diff --git a/.github/workflows/root-cmakelists-msvc.yaml b/.github/workflows/root-cmakelists-msvc.yaml index c68c3dd965..2eb8bc01b3 100644 --- a/.github/workflows/root-cmakelists-msvc.yaml +++ b/.github/workflows/root-cmakelists-msvc.yaml @@ -23,7 +23,7 @@ jobs: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners runs-on: windows-latest - name: msvc (${{ matrix.cc }} ${{ matrix.openmp }} OpenMP ${{ matrix.cuda }} CUDA, ${{ matrix.link }}) + name: msvc (${{ matrix.cc }} ${{ matrix.openmp }} OpenMP, ${{ matrix.link }}) defaults: run: @@ -36,38 +36,23 @@ jobs: matrix: openmp: [with] - cuda: [with] link: [both] cc: [cl] cxx: [cl] include: - openmp: with - cuda: with - link: both - cc: cl - cxx: cl - - openmp: with - cuda: without link: both cc: cl cxx: cl - openmp: without - cuda: without link: both cc: cl cxx: cl - openmp: with - cuda: with - link: static - cc: cl - cxx: cl - - openmp: with - cuda: without link: both cc: clang-cl cxx: clang-cl - openmp: with - cuda: without link: both cc: clang cxx: clang++ @@ -126,7 +111,7 @@ jobs: msystem: UCRT64 - - uses: Jimver/cuda-toolkit@v0.2.18 + - uses: Jimver/cuda-toolkit@v0.2.21 name: install CUDA toolkit if: matrix.cuda == 'with' id: cuda-toolkit diff --git a/ChangeLog b/ChangeLog index 8305e79fa3..ba447de871 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +Mar 3, 2025: version 7.10.0 + + * GraphBLAS v10.0.0: major upgrade, now supporting 32-bit/64-bit integer + indices. Note the SO version change from 9 to 10. GraphBLAS v10 is + upward compatible with v9, but only if the user application is + recompiled. + * Package versions in this release: (* denotes a new version) + SuiteSparse_config 7.10.0 * + AMD 3.3.3 + BTF 2.3.2 + CAMD 3.3.3 + CCOLAMD 3.3.4 + CHOLMOD 5.3.1 + COLAMD 3.3.4 + CSparse 4.3.2 + CXSparse 4.4.1 + Example 1.8.5 * + GraphBLAS 10.0.0 * + KLU 2.3.5 + LDL 3.3.2 + LAGraph 1.1.5 + SuiteSparse_Mongoose 3.3.4 + ParU 1.0.0 + RBio 4.3.4 + SPEX 3.2.3 + SPQR 4.3.4 + UMFPACK 6.3.5 + Feb 20, 2025: version 7.9.0 * GraphBLAS v9.4.5: Added the GxB_IndexBinaryOp. Added new JIT kernels. diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index ea2a3cd2f1..d68b9b58c1 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -53,10 +53,10 @@ message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" ) #------------------------------------------------------------------------------- # cmake inserts the date and version number into Include/my.h: -set ( MY_DATE "Feb 20, 2025" ) +set ( MY_DATE "Mar 1, 2025" ) set ( MY_VERSION_MAJOR 1 ) set ( MY_VERSION_MINOR 8 ) -set ( MY_VERSION_PATCH 4 ) +set ( MY_VERSION_PATCH 5 ) message ( STATUS "Building MY library version: v" ${MY_VERSION_MAJOR}. @@ -87,7 +87,7 @@ project ( my #------------------------------------------------------------------------------- # look for all SuiteSparse packages: -find_package ( SuiteSparse_config 7.9.0 REQUIRED ) +find_package ( SuiteSparse_config 7.10.0 REQUIRED ) find_package ( AMD 3.3.3 REQUIRED ) find_package ( BTF 2.3.2 REQUIRED ) find_package ( CAMD 3.3.3 REQUIRED ) @@ -95,7 +95,7 @@ find_package ( CCOLAMD 3.3.4 REQUIRED ) find_package ( CHOLMOD 5.3.1 REQUIRED ) find_package ( COLAMD 3.3.4 REQUIRED ) find_package ( CXSparse 4.4.1 REQUIRED ) -find_package ( GraphBLAS 9.4.5 ) +find_package ( GraphBLAS 10.0.0 ) find_package ( KLU 2.3.5 REQUIRED ) find_package ( KLU_CHOLMOD 2.3.5 REQUIRED ) find_package ( LDL 3.3.2 REQUIRED ) diff --git a/Example/Include/my_internal.h b/Example/Include/my_internal.h index 8f744fa54c..948b08ac17 100644 --- a/Example/Include/my_internal.h +++ b/Example/Include/my_internal.h @@ -14,8 +14,8 @@ // SuiteSparse include files for C/C++: #include "SuiteSparse_config.h" -#if !defined (SUITESPARSE__VERSION) || SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,9,0) -#error "This library requires SuiteSparse_config 7.9.0 or later" +#if !defined (SUITESPARSE__VERSION) || SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,10,0) +#error "This library requires SuiteSparse_config 7.10.0 or later" #endif #include "amd.h" @@ -56,8 +56,8 @@ #if ! defined (NO_GRAPHBLAS) #include "GraphBLAS.h" #if !defined ( GxB_SUITESPARSE_GRAPHBLAS ) || \ - GxB_IMPLEMENTATION < GxB_VERSION (9,4,5) - #error "This library requires SuiteSparse:GraphBLAS 9.4.5 or later" + GxB_IMPLEMENTATION < GxB_VERSION (10,0,0) + #error "This library requires SuiteSparse:GraphBLAS 10.0.0 or later" #endif #endif diff --git a/GraphBLAS/.gitignore b/GraphBLAS/.gitignore index 1445ddd7b1..a7f90a576e 100644 --- a/GraphBLAS/.gitignore +++ b/GraphBLAS/.gitignore @@ -41,21 +41,7 @@ errlog*.txt fprint.txt log.txt -Demo/bfs_demo.out -Demo/openmp_demo.out -Demo/pagerank_demo.out -Demo/pthread_demo.out -Demo/simple_demo.out -Demo/tri_demo.out -Demo/wildtype_demo.out Demo/*.log -Demo/complex_demo_out.m -Demo/complex_demo_out2.m -Demo/import_demo.out -Demo/gauss_demo1.out -Demo/gauss_demo.out -Demo/t1.out -Demo/t2.out Test/*.log Test/errlog.txt diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 94754a443a..c1efd8bdcc 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -2,7 +2,7 @@ # GraphBLAS/CMakeLists.txt: cmake script for GraphBLAS #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # See the User Guide for details on how to compile SuiteSparse:GraphBLAS. @@ -41,7 +41,7 @@ if ( NOT BUILD_SHARED_LIBS ) endif ( ) # CUDA is under development for now, and not deployed in production: - set ( GRAPHBLAS_USE_CUDA OFF ) + set ( GRAPHBLAS_USE_CUDA OFF ) # turn CUDA off in production # set ( GRAPHBLAS_USE_CUDA ON ) # use this for CUDA development only include ( SuiteSparsePolicy ) @@ -517,14 +517,9 @@ if ( SUITESPARSE_DEMOS ) # Demo programs #--------------------------------------------------------------------------- - add_executable ( openmp_demo "Demo/Program/openmp_demo.c" ) - add_executable ( openmp2_demo "Demo/Program/openmp2_demo.c" ) add_executable ( complex_demo "Demo/Program/complex_demo.c" ) - add_executable ( kron_demo "Demo/Program/kron_demo.c" ) add_executable ( simple_demo "Demo/Program/simple_demo.c" ) add_executable ( wildtype_demo "Demo/Program/wildtype_demo.c" ) - add_executable ( reduce_demo "Demo/Program/reduce_demo.c" ) - add_executable ( import_demo "Demo/Program/import_demo.c" ) add_executable ( wathen_demo "Demo/Program/wathen_demo.c" ) add_executable ( context_demo "Demo/Program/context_demo.c" ) add_executable ( gauss_demo "Demo/Program/gauss_demo.c" ) @@ -532,50 +527,32 @@ if ( SUITESPARSE_DEMOS ) # Libraries required for Demo programs if ( BUILD_SHARED_LIBS ) - target_link_libraries ( openmp_demo PUBLIC GraphBLAS ) - target_link_libraries ( openmp2_demo PUBLIC GraphBLAS ) target_link_libraries ( complex_demo PUBLIC GraphBLAS ) - target_link_libraries ( kron_demo PUBLIC GraphBLAS ) target_link_libraries ( simple_demo PUBLIC GraphBLAS ) target_link_libraries ( wildtype_demo PUBLIC GraphBLAS ) - target_link_libraries ( reduce_demo PUBLIC GraphBLAS ) - target_link_libraries ( import_demo PUBLIC GraphBLAS ) target_link_libraries ( wathen_demo PUBLIC GraphBLAS ) target_link_libraries ( context_demo PUBLIC GraphBLAS ) target_link_libraries ( gauss_demo PUBLIC GraphBLAS ) target_link_libraries ( grow_demo PUBLIC GraphBLAS ) else ( ) - target_link_libraries ( openmp_demo PUBLIC GraphBLAS_static ) - target_link_libraries ( openmp2_demo PUBLIC GraphBLAS_static ) target_link_libraries ( complex_demo PUBLIC GraphBLAS_static ) - target_link_libraries ( kron_demo PUBLIC GraphBLAS_static ) target_link_libraries ( simple_demo PUBLIC GraphBLAS_static ) target_link_libraries ( wildtype_demo PUBLIC GraphBLAS_static ) - target_link_libraries ( reduce_demo PUBLIC GraphBLAS_static ) - target_link_libraries ( import_demo PUBLIC GraphBLAS_static ) target_link_libraries ( wathen_demo PUBLIC GraphBLAS_static ) target_link_libraries ( context_demo PUBLIC GraphBLAS_static ) target_link_libraries ( gauss_demo PUBLIC GraphBLAS_static ) target_link_libraries ( grow_demo PUBLIC GraphBLAS_static ) endif ( ) - target_link_libraries ( openmp_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( openmp2_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( complex_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( kron_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( simple_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( wildtype_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( reduce_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( import_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( wathen_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( context_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( gauss_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( grow_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) if ( GRAPHBLAS_HAS_OPENMP ) - target_link_libraries ( openmp_demo PUBLIC OpenMP::OpenMP_C ) - target_link_libraries ( openmp2_demo PUBLIC OpenMP::OpenMP_C ) - target_link_libraries ( reduce_demo PUBLIC OpenMP::OpenMP_C ) target_link_libraries ( wathen_demo PUBLIC OpenMP::OpenMP_C ) target_link_libraries ( context_demo PUBLIC OpenMP::OpenMP_C ) target_link_libraries ( grow_demo PUBLIC OpenMP::OpenMP_C ) diff --git a/GraphBLAS/CUDA/CMakeLists.txt b/GraphBLAS/CUDA/CMakeLists.txt index b4bbf21a87..2163137b98 100644 --- a/GraphBLAS/CUDA/CMakeLists.txt +++ b/GraphBLAS/CUDA/CMakeLists.txt @@ -2,7 +2,7 @@ # GraphBLAS/CUDA/CMakeLists.txt: cmake script for GraphBLAS/CUDA #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # Some files in this folder are (c) NVIDIA or (c) Google. Please refer # to their individual licenses (Apache, BSD, or others). @@ -16,7 +16,10 @@ project ( GRAPHBLAS_CUDA VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}" LANGUAGES CXX CUDA ) -cmake_policy ( SET CMP0135 NEW ) # URL download timestamp policy +if ( CMAKE_VERSION VERSION_GREATER_EQUAL 3.24 ) + # requires cmake 3.24: + cmake_policy ( SET CMP0135 NEW ) # URL download timestamp policy +endif ( ) set ( CMAKE_CXX_STANDARD 17 ) @@ -49,6 +52,7 @@ target_include_directories ( GraphBLAS_CUDA PRIVATE ../Include ../rmm_wrap ../Source + ../Source/hyper ../Source/builtin ) diff --git a/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in b/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in index befb30bbe6..a04257bf97 100644 --- a/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in +++ b/GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in @@ -1,4 +1,4 @@ -# GraphBLAS_CUDA, Copyright (c) 2017-2024, FIXME +# GraphBLAS_CUDA, Copyright (c) 2017-2025, FIXME # All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in b/GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in index 6db344ffb7..b5249120c2 100644 --- a/GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in +++ b/GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in @@ -4,7 +4,7 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# GraphBLASConfig.cmake, Copyright (c) 2023-2024, FIXME +# GraphBLASConfig.cmake, Copyright (c) 2023-2025, FIXME # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- diff --git a/GraphBLAS/CUDA/GB_cuda.hpp b/GraphBLAS/CUDA/GB_cuda.hpp index b833105393..0653d2d3f7 100644 --- a/GraphBLAS/CUDA/GB_cuda.hpp +++ b/GraphBLAS/CUDA/GB_cuda.hpp @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda.hpp: include file for host CUDA methods (not for JIT) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ extern "C" //------------------------------------------------------------------------------ // for the "which" parameter of GB_cuda_matrix_prefetch: -// FIXME: rename this to GB_WHATEVER_P for GB_cuda_matrix_advise +// FIXME: rename this to GB_WHATEVER_P for GB_cuda_matrix_memadvise #define GB_PREFETCH_P 1 #define GB_PREFETCH_H 2 @@ -64,13 +64,11 @@ GrB_Info GB_cuda_matrix_prefetch ) ; #if 0 -// do we need this function too? -GrB_Info GB_cuda_matrix_advise +// we need this function too: +GrB_Info GB_cuda_matrix_memadvise ( GrB_Matrix A, - p, h, y, b, i, x? 6 bools - what to do: advise (prefer location? access by)? prefetch? nothing? avdice: enum (1 to 6) diff --git a/GraphBLAS/CUDA/GB_cuda_AxB.hpp b/GraphBLAS/CUDA/GB_cuda_AxB.hpp index 12737d882e..3ce055921e 100644 --- a/GraphBLAS/CUDA/GB_cuda_AxB.hpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB.hpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_AxB.hpp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_AxB_dot3.cpp b/GraphBLAS/CUDA/GB_cuda_AxB_dot3.cpp index 39e215024e..9c6974c458 100644 --- a/GraphBLAS/CUDA/GB_cuda_AxB_dot3.cpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB_dot3.cpp @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_AxB_dot3: compute C = A'*B on GPU(s) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,17 +13,21 @@ // and B can have any sparsity format. C is computed as sparse or hypersparse, // with the same format as M. -#define GB_FREE_WORKSPACE \ -{ \ - /* FIXME: use a stream pool instead */ \ - if (stream != nullptr) cudaStreamDestroy (stream) ; \ - stream = nullptr ; \ +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ } -#define GB_FREE_ALL \ -{ \ - GB_FREE_WORKSPACE ; \ - GB_phybix_free (C) ; \ +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORKSPACE ; \ + GB_phybix_free (C) ; \ } #include "GB_cuda_AxB.hpp" @@ -44,15 +48,16 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method ) { - cudaStream_t stream = nullptr ; //-------------------------------------------------------------------------- // create the stream //-------------------------------------------------------------------------- // FIXME: pass in a stream instead, or checkout a stream + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; - GpuTimer kernel_timer; + + GpuTimer kernel_timer; // FIXME: delete this? //-------------------------------------------------------------------------- // check inputs @@ -60,10 +65,10 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method // when CUDA is enabled, no static headers are used in all of GraphBLAS GrB_Info info ; - ASSERT (C != NULL && !(C->static_header)) ; - ASSERT (M != NULL && !(M->static_header)) ; - ASSERT (A != NULL && !(A->static_header)) ; - ASSERT (B != NULL && !(B->static_header)) ; + ASSERT (C != NULL && !(C->header_size == 0)) ; + ASSERT (M != NULL && !(M->header_size == 0)) ; + ASSERT (A != NULL && !(A->header_size == 0)) ; + ASSERT (B != NULL && !(B->header_size == 0)) ; ASSERT_MATRIX_OK (M, "M for dot3 cuda A'*B", GB0) ; ASSERT_MATRIX_OK (A, "A for dot3 cuda A'*B", GB0) ; @@ -98,7 +103,7 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method int number_of_sms = GB_Global_gpu_sm_get (0) ; //-------------------------------------------------------------------------- - // get M, A, and B + // get M //-------------------------------------------------------------------------- const int64_t mvlen = M->vlen ; @@ -107,24 +112,6 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method const int64_t mnvec = M->nvec ; const bool M_is_hyper = GB_IS_HYPERSPARSE( M ) ; - const int64_t anz = GB_nnz (A) ; - const int64_t anvec = A->nvec ; - bool A_is_sparse = GB_IS_SPARSE (A) ; - bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - bool A_is_bitmap = GB_IS_BITMAP (A) ; - bool A_is_full = GB_IS_FULL (A) ; - bool A_is_sparse_or_hyper = A_is_sparse || A_is_hyper ; - bool A_is_bitmap_or_full = A_is_bitmap || A_is_full ; - - const int64_t bnz = GB_nnz (B) ; - const int64_t bnvec = B->nvec ; - bool B_is_sparse = GB_IS_SPARSE (B) ; - bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; - bool B_is_bitmap = GB_IS_BITMAP (B) ; - bool B_is_full = GB_IS_FULL (B) ; - bool B_is_sparse_or_hyper = B_is_sparse || B_is_hyper ; - bool B_is_bitmap_or_full = B_is_bitmap || B_is_full ; - //-------------------------------------------------------------------------- // get the semiring operators //-------------------------------------------------------------------------- @@ -163,10 +150,11 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method } GB_OK (GB_new_bix (&C, // sparse or hyper (from M), existing header - ctype, cvlen, cvdim, GB_Ap_malloc, true, - M_sparsity, false, M->hyper_switch, cnvec, + ctype, cvlen, cvdim, GB_ph_malloc, /* is_csc: */ true, + M_sparsity, /* bitmap_calloc: */ false, M->hyper_switch, cnvec, cnz+1, // add one to cnz for cumsum of Cwork - true, C_iso)) ; + /* numeric: */ true, /* iso: */ C_iso, + /* C pji_is_32: */ M->p_is_32, M->j_is_32, M->i_is_32)) ; //-------------------------------------------------------------------------- // Pre-fetch arrays that will be used on the device @@ -174,14 +162,20 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method // GB_cuda_matrix_advise (C, cnvec, cnz, which, what, device) // advise C - CUDA_OK (cudaMemAdvise (C->p, (cnvec+1) * sizeof ( int64_t), + size_t psize = C->p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = C->j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = C->i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + // FIXME: make this a helper function, something like: + // GB_cuda_matrix_memadvise (C, GB_MEMADVISE_PHIX, device, stream) ; + CUDA_OK (cudaMemAdvise (C->p, (cnvec+1) * psize, cudaMemAdviseSetPreferredLocation, device)) ; if (M_is_hyper) { - CUDA_OK (cudaMemAdvise (C->h, cnvec * sizeof ( int64_t), + CUDA_OK (cudaMemAdvise (C->h, cnvec * jsize, cudaMemAdviseSetPreferredLocation, device)) ; } - CUDA_OK (cudaMemAdvise (C->i, (cnz+1) * sizeof ( int64_t), + CUDA_OK (cudaMemAdvise (C->i, (cnz+1) * isize, cudaMemAdviseSetPreferredLocation, device)) ; if (!C_iso) { @@ -198,17 +192,18 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method //-------------------------------------------------------------------------- // FIXME: use shallow? - CUDA_OK (cudaMemcpyAsync (C->p, M->p, (cnvec+1) * sizeof (int64_t), + CUDA_OK (cudaMemcpyAsync (C->p, M->p, (cnvec+1) * psize, cudaMemcpyDefault, stream)) ; if (M_is_hyper) { - CUDA_OK (cudaMemcpyAsync (C->h, M->h, cnvec * sizeof (int64_t), + CUDA_OK (cudaMemcpyAsync (C->h, M->h, cnvec * jsize, cudaMemcpyDefault, stream)) ; } C->nvals = cnz ; C->magic = GB_MAGIC ; - C->nvec_nonempty = M->nvec_nonempty ; + C->nvec_nonempty = M->nvec_nonempty ; // FIXME + C->nvec = cnvec ; C->jumbled = GB_JUMBLED (M) ; // C is jumbled if M is jumbled GBURBLE ("(GPU C created and copied from M) ") ; @@ -237,20 +232,14 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method // C=A'*B on CUDA, in the JIT //-------------------------------------------------------------------------- -// final call looks like this: -// GB_OK (GB_cuda_AxB_dot3_jit (C, M, Mask_struct, A, B, semiring, flipxy, -// stream, device, number_of_sms)) ; - -// debugging for now, to die early if the CUDA fails to compile, load, or run: - info = GB_cuda_AxB_dot3_jit (C, M, Mask_struct, A, B, semiring, flipxy, - stream, device, number_of_sms) ; - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; + GB_OK (GB_cuda_AxB_dot3_jit (C, M, Mask_struct, A, B, semiring, flipxy, + stream, device, number_of_sms)) ; //-------------------------------------------------------------------------- // free workspace and return result //-------------------------------------------------------------------------- + ASSERT_MATRIX_OK (C, "C result from dot3 cuda A'*B", GB0) ; GB_FREE_WORKSPACE ; return GrB_SUCCESS; } diff --git a/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp index cac90233f2..c2fe1a22b4 100644 --- a/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch.cpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_AxB_dot3_branch: decide to use GPU for dot3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp index 1d82b169d3..2f6f73d235 100644 --- a/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_AxB_dot3_jit.cpp @@ -2,7 +2,7 @@ // GB_cuda_AxB_dot3_jit: reduce a matrix to a scalar, via the CUDA JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,9 +39,10 @@ GrB_Info GB_cuda_AxB_dot3_jit char *suffix ; uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_CUDA_KERNEL_AXB_DOT3, - // FIXME: all C to be iso - /* C->iso: */ false, false, GB_sparsity (C), C->type, - M, Mask_struct, false, semiring, flipxy, A, B) ; + // FIXME: allow C to be iso: + /* C->iso: */ false, /* C_in_iso: */ false, + GB_sparsity (C), C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, /* Mask_comp: */ false, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -60,6 +61,6 @@ GrB_Info GB_cuda_AxB_dot3_jit GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, stream, device, number_of_sms, - &GB_callback, semiring->multiply->theta)) ; + semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_bind1st_jit.cpp b/GraphBLAS/CUDA/GB_cuda_apply_bind1st_jit.cpp index 0ad9c62dbc..ba3a03da24 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_bind1st_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_bind1st_jit.cpp @@ -12,8 +12,8 @@ GrB_Info GB_cuda_apply_bind1st_jit GB_void *Cx, // input: const GrB_Type ctype, - const GrB_BinaryOp op, - const GrB_Matrix A, + const GrB_BinaryOp binaryop, + const GrB_Matrix B, const GB_void *scalarx, // CUDA stream and launch parameters: cudaStream_t stream, @@ -28,9 +28,11 @@ GrB_Info GB_cuda_apply_bind1st_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYBIND1, false, - false, false, GxB_FULL, ctype, NULL, false, false, - op, false, false, NULL, A) ; + GB_JIT_CUDA_KERNEL_APPLYBIND1, /* is_eWiseMult: */ false, + /* C_iso: */ false, /* C_in_iso: */ false, GxB_FULL, ctype, + /* pji is_32: ignored; there is no C matrix: */ false, false, false, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, + binaryop, /* flipij: */ false, /* flipxy: */ false, /* A: */ NULL, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -40,15 +42,14 @@ GrB_Info GB_cuda_apply_bind1st_jit GrB_Info info = GB_jitifyer_load (&dl_function, GB_jit_ewise_family, "cuda_apply_bind1st", hash, &encoding, suffix, NULL, NULL, - (GB_Operator) op, ctype, NULL, A->type) ; - if (info != GrB_SUCCESS) { - return (info) ; - } + (GB_Operator) binaryop, ctype, NULL, B->type) ; + if (info != GrB_SUCCESS) return (info) ; //-------------------------------------------------------------------------- // call the jit kernel and return result //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cx, scalarx, A, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (Cx, scalarx, B, stream, gridsz, blocksz, + &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_bind2nd_jit.cpp b/GraphBLAS/CUDA/GB_cuda_apply_bind2nd_jit.cpp index 9f3725a9b2..d96b4772ad 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_bind2nd_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_bind2nd_jit.cpp @@ -12,7 +12,7 @@ GrB_Info GB_cuda_apply_bind2nd_jit GB_void *Cx, // input: const GrB_Type ctype, - const GrB_BinaryOp op, + const GrB_BinaryOp binaryop, const GrB_Matrix A, const GB_void *scalarx, // CUDA stream and launch parameters: @@ -28,9 +28,11 @@ GrB_Info GB_cuda_apply_bind2nd_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYBIND2, false, - false, false, GxB_FULL, ctype, NULL, false, false, - op, false, false, A, NULL) ; + GB_JIT_CUDA_KERNEL_APPLYBIND2, /* is_eWiseMult: */ false, + /* C_iso: */ false, /* C_in_iso: */ false, GxB_FULL, ctype, + /* pji is_32: ignored; there is no C matrix: */ false, false, false, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, + binaryop, /* flipij: */ false, /* flipxy: */ false, A, /* B: */ NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -40,15 +42,14 @@ GrB_Info GB_cuda_apply_bind2nd_jit GrB_Info info = GB_jitifyer_load (&dl_function, GB_jit_ewise_family, "cuda_apply_bind2nd", hash, &encoding, suffix, NULL, NULL, - (GB_Operator) op, ctype, A->type, NULL) ; - if (info != GrB_SUCCESS){ - return (info) ; - } + (GB_Operator) binaryop, ctype, A->type, NULL) ; + if (info != GrB_SUCCESS) return (info) ; //-------------------------------------------------------------------------- // call the jit kernel and return result //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cx, A, scalarx, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (Cx, A, scalarx, stream, gridsz, blocksz, + &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_binop.cpp b/GraphBLAS/CUDA/GB_cuda_apply_binop.cpp index 7fea1ccae0..603b06bad4 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_binop.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_binop.cpp @@ -1,13 +1,19 @@ #include "GB_cuda_apply.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE \ -{ \ - GB_FREE_WORK (&scalarx_cuda, scalarx_cuda_size) ; \ +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_MEMORY (&scalarx_cuda, scalarx_cuda_size) ; \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ } -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE #define BLOCK_SIZE 512 #define LOG2_BLOCK_SIZE 9 @@ -22,29 +28,35 @@ GrB_Info GB_cuda_apply_binop const bool bind1st ) { - ASSERT (scalarx != NULL) ; - // make a copy of scalarx to ensure it's not on the CPU stack + GrB_Info info ; GB_void *scalarx_cuda = NULL ; size_t scalarx_cuda_size = 0 ; + + // FIXME: use the stream pool + cudaStream_t stream = nullptr ; + CUDA_OK (cudaStreamCreate (&stream)) ; + + ASSERT (scalarx != NULL) ; + // make a copy of scalarx to ensure it's not on the CPU stack + if (bind1st) { ASSERT (op->xtype != NULL) ; - scalarx_cuda = GB_MALLOC_WORK (op->xtype->size, GB_void, &scalarx_cuda_size) ; + scalarx_cuda = (GB_void *) GB_MALLOC_MEMORY (1, op->xtype->size, + &scalarx_cuda_size) ; } else { ASSERT (op->ytype != NULL) ; - scalarx_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, &scalarx_cuda_size) ; + scalarx_cuda = (GB_void *) GB_MALLOC_MEMORY (1, op->ytype->size, + &scalarx_cuda_size) ; } if (scalarx_cuda == NULL) { + GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } memcpy (scalarx_cuda, scalarx, scalarx_cuda_size) ; - - // FIXME: use the stream pool - cudaStream_t stream ; - CUDA_OK (cudaStreamCreate (&stream)) ; GrB_Index anz = GB_nnz_held (A) ; @@ -52,23 +64,18 @@ GrB_Info GB_cuda_apply_binop int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; // cap #of blocks to 256 * #of sms int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; - - GrB_Info info ; - if (bind1st) { - info = GB_cuda_apply_bind1st_jit (Cx, ctype, op, A, - scalarx_cuda, stream, gridsz, BLOCK_SIZE) ; - } else { - info = GB_cuda_apply_bind2nd_jit (Cx, ctype, op, A, - scalarx_cuda, stream, gridsz, BLOCK_SIZE) ; - } - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; - - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; + if (bind1st) + { + GB_OK (GB_cuda_apply_bind1st_jit (Cx, ctype, op, A, + scalarx_cuda, stream, gridsz, BLOCK_SIZE)) ; + } + else + { + GB_OK (GB_cuda_apply_bind2nd_jit (Cx, ctype, op, A, + scalarx_cuda, stream, gridsz, BLOCK_SIZE)) ; + } GB_FREE_WORKSPACE ; return GrB_SUCCESS ; - } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_binop_branch.cpp b/GraphBLAS/CUDA/GB_cuda_apply_binop_branch.cpp index 874eaf0f17..bd76b4f0d5 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_binop_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_binop_branch.cpp @@ -12,7 +12,7 @@ bool GB_cuda_apply_binop_branch return false ; } - if (A->static_header) + if (A->header_size == 0) { return false ; } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_unop.cpp b/GraphBLAS/CUDA/GB_cuda_apply_unop.cpp index 60f449aa52..d4994e07eb 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_unop.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_unop.cpp @@ -1,13 +1,19 @@ #include "GB_cuda_apply.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE \ -{ \ - GB_FREE_WORK (&ythunk_cuda, ythunk_cuda_size) ; \ +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_MEMORY (&ythunk_cuda, ythunk_cuda_size) ; \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ } -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE #define BLOCK_SIZE 512 #define LOG2_BLOCK_SIZE 9 @@ -23,41 +29,39 @@ GrB_Info GB_cuda_apply_unop ) { + GrB_Info info ; GB_void *ythunk_cuda = NULL ; size_t ythunk_cuda_size = 0 ; + + // FIXME: use the stream pool + cudaStream_t stream = nullptr ; + CUDA_OK (cudaStreamCreate (&stream)) ; + + // FIXME: make this a CUDA helper function if (ythunk != NULL && op != NULL && op->ytype != NULL) { // make a copy of ythunk, since ythunk might be allocated on // the CPU stack and thus not accessible to the CUDA kernel. - ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, &ythunk_cuda_size) ; + ythunk_cuda = (GB_void *) GB_MALLOC_MEMORY (1, op->ytype->size, + &ythunk_cuda_size) ; if (ythunk_cuda == NULL) { + GB_FREE_WORKSPACE ; return (GrB_OUT_OF_MEMORY) ; } memcpy (ythunk_cuda, ythunk, op->ytype->size) ; } - // FIXME: use the stream pool - cudaStream_t stream ; - CUDA_OK (cudaStreamCreate (&stream)) ; - GrB_Index anz = GB_nnz_held (A) ; int32_t number_of_sms = GB_Global_gpu_sm_get (0) ; int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; // cap #of blocks to 256 * #of sms int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; - - GrB_Info info = GB_cuda_apply_unop_jit (Cx, ctype, op, flipij, A, - ythunk_cuda, stream, gridsz, BLOCK_SIZE) ; - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; - - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; + GB_OK (GB_cuda_apply_unop_jit (Cx, ctype, op, flipij, A, + ythunk_cuda, stream, gridsz, BLOCK_SIZE)) ; GB_FREE_WORKSPACE ; - return GrB_SUCCESS ; - + return GrB_SUCCESS ; } diff --git a/GraphBLAS/CUDA/GB_cuda_apply_unop_branch.cpp b/GraphBLAS/CUDA/GB_cuda_apply_unop_branch.cpp index f9b1267073..ae950d8c51 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_unop_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_unop_branch.cpp @@ -12,7 +12,7 @@ bool GB_cuda_apply_unop_branch return false ; } - if (A->static_header) + if (A->header_size == 0) { return false ; } @@ -35,4 +35,4 @@ bool GB_cuda_apply_unop_branch ok = ok && (op->hash != UINT64_MAX) ; return ok ; -} \ No newline at end of file +} diff --git a/GraphBLAS/CUDA/GB_cuda_apply_unop_jit.cpp b/GraphBLAS/CUDA/GB_cuda_apply_unop_jit.cpp index afe1fb6bf6..fccbf6746f 100644 --- a/GraphBLAS/CUDA/GB_cuda_apply_unop_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_apply_unop_jit.cpp @@ -29,8 +29,11 @@ GrB_Info GB_cuda_apply_unop_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_CUDA_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, + /* pji_is_32: ignored; no matrix C: */ false, false, false, + op, flipij, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, + A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -48,5 +51,6 @@ GrB_Info GB_cuda_apply_unop_jit //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cx, A, ythunk, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (Cx, A, ythunk, stream, gridsz, blocksz, + &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_colscale.cpp b/GraphBLAS/CUDA/GB_cuda_colscale.cpp index c9e561e5b7..21dac41016 100644 --- a/GraphBLAS/CUDA/GB_cuda_colscale.cpp +++ b/GraphBLAS/CUDA/GB_cuda_colscale.cpp @@ -1,10 +1,18 @@ #include "GB_cuda_ewise.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE ; +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ +} -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE #define BLOCK_SIZE 128 #define LOG2_BLOCK_SIZE 7 @@ -18,8 +26,9 @@ GrB_Info GB_cuda_colscale const bool flipxy ) { + GrB_Info info ; // FIXME: use the stream pool - cudaStream_t stream ; + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; // compute gridsz, blocksz, call GB_cuda_rowscale_jit @@ -27,14 +36,10 @@ GrB_Info GB_cuda_colscale int32_t gridsz = 1 + (anz >> LOG2_BLOCK_SIZE) ; - GrB_Info info = GB_cuda_colscale_jit ( C, A, D, - semiring->multiply, flipxy, stream, gridsz, BLOCK_SIZE) ; + GB_OK (GB_cuda_colscale_jit ( C, A, D, + semiring->multiply, flipxy, stream, gridsz, BLOCK_SIZE)) ; - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; - - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; + GB_FREE_WORKSPACE ; return GrB_SUCCESS ; } diff --git a/GraphBLAS/CUDA/GB_cuda_colscale_branch.cpp b/GraphBLAS/CUDA/GB_cuda_colscale_branch.cpp index 5c6c4ccd9b..dc969e370c 100644 --- a/GraphBLAS/CUDA/GB_cuda_colscale_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_colscale_branch.cpp @@ -8,11 +8,11 @@ bool GB_cuda_colscale_branch const bool flipxy ) { - if (A->static_header) + if (A->header_size == 0) { return false ; } - if (D->static_header) + if (D->header_size == 0) { return false ; } diff --git a/GraphBLAS/CUDA/GB_cuda_colscale_jit.cpp b/GraphBLAS/CUDA/GB_cuda_colscale_jit.cpp index 702af2cfa4..31547d7892 100644 --- a/GraphBLAS/CUDA/GB_cuda_colscale_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_colscale_jit.cpp @@ -29,7 +29,9 @@ GrB_Info GB_cuda_colscale_jit char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_CUDA_KERNEL_COLSCALE, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, + /* C_iso: */ false, /* C_in_iso: */ false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, binaryop, false, flipxy, A, D) ; //-------------------------------------------------------------------------- @@ -48,5 +50,5 @@ GrB_Info GB_cuda_colscale_jit //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, D, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (C, A, D, stream, gridsz, blocksz, &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_get_device_count.cu b/GraphBLAS/CUDA/GB_cuda_get_device_count.cu index fbb2998ae1..3b44c2a1d9 100644 --- a/GraphBLAS/CUDA/GB_cuda_get_device_count.cu +++ b/GraphBLAS/CUDA/GB_cuda_get_device_count.cu @@ -2,12 +2,14 @@ // GraphBLAS/CUDA/GB_cuda_get_device_count.cu: find out how many GPUs exist //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// FIXME: remove printf + #include "GB_cuda.hpp" bool GB_cuda_get_device_count // true if OK, false if failure diff --git a/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu b/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu index daaac9a214..4fd1909651 100644 --- a/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu +++ b/GraphBLAS/CUDA/GB_cuda_get_device_properties.cu @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_get_device_properties: get the properties of a GPU //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_init.c b/GraphBLAS/CUDA/GB_cuda_init.c index 25fcc625da..32908ff68e 100644 --- a/GraphBLAS/CUDA/GB_cuda_init.c +++ b/GraphBLAS/CUDA/GB_cuda_init.c @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_init: initialize the GPUs for use by GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,8 @@ // assumed. Then each GPU is "warmed up" by allocating a small amount of // memory. +// FIXME: remove printfs + #include "GB.h" GrB_Info GB_cuda_init (void) @@ -22,16 +24,17 @@ GrB_Info GB_cuda_init (void) if (!GB_Global_gpu_count_set (true)) { printf ("GB_cuda_init line %d\n", __LINE__) ; - return (GrB_PANIC) ; + return (GxB_GPU_ERROR) ; } int gpu_count = GB_Global_gpu_count_get ( ) ; - for (int device = 0 ; device < 1 ; device++) // TODO for GPU: gpu_count + printf ("GB_cuda_init: ngpus: %d\n", gpu_count) ; + for (int device = 0 ; device < gpu_count ; device++) { // query the GPU and then warm it up if (!GB_Global_gpu_device_properties_get (device)) { printf ("GB_cuda_init line %d\n", __LINE__) ; - return (GrB_PANIC) ; + return (GxB_GPU_ERROR) ; } } @@ -50,17 +53,18 @@ GrB_Info GB_cuda_init (void) } // warm up the GPUs - for (int device = 0 ; device < 1 ; device++) // TODO for GPU: gpu_count + for (int device = 0 ; device < gpu_count ; device++) { if (!GB_cuda_warmup (device)) { printf ("GB_cuda_init line %d\n", __LINE__) ; - return (GrB_PANIC) ; + return (GxB_GPU_ERROR) ; } } - GB_cuda_set_device (0) ; // make GPU 0 the default device - GB_Context_gpu_id_set (NULL, 0) ; // set GxB_CONTEXT_WORLD->gpu_id to 0 + // FIXME: default device set to 1 to avoid hardware failure ... + GB_cuda_set_device (0) ; // make GPU 1 the default device + GB_Context_gpu_id_set (NULL, 0) ; // set GxB_CONTEXT_WORLD->gpu_id to 1 // also check for jit cache, pre-load library of common kernels ... return (GrB_SUCCESS) ; diff --git a/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp b/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp index d3e5710c33..8fa6328edf 100644 --- a/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_matrix_prefetch.cpp @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_matrix_prefetch: prefetch a matrix to a GPU or the CPU //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,15 +24,19 @@ GrB_Info GB_cuda_matrix_prefetch const int64_t anvec = A->nvec ; const int64_t anz = GB_nnz_held (A) ; + size_t psize = A->p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = A->j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = A->i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + if (A->p != NULL && (which & GB_PREFETCH_P)) { - CUDA_OK (cudaMemPrefetchAsync (A->p, (anvec+1) * sizeof (int64_t), + CUDA_OK (cudaMemPrefetchAsync (A->p, (anvec+1) * psize, device, stream)) ; } if (A->h != NULL && (which & GB_PREFETCH_H)) { - CUDA_OK (cudaMemPrefetchAsync (A->h, anvec * sizeof (int64_t), + CUDA_OK (cudaMemPrefetchAsync (A->h, anvec * jsize, device, stream)) ; } @@ -51,7 +55,7 @@ GrB_Info GB_cuda_matrix_prefetch if (A->i != NULL && (which & GB_PREFETCH_I)) { - CUDA_OK (cudaMemPrefetchAsync (A->i, anz * sizeof (int64_t), + CUDA_OK (cudaMemPrefetchAsync (A->i, anz * isize, device, stream)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_reduce.hpp b/GraphBLAS/CUDA/GB_cuda_reduce.hpp index 3dfe07372f..6cda4c3359 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce.hpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce.hpp @@ -2,7 +2,7 @@ // GB_cuda_reduce.hpp: CPU definitions for CUDA reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar.cpp b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar.cpp index e4192fb4bd..a1f24a8f50 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar.cpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar.cpp @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_reduce_to_scalar: reduce on the GPU with semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,12 +15,22 @@ // threadblock. Then GB_reduce_to_scalar on the CPU sees this V as the result, // and calls itself recursively to continue the reduction. +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_MEMORY (&zscalar, zscalar_size) ; \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ +} + #define GB_FREE_ALL \ { \ - GB_FREE_WORK (&zscalar, zscalar_size) ; \ + GB_FREE_WORKSPACE ; \ GB_Matrix_free (&V) ; \ - if (stream != nullptr) cudaStreamDestroy (stream) ; \ - stream = nullptr ; \ } #include "GB_cuda_reduce.hpp" @@ -47,13 +57,13 @@ GrB_Info GB_cuda_reduce_to_scalar GrB_Matrix V = NULL ; (*V_handle) = NULL ; GrB_Info info = GrB_SUCCESS ; - cudaStream_t stream = nullptr ; //-------------------------------------------------------------------------- // create the stream //-------------------------------------------------------------------------- // FIXME: use the stream pool + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; //-------------------------------------------------------------------------- @@ -90,7 +100,8 @@ GrB_Info GB_cuda_reduce_to_scalar // the kernel launch can reduce A to zscalar all by itself // allocate and initialize zscalar (upscaling it to at least 32 bits) size_t zscalar_space = GB_IMAX (zsize, sizeof (uint32_t)) ; - zscalar = GB_MALLOC (zscalar_space, GB_void, &zscalar_size) ; + zscalar = (GB_void *) GB_MALLOC_MEMORY (1, zscalar_space, + &zscalar_size) ; if (zscalar == NULL) { // out of memory @@ -104,8 +115,11 @@ GrB_Info GB_cuda_reduce_to_scalar // allocate a full GrB_Matrix V for the partial result, of size // gridsz-by-1, and of type ztype. V is allocated but not // initialized. - GB_OK (GB_new_bix (&V, ztype, gridsz, 1, GB_Ap_null, - true, GxB_FULL, false, 0, -1, gridsz, true, false)) ; + GB_OK (GB_new_bix (&V, ztype, gridsz, 1, GB_ph_null, + /* is_csc: */ true, /* sparsity: */ GxB_FULL, + /* bitmap_calloc: */ false, /* hyper_switch: */ 0, + /* plen: */ -1, /* nzmax: */ gridsz, /* numeric: */ true, + /* iso: */ false, /* pji_is_32: */ false, false, false)) ; } GBURBLE ("(cuda reduce launch %d threads in %d blocks)", @@ -115,15 +129,8 @@ GrB_Info GB_cuda_reduce_to_scalar // reduce C to a scalar via the CUDA JIT //-------------------------------------------------------------------------- -// final call looks like this: -// GB_OK (GB_cuda_reduce_to_scalar_jit (zscalar, V, monoid, A, -// stream, gridsz, blocksz)) ; - -// debugging for now, to die early if the CUDA fails to compile, load, or run: - info = (GB_cuda_reduce_to_scalar_jit (zscalar, V, monoid, A, + GB_OK (GB_cuda_reduce_to_scalar_jit (zscalar, V, monoid, A, stream, gridsz, blocksz)) ; - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; //-------------------------------------------------------------------------- // return result and destroy the stream @@ -136,7 +143,6 @@ GrB_Info GB_cuda_reduce_to_scalar // return the scalar result // s = zscalar (but only the first zsize bytes of it) memcpy (s, zscalar, zsize) ; - GB_FREE_WORK (&zscalar, zscalar_size) ; } else { @@ -144,7 +150,7 @@ GrB_Info GB_cuda_reduce_to_scalar (*V_handle) = V ; } - CUDA_OK (cudaStreamDestroy (stream)) ; + GB_FREE_WORKSPACE ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp index 353201b65b..a838179a4c 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch.cpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_branch: decide to use GPU for reduce //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp index cc8603c708..2b55cfcf12 100644 --- a/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_reduce_to_scalar_jit.cpp @@ -2,7 +2,7 @@ // GB_cuda_reduce_to_scalar_jit: reduce a matrix to a scalar, via the CUDA JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -57,6 +57,6 @@ GrB_Info GB_cuda_reduce_to_scalar_jit // z = reduce_to_scalar (A) via CUDA JIT //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (z, V, A, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (z, V, A, stream, gridsz, blocksz, &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_rowscale.cpp b/GraphBLAS/CUDA/GB_cuda_rowscale.cpp index 3951bd1491..2ac773429f 100644 --- a/GraphBLAS/CUDA/GB_cuda_rowscale.cpp +++ b/GraphBLAS/CUDA/GB_cuda_rowscale.cpp @@ -1,10 +1,18 @@ #include "GB_cuda_ewise.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE ; +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ +} -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE #define BLOCK_SIZE 128 #define LOG2_BLOCK_SIZE 7 @@ -18,23 +26,20 @@ GrB_Info GB_cuda_rowscale const bool flipxy ) { + GrB_Info info ; // FIXME: use the stream pool - cudaStream_t stream ; + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; // compute gridsz, blocksz, call GB_cuda_rowscale_jit GrB_Index bnz = GB_nnz_held (B) ; - - int32_t gridsz = 1 + (bnz >> LOG2_BLOCK_SIZE) ; - GrB_Info info = GB_cuda_rowscale_jit ( C, D, B, - semiring->multiply, flipxy, stream, gridsz, BLOCK_SIZE) ; - - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; + int32_t gridsz = 1 + (bnz >> LOG2_BLOCK_SIZE) ; - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; - return GrB_SUCCESS ; + GB_OK (GB_cuda_rowscale_jit ( C, D, B, + semiring->multiply, flipxy, stream, gridsz, BLOCK_SIZE)) ; + GB_FREE_WORKSPACE ; + return GrB_SUCCESS ; } + diff --git a/GraphBLAS/CUDA/GB_cuda_rowscale_branch.cpp b/GraphBLAS/CUDA/GB_cuda_rowscale_branch.cpp index 85aadc6c17..bc069b370f 100644 --- a/GraphBLAS/CUDA/GB_cuda_rowscale_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_rowscale_branch.cpp @@ -8,16 +8,16 @@ bool GB_cuda_rowscale_branch const bool flipxy ) { - if (D->static_header) + if (D->header_size == 0) { return false ; } - if (B->static_header) + if (B->header_size == 0) { return false ; } - if (!GB_cuda_type_branch (D->type) || + if (!GB_cuda_type_branch (D->type) || !GB_cuda_type_branch (B->type) || !GB_cuda_type_branch (semiring->multiply->ztype)) { diff --git a/GraphBLAS/CUDA/GB_cuda_rowscale_jit.cpp b/GraphBLAS/CUDA/GB_cuda_rowscale_jit.cpp index a6ecf87b74..0ad2806c22 100644 --- a/GraphBLAS/CUDA/GB_cuda_rowscale_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_rowscale_jit.cpp @@ -29,7 +29,9 @@ GrB_Info GB_cuda_rowscale_jit char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_CUDA_KERNEL_ROWSCALE, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, + /* C_iso: */ false, /* C_in_iso: */ false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, binaryop, false, flipxy, D, B) ; //-------------------------------------------------------------------------- @@ -48,5 +50,5 @@ GrB_Info GB_cuda_rowscale_jit //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, D, B, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (C, D, B, stream, gridsz, blocksz, &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_select.hpp b/GraphBLAS/CUDA/GB_cuda_select.hpp index fc55b305c4..2b55ae6638 100644 --- a/GraphBLAS/CUDA/GB_cuda_select.hpp +++ b/GraphBLAS/CUDA/GB_cuda_select.hpp @@ -10,14 +10,13 @@ #define GB_CUDA_SELECT_H #include "GB_cuda.hpp" +#include "select/GB_select_iso.h" GrB_Info GB_cuda_select_bitmap_jit ( - // output: - int8_t *Cb, - uint64_t *cnvals, + // input/output: + GrB_Matrix C, // input: - const bool C_iso, const GrB_Matrix A, const bool flipij, const GB_void *ythunk, @@ -33,11 +32,10 @@ GrB_Info GB_cuda_select_sparse_jit // output: GrB_Matrix C, // input: - const bool C_iso, - const GrB_IndexUnaryOp op, - const bool flipij, const GrB_Matrix A, + const bool flipij, const GB_void *ythunk, + const GrB_IndexUnaryOp op, // CUDA stream and launch parameters: cudaStream_t stream, int32_t gridsz, diff --git a/GraphBLAS/CUDA/GB_cuda_select_bitmap.cpp b/GraphBLAS/CUDA/GB_cuda_select_bitmap.cpp index 65b3ed034d..34f7892014 100644 --- a/GraphBLAS/CUDA/GB_cuda_select_bitmap.cpp +++ b/GraphBLAS/CUDA/GB_cuda_select_bitmap.cpp @@ -1,49 +1,35 @@ #include "GB_cuda_select.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE \ -{ \ - GB_FREE_WORK (&ythunk_cuda, ythunk_cuda_size) ; \ - GB_FREE_WORK (&cnvals_cuda, cnvals_cuda_size) ; \ +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ } -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE #define BLOCK_SIZE 512 #define LOG2_BLOCK_SIZE 9 GrB_Info GB_cuda_select_bitmap ( - int8_t *Cb, - int64_t *cnvals, - const bool C_iso, + GrB_Matrix C, const GrB_Matrix A, const bool flipij, const GB_void *ythunk, const GrB_IndexUnaryOp op ) { - ASSERT (cnvals != NULL) ; - ASSERT (Cb != NULL) ; + GrB_Info info ; - GB_void *ythunk_cuda = NULL ; - size_t ythunk_cuda_size = 0 ; - if (ythunk != NULL && op != NULL && op->ytype != NULL) - { - // make a copy of ythunk, since ythunk might be allocated on - // the CPU stack and thus not accessible to the CUDA kernel. - ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, - &ythunk_cuda_size) ; - - if (ythunk_cuda == NULL) - { - return (GrB_OUT_OF_MEMORY) ; - } - memcpy (ythunk_cuda, ythunk, op->ytype->size) ; - } // FIXME: use the stream pool - cudaStream_t stream ; + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; GrB_Index anz = GB_nnz_held (A) ; @@ -51,31 +37,10 @@ GrB_Info GB_cuda_select_bitmap int32_t number_of_sms = GB_Global_gpu_sm_get (0) ; int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; - - // create a separate cnvals_result for CUDA since cnvals may be on - // the CPU stack - int64_t *cnvals_cuda ; - size_t cnvals_cuda_size ; - cnvals_cuda = GB_MALLOC_WORK (1, int64_t, &cnvals_cuda_size) ; - if (cnvals_cuda == NULL) - { - return (GrB_OUT_OF_MEMORY) ; - } - (*cnvals_cuda) = 0 ; - - GrB_Info info = GrB_NO_VALUE ; - info = GB_cuda_select_bitmap_jit (Cb, (uint64_t *) cnvals_cuda, C_iso, A, - flipij, ythunk_cuda, op, stream, gridsz, BLOCK_SIZE) ; - - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; - - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; - memcpy (cnvals, cnvals_cuda, sizeof(int64_t)) ; + GB_OK (GB_cuda_select_bitmap_jit (C, A, + flipij, ythunk, op, stream, gridsz, BLOCK_SIZE)) ; GB_FREE_WORKSPACE ; - return GrB_SUCCESS ; - + return GrB_SUCCESS ; } diff --git a/GraphBLAS/CUDA/GB_cuda_select_bitmap_jit.cpp b/GraphBLAS/CUDA/GB_cuda_select_bitmap_jit.cpp index 7d55d89061..48fb026213 100644 --- a/GraphBLAS/CUDA/GB_cuda_select_bitmap_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_select_bitmap_jit.cpp @@ -7,11 +7,9 @@ extern "C" GrB_Info GB_cuda_select_bitmap_jit ( - // output: - int8_t *Cb, - uint64_t *cnvals, + // input/output: + GrB_Matrix C, // input: - const bool C_iso, const GrB_Matrix A, const bool flipij, const GB_void *ythunk, @@ -30,7 +28,7 @@ GrB_Info GB_cuda_select_bitmap_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_select (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_SELECT_BITMAP, C_iso, false, op, flipij, A) ; + GB_JIT_CUDA_KERNEL_SELECT_BITMAP, C, op, flipij, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -48,5 +46,6 @@ GrB_Info GB_cuda_select_bitmap_jit //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cb, cnvals, A, ythunk, stream, gridsz, blocksz)) ; + return (GB_jit_kernel (C, A, ythunk, stream, gridsz, blocksz, + &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_select_branch.cpp b/GraphBLAS/CUDA/GB_cuda_select_branch.cpp index 516715f42f..e7655927be 100644 --- a/GraphBLAS/CUDA/GB_cuda_select_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_select_branch.cpp @@ -9,9 +9,9 @@ bool GB_cuda_select_branch ASSERT (A != NULL && op != NULL) ; - if (A->static_header) + if (A->header_size == 0) { - // see Source/matrix/GB_static_header.h for details. If A has a + // see Source/matrix/GB_clear_matrix_header.h for details. If A has a // static header, it cannot be done on the GPU. However, if GraphBLAS // is compiled to use CUDA, there should be no static headers anyway, // so this is likely dead code. Just a sanity check. diff --git a/GraphBLAS/CUDA/GB_cuda_select_sparse.cpp b/GraphBLAS/CUDA/GB_cuda_select_sparse.cpp index 2648b15b9c..e1bb79023f 100644 --- a/GraphBLAS/CUDA/GB_cuda_select_sparse.cpp +++ b/GraphBLAS/CUDA/GB_cuda_select_sparse.cpp @@ -1,13 +1,23 @@ + #include "GB_cuda_select.hpp" -#undef GB_FREE_WORKSPACE -#define GB_FREE_WORKSPACE \ -{ \ - GB_FREE_WORK (&ythunk_cuda, ythunk_cuda_size) ; \ +#undef GB_FREE_WORKSPACE +#define GB_FREE_WORKSPACE \ +{ \ + if (stream != nullptr) \ + { \ + cudaStreamSynchronize (stream) ; \ + cudaStreamDestroy (stream) ; \ + } \ + stream = nullptr ; \ } -#undef GB_FREE_ALL -#define GB_FREE_ALL ; +#undef GB_FREE_ALL +#define GB_FREE_ALL \ +{ \ + GB_phybix_free (C) ; \ + GB_FREE_WORKSPACE ; \ +} #define BLOCK_SIZE 512 #define LOG2_BLOCK_SIZE 9 @@ -19,35 +29,19 @@ GrB_Info GB_cuda_select_sparse const GrB_IndexUnaryOp op, const bool flipij, const GrB_Matrix A, - const GB_void *ythunk + const GB_void *athunk, + const GB_void *ythunk, + GB_Werk Werk ) { - // in progress - return (GrB_NOT_IMPLEMENTED) ; - -#if 0 // check inputs - ASSERT (C != NULL && !(C->static_header)) ; - ASSERT (A != NULL && !(A->static_header)) ; + GrB_Info info = GrB_NO_VALUE ; + ASSERT (C != NULL && !(C->header_size == 0)) ; + ASSERT (A != NULL && !(A->header_size == 0)) ; - GB_void *ythunk_cuda = NULL ; - size_t ythunk_cuda_size = 0 ; - if (ythunk != NULL && op != NULL && op->ytype != NULL) - { - // make a copy of ythunk, since ythunk might be allocated on - // the CPU stack and thus not accessible to the CUDA kernel. - ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, - &ythunk_cuda_size) ; - - if (ythunk_cuda == NULL) - { - return (GrB_OUT_OF_MEMORY) ; - } - memcpy (ythunk_cuda, ythunk, op->ytype->size) ; - } // FIXME: use the stream pool - cudaStream_t stream ; + cudaStream_t stream = nullptr ; CUDA_OK (cudaStreamCreate (&stream)) ; GrB_Index anz = GB_nnz_held (A) ; @@ -55,18 +49,46 @@ GrB_Info GB_cuda_select_sparse int32_t number_of_sms = GB_Global_gpu_sm_get (0) ; int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; + gridsz = std::max (gridsz, 1) ; - GrB_Info info = GrB_NO_VALUE ; + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + int csparsity = GxB_HYPERSPARSE ; + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + csparsity, anz, A->vlen, A->vdim, Werk) ; + + // Initialize C to be a user-returnable hypersparse empty matrix. + // If needed, we handle the hyper->sparse conversion below. + + GB_OK (GB_new (&C, // sparse or hyper (from A), existing header + A->type, A->vlen, A->vdim, GB_ph_calloc, A->is_csc, + csparsity, A->hyper_switch, /* C->plen: revised later: */ 1, + Cp_is_32, Cj_is_32, Ci_is_32)) ; - info = GB_cuda_select_sparse_jit (C, C_iso, A, - flipij, ythunk_cuda, op, stream, gridsz, BLOCK_SIZE) ; - if (info == GrB_NO_VALUE) info = GrB_PANIC ; - GB_OK (info) ; + C->jumbled = A->jumbled ; + C->iso = C_iso ; - CUDA_OK (cudaStreamSynchronize (stream)) ; - CUDA_OK (cudaStreamDestroy (stream)) ; + GB_OK (GB_cuda_select_sparse_jit (C, A, + flipij, ythunk, op, stream, gridsz, BLOCK_SIZE)) ; GB_FREE_WORKSPACE ; - return info ; -#endif + + ASSERT (C->x != NULL) ; + + if (C_iso) + { + // If C is iso, initialize the iso entry + GB_select_iso ((GB_void *) C->x, op->opcode, athunk, + (GB_void *) A->x, A->type->size) ; + } + + if (C->nvec == C->vdim) + { + // C hypersparse with all vectors present; quick convert to sparse + GB_FREE_MEMORY (&(C->h), C->h_size) ; + } + + ASSERT_MATRIX_OK (C, "C output of cuda_select_sparse", GB0) ; + return GrB_SUCCESS ; } + diff --git a/GraphBLAS/CUDA/GB_cuda_select_sparse_jit.cpp b/GraphBLAS/CUDA/GB_cuda_select_sparse_jit.cpp index c8bb3e3737..f453dcbce6 100644 --- a/GraphBLAS/CUDA/GB_cuda_select_sparse_jit.cpp +++ b/GraphBLAS/CUDA/GB_cuda_select_sparse_jit.cpp @@ -10,7 +10,6 @@ GrB_Info GB_cuda_select_sparse_jit // output: GrB_Matrix C, // input: - const bool C_iso, const GrB_Matrix A, const bool flipij, const GB_void *ythunk, @@ -20,11 +19,7 @@ GrB_Info GB_cuda_select_sparse_jit int32_t gridsz, int32_t blocksz ) -{ - // in progress - return (GrB_NO_VALUE) ; - -#if 0 +{ //-------------------------------------------------------------------------- // encodify the problem @@ -33,7 +28,7 @@ GrB_Info GB_cuda_select_sparse_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_select (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_SELECT_SPARSE, C_iso, false, op, flipij, A) ; + GB_JIT_CUDA_KERNEL_SELECT_SPARSE, C, op, flipij, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,6 +46,6 @@ GrB_Info GB_cuda_select_sparse_jit //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, ythunk, stream, gridsz, blocksz)) ; -#endif + return (GB_jit_kernel (C, A, ythunk, stream, gridsz, blocksz, + &GB_callback)) ; } diff --git a/GraphBLAS/CUDA/GB_cuda_type_branch.cpp b/GraphBLAS/CUDA/GB_cuda_type_branch.cpp index 2bebebc800..d7c405d080 100644 --- a/GraphBLAS/CUDA/GB_cuda_type_branch.cpp +++ b/GraphBLAS/CUDA/GB_cuda_type_branch.cpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_type_branch: decide if GPU can be used on a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp b/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp index df477444cb..4b3a7051a3 100644 --- a/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp +++ b/GraphBLAS/CUDA/GB_cuda_upscale_identity.cpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_upscale_identity: return identity, >= 16 bits in size //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/GB_cuda_warmup.cu b/GraphBLAS/CUDA/GB_cuda_warmup.cu index 8a7322b9f6..269bf91755 100644 --- a/GraphBLAS/CUDA/GB_cuda_warmup.cu +++ b/GraphBLAS/CUDA/GB_cuda_warmup.cu @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/GB_cuda_warmup.cu: warmup the GPU //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ bool GB_cuda_warmup (int device) { - + printf ("cuda warmup %d\n", device) ; //-------------------------------------------------------------------------- // set the device //-------------------------------------------------------------------------- @@ -51,6 +51,7 @@ bool GB_cuda_warmup (int device) // return result //-------------------------------------------------------------------------- + printf ("cuda warmup %d OK\n", device) ; return (true) ; } diff --git a/GraphBLAS/CUDA/License.txt b/GraphBLAS/CUDA/License.txt index b33fe599e7..6b410ed0b1 100644 --- a/GraphBLAS/CUDA/License.txt +++ b/GraphBLAS/CUDA/License.txt @@ -15,7 +15,7 @@ BSD 3-Clause "New" or "Revised" License In addition, any source files not part of the above packages is hereby licensed under the Apache-2.0 license. -Copyright 2020-2023, NVIDIA Corporation +Copyright 2020-2025, NVIDIA Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file expect in compilance with the License. diff --git a/GraphBLAS/CUDA/include/GB_cuda_atomics.cuh b/GraphBLAS/CUDA/include/GB_cuda_atomics.cuh index c4655c885e..3e75a0e538 100644 --- a/GraphBLAS/CUDA/include/GB_cuda_atomics.cuh +++ b/GraphBLAS/CUDA/include/GB_cuda_atomics.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_atomics.cuh: CUDA atomics for GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ // Atomic device functions for CUDA JIT kernels. Not used on the host. /* - * Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2023-2025, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/GraphBLAS/CUDA/include/GB_cuda_error.hpp b/GraphBLAS/CUDA/include/GB_cuda_error.hpp index fe7815c6c2..3871b81f9f 100644 --- a/GraphBLAS/CUDA/include/GB_cuda_error.hpp +++ b/GraphBLAS/CUDA/include/GB_cuda_error.hpp @@ -2,7 +2,7 @@ // GraphBLAS/CUDA/GB_cuda_error.hpp: call a cuda method and check its result //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,19 +14,17 @@ // CUDA_OK: like GB_OK but for calls to cuda* methods //------------------------------------------------------------------------------ -// FIXME: GrB_NO_VALUE means something in CUDA failed, and the caller will then -// do the computation on the CPU. Need to turn off the JIT for CUDA kernels -// (but not CPU kernels) if some CUDA error occurred. Current JIT control does -// not distinguish between CPU and CUDA failures. - #define CUDA_OK(cudaMethod) \ { \ cudaError_t cuda_error = cudaMethod ; \ if (cuda_error != cudaSuccess) \ { \ + printf ("cuda_error is %d\n", cuda_error) ; \ GrB_Info info = (cuda_error == cudaErrorMemoryAllocation) ? \ - GrB_OUT_OF_MEMORY : GrB_NO_VALUE ; \ - GBURBLE ("(cuda failed: %d:%s file:%s line:%d) ", (int) cuda_error, \ + GrB_OUT_OF_MEMORY : GxB_GPU_ERROR ; \ + printf ("(cuda failed: %d:%s file:%s line:%d)\n", (int) cuda_error, \ + cudaGetErrorString (cuda_error), __FILE__, __LINE__) ; \ + GBURBLE ("(cuda failed: %d:%s file:%s line:%d)\n", (int) cuda_error, \ cudaGetErrorString (cuda_error), __FILE__, __LINE__) ; \ GB_FREE_ALL ; \ return (info) ; \ diff --git a/GraphBLAS/CUDA/include/GB_cuda_kernel.cuh b/GraphBLAS/CUDA/include/GB_cuda_kernel.cuh index 64b2ef6749..43ae7798e2 100644 --- a/GraphBLAS/CUDA/include/GB_cuda_kernel.cuh +++ b/GraphBLAS/CUDA/include/GB_cuda_kernel.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_kernel.cuh: definitions for CUDA kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,9 +33,6 @@ using namespace cooperative_groups ; #define GB_CUDA_KERNEL -#undef ASSERT -#define ASSERT(x) - // for internal static inline functions #undef GB_STATIC_INLINE #define GB_STATIC_INLINE static __device__ __inline__ @@ -52,27 +49,29 @@ using namespace cooperative_groups ; extern "C" { + #include "include/GB_opaque.h" + #include "include/GB_index.h" + #include "include/GB_math_macros.h" #include "include/GB_bytes.h" #include "include/GB_pun.h" #include "include/GB_partition.h" - #include "include/GB_binary_search.h" #include "include/GB_zombie.h" + #include "include/GB_binary_search.h" #include "include/GB_int64_mult.h" - #include "include/GB_index.h" + #include "include/GB_math_macros.h" #include "include/GB_hash.h" #include "include/GB_complex.h" #include "include/GB_iceil.h" - #include "include/GB_math_macros.h" #include "include/GB_memory_macros.h" #include "include/GB_printf_kernels.h" - #include "include/GB_opaque.h" - #include "include/GB_static_header.h" + #include "include/GB_clear_matrix_header.h" #include "include/GB_werk.h" #include "include/GB_task_struct.h" #include "include/GB_callback_proto.h" #include "include/GB_saxpy3task_struct.h" #include "include/GB_callback.h" #include "include/GB_hyper_hash_lookup.h" + #include "include/GB_ok.h" } #include "GB_cuda_error.hpp" diff --git a/GraphBLAS/CUDA/include/GB_cuda_timer.hpp b/GraphBLAS/CUDA/include/GB_cuda_timer.hpp index 12a6e87d6b..21bde762a9 100644 --- a/GraphBLAS/CUDA/include/GB_cuda_timer.hpp +++ b/GraphBLAS/CUDA/include/GB_cuda_timer.hpp @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/test/GB_cuda_timer.hpp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/include/GraphBLAS_cuda.hpp b/GraphBLAS/CUDA/include/GraphBLAS_cuda.hpp index edd49b98f8..79fc20ffb2 100644 --- a/GraphBLAS/CUDA/include/GraphBLAS_cuda.hpp +++ b/GraphBLAS/CUDA/include/GraphBLAS_cuda.hpp @@ -2,13 +2,14 @@ // GraphBLAS/CUDA/GraphBLAS_cuda.hpp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ extern "C" { + // definitions that modify GraphBLAS.h #include "include/GB_dev.h" #include "include/GB_compiler.h" #include "include/GB_warnings.h" @@ -34,3 +35,8 @@ extern "C" #define restrict GB_restrict +extern "C" +{ + #include "include/GB_abort.h" +} + diff --git a/GraphBLAS/CUDA/template/GB_cuda_cumsum.cuh b/GraphBLAS/CUDA/template/GB_cuda_cumsum.cuh index 6eea3da950..b74f59532e 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_cumsum.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_cumsum.cuh @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GraphBLAS/CUDA/template/GB_cuda_cumsum: cumlative sum of an array on the GPU(s) +// GraphBLAS/CUDA/template/GB_cuda_cumsum: cumlative sum of array on the GPU(s) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,12 @@ #ifndef GB_CUDA_CUMSUM #define GB_CUDA_CUMSUM -#include +#include + +#define GB_FREE_ALL \ +{ \ + cudaFree (d_temp_storage) ; \ +} typedef enum GB_cuda_cumsum_type { @@ -18,10 +23,10 @@ typedef enum GB_cuda_cumsum_type GB_CUDA_CUMSUM_INCLUSIVE } GB_cuda_cumsum_type ; -__host__ GrB_Info GB_cuda_cumsum // compute the cumulative sum of an array +__host__ GrB_Info GB_cuda_cumsum // compute the cumulative sum of an array ( - int64_t *restrict in, // size n or n+1, input - int64_t *restrict out, // size n or n+1, output. + int64_t *__restrict__ out, // size n or n+1, output. + int64_t *__restrict__ in, // size n or n+1, input // to do an in-place cumsum, pass out == in const int64_t n, @@ -44,26 +49,29 @@ __host__ GrB_Info GB_cuda_cumsum // compute the cumulative sum of an switch (type) { case GB_CUDA_CUMSUM_INCLUSIVE: - cub::DeviceScan::InclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + cub::DeviceScan::InclusiveSum (d_temp_storage, temp_storage_bytes, + in, out, n, stream) ; break; default: - cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + cub::DeviceScan::ExclusiveSum (d_temp_storage, temp_storage_bytes, + in, out, n, stream) ; } - CUDA_OK (cudaMalloc(&d_temp_storage, temp_storage_bytes)) ; + CUDA_OK (cudaMalloc (&d_temp_storage, temp_storage_bytes)) ; // Run switch (type) { case GB_CUDA_CUMSUM_INCLUSIVE: - cub::DeviceScan::InclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + cub::DeviceScan::InclusiveSum (d_temp_storage, temp_storage_bytes, + in, out, n, stream) ; break; default: - cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + cub::DeviceScan::ExclusiveSum (d_temp_storage, temp_storage_bytes, + in, out, n, stream) ; } - - CUDA_OK (cudaFree(d_temp_storage)) ; - + cudaFree (d_temp_storage) ; + return GrB_SUCCESS; } #endif diff --git a/GraphBLAS/CUDA/template/GB_cuda_ek_slice.cuh b/GraphBLAS/CUDA/template/GB_cuda_ek_slice.cuh index 688f540737..2c81036e96 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_ek_slice.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_ek_slice.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_ek_slice.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -69,7 +69,7 @@ static __device__ __inline__ void GB_cuda_ek_slice_setup ( // inputs, not modified: - const int64_t *Ap, // array of size anvec+1 + const GB_Ap_TYPE *Ap, // array of size anvec+1 const int64_t anvec, // # of vectors in the matrix A const int64_t anz, // # of entries in the sparse/hyper matrix A const int64_t pfirst, // first entry in A to find k @@ -107,7 +107,7 @@ static __device__ __inline__ void GB_cuda_ek_slice_setup (*kfirst) = 0 ; int64_t kright = anvec ; - GB_TRIM_BINARY_SEARCH (pfirst, Ap, (*kfirst), kright) ; + GB_trim_binary_search (pfirst, Ap, GB_Ap_IS_32, kfirst, &kright) ; // find klast, the last vector of the slice for this chunk. klast is the // vector that owns the entry Ai [plast-1] and Ax [plast-1]. The search @@ -115,7 +115,7 @@ static __device__ __inline__ void GB_cuda_ek_slice_setup (*klast) = (*kfirst) ; kright = anvec ; - GB_TRIM_BINARY_SEARCH (plast, Ap, (*klast), kright) ; + GB_trim_binary_search (plast, Ap, GB_Ap_IS_32, klast, &kright) ; //-------------------------------------------------------------------------- // find slope of vectors in this chunk, and return result @@ -156,7 +156,7 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice_entry const int64_t pdelta, // find the k value of the pfirst+pdelta entry const int64_t pfirst, // first entry in A to find k (for which // pdelta=0) - const int64_t *Ap, // array of size anvec+1 + const GB_Ap_TYPE *Ap, // array of size anvec+1 const int64_t anvec1, // anvec-1 const int64_t kfirst, // estimate of first vector in the chunk const float slope // estimate # vectors in chunk / my_chunk_size @@ -202,7 +202,7 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice_entry static __device__ __inline__ int64_t GB_cuda_ek_slice // returns my_chunk_size ( // inputs, not modified: - const int64_t *Ap, // array of size anvec+1 + const GB_Ap_TYPE *Ap, // array of size anvec+1 const int64_t anvec, // # of vectors in the matrix A const int64_t anz, // # of entries in the sparse/hyper matrix A const int64_t pfirst, // first entry in A to find k diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh index 51c6ab668a..ccb571b38c 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,17 +36,18 @@ __global__ void GB_cuda_AxB_dot3_dense_phase1_kernel // get C, M, A, and B //-------------------------------------------------------------------------- - const int64_t *__restrict__ Mp = M->p ; - const int64_t *__restrict__ Mi = M->i ; + const GB_Mp_TYPE *__restrict__ Mp = (GB_Mp_TYPE *) M->p ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if !GB_MASK_STRUCT const GB_M_TYPE *__restrict__ Mx = (GB_M_TYPE *) M->x ; #endif const int64_t mnvec = M->nvec ; const GB_M_NVALS (mnz) ; - int64_t *__restrict__ Ci = C->i ; // for zombies, or vector k + // for zombies, or vector k + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; - // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE (i) if C(i,j) is a // zombie, or k otherwise, where C(:,j) is the kth vector of C (j = Ch [k] // if hypersparse or j = k if standard sparse). diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh index cccf4eba1f..8b3d2a4f66 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,10 +56,10 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel //-------------------------------------------------------------------------- #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif - const int64_t *__restrict__ Mp = M->p ; - const int64_t *__restrict__ Mi = M->i ; + const GB_Mp_TYPE *__restrict__ Mp = (GB_Mp_TYPE *) M->p ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if !GB_MASK_STRUCT const GB_M_TYPE *__restrict__ Mx = (GB_M_TYPE *) M->x ; #endif @@ -69,40 +69,37 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; #if GB_A_IS_SPARSE || GB_A_IS_HYPER - const int64_t *__restrict__ Ap = A->p ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #endif #if GB_B_IS_SPARSE || GB_B_IS_HYPER - const int64_t *__restrict__ Bp = B->p ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; #endif #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif - // int64_t *restrict Cp = C->p ; // copy of Mp - // int64_t *restrict Ch = C->h ; // copy of Mh - int64_t *__restrict__ Ci = C->i ; // for zombies, or bucket assignment + // for zombies, or bucket assignment: + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; // FIXME: use (k << 2) not (k << 4) - // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE (i) if C(i,j) is a // zombie, or (k << 4) + bucket otherwise, where C(:,j) is the kth vector // of C (j = Ch [k] if hypersparse or j = k if standard sparse), and // where bucket is the bucket assignment for C(i,j). @@ -182,13 +179,14 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel //-------------------------------------------------------------- #if GB_B_IS_SPARSE || GB_B_IS_HYPER - int64_t j = GBH_M (Mh, k) ; // that Ch and Mh are the same + int64_t j = GBh_M (Mh, k) ; // that Ch and Mh are the same int64_t pB, pB_end, bjnz ; #endif #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, - B_hash_bits, j, &pB, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB, &pB_end) ; bjnz = pB_end - pB ; if (bjnz > 0) #elif GB_B_IS_SPARSE @@ -210,8 +208,9 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel #endif #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + i, &pA, &pA_end) ; ainz = pA_end - pA ; if (ainz > 0) #elif GB_A_IS_SPARSE @@ -304,7 +303,7 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel //------------------------------------------------------------------ // encode the bucket or zombie status in the row index of C(i,j) - Ci [pM] = (bucket == GB_BUCKET_ZOMBIE) * ( GB_ZOMBIE(i) << 4) + Ci [pM] = (bucket == GB_BUCKET_ZOMBIE) * ( GB_ZOMBIE (i) << 4) + (bucket != GB_BUCKET_ZOMBIE) * ((k << 4) + bucket) ; // each thread counts its own bucket sizes diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2.cuh index 06eb999a86..cd7f8140fb 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_GB_AxB_dot3_phase2.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh index be5056b2cc..741dda9b79 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,15 +35,14 @@ __global__ void GB_cuda_AxB_dot3_phase2end_kernel // get C information //-------------------------------------------------------------------------- - // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE (i) if C(i,j) is a // zombie, or (k << 4) + bucket otherwise, where C(:,j) is the kth vector // of C (j = Ch [k] if hypersparse or j = k if standard sparse), and // where bucket is the bucket assignment for C(i,j). This phase does not // need k, just the bucket for each entry C(i,j). - int64_t *__restrict__ Ci = C->i ; // for zombies, or bucket assignment - //int64_t *Mp = C->p ; // for offset calculations - //int64_t mnvec = C->nvec; + // for zombies, or bucket assignment: + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; //-------------------------------------------------------------------------- // load and shift the nanobuckets for this thread block @@ -85,9 +84,6 @@ __global__ void GB_cuda_AxB_dot3_phase2end_kernel // FIXME: why is bucket_idx needed? __shared__ int64_t bucket_idx [chunk_size] ; -// int64_t chunk_max = (cnz + chunk_size -1) / chunk_size ; -// for (int64_t chunk = blockIdx.x ; chunk < chunk_max ; chunk += gridDim.x) - for (int64_t pfirst = blockIdx.x << log2_chunk_size ; pfirst < cnz ; pfirst += gridDim.x << log2_chunk_size) diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh index 8b1acebcb9..19c425aa75 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,10 +52,10 @@ __global__ void GB_cuda_AxB_dot3_phase3_dndn_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif // A and B are either bitmap or full #if GB_A_IS_BITMAP @@ -102,7 +102,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_dndn_kernel { // j = kth or j = Mh [kth] if C and M are hypersparse - int64_t j = GBH_M (Mh, kth) ; + int64_t j = GBh_M (Mh, kth) ; int64_t pA = vlen * i ; int64_t pB = vlen * j ; diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh index 2a10c0c162..4315c90639 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -63,37 +63,37 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + + const GB_Mp_TYPE *__restrict__ Mp = (GB_Mp_TYPE *) M->p ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif // A and B are either sparse or hypersparse - const int64_t *__restrict__ Ai = A->i ; - const int64_t *__restrict__ Bi = B->i ; - const int64_t *__restrict__ Ap = A->p ; - const int64_t *__restrict__ Bp = B->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; ASSERT (GB_A_IS_HYPER || GB_A_IS_SPARSE) ; ASSERT (GB_B_IS_HYPER || GB_B_IS_SPARSE) ; #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif @@ -104,8 +104,9 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel // int tid_global = threadIdx.x+ blockDim.x* blockIdx.x; int tid = threadIdx.x; + thread_block_tile tile = tiled_partition( this_thread_block()); - int all_in_one = ( (end - start) == (M->p)[(M->nvec)] ) ; + int all_in_one = ( (end - start) == Mp [(M->nvec)] ) ; // Main loop over pairs int64_t kk ; @@ -124,12 +125,13 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel // assert: Ci [pair_id] & 0xF == GB_BUCKET_MERGEPATH // j = k or j = Mh [k] if C and M are hypersparse - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; // find A(:,i) int64_t pA_start, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA_start, &pA_end) ; #else pA_start = Ap[i] ; @@ -139,8 +141,9 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel // find B(:,j) int64_t pB_start, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB_start, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB_start, &pB_end) ; #else pB_start = Bp[j] ; pB_end = Bp[j+1] ; diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh index f50de125ec..c266fb3a0b 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,15 +52,15 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif #if GB_A_IS_HYPER || GB_A_IS_SPARSE - const int64_t *__restrict__ Ai = A->i ; - const int64_t *__restrict__ Ap = A->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #else const int64_t avlen = A->vlen ; #endif @@ -70,8 +70,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel #endif #if GB_B_IS_HYPER || GB_B_IS_SPARSE - const int64_t *__restrict__ Bi = B->i ; - const int64_t *__restrict__ Bp = B->p ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; #else const int64_t bvlen = B->vlen ; #endif @@ -82,21 +82,19 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif @@ -127,7 +125,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel int64_t k = Ci [pair_id] >> 4 ; // assert: Ci [pair_id] & 0xF == GB_BUCKET_SPDN // j = k or j = Mh [k] if C and M are hypersparse - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; //---------------------------------------------------------------------- // get A(:,i) @@ -135,8 +133,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel #if GB_A_IS_HYPER int64_t pA, pA_end ; - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #elif GB_A_IS_SPARSE int64_t pA = Ap [i] ; int64_t pA_end = Ap [i+1] ; @@ -151,8 +149,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel #if GB_B_IS_HYPER int64_t pB, pB_end ; - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #elif GB_B_IS_SPARSE int64_t pB = Bp [j] ; int64_t pB_end = Bp [j+1] ; diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh index ae0b0bd60c..dca874de87 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -54,15 +54,15 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif #if GB_A_IS_HYPER || GB_A_IS_SPARSE - const int64_t *__restrict__ Ai = A->i ; - const int64_t *__restrict__ Ap = A->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #else const int64_t avlen = A->vlen ; #endif @@ -72,8 +72,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel #endif #if GB_B_IS_HYPER || GB_B_IS_SPARSE - const int64_t *__restrict__ Bi = B->i ; - const int64_t *__restrict__ Bp = B->p ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; #else const int64_t bvlen = B->vlen ; #endif @@ -84,21 +84,19 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif @@ -123,7 +121,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel int64_t k = Ci [pair_id] >> 4; // vector of C encoded in phase1 // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSDN // j = k or j = Mh [k] if C and M are hypersparse - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; //---------------------------------------------------------------------- // get A(:,i) @@ -131,8 +129,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel #if GB_A_IS_HYPER int64_t pA, pA_end ; - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #elif GB_A_IS_SPARSE int64_t pA = Ap[i] ; int64_t pA_end = Ap[i+1] ; @@ -147,8 +145,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel #if GB_B_IS_HYPER int64_t pB, pB_end ; - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #elif GB_B_IS_SPARSE int64_t pB = Bp [j] ; int64_t pB_end = Bp [j+1] ; diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh index 4f1ae7dfea..675a30309d 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh @@ -36,37 +36,35 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif ASSERT (GB_A_IS_HYPER || GB_A_IS_SPARSE) ; - const int64_t *__restrict__ Ai = A->i ; - const int64_t *__restrict__ Ap = A->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; ASSERT (GB_B_IS_HYPER || GB_B_IS_SPARSE) ; - const int64_t *__restrict__ Bi = B->i ; - const int64_t *__restrict__ Bp = B->p ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif @@ -91,13 +89,13 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSSP // j = k or j = Mh [k] if C and M are hypersparse - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; // find A(:,i): A is always sparse or hypersparse int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #else pA = Ap [i] ; pA_end = Ap [i+1] ; @@ -106,8 +104,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel // find B(:,j): B is always sparse or hypersparse int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #else pB = Bp [j] ; pB_end = Bp [j+1] ; @@ -148,7 +146,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel // discard all entries B(ib:ia-1,j) int64_t pleft = pB + 1 ; int64_t pright = pB_end - 1 ; - GB_TRIM_BINARY_SEARCH (ia, Bi, pleft, pright) ; + GB_trim_binary_search (ia, Bi, GB_Bi_IS_32, + &pleft, &pright) ; //ASSERT (pleft > pB) ; pB = pleft ; } @@ -181,7 +180,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel // discard all entries A(ia:ib-1,i) int64_t pleft = pA + 1 ; int64_t pright = pA_end - 1 ; - GB_TRIM_BINARY_SEARCH (ib, Ai, pleft, pright) ; + GB_trim_binary_search (ib, Ai, GB_Ai_IS_32, + &pleft, &pright) ; //ASSERT (pleft > pA) ; pA = pleft ; } @@ -227,7 +227,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel { zc++; //printf(" %lld, %lld is zombie %d!\n",i,j,zc); - Ci[pair_id] = GB_ZOMBIE( i ) ; + Ci[pair_id] = GB_ZOMBIE ( i ) ; } } } diff --git a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh index f29233d0cf..03b10a2cee 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -54,37 +54,35 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; #endif GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; - int64_t *__restrict__ Ci = C->i ; - const int64_t *__restrict__ Mi = M->i ; + GB_Ci_SIGNED_TYPE *__restrict__ Ci = (GB_Ci_SIGNED_TYPE *) C->i ; + const GB_Mi_TYPE *__restrict__ Mi = (GB_Mi_TYPE *) M->i ; #if GB_M_IS_HYPER - const int64_t *__restrict__ Mh = M->h ; + const GB_Mj_TYPE *__restrict__ Mh = (GB_Mj_TYPE *) M->h ; #endif ASSERT (GB_A_IS_HYPER || GB_A_IS_SPARSE) ; - const int64_t *__restrict__ Ai = A->i ; - const int64_t *__restrict__ Ap = A->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; ASSERT (GB_B_IS_HYPER || GB_B_IS_SPARSE) ; - const int64_t *__restrict__ Bi = B->i ; - const int64_t *__restrict__ Bp = B->p ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; + const GB_Bp_TYPE *__restrict__ Bp = (GB_Bp_TYPE *) B->p ; #if GB_A_IS_HYPER const int64_t anvec = A->nvec ; - const int64_t *__restrict__ Ah = A->h ; - const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *__restrict__ A_Yx = (int64_t *) - ((A->Y == NULL) ? NULL : A->Y->x) ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + const void *A_Yp = (void *) ((A->Y == NULL) ? NULL : A->Y->p) ; + const void *A_Yi = (void *) ((A->Y == NULL) ? NULL : A->Y->i) ; + const void *A_Yx = (void *) ((A->Y == NULL) ? NULL : A->Y->x) ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #endif #if GB_B_IS_HYPER const int64_t bnvec = B->nvec ; - const int64_t *__restrict__ Bh = B->h ; - const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *__restrict__ B_Yx = (int64_t *) - ((B->Y == NULL) ? NULL : B->Y->x) ; + const GB_Bj_TYPE *__restrict__ Bh = (GB_Bj_TYPE *) B->h ; + const void *B_Yp = (void *) ((B->Y == NULL) ? NULL : B->Y->p) ; + const void *B_Yi = (void *) ((B->Y == NULL) ? NULL : B->Y->i) ; + const void *B_Yx = (void *) ((B->Y == NULL) ? NULL : B->Y->x) ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #endif @@ -104,13 +102,13 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSVS // j = k or j = Mh [k] if C and M are hypersparse - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; // find A(:,i): A is always sparse or hypersparse int64_t pA, pA_end ; #if GB_A_IS_HYPER - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, - i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, i, &pA, &pA_end) ; #else pA = Ap [i] ; pA_end = Ap [i+1] ; @@ -119,8 +117,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel // find B(:,j): B is always sparse or hypersparse int64_t pB, pB_end ; #if GB_B_IS_HYPER - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, - j, &pB, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; #else pB = Bp [j] ; pB_end = Bp [j+1] ; diff --git a/GraphBLAS/CUDA/template/GB_cuda_threadblock_reduce_ztype.cuh b/GraphBLAS/CUDA/template/GB_cuda_threadblock_reduce_ztype.cuh index 411929850e..b5e40f4892 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_threadblock_reduce_ztype.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_threadblock_reduce_ztype.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_threadblock_reduce_ztype.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/template/GB_cuda_threadblock_sum_uint64.cuh b/GraphBLAS/CUDA/template/GB_cuda_threadblock_sum_uint64.cuh index dea65f9ac7..6fc259e568 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_threadblock_sum_uint64.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_threadblock_sum_uint64.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_threadblock_sum_uint64.cuh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/template/GB_cuda_tile_reduce_ztype.cuh b/GraphBLAS/CUDA/template/GB_cuda_tile_reduce_ztype.cuh index e3f08d35fd..1b5398ae5d 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_tile_reduce_ztype.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_tile_reduce_ztype.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_tile_reduce_ztype.cuh: warp-level reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/template/GB_cuda_tile_sum_uint64.cuh b/GraphBLAS/CUDA/template/GB_cuda_tile_sum_uint64.cuh index e3139d848a..27fd2790db 100644 --- a/GraphBLAS/CUDA/template/GB_cuda_tile_sum_uint64.cuh +++ b/GraphBLAS/CUDA/template/GB_cuda_tile_sum_uint64.cuh @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/template/GB_cuda_tile_sum_uint64.cuh: warp-level reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause //------------------------------------------------------------------------------ diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu index 1347c7c8d0..cc7fea1338 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/jit_kernels/GB_jit_kernel_cuda_AxB_dot3.cu //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -154,13 +154,13 @@ GB_bucket_code ; // FIXME: rename GB_dot3_bucket_code // sparse-sparse, sparse-dense, or dense-sparse #undef GB_FREE_ALL - #define GB_FREE_ALL \ - { \ - GB_FREE_WORK (&Nanobuckets, Nb_size) ; \ - GB_FREE_WORK (&Blockbucket, Bb_size) ; \ - GB_FREE_WORK (&Bucketp, Bup_size) ; \ - GB_FREE_WORK (&offset, O_size) ; \ - GB_FREE_WORK (&Bucket, Bu_size) ; \ + #define GB_FREE_ALL \ + { \ + GB_FREE_MEMORY (&Nanobuckets, Nb_size) ; \ + GB_FREE_MEMORY (&Blockbucket, Bb_size) ; \ + GB_FREE_MEMORY (&Bucketp, Bup_size) ; \ + GB_FREE_MEMORY (&offset, O_size) ; \ + GB_FREE_MEMORY (&Bucket, Bu_size) ; \ } #include "GB_cuda_jit_AxB_dot3_phase1.cuh" @@ -201,6 +201,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) #ifdef GB_JIT_RUNTIME // get callback functions + GB_GET_CALLBACKS ; GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; #endif @@ -310,11 +311,11 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) int64_t blockbuckets_size = NBUCKETS * number_of_blocks_1 ; int64_t nanobuckets_size = blockbuckets_size * threads_per_block ; - Nanobuckets = GB_MALLOC_WORK (nanobuckets_size, int64_t, &Nb_size) ; - Blockbucket = GB_MALLOC_WORK (blockbuckets_size, int64_t, &Bb_size) ; - Bucketp = GB_MALLOC_WORK (NBUCKETS+1, int64_t, &Bup_size) ; - offset = GB_MALLOC_WORK (NBUCKETS+1, int64_t, &O_size) ; - Bucket = GB_MALLOC_WORK (mnz, int64_t, &Bu_size) ; + Nanobuckets = (int64_t *) GB_MALLOC_MEMORY (nanobuckets_size, sizeof (int64_t), &Nb_size) ; + Blockbucket = (int64_t *) GB_MALLOC_MEMORY (blockbuckets_size, sizeof (int64_t), &Bb_size) ; + Bucketp = (int64_t *) GB_MALLOC_MEMORY (NBUCKETS+1, sizeof (int64_t), &Bup_size) ; + offset = (int64_t *) GB_MALLOC_MEMORY (NBUCKETS+1, sizeof (int64_t), &O_size) ; + Bucket = (int64_t *) GB_MALLOC_MEMORY (mnz, sizeof (int64_t), &Bu_size) ; memset (offset, 0, (NBUCKETS+1) * sizeof (int64_t)) ; memset (Bucketp, 0, (NBUCKETS+1) * sizeof (int64_t)) ; @@ -401,6 +402,14 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) all_in_one = true ; } } + printf ("mnz: %ld in buckets : %ld\n", mnz, s) ; + if (mnz != s) + { + printf ("Abort! Missing %ld entries\n", mnz-s) ; + fflush (stdout) ; + fflush (stderr) ; + abort ( ) ; + } // kernel_timer.Stop(); // printf ("(GPU phase2 %12.6g ms )\n", kernel_timer.Elapsed()) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind1st.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind1st.cu index e3b9474809..55c0f2e96a 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind1st.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind1st.cu @@ -22,7 +22,7 @@ __global__ void GB_cuda_apply_bind1st_kernel for (int64_t p = tid ; p < nvals ; p += nthreads) { - if (!GBB_B (Bb, p)) { continue ; } + if (!GBb_B (Bb, p)) { continue ; } GB_DECLAREB (bij) ; GB_GETB (bij, Bx, p, false) ; GB_EWISEOP (Cx, p, x, bij, /* i */, /* j */) ; @@ -35,6 +35,7 @@ extern "C" { GB_JIT_CUDA_KERNEL_APPLY_BIND1ST_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; ASSERT (Cx != NULL) ; dim3 grid (gridsz) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind2nd.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind2nd.cu index 8681d1e0ad..8ded47a7f5 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind2nd.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_bind2nd.cu @@ -22,7 +22,7 @@ __global__ void GB_cuda_apply_bind2nd_kernel for (int64_t p = tid ; p < nvals ; p += nthreads) { - if (!GBB_A (Ab, p)) { continue ; } + if (!GBb_A (Ab, p)) { continue ; } GB_DECLAREA (aij) ; GB_GETA (aij, Ax, p, false) ; GB_EWISEOP (Cx, p, aij, x, /* i */, /* j */) ; @@ -35,6 +35,7 @@ extern "C" { GB_JIT_CUDA_KERNEL_APPLY_BIND2ND_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; ASSERT (Cx != NULL) ; dim3 grid (gridsz) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu index fdc5e2804e..d2f2571472 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu @@ -20,14 +20,14 @@ __global__ void GB_cuda_apply_unop_kernel #if ( GB_A_IS_SPARSE || GB_A_IS_HYPER ) #if ( GB_DEPENDS_ON_I ) - const int64_t *__restrict__ Ai = (int64_t *) A->i ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; #endif #if ( GB_DEPENDS_ON_J ) #if ( GB_A_IS_HYPER ) - const int64_t *__restrict__ Ah = (int64_t *) A->h ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; #endif - const int64_t *__restrict__ Ap = (int64_t *) A->p ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #endif #endif @@ -51,7 +51,7 @@ __global__ void GB_cuda_apply_unop_kernel // bitmap/full case for (int64_t p = tid ; p < anz ; p += nthreads) { - if (!GBB_A (Ab, p)) { continue ; } + if (!GBb_A (Ab, p)) { continue ; } #if ( GB_DEPENDS_ON_I ) int64_t row_idx = p % A->vlen ; @@ -81,10 +81,10 @@ __global__ void GB_cuda_apply_unop_kernel { int64_t p_final ; int64_t k = GB_cuda_ek_slice_entry (&p_final, pdelta, pfirst, Ap, anvec_sub1, kfirst, slope) ; - int64_t col_idx = GBH_A (Ah, k) ; + int64_t col_idx = GBh_A (Ah, k) ; #if ( GB_DEPENDS_ON_I ) - int64_t row_idx = GBI_A (Ai, p_final, A->vlen) ; + int64_t row_idx = GBi_A (Ai, p_final, A->vlen) ; #endif GB_UNOP (Cx, p_final, Ax, p_final, @@ -97,7 +97,7 @@ __global__ void GB_cuda_apply_unop_kernel for (int64_t p = tid ; p < anz ; p += nthreads) { #if ( GB_DEPENDS_ON_I ) - int64_t row_idx = GBI_A (Ai, p, avlen) ; + int64_t row_idx = GBi_A (Ai, p, avlen) ; #endif GB_UNOP (Cx, p, Ax, p, A_iso, row_idx, /* col_idx */, thunk_value) ; @@ -112,6 +112,7 @@ extern "C" { GB_JIT_CUDA_KERNEL_APPLY_UNOP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; dim3 grid (gridsz) ; dim3 block (blocksz) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_colscale.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_colscale.cu index da0c53e2b8..45a319375e 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_colscale.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_colscale.cu @@ -19,9 +19,9 @@ __global__ void GB_cuda_colscale_kernel GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *) C->x ; #if ( GB_A_IS_SPARSE || GB_A_IS_HYPER ) - const int64_t *__restrict__ Ap = A->p ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #if ( GB_A_IS_HYPER ) - const int64_t *__restrict__ Ah = A->h ; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; #endif #endif @@ -38,7 +38,7 @@ __global__ void GB_cuda_colscale_kernel int tid = blockIdx.x * blockDim.x + threadIdx.x ; for (int64_t p = tid ; p < anz ; p += nthreads_in_entire_grid) { - if (!GBB_A (Ab, p)) continue ; + if (!GBb_A (Ab, p)) continue ; // the pth entry in A is A(i,j) where i = p%avlen and j = p/avlen int64_t col_idx = p / avlen ; // int64_t row_idx = p % avlen ; @@ -66,7 +66,7 @@ __global__ void GB_cuda_colscale_kernel { int64_t p_final ; int64_t k = GB_cuda_ek_slice_entry (&p_final, pdelta, pfirst, Ap, anvec_sub1, kfirst, slope) ; - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_DECLAREB (djj) ; GB_GETB (djj, Dx, j, ) ; @@ -87,6 +87,7 @@ extern "C" { GB_JIT_CUDA_KERNEL_COLSCALE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; ASSERT (GB_JUMBLED_OK (C)) ; ASSERT (GB_JUMBLED_OK (A)) ; ASSERT (!GB_JUMBLED (D)) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_reduce.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_reduce.cu index bc6388bee9..22272dfad7 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_reduce.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_reduce.cu @@ -2,8 +2,8 @@ // GraphBLAS/CUDA/jit_kernels/GB_jit_cuda_reduce.cu //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// This file: Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// This file: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,7 @@ __global__ void GB_cuda_reduce_kernel #if GB_A_HAS_ZOMBIES { // check for zombies during the reduction - const int64_t *__restrict__ Ai = A->i ; + const GB_Ai_SIGNED_TYPE *__restrict__ Ai = (GB_Ai_SIGNED_TYPE *) A->i ; // grid-stride loop: for (int64_t p = blockIdx.x * blockDim.x + threadIdx.x ; p < anz ; @@ -185,6 +185,7 @@ extern "C" GB_JIT_CUDA_KERNEL_REDUCE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; dim3 grid (gridsz) ; // gridsz: # of threadblocks dim3 block (blocksz) ; // blocksz: # of threads in each threadblock GB_A_NHELD (anz) ; // anz = # of entries held in A diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_rowscale.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_rowscale.cu index be158f7273..adf6d864f3 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_rowscale.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_rowscale.cu @@ -16,7 +16,7 @@ __global__ void GB_cuda_rowscale_kernel #define B_iso GB_B_ISO #if ( GB_B_IS_SPARSE || GB_B_IS_HYPER ) - const int64_t *__restrict__ Bi = B->i ; + const GB_Bi_TYPE *__restrict__ Bi = (GB_Bi_TYPE *) B->i ; #endif #if ( GB_B_IS_BITMAP ) @@ -34,9 +34,9 @@ __global__ void GB_cuda_rowscale_kernel for (int64_t p = tid ; p < bnz ; p += ntasks) { - if (!GBB_B (Bb, p)) { continue ; } + if (!GBb_B (Bb, p)) { continue ; } - int64_t i = GBI_B (Bi, p, bvlen) ; // get row index of B(i,j) + int64_t i = GBi_B (Bi, p, bvlen) ; // get row index of B(i,j) GB_DECLAREA (dii) ; GB_GETA (dii, Dx, i, D_iso) ; // dii = D(i,i) GB_DECLAREB (bij) ; @@ -51,6 +51,7 @@ extern "C" { GB_JIT_CUDA_KERNEL_ROWSCALE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; ASSERT (GB_JUMBLED_OK (C)) ; ASSERT (!GB_JUMBLED (D)) ; ASSERT (!GB_IS_BITMAP (D)) ; diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_bitmap.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_bitmap.cu index 59b8ba944b..6b87a5687d 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_bitmap.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_bitmap.cu @@ -12,12 +12,13 @@ using namespace cooperative_groups ; __global__ void GB_cuda_select_bitmap_kernel ( - int8_t *Cb_out, - uint64_t *cnvals_out, + GrB_Matrix C, GrB_Matrix A, - const GB_void *thunk + const GB_void *ythunk ) { + int8_t *Cb_out = C->b ; + #if ( GB_DEPENDS_ON_X ) const GB_A_TYPE *__restrict__ Ax = (GB_A_TYPE *) A->x ; #endif @@ -26,6 +27,10 @@ __global__ void GB_cuda_select_bitmap_kernel const int8_t *__restrict__ Ab = A->b ; #endif + #if ( GB_DEPENDS_ON_Y ) + GB_Y_TYPE y = * ((GB_Y_TYPE *) ythunk) ; + #endif + GB_A_NHELD (anz) ; int64_t nrows = A->vlen ; @@ -35,7 +40,7 @@ __global__ void GB_cuda_select_bitmap_kernel for (int64_t p = tid ; p < anz ; p += nthreads) { Cb_out [p] = 0 ; - if (!GBB_A (Ab, p)) { continue; } + if (!GBb_A (Ab, p)) { continue; } #if ( GB_DEPENDS_ON_I ) int64_t i = (p % nrows) ; @@ -44,10 +49,6 @@ __global__ void GB_cuda_select_bitmap_kernel #if ( GB_DEPENDS_ON_J ) int64_t j = (p / nrows) ; #endif - - #if ( GB_DEPENDS_ON_Y ) - GB_Y_TYPE y = * ((GB_Y_TYPE *) thunk) ; - #endif GB_TEST_VALUE_OF_ENTRY (keep, p) ; if (keep) @@ -58,14 +59,14 @@ __global__ void GB_cuda_select_bitmap_kernel } // compute cnvals for this block - // IMPORTANT: every thread in the threadblock must participate in the warp reduction - // for thread 0 to obtain the right result + // IMPORTANT: every thread in the threadblock must participate in the warp + // reduction for thread 0 to obtain the right result uint64_t block_keep = GB_cuda_threadblock_sum_uint64 (my_keep) ; if (threadIdx.x == 0) { // thread 0 updates global cnvals with atomics - GB_cuda_atomic_add (cnvals_out, block_keep) ; + GB_cuda_atomic_add ((uint64_t *) &(C->nvals), block_keep) ; } } @@ -77,8 +78,10 @@ extern "C" GB_JIT_CUDA_KERNEL_SELECT_BITMAP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; dim3 grid (gridsz) ; dim3 block (blocksz) ; - GB_cuda_select_bitmap_kernel <<>> (Cb, cnvals, A, ythunk) ; + GB_cuda_select_bitmap_kernel <<>> (C, A, ythunk) ; return (GrB_SUCCESS) ; } + diff --git a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu index 7fc1f08d9f..98741d2b68 100644 --- a/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu +++ b/GraphBLAS/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu @@ -1,15 +1,21 @@ using namespace cooperative_groups ; -#define GB_FREE_ALL \ -{ \ - GB_FREE_WORK (W) ; \ - GB_FREE_WORK (W_2) ; \ - GB_FREE_WORK (W_3) ; \ -} - #include "GB_cuda_ek_slice.cuh" #include "GB_cuda_cumsum.cuh" +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_MEMORY (&W, W_size) ; \ + GB_FREE_MEMORY (&W_2, W_2_size) ; \ + GB_FREE_MEMORY (&W_3, W_3_size) ; \ +} + +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_WORKSPACE ; + +#define chunk_size 1024 +#define log2_chunk_size 10 + //------------------------------------------------------------------------------ // GB_cuda_select_sparse_phase1: construct Keep array //------------------------------------------------------------------------------ @@ -19,13 +25,18 @@ __global__ void GB_cuda_select_sparse_phase1 ( int64_t *Keep, GrB_Matrix A, - void *ythunk + const void *ythunk ) { - const int64_t *__restrict__ Ap = A->p ; + #if ( GB_DEPENDS_ON_I ) + const GB_Ai_SIGNED_TYPE *__restrict__ Ai = (GB_Ai_SIGNED_TYPE *) A->i ; + #endif - #if ( GB_A_IS_HYPER ) - const int64_t *__restrict__ Ah = A->h ; + #if ( GB_DEPENDS_ON_J ) + #if ( GB_A_IS_HYPER ) + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h ; + #endif + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; #endif #if ( GB_DEPENDS_ON_X ) @@ -33,13 +44,12 @@ __global__ void GB_cuda_select_sparse_phase1 #endif #if ( GB_DEPENDS_ON_Y ) - const GB_Y_TYPE y = * ((GB_Y_TYPE *) thunk) ; + const GB_Y_TYPE y = * ((GB_Y_TYPE *) ythunk) ; #endif - GB_A_NHELD (anz) ; #if ( GB_DEPENDS_ON_J ) - + const int64_t anvec = A->nvec ; for (int64_t pfirst = blockIdx.x << log2_chunk_size ; pfirst < anz ; pfirst += gridDim.x << log2_chunk_size ) @@ -56,20 +66,18 @@ __global__ void GB_cuda_select_sparse_phase1 int64_t pA ; int64_t k = GB_cuda_ek_slice_entry (&pA, pdelta, pfirst, Ap, anvec1, kfirst, slope) ; - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; #if ( GB_DEPENDS_ON_I ) int64_t i = Ai [pA] ; #endif // keep = fselect (A (i,j)), true if A(i,j) is kept, else false - GB_TEST_VALUE_OF_ENTRY (keep, pA) ; // FIXME: add Ax,i,j,y - Keep[pA] = keep; + GB_TEST_VALUE_OF_ENTRY (keep, pA) ; + Keep [pA] = keep ; } } - #else - int tid = blockIdx.x * blockDim.x + threadIdx.x ; int nthreads = blockDim.x * gridDim.x ; @@ -80,7 +88,7 @@ __global__ void GB_cuda_select_sparse_phase1 #endif GB_TEST_VALUE_OF_ENTRY (keep, pA) ; - Keep[pA] = keep; + Keep [pA] = keep ; } #endif @@ -92,23 +100,21 @@ __global__ void GB_cuda_select_sparse_phase1 __global__ void GB_cuda_select_sparse_phase2 ( - int64_t *Map + int64_t *Map, GrB_Matrix A, int64_t *Ak_keep, - int64_t *Ck_delta, - int64_t *Ci, - GB_X_TYPE *Cx + GB_Ci_TYPE *Ci, + GB_C_TYPE *Cx ) { - const int64_t *__restrict__ Ap = A->p ; - const int64_t *__restrict__ Ai = A->i ; + const GB_Ap_TYPE *__restrict__ Ap = (GB_Ap_TYPE *) A->p ; + const GB_Ai_TYPE *__restrict__ Ai = (GB_Ai_TYPE *) A->i ; + #if (!GB_ISO_SELECT) const GB_A_TYPE *__restrict__ Ax = (GB_A_TYPE *) A->x ; - + #endif GB_A_NHELD (anz) ; - int64_t cnz = Map [anz - 1]; - int tid = blockIdx.x * blockDim.x + threadIdx.x ; - int nthreads = blockDim.x * gridDim.x ; + const int64_t anvec = A->nvec ; for (int64_t pfirst = blockIdx.x << log2_chunk_size ; pfirst < anz ; @@ -143,49 +149,50 @@ __global__ void GB_cuda_select_sparse_phase2 Ci [pC] = Ai [pA] ; // Cx [pC] = Ax [pA] ; - // Q: In iso case, this just becomes - // #define GB_ISO_SELECT 1? I would expect - // Cx [0] = Ax [0] - GB_SELECT_ENTRY (pC, pA) ; + GB_SELECT_ENTRY (Cx, pC, Ax, pA) ; // save the name of the vector kA that holds this entry in A, // for the new position of this entry in C at pC. Ak_keep [pC] = kA ; } } + } +} - // Build the Delta over Ck_delta - this_thread_block().sync(); +__global__ void GB_cuda_select_sparse_phase3 +( + int64_t anz, + int64_t *Map, + int64_t *Ak_keep, + int64_t *Ck_delta +) +{ + int tid = blockIdx.x * blockDim.x + threadIdx.x ; + int nthreads = blockDim.x * gridDim.x ; - for (int64_t pdelta = threadIdx.x ; - pdelta < my_chunk_size ; - pdelta += blockDim.x) + for (int64_t pA = tid; pA < anz; pA += nthreads) + { + int64_t pC = Map [pA] ; + if (Map [pA-1] < pC) { - int64_t pA = pfirst + pdelta ; - int64_t pC = Map[pA] ; - if (Map [pA-1] < pC) - { - pC-- ; - Ck_delta [pC] = (Ak_keep [pC] != Ak_keep [pC - 1]) ; - } + pC-- ; + Ck_delta [pC] = (Ak_keep [pC] != Ak_keep [pC - 1]) ; } } } -// HERE - -__global__ void GB_cuda_select_sparse_phase3 +__global__ void GB_cuda_select_sparse_phase4 ( GrB_Matrix A, int64_t cnz, int64_t *Ak_keep, int64_t *Ck_map, - int64_t *Cp, - int64_t *Ch + GB_Cp_TYPE *Cp, + GB_Cj_TYPE *Ch ) { #if ( GB_A_IS_HYPER ) - const int64_t *__restrict__ Ah = A->h; + const GB_Aj_TYPE *__restrict__ Ah = (GB_Aj_TYPE *) A->h; #endif int tid = blockIdx.x * blockDim.x + threadIdx.x ; @@ -193,11 +200,11 @@ __global__ void GB_cuda_select_sparse_phase3 for (int64_t pC = tid; pC < cnz; pC += nthreads) { - if (Ck_map[pC] != Ck_map[pC - 1]) + if (Ck_map [pC] != Ck_map [pC - 1]) { - int64_t kA = Ak_keep[pC] - 1 ; - Cp[Ck_map[pC] - 1] = pC; - Ch[Ck_map[pC] - 1] = GBH_A (Ah, kA); + int64_t kA = Ak_keep [pC] ; + Cp [Ck_map[pC] - 1] = pC ; + Ch [Ck_map[pC] - 1] = GBh_A (Ah, kA) ; } } } @@ -220,14 +227,16 @@ GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) #ifdef GB_JIT_RUNTIME // get callback functions + GB_GET_CALLBACKS ; GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; + GB_bix_alloc_f GB_bix_alloc = my_callback->GB_bix_alloc_func ; #endif //-------------------------------------------------------------------------- // check inputs and declare workspace //-------------------------------------------------------------------------- - + GrB_Info info ; int64_t *W = NULL, *W_2 = NULL, *W_3 = NULL, *Ak_keep = NULL, *Ck_delta = NULL, *Keep = NULL ; @@ -245,7 +254,7 @@ GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) // Phase 1: Keep [p] = 1 if Ai,Ax [p] is kept, 0 otherwise; then cumsum - W = GB_MALLOC_WORK (A->nvals + 1, int64_t, &W_size) ; + W = (int64_t *) GB_MALLOC_MEMORY (A->nvals + 1, sizeof (int64_t), &W_size) ; if (W == NULL) { // out of memory @@ -259,7 +268,7 @@ GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) GB_cuda_select_sparse_phase1 <<>> (Keep, A, ythunk) ; - + CUDA_OK (cudaGetLastError ( )) ; // FIXME add after all kernel launches CUDA_OK (cudaStreamSynchronize (stream)) ; //-------------------------------------------------------------------------- @@ -267,19 +276,26 @@ GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) //-------------------------------------------------------------------------- // in-place cumsum, overwriting Keep with its cumsum, then becomes Map - CUDA_OK (GB_cuda_cumsum (Keep, Keep, A->nvals, stream, + GB_OK (GB_cuda_cumsum (Keep, Keep, A->nvals, stream, GB_CUDA_CUMSUM_INCLUSIVE)) ; CUDA_OK (cudaStreamSynchronize (stream)) ; int64_t *Map = Keep ; // Keep has been replaced with Map cnz = Map [A->nvals - 1] ; // total # of entries kept, for C - // Q: need to allocate space for Cx, Ci? - // If cnz = 0, just need to do Cp [0] = 0, then done? + GB_OK (GB_bix_alloc (C, cnz, GxB_HYPERSPARSE, false, true, GB_ISO_SELECT)) ; + C->nvals = cnz ; + + if (cnz == 0) { + // C is empty; nothing more to do + printf ("C is empty, iso %d\n", C->iso) ; + GB_FREE_WORKSPACE ; + return (GrB_SUCCESS) ; + } // allocate workspace - W_2 = GB_MALLOC_WORK (cnz + 1, int64_t, &W_2_size) ; - W_3 = GB_MALLOC_WORK (cnz + 1, int64_t, &W_3_size) ; + W_2 = (int64_t *) GB_MALLOC_MEMORY (cnz + 1, sizeof (int64_t), &W_2_size) ; + W_3 = (int64_t *) GB_MALLOC_MEMORY (cnz + 1, sizeof (int64_t), &W_3_size) ; if (W_2 == NULL || W_3 == NULL) { // out of memory @@ -295,40 +311,72 @@ GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) W_3 [0] = -1 ; Ak_keep = W_3 + 1 ; + //-------------------------------------------------------------------------- + // Phase 2: Build Ci, Cx, and Ak_keep + //-------------------------------------------------------------------------- + + GB_cuda_select_sparse_phase2 <<>> + (Map, A, Ak_keep, (GB_Ci_TYPE *) C->i, (GB_C_TYPE *) C->x) ; + CUDA_OK (cudaGetLastError ( )) ; + CUDA_OK (cudaStreamSynchronize (stream)) ; //-------------------------------------------------------------------------- - // phase 2: + // phase 3: //-------------------------------------------------------------------------- - // Phase 2: Build Ci, Cx, Ak_keep, and Ck_delta - GB_cuda_select_sparse_phase2 <<>> - (Map, A, Ak_keep, Ck_delta, Ci, Cx) ; - + // Phase 3a: Build Ck_delta + GB_cuda_select_sparse_phase3 <<>> + (A->nvals, Map, Ak_keep, Ck_delta) ; + CUDA_OK (cudaGetLastError ( )) ; CUDA_OK (cudaStreamSynchronize (stream)) ; // Cumsum over Ck_delta array to get Ck_map // Can reuse `Keep` to avoid a malloc - //-------------------------------------------------------------------------- - // phase2b: Ck_map = cumsum (Ck_delta) - //-------------------------------------------------------------------------- - CUDA_OK (GB_cuda_cumsum (Keep, Ck_delta, cnz, stream, + // Phase 3b: Ck_map = cumsum (Ck_delta) + GB_OK (GB_cuda_cumsum (Keep, Ck_delta, cnz, stream, GB_CUDA_CUMSUM_INCLUSIVE)) ; + CUDA_OK (cudaStreamSynchronize (stream)) ; int64_t *Ck_map = Keep; - int64_t cnk = Ck_map [cnz - 1] ; - - // Q: Need to allocate space for Cp, Ch? + int64_t cnvec = Ck_map [cnz - 1] ; + + // The caller has already allocated C->p, C->h for + // a user-returnable empty hypersparse matrix. + // Free them here before updating. + GB_FREE_MEMORY (&(C->p), C->p_size) ; + GB_FREE_MEMORY (&(C->h), C->h_size) ; + + // Allocate Cp, Ch, finalize matrix + C->plen = cnvec ; + C->nvec = cnvec ; + C->nvec_nonempty = cnvec ; // FIXME + C->nvals = cnz ; + C->p = (GB_Cp_TYPE *) GB_MALLOC_MEMORY (C->plen + 1, sizeof (GB_Cp_TYPE), + &(C->p_size)) ; + C->h = (GB_Cj_TYPE *) GB_MALLOC_MEMORY (C->plen, sizeof (GB_Cj_TYPE), + &(C->h_size)) ; + if (C->p == NULL || C->h == NULL) + { + // The contents of C will be freed with GB_phybix_free() + // in the caller (GB_cuda_select_sparse()) upon returning + // an error. + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + GB_Cp_TYPE *Cp = (GB_Cp_TYPE *) C->p ; //-------------------------------------------------------------------------- // Phase 3: Build Cp and Ch //-------------------------------------------------------------------------- - GB_cuda_select_sparse_phase3 <<>> - (A, cnz, Ak_keep, Ck_map, Cp, Ch) ; + GB_cuda_select_sparse_phase4 <<>> + (A, cnz, Ak_keep, Ck_map, Cp, (GB_Cj_TYPE *) C->h) ; + CUDA_OK (cudaGetLastError ( )) ; CUDA_OK (cudaStreamSynchronize (stream)) ; - + // log the end of the last vector of C + // FIXME: isn't this just Cp [cnvec] = cnz? Cp [Ck_map [cnz - 1]] = cnz; GB_FREE_ALL ; diff --git a/GraphBLAS/Config/GB_JITpackage_NJIT.c.in b/GraphBLAS/Config/GB_JITpackage_NJIT.c.in index fd409bdd9b..1f62848d0c 100644 --- a/GraphBLAS/Config/GB_JITpackage_NJIT.c.in +++ b/GraphBLAS/Config/GB_JITpackage_NJIT.c.in @@ -2,7 +2,7 @@ // GB_JITpackage.c: packaged GraphBLAS source code for the JIT (empty case) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Config/GB_config.h.in b/GraphBLAS/Config/GB_config.h.in index 513cc40f94..64b94350c3 100644 --- a/GraphBLAS/Config/GB_config.h.in +++ b/GraphBLAS/Config/GB_config.h.in @@ -2,7 +2,7 @@ // GraphBLAS/Config/GB_config.h: JIT configuration for GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Config/GB_prejit.c b/GraphBLAS/Config/GB_prejit.c index fb96f15970..f1f5424844 100644 --- a/GraphBLAS/Config/GB_prejit.c +++ b/GraphBLAS/Config/GB_prejit.c @@ -2,7 +2,7 @@ // GraphBLAS/Config/GB_prejit.c: return list of PreJIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ #include "GB.h" #include "jitifyer/GB_jitifyer.h" #include "jit_kernels/include/GB_jit_kernel_proto.h" +#include "include/GB_pedantic_disable.h" //------------------------------------------------------------------------------ // prototypes for all PreJIT kernels diff --git a/GraphBLAS/Config/GB_prejit.c.in b/GraphBLAS/Config/GB_prejit.c.in index b186005008..3f5cc98058 100644 --- a/GraphBLAS/Config/GB_prejit.c.in +++ b/GraphBLAS/Config/GB_prejit.c.in @@ -2,7 +2,7 @@ // GraphBLAS/Config/GB_prejit.c: return list of PreJIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ #include "GB.h" #include "jitifyer/GB_jitifyer.h" #include "jit_kernels/include/GB_jit_kernel_proto.h" +#include "include/GB_pedantic_disable.h" //------------------------------------------------------------------------------ // prototypes for all PreJIT kernels diff --git a/GraphBLAS/Config/GraphBLAS.h.in b/GraphBLAS/Config/GraphBLAS.h.in index d6c7911717..f870f10d25 100644 --- a/GraphBLAS/Config/GraphBLAS.h.in +++ b/GraphBLAS/Config/GraphBLAS.h.in @@ -318,6 +318,15 @@ "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" +//------------------------------------------------------------------------------ +// simplify the use of GraphBLAS.h in C++ programs +//------------------------------------------------------------------------------ + +#if defined ( __cplusplus ) +extern "C" +{ +#endif + //============================================================================== // GrB_Index: the GraphBLAS integer //============================================================================== @@ -329,7 +338,7 @@ typedef uint64_t GrB_Index ; // GrB_INDEX_MAX is the largest permissible index value. The largest valid // matrix or vector dimension is GrB_INDEX_MAX+1, or 2^60 in SuiteSparse:GrB. -#define GrB_INDEX_MAX ((GrB_Index) (1ULL << 60) - 1) +#define GrB_INDEX_MAX ((uint64_t) (1ULL << 60) - 1) //============================================================================== // GraphBLAS error and informational codes @@ -340,7 +349,7 @@ typedef uint64_t GrB_Index ; // called, which returns a string that provides more information on the last // return value from GraphBLAS. -typedef enum +typedef enum // GrB_Info { GrB_SUCCESS = 0, // all is well @@ -358,7 +367,7 @@ typedef enum GrB_UNINITIALIZED_OBJECT = -1, // object has not been initialized GrB_NULL_POINTER = -2, // input pointer is NULL - GrB_INVALID_VALUE = -3, // generic error; some value is bad + GrB_INVALID_VALUE = -3, // general error; some value is bad GrB_INVALID_INDEX = -4, // row or column index is out of bounds GrB_DOMAIN_MISMATCH = -5, // object domains are not compatible GrB_DIMENSION_MISMATCH = -6, // matrix dimensions do not match @@ -371,7 +380,9 @@ typedef enum GrB_INVALID_OBJECT = -104, // object is corrupted GrB_INDEX_OUT_OF_BOUNDS = -105, // row or col index out of bounds GrB_EMPTY_OBJECT = -106, // an object does not contain a value - GxB_JIT_ERROR = -1001, // JIT compiler/loader error + GxB_JIT_ERROR = -7001, // JIT compiler/loader error + GxB_GPU_ERROR = -7002, // GPU error (future; not yet in production) + GxB_OUTPUT_IS_READONLY = -7003, // output matrix has readonly components } GrB_Info ; @@ -395,7 +406,7 @@ GrB_Info ; // 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 +typedef enum // GrB_Mode { GrB_NONBLOCKING = 0, // methods may return with pending computations GrB_BLOCKING = 1, // no computations are ever left pending @@ -405,6 +416,35 @@ typedef enum } GrB_Mode ; +//============================================================================== +// GraphBLAS opaque objects +//============================================================================== + +// GraphBLAS relies on opaque objects for most of its data structures. The +// content of these objects are not accessible to the user application. + +// 11 objects in the GraphBLAS C API: +typedef struct GB_Descriptor_opaque *GrB_Descriptor ; +typedef struct GB_Type_opaque *GrB_Type ; +typedef struct GB_UnaryOp_opaque *GrB_UnaryOp ; +typedef struct GB_BinaryOp_opaque *GrB_BinaryOp ; +typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp ; +typedef struct GB_Monoid_opaque *GrB_Monoid ; +typedef struct GB_Semiring_opaque *GrB_Semiring ; +typedef struct GB_Scalar_opaque *GrB_Scalar ; +typedef struct GB_Vector_opaque *GrB_Vector ; +typedef struct GB_Matrix_opaque *GrB_Matrix ; +typedef struct GB_Global_opaque *GrB_Global ; + +// 3 objects in the SuiteSparse extensions: +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; +typedef struct GB_Context_opaque *GxB_Context ; +typedef struct GB_Iterator_opaque *GxB_Iterator ; + +// 2 historical objects +typedef struct GB_SelectOp_opaque *GxB_SelectOp ; // use GrB_IndexUnaryOp +typedef struct GB_Scalar_opaque *GxB_Scalar ; // use GrB_Scalar + //============================================================================== // GrB_Descriptor: the GraphBLAS descriptor //============================================================================== @@ -487,7 +527,7 @@ GrB_Mode ; // GPU control (DRAFT: in progress, do not use) #define GxB_GPU_ID 7088 -typedef enum +typedef enum // GrB_Desc_Field ; { GrB_OUTP = 0, // descriptor for output of a method GrB_MASK = 1, // descriptor for the mask input of a method @@ -496,11 +536,14 @@ typedef enum GxB_AxB_METHOD = 7090, // descriptor for selecting C=A*B algorithm GxB_SORT = 7091, // control sort in GrB_mxm GxB_COMPRESSION = 7092, // select compression for serialize - GxB_IMPORT = 7093, // secure vs fast GxB_pack + GxB_IMPORT = 7093, // secure vs fast GxB_pack (historical) + GxB_ROWINDEX_LIST = 7094, // how GrB_Vector I is intrepretted + GxB_COLINDEX_LIST = 7095, // how GrB_Vector J is intrepretted + GxB_VALUE_LIST = 7096, // how GrB_Vector X is intrepretted } GrB_Desc_Field ; -typedef enum +typedef enum // GrB_Desc_Value ; { // for all GrB_Descriptor fields: GrB_DEFAULT = 0, // default behavior of the method @@ -523,15 +566,21 @@ typedef enum GxB_AxB_HASH = 7084, // hash-based saxpy method GxB_AxB_SAXPY = 7085, // saxpy method (any kind) - // for GxB_IMPORT only: - GxB_SECURE_IMPORT = 7080 // GxB*_pack* methods trust their input data + // for GxB_IMPORT only: (historical) + GxB_SECURE_IMPORT = 7080, // GxB*_pack* methods trust their input data + + // for GxB_ROWINDEX_LIST, GxB_COLINDEX_LIST, and GxB_VALUE_LIST: + // GxB_USE_VALUES = ((int) GrB_DEFAULT) // use the values of the vector + GxB_USE_INDICES = 7060, // use the indices of the vector + GxB_IS_STRIDE = 7061, // use the values, of size 3, for lo:hi:inc } GrB_Desc_Value ; // default for GxB pack is to trust the input data -#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) +#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) /* historical */ -typedef struct GB_Descriptor_opaque *GrB_Descriptor ; +// settings for GxB_ROWINDEX_LIST, GxB_COLINDEX_LIST, and GxB_VALUE_LIST: +#define GxB_USE_VALUES ((int) GrB_DEFAULT) /* use the values of the vector */ // Predefined descriptors and their values: @@ -595,8 +644,6 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN // GrB_Type: data types //============================================================================== -typedef struct GB_Type_opaque *GrB_Type ; - // GraphBLAS predefined types and their counterparts in pure C: GB_GLOBAL GrB_Type GrB_BOOL , // in C: bool @@ -627,7 +674,7 @@ GB_GLOBAL GrB_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 ; +typedef void (*GxB_unary_function) (void *, const void *) ; //------------------------------------------------------------------------------ // built-in unary operators, z = f(x) @@ -789,8 +836,6 @@ GB_GLOBAL GrB_UnaryOp GxB_ISFINITE_FC32, // isfinite (real (x)) && isfinite (cimag (x)) GxB_ISFINITE_FC64 ; // isfinite (real (x)) && isfinite (cimag (x)) -typedef void (*GxB_unary_function) (void *, const void *) ; - //============================================================================== // GrB_BinaryOp: binary operators //============================================================================== @@ -802,7 +847,7 @@ typedef void (*GxB_unary_function) (void *, const void *) ; // 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 ; +typedef void (*GxB_binary_function) (void *, const void *, const void *) ; //------------------------------------------------------------------------------ // built-in binary operators, z = f(x,y), where x,y,z all have the same type @@ -1190,8 +1235,6 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; // BXOR, and BXNOR. This assumes that the computations for each bit are // entirely independent (so BSHIFT would not fit in the table above). -typedef void (*GxB_binary_function) (void *, const void *, const void *) ; - //============================================================================== // GxB_IndexBinaryOp: index binary operators //============================================================================== @@ -1207,8 +1250,6 @@ typedef void (*GxB_binary_function) (void *, const void *, const void *) ; // ztype, xtype, ytype, and theta_type, respectively. // for examples. -typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; - typedef void (*GxB_index_binary_function) (void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, @@ -1222,8 +1263,6 @@ typedef void (*GxB_index_binary_function) (void *, // value of the A(i,j) entry, i and j are its row and column index, and y // is a scalar. For vectors, it has the form z = f(vi, i, 0, y). -typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp ; - typedef void (*GxB_index_unary_function) ( void *z, // output value z, of type ztype @@ -1233,9 +1272,6 @@ typedef void (*GxB_index_unary_function) const void *y // input scalar y ) ; -// GxB_SelectOp: use GrB_IndexUnaryOp instead -typedef struct GB_SelectOp_opaque *GxB_SelectOp ; // Historical; do not use - //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices //============================================================================== @@ -1321,60 +1357,91 @@ GB_GLOBAL GrB_IndexUnaryOp GrB_VALUEGE_INT64, GrB_VALUEGE_UINT64 ; //============================================================================== -// GrB_Monoid +// SuiteSparse:GraphBLAS options //============================================================================== -// A monoid is an associative operator z=op(x,y) where all three types of z, x, -// and y are identical. The monoid also has an identity element, such that -// op(x,identity) = op(identity,x) = x. +// The following options modify how SuiteSparse:GraphBLAS stores and operates +// on its matrices. The GrB_get/set methods allow the user to suggest how the +// internal representation of a matrix, or all matrices, should be held. These +// options have no effect on the result (except for minor roundoff differences +// for floating-point types). They only affect the time and memory usage of the +// computations. -typedef struct GB_Monoid_opaque *GrB_Monoid ; +typedef enum // GxB_Option_Field ; +{ -//============================================================================== -// GrB_Semiring -//============================================================================== + //-------------------------------------------------------------------------- + // GrB enums in the C API + //-------------------------------------------------------------------------- -typedef struct GB_Semiring_opaque *GrB_Semiring ; + // GrB_Descriptor only, get/set: + GrB_OUTP_FIELD = 0, // descriptor for output of a method + GrB_MASK_FIELD = 1, // descriptor for the mask input of a method + GrB_INP0_FIELD = 2, // descriptor for the first input of a method + GrB_INP1_FIELD = 3, // descriptor for the second input of a method -//============================================================================== -// GrB_Scalar: a GraphBLAS scalar -//============================================================================== + // all objects, including GrB_GLOBAL, get/set (but only get for global): + GrB_NAME = 10, // name of the object, as a string -typedef struct GB_Scalar_opaque *GrB_Scalar ; + // GrB_GLOBAL, get only: + GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, // C API version + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, // GrB_Mode -// GxB_Scalar: use GrB_Scalar instead (as-is) -typedef struct GB_Scalar_opaque *GxB_Scalar ; // Historical, do not use. + // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar, get/set: + GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation -//============================================================================== -// GrB_Vector: a GraphBLAS vector -//============================================================================== + // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize), get only: + GrB_EL_TYPE_CODE = 102, // a GrB_Type_Code (see below) + GrB_EL_TYPE_STRING = 106, // name of the type -typedef struct GB_Vector_opaque *GrB_Vector ; + // GrB_*Op, GrB_Monoid, and GrB_Semiring, get only: + GrB_INP0_TYPE_CODE = 103, // GrB_Type_Code + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, // name of the type, as a string + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, -//============================================================================== -// GrB_Matrix: a GraphBLAS matrix -//============================================================================== + // GrB_Type, get only: + GrB_SIZE = 110, // size of the type -typedef struct GB_Matrix_opaque *GrB_Matrix ; + //-------------------------------------------------------------------------- + // SuiteSparse extensions: + //-------------------------------------------------------------------------- -//============================================================================== -// SuiteSparse:GraphBLAS options -//============================================================================== + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp, get/set: + GxB_JIT_C_NAME = 7041, // C type or function name + GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition -// The following options modify how SuiteSparse:GraphBLAS stores and operates -// on its matrices. The GrB_get/set methods allow the user to suggest how the -// internal representation of a matrix, or all matrices, should be held. These -// options have no effect on the result (except for minor roundoff differences -// for floating-point types). They only affect the time and memory usage of the -// computations. + // GrB_Monoid and GrB_Semiring, get only: + GxB_MONOID_IDENTITY = 7043, // monoid identity value + GxB_MONOID_TERMINAL = 7044, // monoid terminal value + GxB_MONOID_OPERATOR = 7045, // monoid binary operator -typedef enum // for global options or matrix options -{ + // GrB_Semiring, get only: + GxB_SEMIRING_MONOID = 7046, // semiring monoid + GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp, get only:: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring, get only: + GxB_THETA = 7052, // to get the value of theta //------------------------------------------------------------ - // GrB_get / GrB_set for GrB_Matrix and GrB_GLOBAL: + // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar: get/set //------------------------------------------------------------ + GxB_ROWINDEX_INTEGER_HINT = 7053, // hint for row indices + GxB_COLINDEX_INTEGER_HINT = 7054, // hint for column indices + GxB_OFFSET_INTEGER_HINT = 7056, // hint for offsets GxB_HYPER_SWITCH = 7000, // switch to hypersparse (double value) GxB_HYPER_HASH = 7048, // hyper_hash control (global int64 value, // or bool per matrix) @@ -1382,7 +1449,28 @@ typedef enum // for global options or matrix options GxB_FORMAT = 7002, // Historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ - // GrB_get for GrB_GLOBAL: + // GrB_Matrix, GrB_Vector, GrB_Scalar: get/set + //------------------------------------------------------------ + + GxB_ISO = 7079, // get: returns the current iso status + // set true: make the matrix iso-valued, if possible. + // set false: make the matrix non-iso-valued. + GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below + + //------------------------------------------------------------ + // GrB_Matrix, GrB_Vector, GrB_Scalar: get only + //------------------------------------------------------------ + + GxB_ROWINDEX_INTEGER_BITS = 7057, // # bits for row indices + GxB_COLINDEX_INTEGER_BITS = 7058, // # bits for column indices + GxB_OFFSET_INTEGER_BITS = 7059, // # bits for offsets + GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) + GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS + GxB_IS_READONLY = 7078, // true if it has any readonly components + GxB_WILL_WAIT = 7076, // true if GrB_wait(A) will do anything + + //------------------------------------------------------------ + // GrB_GLOBAL, get only: //------------------------------------------------------------ GxB_MODE = 7003, // Historical; use GrB_BLOCKING_MODE @@ -1419,6 +1507,8 @@ typedef enum // for global options or matrix options GxB_FLUSH = 7021, // flush function diagnostic output GxB_MEMORY_POOL = 7022, // no longer used GxB_PRINT_1BASED = 7023, // print matrices as 0-based or 1-based + GxB_INCLUDE_READONLY_STATISTICS = 7077, // include readonly memory in + // memory usage statistics GxB_JIT_C_COMPILER_NAME = 7024, // CPU JIT C compiler name GxB_JIT_C_COMPILER_FLAGS = 7025, // CPU JIT C compiler flags @@ -1433,23 +1523,10 @@ typedef enum // for global options or matrix options GxB_JIT_CUDA_PREFACE = 7100, // CUDA JIT C++ preface - //------------------------------------------------------------ - // GrB_get for GrB_Matrix: - //------------------------------------------------------------ - - GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) - GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS - - //------------------------------------------------------------ - // GrB_get/GrB_set for GrB_Matrix: - //------------------------------------------------------------ - - GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below - } GxB_Option_Field ; // for GxB_JIT_C_CONTROL: -typedef enum +typedef enum // GxB_JIT_Control ; { GxB_JIT_OFF = 0, // do not use the JIT: free all JIT kernels if loaded GxB_JIT_PAUSE = 1, // do not run JIT kernels but keep any loaded @@ -1539,12 +1616,10 @@ GB_GLOBAL const double GxB_ALWAYS_HYPER, GxB_NEVER_HYPER ; // GxB_Context: for managing computational resources //============================================================================== -typedef struct GB_Context_opaque *GxB_Context ; - // GxB_CONTEXT_WORLD is the default Context for all user threads. GB_GLOBAL GxB_Context GxB_CONTEXT_WORLD ; -typedef enum +typedef enum // GxB_Context_Field { GxB_CONTEXT_NTHREADS = GxB_NTHREADS, // max number of threads to use. // If <= 0, then one thread is used. @@ -1561,80 +1636,9 @@ GxB_Context_Field ; // GrB_set and GrB_get //============================================================================== -typedef struct GB_Global_opaque *GrB_Global ; GB_GLOBAL const GrB_Global GrB_GLOBAL ; -typedef enum -{ - - //-------------------------------------------------------------------------- - // GrB enums in the C API - //-------------------------------------------------------------------------- - - // GrB_Descriptor only: - GrB_OUTP_FIELD = 0, // descriptor for output of a method - GrB_MASK_FIELD = 1, // descriptor for the mask input of a method - GrB_INP0_FIELD = 2, // descriptor for the first input of a method - GrB_INP1_FIELD = 3, // descriptor for the second input of a method - - // all objects, including GrB_GLOBAL: - GrB_NAME = 10, // name of the object, as a string - - // GrB_GLOBAL only: - GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version - GrB_LIBRARY_VER_MINOR = 12, - GrB_LIBRARY_VER_PATCH = 13, - GrB_API_VER_MAJOR = 14, // C API version - GrB_API_VER_MINOR = 15, - GrB_API_VER_PATCH = 16, - GrB_BLOCKING_MODE = 17, // GrB_Mode - - // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar: - GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation - - // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize): - GrB_EL_TYPE_CODE = 102, // a GrB_Type_Code (see below) - GrB_EL_TYPE_STRING = 106, // name of the type - - // GrB_*Op, GrB_Monoid, and GrB_Semiring: - GrB_INP0_TYPE_CODE = 103, // GrB_Type_Code - GrB_INP1_TYPE_CODE = 104, - GrB_OUTP_TYPE_CODE = 105, - GrB_INP0_TYPE_STRING = 107, // name of the type, as a string - GrB_INP1_TYPE_STRING = 108, - GrB_OUTP_TYPE_STRING = 109, - - // GrB_Type (readable only): - GrB_SIZE = 110, // size of the type - - //-------------------------------------------------------------------------- - // SuiteSparse extensions: - //-------------------------------------------------------------------------- - - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, - // and GxB_IndexBinaryOp - GxB_JIT_C_NAME = 7041, // C type or function name - GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition - - // GrB_Monoid and GrB_Semiring: - GxB_MONOID_IDENTITY = 7043, // monoid identity value - GxB_MONOID_TERMINAL = 7044, // monoid terminal value - GxB_MONOID_OPERATOR = 7045, // monoid binary operator - - // GrB_Semiring only: - GxB_SEMIRING_MONOID = 7046, // semiring monoid - GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op - - // GrB_BinaryOp and GxB_IndexBinaryOp: - GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops - GxB_THETA_TYPE_STRING = 7051, - - // GrB_BinaryOp or GrB_Semiring: - GxB_THETA = 7052, // to get the value of theta -} -GrB_Field ; - -typedef enum +typedef enum // GrB_Orientation { GrB_ROWMAJOR = 0, GrB_COLMAJOR = 1, @@ -1643,7 +1647,7 @@ typedef enum } GrB_Orientation ; -typedef enum +typedef enum // GrB_Type_Code { GrB_UDT_CODE = 0, // user-defined type GrB_BOOL_CODE = 1, // GraphBLAS: GrB_BOOL C: bool @@ -1666,20 +1670,17 @@ GrB_Type_Code ; // GrB_wait: finish computations //============================================================================== -typedef enum +typedef enum // GrB_WaitMode { - GrB_COMPLETE = 0, // establishes a happens-before relation; work may - // remain to compute the object but this can now - // be done safely by any user thread. - GrB_MATERIALIZE = 1 // all work on the object is finished (also - // establishes a happens-before relation). The - // object can be safely be used as an input to a - // GraphBLAS method by multiple user threads at - // the same time. For example, the A or B matrices - // of GrB_mxm can be shared by 2 user threads, but - // their output matrices C must be different. -} -GrB_WaitMode ; + GrB_COMPLETE = 0, // Establishes a happens-before relation; work may + // remain but this can now be done safely by any user thread. + GrB_MATERIALIZE = 1 // All work on the object is finished (also + // establishes a happens-before relation). The object can be safely be + // used as an input to a GraphBLAS method by multiple user threads at + // the same time. For example, the A or B matrices of GrB_mxm can be + // shared by 2 user threads, but their output matrices C must be + // different. +} GrB_WaitMode ; //============================================================================== // GrB_extract: extract a submatrix or subvector @@ -1688,7 +1689,9 @@ GrB_WaitMode ; GB_GLOBAL const uint64_t *GrB_ALL ; // These special values of ni and nj can be used for GrB_assign, -// GrB_extract, and GxB_subassign. +// GrB_extract, and GxB_subassign, when I and J are uint64_t * arrays. +// For GrB_Vector inputs, use the GxB_ROWINDEX_LIST and GxB_COLINDEX_LIST +// descriptor settings instead. #define GxB_RANGE (INT64_MAX) #define GxB_STRIDE (INT64_MAX-1) #define GxB_BACKWARDS (INT64_MAX-2) @@ -1704,6 +1707,10 @@ GB_GLOBAL const uint64_t *GrB_ALL ; // GrB_Monoid: built-in monoids //============================================================================== +// A monoid is an associative operator z=op(x,y) where all three types of z, x, +// and y are identical. The monoid also has an identity element, such that +// op(x,identity) = op(identity,x) = x. + GB_GLOBAL GrB_Monoid //-------------------------------------------------------------------------- @@ -2583,7 +2590,7 @@ GB_GLOBAL GrB_Semiring // GxB_fprint and GxB_print: print the contents of a GraphBLAS object //============================================================================== -typedef enum +typedef enum // GxB_Print_Level { GxB_SILENT = 0, // nothing is printed, just check the object GxB_SUMMARY = 1, // print a terse summary @@ -2599,7 +2606,7 @@ GxB_Print_Level ; //============================================================================== // The GrB C API specification supports 3 formats: -typedef enum +typedef enum // GrB_Format { GrB_CSR_FORMAT = 0, // CSR format (equiv to GxB_SPARSE with GxB_BY_ROW) GrB_CSC_FORMAT = 1, // CSC format (equiv to GxB_SPARSE with GxB_BY_COL) @@ -2607,7 +2614,7 @@ typedef enum } GrB_Format ; -typedef enum +typedef enum // GxB_Format_Value { GxB_BY_ROW = 0, // matrix is held by row GxB_BY_COL = 1, // matrix is held by column @@ -2619,7 +2626,7 @@ GxB_Format_Value ; // const, so that if SuiteSparse:GraphBLAS is recompiled with a different // default format, and the application is relinked but not recompiled, it will // acquire the new default values. -GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; +GB_GLOBAL const int GxB_FORMAT_DEFAULT ; //============================================================================== // serialize/deserialize compression levels @@ -2641,11 +2648,6 @@ GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; // GraphBLAS/CUDA, since they do not need access these definitions. User // applications have access to these methods. -#if defined ( __cplusplus ) -extern "C" -{ -#endif - #ifndef GB_CUDA_FOLDER //============================================================================== @@ -2654,13 +2656,12 @@ extern "C" GrB_Info GrB_init // start up GraphBLAS ( - GrB_Mode mode // blocking or non-blocking mode, no GPU + int mode // blocking or non-blocking mode, no GPU (GrB_Mode) ) ; GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc ( - GrB_Mode mode, // blocking or non-blocking mode, - // with or without GPU + int mode, // blocking or non-blocking mode (GrB_Mode) // pointers to memory management functions void * (* user_malloc_function ) (size_t), void * (* user_calloc_function ) (size_t, size_t), @@ -2679,11 +2680,6 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -GrB_Info GrB_Descriptor_free // free a descriptor -( - GrB_Descriptor *descriptor // handle of descriptor to free -) ; - //============================================================================== // helper macros for polymorphic functions //============================================================================== @@ -2740,6 +2736,23 @@ GrB_Info GrB_Descriptor_free // free a descriptor const void * : GB_CONCAT ( prefix, _, func, _UDT ), \ void * : GB_CONCAT ( prefix, _, func, _UDT ) +// declare 14 methods, one for each C type and the user type (void *) +#define GB_DECLARE_14(prefix,user_type) \ +GB_DECLARE (prefix, _BOOL , bool ) \ +GB_DECLARE (prefix, _INT8 , int8_t ) \ +GB_DECLARE (prefix, _INT16 , int16_t ) \ +GB_DECLARE (prefix, _INT32 , int32_t ) \ +GB_DECLARE (prefix, _INT64 , int64_t ) \ +GB_DECLARE (prefix, _UINT8 , uint8_t ) \ +GB_DECLARE (prefix, _UINT16, uint16_t ) \ +GB_DECLARE (prefix, _UINT32, uint32_t ) \ +GB_DECLARE (prefix, _UINT64, uint64_t ) \ +GB_DECLARE (prefix, _FP32 , float ) \ +GB_DECLARE (prefix, _FP64 , double ) \ +GB_DECLARE (GxB_ , _FC32 , GxB_FC32_t) \ +GB_DECLARE (GxB_ , _FC64 , GxB_FC64_t) \ +GB_DECLARE (prefix, _UDT , user_type ) + //============================================================================== // GrB_Type: data types //============================================================================== @@ -2790,11 +2803,6 @@ GrB_Info GxB_Type_from_name // return the built-in GrB_Type from a name const char *type_name // array of size at least GxB_MAX_NAME_LEN ) ; -GrB_Info GrB_Type_free // free a user-defined type -( - GrB_Type *type // handle of user-defined type to free -) ; - //============================================================================== // GrB_UnaryOp: unary operators //============================================================================== @@ -2819,11 +2827,6 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -GrB_Info GrB_UnaryOp_free // free a user-created unary operator -( - GrB_UnaryOp *unaryop // handle of unary operator to free -) ; - //============================================================================== // GrB_BinaryOp: binary operators //============================================================================== @@ -2850,11 +2853,6 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -GrB_Info GrB_BinaryOp_free // free a user-created binary operator -( - GrB_BinaryOp *binaryop // handle of binary operator to free -) ; - //============================================================================== // GxB_IndexBinaryOp: index binary operators //============================================================================== @@ -2872,11 +2870,6 @@ GrB_Info GxB_IndexBinaryOp_new const char *idxbinop_defn // definition of the user function ) ; -GrB_Info GxB_IndexBinaryOp_free // free a user-created index binary operator -( - GxB_IndexBinaryOp *op // handle of index binary operator to free -) ; - // GxB_BinaryOp_new_IndexOp: create a new binary op from an index binary op GrB_Info GxB_BinaryOp_new_IndexOp ( @@ -2911,7251 +2904,3125 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp -( - GrB_IndexUnaryOp *op // handle of IndexUnary to free -) ; +//============================================================================== +// GrB_Monoid: an associate & commutative binary op +//============================================================================== + +// A GrB_Monoid consists of a GrB_BinaryOp and an identity value. The op must +// be associative and commutative (but this cannot be checked). It cannot be +// based on a GxB_IndexBinaryOp. +// +// GrB_Info GrB_Monoid_new_TYPE // create a monoid +// ( +// GrB_Monoid *monoid, // handle of monoid to create +// GrB_BinaryOp op, // binary operator of the monoid +// identity // identity value of the monoid +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Monoid_new ## suffix /* create a new monoid */ \ +( \ + GrB_Monoid *monoid, /* handle of monoid to create */ \ + GrB_BinaryOp op, /* binary operator of the monoid */ \ + type identity /* identity value of the monoid */ \ +) ; +GB_DECLARE_14 (GrB_, void *) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_Monoid_new(monoid,op,identity) \ + _Generic ((identity), GB_CASES (GrB, Monoid_new)) (monoid, op, identity) +#endif + +// GxB_Monoid_terminal_new is identical to GrB_Monoid_new, except that a +// terminal value can be specified. The terminal may be NULL, which indicates +// no terminal value (and in this case, it is identical to GrB_Monoid_new). +// The terminal value, if not NULL, must have the same type as the identity. +// +// GrB_Info GxB_Monoid_terminal_new_TYPE // create a terminal monoid +// ( +// GrB_Monoid *monoid, // handle of monoid to create +// GrB_BinaryOp op, // binary operator of the monoid +// identity, // identity value of the monoid +// terminal // terminal value of the monoid +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Monoid_terminal_new ## suffix /* create a new termainal monoid */\ +( \ + GrB_Monoid *monoid, /* handle of monoid to create */ \ + GrB_BinaryOp op, /* binary operator of the monoid */ \ + type identity, /* identity value of the monoid */ \ + type terminal /* terminal value of the monoid */ \ +) ; +GB_DECLARE_14 (GxB_, void *) + +#if GxB_STDC_VERSION >= 201112L +#define GxB_Monoid_terminal_new(monoid,op,identity,terminal) \ + _Generic ((identity), GB_CASES (GxB, Monoid_terminal_new)) \ + (monoid, op, identity, terminal) +#endif //============================================================================== -// GrB_Monoid +// GrB_Semiring //============================================================================== -// The GrB_BinaryOp must be associative and commutative (but this cannot be -// checked). It cannot be based on a GxB_IndexBinaryOp. +// The multiply op can be any GrB_BinaryOp, including those based on a +// GxB_IndexBinaryOp. -GrB_Info GrB_Monoid_new_BOOL // create a new boolean monoid +GrB_Info GrB_Semiring_new // create a semiring ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - bool identity // identity value of the monoid + GrB_Semiring *semiring, // handle of semiring to create + GrB_Monoid add, // add monoid of the semiring + GrB_BinaryOp multiply // multiply operator of the semiring ) ; -GrB_Info GrB_Monoid_new_INT8 // create a new int8 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int8_t identity // identity value of the monoid -) ; +//============================================================================== +// GrB_Scalar: a GraphBLAS scalar +//============================================================================== -GrB_Info GrB_Monoid_new_UINT8 // create a new uint8 monoid +// These methods create, free, copy, and clear a GrB_Scalar. The nvals, +// and type methods return basic information about a GrB_Scalar. + +GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint8_t identity // identity value of the monoid + GrB_Scalar *s, // handle of GrB_Scalar to create + GrB_Type type // type of GrB_Scalar to create ) ; -GrB_Info GrB_Monoid_new_INT16 // create a new int16 monoid +GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int16_t identity // identity value of the monoid + GrB_Scalar *s, // handle of output GrB_Scalar to create + const GrB_Scalar t // input GrB_Scalar to copy ) ; -GrB_Info GrB_Monoid_new_UINT16 // create a new uint16 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint16_t identity // identity value of the monoid +GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry +( // type remains unchanged. + GrB_Scalar s // GrB_Scalar to clear ) ; -GrB_Info GrB_Monoid_new_INT32 // create a new int32 monoid +GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int32_t identity // identity value of the monoid + GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_UINT32 // create a new uint32 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint32_t identity // identity value of the monoid -) ; - -GrB_Info GrB_Monoid_new_INT64 // create a new int64 monoid +GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int64_t identity // identity value of the monoid + size_t *size, // # of bytes used by the scalar s + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_UINT64 // create a new uint64 monoid +GrB_Info GxB_Scalar_type // get the type of a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint64_t identity // identity value of the monoid + GrB_Type *type, // returns the type of the GrB_Scalar + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_FP32 // create a new float monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - float identity // identity value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Scalar_setElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Monoid_new_FP64 // create a new double monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - double identity // identity value of the monoid -) ; +// Set a single GrB_Scalar s, from a user scalar x: s = x, typecasting from the +// type of x to the type of w as needed. +// +// GrB_Info GrB_Scalar_setElement_TYPE // s = x +// ( +// GrB_Scalar s, // GrB_Scalar to modify +// x // user scalar to assign to s +// ) ; -GrB_Info GxB_Monoid_new_FC32 // create a new float complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC32_t identity // identity value of the monoid +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Scalar_setElement ## suffix /* s = x */ \ +( \ + GrB_Scalar s, /* GrB_Scalar to modify */ \ + type x /* user scalar to assign to s */ \ ) ; +GB_DECLARE_14 (GrB_, void *) -GrB_Info GxB_Monoid_new_FC64 // create a new double complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC64_t identity // identity value of the monoid -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Scalar_setElement(s,x) \ + _Generic ((x), GB_CASES (GrB, Scalar_setElement)) (s, x) +#endif -GrB_Info GrB_Monoid_new_UDT // create a monoid with a user-defined type -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - void *identity // identity value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Scalar_extractElement +//------------------------------------------------------------------------------ -// Type-generic method for creating a new monoid: +// Extract a single entry from a GrB_Scalar, x = s, typecasting from the type +// of s to the type of x as needed. +// +// GrB_Info GrB_Scalar_extractElement_TYPE // x = s +// ( +// *x, // user scalar extracted +// const GrB_Scalar s // GrB_Scalar to extract an entry from +// ) ; -/* -GrB_Info GrB_Monoid_new // create a monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity // identity value of the monoid +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Scalar_extractElement ## suffix /* x = s */ \ +( \ + type *x, /* user scalar extracted */ \ + const GrB_Scalar s /* GrB_Scalar to extract an entry from */ \ ) ; -*/ +GB_DECLARE_14 (GrB_, void) #if GxB_STDC_VERSION >= 201112L -#define GrB_Monoid_new(monoid,op,identity) \ - _Generic \ - ( \ - (identity), \ - GB_CASES (GrB, Monoid_new) \ - ) \ - (monoid, op, identity) +#define GrB_Scalar_extractElement(x,s) \ + _Generic ((x), GB_PCASES (GrB, Scalar_extractElement)) (x, s) #endif -// GxB_Monoid_terminal_new is identical to GrB_Monoid_new, except that a -// terminal value can be specified. The terminal may be NULL, which indicates -// no terminal value (and in this case, it is identical to GrB_Monoid_new). -// The terminal value, if not NULL, must have the same type as the identity. +//============================================================================== +// GrB_Vector: a GraphBLAS vector +//============================================================================== -GrB_Info GxB_Monoid_terminal_new_BOOL // create a new boolean monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - bool identity, // identity value of the monoid - bool terminal // terminal value of the monoid -) ; +// These methods create, free, copy, and clear a vector. The size, nvals, +// and type methods return basic information about a vector. -GrB_Info GxB_Monoid_terminal_new_INT8 // create a new int8 monoid +GrB_Info GrB_Vector_new // create a new vector with no entries ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int8_t identity, // identity value of the monoid - int8_t terminal // terminal value of the monoid + GrB_Vector *v, // handle of vector to create + GrB_Type type, // type of vector to create + GrB_Index n // vector dimension is n-by-1 + // (n must be <= GrB_INDEX_MAX+1) ) ; -GrB_Info GxB_Monoid_terminal_new_UINT8 // create a new uint8 monoid +GrB_Info GrB_Vector_dup // make an exact copy of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint8_t identity, // identity value of the monoid - uint8_t terminal // terminal value of the monoid + GrB_Vector *w, // handle of output vector to create + const GrB_Vector u // input vector to copy ) ; -GrB_Info GxB_Monoid_terminal_new_INT16 // create a new int16 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int16_t identity, // identity value of the monoid - int16_t terminal // terminal value of the monoid +GrB_Info GrB_Vector_clear // clear a vector of all entries; +( // type and dimension remain unchanged. + GrB_Vector v // vector to clear ) ; -GrB_Info GxB_Monoid_terminal_new_UINT16 // create a new uint16 monoid +GrB_Info GrB_Vector_size // get the dimension of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint16_t identity, // identity value of the monoid - uint16_t terminal // terminal value of the monoid + GrB_Index *n, // vector dimension is n-by-1 + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_INT32 // create a new int32 monoid +GrB_Info GrB_Vector_nvals // get the number of entries in a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int32_t identity, // identity value of the monoid - int32_t terminal // terminal value of the monoid + GrB_Index *nvals, // vector has nvals entries + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_UINT32 // create a new uint32 monoid +GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint32_t identity, // identity value of the monoid - uint32_t terminal // terminal value of the monoid + size_t *size, // # of bytes used by the vector v + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_INT64 // create a new int64 monoid +GrB_Info GxB_Vector_type // get the type of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int64_t identity, // identity value of the monoid - int64_t terminal // terminal value of the monoid + GrB_Type *type, // returns the type of the vector + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_UINT64 // create a new uint64 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint64_t identity, // identity value of the monoid - uint64_t terminal // terminal value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_build +//------------------------------------------------------------------------------ -GrB_Info GxB_Monoid_terminal_new_FP32 // create a new float monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - float identity, // identity value of the monoid - float terminal // terminal value of the monoid +// GrB_Vector_build: w = sparse (I,1,X) in MATLAB notation, but using any +// associative operator to assemble duplicate entries. The dup operator cannot +// be based on a GxB_IndexBinaryOp. + +// GrB_Info GrB_Vector_build_TYPE // build a vector from (I,X) tuples +// ( +// GrB_Vector w, // vector to build +// const GrB_Index *I, // array of row indices of tuples +// const *X, // array of values of tuples +// GrB_Index nvals, // number of tuples +// const GrB_BinaryOp dup // binary function to assemble duplicates +// ) ; +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_build ## suffix /* build a vector from tuples */ \ +( \ + GrB_Vector w, /* vector to build */ \ + const GrB_Index *I_, /* array of row indices of tuples */ \ + const type *X, /* array of values of tuples */ \ + GrB_Index nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary function to assemble duplicates */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Vector_build_Vector // build a vector from (I,X) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc ) ; -GrB_Info GxB_Monoid_terminal_new_FP64 // create a new double monoid +GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - double identity, // identity value of the monoid - double terminal // terminal value of the monoid + GrB_Vector w, // vector to build + const GrB_Index *I_, // array of row indices of tuples + const GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples ) ; -GrB_Info GxB_Monoid_terminal_new_FC32 // create a new float complex monoid +GrB_Info GxB_Vector_build_Scalar_Vector // build a vector from (I,s) tuples ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC32_t identity, // identity value of the monoid - GxB_FC32_t terminal // terminal value of the monoid + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc ) ; -GrB_Info GxB_Monoid_terminal_new_FC64 // create a new double complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC64_t identity, // identity value of the monoid - GxB_FC64_t terminal // terminal value of the monoid -) ; +// GrB_Vector_build is a polymorphic method that allows access to all +// 17 Vector_build methods. -GrB_Info GxB_Monoid_terminal_new_UDT // create a monoid with a user type -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - void *identity, // identity value of the monoid - void *terminal // terminal value of the monoid -) ; +// GrB_Vector_build_TYPE (w, I, X, nvals, dup) +// GxB_Vector_build_Scalar (w, I, s, nvals, dup) +// GxB_Vector_build_Vector (w, I, X, dup, desc), where I,X are GrB_Vector +// GxB_Vector_build_Scalar_Vector (w, I, s, desc ), where I is GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GB_VECTOR_BUILD_T(X) \ + _Generic ((X), \ + GB_PCASES (GrB, Vector_build), \ + default: GxB_Vector_build_Scalar) +#define GB_VECTOR_BUILD(w,I_,X,...) \ + _Generic ((I_), \ + GrB_Index * : GB_VECTOR_BUILD_T (X), \ + const GrB_Index * : GB_VECTOR_BUILD_T (X), \ + default: \ + _Generic ((X), \ + GrB_Vector : GxB_Vector_build_Vector, \ + default: GxB_Vector_build_Scalar_Vector)) +#define GrB_Vector_build(w,...) \ + GB_VECTOR_BUILD (w, __VA_ARGS__) \ + (w, __VA_ARGS__) +#endif -// Type-generic method for creating a new monoid with a terminal value: +//------------------------------------------------------------------------------ +// GrB_Vector_setElement +//------------------------------------------------------------------------------ -/* -GrB_Info GxB_Monoid_terminal_new // create a monoid +// Set a single scalar in a vector, w(i) = x, typecasting from the type of x to +// the type of w as needed. +// +// GrB_Info GrB_Vector_setElement_TYPE // w(i) = x +// ( +// GrB_Vector w, // vector to modify +// x, // scalar to assign to w(i) +// GrB_Index i // row index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_setElement ## suffix /* w(i) = x */ \ +( \ + GrB_Vector w, /* vector to modify */ \ + type x, /* scalar to assign to w(i) */ \ + GrB_Index i /* row index */ \ +) ; +GB_DECLARE_14 (GrB_, void *) + +GrB_Info GrB_Vector_setElement_Scalar // w(i) = x ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity, // identity value of the monoid - terminal // terminal value of the monoid + GrB_Vector w, // vector to modify + GrB_Scalar x, // scalar to assign to w(i) + GrB_Index i // row index ) ; -*/ #if GxB_STDC_VERSION >= 201112L -#define GxB_Monoid_terminal_new(monoid,op,identity,terminal) \ - _Generic \ - ( \ - (identity), \ - GB_CASES (GxB, Monoid_terminal_new) \ - ) \ - (monoid, op, identity, terminal) +#define GrB_Vector_setElement(w,x,i) \ + _Generic ((x), \ + GB_CASES (GrB, Vector_setElement), \ + default: GrB_Vector_setElement_Scalar) \ + (w, x, i) #endif -GrB_Info GrB_Monoid_free // free a user-created monoid -( - GrB_Monoid *monoid // handle of monoid to free -) ; - -//============================================================================== -// GrB_Semiring -//============================================================================== - -// The multiply op can be any GrB_BinaryOp, including those based on a -// GxB_IndexBinaryOp. +//------------------------------------------------------------------------------ +// GrB_Vector_extractElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Semiring_new // create a semiring -( - GrB_Semiring *semiring, // handle of semiring to create - GrB_Monoid add, // add monoid of the semiring - GrB_BinaryOp multiply // multiply operator of the semiring -) ; +// Extract a single entry from a vector, x = v(i), typecasting from the type of +// v to the type of x as needed. +// +// GrB_Info GrB_Vector_extractElement_TYPE // x = v(i) +// ( +// *x, // scalar extracted +// const GrB_Vector v, // vector to extract an entry from +// GrB_Index i // row index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_extractElement ## suffix /* x = v(i) */ \ +( \ + type *x, /* scalar extracted */ \ + const GrB_Vector v, /* vector to extract an entry from */ \ + GrB_Index i /* row index */ \ +) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Semiring_free // free a user-created semiring +GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) ( - GrB_Semiring *semiring // handle of semiring to free + GrB_Scalar x, // scalar extracted + const GrB_Vector v, // vector to extract an entry from + GrB_Index i // row index ) ; -//============================================================================== -// GrB_Scalar: a GraphBLAS scalar -//============================================================================== +#if GxB_STDC_VERSION >= 201112L +#define GrB_Vector_extractElement(x,v,i) \ + _Generic ((x), \ + GB_PCASES (GrB, Vector_extractElement), \ + default: GrB_Vector_extractElement_Scalar) \ + (x, v, i) +#endif -// These methods create, free, copy, and clear a GrB_Scalar. The nvals, -// and type methods return basic information about a GrB_Scalar. +//------------------------------------------------------------------------------ +// GxB_Vector_isStoredElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry -( - GrB_Scalar *s, // handle of GrB_Scalar to create - GrB_Type type // type of GrB_Scalar to create -) ; +// GxB_Vector_isStoredElement determines if v(i) is present in the structure +// of the vector v, as a stored element. It does not return the value. It +// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. -GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar +GrB_Info GxB_Vector_isStoredElement // determine if v(i) is a stored element ( - GrB_Scalar *s, // handle of output GrB_Scalar to create - const GrB_Scalar t // input GrB_Scalar to copy -) ; - -GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry -( // type remains unchanged. - GrB_Scalar s // GrB_Scalar to clear + const GrB_Vector v, // vector to check + GrB_Index i // row index ) ; -GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar -( - GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) - const GrB_Scalar s // GrB_Scalar to query -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_removeElement +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar -( - size_t *size, // # of bytes used by the scalar s - const GrB_Scalar s // GrB_Scalar to query -) ; +// GrB_Vector_removeElement (v,i) removes the element v(i) from the vector v. -GrB_Info GrB_Scalar_free // free a GrB_Scalar +GrB_Info GrB_Vector_removeElement ( - GrB_Scalar *s // handle of GrB_Scalar to free + GrB_Vector v, // vector to remove an element from + GrB_Index i // index ) ; //------------------------------------------------------------------------------ -// GrB_Scalar_setElement +// GrB_Vector_extractTuples //------------------------------------------------------------------------------ -// Set a single GrB_Scalar s, from a user scalar x: s = x, typecasting from the -// type of x to the type of w as needed. +// Extracts all tuples from a vector, like [I,~,X] = find (V) in MATLAB. If +// any parameter I and/or X is NULL, then that component is not extracted. For +// example, to extract just the row indices, pass I as non-NULL, and X as NULL. +// This is like [I,~,~] = find (V) in MATLAB notation. +// +// GrB_Info GrB_Vector_extractTuples_TYPE // [I,~,X] = find (V) +// ( +// GrB_Index *I, // array for returning row indices of tuples +// *X, // array for returning values of tuples +// GrB_Index *nvals, // I, X size on input; # tuples on output +// const GrB_Vector V // vector to extract tuples from +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_extractTuples ## suffix /* [I,~,X = find (V) */ \ +( \ + GrB_Index *I_, /* array for returning row indices of tuples */ \ + type *X, /* array for returning values of tuples */ \ + GrB_Index *nvals, /* I, X size on input; # tuples on output */ \ + const GrB_Vector V /* vector to extract tuples from */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Vector_extractTuples_Vector // [I,~,X] = find (V) +( + GrB_Vector I_vector, // row indices + GrB_Vector X_vector, // values + const GrB_Vector V, // vectors to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) ; + +// GrB_Vector_extractTuples is a polymorphic method that allow access to +// all of the *Vector_extractTuples* methods: +// GrB_Vector_extractTuples_TYPE (I, X, nvals, V) +// GxB_Vector_extractTuples_Vector (I, X, V, desc) where I,X are GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GrB_Vector_extractTuples(I_,X,arg3,arg4) \ + _Generic ((arg3), \ + GrB_Vector: GxB_Vector_extractTuples_Vector, \ + default: _Generic ((X), \ + GB_PCASES (GrB, Vector_extractTuples), \ + default: GxB_Vector_extractTuples_Vector)) \ + (I_, X, arg3, arg4) +#endif -GrB_Info GrB_Scalar_setElement_BOOL // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - bool x // user scalar to assign to s -) ; +//============================================================================== +// GrB_Matrix: a GraphBLAS matrix +//============================================================================== -GrB_Info GrB_Scalar_setElement_INT8 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - int8_t x // user scalar to assign to s -) ; +// These methods create, free, copy, and clear a matrix. The nrows, ncols, +// nvals, and type methods return basic information about a matrix. -GrB_Info GrB_Scalar_setElement_UINT8 // s = x +GrB_Info GrB_Matrix_new // create a new matrix with no entries ( - GrB_Scalar s, // GrB_Scalar to modify - uint8_t x // user scalar to assign to s + GrB_Matrix *A, // handle of matrix to create + GrB_Type type, // type of matrix to create + GrB_Index nrows, // matrix dimension is nrows-by-ncols + GrB_Index ncols // (nrows and ncols must be <= GrB_INDEX_MAX+1) ) ; -GrB_Info GrB_Scalar_setElement_INT16 // s = x +GrB_Info GrB_Matrix_dup // make an exact copy of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int16_t x // user scalar to assign to s + GrB_Matrix *C, // handle of output matrix to create + const GrB_Matrix A // input matrix to copy ) ; -GrB_Info GrB_Scalar_setElement_UINT16 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - uint16_t x // user scalar to assign to s +GrB_Info GrB_Matrix_clear // clear a matrix of all entries; +( // type and dimensions remain unchanged + GrB_Matrix A // matrix to clear ) ; -GrB_Info GrB_Scalar_setElement_INT32 // s = x +GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int32_t x // user scalar to assign to s + GrB_Index *nrows, // matrix has nrows rows + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_UINT32 // s = x +GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - uint32_t x // user scalar to assign to s + GrB_Index *ncols, // matrix has ncols columns + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_INT64 // s = x +GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int64_t x // user scalar to assign to s + GrB_Index *nvals, // matrix has nvals entries + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_UINT64 // s = x +GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - uint64_t x // user scalar to assign to s + size_t *size, // # of bytes used by the matrix A + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_FP32 // s = x +GrB_Info GxB_Matrix_type // get the type of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - float x // user scalar to assign to s + GrB_Type *type, // returns the type of the matrix + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_FP64 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - double x // user scalar to assign to s -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_build +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_setElement_FC32 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - GxB_FC32_t x // user scalar to assign to s +// GrB_Matrix_build: C = sparse (I,J,X) in MATLAB notation, but using any +// associative operator to assemble duplicate entries. The dup operator cannot +// be based on a GxB_IndexBinaryOp. + +// GrB_Info GrB_Matrix_build_TYPE // build a matrix from (I,J,X) tuples +// ( +// GrB_Matrix C, // matrix to build +// const GrB_Index *I, // array of row indices of tuples +// const GrB_Index *J, // array of column indices of tuples +// const *X, // array of values of tuples +// GrB_Index nvals, // number of tuples +// const GrB_BinaryOp dup // binary function to assemble duplicates +// ) ; +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_build ## suffix /* build a matrix from tuples */ \ +( \ + GrB_Matrix C, /* matrix to build */ \ + const GrB_Index *I_, /* array of row indices of tuples */ \ + const GrB_Index *J, /* array of column indices of tuples */ \ + const type *X, /* array of values of tuples */ \ + GrB_Index nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary function to assemble duplicates */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Matrix_build_Vector // build a matrix from (I,J,X) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc ) ; -GrB_Info GxB_Scalar_setElement_FC64 // s = x +GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples ( - GrB_Scalar s, // GrB_Scalar to modify - GxB_FC64_t x // user scalar to assign to s + GrB_Matrix C, // matrix to build + const GrB_Index *I_, // array of row indices of tuples + const GrB_Index *J, // array of column indices of tuples + GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples ) ; -GrB_Info GrB_Scalar_setElement_UDT // s = x +GrB_Info GxB_Matrix_build_Scalar_Vector // build a matrix from (I,J,s) tuples ( - GrB_Scalar s, // GrB_Scalar to modify - void *x // user scalar to assign to s + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc ) ; -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Scalar_setElement // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - x // user scalar to assign to s -) ; -*/ +// GrB_Matrix_build is a polymorphic method that allows access to all +// 17 Matrix_build methods. +// GrB_Matrix_build_TYPE (C, I, J, X, nvals, dup) +// GxB_Matrix_build_Scalar (C, I, J, s, nvals, dup) +// GxB_Matrix_build_Vector (C, I, J, X, dup, desc); I,J,X are GrB_Vector +// GxB_Matrix_build_Scalar_Vector (C, I, J, s, desc ), where I,J are GrB_Vector #if GxB_STDC_VERSION >= 201112L -#define GrB_Scalar_setElement(s,x) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Scalar_setElement) \ - ) \ - (s, x) +#define GB_MATRIX_BUILD_T(X) \ + _Generic ((X), \ + GB_PCASES (GrB, Matrix_build), \ + default: GxB_Matrix_build_Scalar) +#define GB_MATRIX_BUILD(C,I_,J,X,...) \ + _Generic ((I_), \ + GrB_Index * : GB_MATRIX_BUILD_T (X), \ + const GrB_Index * : GB_MATRIX_BUILD_T (X), \ + default: \ + _Generic ((X), \ + GrB_Vector : GxB_Matrix_build_Vector, \ + default: GxB_Matrix_build_Scalar_Vector)) +#define GrB_Matrix_build(C,...) \ + GB_MATRIX_BUILD (C, __VA_ARGS__) \ + (C, __VA_ARGS__) #endif //------------------------------------------------------------------------------ -// GrB_Scalar_extractElement +// GrB_Matrix_setElement //------------------------------------------------------------------------------ -// Extract a single entry from a GrB_Scalar, x = s, typecasting from the type -// of s to the type of x as needed. +// Set a single entry in a matrix, C(i,j) = x, typecasting from the type of x +// to the type of C, as needed. +// +// GrB_Info GrB_Matrix_setElement_TYPE // C (i,j) = x +// ( +// GrB_Matrix C, // matrix to modify +// x, // scalar to assign to C(i,j) +// GrB_Index i, // row index +// GrB_Index j // column index +// ) ; -GrB_Info GrB_Scalar_extractElement_BOOL // x = s +GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x ( - bool *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Matrix C, // matrix to modify + GrB_Scalar x, // scalar to assign to C(i,j) + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GrB_Scalar_extractElement_INT8 // x = s -( - int8_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_setElement ## suffix /* C(i,j) = x */ \ +( \ + GrB_Matrix C, /* matrix to modify */ \ + type x, /* scalar to assign to C(i,j) */ \ + GrB_Index i, /* row index */ \ + GrB_Index j /* column index */ \ ) ; +GB_DECLARE_14 (GrB_, void *) -GrB_Info GrB_Scalar_extractElement_UINT8 // x = s -( - uint8_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_setElement(C,x,i,j) \ + _Generic ((x), \ + GB_CASES (GrB, Matrix_setElement), \ + default: GrB_Matrix_setElement_Scalar) \ + (C, x, i, j) +#endif -GrB_Info GrB_Scalar_extractElement_INT16 // x = s -( - int16_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_extractElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_extractElement_UINT16 // x = s -( - uint16_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from +// Extract a single entry from a matrix, x = A(i,j), typecasting from the type +// of A to the type of x, as needed. +// +// GrB_Info GrB_Matrix_extractElement_TYPE // x = A(i,j) +// ( +// *x, // extracted scalar +// const GrB_Matrix A, // matrix to extract a scalar from +// GrB_Index i, // row index +// GrB_Index j // column index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_extractElement ## suffix /* x = A(i,j) */ \ +( \ + type *x, /* extracted scalar */ \ + const GrB_Matrix A, /* matrix to extract a scalar from */ \ + GrB_Index i, /* row index */ \ + GrB_Index j /* column index */ \ ) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Scalar_extractElement_INT32 // x = s +GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) ( - int32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; - -GrB_Info GrB_Scalar_extractElement_UINT32 // x = s -( - uint32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Scalar x, // extracted scalar + const GrB_Matrix A, // matrix to extract a scalar from + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GrB_Scalar_extractElement_INT64 // x = s -( - int64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_extractElement(x,A,i,j) \ + _Generic ((x), \ + GB_PCASES (GrB, Matrix_extractElement), \ + default: GrB_Matrix_extractElement_Scalar) \ + (x, A, i, j) +#endif -GrB_Info GrB_Scalar_extractElement_UINT64 // x = s -( - uint64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GxB_Matrix_isStoredElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_extractElement_FP32 // x = s -( - float *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +// GxB_Matrix_isStoredElement determines if A(i,j) is present in the structure +// of the matrix A, as a stored element. It does not return the value. It +// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. -GrB_Info GrB_Scalar_extractElement_FP64 // x = s +GrB_Info GxB_Matrix_isStoredElement // determine if A(i,j) is a stored element ( - double *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + const GrB_Matrix A, // matrix to check + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GxB_Scalar_extractElement_FC32 // x = s -( - GxB_FC32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_removeElement +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_extractElement_FC64 // x = s -( - GxB_FC64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +// GrB_Matrix_removeElement (A,i,j) removes the entry A(i,j) from the matrix A. -GrB_Info GrB_Scalar_extractElement_UDT // x = s +GrB_Info GrB_Matrix_removeElement ( - void *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Matrix C, // matrix to remove entry from + GrB_Index i, // row index + GrB_Index j // column index ) ; -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. +//------------------------------------------------------------------------------ +// GrB_Matrix_extractTuples +//------------------------------------------------------------------------------ -/* +// Extracts all tuples from a matrix, like [I,J,X] = find (A) in MATLAB. If +// any parameter I, J and/or X is NULL, then that component is not extracted. +// For example, to extract just the row and col indices, pass I and J as +// non-NULL, and X as NULL. This is like [I,J,~] = find (A). +// +// GrB_Info GrB_Matrix_extractTuples_TYPE // [I,J,X] = find (A) +// ( +// uint64_t *I, // array for returning row indices of tuples +// uint64_t *J, // array for returning col indices of tuples +// *X, // array for returning values of tuples +// GrB_Index *nvals, // I,J,X size on input; # tuples on output +// const GrB_Matrix A // matrix to extract tuples from +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_extractTuples ## suffix /* [I,J,X = find (A) */ \ +( \ + GrB_Index *I_, /* array for returning row indices of tuples */ \ + GrB_Index *J, /* array for returning col indices of tuples */ \ + type *X, /* array for returning values of tuples */ \ + GrB_Index *nvals, /* I,J,X size on input; # tuples on output */ \ + const GrB_Matrix A /* matrix to extract tuples from */ \ +) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Scalar_extractElement // x = s +GrB_Info GxB_Matrix_extractTuples_Vector // [I,J,X] = find (A) ( - *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Vector I_vector, // row indices + GrB_Vector J_vector, // col indices + GrB_Vector X_vector, // values + const GrB_Matrix A, // matrix to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion ) ; -*/ - +// GrB_Matrix_extractTuples is a polymorphic method that allow access to +// all of the *Matrix_extractTuples* methods: +// GrB_Matrix_extractTuples_TYPE (I, J, X, nvals, A) +// GxB_Matrix_extractTuples_Vector (I, J, X, A, desc) where I,J,X are GrB_Vector #if GxB_STDC_VERSION >= 201112L -#define GrB_Scalar_extractElement(x,s) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Scalar_extractElement) \ - ) \ - (x, s) +#define GrB_Matrix_extractTuples(I_,J,X,arg4,arg5) \ + _Generic ((arg4), \ + GrB_Matrix: GxB_Matrix_extractTuples_Vector, \ + default: _Generic ((X), \ + GB_PCASES (GrB, Matrix_extractTuples), \ + default: GxB_Matrix_extractTuples_Vector)) \ + (I_, J, X, arg4, arg5) #endif -//============================================================================== -// GrB_Vector: a GraphBLAS vector -//============================================================================== - -// These methods create, free, copy, and clear a vector. The size, nvals, -// and type methods return basic information about a vector. +//------------------------------------------------------------------------------ +// GxB_Matrix_concat and GxB_Matrix_split +//------------------------------------------------------------------------------ -GrB_Info GrB_Vector_new // create a new vector with no entries -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n // vector dimension is n-by-1 - // (n must be <= GrB_INDEX_MAX+1) -) ; +// GxB_Matrix_concat concatenates an array of matrices (Tiles) into a single +// GrB_Matrix C. -GrB_Info GrB_Vector_dup // make an exact copy of a vector -( - GrB_Vector *w, // handle of output vector to create - const GrB_Vector u // input vector to copy -) ; +// Tiles is an m-by-n dense array of matrices held in row-major format, where +// Tiles [i*n+j] is the (i,j)th tile, and where m > 0 and n > 0 must hold. Let +// A{i,j} denote the (i,j)th tile. The matrix C is constructed by +// concatenating these tiles together, as: -GrB_Info GrB_Vector_clear // clear a vector of all entries; -( // type and dimension remain unchanged. - GrB_Vector v // vector to clear -) ; +// C = [ A{0,0} A{0,1} A{0,2} ... A{0,n-1} +// A{1,0} A{1,1} A{1,2} ... A{1,n-1} +// ... +// A{m-1,0} A{m-1,1} A{m-1,2} ... A{m-1,n-1} ] -GrB_Info GrB_Vector_size // get the dimension of a vector -( - GrB_Index *n, // vector dimension is n-by-1 - const GrB_Vector v // vector to query -) ; +// On input, the matrix C must already exist. Any existing entries in C are +// discarded. C must have dimensions nrows by ncols where nrows is the sum of +// # of rows in the matrices A{i,0} for all i, and ncols is the sum of the # of +// columns in the matrices A{0,j} for all j. All matrices in any given tile +// row i must have the same number of rows (that is, nrows(A{i,0}) must equal +// nrows(A{i,j}) for all j), and all matrices in any given tile column j must +// have the same number of columns (that is, ncols(A{0,j}) must equal +// ncols(A{i,j}) for all i). -GrB_Info GrB_Vector_nvals // get the number of entries in a vector -( - GrB_Index *nvals, // vector has nvals entries - const GrB_Vector v // vector to query -) ; +// The type of C is unchanged, and all matrices A{i,j} are typecasted into the +// type of C. Any settings made to C by GrB_set (format by row +// or by column, bitmap switch, hyper switch, and sparsity control) are +// unchanged. -GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector +GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices ( - size_t *size, // # of bytes used by the vector v - const GrB_Vector v // vector to query + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Descriptor desc // unused, except threading control ) ; -GrB_Info GxB_Vector_iso // return iso status of a vector -( - bool *iso, // true if the vector is iso-valued - const GrB_Vector v // vector to query -) ; +// GxB_Matrix_split does the opposite of GxB_Matrix_concat. It splits a single +// input matrix A into a 2D array of tiles. On input, the Tiles array must be +// a non-NULL pointer to a previously allocated array of size at least m*n +// where both m and n must be > 0. The Tiles_nrows array has size m, and +// Tiles_ncols has size n. The (i,j)th tile has dimension +// Tiles_nrows[i]-by-Tiles_ncols[j]. The sum of Tiles_nrows [0:m-1] must equal +// the number of rows of A, and the sum of Tiles_ncols [0:n-1] must equal the +// number of columns of A. The type of each tile is the same as the type of A; +// no typecasting is done. -GrB_Info GrB_Vector_free // free a vector +GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices ( - GrB_Vector *v // handle of vector to free + GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Index *Tile_nrows, // array of size m + const GrB_Index *Tile_ncols, // array of size n + const GrB_Matrix A, // input matrix to split + const GrB_Descriptor desc // unused, except threading control ) ; //------------------------------------------------------------------------------ -// GrB_Vector_build +// GxB_Matrix_diag, GxB_Vector_diag, GrB_Matrix_diag //------------------------------------------------------------------------------ -// GrB_Vector_build: w = sparse (I,1,X), but using any -// associative operator to assemble duplicate entries. - -// The dup operator cannot be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Vector_build_BOOL // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const bool *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Matrix_diag constructs a new matrix from a vector. Let n be the length +// of the v vector, from GrB_Vector_size (&n, v). If k = 0, then C is an +// n-by-n diagonal matrix with the entries from v along the main diagonal of C, +// with C(i,i) = v(i). If k is nonzero, C is square with dimension n+abs(k). +// If k is positive, it denotes diagonals above the main diagonal, with +// C(i,i+k) = v(i). If k is negative, it denotes diagonals below the main +// diagonal of C, with C(i-k,i) = v(i). C is constructed with the same type +// as v. -GrB_Info GrB_Vector_build_INT8 // build a vector from (I,X) tuples +GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix *C, // output matrix + const GrB_Vector v, // input vector + int64_t k ) ; -GrB_Info GrB_Vector_build_UINT8 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Matrix_diag is like GxB_Matrix_diag (&C, v, k, NULL), except that C must +// already exist on input, of the correct size. Any existing entries in C are +// discarded. The type of C is preserved, so that if the type of C and v +// differ, the entries are typecasted into the type of C. Any settings made to +// C by GrB_set (format by row or by column, bitmap switch, hyper +// switch, and sparsity control) are unchanged. -GrB_Info GrB_Vector_build_INT16 // build a vector from (I,X) tuples +GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // output matrix + const GrB_Vector v, // input vector + int64_t k, + const GrB_Descriptor desc // to specify # of threads ) ; -GrB_Info GrB_Vector_build_UINT16 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GxB_Vector_diag extracts a vector v from an input matrix A, which may be +// rectangular. If k = 0, the main diagonal of A is extracted; k > 0 denotes +// diagonals above the main diagonal of A, and k < 0 denotes diagonals below +// the main diagonal of A. Let A have dimension m-by-n. If k is in the range +// 0 to n-1, then v has length min(m,n-k). If k is negative and in the range +// -1 to -m+1, then v has length min(m+k,n). If k is outside these ranges, +// v has length 0 (this is not an error). -GrB_Info GrB_Vector_build_INT32 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// v must already exist on input, of the correct length; that is +// GrB_Vector_size (&len,v) must return len = 0 if k >= n or k <= -m, len = +// min(m,n-k) if k is in the range 0 to n-1, and len = min(m+k,n) if k is in +// the range -1 to -m+1. Any existing entries in v are discarded. The type of +// v is preserved, so that if the type of A and v differ, the entries are +// typecasted into the type of v. Any settings made to v by +// GrB_set (bitmap switch and sparsity control) are unchanged. -GrB_Info GrB_Vector_build_UINT32 // build a vector from (I,X) tuples +GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector v, // output vector + const GrB_Matrix A, // input matrix + int64_t k, + const GrB_Descriptor desc // unused, except threading control ) ; -GrB_Info GrB_Vector_build_INT64 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//============================================================================== +// GxB_Context: for managing computational resources +//============================================================================== -GrB_Info GrB_Vector_build_UINT64 // build a vector from (I,X) tuples +GrB_Info GxB_Context_new // create a new Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context *Context // handle of Context to create ) ; -GrB_Info GrB_Vector_build_FP32 // build a vector from (I,X) tuples +GrB_Info GxB_Context_engage // engage a Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const float *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context Context // Context to engage ) ; -GrB_Info GrB_Vector_build_FP64 // build a vector from (I,X) tuples +GrB_Info GxB_Context_disengage // disengage a Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const double *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context Context // Context to disengage ) ; -GrB_Info GxB_Vector_build_FC32 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const GxB_FC32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//============================================================================== +// GrB_get: get a scalar, string, enum, size, or void * from an object. +//============================================================================== -GrB_Info GxB_Vector_build_FC64 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const GxB_FC64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Info GrB_get +// ( +// Object object, // GraphBLAS object to query +// result, // GrB_Scalar, char *, int32_t *, size_t *, void * +// int field // what to query +// ) ; +// +// GrB_Info GrB_get // a SuiteSparse:GraphBLAS extension +// ( +// void *blob, // GraphBLAS serialized blob +// result, // GrB_Scalar, char *, int32_t *, size_t *, void * +// int field, // what to query +// size_t blobsize // size of the blob +// ) ; -GrB_Info GrB_Vector_build_UDT // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const void *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_get(object,value,...) \ + _Generic ((object), \ + GrB_Scalar : \ + _Generic ((value), \ + GrB_Scalar : GrB_Scalar_get_Scalar , \ + char * : GrB_Scalar_get_String , \ + int32_t * : GrB_Scalar_get_INT32 , \ + size_t * : GrB_Scalar_get_SIZE , \ + void * : GrB_Scalar_get_VOID ) , \ + GrB_Vector : \ + _Generic ((value), \ + GrB_Scalar : GrB_Vector_get_Scalar , \ + char * : GrB_Vector_get_String , \ + int32_t * : GrB_Vector_get_INT32 , \ + size_t * : GrB_Vector_get_SIZE , \ + void * : GrB_Vector_get_VOID ) , \ + GrB_Matrix : \ + _Generic ((value), \ + GrB_Scalar : GrB_Matrix_get_Scalar , \ + char * : GrB_Matrix_get_String , \ + int32_t * : GrB_Matrix_get_INT32 , \ + size_t * : GrB_Matrix_get_SIZE , \ + void * : GrB_Matrix_get_VOID ) , \ + GrB_UnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_UnaryOp_get_Scalar , \ + char * : GrB_UnaryOp_get_String , \ + int32_t * : GrB_UnaryOp_get_INT32 , \ + size_t * : GrB_UnaryOp_get_SIZE , \ + void * : GrB_UnaryOp_get_VOID ) , \ + GrB_IndexUnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_IndexUnaryOp_get_Scalar , \ + char * : GrB_IndexUnaryOp_get_String , \ + int32_t * : GrB_IndexUnaryOp_get_INT32 , \ + size_t * : GrB_IndexUnaryOp_get_SIZE , \ + void * : GrB_IndexUnaryOp_get_VOID ) , \ + GrB_BinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_BinaryOp_get_Scalar , \ + char * : GrB_BinaryOp_get_String , \ + int32_t * : GrB_BinaryOp_get_INT32 , \ + size_t * : GrB_BinaryOp_get_SIZE , \ + void * : GrB_BinaryOp_get_VOID ) , \ + GxB_IndexBinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ + char * : GxB_IndexBinaryOp_get_String , \ + int32_t * : GxB_IndexBinaryOp_get_INT32 , \ + size_t * : GxB_IndexBinaryOp_get_SIZE , \ + void * : GxB_IndexBinaryOp_get_VOID ) , \ + GrB_Monoid : \ + _Generic ((value), \ + GrB_Scalar : GrB_Monoid_get_Scalar , \ + char * : GrB_Monoid_get_String , \ + int32_t * : GrB_Monoid_get_INT32 , \ + size_t * : GrB_Monoid_get_SIZE , \ + void * : GrB_Monoid_get_VOID ) , \ + GrB_Semiring : \ + _Generic ((value), \ + GrB_Scalar : GrB_Semiring_get_Scalar , \ + char * : GrB_Semiring_get_String , \ + int32_t * : GrB_Semiring_get_INT32 , \ + size_t * : GrB_Semiring_get_SIZE , \ + void * : GrB_Semiring_get_VOID ) , \ + GrB_Type : \ + _Generic ((value), \ + GrB_Scalar : GrB_Type_get_Scalar , \ + char * : GrB_Type_get_String , \ + int32_t * : GrB_Type_get_INT32 , \ + size_t * : GrB_Type_get_SIZE , \ + void * : GrB_Type_get_VOID ) , \ + GrB_Descriptor : \ + _Generic ((value), \ + GrB_Scalar : GrB_Descriptor_get_Scalar , \ + char * : GrB_Descriptor_get_String , \ + int32_t * : GrB_Descriptor_get_INT32 , \ + size_t * : GrB_Descriptor_get_SIZE , \ + void * : GrB_Descriptor_get_VOID ) , \ + GrB_Global : \ + _Generic ((value), \ + GrB_Scalar : GrB_Global_get_Scalar , \ + char * : GrB_Global_get_String , \ + int32_t * : GrB_Global_get_INT32 , \ + size_t * : GrB_Global_get_SIZE , \ + void * : GrB_Global_get_VOID ) , \ + GxB_Context : \ + _Generic ((value), \ + GrB_Scalar : GxB_Context_get_Scalar , \ + char * : GxB_Context_get_String , \ + int32_t * : GxB_Context_get_INT , \ + size_t * : GxB_Context_get_SIZE , \ + void * : GxB_Context_get_VOID ) , \ + const void *: \ + _Generic ((value), \ + GrB_Scalar : GxB_Serialized_get_Scalar , \ + char * : GxB_Serialized_get_String , \ + int32_t * : GxB_Serialized_get_INT32 , \ + size_t * : GxB_Serialized_get_SIZE , \ + void * : GxB_Serialized_get_VOID ) , \ + void *: \ + _Generic ((value), \ + GrB_Scalar : GxB_Serialized_get_Scalar , \ + char * : GxB_Serialized_get_String , \ + int32_t * : GxB_Serialized_get_INT32 , \ + size_t * : GxB_Serialized_get_SIZE , \ + void * : GxB_Serialized_get_VOID )) \ + (object, value, __VA_ARGS__) +#endif -GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _get_Scalar (Object object, GrB_Scalar, int) ; \ +GrB_Info Object ## _get_String (Object object, char * , int) ; \ +GrB_Info Object ## _get_INT32 (Object object, int32_t * , int) ; \ +GrB_Info Object ## _get_SIZE (Object object, size_t * , int) ; \ +GrB_Info Object ## _get_VOID (Object object, void * , int) ; +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_Global ) + +GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, int, size_t) ; +GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, int, size_t) ; +GrB_Info GxB_Serialized_get_String (const void *, char * , int, size_t) ; +GrB_Info GxB_Serialized_get_INT32 (const void *, int32_t * , int, size_t) ; +GrB_Info GxB_Serialized_get_SIZE (const void *, size_t * , int, size_t) ; +GrB_Info GxB_Serialized_get_VOID (const void *, void * , int, size_t) ; + +// Note that GxB_Context_get_INT has an irregular name. This is because it +// conflicts with the signature of the prior GxB_Context_get_INT32 method, +// which is now historical. +GrB_Info GxB_Context_get_Scalar (GxB_Context, GrB_Scalar, int) ; +GrB_Info GxB_Context_get_String (GxB_Context, char * , int) ; +GrB_Info GxB_Context_get_INT (GxB_Context, int32_t * , int) ; +GrB_Info GxB_Context_get_SIZE (GxB_Context, size_t * , int) ; +GrB_Info GxB_Context_get_VOID (GxB_Context, void * , int) ; -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. +//============================================================================== +// GrB_set: set a scalar, string, enum, size, or void * of an object +//============================================================================== -/* -GrB_Info GrB_Vector_build // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -*/ +// GrB_Info GrB_set +// ( +// Object object, // GraphBLAS object to modify +// input, // GrB_Scalar, char *, int32_t: new value of field +// int field // what to modify +// ) ; +// +// GrB_Info GrB_set +// ( +// Object object, // GraphBLAS object to modify +// void *input, // new value of the field +// int field, // what to field modify +// size_t inputsize // size of the input +// ) ; #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_build(w,Ilist,X,nvals,dup) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Vector_build) \ - ) \ - (w, Ilist, ((const void *) (X)), nvals, dup) +#define GrB_set(object,value,...) \ + _Generic ((object), \ + GrB_Scalar : \ + _Generic ((value), \ + GrB_Scalar : GrB_Scalar_set_Scalar , \ + char * : GrB_Scalar_set_String , \ + int32_t : GrB_Scalar_set_INT32 , \ + void * : GrB_Scalar_set_VOID ) , \ + GrB_Vector : \ + _Generic ((value), \ + GrB_Scalar : GrB_Vector_set_Scalar , \ + char * : GrB_Vector_set_String , \ + int32_t : GrB_Vector_set_INT32 , \ + void * : GrB_Vector_set_VOID ) , \ + GrB_Matrix : \ + _Generic ((value), \ + GrB_Scalar : GrB_Matrix_set_Scalar , \ + char * : GrB_Matrix_set_String , \ + int32_t : GrB_Matrix_set_INT32 , \ + void * : GrB_Matrix_set_VOID ) , \ + GrB_UnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_UnaryOp_set_Scalar , \ + char * : GrB_UnaryOp_set_String , \ + int32_t : GrB_UnaryOp_set_INT32 , \ + void * : GrB_UnaryOp_set_VOID ) , \ + GrB_IndexUnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_IndexUnaryOp_set_Scalar , \ + char * : GrB_IndexUnaryOp_set_String , \ + int32_t : GrB_IndexUnaryOp_set_INT32 , \ + void * : GrB_IndexUnaryOp_set_VOID ) , \ + GrB_BinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_BinaryOp_set_Scalar , \ + char * : GrB_BinaryOp_set_String , \ + int32_t : GrB_BinaryOp_set_INT32 , \ + void * : GrB_BinaryOp_set_VOID ) , \ + GxB_IndexBinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ + char * : GxB_IndexBinaryOp_set_String , \ + int32_t : GxB_IndexBinaryOp_set_INT32 , \ + void * : GxB_IndexBinaryOp_set_VOID ) , \ + GrB_Monoid : \ + _Generic ((value), \ + GrB_Scalar : GrB_Monoid_set_Scalar , \ + char * : GrB_Monoid_set_String , \ + int32_t : GrB_Monoid_set_INT32 , \ + void * : GrB_Monoid_set_VOID ) , \ + GrB_Semiring : \ + _Generic ((value), \ + GrB_Scalar : GrB_Semiring_set_Scalar , \ + char * : GrB_Semiring_set_String , \ + int32_t : GrB_Semiring_set_INT32 , \ + void * : GrB_Semiring_set_VOID ) , \ + GrB_Type : \ + _Generic ((value), \ + GrB_Scalar : GrB_Type_set_Scalar , \ + char * : GrB_Type_set_String , \ + int32_t : GrB_Type_set_INT32 , \ + void * : GrB_Type_set_VOID ) , \ + GrB_Descriptor : \ + _Generic ((value), \ + GrB_Scalar : GrB_Descriptor_set_Scalar , \ + char * : GrB_Descriptor_set_String , \ + int32_t : GrB_Descriptor_set_INT32 , \ + void * : GrB_Descriptor_set_VOID ) , \ + GrB_Global : \ + _Generic ((value), \ + GrB_Scalar : GrB_Global_set_Scalar , \ + char * : GrB_Global_set_String , \ + int32_t : GrB_Global_set_INT32 , \ + void * : GrB_Global_set_VOID ) , \ + GxB_Context : \ + _Generic ((value), \ + GrB_Scalar : GxB_Context_set_Scalar , \ + char * : GxB_Context_set_String , \ + int32_t : GxB_Context_set_INT , \ + void * : GxB_Context_set_VOID )) \ + (object, value, __VA_ARGS__) #endif -//------------------------------------------------------------------------------ -// GrB_Vector_setElement -//------------------------------------------------------------------------------ +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _set_Scalar (Object object, GrB_Scalar, int) ; \ +GrB_Info Object ## _set_String (Object object, char * , int) ; \ +GrB_Info Object ## _set_INT32 (Object object, int32_t , int) ; \ +GrB_Info Object ## _set_VOID (Object object, void * , int, size_t) ; +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_Global ) + +// GxB_Context_set_INT is slightly misnamed, because of the prior +// GxB_Context_set_INT32. +GrB_Info GxB_Context_set_Scalar (GxB_Context, GrB_Scalar, int) ; +GrB_Info GxB_Context_set_String (GxB_Context, char * , int) ; +GrB_Info GxB_Context_set_INT (GxB_Context, int32_t , int) ; +GrB_Info GxB_Context_set_VOID (GxB_Context, void * , int, size_t) ; -// Set a single scalar in a vector, w(i) = x, typecasting from the type of x to -// the type of w as needed. +//============================================================================== +// GrB_wait: finish computations +//============================================================================== -GrB_Info GrB_Vector_setElement_BOOL // w(i) = x -( - GrB_Vector w, // vector to modify - bool x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +// Finish all pending work in a specific object. +// +// GrB_Info GrB_wait +// ( +// Object object, // GraphBLAS object to wait on +// int waitmode // (GrB_WaitMode) +// ) ; -GrB_Info GrB_Vector_setElement_INT8 // w(i) = x -( - GrB_Vector w, // vector to modify - int8_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_wait(object,waitmode) \ + _Generic ((object), \ + GrB_Type : GrB_Type_wait , \ + GrB_UnaryOp : GrB_UnaryOp_wait , \ + GrB_BinaryOp : GrB_BinaryOp_wait , \ + GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ + GrB_Monoid : GrB_Monoid_wait , \ + GrB_Semiring : GrB_Semiring_wait , \ + GrB_Scalar : GrB_Scalar_wait , \ + GrB_Vector : GrB_Vector_wait , \ + GrB_Matrix : GrB_Matrix_wait , \ + GxB_Context : GxB_Context_wait , \ + GrB_Descriptor : GrB_Descriptor_wait) \ + (object, waitmode) +#endif -GrB_Info GrB_Vector_setElement_UINT8 // w(i) = x -( - GrB_Vector w, // vector to modify - uint8_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _wait (Object object, int waitmode) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) -GrB_Info GrB_Vector_setElement_INT16 // w(i) = x -( - GrB_Vector w, // vector to modify - int16_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +//============================================================================== +// GrB_error: error handling +//============================================================================== -GrB_Info GrB_Vector_setElement_UINT16 // w(i) = x -( - GrB_Vector w, // vector to modify - uint16_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +// Each GraphBLAS method and operation returns a GrB_Info error code. +// GrB_error returns additional information on the error in a thread-safe +// null-terminated string. The string returned by GrB_error is owned by +// the GraphBLAS library and must not be free'd. +// +// GrB_Info GrB_error +// ( +// const char **error, // output error string +// const Object object // GraphBLAS object to query +// ) ; -GrB_Info GrB_Vector_setElement_INT32 // w(i) = x -( - GrB_Vector w, // vector to modify - int32_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_error(error,object) \ + _Generic ((object), \ + GrB_Type : GrB_Type_error , \ + GrB_UnaryOp : GrB_UnaryOp_error , \ + GrB_BinaryOp : GrB_BinaryOp_error , \ + GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ + GrB_Monoid : GrB_Monoid_error , \ + GrB_Semiring : GrB_Semiring_error , \ + GrB_Scalar : GrB_Scalar_error , \ + GrB_Vector : GrB_Vector_error , \ + GrB_Matrix : GrB_Matrix_error , \ + GxB_Context : GxB_Context_error , \ + GrB_Descriptor : GrB_Descriptor_error) \ + (error, object) +#endif -GrB_Info GrB_Vector_setElement_UINT32 // w(i) = x -( - GrB_Vector w, // vector to modify - uint32_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) GrB_Info Object ## _error \ +( \ + const char **error, /* output error string */ \ + const Object object /* GraphBLAS object to query */ \ +) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) + +//============================================================================== +// GrB_mxm, vxm, mxv: matrix multiplication over a semiring +//============================================================================== + +// No accum operator in any method can be based on a GxB_IndexBinaryOp. -GrB_Info GrB_Vector_setElement_INT64 // w(i) = x +GrB_Info GrB_mxm // C = accum (C, A*B) ( - GrB_Vector w, // vector to modify - int64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_setElement_UINT64 // w(i) = x +GrB_Info GrB_vxm // w' = accum (w, u'*A) ( - GrB_Vector w, // vector to modify - uint64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for u'*A + const GrB_Vector u, // first input: vector u + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_setElement_FP32 // w(i) = x +GrB_Info GrB_mxv // w = accum (w, A*u) ( - GrB_Vector w, // vector to modify - float x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_setElement_FP64 // w(i) = x +//============================================================================== +// GrB_eWiseMult: element-wise matrix and vector operations, set intersection +//============================================================================== + +// GrB_eWiseMult computes C = accum (C, A.*B), where ".*" is the Hadamard +// product, and where pairs of elements in two matrices (or vectors) are +// pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). The mult operator +// can be based on a GxB_IndexBinaryOp. + +GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - double x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Vector_setElement_FC32 // w(i) = x +GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - GxB_FC32_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Vector_setElement_FC64 // w(i) = x +GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - GxB_FC64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp mult, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_setElement_UDT // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - void *x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_setElement_Scalar // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - GrB_Scalar x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Vector_setElement // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp mult, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -*/ + +// All 6 of the above type-specific functions are captured in a single +// type-polymorphic function, GrB_eWiseMult: #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_setElement(w,x,i) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Vector_setElement), \ - default: GrB_Vector_setElement_Scalar \ - ) \ - (w, x, i) +#define GrB_eWiseMult(C,Mask,accum,op,A,B,desc) \ + _Generic ((C), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_eWiseMult_Semiring , \ + GrB_Monoid : GrB_Matrix_eWiseMult_Monoid , \ + GrB_BinaryOp : GrB_Matrix_eWiseMult_BinaryOp \ + ), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_Semiring : GrB_Vector_eWiseMult_Semiring , \ + GrB_Monoid : GrB_Vector_eWiseMult_Monoid , \ + GrB_BinaryOp : GrB_Vector_eWiseMult_BinaryOp)) \ + (C, Mask, accum, op, A, B, desc) #endif -//------------------------------------------------------------------------------ -// GrB_Vector_extractElement -//------------------------------------------------------------------------------ +//============================================================================== +// GrB_eWiseAdd: element-wise matrix and vector operations, set union +//============================================================================== -// Extract a single entry from a vector, x = v(i), typecasting from the type of -// v to the type of x as needed. +// GrB_eWiseAdd computes C = accum (C, A+B), where pairs of elements in +// two matrices (or two vectors) are pairwise "added". -GrB_Info GrB_Vector_extractElement_BOOL // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) ( - bool *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_INT8 // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) ( - int8_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_UINT8 // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) ( - uint8_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_INT16 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) ( - int16_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_UINT16 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) ( - uint16_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_INT32 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) ( - int32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_UINT32 // x = v(i) -( - uint32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_eWiseAdd(C,Mask,accum,op,A,B,desc) \ + _Generic ((C), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_eWiseAdd_Semiring , \ + GrB_Monoid : GrB_Matrix_eWiseAdd_Monoid , \ + GrB_BinaryOp : GrB_Matrix_eWiseAdd_BinaryOp \ + ), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_Semiring : GrB_Vector_eWiseAdd_Semiring , \ + GrB_Monoid : GrB_Vector_eWiseAdd_Monoid , \ + GrB_BinaryOp : GrB_Vector_eWiseAdd_BinaryOp)) \ + (C, Mask, accum, op, A, B, desc) +#endif -GrB_Info GrB_Vector_extractElement_INT64 // x = v(i) -( - int64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +//============================================================================== +// GxB_eWiseUnion: a variant of GrB_eWiseAdd +//============================================================================== -GrB_Info GrB_Vector_extractElement_UINT64 // x = v(i) -( - uint64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// GxB_eWiseUnion is a variant of eWiseAdd. The methods create a result with +// the same sparsity structure. They differ when an entry is present in A but +// not B, or in B but not A. -GrB_Info GrB_Vector_extractElement_FP32 // x = v(i) -( - float *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// eWiseAdd does the following, for a matrix, where "+" is the add binary op: -GrB_Info GrB_Vector_extractElement_FP64 // x = v(i) -( - double *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// if A(i,j) and B(i,j) are both present: +// C(i,j) = A(i,j) + B(i,j) +// else if A(i,j) is present but not B(i,j) +// C(i,j) = A(i,j) +// else if B(i,j) is present but not A(i,j) +// C(i,j) = B(i,j) -GrB_Info GxB_Vector_extractElement_FC32 // x = v(i) -( - GxB_FC32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// by contrast, eWiseUnion always applies the operator: -GrB_Info GxB_Vector_extractElement_FC64 // x = v(i) -( - GxB_FC64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// if A(i,j) and B(i,j) are both present: +// C(i,j) = A(i,j) + B(i,j) +// else if A(i,j) is present but not B(i,j) +// C(i,j) = A(i,j) + beta +// else if B(i,j) is present but not A(i,j) +// C(i,j) = alpha + B(i,j) -GrB_Info GrB_Vector_extractElement_UDT // x = v(i) +GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) ( - void *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; - -GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) -( - GrB_Scalar x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Scalar alpha, + const GrB_Vector v, // second input: vector v + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for w and mask ) ; -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Vector_extractElement // x = v(i) +GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) ( - *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar alpha, + const GrB_Matrix B, // second input: matrix B + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for C, M, A, and B ) ; -*/ #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractElement(x,v,i) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Vector_extractElement), \ - default: GrB_Vector_extractElement_Scalar \ - ) \ - (x, v, i) +#define GxB_eWiseUnion(C,Mask,accum,op,A,alpha,B,beta,desc) \ + _Generic ((C), \ + GrB_Matrix : GxB_Matrix_eWiseUnion , \ + GrB_Vector : GxB_Vector_eWiseUnion) \ + (C, Mask, accum, op, A, alpha, B, beta, desc) #endif -// GxB_Vector_isStoredElement determines if v(i) is present in the structure -// of the vector v, as a stored element. It does not return the value. It -// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. +//============================================================================== +// GrB_extract: extract a submatrix or subvector +//============================================================================== -GrB_Info GxB_Vector_isStoredElement // determine if v(i) is a stored element +GrB_Info GrB_Vector_extract // w = accum (w, u(I)) ( - const GrB_Vector v, // vector to check - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask ) ; -//------------------------------------------------------------------------------ -// GrB_Vector_removeElement -//------------------------------------------------------------------------------ - -// GrB_Vector_removeElement (v,i) removes the element v(i) from the vector v. - -GrB_Info GrB_Vector_removeElement +GrB_Info GxB_Vector_extract_Vector // w = accum (w, u(I)) ( - GrB_Vector v, // vector to remove an element from - GrB_Index i // index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask ) ; -//------------------------------------------------------------------------------ -// GrB_Vector_extractTuples -//------------------------------------------------------------------------------ - -// Extracts all tuples from a vector, like [I,~,X] = find (v). If any -// parameter I and/or X is NULL, then that component is not extracted. For -// example, to extract just the row indices, pass I as non-NULL, and X as NULL. -// This is like [I,~,~] = find (v). - -GrB_Info GrB_Vector_extractTuples_BOOL // [I,~,X] = find (v) +GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - bool *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices (64-bit) + GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C, M, and A ) ; -GrB_Info GrB_Vector_extractTuples_INT8 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_extract_Vector // C = accum (C, A(I,J)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C, M, and A ) ; -GrB_Info GrB_Vector_extractTuples_UINT8 // [I,~,X] = find (v) +GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_extractTuples_INT16 // [I,~,X] = find (v) +GrB_Info GxB_Col_extract_Vector // w = accum (w, A(I,j)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_extractTuples_UINT16 // [I,~,X] = find (v) -( - GrB_Index *Ilist, // array for returning row indices of tuples - uint16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from -) ; +// GrB_extract is a polymorphic interface to the following functions: +// +// GrB_Vector_extract (w,m,acc,u,I,ni,d) +// GxB_Vector_extract_Vector (w,m,acc,u,I,d) where I is a GrB_Vector +// GrB_Col_extract (w,m,acc,A,I,ni,j,d) +// GxB_Col_extract_Vector (w,m,acc,A,I,j,d) where I is a GrB_Vector +// GrB_Matrix_extract (C,M,acc,A,I,ni,J,nj,d) +// GxB_Matrix_extract_Vector (C,M,acc,A,I,ni,J,nj,d) where I,J are GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GrB_extract(C,M,accum,A,I,...) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((A), \ + GrB_Vector : \ + _Generic ((I), \ + GrB_Vector: GxB_Vector_extract_Vector, \ + default: GrB_Vector_extract), \ + GrB_Matrix : \ + _Generic ((I), \ + GrB_Vector: GxB_Col_extract_Vector, \ + default: GrB_Col_extract)), \ + GrB_Matrix : \ + _Generic ((I), \ + GrB_Vector: GxB_Matrix_extract_Vector, \ + default: GrB_Matrix_extract)) \ + (C, M, accum, A, I, __VA_ARGS__) +#endif + +//============================================================================== +// GxB_subassign: matrix and vector subassign: C(I,J) = accum (C(I,J), A) +//============================================================================== + +// Assign entries in a matrix or vector; C(I,J) = A. + +// Most assign and subassign methods have two variants depending on how the +// integer lists I and J are passed: (1) as C arrays of type (GrB_Index *) and +// a corresponding array length, and (2) as GrB_Vectors. The latter methods +// have a "_Vector" suffix to their name. The exception to this rule are +// methods with a type suffix (_BOOL, _UINT*, _INT*, _FP*, _FC*, and _UDT) +// where the scalar x is provided as a plain C scalar or (void *) for _UDT. +// Those methods only accept C arrays of type (GrB_Index *) for I and J. + +// Each GxB_subassign function is very similar to its corresponding GrB_assign +// function in the spec, but they differ in two ways: (1) the mask in +// GxB_subassign has the same size as w(I) for vectors and C(I,J) for matrices, +// and (2) they differ in the GrB_REPLACE option. See the user guide for +// details. + +// In GraphBLAS notation, assign and subassign can be described as follows: + +// matrix and vector subassign: C(I,J) = accum (C(I,J), A) +// matrix and vector assign: C(I,J) = accum (C(I,J), A) + +// --- assign ------------------------------------------------------------------ +// +// GrB_Matrix_assign C(I,J) += A M same size as matrix C. +// A is |I|-by-|J| +// +// GrB_Vector_assign w(I) += u m same size as column vector w. +// u is |I|-by-1 +// +// GrB_Row_assign C(i,J) += u' m is a column vector the same +// size as a row of C. +// u is |J|-by-1, i is a scalar. +// +// GrB_Col_assign C(I,j) += u m is a column vector the same +// size as a column of C. +// u is |I|-by-1, j is a scalar. +// +// --- subassign --------------------------------------------------------------- +// +// GxB_Matrix_subassign C(I,J) += A M same size as matrix A. +// A is |I|-by-|J| +// +// GxB_Vector_subassign w(I) += u m same size as column vector u. +// u is |I|-by-1 +// +// GxB_Row_subassign C(i,J) += u' m same size as column vector u. +// u is |J|-by-1, i is a scalar. +// +// GxB_Col_subassign C(I,j) += u m same size as column vector u. +// u is |I|-by-1, j is a scalar. -GrB_Info GrB_Vector_extractTuples_INT32 // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign // w(I) = accum (w(I),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UINT32 // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign_Vector // w(I) = accum (w(I),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_INT64 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_subassign // C(I,J) = accum (C(I,J),A) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UINT64 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_subassign_Vector // C(I,J) = accum (C(I,J),A) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_FP32 // [I,~,X] = find (v) +GrB_Info GxB_Col_subassign // C(I,j) = accum (C(I,j),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - float *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_FP64 // [I,~,X] = find (v) +GrB_Info GxB_Col_subassign_Vector // C(I,j) = accum (C(I,j),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - double *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_extractTuples_FC32 // [I,~,X] = find (v) +GrB_Info GxB_Row_subassign // C(i,J) = accum (C(i,J),u') ( - GrB_Index *Ilist, // array for returning row indices of tuples - GxB_FC32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_extractTuples_FC64 // [I,~,X] = find (v) +GrB_Info GxB_Row_subassign_Vector // C(i,J) = accum (C(i,J),u') ( - GrB_Index *Ilist, // array for returning row indices of tuples - GxB_FC64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UDT // [I,~,X] = find (v) +//------------------------------------------------------------------------------ +// GxB_Vector_subassign_[SCALAR]: scalar expansion assignment to subvector +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The +// scalar x is implicitly expanded into a vector u of size ni-by-1, with each +// entry in u equal to x, and then w(I) = accum(w(I),u) is done. + +GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),x) ( - GrB_Index *Ilist, // array for returning row indices of tuples - void *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign_Scalar_Vector // w(I) = accum (w(I),x) ( - GrB_Index *Ilist, // array for returning row indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -*/ -#if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Vector_extractTuples) \ - ) \ - (Ilist, X, nvals, v) -#endif +// The following methods do not accept a GrB_Vector I parameter: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Vector_subassign ## suffix /* w(I) = accum (w(I),x) */ \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w(I), unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Descriptor desc \ +) ; +GB_DECLARE_14 (GxB_, void *) -//============================================================================== -// GrB_Matrix: a GraphBLAS matrix -//============================================================================== +//------------------------------------------------------------------------------ +// GxB_Matrix_subassign_[SCALAR]: scalar expansion assignment to submatrix +//------------------------------------------------------------------------------ -// These methods create, free, copy, and clear a matrix. The nrows, ncols, -// nvals, and type methods return basic information about a matrix. +// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The +// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each +// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. -GrB_Info GrB_Matrix_new // create a new matrix with no entries +GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols // (nrows and ncols must be <= GrB_INDEX_MAX+1) + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_dup // make an exact copy of a matrix +GrB_Info GxB_Matrix_subassign_Scalar_Vector // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix *C, // handle of output matrix to create - const GrB_Matrix A // input matrix to copy + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_clear // clear a matrix of all entries; -( // type and dimensions remain unchanged - GrB_Matrix A // matrix to clear +// The following methods do not accept GrB_Vector I,J parameters: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Matrix_subassign ## suffix /* C(I,J) = accum (C(I,J),x) */ \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C(I,J), unused if NULL */\ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C(I,J),x) */ \ + type x, /* scalar to assign to C(I,J) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Index *J, /* column indices */ \ + GrB_Index nj, /* number of column indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GxB_, void *) -GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix -( - GrB_Index *nrows, // matrix has nrows rows - const GrB_Matrix A // matrix to query -) ; +//------------------------------------------------------------------------------ +// GxB_subassign: polymorphic submatrix/subvector assignment +//------------------------------------------------------------------------------ -GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix -( - GrB_Index *ncols, // matrix has ncols columns - const GrB_Matrix A // matrix to query -) ; +// GxB_subassign is a polymorphic function that provides access to all +// non-polymorphic *_subassign* functions. -GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix -( - GrB_Index *nvals, // matrix has nvals entries - const GrB_Matrix A // matrix to query -) ; +// GB_VECTOR_SUBASSIGN: +// GxB_Vector_subassign_TYPE (w,m,acc,x,I,ni,d) +// GxB_Vector_subassign_Scalar_Vector (w,m,acc,s,I,d) I is a GrB_Vector +// GxB_Vector_subassign_Scalar (w,m,acc,s,I,ni,d) +// GxB_Vector_subassign_Vector (w,m,acc,u,I,d) I is a GrB_Vector +// GxB_Vector_subassign (w,m,acc,u,I,ni,d) +#if GxB_STDC_VERSION >= 201112L +#define GB_VECTOR_SUBASSIGN(w,mask,accum,arg4,arg5,...) \ + _Generic ((arg4), \ + GB_CASES (GxB, Vector_subassign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_subassign_Scalar_Vector, \ + default: GxB_Vector_subassign_Scalar), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_subassign_Vector, \ + default: GxB_Vector_subassign)) + +// GB_MATRIX_SUBASSIGN: +// GxB_Matrix_subassign_TYPE (C,M,acc,x,I,ni,J,nj,d) +// GxB_Matrix_subassign_Scalar_Vector (C,M,acc,s,I,J,d) I,J are GrB_Vector +// GxB_Matrix_subassign_Scalar (C,M,acc,s,I,ni,J,nj,d) +// GxB_Col_subassign (C,m,acc,u,I,ni,j,d) +// GxB_Col_subassign_Vector (C,m,acc,u,I,j,d) I is a GrB_Vector +// GxB_Row_subassign (C,m,acc,u,i,J,nj,d) +// GxB_Row_subassign_Vector (C,m,acc,u,i,J,d) J is a GrB_Vector +// GxB_Matrix_subassign_Vector (C,M,acc,A,I,J,d) I,J are GrB_Vector +// GxB_Matrix_subassign (C,M,acc,A,I,ni,J,nj,d) +#define GB_MATRIX_SUBASSIGN(C,M,accum,arg4,arg5,arg6,...) \ + _Generic ((arg4), \ + GB_CASES (GxB, Matrix_subassign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_subassign_Scalar_Vector, \ + default: GxB_Matrix_subassign_Scalar), \ + GrB_Vector : \ + _Generic ((arg5), \ + const GrB_Index *: GxB_Col_subassign, \ + GrB_Index *: GxB_Col_subassign, \ + GrB_Vector : GxB_Col_subassign_Vector, \ + default: \ + _Generic ((arg6), \ + const GrB_Index *: GxB_Row_subassign, \ + GrB_Index *: GxB_Row_subassign, \ + default: GxB_Row_subassign_Vector)), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_subassign_Vector, \ + default: GxB_Matrix_subassign)) + +#define GxB_subassign(C,...) \ + _Generic ((C), \ + GrB_Vector : GB_VECTOR_SUBASSIGN (C, __VA_ARGS__), \ + GrB_Matrix : GB_MATRIX_SUBASSIGN (C, __VA_ARGS__)) \ + (C, __VA_ARGS__) +#endif -GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix -( - size_t *size, // # of bytes used by the matrix A - const GrB_Matrix A // matrix to query -) ; +//============================================================================== +// GrB_assign: matrix and vector assign: C(I,J) = accum (C(I,J), A) +//============================================================================== -GrB_Info GxB_Matrix_iso // return iso status of a matrix -( - bool *iso, // true if the matrix is iso-valued - const GrB_Matrix A // matrix to query -) ; +// Assign entries in a matrix or vector; C(I,J) = A. +// Each of these can be used with their polymorphic name, GrB_assign. -GrB_Info GrB_Matrix_free // free a matrix +GrB_Info GrB_Vector_assign // w(I) = accum (w(I),u) ( - GrB_Matrix *A // handle of matrix to free + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -//------------------------------------------------------------------------------ -// GrB_Matrix_build -//------------------------------------------------------------------------------ - -// GrB_Matrix_build: C = sparse (I,J,X), but using any -// associative operator to assemble duplicate entries. -// The dup operator cannot be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples +GrB_Info GxB_Vector_assign_Vector // w(I) = accum (w(I),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const bool *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT8 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Matrix_assign // C(I,J) = accum (C(I,J),A) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT8 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Matrix_assign_Vector // C(I,J) = accum (C(I,J),A) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT16 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Col_assign // C(I,j) = accum (C(I,j),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT16 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Col_assign_Vector // C(I,j) = accum (C(I,j),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT32 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Row_assign // C(i,J) = accum (C(i,J),u') ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT32 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Row_assign_Vector // C(i,J) = accum(C(i,j),u') ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT64 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_assign_[SCALAR]: scalar expansion assignment to subvector +//------------------------------------------------------------------------------ -GrB_Info GrB_Matrix_build_UINT64 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The +// scalar x is implicitly expanded into a vector u of size ni-by-1, with each +// entry in u equal to x, and then w(I) = accum(w(I),u) is done. -GrB_Info GrB_Matrix_build_FP32 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const float *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_FP64 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Vector_assign_Scalar_Vector // w(I) = accum (w(I),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const double *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_build_FC32 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const GxB_FC32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates +// The following methods do not accept a GrB_Vector I parameter: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_assign ## suffix /* w(I) = accum (w(I),x) */ \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void *) + +//------------------------------------------------------------------------------ +// GrB_Matrix_assign_[SCALAR]: scalar expansion assignment to submatrix +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The +// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each +// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. -GrB_Info GxB_Matrix_build_FC64 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const GxB_FC64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UDT // build a matrix from (I,J,X) tuples +GrB_Info GxB_Matrix_assign_Scalar_Vector // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const void *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples +// The following methods do not accept GrB_Vector I,J parameters: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_assign ## suffix /* C(I,J) = accum(C(I,J),x)*/\ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C(I,J),x) */ \ + type x, /* scalar to assign to C(I,J) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Index *J, /* column indices */ \ + GrB_Index nj, /* number of column indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void *) -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. +//------------------------------------------------------------------------------ +// GrB_assign: polymorphic submatrix/subvector assignment +//------------------------------------------------------------------------------ -/* -GrB_Info GrB_Matrix_build // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -*/ +// GrB_assign is a polymorphic function that provides access to all +// non-polymorphic *_assign* functions. +// GB_VECTOR_ASSIGN: +// GrB_Vector_assign_TYPE (w,m,acc,x,I,ni,d) +// GxB_Vector_assign_Scalar_Vector (w,m,acc,s,I,d) where I is a GrB_Vector +// GrB_Vector_assign_Scalar (w,m,acc,s,I,ni,d) +// GxB_Vector_assign_Vector (w,m,acc,u,I,d) where I is a GrB_Vector +// GrB_Vector_assign (w,m,acc,u,I,ni,d) #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Matrix_build) \ - ) \ - (C, Ilist, J, ((const void *) (X)), nvals, dup) +#define GB_VECTOR_ASSIGN(w,mask,accum,arg4,arg5,...) \ + _Generic ((arg4), \ + GB_CASES (GrB, Vector_assign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_assign_Scalar_Vector, \ + default: GrB_Vector_assign_Scalar), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_assign_Vector, \ + default: GrB_Vector_assign)) + +// GB_MATRIX_ASSIGN: +// GrB_Matrix_assign_TYPE (C,M,acc,x,I,ni,J,nj,d) +// GxB_Matrix_assign_Scalar_Vector (C,M,acc,s,I,J,d) where I,J are GrB_Vector +// GrB_Matrix_assign_Scalar (C,M,acc,s,I,ni,J,nj,d) +// GrB_Col_assign (C,m,acc,u,I,ni,j,d) +// GxB_Col_assign_Vector (C,m,acc,u,I,j,d) where I is a GrB_Vector +// GrB_Row_assign (C,m,acc,u,i,J,nj,d) +// GxB_Row_assign_Vector (C,m,acc,u,i,J,d) where J is a GrB_Vector +// GxB_Matrix_assign_Vector (C,M,acc,A,I,J,d) where I,J are GrB_Vector +// GrB_Matrix_assign (C,M,acc,A,I,ni,J,nj,d) +#define GB_MATRIX_ASSIGN(C,M,accum,arg4,arg5,arg6,...) \ + _Generic ((arg4), \ + GB_CASES (GrB, Matrix_assign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_assign_Scalar_Vector, \ + default: GrB_Matrix_assign_Scalar), \ + GrB_Vector : \ + _Generic ((arg5), \ + const GrB_Index *: GrB_Col_assign, \ + GrB_Index *: GrB_Col_assign, \ + GrB_Vector : GxB_Col_assign_Vector, \ + default: \ + _Generic ((arg6), \ + const GrB_Index *: GrB_Row_assign, \ + GrB_Index *: GrB_Row_assign, \ + default: GxB_Row_assign_Vector)), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_assign_Vector, \ + default: GrB_Matrix_assign)) + +#define GrB_assign(C,...) \ + _Generic ((C), \ + GrB_Vector : GB_VECTOR_ASSIGN (C, __VA_ARGS__), \ + GrB_Matrix : GB_MATRIX_ASSIGN (C, __VA_ARGS__)) \ + (C, __VA_ARGS__) #endif -//------------------------------------------------------------------------------ -// GrB_Matrix_setElement -//------------------------------------------------------------------------------ - -// Set a single entry in a matrix, C(i,j) = x, typecasting -// from the type of x to the type of C, as needed. +//============================================================================== +// GrB_apply: matrix and vector apply +//============================================================================== -GrB_Info GrB_Matrix_setElement_BOOL // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - bool x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a unary, index_unary, or binary operator to entries in a matrix or +// vector, C = accum (C, op (A)). -GrB_Info GrB_Matrix_setElement_INT8 // C (i,j) = x +GrB_Info GrB_Vector_apply // w = accum (w, op(u)) ( - GrB_Matrix C, // matrix to modify - int8_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Matrix_setElement_UINT8 // C (i,j) = x +GrB_Info GrB_Matrix_apply // C = accum (C, op(A)) or op(A') ( - GrB_Matrix C, // matrix to modify - uint8_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -GrB_Info GrB_Matrix_setElement_INT16 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - int16_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +//------------------------------------------- +// vector apply: binaryop variants (bind 1st) +//------------------------------------------- -GrB_Info GrB_Matrix_setElement_UINT16 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint16_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a binary operator to the entries in a vector, binding the first +// input to a scalar x, w = accum (w, op (x,u)). -GrB_Info GrB_Matrix_setElement_INT32 // C (i,j) = x +GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) ( - GrB_Matrix C, // matrix to modify - int32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Scalar x, // first input: scalar x + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Matrix_setElement_UINT32 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_BinaryOp1st ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + type x, /* first input: scalar x */ \ + const GrB_Vector u, /* second input: vector u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) -GrB_Info GrB_Matrix_setElement_INT64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - int64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +//------------------------------------------- +// vector apply: binaryop variants (bind 2nd) +//------------------------------------------- -GrB_Info GrB_Matrix_setElement_UINT64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a binary operator to the entries in a vector, binding the second +// input to a scalar y, w = accum (w, op (u,y)). -GrB_Info GrB_Matrix_setElement_FP32 // C (i,j) = x +GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) ( - GrB_Matrix C, // matrix to modify - float x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_FP64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - double x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_setElement_FC32 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GxB_FC32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_setElement_FC64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GxB_FC64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_UDT // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - void *x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GrB_Scalar x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Matrix_setElement // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_setElement(C,x,i,j) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Matrix_setElement), \ - default: GrB_Matrix_setElement_Scalar \ - ) \ - (C, x, i, j) -#endif - -//------------------------------------------------------------------------------ -// GrB_Matrix_extractElement -//------------------------------------------------------------------------------ - -// Extract a single entry from a matrix, x = A(i,j), typecasting from the type -// of A to the type of x, as needed. - -GrB_Info GrB_Matrix_extractElement_BOOL // x = A(i,j) -( - bool *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT8 // x = A(i,j) -( - int8_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT8 // x = A(i,j) -( - uint8_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT16 // x = A(i,j) -( - int16_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT16 // x = A(i,j) -( - uint16_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT32 // x = A(i,j) -( - int32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT32 // x = A(i,j) -( - uint32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT64 // x = A(i,j) -( - int64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT64 // x = A(i,j) -( - uint64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_FP32 // x = A(i,j) -( - float *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_FP64 // x = A(i,j) -( - double *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_extractElement_FC32 // x = A(i,j) -( - GxB_FC32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_extractElement_FC64 // x = A(i,j) -( - GxB_FC64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UDT // x = A(i,j) -( - void *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) -( - GrB_Scalar x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Matrix_extractElement // x = A(i,j) -( - *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_extractElement(x,A,i,j) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Matrix_extractElement), \ - default: GrB_Matrix_extractElement_Scalar \ - ) \ - (x, A, i, j) -#endif - -// GxB_Matrix_isStoredElement determines if A(i,j) is present in the structure -// of the matrix A, as a stored element. It does not return the value. It -// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. - -GrB_Info GxB_Matrix_isStoredElement // determine if A(i,j) is a stored element -( - const GrB_Matrix A, // matrix to check - GrB_Index i, // row index - GrB_Index j // column index -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_removeElement -//------------------------------------------------------------------------------ - -// GrB_Matrix_removeElement (A,i,j) removes the entry A(i,j) from the matrix A. - -GrB_Info GrB_Matrix_removeElement -( - GrB_Matrix C, // matrix to remove entry from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_extractTuples -//------------------------------------------------------------------------------ - -// Extracts all tuples from a matrix, like [I,J,X] = find (A). If -// any parameter I, J and/or X is NULL, then that component is not extracted. -// For example, to extract just the row and col indices, pass I and J as -// non-NULL, and X as NULL. This is like [I,J,~] = find (A). - -GrB_Info GrB_Matrix_extractTuples_BOOL // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - bool *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT8 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT8 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT16 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT16 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_FP32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - float *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_FP64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - double *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GxB_Matrix_extractTuples_FC32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - GxB_FC32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GxB_Matrix_extractTuples_FC64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - GxB_FC64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UDT // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - void *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_extractTuples(Ilist,J,X,nvals,A) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Matrix_extractTuples) \ - ) \ - (Ilist, J, X, nvals, A) -#endif - -//------------------------------------------------------------------------------ -// GxB_Matrix_concat and GxB_Matrix_split -//------------------------------------------------------------------------------ - -// GxB_Matrix_concat concatenates an array of matrices (Tiles) into a single -// GrB_Matrix C. - -// Tiles is an m-by-n dense array of matrices held in row-major format, where -// Tiles [i*n+j] is the (i,j)th tile, and where m > 0 and n > 0 must hold. Let -// A{i,j} denote the (i,j)th tile. The matrix C is constructed by -// concatenating these tiles together, as: - -// C = [ A{0,0} A{0,1} A{0,2} ... A{0,n-1} -// A{1,0} A{1,1} A{1,2} ... A{1,n-1} -// ... -// A{m-1,0} A{m-1,1} A{m-1,2} ... A{m-1,n-1} ] - -// On input, the matrix C must already exist. Any existing entries in C are -// discarded. C must have dimensions nrows by ncols where nrows is the sum of -// # of rows in the matrices A{i,0} for all i, and ncols is the sum of the # of -// columns in the matrices A{0,j} for all j. All matrices in any given tile -// row i must have the same number of rows (that is, nrows(A{i,0}) must equal -// nrows(A{i,j}) for all j), and all matrices in any given tile column j must -// have the same number of columns (that is, ncols(A{0,j}) must equal -// ncols(A{i,j}) for all i). - -// The type of C is unchanged, and all matrices A{i,j} are typecasted into the -// type of C. Any settings made to C by GrB_set (format by row -// or by column, bitmap switch, hyper switch, and sparsity control) are -// unchanged. - -GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Descriptor desc // unused, except threading control -) ; - -// GxB_Matrix_split does the opposite of GxB_Matrix_concat. It splits a single -// input matrix A into a 2D array of tiles. On input, the Tiles array must be -// a non-NULL pointer to a previously allocated array of size at least m*n -// where both m and n must be > 0. The Tiles_nrows array has size m, and -// Tiles_ncols has size n. The (i,j)th tile has dimension -// Tiles_nrows[i]-by-Tiles_ncols[j]. The sum of Tiles_nrows [0:m-1] must equal -// the number of rows of A, and the sum of Tiles_ncols [0:n-1] must equal the -// number of columns of A. The type of each tile is the same as the type of A; -// no typecasting is done. - -GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices -( - GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n - const GrB_Matrix A, // input matrix to split - const GrB_Descriptor desc // unused, except threading control -) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_diag, GxB_Vector_diag, GrB_Matrix_diag -//------------------------------------------------------------------------------ - -// GrB_Matrix_diag constructs a new matrix from a vector. Let n be the length -// of the v vector, from GrB_Vector_size (&n, v). If k = 0, then C is an -// n-by-n diagonal matrix with the entries from v along the main diagonal of C, -// with C(i,i) = v(i). If k is nonzero, C is square with dimension n+abs(k). -// If k is positive, it denotes diagonals above the main diagonal, with -// C(i,i+k) = v(i). If k is negative, it denotes diagonals below the main -// diagonal of C, with C(i-k,i) = v(i). C is constructed with the same type -// as v. - -GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector -( - GrB_Matrix *C, // output matrix - const GrB_Vector v, // input vector - int64_t k -) ; - -// GrB_Matrix_diag is like GxB_Matrix_diag (&C, v, k, NULL), except that C must -// already exist on input, of the correct size. Any existing entries in C are -// discarded. The type of C is preserved, so that if the type of C and v -// differ, the entries are typecasted into the type of C. Any settings made to -// C by GrB_set (format by row or by column, bitmap switch, hyper -// switch, and sparsity control) are unchanged. - -GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector -( - GrB_Matrix C, // output matrix - const GrB_Vector v, // input vector - int64_t k, - const GrB_Descriptor desc // to specify # of threads -) ; - -// GxB_Vector_diag extracts a vector v from an input matrix A, which may be -// rectangular. If k = 0, the main diagonal of A is extracted; k > 0 denotes -// diagonals above the main diagonal of A, and k < 0 denotes diagonals below -// the main diagonal of A. Let A have dimension m-by-n. If k is in the range -// 0 to n-1, then v has length min(m,n-k). If k is negative and in the range -// -1 to -m+1, then v has length min(m+k,n). If k is outside these ranges, -// v has length 0 (this is not an error). - -// v must already exist on input, of the correct length; that is -// GrB_Vector_size (&len,v) must return len = 0 if k >= n or k <= -m, len = -// min(m,n-k) if k is in the range 0 to n-1, and len = min(m+k,n) if k is in -// the range -1 to -m+1. Any existing entries in v are discarded. The type of -// v is preserved, so that if the type of A and v differ, the entries are -// typecasted into the type of v. Any settings made to v by -// GrB_set (bitmap switch and sparsity control) are unchanged. - -GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector -( - GrB_Vector v, // output vector - const GrB_Matrix A, // input matrix - int64_t k, - const GrB_Descriptor desc // unused, except threading control -) ; - -//============================================================================== -// GxB_Context: for managing computational resources -//============================================================================== - -GrB_Info GxB_Context_new // create a new Context -( - GxB_Context *Context // handle of Context to create -) ; - -GrB_Info GxB_Context_free // free a Context -( - GxB_Context *Context // handle of Context to free -) ; - -GrB_Info GxB_Context_engage // engage a Context -( - GxB_Context Context // Context to engage -) ; - -GrB_Info GxB_Context_disengage // disengage a Context -( - GxB_Context Context // Context to disengage -) ; - -//============================================================================== -// GrB_set and GrB_get -//============================================================================== - -//------------------------------------------------------------------------------ -// GrB_get: get a scalar, string, enum, size, or void * from an object -//------------------------------------------------------------------------------ - -GrB_Info GrB_Scalar_get_Scalar (GrB_Scalar, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Scalar_get_String (GrB_Scalar, char * , GrB_Field) ; -GrB_Info GrB_Scalar_get_INT32 (GrB_Scalar, int32_t * , GrB_Field) ; -GrB_Info GrB_Scalar_get_SIZE (GrB_Scalar, size_t * , GrB_Field) ; -GrB_Info GrB_Scalar_get_VOID (GrB_Scalar, void * , GrB_Field) ; - -GrB_Info GrB_Vector_get_Scalar (GrB_Vector, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Vector_get_String (GrB_Vector, char * , GrB_Field) ; -GrB_Info GrB_Vector_get_INT32 (GrB_Vector, int32_t * , GrB_Field) ; -GrB_Info GrB_Vector_get_SIZE (GrB_Vector, size_t * , GrB_Field) ; -GrB_Info GrB_Vector_get_VOID (GrB_Vector, void * , GrB_Field) ; - -GrB_Info GrB_Matrix_get_Scalar (GrB_Matrix, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Matrix_get_String (GrB_Matrix, char * , GrB_Field) ; -GrB_Info GrB_Matrix_get_INT32 (GrB_Matrix, int32_t * , GrB_Field) ; -GrB_Info GrB_Matrix_get_SIZE (GrB_Matrix, size_t * , GrB_Field) ; -GrB_Info GrB_Matrix_get_VOID (GrB_Matrix, void * , GrB_Field) ; - -GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_String (const void *, char * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_INT32 (const void *, int32_t * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_SIZE (const void *, size_t * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_VOID (const void *, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_UnaryOp_get_Scalar (GrB_UnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_UnaryOp_get_String (GrB_UnaryOp, char * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_INT32 (GrB_UnaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_SIZE (GrB_UnaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_VOID (GrB_UnaryOp, void * , GrB_Field) ; - -GrB_Info GrB_IndexUnaryOp_get_Scalar (GrB_IndexUnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_String (GrB_IndexUnaryOp, char * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_INT32 (GrB_IndexUnaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_SIZE (GrB_IndexUnaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_VOID (GrB_IndexUnaryOp, void * , GrB_Field) ; - -GrB_Info GrB_BinaryOp_get_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_BinaryOp_get_String (GrB_BinaryOp, char * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_INT32 (GrB_BinaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_SIZE (GrB_BinaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_VOID (GrB_BinaryOp, void * , GrB_Field) ; - -GrB_Info GxB_IndexBinaryOp_get_Scalar (GxB_IndexBinaryOp, GrB_Scalar, - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_String (GxB_IndexBinaryOp, char * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_INT32 (GxB_IndexBinaryOp, int32_t * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_SIZE (GxB_IndexBinaryOp, size_t * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_VOID (GxB_IndexBinaryOp, void * , - GrB_Field) ; - -GrB_Info GrB_Monoid_get_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Monoid_get_String (GrB_Monoid, char * , GrB_Field) ; -GrB_Info GrB_Monoid_get_INT32 (GrB_Monoid, int32_t * , GrB_Field) ; -GrB_Info GrB_Monoid_get_SIZE (GrB_Monoid, size_t * , GrB_Field) ; -GrB_Info GrB_Monoid_get_VOID (GrB_Monoid, void * , GrB_Field) ; - -GrB_Info GrB_Semiring_get_Scalar (GrB_Semiring, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Semiring_get_String (GrB_Semiring, char * , GrB_Field) ; -GrB_Info GrB_Semiring_get_INT32 (GrB_Semiring, int32_t * , GrB_Field) ; -GrB_Info GrB_Semiring_get_SIZE (GrB_Semiring, size_t * , GrB_Field) ; -GrB_Info GrB_Semiring_get_VOID (GrB_Semiring, void * , GrB_Field) ; - -GrB_Info GrB_Descriptor_get_Scalar (GrB_Descriptor, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Descriptor_get_String (GrB_Descriptor, char * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_INT32 (GrB_Descriptor, int32_t * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_SIZE (GrB_Descriptor, size_t * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_VOID (GrB_Descriptor, void * , GrB_Field) ; - -GrB_Info GrB_Type_get_Scalar (GrB_Type, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Type_get_String (GrB_Type, char * , GrB_Field) ; -GrB_Info GrB_Type_get_INT32 (GrB_Type, int32_t * , GrB_Field) ; -GrB_Info GrB_Type_get_SIZE (GrB_Type, size_t * , GrB_Field) ; -GrB_Info GrB_Type_get_VOID (GrB_Type, void * , GrB_Field) ; - -GrB_Info GrB_Global_get_Scalar (GrB_Global, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Global_get_String (GrB_Global, char * , GrB_Field) ; -GrB_Info GrB_Global_get_INT32 (GrB_Global, int32_t * , GrB_Field) ; -GrB_Info GrB_Global_get_SIZE (GrB_Global, size_t * , GrB_Field) ; -GrB_Info GrB_Global_get_VOID (GrB_Global, void * , GrB_Field) ; - -GrB_Info GxB_Context_get_Scalar (GxB_Context, GrB_Scalar, GrB_Field) ; -GrB_Info GxB_Context_get_String (GxB_Context, char * , GrB_Field) ; -GrB_Info GxB_Context_get_INT (GxB_Context, int32_t * , GrB_Field) ; -GrB_Info GxB_Context_get_SIZE (GxB_Context, size_t * , GrB_Field) ; -GrB_Info GxB_Context_get_VOID (GxB_Context, void * , GrB_Field) ; - -// GrB_get (object, value, field): -#if GxB_STDC_VERSION >= 201112L -#define GrB_get(object,value,...) \ - _Generic \ - ( \ - (object), \ - GrB_Scalar : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Scalar_get_Scalar , \ - char * : GrB_Scalar_get_String , \ - int32_t * : GrB_Scalar_get_INT32 , \ - size_t * : GrB_Scalar_get_SIZE , \ - void * : GrB_Scalar_get_VOID \ - ) , \ - GrB_Vector : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Vector_get_Scalar , \ - char * : GrB_Vector_get_String , \ - int32_t * : GrB_Vector_get_INT32 , \ - size_t * : GrB_Vector_get_SIZE , \ - void * : GrB_Vector_get_VOID \ - ) , \ - GrB_Matrix : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Matrix_get_Scalar , \ - char * : GrB_Matrix_get_String , \ - int32_t * : GrB_Matrix_get_INT32 , \ - size_t * : GrB_Matrix_get_SIZE , \ - void * : GrB_Matrix_get_VOID \ - ) , \ - GrB_UnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_UnaryOp_get_Scalar , \ - char * : GrB_UnaryOp_get_String , \ - int32_t * : GrB_UnaryOp_get_INT32 , \ - size_t * : GrB_UnaryOp_get_SIZE , \ - void * : GrB_UnaryOp_get_VOID \ - ) , \ - GrB_IndexUnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_IndexUnaryOp_get_Scalar , \ - char * : GrB_IndexUnaryOp_get_String , \ - int32_t * : GrB_IndexUnaryOp_get_INT32 , \ - size_t * : GrB_IndexUnaryOp_get_SIZE , \ - void * : GrB_IndexUnaryOp_get_VOID \ - ) , \ - GrB_BinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_BinaryOp_get_Scalar , \ - char * : GrB_BinaryOp_get_String , \ - int32_t * : GrB_BinaryOp_get_INT32 , \ - size_t * : GrB_BinaryOp_get_SIZE , \ - void * : GrB_BinaryOp_get_VOID \ - ) , \ - GxB_IndexBinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ - char * : GxB_IndexBinaryOp_get_String , \ - int32_t * : GxB_IndexBinaryOp_get_INT32 , \ - size_t * : GxB_IndexBinaryOp_get_SIZE , \ - void * : GxB_IndexBinaryOp_get_VOID \ - ) , \ - GrB_Monoid : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Monoid_get_Scalar , \ - char * : GrB_Monoid_get_String , \ - int32_t * : GrB_Monoid_get_INT32 , \ - size_t * : GrB_Monoid_get_SIZE , \ - void * : GrB_Monoid_get_VOID \ - ) , \ - GrB_Semiring : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Semiring_get_Scalar , \ - char * : GrB_Semiring_get_String , \ - int32_t * : GrB_Semiring_get_INT32 , \ - size_t * : GrB_Semiring_get_SIZE , \ - void * : GrB_Semiring_get_VOID \ - ) , \ - GrB_Type : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Type_get_Scalar , \ - char * : GrB_Type_get_String , \ - int32_t * : GrB_Type_get_INT32 , \ - size_t * : GrB_Type_get_SIZE , \ - void * : GrB_Type_get_VOID \ - ) , \ - GrB_Descriptor : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Descriptor_get_Scalar , \ - char * : GrB_Descriptor_get_String , \ - int32_t * : GrB_Descriptor_get_INT32 , \ - size_t * : GrB_Descriptor_get_SIZE , \ - void * : GrB_Descriptor_get_VOID \ - ) , \ - GrB_Global : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Global_get_Scalar , \ - char * : GrB_Global_get_String , \ - int32_t * : GrB_Global_get_INT32 , \ - size_t * : GrB_Global_get_SIZE , \ - void * : GrB_Global_get_VOID \ - ) , \ - GxB_Context : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Context_get_Scalar , \ - char * : GxB_Context_get_String , \ - int32_t * : GxB_Context_get_INT , \ - size_t * : GxB_Context_get_SIZE , \ - void * : GxB_Context_get_VOID \ - ) , \ - const void *: \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Serialized_get_Scalar , \ - char * : GxB_Serialized_get_String , \ - int32_t * : GxB_Serialized_get_INT32 , \ - size_t * : GxB_Serialized_get_SIZE , \ - void * : GxB_Serialized_get_VOID \ - ) , \ - void *: \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Serialized_get_Scalar , \ - char * : GxB_Serialized_get_String , \ - int32_t * : GxB_Serialized_get_INT32 , \ - size_t * : GxB_Serialized_get_SIZE , \ - void * : GxB_Serialized_get_VOID \ - ) \ - ) (object, value, __VA_ARGS__) -#endif - -//------------------------------------------------------------------------------ -// GrB_set: set a scalar, string, enum, size, or void * of an object -//------------------------------------------------------------------------------ - -GrB_Info GrB_Scalar_set_Scalar (GrB_Scalar, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Scalar_set_String (GrB_Scalar, char * , GrB_Field) ; -GrB_Info GrB_Scalar_set_INT32 (GrB_Scalar, int32_t , GrB_Field) ; -GrB_Info GrB_Scalar_set_VOID (GrB_Scalar, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Vector_set_Scalar (GrB_Vector, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Vector_set_String (GrB_Vector, char * , GrB_Field) ; -GrB_Info GrB_Vector_set_INT32 (GrB_Vector, int32_t , GrB_Field) ; -GrB_Info GrB_Vector_set_VOID (GrB_Vector, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Matrix_set_Scalar (GrB_Matrix, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Matrix_set_String (GrB_Matrix, char * , GrB_Field) ; -GrB_Info GrB_Matrix_set_INT32 (GrB_Matrix, int32_t , GrB_Field) ; -GrB_Info GrB_Matrix_set_VOID (GrB_Matrix, void * , GrB_Field, size_t) ; - -GrB_Info GrB_UnaryOp_set_Scalar (GrB_UnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_UnaryOp_set_String (GrB_UnaryOp, char * , GrB_Field) ; -GrB_Info GrB_UnaryOp_set_INT32 (GrB_UnaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_UnaryOp_set_VOID (GrB_UnaryOp, void * , GrB_Field, size_t) ; - -GrB_Info GrB_IndexUnaryOp_set_Scalar (GrB_IndexUnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_String (GrB_IndexUnaryOp, char * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_INT32 (GrB_IndexUnaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_VOID (GrB_IndexUnaryOp, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_BinaryOp_set_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_BinaryOp_set_String (GrB_BinaryOp, char * , GrB_Field) ; -GrB_Info GrB_BinaryOp_set_INT32 (GrB_BinaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_BinaryOp_set_VOID (GrB_BinaryOp, void * , GrB_Field, size_t) ; - -GrB_Info GxB_IndexBinaryOp_set_Scalar (GxB_IndexBinaryOp, GrB_Scalar, - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_String (GxB_IndexBinaryOp, char * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_INT32 (GxB_IndexBinaryOp, int32_t , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_VOID (GxB_IndexBinaryOp, void * , - GrB_Field, size_t) ; - -GrB_Info GrB_Monoid_set_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Monoid_set_String (GrB_Monoid, char * , GrB_Field) ; -GrB_Info GrB_Monoid_set_INT32 (GrB_Monoid, int32_t , GrB_Field) ; -GrB_Info GrB_Monoid_set_VOID (GrB_Monoid, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Semiring_set_Scalar (GrB_Semiring, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Semiring_set_String (GrB_Semiring, char * , GrB_Field) ; -GrB_Info GrB_Semiring_set_INT32 (GrB_Semiring, int32_t , GrB_Field) ; -GrB_Info GrB_Semiring_set_VOID (GrB_Semiring, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Descriptor_set_Scalar (GrB_Descriptor, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Descriptor_set_String (GrB_Descriptor, char * , GrB_Field) ; -GrB_Info GrB_Descriptor_set_INT32 (GrB_Descriptor, int32_t , GrB_Field) ; -GrB_Info GrB_Descriptor_set_VOID (GrB_Descriptor, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_Type_set_Scalar (GrB_Type, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Type_set_String (GrB_Type, char * , GrB_Field) ; -GrB_Info GrB_Type_set_INT32 (GrB_Type, int32_t , GrB_Field) ; -GrB_Info GrB_Type_set_VOID (GrB_Type, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Global_set_Scalar (GrB_Global, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Global_set_String (GrB_Global, char * , GrB_Field) ; -GrB_Info GrB_Global_set_INT32 (GrB_Global, int32_t , GrB_Field) ; -GrB_Info GrB_Global_set_VOID (GrB_Global, void * , GrB_Field, size_t) ; - -GrB_Info GxB_Context_set_Scalar (GxB_Context, GrB_Scalar, GrB_Field) ; -GrB_Info GxB_Context_set_String (GxB_Context, char * , GrB_Field) ; -GrB_Info GxB_Context_set_INT (GxB_Context, int32_t , GrB_Field) ; -GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; - -// GrB_set (object, value, field) or (object, value, field, size) for _VOID -#if GxB_STDC_VERSION >= 201112L -#define GrB_set(object,value,...) \ - _Generic \ - ( \ - (object), \ - GrB_Scalar : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Scalar_set_Scalar , \ - char * : GrB_Scalar_set_String , \ - int32_t : GrB_Scalar_set_INT32 , \ - void * : GrB_Scalar_set_VOID \ - ) , \ - GrB_Vector : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Vector_set_Scalar , \ - char * : GrB_Vector_set_String , \ - int32_t : GrB_Vector_set_INT32 , \ - void * : GrB_Vector_set_VOID \ - ) , \ - GrB_Matrix : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Matrix_set_Scalar , \ - char * : GrB_Matrix_set_String , \ - int32_t : GrB_Matrix_set_INT32 , \ - void * : GrB_Matrix_set_VOID \ - ) , \ - GrB_UnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_UnaryOp_set_Scalar , \ - char * : GrB_UnaryOp_set_String , \ - int32_t : GrB_UnaryOp_set_INT32 , \ - void * : GrB_UnaryOp_set_VOID \ - ) , \ - GrB_IndexUnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_IndexUnaryOp_set_Scalar , \ - char * : GrB_IndexUnaryOp_set_String , \ - int32_t : GrB_IndexUnaryOp_set_INT32 , \ - void * : GrB_IndexUnaryOp_set_VOID \ - ) , \ - GrB_BinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_BinaryOp_set_Scalar , \ - char * : GrB_BinaryOp_set_String , \ - int32_t : GrB_BinaryOp_set_INT32 , \ - void * : GrB_BinaryOp_set_VOID \ - ) , \ - GxB_IndexBinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ - char * : GxB_IndexBinaryOp_set_String , \ - int32_t : GxB_IndexBinaryOp_set_INT32 , \ - void * : GxB_IndexBinaryOp_set_VOID \ - ) , \ - GrB_Monoid : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Monoid_set_Scalar , \ - char * : GrB_Monoid_set_String , \ - int32_t : GrB_Monoid_set_INT32 , \ - void * : GrB_Monoid_set_VOID \ - ) , \ - GrB_Semiring : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Semiring_set_Scalar , \ - char * : GrB_Semiring_set_String , \ - int32_t : GrB_Semiring_set_INT32 , \ - void * : GrB_Semiring_set_VOID \ - ) , \ - GrB_Type : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Type_set_Scalar , \ - char * : GrB_Type_set_String , \ - int32_t : GrB_Type_set_INT32 , \ - void * : GrB_Type_set_VOID \ - ) , \ - GrB_Descriptor : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Descriptor_set_Scalar , \ - char * : GrB_Descriptor_set_String , \ - int32_t : GrB_Descriptor_set_INT32 , \ - void * : GrB_Descriptor_set_VOID \ - ) , \ - GrB_Global : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Global_set_Scalar , \ - char * : GrB_Global_set_String , \ - int32_t : GrB_Global_set_INT32 , \ - void * : GrB_Global_set_VOID \ - ) , \ - GxB_Context : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Context_set_Scalar , \ - char * : GxB_Context_set_String , \ - int32_t : GxB_Context_set_INT , \ - void * : GxB_Context_set_VOID \ - ) \ - ) (object, value, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_free: free any GraphBLAS object -//============================================================================== - -#if GxB_STDC_VERSION >= 201112L -#define GrB_free(object) \ - _Generic \ - ( \ - (object), \ - GrB_Type *: GrB_Type_free , \ - GrB_UnaryOp *: GrB_UnaryOp_free , \ - GrB_BinaryOp *: GrB_BinaryOp_free , \ - GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ - GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ - GrB_Monoid *: GrB_Monoid_free , \ - GrB_Semiring *: GrB_Semiring_free , \ - GrB_Scalar *: GrB_Scalar_free , \ - GrB_Vector *: GrB_Vector_free , \ - GrB_Matrix *: GrB_Matrix_free , \ - GrB_Descriptor *: GrB_Descriptor_free , \ - GxB_Context *: GxB_Context_free , \ - GxB_Iterator *: GxB_Iterator_free \ - ) \ - (object) -#endif - -//============================================================================== -// GrB_wait: finish computations -//============================================================================== - -// Finish all pending work in a specific object. - -GrB_Info GrB_Type_wait (GrB_Type type , GrB_WaitMode waitmode); -GrB_Info GrB_UnaryOp_wait (GrB_UnaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_BinaryOp_wait (GrB_BinaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_IndexUnaryOp_wait (GrB_IndexUnaryOp op , GrB_WaitMode waitmode); -GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_Monoid_wait (GrB_Monoid monoid , GrB_WaitMode waitmode); -GrB_Info GrB_Semiring_wait (GrB_Semiring semiring, GrB_WaitMode waitmode); -GrB_Info GrB_Descriptor_wait (GrB_Descriptor desc , GrB_WaitMode waitmode); -GrB_Info GrB_Scalar_wait (GrB_Scalar s , GrB_WaitMode waitmode); -GrB_Info GrB_Vector_wait (GrB_Vector v , GrB_WaitMode waitmode); -GrB_Info GrB_Matrix_wait (GrB_Matrix A , GrB_WaitMode waitmode); -GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); - -// GrB_wait (object,waitmode) polymorphic function: -#if GxB_STDC_VERSION >= 201112L -#define GrB_wait(object,waitmode) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GrB_Type_wait , \ - GrB_UnaryOp : GrB_UnaryOp_wait , \ - GrB_BinaryOp : GrB_BinaryOp_wait , \ - GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ - GrB_Monoid : GrB_Monoid_wait , \ - GrB_Semiring : GrB_Semiring_wait , \ - GrB_Scalar : GrB_Scalar_wait , \ - GrB_Vector : GrB_Vector_wait , \ - GrB_Matrix : GrB_Matrix_wait , \ - GxB_Context : GxB_Context_wait , \ - GrB_Descriptor : GrB_Descriptor_wait \ - ) \ - (object, waitmode) -#endif - -//============================================================================== -// GrB_error: error handling -//============================================================================== - -// Each GraphBLAS method and operation returns a GrB_Info error code. -// GrB_error returns additional information on the error in a thread-safe -// null-terminated string. The string returned by GrB_error is owned by -// the GraphBLAS library and must not be free'd. - -GrB_Info GrB_Type_error (const char **error, const GrB_Type type) ; -GrB_Info GrB_UnaryOp_error (const char **error, const GrB_UnaryOp op) ; -GrB_Info GrB_BinaryOp_error (const char **error, const GrB_BinaryOp op) ; -GrB_Info GrB_IndexUnaryOp_error (const char **error, - const GrB_IndexUnaryOp op) ; -GrB_Info GxB_IndexBinaryOp_error(const char **error, - const GxB_IndexBinaryOp op); -GrB_Info GrB_Monoid_error (const char **error, const GrB_Monoid monoid) ; -GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring - semiring) ; -GrB_Info GrB_Scalar_error (const char **error, const GrB_Scalar s) ; -GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) ; -GrB_Info GrB_Matrix_error (const char **error, const GrB_Matrix A) ; -GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor d) ; -GrB_Info GxB_Context_error (const char **error, const GxB_Context c) ; - -// GrB_error (error,object) polymorphic function: -#if GxB_STDC_VERSION >= 201112L -#define GrB_error(error,object) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GrB_Type_error , \ - GrB_UnaryOp : GrB_UnaryOp_error , \ - GrB_BinaryOp : GrB_BinaryOp_error , \ - GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ - GrB_Monoid : GrB_Monoid_error , \ - GrB_Semiring : GrB_Semiring_error , \ - GrB_Scalar : GrB_Scalar_error , \ - GrB_Vector : GrB_Vector_error , \ - GrB_Matrix : GrB_Matrix_error , \ - GxB_Context : GxB_Context_error , \ - GrB_Descriptor : GrB_Descriptor_error \ - ) \ - (error, object) -#endif - -//============================================================================== -// GrB_mxm, vxm, mxv: matrix multiplication over a semiring -//============================================================================== - -// No accum operator in any method can be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_mxm // C = accum (C, A*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_vxm // w' = accum (w, u'*A) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for u'*A - const GrB_Vector u, // first input: vector u - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -GrB_Info GrB_mxv // w = accum (w, A*u) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -//============================================================================== -// GrB_eWiseMult: element-wise matrix and vector operations, set intersection -//============================================================================== - -// GrB_eWiseMult computes C = accum (C, A.*B), where ".*" is the Hadamard -// product, and where pairs of elements in two matrices (or vectors) are -// pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). - -// The mult operator can be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp mult, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp mult, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -// All 6 of the above type-specific functions are captured in a single -// type-generic function, GrB_eWiseMult: - -#if GxB_STDC_VERSION >= 201112L -#define GrB_eWiseMult(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_eWiseMult_Semiring , \ - GrB_Monoid : GrB_Matrix_eWiseMult_Monoid , \ - GrB_BinaryOp : GrB_Matrix_eWiseMult_BinaryOp \ - ), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Vector_eWiseMult_Semiring , \ - GrB_Monoid : GrB_Vector_eWiseMult_Monoid , \ - GrB_BinaryOp : GrB_Vector_eWiseMult_BinaryOp \ - ) \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GrB_eWiseAdd: element-wise matrix and vector operations, set union -//============================================================================== - -// GrB_eWiseAdd computes C = accum (C, A+B), where pairs of elements in -// two matrices (or two vectors) are pairwise "added". - -GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GrB_eWiseAdd(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_eWiseAdd_Semiring , \ - GrB_Monoid : GrB_Matrix_eWiseAdd_Monoid , \ - GrB_BinaryOp : GrB_Matrix_eWiseAdd_BinaryOp \ - ), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Vector_eWiseAdd_Semiring , \ - GrB_Monoid : GrB_Vector_eWiseAdd_Monoid , \ - GrB_BinaryOp : GrB_Vector_eWiseAdd_BinaryOp \ - ) \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GxB_eWiseUnion: a variant of GrB_eWiseAdd -//============================================================================== - -// GxB_eWiseUnion is a variant of eWiseAdd. The methods create a result with -// the same sparsity structure. They differ when an entry is present in A but -// not B, or in B but not A. - -// eWiseAdd does the following, for a matrix, where "+" is the add binary op: - -// if A(i,j) and B(i,j) are both present: -// C(i,j) = A(i,j) + B(i,j) -// else if A(i,j) is present but not B(i,j) -// C(i,j) = A(i,j) -// else if B(i,j) is present but not A(i,j) -// C(i,j) = B(i,j) - -// by contrast, eWiseUnion always applies the operator: - -// if A(i,j) and B(i,j) are both present: -// C(i,j) = A(i,j) + B(i,j) -// else if A(i,j) is present but not B(i,j) -// C(i,j) = A(i,j) + beta -// else if B(i,j) is present but not A(i,j) -// C(i,j) = alpha + B(i,j) - -GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Scalar alpha, - const GrB_Vector v, // second input: vector v - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar alpha, - const GrB_Matrix B, // second input: matrix B - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GxB_eWiseUnion(C,Mask,accum,op,A,alpha,B,beta,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : GxB_Matrix_eWiseUnion , \ - GrB_Vector : GxB_Vector_eWiseUnion \ - ) \ - (C, Mask, accum, op, A, alpha, B, beta, desc) -#endif - -//============================================================================== -// GrB_extract: extract a submatrix or subvector -//============================================================================== - -GrB_Info GrB_Vector_extract // w = accum (w, u(I)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -// GrB_extract is a generic interface to the following functions: - -// GrB_Vector_extract (w,mask,acc,u,I,ni,d) // w = acc (w, u(I)) -// GrB_Col_extract (w,mask,acc,A,I,ni,j,d) // w = acc (w, A(I,j)) -// GrB_Matrix_extract (C,Mask,acc,A,I,ni,J,nj,d) // C = acc (C, A(I,J)) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_extract(arg1,Mask,accum,arg4,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GrB_Vector : GrB_Vector_extract , \ - GrB_Matrix : GrB_Col_extract \ - ), \ - GrB_Matrix : GrB_Matrix_extract \ - ) \ - (arg1, Mask, accum, arg4, __VA_ARGS__) -#endif - -//============================================================================== -// GxB_subassign: matrix and vector subassign: C(I,J) = accum (C(I,J), A) -//============================================================================== - -// Assign entries in a matrix or vector; C(I,J) = A. - -// Each GxB_subassign function is very similar to its corresponding GrB_assign -// function in the spec, but they differ in two ways: (1) the mask in -// GxB_subassign has the same size as w(I) for vectors and C(I,J) for matrices, -// and (2) they differ in the GrB_REPLACE option. See the user guide for -// details. - -// In GraphBLAS notation, the two methods can be described as follows: - -// matrix and vector subassign: C(I,J) = accum (C(I,J), A) -// matrix and vector assign: C(I,J) = accum (C(I,J), A) - -// --- assign ------------------------------------------------------------------ -// -// GrB_Matrix_assign C(I,J) += A M same size as matrix C. -// A is |I|-by-|J| -// -// GrB_Vector_assign w(I) += u m same size as column vector w. -// u is |I|-by-1 -// -// GrB_Row_assign C(i,J) += u' m is a column vector the same -// size as a row of C. -// u is |J|-by-1, i is a scalar. -// -// GrB_Col_assign C(I,j) += u m is a column vector the same -// size as a column of C. -// u is |I|-by-1, j is a scalar. -// -// --- subassign --------------------------------------------------------------- -// -// GxB_Matrix_subassign C(I,J) += A M same size as matrix A. -// A is |I|-by-|J| -// -// GxB_Vector_subassign w(I) += u m same size as column vector u. -// u is |I|-by-1 -// -// GxB_Row_subassign C(i,J) += u' m same size as column vector u. -// u is |J|-by-1, i is a scalar. -// -// GxB_Col_subassign C(I,j) += u m same size as column vector u. -// u is |I|-by-1, j is a scalar. - -GrB_Info GxB_Vector_subassign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Matrix_subassign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J), Mask, and A -) ; - -GrB_Info GxB_Col_subassign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(I,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(I,j) and mask -) ; - -GrB_Info GxB_Row_subassign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - GrB_Index i, // row index - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,J) and mask -) ; - -//------------------------------------------------------------------------------ -// GxB_Vector_subassign_[SCALAR]: scalar expansion assignment to subvector -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The -// scalar x is implicitly expanded into a vector u of size ni-by-1, with each -// entry in u equal to x, and then w(I) = accum(w(I),u) is done. - -GrB_Info GxB_Vector_subassign_BOOL // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - bool x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FP32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - float x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FP64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - double x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FC32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FC64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UDT // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - void *x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_subassign_[SCALAR]: scalar expansion assignment to submatrix -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The -// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each -// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. - -GrB_Info GxB_Matrix_subassign_BOOL // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - bool x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FP32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - float x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FP64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - double x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FC32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FC64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UDT // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - void *x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -//------------------------------------------------------------------------------ -// GxB_subassign: generic submatrix/subvector assignment -//------------------------------------------------------------------------------ - -// GxB_subassign is a generic function that provides access to all specific -// GxB_*_subassign* functions: - -// GxB_Vector_subassign (w,m,acc,u,I,ni,d) // w(I) = acc(w(I),u) -// GxB_Matrix_subassign (C,M,acc,A,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),A) -// GxB_Col_subassign (C,m,acc,u,I,ni,j,d) // C(I,j) = acc(C(I,j),u) -// GxB_Row_subassign (C,m,acc,u,i,J,nj,d) // C(i,J) = acc(C(i,J),u') -// GxB_Vector_subassign_T (w,m,acc,x,I,ni,d) // w(I) = acc(w(I),x) -// GxB_Matrix_subassign_T (C,M,acc,x,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),x) - -#if GxB_STDC_VERSION >= 201112L -#define GxB_subassign(arg1,Mask,accum,arg4,arg5,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GxB, Vector_subassign) , \ - GrB_Scalar : GxB_Vector_subassign_Scalar, \ - default: GxB_Vector_subassign \ - ), \ - default: \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GxB, Matrix_subassign) , \ - GrB_Scalar : GxB_Matrix_subassign_Scalar, \ - GrB_Vector : \ - _Generic \ - ( \ - (arg5), \ - const GrB_Index *: GxB_Col_subassign , \ - GrB_Index *: GxB_Col_subassign , \ - default: GxB_Row_subassign \ - ), \ - default: GxB_Matrix_subassign \ - ) \ - ) \ - (arg1, Mask, accum, arg4, arg5, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_assign: matrix and vector assign: C(I,J) = accum (C(I,J), A) -//============================================================================== - -// Assign entries in a matrix or vector; C(I,J) = A. -// Each of these can be used with their generic name, GrB_assign. - -GrB_Info GrB_Vector_assign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_assign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -GrB_Info GrB_Col_assign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(:,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(:,j) and mask -) ; - -GrB_Info GrB_Row_assign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,:), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - GrB_Index i, // row index - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,:) and mask -) ; - -//------------------------------------------------------------------------------ -// GrB_Vector_assign_[SCALAR]: scalar expansion assignment to subvector -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The -// scalar x is implicitly expanded into a vector u of size ni-by-1, with each -// entry in u equal to x, and then w(I) = accum(w(I),u) is done. - -GrB_Info GrB_Vector_assign_BOOL // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - bool x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_FP32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - float x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_FP64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - double x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_assign_FC32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_assign_FC64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UDT // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - void *x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_assign_[SCALAR]: scalar expansion assignment to submatrix -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The -// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each -// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. - -GrB_Info GrB_Matrix_assign_BOOL // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - bool x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_FP32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - float x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_FP64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - double x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GxB_Matrix_assign_FC32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GxB_Matrix_assign_FC64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UDT // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - void *x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -//------------------------------------------------------------------------------ -// GrB_assign: generic submatrix/subvector assignment -//------------------------------------------------------------------------------ - -// GrB_assign is a generic function that provides access to all specific -// GrB_*_assign* functions: - -// GrB_Vector_assign_T (w,m,acc,x,I,ni,d) // w(I) = acc(w(I),x) -// GrB_Vector_assign (w,m,acc,u,I,ni,d) // w(I) = acc(w(I),u) -// GrB_Matrix_assign_T (C,M,acc,x,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),x) -// GrB_Col_assign (C,m,acc,u,I,ni,j,d) // C(I,j) = acc(C(I,j),u) -// GrB_Row_assign (C,m,acc,u,i,J,nj,d) // C(i,J) = acc(C(i,J),u') -// GrB_Matrix_assign (C,M,acc,A,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),A) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_assign(arg1,Mask,accum,arg4,arg5,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GrB, Vector_assign) , \ - GrB_Scalar : GrB_Vector_assign_Scalar , \ - default: GrB_Vector_assign \ - ), \ - default: \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GrB, Matrix_assign) , \ - GrB_Scalar : GrB_Matrix_assign_Scalar , \ - GrB_Vector : \ - _Generic \ - ( \ - (arg5), \ - const GrB_Index *: GrB_Col_assign , \ - GrB_Index *: GrB_Col_assign , \ - default: GrB_Row_assign \ - ), \ - default: GrB_Matrix_assign \ - ) \ - ) \ - (arg1, Mask, accum, arg4, arg5, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_apply: matrix and vector apply -//============================================================================== - -// Apply a unary, index_unary, or binary operator to entries in a matrix or -// vector, C = accum (C, op (A)). - -GrB_Info GrB_Vector_apply // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_apply // C = accum (C, op(A)) or op(A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// vector apply: binaryop variants (bind 1st) -//------------------------------------------- - -// Apply a binary operator to the entries in a vector, binding the first -// input to a scalar x, w = accum (w, op (x,u)). - -GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - bool x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT8 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int8_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT16 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int16_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint8_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint16_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_FP32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - float x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_FP64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - double x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp1st_FC32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp1st_FC64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UDT // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const void *x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// vector apply: binaryop variants (bind 2nd) -//------------------------------------------- - -// Apply a binary operator to the entries in a vector, binding the second -// input to a scalar y, w = accum (w, op (u,y)). - -GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// vector apply: IndexUnaryOp variants -//------------------------------------------- - -// Apply a GrB_IndexUnaryOp to the entries in a vector - -GrB_Info GrB_Vector_apply_IndexOp_Scalar // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_BOOL // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_FP32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_FP64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_IndexOp_FC32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_IndexOp_FC64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UDT // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// matrix apply: binaryop variants (bind 1st) -//------------------------------------------- - -// Apply a binary operator to the entries in a matrix, binding the first input -// to a scalar x, C = accum (C, op (x,A)), or op(x,A'). - -GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - bool x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int8_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int16_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint8_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint16_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - float x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - double x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const void *x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// matrix apply: binaryop variants (bind 2nd) -//------------------------------------------- - -// Apply a binary operator to the entries in a matrix, binding the second input -// to a scalar y, C = accum (C, op (A,y)), or op(A',y). - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// matrix apply: IndexUnaryOp variants -//------------------------------------------- - -// Apply a GrB_IndexUnaryOp to the entries in a matrix. - -GrB_Info GrB_Matrix_apply_IndexOp_Scalar // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_BOOL // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_FP32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_FP64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_IndexOp_FC32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_IndexOp_FC64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UDT // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------------------------------------------ -// GrB_apply: generic matrix/vector apply -//------------------------------------------------------------------------------ - -// GrB_apply is a generic function for applying a unary operator to a matrix -// or vector and provides access to these functions: - -// GrB_Vector_apply (w,mask,acc,op,u,d) // w = accum (w, op(u)) -// GrB_Matrix_apply (C,Mask,acc,op,A,d) // C = accum (C, op(A)) - -// GrB_Vector_apply (w,m,acc,unop ,u,d) -// GrB_Vector_apply_BinaryOp1st_TYPE (w,m,acc,binop,x,u,d) -// GrB_Vector_apply_BinaryOp2nd_TYPE (w,m,acc,binop,u,y,d) -// GrB_Vector_apply_IndexOp_TYPE (w,m,acc,idxop,u,y,d) - -// GrB_Matrix_apply (C,M,acc,unop ,A,d) -// GrB_Matrix_apply_BinaryOp1st_TYPE (C,M,acc,binop,x,A,d) -// GrB_Matrix_apply_BinaryOp2nd_TYPE (C,M,acc,binop,A,y,d) -// GrB_Matrix_apply_IndexOp_TYPE (C,M,acc,idxop,A,y,d) - -#if GxB_STDC_VERSION >= 201112L - -#define GB_BIND(kind,x,y,...) \ - _Generic \ - ( \ - (x), \ - GrB_Scalar: GB_CONCAT ( GrB,_,kind,_apply_BinaryOp1st_Scalar), \ - GB_CASES (GrB, GB_CONCAT ( kind, _apply_BinaryOp1st,, )) , \ - default: \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, GB_CONCAT ( kind , _apply_BinaryOp2nd,, )), \ - default: GB_CONCAT ( GrB,_,kind,_apply_BinaryOp2nd_Scalar) \ - ) \ - ) - -#define GB_IDXOP(kind,A,y,...) \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, GB_CONCAT ( kind, _apply_IndexOp,, )), \ - default: GB_CONCAT ( GrB, _, kind, _apply_IndexOp_Scalar) \ - ) - -#define GrB_apply(C,Mask,accum,op,...) \ - _Generic \ - ( \ - (C), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_UnaryOp : GrB_Vector_apply , \ - GrB_BinaryOp : GB_BIND (Vector, __VA_ARGS__), \ - GrB_IndexUnaryOp : GB_IDXOP (Vector, __VA_ARGS__) \ - ), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_UnaryOp : GrB_Matrix_apply , \ - GrB_BinaryOp : GB_BIND (Matrix, __VA_ARGS__), \ - GrB_IndexUnaryOp : GB_IDXOP (Matrix, __VA_ARGS__) \ - ) \ - ) \ - (C, Mask, accum, op, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_select: matrix and vector selection using an IndexUnaryOp -//============================================================================== - -//------------------------------------------- -// vector select using an IndexUnaryOp -//------------------------------------------- - -GrB_Info GrB_Vector_select_Scalar // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_BOOL // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_FP32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_FP64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_select_FC32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_select_FC64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UDT // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// matrix select using an IndexUnaryOp -//------------------------------------------- - -GrB_Info GrB_Matrix_select_Scalar // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_BOOL // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_FP32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_FP64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_select_FC32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_select_FC64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UDT // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -// GrB_select is a generic method that applies an IndexUnaryOp to -// a matrix or vector, using any type of the scalar y. - -// GrB_Vector_select_TYPE (w,m,acc,idxop,u,y,d) -// GrB_Matrix_select_TYPE (C,M,acc,idxop,A,y,d) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_select(C,Mask,accum,op,x,y,d) \ - _Generic \ - ( \ - (C), \ - GrB_Vector : \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, Vector_select), \ - default: GrB_Vector_select_Scalar \ - ), \ - GrB_Matrix : \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, Matrix_select), \ - default: GrB_Matrix_select_Scalar \ - ) \ - ) \ - (C, Mask, accum, op, x, y, d) -#endif - -//============================================================================== -// GrB_reduce: matrix and vector reduction -//============================================================================== - -// Reduce the entries in a matrix to a vector, a column vector t such that -// t(i) = sum (A (i,:)), and where "sum" is a commutative and associative -// monoid with an identity value. A can be transposed, which reduces down the -// columns instead of the rows. - -// For GrB_Matrix_reduce_BinaryOp, the GrB_BinaryOp op must correspond to a -// known built-in monoid: -// -// operator data-types (all built-in) -// ---------------------- --------------------------- -// MIN, MAX INT*, UINT*, FP* -// TIMES, PLUS INT*, UINT*, FP*, FC* -// ANY INT*, UINT*, FP*, FC*, BOOL -// LOR, LAND, LXOR, EQ BOOL -// BOR, BAND, BXOR, BXNOR UINT* - -GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // reduce operator for t=reduce(A) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -GrB_Info GrB_Matrix_reduce_BinaryOp // w = accum (w,reduce(A)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // reduce operator for t=reduce(A) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -//------------------------------------------------------------------------------ -// reduce a vector to a scalar -//------------------------------------------------------------------------------ - -// Reduce entries in a vector to a scalar, c = accum (c, reduce_to_scalar(u)) - -GrB_Info GrB_Vector_reduce_BOOL // c = accum (c, reduce_to_scalar (u)) -( - bool *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT8 // c = accum (c, reduce_to_scalar (u)) -( - int8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT8 // c = accum (c, reduce_to_scalar (u)) -( - uint8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT16 // c = accum (c, reduce_to_scalar (u)) -( - int16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT16 // c = accum (c, reduce_to_scalar (u)) -( - uint16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT32 // c = accum (c, reduce_to_scalar (u)) -( - int32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT32 // c = accum (c, reduce_to_scalar (u)) -( - uint32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT64 // c = accum (c, reduce_to_scalar (u)) -( - int64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT64 // c = accum (c, reduce_to_scalar (u)) -( - uint64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_FP32 // c = accum (c, reduce_to_scalar (u)) -( - float *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_FP64 // c = accum (c, reduce_to_scalar (u)) -( - double *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Vector_reduce_FC32 // c = accum (c, reduce_to_scalar (u)) -( - GxB_FC32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Vector_reduce_FC64 // c = accum (c, reduce_to_scalar (u)) -( - GxB_FC64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UDT // c = accum (c, reduce_to_scalar (u)) -( - void *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(u)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_BinaryOp_Scalar -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_BinaryOp op, // binary op to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -//------------------------------------------------------------------------------ -// reduce a matrix to a scalar -//------------------------------------------------------------------------------ - -// Reduce entries in a matrix to a scalar, c = accum (c, reduce_to_scalar(A)) - -GrB_Info GrB_Matrix_reduce_BOOL // c = accum (c, reduce_to_scalar (A)) -( - bool *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT8 // c = accum (c, reduce_to_scalar (A)) -( - int8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT8 // c = accum (c, reduce_to_scalar (A)) -( - uint8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT16 // c = accum (c, reduce_to_scalar (A)) -( - int16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT16 // c = accum (c, reduce_to_scalar (A)) -( - uint16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT32 // c = accum (c, reduce_to_scalar (A)) -( - int32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT32 // c = accum (c, reduce_to_scalar (A)) -( - uint32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT64 // c = accum (c, reduce_to_scalar (A)) -( - int64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT64 // c = accum (c, reduce_to_scalar (A)) -( - uint64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_FP32 // c = accum (c, reduce_to_scalar (A)) -( - float *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_FP64 // c = accum (c, reduce_to_scalar (A)) -( - double *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Matrix_reduce_FC32 // c = accum (c, reduce_to_scalar (A)) -( - GxB_FC32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Matrix_reduce_FC64 // c = accum (c, reduce_to_scalar (A)) -( - GxB_FC64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UDT // c = accum (c, reduce_to_scalar (A)) -( - void *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(A)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar -( - GrB_Scalar S, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_BinaryOp op, // binary op to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -//------------------------------------------------------------------------------ -// GrB_reduce: generic matrix/vector reduction to a vector or scalar -//------------------------------------------------------------------------------ - -// GrB_reduce is a generic function that provides access to all GrB_*reduce* -// functions: - -// reduce matrix to vector: -// GrB_Matrix_reduce_Monoid (w,mask,acc,mo,A,d) // w = acc (w,reduce(A)) -// GrB_Matrix_reduce_BinaryOp (w,mask,acc,op,A,d) // w = acc (w,reduce(A)) - -// reduce matrix to scalar: -// GrB_Vector_reduce_[SCALAR] (c,acc,monoid,u,d) // c = acc (c,reduce(u)) -// GrB_Matrix_reduce_[SCALAR] (c,acc,monoid,A,d) // c = acc (c,reduce(A)) -// GrB_Vector_reduce_Monoid_Scalar (s,acc,monoid,u,d) // s = acc (s,reduce(u)) -// GrB_Matrix_reduce_Monoid_Scalar (s,acc,monoid,A,d) // s = acc (s,reduce(A)) -// GrB_Vector_reduce_BinaryOp_Scalar (s,acc,op,u,d) // s = acc (s,reduce(u)) -// GrB_Matrix_reduce_BinaryOp_Scalar (s,acc,op,A,d) // s = acc (s,reduce(A)) - -#if GxB_STDC_VERSION >= 201112L -#define GB_REDUCE_TO_SCALAR(kind,c,op) \ - _Generic \ - ( \ - (c), \ - GB_PCASES (GrB, GB_CONCAT ( kind, _reduce,, )), \ - default: \ - _Generic \ - ( \ - (op), \ - GrB_BinaryOp : \ - GB_CONCAT (GrB,_,kind,_reduce_BinaryOp_Scalar),\ - default: GB_CONCAT (GrB,_,kind,_reduce_Monoid_Scalar) \ - ) \ - ) - -#define GrB_reduce(arg1,arg2,arg3,arg4,...) \ - _Generic \ - ( \ - (arg4), \ - GrB_Vector : GB_REDUCE_TO_SCALAR (Vector, arg1, arg3), \ - GrB_Matrix : GB_REDUCE_TO_SCALAR (Matrix, arg1, arg3), \ - GrB_Monoid : GrB_Matrix_reduce_Monoid , \ - GrB_BinaryOp : GrB_Matrix_reduce_BinaryOp \ - ) \ - (arg1, arg2, arg3, arg4, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_transpose: matrix transpose -//============================================================================== - -GrB_Info GrB_transpose // C = accum (C, A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -//============================================================================== -// GrB_kronecker: Kronecker product -//============================================================================== - -GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GrB_kronecker(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_kronecker_Semiring , \ - GrB_Monoid : GrB_Matrix_kronecker_Monoid , \ - GrB_BinaryOp : GrB_Matrix_kronecker_BinaryOp \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GrB_*_resize: change the size of a matrix or vector -//============================================================================== - -// If the dimensions decrease, entries that fall outside the resized matrix or -// vector are deleted. - -GrB_Info GrB_Matrix_resize // change the size of a matrix -( - GrB_Matrix C, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix -) ; - -GrB_Info GrB_Vector_resize // change the size of a vector -( - GrB_Vector w, // vector to modify - GrB_Index nrows_new // new number of rows in vector -) ; - -// GxB_resize is a generic function for resizing a matrix or vector: -// GrB_Vector_resize (u,nrows_new) -// GrB_Matrix_resize (A,nrows_new,ncols_new) -#if GxB_STDC_VERSION >= 201112L -#define GxB_resize(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : GrB_Vector_resize , \ - GrB_Matrix : GrB_Matrix_resize \ - ) \ - (arg1, __VA_ARGS__) -#endif - -//============================================================================== -// GxB_fprint and GxB_print: print the contents of a GraphBLAS object -//============================================================================== - -// GxB_fprint (object, GxB_Print_Level pr, FILE *f) prints the contents of any -// of the 9 GraphBLAS objects to the file f, and also does an extensive test on -// the object to determine if it is valid. It returns one of the following -// error conditions: -// -// GrB_SUCCESS object is valid -// GrB_UNINITIALIZED_OBJECT object is not initialized -// GrB_INVALID_OBJECT object is not valid -// GrB_NULL_POINTER object is a NULL pointer -// GrB_INVALID_VALUE fprintf returned an I/O error; see the ANSI C -// errno or GrB_error( )for details. -// -// GxB_fprint does not modify the status of any object. If a matrix or vector -// has not been completed, the pending computations are guaranteed to *not* be -// performed by GxB_fprint. The reason is simple. It is possible for a bug in -// the user application (such as accessing memory outside the bounds of an -// array) to mangle the internal content of a GraphBLAS object, and GxB_fprint -// can be a helpful tool to track down this bug. If GxB_fprint attempted to -// complete any computations prior to printing or checking the contents of the -// matrix or vector, then further errors could occur, including a segfault. -// -// The type-specific functions include an additional argument, the name string. -// The name is printed at the beginning of the display (assuming pr is not -// GxB_SILENT) so that the object can be more easily identified in the output. -// For the type-generic methods GxB_fprint and GxB_print, the name string is -// the variable name of the object itself. -// -// If f is NULL, stdout is used; this is not an error condition. If pr is -// outside the bounds 0 to 3, negative values are treated as GxB_SILENT, and -// values > 3 are treated as GxB_COMPLETE. If name is NULL, it is treated as -// the empty string. -// -// GxB_print (object, GxB_Print_Level pr) is the same as GxB_fprint, except -// that it prints the contents with printf instead of fprintf to a file f. -// -// The exact content and format of what is printed is implementation-dependent, -// and will change from version to version of SuiteSparse:GraphBLAS. Do not -// attempt to rely on the exact content or format by trying to parse the -// resulting output via another program. The intent of these functions is to -// produce a report of the object for visual inspection. - -GrB_Info GxB_Type_fprint // print and check a GrB_Type -( - GrB_Type type, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp -( - GrB_UnaryOp unaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp -( - GrB_BinaryOp binaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp -( - GrB_IndexUnaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp -( - GxB_IndexBinaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid -( - GrB_Monoid monoid, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring -( - GrB_Semiring semiring, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor -( - GrB_Descriptor descriptor, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix -( - GrB_Matrix A, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Vector_fprint // print and check a GrB_Vector -( - GrB_Vector v, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar -( - GrB_Scalar s, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Context_fprint // print and check a GxB_Context -( - GxB_Context Context, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GxB_fprint(object,pr,f) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GxB_Type_fprint , \ - GrB_UnaryOp : GxB_UnaryOp_fprint , \ - GrB_BinaryOp : GxB_BinaryOp_fprint , \ - GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ - GrB_Monoid : GxB_Monoid_fprint , \ - GrB_Semiring : GxB_Semiring_fprint , \ - GrB_Scalar : GxB_Scalar_fprint , \ - GrB_Vector : GxB_Vector_fprint , \ - GrB_Matrix : GxB_Matrix_fprint , \ - GrB_Descriptor : GxB_Descriptor_fprint , \ - GxB_Context : GxB_Context_fprint \ - ) \ - (object, GB_STR(object), pr, f) - -#define GxB_print(object,pr) GxB_fprint(object,pr,NULL) -#endif - -//============================================================================== -// GxB_pack/GxB_unpack: Matrix and vector pack/unpack -//============================================================================== - -// The pack/unpack functions allow the user application to create a GrB_Matrix -// or GrB_Vector object, and to extract its contents, faster and with less -// memory overhead than the GrB_*_build and GrB_*_extractTuples functions. - -// The semantics of pack/unpack are the same as the "move constructor" in C++. -// On pack, the user provides a set of arrays that have been previously -// allocated via the ANSI C malloc function. The arrays define the content of -// the matrix or vector. Unlike GrB_*_build, the GraphBLAS library then takes -// ownership of the user's input arrays and may either (a) incorporate them -// into its internal data structure for the new GrB_Matrix or GrB_Vector, -// potentially creating the GrB_Matrix or GrB_Vector in constant time with no -// memory copying performed, or (b) if the library does not support the format -// directly, then it may convert the input to its internal format, and then -// free the user's input arrays. GraphBLAS may also choose to use a mix of the -// two strategies. In either case, the input arrays are no longer "owned" by -// the user application. If A is a GrB_Matrix created by a pack, the user -// input arrays are freed no later than GrB_free (&A), and may be freed -// earlier, at the discretion of the GraphBLAS library. The data structure of -// the GrB_Matrix and GrB_Vector remain opaque. - -// The unpack of a GrB_Matrix or GrB_Vector is symmetric with the pack -// operation. The GrB_Matrix or GrB_Vector exists after an unpack operation, -// just with no entries. For unpack, the user is returned several arrays that -// contain the matrix or vector in the requested format. Ownership of these -// arrays is given to the user application, which is then responsible for -// freeing them via the ANSI C free function. If the output format is -// supported by the GraphBLAS library, then these arrays may be returned to the -// user application in O(1) time and with no memory copying performed. -// Otherwise, the GraphBLAS library will create the output arrays for the user -// (via the ANSI C malloc function), fill them with the GrB_Matrix or -// GrB_Vector data, and then return the newly allocated arrays to the user. - -// Eight different formats are provided for pack/unpack. For each format, the -// Ax array has a C-type corresponding to one of the 13 built-in types -// in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or double -// complex), or a user-defined type. - -// On pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must be -// non-NULL pointers to memory space allocated by the ANSI C malloc (or calloc, -// or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, vb, vi, -// and vx arrays may all be NULL). For the pack, A (or GrB_Vector v) is -// undefined on input, just like GrB_*_new, the GrB_Matrix. If the pack is -// successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers to -// the user input arrays have been set to NULL. These user arrays have either -// been incorporated directly into the GrB_Matrix A or GrB_Vector v, in which -// case the user input arrays will eventually be freed by GrB_free (&A), or -// their contents have been copied and the arrays freed. This decision is made -// by the GraphBLAS library itself, and the user application has no control -// over this decision. - -// If any of the arrays Ab, Aj, Ai, Ax, vb, vi, or vx have zero size (with -// nzmax of zero), they are allowed to be be NULL pointers on input. - -// A matrix or vector may be "iso", where all entries present in the pattern -// have the same value. In this case, the boolean iso flag is true, and the -// corresponding numerical array (Ax for matrices, vx for vectors, below) need -// be only large enough to hold a single value. - -// No error checking is performed on the content of the user input arrays. If -// the user input arrays do not conform to the precise specifications above, -// results are undefined. No typecasting of the values of the matrix or vector -// entries is performed on pack/unpack - -// SuiteSparse:GraphBLAS supports all eight formats natively (CSR, CSC, -// HyperCSR, and HyperCSC, BitmapR, BitmapC, FullR, FullC). For vectors, only -// CSC, BitmapC, and FullC formats are used. On pack, the all eight formats -// take O(1) time and memory to pack. On unpack, if the GrB_Matrix or -// GrB_Vector is already in this particular format, then the unpack takes O(1) -// time and no memory copying is performed. - -// If the input data is untrusted, use the following descriptor setting for -// GxB_Matrix_pack*. The pack will be slower, but secure. GrB_Matrix_import -// uses the slow, secure method, since it has no descriptor input. -// -// GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_CSR: pack a CSR matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; - // CSR: an nrows-by-ncols matrix with nvals entries in CSR format consists - // of 3 arrays, where nvals = Ap [nrows]: - // - // GrB_Index Ap [nrows+1], Aj [nvals] ; Ax [nvals] ; - // - // The column indices of entries in the ith row of the matrix are held - // in Aj [Ap [i] to Ap[i+1]-1], and the corresponding values are held - // in the same positions in Ax. Column indices must be in the range 0 - // to ncols-1. If jumbled is false, the column indices must appear in - // sorted order within each row. No duplicate column indices may - // appear in any row. Ap [0] must equal zero, and Ap [nrows] must - // equal nvals. The Ap array must be of size nrows+1 (or larger), and - // the Aj and Ax arrays must have size at least nvals. If nvals is - // zero, then the Aj and Ax arrays need not be present and can be - // NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_CSC: pack a CSC matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_BinaryOp2nd ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // CSC: an nrows-by-ncols matrix with nvals entries in CSC format consists - // of 3 arrays, where nvals = Ap [ncols]: - // - // GrB_Index Ap [ncols+1], Ai [nvals] ; Ax [nvals] ; - // - // The row indices of entries in the jth column of the matrix are held - // in Ai [Ap [j] to Ap[j+1]-1], and the corresponding values are held - // in the same positions in Ax. Row indices must be in the range 0 to - // nrows-1. If jumbled is false, the row indices must appear in - // sorted order within each column. No duplicate row indices may - // appear in any column. Ap [0] must equal zero, and Ap [ncols] must - // equal nvals. The Ap array must be of size ncols+1 (or larger), and - // the Ai and Ax arrays must have size at least nvals. If nvals is - // zero, then the Ai and Ax arrays need not be present and can be - // NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_HyperCSR: pack a hypersparse CSR matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// vector apply: IndexUnaryOp variants +//------------------------------------------- - // HyperCSR: an nrows-by-ncols matrix with nvals entries and nvec - // rows that may have entries in HyperCSR format consists of 4 arrays, - // where nvals = Ap [nvec]: - // - // GrB_Index Ah [nvec], Ap [nvec+1], Aj [nvals] ; - // Ax [nvals] ; - // - // The Aj and Ax arrays are the same for a matrix in CSR or HyperCSR - // format. Only Ap and Ah differ. - // - // The Ah array is a list of the row indices of rows that appear in - // the matrix. It - // must appear in sorted order, and no duplicates may appear. If i = - // Ah [k] is the kth row, then the column indices of the ith - // row appear in Aj [Ap [k] to Ap [k+1]-1], and the corresponding - // values appear in the same locations in Ax. Column indices must be - // in the range 0 to ncols-1, and must appear in sorted order within - // each row. No duplicate column indices may appear in any row. nvec - // may be zero, to denote an array with no entries. The Ah array must - // be of size at least nvec, Ap must be of size at least nvec+1, and - // Aj and Ax must be at least of size nvals. If nvals is zero, then - // the Aj and Ax arrays need not be present and can be NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_HyperCSC: pack a hypersparse CSC matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A)*(type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc +// Apply a GrB_IndexUnaryOp to the entries in a vector + +GrB_Info GrB_Vector_apply_IndexOp_Scalar // w = accum (w, op(u)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; - // HyperCSC: an nrows-by-ncols matrix with nvals entries and nvec - // columns that may have entries in HyperCSC format consists of 4 arrays, - // where nvals = Ap [nvec]: - // - // - // GrB_Index Ah [nvec], Ap [nvec+1], Ai [nvals] ; - // Ax [nvals] ; - // - // The Ai and Ax arrays are the same for a matrix in CSC or HyperCSC - // format. Only Ap and Ah differ. - // - // The Ah array is a list of the column indices of non-empty columns. - // It must appear in sorted order, and no duplicates may appear. If j - // = Ah [k] is the kth non-empty column, then the row indices of the - // jth column appear in Ai [Ap [k] to Ap [k+1]-1], and the - // corresponding values appear in the same locations in Ax. Row - // indices must be in the range 0 to nrows-1, and must appear in - // sorted order within each column. No duplicate row indices may - // appear in any column. nvec may be zero, to denote an array with no - // entries. The Ah array must be of size at least nvec, Ap must be of - // size at least nvec+1, and Ai and Ax must be at least of size nvals. - // If nvals is zero, then the Ai and Ax arrays need not be present and - // can be NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_BitmapR: pack a bitmap matrix, held by row -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_IndexOp ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // BitmapR: a dense format, but able to represent sparsity structure of A. - // - // int8_t Ab [nrows*ncols] ; - // Ax [nrows*ncols] ; - // - // Ab and Ax are both of size nrows*ncols. Ab [i*ncols+j] = 1 if the - // A(i,j) entry is present with value Ax [i*ncols+j], or 0 if A(i,j) - // is not present. nvals must equal the number of 1's in the Ab - // array. +//------------------------------------------- +// matrix apply: binaryop variants (bind 1st) +//------------------------------------------- -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_BitmapC: pack a bitmap matrix, held by column -//------------------------------------------------------------------------------ +// Apply a binary operator to the entries in a matrix, binding the first input +// to a scalar x, C = accum (C, op (x,A)), or op(x,A'). -GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column +GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) ( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Scalar x, // first input: scalar x + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // BitmapC: a dense format, but able to represent sparsity structure of A. - // - // int8_t Ab [nrows*ncols] ; - // Ax [nrows*ncols] ; - // - // Ab and Ax are both of size nrows*ncols. Ab [i+j*nrows] = 1 if the - // A(i,j) entry is present with value Ax [i+j*nrows], or 0 if A(i,j) - // is not present. nvals must equal the number of 1's in the Ab - // array. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_FullR: pack a full matrix, held by row -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_BinaryOp1st ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + type x, /* first input: scalar x */ \ + const GrB_Matrix A, /* second input: matrix A */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // FullR: an nrows-by-ncols full matrix held in row-major order: - // - // Ax [nrows*ncols] ; - // - // Ax is an array of size nrows*ncols, where A(i,j) is held in - // Ax [i*ncols+j]. All entries in A are present. +//------------------------------------------- +// matrix apply: binaryop variants (bind 2nd) +//------------------------------------------- -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_FullC: pack a full matrix, held by column -//------------------------------------------------------------------------------ +// Apply a binary operator to the entries in a matrix, binding the second input +// to a scalar y, C = accum (C, op (A,y)), or op(A',y). -GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column +GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) ( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // FullC: an nrows-by-ncols full matrix held in column-major order: - // - // Ax [nrows*ncols] ; - // - // Ax is an array of size nrows*ncols, where A(i,j) is held in - // Ax [i+j*nrows]. All entries in A are present. +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_BinaryOp2nd ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ +) ; +GB_DECLARE_14 (GrB_, const void *) -//------------------------------------------------------------------------------ -// GxB_Vector_pack_CSC: pack a vector in CSC format -//------------------------------------------------------------------------------ +//------------------------------------------- +// matrix apply: IndexUnaryOp variants +//------------------------------------------- + +// Apply a GrB_IndexUnaryOp to the entries in a matrix. -GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format +GrB_Info GrB_Matrix_apply_IndexOp_Scalar // C=accum(C,op(A)) ( - GrB_Vector v, // vector to create (type and length unchanged) - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector - bool jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in CSC format, except that no vp array is required. If nvals is - // zero, then the vi and vx arrays need not be present and can be NULL. +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_IndexOp ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ +) ; +GB_DECLARE_14 (GrB_, const void *) //------------------------------------------------------------------------------ -// GxB_Vector_pack_Bitmap: pack a vector in bitmap format +// GrB_apply: polymorphic matrix/vector apply //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector -( - GrB_Vector v, // vector to create (type and length unchanged) - int8_t **vb, // bitmap, vb_size >= n - void **vx, // values, vx_size >= n * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; +// GrB_apply is a polymorphic function for applying a unary operator to a matrix +// or vector and provides access to these functions: - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in BitmapC format. +// GrB_Vector_apply (w,mask,acc,op,u,d) // w = accum (w, op(u)) +// GrB_Matrix_apply (C,Mask,acc,op,A,d) // C = accum (C, op(A)) -//------------------------------------------------------------------------------ -// GxB_Vector_pack_Full: pack a vector in full format -//------------------------------------------------------------------------------ +// GrB_Vector_apply (w,m,acc,unop ,u,d) +// GrB_Vector_apply_BinaryOp1st_TYPE (w,m,acc,binop,x,u,d) +// GrB_Vector_apply_BinaryOp2nd_TYPE (w,m,acc,binop,u,y,d) +// GrB_Vector_apply_IndexOp_TYPE (w,m,acc,idxop,u,y,d) -GrB_Info GxB_Vector_pack_Full // pack a full vector -( - GrB_Vector v, // vector to create (type and length unchanged) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - const GrB_Descriptor desc -) ; +// GrB_Matrix_apply (C,M,acc,unop ,A,d) +// GrB_Matrix_apply_BinaryOp1st_TYPE (C,M,acc,binop,x,A,d) +// GrB_Matrix_apply_BinaryOp2nd_TYPE (C,M,acc,binop,A,y,d) +// GrB_Matrix_apply_IndexOp_TYPE (C,M,acc,idxop,A,y,d) - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in FullC format. +#if GxB_STDC_VERSION >= 201112L +#define GB_BIND(kind,x,y,...) \ + _Generic ((x), \ + GrB_Scalar: GB_CONCAT (GrB,_,kind,_apply_BinaryOp1st_Scalar), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_BinaryOp1st,,)), \ + default: \ + _Generic ((y), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_BinaryOp2nd,,)), \ + default: GB_CONCAT (GrB,_,kind,_apply_BinaryOp2nd_Scalar))) +#define GB_IDXOP(kind,A,y,...) \ + _Generic ((y), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_IndexOp,,)), \ + default: GB_CONCAT (GrB, _, kind, _apply_IndexOp_Scalar)) +#define GrB_apply(C,Mask,accum,op,...) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_UnaryOp : GrB_Vector_apply, \ + GrB_BinaryOp : GB_BIND (Vector, __VA_ARGS__), \ + GrB_IndexUnaryOp : GB_IDXOP (Vector, __VA_ARGS__)), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_UnaryOp : GrB_Matrix_apply, \ + GrB_BinaryOp : GB_BIND (Matrix, __VA_ARGS__), \ + GrB_IndexUnaryOp : GB_IDXOP (Matrix, __VA_ARGS__))) \ + (C, Mask, accum, op, __VA_ARGS__) +#endif -//------------------------------------------------------------------------------ -// GxB unpack -//------------------------------------------------------------------------------ +//============================================================================== +// GrB_select: matrix and vector selection using an IndexUnaryOp +//============================================================================== -// The GxB_*_unpack functions are symmetric with the GxB_*_pack functions. The -// unpack functions force completion of any pending operations, prior to the -// unpack, except if the only pending operation is to unjumble the matrix. -// -// If there are no entries in the matrix or vector, then the index arrays (Ai, -// Aj, or vi) and value arrays (Ax or vx) are returned as NULL. This is not an -// error condition. -// -// A GrB_Matrix may be unpacked in any one of four different formats. -// -// If jumbled is NULL on input, this indicates to GxB_*unpack* that the -// unpacked matrix cannot be returned in a jumbled format. In this case, if -// the matrix is jumbled, it is sorted before unpacking it to the caller. -// -// If iso is NULL on input, this indicates to the unpack methods that the -// unpacked matrix cannot be returned in a iso format, with an Ax array with -// just one entry. In this case, if the matrix is iso, it is expanded before -// unpacking it to the caller. -// -// For the unpack*Full* methods, all entries in the matrix or must be present. -// That is, GrB_*_nvals must report nvals equal to nrows*ncols or a matrix. If -// this condition does not hold, the matrix/vector is not unpack, and -// GrB_INVALID_VALUE is returned. -// -// If the unpack is not successful, the unpack functions do not modify matrix -// or vector and the user arrays are returned as NULL. - -GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// vector select using an IndexUnaryOp +//------------------------------------------- -GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix +GrB_Info GrB_Vector_select_Scalar // w = accum (w, op(u)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_select ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) -GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// matrix select using an IndexUnaryOp +//------------------------------------------- -GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row +GrB_Info GrB_Matrix_select_Scalar // C=accum(C,op(A)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_select ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) + +// GrB_select is a polymorphic method that applies an IndexUnaryOp to +// a matrix or vector, using any type of the scalar y. +// +// GrB_Vector_select_TYPE (w,m,acc,idxop,u,y,d) +// GrB_Matrix_select_TYPE (C,M,acc,idxop,A,y,d) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_select(C,Mask,accum,op,x,y,d) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((y), \ + GB_CASES (GrB, Vector_select), \ + default: GrB_Vector_select_Scalar), \ + GrB_Matrix : \ + _Generic ((y), \ + GB_CASES (GrB, Matrix_select), \ + default: GrB_Matrix_select_Scalar)) \ + (C, Mask, accum, op, x, y, d) +#endif + +//============================================================================== +// GrB_reduce: matrix and vector reduction +//============================================================================== + +// Reduce the entries in a matrix to a vector, a column vector t such that +// t(i) = sum (A (i,:)), and where "sum" is a commutative and associative +// monoid with an identity value. A can be transposed, which reduces down the +// columns instead of the rows. -GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row +GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // reduce operator for t=reduce(A) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column +//------------------------------------------------------------------------------ +// reduce a vector to a scalar +//------------------------------------------------------------------------------ + +// Reduce entries in a vector to a scalar, c = accum (c, reduce_to_scalar(u)) + +GrB_Info GrB_Vector_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(u)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Vector u, // vector to reduce const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - GrB_Index **vi, // indices - void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector - bool *jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_reduce ## suffix \ +( \ + type *c, /* result scalar */ \ + const GrB_BinaryOp accum, /* optional accum for c=accum(c,t) */ \ + const GrB_Monoid monoid, /* monoid to do the reduction */ \ + const GrB_Vector u, /* vector to reduce */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void) + +//------------------------------------------------------------------------------ +// reduce a matrix to a scalar +//------------------------------------------------------------------------------ + +// Reduce entries in a matrix to a scalar, c = accum (c, reduce_to_scalar(A)) -GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector +GrB_Info GrB_Matrix_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(A)) ( - GrB_Vector v, // vector to unpack (type and length unchanged) - int8_t **vb, // bitmap - void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Matrix A, // matrix to reduce const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_unpack_Full // unpack a full vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - void **vx, // values - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_reduce ## suffix \ +( \ + type *c, /* result scalar */ \ + const GrB_BinaryOp accum, /* optional accum for c=accum(c,t) */ \ + const GrB_Monoid monoid, /* monoid to do the reduction */ \ + const GrB_Matrix A, /* matrix to reduce */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void) //------------------------------------------------------------------------------ -// GxB hyper_hash pack/unpack +// GrB_reduce: polymorphic matrix/vector reduction to a vector or scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v7.3.0 adds a new internal component to the -// hypersparse matrix format: the hyper_hash GrB_Matrix A->Y. The matrix -// provides a fast lookup into the hyperlist Ah. - -// GxB_unpack_HyperHash unpacks the hyper_hash from the hypersparse matrix A. -// Normally, this method is called immediately before calling one of the four -// methods GxB_Matrix_unpack_Hyper(CSR/CSC). For example, to unpack -// then pack a hypersparse CSC matrix: - -// GrB_Matrix Y = NULL ; -// -// // to unpack all of A: -// GxB_unpack_HyperHash (A, &Y, desc) ; // first unpack A->Y into Y -// GxB_Matrix_unpack_HyperCSC (A, // then unpack the rest of A -// &Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, -// &iso, &nvec, &jumbled, descriptor) ; +// GrB_reduce is a polymorphic function that provides access to all GrB_*reduce* +// functions: // -// // use the unpacked contents of A here, but do not change Ah or nvec. +// reduce matrix to vector: +// GrB_Matrix_reduce_Monoid (w,mask,acc,mo,A,d) +// GrB_Matrix_reduce_BinaryOp (w,mask,acc,op,A,d); do not use this method // -// // to pack the data back into A: -// GxB_Matrix_pack_HyperCSC (A, etc) ; // pack most of A, except A->Y -// GxB_pack_HyperHash (A, &Y, desc) ; // then pack A->Y - -// The same process is used with GxB_Matrix_unpack_HyperCSR. +// reduce matrix to scalar: +// GrB_Vector_reduce_[SCALAR] (c,acc,monoid,u,d) +// GrB_Matrix_reduce_[SCALAR] (c,acc,monoid,A,d) +// GrB_Vector_reduce_Monoid_Scalar (s,acc,monoid,u,d) +// GrB_Matrix_reduce_Monoid_Scalar (s,acc,monoid,A,d) +// GrB_Vector_reduce_BinaryOp_Scalar (s,acc,op,u,d); do not use this method +// GrB_Matrix_reduce_BinaryOp_Scalar (s,acc,op,A,d); do not use this method -// If A is not hypersparse on input to GxB_unpack_HyperHash, or if A is -// hypersparse but does yet not have a hyper_hash, then Y is returned as NULL. -// This is not an error condition, and GrB_SUCCESS is returned. The hyper_hash -// of a hypersparse matrix A is a matrix that provides quick access to the -// inverse of Ah. It is not always needed and may not be present. It is left -// as pending work to be computed when needed. GrB_Matrix_wait (A) will ensure -// that the hyper_hash is constructed, if A is hypersparse. +#if GxB_STDC_VERSION >= 201112L +#define GB_REDUCE_TO_SCALAR(kind,c,op) \ + _Generic ((c), \ + GB_PCASES (GrB, GB_CONCAT (kind, _reduce,,)), \ + default: \ + _Generic ((op), \ + GrB_BinaryOp : GB_CONCAT (GrB,_,kind,_reduce_BinaryOp_Scalar),\ + default: GB_CONCAT (GrB,_,kind,_reduce_Monoid_Scalar))) +#define GrB_reduce(arg1,arg2,arg3,arg4,...) \ + _Generic ((arg4), \ + GrB_Vector : GB_REDUCE_TO_SCALAR (Vector, arg1, arg3), \ + GrB_Matrix : GB_REDUCE_TO_SCALAR (Matrix, arg1, arg3), \ + GrB_Monoid : GrB_Matrix_reduce_Monoid, \ + GrB_BinaryOp : GrB_Matrix_reduce_BinaryOp) \ + (arg1, arg2, arg3, arg4, __VA_ARGS__) +#endif -// If Y is moved from A and returned as non-NULL to the caller, then it is -// the responsibility of the user application to free it, or to re-pack it back -// into A via GxB_pack_HyperHash, as shown in the example above. +// The following methods are not recommended; use a GrB_Monoid instead. The +// GrB_BinaryOp op must correspond to a known built-in monoid. +GrB_Info GrB_Matrix_reduce_BinaryOp (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, + const GrB_Descriptor) ; +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar (GrB_Scalar, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Vector, const GrB_Descriptor) ; +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar (GrB_Scalar, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor) ; -// If this method is called to remove the hyper_hash Y from the hypersparse -// matrix A, and then GrB_Matrix_wait (A) is called, a new hyper_hash matrix is -// constructed for A. +//============================================================================== +// GrB_transpose: matrix transpose +//============================================================================== -GrB_Info GxB_unpack_HyperHash // move A->Y into Y +GrB_Info GrB_transpose // C = accum (C, A') ( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to move from A - const GrB_Descriptor desc // unused + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, Mask, and A ) ; -// GxB_pack_HyperHash assigns the input Y matrix as the A->Y hyper_hash of the -// hypersparse matrix A. Normally, this method is called immediately after -// calling one of the four methods GxB_Matrix_pack_Hyper(CSR/CSC). - -// If A is not hypersparse on input to GxB_pack_HyperHash, or if A already has -// a hyper_hash matrix, or if Y is NULL on input, then nothing happens and Y is -// unchanged. This is not an error condition and this method returns -// GrB_SUCCESS. In this case, if Y is non-NULL after calling this method, it -// owned by the user application and freeing it is the responsibility of the -// user application. - -// Basic checks are perfomed on Y: Y must have the right dimensions: if A is -// HyperCSR and m-by-n with nvec vectors present in Ah, then Y must be n-by-v -// where v is a power of 2; if A is HyperCSR and m-by-n, then Y must be m-by-v. -// nvals(Y) must equal nvec. Y must be sparse, held by column, and have type -// int64. It cannot have any pending work. It cannot have a hyper_hash -// of its own. If any of these conditions hold, GrB_INVALID is returned and -// A and Y are unchanged. - -// If Y is moved into A as its hyper_hash, then the caller's Y is set to NULL -// to indicate that it has been moved into A. It is no longer owned by the -// caller, but is instead an opaque component of the A matrix. It will be -// freed by SuiteSparse:GraphBLAS if A is modified or freed. +//============================================================================== +// GrB_kronecker: Kronecker product +//============================================================================== -// Results are undefined if the input Y was not created by GxB_unpack_HyperHash -// (see the example above) or if the Ah contents or nvec of the matrix A are -// modified after they were unpacked by -// GxB_Matrix_unpack_Hyper(CSR/CSC). +GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B +) ; -GrB_Info GxB_pack_HyperHash // move Y into A->Y +GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) ( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to pack into A - const GrB_Descriptor desc // unused + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B ) ; -//============================================================================== -// GrB_import/GrB_export -//============================================================================== +GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B +) ; -// The GrB_Matrix_import method copies from user-provided arrays into an -// opaque GrB_Matrix and GrB_Matrix_export copies data out, from an opaque -// GrB_Matrix into user-provided arrays. Unlike the GxB pack/unpack methods, -// memory is not handed off between the user application and GraphBLAS. +#if GxB_STDC_VERSION >= 201112L +#define GrB_kronecker(C,Mask,accum,op,A,B,desc) \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_kronecker_Semiring, \ + GrB_Monoid : GrB_Matrix_kronecker_Monoid, \ + GrB_BinaryOp : GrB_Matrix_kronecker_BinaryOp) \ + (C, Mask, accum, op, A, B, desc) +#endif -// These methods are much slower than the GxB pack/unpack methods, since they -// require a copy of the data to be made. GrB_Matrix_import also must assume -// its input data cannot be trusted, and so it does extensive checks. The GxB -// pack takes O(1) time in all cases (unless it is told the input data is -// untrusted, via the descriptor). GxB unpack takes O(1) time unless the -// matrix is exported in a different format than it currently has. +//============================================================================== +// GrB_*_resize: change the size of a matrix or vector +//============================================================================== -// No typecasting of the values is done on import or export. +// If the dimensions decrease, entries that fall outside the resized matrix or +// vector are deleted. -GrB_Info GrB_Matrix_import_BOOL // import a GrB_BOOL matrix +GrB_Info GrB_Matrix_resize // change the size of a matrix ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_BOOL) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const bool *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Matrix C, // matrix to modify + GrB_Index nrows_new, // new number of rows in matrix + GrB_Index ncols_new // new number of columns in matrix ) ; -GrB_Info GrB_Matrix_import_INT8 // import a GrB_INT8 matrix +GrB_Info GrB_Vector_resize // change the size of a vector ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_iNT8) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int8_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Vector w, // vector to modify + GrB_Index nrows_new // new number of rows in vector ) ; -GrB_Info GrB_Matrix_import_INT16 // import a GrB_INT16 matrix +// GxB_resize is a polymorphic function for resizing a matrix or vector: +// GrB_Vector_resize (u,nrows_new) +// GrB_Matrix_resize (A,nrows_new,ncols_new) + +#if GxB_STDC_VERSION >= 201112L +#define GxB_resize(C,...) \ + _Generic ((C), \ + GrB_Vector : GrB_Vector_resize, \ + GrB_Matrix : GrB_Matrix_resize) \ + (C, __VA_ARGS__) +#endif + +//============================================================================== +// GxB_fprint and GxB_print: print the contents of a GraphBLAS object +//============================================================================== + +// GxB_fprint (object, int pr, FILE *f) prints the contents of any of the 9 +// GraphBLAS objects to the file f, and also does an extensive test on the +// object to determine if it is valid. It returns one of the following error +// conditions: +// +// GrB_SUCCESS object is valid +// GrB_UNINITIALIZED_OBJECT object is not initialized +// GrB_INVALID_OBJECT object is not valid +// GrB_NULL_POINTER object is a NULL pointer +// GrB_INVALID_VALUE fprintf returned an I/O error; see the ANSI C +// errno or GrB_error( )for details. +// +// GxB_fprint does not modify the status of any object. If a matrix or vector +// has not been completed, the pending computations are guaranteed to *not* be +// performed by GxB_fprint. The reason is simple. It is possible for a bug in +// the user application (such as accessing memory outside the bounds of an +// array) to mangle the internal content of a GraphBLAS object, and GxB_fprint +// can be a helpful tool to track down this bug. If GxB_fprint attempted to +// complete any computations prior to printing or checking the contents of the +// matrix or vector, then further errors could occur, including a segfault. +// +// The type-specific functions include an additional argument, the name string. +// The name is printed at the beginning of the display (assuming pr is not +// GxB_SILENT) so that the object can be more easily identified in the output. +// For the type-polymorphic methods GxB_fprint and GxB_print, the name string is +// the variable name of the object itself. +// +// If f is NULL, stdout is used; this is not an error condition. If pr is +// outside the bounds 0 to 3, negative values are treated as GxB_SILENT, and +// values > 3 are treated as GxB_COMPLETE. If name is NULL, it is treated as +// the empty string. +// +// GxB_print (object, int pr) is the same as GxB_fprint, except that it prints +// the contents with printf instead of fprintf to a file f. +// +// The exact content and format of what is printed is implementation-dependent, +// and will change from version to version of SuiteSparse:GraphBLAS. Do not +// attempt to rely on the exact content or format by trying to parse the +// resulting output via another program. The intent of these functions is to +// produce a report of the object for visual inspection. + +GrB_Info GxB_Type_fprint // print and check a GrB_Type ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT16) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int16_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Type type, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_INT32 // import a GrB_INT32 matrix +GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_UnaryOp unaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_INT64 // import a GrB_INT64 matrix +GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_BinaryOp binaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT8 // import a GrB_UINT8 matrix +GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT8) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint8_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_IndexUnaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT16 // import a GrB_UINT16 matrix +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT16) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint16_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT32 // import a GrB_UINT32 matrix +GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Monoid monoid, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT64 // import a GrB_UINT64 matrix +GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Semiring semiring, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_FP32 // import a GrB_FP32 matrix +GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_FP32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const float *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Descriptor descriptor, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_FP64 // import a GrB_FP64 matrix +GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_FP64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const double *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Matrix A, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GxB_Matrix_import_FC32 // import a GxB_FC32 matrix +GrB_Info GxB_Vector_fprint // print and check a GrB_Vector ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GxB_FC32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const GxB_FC32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Vector v, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GxB_Matrix_import_FC64 // import a GxB_FC64 matrix +GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GxB_FC64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const GxB_FC64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Scalar s, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UDT // import a matrix with a user-defined type +GrB_Info GxB_Context_fprint // print and check a GxB_Context ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const void *Ax, // values (must match the type parameter) - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GxB_Context Context, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_import(A,type,nrows,ncols,Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt)\ - _Generic \ - ( \ - (Ax), \ - GB_PCASES (GrB, Matrix_import) \ - ) \ - (A, type, nrows, ncols, Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt) +#define GxB_fprint(object,pr,f) \ + _Generic ((object), \ + GrB_Type : GxB_Type_fprint , \ + GrB_UnaryOp : GxB_UnaryOp_fprint , \ + GrB_BinaryOp : GxB_BinaryOp_fprint , \ + GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ + GrB_Monoid : GxB_Monoid_fprint , \ + GrB_Semiring : GxB_Semiring_fprint , \ + GrB_Scalar : GxB_Scalar_fprint , \ + GrB_Vector : GxB_Vector_fprint , \ + GrB_Matrix : GxB_Matrix_fprint , \ + GrB_Descriptor : GxB_Descriptor_fprint , \ + GxB_Context : GxB_Context_fprint) \ + (object, GB_STR(object), pr, f) +#define GxB_print(object,pr) GxB_fprint(object,pr,NULL) #endif -// For GrB_Matrix_export_T: on input, Ap_len, Ai_len, and Ax_len are -// the size of the 3 arrays Ap, Ai, and Ax, in terms of the # of entries. -// On output, these 3 values are modified to be the # of entries copied -// into those 3 arrays. +//============================================================================== +// GxB_Container methods +//============================================================================== -GrB_Info GrB_Matrix_export_BOOL // export a GrB_BOOL matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - bool *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_BOOL) -) ; +struct GxB_Container_struct +{ + // 16 words of uint64_t / int64_t: + uint64_t nrows ; + uint64_t ncols ; + int64_t nrows_nonempty ; + int64_t ncols_nonempty ; + uint64_t nvals ; + uint64_t u64_future [11] ; // for future expansion + + // 16 words of uint32_t / int32_t: + int32_t format ; // GxB_HYPERSPARSE, GxB_SPARSE, GxB_BITMAP, + // or GxB_FULL + int32_t orientation ; // GrB_ROWMAJOR or GrB_COLMAJOR + uint32_t u32_future [14] ; // for future expansion + + // 16 GrB_Vector objects: + GrB_Vector p ; + GrB_Vector h ; + GrB_Vector b ; + GrB_Vector i ; + GrB_Vector x ; + GrB_Vector vector_future [11] ; // for future expansion + + // 16 GrB_Matrix objects: + GrB_Matrix Y ; + GrB_Matrix matrix_future [15] ; // for future expansion + + // 32 words of bool + bool iso ; + bool jumbled ; + bool bool_future [30] ; // for future expansion + + // 16 (void *) pointers + void *void_future [16] ; // for future expansion +} ; -GrB_Info GrB_Matrix_export_INT8 // export a GrB_INT8 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int8_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT8) -) ; +typedef struct GxB_Container_struct *GxB_Container ; -GrB_Info GrB_Matrix_export_INT16 // export a GrB_INT16 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int16_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT16) -) ; +GrB_Info GxB_Container_new (GxB_Container *Container) ; -GrB_Info GrB_Matrix_export_INT32 // export a GrB_INT32 matrix +GrB_Info GxB_load_Matrix_from_Container // GrB_Matrix <- GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT32) + GrB_Matrix A, // matrix to load from the Container. On input, + // A is a matrix of any size or type; on output + // any prior size, type, or contents is freed + // and overwritten with the Container. + GxB_Container Container, // Container with contents to load into A + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_INT64 // export a GrB_INT64 matrix +GrB_Info GxB_load_Vector_from_Container // GrB_Vector <- GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT64) + GrB_Vector V, // GrB_Vector to load from the Container + GxB_Container Container, // Container with contents to load into V + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT8 // export a GrB_UINT8 matrix +GrB_Info GxB_unload_Matrix_into_Container // GrB_Matrix -> GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint8_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT8) + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT16 // export a GrB_UINT16 matrix +GrB_Info GxB_unload_Vector_into_Container // GrB_Vector -> GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint16_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT16) + GrB_Vector V, // vector to unload into the Container + GxB_Container Container, // Container to hold the contents of V + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT32 // export a GrB_UINT32 matrix +GrB_Info GxB_Vector_load ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT32) + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + int handling, // GrB_DEFAULT (0): transfer ownership to GraphBLAS + // GxB_IS_READONLY: X treated as readonly; + // ownership kept by the user application + const GrB_Descriptor desc // currently unused; for future expansion ) ; -GrB_Info GrB_Matrix_export_UINT64 // export a GrB_UINT64 matrix +GrB_Info GxB_Vector_unload ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT64) + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + int *handling, // see GxB_Vector_load + const GrB_Descriptor desc // currently unused; for future expansion ) ; -GrB_Info GrB_Matrix_export_FP32 // export a GrB_FP32 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - float *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FP32) -) ; +//============================================================================== +// GrB_import/GrB_export +//============================================================================== -GrB_Info GrB_Matrix_export_FP64 // export a GrB_FP64 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - double *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FP64) -) ; +// The GrB_Matrix_import method copies from user-provided arrays into an +// opaque GrB_Matrix and GrB_Matrix_export copies data out, from an opaque +// GrB_Matrix into user-provided arrays. Unlike the GxB pack/unpack methods, +// memory is not handed off between the user application and GraphBLAS. -GrB_Info GxB_Matrix_export_FC32 // export a GrB_FC32 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - GxB_FC32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FC32) -) ; +// These methods are much slower than the GxB pack/unpack methods, since they +// require a copy of the data to be made. GrB_Matrix_import also must assume +// its input data cannot be trusted, and so it does extensive checks. The GxB +// pack takes O(1) time in all cases (unless it is told the input data is +// untrusted, via the descriptor). GxB unpack takes O(1) time unless the +// matrix is exported in a different format than it currently has. -GrB_Info GxB_Matrix_export_FC64 // export a GrB_FC64 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - GxB_FC64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FC64) -) ; +// No typecasting of the values is done on import or export. The GrB_Type type +// parameter must be the equivalent of the ctype of the *Ax parameter. -GrB_Info GrB_Matrix_export_UDT // export a matrix with a user-defined type -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - void *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,ctype) \ +GrB_Info prefix ## Matrix_import ## suffix \ +( \ + GrB_Matrix *A, /* handle of matrix to create */ \ + GrB_Type type, /* type of matrix to create */ \ + GrB_Index nrows, /* number of rows of the matrix */ \ + GrB_Index ncols, /* number of columns of the matrix */ \ + const GrB_Index *Ap, /* pointers for CSR, CSC, col indices for COO */\ + const GrB_Index *Ai, /* row indices for CSR, CSC */ \ + const ctype *Ax, /* values */ \ + GrB_Index Ap_len, /* number of entries in Ap (not # of bytes) */ \ + GrB_Index Ai_len, /* number of entries in Ai (not # of bytes) */ \ + GrB_Index Ax_len, /* number of entries in Ax (not # of bytes) */ \ + int format /* import format (GrB_Format) */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_import(A,type,nrows,ncols,Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt)\ + _Generic ((Ax), GB_PCASES (GrB, Matrix_import)) \ + (A, type, nrows, ncols, Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt) +#endif + +// For GrB_Matrix_export_T: on input, Ap_len, Ai_len, and Ax_len are +// the size of the 3 arrays Ap, Ai, and Ax, in terms of the # of entries. +// On output, these 3 values are modified to be the # of entries copied +// into those 3 arrays. + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_export ## suffix \ +( \ + GrB_Index *Ap, /* pointers for CSR, CSC, col indices for COO */\ + GrB_Index *Ai, /* col indices for CSR/COO, row indices for CSC*/\ + type *Ax, /* values (must match the type of A) */ \ + GrB_Index *Ap_len, /* number of entries in Ap (not # of bytes) */ \ + GrB_Index *Ai_len, /* number of entries in Ai (not # of bytes) */ \ + GrB_Index *Ax_len, /* number of entries in Ax (not # of bytes) */ \ + int format, /* export format (GrB_Format) */ \ + GrB_Matrix A /* matrix to export */ \ ) ; +GB_DECLARE_14 (GrB_, void) #if GxB_STDC_VERSION >= 201112L #define GrB_Matrix_export(Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt,A) \ - _Generic \ - ( \ - (Ax), \ - GB_PCASES (GrB, Matrix_export) \ - ) \ + _Generic ((Ax), GB_PCASES (GrB, Matrix_export)) \ (Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt, A) #endif @@ -10164,13 +6031,13 @@ GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export GrB_Index *Ap_len, // # of entries required for Ap (not # of bytes) GrB_Index *Ai_len, // # of entries required for Ai (not # of bytes) GrB_Index *Ax_len, // # of entries required for Ax (not # of bytes) - GrB_Format format, // export format + int format, // export format GrB_Matrix A // matrix to export ) ; GrB_Info GrB_Matrix_exportHint // suggest the best export format ( - GrB_Format *format, // export format + int *format, // export format GrB_Matrix A // matrix to export ) ; @@ -10207,7 +6074,7 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format // below do a few basic checks so that no out-of-bounds access occurs during // deserialization, but the output matrix itself may still be corrupted. If // the data is untrusted, use this to check the matrix: -// GxB_Matrix_fprint (A, "A deserialized", GrB_SILENT, NULL) +// GxB_Matrix_fprint (A, "A deserialized", GxB_SILENT, NULL) // Example usage: @@ -10413,14 +6280,13 @@ GrB_Info GxB_Matrix_sort const GrB_Descriptor desc ) ; -#define GxB_sort(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : GxB_Vector_sort , \ - GrB_Matrix : GxB_Matrix_sort \ - ) \ - (arg1, __VA_ARGS__) +#if GxB_STDC_VERSION >= 201112L +#define GxB_sort(C,P,op,A,desc) \ + _Generic ((C), \ + GrB_Vector : GxB_Vector_sort, \ + GrB_Matrix : GxB_Matrix_sort) \ + (C, P, op, A, desc) +#endif //============================================================================== // GxB_Matrix_reshape and GxB_Matrix_reshapeDup: reshape a matrix @@ -10555,7 +6421,6 @@ parallel iteration using 4 threads (work may be imbalanced however): then compute the cumulative sum (ideally in parallel). Next, partition the cumulative sum into one part per thread via binary search, and divide the rows into parts accordingly. - */ //------------------------------------------------------------------------------ @@ -10566,7 +6431,7 @@ parallel iteration using 4 threads (work may be imbalanced however): // application. Only the functions and macros provided here may access // "iterator->" contents. The iterator is defined here only so that macros // can be used to speed up the use of the iterator methods. User applications -// must not use "iterator->" directly. +// must not use "iterator->" directly; results are undefined otherwise. struct GB_Iterator_opaque { @@ -10584,25 +6449,26 @@ struct GB_Iterator_opaque int64_t avlen ; // length of each vector in the matrix int64_t avdim ; // number of vectors in the matrix dimension int64_t anvec ; // # of vectors present in the matrix - const int64_t *GB_restrict Ap ; // pointers for sparse and hypersparse - const int64_t *GB_restrict Ah ; // vector names for hypersparse - const int8_t *GB_restrict Ab ; // bitmap - const int64_t *GB_restrict Ai ; // indices for sparse and hypersparse - const void *GB_restrict Ax ; // values for all 4 data structures + + // Ap, Ah, Ai: can be 32 bit or 64-bit integers + const uint32_t *GB_restrict Ap32 ; // offsets for sparse/hypersparse + const uint64_t *GB_restrict Ap64 ; + const uint32_t *GB_restrict Ah32 ; // vector names for hypersparse + const uint64_t *GB_restrict Ah64 ; + const uint32_t *GB_restrict Ai32 ; // indices for sparse/hypersparse + const uint64_t *GB_restrict Ai64 ; + const int8_t *GB_restrict Ab ; // bitmap + const void *GB_restrict Ax ; // values for all 4 data structures + size_t type_size ; // size of the type of A int A_sparsity ; // sparse, hyper, bitmap, or full bool iso ; // true if A is iso-valued, false otherwise bool by_col ; // true if A is held by column, false if by row } ; -typedef struct GB_Iterator_opaque *GxB_Iterator ; - // GxB_Iterator_new: create a new iterator, not attached to any matrix/vector GrB_Info GxB_Iterator_new (GxB_Iterator *iterator) ; -// GxB_Iterator_free: free an iterator -GrB_Info GxB_Iterator_free (GxB_Iterator *iterator) ; - //============================================================================== // GB_Iterator_*: implements user-callable GxB_*Iterator_* methods //============================================================================== @@ -10618,7 +6484,7 @@ GrB_Info GB_Iterator_attach ( GxB_Iterator iterator, // iterator to attach to the matrix A GrB_Matrix A, // matrix to attach - GxB_Format_Value format, // by row, by col, or by entry (GxB_NO_FORMAT) + int format, // by row, col, or entry (GxB_Format_Value) GrB_Descriptor desc ) ; @@ -10661,8 +6527,12 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; (iterator->A_sparsity <= GxB_SPARSE) ? \ ( \ /* matrix is sparse or hypersparse */ \ - iterator->pstart = iterator->Ap [iterator->k], \ - iterator->pend = iterator->Ap [iterator->k+1], \ + iterator->pstart = ((iterator->Ap32 != NULL) ? \ + iterator->Ap32 [iterator->k] : \ + iterator->Ap64 [iterator->k]), \ + iterator->pend = ((iterator->Ap32 != NULL) ? \ + iterator->Ap32 [iterator->k+1] : \ + iterator->Ap64 [iterator->k+1]), \ iterator->p = iterator->pstart, \ ((iterator->p >= iterator->pend) ? GrB_NO_VALUE : GrB_SUCCESS) \ ) \ @@ -10711,8 +6581,6 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; ) \ ) \ ) - - //------------------------------------------------------------------------------ // GB_Iterator_rc_getj: get index of current vector for row/col iterator //------------------------------------------------------------------------------ @@ -10729,7 +6597,9 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; (iterator->A_sparsity == GxB_HYPERSPARSE) ? \ ( \ /* return the name of kth vector: j = Ah [k] if it appears */ \ - iterator->Ah [iterator->k] \ + ((iterator->Ah32 != NULL) ? \ + iterator->Ah32 [iterator->k] : \ + iterator->Ah64 [iterator->k]) \ ) \ : \ ( \ @@ -10745,14 +6615,9 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; #define GB_Iterator_rc_geti(iterator) \ ( \ - (iterator->Ai != NULL) ? \ - ( \ - iterator->Ai [iterator->p] \ - ) \ - : \ - ( \ - (iterator->p - iterator->pstart) \ - ) \ + (iterator->Ai32 != NULL) ? iterator->Ai32 [iterator->p] : \ + ((iterator->Ai64 != NULL) ? iterator->Ai64 [iterator->p] : \ + (iterator->p - iterator->pstart)) \ ) //============================================================================== @@ -11262,8 +7127,7 @@ GrB_Index GxB_Vector_Iterator_getpmax (GxB_Iterator iterator) ; // Returns GrB_SUCCESS if the iterator is at an entry that exists in the // vector, or GxB_EXHAUSTED if the iterator is exhausted. -GrB_Info GB_Vector_Iterator_bitmap_seek (GxB_Iterator iterator, - GrB_Index unused) ; // unused parameter to be removed in v8.x +GrB_Info GB_Vector_Iterator_bitmap_seek (GxB_Iterator iterator) ; GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, GrB_Index p) ; @@ -11281,7 +7145,7 @@ GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, GrB_Index p) ; iterator->p = q, \ (iterator->A_sparsity == GxB_BITMAP) ? \ ( \ - GB_Vector_Iterator_bitmap_seek (iterator, 0) \ + GB_Vector_Iterator_bitmap_seek (iterator) \ ) \ : \ ( \ @@ -11324,7 +7188,7 @@ GrB_Info GxB_Vector_Iterator_next (GxB_Iterator iterator) ; (iterator->A_sparsity == GxB_BITMAP) ? \ ( \ /* bitmap: seek to the next entry present in the bitmap */ \ - GB_Vector_Iterator_bitmap_seek (iterator, 0) \ + GB_Vector_Iterator_bitmap_seek (iterator) \ ) \ : \ ( \ @@ -11370,7 +7234,8 @@ GrB_Index GxB_Vector_Iterator_getIndex (GxB_Iterator iterator) ; #define GxB_Vector_Iterator_getIndex(iterator) \ ( \ - ((iterator->Ai != NULL) ? iterator->Ai [iterator->p] : iterator->p) \ + (iterator->Ai32 != NULL) ? iterator->Ai32 [iterator->p] : \ + ((iterator->Ai64 != NULL) ? iterator->Ai64 [iterator->p] : iterator->p) \ ) //============================================================================== @@ -11413,8 +7278,7 @@ float GxB_Iterator_get_FP32 (GxB_Iterator iterator) ; double GxB_Iterator_get_FP64 (GxB_Iterator iterator) ; GxB_FC32_t GxB_Iterator_get_FC32 (GxB_Iterator iterator) ; GxB_FC64_t GxB_Iterator_get_FC64 (GxB_Iterator iterator) ; -void GxB_Iterator_get_UDT (GxB_Iterator iterator, - void *value) ; +void GxB_Iterator_get_UDT (GxB_Iterator iterator, void *value) ; #define GB_Iterator_get(iterator, type) \ ( \ @@ -11442,6 +7306,50 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, (iterator)->type_size) \ ) +//============================================================================== +// GrB_free: free any GraphBLAS object +//============================================================================== + +// GrB_free (&object) frees any of the 14 allocatable GraphBLAS objects. +// The GrB_Global object cannot be freed. + +#undef GB_DECLARE +#define GB_DECLARE(Object) GrB_Info Object ## _free (Object *object) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) +GB_DECLARE (GxB_Container ) +GB_DECLARE (GxB_Iterator ) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_free(object) \ + _Generic ((object), \ + GrB_Type *: GrB_Type_free , \ + GrB_UnaryOp *: GrB_UnaryOp_free , \ + GrB_BinaryOp *: GrB_BinaryOp_free , \ + GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ + GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ + GrB_Monoid *: GrB_Monoid_free , \ + GrB_Semiring *: GrB_Semiring_free , \ + GrB_Scalar *: GrB_Scalar_free , \ + GrB_Vector *: GrB_Vector_free , \ + GrB_Matrix *: GrB_Matrix_free , \ + GrB_Descriptor *: GrB_Descriptor_free , \ + GxB_Context *: GxB_Context_free , \ + GxB_Container *: GxB_Container_free , \ + GxB_Iterator *: GxB_Iterator_free) \ + (object) +#endif + //============================================================================== //=== Historical methods ======================================================= //============================================================================== @@ -11457,31 +7365,34 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, // the usage of these historical methods, and upgrade to the newer methods // present in this version of GraphBLAS. +// A user application can request that no historical methods should be +// available, by compiling with -DNHISTORICAL. + +#ifndef NHISTORICAL + +// GxB_*_iso: use GrB_get instead +GrB_Info GxB_Matrix_iso (bool *, const GrB_Matrix) ; +GrB_Info GxB_Vector_iso (bool *, const GrB_Vector) ; + +typedef int GrB_Field ; // STRONGLY DEPRECATED: will be removed in v11.0.0, + // to allow the creation of a GraphBLAS object that represents a + // mathematical field: https://en.wikipedia.org/wiki/Field_(mathematics) + // GrB_getVersion: use GrB_get instead GrB_Info GrB_getVersion (unsigned int *, unsigned int *) ; // GxB_INDEX_MAX: use GrB_INDEX_MAX+1 instead -#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) - -// GxB_SelectOp: use GrB_IndexUnaryOp instead -GB_GLOBAL GxB_SelectOp GxB_TRIL, GxB_TRIU, GxB_DIAG, GxB_OFFDIAG, GxB_NONZERO, - GxB_EQ_ZERO, GxB_GT_ZERO, GxB_GE_ZERO, GxB_LT_ZERO, GxB_LE_ZERO, - GxB_NE_THUNK, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, - GxB_LE_THUNK ; -GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; -GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; -GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, - GxB_Print_Level pr, FILE *f) ; +#define GxB_INDEX_MAX ((uint64_t) (1ULL << 60)) // GxB_Desc*get/set and GrB_Descriptor_set: use GrB_get/set instead. -GrB_Info GrB_Descriptor_set (GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value) ; -GrB_Info GxB_Descriptor_get (GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field) ; -GrB_Info GxB_Desc_set (GrB_Descriptor, GrB_Desc_Field, ...) ; -GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t) ; -GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, GrB_Desc_Field, double) ; -GrB_Info GxB_Desc_get (GrB_Descriptor, GrB_Desc_Field, ...) ; -GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t *) ; -GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, GrB_Desc_Field, double *) ; +GrB_Info GrB_Descriptor_set (GrB_Descriptor, int, int) ; +GrB_Info GxB_Descriptor_get (int32_t *, GrB_Descriptor, int) ; +GrB_Info GxB_Desc_set (GrB_Descriptor, int, ...) ; +GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, int, int32_t) ; +GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, int, double) ; +GrB_Info GxB_Desc_get (GrB_Descriptor, int, ...) ; +GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, int, int32_t *) ; +GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, int, double *) ; // GxB_Type_* queries: use GrB_get instead GrB_Info GxB_Type_name (char *, const GrB_Type) ; @@ -11516,14 +7427,13 @@ GrB_Info GxB_Semiring_add (GrB_Monoid *, GrB_Semiring) ; GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *, GrB_Semiring) ; // GxB_Scalar_* queries: use GrB_get instead -GrB_Info GxB_Scalar_type (GrB_Type *, const GrB_Scalar) ; GrB_Info GxB_Scalar_type_name (char *, const GrB_Scalar) ; // GxB_Scalar_* methods: use GrB_Scalar_* instead (as-is) GrB_Info GxB_Scalar_new (GrB_Scalar *, GrB_Type) ; GrB_Info GxB_Scalar_dup (GrB_Scalar *, const GrB_Scalar) ; GrB_Info GxB_Scalar_clear (GrB_Scalar ) ; -GrB_Info GxB_Scalar_nvals (GrB_Index *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_nvals (uint64_t *, const GrB_Scalar) ; GrB_Info GxB_Scalar_free (GrB_Scalar *) ; GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar, bool) ; GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar, int8_t) ; @@ -11557,71 +7467,63 @@ GrB_Info GxB_Scalar_error (const char **, const GrB_Scalar) ; #endif // GxB_Vector_* queries: use GrB_get instead -GrB_Info GxB_Vector_type (GrB_Type *, const GrB_Vector) ; GrB_Info GxB_Vector_type_name (char *, const GrB_Vector) ; // GxB_Matrix_* queries: use GrB_get instead -GrB_Info GxB_Matrix_type (GrB_Type *, const GrB_Matrix) ; GrB_Info GxB_Matrix_type_name (char *, const GrB_Matrix) ; // GxB_*_Option_set/get: use GrB_get/set instead -GrB_Info GxB_Matrix_Option_set (GrB_Matrix, GxB_Option_Field, ...) ; -GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, GxB_Option_Field, int32_t) ; -GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, GxB_Option_Field, double) ; -GrB_Info GxB_Matrix_Option_get (GrB_Matrix, GxB_Option_Field, ...) ; -GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, GxB_Option_Field, double *) ; -GrB_Info GxB_Vector_Option_set (GrB_Vector, GxB_Option_Field, ...) ; -GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, GxB_Option_Field, int32_t) ; -GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, GxB_Option_Field, double) ; -GrB_Info GxB_Vector_Option_get (GrB_Vector, GxB_Option_Field, ...) ; -GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_set (GxB_Option_Field, ...) ; -GrB_Info GxB_Global_Option_set_INT32 (GxB_Option_Field, int32_t) ; -GrB_Info GxB_Global_Option_set_FP64 (GxB_Option_Field, double) ; -GrB_Info GxB_Global_Option_set_FP64_ARRAY (GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_set_INT64_ARRAY (GxB_Option_Field, int64_t *) ; -GrB_Info GxB_Global_Option_set_CHAR (GxB_Option_Field, const char *) ; -GrB_Info GxB_Global_Option_set_FUNCTION (GxB_Option_Field, void *) ; -GrB_Info GxB_Global_Option_get (GxB_Option_Field, ...) ; -GrB_Info GxB_Global_Option_get_INT32 (GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Global_Option_get_FP64 (GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_get_INT64 (GxB_Option_Field, int64_t *) ; -GrB_Info GxB_Global_Option_get_CHAR (GxB_Option_Field, const char **) ; -GrB_Info GxB_Global_Option_get_FUNCTION (GxB_Option_Field, void **) ; -GrB_Info GxB_Context_set_INT32 (GxB_Context, GxB_Context_Field, int32_t) ; -GrB_Info GxB_Context_set_FP64 (GxB_Context, GxB_Context_Field, double) ; -GrB_Info GxB_Context_set (GxB_Context, GxB_Context_Field, ...) ; -GrB_Info GxB_Context_get_INT32 (GxB_Context, GxB_Context_Field, int32_t *) ; -GrB_Info GxB_Context_get_FP64 (GxB_Context, GxB_Context_Field, double *) ; -GrB_Info GxB_Context_get (GxB_Context, GxB_Context_Field, ...) ; +GrB_Info GxB_Matrix_Option_set (GrB_Matrix, int, ...) ; +GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, int, int32_t) ; +GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, int, double) ; +GrB_Info GxB_Matrix_Option_get (GrB_Matrix, int, ...) ; +GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, int, int32_t *) ; +GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, int, double *) ; +GrB_Info GxB_Vector_Option_set (GrB_Vector, int, ...) ; +GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, int, int32_t) ; +GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, int, double) ; +GrB_Info GxB_Vector_Option_get (GrB_Vector, int, ...) ; +GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, int, int32_t *) ; +GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, int, double *) ; +GrB_Info GxB_Global_Option_set (int, ...) ; +GrB_Info GxB_Global_Option_set_INT32 (int, int32_t) ; +GrB_Info GxB_Global_Option_set_FP64 (int, double) ; +GrB_Info GxB_Global_Option_set_FP64_ARRAY (int, double *) ; +GrB_Info GxB_Global_Option_set_INT64_ARRAY (int, int64_t *) ; +GrB_Info GxB_Global_Option_set_CHAR (int, const char *) ; +GrB_Info GxB_Global_Option_set_FUNCTION (int, void *) ; +GrB_Info GxB_Global_Option_get (int, ...) ; +GrB_Info GxB_Global_Option_get_INT32 (int, int32_t *) ; +GrB_Info GxB_Global_Option_get_FP64 (int, double *) ; +GrB_Info GxB_Global_Option_get_INT64 (int, int64_t *) ; +GrB_Info GxB_Global_Option_get_CHAR (int, const char **) ; +GrB_Info GxB_Global_Option_get_FUNCTION (int, void **) ; +GrB_Info GxB_Context_set_INT32 (GxB_Context, int, int32_t) ; +GrB_Info GxB_Context_set_FP64 (GxB_Context, int, double) ; +GrB_Info GxB_Context_set (GxB_Context, int, ...) ; +GrB_Info GxB_Context_get_INT32 (GxB_Context, int, int32_t *) ; +GrB_Info GxB_Context_get_FP64 (GxB_Context, int, double *) ; +GrB_Info GxB_Context_get (GxB_Context, int, ...) ; // GxB_get/set: use GrB_get/set instead #if GxB_STDC_VERSION >= 201112L -#define GxB_set(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_set , \ - GxB_Option_Field : GxB_Global_Option_set , \ - GrB_Vector : GxB_Vector_Option_set , \ - GrB_Matrix : GxB_Matrix_Option_set , \ - GrB_Descriptor : GxB_Desc_set , \ - GxB_Context : GxB_Context_set \ - ) \ +#define GxB_set(arg1,...) \ + _Generic ((arg1), \ + default: GxB_Global_Option_set, \ + int : GxB_Global_Option_set, \ + GrB_Vector : GxB_Vector_Option_set, \ + GrB_Matrix : GxB_Matrix_Option_set, \ + GrB_Descriptor : GxB_Desc_set, \ + GxB_Context : GxB_Context_set) \ (arg1, __VA_ARGS__) -#define GxB_get(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_get , \ - GxB_Option_Field : GxB_Global_Option_get , \ - GrB_Vector : GxB_Vector_Option_get , \ - GrB_Matrix : GxB_Matrix_Option_get , \ - GrB_Descriptor : GxB_Desc_get , \ - GxB_Context : GxB_Context_get \ - ) \ +#define GxB_get(arg1,...) \ + _Generic ((arg1), \ + default: GxB_Global_Option_get, \ + int : GxB_Global_Option_get, \ + GrB_Vector : GxB_Vector_Option_get, \ + GrB_Matrix : GxB_Matrix_Option_get, \ + GrB_Descriptor : GxB_Desc_get, \ + GxB_Context : GxB_Context_get) \ (arg1, __VA_ARGS__) #endif @@ -11645,94 +7547,91 @@ GrB_Info GxB_kron (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_Descriptor) ; // GxB_*_resize: use GrB_*_resize instead (as-is) -GrB_Info GxB_Matrix_resize (GrB_Matrix, GrB_Index, GrB_Index) ; -GrB_Info GxB_Vector_resize (GrB_Vector, GrB_Index) ; +GrB_Info GxB_Matrix_resize (GrB_Matrix, uint64_t, uint64_t) ; +GrB_Info GxB_Vector_resize (GrB_Vector, uint64_t) ; // GxB_*_import/export_[FORMAT]: use GxB_*_pack/unpack_[FORMAT] instead -GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, +GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, +GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, +GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, - GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, - GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, +GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, + uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, + uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - void **, GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - void **, GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, - void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, GrB_Index, int8_t **, - void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, GrB_Index, void **, - GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, - GrB_Index *, bool *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, - GrB_Index *, bool *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, - GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + void **, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + void **, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, uint64_t, uint64_t **, + void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, uint64_t, int8_t **, + void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, uint64_t, void **, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, + uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, + uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, - GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, +GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, + uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, - GrB_Index *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, - GrB_Index *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, GrB_Index *, - GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, + uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, + uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, uint64_t *, + uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, GrB_Index *, - int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, uint64_t *, + int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, GrB_Index *, - void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, uint64_t *, + void **, uint64_t *, bool *, const GrB_Descriptor) ; + +// GxB_SelectOp_: use GrB_IndexUnaryOp instead +GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_fprint (GxB_SelectOp, const char *, int, FILE *) ; // GxB_select: use GrB_select instead -GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +GrB_Info GxB_Vector_select (GrB_Vector, const GrB_Vector, const GrB_BinaryOp, + const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_select (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, + const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, + const GrB_Descriptor) ; #if GxB_STDC_VERSION >= 201112L -#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic ((C), \ - GrB_Vector : GxB_Vector_select , \ - GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, Thunk, desc) +#define GxB_select(C,Mask,accum,op,A,y,desc) _Generic ((C), \ + GrB_Vector : GxB_Vector_select , \ + GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, y, desc) #endif // GxB_deserialize_* queries: use GrB_get instead -GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; - -#endif // GB_CUDA_FOLDER -#if defined ( __cplusplus ) -} -#endif +GrB_Info GxB_deserialize_type_name (char *, const void *, uint64_t) ; // GxB_ABS_*: use GrB_ABS_* instead (as-is) GB_GLOBAL GrB_UnaryOp @@ -11760,7 +7659,6 @@ GB_GLOBAL GrB_Monoid // GxB_* semirings: use the GrB_* semirings instead (as-is) GB_GLOBAL GrB_Semiring - GxB_PLUS_TIMES_INT8, GxB_PLUS_MIN_INT8, GxB_MIN_PLUS_INT8, GxB_PLUS_TIMES_INT16, GxB_PLUS_MIN_INT16, GxB_MIN_PLUS_INT16, GxB_PLUS_TIMES_INT32, GxB_PLUS_MIN_INT32, GxB_MIN_PLUS_INT32, @@ -11808,5 +7706,72 @@ GB_GLOBAL GrB_Semiring GxB_LOR_LAND_BOOL, GxB_LAND_LOR_BOOL, GxB_LXOR_LAND_BOOL, GxB_EQ_LOR_BOOL ; // use GrB_LXNOR_LOR_SEMIRING_BOOL instead (as-is) +// GxB_SelectOp: use GrB_IndexUnaryOp instead +GB_GLOBAL GxB_SelectOp GxB_TRIL, GxB_TRIU, GxB_DIAG, GxB_OFFDIAG, GxB_NONZERO, + GxB_EQ_ZERO, GxB_GT_ZERO, GxB_GE_ZERO, GxB_LT_ZERO, GxB_LE_ZERO, + GxB_NE_THUNK, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, + GxB_LE_THUNK ; + +// pack/unpack: use the GxB_Container methods instead +GrB_Info GxB_Matrix_pack_CSR (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_CSC (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_HyperCSR (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_HyperCSC (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_BitmapR (GrB_Matrix, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_BitmapC (GrB_Matrix, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_FullR (GrB_Matrix, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_FullC (GrB_Matrix, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_CSC (GrB_Vector, uint64_t **, void **, uint64_t, + uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_Bitmap (GrB_Vector, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_Full (GrB_Vector, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_CSR (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_CSC (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_HyperCSR (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, + bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_HyperCSC (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, + bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_BitmapR (GrB_Matrix, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_BitmapC (GrB_Matrix, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_FullR (GrB_Matrix, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_FullC (GrB_Matrix, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_CSC (GrB_Vector, uint64_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_Bitmap (GrB_Vector, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_Full (GrB_Vector, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_unpack_HyperHash (GrB_Matrix, GrB_Matrix *, const GrB_Descriptor) ; +GrB_Info GxB_pack_HyperHash (GrB_Matrix, GrB_Matrix *, const GrB_Descriptor) ; + +#endif + +#endif // GB_CUDA_FOLDER +#if defined ( __cplusplus ) +} +#endif + +#undef GB_DECLARE +#undef GB_DECLARE_14 #endif diff --git a/GraphBLAS/Config/GraphBLAS.pc.in b/GraphBLAS/Config/GraphBLAS.pc.in index db39c4c671..6e81901fc1 100644 --- a/GraphBLAS/Config/GraphBLAS.pc.in +++ b/GraphBLAS/Config/GraphBLAS.pc.in @@ -1,4 +1,4 @@ -# GraphBLAS, Copyright (c) 2017-2024, Timothy A. Davis. +# GraphBLAS, Copyright (c) 2017-2025, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 @@ -7,8 +7,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -# FIXME: Which flags do we need to statically link CUDA? - Name: GraphBLAS URL: https://github.com/DrTimothyAldenDavis/SuiteSparse Description: Complete implementation of the GraphBLAS standard in SuiteSparse diff --git a/GraphBLAS/Config/GraphBLASConfig.cmake.in b/GraphBLAS/Config/GraphBLASConfig.cmake.in index a806fc3217..6ef50bc83a 100644 --- a/GraphBLAS/Config/GraphBLASConfig.cmake.in +++ b/GraphBLAS/Config/GraphBLASConfig.cmake.in @@ -4,7 +4,7 @@ # The following copyright and license applies to just this file only, not to # the library itself: -# GraphBLASConfig.cmake, Copyright (c) 2024, Timothy A. Davis. All Rights +# GraphBLASConfig.cmake, Copyright (c) 2017-2025, Timothy A. Davis. All Rights # Reserved. # SPDX-License-Identifier: BSD-3-clause diff --git a/GraphBLAS/Demo/DO_NOT_BENCHMARK.txt b/GraphBLAS/Demo/DO_NOT_BENCHMARK.txt deleted file mode 100644 index 735a60dad1..0000000000 --- a/GraphBLAS/Demo/DO_NOT_BENCHMARK.txt +++ /dev/null @@ -1,10 +0,0 @@ - -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ->>> DO NOT BENCHMARK ANY OF THESE PROGRAMS <<< -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - These methods are simple ones, meant for illustration only. They can be - slow. Use LAGraph for benchmarking and use in production. Do not use any - of these methods in user applications. Eventually, this Demo folder will - be removed, and its purpose will be achieved in LAGraph instead. - diff --git a/GraphBLAS/Demo/InProgress/gpu_reduce_demo.c b/GraphBLAS/Demo/InProgress/gpu_reduce_demo.c deleted file mode 100644 index bf59af32ea..0000000000 --- a/GraphBLAS/Demo/InProgress/gpu_reduce_demo.c +++ /dev/null @@ -1,127 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/reduce_demo: reduce a matrix to a scalar -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// TODO for GPU: add this to CMakelists.txt, or merge with reduce_demo.c - -#include "GraphBLAS.h" -#undef I - -// #define N 65536 - #define N 16384 - -int main (void) -{ - - #if defined ( _OPENMP ) - double t0 = omp_get_wtime ( ) ; - #endif - - // start GraphBLAS - GrB_init (GrB_NONBLOCKING) ; - printf ("demo: reduce a matrix to a scalar\n") ; - - int nthreads_max ; - GxB_get (GxB_NTHREADS, &nthreads_max) ; - printf ("# of threads: %d\n", nthreads_max) ; - - #if defined ( _OPENMP ) - t0 = omp_get_wtime ( ) - t0 ; - printf ("GPU warmup time: %g\n", t0) ; - t0 = omp_get_wtime ( ) ; - #endif - - GrB_Index nrows = N ; - GrB_Index ncols = N ; - GrB_Matrix A ; - GrB_Matrix_new (&A, GrB_INT64, nrows, ncols) ; - - GrB_Index *I = malloc (nrows * ncols * sizeof (GrB_Index)) ; - GrB_Index *J = malloc (nrows * ncols * sizeof (GrB_Index)) ; - int64_t *X = malloc (nrows * ncols * sizeof (int64_t)) ; - - #pragma omp parallel for num_threads(nthreads_max) collapse(2) \ - schedule(static) - for (int64_t i = 0 ; i < nrows ; i++) - { - for (int64_t j = 0 ; j < ncols ; j++) - { - int64_t k = i * N + j ; - // int x = (int) (rand ( ) & 0xFF) ; - int x = (int) (k & 0xFF) ; - I [k] = i ; - J [k] = j ; - X [k] = x ; - } - } - - GrB_Index nvals = ((size_t) N) * ((size_t) N) ; - GrB_Matrix_build (A, I, J, X, nvals, GrB_PLUS_INT64) ; - - GxB_print (A, 2) ; - - free (I) ; - free (J) ; - free (X) ; - - #if defined ( _OPENMP ) - t0 = omp_get_wtime ( ) - t0 ; - printf ("time to create matrix: %g\n", t0) ; - #endif - - GrB_Index result ; - - GrB_Matrix B ; - GrB_Matrix_new (&B, GrB_INT64, 2000, 2000) ; - for (int64_t i = 0 ; i < 2000 ; i++) - { - for (int64_t j = 0 ; j < 2000 ; j++) - { - GrB_Matrix_setElement (B, 1, i, j) ; - } - } - GrB_Index ignore ; - GrB_Matrix_nvals (&ignore, B) ; - - #if defined ( _OPENMP ) - double tfirst = omp_get_wtime ( ) ; - #endif - GrB_reduce (&result, NULL, GxB_PLUS_INT64_MONOID, B, NULL) ; - #if defined ( _OPENMP ) - tfirst = omp_get_wtime ( ) - tfirst ; - printf ("warmup %g sec (on all threads/gpu, small matrix)\n", tfirst) ; - printf ("result: %"PRIu64"\n", result) ; - #endif - - double t1 ; - - printf ("\nreduce to a scalar:\n") ; - - for (int nthreads = 1 ; nthreads <= nthreads_max ; nthreads++) - { - GxB_set (GxB_NTHREADS, nthreads) ; - #if defined ( _OPENMP ) - double t = omp_get_wtime ( ) ; - #endif - GrB_reduce (&result, NULL, GxB_PLUS_INT64_MONOID, A, NULL) ; - #if defined ( _OPENMP ) - t = omp_get_wtime ( ) - t ; - if (nthreads == 1) t1 = t ; - printf ("nthreads %3d time: %12.6f speedup %8.2f\n", - nthreads, t, t1/t) ; - #endif - } - - // printf ("result %d\n", result) ; - printf ("result %"PRId64"\n", (int64_t) result) ; - - // free everyting - GrB_free (&A) ; - GrB_finalize ( ) ; -} - diff --git a/GraphBLAS/Demo/Include/get_matrix.c b/GraphBLAS/Demo/Include/get_matrix.c index 8a02fe964c..18bbab6df2 100644 --- a/GraphBLAS/Demo/Include/get_matrix.c +++ b/GraphBLAS/Demo/Include/get_matrix.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/get_matrix.c: get matrix from file, or create random //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,8 +10,7 @@ // Creates a symmetric matrix, either from a file or by creating a random // matrix. If reading from a file, the file is assumed to be 0-based. -#include "GraphBLAS.h" -#undef I +#include "graphblas_demos.h" #undef FREE_ALL #define FREE_ALL \ @@ -19,8 +18,6 @@ GrB_Descriptor_free (&desc) ; \ GrB_Matrix_free (&Mask) ; -#include "graphblas_demos.h" - GrB_Info get_matrix // get a matrix from stdin, or create random one ( GrB_Matrix *A_output, // matrix to create @@ -28,7 +25,8 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one char **argv, bool no_self_edges, // if true, ensure the matrix has no self-edges bool boolean, // if true, file is read as GrB_BOOL, else GrB_FP64 - bool spones // if true, return all entries equal to 1 + bool spones, // if true, return all entries equal to 1 + uint64_t *state // random state, revised on output ) { @@ -65,16 +63,13 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one if (argc > 5) method = strtol (argv [5], NULL, 0) ; OK (random_matrix (&A, true, no_self_edges, - nrows, ncols, ntuples, method, false)) ; - - // force completion, just to check timing - GrB_Matrix_nvals (&nvals, A) ; + nrows, ncols, ntuples, method, false, state)) ; // printf format warnings can vary with different compilers, so // punt and type cast to double + GrB_Matrix_nvals (&nvals, A) ; printf ( "random %.16g by %.16g, nz: %.16g, method %d\n", (double) nrows, (double) ncols, (double) nvals, method) ; - fprintf (stderr, "random %.16g by %.16g, nz: %.16g, method %d\n", (double) nrows, (double) ncols, (double) nvals, method) ; @@ -94,46 +89,24 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one if (argc > 3) ny = strtol (argv [3], NULL, 0) ; if (argc > 4) method = strtol (argv [4], NULL, 0) ; - OK (wathen (&A, nx, ny, false, method, NULL)) ; - GrB_Matrix_nvals (&nvals, A) ; - GrB_Matrix_nrows (&nrows, A) ; + OK (wathen (&A, nx, ny, false, method, NULL, state)) ; // remove the self edges from the matrix if (no_self_edges) { - // Mask = speye (nrows) ; - OK (GrB_Matrix_new (&Mask, GrB_BOOL, nrows, nrows)) ; - for (int64_t i = 0 ; i < nrows ; i++) - { - // Mask (i,i) = true - OK (GrB_Matrix_setElement_BOOL (Mask, (bool) true, i, i)) ; - } - // A<~Mask> = A, thus removing the diagonal. GrB_transpose - // does C=A', so setting inp0 to tran does C=A'', and - // thus C=A, without forming any transpose at all. - // Replace is set, so A is cleared first. Otherwise the - // diagonal is not touched by C<~Mask>=A. - OK (GrB_Descriptor_new (&desc)) ; - OK (GrB_Descriptor_set (desc, GrB_INP0, GrB_TRAN)) ; - OK (GrB_Descriptor_set (desc, GrB_MASK, GrB_COMP)) ; - OK (GrB_Descriptor_set (desc, GrB_OUTP, GrB_REPLACE)) ; - OK (GrB_transpose (A, Mask, NULL, A, desc)) ; - GrB_Matrix_free (&Mask) ; - GrB_Descriptor_free (&desc) ; + OK (GrB_Matrix_select_UINT64 (A, NULL, NULL, GrB_OFFDIAG, A, + 0, NULL)) ; } - // force completion, just to check timing + GrB_Matrix_nrows (&nrows, A) ; OK (GrB_Matrix_nvals (&nvals, A)) ; - printf ("Wathen: nx %.16g ny %.16g n %.16g nz %.16g method %d\n", (double) nx, (double) ny, (double) nrows, (double) nvals, method) ; - fprintf (stderr, "Wathen: nx %.16g ny %.16g n %.16g nz %.16g method %d\n", (double) nx, (double) ny, (double) nrows, (double) nvals, method) ; - } } @@ -159,13 +132,10 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; OK (GrB_Matrix_nvals (&nvals, A)) ; - printf ("matrix %.16g by %.16g, %.16g entries, from stdin\n", (double) nrows, (double) ncols, (double) nvals) ; - fprintf (stderr, "matrix %.16g by %.16g, %.16g entries, from stdin\n", (double) nrows, (double) ncols, (double) nvals) ; - } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Demo/Include/graphblas_demos.h b/GraphBLAS/Demo/Include/graphblas_demos.h index d775bf705f..f62de976ec 100644 --- a/GraphBLAS/Demo/Include/graphblas_demos.h +++ b/GraphBLAS/Demo/Include/graphblas_demos.h @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/graphblas_demos.h: include file for all demo programs //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -53,10 +53,18 @@ #endif #endif +// do not use any historical methods in GraphBLAS.h +#define NHISTORICAL + #include "GraphBLAS.h" -#undef I #include "simple_rand.h" -// #include "usercomplex.h" +#undef I +#ifdef _OPENMP + #include "omp.h" + #define WALLCLOCK omp_get_wtime () +#else + #define WALLCLOCK 0 +#endif #undef MIN #undef MAX @@ -83,7 +91,8 @@ GrB_Info random_matrix // create a random double-precision matrix int64_t ncols, // number of columns int64_t ntuples, // number of entries (x2 if made symmetric) int method, // method to use: 0:setElement, 1:build - bool A_complex // if true, create a Complex matrix + bool A_complex, // if true, create a Complex matrix + uint64_t *state // random number state (revised on output) ) ; GrB_Info get_matrix // get a matrix from stdin, or create random one @@ -93,7 +102,8 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one char **argv, bool no_self_edges, // if true, ensure the matrix has no self-edges bool boolean, // if true, file is read as GrB_BOOL, else GrB_FP64 - bool spones // if true, return all entries equal to 1 + bool spones, // if true, return all entries equal to 1 + uint64_t *state // random state, revised on output ) ; GrB_Info wathen // construct a random Wathen matrix @@ -103,13 +113,8 @@ GrB_Info wathen // construct a random Wathen matrix int64_t ny, // grid dimension ny bool scale, // if true, scale the rows int method, // 0 to 3 - double *rho_given // nx-by-ny dense matrix, if NULL use random rho -) ; - -GrB_Info triu // C = triu (A,1) -( - GrB_Matrix *C_output, // output matrix - const GrB_Matrix A // input matrix, boolean or double + double *rho_given, // nx-by-ny dense matrix, if NULL use random rho + uint64_t *state // random state, revised on output ) ; GrB_Info isequal_type // return GrB_SUCCESS if successful @@ -129,12 +134,6 @@ GrB_Info isequal // return GrB_SUCCESS if successful // if A and B are of built-in types ) ; -//------------------------------------------------------------------------------ -// import/export test -//------------------------------------------------------------------------------ - -GrB_Info import_test (GrB_Matrix *C_handle, int format, bool dump) ; - //------------------------------------------------------------------------------ // CHECK: expr must be true; if not, return an error condition //------------------------------------------------------------------------------ @@ -147,7 +146,8 @@ GrB_Info import_test (GrB_Matrix *C_handle, int format, bool dump) ; { \ /* free the result and all workspace, and return NULL */ \ FREE_ALL ; \ - printf ("Failure: line %d file %s\n", __LINE__, __FILE__) ; \ + printf ("Failure: %d, line %d file %s\n", info, \ + __LINE__, __FILE__) ; \ return (info) ; \ } \ } @@ -166,6 +166,7 @@ GrB_Info import_test (GrB_Matrix *C_handle, int format, bool dump) ; if (!(info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ { \ printf ("GraphBLAS error: %d\n", info) ; \ + fprintf (stderr, "GraphBLAS error: %d\n", info) ; \ CHECK (false, info) ; \ } \ } diff --git a/GraphBLAS/Demo/Include/import_test.c b/GraphBLAS/Demo/Include/import_test.c deleted file mode 100644 index aaf701d46c..0000000000 --- a/GraphBLAS/Demo/Include/import_test.c +++ /dev/null @@ -1,268 +0,0 @@ -//------------------------------------------------------------------------------ -// SuiteSparse/GraphBLAS/Demo/Include/import_test: test import/export -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GraphBLAS.h" -#undef I -#include "graphblas_demos.h" - -#if defined __INTEL_COMPILER -#pragma warning (disable: 556) -#endif - -#undef FREE_ALL -#define FREE_ALL \ -{ \ - GrB_Matrix_free (C_handle) ; \ - if (Ap != NULL) free (Ap) ; \ - if (Ah != NULL) free (Ah) ; \ - if (Ai != NULL) free (Ai) ; \ - if (Aj != NULL) free (Aj) ; \ - if (Ax != NULL) free (Ax) ; \ -} - -// typecast the values to the exported type -#define GETVAL \ -{ \ - if (type == GrB_BOOL ) Ax_bool = (bool *) Ax ; \ - else if (type == GrB_INT8 ) Ax_int8 = (int8_t *) Ax ; \ - else if (type == GrB_INT16 ) Ax_int16 = (int16_t *) Ax ; \ - else if (type == GrB_INT32 ) Ax_int32 = (int32_t *) Ax ; \ - else if (type == GrB_INT64 ) Ax_int64 = (int64_t *) Ax ; \ - else if (type == GrB_UINT8 ) Ax_uint8 = (uint8_t *) Ax ; \ - else if (type == GrB_UINT16) Ax_uint16 = (uint16_t *) Ax ; \ - else if (type == GrB_UINT32) Ax_uint32 = (uint32_t *) Ax ; \ - else if (type == GrB_UINT64) Ax_uint64 = (uint64_t *) Ax ; \ - else if (type == GrB_FP32 ) Ax_fp32 = (float *) Ax ; \ - else if (type == GrB_FP64 ) Ax_fp64 = (double *) Ax ; \ - else return (GrB_INVALID_VALUE) ; \ -} - -// print a value -#define PRINTVAL(p) \ -{ \ - if (type == GrB_BOOL ) printf ("%g", (double) Ax_bool [p]) ; \ - else if (type == GrB_INT8 ) printf ("%g", (double) Ax_int8 [p]) ; \ - else if (type == GrB_INT16 ) printf ("%g", (double) Ax_int16 [p]) ; \ - else if (type == GrB_INT32 ) printf ("%g", (double) Ax_int32 [p]) ; \ - else if (type == GrB_INT64 ) printf ("%g", (double) Ax_int64 [p]) ; \ - else if (type == GrB_UINT8 ) printf ("%g", (double) Ax_uint8 [p]) ; \ - else if (type == GrB_UINT16) printf ("%g", (double) Ax_uint16 [p]) ; \ - else if (type == GrB_UINT32) printf ("%g", (double) Ax_uint32 [p]) ; \ - else if (type == GrB_UINT64) printf ("%g", (double) Ax_uint64 [p]) ; \ - else if (type == GrB_FP32 ) printf ("%g", (double) Ax_fp32 [p]) ; \ - else if (type == GrB_FP64 ) printf ("%g", (double) Ax_fp64 [p]) ; \ -} - -GrB_Info import_test (GrB_Matrix *C_handle, int format, bool dump) -{ - - GrB_Type type ; - GrB_Index nrows, ncols, nvec ; - GrB_Index *Ap = NULL, *Ah = NULL, *Ai = NULL, *Aj = NULL ; - GrB_Index Ap_size = 0 ; - GrB_Index Ah_size = 0 ; - GrB_Index Ab_size = 0 ; - GrB_Index Ai_size = 0 ; - GrB_Index Aj_size = 0 ; - GrB_Index Ax_size = 0 ; - bool iso = false ; - bool jumbled ; - - void *Ax = NULL ; - - bool *Ax_bool = NULL ; - int8_t *Ax_int8 = NULL ; - int16_t *Ax_int16 = NULL ; - int32_t *Ax_int32 = NULL ; - int64_t *Ax_int64 = NULL ; - uint8_t *Ax_uint8 = NULL ; - uint16_t *Ax_uint16 = NULL ; - uint32_t *Ax_uint32 = NULL ; - uint64_t *Ax_uint64 = NULL ; - float *Ax_fp32 = NULL ; - double *Ax_fp64 = NULL ; - - GrB_Info info = GrB_SUCCESS ; - - printf ("\n========================= import_test: format %d\n", format) ; - OK (GxB_Matrix_fprint (*(C_handle), "C to export", - dump ? GxB_COMPLETE : GxB_SHORT, stdout)) ; - - switch (format) - { - - //---------------------------------------------------------------------- - case 0 : - //---------------------------------------------------------------------- - - OK (GxB_Matrix_export_CSR (C_handle, &type, &nrows, &ncols, - &Ap, &Aj, &Ax, &Ap_size, &Aj_size, &Ax_size, &iso, - &jumbled, NULL)) ; - - // the export destroys the matrix (*C_handle), returning its - // contents in Ap, Aj, and Ax. - CHECK (*C_handle == NULL, GrB_INVALID_VALUE) ; - - if (dump) - { - printf ("export standard CSR: %g-by-%g, Ax_size %g:\n", - (double) nrows, (double) ncols, (double) Ax_size) ; - OK (GxB_Type_fprint (type, "type", GxB_COMPLETE, stdout)) ; - GETVAL ; - printf ("Ap %p Aj %p Ax %p\n", (void *) Ap, (void *) Aj, Ax) ; - - for (int64_t i = 0 ; i < nrows ; i++) - { - printf ("Row %g\n", (double) i) ; - for (int64_t p = Ap [i] ; p < Ap [i+1] ; p++) - { - printf (" col %g value ", (double) Aj [p]) ; - PRINTVAL (iso ? 0 : p) ; - printf ("\n") ; - } - } - } - - // reimport the matrix - OK (GxB_Matrix_import_CSR (C_handle, type, nrows, ncols, - &Ap, &Aj, &Ax, Ap_size, Aj_size, Ax_size, iso, - jumbled, NULL)) ; - - OK (GxB_Matrix_fprint ((*C_handle), "C reimported", - dump ? GxB_COMPLETE : GxB_SILENT, stdout)) ; - break ; - - //---------------------------------------------------------------------- - case 1 : - //---------------------------------------------------------------------- - - OK (GxB_Matrix_export_CSC (C_handle, &type, &nrows, &ncols, - &Ap, &Ai, &Ax, &Ap_size, &Ai_size, &Ax_size, &iso, - &jumbled, NULL)) ; - - CHECK (*C_handle == NULL, GrB_INVALID_VALUE) ; - - if (dump) - { - printf ("export standard CSC: %g-by-%g, Ax_size %g:\n", - (double) nrows, (double) ncols, (double) Ax_size) ; - OK (GxB_Type_fprint (type, "type", GxB_COMPLETE, stdout)) ; - GETVAL ; - - for (int64_t j = 0 ; j < ncols ; j++) - { - printf ("Col %g\n", (double) j) ; - for (int64_t p = Ap [j] ; p < Ap [j+1] ; p++) - { - printf (" row %g value ", (double) Ai [p]) ; - PRINTVAL (iso ? 0 : p) ; - printf ("\n") ; - } - } - - } - - OK (GxB_Matrix_import_CSC (C_handle, type, nrows, ncols, - &Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, iso, - jumbled, NULL)) ; - - OK (GxB_Matrix_fprint ((*C_handle), "C reimported", - dump ? GxB_COMPLETE : GxB_SILENT, stdout)) ; - break ; - - //---------------------------------------------------------------------- - case 2 : - //---------------------------------------------------------------------- - - OK (GxB_Matrix_export_HyperCSR (C_handle, &type, &nrows, &ncols, - &Ap, &Ah, &Aj, &Ax, &Ap_size, &Ah_size, &Aj_size, &Ax_size, - &iso, &nvec, &jumbled, NULL)) ; - - CHECK (*C_handle == NULL, GrB_INVALID_VALUE) ; - - if (dump) - { - printf ("export hyper CSR: %g-by-%g, Ax_size %g, nvec %g:\n", - (double) nrows, (double) ncols, (double) Ax_size, - (double) nvec) ; - OK (GxB_Type_fprint (type, "type", GxB_COMPLETE, stdout)) ; - GETVAL ; - - for (int64_t k = 0 ; k < nvec ; k++) - { - int64_t i = Ah [k] ; - printf ("Row %g\n", (double) i) ; - for (int64_t p = Ap [k] ; p < Ap [k+1] ; p++) - { - printf (" col %g value ", (double) Aj [p]) ; - PRINTVAL (iso ? 0 : p) ; - printf ("\n") ; - } - } - } - - OK (GxB_Matrix_import_HyperCSR (C_handle, type, nrows, ncols, - &Ap, &Ah, &Aj, &Ax, Ap_size, Ah_size, Aj_size, Ax_size, - iso, nvec, jumbled, NULL)) ; - - OK (GxB_Matrix_fprint ((*C_handle), "C reimported", - dump ? GxB_COMPLETE : GxB_SILENT, stdout)) ; - break ; - - //---------------------------------------------------------------------- - case 3 : - //---------------------------------------------------------------------- - - OK (GxB_Matrix_export_HyperCSC (C_handle, &type, &nrows, &ncols, - &Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, - &iso, &nvec, &jumbled, NULL)) ; - - CHECK (*C_handle == NULL, GrB_INVALID_VALUE) ; - - if (dump) - { - printf ("export hyper CSC: %g-by-%g, Ax_size %g, nvec %g:\n", - (double) nrows, (double) ncols, (double) Ax_size, - (double) nvec) ; - OK (GxB_Type_fprint (type, "type", GxB_COMPLETE, stdout)) ; - GETVAL ; - - for (int64_t k = 0 ; k < nvec ; k++) - { - int64_t j = Ah [k] ; - printf ("Col %g\n", (double) j) ; - for (int64_t p = Ap [k] ; p < Ap [k+1] ; p++) - { - printf (" row %g value ", (double) Ai [p]) ; - PRINTVAL (iso ? 0 : p) ; - printf ("\n") ; - } - } - } - - OK (GxB_Matrix_import_HyperCSC (C_handle, type, nrows, ncols, - &Ap, &Ah, &Ai, &Ax, Ap_size, Ah_size, Ai_size, Ax_size, - iso, nvec, jumbled, NULL)) ; - - OK (GxB_Matrix_fprint ((*C_handle), "C reimported", - dump ? GxB_COMPLETE : GxB_SILENT, stdout)) ; - break ; - - //---------------------------------------------------------------------- - default : - //---------------------------------------------------------------------- - - printf ("bad format\n") ; - return (GrB_INVALID_VALUE) ; - break ; - } - - return (GrB_SUCCESS) ; -} - diff --git a/GraphBLAS/Demo/Include/isequal.c b/GraphBLAS/Demo/Include/isequal.c index 592089680e..ffe477caba 100644 --- a/GraphBLAS/Demo/Include/isequal.c +++ b/GraphBLAS/Demo/Include/isequal.c @@ -2,7 +2,7 @@ // isequal: check two matrices for exact equality //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,22 +19,9 @@ // NaN equality, use isequal_type with a user-defined operator f(x,y) that // returns true if x and y are both NaN. -#include "GraphBLAS.h" -#undef I #include "graphblas_demos.h" -// call a GraphBLAS method and return if an error occurs -#undef OK -#define OK(method) \ -{ \ - GrB_Info info = method ; \ - if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ - { \ - /* error occured: free workspace and return */ \ - GrB_Matrix_free (&C) ; \ - return (info) ; \ - } \ -} +#define FREE_ALL GrB_Matrix_free (&C) ; //------------------------------------------------------------------------------ // isequal_type: check two matrices, works in any GraphBLAS diff --git a/GraphBLAS/Demo/Include/random_matrix.c b/GraphBLAS/Demo/Include/random_matrix.c index dc49582d07..fb629c8f02 100644 --- a/GraphBLAS/Demo/Include/random_matrix.c +++ b/GraphBLAS/Demo/Include/random_matrix.c @@ -2,15 +2,14 @@ // GraphBLAS/Demo/Include/random_matrix.c: create a random matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // Creates a random sparse matrix, using either setElement or build. -#include "GraphBLAS.h" -#undef I +#include "graphblas_demos.h" #undef FREE_ALL #define FREE_ALL \ @@ -21,8 +20,6 @@ if (J != NULL) free (J) ; \ if (X != NULL) free (X) ; -#include "graphblas_demos.h" - //------------------------------------------------------------------------------ // create a random matrix //------------------------------------------------------------------------------ @@ -36,7 +33,8 @@ GrB_Info random_matrix // create a random double-precision matrix int64_t ncols, // number of columns int64_t nedges, // number of edges int method, // method to use: 0:setElement, 1:build, - bool A_complex // if true, create a Complex matrix + bool A_complex, // if true, create a Complex matrix + uint64_t *state // random number state (revised on output) ) { GrB_Matrix Areal = NULL, Aimag = NULL, A = NULL ; @@ -59,11 +57,11 @@ GrB_Info random_matrix // create a random double-precision matrix { // Areal = real random matrix OK (random_matrix (&Areal, make_symmetric, no_self_edges, nrows, - ncols, nedges, method, false)) ; + ncols, nedges, method, false, state)) ; OK (GxB_Matrix_fprint (Areal, "random real part", GxB_SHORT, stderr)) ; // Aimag = real random matrix OK (random_matrix (&Aimag, make_symmetric, no_self_edges, nrows, - ncols, nedges, method, false)) ; + ncols, nedges, method, false, state)) ; OK (GxB_Matrix_fprint (Aimag, "random imag part", GxB_SHORT, stderr)) ; // A = Areal + imag(Aimag) OK (GrB_Matrix_new (&A, Complex, nrows, ncols)) ; @@ -112,10 +110,10 @@ GrB_Info random_matrix // create a random double-precision matrix for (int64_t k = 0 ; k < nedges ; k++) { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; + GrB_Index i = simple_rand (state) % nrows ; + GrB_Index j = simple_rand (state) % ncols ; if (no_self_edges && (i == j)) continue ; - double x = simple_rand_x ( ) ; + double x = simple_rand_x (state) ; // A (i,j) = x OK (GrB_Matrix_setElement_FP64 (A, x, i, j)) ; if (make_symmetric) @@ -154,10 +152,10 @@ GrB_Info random_matrix // create a random double-precision matrix int64_t ntuples = 0 ; for (int64_t k = 0 ; k < nedges ; k++) { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; + GrB_Index i = simple_rand (state) % nrows ; + GrB_Index j = simple_rand (state) % ncols ; if (no_self_edges && (i == j)) continue ; - double x = simple_rand_x ( ) ; + double x = simple_rand_x (state) ; // A (i,j) = x I [ntuples] = i ; J [ntuples] = j ; diff --git a/GraphBLAS/Demo/Include/read_matrix.c b/GraphBLAS/Demo/Include/read_matrix.c index aad5503374..9b01b3e6a7 100644 --- a/GraphBLAS/Demo/Include/read_matrix.c +++ b/GraphBLAS/Demo/Include/read_matrix.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/read_matrix.c: read a matrix from stdin //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,8 +15,7 @@ // where i and j are the row and column indices, and x is the value. // The matrix is read in double precision. -#include "GraphBLAS.h" -#undef I +#include "graphblas_demos.h" // free all workspace; this used by the OK(...) macro if an error occurs #undef FREE_ALL @@ -34,8 +33,6 @@ GrB_Matrix_free (&B) ; \ GrB_Matrix_free (&C) ; -#include "graphblas_demos.h" - //------------------------------------------------------------------------------ // unary operator to divide by 2 //------------------------------------------------------------------------------ @@ -109,8 +106,11 @@ GrB_Info read_matrix // read a double-precision or boolean matrix if (ntuples >= len) { I2 = (GrB_Index *) realloc (I, 2 * len * sizeof (GrB_Index)) ; + if (I2 != NULL) I = NULL ; J2 = (GrB_Index *) realloc (J, 2 * len * sizeof (GrB_Index)) ; + if (J2 != NULL) J = NULL ; X2 = realloc (X, 2 * len * xsize) ; + if (X2 != NULL) X = NULL ; if (I2 == NULL || J2 == NULL || X2 == NULL) { if (pr) printf ("out of memory for tuples\n") ; @@ -129,6 +129,13 @@ GrB_Info read_matrix // read a double-precision or boolean matrix i-- ; j-- ; } + if (i < 0 || j < 0) + { + if (pr) printf ("invalid matrix entry (row %g, col %g)\n", + (double) i, (double) j) ; + FREE_ALL ; + return (GrB_INVALID_INDEX) ; + } I [ntuples] = i ; J [ntuples] = j ; if (boolean) @@ -230,11 +237,11 @@ GrB_Info read_matrix // read a double-precision or boolean matrix // descriptor dt2: transpose the 2nd input OK (GrB_Descriptor_new (&dt2)) ; - OK (GrB_Descriptor_set (dt2, GrB_INP1, GrB_TRAN)) ; + OK (GrB_Descriptor_set_INT32 (dt2, GrB_TRAN, GrB_INP1)) ; // descriptor dt1: transpose the 1st input OK (GrB_Descriptor_new (&dt1)) ; - OK (GrB_Descriptor_set (dt1, GrB_INP0, GrB_TRAN)) ; + OK (GrB_Descriptor_set_INT32 (dt1, GrB_TRAN, GrB_INP0)) ; //-------------------------------------------------------------------------- // create the output matrix diff --git a/GraphBLAS/Demo/Include/simple_rand.c b/GraphBLAS/Demo/Include/simple_rand.c deleted file mode 100644 index 4f3ebc5f58..0000000000 --- a/GraphBLAS/Demo/Include/simple_rand.c +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Include/simple_rand.c: a very simple random number generator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// The POSIX.1-2001 example of rand, duplicated here so that the same sequence -// will be generated on different machines. The purpose is not to generate -// high-quality random numbers, but to ensure the same sequence is generated -// on any computer or operating system. This allows the GraphBLAS tests and -// demos to be repeatable. - -// Since the simple_rand ( ) function is replicated from the POSIX.1-2001 -// standard, no copyright claim is intended for this specific file. The -// copyright statement above applies to all of SuiteSparse:GraphBLAS, not -// this file. - -#include "simple_rand.h" - -// simple_rand is not thread-safe -static uint64_t simple_rand_next = 1 ; - -#define SIMPLE_RAND_MAX 32767 - -// return a random number between 0 and SIMPLE_RAND_MAX -uint64_t simple_rand (void) -{ - simple_rand_next = simple_rand_next * 1103515245 + 12345 ; - return ((simple_rand_next/65536) % (SIMPLE_RAND_MAX + 1)) ; -} - -// set the seed -void simple_rand_seed (uint64_t seed) -{ - simple_rand_next = seed ; -} - -// get the seed -uint64_t simple_rand_getseed (void) -{ - return (simple_rand_next) ; -} - -// return a random uint64_t -uint64_t simple_rand_i ( ) -{ - uint64_t i = 0 ; - for (int k = 0 ; k < 5 ; k++) - { - i = SIMPLE_RAND_MAX * i + simple_rand ( ) ; - } - return (i) ; -} - -// return a random double between 0 and 1, inclusive -double simple_rand_x ( ) -{ - return (((double) simple_rand_i ( )) / ((double) UINT64_MAX)) ; -} - diff --git a/GraphBLAS/Demo/Include/simple_rand.h b/GraphBLAS/Demo/Include/simple_rand.h index 468959190a..678c7a8665 100644 --- a/GraphBLAS/Demo/Include/simple_rand.h +++ b/GraphBLAS/Demo/Include/simple_rand.h @@ -2,36 +2,30 @@ // GraphBLAS/Demo/Include/simple_rand.h: a very simple random number generator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Since the simple_rand ( ) function is replicated from the POSIX.1-2001 -// standard, no copyright claim is intended for this specific file. The -// copyright statement above applies to all of SuiteSparse:GraphBLAS, not -// this file. - #ifndef SIMPLE_RAND_H #define SIMPLE_RAND_H #include -#define SIMPLE_RAND_MAX 32767 - -// return a random number between 0 and SIMPLE_RAND_MAX -uint64_t simple_rand (void) ; - -// set the seed -void simple_rand_seed (uint64_t seed) ; - -// get the seed -uint64_t simple_rand_getseed (void) ; +// return a random number between 0 and UINT64_MAX +static inline uint64_t simple_rand (uint64_t *state) +{ + uint64_t s = (*state) ; + s ^= s << 13 ; + s ^= s >> 7 ; + s ^= s << 17 ; + return ((*state) = s) ; +} // return a random double between 0 and 1, inclusive -double simple_rand_x ( ) ; - -// return a random uint64_t -uint64_t simple_rand_i ( ) ; +static inline double simple_rand_x (uint64_t *state) +{ + return (((double) simple_rand (state)) / ((double) UINT64_MAX)) ; +} #endif diff --git a/GraphBLAS/Demo/Include/usercomplex.c b/GraphBLAS/Demo/Include/usercomplex.c index ad82f213a3..084ace29ca 100644 --- a/GraphBLAS/Demo/Include/usercomplex.c +++ b/GraphBLAS/Demo/Include/usercomplex.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/usercomplex.c: complex numbers as a user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,21 +14,22 @@ #ifdef MATLAB_MEX_FILE #include "GB_mex.h" - + #undef OK #define OK(method) \ { \ info = method ; \ if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ { \ - return (info) ; \ + printf ("%s, line %d, info %d\n", __FILE__, __LINE__, info) ; \ + mexErrMsgTxt ("GraphBLAS error!") ; \ } \ } #else - #include "GraphBLAS.h" - #undef I #include "graphblas_demos.h" + #undef FREE_ALL + #define FREE_ALL Complex_finalize ( ) ; #if defined __INTEL_COMPILER #pragma warning (disable: 58 167 144 161 177 181 186 188 589 593 869 981 \ @@ -40,17 +41,6 @@ #endif #endif - #undef OK - #define OK(method) \ - { \ - info = method ; \ - if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ - { \ - Complex_finalize ( ) ; \ - return (info) ; \ - } \ - } - #endif GrB_BinaryOp Complex_first = NULL, Complex_second = NULL, Complex_min = NULL, @@ -1406,4 +1396,6 @@ GrB_Info Complex_finalize ( ) #undef U #undef B +#undef FREE_ALL + diff --git a/GraphBLAS/Demo/Include/usercomplex.h b/GraphBLAS/Demo/Include/usercomplex.h index 34d3c7cc58..c0c718bb99 100644 --- a/GraphBLAS/Demo/Include/usercomplex.h +++ b/GraphBLAS/Demo/Include/usercomplex.h @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/usercomplex.h: complex numbers as a user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Demo/Include/wathen.c b/GraphBLAS/Demo/Include/wathen.c index 19eb1be258..2342e94611 100644 --- a/GraphBLAS/Demo/Include/wathen.c +++ b/GraphBLAS/Demo/Include/wathen.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Include/wathen.c: a finite-element matrix on a regular mesh //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,8 +10,6 @@ // Create a finite-element matrix on an nx-by-ny 2D mesh, as computed by // wathen.m. -#include "GraphBLAS.h" -#undef I #include "graphblas_demos.h" //------------------------------------------------------------------------------ @@ -35,7 +33,8 @@ GrB_Info wathen // construct a random Wathen matrix int64_t ny, // grid dimension ny bool scale, // if true, scale the rows int method, // 0 to 3 - double *rho_given // nx-by-ny dense matrix, if NULL use random rho + double *rho_given, // nx-by-ny dense matrix, if NULL use random rho + uint64_t *state // random state, revised on output ) { @@ -65,7 +64,7 @@ GrB_Info wathen // construct a random Wathen matrix GrB_Matrix A = NULL, F = NULL, E = NULL, D = NULL ; GrB_UnaryOp rho_op = NULL ; double *rho_rand = NULL, *X = NULL, *rho ; - GrB_Index *I = NULL, *J = NULL ; + uint64_t *I = NULL, *J = NULL ; //-------------------------------------------------------------------------- // construct the coefficients @@ -111,7 +110,7 @@ GrB_Info wathen // construct a random Wathen matrix { for (int i = 1 ; i <= nx ; i++) { - RHO (i,j) = 100 * simple_rand_x ( ) ; + RHO (i,j) = 100 * simple_rand_x (state) ; } } } @@ -151,8 +150,8 @@ GrB_Info wathen // construct a random Wathen matrix // allocate the tuples int64_t ntriplets = nx*ny*64 ; - I = (GrB_Index *) malloc (ntriplets * sizeof (GrB_Index)) ; - J = (GrB_Index *) malloc (ntriplets * sizeof (GrB_Index)) ; + I = (uint64_t *) malloc (ntriplets * sizeof (uint64_t)) ; + J = (uint64_t *) malloc (ntriplets * sizeof (uint64_t)) ; X = (double *) malloc (ntriplets * sizeof (double )) ; if (I == NULL || J == NULL || X == NULL) { // out of memory @@ -191,7 +190,6 @@ GrB_Info wathen // construct a random Wathen matrix // A = sparse (I,J,X,n,n) ; OK (GrB_Matrix_build_FP64 (A, I, J, X, ntriplets, GrB_PLUS_FP64)) ; - } break ; @@ -362,7 +360,7 @@ GrB_Info wathen // construct a random Wathen matrix OK (GrB_Matrix_setElement_FP64 (D, 1/di, i, i)) ; } // A = D*A - OK (GrB_mxm (A, NULL, NULL, GxB_PLUS_TIMES_FP64, D, A, NULL)) ; + OK (GrB_mxm (A, NULL, NULL, GrB_PLUS_TIMES_SEMIRING_FP64, D, A, NULL)) ; } // force completion diff --git a/GraphBLAS/Demo/Output/complex_demo_out.m b/GraphBLAS/Demo/Output/complex_demo_out.m index e9e9a87852..eae6d39b73 100644 --- a/GraphBLAS/Demo/Output/complex_demo_out.m +++ b/GraphBLAS/Demo/Output/complex_demo_out.m @@ -1,50 +1,42 @@ % run this output of this program as a script: -% GraphBLAS matrix A: nrows: 3 ncols 5 entries: 10 +% GraphBLAS matrix A: nrows: 3 ncols 5 entries: 6 A = sparse (3,5) ; - A (1,2) = ( 0) + ( 0.8253972948485638)*1i ; - A (1,3) = ( 0.8158771738902956) + ( 0.6199473944886393)*1i ; - A (1,4) = ( 0.230335927869842) + ( 0)*1i ; - A (1,5) = ( 0.6834455780600209) + ( 0)*1i ; - A (2,1) = ( 0) + ( 0.8145545554415048)*1i ; - A (2,2) = ( 0) + ( 0.8106511441383925)*1i ; - A (2,3) = ( 0) + ( 0.6296551667948371)*1i ; - A (2,4) = ( 0.6749993971837149) + ( 0.1028046574093258)*1i ; - A (2,5) = ( 0.1781985185630041) + ( 0)*1i ; - A (3,1) = ( 0.6668132827629559) + ( 0)*1i ; + A (1,1) = ( 0.6606296233424496) + ( 0.9460708279587872)*1i ; + A (1,3) = ( 0) + ( 0.5437355909764924)*1i ; + A (1,4) = ( 0.4892274845865111) + ( 0)*1i ; + A (3,2) = ( 0.537214211497701) + ( 0.3927366677319613)*1i ; + A (3,4) = ( 0.9636279947347471) + ( 0)*1i ; + A (3,5) = ( 0.9362395387648647) + ( 0.1932763616009246)*1i ; A -% GraphBLAS matrix B: nrows: 5 ncols 4 entries: 13 +% GraphBLAS matrix B: nrows: 5 ncols 4 entries: 12 B = sparse (5,4) ; - B (1,1) = ( 0.03470661760412896) + ( 0)*1i ; - B (1,2) = ( 0.2320846810101108) + ( 0)*1i ; - B (1,4) = ( 0.4037695773165162) + ( 0)*1i ; - B (2,1) = ( 0) + ( 0.70501889367129)*1i ; - B (2,3) = ( 0.2114568817022959) + ( 0)*1i ; - B (2,4) = ( 0) + ( 0.4423346124115619)*1i ; - B (3,1) = ( 0.929676618909714) + ( 0)*1i ; - B (3,2) = ( 0.03154825424997802) + ( 0)*1i ; - B (3,3) = ( 0) + ( 0.1598994553484671)*1i ; - B (3,4) = ( 0.9813322475732387) + ( 0.9048904118202962)*1i ; - B (4,1) = ( 0) + ( 0.9376008381429164)*1i ; - B (4,4) = ( 0) + ( 0.8269171297987302)*1i ; - B (5,4) = ( 0.1371733231185191) + ( 0)*1i ; + B (1,4) = ( 0) + ( 0.8073208487984076)*1i ; + B (2,1) = ( 0.6630361554125466) + ( 0)*1i ; + B (2,2) = ( 0.4290097793686153) + ( 0)*1i ; + B (2,4) = ( 0) + ( 0.7963012789805426)*1i ; + B (3,1) = ( 0) + ( 0.4789398381884235)*1i ; + B (3,2) = ( 0) + ( 0.174465941751312)*1i ; + B (3,3) = ( 0.03575034370042069) + ( 0.0454505827823905)*1i ; + B (3,4) = ( 0.7931472431266039) + ( 0)*1i ; + B (4,3) = ( 0.9128666744293144) + ( 0)*1i ; + B (4,4) = ( 0.2895771348964379) + ( 0)*1i ; + B (5,3) = ( 0) + ( 0.7385180444190567)*1i ; + B (5,4) = ( 0) + ( 0.05298253707866783)*1i ; B -% GraphBLAS matrix C: nrows: 3 ncols 4 entries: 11 +% GraphBLAS matrix C: nrows: 3 ncols 4 entries: 8 C = sparse (3,4) ; - C (1,1) = ( 0.1765812448145327) + ( 0.7923137566352751)*1i ; - C (1,2) = ( 0.02573950051864457) + ( 0.01955825802293901)*1i ; - C (1,3) = (-0.09912925072343469) + ( 0.3049942538704926)*1i ; - C (1,4) = (-0.03168916369751931) + ( 1.537122526250736)*1i ; - C (2,1) = ( -0.6679141057457941) + ( 1.24652612056368)*1i ; - C (2,2) = ( 0) + ( 0.2089101554568301)*1i ; - C (2,3) = ( -0.1006815182278427) + ( 0.1714177630879029)*1i ; - C (2,4) = ( -0.9889148320979797) + ( 1.50496183271377)*1i ; - C (3,1) = ( 0.02314283361820783) + ( 0)*1i ; - C (3,2) = ( 0.1547571480233455) + ( 0)*1i ; - C (3,4) = ( 0.2692389173302374) + ( 0)*1i ; + C (1,1) = ( -0.2604166359595681) + ( 0)*1i ; + C (1,2) = (-0.09486334194341992) + ( 0)*1i ; + C (1,3) = ( 0.421886367404498) + ( 0.01943873425956097)*1i ; + C (1,4) = ( -0.6221136105519471) + ( 0.9646024532310183)*1i ; + C (3,1) = ( 0.3561924454244184) + ( 0.2603986102625343)*1i ; + C (3,2) = ( 0.2304701503483134) + ( 0.1684878711736539)*1i ; + C (3,3) = ( 0.7369258023385522) + ( 0.6914297932764274)*1i ; + C (3,4) = (-0.04393234899118034) + ( 0.4773887097792673)*1i ; C E = A*B err = norm (C-E,1) diff --git a/GraphBLAS/Demo/Output/complex_demo_out2.m b/GraphBLAS/Demo/Output/complex_demo_out2.m index e9e9a87852..eae6d39b73 100644 --- a/GraphBLAS/Demo/Output/complex_demo_out2.m +++ b/GraphBLAS/Demo/Output/complex_demo_out2.m @@ -1,50 +1,42 @@ % run this output of this program as a script: -% GraphBLAS matrix A: nrows: 3 ncols 5 entries: 10 +% GraphBLAS matrix A: nrows: 3 ncols 5 entries: 6 A = sparse (3,5) ; - A (1,2) = ( 0) + ( 0.8253972948485638)*1i ; - A (1,3) = ( 0.8158771738902956) + ( 0.6199473944886393)*1i ; - A (1,4) = ( 0.230335927869842) + ( 0)*1i ; - A (1,5) = ( 0.6834455780600209) + ( 0)*1i ; - A (2,1) = ( 0) + ( 0.8145545554415048)*1i ; - A (2,2) = ( 0) + ( 0.8106511441383925)*1i ; - A (2,3) = ( 0) + ( 0.6296551667948371)*1i ; - A (2,4) = ( 0.6749993971837149) + ( 0.1028046574093258)*1i ; - A (2,5) = ( 0.1781985185630041) + ( 0)*1i ; - A (3,1) = ( 0.6668132827629559) + ( 0)*1i ; + A (1,1) = ( 0.6606296233424496) + ( 0.9460708279587872)*1i ; + A (1,3) = ( 0) + ( 0.5437355909764924)*1i ; + A (1,4) = ( 0.4892274845865111) + ( 0)*1i ; + A (3,2) = ( 0.537214211497701) + ( 0.3927366677319613)*1i ; + A (3,4) = ( 0.9636279947347471) + ( 0)*1i ; + A (3,5) = ( 0.9362395387648647) + ( 0.1932763616009246)*1i ; A -% GraphBLAS matrix B: nrows: 5 ncols 4 entries: 13 +% GraphBLAS matrix B: nrows: 5 ncols 4 entries: 12 B = sparse (5,4) ; - B (1,1) = ( 0.03470661760412896) + ( 0)*1i ; - B (1,2) = ( 0.2320846810101108) + ( 0)*1i ; - B (1,4) = ( 0.4037695773165162) + ( 0)*1i ; - B (2,1) = ( 0) + ( 0.70501889367129)*1i ; - B (2,3) = ( 0.2114568817022959) + ( 0)*1i ; - B (2,4) = ( 0) + ( 0.4423346124115619)*1i ; - B (3,1) = ( 0.929676618909714) + ( 0)*1i ; - B (3,2) = ( 0.03154825424997802) + ( 0)*1i ; - B (3,3) = ( 0) + ( 0.1598994553484671)*1i ; - B (3,4) = ( 0.9813322475732387) + ( 0.9048904118202962)*1i ; - B (4,1) = ( 0) + ( 0.9376008381429164)*1i ; - B (4,4) = ( 0) + ( 0.8269171297987302)*1i ; - B (5,4) = ( 0.1371733231185191) + ( 0)*1i ; + B (1,4) = ( 0) + ( 0.8073208487984076)*1i ; + B (2,1) = ( 0.6630361554125466) + ( 0)*1i ; + B (2,2) = ( 0.4290097793686153) + ( 0)*1i ; + B (2,4) = ( 0) + ( 0.7963012789805426)*1i ; + B (3,1) = ( 0) + ( 0.4789398381884235)*1i ; + B (3,2) = ( 0) + ( 0.174465941751312)*1i ; + B (3,3) = ( 0.03575034370042069) + ( 0.0454505827823905)*1i ; + B (3,4) = ( 0.7931472431266039) + ( 0)*1i ; + B (4,3) = ( 0.9128666744293144) + ( 0)*1i ; + B (4,4) = ( 0.2895771348964379) + ( 0)*1i ; + B (5,3) = ( 0) + ( 0.7385180444190567)*1i ; + B (5,4) = ( 0) + ( 0.05298253707866783)*1i ; B -% GraphBLAS matrix C: nrows: 3 ncols 4 entries: 11 +% GraphBLAS matrix C: nrows: 3 ncols 4 entries: 8 C = sparse (3,4) ; - C (1,1) = ( 0.1765812448145327) + ( 0.7923137566352751)*1i ; - C (1,2) = ( 0.02573950051864457) + ( 0.01955825802293901)*1i ; - C (1,3) = (-0.09912925072343469) + ( 0.3049942538704926)*1i ; - C (1,4) = (-0.03168916369751931) + ( 1.537122526250736)*1i ; - C (2,1) = ( -0.6679141057457941) + ( 1.24652612056368)*1i ; - C (2,2) = ( 0) + ( 0.2089101554568301)*1i ; - C (2,3) = ( -0.1006815182278427) + ( 0.1714177630879029)*1i ; - C (2,4) = ( -0.9889148320979797) + ( 1.50496183271377)*1i ; - C (3,1) = ( 0.02314283361820783) + ( 0)*1i ; - C (3,2) = ( 0.1547571480233455) + ( 0)*1i ; - C (3,4) = ( 0.2692389173302374) + ( 0)*1i ; + C (1,1) = ( -0.2604166359595681) + ( 0)*1i ; + C (1,2) = (-0.09486334194341992) + ( 0)*1i ; + C (1,3) = ( 0.421886367404498) + ( 0.01943873425956097)*1i ; + C (1,4) = ( -0.6221136105519471) + ( 0.9646024532310183)*1i ; + C (3,1) = ( 0.3561924454244184) + ( 0.2603986102625343)*1i ; + C (3,2) = ( 0.2304701503483134) + ( 0.1684878711736539)*1i ; + C (3,3) = ( 0.7369258023385522) + ( 0.6914297932764274)*1i ; + C (3,4) = (-0.04393234899118034) + ( 0.4773887097792673)*1i ; C E = A*B err = norm (C-E,1) diff --git a/GraphBLAS/Demo/Output/context_demo.out b/GraphBLAS/Demo/Output/context_demo.out index 88553fbd9a..b984bb966e 100644 --- a/GraphBLAS/Demo/Output/context_demo.out +++ b/GraphBLAS/Demo/Output/context_demo.out @@ -1,827 +1,175 @@ -context_demo output and its analysis. Jan 5-6, 2022. - -legend: threads (a,b): outer parallelism uses a parallel loop with -num_threads(a), and inner loop uses num_threads(b), for a total of a*b threads. -The context_demo constructs 1 to 64 matrices, all the same, with -GrB_Matrix_build, type: FP64, n-by-n with n = 100,000, and nvals = 20 -million. Bulk of the time would be spent in the parallel merge sort. -The GraphBLAS merge sort uses a sequence of parallel for loops, with -#pragma omp parallel for num_threads(b) schedule(dynamic,1) -with each iteration a large "task" (not an OpenMP task). - -hypersparse is a 20-core, 40-thread Intel Xeon CPU E5-2698 v4 @ 2.20GHz, -with Ubuntu 20.04. - -Mixed parallelism is slow with gcc 9.4.0 and libgomp. -Consider the time to build 64 matrices with 1 and 32 threads: - - with gcc 9.4.0 and its included libgomp: bad results - threads ( 1, 1): 1 time: 248.3557 sec speedup: 1.000 - ... - threads ( 1, 32): 32 time: 28.6471 sec speedup: 8.669 - threads ( 2, 16): 32 time: 140.2951 sec speedup: 1.770 <== Yikes!! - threads ( 4, 8): 32 time: 72.8835 sec speedup: 3.408 - threads ( 8, 4): 32 time: 40.4137 sec speedup: 6.145 - threads ( 16, 2): 32 time: 25.8655 sec speedup: 9.602 - threads ( 32, 1): 32 time: 17.4474 sec speedup: 14.235 - -The same work done with icx 2022.0.1 and libiomp5 shows no such slowdown, -and all 6 methods take roughly the same time, although it's fastest to -build all 64 matrices with a=32 threads in the outer loop, and b=1 thread -for each GrB_Matrix_build (which then uses a single-threaded qsort, not -a merge sort): - - with icx 2022.0.1 and its included libiomp: great results - threads ( 1, 1): 1 time: 249.5680 sec speedup: 1.000 - ... - threads ( 1, 32): 32 time: 30.4074 sec speedup: 8.207 - threads ( 2, 16): 32 time: 26.5007 sec speedup: 9.417 <== good! - threads ( 4, 8): 32 time: 24.5964 sec speedup: 10.147 - threads ( 8, 4): 32 time: 22.7695 sec speedup: 10.961 - threads ( 16, 2): 32 time: 19.7543 sec speedup: 12.634 - threads ( 32, 1): 32 time: 17.5195 sec speedup: 14.245 - -The (1,32) and (32,1) times for gcc-9.4 and icx 2022.0.1 are about the -same (~30 sec and ~17 sec for both). It's the mixed parallelism where -gcc 9.4 struggles. - -I then tried gcc 12.2.0 with libgomp (both from slack). The libgomp was -installed with gcc 12.2.0. This version of gcc fixes the multi-level -parallelism problem of gcc 9.4.0: - - with gcc 12.2.0 and its included libgomp: great results - threads ( 1, 1): 1 time: 256.8161 sec speedup: 1.000 - ... - threads ( 1, 32): 32 time: 29.2369 sec speedup: 8.784 - threads ( 2, 16): 32 time: 25.6922 sec speedup: 9.996 <== good! - threads ( 4, 8): 32 time: 24.2922 sec speedup: 10.572 - threads ( 8, 4): 32 time: 22.4136 sec speedup: 11.458 - threads ( 16, 2): 32 time: 20.2493 sec speedup: 12.683 - threads ( 32, 1): 32 time: 17.5978 sec speedup: 14.594 - -gcc 12.2.0 completely solves the performance bug of gcc 9.4.0. These results -were from GraphBLAS/Demo/Program/context_demo.c, which I will tag as -GraphbBLAS v8.0.0.alpha1 (not for production use but I want to save the entire -code base that generated these results). - -It must be said that to create these 64 matrices with 32 threads, the fastest -method is (32,1), to use one thread to create any given matrix. The -parallelism is obvious there. However, multi-level parallelism is useful in -other harder cases. - - ----- raw output: - --------------------------------------------------------------------------------- -hypersparse: with gcc 9.4.0 and libgomp (OpenMP 4.5) --------------------------------------------------------------------------------- - -hypersparse $ ./build/context_demo -context demo: nthreads_max 40 - - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 40 - Context.chunk: 65536 - -nthreads to use: 32 - -nmat 1 - - threads ( 1, 1): 1 time: 3.8534 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 2.3148 sec speedup: 1.665 - - threads ( 1, 4): 4 time: 1.3107 sec speedup: 2.940 - - threads ( 1, 8): 8 time: 0.7317 sec speedup: 5.266 - - threads ( 1, 16): 16 time: 0.5120 sec speedup: 7.526 - - threads ( 1, 32): 32 time: 0.4551 sec speedup: 8.468 - -nmat 2 - - threads ( 1, 1): 1 time: 7.7321 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 4.5403 sec speedup: 1.703 - threads ( 2, 1): 2 time: 3.9613 sec speedup: 1.952 - - threads ( 1, 4): 4 time: 2.5055 sec speedup: 3.086 - threads ( 2, 2): 4 time: 4.3797 sec speedup: 1.765 - - threads ( 1, 8): 8 time: 1.4525 sec speedup: 5.323 - threads ( 2, 4): 8 time: 4.4328 sec speedup: 1.744 - - threads ( 1, 16): 16 time: 0.9851 sec speedup: 7.849 - threads ( 2, 8): 16 time: 4.4588 sec speedup: 1.734 - - threads ( 1, 32): 32 time: 0.9148 sec speedup: 8.452 - threads ( 2, 16): 32 time: 4.4243 sec speedup: 1.748 - -nmat 4 - - threads ( 1, 1): 1 time: 15.5298 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 9.0791 sec speedup: 1.710 - threads ( 2, 1): 2 time: 7.9019 sec speedup: 1.965 - - threads ( 1, 4): 4 time: 4.9082 sec speedup: 3.164 - threads ( 2, 2): 4 time: 8.7219 sec speedup: 1.781 - threads ( 4, 1): 4 time: 4.1104 sec speedup: 3.778 - - threads ( 1, 8): 8 time: 2.8315 sec speedup: 5.485 - threads ( 2, 4): 8 time: 8.7174 sec speedup: 1.781 - threads ( 4, 2): 8 time: 4.6255 sec speedup: 3.357 - - threads ( 1, 16): 16 time: 1.9855 sec speedup: 7.822 - threads ( 2, 8): 16 time: 8.7663 sec speedup: 1.772 - threads ( 4, 4): 16 time: 4.5945 sec speedup: 3.380 - - threads ( 1, 32): 32 time: 1.8083 sec speedup: 8.588 - threads ( 2, 16): 32 time: 8.7982 sec speedup: 1.765 - threads ( 4, 8): 32 time: 4.6446 sec speedup: 3.344 - -nmat 8 - - threads ( 1, 1): 1 time: 31.1035 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 18.1952 sec speedup: 1.709 - threads ( 2, 1): 2 time: 15.7492 sec speedup: 1.975 - - threads ( 1, 4): 4 time: 9.9206 sec speedup: 3.135 - threads ( 2, 2): 4 time: 17.4668 sec speedup: 1.781 - threads ( 4, 1): 4 time: 8.1773 sec speedup: 3.804 - - threads ( 1, 8): 8 time: 5.7912 sec speedup: 5.371 - threads ( 2, 4): 8 time: 17.4747 sec speedup: 1.780 - threads ( 4, 2): 8 time: 9.1311 sec speedup: 3.406 - threads ( 8, 1): 8 time: 4.5637 sec speedup: 6.815 - - threads ( 1, 16): 16 time: 3.8917 sec speedup: 7.992 - threads ( 2, 8): 16 time: 17.6856 sec speedup: 1.759 - threads ( 4, 4): 16 time: 9.1148 sec speedup: 3.412 - threads ( 8, 2): 16 time: 5.0973 sec speedup: 6.102 - - threads ( 1, 32): 32 time: 3.5801 sec speedup: 8.688 - threads ( 2, 16): 32 time: 17.5796 sec speedup: 1.769 - threads ( 4, 8): 32 time: 9.1489 sec speedup: 3.400 - threads ( 8, 4): 32 time: 5.1116 sec speedup: 6.085 - -nmat 16 - - threads ( 1, 1): 1 time: 62.1321 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 36.2732 sec speedup: 1.713 - threads ( 2, 1): 2 time: 31.7772 sec speedup: 1.955 - - threads ( 1, 4): 4 time: 19.6319 sec speedup: 3.165 - threads ( 2, 2): 4 time: 34.9820 sec speedup: 1.776 - threads ( 4, 1): 4 time: 16.3540 sec speedup: 3.799 - - threads ( 1, 8): 8 time: 11.4431 sec speedup: 5.430 - threads ( 2, 4): 8 time: 34.9561 sec speedup: 1.777 - threads ( 4, 2): 8 time: 18.1864 sec speedup: 3.416 - threads ( 8, 1): 8 time: 8.9714 sec speedup: 6.926 - - threads ( 1, 16): 16 time: 8.0043 sec speedup: 7.762 - threads ( 2, 8): 16 time: 35.2678 sec speedup: 1.762 - threads ( 4, 4): 16 time: 18.2380 sec speedup: 3.407 - threads ( 8, 2): 16 time: 10.1349 sec speedup: 6.130 - threads ( 16, 1): 16 time: 5.5789 sec speedup: 11.137 - - threads ( 1, 32): 32 time: 7.1956 sec speedup: 8.635 - threads ( 2, 16): 32 time: 35.1221 sec speedup: 1.769 - threads ( 4, 8): 32 time: 18.3000 sec speedup: 3.395 - threads ( 8, 4): 32 time: 10.1149 sec speedup: 6.143 - threads ( 16, 2): 32 time: 6.4567 sec speedup: 9.623 - -nmat 32 - - threads ( 1, 1): 1 time: 124.3046 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 73.0840 sec speedup: 1.701 - threads ( 2, 1): 2 time: 63.2347 sec speedup: 1.966 - - threads ( 1, 4): 4 time: 39.3756 sec speedup: 3.157 - threads ( 2, 2): 4 time: 69.6552 sec speedup: 1.785 - threads ( 4, 1): 4 time: 32.6271 sec speedup: 3.810 - - threads ( 1, 8): 8 time: 22.5988 sec speedup: 5.500 - threads ( 2, 4): 8 time: 70.0136 sec speedup: 1.775 - threads ( 4, 2): 8 time: 36.2364 sec speedup: 3.430 - threads ( 8, 1): 8 time: 17.6730 sec speedup: 7.034 - - threads ( 1, 16): 16 time: 15.8866 sec speedup: 7.824 - threads ( 2, 8): 16 time: 70.3100 sec speedup: 1.768 - threads ( 4, 4): 16 time: 36.5352 sec speedup: 3.402 - threads ( 8, 2): 16 time: 20.2405 sec speedup: 6.141 - threads ( 16, 1): 16 time: 11.1634 sec speedup: 11.135 - - threads ( 1, 32): 32 time: 14.3147 sec speedup: 8.684 - threads ( 2, 16): 32 time: 70.3289 sec speedup: 1.767 - threads ( 4, 8): 32 time: 36.6753 sec speedup: 3.389 - threads ( 8, 4): 32 time: 20.1374 sec speedup: 6.173 - threads ( 16, 2): 32 time: 12.9747 sec speedup: 9.581 - threads ( 32, 1): 32 time: 9.1931 sec speedup: 13.521 - -nmat 64 - - threads ( 1, 1): 1 time: 248.3557 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 145.6142 sec speedup: 1.706 - threads ( 2, 1): 2 time: 126.2116 sec speedup: 1.968 - - threads ( 1, 4): 4 time: 79.2739 sec speedup: 3.133 - threads ( 2, 2): 4 time: 139.4324 sec speedup: 1.781 - threads ( 4, 1): 4 time: 64.7130 sec speedup: 3.838 - - threads ( 1, 8): 8 time: 45.2899 sec speedup: 5.484 - threads ( 2, 4): 8 time: 139.3560 sec speedup: 1.782 - threads ( 4, 2): 8 time: 72.8747 sec speedup: 3.408 - threads ( 8, 1): 8 time: 35.8676 sec speedup: 6.924 - - threads ( 1, 16): 16 time: 31.0142 sec speedup: 8.008 - threads ( 2, 8): 16 time: 140.4779 sec speedup: 1.768 - threads ( 4, 4): 16 time: 72.8727 sec speedup: 3.408 - threads ( 8, 2): 16 time: 40.3175 sec speedup: 6.160 - threads ( 16, 1): 16 time: 21.7651 sec speedup: 11.411 - - threads ( 1, 32): 32 time: 28.6471 sec speedup: 8.669 - threads ( 2, 16): 32 time: 140.2951 sec speedup: 1.770 - threads ( 4, 8): 32 time: 72.8835 sec speedup: 3.408 - threads ( 8, 4): 32 time: 40.4137 sec speedup: 6.145 - threads ( 16, 2): 32 time: 25.8655 sec speedup: 9.602 - threads ( 32, 1): 32 time: 17.4474 sec speedup: 14.235 - - --------------------------------------------------------------------------------- -hypersparse: with icx 2022.0.1 and libiomp5 --------------------------------------------------------------------------------- - -hypersparse $ ./build/context_demo -context demo: nthreads_max 40 - - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 40 - Context.chunk: 65536 - -nthreads to use: 32 - -nmat 1 - - threads ( 1, 1): 1 time: 3.8905 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 2.2030 sec speedup: 1.766 - - threads ( 1, 4): 4 time: 1.1783 sec speedup: 3.302 - - threads ( 1, 8): 8 time: 0.6758 sec speedup: 5.757 - - threads ( 1, 16): 16 time: 0.4814 sec speedup: 8.082 - - threads ( 1, 32): 32 time: 0.4780 sec speedup: 8.139 - -nmat 2 - - threads ( 1, 1): 1 time: 7.8132 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 4.4651 sec speedup: 1.750 - threads ( 2, 1): 2 time: 3.9744 sec speedup: 1.966 - - threads ( 1, 4): 4 time: 2.4026 sec speedup: 3.252 - threads ( 2, 2): 4 time: 2.2750 sec speedup: 3.434 - - threads ( 1, 8): 8 time: 1.3562 sec speedup: 5.761 - threads ( 2, 4): 8 time: 1.2635 sec speedup: 6.184 - - threads ( 1, 16): 16 time: 0.9322 sec speedup: 8.382 - threads ( 2, 8): 16 time: 0.8537 sec speedup: 9.152 - - threads ( 1, 32): 32 time: 0.9381 sec speedup: 8.329 - threads ( 2, 16): 32 time: 0.8465 sec speedup: 9.230 - -nmat 4 - - threads ( 1, 1): 1 time: 15.5757 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 8.8440 sec speedup: 1.761 - threads ( 2, 1): 2 time: 7.9109 sec speedup: 1.969 - - threads ( 1, 4): 4 time: 4.7781 sec speedup: 3.260 - threads ( 2, 2): 4 time: 4.4955 sec speedup: 3.465 - threads ( 4, 1): 4 time: 4.1167 sec speedup: 3.784 - - threads ( 1, 8): 8 time: 2.6736 sec speedup: 5.826 - threads ( 2, 4): 8 time: 2.4870 sec speedup: 6.263 - threads ( 4, 2): 8 time: 2.5131 sec speedup: 6.198 - - threads ( 1, 16): 16 time: 1.8047 sec speedup: 8.631 - threads ( 2, 8): 16 time: 1.6818 sec speedup: 9.261 - threads ( 4, 4): 16 time: 1.6380 sec speedup: 9.509 - - threads ( 1, 32): 32 time: 1.6567 sec speedup: 9.402 - threads ( 2, 16): 32 time: 1.5215 sec speedup: 10.237 - threads ( 4, 8): 32 time: 1.5564 sec speedup: 10.008 - -nmat 8 - - threads ( 1, 1): 1 time: 31.1358 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 17.5252 sec speedup: 1.777 - threads ( 2, 1): 2 time: 15.8409 sec speedup: 1.966 - - threads ( 1, 4): 4 time: 9.3545 sec speedup: 3.328 - threads ( 2, 2): 4 time: 9.0323 sec speedup: 3.447 - threads ( 4, 1): 4 time: 8.2265 sec speedup: 3.785 - - threads ( 1, 8): 8 time: 5.3005 sec speedup: 5.874 - threads ( 2, 4): 8 time: 4.9717 sec speedup: 6.263 - threads ( 4, 2): 8 time: 5.0492 sec speedup: 6.166 - threads ( 8, 1): 8 time: 4.6251 sec speedup: 6.732 +context demo: nthreads_max 32 - threads ( 1, 16): 16 time: 3.6023 sec speedup: 8.643 - threads ( 2, 8): 16 time: 3.3817 sec speedup: 9.207 - threads ( 4, 4): 16 time: 3.3087 sec speedup: 9.410 - threads ( 8, 2): 16 time: 3.2689 sec speedup: 9.525 - - threads ( 1, 32): 32 time: 3.3048 sec speedup: 9.421 - threads ( 2, 16): 32 time: 3.0974 sec speedup: 10.052 - threads ( 4, 8): 32 time: 2.9611 sec speedup: 10.515 - threads ( 8, 4): 32 time: 2.8225 sec speedup: 11.031 - -nmat 16 - - threads ( 1, 1): 1 time: 62.1888 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 35.0187 sec speedup: 1.776 - threads ( 2, 1): 2 time: 31.6794 sec speedup: 1.963 - - threads ( 1, 4): 4 time: 18.3706 sec speedup: 3.385 - threads ( 2, 2): 4 time: 18.0797 sec speedup: 3.440 - threads ( 4, 1): 4 time: 16.2714 sec speedup: 3.822 - - threads ( 1, 8): 8 time: 10.3597 sec speedup: 6.003 - threads ( 2, 4): 8 time: 9.9368 sec speedup: 6.258 - threads ( 4, 2): 8 time: 9.9705 sec speedup: 6.237 - threads ( 8, 1): 8 time: 9.0520 sec speedup: 6.870 - - threads ( 1, 16): 16 time: 7.1725 sec speedup: 8.670 - threads ( 2, 8): 16 time: 6.8258 sec speedup: 9.111 - threads ( 4, 4): 16 time: 6.4323 sec speedup: 9.668 - threads ( 8, 2): 16 time: 6.3995 sec speedup: 9.718 - threads ( 16, 1): 16 time: 5.5975 sec speedup: 11.110 - - threads ( 1, 32): 32 time: 7.4021 sec speedup: 8.401 - threads ( 2, 16): 32 time: 6.5864 sec speedup: 9.442 - threads ( 4, 8): 32 time: 5.9699 sec speedup: 10.417 - threads ( 8, 4): 32 time: 5.5479 sec speedup: 11.209 - threads ( 16, 2): 32 time: 5.1339 sec speedup: 12.113 - -nmat 32 - - threads ( 1, 1): 1 time: 124.5053 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 70.0750 sec speedup: 1.777 - threads ( 2, 1): 2 time: 63.4149 sec speedup: 1.963 - - threads ( 1, 4): 4 time: 37.3717 sec speedup: 3.332 - threads ( 2, 2): 4 time: 36.1395 sec speedup: 3.445 - threads ( 4, 1): 4 time: 32.6771 sec speedup: 3.810 - - threads ( 1, 8): 8 time: 21.1201 sec speedup: 5.895 - threads ( 2, 4): 8 time: 20.0948 sec speedup: 6.196 - threads ( 4, 2): 8 time: 20.0478 sec speedup: 6.210 - threads ( 8, 1): 8 time: 17.9685 sec speedup: 6.929 - - threads ( 1, 16): 16 time: 14.6100 sec speedup: 8.522 - threads ( 2, 8): 16 time: 13.5692 sec speedup: 9.176 - threads ( 4, 4): 16 time: 13.0394 sec speedup: 9.548 - threads ( 8, 2): 16 time: 12.8218 sec speedup: 9.710 - threads ( 16, 1): 16 time: 11.1682 sec speedup: 11.148 - - threads ( 1, 32): 32 time: 13.9816 sec speedup: 8.905 - threads ( 2, 16): 32 time: 13.4097 sec speedup: 9.285 - threads ( 4, 8): 32 time: 12.4585 sec speedup: 9.994 - threads ( 8, 4): 32 time: 11.3059 sec speedup: 11.012 - threads ( 16, 2): 32 time: 10.2970 sec speedup: 12.091 - threads ( 32, 1): 32 time: 9.1403 sec speedup: 13.622 - -nmat 64 - - threads ( 1, 1): 1 time: 249.5680 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 140.8343 sec speedup: 1.772 - threads ( 2, 1): 2 time: 126.9077 sec speedup: 1.967 - - threads ( 1, 4): 4 time: 74.5298 sec speedup: 3.349 - threads ( 2, 2): 4 time: 72.8017 sec speedup: 3.428 - threads ( 4, 1): 4 time: 65.1886 sec speedup: 3.828 - - threads ( 1, 8): 8 time: 42.3061 sec speedup: 5.899 - threads ( 2, 4): 8 time: 39.9543 sec speedup: 6.246 - threads ( 4, 2): 8 time: 40.1495 sec speedup: 6.216 - threads ( 8, 1): 8 time: 35.8008 sec speedup: 6.971 - - threads ( 1, 16): 16 time: 29.1442 sec speedup: 8.563 - threads ( 2, 8): 16 time: 27.3748 sec speedup: 9.117 - threads ( 4, 4): 16 time: 26.1547 sec speedup: 9.542 - threads ( 8, 2): 16 time: 25.7551 sec speedup: 9.690 - threads ( 16, 1): 16 time: 21.9241 sec speedup: 11.383 - - threads ( 1, 32): 32 time: 30.4074 sec speedup: 8.207 - threads ( 2, 16): 32 time: 26.5007 sec speedup: 9.417 - threads ( 4, 8): 32 time: 24.5964 sec speedup: 10.147 - threads ( 8, 4): 32 time: 22.7695 sec speedup: 10.961 - threads ( 16, 2): 32 time: 19.7543 sec speedup: 12.634 - threads ( 32, 1): 32 time: 17.5195 sec speedup: 14.245 - - --------------------------------------------------------------------------------- -M1 MacBook Air 2020 with gcc 12 and libgomp (Apple Silicon, native gcc-12) --------------------------------------------------------------------------------- - -8 hardware cores (4 performance, 4 efficiency cores). To build 16 matrices, -each the same size as done on hypersparse, no problems with mixing levels -of parallelism. - - M1 MacBook Air: - threads ( 1, 1): 1 time: 35.7127 sec speedup: 1.000 - ... - threads ( 1, 8): 8 time: 9.3390 sec speedup: 3.824 - threads ( 2, 4): 8 time: 8.9232 sec speedup: 4.002 - threads ( 4, 2): 8 time: 8.7156 sec speedup: 4.098 - threads ( 8, 1): 8 time: 8.4503 sec speedup: 4.226 - - Compare the same on hypersparse with 8 threads, 16 matrices, gcc and - libgomp, where 1 thread takes 62.1 seconds: - threads ( 1, 1): 1 time: 62.1321 sec speedup: 1.000 - ... - threads ( 1, 8): 8 time: 11.4431 sec speedup: 5.430 - threads ( 2, 4): 8 time: 34.9561 sec speedup: 1.777 <=== Yikes! - threads ( 4, 2): 8 time: 18.1864 sec speedup: 3.416 <=== Yikes! - threads ( 8, 1): 8 time: 8.9714 sec speedup: 6.926 - - hypersparse with icx 2022.0.1, libiomp, 8 threads, 16 matrices: - threads ( 1, 8): 8 time: 10.3597 sec speedup: 6.003 - threads ( 2, 4): 8 time: 9.9368 sec speedup: 6.258 - threads ( 4, 2): 8 time: 9.9705 sec speedup: 6.237 - threads ( 8, 1): 8 time: 9.0520 sec speedup: 6.870 - - The problem with multiple levels of parallelism is fixed with gcc 12.2.0: - hypersparse with gcc 12.2.0, libgomp, 8 threads, 16 matrices: - threads ( 1, 8): 8 time: 12.0057 sec speedup: 5.349 - threads ( 2, 4): 8 time: 10.8107 sec speedup: 5.940 <== ok!! - threads ( 4, 2): 8 time: 10.5337 sec speedup: 6.096 - threads ( 8, 1): 8 time: 9.1881 sec speedup: 6.989 - ---- raw output for M1: - -context demo: nthreads_max 8 - - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 8 - Context.chunk: 65536 - -nthreads to use: 8 - -nmat 1 - - threads ( 1, 1): 1 time: 2.2089 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 1.2219 sec speedup: 1.808 - - threads ( 1, 4): 4 time: 0.6950 sec speedup: 3.178 - - threads ( 1, 8): 8 time: 0.5525 sec speedup: 3.998 - -nmat 2 - - threads ( 1, 1): 1 time: 4.4538 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 2.4518 sec speedup: 1.817 - threads ( 2, 1): 2 time: 2.3159 sec speedup: 1.923 - - threads ( 1, 4): 4 time: 1.3959 sec speedup: 3.191 - threads ( 2, 2): 4 time: 1.3442 sec speedup: 3.313 - - threads ( 1, 8): 8 time: 1.1034 sec speedup: 4.036 - threads ( 2, 4): 8 time: 1.0427 sec speedup: 4.272 - -nmat 4 - - threads ( 1, 1): 1 time: 8.8785 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 4.9046 sec speedup: 1.810 - threads ( 2, 1): 2 time: 4.6403 sec speedup: 1.913 - - threads ( 1, 4): 4 time: 2.8856 sec speedup: 3.077 - threads ( 2, 2): 4 time: 2.8852 sec speedup: 3.077 - threads ( 4, 1): 4 time: 2.7526 sec speedup: 3.226 - - threads ( 1, 8): 8 time: 2.2838 sec speedup: 3.888 - threads ( 2, 4): 8 time: 2.1707 sec speedup: 4.090 - threads ( 4, 2): 8 time: 2.1069 sec speedup: 4.214 - -nmat 8 - - threads ( 1, 1): 1 time: 17.7896 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 9.8192 sec speedup: 1.812 - threads ( 2, 1): 2 time: 9.3465 sec speedup: 1.903 - - threads ( 1, 4): 4 time: 5.8638 sec speedup: 3.034 - threads ( 2, 2): 4 time: 5.9525 sec speedup: 2.989 - threads ( 4, 1): 4 time: 5.6684 sec speedup: 3.138 - - threads ( 1, 8): 8 time: 4.6066 sec speedup: 3.862 - threads ( 2, 4): 8 time: 4.3528 sec speedup: 4.087 - threads ( 4, 2): 8 time: 4.3088 sec speedup: 4.129 - threads ( 8, 1): 8 time: 4.3591 sec speedup: 4.081 - -nmat 16 - - threads ( 1, 1): 1 time: 35.7127 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 19.7688 sec speedup: 1.807 - threads ( 2, 1): 2 time: 18.7420 sec speedup: 1.905 - - threads ( 1, 4): 4 time: 11.9527 sec speedup: 2.988 - threads ( 2, 2): 4 time: 12.1196 sec speedup: 2.947 - threads ( 4, 1): 4 time: 11.4622 sec speedup: 3.116 - - threads ( 1, 8): 8 time: 9.3390 sec speedup: 3.824 - threads ( 2, 4): 8 time: 8.9232 sec speedup: 4.002 - threads ( 4, 2): 8 time: 8.7156 sec speedup: 4.098 - threads ( 8, 1): 8 time: 8.4503 sec speedup: 4.226 - - --------------------------------------------------------------------------------- -slash: Dell laptop, Ubuntu 18.04, Intel Core i7-8565U CPU @ 1.80GHz --------------------------------------------------------------------------------- - -with gcc 11.2.0 and libgomp: performance is modest but uniform. -4 cores, 8 threads max. - ---- raw output: - -context demo: nthreads_max 8 - - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 8 - Context.chunk: 65536 - -nthreads to use: 8 - -nmat 1 - - threads ( 1, 1): 1 time: 3.3253 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 2.0142 sec speedup: 1.651 - - threads ( 1, 4): 4 time: 1.2565 sec speedup: 2.647 - - threads ( 1, 8): 8 time: 1.1699 sec speedup: 2.842 - -nmat 2 - - threads ( 1, 1): 1 time: 6.7556 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 4.1288 sec speedup: 1.636 - threads ( 2, 1): 2 time: 4.0819 sec speedup: 1.655 - - threads ( 1, 4): 4 time: 3.0058 sec speedup: 2.248 - threads ( 2, 2): 4 time: 3.1214 sec speedup: 2.164 - - threads ( 1, 8): 8 time: 2.5679 sec speedup: 2.631 - threads ( 2, 4): 8 time: 2.5633 sec speedup: 2.636 - -nmat 4 - - threads ( 1, 1): 1 time: 13.2450 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 8.9054 sec speedup: 1.487 - threads ( 2, 1): 2 time: 8.2617 sec speedup: 1.603 - - threads ( 1, 4): 4 time: 6.2032 sec speedup: 2.135 - threads ( 2, 2): 4 time: 6.1049 sec speedup: 2.170 - threads ( 4, 1): 4 time: 5.4404 sec speedup: 2.435 - - threads ( 1, 8): 8 time: 5.0979 sec speedup: 2.598 - threads ( 2, 4): 8 time: 4.9381 sec speedup: 2.682 - threads ( 4, 2): 8 time: 5.0856 sec speedup: 2.604 - -nmat 8 - - threads ( 1, 1): 1 time: 26.3780 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 18.0355 sec speedup: 1.463 - threads ( 2, 1): 2 time: 16.5057 sec speedup: 1.598 - - threads ( 1, 4): 4 time: 12.3503 sec speedup: 2.136 - threads ( 2, 2): 4 time: 12.1201 sec speedup: 2.176 - threads ( 4, 1): 4 time: 10.8411 sec speedup: 2.433 - - threads ( 1, 8): 8 time: 10.2767 sec speedup: 2.567 - threads ( 2, 4): 8 time: 9.9508 sec speedup: 2.651 - threads ( 4, 2): 8 time: 9.7275 sec speedup: 2.712 - threads ( 8, 1): 8 time: 9.2212 sec speedup: 2.861 - -nmat 16 - - threads ( 1, 1): 1 time: 52.6915 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 36.1360 sec speedup: 1.458 - threads ( 2, 1): 2 time: 32.6665 sec speedup: 1.613 - - threads ( 1, 4): 4 time: 24.8339 sec speedup: 2.122 - threads ( 2, 2): 4 time: 24.2778 sec speedup: 2.170 - threads ( 4, 1): 4 time: 22.3687 sec speedup: 2.356 - - threads ( 1, 8): 8 time: 21.3673 sec speedup: 2.466 - threads ( 2, 4): 8 time: 19.9309 sec speedup: 2.644 - threads ( 4, 2): 8 time: 19.9392 sec speedup: 2.643 - threads ( 8, 1): 8 time: 17.7655 sec speedup: 2.966 - - --------------------------------------------------------------------------------- -hypersparse: with gcc 12.2.0 and its included libgomp (OpenMP 4.5) --------------------------------------------------------------------------------- - -This version of gcc solves the problem of multi-level parallelism in gcc 9.4.0. - -context demo: nthreads_max 40 - - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 40 + GraphBLAS Context: World + Context.nthreads: 32 Context.chunk: 65536 nthreads to use: 32 nmat 1 - threads ( 1, 1): 1 time: 3.9834 sec speedup: 1.000 + threads ( 1, 1): 1 time: 1.8872 sec speedup: 1.000 - threads ( 1, 2): 2 time: 2.4229 sec speedup: 1.644 + threads ( 1, 2): 2 time: 1.1648 sec speedup: 1.620 - threads ( 1, 4): 4 time: 1.3031 sec speedup: 3.057 + threads ( 1, 4): 4 time: 0.6206 sec speedup: 3.041 - threads ( 1, 8): 8 time: 0.7562 sec speedup: 5.268 + threads ( 1, 8): 8 time: 0.4050 sec speedup: 4.659 - threads ( 1, 16): 16 time: 0.5288 sec speedup: 7.532 + threads ( 1, 16): 16 time: 0.3003 sec speedup: 6.284 - threads ( 1, 32): 32 time: 0.4611 sec speedup: 8.638 + threads ( 1, 32): 32 time: 0.2695 sec speedup: 7.002 nmat 2 - threads ( 1, 1): 1 time: 8.0220 sec speedup: 1.000 + threads ( 1, 1): 1 time: 3.8363 sec speedup: 1.000 - threads ( 1, 2): 2 time: 4.7192 sec speedup: 1.700 - threads ( 2, 1): 2 time: 4.0965 sec speedup: 1.958 + threads ( 1, 2): 2 time: 2.2758 sec speedup: 1.686 + threads ( 2, 1): 2 time: 1.9078 sec speedup: 2.011 - threads ( 1, 4): 4 time: 2.5687 sec speedup: 3.123 - threads ( 2, 2): 4 time: 2.4592 sec speedup: 3.262 + threads ( 1, 4): 4 time: 1.2567 sec speedup: 3.053 + threads ( 2, 2): 4 time: 1.2209 sec speedup: 3.142 - threads ( 1, 8): 8 time: 1.5153 sec speedup: 5.294 - threads ( 2, 4): 8 time: 1.3770 sec speedup: 5.826 + threads ( 1, 8): 8 time: 0.8167 sec speedup: 4.697 + threads ( 2, 4): 8 time: 0.7064 sec speedup: 5.431 - threads ( 1, 16): 16 time: 1.0313 sec speedup: 7.779 - threads ( 2, 8): 16 time: 0.9264 sec speedup: 8.660 + threads ( 1, 16): 16 time: 0.6008 sec speedup: 6.385 + threads ( 2, 8): 16 time: 0.5364 sec speedup: 7.151 - threads ( 1, 32): 32 time: 0.9156 sec speedup: 8.762 - threads ( 2, 16): 32 time: 0.8146 sec speedup: 9.848 + threads ( 1, 32): 32 time: 0.5385 sec speedup: 7.125 + threads ( 2, 16): 32 time: 0.4709 sec speedup: 8.146 nmat 4 - threads ( 1, 1): 1 time: 16.0394 sec speedup: 1.000 + threads ( 1, 1): 1 time: 7.5279 sec speedup: 1.000 - threads ( 1, 2): 2 time: 9.4169 sec speedup: 1.703 - threads ( 2, 1): 2 time: 8.2035 sec speedup: 1.955 + threads ( 1, 2): 2 time: 4.6509 sec speedup: 1.619 + threads ( 2, 1): 2 time: 3.8123 sec speedup: 1.975 - threads ( 1, 4): 4 time: 5.3124 sec speedup: 3.019 - threads ( 2, 2): 4 time: 4.8021 sec speedup: 3.340 - threads ( 4, 1): 4 time: 4.2197 sec speedup: 3.801 + threads ( 1, 4): 4 time: 2.5009 sec speedup: 3.010 + threads ( 2, 2): 4 time: 2.2907 sec speedup: 3.286 + threads ( 4, 1): 4 time: 2.0223 sec speedup: 3.722 - threads ( 1, 8): 8 time: 2.9796 sec speedup: 5.383 - threads ( 2, 4): 8 time: 2.7875 sec speedup: 5.754 - threads ( 4, 2): 8 time: 2.6475 sec speedup: 6.058 + threads ( 1, 8): 8 time: 1.6284 sec speedup: 4.623 + threads ( 2, 4): 8 time: 1.3979 sec speedup: 5.385 + threads ( 4, 2): 8 time: 1.2717 sec speedup: 5.920 - threads ( 1, 16): 16 time: 2.0298 sec speedup: 7.902 - threads ( 2, 8): 16 time: 1.8748 sec speedup: 8.555 - threads ( 4, 4): 16 time: 1.7275 sec speedup: 9.285 + threads ( 1, 16): 16 time: 1.1974 sec speedup: 6.287 + threads ( 2, 8): 16 time: 1.0761 sec speedup: 6.996 + threads ( 4, 4): 16 time: 1.0082 sec speedup: 7.467 - threads ( 1, 32): 32 time: 1.8263 sec speedup: 8.783 - threads ( 2, 16): 32 time: 1.6332 sec speedup: 9.821 - threads ( 4, 8): 32 time: 1.5398 sec speedup: 10.417 + threads ( 1, 32): 32 time: 1.0969 sec speedup: 6.863 + threads ( 2, 16): 32 time: 0.9691 sec speedup: 7.768 + threads ( 4, 8): 32 time: 0.8739 sec speedup: 8.615 nmat 8 - threads ( 1, 1): 1 time: 32.0759 sec speedup: 1.000 + threads ( 1, 1): 1 time: 15.1258 sec speedup: 1.000 - threads ( 1, 2): 2 time: 18.8857 sec speedup: 1.698 - threads ( 2, 1): 2 time: 16.3029 sec speedup: 1.967 + threads ( 1, 2): 2 time: 9.0710 sec speedup: 1.667 + threads ( 2, 1): 2 time: 7.6391 sec speedup: 1.980 - threads ( 1, 4): 4 time: 10.3060 sec speedup: 3.112 - threads ( 2, 2): 4 time: 9.6810 sec speedup: 3.313 - threads ( 4, 1): 4 time: 8.4811 sec speedup: 3.782 + threads ( 1, 4): 4 time: 4.9519 sec speedup: 3.055 + threads ( 2, 2): 4 time: 4.7943 sec speedup: 3.155 + threads ( 4, 1): 4 time: 3.9578 sec speedup: 3.822 - threads ( 1, 8): 8 time: 5.9792 sec speedup: 5.365 - threads ( 2, 4): 8 time: 5.4837 sec speedup: 5.849 - threads ( 4, 2): 8 time: 5.3044 sec speedup: 6.047 - threads ( 8, 1): 8 time: 4.7044 sec speedup: 6.818 + threads ( 1, 8): 8 time: 3.2406 sec speedup: 4.668 + threads ( 2, 4): 8 time: 2.7872 sec speedup: 5.427 + threads ( 4, 2): 8 time: 2.6267 sec speedup: 5.758 + threads ( 8, 1): 8 time: 2.2365 sec speedup: 6.763 - threads ( 1, 16): 16 time: 4.0890 sec speedup: 7.845 - threads ( 2, 8): 16 time: 3.7140 sec speedup: 8.636 - threads ( 4, 4): 16 time: 3.3708 sec speedup: 9.516 - threads ( 8, 2): 16 time: 3.3925 sec speedup: 9.455 + threads ( 1, 16): 16 time: 2.4299 sec speedup: 6.225 + threads ( 2, 8): 16 time: 2.1736 sec speedup: 6.959 + threads ( 4, 4): 16 time: 1.9760 sec speedup: 7.655 + threads ( 8, 2): 16 time: 1.8013 sec speedup: 8.397 - threads ( 1, 32): 32 time: 3.6523 sec speedup: 8.782 - threads ( 2, 16): 32 time: 3.2289 sec speedup: 9.934 - threads ( 4, 8): 32 time: 3.0341 sec speedup: 10.572 - threads ( 8, 4): 32 time: 2.8246 sec speedup: 11.356 + threads ( 1, 32): 32 time: 2.2446 sec speedup: 6.739 + threads ( 2, 16): 32 time: 1.8530 sec speedup: 8.163 + threads ( 4, 8): 32 time: 1.8092 sec speedup: 8.361 + threads ( 8, 4): 32 time: 1.6111 sec speedup: 9.389 nmat 16 - threads ( 1, 1): 1 time: 64.2177 sec speedup: 1.000 + threads ( 1, 1): 1 time: 30.1287 sec speedup: 1.000 - threads ( 1, 2): 2 time: 37.9504 sec speedup: 1.692 - threads ( 2, 1): 2 time: 32.4998 sec speedup: 1.976 + threads ( 1, 2): 2 time: 18.4422 sec speedup: 1.634 + threads ( 2, 1): 2 time: 15.2398 sec speedup: 1.977 - threads ( 1, 4): 4 time: 20.2811 sec speedup: 3.166 - threads ( 2, 2): 4 time: 19.4124 sec speedup: 3.308 - threads ( 4, 1): 4 time: 16.8301 sec speedup: 3.816 + threads ( 1, 4): 4 time: 10.0832 sec speedup: 2.988 + threads ( 2, 2): 4 time: 9.3758 sec speedup: 3.213 + threads ( 4, 1): 4 time: 7.8656 sec speedup: 3.830 - threads ( 1, 8): 8 time: 12.0057 sec speedup: 5.349 - threads ( 2, 4): 8 time: 10.8107 sec speedup: 5.940 - threads ( 4, 2): 8 time: 10.5337 sec speedup: 6.096 - threads ( 8, 1): 8 time: 9.1881 sec speedup: 6.989 + threads ( 1, 8): 8 time: 6.5859 sec speedup: 4.575 + threads ( 2, 4): 8 time: 5.5956 sec speedup: 5.384 + threads ( 4, 2): 8 time: 5.0997 sec speedup: 5.908 + threads ( 8, 1): 8 time: 4.4455 sec speedup: 6.777 - threads ( 1, 16): 16 time: 8.0647 sec speedup: 7.963 - threads ( 2, 8): 16 time: 7.4993 sec speedup: 8.563 - threads ( 4, 4): 16 time: 6.8535 sec speedup: 9.370 - threads ( 8, 2): 16 time: 6.6811 sec speedup: 9.612 - threads ( 16, 1): 16 time: 5.7370 sec speedup: 11.194 + threads ( 1, 16): 16 time: 4.9009 sec speedup: 6.148 + threads ( 2, 8): 16 time: 4.1517 sec speedup: 7.257 + threads ( 4, 4): 16 time: 3.8824 sec speedup: 7.760 + threads ( 8, 2): 16 time: 3.4861 sec speedup: 8.642 + threads ( 16, 1): 16 time: 3.1729 sec speedup: 9.496 - threads ( 1, 32): 32 time: 7.3062 sec speedup: 8.790 - threads ( 2, 16): 32 time: 6.3202 sec speedup: 10.161 - threads ( 4, 8): 32 time: 6.0907 sec speedup: 10.544 - threads ( 8, 4): 32 time: 5.5732 sec speedup: 11.523 - threads ( 16, 2): 32 time: 5.3226 sec speedup: 12.065 + threads ( 1, 32): 32 time: 4.5256 sec speedup: 6.657 + threads ( 2, 16): 32 time: 3.7821 sec speedup: 7.966 + threads ( 4, 8): 32 time: 3.5929 sec speedup: 8.386 + threads ( 8, 4): 32 time: 3.2492 sec speedup: 9.273 + threads ( 16, 2): 32 time: 3.0619 sec speedup: 9.840 nmat 32 - threads ( 1, 1): 1 time: 127.8109 sec speedup: 1.000 + threads ( 1, 1): 1 time: 60.2346 sec speedup: 1.000 - threads ( 1, 2): 2 time: 75.8122 sec speedup: 1.686 - threads ( 2, 1): 2 time: 64.9549 sec speedup: 1.968 + threads ( 1, 2): 2 time: 36.8352 sec speedup: 1.635 + threads ( 2, 1): 2 time: 30.4048 sec speedup: 1.981 - threads ( 1, 4): 4 time: 40.5789 sec speedup: 3.150 - threads ( 2, 2): 4 time: 38.6125 sec speedup: 3.310 - threads ( 4, 1): 4 time: 33.4299 sec speedup: 3.823 + threads ( 1, 4): 4 time: 20.1776 sec speedup: 2.985 + threads ( 2, 2): 4 time: 19.1438 sec speedup: 3.146 + threads ( 4, 1): 4 time: 15.7468 sec speedup: 3.825 - threads ( 1, 8): 8 time: 23.7604 sec speedup: 5.379 - threads ( 2, 4): 8 time: 21.8153 sec speedup: 5.859 - threads ( 4, 2): 8 time: 21.0691 sec speedup: 6.066 - threads ( 8, 1): 8 time: 18.5383 sec speedup: 6.894 + threads ( 1, 8): 8 time: 13.0692 sec speedup: 4.609 + threads ( 2, 4): 8 time: 11.3337 sec speedup: 5.315 + threads ( 4, 2): 8 time: 10.2462 sec speedup: 5.879 + threads ( 8, 1): 8 time: 8.6603 sec speedup: 6.955 - threads ( 1, 16): 16 time: 16.3755 sec speedup: 7.805 - threads ( 2, 8): 16 time: 14.8211 sec speedup: 8.624 - threads ( 4, 4): 16 time: 13.5300 sec speedup: 9.446 - threads ( 8, 2): 16 time: 13.2544 sec speedup: 9.643 - threads ( 16, 1): 16 time: 11.2225 sec speedup: 11.389 + threads ( 1, 16): 16 time: 9.7062 sec speedup: 6.206 + threads ( 2, 8): 16 time: 8.6990 sec speedup: 6.924 + threads ( 4, 4): 16 time: 7.7606 sec speedup: 7.762 + threads ( 8, 2): 16 time: 6.9603 sec speedup: 8.654 + threads ( 16, 1): 16 time: 6.5332 sec speedup: 9.220 - threads ( 1, 32): 32 time: 14.6022 sec speedup: 8.753 - threads ( 2, 16): 32 time: 12.8340 sec speedup: 9.959 - threads ( 4, 8): 32 time: 11.9942 sec speedup: 10.656 - threads ( 8, 4): 32 time: 11.3262 sec speedup: 11.285 - threads ( 16, 2): 32 time: 10.4357 sec speedup: 12.247 - threads ( 32, 1): 32 time: 9.1102 sec speedup: 14.029 + threads ( 1, 32): 32 time: 9.0971 sec speedup: 6.621 + threads ( 2, 16): 32 time: 7.4761 sec speedup: 8.057 + threads ( 4, 8): 32 time: 7.0028 sec speedup: 8.601 + threads ( 8, 4): 32 time: 6.3830 sec speedup: 9.437 + threads ( 16, 2): 32 time: 5.9026 sec speedup: 10.205 + threads ( 32, 1): 32 time: 5.2373 sec speedup: 11.501 nmat 64 - threads ( 1, 1): 1 time: 256.8161 sec speedup: 1.000 - - threads ( 1, 2): 2 time: 150.4740 sec speedup: 1.707 - threads ( 2, 1): 2 time: 130.3654 sec speedup: 1.970 + threads ( 1, 1): 1 time: 120.4971 sec speedup: 1.000 - threads ( 1, 4): 4 time: 81.6405 sec speedup: 3.146 - threads ( 2, 2): 4 time: 77.1502 sec speedup: 3.329 - threads ( 4, 1): 4 time: 67.0037 sec speedup: 3.833 + threads ( 1, 2): 2 time: 74.6771 sec speedup: 1.614 + threads ( 2, 1): 2 time: 60.7731 sec speedup: 1.983 - threads ( 1, 8): 8 time: 47.5249 sec speedup: 5.404 - threads ( 2, 4): 8 time: 42.9851 sec speedup: 5.975 - threads ( 4, 2): 8 time: 42.0289 sec speedup: 6.110 - threads ( 8, 1): 8 time: 37.0242 sec speedup: 6.936 + threads ( 1, 4): 4 time: 40.8018 sec speedup: 2.953 + threads ( 2, 2): 4 time: 38.1307 sec speedup: 3.160 + threads ( 4, 1): 4 time: 31.5319 sec speedup: 3.821 - threads ( 1, 16): 16 time: 32.1680 sec speedup: 7.984 - threads ( 2, 8): 16 time: 29.8900 sec speedup: 8.592 - threads ( 4, 4): 16 time: 27.0722 sec speedup: 9.486 - threads ( 8, 2): 16 time: 26.4113 sec speedup: 9.724 - threads ( 16, 1): 16 time: 22.0254 sec speedup: 11.660 + threads ( 1, 8): 8 time: 26.2851 sec speedup: 4.584 + threads ( 2, 4): 8 time: 22.2293 sec speedup: 5.421 + threads ( 4, 2): 8 time: 20.2981 sec speedup: 5.936 + threads ( 8, 1): 8 time: 17.2022 sec speedup: 7.005 - threads ( 1, 32): 32 time: 29.2369 sec speedup: 8.784 - threads ( 2, 16): 32 time: 25.6922 sec speedup: 9.996 - threads ( 4, 8): 32 time: 24.2922 sec speedup: 10.572 - threads ( 8, 4): 32 time: 22.4136 sec speedup: 11.458 - threads ( 16, 2): 32 time: 20.2493 sec speedup: 12.683 - threads ( 32, 1): 32 time: 17.5978 sec speedup: 14.594 + threads ( 1, 16): 16 time: 19.3734 sec speedup: 6.220 + threads ( 2, 8): 16 time: 17.1528 sec speedup: 7.025 + threads ( 4, 4): 16 time: 15.2618 sec speedup: 7.895 + threads ( 8, 2): 16 time: 13.8422 sec speedup: 8.705 + threads ( 16, 1): 16 time: 12.3033 sec speedup: 9.794 + threads ( 1, 32): 32 time: 17.9717 sec speedup: 6.705 + threads ( 2, 16): 32 time: 15.1003 sec speedup: 7.980 + threads ( 4, 8): 32 time: 14.6149 sec speedup: 8.245 + threads ( 8, 4): 32 time: 12.6766 sec speedup: 9.505 + threads ( 16, 2): 32 time: 11.6014 sec speedup: 10.386 + threads ( 32, 1): 32 time: 10.5020 sec speedup: 11.474 diff --git a/GraphBLAS/Demo/Output/gauss_demo.out b/GraphBLAS/Demo/Output/gauss_demo.out index f6afbec372..335cb3a001 100644 --- a/GraphBLAS/Demo/Output/gauss_demo.out +++ b/GraphBLAS/Demo/Output/gauss_demo.out @@ -3,15 +3,15 @@ not matrix (conjugate) transposes. GraphBLAS Context: World - Context.nthreads: 40 + Context.nthreads: 32 Context.chunk: 65536 JIT configuration: ------------------ -JIT C compiler: [/usr/bin/cc] -JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC ] +JIT C compiler: [/usr/bin/gcc] +JIT C flags: [ -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp] JIT C link flags: [ -shared ] JIT C libraries: [ -lm -ldl -lgomp -lpthread] JIT C preface: [] -JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB9.0.0] +JIT cache: [/home/davis/.SuiteSparse/GrB10.0.0] JIT C control: [4] JIT C control: [4] reset ------------------------------------- @@ -20,110 +20,138 @@ JIT C preface (revised): // kernel generated by gauss_demo.c #include - [ GxB_Type_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GxB_Type_new (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/b4/GB_jit__user_type__0__gauss.c.o [100%] Linking C shared library libGB_jit__user_type__0__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.617 sec ] - GraphBLAS type: BadGauss user-defined: [gauss] size: 4 + 0.381 sec ] + GraphBLAS Type: BadGauss user-defined: [gauss] size: 4 typedef struct { int32_t real ; } gauss ; - [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +jit: status 4 + [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/b4/GB_jit__user_type__0__gauss.c.o [100%] Linking C shared library libGB_jit__user_type__0__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.596 sec ] - GraphBLAS type: Gauss user-defined: [gauss] size: 8 + 0.314 sec ] + GraphBLAS Type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; [ GxB_Type_new - 1.2e-05 sec ] - GraphBLAS type: Gauss user-defined: [gauss] size: 8 + 3.83e-06 sec ] + GraphBLAS Type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - [ GxB_BinaryOp_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +JIT: off +JIT: on +jit: status 4 + [ GxB_BinaryOp_new (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.605 sec ] + 0.365 sec ] GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { z->real = x->real + y->real ; z->imag = -911 ; } - [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.614 sec ] + 0.356 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -131,28 +159,31 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } [ GxB_BinaryOp_new - 6.98e-06 sec ] + 3.34e-06 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { z->real = x->real + y->real ; z->imag = x->imag + y->imag ; } +JIT: off +JIT: on +jit: status 4 GraphBLAS Monoid: AddMonoid (user-defined): GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -162,11 +193,11 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) identity: [ [user-defined value] ] GraphBLAS BinaryOp: MultGauss (user-defined): z=multgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void multgauss (gauss *z, const gauss *x, const gauss *y) { @@ -179,11 +210,11 @@ void multgauss (gauss *z, const gauss *x, const gauss *y) GraphBLAS Semiring: GaussSemiring (user-defined): (addgauss_multgauss) GraphBLAS Monoid: semiring->add (user-defined): GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -191,13 +222,12 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } identity: [ [user-defined value] ] - GraphBLAS BinaryOp: semiring->multiply (user-defined): z=multgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void multgauss (gauss *z, const gauss *x, const gauss *y) { @@ -206,7 +236,7 @@ void multgauss (gauss *z, const gauss *x, const gauss *y) z->real = zreal ; z->imag = zimag ; } -(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) +(convert ints 32/32 to 64/64, time: 1.5738e-05) (convert ints 32/32 to 64/64, time: 1.36578e-06) (iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) (build 32/32 time: 1.53831e-05) =============== Gauss A matrix: @@ -216,12 +246,12 @@ row 1: ( 2, 2) ( 2, 1) ( 2, 0) ( 2, -1) row 2: ( 3, 2) ( 3, 1) ( 3, 0) ( 3, -1) row 3: ( 4, 2) ( 4, 1) ( 4, 0) ( 4, -1) - [ GrB_reduce (A bitmap) (jit: load) - 0.000144 sec ] + [ GrB_reduce (A bitmap) (jit: cpu load) + 8.61e-05 sec ] sum (A) = (39,6) - [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: load) (bitmap to full) - 0.000198 sec ] + [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: cpu load) (bitmap to full) + 0.000109 sec ] =============== Gauss A = A^2 matrix: @@ -232,11 +262,11 @@ row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) - [ GrB_reduce (A full) (jit: load) - 0.000102 sec ] + [ GrB_reduce (A full) (jit: cpu load) + 5.44e-05 sec ] sum (A^2) = (387,46) - +(convert ints 32/32 to 64/64, time: 2.59513e-06) Gauss C empty matrix size: 4-by-4 @@ -245,12 +275,12 @@ row 1: . . . . row 2: . . . . row 3: . . . . - [ GxB_set (full to sparse) - 1.09e-05 sec ] - [ GxB_set (hyper to sparse) - 6.95e-06 sec ] - [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: load) (sparse to bitmap) - 0.000206 sec ] + [ GrB_set (full to sparse) + 5.11e-06 sec ] + [ GrB_set (hyper to sparse) + 2.47e-06 sec ] + [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build, 1 threads) (build 32/32 time: 4.76418e-06) (hyper to sparse) (convert ints 32/32 to 64/64, time: 1.46916e-06) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: cpu load) (sparse to bitmap) + 0.0001 sec ] =============== Gauss C = diag(AA') matrix: @@ -261,12 +291,12 @@ row 1: . (1304, 296) . . row 2: . . (2893, 768) . row 3: . . . (5108,1456) - [ GxB_set - 4.82e-07 sec ] - [ GxB_set (hyper to sparse) - 5.16e-06 sec ] +(convert ints 32/32 to 64/64, time: 2.45124e-06) [ GrB_set + 1.18e-07 sec ] + [ GrB_set (hyper to sparse) + 1.23e-06 sec ] [ GrB_select (A dense) - 3.13e-05 sec ] + 1.45e-05 sec ] Gauss D matrix @@ -276,8 +306,8 @@ row 1: . ( 18, 8) . . row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) - [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: load) - 0.000133 sec ] + [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: cpu load) + 5.94e-05 sec ] =============== Gauss C = D*A matrix: @@ -288,10 +318,10 @@ row 1: ( 244, 324) ( 260, 288) ( 360, 160) ( 460, 32) row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) - [ GxB_set - 3.64e-07 sec ] - [ GxB_set (sparse to bitmap) - 6.43e-06 sec ] + [ GrB_set + 8.1e-08 sec ] + [ GrB_set (sparse to bitmap) + 1.38e-06 sec ] Gauss D matrix (bitmap) @@ -311,8 +341,8 @@ row 3: . . . ( 42, -16) (2,2) [user-defined value] (3,3) [user-defined value] - [ GxB_set (bitmap to sparse) - 1.01e-05 sec ] + [ GrB_set (bitmap to sparse) + 5.43e-06 sec ] Gauss D matrix (back to sparse) @@ -323,7 +353,7 @@ row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) - 4x4 GraphBLAS gauss matrix, sparse by row + 4x4 GraphBLAS gauss matrix, sparse by row, ints: 64/64 sparsity control: sparse only D, 4 entries, memory: 336 bytes @@ -332,8 +362,8 @@ row 3: . . . ( 42, -16) (2,2) [user-defined value] (3,3) [user-defined value] - [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: load) - 0.000128 sec ] + [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: cpu load) + 5.49e-05 sec ] =============== Gauss C = A*D matrix: @@ -345,7 +375,7 @@ row 2: ( 179, 252) ( 408, 440) ( 900, 0) (1152,-1016) row 3: ( 236, 342) ( 556, 592) (1200, 0) (1508,-1344) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 3.02e-05 sec ] + 1.48e-05 sec ] =============== Gauss C = (1,-2) matrix: @@ -366,8 +396,8 @@ row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) - [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: load) (C in place) - 0.000126 sec ] + [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: cpu load) (C in place) + 5.56e-05 sec ] =============== Gauss C += A*A' matrix: @@ -378,8 +408,8 @@ row 1: ( 615, 28) (1305, 294) (1943, 476) (2581, 658) row 2: ( 918, 58) (1943, 476) (2894, 766) (3845,1056) row 3: (1221, 88) (2581, 658) (3845,1056) (5109,1454) - [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 1.29e-05 sec ] +(convert ints 32/32 to 64/64, time: 2.21608e-06) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar + 2.73e-06 sec ] =============== Gauss B = (1,-2) matrix: @@ -390,8 +420,8 @@ row 1: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) row 2: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) - [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: load) (C in place) - 0.000147 sec ] + [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: cpu load) (C in place) + 5.92e-05 sec ] =============== Gauss C += B*A: @@ -402,8 +432,8 @@ row 1: ( 809,-100) (1472, 145) (2038, 276) (2604, 407) row 2: (1112, -70) (2110, 327) (2989, 566) (3868, 805) row 3: (1415, -40) (2748, 509) (3940, 856) (5132,1203) - [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: load) (C in place) - 0.000126 sec ] + [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: cpu load) (C in place) + 5.37e-05 sec ] =============== Gauss C += A*B: @@ -414,8 +444,8 @@ row 1: ( 907,-246) (1570, -1) (2136, 130) (2702, 261) row 2: (1261,-288) (2259, 109) (3138, 348) (4017, 587) row 3: (1615,-330) (2948, 219) (4140, 566) (5332, 913) - [ GrB_apply (shallow-op) (jit: load) - 0.000121 sec ] + [ GrB_apply (shallow-op) (jit: cpu load) + 5.67e-05 sec ] =============== Gauss C = (1,-2) + A: @@ -426,8 +456,8 @@ row 1: ( 19, 8) ( 19, 6) ( 21, -2) ( 23, -10) row 2: ( 28, 14) ( 29, 10) ( 31, -2) ( 33, -14) row 3: ( 37, 20) ( 39, 14) ( 41, -2) ( 43, -18) - [ GrB_apply (shallow-op) (jit: load) - 0.000106 sec ] + [ GrB_apply (shallow-op) (jit: cpu load) + 4.95e-05 sec ] =============== Gauss C = A*(1,-2): @@ -438,8 +468,8 @@ row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) - 0.000134 sec ] + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: cpu load) (full to sparse) + 7.38e-05 sec ] =============== Gauss C = A'*(1,-2): @@ -450,8 +480,8 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) - 0.000121 sec ] + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: cpu load) (full to sparse) + 5.29e-05 sec ] =============== Gauss C = (1,-2)*A': @@ -464,15 +494,15 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) GraphBLAS UnaryOp: RealGauss (user-defined): z=realgauss(x) - GraphBLAS type: ztype int32_t size: 4 - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype int32_t size: 4 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void realgauss (int32_t *z, const gauss *x) { (*z) = x->real ; } - [ GrB_apply (shallow-op) (jit: load) - 0.000159 sec ] +(convert ints 32/32 to 64/64, time: 1.28103e-06) [ GrB_apply (shallow-op) (jit: cpu load) + 5.25e-05 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 296 bytes @@ -504,8 +534,8 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: load) - 0.000125 sec ] + [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: cpu load) + 4.93e-05 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 296 bytes @@ -527,7 +557,7 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) (3,2) 40 (3,3) 10 - +(convert ints 32/32 to 64/64, time: 3.22983e-06) =============== C @@ -537,8 +567,8 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (shallow-op) (jit: load) - 0.000119 sec ] + [ GrB_apply (shallow-op) (jit: cpu load) + 4.77e-05 sec ] R = ijgauss (C) @@ -562,8 +592,8 @@ R = ijgauss (C) (3,2) 10 (3,3) 11 - [ GrB_Matrix_extractTuples (A full) - 3.29e-05 sec ] + [ GrB_Matrix_extractTuples_FP64 (A full) + 1.57e-05 sec ] R (0,0) = 18 R (0,1) = 38 R (0,2) = 58 @@ -590,8 +620,8 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_transpose (transpose) (bitmap/full transpose) (jit: load) - 0.000161 sec ] + [ GrB_transpose (transpose) (bitmap/full transpose) (jit: cpu load) + 5.32e-05 sec ] =============== C = C' @@ -602,10 +632,10 @@ row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - [ GxB_set (in-place transpose) (transpose) - 1.23e-05 sec ] - [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: load) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 0.000185 sec ] +(convert ints 32/32 to 64/64, time: 2.0368e-06) (convert ints 32/32 to 64/64, time: 8.62405e-07) [ GrB_set (in-place transpose) (transpose) + 4.72e-06 sec ] + [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: cpu load) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 7.06e-05 sec ] =============== Z = [C D ; E E ; D C] @@ -868,7 +898,7 @@ row 254: . . ( 30, 0) . ( 59, -38) ( 52, -44 row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - 256x8 GraphBLAS gauss matrix, sparse by col + 256x8 GraphBLAS gauss matrix, sparse by col, ints: 64/64 Z, 40 entries, memory: 944 bytes (0,0) [user-defined value] @@ -913,7 +943,7 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 (255,7) [user-defined value] [ GxB_Matrix_split (sparse/hyper split) - 2.96e-05 sec ] + 1.14e-05 sec ] =============== C Tile from Z: @@ -1049,7 +1079,7 @@ row 126: . . . row 127: . . . - 128x3 GraphBLAS gauss matrix, sparse by col + 128x3 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 12 entries, memory: 456 bytes (0,0) [user-defined value] @@ -1200,7 +1230,7 @@ row 126: . . . . . row 127: . . . . . - 128x5 GraphBLAS gauss matrix, sparse by col + 128x5 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 8 entries, memory: 408 bytes (0,0) [user-defined value] @@ -1347,7 +1377,7 @@ row 126: . . ( 30, 0) row 127: . . . - 128x3 GraphBLAS gauss matrix, sparse by col + 128x3 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 3 entries, memory: 312 bytes (124,0) [user-defined value] @@ -1489,7 +1519,7 @@ row 126: . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - 128x5 GraphBLAS gauss matrix, sparse by col + 128x5 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 17 entries, memory: 552 bytes (127,0) [user-defined value] @@ -1510,10 +1540,10 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (126,4) [user-defined value] (127,4) [user-defined value] - [ GxB_set (in-place transpose) (transpose) - 7.28e-06 sec ] +(convert ints 32/32 to 64/64, time: 1.24983e-06) (convert ints 32/32 to 64/64, time: 8.73581e-07) [ GrB_set (in-place transpose) (transpose) + 1.77e-06 sec ] [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 5.54e-05 sec ] + 1.73e-05 sec ] =============== Z = [C D ; E E ; D C] @@ -1581,7 +1611,7 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) (15,7) [user-defined value] [ GxB_Matrix_split (bitmap split) - 1.49e-05 sec ] + 5.49e-06 sec ] =============== C Tile from Z: @@ -1698,8 +1728,8 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (6,4) [user-defined value] (7,4) [user-defined value] - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 0.000165 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: cpu load) + 6.55e-05 sec ] =============== C = C + ciso @@ -1710,10 +1740,10 @@ row 1: ( 39, -28) ( 35, -30) ( 21, -42) ( 7, -54) row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) - [ GxB_set - 2.72e-07 sec ] + [ GrB_set + 1.18e-07 sec ] [ GxB_Matrix_split (full split) - 1.53e-05 sec ] + 4.86e-06 sec ] =============== S Tile from C: @@ -1798,7 +1828,7 @@ row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 1.69e-05 sec ] + 3.38e-06 sec ] =============== C = C + ciso (JIT paused): @@ -1820,7 +1850,7 @@ row 2: ( 61, -42) ( 54, -48) ( 32, -64) ( 10, -80) row 3: ( 82, -54) ( 72, -64) ( 42, -84) ( 12,-104) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 1.07e-05 sec ] + 2.5e-06 sec ] =============== C = C * ciso (JIT paused): @@ -1831,9 +1861,9 @@ row 1: ( -20,-110) ( -28,-104) ( -66, -88) (-104, -72) row 2: ( -23,-164) ( -42,-156) ( -96,-128) (-150,-100) row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) -JIT: run (may not load or compile) +JIT: run (the JIT can only run, not load or compile) [ GrB_assign (pending: 0) Method 22: (C full) += scalar - 8.46e-06 sec ] + 2.09e-06 sec ] =============== C = C + ciso (JIT run): @@ -1845,7 +1875,7 @@ row 2: ( -22,-166) ( -41,-158) ( -95,-130) (-149,-102) row 3: ( -25,-220) ( -55,-210) (-125,-170) (-195,-130) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 1.01e-05 sec ] + 2.49e-06 sec ] =============== C = C * ciso (JIT not loaded): @@ -1857,8 +1887,8 @@ row 2: (-354,-122) (-357, -76) (-355, 60) (-353, 196) row 3: (-465,-170) (-475,-100) (-465, 80) (-455, 260) JIT: on - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 0.000127 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: cpu load) + 5.25e-05 sec ] =============== C = C * ciso (full JIT): diff --git a/GraphBLAS/Demo/Output/gauss_demo1.out b/GraphBLAS/Demo/Output/gauss_demo1.out index 3fd296ca1c..2862c99fb8 100644 --- a/GraphBLAS/Demo/Output/gauss_demo1.out +++ b/GraphBLAS/Demo/Output/gauss_demo1.out @@ -3,15 +3,15 @@ not matrix (conjugate) transposes. GraphBLAS Context: World - Context.nthreads: 40 + Context.nthreads: 32 Context.chunk: 65536 JIT configuration: ------------------ -JIT C compiler: [/usr/bin/cc] -JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC ] +JIT C compiler: [/usr/bin/gcc] +JIT C flags: [ -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp] JIT C link flags: [ -shared ] JIT C libraries: [ -lm -ldl -lgomp -lpthread] JIT C preface: [] -JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB9.0.0] +JIT cache: [/home/davis/.SuiteSparse/GrB10.0.0] JIT C control: [4] JIT C control: [4] reset ------------------------------------- @@ -20,110 +20,138 @@ JIT C preface (revised): // kernel generated by gauss_demo.c #include - [ GxB_Type_new (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GxB_Type_new (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/b4/GB_jit__user_type__0__gauss.c.o [100%] Linking C shared library libGB_jit__user_type__0__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.586 sec ] - GraphBLAS type: BadGauss user-defined: [gauss] size: 4 + 0.379 sec ] + GraphBLAS Type: BadGauss user-defined: [gauss] size: 4 typedef struct { int32_t real ; } gauss ; - [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +jit: status 4 + [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' -[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b4/GB_jit__user_type__0__gauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/b4/GB_jit__user_type__0__gauss.c.o [100%] Linking C shared library libGB_jit__user_type__0__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' [100%] Built target GB_jit__user_type__0__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/ce2be202506bf1b4' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/ce2be202506bf1b4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b4/libGB_jit__user_type__0__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/b4/libGB_jit__user_type__0__gauss.so - 0.603 sec ] - GraphBLAS type: Gauss user-defined: [gauss] size: 8 + 0.346 sec ] + GraphBLAS Type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; [ GxB_Type_new - 1.09e-05 sec ] - GraphBLAS type: Gauss user-defined: [gauss] size: 8 + 7.2e-06 sec ] + GraphBLAS Type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - [ GxB_BinaryOp_new (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +JIT: off +JIT: on +jit: status 4 + [ GxB_BinaryOp_new (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.617 sec ] + 0.357 sec ] GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { z->real = x->real + y->real ; z->imag = -911 ; } - [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' -[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/1b/GB_jit__user_op__0__addgauss.c.o [100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' [100%] Built target GB_jit__user_op__0__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/af7c00a52397011b' +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/af7c00a52397011b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so - 0.598 sec ] + 0.395 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -131,28 +159,31 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } [ GxB_BinaryOp_new - 8.62e-06 sec ] + 2.53e-06 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { z->real = x->real + y->real ; z->imag = x->imag + y->imag ; } +JIT: off +JIT: on +jit: status 4 GraphBLAS Monoid: AddMonoid (user-defined): GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -162,11 +193,11 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) identity: [ [user-defined value] ] GraphBLAS BinaryOp: MultGauss (user-defined): z=multgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void multgauss (gauss *z, const gauss *x, const gauss *y) { @@ -179,11 +210,11 @@ void multgauss (gauss *z, const gauss *x, const gauss *y) GraphBLAS Semiring: GaussSemiring (user-defined): (addgauss_multgauss) GraphBLAS Monoid: semiring->add (user-defined): GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void addgauss (gauss *z, const gauss *x, const gauss *y) { @@ -191,13 +222,12 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->imag = x->imag + y->imag ; } identity: [ [user-defined value] ] - GraphBLAS BinaryOp: semiring->multiply (user-defined): z=multgauss(x,y) - GraphBLAS type: ztype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - GraphBLAS type: ytype user-defined: [gauss] size: 8 + GraphBLAS Type: ytype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void multgauss (gauss *z, const gauss *x, const gauss *y) { @@ -206,7 +236,7 @@ void multgauss (gauss *z, const gauss *x, const gauss *y) z->real = zreal ; z->imag = zimag ; } -(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) +(convert ints 32/32 to 64/64, time: 1.23279e-05) (convert ints 32/32 to 64/64, time: 7.57165e-07) (iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) (build 32/32 time: 1.2116e-05) =============== Gauss A matrix: @@ -216,46 +246,58 @@ row 1: ( 2, 2) ( 2, 1) ( 2, 0) ( 2, -1) row 2: ( 3, 2) ( 3, 1) ( 3, 0) ( 3, -1) row 3: ( 4, 2) ( 4, 1) ( 4, 0) ( 4, -1) - [ GrB_reduce (A bitmap) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_reduce (A bitmap) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/30e2328e57edb8cc -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/30e2328e57edb8cc' -[ 50%] Building C object CMakeFiles/GB_jit__reduce__83feee2__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/cc/GB_jit__reduce__83feee2__addgauss.c.o -[100%] Linking C shared library libGB_jit__reduce__83feee2__addgauss.so -[100%] Built target GB_jit__reduce__83feee2__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/30e2328e57edb8cc' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +[ 50%] Building C object CMakeFiles/GB_jit__reduce__10ee2__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/57/GB_jit__reduce__10ee2__addgauss.c.o +[100%] Linking C shared library libGB_jit__reduce__10ee2__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +[100%] Built target GB_jit__reduce__10ee2__addgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/225c38640fc21857' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/cc/libGB_jit__reduce__83feee2__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/57/libGB_jit__reduce__10ee2__addgauss.so - 0.656 sec ] + 0.356 sec ] sum (A) = (39,6) - [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/e335728df7d8fc68 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/e335728df7d8fc68' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/68/GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.c.o -[100%] Linking C shared library libGB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.so -[100%] Built target GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/e335728df7d8fc68' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxbit__0100eee0eee8a__addgauss_multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/c6/GB_jit__AxB_saxbit__0100eee0eee8a__addgauss_multgauss.c.o +[100%] Linking C shared library libGB_jit__AxB_saxbit__0100eee0eee8a__addgauss_multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +[100%] Built target GB_jit__AxB_saxbit__0100eee0eee8a__addgauss_multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/c9c3bcfb88e8c0c6' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/68/libGB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/c6/libGB_jit__AxB_saxbit__0100eee0eee8a__addgauss_multgauss.so (bitmap to full) - 0.769 sec ] + 0.397 sec ] =============== Gauss A = A^2 matrix: @@ -266,28 +308,34 @@ row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) - [ GrB_reduce (A full) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_reduce (A full) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/216cc7a07453b1ee -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/216cc7a07453b1ee' -[ 50%] Building C object CMakeFiles/GB_jit__reduce__83feee3__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/ee/GB_jit__reduce__83feee3__addgauss.c.o -[100%] Linking C shared library libGB_jit__reduce__83feee3__addgauss.so -[100%] Built target GB_jit__reduce__83feee3__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/216cc7a07453b1ee' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +[ 50%] Building C object CMakeFiles/GB_jit__reduce__10ee3__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/67/GB_jit__reduce__10ee3__addgauss.c.o +[100%] Linking C shared library libGB_jit__reduce__10ee3__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +[100%] Built target GB_jit__reduce__10ee3__addgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/11676798b10dcc67' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/ee/libGB_jit__reduce__83feee3__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/67/libGB_jit__reduce__10ee3__addgauss.so - 0.74 sec ] + 0.378 sec ] sum (A^2) = (387,46) - +(convert ints 32/32 to 64/64, time: 1.19661e-05) Gauss C empty matrix size: 4-by-4 @@ -296,29 +344,35 @@ row 1: . . . . row 2: . . . . row 3: . . . . - [ GxB_set (full to sparse) - 2.34e-05 sec ] - [ GxB_set (hyper to sparse) - 1.51e-05 sec ] - [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_set (full to sparse) + 1.72e-05 sec ] + [ GrB_set (hyper to sparse) + 8.24e-06 sec ] + [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build, 1 threads) (build 32/32 time: 1.3663e-05) (hyper to sparse) (convert ints 32/32 to 64/64, time: 4.87687e-06) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/67a80190c429079f -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/67a80190c429079f' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/9f/GB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.c.o -[100%] Linking C shared library libGB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.so -[100%] Built target GB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/67a80190c429079f' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot3__0100eee2eee55__addgauss_multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/41/GB_jit__AxB_dot3__0100eee2eee55__addgauss_multgauss.c.o +[100%] Linking C shared library libGB_jit__AxB_dot3__0100eee2eee55__addgauss_multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +[100%] Built target GB_jit__AxB_dot3__0100eee2eee55__addgauss_multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/6682aa418beb7841' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/9f/libGB_jit__AxB_dot3__03fe100eee2eee55__addgauss_multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/41/libGB_jit__AxB_dot3__0100eee2eee55__addgauss_multgauss.so (sparse to bitmap) - 0.719 sec ] + 0.361 sec ] =============== Gauss C = diag(AA') matrix: @@ -329,12 +383,12 @@ row 1: . (1304, 296) . . row 2: . . (2893, 768) . row 3: . . . (5108,1456) - [ GxB_set - 1.33e-06 sec ] - [ GxB_set (hyper to sparse) - 8.97e-06 sec ] +(convert ints 32/32 to 64/64, time: 5.23916e-06) [ GrB_set + 8.04e-07 sec ] + [ GrB_set (hyper to sparse) + 2.26e-06 sec ] [ GrB_select (A dense) - 5.52e-05 sec ] + 2.5e-05 sec ] Gauss D matrix @@ -344,25 +398,31 @@ row 1: . ( 18, 8) . . row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) - [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/dd2129670608a0a3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/dd2129670608a0a3' -[ 50%] Building C object CMakeFiles/GB_jit__colscale__0100eee0eee45__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/a3/GB_jit__colscale__0100eee0eee45__multgauss.c.o -[100%] Linking C shared library libGB_jit__colscale__0100eee0eee45__multgauss.so -[100%] Built target GB_jit__colscale__0100eee0eee45__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/dd2129670608a0a3' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +[ 50%] Building C object CMakeFiles/GB_jit__colscale__00080eee0eee45__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/18/GB_jit__colscale__00080eee0eee45__multgauss.c.o +[100%] Linking C shared library libGB_jit__colscale__00080eee0eee45__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +[100%] Built target GB_jit__colscale__00080eee0eee45__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/5eb304f0fae2b218' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/a3/libGB_jit__colscale__0100eee0eee45__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/18/libGB_jit__colscale__00080eee0eee45__multgauss.so - 0.622 sec ] + 0.409 sec ] =============== Gauss C = D*A matrix: @@ -373,10 +433,10 @@ row 1: ( 244, 324) ( 260, 288) ( 360, 160) ( 460, 32) row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) - [ GxB_set - 1.08e-06 sec ] - [ GxB_set (sparse to bitmap) - 1.35e-05 sec ] + [ GrB_set + 6.96e-07 sec ] + [ GrB_set (sparse to bitmap) + 5.13e-06 sec ] Gauss D matrix (bitmap) @@ -396,8 +456,8 @@ row 3: . . . ( 42, -16) (2,2) [user-defined value] (3,3) [user-defined value] - [ GxB_set (bitmap to sparse) - 1.5e-05 sec ] + [ GrB_set (bitmap to sparse) + 6e-06 sec ] Gauss D matrix (back to sparse) @@ -408,7 +468,7 @@ row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) - 4x4 GraphBLAS gauss matrix, sparse by row + 4x4 GraphBLAS gauss matrix, sparse by row, ints: 64/64 sparsity control: sparse only D, 4 entries, memory: 336 bytes @@ -417,25 +477,31 @@ row 3: . . . ( 42, -16) (2,2) [user-defined value] (3,3) [user-defined value] - [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/96b50768cfd669a8 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/96b50768cfd669a8' -[ 50%] Building C object CMakeFiles/GB_jit__rowscale__0100eee0eee45__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/a8/GB_jit__rowscale__0100eee0eee45__multgauss.c.o -[100%] Linking C shared library libGB_jit__rowscale__0100eee0eee45__multgauss.so -[100%] Built target GB_jit__rowscale__0100eee0eee45__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/96b50768cfd669a8' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +[ 50%] Building C object CMakeFiles/GB_jit__rowscale__00080eee0eee45__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/7f/GB_jit__rowscale__00080eee0eee45__multgauss.c.o +[100%] Linking C shared library libGB_jit__rowscale__00080eee0eee45__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +[100%] Built target GB_jit__rowscale__00080eee0eee45__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/4767bca8be22337f' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/a8/libGB_jit__rowscale__0100eee0eee45__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/7f/libGB_jit__rowscale__00080eee0eee45__multgauss.so - 0.597 sec ] + 0.365 sec ] =============== Gauss C = A*D matrix: @@ -447,7 +513,7 @@ row 2: ( 179, 252) ( 408, 440) ( 900, 0) (1152,-1016) row 3: ( 236, 342) ( 556, 592) (1200, 0) (1508,-1344) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 3.96e-05 sec ] + 3.13e-05 sec ] =============== Gauss C = (1,-2) matrix: @@ -468,25 +534,31 @@ row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) - [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7acb8bd141ca27c9 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7acb8bd141ca27c9' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/c9/GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.c.o -[100%] Linking C shared library libGB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.so -[100%] Built target GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7acb8bd141ca27c9' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +[ 50%] Building C object CMakeFiles/GB_jit__AxB_dot4__0900eee0eeec5__addgauss_multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/54/GB_jit__AxB_dot4__0900eee0eeec5__addgauss_multgauss.c.o +[100%] Linking C shared library libGB_jit__AxB_dot4__0900eee0eeec5__addgauss_multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +[100%] Built target GB_jit__AxB_dot4__0900eee0eeec5__addgauss_multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/bd5099fe43e43654' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/c9/libGB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/54/libGB_jit__AxB_dot4__0900eee0eeec5__addgauss_multgauss.so (C in place) - 0.675 sec ] + 0.287 sec ] =============== Gauss C += A*A' matrix: @@ -497,8 +569,8 @@ row 1: ( 615, 28) (1305, 294) (1943, 476) (2581, 658) row 2: ( 918, 58) (1943, 476) (2894, 766) (3845,1056) row 3: (1221, 88) (2581, 658) (3845,1056) (5109,1454) - [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 2.82e-05 sec ] +(convert ints 32/32 to 64/64, time: 5.3891e-06) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar + 1.39e-05 sec ] =============== Gauss B = (1,-2) matrix: @@ -509,25 +581,31 @@ row 1: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) row 2: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) - [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5301828568d7f863 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5301828568d7f863' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/63/GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.c.o -[100%] Linking C shared library libGB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.so -[100%] Built target GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5301828568d7f863' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy4__0300eee0eeec7__addgauss_multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/f0/GB_jit__AxB_saxpy4__0300eee0eeec7__addgauss_multgauss.c.o +[100%] Linking C shared library libGB_jit__AxB_saxpy4__0300eee0eeec7__addgauss_multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +[100%] Built target GB_jit__AxB_saxpy4__0300eee0eeec7__addgauss_multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/561033c1482ca5f0' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/63/libGB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/f0/libGB_jit__AxB_saxpy4__0300eee0eeec7__addgauss_multgauss.so (C in place) - 1.05 sec ] + 0.378 sec ] =============== Gauss C += B*A: @@ -538,25 +616,31 @@ row 1: ( 809,-100) (1472, 145) (2038, 276) (2604, 407) row 2: (1112, -70) (2110, 327) (2989, 566) (3868, 805) row 3: (1415, -40) (2748, 509) (3940, 856) (5132,1203) - [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/c94d1f86a5825b56 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/c94d1f86a5825b56' -[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/56/GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.c.o -[100%] Linking C shared library libGB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.so -[100%] Built target GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/c94d1f86a5825b56' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +[ 50%] Building C object CMakeFiles/GB_jit__AxB_saxpy5__0500eee0eeecd__addgauss_multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/3b/GB_jit__AxB_saxpy5__0500eee0eeecd__addgauss_multgauss.c.o +[100%] Linking C shared library libGB_jit__AxB_saxpy5__0500eee0eeecd__addgauss_multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +[100%] Built target GB_jit__AxB_saxpy5__0500eee0eeecd__addgauss_multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/b76aa5d3285c123b' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/56/libGB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/3b/libGB_jit__AxB_saxpy5__0500eee0eeecd__addgauss_multgauss.so (C in place) - 0.644 sec ] + 0.369 sec ] =============== Gauss C += A*B: @@ -567,25 +651,31 @@ row 1: ( 907,-246) (1570, -1) (2136, 130) (2702, 261) row 2: (1261,-288) (2259, 109) (3138, 348) (4017, 587) row 3: (1615,-330) (2948, 219) (4140, 566) (5332, 913) - [ GrB_apply (shallow-op) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (shallow-op) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/3b6448d781104419 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/3b6448d781104419' -[ 50%] Building C object CMakeFiles/GB_jit__apply_bind1st__0000eee0efec1__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/19/GB_jit__apply_bind1st__0000eee0efec1__addgauss.c.o -[100%] Linking C shared library libGB_jit__apply_bind1st__0000eee0efec1__addgauss.so -[100%] Built target GB_jit__apply_bind1st__0000eee0efec1__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/3b6448d781104419' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +[ 50%] Building C object CMakeFiles/GB_jit__apply_bind1st__00000eee0efec1__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/19/GB_jit__apply_bind1st__00000eee0efec1__addgauss.c.o +[100%] Linking C shared library libGB_jit__apply_bind1st__00000eee0efec1__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +[100%] Built target GB_jit__apply_bind1st__00000eee0efec1__addgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/3b6448d781104419' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/19/libGB_jit__apply_bind1st__0000eee0efec1__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/19/libGB_jit__apply_bind1st__00000eee0efec1__addgauss.so - 0.618 sec ] + 0.341 sec ] =============== Gauss C = (1,-2) + A: @@ -596,25 +686,31 @@ row 1: ( 19, 8) ( 19, 6) ( 21, -2) ( 23, -10) row 2: ( 28, 14) ( 29, 10) ( 31, -2) ( 33, -14) row 3: ( 37, 20) ( 39, 14) ( 41, -2) ( 43, -18) - [ GrB_apply (shallow-op) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (shallow-op) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/42813a1e14cb43c9 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/42813a1e14cb43c9' -[ 50%] Building C object CMakeFiles/GB_jit__apply_bind2nd__0000eee0eefc4__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/c9/GB_jit__apply_bind2nd__0000eee0eefc4__multgauss.c.o -[100%] Linking C shared library libGB_jit__apply_bind2nd__0000eee0eefc4__multgauss.so -[100%] Built target GB_jit__apply_bind2nd__0000eee0eefc4__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/42813a1e14cb43c9' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +[ 50%] Building C object CMakeFiles/GB_jit__apply_bind2nd__00000eee0eefc4__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/c9/GB_jit__apply_bind2nd__00000eee0eefc4__multgauss.c.o +[100%] Linking C shared library libGB_jit__apply_bind2nd__00000eee0eefc4__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +[100%] Built target GB_jit__apply_bind2nd__00000eee0eefc4__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/42813a1e14cb43c9' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/c9/libGB_jit__apply_bind2nd__0000eee0eefc4__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/c9/libGB_jit__apply_bind2nd__00000eee0eefc4__multgauss.so - 0.665 sec ] + 0.36 sec ] =============== Gauss C = A*(1,-2): @@ -625,25 +721,31 @@ row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/37d33aa629f415d3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/37d33aa629f415d3' -[ 50%] Building C object CMakeFiles/GB_jit__trans_bind2nd__0000eee0eef44__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/d3/GB_jit__trans_bind2nd__0000eee0eef44__multgauss.c.o -[100%] Linking C shared library libGB_jit__trans_bind2nd__0000eee0eef44__multgauss.so -[100%] Built target GB_jit__trans_bind2nd__0000eee0eef44__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/37d33aa629f415d3' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +[ 50%] Building C object CMakeFiles/GB_jit__trans_bind2nd__00000eee0eef44__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/d3/GB_jit__trans_bind2nd__00000eee0eef44__multgauss.c.o +[100%] Linking C shared library libGB_jit__trans_bind2nd__00000eee0eef44__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +[100%] Built target GB_jit__trans_bind2nd__00000eee0eef44__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/37d33aa629f415d3' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d3/libGB_jit__trans_bind2nd__0000eee0eef44__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/d3/libGB_jit__trans_bind2nd__00000eee0eef44__multgauss.so (full to sparse) - 0.679 sec ] + 0.393 sec ] =============== Gauss C = A'*(1,-2): @@ -654,25 +756,31 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/07d1cb825d4304d3 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/07d1cb825d4304d3' -[ 50%] Building C object CMakeFiles/GB_jit__trans_bind1st__0000eee0efe41__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/d3/GB_jit__trans_bind1st__0000eee0efe41__multgauss.c.o -[100%] Linking C shared library libGB_jit__trans_bind1st__0000eee0efe41__multgauss.so -[100%] Built target GB_jit__trans_bind1st__0000eee0efe41__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/07d1cb825d4304d3' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +[ 50%] Building C object CMakeFiles/GB_jit__trans_bind1st__00000eee0efe41__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/d3/GB_jit__trans_bind1st__00000eee0efe41__multgauss.c.o +[100%] Linking C shared library libGB_jit__trans_bind1st__00000eee0efe41__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +[100%] Built target GB_jit__trans_bind1st__00000eee0efe41__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/07d1cb825d4304d3' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d3/libGB_jit__trans_bind1st__0000eee0efe41__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/d3/libGB_jit__trans_bind1st__00000eee0efe41__multgauss.so (full to sparse) - 0.678 sec ] + 0.361 sec ] =============== Gauss C = (1,-2)*A': @@ -685,32 +793,38 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) GraphBLAS UnaryOp: RealGauss (user-defined): z=realgauss(x) - GraphBLAS type: ztype int32_t size: 4 - GraphBLAS type: xtype user-defined: [gauss] size: 8 + GraphBLAS Type: ztype int32_t size: 4 + GraphBLAS Type: xtype user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; void realgauss (int32_t *z, const gauss *x) { (*z) = x->real ; } - [ GrB_apply (shallow-op) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +(convert ints 32/32 to 64/64, time: 4.68502e-06) [ GrB_apply (shallow-op) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5c78101d6e73dc21 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5c78101d6e73dc21' -[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__00006e06ef__realgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/21/GB_jit__apply_unop__00006e06ef__realgauss.c.o -[100%] Linking C shared library libGB_jit__apply_unop__00006e06ef__realgauss.so -[100%] Built target GB_jit__apply_unop__00006e06ef__realgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/5c78101d6e73dc21' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__040006e06ef__realgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/f6/GB_jit__apply_unop__040006e06ef__realgauss.c.o +[100%] Linking C shared library libGB_jit__apply_unop__040006e06ef__realgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +[100%] Built target GB_jit__apply_unop__040006e06ef__realgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/2eb4c260aa6a3cf6' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/21/libGB_jit__apply_unop__00006e06ef__realgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/f6/libGB_jit__apply_unop__040006e06ef__realgauss.so - 0.639 sec ] + 0.344 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 296 bytes @@ -742,25 +856,31 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/b799fc2c5b29ec49 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/b799fc2c5b29ec49' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__08006e06ef__realgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/49/GB_jit__trans_unop__08006e06ef__realgauss.c.o -[100%] Linking C shared library libGB_jit__trans_unop__08006e06ef__realgauss.so -[100%] Built target GB_jit__trans_unop__08006e06ef__realgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/b799fc2c5b29ec49' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__048006e06ef__realgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/bf/GB_jit__trans_unop__048006e06ef__realgauss.c.o +[100%] Linking C shared library libGB_jit__trans_unop__048006e06ef__realgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +[100%] Built target GB_jit__trans_unop__048006e06ef__realgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/a59f0f91c7c71dbf' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/49/libGB_jit__trans_unop__08006e06ef__realgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/bf/libGB_jit__trans_unop__048006e06ef__realgauss.so - 0.616 sec ] + 0.341 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 296 bytes @@ -782,7 +902,7 @@ gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/b79 (3,2) 40 (3,3) 10 - +(convert ints 32/32 to 64/64, time: 2.66312e-06) =============== C @@ -792,25 +912,31 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_apply (shallow-op) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_apply (shallow-op) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/4e606820337e573c -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/4e606820337e573c' -[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__07fe8ee8ef__ijgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/3c/GB_jit__apply_unop__07fe8ee8ef__ijgauss.c.o -[100%] Linking C shared library libGB_jit__apply_unop__07fe8ee8ef__ijgauss.so -[100%] Built target GB_jit__apply_unop__07fe8ee8ef__ijgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/4e606820337e573c' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4 +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +[ 50%] Building C object CMakeFiles/GB_jit__apply_unop__047fe8ee8ef__ijgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/c4/GB_jit__apply_unop__047fe8ee8ef__ijgauss.c.o +[100%] Linking C shared library libGB_jit__apply_unop__047fe8ee8ef__ijgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +[100%] Built target GB_jit__apply_unop__047fe8ee8ef__ijgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/da95801438e113c4' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/3c/libGB_jit__apply_unop__07fe8ee8ef__ijgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/c4/libGB_jit__apply_unop__047fe8ee8ef__ijgauss.so - 0.644 sec ] + 0.35 sec ] R = ijgauss (C) @@ -834,8 +960,8 @@ R = ijgauss (C) (3,2) 10 (3,3) 11 - [ GrB_Matrix_extractTuples (A full) - 4.07e-05 sec ] + [ GrB_Matrix_extractTuples_FP64 (A full) + 3.28e-05 sec ] R (0,0) = 18 R (0,1) = 38 R (0,2) = 58 @@ -862,25 +988,31 @@ row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) - [ GrB_transpose (transpose) (bitmap/full transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_transpose (transpose) (bitmap/full transpose) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/20f5326f3ffc493d -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/20f5326f3ffc493d' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__0802ee0eef__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/3d/GB_jit__trans_unop__0802ee0eef__gauss.c.o -[100%] Linking C shared library libGB_jit__trans_unop__0802ee0eef__gauss.so -[100%] Built target GB_jit__trans_unop__0802ee0eef__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/20f5326f3ffc493d' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__04802ee0eef__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/0d/GB_jit__trans_unop__04802ee0eef__gauss.c.o +[100%] Linking C shared library libGB_jit__trans_unop__04802ee0eef__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +[100%] Built target GB_jit__trans_unop__04802ee0eef__gauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/238f3ddc4a66790d' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/3d/libGB_jit__trans_unop__0802ee0eef__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/0d/libGB_jit__trans_unop__04802ee0eef__gauss.so - 0.644 sec ] + 0.335 sec ] =============== C = C' @@ -891,27 +1023,33 @@ row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - [ GxB_set (in-place transpose) (transpose) - 2.09e-05 sec ] - [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 +(convert ints 32/32 to 64/64, time: 7.15395e-06) (convert ints 32/32 to 64/64, time: 3.12226e-06) [ GrB_set (in-place transpose) (transpose) + 1.63e-05 sec ] + [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/f6daeb95a8060316 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/f6daeb95a8060316' -[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__0802ee0ee5__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/16/GB_jit__trans_unop__0802ee0ee5__gauss.c.o -[100%] Linking C shared library libGB_jit__trans_unop__0802ee0ee5__gauss.so -[100%] Built target GB_jit__trans_unop__0802ee0ee5__gauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/f6daeb95a8060316' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +[ 50%] Building C object CMakeFiles/GB_jit__trans_unop__04802ee0ee5__gauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/da/GB_jit__trans_unop__04802ee0ee5__gauss.c.o +[100%] Linking C shared library libGB_jit__trans_unop__04802ee0ee5__gauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +[100%] Built target GB_jit__trans_unop__04802ee0ee5__gauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/09d7fc73177577da' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/16/libGB_jit__trans_unop__0802ee0ee5__gauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/da/libGB_jit__trans_unop__04802ee0ee5__gauss.so (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 0.659 sec ] + 0.372 sec ] =============== Z = [C D ; E E ; D C] @@ -1174,7 +1312,7 @@ row 254: . . ( 30, 0) . ( 59, -38) ( 52, -44 row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - 256x8 GraphBLAS gauss matrix, sparse by col + 256x8 GraphBLAS gauss matrix, sparse by col, ints: 64/64 Z, 40 entries, memory: 944 bytes (0,0) [user-defined value] @@ -1219,7 +1357,7 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 (255,7) [user-defined value] [ GxB_Matrix_split (sparse/hyper split) - 3.36e-05 sec ] + 1.97e-05 sec ] =============== C Tile from Z: @@ -1355,7 +1493,7 @@ row 126: . . . row 127: . . . - 128x3 GraphBLAS gauss matrix, sparse by col + 128x3 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 12 entries, memory: 456 bytes (0,0) [user-defined value] @@ -1506,7 +1644,7 @@ row 126: . . . . . row 127: . . . . . - 128x5 GraphBLAS gauss matrix, sparse by col + 128x5 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 8 entries, memory: 408 bytes (0,0) [user-defined value] @@ -1653,7 +1791,7 @@ row 126: . . ( 30, 0) row 127: . . . - 128x3 GraphBLAS gauss matrix, sparse by col + 128x3 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 3 entries, memory: 312 bytes (124,0) [user-defined value] @@ -1795,7 +1933,7 @@ row 126: . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) - 128x5 GraphBLAS gauss matrix, sparse by col + 128x5 GraphBLAS gauss matrix, sparse by col, ints: 64/64 CTiles [k], 17 entries, memory: 552 bytes (127,0) [user-defined value] @@ -1816,10 +1954,10 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (126,4) [user-defined value] (127,4) [user-defined value] - [ GxB_set (in-place transpose) (transpose) - 9.74e-06 sec ] +(convert ints 32/32 to 64/64, time: 3.35369e-06) (convert ints 32/32 to 64/64, time: 1.28709e-06) [ GrB_set (in-place transpose) (transpose) + 2.93e-06 sec ] [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) - 7.15e-05 sec ] + 2.59e-05 sec ] =============== Z = [C D ; E E ; D C] @@ -1887,7 +2025,7 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) (15,7) [user-defined value] [ GxB_Matrix_split (bitmap split) - 1.78e-05 sec ] + 7.23e-06 sec ] =============== C Tile from Z: @@ -2004,25 +2142,31 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (6,4) [user-defined value] (7,4) [user-defined value] - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/bcb251ed7f212866 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/bcb251ed7f212866' -[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__1000eee0eec8__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/66/GB_jit__subassign_22__1000eee0eec8__addgauss.c.o -[100%] Linking C shared library libGB_jit__subassign_22__1000eee0eec8__addgauss.so -[100%] Built target GB_jit__subassign_22__1000eee0eec8__addgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/bcb251ed7f212866' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__2040eee0eec0__addgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/ba/GB_jit__subassign_22__2040eee0eec0__addgauss.c.o +[100%] Linking C shared library libGB_jit__subassign_22__2040eee0eec0__addgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +[100%] Built target GB_jit__subassign_22__2040eee0eec0__addgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/9fb923a6107650ba' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/66/libGB_jit__subassign_22__1000eee0eec8__addgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/ba/libGB_jit__subassign_22__2040eee0eec0__addgauss.so - 0.643 sec ] + 0.358 sec ] =============== C = C + ciso @@ -2033,10 +2177,10 @@ row 1: ( 39, -28) ( 35, -30) ( 21, -42) ( 7, -54) row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) - [ GxB_set - 7.84e-07 sec ] + [ GrB_set + 1.99e-07 sec ] [ GxB_Matrix_split (full split) - 2.92e-05 sec ] + 1.11e-05 sec ] =============== S Tile from C: @@ -2121,7 +2265,7 @@ row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 3.51e-05 sec ] + 9.7e-06 sec ] =============== C = C + ciso (JIT paused): @@ -2143,7 +2287,7 @@ row 2: ( 61, -42) ( 54, -48) ( 32, -64) ( 10, -80) row 3: ( 82, -54) ( 72, -64) ( 42, -84) ( 12,-104) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 1.82e-05 sec ] + 1.82e-06 sec ] =============== C = C * ciso (JIT paused): @@ -2154,9 +2298,9 @@ row 1: ( -20,-110) ( -28,-104) ( -66, -88) (-104, -72) row 2: ( -23,-164) ( -42,-156) ( -96,-128) (-150,-100) row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) -JIT: run (may not load or compile) +JIT: run (the JIT can only run, not load or compile) [ GrB_assign (pending: 0) Method 22: (C full) += scalar - 1.47e-05 sec ] + 1.63e-06 sec ] =============== C = C + ciso (JIT run): @@ -2168,7 +2312,7 @@ row 2: ( -22,-166) ( -41,-158) ( -95,-130) (-149,-102) row 3: ( -25,-220) ( -55,-210) (-125,-170) (-195,-130) [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) - 1.82e-05 sec ] + 1.78e-06 sec ] =============== C = C * ciso (JIT not loaded): @@ -2180,25 +2324,31 @@ row 2: (-354,-122) (-357, -76) (-355, 60) (-353, 196) row 3: (-465,-170) (-475,-100) (-465, 80) (-455, 260) JIT: on - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: compile and load) (jit: cmake) --- The C compiler identification is GNU 9.4.0 + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: compile and load) (jit compile with cmake) +-- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped +-- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done --- Configuring done (0.3s) --- Generating done (0.0s) --- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7a164201169278d1 -gmake[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7a164201169278d1' -[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__1000eee0eec8__multgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/d1/GB_jit__subassign_22__1000eee0eec8__multgauss.c.o -[100%] Linking C shared library libGB_jit__subassign_22__1000eee0eec8__multgauss.so -[100%] Built target GB_jit__subassign_22__1000eee0eec8__multgauss -gmake[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/tmp/7a164201169278d1' +-- Configuring done +-- Generating done +-- Build files have been written to: /home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab +gmake[1]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +gmake[2]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +gmake[3]: Entering directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +[ 50%] Building C object CMakeFiles/GB_jit__subassign_22__2040eee0eec0__multgauss.dir/home/davis/.SuiteSparse/GrB10.0.0/c/ab/GB_jit__subassign_22__2040eee0eec0__multgauss.c.o +[100%] Linking C shared library libGB_jit__subassign_22__2040eee0eec0__multgauss.so +gmake[3]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +[100%] Built target GB_jit__subassign_22__2040eee0eec0__multgauss +gmake[2]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' +gmake[1]: Leaving directory '/home/davis/.SuiteSparse/GrB10.0.0/tmp/10a2b99fcf56f7ab' -- Install configuration: "" --- Installing: /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/d1/libGB_jit__subassign_22__1000eee0eec8__multgauss.so +-- Installing: /home/davis/.SuiteSparse/GrB10.0.0/lib/ab/libGB_jit__subassign_22__2040eee0eec0__multgauss.so - 0.661 sec ] + 0.358 sec ] =============== C = C * ciso (full JIT): diff --git a/GraphBLAS/Demo/Output/import_demo.out b/GraphBLAS/Demo/Output/import_demo.out deleted file mode 100644 index dc72b3c9b0..0000000000 --- a/GraphBLAS/Demo/Output/import_demo.out +++ /dev/null @@ -1,585 +0,0 @@ - -######### input A: hyper 0 csc 0 - -========================= import_test: format 0 - - 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.4 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 1 - - 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.4 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 2 - - 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.4 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 3 - - 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 5.4 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -######### input A: hyper 0 csc 1 - -========================= import_test: format 0 - - 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.4 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 1 - - 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.4 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 2 - - 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.4 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 3 - - 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 5.4 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -######### input A: hyper 1 csc 0 - -========================= import_test: format 0 - - 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 5.9 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 1 - - 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 5.9 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 2 - - 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 5.9 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -========================= import_test: format 3 - - 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 5.9 KB - - (0,7) -0.834182 - (0,12) 1.26582 - (0,17) -0.336156 - (1,8) -0.834182 - (1,13) 1.01266 - (1,17) -0.29392 - (2,9) -0.834182 - (2,14) 0.759494 - (2,17) -0.221481 - (3,10) -0.834182 - (3,15) 0.506329 - (3,17) -0.118986 - (4,0) -0.278842 - (4,1) -0.8 - (4,6) 0.134462 - (4,7) 0.4 - (4,12) 0.4 - (5,0) -0.268019 - (5,2) -0.8 - (5,6) 0.117568 - (5,8) 0.4 - (5,13) 0.4 - (6,0) -0.232372 - (6,3) -0.8 - (6,6) 0.0885926 - (6,9) 0.4 - (6,14) 0.4 - (7,0) -0.157508 - (7,4) -0.8 - ... - -######### input A: hyper 1 csc 1 - -========================= import_test: format 0 - - 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 5.9 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 1 - - 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 5.9 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 2 - - 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 5.9 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... - -========================= import_test: format 3 - - 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 5.9 KB - - (4,0) -0.278842 - (5,0) -0.268019 - (6,0) -0.232372 - (7,0) -0.157508 - (8,0) -0.0632598 - (24,0) 0.139421 - (25,0) 0.134009 - (26,0) 0.116186 - (27,0) 0.0787541 - (28,0) 0.0316299 - (4,1) -0.8 - (20,1) -0.915953 - (24,1) 0.4 - (60,1) 1 - (5,2) -0.8 - (21,2) -0.915953 - (25,2) 0.4 - (60,2) 1 - (6,3) -0.8 - (22,3) -0.915953 - (26,3) 0.4 - (60,3) 1 - (7,4) -0.8 - (23,4) -0.915953 - (27,4) 0.4 - (60,4) 1 - (8,5) -0.8 - (28,5) 0.4 - (60,5) 1 - ... -import_demo: all tests passed diff --git a/GraphBLAS/Demo/Output/openmp_demo.out b/GraphBLAS/Demo/Output/openmp_demo.out deleted file mode 100644 index 1984601419..0000000000 --- a/GraphBLAS/Demo/Output/openmp_demo.out +++ /dev/null @@ -1,674 +0,0 @@ -Demo: ../build/openmp_demo: -User threads in this program are OpenMP threads. - -================= worker 0 starts: - -================= worker 4 starts: - -================= worker 2 starts: - -================= worker 3 starts: - -================= worker 6 starts: - -================= worker 7 starts: - -================= worker 1 starts: - -================= worker 5 starts: - ------------------ worker 0 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1000 out of range; must be < 6 - ------------------ worker 7 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1007 out of range; must be < 6 - ------------------ worker 3 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1003 out of range; must be < 6 - ------------------ worker 6 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1006 out of range; must be < 6 - ------------------ worker 4 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1004 out of range; must be < 6 - ------------------ worker 1 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1001 out of range; must be < 6 - ------------------ worker 2 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1002 out of range; must be < 6 - ------------------ worker 5 intentional error: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1005 out of range; must be < 6 - ------------------ worker 0 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101000 - (0,1) 102000 - (0,2) 103000 - (0,3) 104000 - (0,4) 105000 - (0,5) 106000 - (1,0) 201000 - (1,1) 202000 - (1,2) 203000 - (1,3) 204000 - (1,4) 205000 - (1,5) 206000 - (2,0) 301000 - (2,1) 302000 - (2,2) 303000 - (2,3) 304000 - (2,4) 305000 - (2,5) 306000 - (3,0) 401000 - (3,1) 402000 - (3,2) 403000 - (3,3) 404000 - (3,4) 405000 - (3,5) 406000 - (4,0) 501000 - (4,1) 502000 - (4,2) 503000 - (4,3) 504000 - (4,4) 505000 - ... - ------------------ worker 6 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101006 - (0,1) 102006 - (0,2) 103006 - (0,3) 104006 - (0,4) 105006 - (0,5) 106006 - (1,0) 201006 - (1,1) 202006 - (1,2) 203006 - (1,3) 204006 - (1,4) 205006 - (1,5) 206006 - (2,0) 301006 - (2,1) 302006 - (2,2) 303006 - (2,3) 304006 - (2,4) 305006 - (2,5) 306006 - (3,0) 401006 - (3,1) 402006 - (3,2) 403006 - (3,3) 404006 - (3,4) 405006 - (3,5) 406006 - (4,0) 501006 - (4,1) 502006 - (4,2) 503006 - (4,3) 504006 - (4,4) 505006 - ... - ------------------ worker 0 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1000 out of range; must be < 6 - ------------------ worker 3 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101003 - (0,1) 102003 - (0,2) 103003 - (0,3) 104003 - (0,4) 105003 - (0,5) 106003 - (1,0) 201003 - (1,1) 202003 - (1,2) 203003 - (1,3) 204003 - (1,4) 205003 - (1,5) 206003 - (2,0) 301003 - (2,1) 302003 - (2,2) 303003 - (2,3) 304003 - (2,4) 305003 - (2,5) 306003 - (3,0) 401003 - (3,1) 402003 - (3,2) 403003 - (3,3) 404003 - (3,4) 405003 - (3,5) 406003 - (4,0) 501003 - (4,1) 502003 - (4,2) 503003 - (4,3) 504003 - (4,4) 505003 - ... - ------------------ worker 4 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101004 - (0,1) 102004 - (0,2) 103004 - (0,3) 104004 - (0,4) 105004 - (0,5) 106004 - (1,0) 201004 - (1,1) 202004 - (1,2) 203004 - (1,3) 204004 - (1,4) 205004 - (1,5) 206004 - (2,0) 301004 - (2,1) 302004 - (2,2) 303004 - (2,3) 304004 - (2,4) 305004 - (2,5) 306004 - (3,0) 401004 - (3,1) 402004 - (3,2) 403004 - (3,3) 404004 - (3,4) 405004 - (3,5) 406004 - (4,0) 501004 - (4,1) 502004 - (4,2) 503004 - (4,3) 504004 - (4,4) 505004 - ... - ------------------ worker 2 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101002 - (0,1) 102002 - (0,2) 103002 - (0,3) 104002 - (0,4) 105002 - (0,5) 106002 - (1,0) 201002 - (1,1) 202002 - (1,2) 203002 - (1,3) 204002 - (1,4) 205002 - (1,5) 206002 - (2,0) 301002 - (2,1) 302002 - (2,2) 303002 - (2,3) 304002 - (2,4) 305002 - (2,5) 306002 - (3,0) 401002 - (3,1) 402002 - (3,2) 403002 - (3,3) 404002 - (3,4) 405002 - (3,5) 406002 - (4,0) 501002 - (4,1) 502002 - (4,2) 503002 - (4,3) 504002 - (4,4) 505002 - ... - ------------------ worker 3 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1003 out of range; must be < 6 - ------------------ worker 5 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101005 - (0,1) 102005 - (0,2) 103005 - (0,3) 104005 - (0,4) 105005 - (0,5) 106005 - (1,0) 201005 - (1,1) 202005 - (1,2) 203005 - (1,3) 204005 - (1,4) 205005 - (1,5) 206005 - (2,0) 301005 - (2,1) 302005 - (2,2) 303005 - (2,3) 304005 - (2,4) 305005 - (2,5) 306005 - (3,0) 401005 - (3,1) 402005 - (3,2) 403005 - (3,3) 404005 - (3,4) 405005 - (3,5) 406005 - (4,0) 501005 - (4,1) 502005 - (4,2) 503005 - (4,3) 504005 - (4,4) 505005 - ... - ------------------ worker 1 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101001 - (0,1) 102001 - (0,2) 103001 - (0,3) 104001 - (0,4) 105001 - (0,5) 106001 - (1,0) 201001 - (1,1) 202001 - (1,2) 203001 - (1,3) 204001 - (1,4) 205001 - (1,5) 206001 - (2,0) 301001 - (2,1) 302001 - (2,2) 303001 - (2,3) 304001 - (2,4) 305001 - (2,5) 306001 - (3,0) 401001 - (3,1) 402001 - (3,2) 403001 - (3,3) 404001 - (3,4) 405001 - (3,5) 406001 - (4,0) 501001 - (4,1) 502001 - (4,2) 503001 - (4,3) 504001 - (4,4) 505001 - ... - ------------------ worker 7 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101007 - (0,1) 102007 - (0,2) 103007 - (0,3) 104007 - (0,4) 105007 - (0,5) 106007 - (1,0) 201007 - (1,1) 202007 - (1,2) 203007 - (1,3) 204007 - (1,4) 205007 - (1,5) 206007 - (2,0) 301007 - (2,1) 302007 - (2,2) 303007 - (2,3) 304007 - (2,4) 305007 - (2,5) 306007 - (3,0) 401007 - (3,1) 402007 - (3,2) 403007 - (3,3) 404007 - (3,4) 405007 - (3,5) 406007 - (4,0) 501007 - (4,1) 502007 - (4,2) 503007 - (4,3) 504007 - (4,4) 505007 - ... - ------------------ worker 6 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1006 out of range; must be < 6 - ------------------ worker 5 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1005 out of range; must be < 6 - ------------------ worker 7 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1007 out of range; must be < 6 - ------------------ worker 2 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1002 out of range; must be < 6 - ------------------ worker 4 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1004 out of range; must be < 6 - ------------------ worker 1 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1001 out of range; must be < 6 - ----- Leader prints matrix 0 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101000 - (0,1) 102000 - (0,2) 103000 - (0,3) 104000 - (0,4) 105000 - (0,5) 106000 - (1,0) 201000 - (1,1) 202000 - (1,2) 203000 - (1,3) 204000 - (1,4) 205000 - (1,5) 206000 - (2,0) 301000 - (2,1) 302000 - (2,2) 303000 - (2,3) 304000 - (2,4) 305000 - (2,5) 306000 - (3,0) 401000 - (3,1) 402000 - (3,2) 403000 - (3,3) 404000 - (3,4) 405000 - (3,5) 406000 - (4,0) 501000 - (4,1) 502000 - (4,2) 503000 - (4,3) 504000 - (4,4) 505000 - ... - ----- Leader prints matrix 1 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101001 - (0,1) 102001 - (0,2) 103001 - (0,3) 104001 - (0,4) 105001 - (0,5) 106001 - (1,0) 201001 - (1,1) 202001 - (1,2) 203001 - (1,3) 204001 - (1,4) 205001 - (1,5) 206001 - (2,0) 301001 - (2,1) 302001 - (2,2) 303001 - (2,3) 304001 - (2,4) 305001 - (2,5) 306001 - (3,0) 401001 - (3,1) 402001 - (3,2) 403001 - (3,3) 404001 - (3,4) 405001 - (3,5) 406001 - (4,0) 501001 - (4,1) 502001 - (4,2) 503001 - (4,3) 504001 - (4,4) 505001 - ... - ----- Leader prints matrix 2 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101002 - (0,1) 102002 - (0,2) 103002 - (0,3) 104002 - (0,4) 105002 - (0,5) 106002 - (1,0) 201002 - (1,1) 202002 - (1,2) 203002 - (1,3) 204002 - (1,4) 205002 - (1,5) 206002 - (2,0) 301002 - (2,1) 302002 - (2,2) 303002 - (2,3) 304002 - (2,4) 305002 - (2,5) 306002 - (3,0) 401002 - (3,1) 402002 - (3,2) 403002 - (3,3) 404002 - (3,4) 405002 - (3,5) 406002 - (4,0) 501002 - (4,1) 502002 - (4,2) 503002 - (4,3) 504002 - (4,4) 505002 - ... - ----- Leader prints matrix 3 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101003 - (0,1) 102003 - (0,2) 103003 - (0,3) 104003 - (0,4) 105003 - (0,5) 106003 - (1,0) 201003 - (1,1) 202003 - (1,2) 203003 - (1,3) 204003 - (1,4) 205003 - (1,5) 206003 - (2,0) 301003 - (2,1) 302003 - (2,2) 303003 - (2,3) 304003 - (2,4) 305003 - (2,5) 306003 - (3,0) 401003 - (3,1) 402003 - (3,2) 403003 - (3,3) 404003 - (3,4) 405003 - (3,5) 406003 - (4,0) 501003 - (4,1) 502003 - (4,2) 503003 - (4,3) 504003 - (4,4) 505003 - ... - ----- Leader prints matrix 4 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101004 - (0,1) 102004 - (0,2) 103004 - (0,3) 104004 - (0,4) 105004 - (0,5) 106004 - (1,0) 201004 - (1,1) 202004 - (1,2) 203004 - (1,3) 204004 - (1,4) 205004 - (1,5) 206004 - (2,0) 301004 - (2,1) 302004 - (2,2) 303004 - (2,3) 304004 - (2,4) 305004 - (2,5) 306004 - (3,0) 401004 - (3,1) 402004 - (3,2) 403004 - (3,3) 404004 - (3,4) 405004 - (3,5) 406004 - (4,0) 501004 - (4,1) 502004 - (4,2) 503004 - (4,3) 504004 - (4,4) 505004 - ... - ----- Leader prints matrix 5 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101005 - (0,1) 102005 - (0,2) 103005 - (0,3) 104005 - (0,4) 105005 - (0,5) 106005 - (1,0) 201005 - (1,1) 202005 - (1,2) 203005 - (1,3) 204005 - (1,4) 205005 - (1,5) 206005 - (2,0) 301005 - (2,1) 302005 - (2,2) 303005 - (2,3) 304005 - (2,4) 305005 - (2,5) 306005 - (3,0) 401005 - (3,1) 402005 - (3,2) 403005 - (3,3) 404005 - (3,4) 405005 - (3,5) 406005 - (4,0) 501005 - (4,1) 502005 - (4,2) 503005 - (4,3) 504005 - (4,4) 505005 - ... - ----- Leader prints matrix 6 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101006 - (0,1) 102006 - (0,2) 103006 - (0,3) 104006 - (0,4) 105006 - (0,5) 106006 - (1,0) 201006 - (1,1) 202006 - (1,2) 203006 - (1,3) 204006 - (1,4) 205006 - (1,5) 206006 - (2,0) 301006 - (2,1) 302006 - (2,2) 303006 - (2,3) 304006 - (2,4) 305006 - (2,5) 306006 - (3,0) 401006 - (3,1) 402006 - (3,2) 403006 - (3,3) 404006 - (3,4) 405006 - (3,5) 406006 - (4,0) 501006 - (4,1) 502006 - (4,2) 503006 - (4,3) 504006 - (4,4) 505006 - ... - ----- Leader prints matrix 7 - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 520 bytes - - (0,0) 101007 - (0,1) 102007 - (0,2) 103007 - (0,3) 104007 - (0,4) 105007 - (0,5) 106007 - (1,0) 201007 - (1,1) 202007 - (1,2) 203007 - (1,3) 204007 - (1,4) 205007 - (1,5) 206007 - (2,0) 301007 - (2,1) 302007 - (2,2) 303007 - (2,3) 304007 - (2,4) 305007 - (2,5) 306007 - (3,0) 401007 - (3,1) 402007 - (3,2) 403007 - (3,3) 404007 - (3,4) 405007 - (3,5) 406007 - (4,0) 501007 - (4,1) 502007 - (4,2) 503007 - (4,3) 504007 - (4,4) 505007 - ... diff --git a/GraphBLAS/Demo/Output/simple_demo.out b/GraphBLAS/Demo/Output/simple_demo.out index da2cbc43ea..26c0611b0f 100644 --- a/GraphBLAS/Demo/Output/simple_demo.out +++ b/GraphBLAS/Demo/Output/simple_demo.out @@ -1,11 +1,11 @@ first 10 random numbers: - 0.257524 - 0.688456 - 0.815877 - 0.351514 - 0.178770 - 0.178199 - 0.571497 - 0.566362 - 0.674999 - 0.681490 + 0.000000 + 0.062504 + 0.605934 + 0.958328 + 0.523622 + 0.963628 + 0.633881 + 0.774118 + 0.489227 + 0.451715 diff --git a/GraphBLAS/Demo/Output/wathen_demo.out b/GraphBLAS/Demo/Output/wathen_demo.out new file mode 100644 index 0000000000..807c517d8a --- /dev/null +++ b/GraphBLAS/Demo/Output/wathen_demo.out @@ -0,0 +1,4 @@ + + 341x341 GraphBLAS double matrix, sparse by row, ints: 64/64 + A, 4861 entries, memory: 78.9 KB + diff --git a/GraphBLAS/Demo/Output/wildtype_demo.out b/GraphBLAS/Demo/Output/wildtype_demo.out index c7e73afe6b..e151a8d675 100644 --- a/GraphBLAS/Demo/Output/wildtype_demo.out +++ b/GraphBLAS/Demo/Output/wildtype_demo.out @@ -1,18 +1,27 @@ [ GxB_Type_new - 9.48e-06 sec ] - GraphBLAS type: WildType user-defined: [wildtype] size: 192 + 5.24e-06 sec ] + GraphBLAS Type: WildType user-defined: [wildtype] size: 192 typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; WildType size: 192 - GraphBLAS type: WildType user-defined: [wildtype] size: 192 + GraphBLAS Type: WildType user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - +(convert ints 32/32 to 64/64, time: 3.1637e-06) a wildtype scalar: scalar1 [this is from scalar1] 0.0 1.0 2.0 3.0 100.0 101.0 102.0 103.0 200.0 201.0 202.0 203.0 300.0 301.0 302.0 303.0 -(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) [ GrB_transpose (wait:A 0 zombies, 2 pending) (build) (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/de/GB_jit__build__02eeeee__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/de/GB_jit__build__02eeeee__wildtype.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/de/libGB_jit__build__02eeeee__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/de/GB_jit__build__02eeeee__wildtype.o -lm -ldl -lgomp -lpthread ") add:(H<.>=H+H) (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/77/GB_jit__add__1002e0e0eee00__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/77/GB_jit__add__1002e0e0eee00__wildtype.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/77/libGB_jit__add__1002e0e0eee00__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/77/GB_jit__add__1002e0e0eee00__wildtype.o -lm -ldl -lgomp -lpthread ") (hyper to sparse) (transpose) (builder transpose) (hyper to sparse) - 0.556 sec ] +(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) (build 32/32 time: 5.80074e-06) (convert ints 32/32 to 64/64, time: 2.24216e-06) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/5b/GB_jit__iso_expand__01002ee0eef__wildtype.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/5b/GB_jit__iso_expand__01002ee0eef__wildtype.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/5b/libGB_jit__iso_expand__01002ee0eef__wildtype.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/5b/GB_jit__iso_expand__01002ee0eef__wildtype.o' -lm -ldl -lgomp -lpthread 2>&1 " +(convert ints 32/32 to 64/64, time: 4.99608e-06) [ GrB_transpose (wait:A 0 zombies, 2 pending) (build, 1 threads) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/35/GB_jit__build__a90eeeee__wildtype.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/35/GB_jit__build__a90eeeee__wildtype.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/35/libGB_jit__build__a90eeeee__wildtype.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/35/GB_jit__build__a90eeeee__wildtype.o' -lm -ldl -lgomp -lpthread 2>&1 " +(build 32/32 time: 0.0503795) (convert ints 32/32 to 64/64, time: 5.36721e-06) add:(H<.>=H+H) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/ba/GB_jit__add__00010e0e0eee00__wildtype.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/ba/GB_jit__add__00010e0e0eee00__wildtype.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/ba/libGB_jit__add__00010e0e0eee00__wildtype.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/ba/GB_jit__add__00010e0e0eee00__wildtype.o' -lm -ldl -lgomp -lpthread 2>&1 " +(hyper to sparse) (transpose) (builder transpose) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/94/GB_jit__build__290eeeee__wildtype.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/94/GB_jit__build__290eeeee__wildtype.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/94/libGB_jit__build__290eeeee__wildtype.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/94/GB_jit__build__290eeeee__wildtype.o' -lm -ldl -lgomp -lpthread 2>&1 " +(build 64/64 time: 0.0508151) (hyper to sparse) + 0.207 sec ] a wildtype scalar: got scalar2 = C(7,2) [this is A(2,7)] 0.0 1.0 2.0 3.0 @@ -21,11 +30,14 @@ a wildtype scalar: got scalar2 = C(7,2) [this is A(2,7)] 300.0 301.0 302.0 303.0 GraphBLAS BinaryOp: WildAdd (user-defined): z=wildadd(x,y) - GraphBLAS type: ztype user-defined: [wildtype] size: 192 + GraphBLAS Type: ztype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: xtype user-defined: [wildtype] size: 192 + GraphBLAS Type: xtype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: ytype user-defined: [wildtype] size: 192 + GraphBLAS Type: ytype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; void wildadd (wildtype *z, const wildtype *x, const wildtype *y) { @@ -42,11 +54,14 @@ void wildadd (wildtype *z, const wildtype *x, const wildtype *y) } GraphBLAS BinaryOp: WildMult (user-defined): z=wildmult(x,y) - GraphBLAS type: ztype user-defined: [wildtype] size: 192 + GraphBLAS Type: ztype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: xtype user-defined: [wildtype] size: 192 + GraphBLAS Type: xtype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: ytype user-defined: [wildtype] size: 192 + GraphBLAS Type: ytype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; void wildmult (wildtype *z, const wildtype *x, const wildtype *y) { @@ -65,13 +80,13 @@ void wildmult (wildtype *z, const wildtype *x, const wildtype *y) char *pdst = z->whatstuff ; while ((*pdst++ = *psrc++)) ; } - +(convert ints 32/32 to 64/64, time: 4.48665e-06) a wildtype scalar: scalar2 [here is scalar2] 0.5 1.5 2.5 3.5 -0.5 0.5 1.5 2.5 -1.5 -0.5 0.5 1.5 -2.5 -1.5 -0.5 0.5 -(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) +(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) (build 32/32 time: 7.86409e-06) (convert ints 32/32 to 64/64, time: 3.42587e-06) a wildtype scalar: scalar_identity for the monoid [identity] 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -81,11 +96,14 @@ a wildtype scalar: scalar_identity for the monoid [identity] GraphBLAS Semiring: InTheWild (user-defined): (wildadd_wildmult) GraphBLAS Monoid: semiring->add (user-defined): GraphBLAS BinaryOp: monoid->op (user-defined): z=wildadd(x,y) - GraphBLAS type: ztype user-defined: [wildtype] size: 192 + GraphBLAS Type: ztype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: xtype user-defined: [wildtype] size: 192 + GraphBLAS Type: xtype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: ytype user-defined: [wildtype] size: 192 + GraphBLAS Type: ytype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; void wildadd (wildtype *z, const wildtype *x, const wildtype *y) { @@ -101,13 +119,15 @@ void wildadd (wildtype *z, const wildtype *x, const wildtype *y) while ((*pdst++ = *psrc++)) ; } identity: [ [user-defined value] ] - GraphBLAS BinaryOp: semiring->multiply (user-defined): z=wildmult(x,y) - GraphBLAS type: ztype user-defined: [wildtype] size: 192 + GraphBLAS Type: ztype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: xtype user-defined: [wildtype] size: 192 + GraphBLAS Type: xtype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; - GraphBLAS type: ytype user-defined: [wildtype] size: 192 + GraphBLAS Type: ytype user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; void wildmult (wildtype *z, const wildtype *x, const wildtype *y) { @@ -131,15 +151,16 @@ multiplication C=A*B InTheWild semiring: Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS wildtype matrix, sparse by row + 10x10 GraphBLAS wildtype matrix, sparse by row, ints: 64/64 input A, 3 entries, memory: 920 bytes (2,4) [user-defined value] (2,7) [user-defined value] (3,7) [user-defined value] +matrix type given name: [WildType] [ GrB_Matrix_nvals - 1.11e-06 sec ] + 1.52e-06 sec ] ============= printing the WildType matrix: input A (10-by-10 with 3 entries) @@ -171,20 +192,22 @@ a wildtype scalar: [this is A(3,7)] Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS wildtype matrix, hypersparse by row + 10x10 GraphBLAS wildtype matrix, hypersparse by row, ints: 64/64 input B, 1 entry, memory: 52.5 KB pending tuples: 2 max pending: 256 zombies: 0 (7,2) [user-defined value] pending tuples: - GraphBLAS type: user-defined: [wildtype] size: 192 + GraphBLAS Type: user-defined: [wildtype] size: 192 + Type given name: [WildType] typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; row: 7 col: 5 [user-defined value] row: 4 col: 2 [user-defined value] pending operator: implicit 2nd - [ GrB_Matrix_nvals (wait:A 0 zombies, 2 pending) (build) add:(H<.>=H+H) (hyper to sparse) - 0.000173 sec ] +matrix type given name: [WildType] + [ GrB_Matrix_nvals (wait:A 0 zombies, 2 pending) (build, 1 threads) (build 32/32 time: 1.33016e-05) (convert ints 32/32 to 64/64, time: 3.21213e-06) add:(H<.>=H+H) (hyper to sparse) + 0.00016 sec ] ============= printing the WildType matrix: input B (10-by-10 with 3 entries) @@ -213,12 +236,14 @@ a wildtype scalar: [here is B(7,5)] -2.5 -1.5 -0.5 0.5 ============= that was the WildType matrix input B - [ GrB_mxm C=A*B, saxpy (S = S*S, anz: 3 bnz: 3) axbwork 8 (intensity: 1.14 workspace/(nnz(A)+nnz(B)): 1.43) (nthreads 1 coarse: 1) (sparse saxpy) (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/21/GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/21/GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/21/libGB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/21/GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult.o -lm -ldl -lgomp -lpthread ") - 0.978 sec ] + [ GrB_mxm C=A*B, saxpy (S = S*S, anz: 3 bnz: 3) axbwork 8 (intensity: 1.14 workspace/(nnz(A)+nnz(B)): 1.43) (nthreads 1 coarse: 1) (sparse saxpy) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/0a/GB_jit__AxB_saxpy3__0100eee0eee45__wildadd_wildmult.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/0a/GB_jit__AxB_saxpy3__0100eee0eee45__wildadd_wildmult.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/0a/libGB_jit__AxB_saxpy3__0100eee0eee45__wildadd_wildmult.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/0a/GB_jit__AxB_saxpy3__0100eee0eee45__wildadd_wildmult.o' -lm -ldl -lgomp -lpthread 2>&1 " + + 0.34 sec ] Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS wildtype matrix, sparse by row + 10x10 GraphBLAS wildtype matrix, sparse by row, ints: 64/64 output C, 4 entries, memory: 1.1 KB (2,2) [user-defined value] @@ -226,8 +251,9 @@ Printing the matrix with GxB_Matrix_fprint: (3,2) [user-defined value] (3,5) [user-defined value] +matrix type given name: [WildType] [ GrB_Matrix_nvals - 5.17e-07 sec ] + 7.12e-08 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -266,27 +292,29 @@ a wildtype scalar: [this was multiplied] ============= that was the WildType matrix output C ------ C=C*C'---------------------------------------- - +(convert ints 32/32 to 64/64, time: 2.50107e-06) The mask matrix M: - 10x10 GraphBLAS bool matrix, hypersparse by row + 10x10 GraphBLAS bool matrix, hypersparse by row, ints: 64/64 M, no entries, memory: 4.4 KB iso value: 1 pending tuples: 4 max pending: 256 zombies: 0 pending tuples: - GraphBLAS type: bool size: 1 + GraphBLAS Type: bool size: 1 row: 2 col: 2 row: 2 col: 3 row: 3 col: 2 row: 3 col: 3 pending operator: implicit 2nd - [ GrB_mxm (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = S'*S) nthreads 1 ntasks 1 (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/0f/GB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/0f/GB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/0f/libGB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/0f/GB_jit__AxB_dot3__03fe100eee2eee55__wildadd_wildmult.o -lm -ldl -lgomp -lpthread ") - 0.51 sec ] + [ GrB_mxm (iso wait:M 0 zombies, 4 pending) (iso build, 1 threads) (build 32/32 time: 7.91205e-06) (hyper to sparse) (convert ints 32/32 to 64/64, time: 1.05193e-06) C=A'*B, masked_dot_product (dot3) (S{S} = S'*S) nthreads 1 ntasks 1 (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/38/GB_jit__AxB_dot3__0100eee2eee55__wildadd_wildmult.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/38/GB_jit__AxB_dot3__0100eee2eee55__wildadd_wildmult.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/38/libGB_jit__AxB_dot3__0100eee2eee55__wildadd_wildmult.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/38/GB_jit__AxB_dot3__0100eee2eee55__wildadd_wildmult.o' -lm -ldl -lgomp -lpthread 2>&1 " + + 0.156 sec ] Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS wildtype matrix, sparse by row + 10x10 GraphBLAS wildtype matrix, sparse by row, ints: 64/64 output C, 4 entries, memory: 1.3 KB (2,2) [user-defined value] @@ -294,8 +322,9 @@ Printing the matrix with GxB_Matrix_fprint: (3,2) [user-defined value] (3,3) [user-defined value] +matrix type given name: [WildType] [ GrB_Matrix_nvals - 4.27e-07 sec ] + 8.89e-08 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -332,8 +361,10 @@ a wildtype scalar: [this was added] -13424304.0 -2565388.0 6850828.0 16267044.0 ============= that was the WildType matrix output C - [ GrB_reduce (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b7/GB_jit__reduce__03feee1__wildadd.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b7/GB_jit__reduce__03feee1__wildadd.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/b7/libGB_jit__reduce__03feee1__wildadd.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/b7/GB_jit__reduce__03feee1__wildadd.o -lm -ldl -lgomp -lpthread ") - 0.245 sec ] + [ GrB_reduce (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/5c/GB_jit__reduce__00ee1__wildadd.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/5c/GB_jit__reduce__00ee1__wildadd.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/5c/libGB_jit__reduce__00ee1__wildadd.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/5c/GB_jit__reduce__00ee1__wildadd.o' -lm -ldl -lgomp -lpthread 2>&1 " + + 0.0681 sec ] a wildtype scalar: sum (first time) [this was added] -111773.5 269.5 93412.5 583455.5 @@ -341,15 +372,17 @@ a wildtype scalar: sum (first time) [this was added] -92402621.5 2801413.5 85075148.5 622622583.5 -149241466.8 471094.8 130123106.2 959972867.8 [ GrB_reduce - 1.2e-05 sec ] + 2.65e-06 sec ] a wildtype scalar: sum (again) [this was added] -111773.5 269.5 93412.5 583455.5 -49510798.5 271594.5 43367587.5 319487980.5 -92402621.5 2801413.5 85075148.5 622622583.5 -149241466.8 471094.8 130123106.2 959972867.8 - [ GxB_set (transpose) (in-place transpose) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit: sh -c "/usr/bin/cc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/faculty/d/davis/.SuiteSparse/GrB9.0.0/src -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/6c/GB_jit__trans_unop__0802ee0ee5__wildtype.o -c /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/6c/GB_jit__trans_unop__0802ee0ee5__wildtype.c ; /usr/bin/cc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/lib/6c/libGB_jit__trans_unop__0802ee0ee5__wildtype.so /home/faculty/d/davis/.SuiteSparse/GrB9.0.0/c/6c/GB_jit__trans_unop__0802ee0ee5__wildtype.o -lm -ldl -lgomp -lpthread ") - 0.212 sec ] + [ GrB_set (transpose) (in-place transpose) (transpose) (1-thread bucket transpose) (jit: compile and load) (jit compile:) +sh -c "/usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -I'/home/davis/.SuiteSparse/GrB10.0.0/src' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/template' -I'/home/davis/.SuiteSparse/GrB10.0.0/src/include' -o '/home/davis/.SuiteSparse/GrB10.0.0/c/fe/GB_jit__trans_unop__04802ee0ee5__wildtype.o' -c '/home/davis/.SuiteSparse/GrB10.0.0/c/fe/GB_jit__trans_unop__04802ee0ee5__wildtype.c' 2>&1 ; /usr/bin/gcc -Wundef -Wno-strict-aliasing -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -Wall -Wextra -Wpedantic -Werror -O3 -DNDEBUG -fPIC -fopenmp -shared -o '/home/davis/.SuiteSparse/GrB10.0.0/lib/fe/libGB_jit__trans_unop__04802ee0ee5__wildtype.so' '/home/davis/.SuiteSparse/GrB10.0.0/c/fe/GB_jit__trans_unop__04802ee0ee5__wildtype.o' -lm -ldl -lgomp -lpthread 2>&1 " + + 0.0649 sec ] C is now stored by column, but it looks just the same to the GraphBLAS user application. The difference is opaque, in the @@ -357,7 +390,7 @@ internal data structure. Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS wildtype matrix, sparse by col + 10x10 GraphBLAS wildtype matrix, sparse by col, ints: 64/64 output C, 4 entries, memory: 1.1 KB (2,2) [user-defined value] @@ -365,8 +398,9 @@ Printing the matrix with GxB_Matrix_fprint: (2,3) [user-defined value] (3,3) [user-defined value] +matrix type given name: [WildType] [ GrB_Matrix_nvals - 5.4e-07 sec ] + 8.2e-08 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -403,18 +437,19 @@ a wildtype scalar: [this was added] -13424304.0 -2565388.0 6850828.0 16267044.0 ============= that was the WildType matrix output C - +(convert ints 32/32 to 64/64, time: 2.65799e-06) Printing the matrix with GxB_Matrix_fprint: - 10x10 GraphBLAS float matrix, hypersparse by row + 10x10 GraphBLAS float matrix, hypersparse by row, ints: 64/64 D, no entries, memory: 256 bytes +matrix type given name: [GrB_FP32] The matrix D is not wild enough to print. - [ GrB_apply (shallow-op) - 3.66e-05 sec ] +(convert ints 32/32 to 64/64, time: 4.31621e-06) [ GrB_apply (shallow-op) + 1.88e-05 sec ] - 10x10 GraphBLAS int64_t matrix, sparse by row + 10x10 GraphBLAS int64_t matrix, sparse by row, ints: 64/64 E (positional i), 3 entries, memory: 368 bytes (2,4) 2 @@ -422,9 +457,9 @@ The matrix D is not wild enough to print. (3,7) 3 [ GrB_apply (shallow-op) - 1.26e-05 sec ] + 4.14e-06 sec ] - 10x10 GraphBLAS int64_t matrix, sparse by row + 10x10 GraphBLAS int64_t matrix, sparse by row, ints: 64/64 E (positional j), 3 entries, memory: 368 bytes (2,4) 4 @@ -432,11 +467,11 @@ The matrix D is not wild enough to print. (3,7) 7 [ GrB_eWiseAdd - 7.58e-06 sec ] + 8.19e-06 sec ] This is supposed to fail, as a demo of GrB_error: GraphBLAS error: GrB_DOMAIN_MISMATCH -function: GrB_Matrix_eWiseAdd_BinaryOp (C, M, accum, add, A, B, desc) +function: GrB_Matrix_eWiseAdd (C, M, accum, op, A, B, desc) Incompatible type for z=wildadd(x,y): second input of type [float] cannot be typecast to y input of type [wildtype] diff --git a/GraphBLAS/Demo/Program/complex_demo.c b/GraphBLAS/Demo/Program/complex_demo.c index 94c0554262..fcf2cef358 100644 --- a/GraphBLAS/Demo/Program/complex_demo.c +++ b/GraphBLAS/Demo/Program/complex_demo.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Program/complex_demo.c: demo for user-defined complex type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,9 +13,9 @@ #include "graphblas_demos.h" #include "usercomplex.h" -#include "usercomplex.c" -#include "simple_rand.c" #include "random_matrix.c" +#include "usercomplex.c" +#define FREE_ALL ; //------------------------------------------------------------------------------ // print a complex matrix @@ -78,11 +78,11 @@ int main (int argc, char **argv) GrB_Info info ; GrB_init (GrB_NONBLOCKING) ; int nthreads ; - GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads, GxB_NTHREADS)) ; fprintf (stderr, "complex_demo: nthreads: %d\n", nthreads) ; // print in 1-based notation - GxB_Global_Option_set (GxB_PRINT_1BASED, true) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_PRINT_1BASED)) ; bool predefined = (argc > 1) ; if (predefined) @@ -102,9 +102,9 @@ int main (int argc, char **argv) } // generate random matrices A and B - simple_rand_seed (1) ; - random_matrix (&A, false, false, m, k, 6, 0, true) ; - random_matrix (&B, false, false, k, n, 8, 0, true) ; + uint64_t state = 1 ; + random_matrix (&A, false, false, m, k, 6, 0, true, &state) ; + random_matrix (&B, false, false, k, n, 8, 0, true, &state) ; GxB_Matrix_fprint (A, "A", GxB_SHORT, stderr) ; GxB_Matrix_fprint (B, "B", GxB_SHORT, stderr) ; diff --git a/GraphBLAS/Demo/Program/context_demo.c b/GraphBLAS/Demo/Program/context_demo.c index 92ba21dfeb..275fc26a46 100644 --- a/GraphBLAS/Demo/Program/context_demo.c +++ b/GraphBLAS/Demo/Program/context_demo.c @@ -2,46 +2,32 @@ // GraphBLAS/Demo/Program/context_demo: example for the GxB_Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#include "GraphBLAS.h" -#undef I -#include "simple_rand.h" -#include "simple_rand.c" -#define MIN(x,y) ((x) < (y)) ? (x) : (y) -#define MAX(x,y) ((x) > (y)) ? (x) : (y) -#ifdef _OPENMP -#include -#define TIMER omp_get_wtime ( ) -#else -#define TIMER 0 -#endif +#include "graphblas_demos.h" +#define FREE_ALL ; -#undef OK -#define OK(method) \ +#define TRY(method) \ { \ - GrB_Info info = (method) ; \ - if (info != GrB_SUCCESS) \ - { \ - printf ("abort at line: %d, info: %d\n", __LINE__, info) ; \ - abort ( ) ; \ - } \ + GrB_Info info = method ; \ + if (info != GrB_SUCCESS) printf ("Failure: %d, %s, %d\n", info, \ + __FILE__, __LINE__) ; \ } int main (void) { #if defined ( _MSC_VER ) - printf ("context_demo: requires OpenMP 4.0 (not supported on Windows)\n") ; + printf ("context_demo: requires OpenMP 4.0\n") ; #else // start GraphBLAS + GrB_Info info ; OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads_max = 0 ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads_max)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads_max, GxB_NTHREADS)) ; nthreads_max = MIN (nthreads_max, 256) ; printf ("context demo: nthreads_max %d\n", nthreads_max) ; OK (GxB_Context_fprint (GxB_CONTEXT_WORLD, "World", GxB_COMPLETE, stdout)) ; @@ -55,7 +41,7 @@ int main (void) } printf ("\nnthreads to use: %d\n", nthreads) ; - OK (GxB_Global_Option_set (GxB_GLOBAL_NTHREADS, nthreads)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, nthreads, GxB_NTHREADS)) ; #ifdef _OPENMP omp_set_max_active_levels (2) ; @@ -67,15 +53,15 @@ int main (void) GrB_Index n = 100000 ; GrB_Index nvals = 20000000 ; - simple_rand_seed (1) ; + uint64_t state = 1 ; GrB_Index *I = malloc (nvals * sizeof (GrB_Index)) ; GrB_Index *J = malloc (nvals * sizeof (GrB_Index)) ; double *X = malloc (nvals * sizeof (double)) ; for (int k = 0 ; k < nvals ; k++) { - I [k] = simple_rand_i ( ) % n ; - J [k] = simple_rand_i ( ) % n ; - X [k] = simple_rand_x ( ) ; + I [k] = simple_rand (&state) % n ; + J [k] = simple_rand (&state) % n ; + X [k] = simple_rand_x (&state) ; } //-------------------------------------------------------------------------- @@ -102,7 +88,7 @@ int main (void) if (nouter <= nmat) { - double t = TIMER ; + double t = WALLCLOCK ; #pragma omp parallel for num_threads (nouter) \ schedule (dynamic, 1) @@ -110,25 +96,27 @@ int main (void) { // each user thread constructs its own context GxB_Context Context = NULL ; - OK (GxB_Context_new (&Context)) ; - OK (GxB_Context_set (Context, GxB_NTHREADS, ninner)) ; - OK (GxB_Context_engage (Context)) ; + TRY (GxB_Context_new (&Context)) ; + TRY (GxB_Context_set_INT (Context, ninner, + GxB_NTHREADS)) ; +// TRY (GxB_Context_set (Context, GxB_NTHREADS, ninner)) ; + TRY (GxB_Context_engage (Context)) ; // kth user thread builds kth matrix with ninner threads GrB_Matrix A = NULL ; - OK (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; - OK (GrB_Matrix_build (A, I, J, X, nvals, + TRY (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; + TRY (GrB_Matrix_build (A, I, J, X, nvals, GrB_PLUS_FP64)) ; // free the matrix just built - OK (GrB_Matrix_free (&A)) ; + TRY (GrB_Matrix_free (&A)) ; // each user thread frees its own context - OK (GxB_Context_disengage (Context)) ; - OK (GxB_Context_free (&Context)) ; + TRY (GxB_Context_disengage (Context)) ; + TRY (GxB_Context_free (&Context)) ; } - t = TIMER - t ; + t = WALLCLOCK - t ; if (nouter == 1 && ninner == 1) t1 = t ; printf (" threads (%4d,%4d): %4d " diff --git a/GraphBLAS/Demo/Program/gauss_demo.c b/GraphBLAS/Demo/Program/gauss_demo.c index c4567ea650..c3df001d50 100644 --- a/GraphBLAS/Demo/Program/gauss_demo.c +++ b/GraphBLAS/Demo/Program/gauss_demo.c @@ -2,13 +2,13 @@ // GraphBLAS/Demo/Program/gauss_demo: Gaussian integers //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "graphblas_demos.h" -#undef I +#define FREE_ALL ; //------------------------------------------------------------------------------ // the Gaussian integer: real and imaginary parts @@ -141,35 +141,13 @@ void ijgauss (int64_t *z, const gauss *x, GrB_Index i, GrB_Index j, // not recommended for large matrices. However, it looks nice for this demo // since the matrix is small. -#undef OK -#define OK(x) \ -{ \ - if (!(x)) \ - { \ - printf ("info: %d error! File %s, Line %d\n", \ - info, __FILE__, __LINE__) ; \ - fprintf (stderr, "info: %d error! File %s, Line %d\n", \ - info, __FILE__, __LINE__) ; \ - fflush (stdout) ; \ - fflush (stderr) ; \ - abort ( ) ; \ - } \ -} - -#undef TRY -#define TRY(method) \ -{ \ - info = (method) ; \ - OK (info == GrB_SUCCESS) ; \ -} - void printgauss (GrB_Matrix A, char *name) { // print the matrix GrB_Info info = GrB_SUCCESS ; GrB_Index m, n ; - TRY (GrB_Matrix_nrows (&m, A)) ; - TRY (GrB_Matrix_ncols (&n, A)) ; + GrB_Matrix_nrows (&m, A) ; + GrB_Matrix_ncols (&n, A) ; printf ("\n%s\nsize: %d-by-%d\n", name, (int) m, (int) n) ; for (int i = 0 ; i < m ; i++) { @@ -186,7 +164,10 @@ void printgauss (GrB_Matrix A, char *name) { printf (" (%4d,%4d)", a.real, a.imag) ; } - else TRY (GrB_PANIC) ; + else + { + printf (" error: %d!", info) ; + } } printf ("\n") ; } @@ -203,58 +184,57 @@ int main (void) // start GraphBLAS GrB_Info info = GrB_SUCCESS ; - TRY (GrB_init (GrB_NONBLOCKING)) ; - TRY (GxB_Global_Option_set (GxB_BURBLE, true)) ; + OK (GrB_init (GrB_NONBLOCKING)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; // try using cmake to build all JIT kernels, just as a test. This setting // is ignored by Windows (for MSVC it is treated as always true, and for // MINGW it is treated as always false). Only Linux and Mac can change // this setting. - TRY (GxB_Global_Option_set (GxB_JIT_USE_CMAKE, true)) ; -// TRY (GxB_Global_Option_set (GxB_JIT_ERROR_FALLBACK, false)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_JIT_USE_CMAKE)) ; printf ("Gauss demo. Note that all transposes are array transposes,\n" "not matrix (conjugate) transposes.\n\n") ; -// try changing the error log file for compiler errors -// TRY (GxB_Global_Option_set (GxB_JIT_ERROR_LOG, "/tmp/grb_jit_errors.txt")) ; + OK (GxB_Context_fprint (GxB_CONTEXT_WORLD, "World", GxB_COMPLETE, stdout)); + + printf ("JIT configuration: ------------------\n") ; + char str [5000] ; + + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_COMPILER_NAME)) ; + printf ("JIT C compiler: [%s]\n", str) ; -// try changing the cache path -// TRY (GxB_Global_Option_set (GxB_JIT_CACHE_PATH, -// "/home/faculty/d/davis/mycache")) ; + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_COMPILER_FLAGS)) ; + printf ("JIT C flags: [%s]\n", str) ; + + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_LINKER_FLAGS)) ; + printf ("JIT C link flags: [%s]\n", str) ; + + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_LIBRARIES)) ; + printf ("JIT C libraries: [%s]\n", str) ; + + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_PREFACE)) ; + printf ("JIT C preface: [%s]\n", str) ; + + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_CACHE_PATH)) ; + printf ("JIT cache: [%s]\n", str) ; - TRY (GxB_Context_fprint (GxB_CONTEXT_WORLD, "World", GxB_COMPLETE, stdout)); - char *compiler, *cache, *flags, *link, *libraries, *preface ; int control ; - TRY (GxB_Global_Option_get (GxB_JIT_C_COMPILER_NAME, &compiler)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_COMPILER_FLAGS, &flags)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_LINKER_FLAGS, &link)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_LIBRARIES, &libraries)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_PREFACE, &preface)) ; - TRY (GxB_Global_Option_get (GxB_JIT_CACHE_PATH, &cache)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; - printf ("JIT configuration: ------------------\n") ; - printf ("JIT C compiler: [%s]\n", compiler) ; - printf ("JIT C flags: [%s]\n", flags) ; - printf ("JIT C link flags: [%s]\n", link) ; - printf ("JIT C libraries: [%s]\n", libraries) ; - printf ("JIT C preface: [%s]\n", preface) ; - printf ("JIT cache: [%s]\n", cache) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; printf ("JIT C control: [%d]\n", control) ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; int save = control ; printf ("JIT C control: [%d] reset\n", control) ; printf ("-------------------------------------\n\n") ; - // revise the header for each JIT kernel; this is not required but appears // here just as a demo of the feature. - TRY (GxB_Global_Option_set (GxB_JIT_C_PREFACE, + OK (GrB_Global_set_String (GrB_GLOBAL, "// kernel generated by gauss_demo.c\n" - "#include \n")) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_PREFACE, &preface)) ; - printf ("JIT C preface (revised):\n%s\n", preface) ; + "#include \n", GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_get_String (GrB_GLOBAL, str, GxB_JIT_C_PREFACE)) ; + printf ("JIT C preface (revised):\n%s\n", str) ; // create the Gauss type but do it wrong the first time. This will always // require a new JIT kernel to be compiled: if this is the first run of @@ -274,24 +254,25 @@ int main (void) // JIT disabled printf ("JIT: unable to determine type size: set it to %d\n", (int) sizeof (badgauss)) ; - TRY (GrB_Type_new (&BadGauss, sizeof (badgauss))) ; + OK (GrB_Type_new (&BadGauss, sizeof (badgauss))) ; } - TRY (GxB_Type_fprint (BadGauss, "BadGauss", GxB_COMPLETE, stdout)) ; - TRY (GxB_Type_size (&sizeof_gauss, BadGauss)) ; - OK (sizeof_gauss == sizeof (badgauss)) ; + OK (GxB_Type_fprint (BadGauss, "BadGauss", GxB_COMPLETE, stdout)) ; + + OK (GrB_Type_get_SIZE (BadGauss, &sizeof_gauss, GrB_SIZE)) ; + CHECK (sizeof_gauss == sizeof (badgauss), GrB_PANIC) ; GrB_Type_free (&BadGauss) ; } // the JIT should have been successful, unless it was originally off #define OK_JIT \ - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; \ - OK (control == save) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; \ + CHECK (control == save, GrB_PANIC) ; OK_JIT // renable the JIT in case the JIT was disabled when GraphBLAS was built; // this will enable any prejit kernels. - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &save)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &save, GxB_JIT_C_CONTROL)) ; printf ("jit: status %d\n", save) ; // create the Gauss type, and let the JIT determine the size. This causes @@ -310,20 +291,19 @@ int main (void) // JIT disabled printf ("JIT: unable to determine type size: set it to %d\n", (int) sizeof (gauss)) ; - TRY (GrB_Type_new (&Gauss, sizeof (gauss))) ; + OK (GrB_Type_new (&Gauss, sizeof (gauss))) ; } - TRY (GxB_Type_fprint (Gauss, "Gauss", GxB_COMPLETE, stdout)) ; - TRY (GxB_Type_size (&sizeof_gauss, Gauss)) ; -// printf ("sizeof_gauss %lu %lu\n", sizeof_gauss, sizeof (gauss)) ; - OK (sizeof_gauss == sizeof (gauss)) ; + OK (GxB_Type_fprint (Gauss, "Gauss", GxB_COMPLETE, stdout)) ; + OK (GrB_Type_get_SIZE (Gauss, &sizeof_gauss, GrB_SIZE)) ; + CHECK (sizeof_gauss == sizeof (gauss), GrB_PANIC) ; OK_JIT } printf ("JIT: off\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_OFF)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_OFF, GxB_JIT_C_CONTROL)) ; printf ("JIT: on\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; printf ("jit: status %d\n", control) ; // create the BadAddGauss operator; use a NULL function pointer to test the @@ -341,10 +321,10 @@ int main (void) { // JIT disabled printf ("JIT: unable to compile the BadAddGauss kernel\n") ; - TRY (GrB_BinaryOp_new (&BadAddGauss, (void *) badaddgauss, + OK (GrB_BinaryOp_new (&BadAddGauss, (GxB_binary_function) badaddgauss, Gauss, Gauss, Gauss)) ; } - TRY (GxB_BinaryOp_fprint (BadAddGauss, "BadAddGauss", GxB_COMPLETE, + OK (GxB_BinaryOp_fprint (BadAddGauss, "BadAddGauss", GxB_COMPLETE, stdout)) ; GrB_BinaryOp_free (&BadAddGauss) ; } @@ -367,22 +347,22 @@ int main (void) { // JIT disabled printf ("JIT: unable to compile the AddGauss kernel\n") ; - TRY (GrB_BinaryOp_new (&AddGauss, (void *) addgauss, + OK (GrB_BinaryOp_new (&AddGauss, (GxB_binary_function) addgauss, Gauss, Gauss, Gauss)) ; } - TRY (GxB_BinaryOp_fprint (AddGauss, "AddGauss", GxB_COMPLETE, stdout)) ; + OK (GxB_BinaryOp_fprint (AddGauss, "AddGauss", GxB_COMPLETE, stdout)) ; OK_JIT } printf ("JIT: off\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_OFF)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_OFF, GxB_JIT_C_CONTROL)) ; printf ("JIT: on\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; // renable the JIT in case the JIT was disabled when GraphBLAS was built; // this will enable any prejit kernels. - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &save)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &save, GxB_JIT_C_CONTROL)) ; printf ("jit: status %d\n", save) ; // create the AddMonoid @@ -390,88 +370,90 @@ int main (void) zero.real = 0 ; zero.imag = 0 ; GrB_Monoid AddMonoid ; - TRY (GrB_Monoid_new_UDT (&AddMonoid, AddGauss, &zero)) ; - TRY (GxB_Monoid_fprint (AddMonoid, "AddMonoid", GxB_COMPLETE, stdout)) ; + OK (GrB_Monoid_new_UDT (&AddMonoid, AddGauss, &zero)) ; + OK (GxB_Monoid_fprint (AddMonoid, "AddMonoid", GxB_COMPLETE, stdout)) ; // create the MultGauss operator GrB_BinaryOp MultGauss ; - TRY (GxB_BinaryOp_new (&MultGauss, (void *) multgauss, + OK (GxB_BinaryOp_new (&MultGauss, (GxB_binary_function) multgauss, Gauss, Gauss, Gauss, "multgauss", MULTGAUSS_DEFN)) ; - TRY (GxB_BinaryOp_fprint (MultGauss, "MultGauss", GxB_COMPLETE, stdout)) ; + OK (GxB_BinaryOp_fprint (MultGauss, "MultGauss", GxB_COMPLETE, stdout)) ; // create the GaussSemiring GrB_Semiring GaussSemiring ; - TRY (GrB_Semiring_new (&GaussSemiring, AddMonoid, MultGauss)) ; - TRY (GxB_Semiring_fprint (GaussSemiring, "GaussSemiring", GxB_COMPLETE, + OK (GrB_Semiring_new (&GaussSemiring, AddMonoid, MultGauss)) ; + OK (GxB_Semiring_fprint (GaussSemiring, "GaussSemiring", GxB_COMPLETE, stdout)) ; // create a 4-by-4 Gauss matrix, each entry A(i,j) = (i+1,2-j), // except A(0,0) is missing GrB_Matrix A, D ; - TRY (GrB_Matrix_new (&A, Gauss, 4, 4)) ; - TRY (GrB_Matrix_new (&D, GrB_BOOL, 4, 4)) ; + OK (GrB_Matrix_new (&A, Gauss, 4, 4)) ; + OK (GrB_Matrix_new (&D, GrB_BOOL, 4, 4)) ; gauss a ; for (int i = 0 ; i < 4 ; i++) { - TRY (GrB_Matrix_setElement_BOOL (D, 1, i, i)) ; + OK (GrB_Matrix_setElement_BOOL (D, 1, i, i)) ; for (int j = 0 ; j < 4 ; j++) { if (i == 0 && j == 0) continue ; a.real = i+1 ; a.imag = 2-j ; - TRY (GrB_Matrix_setElement_UDT (A, &a, i, j)) ; + OK (GrB_Matrix_setElement_UDT (A, &a, i, j)) ; } } printgauss (A, "\n=============== Gauss A matrix:\n") ; // a = sum (A) - TRY (GrB_Matrix_reduce_UDT (&a, NULL, AddMonoid, A, NULL)) ; + OK (GrB_Matrix_reduce_UDT (&a, NULL, AddMonoid, A, NULL)) ; printf ("\nsum (A) = (%d,%d)\n", a.real, a.imag) ; OK_JIT // A = A*A - TRY (GrB_mxm (A, NULL, NULL, GaussSemiring, A, A, NULL)) ; + OK (GrB_mxm (A, NULL, NULL, GaussSemiring, A, A, NULL)) ; printgauss (A, "\n=============== Gauss A = A^2 matrix:\n") ; OK_JIT // a = sum (A) - TRY (GrB_Matrix_reduce_UDT (&a, NULL, AddMonoid, A, NULL)) ; + OK (GrB_Matrix_reduce_UDT (&a, NULL, AddMonoid, A, NULL)) ; printf ("\nsum (A^2) = (%d,%d)\n", a.real, a.imag) ; OK_JIT // C = A*A' where A and D are sparse GrB_Matrix C ; - TRY (GrB_Matrix_new (&C, Gauss, 4, 4)) ; + OK (GrB_Matrix_new (&C, Gauss, 4, 4)) ; printgauss (C, "\nGauss C empty matrix") ; - TRY (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - TRY (GxB_Matrix_Option_set (D, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - TRY (GrB_mxm (C, D, NULL, GaussSemiring, A, A, GrB_DESC_T1)) ; + + OK (GrB_Matrix_set_INT32 (A, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (D, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_mxm (C, D, NULL, GaussSemiring, A, A, GrB_DESC_T1)) ; printgauss (C, "\n=============== Gauss C = diag(AA') matrix:\n") ; OK_JIT // C = D*A GrB_Matrix_free (&D) ; - TRY (GrB_Matrix_new (&D, Gauss, 4, 4)) ; - TRY (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - TRY (GxB_Matrix_Option_set (D, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - TRY (GrB_Matrix_select_INT64 (D, NULL, NULL, GrB_DIAG, A, 0, NULL)) ; + OK (GrB_Matrix_new (&D, Gauss, 4, 4)) ; + OK (GrB_Matrix_set_INT32 (A, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (D, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_select_INT64 (D, NULL, NULL, GrB_DIAG, A, 0, NULL)) ; printgauss (D, "\nGauss D matrix") ; - TRY (GrB_mxm (C, NULL, NULL, GaussSemiring, D, A, NULL)) ; + OK (GrB_mxm (C, NULL, NULL, GaussSemiring, D, A, NULL)) ; printgauss (C, "\n=============== Gauss C = D*A matrix:\n") ; OK_JIT // convert D to bitmap then back to sparse - TRY (GxB_Matrix_Option_set (D, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - TRY (GxB_Matrix_Option_set (D, GxB_SPARSITY_CONTROL, GxB_BITMAP)) ; + OK (GrB_Matrix_set_INT32 (D, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (D, GxB_BITMAP, GxB_SPARSITY_CONTROL)) ; + printgauss (D, "\nGauss D matrix (bitmap)") ; - TRY (GxB_Matrix_fprint (D, "D", GxB_COMPLETE, stdout)) ; - TRY (GxB_Matrix_Option_set (D, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GxB_Matrix_fprint (D, "D", GxB_COMPLETE, stdout)) ; + OK (GrB_Matrix_set_INT32 (D, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; printgauss (D, "\nGauss D matrix (back to sparse)") ; - TRY (GxB_Matrix_fprint (D, "D", GxB_COMPLETE, stdout)) ; + OK (GxB_Matrix_fprint (D, "D", GxB_COMPLETE, stdout)) ; OK_JIT // C = A*D - TRY (GrB_mxm (C, NULL, NULL, GaussSemiring, A, D, NULL)) ; + OK (GrB_mxm (C, NULL, NULL, GaussSemiring, A, D, NULL)) ; printgauss (C, "\n=============== Gauss C = A*D matrix:\n") ; OK_JIT @@ -479,87 +461,87 @@ int main (void) gauss ciso ; ciso.real = 1 ; ciso.imag = -2 ; - TRY (GrB_Matrix_assign_UDT (C, NULL, NULL, &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, NULL, &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== Gauss C = (1,-2) matrix:\n") ; printgauss (A, "\n=============== Gauss A matrix:\n") ; - TRY (GrB_mxm (C, NULL, AddGauss, GaussSemiring, A, A, GrB_DESC_T1)) ; + OK (GrB_mxm (C, NULL, AddGauss, GaussSemiring, A, A, GrB_DESC_T1)) ; printgauss (C, "\n=============== Gauss C += A*A' matrix:\n") ; OK_JIT // C += B*A where B is full and A is sparse GrB_Matrix B ; - TRY (GrB_Matrix_new (&B, Gauss, 4, 4)) ; - TRY (GrB_Matrix_assign_UDT (B, NULL, NULL, &ciso, + OK (GrB_Matrix_new (&B, Gauss, 4, 4)) ; + OK (GrB_Matrix_assign_UDT (B, NULL, NULL, &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (B, "\n=============== Gauss B = (1,-2) matrix:\n") ; - TRY (GrB_mxm (C, NULL, AddGauss, GaussSemiring, B, A, NULL)) ; + OK (GrB_mxm (C, NULL, AddGauss, GaussSemiring, B, A, NULL)) ; printgauss (C, "\n=============== Gauss C += B*A:\n") ; OK_JIT // C += A*B where B is full and A is sparse - TRY (GrB_mxm (C, NULL, AddGauss, GaussSemiring, A, B, NULL)) ; + OK (GrB_mxm (C, NULL, AddGauss, GaussSemiring, A, B, NULL)) ; printgauss (C, "\n=============== Gauss C += A*B:\n") ; OK_JIT // C = ciso+A - TRY (GrB_Matrix_apply_BinaryOp1st_UDT (C, NULL, NULL, AddGauss, + OK (GrB_Matrix_apply_BinaryOp1st_UDT (C, NULL, NULL, AddGauss, (void *) &ciso, A, NULL)) ; printgauss (C, "\n=============== Gauss C = (1,-2) + A:\n") ; OK_JIT // C = A*ciso - TRY (GrB_Matrix_apply_BinaryOp2nd_UDT (C, NULL, NULL, MultGauss, A, + OK (GrB_Matrix_apply_BinaryOp2nd_UDT (C, NULL, NULL, MultGauss, A, (void *) &ciso, NULL)) ; printgauss (C, "\n=============== Gauss C = A*(1,-2):\n") ; OK_JIT // C = A'*ciso - TRY (GrB_Matrix_apply_BinaryOp2nd_UDT (C, NULL, NULL, MultGauss, A, + OK (GrB_Matrix_apply_BinaryOp2nd_UDT (C, NULL, NULL, MultGauss, A, (void *) &ciso, GrB_DESC_T0)) ; printgauss (C, "\n=============== Gauss C = A'*(1,-2):\n") ; OK_JIT // C = ciso*A' - TRY (GrB_Matrix_apply_BinaryOp1st_UDT (C, NULL, NULL, MultGauss, + OK (GrB_Matrix_apply_BinaryOp1st_UDT (C, NULL, NULL, MultGauss, (void *) &ciso, A, GrB_DESC_T1)) ; printgauss (C, "\n=============== Gauss C = (1,-2)*A':\n") ; OK_JIT // create the RealGauss unary op GrB_UnaryOp RealGauss ; - TRY (GxB_UnaryOp_new (&RealGauss, (void *) realgauss, GrB_INT32, Gauss, - "realgauss", REALGAUSS_DEFN)) ; - TRY (GxB_UnaryOp_fprint (RealGauss, "RealGauss", GxB_COMPLETE, stdout)) ; + OK (GxB_UnaryOp_new (&RealGauss, (GxB_unary_function) realgauss, + GrB_INT32, Gauss, "realgauss", REALGAUSS_DEFN)) ; + OK (GxB_UnaryOp_fprint (RealGauss, "RealGauss", GxB_COMPLETE, stdout)) ; GrB_Matrix R ; - TRY (GrB_Matrix_new (&R, GrB_INT32, 4, 4)) ; + OK (GrB_Matrix_new (&R, GrB_INT32, 4, 4)) ; OK_JIT // R = RealGauss (C) - TRY (GrB_Matrix_apply (R, NULL, NULL, RealGauss, C, NULL)) ; - TRY (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; + OK (GrB_Matrix_apply (R, NULL, NULL, RealGauss, C, NULL)) ; + OK (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; OK_JIT // R = RealGauss (C') printgauss (C, "\n=============== R = RealGauss (C')\n") ; - TRY (GrB_Matrix_apply (R, NULL, NULL, RealGauss, C, GrB_DESC_T0)) ; - TRY (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; + OK (GrB_Matrix_apply (R, NULL, NULL, RealGauss, C, GrB_DESC_T0)) ; + OK (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; GrB_Matrix_free (&R) ; OK_JIT // create the IJGauss IndexUnaryOp GrB_IndexUnaryOp IJGauss ; - TRY (GxB_IndexUnaryOp_new (&IJGauss, (void *) ijgauss, GrB_INT64, Gauss, - Gauss, "ijgauss", IJGAUSS_DEFN)) ; - TRY (GrB_Matrix_new (&R, GrB_INT64, 4, 4)) ; + OK (GxB_IndexUnaryOp_new (&IJGauss, (GxB_index_unary_function) ijgauss, + GrB_INT64, Gauss, Gauss, "ijgauss", IJGAUSS_DEFN)) ; + OK (GrB_Matrix_new (&R, GrB_INT64, 4, 4)) ; printgauss (C, "\n=============== C \n") ; - TRY (GrB_Matrix_apply_IndexOp_UDT (R, NULL, NULL, IJGauss, C, + OK (GrB_Matrix_apply_IndexOp_UDT (R, NULL, NULL, IJGauss, C, (void *) &ciso, NULL)) ; printf ("\nR = ijgauss (C)\n") ; - TRY (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; + OK (GxB_Matrix_fprint (R, "R", GxB_COMPLETE, stdout)) ; GrB_Index I [100], J [100], rnvals = 100 ; double X [100] ; - TRY (GrB_Matrix_extractTuples_FP64 (I, J, X, &rnvals, R)) ; + OK (GrB_Matrix_extractTuples_FP64 (I, J, X, &rnvals, R)) ; for (int k = 0 ; k < rnvals ; k++) { printf ("R (%d,%d) = %g\n", (int) I [k], (int) J [k], X [k]) ; @@ -568,7 +550,7 @@ int main (void) // C = C' printgauss (C, "\n=============== C\n") ; - TRY (GrB_transpose (C, NULL, NULL, C, NULL)) ; + OK (GrB_transpose (C, NULL, NULL, C, NULL)) ; printgauss (C, "\n=============== C = C'\n") ; OK_JIT @@ -577,16 +559,17 @@ int main (void) GrB_Matrix Z, E ; int ncols = 8 ; int nrows = (trial == 0) ? 256 : 16 ; - TRY (GrB_Matrix_new (&Z, Gauss, nrows, ncols)) ; - TRY (GrB_Matrix_new (&E, Gauss, nrows-8, 4)) ; - TRY (GxB_Matrix_Option_set (Z, GxB_FORMAT, GxB_BY_COL)) ; + OK (GrB_Matrix_new (&Z, Gauss, nrows, ncols)) ; + OK (GrB_Matrix_new (&E, Gauss, nrows-8, 4)) ; + OK (GrB_Matrix_set_INT32 (Z, GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; GrB_Matrix Tiles [3][2] ; Tiles [0][0] = C ; Tiles [0][1] = D ; Tiles [1][0] = E ; Tiles [1][1] = E ; Tiles [2][0] = D ; Tiles [2][1] = C ; - TRY (GxB_Matrix_concat (Z, (GrB_Matrix *) Tiles, 3, 2, NULL)) ; + OK (GxB_Matrix_concat (Z, (GrB_Matrix *) Tiles, 3, 2, NULL)) ; printgauss (Z, "\n=============== Z = [C D ; E E ; D C]") ; - TRY (GxB_Matrix_fprint (Z, "Z", GxB_COMPLETE, stdout)) ; + OK (GxB_Matrix_fprint (Z, "Z", GxB_COMPLETE, stdout)) ; OK_JIT GrB_Matrix CTiles [4] ; @@ -596,13 +579,13 @@ int main (void) Tile_nrows [1] = nrows / 2 ; Tile_ncols [0] = 3 ; Tile_ncols [1] = 5 ; - TRY (GxB_Matrix_split (CTiles, 2, 2, Tile_nrows, Tile_ncols, Z, NULL)) ; + OK (GxB_Matrix_split (CTiles, 2, 2, Tile_nrows, Tile_ncols, Z, NULL)) ; OK_JIT for (int k = 0 ; k < 4 ; k++) { printgauss (CTiles [k], "\n=============== C Tile from Z:\n") ; - TRY (GxB_Matrix_fprint (CTiles [k], "CTiles [k]", GxB_COMPLETE, + OK (GxB_Matrix_fprint (CTiles [k], "CTiles [k]", GxB_COMPLETE, stdout)) ; GrB_Matrix_free (& (CTiles [k])) ; OK_JIT @@ -613,27 +596,27 @@ int main (void) } // try using cmake instead of a direct compile/link command - TRY (GxB_Global_Option_set (GxB_JIT_USE_CMAKE, true)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_JIT_USE_CMAKE)) ; OK_JIT // C += ciso - TRY (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C + ciso\n") ; OK_JIT // split the full matrix C - TRY (GxB_Matrix_Option_set (C, GxB_SPARSITY_CONTROL, GxB_FULL)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_FULL, GxB_SPARSITY_CONTROL)) ; GrB_Matrix STiles [4] ; GrB_Index Tile_nrows [2] = { 1, 3 } ; GrB_Index Tile_ncols [2] = { 2, 2 } ; - TRY (GxB_Matrix_split (STiles, 2, 2, Tile_nrows, Tile_ncols, C, NULL)) ; + OK (GxB_Matrix_split (STiles, 2, 2, Tile_nrows, Tile_ncols, C, NULL)) ; OK_JIT for (int k = 0 ; k < 4 ; k++) { printgauss (STiles [k], "\n=============== S Tile from C:\n") ; - TRY (GxB_Matrix_fprint (STiles [k], "STiles [k]", GxB_COMPLETE, + OK (GxB_Matrix_fprint (STiles [k], "STiles [k]", GxB_COMPLETE, stdout)) ; GrB_Matrix_free (& (STiles [k])) ; OK_JIT @@ -641,59 +624,59 @@ int main (void) // pause the JIT printf ("JIT: paused\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_PAUSE)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_PAUSE, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; save = control ; OK_JIT // C += ciso printgauss (C, "\n=============== C: \n") ; - TRY (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C + ciso (JIT paused):\n") ; OK_JIT // C *= ciso printgauss (C, "\n=============== C: \n") ; - TRY (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C * ciso (JIT paused):\n") ; OK_JIT // re-enable the JIT, but not to compile anything new printf ("JIT: run (the JIT can only run, not load or compile)\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_RUN)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_RUN, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; save = control ; OK_JIT // C += ciso, using the previous loaded JIT kernel - TRY (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, AddGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C + ciso (JIT run):\n") ; OK_JIT // C *= ciso, but using generic since it is not compiled - TRY (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C * ciso (JIT not loaded):\n") ; OK_JIT // re-enable the JIT entirely printf ("JIT: on\n") ; - TRY (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - TRY (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &control)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; save = control ; OK_JIT // C *= ciso, compiling a new JIT kernel if needed - TRY (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, + OK (GrB_Matrix_assign_UDT (C, NULL, MultGauss, (void *) &ciso, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; printgauss (C, "\n=============== C = C * ciso (full JIT):\n") ; OK_JIT gauss result ; - TRY (GrB_Matrix_extractElement_UDT (&result, C, 3, 3)) ; + OK (GrB_Matrix_extractElement_UDT (&result, C, 3, 3)) ; // free everything and finalize GraphBLAS GrB_Matrix_free (&A) ; diff --git a/GraphBLAS/Demo/Program/grow_demo.c b/GraphBLAS/Demo/Program/grow_demo.c index 9d017b0a1a..28e419ac03 100644 --- a/GraphBLAS/Demo/Program/grow_demo.c +++ b/GraphBLAS/Demo/Program/grow_demo.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Program/grow_demo.c: grow a matrix row-by-row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,21 +10,12 @@ // Reads in a matrix A, then does C = A one row at a time. #include "graphblas_demos.h" -#include "simple_rand.c" #include "usercomplex.h" #include "usercomplex.c" #include "wathen.c" -#include "get_matrix.c" #include "random_matrix.c" -#include "import_test.c" #include "read_matrix.c" - -#include "omp.h" -#if defined ( _OPENMP ) -#define WALLCLOCK omp_get_wtime ( ) -#else -#define WALLCLOCK 0 -#endif +#include "get_matrix.c" // macro used by OK(...) to free workspace if an error occurs #undef FREE_ALL @@ -73,15 +64,17 @@ int main (int argc, char **argv) GrB_Info info ; OK (GrB_init (GrB_NONBLOCKING)) ; +// OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; int32_t nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads, GxB_NTHREADS)) ; fprintf (stderr, "grow demo: nthreads %d\n", nthreads) ; //-------------------------------------------------------------------------- // get A matrix //-------------------------------------------------------------------------- - OK (get_matrix (&A, argc, argv, false, false, false)) ; + uint64_t state = 1 ; + OK (get_matrix (&A, argc, argv, false, false, false, &state)) ; GrB_Index anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; @@ -89,8 +82,6 @@ int main (int argc, char **argv) int32_t type_code ; OK (GrB_Matrix_get_INT32 (A, &type_code, GrB_EL_TYPE_CODE)) ; GrB_Type atype = NULL ; - // OK (GxB_print (A, 5)) ; - // printf ("type_code: %d\n", type_code) ; GrB_BinaryOp eq = NULL ; switch (type_code) @@ -111,7 +102,6 @@ int main (int argc, char **argv) default : ; } - // OK (GxB_print (atype, 5)) ; CHECK (atype != NULL, GrB_INVALID_VALUE) ; OK (GxB_Matrix_fprint (A, "A", 1, stdout)) ; @@ -121,26 +111,20 @@ int main (int argc, char **argv) OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; OK (GrB_Vector_new (&w, atype, ancols)) ; - // OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; - OK (GrB_Matrix_set_INT32 (C, (int32_t) false, (GrB_Field) GxB_HYPER_HASH)) ; - OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; - OK (GrB_Vector_set_INT32 (w, GxB_SPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; - // printf ("\n\nC empty:\n") ; - // OK (GxB_print (C, 1)) ; + OK (GrB_Matrix_set_INT32 (C, (int32_t) false, GxB_HYPER_HASH)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Vector_set_INT32 (w, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; double t, tt [4] = {0, 0, 0, 0}, t2 [4] = {0, 0, 0, 0} ; tt [0] = WALLCLOCK ; for (int64_t i = 0 ; i < anrows ; i++) { - // printf ("\n\ni = %ld\n", i) ; - // w = A (i,:), using A' via the descriptor t = WALLCLOCK ; OK (GrB_Col_extract (w, NULL, NULL, A, GrB_ALL, ancols, i, GrB_DESC_T0)) ; tt [1] += (WALLCLOCK - t) ; - // OK (GxB_print (w, 3)) ; // C (i,:) = w t = WALLCLOCK ; @@ -151,11 +135,9 @@ int main (int argc, char **argv) t = WALLCLOCK ; OK (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; tt [3] += (WALLCLOCK - t) ; - // OK (GxB_print (C, 1)) ; } - OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, (GrB_Field) GxB_BURBLE)) ; - // OK (GxB_print (C, 1)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; tt [0] = WALLCLOCK - tt [0] ; printf ("one row at a time:\n") ; @@ -171,10 +153,9 @@ int main (int argc, char **argv) // C = A, multiple rows at a time //-------------------------------------------------------------------------- - // OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; GrB_Matrix_free (&C) ; OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; - OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; t2 [0] = WALLCLOCK ; int64_t i1 = 0 ; @@ -187,24 +168,19 @@ int main (int argc, char **argv) int64_t i2 = i1 + irows - 1 ; if (i2 > ilast) i2 = ilast ; irows = i2 - i1 + 1 ; - // printf ("i1: %ld i2: %ld irows %ld ilast: %ld\n", - // i1, i2, irows, ilast) ; // W = A (i1:i2,:) t = WALLCLOCK ; OK (GrB_Matrix_new (&W, atype, irows, ancols)) ; - OK (GrB_Matrix_set_INT32 (W, GxB_SPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (W, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; GrB_Index Icolon [3] ; Icolon [GxB_BEGIN] = i1 ; Icolon [GxB_INC ] = 1 ; Icolon [GxB_END ] = i2 ; - // OK (GxB_print (W, 3)) ; info = GrB_Matrix_extract (W, NULL, NULL, A, Icolon, GxB_RANGE, GrB_ALL, ancols, NULL) ; - // printf ("got here: %d\n", info) ; OK (info) ; t2 [1] += (WALLCLOCK - t) ; - // OK (GxB_print (W, 3)) ; // C (i1:i2,:) = W t = WALLCLOCK ; @@ -216,13 +192,12 @@ int main (int argc, char **argv) t = WALLCLOCK ; OK (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; t2 [3] += (WALLCLOCK - t) ; - // OK (GxB_print (C, 1)) ; GrB_Matrix_free (&W) ; i1 += irows ; } - OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, (GrB_Field) GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; t2 [0] = WALLCLOCK - t2 [0] ; printf ("\nmany rows at a time:\n") ; @@ -242,15 +217,64 @@ int main (int argc, char **argv) for (int trial = 1 ; trial <= 2 ; trial++) { int32_t threads ; - GrB_Global_get_INT32 (GrB_GLOBAL, &threads, (GrB_Field) GxB_GLOBAL_NTHREADS) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &threads, GxB_GLOBAL_NTHREADS) ; GrB_Matrix_free (&T) ; t = WALLCLOCK ; OK (GrB_Matrix_dup (&T, A)) ; t = (WALLCLOCK - t) ; printf ("dup: %g (%d threads)\n", t, threads) ; - GrB_Global_set_INT32 (GrB_GLOBAL, (int) 1, (GrB_Field) GxB_GLOBAL_NTHREADS) ; + GrB_Global_set_INT32 (GrB_GLOBAL, (int) 1, GxB_GLOBAL_NTHREADS) ; + } + + //-------------------------------------------------------------------------- + // try different integer sizes + //-------------------------------------------------------------------------- + +#if 0 + +// OK (GrB_Global_set_INT32 (GrB_GLOBAL, 1, GxB_BURBLE)) ; + for (int p_hint = 0 ; p_hint <= 64 ; p_hint += 32) + { + for (int i_hint = 0 ; i_hint <= 64 ; i_hint += 32) + { + int p_size, i_size, p_hint2, i_hint2 ; + printf ("\np_hint: %d i_hint: %d\n", p_hint, i_hint) ; + OK (GrB_Matrix_set_INT32 (A, p_hint, GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_Matrix_set_INT32 (A, i_hint, GxB_INDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_get_INT32 (A, &p_size, GxB_OFFSET_INTEGER_BITS)) ; + OK (GrB_Matrix_get_INT32 (A, &i_size, GxB_INDEX_INTEGER_BITS)) ; + OK (GrB_Matrix_get_INT32 (A, &p_hint2, GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_Matrix_get_INT32 (A, &i_hint2, GxB_INDEX_INTEGER_HINT)) ; + printf ("p_size %d i_size %d\n", p_size, i_size) ; + CHECK (p_hint == p_hint2, GrB_PANIC) ; + CHECK (i_hint == i_hint2, GrB_PANIC) ; + OK (GxB_print (A, GxB_SUMMARY)) ; + } } + GrB_Matrix_free (&A) ; + + for (int p_hint = 32 ; p_hint <= 64 ; p_hint += 32) + { + for (int i_hint = 32 ; i_hint <= 64 ; i_hint += 32) + { + int p_size, i_size ; + printf ("\nglobal p_hint: %d i_hint: %d\n", p_hint, i_hint) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, p_hint, + GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, i_hint, + GxB_INDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_new (&A, GrB_FP32, 10, 10)) ; + OK (GrB_Matrix_get_INT32 (A, &p_size, GxB_OFFSET_INTEGER_BITS)) ; + OK (GrB_Matrix_get_INT32 (A, &i_size, GxB_INDEX_INTEGER_BITS)) ; + printf ("p_size %d i_size %d\n", p_size, i_size) ; + OK (GxB_print (A, GxB_SUMMARY)) ; + GrB_Matrix_free (&A) ; + } + } + +#endif + printf ("grow_demo: all tests passed\n") ; FREE_ALL ; GrB_finalize ( ) ; diff --git a/GraphBLAS/Demo/Program/import_demo.c b/GraphBLAS/Demo/Program/import_demo.c deleted file mode 100644 index 410742018a..0000000000 --- a/GraphBLAS/Demo/Program/import_demo.c +++ /dev/null @@ -1,79 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/import_demo.c: test import/export -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Read a graph from a file and test import/export. Usage: -// -// import_demo < infile - -#include "graphblas_demos.h" -#include "simple_rand.h" -#include "simple_rand.c" -#include "usercomplex.h" -#include "usercomplex.c" -#include "wathen.c" -#include "get_matrix.c" -#include "random_matrix.c" -#include "import_test.c" -#include "read_matrix.c" - -// macro used by OK(...) to free workspace if an error occurs -#undef FREE_ALL -#define FREE_ALL \ - GrB_Matrix_free (&A) ; \ - -int main (int argc, char **argv) -{ - GrB_Matrix A = NULL ; - GrB_Info info ; - OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - fprintf (stderr, "import_demo: nthreads: %d\n", nthreads) ; - - //-------------------------------------------------------------------------- - // get a matrix - //-------------------------------------------------------------------------- - - // usage: ./main < file - // ./main 0 dump < file - // ./main 1 dump < file - // - // default is 0-based, for the matrices in the Matrix/ folder - - bool one_based = false ; - bool dump = false ; - if (argc > 1) one_based = strtol (argv [1], NULL, 0) ; - if (argc > 2) dump = strtol (argv [2], NULL, 0) ; - - OK (read_matrix (&A, stdin, false, false, one_based, false, false)) ; - - for (int hyper = 0 ; hyper <= 1 ; hyper++) - { - for (int csc = 0 ; csc <= 1 ; csc++) - { - double h = hyper ? GxB_ALWAYS_HYPER : GxB_NEVER_HYPER ; - GxB_Format_Value f = csc ? GxB_BY_COL : GxB_BY_ROW ; - - printf ("\n######### input A: hyper %d csc %d\n", hyper, csc) ; - - for (int format = 0 ; format <= 3 ; format++) - { - OK (GxB_Matrix_Option_set (A, GxB_HYPER_SWITCH, h)) ; - OK (GxB_Matrix_Option_set (A, GxB_FORMAT, f)) ; - OK (import_test (&A, format, dump)) ; - } - } - } - - FREE_ALL ; - - OK (GrB_finalize ( )) ; - printf ("import_demo: all tests passed\n") ; -} - diff --git a/GraphBLAS/Demo/Program/kron_demo.c b/GraphBLAS/Demo/Program/kron_demo.c deleted file mode 100644 index acbd3bd84a..0000000000 --- a/GraphBLAS/Demo/Program/kron_demo.c +++ /dev/null @@ -1,166 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/kron_demo.c: Kronkecker product -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Reads two graphs from two files and computes their Kronecker product, -// C = kron (A,B), writing the result to a file. -// -// kron_demo A.tsv B.tsv C.tsv -// -// Where A.tsv and B.tsv are two tab- or space-delimited triplet files with -// 1-based indices. Each line has the form: -// -// i j x -// -// where A(i,j)=x is performed by GrB_Matrix_build, to construct the matrix. -// The dimensions of A and B are assumed to be the largest row and column -// indices that appear in the files. The file C.tsv is the filename of the -// output file for C=kron(A,B), also with 1-based indices. - -#include "graphblas_demos.h" -#include "simple_rand.c" -#include "usercomplex.h" -#include "usercomplex.c" -#include "wathen.c" -#include "get_matrix.c" -#include "random_matrix.c" -#include "import_test.c" -#include "read_matrix.c" - -// macro used by OK(...) to free workspace if an error occurs -#undef FREE_ALL -#define FREE_ALL \ - GrB_Matrix_free (&A) ; \ - GrB_Matrix_free (&B) ; \ - GrB_Matrix_free (&C) ; \ - if (Afile != NULL) fclose (Afile) ; \ - if (Bfile != NULL) fclose (Bfile) ; \ - if (Cfile != NULL) fclose (Cfile) ; \ - if (I != NULL) free (I) ; \ - if (J != NULL) free (J) ; \ - if (X != NULL) free (X) ; \ - GrB_finalize ( ) ; - -int main (int argc, char **argv) -{ - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Matrix A = NULL, B = NULL, C = NULL ; - GrB_Index *I = NULL, *J = NULL ; - FILE *Afile = NULL, *Bfile = NULL, *Cfile = NULL ; - double *X = NULL ; - GrB_Info info ; - - OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - fprintf (stderr, "kron demo: nthreads %d\n", nthreads) ; - - // printf ("argc %d\n", argc) ; - if (argc != 4) - { - FREE_ALL ; - fprintf (stderr, "usage: kron_demo A.tsv B.tsv C.tsv\n") ; - exit (1) ; - } - - Afile = fopen (argv [1], "r") ; - Bfile = fopen (argv [2], "r") ; - Cfile = fopen (argv [3], "w") ; - if (Afile == NULL || Bfile == NULL || Cfile == NULL) - { - FREE_ALL ; - fprintf (stderr, "unable to read input files or create output file\n") ; - exit (1) ; - } - - //-------------------------------------------------------------------------- - // get A and B from input files - //-------------------------------------------------------------------------- - - // this would be faster and take less memory if GraphBLAS had a built-in - // read-from-file operation - OK (read_matrix (&A, Afile, false, false, true, false, false)) ; - OK (read_matrix (&B, Bfile, false, false, true, false, false)) ; - - fclose (Afile) ; - fclose (Bfile) ; - Afile = NULL ; - Bfile = NULL ; - - GrB_Index anrows, ancols, bnrows, bncols, anvals, bnvals ; - OK (GrB_Matrix_nrows (&anrows, A)) ; - OK (GrB_Matrix_ncols (&ancols, A)) ; - OK (GrB_Matrix_nvals (&anvals, A)) ; - OK (GrB_Matrix_nrows (&bnrows, B)) ; - OK (GrB_Matrix_ncols (&bncols, B)) ; - OK (GrB_Matrix_nvals (&bnvals, B)) ; - - //-------------------------------------------------------------------------- - // C = kron (A,B) - //-------------------------------------------------------------------------- - - OK (GrB_Matrix_new (&C, GrB_FP64, anrows * bnrows, ancols * bncols)) ; - - OK (GrB_Matrix_kronecker_BinaryOp (C, NULL, NULL, - GrB_TIMES_FP64, A, B, NULL)) ; - - OK (GrB_Matrix_free (&A)) ; - OK (GrB_Matrix_free (&B)) ; - - //-------------------------------------------------------------------------- - // report results - //-------------------------------------------------------------------------- - - GrB_Index cnrows, cncols, cnvals ; - OK (GrB_Matrix_nrows (&cnrows, C)) ; - OK (GrB_Matrix_ncols (&cncols, C)) ; - OK (GrB_Matrix_nvals (&cnvals, C)) ; - - // note that integers of type GrB_Index should be printed with the - // %PRIu64 format. - - fprintf (stderr, "GraphBLAS GrB_kronecker:\n" - "A: %" PRIu64 "-by-%" PRIu64 ", %" PRIu64 " entries.\n" - "B: %" PRIu64 "-by-%" PRIu64 ", %" PRIu64 " entries.\n" - "C: %" PRIu64 "-by-%" PRIu64 ", %" PRIu64 " entries.\n", - anrows, ancols, anvals, - bnrows, bncols, bnvals, - cnrows, cncols, cnvals) ; - - //-------------------------------------------------------------------------- - // write C to the output file - //-------------------------------------------------------------------------- - - // this would be faster and take less memory if GraphBLAS had a built-in - // write-to-file operation - - I = (GrB_Index *) malloc ((cnvals+1) * sizeof (GrB_Index)) ; - J = (GrB_Index *) malloc ((cnvals+1) * sizeof (GrB_Index)) ; - X = (double *) malloc ((cnvals+1) * sizeof (double )) ; - if (I == NULL || J == NULL || X == NULL) - { - fprintf (stderr, "out of memory\n") ; - FREE_ALL ; - exit (1) ; - } - - OK (GrB_Matrix_extractTuples_FP64 (I, J, X, &cnvals, C)) ; - - for (int64_t k = 0 ; k < cnvals ; k++) - { - fprintf (Cfile, "%" PRIu64 "\t%" PRIu64 "\t%.17g\n", - 1 + I [k], 1 + J [k], X [k]) ; - } - - FREE_ALL ; - return (0) ; -} - diff --git a/GraphBLAS/Demo/Program/openmp2_demo.c b/GraphBLAS/Demo/Program/openmp2_demo.c deleted file mode 100644 index fbd35df6ea..0000000000 --- a/GraphBLAS/Demo/Program/openmp2_demo.c +++ /dev/null @@ -1,132 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/openmp2_demo: example of user multithreading -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// This demo uses OpenMP, and illustrates how GraphBLAS can be called from -// a multi-threaded user program. - -#include "GraphBLAS.h" -#undef I - -#ifdef _OPENMP -#include -#endif - -#if defined __INTEL_COMPILER -#pragma warning (disable: 58 167 144 177 181 186 188 589 593 869 981 1418 1419 1572 1599 2259 2282 2557 2547 3280 ) -#elif defined __GNUC__ -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#if !defined ( __cplusplus ) -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" -#endif -#endif - -#define NTRIALS 1000 -#define N 6 - -#undef OK -#define OK(method) \ -{ \ - GrB_Info info = method ; \ - if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ - { \ - fprintf (stderr, "Failure (id: %d, info: %d):\n", id, info) ; \ - /* return to caller (do not use inside critical section) */ \ - return (0) ; \ - } \ -} - -//------------------------------------------------------------------------------ -// worker -//------------------------------------------------------------------------------ - -int worker (int id) -{ - - GrB_Matrix A = NULL ; -// printf ("\nworker %d\n", id) ; - - for (int hammer_hard = 0 ; hammer_hard < NTRIALS ; hammer_hard++) - { - OK (GrB_Matrix_free (&A)) ; - OK (GrB_Matrix_new (&A, GrB_FP64, N, N)) ; - - for (int i = 0 ; i < N ; i++) - { - for (int j = 0 ; j < N ; j++) - { - double x = (i+1)*100000 + (j+1)*1000 + id ; - OK (GrB_Matrix_setElement_FP64 (A, x, i, j)) ; - } - } - - // force completion - OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; - } - OK (GrB_Matrix_free (&A)) ; - - return (0) ; -} - -//------------------------------------------------------------------------------ -// openmp_demo main program -//------------------------------------------------------------------------------ - -int main (int argc, char **argv) -{ - printf ("Demo: %s:\n", argv [0]) ; - int id = 0 ; - - // start GraphBLAS - OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - int ver [3] ; - char *date ; - OK (GxB_Global_Option_get (GxB_LIBRARY_VERSION , ver)) ; - OK (GxB_Global_Option_get (GxB_LIBRARY_DATE , &date)) ; - printf ("openmp demo, nthreads %d (v%d.%d.%d, %s)\n", - nthreads, ver [0], ver [1], ver [2], date) ; - - OK (GxB_Global_Option_set (GxB_NTHREADS, 1)) ; - double t1 = 0 ; - - for (int nth = 1 ; nth <= nthreads ; nth++) - { - printf ("nthreads %2d: ", nth) ; - - for (int trial = 0 ; trial <= 0 ; trial++) - { - #ifdef _OPENMP - double t = omp_get_wtime ( ) ; - #endif - - // create the threads - #pragma omp parallel for num_threads(nth) - for (id = 0 ; id < 128 ; id++) - { - worker (id) ; - } - - #ifdef _OPENMP - t = omp_get_wtime ( ) - t ; - if (nth == 1) t1 = t ; - printf (" time: %10.4f sec speedup: %10.4f", t, t1/t) ; - #endif - } - printf ("\n") ; - } - - // finish GraphBLAS - GrB_finalize ( ) ; - - // finish OpenMP - exit (0) ; -} - diff --git a/GraphBLAS/Demo/Program/openmp_demo.c b/GraphBLAS/Demo/Program/openmp_demo.c deleted file mode 100644 index c021a0b9b7..0000000000 --- a/GraphBLAS/Demo/Program/openmp_demo.c +++ /dev/null @@ -1,167 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/openmp_demo: example of user multithreading -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// This demo uses OpenMP, and illustrates how GraphBLAS can be called from -// a multi-threaded user program. - -#include "GraphBLAS.h" -#undef I - -#ifdef _OPENMP -#include -#endif - -#if defined __INTEL_COMPILER -#pragma warning (disable: 58 167 144 177 181 186 188 589 593 869 981 1418 1419 1572 1599 2259 2282 2557 2547 3280 ) -#elif defined __GNUC__ -#pragma GCC diagnostic ignored "-Wunknown-pragmas" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#if !defined ( __cplusplus ) -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" -#endif -#endif - -#define NTHREADS 8 -#define NTRIALS 10 -#define N 6 - -#undef OK -#define OK(method) \ -{ \ - GrB_Info info = method ; \ - if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ - { \ - printf ("Failure (id: %d, info: %d):\n", id, info) ; \ - /* return to caller (do not use inside critical section) */ \ - return (0) ; \ - } \ -} - -//------------------------------------------------------------------------------ -// worker -//------------------------------------------------------------------------------ - -int worker (GrB_Matrix *Ahandle, int id) -{ - - printf ("\n================= worker %d starts:\n", id) ; - fprintf (stderr, "worker %d\n", id) ; - - OK (GrB_Matrix_new (Ahandle, GrB_FP64, N, N)) ; - GrB_Matrix A = *Ahandle ; - - // worker generates an intentional error message - GrB_Matrix_setElement_INT32 (A, 42, 1000+id, 1000+id) ; - - // print the intentional error generated when the worker started - #pragma omp critical - { - // critical section - printf ("\n----------------- worker %d intentional error:\n", id) ; - const char *s ; - GrB_Matrix_error (&s, A) ; - printf ("%s\n", s) ; - } - - for (int hammer_hard = 0 ; hammer_hard < NTRIALS ; hammer_hard++) - { - for (int i = 0 ; i < N ; i++) - { - for (int j = 0 ; j < N ; j++) - { - double x = (i+1)*100000 + (j+1)*1000 + id ; - OK (GrB_Matrix_setElement_FP64 (A, x, i, j)) ; - } - } - - // force completion - OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; - } - - // Printing is done in a critical section, just so it is not overly - // jumbled. Each matrix and error will print in a single body of text, - // but the order of the matrices and errors printed will be out of order - // because the critical section does not enforce the order that the - // threads enter. - - GrB_Info info2 ; - #pragma omp critical - { - // critical section - printf ("\n----------------- worker %d is done:\n", id) ; - info2 = GxB_Matrix_fprint (A, "A", GxB_SHORT, stdout) ; - } - OK (info2) ; - - // worker generates an intentional error message - GrB_Matrix_setElement_INT32 (A, 42, 1000+id, 1000+id) ; - - // print the intentional error generated when the worker started - // It should be unchanged. - #pragma omp critical - { - // critical section - printf ("\n----------------- worker %d error should be same:\n", id) ; - const char *s ; - GrB_Matrix_error (&s, A) ; - printf ("%s\n", s) ; - } - return (0) ; -} - -//------------------------------------------------------------------------------ -// openmp_demo main program -//------------------------------------------------------------------------------ - -int main (int argc, char **argv) -{ - fprintf (stderr, "Demo: %s:\n", argv [0]) ; - printf ("Demo: %s:\n", argv [0]) ; - - // initialize the mutex - int id = -1 ; - - // start GraphBLAS - OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - fprintf (stderr, "openmp demo, nthreads %d\n", nthreads) ; - - // Determine which user-threading model is being used. - #ifdef _OPENMP - printf ("User threads in this program are OpenMP threads.\n") ; - #else - printf ("This user program is single threaded.\n") ; - #endif - - GrB_Matrix Aarray [NTHREADS] ; - - // create the threads - #pragma omp parallel for num_threads(NTHREADS) - for (id = 0 ; id < NTHREADS ; id++) - { - worker (&Aarray [id], id) ; - } - - // the leader thread prints them again, and frees them - for (int id = 0 ; id < NTHREADS ; id++) - { - GrB_Matrix A = Aarray [id] ; - printf ("\n---- Leader prints matrix %d\n", id) ; - OK (GxB_Matrix_fprint (A, "A", GxB_SHORT, stdout)) ; - GrB_Matrix_free (&A) ; - } - - // finish GraphBLAS - GrB_finalize ( ) ; - - // finish OpenMP - exit (0) ; -} - diff --git a/GraphBLAS/Demo/Program/reduce_demo.c b/GraphBLAS/Demo/Program/reduce_demo.c deleted file mode 100644 index 303cca39a4..0000000000 --- a/GraphBLAS/Demo/Program/reduce_demo.c +++ /dev/null @@ -1,105 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/reduce_demo: reduce a matrix to a scalar -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "graphblas_demos.h" -#undef I -#if defined ( _OPENMP ) -#include -#endif - -// #define N 65536 - #define N 16382 - -int main (void) -{ - - #if defined ( _OPENMP ) - double t0 = omp_get_wtime ( ) ; - #endif - - // start GraphBLAS - GrB_init (GrB_NONBLOCKING) ; - int nthreads ; - GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads) ; - printf ("demo: reduce a matrix to a scalar, nthreads: %d\n", nthreads) ; - - int nthreads_max ; - GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads_max) ; - printf ("# of threads: %d\n", nthreads_max) ; - - #if defined ( _OPENMP ) - t0 = omp_get_wtime ( ) - t0 ; - printf ("GPU warmup time: %g\n", t0) ; - t0 = omp_get_wtime ( ) ; - #endif - - GrB_Index nrows = N ; - GrB_Index ncols = N ; - GrB_Matrix A ; - GrB_Matrix_new (&A, GrB_INT64, nrows, ncols) ; - - GrB_Index *I = (GrB_Index *) malloc (nrows * ncols * sizeof (GrB_Index)) ; - GrB_Index *J = (GrB_Index *) malloc (nrows * ncols * sizeof (GrB_Index)) ; - int64_t *X = (int64_t *) malloc (nrows * ncols * sizeof (int64_t)) ; - - int64_t k ; - #pragma omp parallel for num_threads(nthreads_max) schedule(static) - for (k = 0 ; k < N*N ; k++) - { - // k = i * N + j ; - int64_t i = k / N ; - int64_t j = k % N ; - // int x = (int) (rand ( ) & 0xFF) ; - int x = (int) (k & 0xFF) ; - I [k] = i ; - J [k] = j ; - X [k] = x ; - } - - GrB_Index nvals = N*N ; - GrB_Matrix_build_INT64 (A, I, J, X, nvals, GrB_PLUS_INT64) ; - - free (I) ; - free (J) ; - free (X) ; - - #if defined ( _OPENMP ) - t0 = omp_get_wtime ( ) - t0 ; - printf ("time to create matrix: %g\n", t0) ; - #endif - - GrB_Index result ; - - double t1 ; - - printf ("\nreduce to a scalar:\n") ; - - for (int nthreads = 1 ; nthreads <= nthreads_max ; nthreads++) - { - GxB_Global_Option_set (GxB_GLOBAL_NTHREADS, nthreads) ; - #if defined ( _OPENMP ) - double t = omp_get_wtime ( ) ; - #endif - GrB_Matrix_reduce_UINT64 (&result, NULL, GrB_PLUS_MONOID_INT64, - A, NULL) ; - #if defined ( _OPENMP ) - t = omp_get_wtime ( ) - t ; - if (nthreads == 1) t1 = t ; - printf ("nthreads %3d time: %12.6f speedup %8.2f\n", - nthreads, t, t1/t) ; - #endif - } - - printf ("result %" PRId64 "\n", result) ; - - // free everyting - GrB_Matrix_free (&A) ; - GrB_finalize ( ) ; -} - diff --git a/GraphBLAS/Demo/Program/simple_demo.c b/GraphBLAS/Demo/Program/simple_demo.c index c562106ccb..86ab7b73c9 100644 --- a/GraphBLAS/Demo/Program/simple_demo.c +++ b/GraphBLAS/Demo/Program/simple_demo.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Program/simple_demo.c: tests simple_rand //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,6 @@ */ #include "simple_rand.h" -#include "simple_rand.c" #include #include @@ -49,11 +48,13 @@ int main (void) fprintf (stderr, "simple_demo: out of memory\n") ; exit (1) ; } + + uint64_t state = 1 ; // generate random numbers for (i = 0 ; i < LEN ; i++) { - x [i] = simple_rand_x ( ) ; + x [i] = simple_rand_x (&state) ; } // these should be the same on any system and any compiler @@ -66,7 +67,7 @@ int main (void) // generate random uint64_t numbers for (i = 0 ; i < LEN ; i++) { - simple_rand_i ( ) ; + simple_rand (&state) ; } free (x) ; diff --git a/GraphBLAS/Demo/Program/wathen_demo.c b/GraphBLAS/Demo/Program/wathen_demo.c index 7082a11488..10a8a92359 100644 --- a/GraphBLAS/Demo/Program/wathen_demo.c +++ b/GraphBLAS/Demo/Program/wathen_demo.c @@ -2,7 +2,7 @@ // GraphBLAS/Demo/Program/wathen_demo.c: test wathen //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,14 +10,19 @@ // Construct a matrix using the wathen method. // // wathen_demo nx ny method nthreads +// +// nx and ny default to 10. +// +// methods: +// 0: build (the default, the fastest method) +// 1: assign scalars +// 2: assign finite elements, create F with a loop +// 3: assign finite elements, create F all at once +// +// nthreads: defaults # of threads from OpenMP #include "graphblas_demos.h" -#include "simple_rand.h" -#include "simple_rand.c" #include "wathen.c" -#ifdef _OPENMP -#include "omp.h" -#endif // macro used by OK(...) to free workspace if an error occurs #undef FREE_ALL @@ -29,6 +34,7 @@ int main (int argc, char **argv) GrB_Matrix A = NULL ; GrB_Info info ; OK (GrB_init (GrB_NONBLOCKING)) ; +// OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; //-------------------------------------------------------------------------- // get inputs @@ -43,10 +49,9 @@ int main (int argc, char **argv) if (argc > 4) { nthreads = strtol (argv [4], NULL, 0) ; - OK (GxB_Global_Option_set (GxB_GLOBAL_NTHREADS, nthreads)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, nthreads, GxB_NTHREADS)) ; } - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads, GxB_NTHREADS)) ; fprintf (stderr, "Wathen: nx %d ny %d method: %d nthreads: %d ", (int) nx, (int) ny, method, nthreads) ; @@ -54,20 +59,18 @@ int main (int argc, char **argv) // create a Wathen matrix //-------------------------------------------------------------------------- - #ifdef _OPENMP - double t = omp_get_wtime ( ) ; - #endif - OK (wathen (&A, nx, ny, false, method, NULL)) ; - #ifdef _OPENMP - t = omp_get_wtime ( ) - t ; - fprintf (stderr, "time: %g", t) ; - #endif - fprintf (stderr, "\n") ; - - OK (GxB_Matrix_fprint (A, "A", GxB_SUMMARY, stdout)) ; - + uint64_t state = 1 ; + double t = WALLCLOCK ; + OK (wathen (&A, nx, ny, false, method, NULL, &state)) ; + t = WALLCLOCK - t ; + fprintf (stderr, "time: %g\n", t) ; + GrB_Index n ; + OK (GrB_Matrix_nrows (&n, A)) ; + if (n < 1000) + { + OK (GxB_Matrix_fprint (A, "A", GxB_SUMMARY, stdout)) ; + } FREE_ALL ; - OK (GrB_finalize ( )) ; } diff --git a/GraphBLAS/Demo/Program/wildtype_demo.c b/GraphBLAS/Demo/Program/wildtype_demo.c index 36e312746e..f56f03f831 100644 --- a/GraphBLAS/Demo/Program/wildtype_demo.c +++ b/GraphBLAS/Demo/Program/wildtype_demo.c @@ -2,32 +2,20 @@ // GraphBLAS/Demo/Program/wildtype_demo: an arbitrary user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Each "scalar" entry of this type consists of a 4x4 matrix and a string of -// length 64. - #include "graphblas_demos.h" -#undef I - -#if defined __INTEL_COMPILER -#pragma warning (disable: 58 167 144 177 181 186 188 589 593 869 981 1418 1419 1572 1599 2259 2282 2557 2547 3280 ) -#elif defined __GNUC__ -#pragma GCC diagnostic ignored "-Wunused-parameter" -#if defined ( __cplusplus ) -#pragma GCC diagnostic ignored "-Wwrite-strings" -#else -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" -#endif -#endif //------------------------------------------------------------------------------ // the wildtype //------------------------------------------------------------------------------ +// Each "scalar" entry of this type consists of a 4x4 matrix and a string of +// length 64. + typedef struct { double stuff [4][4] ; @@ -76,9 +64,16 @@ void wildtype_print_matrix (GrB_Matrix A, char *name) { printf ("\nPrinting the matrix with GxB_Matrix_fprint:\n") ; GxB_Matrix_fprint (A, name, GxB_COMPLETE, stdout) ; - GrB_Type type ; - GxB_Matrix_type (&type, A) ; - if (type != WildType) + char typename [256] ; + size_t len = 0 ; + GrB_Matrix_get_SIZE (A, &len, GrB_EL_TYPE_STRING) ; + typename [0] = '\0' ; + if (len < 256) + { + GrB_Matrix_get_String (A, typename, GrB_EL_TYPE_STRING) ; + } + printf ("matrix type given name: [%s]\n", typename) ; + if (strcmp (typename, "WildType") != 0) { printf ("\nThe matrix %s is not wild enough to print.\n", name) ; return ; @@ -185,6 +180,26 @@ void wildmult (wildtype *z, const wildtype *x, const wildtype *y) " while ((*pdst++ = *psrc++)) ; \n" \ "}" +//------------------------------------------------------------------------------ +// get_global_string: safely get a string from GraphBLAS +//------------------------------------------------------------------------------ + +// If the string is too long to fit in str [0:maxlen-1], then it is not +// retrieved from GraphBLAS. In this case, str is returned as empty. An +// alternative is to reallocate str as length len, which is enough for the +// call got GrB_Global_get_String. + +void get_global_string (char *str, size_t maxlen, int option) +{ + str [0] = '\0' ; + size_t len = 0 ; + GrB_Global_get_SIZE (GrB_GLOBAL, &len, option) ; + if (len <= maxlen) + { + GrB_Global_get_String (GrB_GLOBAL, str, option) ; + } +} + //------------------------------------------------------------------------------ // wildtype main program //------------------------------------------------------------------------------ @@ -197,57 +212,81 @@ int main (void) // start GraphBLAS GrB_init (GrB_NONBLOCKING) ; + GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE) ; - GxB_Global_Option_set (GxB_BURBLE, true) ; int nthreads ; - GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads, GxB_GLOBAL_NTHREADS) ; fprintf (stderr, "\n" LINE "wildtype_demo: nthreads: %d\n", nthreads ) ; - char *library ; GxB_Global_Option_get (GxB_LIBRARY_NAME, &library) ; - int version [3] ; GxB_Global_Option_get (GxB_LIBRARY_VERSION, version) ; - char *date ; GxB_Global_Option_get (GxB_LIBRARY_DATE, &date) ; - char *about ; GxB_Global_Option_get (GxB_LIBRARY_ABOUT, &about) ; - char *url ; GxB_Global_Option_get (GxB_LIBRARY_URL, &url) ; - char *license ; GxB_Global_Option_get (GxB_LIBRARY_LICENSE, &license) ; - char *cdate ; GxB_Global_Option_get (GxB_LIBRARY_COMPILE_DATE, &cdate) ; - char *ctime ; GxB_Global_Option_get (GxB_LIBRARY_COMPILE_TIME, &ctime) ; - int api_ver [3] ; GxB_Global_Option_get (GxB_API_VERSION, api_ver) ; - char *api_date ; GxB_Global_Option_get (GxB_API_DATE, &api_date) ; - char *api_about ; GxB_Global_Option_get (GxB_API_ABOUT, &api_about) ; - char *api_url ; GxB_Global_Option_get (GxB_API_URL, &api_url) ; - - fprintf (stderr, LINE "%s Version %d.%d.%d, %s\n" LINE "%s" - "(%s)\n" LINE "License:\n%s" LINE "GraphBLAS API Version %d.%d.%d, %s" - " (%s)\n%s" LINE, - library, version [0], version [1], version [2], date, about, url, - license, api_ver [0], api_ver [1], api_ver [2], api_date, api_url, - api_about) ; - fprintf (stderr, "compiled: %s %s\n", cdate, ctime) ; + #define STRLEN 5000 + char str [STRLEN+1] ; + get_global_string (str, STRLEN, GxB_LIBRARY_NAME) ; + fprintf (stderr, LINE "%s ", str) ; + + int vmajor, vminor, vpatch ; + GrB_Global_get_INT32 (GrB_GLOBAL, &vmajor, GrB_LIBRARY_VER_MAJOR) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &vminor, GrB_LIBRARY_VER_MINOR) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &vpatch, GrB_LIBRARY_VER_PATCH) ; + fprintf (stderr, "Version %d.%d.%d, ", vmajor, vminor, vpatch) ; + + get_global_string (str, STRLEN, GxB_LIBRARY_DATE) ; + fprintf (stderr, "%s\n" LINE, str) ; + + get_global_string (str, STRLEN, GxB_LIBRARY_ABOUT) ; + fprintf (stderr, "%s", str) ; + + get_global_string (str, STRLEN, GxB_LIBRARY_URL) ; + fprintf (stderr, "(%s)\n" LINE, str) ; + get_global_string (str, STRLEN, GxB_LIBRARY_LICENSE) ; + fprintf (stderr, "License:\n%s" LINE, str) ; + + GrB_Global_get_INT32 (GrB_GLOBAL, &vmajor, GrB_API_VER_MAJOR) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &vminor, GrB_API_VER_MINOR) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &vpatch, GrB_API_VER_PATCH) ; + fprintf (stderr, "GraphBLAS API Version %d.%d.%d", vmajor, vminor, vpatch) ; + + get_global_string (str, STRLEN, GxB_API_DATE) ; + fprintf (stderr, ", %s ", str) ; + get_global_string (str, STRLEN, GxB_API_URL) ; + fprintf (stderr, "(%s)\n", str) ; + get_global_string (str, STRLEN, GxB_API_ABOUT) ; + fprintf (stderr, "%s" LINE, str) ; + + get_global_string (str, STRLEN, GxB_LIBRARY_COMPILE_DATE) ; + fprintf (stderr, "compiled: %s", str) ; + + get_global_string (str, STRLEN, GxB_LIBRARY_COMPILE_TIME) ; + fprintf (stderr, " %s\n", str) ; + + GrB_Scalar Hyper ; + GrB_Scalar_new (&Hyper, GrB_FP64) ; + GrB_Global_get_Scalar (GrB_GLOBAL, Hyper, GxB_HYPER_SWITCH) ; double hyper_switch ; - GxB_Global_Option_get (GxB_HYPER_SWITCH, &hyper_switch) ; + GrB_Scalar_extractElement_FP64 (&hyper_switch, Hyper) ; fprintf (stderr, "hyper switch: %g\n", hyper_switch) ; - GxB_Format_Value format ; - GxB_Global_Option_get (GxB_FORMAT, &format) ; - fprintf (stderr, "format: %s\n", (format == GxB_BY_ROW) ? "CSR" : "CSC") ; + int format ; + GrB_Global_get_INT32 (GrB_GLOBAL, &format, GrB_STORAGE_ORIENTATION_HINT) ; + fprintf (stderr, "format: %s\n", (format == GrB_ROWMAJOR) ? "CSR" : "CSC") ; - GrB_Mode mode ; - GxB_Global_Option_get (GxB_MODE, &mode) ; + int mode ; + GrB_Global_get_INT32 (GrB_GLOBAL, &mode, GrB_BLOCKING_MODE) ; fprintf (stderr, "mode: %s\n", (mode == GrB_BLOCKING) ? "blocking" : "non-blocking") ; int nthreads_max ; - GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads_max) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads_max, GxB_GLOBAL_NTHREADS) ; fprintf (stderr, "max # of threads used internally: %d\n", nthreads_max) ; // create the WildType GxB_Type_new (&WildType, sizeof (wildtype), "wildtype", WILDTYPE_DEFN) ; GxB_Type_fprint (WildType, "WildType", GxB_COMPLETE, stdout) ; + GrB_Type_set_String (WildType, "WildType", GrB_NAME) ; // get its properties size_t s ; - GxB_Type_size (&s, WildType) ; + GrB_Type_get_SIZE (WildType, &s, GrB_SIZE) ; printf ("WildType size: %d\n", (int) s) ; GxB_Type_fprint (WildType, "WildType", GxB_COMPLETE, stdout) ; @@ -377,7 +416,7 @@ int main (void) printf ("\nThe mask matrix M:\n") ; GxB_Matrix_fprint (M, "M", GxB_COMPLETE, stdout) ; -// GxB_Global_Option_set (GxB_BURBLE, true) ; +// GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE) ; GrB_mxm (C, M, NULL, InTheWild, C, C, GrB_DESC_RST1) ; wildtype_print_matrix (C, "output C") ; @@ -391,15 +430,10 @@ int main (void) memset (&sum, 0, sizeof (wildtype)) ; GrB_Matrix_reduce_UDT (&sum, NULL, WildAdder, C, NULL) ; wildtype_print (&sum, "sum (again)") ; -// GxB_Global_Option_set (GxB_BURBLE, false) ; - -// for (int k = 0 ; k < 100 ; k++) -// { -// GrB_Matrix_reduce_UDT (&sum, NULL, WildAdder, C, NULL) ; -// } +// GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE) ; // set C to column-oriented format - GxB_Matrix_Option_set (C, GxB_FORMAT, GxB_BY_COL) ; + GrB_Matrix_set_INT32 (C, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; printf ("\nC is now stored by column, but it looks just the same to the\n" "GraphBLAS user application. The difference is opaque, in the\n" "internal data structure.\n") ; diff --git a/GraphBLAS/Demo/README.txt b/GraphBLAS/Demo/README.txt index 0fbd48ed8a..1b3fe487d7 100644 --- a/GraphBLAS/Demo/README.txt +++ b/GraphBLAS/Demo/README.txt @@ -1,62 +1,58 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 This is the GraphBLAS/Demo folder. It contains a set of simple demo programs that illustrate the use of GraphBLAS. To compile and run the demos, see -../README.txt. - -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ->>> DO NOT BENCHMARK ANY OF THESE PROGRAMS <<< -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - These methods are simple ones, meant for illustration only. They can be - slow. Use LAGraph for benchmarking and use in production. Do not use any - of these methods in user applications. Eventually, this Demo folder will - be removed, and its purpose will be achieved in LAGraph instead. +../README.txt. These methods are not meant as benchmarks; use LAGraph for +that. -------------------------------------------------------------------------------- Files in this folder: README.txt this file demo run all demos + vdemo run all demos with valgrind + wdemo run the wathen_demo with larger matrices -------------------------------------------------------------------------------- in Demo/Program: -------------------------------------------------------------------------------- - complex_demo.c demo program to test complex type - import_demo.c demo program to test import/export - kron_demo.c demo program to test GrB_kronecker - simple_demo.c demo program to test simple_rand - wildtype_demo.c demo program, arbitrary struct as user-defined type - openmp_demo.c demo program using OpenMP + complex_demo.c a user-defined complex number type + context_demo.c how to use the GxB_Context for nested parallelism + gauss_demo.c the Gaussian integer: an int with real/imag parts + gauss.m the same as gauss_demo.c, but in MATLAB + grow_demo.c growing a matrix, one or many rows at a time + simple_demo.c a test for simple_rand + wathen_demo.c creating a finite element matrix + wildtype_demo.c an arbitrary user-defined type -------------------------------------------------------------------------------- in Demo/Output: -------------------------------------------------------------------------------- - complex_demo_out.m output of complex_demo - simple_test.out output of simple_demo - tri_demo.out output of tri_demo - wildtype_demo.out output of wildtype_demo - import_demo.out output of import_demo + complex_demo_out2.m output of complex_demo + complex_demo_out.m output of complex_demo + context_demo.out output of context_demo + gauss_demo1.out output of gauss_demo + gauss_demo.out output of gauss_demo + simple_demo.out output of simple_demo + wathen_demo.out output of wathen_demo + wildtype_demo.out output of wildtype_demo -------------------------------------------------------------------------------- in Demo/Include: -------------------------------------------------------------------------------- - graphblas_demos.h include file for all demos - simple_rand.h include file for simple_rand.c - usercomplex.h include file for usercomplex.h - get_matrix.c get a matrix (file, Wathen, or random) + graphblas_demos.h include file for all demos + isequal.c test if 2 matrices are equal random_matrix.c create a random matrix read_matrix.c read a matrix from a file (Matrix/*) - simple_rand.c a very simple random number generator + simple_rand.h simple random number generator usercomplex.c user-defined double complex type + usercomplex.h include file for usercomplex.h wathen.c GraphBLAS version of wathen.m - import_test.c test import/export - isequal.c test if 2 matrices are equal -------------------------------------------------------------------------------- in Demo/Matrix: @@ -68,6 +64,7 @@ the Harwell/Boeing matrix collection. Contains: 2blocks ash219 bcsstk01 + cover.mtx eye3 fs_183_1 huge diff --git a/GraphBLAS/Demo/demo b/GraphBLAS/Demo/demo index 85edda157f..a6f0d6b2ba 100755 --- a/GraphBLAS/Demo/demo +++ b/GraphBLAS/Demo/demo @@ -1,6 +1,6 @@ #!/bin/sh -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 ../build/grow_demo < Matrix/west0067 @@ -8,7 +8,6 @@ ../build/simple_demo > ../build/simple_demo.out ../build/complex_demo > ../build/complex_demo_out.m ../build/complex_demo 1 > ../build/complex_demo_out2.m -../build/openmp_demo > ../build/openmp_demo.out ../build/import_demo < Matrix/west0067 > ../build/import_demo.out ../build/wildtype_demo > ../build/wildtype_demo.out diff --git a/GraphBLAS/Demo/vdemo b/GraphBLAS/Demo/vdemo index 1835a942ff..3bff015127 100755 --- a/GraphBLAS/Demo/vdemo +++ b/GraphBLAS/Demo/vdemo @@ -1,6 +1,6 @@ #!/bin/sh -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # V="valgrind --error-limit=no --tool=memcheck -q --log-file=valgrind_%p.log --leak-check=full --show-leak-kinds=all" @@ -9,7 +9,6 @@ V="valgrind --error-limit=no --tool=memcheck -q --log-file=valgrind_%p.log" $V ../build/simple_demo > ../build/simple_demo.out $V ../build/complex_demo > ../build/complex_demo_out.m $V ../build/complex_demo 1 > ../build/complex_demo_out2.m -$V ../build/openmp_demo > ../build/openmp_demo.out $V ../build/import_demo < Matrix/west0067 > ../build/import_demo.out $V ../build/wildtype_demo > ../build/wildtype_demo.out diff --git a/GraphBLAS/Demo/wdemo b/GraphBLAS/Demo/wdemo index 19ede0553d..f9135cc7ad 100755 --- a/GraphBLAS/Demo/wdemo +++ b/GraphBLAS/Demo/wdemo @@ -1,6 +1,6 @@ #!/bin/sh -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 ../build/wathen_demo @@ -31,8 +31,12 @@ ../build/wathen_demo 400 400 0 1 ../build/wathen_demo 400 400 0 8 +../build/wathen_demo 400 400 0 16 +../build/wathen_demo 400 400 0 32 ../build/wathen_demo 400 400 1 1 ../build/wathen_demo 400 400 1 8 +../build/wathen_demo 400 400 1 16 +../build/wathen_demo 400 400 1 32 exit 0 diff --git a/GraphBLAS/Doc/ChangeLog b/GraphBLAS/Doc/ChangeLog index 9553c88ab8..73ab45bdbc 100644 --- a/GraphBLAS/Doc/ChangeLog +++ b/GraphBLAS/Doc/ChangeLog @@ -1,3 +1,29 @@ +Mar 1, 2025: version 10.0.0 + + * 32/64 bit matrices and vectors: the GrB_Matrix and GrB_Vector + now exploit 32-bit integers when possible. New methods added to pass + 32-bit integer arrays to/from GrB_build, extract, assign, subassign, + and extractTuples. New object, the GxB_Container added for fast + import/export of matrices/vectors with arbitrary integer content. + * GrB_Field: this enum is strongly deprecated, and replaced with + 'typedef int GrB_Field'. This is an upward-compatible change to the + API, and will allow the creation of a future mathematical field object + in GraphBLAS. This type should not be used; use an int instead. + It will be removed or replaced in a future version of GraphBLAS. + * enum parameters: replaced all enum parameters with int, to simplify + future updates to enum parameters, including the GrB_Field. + * GxB_JIT_ERROR: added in 9.4.x, changed value to avoid conflict with + LAGraph error codes. + * pack/unpack: these are declared historical; they still work but use + 64-bit integers only. Use the new GxB_Container methods instead. + * GxB_Matrix_iso and GxB_Vector_iso: declared historical; use GrB_get + with the new GxB_ISO enum. + * GxB_Matrix_type, GxB_Vector_type, GxB_Scalar_type: no longer historical; + added back to the user guide. + * Summary: the API is upward-compatible with 9.4.x, but only after + the user application is recompiled with GraphBLAS v10.0.0. + As a result, the SO version must increase from 9 to 10. + Feb 20, 2025: version 9.4.5 * (59) bug fix: the GxB_NO_INT32 and GxB_NOT_INT64 flags in GB_control.h @@ -131,7 +157,7 @@ Jan 10, 2024: version 9.0.0 Dec 30, 2023: version 8.3.1 * major change to build system: by Markus Mützel - * GraphBLAS.h: remove "undef I" + * GraphBLAS.h: remove "undef I" Oct 7, 2023: version 8.2.1 @@ -256,7 +282,7 @@ Version 7.3.3, Dec 9, 2022 Version 7.3.2, Nov 12, 2022 - * cmake_modules: minor revision to build system, to sync + * cmake_modules: minor revision to build system, to sync with SuiteSparse v6.0.0 * Added option -DNOPENMP=1 to disable OpenMP parallelism diff --git a/GraphBLAS/Doc/FUTURE.txt b/GraphBLAS/Doc/FUTURE.txt index b80b0c4e64..d4c2686f25 100644 --- a/GraphBLAS/Doc/FUTURE.txt +++ b/GraphBLAS/Doc/FUTURE.txt @@ -42,6 +42,9 @@ FUTURE plans for GraphBLAS: GrB_set (op, GxB_DEFN, "string") also for all ops + monoids with terminal conditions (as a function), not just a terminal + value + candidates for kernel fusion: * triangle counting: mxm then reduce to scalar * lcc: mxm then reduce to vector @@ -53,86 +56,40 @@ FUTURE plans for GraphBLAS: * check if vectorization of GrB_mxm is effective when using clang * see how HNSW vector search could be implemented in GraphBLAS -integer sizes: - use 32-bit or 64-bit integers in A->i, A->h, and perhaps A->p. - >>> requires generic pack/unpack method for O(1) move constructors. - could use new build methods (int32 indices), or GrB_Vectors for I and J. - does not require new extracTuples method (simply typecast the copy). - could use new GrB_*import/export methods, with int32 indices, or just - typecast on copy. - -first step: - A->i and A->h have the same size (both 32, or both 64), - determined by max(nrows,ncols) <= 2^30. A->p always 64-bit. - In the GrB_Matrix, A->i and A->h become void *, not int64_t *. - This gives 2 types of matrices. - - Ai = A->i ; - Ah = A->h ; - Ai [p] = i - Ah [k] = j - i = Ai [p] ; - j = Ah [k] ; - - replaced with - - GBI_GET_PTR (A) ; // new macro - GBH_GET_PTR (A) ; // new macro - GBI_SET (Ai, p, k) // new macro - GBH_SET (Ah, k, j) // new macro - i = GHI_A (Ai, pA, avlen) ; // no change to use of macro - j = GHH_A (Ah, pA, avlen) ; // no change to use of macro - - where - - #define GPI_GET_PTR(A) \ - A ## i32 = (A->is_32) ? (int32_t *) A->i : NULL ; - A ## i64 = (A->is_32) ? NULL : (int64_t *) A->i ; - - #define GPH_GET_PTR(A) \ - A ## h32 = (A->is_32) ? (int32_t *) A->h : NULL ; - A ## h64 = (A->is_32) ? NULL : (int64_t *) A->h ; - - #define GBI_SET (Ai, p, i) \ - if (Ai ## 32 == NULL) - { - Ai ## 64 [p] = (i) ; - } - else - { - Ai ## 32 [p] = (i) ; - } - - #define GBH_SET (Ah, k, j) \ - if (Ah ## 32 == NULL) - { - Ah ## 64 [k] = (j) ; - } - else - { - Ah ## 32 [k] = (j) ; - } - -// handles the case where Ai is 32 bit, 64 bit, or NULL for full matrix: -#define GBI (Ai, p, vlen) - (Ai ## 32 == NULL) ? ((Ai ## 64 == NULL) ? ((p) % vlen) : Ai ## 64 [p]) - : (Ai ## 32 [p]) ; - -// use the same for GBH - -All JIT kernels can be specialized to the int types of its matrices. -FactoryKernels and generic kernels cannot; they would need to use the above -macros. Or, current single-integer codes with no specializations would use: - - if (all matrices are 32 bit) - use all 32 bit Ai and Ah for all matrices - else if all 64 - use all 64 bit Ai and Ah for all matrices - else - use generic macros as above - -The code inside each of the 3 cases above would be templatized methods. - -memcpy (Ai, Ci, ...) would be replaced with a function that did all 4 -variants: both 32, 32 to 64, 64 to 32, and both 64. + printing user-defined types + + Support for COO / Tuple formats: + + The Container method could be extended to the COO / Tuples format. It + would be like GrB_Matrix_build when moving the tuples to a matrix, but + the method would be faster than GrB_Matrix_build / + GrB_Matrix_extractTuples. The row indices, column indices, and values + in the Container could be moved into the matrix, saving time and space. + I already have this capability in my internal methods but there is no + user interface for it. + + The Container could include a binary operator, which would be used to + combine duplicate entries. + + The COO -> Container -> GrB_Matrix construction would not take O(1) + time and space, but it would be faster and take less memory than + the existing GrB_Matrix_build. + + I think this option would be important for the SparseBLAS, to allow for + fast load/unload of COO matrices into/from a GrB_Matrix or GrB_Vector. + They anticipate supportng a COO matrix format, with the option of + creating a corresponding matrix_handle for the data (for GraphBLAS, + the matrix_handle would be the GrB_Matrix). + + Alternatively, I could create new GrB_build variants (or variant + behavior via the descriptor) that "ingest" the input GrB_Vectors I,J, + and X, and I could create a GrB_extractTuples variant that moves its + data into GrB_Vectors I,J, and X, returning the GrB_Matrix as empty + with no content. This could be done via the descriptor, using the new + GxB_*_build*_Vector methods described above. + + Lots to work out for this, and it's unrelated to the 32/64 bit issue + (except that the introduction of GrB_Vectors I,J,X to GrB_build and + extractTuples makes this feature more feasible). Thus, I don't expect + to add it to GraphBLAS v10.0.0. diff --git a/GraphBLAS/Doc/GrB_get_set.tex b/GraphBLAS/Doc/GrB_get_set.tex deleted file mode 100644 index 9563fff7e7..0000000000 --- a/GraphBLAS/Doc/GrB_get_set.tex +++ /dev/null @@ -1,1730 +0,0 @@ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{GraphBLAS Options ({\sf GrB\_get} and {\sf GrB\_set})} -\label{options} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The latest v2.1 C API adds a pair of methods, \verb'GrB_get' and \verb'GrB_set' -that allows the user to query GraphBLAS objects and change their state. These -two methods are polymorphic wrappers for a suite of methods for each object. -They replace the \verb'GxB_get' and \verb'GxB_set' methods in -SuiteSparse:GraphBLAS v8.* and earlier. - -The general polymorphic signatures of these methods are given below: - -{\footnotesize -\begin{verbatim} - GrB_Info GrB_get (object, value, GrB_Field field) ; - GrB_Info GrB_set (object, value, GrB_Field field) ; - GrB_Info GrB_set (object, void *value, GrB_Field field, size_t s) ; \end{verbatim}} - -\noindent -where \verb'object' can be any GraphBLAS object. The \verb'value' can be a -\verb'GrB_Scalar', an \verb'int32_t' (or a pointer to \verb'int32_t' for -\verb'GrB_get'), a string (\verb'char *'), or a \verb'void *' pointer. In the -latter case, \verb'GrB_set' requires an additional parameter (\verb'size_t s') -that specifies the size of the object pointed to by \verb'void *value'. - -The non-polymorphic names have the following format, where \verb'[OBJ]' -is any GraphBLAS object. - -{\footnotesize -\begin{verbatim} - GrB_Info GrB_[OBJ]_get_[KIND] (object, value, GrB_Field field) ; - GrB_Info GrB_[OBJ]_set_[KIND] (object, value, GrB_Field field) ; - GrB_Info GrB_[OBJ]_set_VOID (object, void *value, GrB_Field field, size_t s) ; \end{verbatim}} - -The \verb'[KIND]' suffix defines the type of second parameter, and can be: - \verb'Scalar' (for \verb'GrB_Scalar'), - \verb'String' (for \verb'char *'), - \verb'INT32' (for \verb'int32_t'), and - \verb'SIZE' (for \verb'size_t *' for \verb'GrB_get' only), and - \verb'VOID' (for \verb'void *'). - -The tables below list all the valid fields that can be used for each object. -Each table contains four columns: (1) the \verb'GrB_Field', -(2) a column labelled R/W, (3) a column defining the C type, and a description. -For the R/W column: - -\begin{itemize} -\item If the R/W column of a table is R, then the value can be read by \verb'GrB_get' - but not written by \verb'GrB_set'. -\item R/W means that both \verb'GrB_get' and \verb'GrB_set' can be used any number of times, - with different values. -\item R/W1 means that \verb'GrB_get' can be done multiple times, - but \verb'GrB_set' can be used only once. - Subsequent calls to \verb'GrB_set' return the error code \verb'GrB_ALREADY_SET'. -\item W means that only \verb'GrB_set' can be used (any number of times), - but \verb'GrB_get' cannot be done. -\end{itemize} - -The second parameter (\verb'value') of \verb'GrB_get' and \verb'GrB_set' can take on several -different C types, and it can also be a \verb'GrB_Scalar' that holds a value -with the given C type (or that can be typecasted to the given C type): - -\begin{itemize} -\item \verb'int32_t': - For \verb'GrB_set' the \verb'value' parameter is \verb'int32_t'. - For \verb'GrB_get' the \verb'value' parameter is \verb'int32_t *.' - The following example sets the global number of threads, and then - retrieves that \verb'value' into \verb'nthreads'. - - {\footnotesize - \begin{verbatim} - GrB_set (GrB_GLOBAL, 8, GxB_NTHREADS) ; - int32_t nthreads ; - GrB_get (GrB_GLOBAL, &nthreads, GxB_NTHREADS) ; - printf ("nthreads: %d\n", nthreads) ; \end{verbatim} } - - A \verb'GrB_Scalar' can also be used for an \verb'int32_t' \verb'value'. - For \verb'GrB_set', the scalar must not be empty. - Here is the same example but using a \verb'GrB_Scalar' instead: - - {\footnotesize - \begin{verbatim} - GrB_Scalar s ; - GrB_Scalar_new (s, GrB_INT32) ; - GrB_Scalar_setElement (s, 8) ; - GrB_set (GrB_GLOBAL, s, GxB_NTHREADS) ; - GrB_get (GrB_GLOBAL, s, GxB_NTHREADS) ; - int32_t nthreads ; - GrB_Scalar_extractElement (&nthreads, s) ; - printf ("nthreads: %d\n", nthreads) ; \end{verbatim} } - -\item \verb'char *': - The \verb'value' parameter is \verb'char *' for both \verb'GrB_get' and - \verb'GrB_set'. A \verb'GrB_Scalar' cannot be used. The size of the - string required for \verb'GrB_get' is given by using a \verb'size_t *' - parameter with the same field. For example: - - {\footnotesize - \begin{verbatim} - size_t len ; - GrB_get (GrB_GLOBAL, &len, GrB_NAME) ; - char *name = malloc (len) ; - GrB_get (GrB_GLOBAL, name, GrB_NAME) ; - printf ("The library is: %s\n", name) ; - free (name) ; \end{verbatim} } - - To get the current JIT C compiler and then set it to something else: - - {\footnotesize - \begin{verbatim} - size_t len ; - GrB_get (GrB_GLOBAL, &len, GxB_JIT_C_COMPILER_NAME) ; - char *compiler = malloc (len) ; - GrB_get (GrB_GLOBAL, compiler, GxB_JIT_C_COMPILER_NAME) ; - printf ("The current JIT compiler is: %s\n", compiler) ; - GrB_set (GrB_GLOBAL, "gcc", GxB_JIT_C_COMPILER_NAME) ; - GrB_get (GrB_GLOBAL, &len, GxB_JIT_C_COMPILER_NAME) ; - char *new_compiler = malloc (len) ; - GrB_get (GrB_GLOBAL, new_compiler, GxB_JIT_C_COMPILER_NAME) ; - printf ("The new JIT compiler is: %s\n", new_compiler) ; - free (compiler) ; - free (new_compiler) ; \end{verbatim} } - -\item Other scalar data types (typically \verb'double'): - Only a \verb'GrB_Scalar' can be used. When using \verb'GrB_set' with a - \verb'GrB_Scalar', the scalar cannot be empty. For example, to get then - set the global \verb'GxB_HYPER_SWITCH' parameter to 0.3: - - {\footnotesize - \begin{verbatim} - GrB_Scalar s ; - GrB_Scalar_new (s, GrB_FP64) ; - GrB_get (GrB_GLOBAL, s, GxB_HYPER_SWITCH) ; - double hs ; - GrB_Scalar_extractElement (&hs, s) ; - printf ("current hyper_switch: %g\n", hs) ; - GrB_Scalar_setElement (s, 0.3) ; - GrB_set (GrB_GLOBAL, s, GxB_HYPER_SWITCH) ; \end{verbatim} } - -\item \verb'void *': - This type is used for all other cases. - For \verb'GrB_get', the array must have the right size, just like a - \verb'char *' string. Use the same field first, but with - \verb'size_t *value' as the second parameter to obtain the size of the - \verb'void *' array, then use \verb'GrB_get' with a \verb'void *' array of - the right size. In some cases, the size is always the same. For example, - to query the operator of a monoid: - - {\footnotesize - \begin{verbatim} - GrB_BinaryOp op ; - GrB_get (GrB_PLUS_MONOID_FP64, (void *) &op, GxB_MONOID_OPERATOR) ; - assert (op == GrB_PLUS_FP64) ; \end{verbatim} } - - For \verb'GrB_set', a fourth parameter is required to tell GraphBLAS the - size of the input array. - -\end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Enum types for get/set: {\sf GrB\_Field}, {\sf GrB\_Orientation}, -and {\sf GrB\_Type\_Code}} -\label{get_set_enums} -%------------------------------------------------------------------------------- - -The get/set methods share a \verb'GrB_Field' enum type to specify which -component of the object is to be set or retrieved. -fields. - -{\footnotesize -\begin{verbatim} -typedef enum -{ - // GrB_Descriptor only: - GrB_OUTP_FIELD = 0, // descriptor for output of a method - GrB_MASK_FIELD = 1, // descriptor for the mask input of a method - GrB_INP0_FIELD = 2, // descriptor for the first input of a method - GrB_INP1_FIELD = 3, // descriptor for the second input of a method - - // all objects, including GrB_GLOBAL: - GrB_NAME = 10, // name of the object, as a string - - // GrB_GLOBAL only: - GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version - GrB_LIBRARY_VER_MINOR = 12, - GrB_LIBRARY_VER_PATCH = 13, - GrB_API_VER_MAJOR = 14, // C API version - GrB_API_VER_MINOR = 15, - GrB_API_VER_PATCH = 16, - GrB_BLOCKING_MODE = 17, // GrB_Mode - - // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize?): - GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation - - // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize): - GrB_EL_TYPE_CODE = 102, // a GrB_Type_code (see below) - GrB_EL_TYPE_STRING = 106, // name of the type - - // GrB_*Op, GrB_Monoid, and GrB_Semiring: - GrB_INP1_TYPE_CODE = 103, // GrB_Type_code - GrB_INP2_TYPE_CODE = 104, - GrB_OUTP_TYPE_CODE = 105, - GrB_INP1_TYPE_STRING = 107, // name of the type, as a string - GrB_INP2_TYPE_STRING = 108, - GrB_OUTP_TYPE_STRING = 109, - - // GrB_Type (readable only): - GrB_SIZE = 110, // size of the type - - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, - // and GxB_IndexBinaryOp - GxB_JIT_C_NAME = 7041, // C type or function name - GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition - - // GrB_Monoid and GrB_Semiring: - GxB_MONOID_IDENTITY = 7043, // monoid identity value - GxB_MONOID_TERMINAL = 7044, // monoid terminal value - GxB_MONOID_OPERATOR = 7045, // monoid binary operator - - // GrB_Semiring only: - GxB_SEMIRING_MONOID = 7046, // semiring monoid - GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op - - // GrB_BinaryOp and GxB_IndexBinaryOp: - GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops - GxB_THETA_TYPE_STRING = 7051, - - // GrB_BinaryOp or GrB_Semiring: - GxB_THETA = 7052, // to get the value of theta -} -GrB_Field ; - -#define GxB_NTHREADS 7086 -#define GxB_CHUNK 7087 - -typedef enum // more SuiteSparse extensions for GrB_Field: -{ - - // GrB_get/GrB_set for GrB_Matrix and GrB_GLOBAL: - GxB_HYPER_SWITCH = 7000, // switch to hypersparse (double value) - GxB_HYPER_HASH = 7048, // hyper_hash control (int64 value) - GxB_BITMAP_SWITCH = 7001, // switch to bitmap (double value) - - // GrB_get for GrB_GLOBAL: - GxB_LIBRARY_DATE = 7006, // date of the library (char *) - GxB_LIBRARY_ABOUT = 7007, // about the library (char *) - GxB_LIBRARY_URL = 7008, // URL for the library (char *) - GxB_LIBRARY_LICENSE = 7009, // license of the library (char *) - GxB_LIBRARY_COMPILE_DATE = 7010, // date library was compiled (char *) - GxB_LIBRARY_COMPILE_TIME = 7011, // time library was compiled (char *) - GxB_API_DATE = 7013, // date of the API (char *) - GxB_API_ABOUT = 7014, // about the API (char *) - GxB_API_URL = 7015, // URL for the API (char *) - GxB_COMPILER_VERSION = 7016, // compiler version (3 int's) - GxB_COMPILER_NAME = 7017, // compiler name (char *) - GxB_LIBRARY_OPENMP = 7018, // library compiled with OpenMP - GxB_MALLOC_FUNCTION = 7037, // malloc function pointer - GxB_CALLOC_FUNCTION = 7038, // calloc function pointer - GxB_REALLOC_FUNCTION = 7039, // realloc function pointer - GxB_FREE_FUNCTION = 7040, // free function pointer - - // GrB_get/GrB_set for GrB_GLOBAL: - GxB_GLOBAL_NTHREADS = GxB_NTHREADS, // max number of threads to use - GxB_GLOBAL_CHUNK = GxB_CHUNK, // chunk size for small problems. - GxB_BURBLE = 7019, // diagnostic output (bool *) - GxB_PRINTF = 7020, // printf function diagnostic output - GxB_FLUSH = 7021, // flush function diagnostic output - GxB_PRINT_1BASED = 7023, // print matrices as 0-based or 1-based - GxB_JIT_C_COMPILER_NAME = 7024, // CPU JIT C compiler name - GxB_JIT_C_COMPILER_FLAGS = 7025, // CPU JIT C compiler flags - GxB_JIT_C_LINKER_FLAGS = 7026, // CPU JIT C linker flags - GxB_JIT_C_LIBRARIES = 7027, // CPU JIT C libraries - GxB_JIT_C_PREFACE = 7028, // CPU JIT C preface - GxB_JIT_C_CONTROL = 7029, // CPU JIT C control - GxB_JIT_CACHE_PATH = 7030, // CPU/CUDA JIT path for compiled kernels - GxB_JIT_C_CMAKE_LIBS = 7031, // CPU JIT C libraries when using cmake - GxB_JIT_USE_CMAKE = 7032, // CPU JIT: use cmake or direct compile - GxB_JIT_ERROR_LOG = 7033, // CPU JIT: error log file - - // GrB_get for GrB_Matrix: - GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) - - // GrB_get/GrB_set for GrB_Matrix: - GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below - -} GxB_Option_Field ; - -typedef enum -{ - GrB_ROWMAJOR = 0, - GrB_COLMAJOR = 1, - GrB_BOTH = 2, - GrB_UNKNOWN = 3, -} -GrB_Orientation ; - -typedef enum -{ - GrB_UDT_CODE = 0, // user-defined type - GrB_BOOL_CODE = 1, // GraphBLAS: GrB_BOOL C: bool - GrB_INT8_CODE = 2, // GraphBLAS: GrB_INT8 C: int8_t - GrB_UINT8_CODE = 3, // GraphBLAS: GrB_UINT8 C: uint8_t - GrB_INT16_CODE = 4, // GraphBLAS: GrB_INT16 C: int16_t - GrB_UINT16_CODE = 5, // GraphBLAS: GrB_UINT16 C: uint16_t - GrB_INT32_CODE = 6, // GraphBLAS: GrB_INT32 C: int32_t - GrB_UINT32_CODE = 7, // GraphBLAS: GrB_UINT32 C: uint32_t - GrB_INT64_CODE = 8, // GraphBLAS: GrB_INT64 C: int64_t - GrB_UINT64_CODE = 9, // GraphBLAS: GrB_UINT64 C: uint64_t - GrB_FP32_CODE = 10, // GraphBLAS: GrB_FP32 C: float - GrB_FP64_CODE = 11, // GraphBLAS: GrB_FP64 C: double - GxB_FC32_CODE = 7070, // GraphBLAS: GxB_FC32 C: float complex - GxB_FC64_CODE = 7071, // GraphBLAS: GxB_FC64 C: double complex -} -GrB_Type_Code ; \end{verbatim}} - - -%------------------------------------------------------------------------------- -\subsection{Global Options ({\sf GrB\_Global})} -\label{get_set_global} -%------------------------------------------------------------------------------- - -A single object \verb'GrB_GLOBAL' whose type is \verb'GrB_Global' is used to -denote global settings to read or modify. To use it with \verb'GrB_get' and -\verb'GrB_set', pass in \verb'GrB_GLOBAL' as the first parameter. - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Global g, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Global g, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Global g, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Global g, size_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Global g, void * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Global g, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Global g, char * value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Global g, int32_t value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Global g, void * value, GrB_Field f, size_t s) ; -\end{verbatim} -}\end{mdframed} - - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_LIBRARY_VER_MAJOR' & R & \verb'int32_t'& major version of the library \\ -\verb'GrB_LIBRARY_VER_MINOR' & R & \verb'int32_t'& minor version of the library \\ -\verb'GrB_LIBRARY_VER_PATCH' & R & \verb'int32_t'& patch version of the library \\ -\verb'GrB_API_VER_MAJOR' & R & \verb'int32_t'& major version of the API \\ -\verb'GrB_API_VER_MINOR' & R & \verb'int32_t'& major version of the API \\ -\verb'GrB_API_VER_PATCH' & R & \verb'int32_t'& major version of the API \\ -\verb'GrB_BLOCKING_MODE' & R & \verb'int32_t'& blocking mode (\verb'GrB_BLOCKING' \newline - or \verb'GrB_NONBLOCKING') \\ -\verb'GxB_LIBRARY_OPENMP' & R & \verb'int32_t'& if OpenMP is in use (true/false) \\ -\hline -\end{tabular} -} -\vspace{0.05in} - -\vspace{0.1in} -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_STORAGE_ORIENTATION_HINT' & R/W & \verb'int32_t'& see \verb'GrB_Orientation': default - format for matrices. \\ -% Matrices are held by row, unless this -% value is set to \verb'GrB_COLMAJOR'. \\ -\verb'GxB_NTHREADS' & R/W & \verb'int32_t'& number of OpenMP threads used. \newline - See Section~\ref{omp_parallelism}. \\ -% \verb'GxB_GPU_ID' & R/W & \verb'int32_t'& which GPU to use \\ -\verb'GxB_BURBLE' & R/W & \verb'int32_t'& diagnostic output (true/false). \newline - See Section~\ref{diag}. \\ -\verb'GxB_PRINT_1BASED' & R/W & \verb'int32_t'& matrices printed as 1-based or 0-based \\ -\verb'GxB_JIT_C_CONTROL' & R/W & \verb'int32_t'& see Section~\ref{jit} \\ -\verb'GxB_JIT_USE_CMAKE' & R/W & \verb'int32_t'& " \\ -% \verb'GxB_JIT_ERROR_FALLBACK' & R/W & \verb'int32_t'& " \\ -\hline -\verb'GxB_HYPER_SWITCH' & R/W & \verb'double' & global hypersparsity control. \newline - See Section~\ref{hypersparse}. \\ -\verb'GxB_HYPER_HASH' & R/W & \verb'int64_t' & global hypersparsity (hyper-hash) - control \\ -\verb'GxB_CHUNK' & R/W & \verb'double' & global chunk size for parallel task creation. - See Section~\ref{omp_parallelism}. \\ -\hline -\verb'GrB_NAME' & R & \verb'char *' & name of the library \newline - (\verb'"SuiteSparse:GraphBLAS"') \\ -\verb'GxB_LIBRARY_DATE' & R & \verb'char *' & library release date \\ -\verb'GxB_LIBRARY_ABOUT' & R & \verb'char *' & details about the library \\ -\verb'GxB_LIBRARY_LICENSE' & R & \verb'char *' & license of the library \\ -\verb'GxB_LIBRARY_COMPILE_DATE' & R & \verb'char *' & date the library was compiled \\ -\verb'GxB_LIBRARY_COMPILE_TIME' & R & \verb'char *' & time the library was compiled \\ -\verb'GxB_LIBRARY_URL' & R & \verb'char *' & URL for the library \\ -\verb'GxB_API_DATE' & R & \verb'char *' & C API release date \\ -\verb'GxB_API_ABOUT' & R & \verb'char *' & about the C API \\ -\verb'GxB_API_URL' & R & \verb'char *' & URL for the C API \\ -\verb'GxB_COMPILER_NAME' & R & \verb'char *' & name of the compiler used to compile the library \\ -\hline -\verb'GxB_JIT_C_COMPILER_NAME' & R/W & \verb'char *' & See Section~\ref{jit} \\ -\verb'GxB_JIT_C_COMPILER_FLAGS' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_C_LINKER_FLAGS' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_C_LIBRARIES' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_C_CMAKE_LIBS' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_C_PREFACE' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_ERROR_LOG' & R/W & \verb'char *' & " \\ -\verb'GxB_JIT_CACHE_PATH' & R/W & \verb'char *' & " \\ -\hline -\end{tabular} -} - -\vspace{0.1in} -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\verb'GxB_BITMAP_SWITCH' & R/W & \verb'void *' & \verb'double' array of size \newline - \verb'GxB_NBITMAP_SWITCH'. \newline - See Section~\ref{bitmap_switch}. \\ -\verb'GxB_COMPILER_VERSION' & R & \verb'void *' & \verb'int32_t' array of size 3. - The version of the compiler used to - compile the library. \\ -\verb'GxB_PRINTF' & W & \verb'void *' & pointer to \verb'printf' function for diagnostic output. - See Section~\ref{diag}. \\ -\verb'GxB_FLUSH' & W & \verb'void *' & pointer to \verb'flush' function for diagnostic output. - See Section~\ref{diag}. \\ -\verb'GxB_MALLOC_FUNCTION' & R & \verb'void *' & malloc function \\ -\verb'GxB_CALLOC_FUNCTION' & R & \verb'void *' & calloc function \\ -\verb'GxB_REALLOC_FUNCTION' & R & \verb'void *' & realloc function \\ -\verb'GxB_FREE_FUNCTION' & R & \verb'void *' & free function \\ -\hline -\end{tabular} -} - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{Global diagnostic settings} -\label{diag} -%------------------------------------------------------------------------------- - -\verb'GrB_set (GrB_GLOBAL, ..., GxB_BURBLE)' controls the burble setting. It can also be -controlled via \verb'GrB.burble(b)' in the MATLAB/Octave interface. - -{\footnotesize -\begin{verbatim} - GrB_set (GrB_GLOBAL, true, GxB_BURBLE) ; // enable burble - GrB_set (GrB_GLOBAL, false, GxB_BURBLE) ; // disable burble \end{verbatim}} - -If enabled, SuiteSparse:GraphBLAS reports which internal kernels it uses, and -how much time is spent. If you see the word \verb'generic', it means that -SuiteSparse:GraphBLAS was unable to use its JIT kernels, or its faster kernels -in \verb'Source/FactoryKernels', but used a generic kernel that relies on -function pointers. This is done for user-defined types and operators when they -cannot be used in the JIT, and when typecasting is performed. Generic kernels -are typically slower than the JIT kernels or kernels in -\verb'Source/FactoryKernels'. - -If you see a lot of \verb'wait' statements, it may mean that a lot of time is -spent finishing a matrix or vector. This may be the result of an inefficient -use of the \verb'setElement' and \verb'assign' methods. If this occurs you -might try changing the sparsity format of a vector or matrix to -\verb'GxB_BITMAP', assuming there's enough space for it. - -The following setting allows the user application to change the -function used to print diagnostic output: - -{\small -\begin{verbatim} - GrB_set (GrB_GLOBAL, (void *) printf, GxB_PRINTF, sizeof (void *)) ; \end{verbatim} } - -This also controls the output of the -\verb'GxB_*print' functions. By default this parameter is \verb'NULL', in -which case the C11 \verb'printf' function is used. The parameter is a -function pointer with the same signature as the C11 \verb'printf' -function. The MATLAB/Octave interface to GraphBLAS sets it to \verb'mexPrintf' -so that GraphBLAS can print to the MATLAB/Octave Command Window. - -After each call to the \verb'printf' function, an optional -\verb'flush' function is called, which is \verb'NULL' by default. If -\verb'NULL', the function is not used. This can be changed with: - -{\small -\begin{verbatim} - GrB_set (GrB_GLOBAL, (void *) flush, GxB_FLUSH, sizeof (void *)) ; \end{verbatim} } - -The \verb'flush' function takes no -arguments, and returns an \verb'int' which is 0 if successful, or any nonzero -value on failure (the same output as the C11 \verb'fflush' function, -except that \verb'flush' has no inputs). - -%------------------------------------------------------------------------------- -\subsubsection{OpenMP parallelism} -%------------------------------------------------------------------------------- -\label{omp_parallelism} - -SuiteSparse:GraphBLAS is a parallel library, based on OpenMP. By -default, all GraphBLAS operations will use up to the maximum number of threads -specified by the \verb'omp_get_max_threads' OpenMP function. For small -problems, GraphBLAS may choose to use fewer threads, using two parameters: the -maximum number of threads to use (which may differ from the -\verb'omp_get_max_threads' value), and a parameter called the \verb'chunk'. -Suppose \verb'work' is a measure of the work an operation needs to perform (say -the number of entries in the two input matrices for \verb'GrB_eWiseAdd'). No -more than \verb'floor(work/chunk)' threads will be used (or one thread if the -ratio is less than 1). - -\verb'GxB_NTHREADS' controls how many threads a method uses. - By default (if set to zero, or \verb'GrB_DEFAULT'), all available threads - are used. The maximum available threads is controlled by the global - setting, which is \verb'omp_get_max_threads ( )' by default. If set to - some positive integer \verb'nthreads' less than this maximum, at most - \verb'nthreads' threads will be used. - -\verb'GxB_CHUNK' is a \verb'double' value that controls how many threads - a method uses for small problems. -The default \verb'chunk' value is 65,536, but this may change in future -versions, or it may be modified when GraphBLAS is installed on a particular -machine. - -Both parameters can be set in two ways: - -\begin{itemize} - -\item Globally: If the following methods are used, then all subsequent -GraphBLAS operations will use these settings. Note the typecast, -\verb'(double)' \verb'chunk'. This is necessary if a literal constant such as -\verb'20000' is passed as this argument. The type of the constant must be -\verb'double'. - - {\footnotesize - \begin{verbatim} - int32_t nthreads_max = 40 ; - GrB_set (GrB_GLOBAL, nthreads_max, GxB_NTHREADS) ; - GrB_Scalar_new (&s, GrB_FP64) ; - GrB_Scalar_setElement (s, (double) 20000) ; - GrB_set (GrB_GLOBAL, s, GxB_CHUNK) ; \end{verbatim} } - -\item Context: this object can be used to choose a different number of -threads used in calls to GraphBLAS from different user threads, exploiting -nested parallelism. Refer to Section~\ref{context}. If a thread has engaged a -context object, it ignores the global settings for \verb'GxB_NTHREADS' and -\verb'GxB_CHUNK', and uses the settings in its own context instead. - -\end{itemize} - -The smaller of \verb'nthreads_max' and \verb'floor(work/chunk)' is used for any -given GraphBLAS operation, except that a single thread is used if this value is -zero or less. - -If either parameter is set to \verb'GrB_DEFAULT', then default values are used. -The default for \verb'nthreads_max' is the return value from -\verb'omp_get_max_threads', and the default chunk size is currently 65,536. - -If a descriptor value for either parameter is left at its default, or set to -\verb'GrB_DEFAULT', then the global setting is used. This global setting may -have been modified from its default, and this modified value will be used. - -For example, suppose \verb'omp_get_max_threads' reports 8 threads. If \newline -\verb'GrB_set (GrB_GLOBAL, 4, GxB_NTHREADS)' is used, then the global setting is four -threads, not eight. - -GraphBLAS may be compiled without OpenMP, by setting \verb'-DNOPENMP=1'. -The library will be thread-safe, with one exception. \verb'GrB_wait' is -intended to provide thread-safety by flushing the cache of one user thread -so the object can be safely read by another thread. This is accomplished -with \verb'pragma omp flush', but if OpenMP is not available, this does -nothing. If OpenMP is not available or \verb'-DNOPEMP=1' is used, then -user applications need to ensure their own thread safety when one user thread -computes a result that is then read by another thread. - -You can query GraphBLAS at run-time to ask if it was compiled with OpenMP: - -{\small -\begin{verbatim} - bool have_openmp ; - GrB_get (GrB_GLOBAL, &have_openmp, GxB_LIBRARY_OPENMP) ; - if (!have_openmp) printf ("GraphBLAS not compiled with OpenMP\n") : \end{verbatim}} - -Compiling GraphBLAS without OpenMP is not recommended for installation in a -package manager (Linux, conda-forge, spack, brew, vcpkg, etc). - -%------------------------------------------------------------------------------- -\subsubsection{Other global options} -%------------------------------------------------------------------------------- - -\verb'GrB_BLOCKING_MODE' can only be queried by \verb'GrB_get'; it cannot be -modified by \verb'GrB_set'. The mode is the value passed to \verb'GrB_init' -(blocking or non-blocking). - -All threads in the same user application share the same global options, -including hypersparsity, bitmap options, and CSR/CSC format determined by -\verb'GrB_set', and the blocking mode determined by \verb'GrB_init'. -Specific format and hypersparsity parameters of each matrix are specific to -that matrix and can be independently changed. - -The \verb'GrB_LIBRARY_*' and \verb'GxB_LIBRARY_*' options can be used to query -the current implementation of SuiteSparse:GraphBLAS. The \verb'GrB_API_*' and -\verb'GxB_API_*' options can be used to query the current GraphBLAS C API -Specification. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Type} Options} -\label{get_set_type} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Type t, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Type t, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Type t, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Type t, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Type t, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.85in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& type code (see \verb'GrB_Type_Code') \\ -\verb'GrB_SIZE' & R & \verb'size_t' & \verb'sizeof' the type \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (type) - name of the type. For built-in types, this returns the GraphBLAS - name (\verb'"GrB_FP32"' for \verb'GrB_FP32', for example). - For user-defined types, the name can be any string of any length. It is - not used by the JIT. It can be set at most once. \\ -\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & - This must be a valid name of a C type to enable its use in the JIT. For - built-in types, this returns the C name of the type (\verb'"float"' for - \verb'GrB_FP32', for example). The length of the name can be at most - \verb'GxB_MAX_NAME_LEN', including the \verb'nul' terminating byte. It can - be set at most once. \\ -\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & - type definition, as a C \verb'typedef'; - built-in types return an empty string. - It can be set at most once. \\ -\hline -\end{tabular} -} - -Built-in types cannot be modified by \verb'GrB_set'. User-defined types can be -used without setting their name or definition, but they can be used in JIT -kernels only when both the JIT C name and the definition are set. - -To use the JIT, all operators, monoids, and semirings that access this type -must be defined after the user-defined type has been given both a name and a -definition. GraphBLAS can use an operator that uses a type without a name, -but it cannot use the JIT, even if the type is given a name later on after -the operator is created. - -The size of the type can be returned as a \verb'size_t' C scalar, or as a -\verb'GrB_Scalar', normally of type \verb'GrB_UINT64', with the examples below. - -{\footnotesize -\begin{verbatim} - size_t size ; - GrB_get (GrB_FP32, &size, GrB_SIZE) ; - assert (size == sizeof (float)) ; - - GrB_Scalar s ; - GrB_Scalar_new (&s, GrB_UINT64) ; - GrB_get (GrB_FP32, s, GrB_SIZE) ; - GrB_Scalar_extractElement (&size, s) ; - assert (size == sizeof (float)) ; \end{verbatim}} - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_UnaryOp} Options} -\label{get_set_unop} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_UnaryOp op, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_UnaryOp op, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_UnaryOp op, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_UnaryOp op, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_UnaryOp op, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.8in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& input type code (see \verb'GrB_Type_code') \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the input type \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (unop) - name of the operator. For built-in operators, this returns the GraphBLAS - name (\verb'"GrB_LNOT"' for \verb'GrB_LNOT', for example). - For user-defined operators, the name can be any string of any length. It - is not used by the JIT. It can be set at most once. \\ -\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & - This must be a valid name of a C function to enable its use in the JIT. - The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including - the \verb'nul' terminating byte. It can be set at most once. \\ -\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & - definition for a user-defined operator, as a C function; built-in operators - return an empty string. It can be set at most once. \\ -\hline -\end{tabular} -} - -Built-in operators cannot be modified by \verb'GrB_set'. User-defined -operators can be used without setting their name or definition, but they can be -used in JIT kernels only when both the JIT C name and the definition are set. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_IndexUnaryOp} Options} -\label{get_set_idxunop} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_IndexUnaryOp op, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_IndexUnaryOp op, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_IndexUnaryOp op, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_IndexUnaryOp op, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_IndexUnaryOp op, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.8in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ -\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ -\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (idxunop) - name of the operator. For built-in operators, this returns the GraphBLAS - name (\verb'"GrB_TRIL"' for \verb'GrB_TRIL', for example). - For user-defined operators, the name can be any string of any length. It - is not used by the JIT. It can be set at most once. \\ -\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & - This must be a valid name of a C function to enable its use in the JIT. - The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including - the \verb'nul' terminating byte. It can be set at most once. \\ -\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & - definition for a user-defined operator, as a C function; built-in operators - return an empty string. It can be set at most once. \\ -\hline -\end{tabular} -} - -Built-in operators cannot be modified by \verb'GrB_set'. User-defined -operators can be used without setting their name or definition, but they can be -used in JIT kernels only when both the JIT C name and the definition are set. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_BinaryOp} Options} -\label{get_set_binop} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_BinaryOp op, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_BinaryOp op, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_BinaryOp op, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_BinaryOp op, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_BinaryOp op, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.8in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ -\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ -\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ -\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ -\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) - name of the operator. For built-in operators, this returns the GraphBLAS - name (\verb'"GrB_LOR"' for \verb'GrB_LOR', for example). - For user-defined operators, the name can be any string of any length. It - is not used by the JIT. It can be set at most once. \\ -\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & - This must be a valid name of a C function to enable its use in the JIT. - The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including - the \verb'nul' terminating byte. It can be set at most once. \\ -\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & - definition for a user-defined operator, as a C function; built-in operators - return an empty string. It can be set at most once. \\ -\verb'GxB_THETA' & R & \verb'GrB_Scalar' & - value of \verb'Theta', if any. - The type of the \verb'GrB_Scalar' - must match the \verb'Theta' type of the underlying - index-binary operator exactly. \\ -\hline -\end{tabular} -} - -Built-in operators cannot be modified by \verb'GrB_set'. User-defined -operators can be used without setting their name or definition, but they can be -used in JIT kernels only when both the JIT C name and the definition are set. - -To use the JIT, all monoids and semirings that access this binary operator must -be defined after the user-defined operator has been given both a name and a -definition. GraphBLAS can use a monoid or semiring that uses a binary operator -without a name, but it cannot use the JIT, even if the operator is given a name -later on after the operator is created. - -The \verb'*THETA*' options can only be used in the binary operator was -created by \verb'GxB_BinaryOp_new_IndexOp'. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GxB\_IndexBinaryOp} Options} -\label{get_set_idxbinop} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GxB_IndexBinaryOp op, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GxB_IndexBinaryOp op, char * value, GrB_Field f) ; -GrB_Info GrB_get (GxB_IndexBinaryOp op, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GxB_IndexBinaryOp op, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GxB_IndexBinaryOp op, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.8in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ -\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ -\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ -\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ -\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) - name of the operator. - For user-defined operators, the name can be any string of any length. It - is not used by the JIT. It can be set at most once. \\ -\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & - This must be a valid name of a C function to enable its use in the JIT. - The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including - the \verb'nul' terminating byte. It can be set at most once. \\ -\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & - definition for a user-defined operator, as a C function; built-in operators - return an empty string. It can be set at most once. \\ -\hline -\end{tabular} -} - -There are no built-in index-binary operators, but if there are in the future, -they will not be be modified by \verb'GrB_set'. User-defined operators can be -used without setting their name or definition, but they can be used in JIT -kernels only when both the JIT C name and the definition are set. - -To use the JIT, all semirings that access this index-binary operator must -be defined after the user-defined operator has been given both a name and a -definition. GraphBLAS can use a semiring that uses a binary operator -without a name, but it cannot use the JIT, even if the operator is given a name -later on after the operator is created. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Monoid} Options} -\label{get_set_monoid} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Monoid monoid, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Monoid monoid, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Monoid monoid, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Monoid monoid, size_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Monoid monoid, void * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Monoid monoid, char * value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code \newline - (see \verb'GrB_Type_code') \\ -\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ -\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (monoid) - name of the monoid. For built-in monoids, this returns the GraphBLAS - name (\verb'"GrB_LOR_MONOID_BOOL"' for \verb'GrB_LOR_MONOID_BOOL', for example). - For user-defined monoids, the name can be any string of any length. It is - not used by the JIT. It can be set at most once. \\ -\hline -\verb'GxB_MONOID_IDENTITY' & R & \verb'GrB_Scalar' & - identity value of the monoid. The type of the \verb'GrB_Scalar' - must match the monoid type exactly. \\ -\verb'GxB_MONOID_TERMINAL' & R & \verb'GrB_Scalar' & - terminal value of a terminal monoid. The type of the \verb'GrB_Scalar' - must match the monoid type exactly. If the monoid is not terminal, - the \verb'GrB_Scalar' is returned with no entry. \\ -\hline -\verb'GxB_MONOID_OPERATOR' & R & \verb'void *' & - binary operator of the monoid, as a \verb'GrB_BinaryOp' \\ -\hline -\end{tabular} -} - -Built-in monoids cannot be modified by \verb'GrB_set'. - -For \verb'GxB_MONOID_OPERATOR', -the \verb'op' is returned as an alias, not as a new object. For example, -if a monoid is created with a user-defined binary operator, the following usage -returns a shallow copy of the operator: - - {\footnotesize - \begin{verbatim} - GrB_BinaryOp binop ; - GrB_BinaryOp_new (&binop, func, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; - GrB_Monoid monoid ; - GrB_Monoid_new (&monoid, binop, (bool) false) ; \end{verbatim} } - -With the above objects defined, the following two code snippets do the same thing: - - {\footnotesize - \begin{verbatim} - // getting an alias to the binary operator directly: - GrB_BinaryOp op ; - op = binop ; \end{verbatim} } - - {\footnotesize - \begin{verbatim} - // getting an alias to the binary operator using GrB_get: - GrB_BinaryOp op ; - GrB_get (monoid, (void *) &op, GxB_MONOID_OPERATOR) ; - assert (op == binop) ; \end{verbatim} } - -As a result, it is not valid to free both the \verb'op' and the \verb'binop', -since they are the same object. This usage returns the built-in \verb'GrB_LOR' -operator of the corresponding built-in monoid: - - {\footnotesize - \begin{verbatim} - GrB_BinaryOp op ; - GrB_get (GrB_LOR_MONOID, (void *) &op, GxB_MONOID_OPERATOR) ; - assert (op == GrB_LOR) ; \end{verbatim} } - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Semiring} Options} -\label{get_set_semiring} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Semiring semiring, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Semiring semiring, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Semiring semiring, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Semiring semiring, size_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Semiring semiring, void * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Semiring semiring, GrB_Scalar value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.8in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') - of the multiplicative operator \\ -\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code - of the multiplicative operator \\ -\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code - of the multiplicative operator, - and the monoid type. \\ -\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ -\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type - of the multiplicative operator \\ -\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type - of the multiplicative operator \\ -\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type - of the multiplicative operator, - and the monoid type. \\ -\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ -\hline -\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (semiring) - name of the semiring. For built-in semirings, this returns the GraphBLAS - name (\verb'"GrB_LOR_LAND_SEMIRING_BOOL"' for \verb'GrB_LOR_LAND_SEMIRING_BOOL', - for example). For user-defined semirings, the name can be any string of any - length. It is not used by the JIT. It can be set at most once. \\ -\verb'GxB_THETA' & R & \verb'GrB_Scalar' & - value of \verb'Theta', if any. - The type of the \verb'GrB_Scalar' - must match the \verb'Theta' type of the underlying - index-binary operator exactly. \\ -\hline -\end{tabular} -} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GxB_MONOID_IDENTITY' & R & \verb'GrB_Scalar' & - identity value of the monoid. The type of the \verb'GrB_Scalar' - must match the monoid type exactly. \\ -\verb'GxB_MONOID_TERMINAL' & R & \verb'GrB_Scalar' & - terminal value of a terminal monoid. The type of the \verb'GrB_Scalar' - must match the monoid type exactly. If the monoid is not terminal, - the \verb'GrB_Scalar' is returned with no entry. \\ -\hline -\verb'GxB_MONOID_OPERATOR' & R & \verb'void *' & - binary operator of the monoid, as a \verb'GrB_BinaryOp'; - See Section~\ref{get_set_monoid} \\ -\verb'GxB_SEMIRING_MONOID' & R & \verb'void *' & - monoid of the semiring, as a \verb'GrB_Monoid' \\ -\verb'GxB_SEMIRING_MULTIPLY' & R & \verb'void *' & - multiplicative operator of the semiring, as a \verb'GrB_BinaryOp' \\ -\hline -\end{tabular} -} - -Built-in semirings cannot be modified by \verb'GrB_set'. - -The \verb'GxB_SEMIRING_MONOID' option returns the \verb'GrB_Monoid' of the -semiring. The \verb'GxB_SEMIRING_MULTIPLY' option returns the -\verb'GrB_BinaryOp' for the multiplicative operator of the semiring. For -example: - - {\footnotesize - \begin{verbatim} - // getting an alias to the monoid and multiply operator using GrB_get: - GrB_BinaryOp op ; - GrB_Monoid mon ; - GrB_Semiring semiring = GrB_PLUS_TIMES_FP32 ; - GrB_get (semiring, (void *) &mon, GxB_SEMIRING_MONOID) ; - GrB_get (semiring, (void *) &op, GxB_SEMIRING_MULTIPLY) ; - assert (op == GrB_TIMES_FP32) ; - assert (mon == GrB_PLUS_MONOID_FP32) ; \end{verbatim} } - -The binary op and monoid returned are aliases, not new objects. - -The \verb'*THETA*' options can only be used in the multiplicative binary -operator of the semiring was created by \verb'GxB_BinaryOp_new_IndexOp'. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Matrix} Options} -\label{get_set_matrix} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Matrix A, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Matrix A, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Matrix A, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Matrix A, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Matrix A, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Matrix A, char * value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Matrix A, int32_t value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.2in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_STORAGE_ORIENTATION_HINT' & R/W & \verb'int32_t'& See \verb'GrB_Orientation', \newline - and Section~\ref{storage_orientation}. \\ -\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& matrix type \\ -\verb'GxB_SPARSITY_CONTROL' & R/W & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\hline -\verb'GrB_NAME' & R/W & \verb'char *' & name of the matrix. - This can be set any number of times. \\ -\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the matrix. \\ -\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the matrix. \\ -\hline -\verb'GxB_HYPER_SWITCH' & R/W & \verb'double' & See Section~\ref{hypersparse} \\ -\verb'GxB_BITMAP_SWITCH' & R/W & \verb'double' & See Section~\ref{bitmap_switch} \\ -\hline -\end{tabular} -} - -%------------------------------------------------------------------------------- -\subsubsection{Storing a matrix by row or by column} -\label{storage_orientation} -%------------------------------------------------------------------------------- - -The GraphBLAS \verb'GrB_Matrix' is entirely opaque to the user application, and -the GraphBLAS API does not specify how the matrix should be stored. However, -choices made in how the matrix is represented in a particular implementation, -such as SuiteSparse:GraphBLAS, can have a large impact on performance. - -Many graph algorithms are just as fast in any format, but some algorithms are -much faster in one format or the other. For example, suppose the user -application stores a directed graph as a matrix \verb'A', with the edge $(i,j)$ -represented as the value \verb'A(i,j)', and the application makes many accesses -to the $i$th row of the matrix, with \verb'GrB_Col_extract' -\verb'(w,...,A,GrB_ALL,...,i,desc)' with the transposed descriptor -(\verb'GrB_INP0' set to \verb'GrB_TRAN'). If the matrix is stored by column -this can be extremely slow, just like the expression \verb'w=A(i,:)' in MATLAB, -where \verb'i' is a scalar. Since this is a typical use-case in graph -algorithms, the default format in SuiteSparse:GraphBLAS is to store its -matrices by row, in Compressed Sparse Row format (CSR). - -MATLAB stores its sparse matrices by column, in ``non-hypersparse'' format, in -what is called the Compressed Sparse Column format, or CSC for short. An -\verb'm'-by-\verb'n' matrix in MATLAB is represented as a set of \verb'n' -column vectors, each with a sorted list of row indices and values of the -nonzero entries in that column. As a result, \verb'w=A(:,j)' is very fast in -MATLAB, since the result is already held in the data structure a single list, -the $j$th column vector. However, \verb'w=A(i,:)' is very slow in MATLAB, -since every column in the matrix has to be searched to see if it contains row -\verb'i'. In MATLAB, if many such accesses are made, it is much better to -transpose the matrix (say \verb"AT=A'") and then use \verb"w=AT(:,i)" instead. -This can have a dramatic impact on the performance of MATLAB. - -Likewise, if \verb'u' is a very sparse column vector and \verb'A' is stored by -column, then \verb"w=u'*A" (via \verb'GrB_vxm') is slower than \verb'w=A*u' -(via \verb'GrB_mxv'). The opposite is true if the matrix is stored by row. - -SuiteSparse:GraphBLAS stores its matrices by row, by default (with one -exception described below). However, it can also be instructed to store any -selected matrices, or all matrices, by column instead (just like MATLAB), so -that \verb'w=A(:,j)' (via \verb'GrB_Col_extract') is very fast. The change in -data format has no effect on the result, just the time and memory usage. To -use a column-oriented format by default, the following can be done in a user -application that tends to access its matrices by column. - - {\footnotesize - \begin{verbatim} - GrB_init (...) ; - // just after GrB_init: do the following: - GrB_set (GrB_GLOBAL, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; \end{verbatim} } - -If this is done, and no other \verb'GrB_set' calls are made with \newline -\verb'GrB_STORAGE_ORIENATION_HINT', all matrices will be stored by column. -The default format is \verb'GrB_ROWMAJOR'. - -All vectors (\verb'GrB_Vector') are held by column, and this cannot be changed. - -By default, matrices of size \verb'm-by-1' are held by column, regardless of -the global setting described above. Matrices of size \verb'1-by-n' with -\verb'n' not equal to 1 are held by row, regardless of the global setting. -The global setting only affects matrices with both \verb'm > 1' and \verb'n > 1'. -Empty matrices (\verb'0-by-0') are also controlled by the global setting. - -After creating a matrix with \verb'GrB_Matrix_new (&A, ...)', -its format can be changed arbitrarily with: - - {\footnotesize - \begin{verbatim} - GrB_set (A, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; - GrB_set (A, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; \end{verbatim} } - -If set to other values (\verb'GrB_BOTH' or \verb'GrB_UNKNOWN'), the -format is changed to \verb'GrB_ROWMAJOR'. - -With this setting, even an \verb'm-by-1' matrix can then be changed to be held -by row, for example. Likewise, once a \verb'1-by-n' matrix is created, it can -be converted to column-oriented format. - -%------------------------------------------------------------------------------- -\subsubsection{Hypersparse matrices} -\label{hypersparse} -%------------------------------------------------------------------------------- - -MATLAB can store an \verb'm'-by-\verb'n' matrix with a very large value of -\verb'm', since a CSC data structure takes $O(n+|{\bf A}|)$ memory, independent -of \verb'm', where $|{\bf A}|$ is the number of nonzeros in the matrix. It -cannot store a matrix with a huge \verb'n', and this structure is also -inefficient when $|{\bf A}|$ is much smaller than \verb'n'. In contrast, -SuiteSparse:GraphBLAS can store its matrices in {\em hypersparse} format, -taking only $O(|{\bf A}|)$ memory, independent of how it is stored (by row or -by column) and independent of both \verb'm' and \verb'n' -\cite{BulucGilbert08,BulucGilbert12}. - -In both the CSR and CSC formats, the matrix is held as a set of sparse vectors. -In non-hypersparse format, the set of sparse vectors is itself dense; all -vectors are present, even if they are empty. For example, an -\verb'm'-by-\verb'n' matrix in non-hypersparse CSC format contains \verb'n' -sparse vectors. Each column vector takes at least one integer to represent, -even for a column with no entries. This allows for quick lookup for a -particular vector, but the memory required is $O(n+|{\bf A}|)$. With a -hypersparse CSC format, the set of vectors itself is sparse, and columns with -no entries take no memory at all. The drawback of the hypersparse format is -that finding an arbitrary column vector \verb'j', such as for the computation -\verb'C=A(:,j)', takes $O(\log k)$ time if there $k \le n$ vectors in the data -structure. One advantage of the hypersparse structure is the memory required -for an \verb'm'-by-\verb'n' hypersparse CSC matrix is only $O(|{\bf A}|)$, -independent of \verb'm' and \verb'n'. Algorithms that must visit all non-empty -columns of a matrix are much faster when working with hypersparse matrices, -since empty columns can be skipped. - -The \verb'hyper_switch' parameter controls the hypersparsity of the internal -data structure for a matrix. The parameter is typically in the range 0 to 1. -The default is \verb'hyper_switch' = \verb'GxB_HYPER_DEFAULT', which is an -\verb'extern' \verb'const' \verb'double' value, currently set to 0.0625, or -1/16. This default ratio may change in the future. - -The \verb'hyper_switch' determines how the matrix is converted between the -hypersparse and non-hypersparse formats. Let $n$ be the number of columns of a -CSC matrix, or the number of rows of a CSR matrix. The matrix can have at most -$n$ non-empty vectors. - -Let $k$ be the actual number of non-empty vectors. That is, for the CSC -format, $k \le n$ is the number of columns that have at least one entry. Let -$h$ be the value of \verb'hyper_switch'. - -If a matrix is currently hypersparse, it can be converted to non-hypersparse if -the either condition $n \le 1$ or $k > 2nh$ holds, or both. Otherwise, it -stays hypersparse. Note that if $n \le 1$ the matrix is always stored as -non-hypersparse. - -If currently non-hypersparse, it can be converted to hypersparse if -both conditions $n > 1$ and $k \le nh$ hold. Otherwise, it stays -non-hypersparse. Note that if $n \le 1$ the matrix always remains -non-hypersparse. - -The default value of \verb'hyper_switch' is assigned at startup by -\verb'GrB_init', and can then be modified globally with \verb'GrB_set'. All -new matrices are created with the same \verb'hyper_switch', determined by the -global value. Once a particular matrix \verb'A' has been constructed, its -hypersparsity ratio can be modified from the default with: - - {\footnotesize - \begin{verbatim} - double hyper_switch = 0.2 ; - GrB_set (A, hyper_switch, GxB_HYPER_SWITCH) ; \end{verbatim}} - -To force a matrix to always be non-hypersparse, use \verb'hyper_switch' equal to -\verb'GxB_NEVER_HYPER'. To force a matrix to always stay hypersparse, set -\verb'hyper_switch' to \verb'GxB_ALWAYS_HYPER'. - -A \verb'GrB_Matrix' can thus be held in one of four formats: any combination of -hyper/non-hyper and CSR/CSC. All \verb'GrB_Vector' objects are always stored -in non-hypersparse CSC format. - -A new matrix created via \verb'GrB_Matrix_new' starts with $k=0$ and is created -in hypersparse form by default unless $n \le 1$ or if $h<0$, where $h$ is the -global \verb'hyper_switch' value. The matrix is created in either -\verb'GrB_ROWMAJOR' or \verb'GrB_COLMAJOR' format, as determined by the last call -to -\verb'GrB_set(GrB_GLOBAL,' \verb'..., GrB_STORAGE_ORIENTATION_HINT,...)' or \verb'GrB_init'. - -A new matrix \verb'C' created via \verb'GrB_dup (&C,A)' inherits the CSR/CSC -format, hypersparsity format, and \verb'hyper_switch' from \verb'A'. - -%------------------------------------------------------------------------------- -\subsubsection{Bitmap matrices} -\label{bitmap_switch} -%------------------------------------------------------------------------------- - -By default, SuiteSparse:GraphBLAS switches between all four formats -(hypersparse, sparse, bitmap, and full) automatically. Let $d = |{\bf A}|/mn$ -for an $m$-by-$n$ matrix $\bf A$ with $|{\bf A}|$ entries. If the matrix is -currently in sparse or hypersparse format, and is modified so that $d$ exceeds -a given threshold, it is converted into bitmap format. The default threshold -is controlled by the \verb'GxB_BITMAP_SWITCH' setting, which can be set -globally, or for a particular matrix or vector. - -The default value of the switch to bitmap format depends on $\min(m,n)$, for a -matrix of size $m$-by-$n$. For the global setting, the bitmap switch is a -\verb'double' array of size \verb'GxB_NBITMAP_SWITCH'. The defaults are given -below: - -\vspace{0.2in} -{\small -\begin{tabular}{lll} -parameter & default & matrix sizes \\ -\hline -\verb'bitmap_switch [0]' & 0.04 & $\min(m,n) = 1$ (and all vectors) \\ -\verb'bitmap_switch [1]' & 0.05 & $\min(m,n) = 2$ \\ -\verb'bitmap_switch [2]' & 0.06 & $\min(m,n) = 3$ to 4 \\ -\verb'bitmap_switch [3]' & 0.08 & $\min(m,n) = 5$ to 8 \\ -\verb'bitmap_switch [4]' & 0.10 & $\min(m,n) = 9$ to 16\\ -\verb'bitmap_switch [5]' & 0.20 & $\min(m,n) = 17$ to 32\\ -\verb'bitmap_switch [6]' & 0.30 & $\min(m,n) = 33$ to 64 \\ -\verb'bitmap_switch [7]' & 0.40 & $\min(m,n) > 64$ \\ -\end{tabular} -} -\vspace{0.2in} - -That is, by default a \verb'GrB_Vector' is held in bitmap format if its density -exceeds 4\%. To change the global settings, do the following: - -{\footnotesize -\begin{verbatim} - double bswitch [GxB_NBITMAP_SWITCH] = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 } ; - GrB_set (GrB_GLOBAL, (void *) bswitch, GxB_BITMAP_SWITCH, - GxB_NBITMAP_SWITCH * sizeof (double)) ; -\end{verbatim} -} - -If the matrix is currently in bitmap format, it is converted to full if all -entries are present, or to sparse/hypersparse if $d$ drops below $b/2$, if its -bitmap switch is $b$. A matrix or vector with $d$ between $b/2$ and $b$ -remains in its current format. - -%------------------------------------------------------------------------------- -\subsubsection{Sparsity status} -\label{sparsity_status} -%------------------------------------------------------------------------------- - -The sparsity status of a matrix can be queried with the following, which -returns a value of \verb'GxB_HYPERSPARSE' (1), \verb'GxB_SPARSE' (2), -\verb'GxB_BITMAP' (4), or \verb'GxB_FULL' (8). - -{\footnotesize -\begin{verbatim} - int32_t sparsity ; - GrB_get (A, &sparsity, GxB_SPARSITY_STATUS) ; \end{verbatim}} - -The sparsity format of a matrix can be controlled with the field set to -\verb'GxB_SPARSITY_CONTROL', for which the \verb'value' can be any mix (a sum or bitwise -or) of \verb'GxB_HYPERSPARSE', \verb'GxB_SPARSE', \verb'GxB_BITMAP', and -\verb'GxB_FULL'. By default, a matrix or vector can be held in any format, -with the default setting \verb'GxB_AUTO_SPARSITY', which is equal to -\verb'GxB_HYPERSPARSE' + \verb'GxB_SPARSE' + \verb'GxB_BITMAP' + -\verb'GxB_FULL' (15). To enable a matrix to take on just \verb'GxB_SPARSE' or -\verb'GxB_FULL' formats, but not \verb'GxB_HYPERSPARSE' or \verb'GxB_BITMAP', -for example, use the following: - -{\footnotesize -\begin{verbatim} - GrB_set (A, GxB_SPARSE + GxB_FULL, GxB_SPARSITY_CONTROL) ; \end{verbatim}} - -In this case, SuiteSparse:GraphBLAS will hold the matrix in sparse format -(\verb'CSR' or \verb'CSC', depending on its -\verb'GrB_STORAGE_ORIENTATION_HINT'), unless all entries are present, in which -case it will be converted to full format. - -Only the least significant 4 bits of the sparsity control are considered, so -the formats can be bitwise negated. For example, to allow for any format -except full: - -{\footnotesize -\begin{verbatim} - GrB_set (A, ~GxB_FULL, GxB_SPARSITY_CONTROL) ; \end{verbatim}} - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Vector} Options} -\label{get_set_vector} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Vector v, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Vector v, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Vector v, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Vector v, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Vector v, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Vector v, char * value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Vector v, int32_t value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{3in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& vector type \\ -\verb'GxB_SPARSITY_CONTROL' & R/W & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\hline -\verb'GrB_NAME' & R/W & \verb'char *' & name of the vector. \\ -% This can be set any number of times. \\ -\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the vector. \\ -\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the vector. \\ -\hline -\verb'GxB_BITMAP_SWITCH' & R/W & \verb'double' & See Section~\ref{bitmap_switch} \\ -\hline -\end{tabular} -} - -See Section~\ref{get_set_matrix}; a \verb'GrB_Vector' is treated as if it were -an $n$-by-1 matrix, and is always in column major form. It is never -hypersparse. - -%------------------------------------------------------------------------------- -% \newpage -\subsection{{\sf GrB\_Scalar} Options} -\label{get_set_scalar} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Scalar s, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Scalar s, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Scalar s, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Scalar s, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Scalar s, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Scalar s, char * value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Scalar s, int32_t value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{3in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline - -\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& scalar type \\ -\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\hline -\verb'GrB_NAME' & R/W & \verb'char *' & name of the scalar. \\ -% This can be set any number of times. \\ -\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the scalar. \\ -\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the scalar. \\ -\hline -\end{tabular} -} -\vspace{0.1in} - -See Section~\ref{get_set_matrix}; a \verb'GrB_Scalar' is treated as if it were -a 1-by-1 matrix, and is always in column major form. It is never hypersparse. - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GrB\_Descriptor} Options} -\label{get_set_descriptor} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GrB_Descriptor desc, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Descriptor desc, char * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Descriptor desc, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GrB_Descriptor desc, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GrB_Descriptor desc, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Descriptor desc, char * value, GrB_Field f) ; -GrB_Info GrB_set (GrB_Descriptor desc, int32_t value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{3.3in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_OUTP' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_REPLACE' \\ -\verb'GrB_MASK' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT', \verb'GrB_COMP', \verb'GrB_STRUCTURE', or - \newline \verb'GrB_COMP_STRUCTURE' \\ -\verb'GrB_INP0' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_TRAN' \\ -\verb'GrB_INP1' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_TRAN' \\ -\verb'GxB_AxB_METHOD' & R/W & \verb'int32_t'& Method used by \verb'GrB_mxm' (\verb'GrB_DEFAULT', \newline - \verb'GxB_AxB_GUSTAVSON'. \verb'GxB_AxB_HASH', \newline - \verb'GxB_AxB_SAXPY', or \verb'GxB_AxB_DOT'). \\ -\verb'GxB_SORT' & R/W & \verb'int32_t'& if true, \verb'GrB_mxm' returns its output in sorted form. \\ -\verb'GxB_COMPRESSION' & R/W & \verb'int32_t'& compression method for serialize methods. \\ -\verb'GxB_IMPORT' & R/W & \verb'int32_t'& \verb'GxB_FAST_IMPORT' or \verb'GxB_SECURE_IMPORT' for \verb'GxB*_pack*' methods. \\ -\hline -\verb'GrB_NAME' & R/W & \verb'char *' & name of the descriptor. - This can be set any number of times for user-defined descriptors. Built-in - descriptors have the same name as the variable name (\verb'"GrB_DESC_T1"' - for the \verb'GrB_DESC_T1' descriptor, for example) \\ -\hline -\end{tabular} -} - -The following table describes each option. -See Section~\ref{descriptor} for more details. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{|l|p{2.4in}|p{2.2in}|} -\hline -Descriptor & Default & Non-default \\ -field & & \\ -\hline - -\verb'GrB_OUTP' - & \verb'GrB_DEFAULT': - The output matrix is not cleared. The operation computes - ${\bf C \langle M \rangle = C \odot T}$. - & \verb'GrB_REPLACE': - After computing ${\bf Z=C\odot T}$, - the output {\bf C} is cleared of all entries. - Then ${\bf C \langle M \rangle = Z}$ is performed. \\ - -\hline - -\verb'GrB_MASK' - & \verb'GrB_DEFAULT': - The Mask is not complemented. \verb'Mask(i,j)=1' means the value $C_{ij}$ - can be modified by the operation, while \verb'Mask(i,j)=0' means the value - $C_{ij}$ shall not be modified by the operation. - & \verb'GrB_COMP': - The Mask is complemented. \verb'Mask(i,j)=0' means the value $C_{ij}$ - can be modified by the operation, while \verb'Mask(i,j)=1' means the value - $C_{ij}$ shall not be modified by the operation. \\ - & - & \verb'GrB_STRUCTURE': - The values of the Mask are ignored. If \verb'Mask(i,j)' is an entry - in the \verb'Mask' matrix, it is treated as if \verb'Mask(i,j)=1'. - The two options \verb'GrB_COMP' and \verb'GrB_STRUCTURE' can be - combined, with two subsequent calls, or with a single call with the setting - \verb'GrB_COMP+GrB_STRUCTURE'. \\ - -\hline - -\verb'GrB_INP0' - & \verb'GrB_DEFAULT': - The first input is not transposed prior to using it in the operation. - & \verb'GrB_TRAN': - The first input is transposed prior to using it in the operation. Only - matrices are transposed, never vectors. \\ - -\hline - -\verb'GrB_INP1' - & \verb'GrB_DEFAULT': - The second input is not transposed prior to using it in the operation. - & \verb'GrB_TRAN': - The second input is transposed prior to using it in the operation. Only - matrices are transposed, never vectors. \\ - -\hline - -\verb'GxB_AxB_METHOD' - & \verb'GrB_DEFAULT': - The method for \verb'C=A*B' is selected automatically. - & \verb'GxB_AxB_'{\em method}: The selected method is used to compute - \verb'C=A*B'. \\ - -\hline - -\verb'GxB_SORT' - & \verb'GrB_DEFAULT': - The computation of \verb'C=A*B' may leave \verb'C' in a jumbled state; - \verb'GrB_wait' will finalize the matrix. - & any nonzero value: \verb'C=A*B' always returns \verb'C' in final, - sorted form. \\ - -\hline - -\verb'GxB_COMPRESION' - & \verb'GrB_DEFAULT': - Serialize methods will use the default method, ZSTD (level 1) - & See Section~\ref{serialize_deserialize} \\ - -\hline - -\verb'GxB_IMPORT' - & \verb'GrB_DEFAULT': fast import - & \verb'GxB_SECURE_IMPORT': secure import \\ - -\hline -\end{tabular} -} - - -%------------------------------------------------------------------------------- -\newpage -\subsection{{\sf GxB\_Context} Options} -\label{get_set_context} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (GxB_Context Context, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_get (GxB_Context Context, char * value, GrB_Field f) ; -GrB_Info GrB_get (GxB_Context Context, int32_t * value, GrB_Field f) ; -GrB_Info GrB_get (GxB_Context Context, size_t * value, GrB_Field f) ; - -GrB_Info GrB_set (GxB_Context Context, GrB_Scalar value, GrB_Field f) ; -GrB_Info GrB_set (GxB_Context Context, char * value, GrB_Field f) ; -GrB_Info GrB_set (GxB_Context Context, int32_t value, GrB_Field f) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{3.5in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GxB_NTHREADS' & R/W & \verb'int32_t' & number of OpenMP threads to use; - See Section~\ref{omp_parallelism} \\ -\verb'GxB_CHUNK' & R/W & \verb'double' & chunk factor for task creation; - See Section~\ref{omp_parallelism} \\ -\hline -\verb'GrB_NAME' & R/W & \verb'char *' & name of the context. - This can be set any number of times for user-defined contexts. Built-in - contexts have the same name as the variable name (\verb'"GxB_CONTEXT_WORLD"' - for the \verb'GxB_CONTEXT_WORLD' context, for example) \\ -\hline -\end{tabular} -} - -NOTE: the non-polymorphic names for this method are -\verb'GxB_Context_get_[KIND]' and \verb'GxB_Context_set_[KIND]', where -\verb'KIND' can be: - \verb'Scalar' (for \verb'GrB_Scalar'), - \verb'String' (for \verb'char *'), - \verb'INT' (for \verb'int32_t'), and - \verb'SIZE' (for \verb'size_t *' for \verb'GrB_get' only), and - \verb'VOID' (for \verb'void *'). -The non-polymorphic suffix of \verb'INT' is used here instead of -\verb'INT32' because \verb'GxB_Context_*_INT32' appear as historical methods -in version v8.0 and earlier, which are now deprecated. - -For the \verb'int32_t' type, the use of the polymorphic \verb'GrB_set' and -\verb'GrB_get' accesses the correct version of this method. When using -non-polymorphic methods, the use of \verb'GxB_Context_get_INT' and -\verb'GxB_Context_set_INT' is recommended. - -%------------------------------------------------------------------------------- -\newpage -\subsection{Options for inspecting a serialized blob} -\label{get_set_blob} -%------------------------------------------------------------------------------- - -\begin{mdframed}[userdefinedwidth=6.5in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_get (const void *blob, GrB_Scalar value, GrB_Field f, size_t blobsize) ; -GrB_Info GrB_get (const void *blob, char * value, GrB_Field f, size_t blobsize) ; -GrB_Info GrB_get (const void *blob, int32_t * value, GrB_Field f, size_t blobsize) ; -GrB_Info GrB_get (const void *blob, size_t * value, GrB_Field f, size_t blobsize) ; -\end{verbatim} -}\end{mdframed} - -\noindent -{\small -\begin{tabular}{|l|l|l|p{2.2in}|} -\hline -\verb'GrB_Field' & R/W & C type & description \\ -\hline -\verb'GrB_STORAGE_ORIENTATION_HINT' & R & \verb'int32_t'& See \verb'GrB_Orientation', \newline - and Section~\ref{storage_orientation}. \\ -\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& type of matrix in the blob \\ -\verb'GxB_SPARSITY_CONTROL' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ -\hline -\verb'GrB_NAME' & R & \verb'char *' & name of the matrix in the blob. \\ -\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the matrix in the blob. \\ -\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the matrix in the blob. \\ -\hline -\verb'GxB_HYPER_SWITCH' & R & \verb'double' & See Section~\ref{hypersparse} \\ -\verb'GxB_BITMAP_SWITCH' & R & \verb'double' & See Section~\ref{bitmap_switch} \\ -\hline -\end{tabular} -} - -The \verb'GrB_Matrix_serialize' and \verb'GxB_Matrix_serialize' methods create -a {\em blob} as a single array of bytes that contains all content of a -\verb'GrB_Matrix'. These \verb'GrB_get' methods can query a blob for the same -values that can be queried for a \verb'GrB_Matrix'. The blob cannot be -modified by \verb'GrB_set'. - -Note that these \verb'GrB_get' methods add a fourth parameter, the size of -the blob. All other \verb'GrB_get' methods have just three parameters: -the object, the value, and the field. - diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf index cc461f2ce3..7f178423f8 100644 Binary files a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf and b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf differ diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex index 9e3f35fe6e..36c9f4a4fe 100644 --- a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex +++ b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex @@ -55,15845 +55,34 @@ % version and date are set by cmake \input{GraphBLAS_version.tex} -%------------------------------------------------------------------------------- \begin{document} -%------------------------------------------------------------------------------- \maketitle - -\begin{abstract} -SuiteSparse:GraphBLAS is a full 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 for creating high-performance graph algorithms based on the elegant -mathematics of sparse matrix operations on a semiring. - -When compared with MATLAB R2021a, some methods in GraphBLAS are up to -a million times faster than MATLAB, even when using the same syntax. -Typical speedups are in the range 2x to 30x. -The statement \verb'C(M)=A' when using MATLAB sparse matrices takes -$O(e^2)$ time where $e$ is the number of entries in \verb'C'. GraphBLAS -can perform the same computation with the exact same syntax, but -in $O(e \log e)$ time (or $O(e)$ in some cases), and in practice that -means GraphBLAS can compute \verb'C(M)=A' for a large problem in under -a second, while MATLAB takes about 4 to 5 days. - -SuiteSparse:GraphBLAS is under the Apache-2.0 license. - -Version 8.0 adds several new features, in particular a JIT for compiling -kernels at run-time, and a new \verb'GxB_Context' object. -See Sections~\ref{context} and \ref{jit} for details. -Version 9.0 adds the \verb'GrB_get' and \verb'GrB_set' methods; -see Section~\ref{options}. - -\end{abstract} - +\input{UserGuide/GrB_abstract.tex} \newpage {\small \tableofcontents } +\input{UserGuide/GrB_intro.tex} +\input{UserGuide/GrB_concepts.tex} +\input{UserGuide/GrB_v10.tex} +\input{UserGuide/GrB_interfaces.tex} +\input{UserGuide/GrB_init.tex} +\input{UserGuide/GrB_objects.tex} +\input{UserGuide/GrB_mask.tex} +\input{UserGuide/GrB_context.tex} +\input{UserGuide/GrB_jit.tex} +\input{UserGuide/GrB_get_set.tex} +\input{UserGuide/GrB_colon.tex} +\input{UserGuide/GrB_operations.tex} +\input{UserGuide/GrB_print.tex} +\input{UserGuide/GrB_iterator.tex} +\input{UserGuide/GrB_iso.tex} +\input{UserGuide/GrB_performance.tex} +\input{UserGuide/GrB_examples.tex} +\input{UserGuide/GrB_installing.tex} +\input{UserGuide/GrB_release.tex} +\input{UserGuide/GrB_acknowledgements.tex} +\input{UserGuide/GrB_resources.tex} +\input{UserGuide/GrB_references.tex} +\end{document} -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Introduction} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{intro} - -The GraphBLAS standard defines sparse matrix and vector operations on an -extended algebra of semirings. The operations are useful for creating a wide -range of graph algorithms. - -For example, consider the matrix-matrix multiplication, ${\bf C=AB}$. Suppose -${\bf A}$ and ${\bf B}$ are sparse $n$-by-$n$ Boolean adjacency matrices of two -undirected graphs. If the matrix multiplication is redefined to use logical -AND instead of scalar multiply, and if it uses the logical OR instead of add, -then the matrix ${\bf C}$ is the sparse Boolean adjacency matrix of a graph -that has an edge $(i,j)$ if node $i$ in ${\bf A}$ and node $j$ in ${\bf B}$ -share any neighbor in common. The OR-AND pair forms an algebraic semiring, and -many graph operations like this one can be succinctly represented by matrix -operations with different semirings and different numerical types. GraphBLAS -provides a wide range of built-in types and operators, and allows the user -application to create new types and operators without needing to recompile the -GraphBLAS library. - -For more details on SuiteSparse:GraphBLAS, and its use in LAGraph, see -\cite{Davis19,Davis23,Davis18b,DavisAznavehKolodziej19,Davis20,Mattson19}. - -A full and precise definition of the GraphBLAS specification is provided in -{\em The GraphBLAS C API Specification} by {Ayd\i n Bulu\c{c}, Timothy Mattson, -Scott McMillan, Jos\'e Moreira, Carl Yang, and Benjamin Brock} -\cite{BulucMattsonMcMillanMoreiraYang17,spec,spec2}, based on {\em GraphBLAS -Mathematics} by Jeremy Kepner \cite{Kepner2017}. The GraphBLAS C API -Specification is available at \url{http://graphblas.org}. -This version of SuiteSparse:GraphBLAS conforms to Version -\input{GraphBLAS_API_version.tex} of {\em The GraphBLAS C API specification}. - -In this User Guide, aspects of the GraphBLAS specification that would be true -for any GraphBLAS implementation are simply called ``GraphBLAS.'' Details -unique to this particular implementation are referred to as -SuiteSparse:GraphBLAS. - -All functions, objects, and macros with a name of the form \verb'GxB_*' are -SuiteSparse-specific extensions to the specification. - -\begin{alert} -{\bf SPEC:} Non-obvious deviations or additions to the GraphBLAS C API -Specification are highlighted in a box like this one, except for \verb'GxB*' -methods. They are not highlighted since their name makes it clear that they -are extensions to the GraphBLAS C API. -\end{alert} - - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Basic Concepts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{basic} - -Since the {\em GraphBLAS C API Specification} provides a precise definition of -GraphBLAS, not every detail of every function is provided here. For example, -some error codes returned by GraphBLAS are self-explanatory, but since a -specification must precisely define all possible error codes a function can -return, these are listed in detail in the {\em GraphBLAS C API Specification}. -However, including them here is not essential and the additional information on -the page might detract from a clearer view of the essential features of the -GraphBLAS functions. - -This User Guide also assumes the reader is familiar with MATLAB/Octave. -MATLAB supports only the conventional plus-times semiring on sparse -double and complex matrices, but a MATLAB-like notation easily extends to the -arbitrary semirings used in GraphBLAS. The matrix multiplication in the -example in the Introduction can be written in MATLAB notation as -\verb'C=A*B', if the Boolean \verb'OR-AND' semiring is understood. Relying on -a MATLAB-like notation allows the description in this User Guide to be -expressive, easy to understand, and terse at the same time. {\em The GraphBLAS -C API Specification} also makes use of some MATLAB-like language, such -as the colon notation. - -MATLAB notation will always appear here in fixed-width font, such as -\verb'C=A*B(:,j)'. In standard mathematical notation it would be written as -the matrix-vector multiplication ${\bf C = A b}_j$ where ${\bf b}_j$ is the -$j$th column of the matrix ${\bf B}$. The GraphBLAS standard is a C API and -SuiteSparse:GraphBLAS is written in C, and so a great deal of C syntax appears -here as well, also in fixed-width font. This User Guide alternates between all -three styles as needed. - -%=============================================================================== -\subsection{Graphs and sparse matrices} %======================================= -%=============================================================================== -\label{sparse} - -Graphs can be huge, with many nodes and edges. A dense adjacency matrix ${\bf -A}$ for a graph of $n$ nodes takes $O(n^2)$ memory, which is impossible if $n$ -is, say, a million. Let $|{\bf A}|$ denote the number of entries in a matrix. -Most graphs arising in practice are sparse, however, with only $|{\bf A}|=O(n)$ -edges, where $|{\bf A}|$ denotes the number of edges in the graph, or the -number of explicit entries present in the data structure for the matrix ${\bf -A}$. Sparse graphs with millions of nodes and edges can easily be created by -representing them as sparse matrices, where only explicit values need to be -stored. Some graphs are {\em hypersparse}, with ${|\bf A}| << n$. -SuiteSparse:GraphBLAS supports three kinds of sparse matrix formats: a regular -sparse format, taking $O(n+|{\bf A}|)$ space, a hypersparse format taking only -$O(|{\bf A}|)$ space, and a bitmap form, taking $O(n^2)$ space. Full matrices -are also represented in $O(n^2)$ space. Using its hypersparse format, creating -a sparse matrix of size $n$-by-$n$ where $n=2^{60}$ (about $10^{18}$) can be -done on quite easily on a commodity laptop, limited only by $|{\bf A}|$. -To the GraphBLAS user application, all matrices look alike, since these formats -are opaque, and SuiteSparse:GraphBLAS switches between them at will. - -A sparse matrix data structure only stores a subset of the possible $n^2$ -entries, and it assumes the values of entries not stored have some implicit -value. In conventional linear algebra, this implicit value is zero, but it -differs with different semirings. Explicit values are called {\em entries} and -they appear in the data structure. The {\em pattern} (also called the -{\em structure}) of a matrix defines where its explicit entries appear. It -will be referenced in one of two equivalent ways. It can be viewed as a set of -indices $(i,j)$, where $(i,j)$ is in the pattern of a matrix ${\bf A}$ if ${\bf -A}(i,j)$ is an explicit value. It can also be viewed as a Boolean matrix ${\bf -S}$ where ${\bf S}(i,j)$ is true if $(i,j)$ is an explicit entry and false -otherwise. In MATLAB notation, \verb'S=spones(A)' or \verb'S=(A~=0)', if the -implicit value is zero. The \verb'(i,j)' pairs, and their values, can also be -extracted from the matrix via the MATLAB expression \verb'[I,J,X]=find(A)', -where the \verb'k'th tuple \verb'(I(k),J(k),X(k))' represents the explicit -entry \verb'A(I(k),J(k))', with numerical value \verb'X(k)' equal to $a_{ij}$, -with row index $i$=\verb'I(k)' and column index $j$=\verb'J(k)'. - -The entries in the pattern of ${\bf A}$ can take on any value, including the -implicit value, whatever it happens to be. This differs slightly from MATLAB, -which always drops all explicit zeros from its sparse matrices. This is a -minor difference but GraphBLAS cannot drop explicit zeros. For example, in the -max-plus tropical algebra, the implicit value is negative infinity, and zero -has a different meaning. Here, the MATLAB notation used will assume that no -explicit entries are ever dropped because their explicit value happens to match -the implicit value. - -{\em Graph Algorithms in the Language on Linear Algebra}, Kepner and Gilbert, -eds., provides a framework for understanding how graph algorithms can be -expressed as matrix computations \cite{KepnerGilbert2011}. For additional -background on sparse matrix algorithms, see also \cite{Davis06book} and -\cite{DavisRajamanickamSidLakhdar16}. - -%=============================================================================== -\subsection{Overview of GraphBLAS methods and operations} %===================== -%=============================================================================== -\label{overview} - -GraphBLAS provides a collection of {\em methods} to create, query, and free its -of objects: sparse matrices, sparse vectors, scalars, types, operators, -monoids, semirings, and a descriptor object used for parameter settings. -Details are given in Section~\ref{objects}. Once these objects are created -they can be used in mathematical {\em operations} (not to be confused with the -how the term {\em operator} is used in GraphBLAS). A short summary of these -operations and their nearest MATLAB/Octave analog is given in the table below. - -% \vspace{0.1in} -\begin{tabular}{ll} -operation & approximate MATLAB/Octave analog \\ -\hline -matrix multiplication & \verb'C=A*B' \\ -element-wise operations & \verb'C=A+B' and \verb'C=A.*B' \\ -reduction to a vector or scalar & \verb's=sum(A)' \\ -apply unary operator & \verb'C=-A' \\ -transpose & \verb"C=A'" \\ -submatrix extraction & \verb'C=A(I,J)' \\ -submatrix assignment & \verb'C(I,J)=A' \\ -select & \verb'C=tril(A)' \\ -\hline -\end{tabular} -\vspace{0.1in} - -GraphBLAS can do far more than what MATLAB/Octave can do in these rough -analogs, but the list provides a first step in describing what GraphBLAS can -do. Details of each GraphBLAS operation are given in Section~\ref{operations}. -With this brief overview, the full scope of GraphBLAS extensions of these -operations can now be described. - -SuiteSparse:GraphBLAS has 13 built-in scalar types: Boolean, single and double -precision floating-point (real and complex), and 8, 16, 32, and 64-bit signed -and unsigned integers. In addition, user-defined scalar types can be created -from nearly any C \verb'typedef', as long as the entire type fits in a -fixed-size contiguous block of memory (of arbitrary size). All of these types -can be used to create GraphBLAS sparse matrices, vectors, or scalars. - -The scalar addition of conventional matrix multiplication is replaced with a -{\em monoid}. A monoid is an associative and commutative binary operator -\verb'z=f(x,y)' where all three domains are the same (the types of \verb'x', -\verb'y', and \verb'z'), and where the operator has an identity value \verb'id' -such that \verb'f(x,id)=f(id,x)=x'. Performing matrix multiplication with a -semiring uses a monoid in place of the ``add'' operator, scalar addition being -just one of many possible monoids. The identity value of addition is zero, -since $x+0=0+x=x$. GraphBLAS includes many built-in operators suitable for -use as a monoid: min (with an identity value of positive infinity), max (whose -identity is negative infinity), add (identity is zero), multiply (with an -identity of one), four logical operators: AND, OR, exclusive-OR, and -Boolean equality (XNOR), four bitwise operators (AND, OR, XOR, and XNOR), -and the ANY operator -See Section~\ref{any_pair} for more details on the unusual ANY operator. -User-created monoids can be defined with any associative and -commutative operator that has an identity value. - -Finally, a semiring can use any built-in or user-defined binary operator -\verb'z=f(x,y)' as its ``multiply'' operator, as long as the type of its -output, \verb'z' matches the type of the semiring's monoid. -The user application can create any semiring based on any types, monoids, -and multiply operators, as long these few rules are followed. - -Just considering built-in types and operators, GraphBLAS can perform -\verb'C=A*B' in thousands of unique semirings. With typecasting, any of these -semirings can be applied to matrices \verb'C', \verb'A', and \verb'B' of 13 -predefined types, in any combination. This results in millions of possible -kinds of sparse matrix multiplication supported by GraphBLAS, and this is -counting just built-in types and operators. By contrast, MATLAB provides just -two semirings for its sparse matrix multiplication \verb'C=A*B': -plus-times-double and plus-times-complex, not counting the typecasting that -MATLAB does when multiplying a real matrix times a complex matrix. - -A monoid can also be used in a reduction operation, like \verb's=sum(A)' in -MATLAB. MATLAB provides the plus, times, min, and max reductions of a real or -complex sparse matrix as \verb's=sum(A)', \verb's=prod(A)', \verb's=min(A)', -and \verb's=max(A)', respectively. In GraphBLAS, any monoid can be used (min, -max, plus, times, AND, OR, exclusive-OR, equality, bitwise operators, -or any user-defined monoid on any user-defined type). - -Element-wise operations are also expanded from what can be done in MATLAB. -Consider matrix addition, \verb'C=A+B' in MATLAB. The pattern of the result is -the set union of the pattern of \verb'A' and \verb'B'. In GraphBLAS, any -binary operator can be used in this set-union ``addition.'' The operator is -applied to entries in the intersection. Entries in \verb'A' but not \verb'B', -or visa-versa, are copied directly into \verb'C', without any application of -the binary operator. The accumulator operation for ${\bf Z = C \odot T}$ -described in Section~\ref{accummask} is one example of this set-union -application of an arbitrary binary operator. - -Consider element-wise multiplication, \verb'C=A.*B' in MATLAB. The operator -(multiply in this case) is applied to entries in the set intersection, and the -pattern of \verb'C' just this set intersection. Entries in \verb'A' but not -\verb'B', or visa-versa, do not appear in \verb'C'. In GraphBLAS, any binary -operator can be used in this manner, not just scalar multiplication. The -difference between element-wise ``add'' and ``multiply'' is not the operators, -but whether or not the pattern of the result is the set union or the set -intersection. In both cases, the operator is only applied to the set -intersection. - -Finally, GraphBLAS includes a {\em non-blocking} mode where operations can be -left pending, and saved for later. This is very useful for submatrix -assignment (\verb'C(I,J)=A' where \verb'I' and \verb'J' are integer vectors), -or scalar assignment (\verb'C(i,j)=x' where \verb'i' and \verb'j' are scalar -integers). Because of how MATLAB stores its matrices, adding and deleting -individual entries is very costly. For example, this is very slow in MATLAB, -taking $O(nz^2)$ time: - - \begin{mdframed} - {\footnotesize - \begin{verbatim} - A = sparse (m,n) ; % an empty sparse matrix - for k = 1:nz - compute a value x, row index i, and column index j - A (i,j) = x ; - end\end{verbatim}}\end{mdframed} - -The above code is very easy read and simple to write, but exceedingly slow. In -MATLAB, the method below is preferred and is far faster, taking at most -$O(|{\bf A}| \log |{\bf A}| +n)$ time. It can easily be a million times faster -than the method above. Unfortunately the second method below is a little -harder to read and a little less natural to write: - - \begin{mdframed} - {\footnotesize - \begin{verbatim} - I = zeros (nz,1) ; - J = zeros (nz,1) ; - X = zeros (nz,1) ; - for k = 1:nz - compute a value x, row index i, and column index j - I (k) = i ; - J (k) = j ; - X (k) = x ; - end - A = sparse (I,J,X,m,n) ; \end{verbatim}} \end{mdframed} - -GraphBLAS can do both methods. SuiteSparse:GraphBLAS stores its matrices in a -format that allows for pending computations, which are done later in bulk, and -as a result it can do both methods above equally as fast as the MATLAB -\verb'sparse' function, allowing the user to write simpler code. - -%=============================================================================== -\subsection{The accumulator and the mask} %===================================== -%=============================================================================== -\label{accummask} - -Most GraphBLAS operations can be modified via transposing input matrices, using -an accumulator operator, applying a mask or its complement, and by clearing all -entries the matrix \verb'C' after using it in the accumulator operator but -before the final results are written back into it. All of these steps are -optional, and are controlled by a descriptor object that holds parameter -settings (see Section~\ref{descriptor}) that control the following options: - -\begin{itemize} -\item the input matrices \verb'A' and/or \verb'B' can be transposed first. - -\item an accumulator operator can be used, like the plus in the statement - \verb'C=C+A*B'. The accumulator operator can be any binary operator, and - an element-wise ``add'' (set union) is performed using the operator. - -\item an optional {\em mask} can be used to selectively write the results to - the output. The mask is a sparse Boolean matrix \verb'Mask' whose size is - the same size as the result. If \verb'Mask(i,j)' is true, then the - corresponding entry in the output can be modified by the computation. If - \verb'Mask(i,j)' is false, then the corresponding in the output is - protected and cannot be modified by the computation. The \verb'Mask' - matrix acts exactly like logical matrix indexing in MATLAB, with one - minor difference: in GraphBLAS notation, the mask operation is $\bf C - \langle M \rangle = Z$, where the mask $\bf M$ appears only on the - left-hand side. In MATLAB, it would appear on both sides as - \verb'C(Mask)=Z(Mask)'. If no mask is provided, the \verb'Mask' matrix is - implicitly all true. This is indicated by passing the value - \verb'GrB_NULL' in place of the \verb'Mask' argument in GraphBLAS - operations. - -\end{itemize} - -\noindent -This process can be described in mathematical notation as: - \vspace{-0.2in} - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> ${\bf A = A}^{\sf T}$, if requested via descriptor (first input option) \\ - \> ${\bf B = B}^{\sf T}$, if requested via descriptor (second input option) \\ - \> ${\bf T}$ is computed according to the specific operation \\ - \> ${\bf C \langle M \rangle = C \odot T}$, - accumulating and writing the results back via the mask - \end{tabbing} } -\noindent -The application of the mask and the accumulator operator is written as -${\bf C \langle M \rangle = C \odot T}$ where ${\bf Z = C \odot T}$ denotes the -application of the accumulator operator, and -${\bf C \langle M \rangle = Z}$ -denotes the mask operator via the Boolean matrix ${\bf M}$. The Accumulator -Phase, ${\bf Z = C \odot T}$, is performed as follows: - - % \vspace{-0.2in} - % accum: Z = C odot T - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> {\bf Accumulator Phase}: compute ${\bf Z = C \odot T}$: \\ - \> \> if \verb'accum' is \verb'NULL' \\ - \> \>\> ${\bf Z = T}$ \\ - \> \> else \\ - \> \>\> ${\bf Z = C \odot T}$ - \end{tabbing}} -The accumulator operator is $\odot$ in GraphBLAS notation, or \verb'accum' -in the code. The pattern of ${\bf C \odot T}$ is the set union of the -patterns of ${\bf C}$ and ${\bf T}$, and the operator is applied only on the -set intersection of ${\bf C}$ and ${\bf T}$. Entries in neither the pattern -of ${\bf C}$ nor ${\bf T}$ do not appear in the pattern of ${\bf Z}$. That is: - % \newpage - \vspace{-0.2in} - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> for all entries $(i,j)$ in ${\bf C \cap T}$ - (that is, entries in both ${\bf C}$ and ${\bf T}$) \\ - \> \> $z_{ij} = c_{ij} \odot t_{ij}$ \\ - \> for all entries $(i,j)$ in ${\bf C \setminus T}$ - (that is, entries in ${\bf C}$ but not ${\bf T}$) \\ - \> \> $z_{ij} = c_{ij}$ \\ - \> for all entries $(i,j)$ in ${\bf T \setminus C}$ - (that is, entries in ${\bf T}$ but not ${\bf C}$) \\ - \> \> $z_{ij} = t_{ij}$ - \end{tabbing} } -The Accumulator Phase is followed by the Mask/Replace Phase, -${\bf C \langle M \rangle = Z}$ -as controlled by the \verb'GrB_REPLACE' and \verb'GrB_COMP' descriptor options: - \vspace{-0.2in} - % mask/replace/scmp: C = Z - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \>{\bf Mask/Replace Phase}: compute ${\bf C \langle M \rangle = Z}$: \\ - \> \> if (\verb'GrB_REPLACE') delete all entries in ${\bf C}$ \\ - \> \> if \verb'Mask' is \verb'NULL' \\ - \> \>\> if (\verb'GrB_COMP') \\ - \> \>\>\> ${\bf C}$ is not modified \\ - \> \>\> else \\ - \> \>\>\> ${\bf C = Z}$ \\ - \> \> else \\ - \> \>\> if (\verb'GrB_COMP') \\ - \> \>\>\> ${\bf C \langle \neg M \rangle = Z}$ \\ - \> \>\> else \\ - \> \>\>\> ${\bf C \langle M \rangle = Z}$ - \end{tabbing} } -Both phases of the accum/mask process are illustrated in MATLAB notation in -Figure~\ref{fig_accummask}. - -\begin{figure} -\begin{mdframed}[leftmargin=-0.4in,userdefinedwidth=5.8in] -{\footnotesize -\begin{verbatim} -function C = accum_mask (C, Mask, accum, T, C_replace, Mask_complement) -[m n] = size (C.matrix) ; -Z.matrix = zeros (m, n) ; -Z.pattern = false (m, n) ; - -if (isempty (accum)) - Z = T ; % no accum operator -else - % Z = accum (C,T), like Z=C+T but with an binary operator, accum - p = C.pattern & T.pattern ; Z.matrix (p) = accum (C.matrix (p), T.matrix (p)); - p = C.pattern & ~T.pattern ; Z.matrix (p) = C.matrix (p) ; - p = ~C.pattern & T.pattern ; Z.matrix (p) = T.matrix (p) ; - Z.pattern = C.pattern | T.pattern ; -end - -% apply the mask to the values and pattern -C.matrix = mask (C.matrix, Mask, Z.matrix, C_replace, Mask_complement) ; -C.pattern = mask (C.pattern, Mask, Z.pattern, C_replace, Mask_complement) ; -end - -function C = mask (C, Mask, Z, C_replace, Mask_complement) -% replace C if requested -if (C_replace) - C (:,:) = 0 ; -end -if (isempty (Mask)) % if empty, Mask is implicit ones(m,n) - % implicitly, Mask = ones (size (C)) - if (~Mask_complement) - C = Z ; % this is the default - else - C = C ; % Z need never have been computed - end -else - % apply the mask - if (~Mask_complement) - C (Mask) = Z (Mask) ; - else - C (~Mask) = Z (~Mask) ; - end -end -end \end{verbatim} } -\end{mdframed} -\caption{Applying the mask and accumulator, ${\bf C \langle M \rangle = C \odot T}$\label{fig_accummask}} -\end{figure} - -A GraphBLAS operation starts with its primary -computation, producing a result \verb'T'; for matrix multiply, \verb'T=A*B', or -if \verb'A' is transposed first, \verb"T=A'*B", for example. Applying the -accumulator, mask (or its complement) to obtain the final result matrix -\verb'C' can be expressed in the MATLAB \verb'accum_mask' function shown in the -figure. This function is an exact, fully functional, and nearly-complete -description of the GraphBLAS accumulator/mask operation. The only aspects it -does not consider are typecasting (see Section~\ref{typecasting}), and the -value of the implicit identity (for those, see another version in the -\verb'Test' folder). - -One aspect of GraphBLAS cannot be as easily expressed in a MATLAB sparse -matrix: namely, what is the implicit value of entries not in the pattern? To -accommodate this difference in the \verb'accum_mask' MATLAB function, each -sparse matrix \verb'A' is represented with its values \verb'A.matrix' and its -pattern, \verb'A.pattern'. The latter could be expressed as the sparse matrix -\verb'A.pattern=spones(A)' or \verb'A.pattern=(A~=0)' in MATLAB, if the -implicit value is zero. With different semirings, entries not in the pattern -can be \verb'1', \verb'+Inf', \verb'-Inf', or whatever is the identity value of -the monoid. As a result, Figure~\ref{fig_accummask} performs its computations -on two MATLAB matrices: the values in \verb'A.matrix' and the pattern in the -logical matrix \verb'A.pattern'. Implicit values are untouched. - -The final computation in Figure~\ref{fig_accummask} with a complemented -\verb'Mask' is easily expressed in MATLAB as \verb'C(~Mask)=Z(~Mask)' but this -is costly if \verb'Mask' is very sparse (the typical case). It can be computed -much faster in MATLAB without complementing the sparse \verb'Mask' via: - - {\footnotesize - \begin{verbatim} - R = Z ; R (Mask) = C (Mask) ; C = R ; \end{verbatim} } - -A set of MATLAB functions that precisely compute the ${\bf C \langle M \rangle -= C \odot T}$ operation according to the full GraphBLAS specification is -provided in SuiteSparse:GraphBLAS as \verb'GB_spec_accum.m', which computes -${\bf Z=C\odot T}$, and \verb'GB_spec_mask.m', which computes ${\bf C \langle M -\rangle = Z}$. SuiteSparse:GraphBLAS includes a complete list of -\verb'GB_spec_*' functions that illustrate every GraphBLAS operation. - -The methods in Figure~\ref{fig_accummask} rely heavily on MATLAB's logical -matrix indexing. For those unfamiliar with logical indexing in MATLAB, here is -short summary. Logical matrix indexing in MATLAB is written as \verb'A(Mask)' -where \verb'A' is any matrix and \verb'Mask' is a logical matrix the same size -as \verb'A'. The expression \verb'x=A(Mask)' produces a column vector \verb'x' -consisting of the entries of \verb'A' where \verb'Mask' is true. On the -left-hand side, logical submatrix assignment \verb'A(Mask)=x' does the -opposite, copying the components of the vector \verb'x' into the places in -\verb'A' where \verb'Mask' is true. For example, to negate all values greater -than 10 using logical indexing in MATLAB: - - \begin{mdframed} - {\footnotesize - \begin{verbatim} - >> A = magic (4) - A = - 16 2 3 13 - 5 11 10 8 - 9 7 6 12 - 4 14 15 1 - >> A (A>10) = - A (A>10) - A = - -16 2 3 -13 - 5 -11 10 8 - 9 7 6 -12 - 4 -14 -15 1 \end{verbatim} } \end{mdframed} - -In MATLAB, logical indexing with a sparse matrix \verb'A' and sparse logical -matrix \verb'Mask' is a built-in method. The Mask operator in GraphBLAS works -identically as sparse logical indexing in MATLAB, but is typically far faster -in SuiteSparse:GraphBLAS than the same operation using MATLAB sparse matrices. - -%=============================================================================== -\subsection{Typecasting} %====================================================== -%=============================================================================== -\label{typecasting} - -If an operator \verb'z=f(x)' or \verb'z=f(x,y)' is used with inputs that do not -match its inputs \verb'x' or \verb'y', or if its result \verb'z' does not match -the type of the matrix it is being stored into, then the values are typecasted. -Typecasting in GraphBLAS extends beyond just operators. Almost all GraphBLAS -methods and operations are able to typecast their results, as needed. - -If one type can be typecasted into the other, they are said to be {\em -compatible}. All built-in types are compatible with each other. GraphBLAS -cannot typecast user-defined types thus any user-defined type is only -compatible with itself. When GraphBLAS requires inputs of a specific type, or -when one type cannot be typecast to another, the GraphBLAS function returns an -error code, \verb'GrB_DOMAIN_MISMATCH' (refer to Section~\ref{error} for a -complete list of error codes). Typecasting can only be done between built-in -types, and it follows the rules of the ANSI C language (not MATLAB) wherever -the rules of ANSI C are well-defined. - -However, unlike MATLAB, the C11 language specification states that the -results of typecasting a \verb'float' or \verb'double' to an integer type is -not always defined. In SuiteSparse:GraphBLAS, whenever C leaves the result -undefined the rules used in MATLAB are followed. In particular \verb'+Inf' -converts to the largest integer value, \verb'-Inf' converts to the smallest -(zero for unsigned integers), and \verb'NaN' converts to zero. Positive values -outside the range of the integer are converted to the largest positive integer, -and negative values less than the most negative integer are converted to that -most negative integer. Other than these special cases, SuiteSparse:GraphBLAS -trusts the C compiler for the rest of its typecasting. - -Typecasting to \verb'bool' is fully defined in the C language specification, -even for \verb'NaN'. The result is \verb'false' if the value compares equal to -zero, and true otherwise. Thus \verb'NaN' converts to \verb'true'. This is -unlike MATLAB, which does not allow a typecast of a \verb'NaN' to the MATLAB -logical type. - -\begin{alert} -{\bf SPEC:} the GraphBLAS API C Specification states that typecasting follows -the rules of ANSI C. Yet C leaves some typecasting undefined. All typecasting -between built-in types in SuiteSparse:GraphBLAS is precisely defined, as an -extension to the specification. -\end{alert} - -\begin{alert} -{\bf SPEC:} Some functions do not make use of all of their inputs; in -particular the binary operators \verb'FIRST', \verb'SECOND', and \verb'ONEB', -and many of the index unary operators. The Specification requires that the -inputs to these operators must be compatible with (that is, can be typecasted -to) the inputs to the operators, even if those inputs are not used and no -typecasting would ever occur. As an extension to the specification, -SuiteSparse:GraphBLAS does not perform this error check on unused inputs of -built-in operators. For example, the \verb'GrB_FIRST_INT64' operator can be -used in \verb'GrB_eWiseMult(C,..,A,B,...)' on a matrix \verb'B' of any type, -including user-defined types. For this case, the matrix \verb'A' must be -compatible with \verb'GrB_INT64'. -\end{alert} - -%=============================================================================== -\subsection{Notation and list of GraphBLAS operations} %======================== -%=============================================================================== -\label{list} - -As a summary of what GraphBLAS can do, the following table lists all GraphBLAS -operations. Upper case letters denote a matrix, lower case letters are -vectors, and ${\bf AB}$ denote the multiplication of two matrices over a -semiring. - -Each operation takes an optional \verb'GrB_Descriptor' argument that modifies -the operation. The input matrices ${\bf A}$ and ${\bf B}$ can be optionally -transposed, the mask ${\bf M}$ can be complemented, and ${\bf C}$ can be -cleared of its entries after it is used in ${\bf Z = C \odot T}$ but before -the ${\bf C \langle M \rangle = Z}$ assignment. -Vectors are never transposed via the descriptor. - -Let ${\bf A \oplus B}$ denote the element-wise operator that produces a set -union pattern (like \verb'A+B' in MATLAB). Any binary operator can be used -this way in GraphBLAS, not just plus. Let ${\bf A \otimes B}$ denote the -element-wise operator that produces a set intersection pattern (like -\verb'A.*B' in MATLAB); any binary operator can be used this way, not just -times. - -Reduction of a matrix ${\bf A}$ to a vector reduces the $i$th row of ${\bf A}$ -to a scalar $w_i$. This is like \verb"w=sum(A')" since by default, MATLAB -reduces down the columns, not across the rows. - -\vspace{0.05in} -{\footnotesize -\begin{tabular}{lll} -\hline -\verb'GrB_mxm' & matrix-matrix multiply & ${\bf C \langle M \rangle = C \odot AB}$ \\ -\verb'GrB_vxm' & vector-matrix multiply & ${\bf w^{\sf T}\langle m^{\sf T}\rangle = w^{\sf T}\odot u^{\sf T}A}$ \\ -\verb'GrB_mxv' & matrix-vector multiply & ${\bf w \langle m \rangle = w \odot Au}$ \\ -\hline -\verb'GrB_eWiseMult' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \otimes B)}$ \\ - & set intersection & ${\bf w \langle m \rangle = w \odot (u \otimes v)}$ \\ -\hline -\verb'GrB_eWiseAdd' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ - & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ -\hline -\verb'GxB_eWiseUnion'& element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ - & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ -\hline -\verb'GrB_extract' & extract submatrix & ${\bf C \langle M \rangle = C \odot A(I,J)}$ \\ - & & ${\bf w \langle m \rangle = w \odot u(i)}$ \\ -\hline -\verb'GxB_subassign' & assign submatrix & ${\bf C (I,J) \langle M \rangle = C(I,J) \odot A}$ \\ - & (with submask for ${\bf C(I,J)}$) - & ${\bf w (i) \langle m \rangle = w(i) \odot u}$ \\ -\hline -\verb'GrB_assign' & assign submatrix & ${\bf C \langle M \rangle (I,J) = C(I,J) \odot A}$ \\ - & (with mask for ${\bf C}$) - & ${\bf w \langle m \rangle (i) = w(i) \odot u}$ \\ -\hline -\verb'GrB_apply' & apply unary operator & ${\bf C \langle M \rangle = C \odot} f{\bf (A)}$ \\ - & & ${\bf w \langle m \rangle = w \odot} f{\bf (u)}$ \\ - & apply binary operator & ${\bf C \langle M \rangle = C \odot} f({\bf A},y)$ \\ - & & ${\bf C \langle M \rangle = C \odot} f(x,{\bf A})$ \\ - & & ${\bf w \langle m \rangle = w \odot} f({\bf u},y)$ \\ - & & ${\bf w \langle m \rangle = w \odot} f(x,{\bf u})$ \\ - & apply index-unary op & ${\bf C \langle M \rangle = C \odot} f({\bf A},i,j,k)$ \\ - & & ${\bf w \langle m \rangle = w \odot} f({\bf u},i,0,k)$ \\ -\hline -\verb'GrB_select' & select entries & ${\bf C \langle M \rangle = C \odot} \mbox{select}({\bf A},i,j,k)$ \\ - & & ${\bf w \langle m \rangle = w \odot} \mbox{select}({\bf u},i,0,k)$ \\ -\hline -\verb'GrB_reduce' & reduce to vector & ${\bf w \langle m \rangle = w \odot} [{\oplus}_j {\bf A}(:,j)]$ \\ - & reduce to scalar & $s = s \odot [{\oplus}_{ij} {\bf A}(i,j)]$ \\ -\hline -\verb'GrB_transpose' & transpose & ${\bf C \langle M \rangle = C \odot A^{\sf T}}$ \\ -\hline -\verb'GrB_kronecker' & Kronecker product & ${\bf C \langle M \rangle = C \odot \mbox{kron}(A, B)}$ \\ -\hline -\end{tabular} -} -\vspace{0.15in} - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Interfaces to MATLAB, Octave, Python, Julia, Go, Java, ...} %%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The MATLAB/Octave interface to SuiteSparse:GraphBLAS is included with this -distribution, described in Section~\ref{octave}. -Python, Julia, Go, and Java interfaces are available. -These are not part of the SuiteSparse:GraphBLAS distribution. -See the links below. - -%=============================================================================== -\subsection{MATLAB/Octave Interface} -%=============================================================================== -\label{octave} - -An easy-to-use MATLAB/Octave interface for SuiteSparse:GraphBLAS is available; -see the documentation in the \verb'GraphBLAS/GraphBLAS' folder for details. -Start with the \verb'README.md' file in that directory. An easy-to-read output -of the MATLAB demos can be found in \verb'GraphBLAS/GraphBLAS/demo/html'. - -The MATLAB/Octave interface adds the \verb'@GrB' class, which is an opaque -MATLAB/Octave object that contains a GraphBLAS matrix, either double or single -precision (real or complex), boolean, or any of the built-in integer types. -MATLAB/Octave sparse and full matrices can be arbitrarily mixed with GraphBLAS -matrices. The following overloaded operators and methods all work as you would -expect for any matrix. The matrix multiplication \verb'A*B' uses the -conventional \verb'PLUS_TIMES' semiring. - -{\footnotesize -\begin{verbatim} - A+B A-B A*B A.*B A./B A.\B A.^b A/b C=A(I,J) - -A +A ~A A' A.' A&B A|B b\A C(I,J)=A - A~=B A>B A==B A<=B A>=B A= 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 (5,2,0) - ... use features from version 5.2.0 (or later) - of a specific GraphBLAS implementation - #endif \end{verbatim}} - -SuiteSparse:GraphBLAS also defines the following strings with \verb'#define'. -Refer to the \verb'GraphBLAS.h' file for details. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{ll} -\hline -Macro & purpose \\ -\hline -\verb'GxB_IMPLEMENTATION_ABOUT' - & this particular implementation, copyright, and URL \\ -\verb'GxB_IMPLEMENTATION_DATE' - & the date of this implementation \\ -\verb'GxB_SPEC_ABOUT' - & the GraphBLAS specification for this implementation \\ -\verb'GxB_SPEC_DATE' - & the date of the GraphBLAS specification \\ -\verb'GxB_IMPLEMENTATION_LICENSE' - & the license for this particular implementation \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -Finally, SuiteSparse:GraphBLAS gives itself a unique name of the form -\verb'GxB_SUITESPARSE_GRAPHBLAS' that the user application can use in -\verb'#ifdef' tests. This is helpful in case a particular implementation -provides non-standard features that extend the GraphBLAS specification, such as -additional predefined built-in operators, or if a GraphBLAS implementation does -not yet fully implement all of the GraphBLAS specification. - -For example, SuiteSparse:GraphBLAS predefines additional built-in operators not -in the specification. If the user application wishes to use these in any -GraphBLAS implementation, an \verb'#ifdef' can control when they are used. -Refer to the examples in the \verb'GraphBLAS/Demo' folder. - -As another example, the GraphBLAS API states that an -implementation need not define the order in which \verb'GrB_Matrix_build' -assembles duplicate tuples in its \verb'[I,J,X]' input arrays. As a result, no -particular ordering should be relied upon in general. However, -SuiteSparse:GraphBLAS does guarantee an ordering, and this guarantee will be -kept in future versions of SuiteSparse:GraphBLAS as well. Since not all -implementations will ensure a particular ordering, the following can be used to -exploit the ordering returned by SuiteSparse:GraphBLAS. - - {\footnotesize - \begin{verbatim} - #ifdef GxB_SUITESPARSE_GRAPHBLAS - // duplicates in I, J, X assembled in a specific order; - // results are well-defined even if op is not associative. - GrB_Matrix_build (C, I, J, X, nvals, op) ; - #else - // duplicates in I, J, X assembled in no particular order; - // results are undefined if op is not associative. - GrB_Matrix_build (C, I, J, X, nvals, op) ; - #endif \end{verbatim}} - -The remainder of this section describes GraphBLAS functions that start or finalize GraphBLAS, -error handling, and the GraphBLAS integer. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function/type & purpose & Section \\ -\hline -\verb'GrB_Index' & the GraphBLAS integer & \ref{grbindex} \\ -\verb'GrB_init' & start up GraphBLAS & \ref{init} \\ -\verb'GrB_getVersion'& C API supported by the library & \ref{getVersion} \\ -\verb'GxB_init' & start up GraphBLAS with different \verb'malloc' & \ref{xinit} \\ -\verb'GrB_Info' & status code returned by GraphBLAS functions & \ref{info} \\ -\verb'GrB_error' & get more details on the last error & \ref{error} \\ -\verb'GrB_finalize' & finish GraphBLAS & \ref{finalize} \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -%=============================================================================== -\subsection{{\sf GrB\_Index:} the GraphBLAS integer} %========================== -%=============================================================================== -\label{grbindex} - -Matrix and vector dimensions and indexing rely on a specific integer, -\verb'GrB_Index', which is defined in \verb'GraphBLAS.h' as - - {\footnotesize - \begin{verbatim} - typedef uint64_t GrB_Index ; \end{verbatim}} - -Row and column indices of an \verb'nrows'-by-\verb'ncols' matrix range from -zero to the \verb'nrows-1' for the rows, and zero to \verb'ncols-1' for the -columns. Indices are zero-based, like C, and not one-based, like -MATLAB/Octave. In SuiteSparse:GraphBLAS, the largest permitted index value -is \verb'GrB_INDEX_MAX', defined as $2^{60}-1$. The largest permitted -matrix or vector dimension is $2^{60}$ (that is, \verb'GrB_INDEX_MAX+1'). -The largest \verb'GrB_Matrix' that -SuiteSparse: GraphBLAS can construct is thus $2^{60}$-by-$2^{60}$. An -$n$-by-$n$ matrix $\bf A$ that size can easily be constructed in practice with -$O(|{\bf A}|)$ memory requirements, where $|{\bf A}|$ denotes the number of -entries that explicitly appear in the pattern of ${\bf A}$. The time and -memory required to construct a matrix that large does not depend on $n$, since -SuiteSparse:GraphBLAS can represent ${\bf A}$ in hypersparse form (see -Section~\ref{hypersparse}). The largest \verb'GrB_Vector' that can be -constructed is $2^{60}$-by-1. - -%=============================================================================== -\subsection{{\sf GrB\_init:} initialize GraphBLAS} %============================ -%=============================================================================== -\label{init} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -typedef enum -{ - GrB_NONBLOCKING = 0, // methods may return with pending computations - GrB_BLOCKING = 1 // no computations are ever left pending -} -GrB_Mode ; -\end{verbatim} -}\end{mdframed} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_init // start up GraphBLAS -( - GrB_Mode mode // blocking or non-blocking mode -) ; -\end{verbatim} -}\end{mdframed} - -\hypertarget{link:init}{\mbox{ }}% -\verb'GrB_init' must be called before any other GraphBLAS operation. It -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. Non-blocking mode can be much faster than blocking mode, by many -orders of magnitude in extreme cases. Blocking mode should be used only when -debugging a user application. The mode cannot be changed once it is set by -\verb'GrB_init'. - -GraphBLAS objects are opaque. This allows GraphBLAS to -postpone operations and then do them later in a more efficient manner by -rearranging them and grouping them together. In non-blocking mode, the -computations required to construct an opaque GraphBLAS object might not be -finished when the GraphBLAS method or operation returns to the user. However, -user-provided arrays are not opaque, and GraphBLAS methods and operations that -read them (such as \verb'GrB_Matrix_build') or write to them (such as -\verb'GrB_Matrix_extractTuples') always finish reading them, or creating them, -when the method or operation returns to the user application. - -All methods and operations that extract values from a GraphBLAS object and -return them into non-opaque user arrays always ensure that the user-visible -arrays are fully populated when they return: \verb'GrB_*_reduce' (to scalar), -\verb'GrB_*_nvals', \verb'GrB_*_extractElement', and -\verb'GrB_*_extractTuples'. These functions do {\em not} guarantee that the -opaque objects they depend on are finalized. To do that, use -\verb'GrB_wait' instead. - -SuiteSparse:GraphBLAS is multithreaded internally, via OpenMP, and it is also -safe to use in a multithreaded user application. See Section~\ref{sec:install} -for details. -User threads must not operate on the same matrices at the same time, with one -exception. Multiple user threads can use the same matrices or vectors as -read-only inputs to GraphBLAS operations or methods, but only if they have no -pending operations (use \verb'GrB_wait' -first). User threads cannot simultaneously modify a matrix or vector via any -GraphBLAS operation or method. - -It is safe to use the internal parallelism in SuiteSparse:GraphBLAS on -matrices, vectors, and scalars that are not yet completed. The library -handles this on its own. The \verb'GrB_wait' function is only -needed when a user application makes multiple calls to GraphBLAS in parallel, -from multiple user threads. - -With multiple user threads, exactly one user thread must call \verb'GrB_init' -before any user thread may call any \verb'GrB_*' or \verb'GxB_*' function. -When the user application is finished, exactly one user thread must call -\verb'GrB_finalize', after which no user thread may call any \verb'GrB_*' or -\verb'GxB_*' function. -The mode of a GraphBLAS session can be queried with \verb'GrB_get'; -see Section~\ref{options} for details. - -%=============================================================================== -\subsection{{\sf GrB\_getVersion:} determine the C API Version} %=============== -%=============================================================================== -\label{getVersion} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_getVersion // run-time access to C API version number -( - unsigned int *version, // returns GRB_VERSION - unsigned int *subversion // returns GRB_SUBVERSION -) ; -\end{verbatim} -}\end{mdframed} - -GraphBLAS defines two compile-time constants that -define the version of the C API Specification -that is implemented by the library: -\verb'GRB_VERSION' and \verb'GRB_SUBVERSION'. -If the user program was compiled with one -version of the library but linked with a different one later on, the -compile-time version check with \verb'GRB_VERSION' would be stale. -\verb'GrB_getVersion' thus provides a run-time access of the version of the C -API Specification supported by the library. - -% \newpage -%=============================================================================== -\subsection{{\sf GxB\_init:} initialize with alternate malloc} %================ -%=============================================================================== -\label{xinit} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_init // start up GraphBLAS and also define malloc -( - GrB_Mode mode, // blocking or non-blocking mode - // pointers to memory management functions. - void * (* user_malloc_func ) (size_t), - void * (* user_calloc_func ) (size_t, size_t), - void * (* user_realloc_func ) (void *, size_t), - void (* user_free_func ) (void *) -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_init' is identical to \verb'GrB_init', except that it also redefines -the memory management functions that SuiteSparse:GraphBLAS will use. Giving -the user application control over this is particularly important when using the -\verb'GxB_*pack', -\verb'GxB_*unpack', and \verb'GxB_*serialize' functions described in -Sections \ref{serialize_deserialize} and \ref{pack_unpack}, -since they require the user application and -GraphBLAS to use the same memory manager. -\verb'user_calloc_func' and \verb'user_realloc_func' are optional, and -may be \verb'NULL'. If \verb'NULL', then the \verb'user_malloc_func' is -relied on instead, for all memory allocations. -These functions can only be set once, when GraphBLAS starts. -They can be queried using \verb'GrB_get' (see -Section~\ref{get_set_global}). -Either -\verb'GrB_init' or \verb'GxB_init' must be called before any other GraphBLAS -operation, but not both. The functions passed to \verb'GxB_init' must be -thread-safe. -The following usage is identical to \verb'GrB_init(mode)': - - {\footnotesize - \begin{verbatim} - GxB_init (mode, malloc, calloc, realloc, free) ; \end{verbatim}} - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_Info:} status code returned by GraphBLAS} %=============== -%=============================================================================== -\label{info} - -Each GraphBLAS method and operation returns its status to the caller as its -return value, an enumerated type (an \verb'enum') called \verb'GrB_Info'. The -first two values in the following table denote a successful status, the rest -are error codes. - -Not all GraphBLAS methods or operations can return all status codes. -In the discussions of each method and operation in this User Guide, most of the -obvious error code returns are not discussed. For example, if a required input -is a \verb'NULL' pointer, then \verb'GrB_NULL_POINTER' is returned. Only error -codes specific to the method or that require elaboration are discussed here. -For a full list of the status codes that each GraphBLAS function can return, -refer to {\em The GraphBLAS C API Specification} \cite{spec,spec2}. - -\vspace{0.2in} -\noindent -{\small -\begin{tabular}{lrp{2.8in}} -\hline -Error & value & description \\ -\hline -\verb'GrB_SUCCESS' & 0 & the method or operation was successful \\ -\verb'GrB_NO_VALUE' & 1 & the method was successful, but the entry \\ - & & does not appear in the matrix or vector. \\ -\verb'GxB_EXHAUSTED' & 2 & the iterator is exhausted \\ -\hline -\hline -\verb'GrB_UNINITIALIZED_OBJECT' & -1 & object has not been initialized \\ -\verb'GrB_NULL_POINTER' & -2 & input pointer is \verb'NULL' \\ -\verb'GrB_INVALID_VALUE' & -3 & generic error code; some value is bad \\ -\verb'GrB_INVALID_INDEX' & -4 & a row or column index is out of bounds \\ -\verb'GrB_DOMAIN_MISMATCH' & -5 & object domains are not compatible \\ -\verb'GrB_DIMENSION_MISMATCH' & -6 & matrix dimensions do not match \\ -\verb'GrB_OUTPUT_NOT_EMPTY' & -7 & output matrix already has values in it \\ -\verb'GrB_NOT_IMPLEMENTED' & -8 & not implemented in SS:GrB \\ -\verb'GrB_ALREADY_SET' & -9 & field already written to \\ -\verb'GrB_PANIC' & -101 & unrecoverable error \\ -\verb'GrB_OUT_OF_MEMORY' & -102 & out of memory \\ -\verb'GrB_INSUFFICIENT_SPACE' & -103 & output array not large enough \\ -\verb'GrB_INVALID_OBJECT' & -104 & object is corrupted \\ -\verb'GrB_INDEX_OUT_OF_BOUNDS' & -105 & a row or column index is out of bounds \\ -\verb'GrB_EMPTY_OBJECT' & -106 & a input scalar has no entry \\ -\verb'GxB_JIT_ERROR' &-1001 & JIT compiler error \\ -\hline -\end{tabular} -\vspace{0.2in} -} - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_error:} get more details on the last error} %============= -%=============================================================================== -\label{error} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_error // return a string describing the last error -( - const char **error, // error string - object // a GrB_matrix, GrB_Vector, etc. -) ; -\end{verbatim} -}\end{mdframed} - -Each GraphBLAS method and operation returns a \verb'GrB_Info' error code. The -\verb'GrB_error' function returns additional information on the error for a -particular object in a null-terminated string. The string returned by -\verb'GrB_error' is never a \verb'NULL' string, but it may have length zero -(with the first entry being the \verb"'\0'" string-termination value). The -string must not be freed or modified. - - {\footnotesize - \begin{verbatim} - info = GrB_some_method_here (C, ...) ; - if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) - { - char *err ; - GrB_error (&err, C) ; - printf ("info: %d error: %s\n", info, err) ; - } \end{verbatim}} - -If \verb'C' has no error status, or if the error is not recorded in -the string, an empty non-null string is returned. In particular, -out-of-memory conditions result in an empty string from \verb'GrB_error'. - -SuiteSparse:GraphBLAS reports many helpful details via \verb'GrB_error'. For -example, if a row or column index is out of bounds, the report will state what -those bounds are. If a matrix dimension is incorrect, the mismatching -dimensions will be provided. Refer to -the output of the example programs in the \verb'Demo' and \verb'Test' folder, -which intentionally generate errors to illustrate the use of \verb'GrB_error'. - -The only functions in GraphBLAS that return an error string are functions that -have a single input/output argument \verb'C', as a \verb'GrB_Matrix', -\verb'GrB_Vector', \verb'GrB_Scalar', or \verb'GrB_Descriptor'. Methods that -create these objects (such as \verb'GrB_Matrix_new') return a \verb'NULL' -object on failure, so these methods cannot also return an error string in -\verb'C'. - -Any subsequent GraphBLAS method that modifies the object \verb'C' clears the -error string. - -Note that \verb'GrB_NO_VALUE' is an not error, but an informational status. -\verb'GrB_*_extractElment(&x,A,i,j)', which does \verb'x=A(i,j)', returns this -value to indicate that \verb'A(i,j)' is not present in the matrix. That -method does not have an input/output object so it cannot return an error -string. - -%=============================================================================== -\subsection{{\sf GrB\_finalize:} finish GraphBLAS} %============================ -%=============================================================================== -\label{finalize} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_finalize ( ) ; // finish GraphBLAS -\end{verbatim} -}\end{mdframed} - -\verb'GrB_finalize' must be called as the last GraphBLAS operation, even after -all calls to \verb'GrB_free'. All GraphBLAS objects created by the user -application should be freed first, before calling \verb'GrB_finalize' since -\verb'GrB_finalize' will not free those objects. In non-blocking mode, -GraphBLAS may leave some computations as pending. These computations can be -safely abandoned if the user application frees all GraphBLAS objects it has -created and then calls \verb'GrB_finalize'. When the user application is -finished, exactly one user thread must call \verb'GrB_finalize'. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{GraphBLAS Objects and their Methods} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{objects} - -GraphBLAS defines eleven different objects to represent matrices, vectors, -scalars, data types, operators (binary, unary, and index-unary), monoids, -semirings, a {\em descriptor} object used to specify optional parameters -that modify the behavior of a GraphBLAS operation, and a {\em context} -object for controlling computational resources. - -The GraphBLAS API makes a distinction between {\em methods} and {\em -operations}. A method is a function that works on a GraphBLAS object, creating -it, destroying it, or querying its contents. An operation (not to be confused -with an operator) acts on matrices and/or vectors in a semiring. - -\vspace{0.1in} -\noindent -{\small -\begin{tabular}{ll} -\hline -\verb'GrB_Type' & a scalar data type \\ -\verb'GrB_UnaryOp' & a unary operator $z=f(x)$, where $z$ and $x$ are scalars\\ -\verb'GrB_BinaryOp' & a binary operator $z=f(x,y)$, where $z$, $x$, and $y$ are scalars\\ -\verb'GrB_IndexUnaryOp' & an index-unary operator \\ -\verb'GxB_IndexBinaryOp' & an index-binary operator \\ -\verb'GrB_Monoid' & an associative and commutative binary operator \\ - & and its identity value \\ -\verb'GrB_Semiring' & a monoid that defines the ``plus'' and a binary operator\\ - & that defines the ``multiply'' for an algebraic semiring \\ -\verb'GrB_Matrix' & a 2D sparse matrix of any type \\ -\verb'GrB_Vector' & a 1D sparse column vector of any type \\ -\verb'GrB_Scalar' & a scalar of any type \\ -\verb'GrB_Descriptor'& a collection of parameters that modify an operation \\ -\verb'GxB_Context' & allocating computational resources \\ -\hline -\end{tabular} -} -\vspace{0.1in} - -Each of these objects is implemented in C as an opaque handle, which is a -pointer to a data structure held by GraphBLAS. User applications may not -examine the content of the object directly; instead, they can pass the handle -back to GraphBLAS which will do the work. Assigning one handle to another -is valid but it does not make a copy of the underlying object. - -\newpage -%=============================================================================== -\subsection{The GraphBLAS type: {\sf GrB\_Type}} %============================== -%=============================================================================== -\label{type} - -A GraphBLAS \verb'GrB_Type' defines the type of scalar values that a matrix or -vector contains, and the type of scalar operands for a unary or binary -operator. There are 13 built-in types, and a user application can define -any types of its own as well. The built-in types correspond to built-in types -in C (in the \verb'#include' files \verb'stdbool.h', \verb'stdint.h', and -\verb'complex.h') as listed in the following table. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{llll} -\hline -GraphBLAS & C type & description & range \\ -type & & & \\ -\hline -\verb'GrB_BOOL' & \verb'bool' & Boolean & true (1), false (0) \\ -\hline -\verb'GrB_INT8' & \verb'int8_t' & 8-bit signed integer & -128 to 127 \\ -\verb'GrB_INT16' & \verb'int16_t' & 16-bit integer & $-2^{15}$ to $2^{15}-1$ \\ -\verb'GrB_INT32' & \verb'int32_t' & 32-bit integer & $-2^{31}$ to $2^{31}-1$ \\ -\verb'GrB_INT64' & \verb'int64_t' & 64-bit integer & $-2^{63}$ to $2^{63}-1$ \\ -\hline -\verb'GrB_UINT8' & \verb'uint8_t' & 8-bit unsigned integer & 0 to 255 \\ -\verb'GrB_UINT16' & \verb'uint16_t' & 16-bit unsigned integer & 0 to $2^{16}-1$ \\ -\verb'GrB_UINT32' & \verb'uint32_t' & 32-bit unsigned integer & 0 to $2^{32}-1$ \\ -\verb'GrB_UINT64' & \verb'uint64_t' & 64-bit unsigned integer & 0 to $2^{64}-1$ \\ -\hline -\verb'GrB_FP32' & \verb'float' & 32-bit IEEE 754 & \verb'-Inf' to \verb'+Inf'\\ -\verb'GrB_FP64' & \verb'double' & 64-bit IEEE 754 & \verb'-Inf' to \verb'+Inf'\\ -\hline -\verb'GxB_FC32' & \verb'float complex' & 32-bit complex & \verb'-Inf' to \verb'+Inf'\\ -\verb'GxB_FC64' & \verb'double complex' & 64-bit complex & \verb'-Inf' to \verb'+Inf'\\ -\hline -\end{tabular} -} -\vspace{0.2in} - -The C11 definitions of \verb'float complex' and \verb'double complex' -are not always available. The \verb'GraphBLAS.h' header defines them as -\verb'GxB_FC32_t' and \verb'GxB_FC64_t', respectively. - -The user application can also define new types based on any \verb'typedef' in -the C language whose values are held in a contiguous region of memory of fixed -size. For example, a user-defined \verb'GrB_Type' could be created to hold any -C \verb'struct' whose content is self-contained. A C \verb'struct' containing -pointers might be problematic because GraphBLAS would not know to dereference -the pointers to traverse the entire ``scalar'' entry, but this can be done if -the objects referenced by these pointers are not moved. A user-defined complex -type with real and imaginary types can be defined, or even a ``scalar'' type -containing a fixed-sized dense matrix (see Section~\ref{type_new}). The -possibilities are endless. GraphBLAS can create and operate on sparse matrices -and vectors in any of these types, including any user-defined ones. For -user-defined types, GraphBLAS simply moves the data around itself (via -\verb'memcpy'), and then passes the values back to user-defined functions when -it needs to do any computations on the type. The next sections describe the -methods for the \verb'GrB_Type' object: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Type_new' & create a user-defined type & \ref{type_new} \\ -\verb'GxB_Type_new' & create a user-defined type, - with name and definition & \ref{type_new_named} \\ -\verb'GrB_Type_wait' & wait for a user-defined type & \ref{type_wait} \\ -\verb'GrB_get' & get properties of a type & \ref{get_set_type} \\ -\verb'GrB_set' & set the type name/definitition & \ref{get_set_type} \\ -\verb'GxB_Type_from_name'& return the type from its name & \ref{type_from_name} \\ -\verb'GrB_Type_free' & free a user-defined type & \ref{type_free} \\ -\hline -\end{tabular} -} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Type\_new:} create a user-defined type} -%------------------------------------------------------------------------------- -\label{type_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -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 -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_Type_new' creates a new user-defined type. The \verb'type' is a -handle, or a pointer to an opaque object. The handle itself must not be -\verb'NULL' on input, but the content of the handle can be undefined. On -output, the handle contains a pointer to a newly created type. -The \verb'ctype' is the type in C that will be used to construct the new -GraphBLAS type. It can be either a built-in C type, or defined by a -\verb'typedef'. -The second parameter should be passed as \verb'sizeof(ctype)'. The only -requirement on the C type is that \verb'sizeof(ctype)' is valid in C, and -that the type reside in a contiguous block of memory so that it can be moved -with \verb'memcpy'. For example, to create a user-defined type called -\verb'Complex' for double-precision complex values using the C11 -\verb'double complex' type, the following can be used. A complete example can -be found in the \verb'usercomplex.c' and \verb'usercomplex.h' files in the -\verb'Demo' folder. - - {\footnotesize - \begin{verbatim} - #include - #include - GrB_Type Complex ; - GrB_Type_new (&Complex, sizeof (double complex)) ; \end{verbatim} } - -To demonstrate the flexibility of the \verb'GrB_Type', consider a ``scalar'' -consisting of 4-by-4 floating-point matrix and a string. This type might be -useful for the 4-by-4 translation/rotation/scaling matrices that arise in -computer graphics, along with a string containing a description or even a -regular expression that can be parsed and executed in a user-defined operator. -All that is required is a fixed-size type, where \verb'sizeof(ctype)' is -a constant. - - {\footnotesize - \begin{verbatim} - typedef struct - { - float stuff [4][4] ; - char whatstuff [64] ; - } - wildtype ; - GrB_Type WildType ; - GrB_Type_new (&WildType, sizeof (wildtype)) ; \end{verbatim} } - -With this type a sparse matrix can be created in which each entry consists of a -4-by-4 dense matrix \verb'stuff' and a 64-character string \verb'whatstuff'. -GraphBLAS treats this 4-by-4 as a ``scalar.'' Any GraphBLAS method or operation -that simply moves data can be used with this type without any further -information from the user application. For example, entries of this type can -be assigned to and extracted from a matrix or vector, and matrices containing -this type can be transposed. A working example (\verb'wildtype.c' -in the \verb'Demo' folder) creates matrices and multiplies them with -a user-defined semiring with this type. - -Performing arithmetic on matrices and vectors with user-defined types requires -operators to be defined. Refer to Section~\ref{user} for more details on these -example user-defined types. - -User defined types created by \verb'GrB_Type_new' will not work with -the JIT; use \verb'GxB_Type_new' instead. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Type\_new:} create a user-defined type (with name and definition)} -%------------------------------------------------------------------------------- -\label{type_new_named} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Type_new // create a new named GraphBLAS type -( - GrB_Type *type, // handle of user type to create - size_t sizeof_ctype, // size = sizeof (ctype) of the C type - const char *type_name, // name of the type (max 128 characters) - const char *type_defn // typedef for the type (no max length) -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_Type_new' creates a type with a name and definition that are known to -GraphBLAS, as strings. The \verb'type_name' is any valid string (max length of 128 -characters, including the required null-terminating character) that may -appear as the name of a C type created by a C \verb'typedef' statement. It must -not contain any white-space characters. For example, to create a type of size -16*4+1 = 65 bytes, with a 4-by-4 dense float array and a 32-bit integer: - - {\footnotesize - \begin{verbatim} - typedef struct { float x [4][4] ; int color ; } myquaternion ; - GrB_Type MyQtype ; - GxB_Type_new (&MyQtype, sizeof (myquaternion), "myquaternion", - "typedef struct { float x [4][4] ; int color ; } myquaternion ;") ; \end{verbatim}} - -The \verb'type_name' and \verb'type_defn' are both null-terminated strings. -The two strings are optional, but are -required to enable the JIT compilation of kernels that use this type. -At most \verb'GxB_MAX_NAME_LEN' characters are accessed in \verb'type_name'; -characters beyond that limit are silently ignored. - -If the \verb'sizeof_ctype' is zero, and the strings are valid, a -JIT kernel is compiled just to determine the size of the type. This is -feature useful for interfaces in languages other than C, which could create -valid strings for C types but would not have a reliable way to determine the -size of the type. - -The above example is identical to the following usage, except that -\verb'GrB_Type_new' requires \verb'sizeof_ctype' to be nonzero, and equal -to the size of the C type. - - {\footnotesize - \begin{verbatim} - typedef struct { float x [4][4] ; int color ; } myquaternion ; - GrB_Type MyQtype ; - GxB_Type_new (&MyQtype, sizeof (myquaternion)) ; - GrB_set (MyQtype, "myquaternion", GxB_JIT_C_NAME) ; - GrB_set (MyQtype, "typedef struct { float x [4][4] ; int color ; } myquaternion ;" - GxB_JIT_C_DEFINITION) ; \end{verbatim}} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Type\_wait:} wait for a type} -%------------------------------------------------------------------------------- -\label{type_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a user-defined type -( - GrB_Type type, // type to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined type, a GraphBLAS library may choose to exploit -non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS -currently does nothing except to ensure that \verb'type' is valid. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} -%------------------------------------------------------------------------------- -\label{type_from_name} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Type_from_name // return the built-in GrB_Type from a name -( - GrB_Type *type, // built-in type, or NULL if user-defined - const char *type_name // array of size at least GxB_MAX_NAME_LEN -) ; -\end{verbatim} -}\end{mdframed} - -Returns the built-in type from the corresponding name of the type. The following -examples both return \verb'type' as \verb'GrB_BOOL'. - -{\footnotesize -\begin{verbatim} - GxB_Type_from_name (&type, "bool") ; - GxB_Type_from_name (&type, "GrB_BOOL") ; }\end{verbatim} } - -If the name is from a user-defined type, the \verb'type' is returned as -\verb'NULL'. This is not an error condition. The user application must itself -do this translation since GraphBLAS does not keep a registry of all -user-defined types. - -With this function, a user application can manage the translation for -both built-in types and its own user-defined types, as in the following -example. - -{\footnotesize -\begin{verbatim} - typedef struct { double x ; char stuff [16] ; } myfirsttype ; - typedef struct { float z [4][4] ; int color ; } myquaternion ; - GrB_Type MyType1, MyQType ; - GxB_Type_new (&MyType1, sizeof (myfirsttype), "myfirsttype", - "typedef struct { double x ; char stuff [16] ; } myfirsttype ;") ; - GxB_Type_new (&MyQType, sizeof (myquaternion), "myquaternion", - "typedef struct { float z [4][4] ; int color ; } myquaternion ;") ; - - GrB_Matrix A ; - // ... create a matrix A of some built-in or user-defined type - - // later on, to query the type of A: - size_t typesize ; - GrB_Scalar_new (s, GrB_UINT64) ; - GrB_get (type, s, GrB_SIZE) ; - GrB_Scalar_extractElement (&typesize, GrB_UINT64) ; - GrB_Type atype ; - char atype_name [GxB_MAX_NAME_LEN] ; - GrB_get (A, atype_name, GrB_EL_TYPE_STRING) ; - GxB_Type_from_name (&atype, atype_name) ; - if (atype == NULL) - { - // This is not yet an error. It means that A has a user-defined type. - if ((strcmp (atype_name, "myfirsttype")) == 0) atype = MyType1 ; - else if ((strcmp (atype_name, "myquaternion")) == 0) atype = MyQType ; - else { ... this is now an error ... the type of A is unknown. } - }\end{verbatim} } - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Type\_free:} free a user-defined type} -%------------------------------------------------------------------------------- -\label{type_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-defined type -( - GrB_Type *type // handle of user-defined type to free -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_Type_free' frees a user-defined type. -Either usage: - - {\small - \begin{verbatim} - GrB_Type_free (&type) ; - GrB_free (&type) ; \end{verbatim}} - -\noindent -frees the user-defined \verb'type' and -sets \verb'type' to \verb'NULL'. -It safely does nothing if passed a \verb'NULL' -handle, or if \verb'type == NULL' on input. - -It is safe to attempt to free a built-in type. SuiteSparse:GraphBLAS silently -ignores the request and returns \verb'GrB_SUCCESS'. A user-defined type should -not be freed until all operations using the type are completed. -SuiteSparse:GraphBLAS attempts to detect this condition but it must query a -freed object in its attempt. This is hazardous and not recommended. -Operations on such objects whose type has been freed leads to undefined -behavior. - -It is safe to first free a type, and then a matrix of that type, but after the -type is freed the matrix can no longer be used. The only safe thing that can -be done with such a matrix is to free it. - -The function signature of \verb'GrB_Type_free' uses the generic name -\verb'GrB_free', which can free any GraphBLAS object. See Section~\ref{free} -details. GraphBLAS includes many such generic functions. When describing a -specific variation, a function is described with its specific name in this User -Guide (such as \verb'GrB_Type_free'). When discussing features applicable to -all specific forms, the generic name is used instead (such as \verb'GrB_free'). - -\newpage -%=============================================================================== -\subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== -%=============================================================================== -\label{unaryop} - -A unary operator is a scalar function of the form $z=f(x)$. The domain (type) -of $z$ and $x$ need not be the same. - -In the notation in the tables -below, $T$ is any of the 13 built-in types and is a place-holder for -\verb'BOOL', \verb'INT8', \verb'UINT8', ... -\verb'FP32', \verb'FP64', \verb'FC32', or \verb'FC64'. -For example, \verb'GrB_AINV_INT32' is a unary operator that computes -\verb'z=-x' for two values \verb'x' and \verb'z' of type \verb'GrB_INT32'. - -The notation $R$ refers to any real type (all but \verb'FC32' and \verb'FC64'), -$I$ refers to any integer type (\verb'INT*' and \verb'UINT*'), -$F$ refers to any real or complex floating point type -(\verb'FP32', \verb'FP64', \verb'FC32', or \verb'FC64'), -$Z$ refers to any complex floating point type -(\verb'FC32' or \verb'FC64'), -and $N$ refers to \verb'INT32' or \verb'INT64'. - -The logical negation operator \verb'GrB_LNOT' only works on Boolean types. The -\verb'GxB_LNOT_'$R$ functions operate on inputs of type $R$, implicitly -typecasting their input to Boolean and returning result of type $R$, with a -value 1 for true and 0 for false. The operators \verb'GxB_LNOT_BOOL' and -\verb'GrB_LNOT' are identical. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Unary operators for all types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x)$ & description \\ -\hline -\verb'GxB_ONE_'$T$ & $T \rightarrow T$ & $z = 1$ & one \\ -\verb'GrB_IDENTITY_'$T$ & $T \rightarrow T$ & $z = x$ & identity \\ -\verb'GrB_AINV_'$T$ & $T \rightarrow T$ & $z = -x$ & additive inverse \\ -\verb'GrB_MINV_'$T$ & $T \rightarrow T$ & $z = 1/x$ & multiplicative inverse \\ -\hline -\end{tabular} - -\vspace{0.2in} -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Unary operators for real and integer types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x)$ & description \\ -\hline -\verb'GrB_ABS_'$T$ & $R \rightarrow R$ & $z = |x|$ & absolute value \\ -\verb'GrB_LNOT' & \verb'bool' - $\rightarrow$ - \verb'bool' & $z = \lnot x$ & logical negation \\ -\verb'GxB_LNOT_'$R$ & $R \rightarrow R$ & $z = \lnot (x \ne 0)$ & logical negation \\ -\verb'GrB_BNOT_'$I$ & $I \rightarrow I$ & $z = \lnot x$ & bitwise negation \\ -\hline -\end{tabular} - -\vspace{0.2in} -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Index-based unary operators for any type (including user-defined)} \\ -\hline -GraphBLAS name & types (domains) & $z=f(a_{ij})$ & description \\ -\hline -\verb'GxB_POSITIONI_'$N$ & $ \rightarrow N$ & $z = i$ & row index (0-based) \\ -\verb'GxB_POSITIONI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index (1-based) \\ -\verb'GxB_POSITIONJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index (0-based) \\ -\verb'GxB_POSITIONJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index (1-based) \\ -\hline -\end{tabular} -\vspace{0.2in} - -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Unary operators for floating-point types (real and complex)} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x)$ & description \\ -\hline -\verb'GxB_SQRT_'$F$ & $F \rightarrow F$ & $z = \sqrt(x)$ & square root \\ -\verb'GxB_LOG_'$F$ & $F \rightarrow F$ & $z = \log_e(x)$ & natural logarithm \\ -\verb'GxB_EXP_'$F$ & $F \rightarrow F$ & $z = e^x$ & natural exponent \\ -\hline -\verb'GxB_LOG10_'$F$ & $F \rightarrow F$ & $z = \log_{10}(x)$ & base-10 logarithm \\ -\verb'GxB_LOG2_'$F$ & $F \rightarrow F$ & $z = \log_2(x)$ & base-2 logarithm \\ -\verb'GxB_EXP2_'$F$ & $F \rightarrow F$ & $z = 2^x$ & base-2 exponent \\ -\hline -\verb'GxB_EXPM1_'$F$ & $F \rightarrow F$ & $z = e^x - 1$ & natural exponent - 1 \\ -\verb'GxB_LOG1P_'$F$ & $F \rightarrow F$ & $z = \log(x+1)$ & natural log of $x+1$ \\ -\hline -\verb'GxB_SIN_'$F$ & $F \rightarrow F$ & $z = \sin(x)$ & sine \\ -\verb'GxB_COS_'$F$ & $F \rightarrow F$ & $z = \cos(x)$ & cosine \\ -\verb'GxB_TAN_'$F$ & $F \rightarrow F$ & $z = \tan(x)$ & tangent \\ -\hline -\verb'GxB_ASIN_'$F$ & $F \rightarrow F$ & $z = \sin^{-1}(x)$ & inverse sine \\ -\verb'GxB_ACOS_'$F$ & $F \rightarrow F$ & $z = \cos^{-1}(x)$ & inverse cosine \\ -\verb'GxB_ATAN_'$F$ & $F \rightarrow F$ & $z = \tan^{-1}(x)$ & inverse tangent \\ -\hline -\verb'GxB_SINH_'$F$ & $F \rightarrow F$ & $z = \sinh(x)$ & hyperbolic sine \\ -\verb'GxB_COSH_'$F$ & $F \rightarrow F$ & $z = \cosh(x)$ & hyperbolic cosine \\ -\verb'GxB_TANH_'$F$ & $F \rightarrow F$ & $z = \tanh(x)$ & hyperbolic tangent \\ -\hline -\verb'GxB_ASINH_'$F$ & $F \rightarrow F$ & $z = \sinh^{-1}(x)$ & inverse hyperbolic sine \\ -\verb'GxB_ACOSH_'$F$ & $F \rightarrow F$ & $z = \cosh^{-1}(x)$ & inverse hyperbolic cosine \\ -\verb'GxB_ATANH_'$F$ & $F \rightarrow F$ & $z = \tanh^{-1}(x)$ & inverse hyperbolic tangent \\ -\hline -\verb'GxB_SIGNUM_'$F$ & $F \rightarrow F$ & $z = \sgn(x)$ & sign, or signum function \\ -\verb'GxB_CEIL_'$F$ & $F \rightarrow F$ & $z = \lceil x \rceil $ & ceiling function \\ -\verb'GxB_FLOOR_'$F$ & $F \rightarrow F$ & $z = \lfloor x \rfloor $ & floor function \\ -\verb'GxB_ROUND_'$F$ & $F \rightarrow F$ & $z = \mbox{round}(x)$ & round to nearest \\ -\verb'GxB_TRUNC_'$F$ & $F \rightarrow F$ & $z = \mbox{trunc}(x)$ & round towards zero \\ -\hline -\verb'GxB_ISINF_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isinf}(x)$ & true if $\pm \infty$ \\ -\verb'GxB_ISNAN_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isnan}(x)$ & true if \verb'NaN' \\ -\verb'GxB_ISFINITE_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isfinite}(x)$ & true if finite \\ -\hline -\end{tabular} -\vspace{0.2in} - -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Unary operators for floating-point types (real only)} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x)$ & description \\ -\hline -\verb'GxB_LGAMMA_'$R$ & $R \rightarrow R$ & $z = \log(|\Gamma (x)|)$ & log of gamma function \\ -\verb'GxB_TGAMMA_'$R$ & $R \rightarrow R$ & $z = \Gamma(x)$ & gamma function \\ -\verb'GxB_ERF_'$R$ & $R \rightarrow R$ & $z = \erf(x)$ & error function \\ -\verb'GxB_ERFC_'$R$ & $R \rightarrow R$ & $z = \erfc(x)$ & complimentary error function \\ -\verb'GxB_CBRT_'$R$ & $R \rightarrow R$ & $z = x^{1/3}$ & cube root \\ -\hline -\verb'GxB_FREXPX_'$R$ & $R \rightarrow R$ & $z = \mbox{frexpx}(x)$ & normalized fraction \\ -\verb'GxB_FREXPE_'$R$ & $R \rightarrow R$ & $z = \mbox{frexpe}(x)$ & normalized exponent \\ -\hline -\end{tabular} -\vspace{0.2in} - -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Unary operators for complex types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x)$ & description \\ -\hline -\verb'GxB_CONJ_'$Z$ & $Z \rightarrow Z$ & $z = \overline{x}$ & complex conjugate \\ -\verb'GxB_ABS_'$Z$ & $Z \rightarrow F$ & $z = |x|$ & absolute value \\ -\verb'GxB_CREAL_'$Z$ & $Z \rightarrow F$ & $z = \mbox{real}(x)$ & real part \\ -\verb'GxB_CIMAG_'$Z$ & $Z \rightarrow F$ & $z = \mbox{imag}(x)$ & imaginary part \\ -\verb'GxB_CARG_'$Z$ & $Z \rightarrow F$ & $z = \mbox{carg}(x)$ & angle \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -Built-in index-based unary operators return the row or column index of an entry. For a -matrix $z=f(a_{ij})$ returns $z = i$ or $z = j$, or +1 for 1-based indices. -The latter is useful in the MATLAB/Octave interface, where row and column indices are -1-based. When applied to a vector, $j$ is always zero, and $i$ is the index in -the vector. These built-in unary operators come in two types: \verb'INT32' and -\verb'INT64', which is the type of the output, $z$. The functions are agnostic -to the type of their inputs; they only depend on the position of the entries, -not their values. -User-defined index-based operators cannot be defined by \verb'GrB_UnaryOp_new'; -use \verb'GrB_IndexUnaryOp_new' instead; see Section~\ref{idxunop}. - -\verb'GxB_FREXPX' and \verb'GxB_FREXPE' return the mantissa and exponent, -respectively, from the C11 \verb'frexp' function. The exponent is -returned as a floating-point value, not an integer. - -The operators \verb'GxB_EXPM1_FC*' and \verb'GxB_LOG1P_FC*' for complex -types are currently not accurate. They will be revised in a future version. - -The functions \verb'casin', \verb'casinf', \verb'casinh', and \verb'casinhf' -provided by Microsoft Visual Studio for computing $\sin^{-1}(x)$ and -$\sinh^{-1}(x)$ when $x$ is complex do not compute the correct result. Thus, -the unary operators \verb'GxB_ASIN_FC32', \verb'GxB_ASIN_FC64' -\verb'GxB_ASINH_FC32', and \verb'GxB_ASINH_FC64' do not work properly if the MS -Visual Studio compiler is used. These functions work properly if the gcc, icc, -or clang compilers are used on Linux or MacOS. - -Integer division by zero normally terminates an application, but this is -avoided in SuiteSparse:GraphBLAS. For details, see the binary -\verb'GrB_DIV_'$T$ operators. - -\begin{alert} -{\bf SPEC:} The definition of integer division by zero is an extension to the -specification. -\end{alert} - -The next sections define the following methods for the \verb'GrB_UnaryOp' -object: - -\vspace{0.1in} -{\footnotesize -\noindent -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_UnaryOp_new' & create a user-defined unary operator & \ref{unaryop_new} \\ -\verb'GxB_UnaryOp_new' & create a named user-defined unary operator & \ref{unaryop_new_named} \\ -\verb'GrB_UnaryOp_wait' & wait for a user-defined unary operator & \ref{unaryop_wait} \\ -\verb'GrB_get' & get properties of an operator & \ref{get_set_unop} \\ -\verb'GrB_set' & set the operator name/definition & \ref{get_set_unop} \\ -\verb'GrB_UnaryOp_free' & free a user-defined unary operator & \ref{unaryop_free} \\ -\hline -\end{tabular} -} -\vspace{0.1in} - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_UnaryOp\_new:} create a user-defined unary operator} -%------------------------------------------------------------------------------- -\label{unaryop_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_UnaryOp_new // create a new user-defined unary operator -( - GrB_UnaryOp *unaryop, // handle for the new unary operator - void *function, // pointer to the unary function - GrB_Type ztype, // type of output z - GrB_Type xtype // type of input x -) ; -\end{verbatim} }\end{mdframed} - -\verb'GrB_UnaryOp_new' creates a new unary operator. The new operator is -returned in the \verb'unaryop' handle, which must not be \verb'NULL' on input. -On output, its contents contains a pointer to the new unary operator. - -The two types \verb'xtype' and \verb'ztype' are the GraphBLAS types of the -input $x$ and output $z$ of the user-defined function $z=f(x)$. These types -may be built-in types or user-defined types, in any combination. The two types -need not be the same, but they must be previously defined before passing them -to \verb'GrB_UnaryOp_new'. - -The \verb'function' argument to \verb'GrB_UnaryOp_new' is a pointer to a -user-defined function with the following signature: - - {\footnotesize - \begin{verbatim} - void (*f) (void *z, const void *x) ; \end{verbatim} } - -When the function \verb'f' is called, the arguments \verb'z' and \verb'x' are -passed as \verb'(void *)' pointers, but they will be pointers to values of the -correct type, defined by \verb'ztype' and \verb'xtype', respectively, when the -operator was created. - -{\bf NOTE:} -The pointers passed to a user-defined operator may not be unique. That is, the -user function may be called with multiple pointers that point to the same -space, such as when \verb'z=f(z,y)' is to be computed by a binary operator, or -\verb'z=f(z)' for a unary operator. Any parameters passed to the user-callable -function may be aliased to each other. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_UnaryOp\_new:} create a named user-defined unary operator} -%------------------------------------------------------------------------------- -\label{unaryop_new_named} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_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 - const char *unop_name, // name of the user function - const char *unop_defn // definition of the user function -) ; -\end{verbatim} }\end{mdframed} - -Creates a named \verb'GrB_UnaryOp'. Only the first 127 characters of -\verb'unop_name' are used. The \verb'unop_defn' is a string containing the -entire function itself. For example: - - {\footnotesize - \begin{verbatim} - void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ; - ... - GrB_Type Square ; - GxB_UnaryOp_new (&Square, square, GrB_FP64, GrB_FP64, "square", - "void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ;") ; - \end{verbatim}} - -The two strings \verb'unop_name' and \verb'unop_defn' are optional, but are -required to enable the JIT compilation of kernels that use this operator. - -If JIT compilation is enabled, or if the corresponding JIT kernel has been -copied into the \verb'PreJIT' folder, the \verb'function' may be \verb'NULL'. -In this case, a JIT kernel is compiled that contains just the user-defined -function. If the JIT is disabled and the \verb'function' is \verb'NULL', this -method returns \verb'GrB_NULL_POINTER'. - -The above example is identical to the following usage, except that -\verb'GrB_UnaryOp_new' requires a non-NULL function pointer. - - {\footnotesize - \begin{verbatim} - void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ; - ... - GrB_Type Square ; - GrB_UnaryOp_new (&Square, square, GrB_FP64, GrB_FP64) ; - GrB_set (Square, "square", GxB_JIT_C_NAME) ; - GrB_set (Square, "void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ;", - GxB_JIT_C_DEFINITION) ; \end{verbatim}} - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_UnaryOp\_wait:} wait for a unary operator} -%------------------------------------------------------------------------------- -\label{unaryop_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a user-defined unary operator -( - GrB_UnaryOp unaryop, // unary operator to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined unary operator, a GraphBLAS library may choose to -exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS currently does nothing except to ensure that the -\verb'unaryop' is valid. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_UnaryOp\_free:} free a user-defined unary operator} -%------------------------------------------------------------------------------- -\label{unaryop_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-created unary operator -( - GrB_UnaryOp *unaryop // handle of unary operator to free -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_UnaryOp_free' frees a user-defined unary operator. -Either usage: - - {\small - \begin{verbatim} - GrB_UnaryOp_free (&unaryop) ; - GrB_free (&unaryop) ; \end{verbatim}} - -\noindent -frees the \verb'unaryop' and sets \verb'unaryop' to \verb'NULL'. -It safely does nothing if passed a \verb'NULL' -handle, or if \verb'unaryop == NULL' on input. -It does nothing at all if passed a built-in unary operator. - -\newpage -%=============================================================================== -\subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== -%=============================================================================== -\label{binaryop} - -A binary operator is a scalar function of the form $z=f(x,y)$. The types of -$z$, $x$, and $y$ need not be the same. The built-in binary operators are -listed in the tables below. The notation $T$ refers to any of the 13 -built-in types, but two of those types are SuiteSparse extensions -(\verb'GxB_FC32' and \verb'GxB_FC64'). For those types, the operator name -always starts with \verb'GxB', not \verb'GrB'). -The notation $R$ refers to any real type (all but \verb'FC32' and \verb'FC64'). - -The six \verb'GxB_IS*' comparators and the \verb'GxB_*' logical -operators all return a result one for true and zero for false, in the same -domain $T$ or $R$ as their inputs. These six comparators are useful -as ``multiply'' operators for creating semirings with non-Boolean monoids. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary operators for all 13 types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -% numeric TxT->T -\verb'GrB_FIRST_'$T$ & $T \times T \rightarrow T$ & $z = x$ & first argument \\ -\verb'GrB_SECOND_'$T$ & $T \times T \rightarrow T$ & $z = y$ & second argument \\ -\verb'GxB_ANY_'$T$ & $T \times T \rightarrow T$ & $z = x$ or $y$ & pick $x$ or $y$ arbitrarily \\ -\verb'GrB_ONEB_'$T$ & $T \times T \rightarrow T$ & $z = 1$ & one \\ -\verb'GxB_PAIR_'$T$ & $T \times T \rightarrow T$ & $z = 1$ & one (historical) \\ -\verb'GrB_PLUS_'$T$ & $T \times T \rightarrow T$ & $z = x+y$ & addition \\ -\verb'GrB_MINUS_'$T$ & $T \times T \rightarrow T$ & $z = x-y$ & subtraction \\ -\verb'GxB_RMINUS_'$T$ & $T \times T \rightarrow T$ & $z = y-x$ & reverse subtraction \\ -\verb'GrB_TIMES_'$T$ & $T \times T \rightarrow T$ & $z = xy$ & multiplication \\ -\verb'GrB_DIV_'$T$ & $T \times T \rightarrow T$ & $z = x/y$ & division \\ -\verb'GxB_RDIV_'$T$ & $T \times T \rightarrow T$ & $z = y/x$ & reverse division \\ -\verb'GxB_POW_'$T$ & $T \times T \rightarrow T$ & $z = x^y$ & power \\ -\hline -% TxT->T comparators -\verb'GxB_ISEQ_'$T$ & $T \times T \rightarrow T$ & $z = (x == y)$ & equal \\ -\verb'GxB_ISNE_'$T$ & $T \times T \rightarrow T$ & $z = (x \ne y)$ & not equal \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -The \verb'GxB_POW_*' operators for real types do not return a complex result, -and thus $z = f(x,y) = x^y$ is undefined if $x$ is negative and $y$ is not an -integer. To compute a complex result, use \verb'GxB_POW_FC32' or -\verb'GxB_POW_FC64'. - -Operators that require the domain to be ordered (\verb'MIN', \verb'MAX', -less-than, greater-than, and so on) are not defined for -complex types. These are listed in the following table: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary operators for all non-complex types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -% numeric RxR->R -\verb'GrB_MIN_'$R$ & $R \times R \rightarrow R$ & $z = \min(x,y)$ & minimum \\ -\verb'GrB_MAX_'$R$ & $R \times R \rightarrow R$ & $z = \max(x,y)$ & maximum \\ -\hline -% RxR->R comparators -\verb'GxB_ISGT_'$R$ & $R \times R \rightarrow R$ & $z = (x > y)$ & greater than \\ -\verb'GxB_ISLT_'$R$ & $R \times R \rightarrow R$ & $z = (x < y)$ & less than \\ -\verb'GxB_ISGE_'$R$ & $R \times R \rightarrow R$ & $z = (x \ge y)$ & greater than or equal \\ -\verb'GxB_ISLE_'$R$ & $R \times R \rightarrow R$ & $z = (x \le y)$ & less than or equal \\ -\hline -% RxR->R logical -\verb'GxB_LOR_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \vee (y \ne 0) $ & logical OR \\ -\verb'GxB_LAND_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \wedge (y \ne 0) $ & logical AND \\ -\verb'GxB_LXOR_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \veebar (y \ne 0) $ & logical XOR \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -Another set of six kinds of built-in comparators have the form $T -\times T \rightarrow $\verb'bool'. Note that when $T$ is \verb'bool', the six -operators give the same results as the six \verb'GxB_IS*_BOOL' operators in the -table above. These six comparators are useful as ``multiply'' -operators for creating semirings with Boolean monoids. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary comparators for all 13 types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -% 6 TxT -> bool comparators -\verb'GrB_EQ_'$T$ & $T \times T \rightarrow $\verb'bool' & $z = (x == y)$ & equal \\ -\verb'GrB_NE_'$T$ & $T \times T \rightarrow $\verb'bool' & $z = (x \ne y)$ & not equal \\ -\hline -\multicolumn{4}{ }{\mbox{ }} \\ -\hline -\multicolumn{4}{|c|}{Binary comparators for non-complex types} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -\verb'GrB_GT_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x > y)$ & greater than \\ -\verb'GrB_LT_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x < y)$ & less than \\ -\verb'GrB_GE_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x \ge y)$ & greater than or equal \\ -\verb'GrB_LE_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x \le y)$ & less than or equal \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -GraphBLAS has four built-in binary operators that operate purely in -the Boolean domain. The first three are identical to the \verb'GxB_L*_BOOL' -operators described above, just with a shorter name. The \verb'GrB_LXNOR' -operator is the same as \verb'GrB_EQ_BOOL'. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary operators for the boolean type only} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -% 3 bool x bool -> bool -\verb'GrB_LOR' & \verb'bool' - $\times$ \verb'bool' - $\rightarrow$ \verb'bool' & $z = x \vee y $ & logical OR \\ -\verb'GrB_LAND' & \verb'bool' - $\times$ \verb'bool' - $\rightarrow$ \verb'bool' & $z = x \wedge y $ & logical AND \\ -\verb'GrB_LXOR' & \verb'bool' - $\times$ \verb'bool' - $\rightarrow$ \verb'bool' & $z = x \veebar y $ & logical XOR \\ -\verb'GrB_LXNOR' & \verb'bool' - $\times$ \verb'bool' - $\rightarrow$ \verb'bool' & $z = \lnot (x \veebar y) $ & logical XNOR \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -The following operators are defined for real floating-point types only (\verb'GrB_FP32' and \verb'GrB_FP64'). -They are identical to the C11 functions of the same name. The last one in the table constructs -the corresponding complex type. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary operators for the real floating-point types only} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -\verb'GxB_ATAN2_'$F$ & $F \times F \rightarrow F$ & $z = \tan^{-1}(y/x)$ & 4-quadrant arc tangent \\ -\verb'GxB_HYPOT_'$F$ & $F \times F \rightarrow F$ & $z = \sqrt{x^2+y^2}$ & hypotenuse \\ -\verb'GxB_FMOD_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'fmod' \\ -\verb'GxB_REMAINDER_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'remainder' \\ -\verb'GxB_LDEXP_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'ldexp' \\ -\verb'GxB_COPYSIGN_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'copysign' \\ -\hline -\verb'GxB_CMPLX_'$F$ & $F \times F \rightarrow Z$ & $z = x + y \times i$ & complex from real \& imag \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -Eight bitwise operators are predefined for signed and unsigned integers. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Binary operators for signed and unsigned integers} \\ -\hline -GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ -\hline -\verb'GrB_BOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=x|y' & bitwise logical OR \\ -\verb'GrB_BAND_'$I$ & $I \times I \rightarrow I$ & \verb'z=x&y' & bitwise logical AND \\ -\verb'GrB_BXOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=x^y' & bitwise logical XOR \\ -\verb'GrB_BXNOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=~(x^y)' & bitwise logical XNOR \\ -\hline -\verb'GxB_BGET_'$I$ & $I \times I \rightarrow I$ & & get bit y of x \\ -\verb'GxB_BSET_'$I$ & $I \times I \rightarrow I$ & & set bit y of x \\ -\verb'GxB_BCLR_'$I$ & $I \times I \rightarrow I$ & & clear bit y of x \\ -\verb'GxB_BSHIFT_'$I$ & $I \times $\verb'int8'$ \rightarrow I$ & & bit shift \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -There are two sets of built-in comparators in SuiteSparse:Graph\-BLAS, -but they are not redundant. They are identical except for the type (domain) of -their output, $z$. The \verb'GrB_EQ_'$T$ and related operators compare their -inputs of type $T$ and produce a Boolean result of true or false. The -\verb'GxB_ISEQ_'$T$ and related operators compute the same thing and produce a -result with same type $T$ as their input operands, returning one for true or -zero for false. The \verb'IS*' comparators are useful when combining -comparators with other non-Boolean operators. For example, a \verb'PLUS-ISEQ' -semiring counts how many terms are true. With this semiring, -matrix multiplication ${\bf C=AB}$ for two weighted undirected graphs ${\bf A}$ -and ${\bf B}$ computes $c_{ij}$ as the number of edges node $i$ and $j$ have in -common that have identical edge weights. Since the output type of the -``multiplier'' operator in a semiring must match the type of its monoid, the -Boolean \verb'EQ' cannot be combined with a non-Boolean \verb'PLUS' monoid to -perform this operation. - -Likewise, SuiteSparse:GraphBLAS has two sets of logical OR, AND, and XOR -operators. Without the \verb'_'$T$ suffix, the three operators \verb'GrB_LOR', -\verb'GrB_LAND', and \verb'GrB_LXOR' operate purely in the Boolean domain, -where all input and output types are \verb'GrB_BOOL'. The second set -(\verb'GxB_LOR_'$T$ \verb'GxB_LAND_'$T$ and \verb'GxB_LXOR_'$T$) provides -Boolean operators to all 11 real domains, implicitly typecasting their inputs from -type $T$ to Boolean and returning a value of type $T$ that is 1 for true or -zero for false. The set of \verb'GxB_L*_'$T$ operators are useful since they -can be combined with non-Boolean monoids in a semiring. - -Floating-point operations follow the IEEE 754 standard. Thus, computing $x/0$ -for a floating-point $x$ results in \verb'+Inf' if $x$ is positive, \verb'-Inf' -if $x$ is negative, and \verb'NaN' if $x$ is zero. The application is not -terminated. However, integer division by zero normally terminates an -application. SuiteSparse:GraphBLAS avoids this by adopting the same rules as -MATLAB, which are analogous to how the IEEE standard handles floating-point -division by zero. For integers, when $x$ is positive, $x/0$ is the largest -positive integer, for negative $x$ it is the minimum integer, and 0/0 results -in zero. For example, for an integer $x$ of type \verb'GrB_INT32', 1/0 is -$2^{31}-1$ and (-1)/0 is $-2^{31}$. Refer to Section~\ref{type} for a list of -integer ranges. - -%=============================================================================== -\subsubsection{GraphBLAS binary operators based on index binary operators} -%=============================================================================== - -Eight binary operators based on underlying index binary operators are -predefined. They differ when used in a semiring and when used in -\verb'GrB_eWise*' and \verb'GrB_apply'. These index-based binary operators -cannot be used in \verb'GrB_build', nor can they be used as the \verb'accum' -operator for any operation. - -The index-based binary operators do not depend on the type or numerical value -of their inputs, just their position in a matrix or vector. For a vector, $j$ -is always 0, and $i$ is the index into the vector. There are two types $N$ -available: \verb'INT32' and \verb'INT64', which is the type of the output $z$. -User-defined index-based operators are not defined by \verb'GrB_BinaryOp_new', -but by \verb'GxB_BinaryOp_new_IndexOp' instead. See Section~\ref{idxbinaryop} -for details. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ -\multicolumn{4}{|c|}{when used as a multiplicative operator in a semiring} \\ -\hline -GraphBLAS name & types (domains) & $z=f(a_{ik},b_{kj})$ & description \\ -\hline -\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $a_{ik}$ (0-based) \\ -\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $a_{ik}$ (1-based) \\ -\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = k$ & column index of $a_{ik}$ (0-based) \\ -\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = k+1$ & column index of $a_{ik}$ (1-based) \\ -\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = k$ & row index of $b_{kj}$ (0-based) \\ -\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = k+1$ & row index of $b_{kj}$ (1-based) \\ -\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $b_{kj}$ (0-based) \\ -\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $b_{kj}$ (1-based) \\ -\hline -\end{tabular} -} - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{|llll|} -\hline -\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ -\multicolumn{4}{|c|}{when used in all other methods} \\ -\hline -GraphBLAS name & types (domains) & $z=f(a_{ij},b_{ij})$ & description \\ -\hline -\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $a_{ij}$ (0-based) \\ -\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $a_{ij}$ (1-based) \\ -\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $a_{ij}$ (0-based) \\ -\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $a_{ij}$ (1-based) \\ -\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $b_{ij}$ (0-based) \\ -\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $b_{ij}$ (1-based) \\ -\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $b_{ij}$ (0-based) \\ -\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $b_{ij}$ (1-based) \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -Finally, one special binary operator can only be used as input to -\verb'GrB_Matrix_build' or \verb'GrB_Vector_build': the \verb'GxB_IGNORE_DUP' -operator. If \verb'dup' is \verb'NULL', any duplicates in the \verb'GrB*build' -methods result in an error. If \verb'dup' is the special binary operator -\verb'GxB_IGNORE_DUP', then any duplicates are ignored. If duplicates appear, -the last one in the list of tuples is taken and the prior ones ignored. This -is not an error. - -The next sections define the following methods for the \verb'GrB_BinaryOp' -object: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_BinaryOp_new' & create a user-defined binary operator & \ref{binaryop_new} \\ -\verb'GxB_BinaryOp_new' & create a named user-defined binary operator & \ref{binaryop_new_named} \\ -\verb'GrB_BinaryOp_wait' & wait for a user-defined binary operator & \ref{binaryop_wait} \\ -\verb'GrB_get' & get properties of an operator & \ref{get_set_binop} \\ -\verb'GrB_set' & set the operator name/definition & \ref{get_set_binop} \\ -\verb'GrB_BinaryOp_free' & free a user-defined binary operator & \ref{binaryop_free} \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_BinaryOp\_new:} create a user-defined binary operator} -%------------------------------------------------------------------------------- -\label{binaryop_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_BinaryOp_new -( - GrB_BinaryOp *binaryop, // handle for the new binary operator - void *function, // pointer to the binary function - GrB_Type ztype, // type of output z - GrB_Type xtype, // type of input x - GrB_Type ytype // type of input y -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GrB_BinaryOp_new' creates a new binary operator. The new operator is -returned in the \verb'binaryop' handle, which must not be \verb'NULL' on input. -On output, its contents contains a pointer to the new binary operator. - -The three types \verb'xtype', \verb'ytype', and \verb'ztype' are the GraphBLAS -types of the inputs $x$ and $y$, and output $z$ of the user-defined function -$z=f(x,y)$. These types may be built-in types or user-defined types, in any -combination. The three types need not be the same, but they must be previously -defined before passing them to \verb'GrB_BinaryOp_new'. - -The final argument to \verb'GrB_BinaryOp_new' is a pointer to a user-defined -function with the following signature: - - {\footnotesize - \begin{verbatim} - void (*f) (void *z, const void *x, const void *y) ; \end{verbatim} } - -When the function \verb'f' is called, the arguments \verb'z', \verb'x', and -\verb'y' are passed as \verb'(void *)' pointers, but they will be pointers to -values of the correct type, defined by \verb'ztype', \verb'xtype', and -\verb'ytype', respectively, when the operator was created. - -{\bf NOTE:} SuiteSparse:GraphBLAS may call the function with the pointers -\verb'z' and \verb'x' equal to one another, in which case \verb'z=f(z,y)' -should be computed. Future versions may use additional pointer aliasing. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_BinaryOp\_new:} create a named user-defined binary operator} -%------------------------------------------------------------------------------- -\label{binaryop_new_named} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_new -( - GrB_BinaryOp *op, // handle for the new binary operator - GxB_binary_function function, // pointer to the binary function - GrB_Type ztype, // type of output z - GrB_Type xtype, // type of input x - GrB_Type ytype, // type of input y - const char *binop_name, // name of the user function - const char *binop_defn // definition of the user function -) ; -\end{verbatim} }\end{mdframed} - -Creates a named \verb'GrB_BinaryOp'. Only the first 127 characters of -\verb'binop_name' are used. The \verb'binop_defn' is a string containing the -entire function itself. For example: - -{\footnotesize -\begin{verbatim} -void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; } ; -... -GrB_Type AbsDiff ; -GxB_BinaryOp_new (&AbsDiff, absdiff, GrB_FP64, GrB_FP64, GrB_FP64, "absdiff", - "void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; }") ; \end{verbatim}} - -The two strings \verb'binop_name' and \verb'binop_defn' are optional, but are -required to enable the JIT compilation of kernels that use this operator. - -If the JIT is enabled, or if the corresponding JIT kernel has been copied -into the \verb'PreJIT' folder, the \verb'function' may be \verb'NULL'. In this -case, a JIT kernel is compiled that contains just the user-defined function. -If the JIT is disabled and the \verb'function' is \verb'NULL', this method -returns \verb'GrB_NULL_POINTER'. - -The above example is identical to the following usage, except that -\verb'GrB_BinaryOp_new' requires a non-NULL function pointer. - -{\footnotesize -\begin{verbatim} -void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; } ; -... -GrB_Type AbsDiff ; -GrB_BinaryOp_new (&AbsDiff, absdiff, GrB_FP64, GrB_FP64, GrB_FP64) ; -GrB_set (AbsDiff, "absdiff", GxB_JIT_C_NAME) ; -GrB_set (AbsDiff, - "void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; }", - GxB_JIT_C_DEFINITION) ;\end{verbatim}} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_BinaryOp\_wait:} wait for a binary operator} -%------------------------------------------------------------------------------- -\label{binaryop_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a user-defined binary operator -( - GrB_BinaryOp binaryop, // binary operator to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined binary operator, a GraphBLAS library may choose -to exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS currently does nothing for except to ensure that the -\verb'binaryop' is valid. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_BinaryOp\_free:} free a user-defined binary operator} -%------------------------------------------------------------------------------- -\label{binaryop_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-created binary operator -( - GrB_BinaryOp *binaryop // handle of binary operator to free -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_BinaryOp_free' frees a user-defined binary operator. -Either usage: - - {\small - \begin{verbatim} - GrB_BinaryOp_free (&op) ; - GrB_free (&op) ; \end{verbatim}} - -\noindent -frees the \verb'op' and sets \verb'op' to \verb'NULL'. -It safely does nothing if passed a \verb'NULL' -handle, or if \verb'op == NULL' on input. -It does nothing at all if passed a built-in binary operator. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf ANY} and {\sf PAIR} ({\sf ONEB}) operators} -%------------------------------------------------------------------------------- -\label{any_pair} - -The \verb'GxB_PAIR' operator (also called \verb'GrB_ONEB') is simple to describe: -just $f(x,y)=1$. It is called -the \verb'PAIR' operator since it returns $1$ in a semiring when a pair of -entries $a_{ik}$ and $b_{kj}$ is found in the matrix multiply. This operator -is simple yet very useful. It allows purely structural computations to be -performed on matrices of any type, without having to typecast them to Boolean -with all values being true. Typecasting need not be performed on the inputs to -the \verb'PAIR' operator, and the \verb'PAIR' operator does not need to access -the values of the matrix. This cuts memory accesses, so it is a very fast -operator to use. - -The \verb'GxB_PAIR_T' operator is a SuiteSparse:GraphBLAS extension. -It has since been added to the v2.0 C API Specification as \verb'GrB_ONEB_T'. -They are identical, but the latter name should be used for compatibility -with other GraphBLAS libraries. - -The \verb'ANY' operator is very unusual, but very powerful. It is the function -$f_{\mbox{any}}(x,y)=x$, or $y$, where GraphBLAS has to freedom to select -either $x$, or $y$, at its own discretion. Do not confuse the \verb'ANY' -operator with the \verb'any' function in MATLAB/Octave, which computes a reduction -using the logical OR operator. - -The \verb'ANY' function is associative and commutative, and can thus serve as -an operator for a monoid. The selection of $x$ are $y$ is not randomized. -Instead, SuiteSparse:GraphBLAS uses this freedom to compute as fast a result as -possible. When used as the monoid in a dot product, \[ c_{ij} = \sum_k a_{ik} -b_{kj} \] for example, the computation can terminate as soon as any matching -pair of entries is found. When used in a parallel saxpy-style computation, the -\verb'ANY' operator allows for a relaxed form of synchronization to be used, -resulting in a fast benign race condition. - -Because of this benign race condition, the result of the \verb'ANY' monoid can -be non-deterministic, unless it is coupled with the \verb'PAIR' multiplicative -operator. In this case, the \verb'ANY_PAIR' semiring will return a -deterministic result, since $f_{\mbox{any}}(1,1)$ is always 1. - -When paired with a different operator, the results are non-deterministic. This -gives a powerful method when computing results for which any value selected by -the \verb'ANY' operator is valid. One such example is the breadth-first-search -tree. Suppose node $j$ is at level $v$, and there are multiple nodes $i$ at -level $v-1$ for which the edge $(i,j)$ exists in the graph. Any of these nodes -$i$ can serve as a valid parent in the BFS tree. Using the \verb'ANY' -operator, GraphBLAS can quickly compute a valid BFS tree; if it used again on -the same inputs, it might return a different, yet still valid, BFS tree, due to -the non-deterministic nature of intra-thread synchronization. - -\newpage -%=============================================================================== -\subsection{GraphBLAS IndexUnaryOp operators: {\sf GrB\_IndexUnaryOp}} %======== -%=============================================================================== -\label{idxunop} - -An index-unary operator is a scalar function of the form -$z=f(a_{ij},i,j,y)$ that is applied to the entries $a_{ij}$ of an -$m$-by-$n$ matrix. It can be used in \verb'GrB_apply' (Section~\ref{apply}) or -in \verb'GrB_select' (Section~\ref{select}) to select entries from a matrix or -vector. - -The signature of the index-unary function \verb'f' is as follows: - -{\footnotesize -\begin{verbatim} -void f -( - 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 of type ytype -) ; \end{verbatim}} - -The following built-in operators are available. Operators that do not depend -on the value of \verb'A(i,j)' can be used on any matrix or vector, including -those of user-defined type. In the table, \verb'y' is a -scalar whose type matches the suffix of the operator. The \verb'VALUEEQ' and -\verb'VALUENE' operators are defined for any built-in type. The other -\verb'VALUE' operators are defined only for real (not complex) built-in types. -Any index computations are done in \verb'int64_t' arithmetic; the result is -typecasted to \verb'int32_t' for the \verb'*INDEX_INT32' operators. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS name & MATLAB/Octave & description \\ - & analog & \\ -\hline -\verb'GrB_ROWINDEX_INT32' & \verb'z=i+y' & row index of \verb'A(i,j)', as int32 \\ -\verb'GrB_ROWINDEX_INT64' & \verb'z=i+y' & row index of \verb'A(i,j)', as int64 \\ -\verb'GrB_COLINDEX_INT32' & \verb'z=j+y' & column index of \verb'A(i,j)', as int32 \\ -\verb'GrB_COLINDEX_INT64' & \verb'z=j+y' & column index of \verb'A(i,j)', as int64 \\ -\verb'GrB_DIAGINDEX_INT32' & \verb'z=j-(i+y)' & column diagonal index of \verb'A(i,j)', as int32 \\ -\verb'GrB_DIAGINDEX_INT64' & \verb'z=j-(i+y)' & column diagonal index of \verb'A(i,j)', as int64 \\ -\hline -\verb'GrB_TRIL' & \verb'z=(j<=(i+y))' & true for entries on or below the \verb'y'th diagonal \\ -\verb'GrB_TRIU' & \verb'z=(j>=(i+y))' & true for entries on or above the \verb'y'th diagonal \\ -\verb'GrB_DIAG' & \verb'z=(j==(i+y))' & true for entries on the \verb'y'th diagonal \\ -\verb'GrB_OFFDIAG' & \verb'z=(j!=(i+y))' & true for entries not on the \verb'y'th diagonal \\ -\verb'GrB_COLLE' & \verb'z=(j<=y)' & true for entries in columns 0 to \verb'y' \\ -\verb'GrB_COLGT' & \verb'z=(j>y)' & true for entries in columns \verb'y+1' and above \\ -\verb'GrB_ROWLE' & \verb'z=(i<=y)' & true for entries in rows 0 to \verb'y' \\ -\verb'GrB_ROWGT' & \verb'z=(i>y)' & true for entries in rows \verb'y+1' and above \\ -\hline -\verb'GrB_VALUENE_T' & \verb'z=(aij!=y)' & true if \verb'A(i,j)' is not equal to \verb'y'\\ -\verb'GrB_VALUEEQ_T' & \verb'z=(aij==y)' & true if \verb'A(i,j)' is equal to \verb'y'\\ -\verb'GrB_VALUEGT_T' & \verb'z=(aij>y)' & true if \verb'A(i,j)' is greater than \verb'y' \\ -\verb'GrB_VALUEGE_T' & \verb'z=(aij>=y)' & true if \verb'A(i,j)' is greater than or equal to \verb'y' \\ -\verb'GrB_VALUELT_T' & \verb'z=(aijk = (int64_t) jx ; - z->v = (*x) ; - } - void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) - { - if (x->v > y->v || (x->v == y->v && x->k < y->k)) - { - z->k = x->k ; - z->v = x->v ; - } - else - { - z->k = y->k ; - z->v = y->v ; - } - } - #define MAX_FP64 (a string containing the max_fp64 function above) - - // create the types and operators: - GrB_Scalar Theta ; // unused, but cannot be NULL - GrB_Scalar_new (&Theta, GrB_BOOL) ; - GrB_Scalar_setElement_BOOL (Theta, 0) ; - GxB_IndexBinaryOp Iop ; - GrB_BinaryOp Bop, MonOp ; - GrB_Type Tuple ; - GxB_Type_new (&Tuple, sizeof (tuple_fp64), "tuple_fp64", FP64_K) ; - GxB_IndexBinaryOp_new (&Iop, make_fp64, Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, - "make_fp64", MAKE_FP64)) ; - GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta) ; - tuple_fp64 id ; - memset (&id, 0, sizeof (tuple_fp64)) ; - id.k = INT64_MAX ; - id.v = (double) (-INFINITY) ; - GxB_BinaryOp_new (&MonOp, max_fp64, Tuple, Tuple, Tuple, "max_fp64", MAX_FP64) ; - GrB_Monoid MonOp ; - GrB_Semiring Semiring ; - GrB_Monoid_new_UDT (&Monoid, MonOp, &id) ; - GrB_Semiring_new (&Semiring, Monoid, Bop) ; - - // compute the argmax of each row of a GrB_FP64 matrix A: - // y = zeros (ncols,1) ; - GrB_Vector y ; - GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; - GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; - // c = A*y using the argmax semiring - GrB_Vector_new (&c, Tuple, nrows, 1)) ; - GrB_mxv (c, NULL, NULL, Semiring, A, y, NULL) ; \end{verbatim}} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_IndexBinaryOp\_wait:} wait for an index-binary operator} -%------------------------------------------------------------------------------- -\label{idxbinop_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexBinaryOp_wait -( - GxB_IndexBinaryOp op, - GrB_WaitMode waitmode -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined index-binary operator, a GraphBLAS library may choose -to exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS currently does nothing except to ensure that the -\verb'op' is valid. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_IndexBinaryOp\_free:} free a user-defined index-binary operator} -%------------------------------------------------------------------------------- -\label{idxbinop_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-created index-binary operator -( - GxB_IndexBinaryOp *op // handle of IndexBinaryOp to free -) ; -\end{verbatim} -}\end{mdframed} - -\verb'GxB_IndexBinaryOp_free' frees a user-defined index-binary operator. Either usage: - - {\small - \begin{verbatim} - GxB_IndexBinaryOp_free (&op) ; - GrB_free (&op) ; \end{verbatim}} - -\noindent -frees the \verb'op' and sets \verb'op' to \verb'NULL'. It safely -does nothing if passed a \verb'NULL' handle, or if \verb'op == NULL' on -input. No built-in index-binary operators exist, but if they did, -the method does nothing at all if passed a built-in index-binary operator. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_BinaryOp\_new\_IndexOp:} create a index-based binary operator} -%------------------------------------------------------------------------------- -\label{binop_new_idxop} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_new_IndexOp -( - GrB_BinaryOp *binop, // handle of binary op to create - GxB_IndexBinaryOp idxbinop, // based on this index binary op - GrB_Scalar theta // theta value to bind to the new binary op -) ; -\end{verbatim} -}\end{mdframed} - -The \verb'GxB_IndexBinaryOp' cannot be directly used in any GraphBLAS operation -such as \verb'GrB_mxm'. Instead, it must be used to create a new index-based -\verb'GrB_BinaryOp'. The resulting binary operator can then be used to as the -multiplicative operator in a new user-defined semiring, or as the primary -binary operator of the element-wise operations (\verb'eWiseAdd', -\verb'eWiseUnion', \verb'eWiseMult', or \verb'kronecker'). - -The resulting binary operator cannot be used as the \verb'accum' operator in -any GraphBLAS operation. It also cannot be used in other places where a binary -operator appears, including \verb'GrB_*_build', \verb'GrB_apply', -\verb'GrB_reduce' and \verb'GrB_*_sort'. - -The \verb'GxB_BinaryOp_new_IndexOp' method creates this index-based binary -operator. It takes two input parameters: an index-binary operator, and a -scalar \verb'Theta'. The value of \verb'Theta' is copied into this new binary -operator, and the value cannot be changed. To change \verb'Theta', the binary -operator must be freed, and any semiring that would like to use the new value -of \verb'Theta' must also be recreated. - -An example of its use is given in Section~\ref{idxbinop_new_named}. - -\newpage -%=============================================================================== -\subsection{GraphBLAS monoids: {\sf GrB\_Monoid}} %============================= -%=============================================================================== -\label{monoid} - -A {\em monoid} is defined on a single domain (that is, a single type), $T$. It -consists of an associative binary operator $z=f(x,y)$ whose three operands $x$, -$y$, and $z$ are all in this same domain $T$ (that is $T \times T \rightarrow -T$). The operator must also have an identity element, or ``zero'' in this -domain, such that $f(x,0)=f(0,x)=x$. Recall that an associative operator -$f(x,y)$ is one for which the condition $f(a, f(b,c)) = f(f (a,b),c)$ always -holds. That is, operator can be applied in any order and the results remain -the same. If used in a semiring, the operator must also be commutative. - -The 77 predefined monoids are listed in the table below, which -includes nearly all monoids that can be constructed from built-in binary -operators. A few additional monoids can be defined with \verb'GrB_Monoid_new' -using built-in operators, such as bitwise monoids for signed integers. -Recall that $T$ denotes any built-in type (including boolean, integer, floating -point real, and complex), $R$ denotes any non-complex type (including bool), -$I$ denotes any integer type, and $Z$ denotes any complex type. Let $S$ denote -the 10 non-boolean real types. Let $U$ denote all unsigned integer types. - -The table lists the GraphBLAS monoid, its type, expression, identity -value, and {\em terminal} value (if any). For these built-in monoids, the -terminal values are the {\em annihilators} of the function, which is the value -$z$ so that $z=f(z,y)$ regardless of the value of $y$. For example -$\min(-\infty,y) = -\infty$ for any $y$. For integer domains, $+\infty$ and -$-\infty$ are the largest and smallest integer in their range. With unsigned -integers, the smallest value is zero, and thus \verb'GrB_MIN_MONOID_UINT8' has an -identity of 255 and a terminal value of 0. - -When computing with a monoid, the computation can terminate early if the -terminal value arises. No further work is needed since the result will not -change. This value is called the terminal value instead of the annihilator, -since a user-defined operator can be created with a terminal value that is not -an annihilator. See Section~\ref{monoid_terminal_new} for an example. - -The \verb'GxB_ANY_*' monoid can terminate as soon as it finds any value at all. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lllll} -\hline -GraphBLAS & types (domains) & expression & identity & terminal \\ -operator & & $z=f(x,y)$ & & \\ -\hline -% numeric SxS -> S -\verb'GrB_PLUS_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = x+y$ & 0 & none \\ -\verb'GrB_TIMES_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = xy$ & 1 & 0 or none (see note) \\ -\verb'GrB_MIN_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = \min(x,y)$ & $+\infty$ & $-\infty$ \\ -\verb'GrB_MAX_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = \max(x,y)$ & $-\infty$ & $+\infty$ \\ -\hline -% complex ZxZ -> Z -\verb'GxB_PLUS_'$Z$\verb'_MONOID' & $Z \times Z \rightarrow Z$ & $z = x+y$ & 0 & none \\ -\verb'GxB_TIMES_'$Z$\verb'_MONOID' & $Z \times Z \rightarrow Z$ & $z = xy$ & 1 & none \\ -\hline -% any TxT -> T -\verb'GxB_ANY_'$T$\verb'_MONOID' & $T \times T \rightarrow T$ & $z = x$ or $y$ & any & any \\ -\hline -% bool x bool -> bool -\verb'GrB_LOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \vee y $ & false & true \\ -\verb'GrB_LAND_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \wedge y $ & true & false \\ -\verb'GrB_LXOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \veebar y $ & false & none \\ -\verb'GrB_LXNOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z =(x == y)$ & true & none \\ -\hline -% bitwise: UxU -> U -\verb'GxB_BOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x|y' & all bits zero & all bits one \\ -\verb'GxB_BAND_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x&y' & all bits one & all bits zero \\ -\verb'GxB_BXOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x^y' & all bits zero & none \\ -\verb'GxB_BXNOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=~(x^y)' & all bits one & none \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -% 40: (min,max,+,*) x (int8,16,32,64, uint8,16,32,64, fp32, fp64) -The C API Specification includes 44 predefined monoids, with the naming -convention \verb'GrB_op_MONOID_type'. Forty monoids are available for the four -operators \verb'MIN', \verb'MAX', \verb'PLUS', and \verb'TIMES', each with the -10 non-boolean real types. Four boolean monoids are predefined: -\verb'GrB_LOR_MONOID_BOOL', \verb'GrB_LAND_MONOID_BOOL', -\verb'GrB_LXOR_MONOID_BOOL', and \verb'GrB_LXNOR_MONOID_BOOL'. - -% 13 ANY -% 4 complex (PLUS, TIMES) -% 16 bitwise -% 33 total -These all appear in SuiteSparse:GraphBLAS, which adds 33 additional predefined -\verb'GxB*' monoids, with the naming convention \verb'GxB_op_type_MONOID'. The -\verb'ANY' operator can be used for all 13 types (including complex). The -\verb'PLUS' and \verb'TIMES' operators are provided for both complex types, for -4 additional complex monoids. Sixteen monoids are predefined for four bitwise -operators (\verb'BOR', \verb'BAND', \verb'BXOR', and \verb'BNXOR'), each with -four unsigned integer types (\verb'UINT8', \verb'UINT16', \verb'UINT32', and -\verb'UINT64'). - -{\bf NOTE:} -The \verb'GrB_TIMES_FP*' operators do not have a terminal value of zero, since -they comply with the IEEE 754 standard, and \verb'0*NaN' is not zero, but -\verb'NaN'. Technically, their terminal value is \verb'NaN', but this value is -rare in practice and thus the terminal condition is not worth checking. - -The next sections define the following methods for the \verb'GrB_Monoid' -object: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Monoid_new' & create a user-defined monoid & \ref{monoid_new} \\ -\verb'GrB_Monoid_wait' & wait for a user-defined monoid & \ref{monoid_wait} \\ -\verb'GxB_Monoid_terminal_new' & create a monoid that has a terminal value & \ref{monoid_terminal_new} \\ -\verb'GrB_get' & get properties of a monoid & \ref{get_set_monoid} \\ -\verb'GrB_set' & set the monoid name & \ref{get_set_monoid} \\ -\verb'GrB_Monoid_free' & free a monoid & \ref{monoid_free} \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Monoid\_new:} create a monoid} -%------------------------------------------------------------------------------- -\label{monoid_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Monoid_new // create a monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity // identity value of the monoid -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Monoid_new' creates a monoid. The operator, \verb'op', must be an -associative binary operator, either built-in or user-defined. - -In the definition above, \verb'' is a place-holder for the specific type -of the monoid. For built-in types, it is the C type corresponding to the -built-in type (see Section~\ref{type}), such as \verb'bool', \verb'int32_t', -\verb'float', or \verb'double'. In this case, \verb'identity' is a -scalar value of the particular type, not a pointer. For -user-defined types, \verb'' is \verb'void *', and thus \verb'identity' is -a not a scalar itself but a \verb'void *' pointer to a memory location -containing the identity value of the user-defined operator, \verb'op'. - -If \verb'op' is a built-in operator with a known identity value, then the -\verb'identity' parameter is ignored, and its known identity value is used -instead. -% -The \verb'op' cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Monoid\_wait:} wait for a monoid} -%------------------------------------------------------------------------------- -\label{monoid_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a user-defined monoid -( - GrB_Monoid monoid, // monoid to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined monoid, a GraphBLAS library may choose to exploit -non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS -currently does nothing except to ensure that the \verb'monoid' is valid. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Monoid\_terminal\_new:} create a monoid with terminal} -%------------------------------------------------------------------------------- -\label{monoid_terminal_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Monoid_terminal_new // create a monoid that has a terminal value -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity, // identity value of the monoid - terminal // terminal value of the monoid -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Monoid_terminal_new' is identical to \verb'GrB_Monoid_new', except -that it allows for the specification of a {\em terminal value}. The -\verb'' of the terminal value is the same as the \verb'identity' -parameter; see Section~\ref{monoid_new} for details. - -The terminal value of a monoid is the value $z$ for which $z=f(z,y)$ for any -$y$, where $z=f(x,y)$ is the binary operator of the monoid. This is also -called the {\em annihilator}, but the term {\em terminal value} is used here. -This is because all annihilators are terminal values, but a terminal value need -not be an annihilator, as described in the \verb'MIN' example below. - -If the terminal value is encountered during computation, the rest of the -computations can be skipped. This can greatly improve the performance of -\verb'GrB_reduce', and matrix multiply in specific cases (when a dot product -method is used). For example, using \verb'GrB_reduce' to compute the sum of -all entries in a \verb'GrB_FP32' matrix with $e$ entries takes $O(e)$ time, -since a monoid based on \verb'GrB_PLUS_FP32' has no terminal value. By -contrast, a reduction using \verb'GrB_LOR' on a \verb'GrB_BOOL' matrix can take -as little as $O(1)$ time, if a \verb'true' value is found in the matrix very -early. - -Monoids based on the built-in \verb'GrB_MIN_*' and \verb'GrB_MAX_*' operators -(for any type), the boolean \verb'GrB_LOR', and the boolean \verb'GrB_LAND' -operators all have terminal values. For example, the identity value of -\verb'GrB_LOR' is \verb'false', and its terminal value is \verb'true'. When -computing a reduction of a set of boolean values to a single value, once a -\verb'true' is seen, the computation can exit early since the result is now -known. - -If \verb'op' is a built-in operator with known identity and terminal values, -then the \verb'identity' and \verb'terminal' parameters are ignored, and its -known identity and terminal values are used instead. - -There may be cases in which the user application needs to use a non-standard -terminal value for a built-in operator. For example, suppose the matrix has -type \verb'GrB_FP32', but all values in the matrix are known to be -non-negative. The annihilator value of \verb'MIN' is \verb'-INFINITY', but -this will never be seen. However, the computation could terminate when -finding the value zero. This is an example of using a terminal value that is -not actually an annihilator, but it functions like one since the monoid will -operate strictly on non-negative values. - -In this case, a monoid created with \verb'GrB_MIN_FP32' will not terminate -early, because the identity and terminal inputs are ignored when using -\verb'GrB_Monoid_new' with a built-in operator as its input. -To create a monoid that can terminate early, create a user-defined operator -that computes the same thing as \verb'GrB_MIN_FP32', and then create a monoid -based on this user-defined operator with a terminal value of zero and an -identity of \verb'+INFINITY'. -% -The \verb'op' cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Monoid\_free:} free a monoid} -%------------------------------------------------------------------------------- -\label{monoid_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-created monoid -( - GrB_Monoid *monoid // handle of monoid to free -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Monoid_frees' frees a monoid. Either usage: - - {\small - \begin{verbatim} - GrB_Monoid_free (&monoid) ; - GrB_free (&monoid) ; \end{verbatim}} - -\noindent -frees the \verb'monoid' and sets \verb'monoid' to \verb'NULL'. It safely does -nothing if passed a \verb'NULL' handle, or if \verb'monoid == NULL' on input. -It does nothing at all if passed a built-in monoid. - -\newpage -%=============================================================================== -\subsection{GraphBLAS semirings: {\sf GrB\_Semiring}} %========================= -%=============================================================================== -\label{semiring} - -A {\em semiring} defines all the operators required to define the -multiplication of two sparse matrices in GraphBLAS, ${\bf C=AB}$. The ``add'' -operator is a commutative and associative monoid, and the binary ``multiply'' -operator defines a function $z=fmult(x,y)$ where the type of $z$ matches the -exactly with the monoid type. SuiteSparse:GraphBLAS includes 1,473 predefined -built-in semirings. The next sections define the following methods for the -\verb'GrB_Semiring' object: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Semiring_new' & create a user-defined semiring & \ref{semiring_new} \\ -\verb'GrB_Semiring_wait' & wait for a user-defined semiring & \ref{semiring_wait} \\ -\verb'GrB_get' & get properties of a semiring & \ref{get_set_semiring} \\ -\verb'GrB_set' & set the semiring name & \ref{get_set_semiring} \\ -\verb'GrB_Semiring_free' & free a semiring & \ref{semiring_free} \\ -\hline -\end{tabular} -} - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Semiring\_new:} create a semiring} -%------------------------------------------------------------------------------- -\label{semiring_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Semiring_new // create a semiring -( - GrB_Semiring *semiring, // handle of semiring to create - GrB_Monoid add, // add monoid of the semiring - GrB_BinaryOp multiply // multiply operator of the semiring -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Semiring_new' creates a new semiring, with \verb'add' being the -additive monoid and \verb'multiply' being the binary ``multiply'' operator. In -addition to the standard error cases, the function returns -\verb'GrB_DOMAIN_MISMATCH' if the output (\verb'ztype') domain of -\verb'multiply' does not match the domain of the \verb'add' monoid. - -The v2.0 C API Specification for GraphBLAS includes 124 predefined semirings, -with names of the form \verb'GrB_add_mult_SEMIRING_type', where \verb'add' is -the operator of the additive monoid, \verb'mult' is the multiply operator, and -\verb'type' is the type of the input $x$ to the multiply operator, $f(x,y)$. -The name of the domain for the additive monoid does not appear in the name, -since it always matches the type of the output of the \verb'mult' operator. -Twelve kinds of \verb'GrB*' semirings are available for all 10 real, non-boolean types: - \verb'PLUS_TIMES', \verb'PLUS_MIN', - \verb'MIN_PLUS', \verb'MIN_TIMES', \verb'MIN_FIRST', \verb'MIN_SECOND', \verb'MIN_MAX', - \verb'MAX_PLUS', \verb'MAX_TIMES', \verb'MAX_FIRST', \verb'MAX_SECOND', and \verb'MAX_MIN'. -Four semirings are for boolean types only: - \verb'LOR_LAND', \verb'LAND_LOR', \verb'LXOR_LAND', and \verb'LXNOR_LOR'. - -SuiteSparse:GraphBLAS pre-defines 1,553 semirings from built-in types and -operators, listed below. The naming convention is \verb'GxB_add_mult_type'. -The 124 \verb'GrB*' semirings are a subset of the list below, included with two -names: \verb'GrB*' and \verb'GxB*'. If the \verb'GrB*' name is provided, its -use is preferred, for portability to other GraphBLAS implementations. - -\vspace{-0.05in} -\begin{itemize} -\item 1000 semirings with a multiplier $T \times T \rightarrow T$ where $T$ is - any of the 10 non-Boolean, real types, from the complete cross product of: - - \vspace{-0.05in} - \begin{itemize} - \item 5 monoids (\verb'MIN', \verb'MAX', \verb'PLUS', \verb'TIMES', \verb'ANY') - \item 20 multiply operators - (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), - \verb'MIN', \verb'MAX', - \verb'PLUS', \verb'MINUS', \verb'RMINUS', \verb'TIMES', \verb'DIV', \verb'RDIV', - \verb'ISEQ', \verb'ISNE', \verb'ISGT', - \verb'ISLT', \verb'ISGE', \verb'ISLE', - \verb'LOR', \verb'LAND', \verb'LXOR'). - \item 10 non-Boolean types, $T$ - \end{itemize} - -\item 300 semirings with a comparator $T \times T \rightarrow$ - \verb'bool', where $T$ is non-Boolean and real, from the complete cross product of: - - \vspace{-0.05in} - \begin{itemize} - \item 5 Boolean monoids - (\verb'LAND', \verb'LOR', \verb'LXOR', \verb'EQ', \verb'ANY') - \item 6 multiply operators - (\verb'EQ', \verb'NE', \verb'GT', \verb'LT', \verb'GE', \verb'LE') - \item 10 non-Boolean types, $T$ - \end{itemize} - -\item 55 semirings with purely Boolean types, \verb'bool' $\times$ \verb'bool' - $\rightarrow$ \verb'bool', from the complete cross product of: - - \vspace{-0.05in} - \begin{itemize} - \item 5 Boolean monoids - (\verb'LAND', \verb'LOR', \verb'LXOR', \verb'EQ', \verb'ANY') - \item 11 multiply operators - (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), - \verb'LOR', \verb'LAND', \verb'LXOR', - \verb'EQ', \verb'GT', \verb'LT', \verb'GE', \verb'LE') - \end{itemize} - -\item 54 complex semirings, $Z \times Z \rightarrow Z$ where $Z$ is - \verb'GxB_FC32' (single precision complex) or - \verb'GxB_FC64' (double precision complex): - - \vspace{-0.05in} - \begin{itemize} - \item 3 complex monoids (\verb'PLUS', \verb'TIMES', \verb'ANY') - \item 9 complex multiply operators - (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), - \verb'PLUS', \verb'MINUS', - \verb'TIMES', \verb'DIV', \verb'RDIV', \verb'RMINUS') - \item 2 complex types, $Z$ - \end{itemize} - -\item 64 bitwise semirings, $U \times U \rightarrow U$ where $U$ is - an unsigned integer. - - \vspace{-0.05in} - \begin{itemize} - \item 4 bitwise monoids (\verb'BOR', \verb'BAND', \verb'BXOR', \verb'BXNOR') - \item 4 bitwise multiply operators (the same list) - \item 4 unsigned integer types - \end{itemize} - -\item 80 index-based semirings, $X \times X \rightarrow N$ where $N$ is - \verb'INT32' or \verb'INT64': - - \vspace{-0.05in} - \begin{itemize} - \item 5 monoids (\verb'MIN', \verb'MAX', \verb'PLUS', \verb'TIMES', \verb'ANY') - \item 8 index-based operators - (\verb'FIRSTI', \verb'FIRSTI1', \verb'FIRSTJ', \verb'FIRSTJ1', - \verb'SECONDI', \verb'SECONDI1', \verb'SECONDJ', \verb'SECONDJ1') - \item 2 integer types (\verb'INT32', \verb'INT64') - \end{itemize} - -\end{itemize} -% -The \verb'multiply' operator can be any a binary operator, including one -created by \verb'GxB_BinaryOp_new_IndexOp'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Semiring\_wait:} wait for a semiring} -%------------------------------------------------------------------------------- -\label{semiring_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a user-defined semiring -( - GrB_Semiring semiring, // semiring to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined semiring, a GraphBLAS library may choose to -exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS currently does nothing except to ensure that the -\verb'semiring' is valid. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Semiring\_free:} free a semiring} -%------------------------------------------------------------------------------- -\label{semiring_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a user-created semiring -( - GrB_Semiring *semiring // handle of semiring to free -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Semiring_free' frees a semiring. Either usage: - - {\small - \begin{verbatim} - GrB_Semiring_free (&semiring) ; - GrB_free (&semiring) ; \end{verbatim}} - -\noindent -frees the \verb'semiring' and sets \verb'semiring' to \verb'NULL'. It safely -does nothing if passed a \verb'NULL' handle, or if \verb'semiring == NULL' on -input. It does nothing at all if passed a built-in semiring. - -\newpage -%=============================================================================== -\subsection{GraphBLAS scalars: {\sf GrB\_Scalar}} %============================= -%=============================================================================== -\label{scalar} - -This section describes a set of methods that create, modify, query, -and destroy a GraphBLAS scalar, \verb'GrB_Scalar': - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Scalar_new' & create a scalar & \ref{scalar_new} \\ -\verb'GrB_Scalar_wait' & wait for a scalar & \ref{scalar_wait} \\ -\verb'GrB_Scalar_dup' & copy a scalar & \ref{scalar_dup} \\ -\verb'GrB_Scalar_clear' & clear a scalar of its entry & \ref{scalar_clear} \\ -\verb'GrB_Scalar_nvals' & return number of entries in a scalar & \ref{scalar_nvals} \\ -\verb'GrB_get' & get properties of a scalar & \ref{get_set_scalar} \\ -\verb'GrB_set' & set properties of a scalar & \ref{get_set_scalar} \\ -\verb'GrB_Scalar_setElement' & set the single entry of a scalar & \ref{scalar_setElement} \\ -\verb'GrB_Scalar_extractElement' & get the single entry from a scalar & \ref{scalar_extractElement} \\ -\verb'GxB_Scalar_memoryUsage' & memory used by a scalar & \ref{scalar_memusage} \\ -\verb'GrB_Scalar_free' & free a scalar & \ref{scalar_free} \\ -\hline -\end{tabular} -} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_new:} create a scalar} -%------------------------------------------------------------------------------- -\label{scalar_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry -( - GrB_Scalar *s, // handle of GrB_Scalar to create - GrB_Type type // type of GrB_Scalar to create -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Scalar_new' creates a new scalar with no -entry in it, of the given type. This is analogous to MATLAB/Octave statement -\verb's = sparse(0)', except that GraphBLAS can create scalars any -type. The pattern of the new scalar is empty. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_wait:} wait for a scalar} -%------------------------------------------------------------------------------- -\label{scalar_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a scalar -( - GrB_Scalar s, // scalar to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -In non-blocking mode, the computations for a \verb'GrB_Scalar' may be delayed. -In this case, the scalar is not yet safe to use by multiple independent user -threads. A user application may force completion of a scalar \verb's' via -\verb'GrB_Scalar_wait(&s)' (in v5.2.0), or -\verb'GrB_Scalar_wait(s,mode)' (in v6.0.0). -With a \verb'mode' of \verb'GrB_MATERIALIZE', -all pending computations are finished, and different user threads may -simultaneously call GraphBLAS operations that use the scalar \verb's' as an -input parameter. -See Section~\ref{omp_parallelism} -if GraphBLAS is compiled without OpenMP. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_dup:} copy a scalar} -%------------------------------------------------------------------------------- -\label{scalar_dup} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar -( - GrB_Scalar *s, // handle of output GrB_Scalar to create - const GrB_Scalar t // input GrB_Scalar to copy -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Scalar_dup' makes a deep copy of a scalar. -In GraphBLAS, it is possible, and valid, to write the following: - - {\footnotesize - \begin{verbatim} - GrB_Scalar t, s ; - GrB_Scalar_new (&t, GrB_FP64) ; - s = t ; // s is a shallow copy of t \end{verbatim}} - -Then \verb's' and \verb't' can be used interchangeably. However, only a pointer -reference is made, and modifying one of them modifies both, and freeing one of -them leaves the other as a dangling handle that should not be used. -If two different scalars are needed, then this should be used instead: - - {\footnotesize - \begin{verbatim} - GrB_Scalar t, s ; - GrB_Scalar_new (&t, GrB_FP64) ; - GrB_Scalar_dup (&s, t) ; // like s = t, but making a deep copy \end{verbatim}} - -Then \verb's' and \verb't' are two different scalars that currently have -the same value, but they do not depend on each other. Modifying one has no -effect on the other. -The \verb'GrB_NAME' is copied into the new scalar. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_clear:} clear a scalar of its entry} -%------------------------------------------------------------------------------- -\label{scalar_clear} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry -( // type remains unchanged. - GrB_Scalar s // GrB_Scalar to clear -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Scalar_clear' clears the entry from a scalar. The pattern of -\verb's' is empty, just as if it were created fresh with \verb'GrB_Scalar_new'. -Analogous with \verb's = sparse (0)' in MATLAB/Octave. The type of \verb's' does not -change. Any pending updates to the scalar are discarded. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_nvals:} return the number of entries in a scalar} -%------------------------------------------------------------------------------- -\label{scalar_nvals} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar -( - GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) - const GrB_Scalar s // GrB_Scalar to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Scalar_nvals' returns the number of entries in a scalar, which -is either 0 or 1. Roughly analogous to \verb'nvals = nnz(s)' in MATLAB/Octave, -except that the implicit value in GraphBLAS need not be zero and \verb'nnz' -(short for ``number of nonzeros'') in MATLAB is better described as ``number of -entries'' in GraphBLAS. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_setElement:} set the single entry of a scalar} -%------------------------------------------------------------------------------- -\label{scalar_setElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_setElement // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - x // user scalar to assign to s -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Scalar_setElement' sets the single entry in a scalar, like -\verb's = sparse(x)' in MATLAB notation. For further details of this function, -see \verb'GrB_Matrix_setElement' in Section~\ref{matrix_setElement}. -If an error occurs, \verb'GrB_error(&err,s)' returns details about the error. -The scalar \verb'x' can be any non-opaque C scalar corresponding to -a built-in type, or \verb'void *' for a user-defined type. It cannot be -a \verb'GrB_Scalar'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_extractElement:} get the single entry from a scalar} -%------------------------------------------------------------------------------- -\label{scalar_extractElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Scalar_extractElement // x = s -( - *x, // user scalar extracted - const GrB_Scalar s // GrB_Sclar to extract an entry from -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Scalar_extractElement' extracts the single entry from a sparse -scalar, like \verb'x = full(s)' in MATLAB. Further details of this method are -discussed in Section~\ref{matrix_extractElement}, which discusses -\verb'GrB_Matrix_extractElement'. {\bf NOTE: } if no entry is present in the -scalar \verb's', then \verb'x' is not modified, and the return value of -\verb'GrB_Scalar_extractElement' is \verb'GrB_NO_VALUE'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Scalar\_memoryUsage:} memory used by a scalar} -%------------------------------------------------------------------------------- -\label{scalar_memusage} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar -( - size_t *size, // # of bytes used by the scalar s - const GrB_Scalar s // GrB_Scalar to query -) ; -\end{verbatim} } \end{mdframed} - -Returns the memory space required for a scalar, in bytes. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Scalar\_free:} free a scalar} -%------------------------------------------------------------------------------- -\label{scalar_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a GrB_Scalar -( - GrB_Scalar *s // handle of GrB_Scalar to free -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Scalar_free' frees a scalar. Either usage: - - {\small - \begin{verbatim} - GrB_Scalar_free (&s) ; - GrB_free (&s) ; \end{verbatim}} - -\noindent -frees the scalar \verb's' and sets \verb's' to \verb'NULL'. It safely -does nothing if passed a \verb'NULL' handle, or if \verb's == NULL' on input. -Any pending updates to the scalar are abandoned. - -\newpage -%=============================================================================== -\subsection{GraphBLAS vectors: {\sf GrB\_Vector}} %============================= -%=============================================================================== -\label{vector} - -This section describes a set of methods that create, modify, query, -and destroy a GraphBLAS sparse vector, \verb'GrB_Vector': - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Vector_new' & create a vector & \ref{vector_new} \\ -\verb'GrB_Vector_wait' & wait for a vector & \ref{vector_wait} \\ -\verb'GrB_Vector_dup' & copy a vector & \ref{vector_dup} \\ -\verb'GrB_Vector_clear' & clear a vector of all entries & \ref{vector_clear} \\ -\verb'GrB_Vector_size' & size of a vector & \ref{vector_size} \\ -\verb'GrB_Vector_nvals' & number of entries in a vector & \ref{vector_nvals} \\ -\verb'GrB_get' & get properties of a vector & \ref{get_set_vector} \\ -\verb'GrB_set' & set properties of a vector & \ref{get_set_vector} \\ -\verb'GrB_Vector_build' & build a vector from tuples & \ref{vector_build} \\ -\verb'GxB_Vector_build_Scalar' & build a vector from tuples & \ref{vector_build_Scalar} \\ -\verb'GrB_Vector_setElement' & add an entry to a vector & \ref{vector_setElement} \\ -\verb'GrB_Vector_extractElement' & get an entry from a vector & \ref{vector_extractElement} \\ -\verb'GxB_Vector_isStoredElement'& check if entry present in vector & \ref{vector_isStoredElement} \\ -\verb'GrB_Vector_removeElement' & remove an entry from a vector & \ref{vector_removeElement} \\ -\verb'GrB_Vector_extractTuples' & get all entries from a vector & \ref{vector_extractTuples} \\ -\verb'GrB_Vector_resize' & resize a vector & \ref{vector_resize} \\ -\verb'GxB_Vector_diag' & extract a diagonal from a matrix & \ref{vector_diag} \\ -\verb'GxB_Vector_iso' & query iso status & \ref{vector_iso} \\ -\verb'GxB_Vector_memoryUsage' & memory used by a vector & \ref{vector_memusage} \\ -\verb'GrB_Vector_free' & free a vector & \ref{vector_free} \\ -\hline -\hline -% NOTE: GrB_Vector_serialize / deserialize does not appear in the 2.0 C API. -% \verb'GrB_Vector_serializeSize' & return size of serialized vector & \ref{vector_serialize_size} \\ -% \verb'GrB_Vector_serialize' & serialize a vector & \ref{vector_serialize} \\ -\verb'GxB_Vector_serialize' & serialize a vector & \ref{vector_serialize_GxB} \\ -% \verb'GrB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize} \\ -\verb'GxB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize_GxB} \\ -\hline -\hline -\verb'GxB_Vector_pack_CSC' & pack in CSC format & \ref{vector_pack_csc} \\ -\verb'GxB_Vector_unpack_CSC' & unpack in CSC format & \ref{vector_unpack_csc} \\ -\hline -\verb'GxB_Vector_pack_Bitmap' & pack in bitmap format & \ref{vector_pack_bitmap} \\ -\verb'GxB_Vector_unpack_Bitmap' & unpack in bitmap format & \ref{vector_unpack_bitmap} \\ -\hline -\verb'GxB_Vector_pack_Full' & pack in full format & \ref{vector_pack_full} \\ -\verb'GxB_Vector_unpack_Full' & unpack in full format & \ref{vector_unpack_full} \\ -\hline -\hline -\verb'GxB_Vector_sort' & sort a vector & \ref{vector_sort} \\ -\end{tabular} -} - -\vspace{0.2in} -Refer to -Section~\ref{serialize_deserialize} for serialization/deserialization methods, -Section~\ref{pack_unpack} for pack/unpack methods, -and to -Section~\ref{sorting_methods} for sorting methods. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_new:} create a vector} -%------------------------------------------------------------------------------- -\label{vector_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_new // create a new vector with no entries -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n // vector dimension is n-by-1 -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_new' creates a new \verb'n'-by-\verb'1' sparse vector with no -entries in it, of the given type. This is analogous to MATLAB/Octave statement -\verb'v = sparse (n,1)', except that GraphBLAS can create sparse vectors any -type. The pattern of the new vector is empty. - -\begin{alert} -{\bf SPEC:} \verb'n' may be zero, as an extension to the specification. -\end{alert} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_wait:} wait for a vector} -%------------------------------------------------------------------------------- -\label{vector_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a vector -( - GrB_Vector w, // vector to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -In non-blocking mode, the computations for a \verb'GrB_Vector' may be delayed. -In this case, the vector is not yet safe to use by multiple independent user -threads. A user application may force completion of a vector \verb'w' via -\verb'GrB_Vector_wait(&w)' (in v5.2.0), or -\verb'GrB_Vector_wait(w,mode)' (in v6.0.0). -With a \verb'mode' of \verb'GrB_MATERIALIZE', -all pending computations are finished, and different user threads may -simultaneously call GraphBLAS operations that use the vector \verb'w' as an -input parameter. -See Section~\ref{omp_parallelism} -if GraphBLAS is compiled without OpenMP. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_dup:} copy a vector} -%------------------------------------------------------------------------------- -\label{vector_dup} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_dup // make an exact copy of a vector -( - GrB_Vector *w, // handle of output vector to create - const GrB_Vector u // input vector to copy -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_dup' makes a deep copy of a sparse vector. -In GraphBLAS, it is possible, and valid, to write the following: - - {\footnotesize - \begin{verbatim} - GrB_Vector u, w ; - GrB_Vector_new (&u, GrB_FP64, n) ; - w = u ; // w is a shallow copy of u \end{verbatim}} - -Then \verb'w' and \verb'u' can be used interchangeably. However, only a pointer -reference is made, and modifying one of them modifies both, and freeing one of -them leaves the other as a dangling handle that should not be used. -If two different vectors are needed, then this should be used instead: - - {\footnotesize - \begin{verbatim} - GrB_Vector u, w ; - GrB_Vector_new (&u, GrB_FP64, n) ; - GrB_Vector_dup (&w, u) ; // like w = u, but making a deep copy \end{verbatim}} - -Then \verb'w' and \verb'u' are two different vectors that currently have the -same set of values, but they do not depend on each other. Modifying one has -no effect on the other. -The \verb'GrB_NAME' is copied into the new vector. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_clear:} clear a vector of all entries} -%------------------------------------------------------------------------------- -\label{vector_clear} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_clear // clear a vector of all entries; -( // type and dimension remain unchanged. - GrB_Vector v // vector to clear -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_clear' clears all entries from a vector. All values -\verb'v(i)' are now equal to the implicit value, depending on what semiring -ring is used to perform computations on the vector. The pattern of \verb'v' is -empty, just as if it were created fresh with \verb'GrB_Vector_new'. Analogous -with \verb'v (:) = sparse(0)' in MATLAB. The type and dimension of \verb'v' do -not change. Any pending updates to the vector are discarded. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_size:} return the size of a vector} -%------------------------------------------------------------------------------- -\label{vector_size} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_size // get the dimension of a vector -( - GrB_Index *n, // vector dimension is n-by-1 - const GrB_Vector v // vector to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_size' returns the size of a vector (the number of rows). -Analogous to \verb'n = length(v)' or \verb'n = size(v,1)' in MATLAB. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_nvals:} return the number of entries in a vector} -%------------------------------------------------------------------------------- -\label{vector_nvals} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_nvals // get the number of entries in a vector -( - GrB_Index *nvals, // vector has nvals entries - const GrB_Vector v // vector to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_nvals' returns the number of entries in a vector. Roughly -analogous to \verb'nvals = nnz(v)' in MATLAB, except that the implicit value in -GraphBLAS need not be zero and \verb'nnz' (short for ``number of nonzeros'') in -MATLAB is better described as ``number of entries'' in GraphBLAS. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_build:} build a vector from a set of tuples} -%------------------------------------------------------------------------------- -\label{vector_build} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_build // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *I, // array of row indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_build' constructs a sparse vector \verb'w' from a set of -tuples, \verb'I' and \verb'X', each of length \verb'nvals'. The vector -\verb'w' must have already been initialized with \verb'GrB_Vector_new', and it -must have no entries in it before calling \verb'GrB_Vector_build'. -This function is just like \verb'GrB_Matrix_build' (see -Section~\ref{matrix_build}), except that it builds a sparse vector instead of a -sparse matrix. For a description of what \verb'GrB_Vector_build' does, refer -to \verb'GrB_Matrix_build'. For a vector, the list of column indices \verb'J' -in \verb'GrB_Matrix_build' is implicitly a vector of length \verb'nvals' all -equal to zero. Otherwise the methods are identical. - -If \verb'dup' is \verb'NULL', any duplicates result in an error. -If \verb'dup' is the special binary operator \verb'GxB_IGNORE_DUP', then -any duplicates are ignored. If duplicates appear, the last one in the -list of tuples is taken and the prior ones ignored. This is not an error. -% -The \verb'dup' operator cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\begin{alert} -{\bf SPEC:} Results are defined even if \verb'dup' is non-associative and/or -non-commutative. -\end{alert} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_build\_Scalar:} build a vector from a set of tuples} -%------------------------------------------------------------------------------- -\label{vector_build_Scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *I, // array of row indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Vector_build_Scalar' constructs a sparse vector \verb'w' from a set -of tuples defined by the index array \verb'I' of length \verb'nvals', and a -scalar. The scalar is the value of all of the tuples. Unlike -\verb'GrB_Vector_build', there is no \verb'dup' operator to handle duplicate -entries. Instead, any duplicates are silently ignored (if the number of -duplicates is desired, simply compare the input \verb'nvals' with the value -returned by \verb'GrB_Vector_nvals' after the vector is constructed). All -entries in the sparsity pattern of \verb'w' are identical, and equal to the -input scalar value. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_setElement:} add an entry to a vector} -%------------------------------------------------------------------------------- -\label{vector_setElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_setElement // w(i) = x -( - GrB_Vector w, // vector to modify - x, // scalar to assign to w(i) - GrB_Index i // index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_setElement' sets a single entry in a vector, \verb'w(i) = x'. -The operation is exactly like setting a single entry in an \verb'n'-by-1 -matrix, \verb'A(i,0) = x', where the column index for a vector is implicitly -\verb'j=0'. For further details of this function, see -\verb'GrB_Matrix_setElement' in Section~\ref{matrix_setElement}. -If an error occurs, \verb'GrB_error(&err,w)' returns details about the error. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_extractElement:} get an entry from a vector} -%------------------------------------------------------------------------------- -\label{vector_extractElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_extractElement // x = v(i) -( - *x, // scalar extracted (non-opaque, C scalar) - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // index -) ; - -GrB_Info GrB_Vector_extractElement // x = v(i) -( - GrB_Scalar x, // GrB_Scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_extractElement' extracts a single entry from a vector, -\verb'x = v(i)'. The method is identical to extracting a single entry -\verb'x = A(i,0)' from an \verb'n'-by-1 matrix; see -Section~\ref{matrix_extractElement}. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_isStoredElement:} check if entry present in vector} -%------------------------------------------------------------------------------- -\label{vector_isStoredElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_isStoredElement -( - const GrB_Vector v, // check presence of entry v(i) - GrB_Index i // index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Vector_isStoredElement' checks if a single entry \verb'v(i)' -is present, returning \verb'GrB_SUCCESS' if the entry is present or -\verb'GrB_NO_VALUE' otherwise. The value of \verb'v(i)' is not returned. -See also Section~\ref{matrix_isStoredElement}. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_removeElement:} remove an entry from a vector} -%------------------------------------------------------------------------------- -\label{vector_removeElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_removeElement -( - GrB_Vector w, // vector to remove an entry from - GrB_Index i // index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_removeElement' removes a single entry \verb'w(i)' from a vector. -If no entry is present at \verb'w(i)', then the vector is not modified. -If an error occurs, \verb'GrB_error(&err,w)' returns details about the error. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_extractTuples:} get all entries from a vector} -%------------------------------------------------------------------------------- -\label{vector_extractTuples} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) -( - GrB_Index *I, // array for returning row indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_extractTuples' extracts all tuples from a sparse vector, -analogous to \verb'[I,~,X] = find(v)' in MATLAB/Octave. This function is -identical to its \verb'GrB_Matrix_extractTuples' counterpart, except that the -array of column indices \verb'J' does not appear in this function. Refer to -Section~\ref{matrix_extractTuples} where further details of this function are -described. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_resize:} resize a vector} -%------------------------------------------------------------------------------- -\label{vector_resize} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Vector_resize // change the size of a vector -( - GrB_Vector u, // vector to modify - GrB_Index nrows_new // new number of rows in vector -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_resize' changes the size of a vector. If the dimension -decreases, entries that fall outside the resized vector are deleted. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_diag:} extract a diagonal from a matrix} -%------------------------------------------------------------------------------- -\label{vector_diag} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_diag // extract a diagonal from a matrix -( - GrB_Vector v, // output vector - const GrB_Matrix A, // input matrix - int64_t k, - const GrB_Descriptor desc // unused, except threading control -) ; -\end{verbatim} } \end{mdframed} - - -\verb'GxB_Vector_diag' extracts a vector \verb'v' from an input matrix -\verb'A', which may be rectangular. If \verb'k' = 0, the main diagonal of -\verb'A' is extracted; \verb'k' $> 0$ denotes diagonals above the main diagonal -of \verb'A', and \verb'k' $< 0$ denotes diagonals below the main diagonal of -\verb'A'. Let \verb'A' have dimension $m$-by-$n$. If \verb'k' is in the range -0 to $n-1$, then \verb'v' has length $\min(m,n-k)$. If \verb'k' is negative -and in the range -1 to $-m+1$, then \verb'v' has length $\min(m+k,n)$. If -\verb'k' is outside these ranges, \verb'v' has length 0 (this is not an error). -This function computes the same thing as the MATLAB/Octave statement -\verb'v=diag(A,k)' when \verb'A' is a matrix, except that -\verb'GxB_Vector_diag' can also do typecasting. - -The vector \verb'v' must already exist on input, and -\verb'GrB_Vector_size (&len,v)' must return \verb'len' = 0 if \verb'k' $\ge n$ -or \verb'k' $\le -m$, \verb'len' $=\min(m,n-k)$ if \verb'k' is in the range 0 -to $n-1$, and \verb'len' $=\min(m+k,n)$ if \verb'k' is in the range -1 to -$-m+1$. Any existing entries in \verb'v' are discarded. The type of \verb'v' -is preserved, so that if the type of \verb'A' and \verb'v' differ, the entries -are typecasted into the type of \verb'v'. Any settings made to \verb'v' by -\verb'GrB_set' (bitmap switch and sparsity control) are -unchanged. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_iso:} query iso status of a vector} -%------------------------------------------------------------------------------- -\label{vector_iso} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_iso // return iso status of a vector -( - bool *iso, // true if the vector is iso-valued - const GrB_Vector v // vector to query -) ; -\end{verbatim} } \end{mdframed} - -Returns the true if the vector is iso-valued, false otherwise. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_memoryUsage:} memory used by a vector} -%------------------------------------------------------------------------------- -\label{vector_memusage} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector -( - size_t *size, // # of bytes used by the vector v - const GrB_Vector v // vector to query -) ; -\end{verbatim} } \end{mdframed} - -Returns the memory space required for a vector, in bytes. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_free:} free a vector} -%------------------------------------------------------------------------------- -\label{vector_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a vector -( - GrB_Vector *v // handle of vector to free -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_free' frees a vector. Either usage: - - {\small - \begin{verbatim} - GrB_Vector_free (&v) ; - GrB_free (&v) ; \end{verbatim}} - -\noindent -frees the vector \verb'v' and sets \verb'v' to \verb'NULL'. It safely does -nothing if passed a \verb'NULL' handle, or if \verb'v == NULL' on input. Any -pending updates to the vector are abandoned. - -\newpage -%=============================================================================== -\subsection{GraphBLAS matrices: {\sf GrB\_Matrix}} %============================ -%=============================================================================== -\label{matrix} - -This section describes a set of methods that create, modify, query, -and destroy a GraphBLAS sparse matrix, \verb'GrB_Matrix': - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Matrix_new' & create a matrix & \ref{matrix_new} \\ -\verb'GrB_Matrix_wait' & wait for a matrix & \ref{matrix_wait} \\ -\verb'GrB_Matrix_dup' & copy a matrix & \ref{matrix_dup} \\ -\verb'GrB_Matrix_clear' & clear a matrix of all entries & \ref{matrix_clear} \\ -\verb'GrB_Matrix_nrows' & number of rows of a matrix & \ref{matrix_nrows} \\ -\verb'GrB_Matrix_ncols' & number of columns of a matrix & \ref{matrix_ncols} \\ -\verb'GrB_Matrix_nvals' & number of entries in a matrix & \ref{matrix_nvals} \\ -\verb'GrB_get' & get properties of a matrix & \ref{get_set_matrix} \\ -\verb'GrB_set' & set properties of a matrix & \ref{get_set_matrix} \\ -\verb'GrB_Matrix_build' & build a matrix from tuples & \ref{matrix_build} \\ -\verb'GxB_Matrix_build_Scalar' & build a matrix from tuples & \ref{matrix_build_Scalar} \\ -\verb'GrB_Matrix_setElement' & add an entry to a matrix & \ref{matrix_setElement} \\ -\verb'GrB_Matrix_extractElement'& get an entry from a matrix & \ref{matrix_extractElement} \\ -\verb'GxB_Matrix_isStoredElement'& check if entry present in matrix & \ref{matrix_isStoredElement} \\ -\verb'GrB_Matrix_removeElement' & remove an entry from a matrix & \ref{matrix_removeElement} \\ -\verb'GrB_Matrix_extractTuples' & get all entries from a matrix & \ref{matrix_extractTuples} \\ -\verb'GrB_Matrix_resize' & resize a matrix & \ref{matrix_resize} \\ -\verb'GxB_Matrix_concat' & concatenate matrices & \ref{matrix_concat} \\ -\verb'GxB_Matrix_split' & split a matrix into matrices & \ref{matrix_split} \\ -\verb'GrB_Matrix_diag' & diagonal matrix from vector & \ref{matrix_diag} \\ -\verb'GxB_Matrix_diag' & diagonal matrix from vector & \ref{matrix_diag_GxB} \\ -\verb'GxB_Matrix_iso' & query iso status & \ref{matrix_iso} \\ -\verb'GxB_Matrix_memoryUsage' & memory used by a matrix & \ref{matrix_memusage} \\ -\verb'GrB_Matrix_free' & free a matrix & \ref{matrix_free} \\ -\hline -\hline -\verb'GrB_Matrix_serializeSize' & return size of serialized matrix & \ref{matrix_serialize_size} \\ -\verb'GrB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize} \\ -\verb'GxB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize_GxB} \\ -\verb'GrB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize} \\ -\verb'GxB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize_GxB} \\ -\hline -\end{tabular} -} - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GxB_Matrix_pack_CSR' & pack CSR & \ref{matrix_pack_csr} \\ -\verb'GxB_Matrix_unpack_CSR' & unpack CSR & \ref{matrix_unpack_csr} \\ -\hline -\verb'GxB_Matrix_pack_CSC' & pack CSC & \ref{matrix_pack_csc} \\ -\verb'GxB_Matrix_unpack_CSC' & unpack CSC & \ref{matrix_unpack_csc} \\ -\hline -\verb'GxB_Matrix_pack_HyperCSR' & pack HyperCSR & \ref{matrix_pack_hypercsr} \\ -\verb'GxB_Matrix_unpack_HyperCSR' & unpack HyperCSR & \ref{matrix_unpack_hypercsr} \\ -\hline -\verb'GxB_Matrix_pack_HyperCSC' & pack HyperCSC & \ref{matrix_pack_hypercsc} \\ -\verb'GxB_Matrix_unpack_HyperCSC' & unpack HyperCSC & \ref{matrix_unpack_hypercsc} \\ -\hline -\verb'GxB_Matrix_pack_BitmapR' & pack BitmapR & \ref{matrix_pack_bitmapr} \\ -\verb'GxB_Matrix_unpack_BitmapR' & unpack BitmapR & \ref{matrix_unpack_bitmapr} \\ -\hline -\verb'GxB_Matrix_pack_BitmapC' & pack BitmapC & \ref{matrix_pack_bitmapc} \\ -\verb'GxB_Matrix_unpack_BitmapC' & unpack BitmapC & \ref{matrix_unpack_bitmapc} \\ -\hline -\verb'GxB_Matrix_pack_FullR' & pack FullR & \ref{matrix_pack_fullr} \\ -\verb'GxB_Matrix_unpack_FullR' & unpack FullR & \ref{matrix_unpack_fullr} \\ -\hline -\verb'GxB_Matrix_pack_FullC' & pack FullC & \ref{matrix_pack_fullc} \\ -\verb'GxB_Matrix_unpack_FullC' & unpack FullC & \ref{matrix_unpack_fullc} \\ -\hline -\hline -\verb'GrB_Matrix_import' & import in various formats & \ref{GrB_matrix_import} \\ -\verb'GrB_Matrix_export' & export in various formats & \ref{GrB_matrix_export} \\ -\verb'GrB_Matrix_exportSize' & array sizes for export & \ref{export_size} \\ -\verb'GrB_Matrix_exportHint' & hint best export format & \ref{export_hint} \\ -\hline -\hline -\verb'GxB_Matrix_sort' & sort a matrix & \ref{matrix_sort} \\ -\hline -\end{tabular} -} - -\vspace{0.2in} -Refer to -Section~\ref{serialize_deserialize} for serialization/deserialization methods, -Section~\ref{pack_unpack} for \verb'GxB'pack/unpack methods, -Section~\ref{GrB_import_export} for \verb'GrB' import/export methods, -and -Section~\ref{sorting_methods} for sorting methods. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_new:} create a matrix} -%------------------------------------------------------------------------------- -\label{matrix_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_new // create a new matrix with no entries -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_new' creates a new \verb'nrows'-by-\verb'ncols' sparse matrix -with no entries in it, of the given type. This is analogous to the MATLAB -statement \verb'A = sparse (nrows, ncols)', except that GraphBLAS can create -sparse matrices of any type. - -By default, matrices of size \verb'nrows-by-1' are held by column, regardless -of the global setting controlled by \verb'GrB_set (GrB_GLOBAL, ...,' \newline -\verb'GrB_STORAGE_ORIENTATION_HINT)', for any value of \verb'nrows'. Matrices -of size \verb'1-by-ncols' with \verb'ncols' not equal to 1 are held by row, -regardless of this global setting. The global setting only affects matrices -with both \verb'm > 1' and \verb'n > 1'. Empty matrices (\verb'0-by-0') are -also controlled by the global setting. - -Once a matrix is created, its format (by-row or by-column) can be arbitrarily -changed with \verb'GrB_set (A, fmt, GrB_STORAGE_ORIENTATION_HINT)' -with \verb'fmt' equal to \verb'GrB_COLMAJOR' or \verb'GrB_ROWMAJOR'. - -\begin{alert} -{\bf SPEC:} \verb'nrows' and/or \verb'ncols' may be zero, -as an extension to the specification. -\end{alert} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_wait:} wait for a matrix} -%------------------------------------------------------------------------------- -\label{matrix_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a matrix -( - GrB_Matrix C, // matrix to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -In non-blocking mode, the computations for a \verb'GrB_Matrix' may be delayed. -In this case, the matrix is not yet safe to use by multiple independent user -threads. A user application may force completion of a matrix \verb'C' via -\verb'GrB_Matrix_wait(&C)' (in v5.2.0), or -\verb'GrB_Matrix_wait(C,mode)' (in v6.0.0). -With a \verb'mode' of \verb'GrB_MATERIALIZE', -all pending computations are finished, and different user threads may -simultaneously call GraphBLAS operations that use the matrix \verb'C' as an -input parameter. -See Section~\ref{omp_parallelism} -if GraphBLAS is compiled without OpenMP. - -%------------------------------------------------------------------------------- -\newpage -\subsubsection{{\sf GrB\_Matrix\_dup:} copy a matrix} -%------------------------------------------------------------------------------- -\label{matrix_dup} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_dup // make an exact copy of a matrix -( - GrB_Matrix *C, // handle of output matrix to create - const GrB_Matrix A // input matrix to copy -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_dup' makes a deep copy of a sparse matrix. -In GraphBLAS, it is possible, and valid, to write the following: - - {\footnotesize - \begin{verbatim} - GrB_Matrix A, C ; - GrB_Matrix_new (&A, GrB_FP64, n) ; - C = A ; // C is a shallow copy of A \end{verbatim}} - -Then \verb'C' and \verb'A' can be used interchangeably. However, only a -pointer reference is made, and modifying one of them modifies both, and freeing -one of them leaves the other as a dangling handle that should not be used. If -two different matrices are needed, then this should be used instead: - - {\footnotesize - \begin{verbatim} - GrB_Matrix A, C ; - GrB_Matrix_new (&A, GrB_FP64, n) ; - GrB_Matrix_dup (&C, A) ; // like C = A, but making a deep copy \end{verbatim}} - -Then \verb'C' and \verb'A' are two different matrices that currently have the -same set of values, but they do not depend on each other. Modifying one has -no effect on the other. -The \verb'GrB_NAME' is copied into the new matrix. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_clear:} clear a matrix of all entries} -%------------------------------------------------------------------------------- -\label{matrix_clear} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_clear // clear a matrix of all entries; -( // type and dimensions remain unchanged - GrB_Matrix A // matrix to clear -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_clear' clears all entries from a matrix. All values -\verb'A(i,j)' are now equal to the implicit value, depending on what semiring -ring is used to perform computations on the matrix. The pattern of \verb'A' is -empty, just as if it were created fresh with \verb'GrB_Matrix_new'. Analogous -with \verb'A (:,:) = 0' in MATLAB. The type and dimensions of \verb'A' do not -change. Any pending updates to the matrix are discarded. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_nrows:} return the number of rows of a matrix} -%------------------------------------------------------------------------------- -\label{matrix_nrows} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix -( - GrB_Index *nrows, // matrix has nrows rows - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_nrows' returns the number of rows of a matrix -(\verb'nrows=size(A,1)' in MATLAB). - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_ncols:} return the number of columns of a matrix} -%------------------------------------------------------------------------------- -\label{matrix_ncols} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix -( - GrB_Index *ncols, // matrix has ncols columns - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Matrix_ncols' returns the number of columns of a matrix -(\verb'ncols=size(A,2)' in MATLAB). - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_nvals:} return the number of entries in a matrix} -%------------------------------------------------------------------------------- -\label{matrix_nvals} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix -( - GrB_Index *nvals, // matrix has nvals entries - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_nvals' returns the number of entries in a matrix. Roughly -analogous to \verb'nvals = nnz(A)' in MATLAB, except that the implicit value in -GraphBLAS need not be zero and \verb'nnz' (short for ``number of nonzeros'') in -MATLAB is better described as ``number of entries'' in GraphBLAS. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_build:} build a matrix from a set of tuples} -%------------------------------------------------------------------------------- -\label{matrix_build} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_build // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *I, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_build' constructs a sparse matrix \verb'C' from a set of -tuples, \verb'I', \verb'J', and \verb'X', each of length \verb'nvals'. The -matrix \verb'C' must have already been initialized with \verb'GrB_Matrix_new', -and it must have no entries in it before calling \verb'GrB_Matrix_build'. Thus -the dimensions and type of \verb'C' are not changed by this function, but are -inherited from the prior call to \verb'GrB_Matrix_new' or -\verb'GrB_matrix_dup'. - -An error is returned (\verb'GrB_INDEX_OUT_OF_BOUNDS') if any row index in -\verb'I' is greater than or equal to the number of rows of \verb'C', or if any -column index in \verb'J' is greater than or equal to the number of columns of -\verb'C' - -Any duplicate entries with identical indices are assembled using the binary -\verb'dup' operator provided on input. All three types (\verb'x', \verb'y', -\verb'z' for \verb'z=dup(x,y)') must be identical. The types of \verb'dup', -\verb'C' and \verb'X' must all be compatible. See Section~\ref{typecasting} -regarding typecasting and compatibility. The values in \verb'X' are -typecasted, if needed, into the type of \verb'dup'. Duplicates are then -assembled into a matrix \verb'T' of the same type as \verb'dup', using -\verb'T(i,j) = dup (T (i,j), X (k))'. After \verb'T' is constructed, it is -typecasted into the result \verb'C'. That is, typecasting does not occur at -the same time as the assembly of duplicates. - -If \verb'dup' is \verb'NULL', any duplicates result in an error. -If \verb'dup' is the special binary operator \verb'GxB_IGNORE_DUP', then -any duplicates are ignored. If duplicates appear, the last one in the -list of tuples is taken and the prior ones ignored. This is not an error. - -\begin{alert} -{\bf SPEC:} As an extension to the specification, -results are defined even if \verb'dup' -is non-associative and/or non-commutative. -\end{alert} - -The GraphBLAS API requires \verb'dup' to be associative so -that entries can be assembled in any order, and states that the result is -undefined if \verb'dup' is not associative. However, SuiteSparse:GraphBLAS -guarantees a well-defined order of assembly. Entries in the tuples -\verb'[I,J,X]' are first sorted in increasing order of row and column index, -with ties broken by the position of the tuple in the \verb'[I,J,X]' list. If -duplicates appear, they are assembled in the order they appear in the -\verb'[I,J,X]' input. That is, if the same indices \verb'i' and \verb'j' -appear in positions \verb'k1', \verb'k2', \verb'k3', and \verb'k4' in -\verb'[I,J,X]', where \verb'k1 < k2 < k3 < k4', then the following operations -will occur in order: - - {\footnotesize - \begin{verbatim} - T (i,j) = X (k1) ; - T (i,j) = dup (T (i,j), X (k2)) ; - T (i,j) = dup (T (i,j), X (k3)) ; - T (i,j) = dup (T (i,j), X (k4)) ; \end{verbatim}} - -This is a well-defined order but the user should not depend upon it when using -other GraphBLAS implementations since the GraphBLAS API does not -require this ordering. - -However, SuiteSparse:GraphBLAS guarantees this ordering, even when it compute -the result in parallel. With this well-defined order, several operators become -very useful. In particular, the \verb'SECOND' operator results in the last -tuple overwriting the earlier ones. The \verb'FIRST' operator means the value -of the first tuple is used and the others are discarded. - -The acronym \verb'dup' is used here for the name of binary function used for -assembling duplicates, but this should not be confused with the \verb'_dup' -suffix in the name of the function \verb'GrB_Matrix_dup'. The latter function -does not apply any operator at all, nor any typecasting, but simply makes a -pure deep copy of a matrix. - -The parameter \verb'X' is a pointer to any C equivalent built-in type, or a -\verb'void *' pointer. The \verb'GrB_Matrix_build' function uses the -\verb'_Generic' feature of C11 to detect the type of pointer passed as the -parameter \verb'X'. If \verb'X' is a pointer to a built-in type, then the -function can do the right typecasting. If \verb'X' is a \verb'void *' pointer, -then it can only assume \verb'X' to be a pointer to a user-defined type that is -the same user-defined type of \verb'C' and \verb'dup'. This function has no -way of checking this condition that the \verb'void * X' pointer points to an -array of the correct user-defined type, so behavior is undefined if the user -breaks this condition. - -The \verb'GrB_Matrix_build' method is analogous to \verb'C = sparse (I,J,X)' in -MATLAB, with several important extensions that go beyond that which MATLAB can -do. In particular, the MATLAB \verb'sparse' function only provides one option -for assembling duplicates (summation), and it can only build double, double -complex, and logical sparse matrices. -% -The \verb'dup' operator cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_build\_Scalar:} build a matrix from a set of tuples} -%------------------------------------------------------------------------------- -\label{matrix_build_Scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *I, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_build_Scalar' constructs a sparse matrix \verb'C' from a set -of tuples defined the index arrays \verb'I' and \verb'J' of length -\verb'nvals', and a scalar. The scalar is the value of all of the tuples. -Unlike \verb'GrB_Matrix_build', there is no \verb'dup' operator to handle -duplicate entries. Instead, any duplicates are silently ignored (if the number -of duplicates is desired, simply compare the input \verb'nvals' with the value -returned by \verb'GrB_Vector_nvals' after the matrix is constructed). All -entries in the sparsity pattern of \verb'C' are identical, and equal to the -input scalar value. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_setElement:} add an entry to a matrix} -%------------------------------------------------------------------------------- -\label{matrix_setElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_setElement // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_setElement' sets a single entry in a matrix, \verb'C(i,j)=x'. -If the entry is already present in the pattern of \verb'C', it is overwritten -with the new value. If the entry is not present, it is added to \verb'C'. In -either case, no entry is ever deleted by this function. Passing in a value of -\verb'x=0' simply creates an explicit entry at position \verb'(i,j)' whose -value is zero, even if the implicit value is assumed to be zero. - -An error is returned (\verb'GrB_INVALID_INDEX') if the row index \verb'i' is -greater than or equal to the number of rows of \verb'C', or if the column index -\verb'j' is greater than or equal to the number of columns of \verb'C'. Note -that this error code differs from the same kind of condition in -\verb'GrB_Matrix_build', which returns \verb'GrB_INDEX_OUT_OF_BOUNDS'. This is -because \verb'GrB_INVALID_INDEX' is an API error, and is caught immediately -even in non-blocking mode, whereas \verb'GrB_INDEX_OUT_OF_BOUNDS' is an -execution error whose detection may wait until the computation completes -sometime later. - -The scalar \verb'x' is typecasted into the type of \verb'C'. Any value can be -passed to this function and its type will be detected, via the \verb'_Generic' -feature of C11. For a user-defined type, \verb'x' is a \verb'void *' -pointer that points to a memory space holding a single entry of this -user-defined type. This user-defined type must exactly match the user-defined -type of \verb'C' since no typecasting is done between user-defined types. -% -If \verb'x' is a \verb'GrB_Scalar' and contains no entry, then the -entry \verb'C(i,j)' is removed (if it exists). The action taken is -identical to \verb'GrB_Matrix_removeElement(C,i,j)' in this case. - -{\bf Performance considerations:} % BLOCKING: setElement, *assign -SuiteSparse:GraphBLAS exploits the non-blocking mode to greatly improve the -performance of this method. Refer to the example shown in -Section~\ref{overview}. If the entry exists in the pattern already, it is -updated right away and the work is not left pending. Otherwise, it is placed -in a list of pending updates, and the later on the updates are done all at -once, using the same algorithm used for \verb'GrB_Matrix_build'. In other -words, \verb'setElement' in SuiteSparse:GraphBLAS builds its own internal list -of tuples \verb'[I,J,X]', and then calls \verb'GrB_Matrix_build' whenever the -matrix is needed in another computation, or whenever \verb'GrB_Matrix_wait' is -called. - -As a result, if calls to \verb'setElement' are mixed with calls to most other -methods and operations (even \verb'extractElement') then the pending updates -are assembled right away, which will be slow. Performance will be good if many -\verb'setElement' updates are left pending, and performance will be poor if the -updates are assembled frequently. - -A few methods and operations can be intermixed with \verb'setElement', in -particular, some forms of the \verb'GrB_assign' and \verb'GxB_subassign' -operations are compatible with the pending updates from \verb'setElement'. -Section~\ref{compare_assign} gives more details on which \verb'GxB_subassign' -and \verb'GrB_assign' operations can be interleaved with calls to -\verb'setElement' without forcing updates to be assembled. Other methods that -do not access the existing entries may also be done without forcing the updates -to be assembled, namely \verb'GrB_Matrix_clear' (which erases all pending -updates), \verb'GrB_Matrix_free', \verb'GrB_Matrix_ncols', -\verb'GrB_Matrix_nrows', \verb'GrB_get', and of course -\verb'GrB_Matrix_setElement' itself. All other methods and operations cause -the updates to be assembled. Future versions of SuiteSparse:GraphBLAS may -extend this list. - -See Section~\ref{random} for an example of how to use -\verb'GrB_Matrix_setElement'. -If an error occurs, \verb'GrB_error(&err,C)' returns details about the error. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_extractElement:} get an entry from a matrix} -%------------------------------------------------------------------------------- -\label{matrix_extractElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_extractElement // x = A(i,j) -( - *x, // extracted scalar (non-opaque C scalar) - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; -GrB_Info GrB_Matrix_extractElement // x = A(i,j) -( - GrB_Scalar x, // extracted GrB_Scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_extractElement' extracts a single entry from a matrix -\verb'x=A(i,j)'. -An error is returned (\verb'GrB_INVALID_INDEX') if the row index \verb'i' is -greater than or equal to the number of rows of \verb'C', or if column index -\verb'j' is greater than or equal to the number of columns of \verb'C'. -If the entry is present, \verb'x=A(i,j)' is performed and the scalar \verb'x' -is returned with this value. The method returns \verb'GrB_SUCCESS'. -If no entry is present at \verb'A(i,j)', and \verb'x' is a non-opaque C scalar, -then \verb'x' is not modified, and the return value of -\verb'GrB_Matrix_extractElement' is \verb'GrB_NO_VALUE'. If \verb'x' is a -\verb'GrB_Scalar', then \verb'x' is returned as an empty scalar with no entry, -and \verb'GrB_SUCCESS' is returned. - -The function knows the type of the pointer \verb'x', so it can do typecasting -as needed, from the type of \verb'A' into the type of \verb'x'. User-defined -types cannot be typecasted, so if \verb'A' has a user-defined type then -\verb'x' must be a \verb'void *' pointer that points to a memory space the same -size as a single scalar of the type of \verb'A'. - -Currently, this method causes all pending updates from -\verb'GrB_setElement', \verb'GrB_assign', or \verb'GxB_subassign' to be -assembled, so its use can have performance implications. Calls to this -function should not be arbitrarily intermixed with calls to these other two -functions. Everything will work correctly and results will be predictable, it -will just be slow. - -%------------------------------------------------------------------------------- -\newpage -\subsubsection{{\sf GxB\_Matrix\_isStoredElement:} check if entry present in matrix} -%------------------------------------------------------------------------------- -\label{matrix_isStoredElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_isStoredElement -( - const GrB_Matrix A, // check for A(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_isStoredElement' check if the single entry \verb'A(i,j)' is -present in the matrix \verb'A'. It returns \verb'GrB_SUCCESS' if the entry is -present, or \verb'GrB_NO_VALUE' otherwise. The value of \verb'A(i,j)' is not -returned. It is otherwise identical to \verb'GrB_Matrix_extractElement'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_removeElement:} remove an entry from a matrix} -%------------------------------------------------------------------------------- -\label{matrix_removeElement} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_removeElement -( - GrB_Matrix C, // matrix to remove an entry from - GrB_Index i, // row index - GrB_Index j // column index -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_removeElement' removes a single entry \verb'A(i,j)' from a -matrix. If no entry is present at \verb'A(i,j)', then the matrix is not -modified. If an error occurs, \verb'GrB_error(&err,A)' returns details about -the error. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_extractTuples:} get all entries from a matrix} -%------------------------------------------------------------------------------- -\label{matrix_extractTuples} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) -( - GrB_Index *I, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_extractTuples' extracts all the entries from the matrix -\verb'A', returning them as a list of tuples, analogous to -\verb'[I,J,X]=find(A)' in MATLAB. Entries in the tuples \verb'[I,J,X]' are -unique. No pair of row and column indices \verb'(i,j)' appears more than once. - -The GraphBLAS API states the tuples can be returned in any order. If -\verb'GrB_wait' is called first, then SuiteSparse:GraphBLAS chooses to -always return them in sorted order, depending on whether the matrix is stored -by row or by column. Otherwise, the indices can be returned in any order. - -The number of tuples in the matrix \verb'A' is given by -\verb'GrB_Matrix_nvals(&anvals,A)'. If \verb'anvals' is larger than the size -of the arrays (\verb'nvals' in the parameter list), an error -\verb'GrB_INSUFFICIENT_SIZE' is returned, and no tuples are extracted. If -\verb'nvals' is larger than \verb'anvals', then only the first \verb'anvals' -entries in the arrays \verb'I' \verb'J', and \verb'X' are modified, containing -all the tuples of \verb'A', and the rest of \verb'I' \verb'J', and \verb'X' are -left unchanged. On output, \verb'nvals' contains the number of tuples -extracted. - -\begin{alert} -{\bf SPEC:} As an extension to the specification, the arrays \verb'I', \verb'J', and/or -\verb'X' may be passed in as \verb'NULL' pointers. -\verb'GrB_Matrix_extractTuples' does not return a component specified as -\verb'NULL'. This is not an error condition. -\end{alert} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_resize:} resize a matrix} -%------------------------------------------------------------------------------- -\label{matrix_resize} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_resize // change the size of a matrix -( - GrB_Matrix A, // matrix to modify - const GrB_Index nrows_new, // new number of rows in matrix - const GrB_Index ncols_new // new number of columns in matrix -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_resize' changes the size of a matrix. If the dimensions -decrease, entries that fall outside the resized matrix are deleted. Unlike -\verb'GxB_Matrix_reshape*' (see Sections \ref{matrix_reshape} and -\ref{matrix_reshapedup}), entries remain in their same position after resizing -the matrix. - -%------------------------------------------------------------------------------- -\newpage -\subsubsection{{\sf GxB\_Matrix\_reshape:} reshape a matrix} -%------------------------------------------------------------------------------- -\label{matrix_reshape} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place -( - // input/output: - GrB_Matrix C, // input/output matrix, reshaped in place - // input: - bool by_col, // true if reshape by column, false if by row - GrB_Index nrows_new, // new number of rows of C - GrB_Index ncols_new, // new number of columns of C - const GrB_Descriptor desc -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_reshape' changes the size of a matrix \verb'C', taking entries -from the input matrix either column-wise or row-wise. If matrix \verb'C' on -input is \verb'nrows'-by-\verb'ncols', and the requested dimensions of -\verb'C' on output are \verb'nrows_new'-by-\verb'nrows_cols', then -the condition \verb'nrows*ncols == nrows_new*nrows_cols' must hold. -The matrix \verb'C' is modified in-place, as both an input and output for -this method. To create a new matrix, use \verb'GxB_Matrix_reshapeDup' -instead (Section \ref{matrix_reshapedup}). - -For example, if \verb'C' is 3-by-4 on input, and is reshaped column-wise to -have dimensions 2-by-6: - -\begin{verbatim} - C on input C on output (by_col true) - 00 01 02 03 00 20 11 02 22 13 - 10 11 12 13 10 01 21 12 03 23 - 20 21 22 23 -\end{verbatim} - -If the same \verb'C' on input is reshaped row-wise to dimensions 2-by-6: - -\begin{verbatim} - C on input C on output (by_col false) - 00 01 02 03 00 01 02 03 10 11 - 10 11 12 13 12 13 20 21 22 23 - 20 21 22 23 -\end{verbatim} - -NOTE: because an intermediate linear index must be computed for each entry, -\verb'GxB_Matrix_reshape' cannot be used on matrices for which -\verb'nrows*ncols' exceeds $2^{60}$. - -%------------------------------------------------------------------------------- -\newpage -\subsubsection{{\sf GxB\_Matrix\_reshapeDup:} reshape a matrix} -%------------------------------------------------------------------------------- -\label{matrix_reshapedup} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix -( - // output: - GrB_Matrix *C, // newly created output matrix, not in place - // input: - GrB_Matrix A, // input matrix, not modified - bool by_col, // true if reshape by column, false if by row - GrB_Index nrows_new, // number of rows of C - GrB_Index ncols_new, // number of columns of C - const GrB_Descriptor desc -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_reshapeDup' is identical to \verb'GxB_Matrix_reshape' (see -Section \ref{matrix_reshape}), except that creates a new output matrix -\verb'C' that is reshaped from the input matrix \verb'A'. - -%------------------------------------------------------------------------------- -% \newpage -\subsubsection{{\sf GxB\_Matrix\_concat:} concatenate matrices } -%------------------------------------------------------------------------------- -\label{matrix_concat} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Descriptor desc // unused, except threading control -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_concat' concatenates an array of matrices (\verb'Tiles') into -a single \verb'GrB_Matrix' \verb'C'. - -\verb'Tiles' is an \verb'm'-by-\verb'n' dense array of matrices held in -row-major format, where \verb'Tiles [i*n+j]' is the $(i,j)$th tile, and where -\verb'm' $> 0$ and \verb'n' $> 0$ must hold. Let $A_{i,j}$ denote the -$(i,j)$th tile. The matrix \verb'C' is constructed by concatenating these -tiles together, as: - -\[ -C = -\left[ -\begin{array}{ccccc} - A_{0,0} & A_{0,1} & A_{0,2} & \cdots & A_{0,n-1} \\ - A_{1,0} & A_{1,1} & A_{1,2} & \cdots & A_{1,n-1} \\ - \cdots & \\ - A_{m-1,0} & A_{m-1,1} & A_{m-1,2} & \cdots & A_{m-1,n-1} -\end{array} -\right] -\] - -On input, the matrix \verb'C' must already exist. Any existing entries in -\verb'C' are discarded. \verb'C' must have dimensions \verb'nrows' by -\verb'ncols' where \verb'nrows' is the sum of the number of rows in the -matrices $A_{i,0}$ for all $i$, and \verb'ncols' is the sum of the number of -columns in the matrices $A_{0,j}$ for all $j$. All matrices in any given tile -row $i$ must have the same number of rows (that is, and all matrices in any -given tile column $j$ must have the same number of columns). - -The type of \verb'C' is unchanged, and all matrices $A_{i,j}$ are typecasted -into the type of \verb'C'. Any settings made to \verb'C' by -\verb'GrB_set' (format by row or by column, bitmap switch, hyper -switch, and sparsity control) are unchanged. - -%------------------------------------------------------------------------------- -% \newpage -\subsubsection{{\sf GxB\_Matrix\_split:} split a matrix } -%------------------------------------------------------------------------------- -\label{matrix_split} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices -( - GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n - const GrB_Matrix A, // input matrix to split - const GrB_Descriptor desc // unused, except threading control -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_split' does the opposite of \verb'GxB_Matrix_concat'. It -splits a single input matrix \verb'A' into a 2D array of tiles. On input, the -\verb'Tiles' array must be a non-\verb'NULL' pointer to a previously allocated -array of size at least \verb'm*n' where both \verb'm' and \verb'n' must be -greater than zero. The \verb'Tiles_nrows' array has size \verb'm', and -\verb'Tiles_ncols' has size \verb'n'. The $(i,j)$th tile has dimension -\verb'Tiles_nrows[i]'-by-\verb'Tiles_ncols[j]'. The sum of -\verb'Tiles_nrows [0:m-1]' must equal the number of rows of \verb'A', and the -sum of \verb'Tiles_ncols [0:n-1]' must equal the number of columns of \verb'A'. -The type of each tile is the same as the type of \verb'A'; no typecasting is -done. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_diag:} construct a diagonal matrix} -%------------------------------------------------------------------------------- -\label{matrix_diag} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_diag // construct a diagonal matrix from a vector -( - GrB_Matrix *C, // output matrix - const GrB_Vector v, // input vector - int64_t k -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_diag' constructs a matrix from a vector. Let $n$ be the -length of the \verb'v' vector, from \verb'GrB_Vector_size (&n, v)'. If -\verb'k' = 0, then \verb'C' is an $n$-by-$n$ diagonal matrix with the entries -from \verb'v' along the main diagonal of \verb'C', with \verb'C(i,i)=v(i)'. If -\verb'k' is nonzero, \verb'C' is square with dimension $n+|k|$. If \verb'k' is -positive, it denotes diagonals above the main diagonal, with -\verb'C(i,i+k)=v(i)'. -If \verb'k' is negative, it denotes diagonals below the main diagonal of -\verb'C', with \verb'C(i-k,i)=v(i)'. This behavior is identical to the MATLAB -statement \verb'C=diag(v,k)', where \verb'v' is a vector. - -The output matrix \verb'C' is a newly-constructed square matrix with the -same type as the input vector \verb'v'. No typecasting is performed. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_diag:} build a diagonal matrix} -%------------------------------------------------------------------------------- -\label{matrix_diag_GxB} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_diag // build a diagonal matrix from a vector -( - GrB_Matrix C, // output matrix - const GrB_Vector v, // input vector - int64_t k, - const GrB_Descriptor desc // unused, except threading control -) ; -\end{verbatim} } \end{mdframed} - -Identical to \verb'GrB_Matrix_diag', except for the extra parameter -(a \verb'descriptor' to provide control over the number of threads used), -and this method is not a constructor. - -The matrix \verb'C' must already exist on input, of the correct size. It must -be square of dimension $n+|k|$ where the vector \verb'v' has length $n$. Any -existing entries in \verb'C' are discarded. The type of \verb'C' is preserved, -so that if the type of \verb'C' and \verb'v' differ, the entries are typecasted -into the type of \verb'C'. Any settings made to \verb'C' by -\verb'GrB_set' (format by row or by column, bitmap switch, hyper -switch, and sparsity control) are unchanged. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_iso:} query iso status of a matrix} -%------------------------------------------------------------------------------- -\label{matrix_iso} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_iso // return iso status of a matrix -( - bool *iso, // true if the matrix is iso-valued - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} } \end{mdframed} - -Returns the true if the matrix is iso-valued, false otherwise. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_memoryUsage:} memory used by a matrix} -%------------------------------------------------------------------------------- -\label{matrix_memusage} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix -( - size_t *size, // # of bytes used by the matrix A - const GrB_Matrix A // matrix to query -) ; -\end{verbatim} } \end{mdframed} - -Returns the memory space required for a matrix, in bytes. - -%------------------------------------------------------------------------------- -% \newpage -\subsubsection{{\sf GrB\_Matrix\_free:} free a matrix} -%------------------------------------------------------------------------------- -\label{matrix_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a matrix -( - GrB_Matrix *A // handle of matrix to free -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_free' frees a matrix. Either usage: - - {\small - \begin{verbatim} - GrB_Matrix_free (&A) ; - GrB_free (&A) ; \end{verbatim}} - -\noindent -frees the matrix \verb'A' and sets \verb'A' to \verb'NULL'. It safely does -nothing if passed a \verb'NULL' handle, or if \verb'A == NULL' on input. Any -pending updates to the matrix are abandoned. - -\newpage -%=============================================================================== -\subsection{Serialize/deserialize methods} -%=============================================================================== -\label{serialize_deserialize} - -{\em Serialization} takes an opaque GraphBLAS object (a vector or matrix) and -encodes it in a single non-opaque array of bytes, the {\em blob}. The blob can -only be deserialized by the same library that created it (SuiteSparse:GraphBLAS -in this case). The array of bytes can be written to a file, sent to another -process over an MPI channel, or operated on in any other way that moves the -bytes around. The contents of the array cannot be interpreted except by -deserialization back into a vector or matrix, by the same library (and -sometimes the same version) that created the blob. - -All versions of SuiteSparse:GraphBLAS that implement -serialization/deserialization use essentially the same format for the blob, so -the library versions are compatible with each other. Version v9.0.0 adds the -\verb'GrB_NAME' and \verb'GrB_EL_TYPE_STRING' to the blob in an upward -compatible manner, so that older versions of SS:GraphBLAS can read the blobs -created by v9.0.0; they simply ignore those components. - -There are two forms of serialization: \verb'GrB*serialize' and -\verb'GxB*serialize'. For the \verb'GrB' form, the blob must first be -allocated by the user application, and it must be large enough to hold the -matrix or vector. - -By default, ZSTD (level 1) compression is used for serialization, but other -options can be selected via the descriptor: -\verb'GrB_set (desc, method, GxB_COMPRESSION)', where \verb'method' is an -integer selected from the following options: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{ll} -\hline -method & description \\ -\hline -\verb'GxB_COMPRESSION_NONE' & no compression \\ -\verb'GxB_COMPRESSION_DEFAULT' & ZSTD, with default level 1 \\ -\verb'GxB_COMPRESSION_LZ4' & LZ4 \\ -\verb'GxB_COMPRESSION_LZ4HC' & LZ4HC, with default level 9 \\ -\verb'GxB_COMPRESSION_ZSTD' & ZSTD, with default level 1 \\ -\hline -\end{tabular} } -\vspace{0.2in} - -The LZ4HC method can be modified by adding a level of zero to 9, with 9 being -the default. Higher levels lead to a more compact blob, at the cost of extra -computational time. This level is simply added to the method, so to compress a -vector with LZ4HC with level 6, use: - - {\footnotesize - \begin{verbatim} - GrB_set (desc, GxB_COMPRESSION_LZ4HC + 6, GxB_COMPRESSION) ; \end{verbatim}} - -The ZSTD method can be specified as level 1 to 19, with 1 being the default. -To compress with ZSTD at level 6, use: - - {\footnotesize - \begin{verbatim} - GrB_set (desc, GxB_COMPRESSION_ZSTD + 6, GxB_COMPRESSION) ; \end{verbatim}} - -Deserialization of untrusted data is a common security problem; see -\url{https://cwe.mitre.org/data/definitions/502.html}. The deserialization -methods do a few basic checks so that no out-of-bounds access occurs during -deserialization, but the output matrix or vector itself may still be corrupted. -If the data is untrusted, use \verb'GxB_*_fprint' to -check the matrix or vector after deserializing it: - -{\footnotesize -\begin{verbatim} - info = GxB_Vector_fprint (w, "w deserialized", GrB_SILENT, NULL) ; - if (info != GrB_SUCCESS) GrB_free (&w) ; - info = GxB_Matrix_fprint (A, "A deserialized", GrB_SILENT, NULL) ; - if (info != GrB_SUCCESS) GrB_free (&A) ; \end{verbatim}} - -The following methods are described in this Section: - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -% \verb'GrB_Vector_serializeSize' & return size of serialized vector & \ref{vector_serialize_size} \\ -% \verb'GrB_Vector_serialize' & serialize a vector & \ref{vector_serialize} \\ -\verb'GxB_Vector_serialize' & serialize a vector & \ref{vector_serialize_GxB} \\ -% \verb'GrB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize} \\ -\verb'GxB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize_GxB} \\ -\hline -\verb'GrB_Matrix_serializeSize' & return size of serialized matrix & \ref{matrix_serialize_size} \\ -\verb'GrB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize} \\ -\verb'GxB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize_GxB} \\ -\verb'GrB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize} \\ -\verb'GxB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize_GxB} \\ -\hline -\verb'GrB_get' & get blob properties & \ref{get_set_blob} \\ -\hline -\end{tabular} -} - -%------------------------------------------------------------------------------- -% \subsubsection{{\sf GrB\_Vector\_serializeSize:} return size of serialized vector} -%------------------------------------------------------------------------------- -% \label{vector_serialize_size} - -% \begin{mdframed}[userdefinedwidth=6in] -% {\footnotesize -% \begin{verbatim} -% GrB_Info GrB_Vector_serializeSize // estimate the size of a blob -% ( -% // output: -% GrB_Index *blob_size_handle, // upper bound on the required size of the -% // blob on output. -% // input: -% GrB_Vector u // vector to serialize -%) ; -%\end{verbatim} -%} \end{mdframed} -% -% \verb'GrB_Vector_serializeSize' returns an upper bound on the size of the blob -% needed to serialize a \verb'GrB_Vector' using \verb'GrB_Vector_serialize'. -% After the vector is serialized, the actual size used is returned, and the blob -% may be \verb'realloc''d to that size if desired. -% This method is not required for \verb'GxB_Vector_serialize'. - -% \newpage -%------------------------------------------------------------------------------- -% \subsubsection{{\sf GrB\_Vector\_serialize:} serialize a vector} -%------------------------------------------------------------------------------- -% \label{vector_serialize} - -% \begin{mdframed}[userdefinedwidth=6in] -% {\footnotesize -% \begin{verbatim} -% GrB_Info GrB_Vector_serialize // serialize a GrB_Vector to a blob -% ( -% // output: -% void *blob, // the blob, already allocated in input -% // input/output: -% GrB_Index *blob_size_handle, // size of the blob on input. On output, -% // the # of bytes used in the blob. -% // input: -% GrB_Vector u // vector to serialize -% ) ; -% \end{verbatim} -% } \end{mdframed} -% -% \verb'GrB_Vector_serialize' serializes a vector into a single array of bytes -% (the blob), which must be already allocated by the user application. -% On input, \verb'&blob_size' is the size of the allocated blob in bytes. -% On output, it is reduced to the numbed of bytes actually used to serialize -% the vector. After calling \verb'GrB_Vector_serialize', the blob may be -% \verb'realloc''d to this revised size if desired (this is optional). -% ZSTD (level 1) compression is used to construct a compact blob. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_serialize:} serialize a vector} -%------------------------------------------------------------------------------- -\label{vector_serialize_GxB} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_serialize // serialize a GrB_Vector to a blob -( - // output: - void **blob_handle, // the blob, allocated on output - GrB_Index *blob_size_handle, // size of the blob on output - // input: - GrB_Vector u, // vector to serialize - const GrB_Descriptor desc // descriptor to select compression method -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_serialize' serializes a vector into a single array of bytes -(the blob), which is \verb'malloc''ed and filled with the serialized vector. -By default, ZSTD (level 1) compression is used, but other options can be -selected via the descriptor. Serializing a vector is identical to serializing -a matrix; see Section \ref{matrix_serialize_GxB} for more information. - -\newpage -%------------------------------------------------------------------------------- -% \subsubsection{{\sf GrB\_Vector\_deserialize:} deserialize a vector} -%------------------------------------------------------------------------------- -% \label{vector_deserialize} - -% \begin{mdframed}[userdefinedwidth=6in] -% {\footnotesize -% \begin{verbatim} -% GrB_Info GrB_Vector_deserialize // deserialize blob into a GrB_Vector -% ( -% // output: -% GrB_Vector *w, // output vector created from the blob -% // input: -% GrB_Type type, // type of the vector w. Required if the blob holds a -% // vector of user-defined type. May be NULL if blob -% // holds a built-in type; otherwise must match the -% // type of w. -% const void *blob, // the blob -% GrB_Index blob_size // size of the blob -% ) ; -% \end{verbatim} -% } \end{mdframed} -% -% This method creates a vector \verb'w' by deserializing the contents of the -% blob, constructed by either \verb'GrB_Vector_serialize' or -% \verb'GxB_Vector_serialize'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_deserialize:} deserialize a vector} -%------------------------------------------------------------------------------- -\label{vector_deserialize_GxB} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector -( - // output: - GrB_Vector *w, // output vector created from the blob - // input: - GrB_Type type, // type of the vector w. See GxB_Matrix_deserialize. - const void *blob, // the blob - GrB_Index blob_size, // size of the blob - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -This method creates a vector \verb'w' by deserializing the contents of the -blob, constructed by -% either \verb'GrB_Vector_serialize' or -\verb'GxB_Vector_serialize'. -Deserializing a vector is identical to deserializing a matrix; -see Section \ref{matrix_deserialize_GxB} for more information. - -The blob is allocated with the \verb'malloc' function passed to -\verb'GxB_init', or the C11 \verb'malloc' if \verb'GrB_init' was used -to initialize GraphBLAS. The blob must be freed by the matching \verb'free' -method, either the \verb'free' function passed to \verb'GxB_init' or -the C11 \verb'free' if \verb'GrB_init' was used. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_serializeSize:} return size of serialized matrix} -%------------------------------------------------------------------------------- -\label{matrix_serialize_size} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_serializeSize // estimate the size of a blob -( - // output: - GrB_Index *blob_size_handle, // upper bound on the required size of the - // blob on output. - // input: - GrB_Matrix A // matrix to serialize -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Matrix_serializeSize' returns an upper bound on the size of the blob -needed to serialize a \verb'GrB_Matrix' with \verb'GrB_Matrix_serialize'. -After the matrix is serialized, the actual size used is returned, and the blob -may be \verb'realloc''d to that size if desired. -This method is not required for \verb'GxB_Matrix_serialize'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_serialize:} serialize a matrix} -%------------------------------------------------------------------------------- -\label{matrix_serialize} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_serialize // serialize a GrB_Matrix to a blob -( - // output: - void *blob, // the blob, already allocated in input - // input/output: - GrB_Index *blob_size_handle, // size of the blob on input. On output, - // the # of bytes used in the blob. - // input: - GrB_Matrix A // matrix to serialize -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Matrix_serialize' serializes a matrix into a single array of bytes -(the blob), which must be already allocated by the user application. -On input, \verb'&blob_size' is the size of the allocated blob in bytes. -On output, it is reduced to the numbed of bytes actually used to serialize -the matrix. After calling \verb'GrB_Matrix_serialize', the blob may be -\verb'realloc''d to this revised size if desired (this is optional). -ZSTD (level 1) compression is used to construct a compact blob. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_serialize:} serialize a matrix} -%------------------------------------------------------------------------------- -\label{matrix_serialize_GxB} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob -( - // output: - void **blob_handle, // the blob, allocated on output - GrB_Index *blob_size_handle, // size of the blob on output - // input: - GrB_Matrix A, // matrix to serialize - const GrB_Descriptor desc // descriptor to select compression method -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_serialize' is identical to \verb'GrB_Matrix_serialize', except -that it does not require a pre-allocated blob. Instead, it allocates the blob -internally, and fills it with the serialized matrix. By default, ZSTD (level 1) -compression is used, but other options can be selected via the descriptor. - -The blob is allocated with the \verb'malloc' function passed to -\verb'GxB_init', or the C11 \verb'malloc' if \verb'GrB_init' was used -to initialize GraphBLAS. The blob must be freed by the matching \verb'free' -method, either the \verb'free' function passed to \verb'GxB_init' or -the C11 \verb'free' if \verb'GrB_init' was used. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_deserialize:} deserialize a matrix} -%------------------------------------------------------------------------------- -\label{matrix_deserialize} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_deserialize // deserialize blob into a GrB_Matrix -( - // output: - GrB_Matrix *C, // output matrix created from the blob - // input: - GrB_Type type, // type of the matrix C. Required if the blob holds a - // matrix of user-defined type. May be NULL if blob - // holds a built-in type; otherwise must match the - // type of C. - const void *blob, // the blob - GrB_Index blob_size // size of the blob -) ; -\end{verbatim} -} \end{mdframed} - -This method creates a matrix \verb'A' by deserializing the contents of the -blob, constructed by either \verb'GrB_Matrix_serialize' or -\verb'GxB_Matrix_serialize'. - -% extended in the v2.1 C API (type may be NULL): -The \verb'type' may be \verb'NULL' if the blob holds a serialized matrix with a -built-in type. In this case, the type is determined automatically. For -user-defined types, the \verb'type' must match the type of the matrix in the -blob. The \verb'GrB_get' method can be used to query the blob for the name of -this type. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_deserialize:} deserialize a matrix} -%------------------------------------------------------------------------------- -\label{matrix_deserialize_GxB} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_deserialize // deserialize blob into a GrB_Matrix -( - // output: - GrB_Matrix *C, // output matrix created from the blob - // input: - GrB_Type type, // type of the matrix C. Required if the blob holds a - // matrix of user-defined type. May be NULL if blob - // holds a built-in type; otherwise must match the - // type of C. - const void *blob, // the blob - GrB_Index blob_size, // size of the blob - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -Identical to \verb'GrB_Matrix_deserialize'. - -\newpage -%=============================================================================== -\subsection{GraphBLAS pack/unpack: using move semantics} %======== -%=============================================================================== -\label{pack_unpack} - -The pack/unpack functions allow the user application to create a -\verb'GrB_Matrix' or \verb'GrB_Vector' object, and to extract its contents, -faster and with less memory overhead than the \verb'GrB_*_build' and -\verb'GrB_*_extractTuples' functions. - -The \verb'GrB_Matrix_import' and \verb'GrB_Matrix_export' are not -described in this section. Refer to Section~\ref{GrB_import_export} instead. - -The semantics of the \verb'GxB' pack/unpack are the same as the -{\em move constructor} in C++. For \verb'GxB*pack*', the user provides a set of -arrays that have been previously allocated via the ANSI C \verb'malloc', -\verb'calloc', or \verb'realloc' functions (by default), or by the -corresponding functions passed to \verb'GxB_init'. The arrays define the -content of the matrix or vector. Unlike \verb'GrB_*_build', the GraphBLAS -library then takes ownership of the user's input arrays and may either: - -\begin{enumerate} -\item incorporate them -into its internal data structure for the new \verb'GrB_Matrix' or -\verb'GrB_Vector', potentially creating the \verb'GrB_Matrix' or -\verb'GrB_Vector' in constant time with no memory copying performed, or -\item if -the library does not support the format directly, then it may convert -the input to its internal format, and then free the user's input arrays. -\item A -GraphBLAS implementation may also choose to use a mix of the two strategies. -\end{enumerate} - -SuiteSparse:GraphBLAS takes the first approach, and so the pack -functions always take $O(1)$ time, and require $O(1)$ memory space to be -allocated. - -Regardless of the method chosen, as listed above, the input arrays are no -longer owned by the user application. If \verb'A' is a \verb'GrB_Matrix' -created by a pack method, the user input arrays are freed no later than -\verb'GrB_free(&A)', and may be freed earlier, at the discretion of the -GraphBLAS library. The data structure of the \verb'GrB_Matrix' and -\verb'GrB_Vector' remain opaque. - -The \verb'GxB*unpack*' of a \verb'GrB_Matrix' or \verb'GrB_Vector' is symmetric with the -pack operation. The unpack changes the ownership of the arrays, which are -returned to the user and which contain the -matrix or vector in the requested format. Ownership of these arrays is given -to the user application, which is then responsible for freeing them via the -ANSI C \verb'free' function (by default), or by the \verb'free_function' that -was passed in to \verb'GxB_init'. Alternatively, these arrays can be -re-packed into a \verb'GrB_Matrix' or \verb'GrB_Vector', at which point they -again become the responsibility of GraphBLAS. - -For an unpack method, if the output format matches the current internal format of the -matrix or vector then these arrays are returned to the user application in -$O(1)$ time and with no memory copying performed. Otherwise, the -\verb'GrB_Matrix' or \verb'GrB_Vector' is first converted into the requested -format, and then unpacked. - -For the pack methods, the \verb'A' matrix/vector must already exist on input, and its contents are -populated with the new content, just like \verb'GrB_Matrix_build'. -For the unpack -methods, \verb'A' is passed in, and the matrix/vector still exists on return, -just with no entries. Its type and dimensions are preserved. - -Unpacking a matrix or vector forces completion of any pending -operations on the matrix, with one exception. SuiteSparse:GraphBLAS supports -three kinds of pending operations: {\em zombies} (pending deletions), {\em -pending tuples} (pending insertions), and a {\em lazy sort}. Zombies and -pending tuples are never unpacked, but the {\em jumbled} state may be -optionally unpacked. In the latter, if the matrix or vector is unpacked in a -{\em jumbled} state, indices in any row or column may appear out of order. If -unpacked as {\em unjumbled}, the indices always appear in ascending order. - -The vector pack/unpack methods use three formats for a -\verb'GrB_Vector'. Eight different formats are provided for the -pack/unpack of a \verb'GrB_Matrix'. For each format, the -numerical value array (\verb'Ax' or \verb'vx') has a C type corresponding to -one of the 13 built-in types in GraphBLAS (\verb'bool', \verb'int*_t', -\verb'uint*_t', \verb'float', \verb'double' \verb'float complex', \verb'double complex'), -or that corresponds with the user-defined type. No typecasting is -done. - -If \verb'iso' is true, then all entries present in the matrix or vector -have the same value, and the \verb'Ax' array (for matrices) or \verb'vx' array -(for vectors) only need to be large enough to hold a single value. - -The unpack of a \verb'GrB_Vector' in \verb'CSC' format may return the -indices in a jumbled state, in any order. -For a \verb'GrB_Matrix' in \verb'CSR' or \verb'HyperCSR' format, if the matrix -is returned as jumbled, the column indices in any given row may appear out of -order. For \verb'CSC' or \verb'HyperCSC' formats, if the matrix is returned as -jumbled, the row indices in any given column may appear out of order. - -On pack, if the user-provided arrays contain jumbled row or column vectors, -then the input flag \verb'jumbled' must be passed in as \verb'true'. On -unpack, if \verb'*jumbled' is \verb'NULL', this indicates to the unpack method -that the user expects the unpacked matrix or vector to be returned in an -ordered, unjumbled state. If \verb'*jumbled' is provided as non-\verb'NULL', -then it is returned as \verb'true' if the indices may appear out of order, or -\verb'false' if they are known to be in ascending order. - -Matrices and vectors in bitmap or full format are never jumbled. - -If data is packed using -\verb'GxB*_pack_*', the default is to trust the input data so that the -pack can be done in $O(1)$ time. However, if the data comes from an -untrusted source, additional checks should be made during the pack. This is -indicated with a descriptor setting, and then passing the descriptor -to the \verb'GxB' pack methods: - - {\footnotesize - \begin{verbatim} - GrB_set (desc, GxB_SECURE_IMPORT, GxB_IMPORT) ; \end{verbatim}} - -The table below lists the methods presented in this section. - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -method & purpose & Section \\ -\hline -\verb'GxB_Vector_pack_CSC' & pack a vector in CSC format & \ref{vector_pack_csc} \\ -\verb'GxB_Vector_unpack_CSC' & unpack a vector in CSC format & \ref{vector_unpack_csc} \\ -\hline -\verb'GxB_Vector_pack_Bitmap' & pack a vector in bitmap format & \ref{vector_pack_bitmap} \\ -\verb'GxB_Vector_unpack_Bitmap' & unpack a vector in bitmap format & \ref{vector_unpack_bitmap} \\ -\hline -\verb'GxB_Vector_pack_Full' & pack a vector in full format & \ref{vector_pack_full} \\ -\verb'GxB_Vector_unpack_Full' & unpack a vector in full format & \ref{vector_unpack_full} \\ -\hline -\hline -\verb'GxB_Matrix_pack_CSR' & pack a matrix in CSR form & \ref{matrix_pack_csr} \\ -\verb'GxB_Matrix_unpack_CSR' & unpack a matrix in CSR form & \ref{matrix_unpack_csr} \\ -\hline -\verb'GxB_Matrix_pack_CSC' & pack a matrix in CSC form & \ref{matrix_pack_csc} \\ -\verb'GxB_Matrix_unpack_CSC' & unpack a matrix in CSC form & \ref{matrix_unpack_csc} \\ -\hline -\verb'GxB_Matrix_pack_HyperCSR' & pack a matrix in HyperCSR form & \ref{matrix_pack_hypercsr} \\ -\verb'GxB_Matrix_unpack_HyperCSR' & unpack a matrix in HyperCSR form & \ref{matrix_unpack_hypercsr} \\ -\hline -\verb'GxB_Matrix_pack_HyperCSC' & pack a matrix in HyperCSC form & \ref{matrix_pack_hypercsc} \\ -\verb'GxB_Matrix_unpack_HyperCSC' & unpack a matrix in HyperCSC form & \ref{matrix_unpack_hypercsc} \\ -\hline -\verb'GxB_unpack_HyperHash' & unpack a hyper-hash & \ref{unpack_hyperhash} \\ -\verb'GxB_pack_HyperHash' & pack a hyper-hash & \ref{pack_hyperhash} \\ -\hline -\verb'GxB_Matrix_pack_BitmapR' & pack a matrix in BitmapR form & \ref{matrix_pack_bitmapr} \\ -\verb'GxB_Matrix_unpack_BitmapR' & unpack a matrix in BitmapR form & \ref{matrix_unpack_bitmapr} \\ -\hline -\verb'GxB_Matrix_pack_BitmapC' & pack a matrix in BitmapC form & \ref{matrix_pack_bitmapc} \\ -\verb'GxB_Matrix_unpack_BitmapC' & unpack a matrix in BitmapC form & \ref{matrix_unpack_bitmapc} \\ -\hline -\verb'GxB_Matrix_pack_FullR' & pack a matrix in FullR form & \ref{matrix_pack_fullr} \\ -\verb'GxB_Matrix_unpack_FullR' & unpack a matrix in FullR form & \ref{matrix_unpack_fullr} \\ -\hline -\verb'GxB_Matrix_pack_FullC' & pack a matrix in FullC form & \ref{matrix_pack_fullc} \\ -\verb'GxB_Matrix_unpack_FullC' & unpack a matrix in FullC form & \ref{matrix_unpack_fullc} \\ -\hline -\end{tabular} -} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_pack\_CSC} pack a vector in CSC form} -%------------------------------------------------------------------------------- -\label{vector_pack_csc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format -( - GrB_Vector v, // vector to create (type and length unchanged) - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector - bool jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\noindent -\verb'GxB_Vector_pack_CSC' is analogous to \verb'GxB_Matrix_pack_CSC'. -Refer to the description of \verb'GxB_Matrix_pack_CSC' for details -(Section~\ref{matrix_pack_csc}). - -The vector \verb'v' must -exist on input with the right type and length. No typecasting is done. -Its entries are -the row indices given by \verb'vi', with the corresponding values in \verb'vx'. -The two pointers \verb'vi' and \verb'vx' are returned as \verb'NULL', which -denotes that they are no longer owned by the user application. They have -instead been moved into \verb'v'. If \verb'jumbled' -is false, the row indices in \verb'vi' must appear in sorted order. No -duplicates can appear. These conditions are not checked, so results are -undefined if they are not met exactly. The user application can check the -resulting vector \verb'v' with \verb'GxB_print', if desired, which will -determine if these conditions hold. - -If not successful, \verb'v', \verb'vi' and -\verb'vx' are not modified. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_unpack\_CSC:} unpack a vector in CSC form} -%------------------------------------------------------------------------------- -\label{vector_unpack_csc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - GrB_Index **vi, // indices - void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector - bool *jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_unpack_CSC' is analogous to \verb'GxB_Matrix_unpack_CSC'. -Refer to the description of \verb'GxB_Matrix_unpack_CSC' for details -(Section~\ref{matrix_unpack_csc}). - -Exporting a vector forces completion of any pending operations on the vector, -except that indices may be unpacked out of order (\verb'jumbled' is \verb'true' -if they may be out of order, \verb'false' if sorted in ascending order). If -\verb'jumbled' is \verb'NULL' on input, then the indices are always returned in -sorted order. - -If successful, \verb'v' is returned with no entries, and its contents are -returned to the user. -A list of row indices of entries that were in -\verb'v' is returned in \verb'vi', and the corresponding numerical values are -returned in \verb'vx'. If \verb'nvals' is zero, the \verb'vi' and \verb'vx' -arrays are returned as \verb'NULL'; this is not an error condition. - -If not successful, \verb'v' is unmodified and \verb'vi' and \verb'vx' are -not modified. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_pack\_Bitmap} pack a vector in bitmap form} -%------------------------------------------------------------------------------- -\label{vector_pack_bitmap} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector -( - GrB_Vector v, // vector to create (type and length unchanged) - int8_t **vb, // bitmap, vb_size >= n - void **vx, // values, vx_size >= n * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\noindent -\verb'GxB_Vector_pack_Bitmap' is analogous to -\verb'GxB_Matrix_pack_BitmapC'. Refer to the description of -\verb'GxB_Matrix_pack_BitmapC' for details -(Section~\ref{matrix_pack_bitmapc}). - -The vector \verb'v' must -exist on input with the right type and length. No typecasting is done. -Its entries are determined by \verb'vb', where \verb'vb[i]=1' denotes that -the entry $v(i)$ is present with value given by \verb'vx[i]', and -\verb'vb[i]=0' denotes that the entry $v(i)$ is not present (\verb'vx[i]' is -ignored in this case). - -The two pointers \verb'vb' and \verb'vx' are returned as \verb'NULL', which -denotes that they are no longer owned by the user application. They have -instead been moved into the new \verb'GrB_Vector' \verb'v'. - -The \verb'vb' array must not hold any values other than 0 and 1. The value -\verb'nvals' must exactly match the number of 1s in the \verb'vb' array. These -conditions are not checked, so results are undefined if they are not met -exactly. The user application can check the resulting vector \verb'v' with -\verb'GxB_print', if desired, which will determine if these conditions hold. - -If not successful, \verb'v', \verb'vb' and -\verb'vx' are not modified. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_unpack\_Bitmap:} unpack a vector in bitmap form} -%------------------------------------------------------------------------------- -\label{vector_unpack_bitmap} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - int8_t **vb, // bitmap - void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_unpack_Bitmap' is analogous to -\verb'GxB_Matrix_unpack_BitmapC'; see -Section~\ref{matrix_unpack_bitmapc}. -Exporting a vector forces completion of any pending operations on the vector. -If successful, \verb'v' is returned with no entries, and its contents are -returned to the user. -The entries that were in \verb'v' are returned in -\verb'vb', where \verb'vb[i]=1' means $v(i)$ is present with value -\verb'vx[i]', and \verb'vb[i]=0' means $v(i)$ is not present (\verb'vx[i]' is -undefined in this case). The corresponding numerical values are returned in -\verb'vx'. - -If not successful, \verb'v' is unmodified and \verb'vb' and \verb'vx' are not -modified. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_pack\_Full} pack a vector in full form} -%------------------------------------------------------------------------------- -\label{vector_pack_full} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_pack_Full // pack a full vector -( - GrB_Vector v, // vector to create (type and length unchanged) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\noindent -\verb'GxB_Vector_pack_Full' is analogous to \verb'GxB_Matrix_pack_FullC'. -Refer to the description of \verb'GxB_Matrix_pack_BitmapC' for details -(Section~\ref{matrix_pack_fullc}). -The vector \verb'v' must exist on input with the right type and length. -No typecasting is done. -If successful, \verb'v' has -all entries are present, and the value of $v(i)$ is given by \verb'vx[i]'. -The pointer \verb'vx' is returned as \verb'NULL', which denotes that it is no -longer owned by the user application. It has instead been moved into the new -\verb'GrB_Vector' \verb'v'. -If not successful, \verb'v' and -\verb'vx' are not modified. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_unpack\_Full:} unpack a vector in full form} -%------------------------------------------------------------------------------- -\label{vector_unpack_full} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_unpack_Full // unpack a full vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - void **vx, // values - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_unpack_Full' is analogous to \verb'GxB_Matrix_unpack_FullC'. -Refer to the description of \verb'GxB_Matrix_unpack_FullC' for details -(Section~\ref{matrix_unpack_fullc}). -Exporting a vector forces completion of any pending operations on the vector. -All entries in \verb'v' must be present. In other words, prior to the unpack, -\verb'GrB_Vector_nvals' for a vector of length \verb'n' must report that the -vector contains \verb'n' entries; \verb'GrB_INVALID_VALUE' is returned if this -condition does not hold. -If successful, \verb'v' is returned with no entries, and its contents are -returned to the user. The entries -that were in \verb'v' are returned in the array \verb'vx', \verb'vb', where -\verb'vb[i]=1' means $v(i)$ is present with value where the value of $v(i)$ is -\verb'vx[i]'. -If not successful, \verb'v' and \verb'vx' are not modified. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_CSR:} pack a CSR matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_csr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_CSR' packs a matrix from 3 user arrays in CSR format. -In the resulting \verb'GrB_Matrix A', the \verb'CSR' format is a sparse matrix -with a format (\verb'GrB_STORAGE_ORIENTATION_HINT') of \verb'GrB_ROWMAJOR'. - -The \verb'GrB_Matrix A' must exist on input with the right type and -dimensions. No typecasting is done. - -This function populates the matrix -\verb'A' with the three arrays \verb'Ap', \verb'Aj' and \verb'Ax', provided by -the user, all of which must have been created with the ANSI C \verb'malloc', -\verb'calloc', or \verb'realloc' functions (by default), or by the -corresponding \verb'malloc_function', \verb'calloc_function', or -\verb'realloc_function' provided to \verb'GxB_init'. These arrays define the -pattern and values of the new matrix \verb'A': - -\begin{itemize} -\item \verb'GrB_Index Ap [nrows+1] ;' The \verb'Ap' array is the row -``pointer'' array. It does not actual contain pointers. More precisely, it is -an integer array that defines where the column indices and values appear in -\verb'Aj' and \verb'Ax', for each row. The number of entries in row \verb'i' -is given by the expression \verb'Ap [i+1] - Ap [i]'. - -\item \verb'GrB_Index Aj [nvals] ;' The \verb'Aj' array defines the -column indices of entries in each row. - -\item \verb'ctype Ax [nvals] ;' The \verb'Ax' array defines the values of -entries in each row. It is passed in as a \verb'(void *)' pointer, but it must -point to an array of size \verb'nvals' values, each of size -\verb'sizeof(ctype)', where \verb'ctype' is the exact type in C that corresponds -to the \verb'GrB_Type type' parameter. That is, if \verb'type' is -\verb'GrB_INT32', then \verb'ctype' is \verb'int32_t'. User types -may be used, just the same as built-in types. -\end{itemize} - -The content of the three arrays \verb'Ap' \verb'Aj', and \verb'Ax' is very -specific. This content is not checked, since this function takes only -$O(1)$ time. Results are undefined if the following specification is not -followed exactly. - -The column indices of entries in the ith row of the matrix are held in -\verb'Aj [Ap [i] ... Ap[i+1]]', and the corresponding values are held in the -same positions in \verb'Ax'. Column indices must be in the range 0 to -\verb'ncols'-1. If \verb'jumbled' is \verb'false', column indices must appear -in ascending order within each row. If \verb'jumbled' is \verb'true', column -indices may appear in any order within each row. No duplicate column indices -may appear in any row. \verb'Ap [0]' must equal zero, and \verb'Ap [nrows]' -must equal nvals. The \verb'Ap' array must be of size \verb'nrows'+1 (or -larger), and the \verb'Aj' and \verb'Ax' arrays must have size at least -\verb'nvals'. - -If \verb'nvals' is zero, then the content of the \verb'Aj' and \verb'Ax' arrays -is not accessed and they may be \verb'NULL' on input (if not \verb'NULL', they -are still freed and returned as \verb'NULL', if the method is successful). - -An example of the CSR format is shown below. Consider the following -matrix with 10 nonzero entries, and suppose the zeros are not stored. - - \begin{equation} - \label{eqn:Aexample} - A = \left[ - \begin{array}{cccc} - 4.5 & 0 & 3.2 & 0 \\ - 3.1 & 2.9 & 0 & 0.9 \\ - 0 & 1.7 & 3.0 & 0 \\ - 3.5 & 0.4 & 0 & 1.0 \\ - \end{array} - \right] - \end{equation} - -The \verb'Ap' array has length 5, since the matrix is 4-by-4. The first entry -must always zero, and \verb'Ap [5] = 10' is the number of entries. -The content of the arrays is shown below: - -{\footnotesize -\begin{verbatim} - int64_t Ap [ ] = { 0, 2, 5, 7, 10 } ; - int64_t Aj [ ] = { 0, 2, 0, 1, 3, 1, 2, 0, 1, 3 } ; - double Ax [ ] = { 4.5, 3.2, 3.1, 2.9, 0.9, 1.7, 3.0, 3.5, 0.4, 1.0 } ; \end{verbatim} } - -Spaces have been added to the \verb'Ap' array, just for illustration. Row zero -is in \verb'Aj [0..1]' (column indices) and \verb'Ax [0..1]' (values), starting -at \verb'Ap [0] = 0' and ending at \verb'Ap [0+1]-1 = 1'. The list of column -indices of row one is at \verb'Aj [2..4]' and row two is in \verb'Aj [5..6]'. -The last row (three) appears \verb'Aj [7..9]', because \verb'Ap [3] = 7' and -\verb'Ap [4]-1 = 10-1 = 9'. The corresponding numerical values appear in the -same positions in \verb'Ax'. - -To iterate over the rows and entries of this matrix, the following code can be -used -(assuming it has type \verb'GrB_FP64'): - - {\footnotesize - \begin{verbatim} - int64_t nvals = Ap [nrows] ; - for (int64_t i = 0 ; i < nrows ; i++) - { - // get A(i,:) - for (int64_t p = Ap [i] ; p < Ap [i+1] ; p++) - { - // get A(i,j) - int64_t j = Aj [p] ; // column index - double aij = Ax [iso ? 0 : p] ; // numerical value - } - } \end{verbatim}} - -If successful, the three pointers \verb'Ap', \verb'Aj', -and \verb'Ax' are set to \verb'NULL' on output. This denotes to the user -application that it is no longer responsible for freeing these arrays. -Internally, GraphBLAS has moved these arrays into its internal data structure. -They will eventually be freed no later than when the user does -\verb'GrB_free(&A)', but they may be freed or resized later, if the matrix -changes. If an unpack is performed, the freeing of these three arrays again -becomes the responsibility of the user application. - -The \verb'GxB_Matrix_pack_CSR' function will rarely fail, since it allocates -just $O(1)$ space. If it does fail, it returns \verb'GrB_OUT_OF_MEMORY', -and it leaves the three user arrays unmodified. They are still owned by -the user application, which is eventually responsible for freeing them with -\verb'free(Ap)', etc. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_CSR:} unpack a CSR matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_csr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_CSR' unpacks a matrix in CSR form. - -If successful, the \verb'GrB_Matrix A' is returned with no entries. -The CSR format is in the three arrays -\verb'Ap', \verb'Aj', and \verb'Ax'. If the matrix has no entries, the -\verb'Aj' and \verb'Ax' arrays may be returned as \verb'NULL'; this is not an -error, and \verb'GxB_Matrix_pack_CSR' also allows these two arrays to be -\verb'NULL' on input when the matrix has no entries. After a successful -unpack, the user application is responsible for freeing these three arrays via -\verb'free' (or the \verb'free' function passed to \verb'GxB_init'). The CSR -format is described in Section~\ref{matrix_unpack_csr}. - -If \verb'jumbled' is returned as \verb'false', column indices will appear in -ascending order within each row. If \verb'jumbled' is returned as \verb'true', -column indices may appear in any order within each row. If \verb'jumbled' is -passed in as \verb'NULL', then column indices will be returned in ascending -order in each row. No duplicate column indices will appear in any row. -\verb'Ap [0]' is zero, and \verb'Ap [nrows]' is equal to the number of entries -in the matrix (\verb'nvals'). The \verb'Ap' array will be of size -\verb'nrows'+1 (or larger), and the \verb'Aj' and \verb'Ax' arrays will have -size at least \verb'nvals'. - -This method takes $O(1)$ time if the matrix is already in CSR format -internally. Otherwise, the matrix is converted to CSR format and then -unpacked. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_CSC:} pack a CSC matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_csc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_CSC' packs a matrix from 3 user arrays in CSC format. -The \verb'GrB_Matrix A' must exist on input with the right type and dimensions. -No typecasting is done. -The arguments are identical to -\verb'GxB_Matrix_pack_CSR', except for how the 3 user arrays are -interpreted. The column ``pointer'' array has size \verb'ncols+1'. The row -indices of the columns are in \verb'Ai', and if \verb'jumbled' is false, -they must appear in ascending order in -each column. The corresponding numerical values are held in \verb'Ax'. The -row indices of column \verb'j' are held in \verb'Ai [Ap [j]...Ap [j+1]-1]', -and the corresponding numerical values are in the same locations in \verb'Ax'. - -The same matrix from Equation~\ref{eqn:Aexample}in -the last section (repeated here): - - \begin{equation} - A = \left[ - \begin{array}{cccc} - 4.5 & 0 & 3.2 & 0 \\ - 3.1 & 2.9 & 0 & 0.9 \\ - 0 & 1.7 & 3.0 & 0 \\ - 3.5 & 0.4 & 0 & 1.0 \\ - \end{array} - \right] - \end{equation} - -is held in CSC form as follows: - -{\footnotesize -\begin{verbatim} - int64_t Ap [ ] = { 0, 3, 6, 8, 10 } ; - int64_t Ai [ ] = { 0, 1, 3, 1, 2, 3, 0, 2, 1, 3 } ; - double Ax [ ] = { 4.5, 3.1, 3.5, 2.9, 1.7, 0.4, 3.2, 3.0, 0.9, 1.0 } ; \end{verbatim} } - -That is, the row indices of column 1 (the second column) are in -\verb'Ai [3..5]', and the values in the same place in \verb'Ax', -since \verb'Ap [1] = 3' and \verb'Ap [2]-1 = 5'. - -To iterate over the columns and entries of this matrix, the following code can -be used -(assuming it has type \verb'GrB_FP64'): - - {\footnotesize - \begin{verbatim} - int64_t nvals = Ap [ncols] ; - for (int64_t j = 0 ; j < ncols ; j++) - { - // get A(:,j) - for (int64_t p = Ap [j] ; p < Ap [j+1] ; p++) - { - // get A(i,j) - int64_t i = Ai [p] ; // row index - double aij = Ax [iso ? 0 : p] ; // numerical value - } - } \end{verbatim}} - -The method is identical to \verb'GxB_Matrix_pack_CSR'; just the format is -transposed. - -If \verb'Ap [ncols]' is zero, then the content of the \verb'Ai' and \verb'Ax' arrays -is not accessed and they may be \verb'NULL' on input (if not \verb'NULL', they -are still freed and returned as \verb'NULL', if the method is successful). - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_CSC:} unpack a CSC matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_csc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_CSC' unpacks a matrix in CSC form. - -If successful, the \verb'GrB_Matrix A' is returned with no entries. -The CSC format is in the three arrays -\verb'Ap', \verb'Ai', and \verb'Ax'. If the matrix has no entries, \verb'Ai' -and \verb'Ax' arrays are returned as \verb'NULL'; this is not an error, and -\verb'GxB_Matrix_pack_CSC' also allows these two arrays to be \verb'NULL' on -input when the matrix has no entries. After a successful unpack, the user -application is responsible for freeing these three arrays via \verb'free' (or -the \verb'free' function passed to \verb'GxB_init'). The CSC format is -described in Section~\ref{matrix_unpack_csc}. - -This method takes $O(1)$ time if the matrix is already in CSC format -internally. Otherwise, the matrix is converted to CSC format and then -unpacked. - - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_HyperCSR:} pack a HyperCSR matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_hypercsr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (plen+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= plen*sizeof(int64_t) - // where plen = 1 if nrows = 1, or nvec otherwise. - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_HyperCSR' packs a matrix in hypersparse CSR format. -The hypersparse HyperCSR format is identical to the CSR format, except that the -\verb'Ap' array itself becomes sparse, if the matrix has rows that are -completely empty. An array \verb'Ah' of size \verb'nvec' provides a list of -rows that appear in the data structure. For example, consider -Equation~\ref{eqn:Ahyper}, which is a sparser version of the matrix in -Equation~\ref{eqn:Aexample}. Row 2 and column 1 of this matrix are all zero. - - \begin{equation} - \label{eqn:Ahyper} - A = \left[ - \begin{array}{cccc} - 4.5 & 0 & 3.2 & 0 \\ - 3.1 & 0 & 0 & 0.9 \\ - 0 & 0 & 0 & 0 \\ - 3.5 & 0 & 0 & 1.0 \\ - \end{array} - \right] - \end{equation} - -The conventional CSR format would appear as follows. Since the third row (row -2) is all zero, accessing \verb'Ai [Ap [2] ... Ap [3]-1]' gives an empty set -(\verb'[2..1]'), and the number of entries in this row is -\verb'Ap [i+1] - Ap [i]' \verb'= Ap [3] - Ap [2] = 0'. - -{\footnotesize -\begin{verbatim} - int64_t Ap [ ] = { 0, 2,2, 4, 5 } ; - int64_t Aj [ ] = { 0, 2, 0, 3, 0 3 } - double Ax [ ] = { 4.5, 3.2, 3.1, 0.9, 3.5, 1.0 } ; \end{verbatim} } - -A hypersparse CSR format for this same matrix would discard -these duplicate integers in \verb'Ap'. Doing so requires -another array, \verb'Ah', that keeps track of the rows that appear -in the data structure. - -{\footnotesize -\begin{verbatim} - int64_t nvec = 3 ; - int64_t Ah [ ] = { 0, 1, 3 } ; - int64_t Ap [ ] = { 0, 2, 4, 5 } ; - int64_t Aj [ ] = { 0, 2, 0, 3, 0 3 } - double Ax [ ] = { 4.5, 3.2, 3.1, 0.9, 3.5, 1.0 } ; \end{verbatim} } - -Note that the \verb'Aj' and \verb'Ax' arrays are the same in the CSR and -HyperCSR formats. If \verb'jumbled' is false, the row indices in \verb'Ah' -must appear in ascending order, and no duplicates can appear. To iterate over -this data structure (assuming it has type \verb'GrB_FP64'): - - {\footnotesize - \begin{verbatim} - int64_t nvals = Ap [nvec] ; - for (int64_t k = 0 ; k < nvec ; k++) - { - int64_t i = Ah [k] ; // row index - // get A(i,:) - for (int64_t p = Ap [k] ; p < Ap [k+1] ; p++) - { - // get A(i,j) - int64_t j = Aj [p] ; // column index - double aij = Ax [iso ? 0 : p] ; // numerical value - } - } \end{verbatim}} - -\vspace{-0.05in} -This is more complex than the CSR format, but it requires at most -$O(e)$ space, where $A$ is $m$-by-$n$ with $e$ = \verb'nvals' entries. The -CSR format requires $O(m+e)$ space. If $e << m$, then the size $m+1$ -of \verb'Ap' can dominate the memory required. In the hypersparse form, -\verb'Ap' takes on size \verb'nvec+1', and \verb'Ah' has size \verb'nvec', -where \verb'nvec' is the number of rows that appear in the data structure. -The CSR format can be viewed as a dense array (of size \verb'nrows') -of sparse row vectors. By contrast, the hypersparse CSR format is a sparse -array (of size \verb'nvec') of sparse row vectors. - -The pack takes $O(1)$ time. If successful, the four arrays \verb'Ah', -\verb'Ap', \verb'Aj', and \verb'Ax' are returned as \verb'NULL', and the -hypersparse \verb'GrB_Matrix A' is modified to contain the entries -they describe. - -If the matrix has no entries, then the content of the \verb'Aj' and \verb'Ax' arrays -is not accessed and they may be \verb'NULL' on input (if not \verb'NULL', they -are still freed and returned as \verb'NULL', if the method is successful). - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_HyperCSR:} unpack a HyperCSR matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_hypercsr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_HyperCSR' unpacks a matrix in HyperCSR format. - -If successful, the \verb'GrB_Matrix A' is returned with no entries. -The number of non-empty rows is -\verb'nvec'. The hypersparse CSR format is in the four arrays \verb'Ah', -\verb'Ap', \verb'Aj', and \verb'Ax'. If the matrix has no entries, the -\verb'Aj' and \verb'Ax' arrays are returned as \verb'NULL'; this is not an -error. After a successful unpack, the user application is responsible for -freeing these three arrays via \verb'free' (or the \verb'free' function passed -to \verb'GxB_init'). The hypersparse CSR format is described in -Section~\ref{matrix_pack_hypercsr}. - -This method takes $O(1)$ time if the matrix is already in HyperCSR format -internally. Otherwise, the matrix is converted to HyperCSR format and then -unpacked. - -In v7.3.0 and later, a hypersparse matrix \verb'A' also may include a hash -table for \verb'Ah', called the {\em hyper-hash}, based on \cite{Green19}. It -allows for fast lookups of entries in \verb'Ah'. The hyper-hash is not -exported by this method. Instead, it is discarded. Use -\verb'GxB_unpack_HyperHash' (Section~\ref{unpack_hyperhash}) to preserve it, -prior to calling this method. If the matrix is re-imported, and the hyper-hash -is not preserved, it is recomputed from \verb'Ah' when needed. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_HyperCSC:} pack a HyperCSC matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_hypercsc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (plen+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= plen*sizeof(int64_t) - // where plen = 1 if ncols = 1, or nvec otherwise. - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A)*(type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_HyperCSC' packs a matrix in hypersparse CSC format. -It is identical to \verb'GxB_Matrix_pack_HyperCSR', except the data -structure defined by the four arrays \verb'Ah', \verb'Ap', \verb'Ai', and -\verb'Ax' holds the matrix as a sparse array of \verb'nvec' sparse column -vectors. The following code iterates over the matrix, -assuming it has type \verb'GrB_FP64': - - \vspace{-0.10in} - {\footnotesize - \begin{verbatim} - int64_t nvals = Ap [nvec] ; - for (int64_t k = 0 ; k < nvec ; k++) - { - int64_t j = Ah [k] ; // column index - // get A(:,j) - for (int64_t p = Ap [k] ; p < Ap [k+1] ; p++) - { - // get A(i,j) - int64_t i = Ai [p] ; // row index - double aij = Ax [iso ? 0 : p] ; // numerical value - } - } \end{verbatim}} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_HyperCSC:} unpack a HyperCSC matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_hypercsc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_HyperCSC' unpacks a matrix in HyperCSC form. - -If successful, the \verb'GrB_Matrix A' is -returned with no entries. -The number of non-empty -rows is in \verb'nvec'. The hypersparse CSC format is in the four arrays -\verb'Ah', \verb'Ap', \verb'Ai', and \verb'Ax'. If the matrix has no entries, -the \verb'Ai' and \verb'Ax' arrays are returned as \verb'NULL'; this is not an -error. After a successful unpack, the user application is responsible for -freeing these three arrays via \verb'free' (or the \verb'free' function passed -to \verb'GxB_init'). The hypersparse CSC format is described in -Section~\ref{matrix_pack_hypercsc}. - -This method takes $O(1)$ time if the matrix is already in HyperCSC format -internally. Otherwise, the matrix is converted to HyperCSC format and then -unpacked. - -In v7.3.0 and later, a hypersparse matrix \verb'A' also may include a hash -table for \verb'Ah', called the {\em hyper-hash}, based on \cite{Green19}. It -allows for fast lookups of entries in \verb'Ah'. The hyper-hash is not -exported by this method. Instead, it is discarded. Use -\verb'GxB_unpack_HyperHash' (Section~\ref{unpack_hyperhash}) to preserve it, -prior to calling this method. If the matrix is re-imported, and the hyper-hash -is not preserved, it is recomputed from \verb'Ah' when needed. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_unpack\_HyperHash:} unpack the hypersparse hash} -%------------------------------------------------------------------------------- -\label{unpack_hyperhash} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_unpack_HyperHash // move A->Y into Y -( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to move from A - const GrB_Descriptor desc // unused -) ; -\end{verbatim} -} \end{mdframed} - - -SuiteSparse:GraphBLAS v7.3.0 adds a new internal component to the -hypersparse matrix format: the {\em hyper-hash} \verb'GrB_Matrix' \verb'A->Y'. -The matrix provides a fast lookup into the hyperlist \verb'Ah'. - -\verb'GxB_unpack_HyperHash' unpacks the hyper-hash from the hypersparse matrix -\verb'A'. Normally, this method is called immediately before calling one of -the two methods \verb'GxB_Matrix_unpack_Hyper(CSR/CSC)'. For example, to -unpack then pack a hypersparse CSC matrix: - - {\footnotesize - \begin{verbatim} - GrB_Matrix Y = NULL ; - // to unpack all of A: - GxB_unpack_HyperHash (A, &Y, desc) ; // first unpack A->Y into Y - GxB_Matrix_unpack_HyperCSC (A, // then unpack the rest of A - &Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, - &iso, &nvec, &jumbled, descriptor) ; - // use the unpacked contents of A here, but do not change Ah or nvec. - ... - // to pack the data back into A: - GxB_Matrix_pack_HyperCSC (A, ...) ; // pack most of A, except A->Y - GxB_pack_HyperHash (A, &Y, desc) ; // then pack A->Y \end{verbatim}} - -The same process is used with \verb'GxB_Matrix_unpack_HyperCSR'. - -If \verb'A' is not hypersparse on input to \verb'GxB_unpack_HyperHash', or if -\verb'A' is hypersparse but does yet not have a hyper-hash and or does not need -one, then \verb'Y' is returned as \verb'NULL'. This is not an error condition, -and \verb'GrB_SUCCESS' is returned. - -The hyper-hash of a hypersparse matrix \verb'A' is a matrix that provides quick -access to the inverse of \verb'Ah'. It is not always needed and may not be -present. It is left as pending work to be computed when needed. To ensure -that the hyper-hash is constructed for a hypersparse matrix \verb'A' (if it -needs one), use \verb'GrB_Matrix_wait (A, GrB_MATERIALIZE)' - -If \verb'Y' is moved from \verb'A' and returned as non-\verb'NULL' to the -caller, then it is the responsibility of the user application to free it, or to -re-pack it back into \verb'A' via \verb'GxB_pack_HyperHash', as shown in the -example above. - -If this method is called to remove the hyper-hash \verb'Y' from the hypersparse -matrix \verb'A', and then \verb'GrB_Matrix_wait (A, GrB_MATERIALZE)' is called, -a new hyper-hash matrix is constructed for \verb'A' (if it needs one). - -Not all hypersparse matrices need the hyper-hash. The hyper-hash is built -only if the matrix has more than 1024 non-empty rows (if held by row) or -columns (if held by column). This threshold of 1024 can be revised with -\verb'GrB_set' as a global setting, \verb'GxB_HYPER_HASH' -(See Section \ref{get_set_global}). - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_pack\_HyperHash:} pack the hypersparse hash} -%------------------------------------------------------------------------------- -\label{pack_hyperhash} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_pack_HyperHash // move Y into A->Y -( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to pack into A - const GrB_Descriptor desc // unused -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_pack_HyperHash' assigns the input \verb'Y' matrix as the \verb'A->Y' -hyper-hash of the hypersparse matrix \verb'A'. Normally, this method is called -immediately after calling one of the two methods -\verb'GxB_Matrix_pack_Hyper(CSR/CSC)'. - -If \verb'A' is not hypersparse on input to \verb'GxB_pack_HyperHash', or if -\verb'A' already has a hyper-hash matrix, or if \verb'Y' is \verb'NULL' on -input, then nothing happens and \verb'Y' is unchanged. This is not an error -condition and this method returns \verb'GrB_SUCCESS'. In this case, if -\verb'Y' is non-\verb'NULL' after calling this method, it owned by the user -application and freeing it is the responsibility of the user application. - -If \verb'Y' is moved into \verb'A' as its hyper-hash, then the caller's -\verb'Y' is set to \verb'NULL' to indicate that it has been moved into -\verb'A'. It is no longer owned by the caller, but is instead becomes an -opaque component of the \verb'A' matrix. It will be freed by -SuiteSparse:GraphBLAS if \verb'A' is modified or freed. - -Results are undefined if the input \verb'Y' was not created by -\verb'GxB_unpack_HyperHash' (see the example in Section \ref{unpack_hyperhash}) -or if the \verb'Ah' contents or \verb'nvec' of the matrix \verb'A' are modified -after they were unpacked by \verb'GxB_Matrix_unpack_Hyper(CSR/CSC)'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_BitmapR:} pack a BitmapR matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_bitmapr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_BitmapR' packs a matrix from 2 user arrays in BitmapR -format. -The matrix must exist on input with the right type and dimensions. No typecasting is done. - -The \verb'GrB_Matrix' \verb'A' is populated from the arrays \verb'Ab' and -\verb'Ax', each of which are size \verb'nrows*ncols'. Both arrays must have -been created with the ANSI C \verb'malloc', \verb'calloc', or \verb'realloc' -functions (by default), or by the corresponding \verb'malloc_function', -\verb'calloc_function', or \verb'realloc_function' provided to \verb'GxB_init'. -These arrays define the pattern and values of the new matrix \verb'A': - -\begin{itemize} -\item \verb'int8_t Ab [nrows*ncols] ;' The \verb'Ab' array defines which -entries of \verb'A' are present. If \verb'Ab[i*ncols+j]=1', then the entry -$A(i,j)$ is present, with value \verb'Ax[i*ncols+j]'. If -\verb'Ab[i*ncols+j]=0', then the entry $A(i,j)$ is not present. The \verb'Ab' -array must contain only 0s and 1s. The \verb'nvals' input must exactly match -the number of 1s in the \verb'Ab' array. - -\item \verb'ctype Ax [nrows*ncols] ;' The \verb'Ax' array defines the values -of entries in the matrix. It is passed in as a \verb'(void *)' pointer, but it -must point to an array of size \verb'nrows*ncols' values, each of size -\verb'sizeof(ctype)', where \verb'ctype' is the exact type in C that -corresponds to the \verb'GrB_Type type' parameter. That is, if \verb'type' is -\verb'GrB_INT32', then \verb'ctype' is \verb'int32_t'. User types may be used, -just the same as built-in types. -If \verb'Ab[p]' is zero, the value of \verb'Ax[p]' is ignored. - -\end{itemize} - -To iterate over the rows and entries of this matrix, the following code can be -used (assuming it has type \verb'GrB_FP64'): - - {\footnotesize - \begin{verbatim} - for (int64_t i = 0 ; i < nrows ; i++) - { - // get A(i,:) - for (int64_t j = 0 ; j < ncols ; j++) - { - // get A(i,j) - int64_t p = i*ncols + j ; - if (Ab [p]) - { - double aij = Ax [iso ? 0 : p] ; // numerical value - } - } - } \end{verbatim}} - -On successful pack of \verb'A', the two pointers \verb'Ab', \verb'Ax', -are set to \verb'NULL' on output. This denotes to the user -application that it is no longer responsible for freeing these arrays. -Internally, GraphBLAS has moved these arrays into its internal data structure. -They will eventually be freed no later than when the user does -\verb'GrB_free(&A)', but they may be freed or resized later, if the matrix -changes. If an unpack is performed, the freeing of these three arrays again -becomes the responsibility of the user application. - -The \verb'GxB_Matrix_pack_BitmapR' function will rarely fail, since it allocates -just $O(1)$ space. If it does fail, it returns \verb'GrB_OUT_OF_MEMORY', -and it leaves the two user arrays unmodified. They are still owned by -the user application, which is eventually responsible for freeing them with -\verb'free(Ab)', etc. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_BitmapR:} unpack a BitmapR matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_bitmapr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_BitmapR' unpacks a matrix in BitmapR form. -If successful, the \verb'GrB_Matrix A' is returned with no entries. -The number of entries is in \verb'nvals'. -The BitmapR format is two arrays \verb'Ab', and \verb'Ax'. After an -unpack, the user application is responsible for freeing these -arrays via \verb'free' (or the \verb'free' function passed to \verb'GxB_init'). -The BitmapR format is described in Section~\ref{matrix_pack_bitmapr}. -If \verb'Ab[p]' is zero, the value of \verb'Ax[p]' is undefined. -This method takes $O(1)$ time if the matrix is already in BitmapR format. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_BitmapC:} pack a BitmapC matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_bitmapc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_BitmapC' packs a matrix from 2 user arrays in BitmapC -format. It is identical to \verb'GxB_Matrix_pack_BitmapR', except that the -entry $A(i,j)$ is held in \verb'Ab[i+j*nrows]' and \verb'Ax[i+j*nrows]', -in column-major format. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_BitmapC:} unpack a BitmapC matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_bitmapc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_BitmapC' unpacks a matrix in BitmapC form. -It is identical to \verb'GxB_Matrix_unpack_BitmapR', except that the -entry $A(i,j)$ is held in \verb'Ab[i+j*nrows]' and \verb'Ax[i+j*nrows]', -in column-major format. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_FullR:} pack a FullR matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_fullr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_FullR' packs a matrix from a user array in FullR format. -For the \verb'FullR' format, t value of $A(i,j)$ is \verb'Ax[i*ncols+j]'. To -iterate over the rows and entries of this matrix, the following code can be -used (assuming it has type \verb'GrB_FP64'). If \verb'A' is both full and iso, -it takes $O(1)$ memory, regardless of \verb'nrows' and \verb'ncols'. - - \vspace{-0.1in} - {\footnotesize - \begin{verbatim} - for (int64_t i = 0 ; i < nrows ; i++) - { - for (int64_t j = 0 ; j < ncols ; j++) - { - int64_t p = i*ncols + j ; - double aij = Ax [iso ? 0 : p] ; // numerical value of A(i,j) - } - } \end{verbatim}} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_FullR:} unpack a FullR matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_fullr} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_FullR' unpacks a matrix in FullR form. It is identical -to \verb'GxB_Matrix_unpack_BitmapR', except that all entries must be present. -Prior to unpack, \verb'GrB_Matrix_nvals (&nvals, A)' must return -\verb'nvals' equal to \verb'nrows*ncols'. Otherwise, if the \verb'A' is -unpacked with \newline \verb'GxB_Matrix_unpack_FullR', an error is returned -(\verb'GrB_INVALID_VALUE') and the matrix is not unpacked. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_pack\_FullC:} pack a FullC matrix} -%------------------------------------------------------------------------------- -\label{matrix_pack_fullc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_pack_FullC' packs a matrix from a user arrays in FullC -format. For the \verb'FullC' format, -the value of $A(i,j)$ is \verb'Ax[i+j*nrows]'. -To iterate over the rows and entries of this matrix, the following code can be -used (assuming it has type \verb'GrB_FP64'). -If \verb'A' is both full and iso, it takes $O(1)$ memory, -regardless of \verb'nrows' and \verb'ncols'. - - \vspace{-0.1in} - {\footnotesize - \begin{verbatim} - for (int64_t i = 0 ; i < nrows ; i++) - { - for (int64_t j = 0 ; j < ncols ; j++) - { - int64_t p = i + j*nrows ; - double aij = Ax [iso ? 0 : p] ; // numerical value of A(i,j) - } - } \end{verbatim}} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_unpack\_FullC:} unpack a FullC matrix} -%------------------------------------------------------------------------------- -\label{matrix_unpack_fullc} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_unpack_FullC' unpacks a matrix in FullC form. It is identical -to \verb'GxB_Matrix_unpack_BitmapC', except that all entries must be present. -That is, prior to unpack, \verb'GrB_Matrix_nvals (&nvals, A)' must return -\verb'nvals' equal to \verb'nrows*ncols'. Otherwise, if the \verb'A' is -unpacked with \newline \verb'GxB_Matrix_unpack_FullC', an error is returned -(\verb'GrB_INVALID_VALUE') and the matrix is not unpacked. - -\newpage -%=============================================================================== -\subsection{GraphBLAS import/export: using copy semantics} %==================== -%=============================================================================== -\label{GrB_import_export} - -The v2.0 C API includes import/export methods for matrices (not vectors) using -a different strategy as compared to the \verb'GxB*pack/unpack*' methods. The -\verb'GxB' methods are based on {\em move semantics}, in which ownership of -arrays is passed between SuiteSparse:GraphBLAS and the user application. This -allows the \verb'GxB*pack/unpack*' methods to work in $O(1)$ time, and require -no additional memory, but it requires that GraphBLAS and the user application -agree on which memory manager to use. This is done via \verb'GxB_init'. This -allows GraphBLAS to \verb'malloc' an array that can be later \verb'free'd by -the user application, and visa versa. - -The \verb'GrB' import/export methods take a different approach. The data -is always copied in and out between the opaque GraphBLAS matrix and the -user arrays. This takes $\Omega(e)$ time, if the matrix has $e$ entries, -and requires more memory. It has the advantage that it does not require -GraphBLAS and the user application to agree on what memory manager to use, -since no ownership of allocated arrays is changed. - -The format for \verb'GrB_Matrix_import' and \verb'GrB_Matrix_export' is -controlled by the following enum: - -{\footnotesize -\begin{verbatim} -typedef enum -{ - GrB_CSR_FORMAT = 0, // CSR format (equiv to GxB_SPARSE with GrB_ROWMAJOR) - GrB_CSC_FORMAT = 1, // CSC format (equiv to GxB_SPARSE with GrB_COLMAJOR) - GrB_COO_FORMAT = 2 // triplet format (like input to GrB*build) -} -GrB_Format ; \end{verbatim}} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_import:} import a matrix} -%------------------------------------------------------------------------------- -\label{GrB_matrix_import} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_import // import a matrix -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format -) ; -\end{verbatim} -} \end{mdframed} - -The \verb'GrB_Matrix_import' method copies from user-provided arrays into an -opaque \verb'GrB_Matrix' and \verb'GrB_Matrix_export' copies data out, from an -opaque \verb'GrB_Matrix' into user-provided arrays. - -The suffix \verb'TYPE' in the prototype above is one of \verb'BOOL', -\verb'INT8', \verb'INT16', etc, for built-n types, or \verb'UDT' for -user-defined types. The type of the \verb'Ax' array must match this type. No -typecasting is performed. - -Unlike the \verb'GxB' -pack/unpack methods, memory is not handed off between the user application -and GraphBLAS. The three arrays \verb'Ap', \verb'Ai'. and \verb'Ax' are not -modified, and are still owned by the user application when the method finishes. - -The matrix can be imported in one of three different formats: - -\begin{packed_itemize} - \item \verb'GrB_CSR_FORMAT': % CSR format (equiv to GxB_SPARSE with GrB_ROWMAJOR) - Compressed-row format. \verb'Ap' is an array of size \verb'nrows+1'. - The arrays \verb'Ai' and \verb'Ax' are of size \verb'nvals = Ap [nrows]', - and \verb'Ap[0]' must be zero. - The column indices of entries in the \verb'i'th row appear in - \verb'Ai[Ap[i]...Ap[i+1]-1]', and the values of those entries appear in - the same locations in \verb'Ax'. - The column indices need not be in any particular order. - - \item \verb'GrB_CSC_FORMAT': % CSC format (equiv to GxB_SPARSE with GrB_COLMAJOR) - Compressed-column format. \verb'Ap' is an array of size \verb'ncols+1'. - The arrays \verb'Ai' and \verb'Ax' are of size \verb'nvals = Ap [ncols]', - and \verb'Ap[0]' must be zero. - The row indices of entries in the \verb'j'th column appear in - \verb'Ai[Ap[j]...Ap[j+1]-1]', and the values of those entries appear in - the same locations in \verb'Ax'. - The row indices need not be in any particular order. - - \item \verb'GrB_COO_FORMAT': % triplet format (like input to GrB*build) - Coordinate format. This is the same format as \newline - \verb'GrB_Matrix_build'. - The three arrays \verb'Ap', \verb'Ai', and \verb'Ax' have the same - size. The \verb'k'th tuple has row index \verb'Ai[k]', - column index \verb'Ap[k]', and value \verb'Ax[k]'. The tuples can - appear any order, but no duplicates are permitted. - -% \item \verb'GrB_DENSE_ROW_FORMAT': % FullR format (GxB_FULL with GrB_ROWMAJOR) -% Dense matrix format, held by row. Only the \verb'Ax' array is used, of -% size \verb'nrows*ncols'. -% It holds the matrix in dense format, in row major order. -% -% \item \verb'GrB_DENSE_COL_FORMAT': % FullC format (GxB_FULL with GrB_ROWMAJOR) -% Dense matrix format, held by column. Only the \verb'Ax' array is used, of -% size \verb'nrows*ncols'. -% It holds the matrix in dense format, in column major order. - -\end{packed_itemize} - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_export:} export a matrix} -%------------------------------------------------------------------------------- -\label{GrB_matrix_export} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_export // export a matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - *Ax, // values (must match the type of A_input) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Matrix_export' copies the contents of a matrix into three -user-provided arrays, using any one of the three different formats -described in Section~\ref{GrB_matrix_import}. The size of the arrays must be -at least as large as the lengths returned by \verb'GrB_Matrix_exportSize'. The -matrix \verb'A' is not modified. - -On input, the size of the three arrays \verb'Ap', \verb'Ai', and \verb'Ax' is -given by \verb'Ap_len', \verb'Ai_len', and \verb'Ax_len', respectively. These -values are in terms of the number of entries in these arrays, not the number of -bytes. On output, these three value are adjusted to report the number of -entries written to the three arrays. - -The suffix \verb'TYPE' in the prototype above is one of \verb'BOOL', -\verb'INT8', \verb'INT16', etc, for built-n types, or \verb'UDT' for -user-defined types. The type of the \verb'Ax' array must match this type. No -typecasting is performed. - -% The \verb'GrB_DENSE_ROW_FORMAT' and \verb'GrB_DENSE_COL_FORMAT' formats can -% only be used if all entries are present in the matrix. That is, -% \verb'GrB_Matrix_nvals (&nvals,A)' must return \verb'nvals' equal to -% \verb'nrows*ncols'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_exportSize:} determine size of export} -%------------------------------------------------------------------------------- -\label{export_size} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export -( - GrB_Index *Ap_len, // # of entries required for Ap (not # of bytes) - GrB_Index *Ai_len, // # of entries required for Ai (not # of bytes) - GrB_Index *Ax_len, // # of entries required for Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export -) ; -\end{verbatim} -} \end{mdframed} - -Returns the required sizes of the arrays \verb'Ap', \verb'Ai', and \verb'Ax' -for exporting a matrix using \verb'GrB_Matrix_export', using the same -\verb'format'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_exportHint:} determine best export format} -%------------------------------------------------------------------------------- -\label{export_hint} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Matrix_exportHint // suggest the best export format -( - GrB_Format *format, // export format - GrB_Matrix A // matrix to export -) ; -\end{verbatim} -} \end{mdframed} - -This method suggests the most efficient format for the export of a given -matrix. For SuiteSparse:GraphBLAS, the hint depends on the current -format of the \verb'GrB_Matrix': - -\begin{packed_itemize} -\item \verb'GxB_SPARSE', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_SPARSE', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' -\item \verb'GxB_HYPERSPARSE': export as \verb'GrB_COO_FORMAT' -\item \verb'GxB_BITMAP', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_BITMAP', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' -%\item \verb'GxB_FULL', \verb'GrB_ROWMAJOR': export as \verb'GrB_DENSE_ROW_FORMAT' -%\item \verb'GxB_FULL', \verb'GrB_COLMAJOR': export as \verb'GrB_DENSE_COL_FORMAT' -\item \verb'GxB_FULL', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' -\item \verb'GxB_FULL', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' -\end{packed_itemize} - -\newpage -%=============================================================================== -\subsection{Sorting methods} -%=============================================================================== -\label{sorting_methods} - -\verb'GxB_Matrix_sort' provides a mechanism to sort all the rows or -all the columns of a matrix, and \verb'GxB_Vector_sort' sorts all the -entries in a vector. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_sort:} sort a vector} -%------------------------------------------------------------------------------- -\label{vector_sort} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_sort -( - // output: - GrB_Vector w, // vector of sorted values - GrB_Vector p, // vector containing the permutation - // input - GrB_BinaryOp op, // comparator op - GrB_Vector u, // vector to sort - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Vector_sort' is identical to sorting the single column of an -\verb'n'-by-1 matrix. -Refer to Section \ref{matrix_sort} for details. -% -The \verb'op' cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_sort:} sort the rows/columns of a matrix} -%------------------------------------------------------------------------------- -\label{matrix_sort} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_sort -( - // output: - GrB_Matrix C, // matrix of sorted values - GrB_Matrix P, // matrix containing the permutations - // input - GrB_BinaryOp op, // comparator op - GrB_Matrix A, // matrix to sort - const GrB_Descriptor desc -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GxB_Matrix_sort' sorts all the rows or all the columns of a matrix. -Each row (or column) is sorted separately. The rows are sorted by default. -To sort the columns, use \verb'GrB_DESC_T0'. A comparator operator is -provided to define the sorting order (ascending or descending). -For example, to sort a \verb'GrB_FP64' matrix in ascending order, -use \verb'GrB_LT_FP64' as the \verb'op', and to sort in descending order, -use \verb'GrB_GT_FP64'. - -The \verb'op' must have a return value of \verb'GrB_BOOL', and the types of -its two inputs must be the same. The entries in \verb'A' are typecasted to -the inputs of the \verb'op', if necessary. Matrices with user-defined types -can be sorted with a user-defined comparator operator, whose two input types -must match the type of \verb'A', and whose output is \verb'GrB_BOOL'. - -The two matrix outputs are \verb'C' and \verb'P'. Any entries present on input -in \verb'C' or \verb'P' are discarded on output. The type of \verb'C' must -match the type of \verb'A' exactly. The dimensions of \verb'C', \verb'P', and -\verb'A' must also match exactly (even with the \verb'GrB_DESC_T0' -descriptor). - -With the default sort (by row), suppose \verb'A(i,:)' contains \verb'k' -entries. In this case, \verb'C(i,0:k-1)' contains the values of those entries -in sorted order, and \verb'P(i,0:k-1)' contains their corresponding column -indices in the matrix \verb'A'. If two values are the same, ties are broken -according column index. - -If the matrix is sorted by column, and \verb'A(:,j)' contains \verb'k' entries, -then \verb'C(0:k-1,j)' contains the values of those entries in sorted order, -and \verb'P(0:k-1,j)' contains their corresponding row indices in the matrix -\verb'A'. If two values are the same, ties are broken according row index. - -The outputs \verb'C' and \verb'P' are both optional; either one (but not both) -may be \verb'NULL', in which case that particular output matrix is not -computed. -% -The \verb'op' cannot be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\newpage -%=============================================================================== -\subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== -%=============================================================================== -\label{descriptor} - -A GraphBLAS {\em descriptor} modifies the behavior of a GraphBLAS operation. -If the descriptor is \verb'GrB_NULL', defaults are used. - -The access to these parameters and their values is governed -by two \verb'enum' types, \verb'GrB_Desc_Field' and \verb'GrB_Desc_Value': - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -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_AxB_METHOD = 1000, // descriptor for selecting C=A*B algorithm - GxB_SORT = 35 // control sort in GrB_mxm - GxB_COMPRESSION = 36, // select compression for serialize - GxB_IMPORT = 37, // secure vs fast pack -} -GrB_Desc_Field ; - -typedef enum -{ - // for all GrB_Descriptor fields: - GrB_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 complement of the mask - GrB_STRUCTURE = 4, // use the structure of the mask - // for GrB_INP0 and GrB_INP1 only: - GrB_TRAN = 3, // use the transpose of the input - // 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) - // for GxB_IMPORT only: - GxB_SECURE_IMPORT = 502 // GxB*_pack* methods trust their input data -} -GrB_Desc_Value ; -\end{verbatim} } \end{mdframed} - -\newpage - -\begin{itemize} -\item \verb'GrB_OUTP' is a parameter that modifies the output of a - GraphBLAS operation. In the default case, the output is not cleared, and - ${\bf Z = C \odot T}$ then ${\bf C \langle M \rangle = Z}$ are computed - as-is, where ${\bf T}$ is the results of the particular GraphBLAS - operation. - - In the non-default case, ${\bf Z = C \odot T}$ is first computed, using the - results of ${\bf T}$ and the accumulator $\odot$. After this is done, if - the \verb'GrB_OUTP' descriptor field is set to \verb'GrB_REPLACE', then the - output is cleared of its entries. Next, the assignment ${\bf C \langle M - \rangle = Z}$ is performed. - -\item \verb'GrB_MASK' is a parameter that modifies the \verb'Mask', - even if the mask is not present. - - If this parameter is set to its default value, and if the mask is not - present (\verb'Mask==NULL') then implicitly \verb'Mask(i,j)=1' for all - \verb'i' and \verb'j'. If the mask is present then \verb'Mask(i,j)=1' - means that \verb'C(i,j)' is to be modified by the ${\bf C \langle M \rangle - = Z}$ update. Otherwise, if \verb'Mask(i,j)=0', then \verb'C(i,j)' is not - modified, even if \verb'Z(i,j)' is an entry with a different value; that - value is simply discarded. - - If the \verb'GrB_MASK' parameter is set to \verb'GrB_COMP', then the - use of the mask is complemented. In this case, if the mask is not present - (\verb'Mask==NULL') then implicitly \verb'Mask(i,j)=0' for all \verb'i' and - \verb'j'. This means that none of ${\bf C}$ is modified and the entire - computation of ${\bf Z}$ might as well have been skipped. That is, a - complemented empty mask means no modifications are made to the output - object at all, except perhaps to clear it in accordance with the - \verb'GrB_OUTP' descriptor. With a complemented mask, if the mask is - present then \verb'Mask(i,j)=0' means that \verb'C(i,j)' is to be modified - by the ${\bf C \langle M \rangle = Z}$ update. Otherwise, if - \verb'Mask(i,j)=1', then \verb'C(i,j)' is not modified, even if - \verb'Z(i,j)' is an entry with a different value; that value is simply - discarded. - - If the \verb'GrB_MASK' parameter is set to \verb'GrB_STRUCTURE', - then the values of the mask are ignored, and just the pattern of the - entries is used. Any entry \verb'M(i,j)' in the pattern is treated as if - it were true. - - The \verb'GrB_COMP' and \verb'GrB_STRUCTURE' settings can be combined, - either by setting the mask option twice (once with each value), or by - setting the mask option to \verb'GrB_COMP+GrB_STRUCTURE' (the latter is an - extension to the specification). - - Using a parameter to complement the \verb'Mask' is very useful because - constructing the actual complement of a very sparse mask is impossible - since it has too many entries. If the number of places in \verb'C' - that should be modified is very small, then use a sparse mask without - complementing it. If the number of places in \verb'C' that should - be protected from modification is very small, then use a sparse mask - to indicate those places, and use a descriptor \verb'GrB_MASK' that - complements the use of the mask. - -\item \verb'GrB_INP0' and \verb'GrB_INP1' modify the use of the - first and second input matrices \verb'A' and \verb'B' of the GraphBLAS - operation. - - If the \verb'GrB_INP0' is set to \verb'GrB_TRAN', then \verb'A' is - transposed before using it in the operation. Likewise, if - \verb'GrB_INP1' is set to \verb'GrB_TRAN', then the second input, - typically called \verb'B', is transposed. - - Vectors and scalars are never transposed via the descriptor. If a method's - first parameter is a matrix and the second a vector or scalar, then - \verb'GrB_INP0' modifies the matrix parameter and - \verb'GrB_INP1' is ignored. If a method's first parameter is a - vector or scalar and the second a matrix, then \verb'GrB_INP1' - modifies the matrix parameter and \verb'GrB_INP0' is ignored. - - To clarify this in each function, the inputs are labeled as - \verb'first input:' and \verb'second input:' in the function signatures. - -\item \verb'GxB_AxB_METHOD' suggests the method that should be - used to compute \verb'C=A*B'. All the methods compute the same result, - except they may have different floating-point roundoff errors. This - descriptor should be considered as a hint; SuiteSparse:GraphBLAS is - free to ignore it. - - \begin{itemize} - - \item \verb'GrB_DEFAULT' means that a method is selected automatically. - - \item \verb'GxB_AxB_SAXPY': select any saxpy-based method: - \verb'GxB_AxB_GUSTAVSON', and/or - \verb'GxB_AxB_HASH', or any mix of the two, - in contrast to the dot-product method. - - \item \verb'GxB_AxB_GUSTAVSON': an extended version of Gustavson's method - \cite{Gustavson78}, which is a very good general-purpose method, but - sometimes the workspace can be too large. Assuming all matrices are stored - by column, it computes \verb'C(:,j)=A*B(:,j)' with a sequence of {\em - saxpy} operations (\verb'C(:,j)+=A(:,k)*B(k:,j)' for each nonzero - \verb'B(k,j)'). In the {\em coarse Gustavson} method, each internal thread - requires workspace of size $m$, to the number of rows of \verb'C', which is - not suitable if the matrices are extremely sparse or if there are many - threads. For the {\em fine Gustavson} method, threads can share workspace - and update it via atomic operations. If all matrices are stored by row, - then it computes \verb'C(i,:)=A(i,:)*B' in a sequence of sparse {\em saxpy} - operations, and using workspace of size $n$ per thread, or group of - threads, corresponding to the number of columns of \verb'C'. - - \item \verb'GxB_AxB_HASH': a hash-based method, based on - \cite{10.1145/3229710.3229720}. It is very efficient for hypersparse - matrices, matrix-vector-multiply, and when $|{\bf B}|$ is small. - SuiteSparse:GraphBLAS includes a {\em coarse hash} method, in which - each thread has its own hash workspace, and a {\em fine hash} - method, in which groups of threads share a single hash workspace, - as concurrent data structure, using atomics. - -% [2] Yusuke Nagasaka, Satoshi Matsuoka, Ariful Azad, and Aydin Buluc. 2018. -% High-Performance Sparse Matrix-Matrix Products on Intel KNL and Multicore -% Architectures. In Proc. 47th Intl. Conf. on Parallel Processing (ICPP '18). -% Association for Computing Machinery, New York, NY, USA, Article 34, 1–10. -% DOI:https://doi.org/10.1145/3229710.3229720 - -\item \verb'GxB_AxB_DOT': computes \verb"C(i,j)=A(i,:)*B(j,:)'", for each - entry \verb'C(i,j)'. If the mask is present and not complemented, only - entries for which \verb'M(i,j)=1' are computed. This is a very specialized - method that works well only if the mask is present, very sparse, and not - complemented, when \verb'C' is small, or when \verb'C' is bitmap or full. - For example, it works very well - when \verb'A' and \verb'B' are tall and thin, and \verb"C=A*B'" or - \verb"C=A*B'" are computed. These expressions assume all matrices are in - CSR format. If in CSC format, then the dot-product method used for - \verb"A'*B". The method is impossibly slow if \verb'C' is large and the - mask is not present, since it takes $\Omega(mn)$ time if \verb'C' is - $m$-by-$n$ in that case. It does not use any workspace at all. Since it - uses no workspace, it can work very well for extremely sparse or - hypersparse matrices, when the mask is present and not complemented. - - \end{itemize} - -\item \verb'GxB_SORT' provides a hint to \verb'GrB_mxm', \verb'GrB_mxv', - \verb'GrB_vxm', and \verb'GrB_reduce' (to vector). These methods can leave - the output matrix or vector in a jumbled state, where the final sort is - left as pending work. This is typically fastest, since some algorithms can - tolerate jumbled matrices on input, and sometimes the sort can be skipped - entirely. However, if the matrix or vector will be immediately exported in - unjumbled form, or provided as input to a method that requires it to not be - jumbled, then sorting it during the matrix multiplication is faster. - By default, these methods leave the result in jumbled form (a {\em lazy - sort}), if \verb'GxB_SORT' is set to zero (\verb'GrB_DEFAULT'). A nonzero - value will inform the matrix multiplication to sort its result, instead. - -\item \verb'GxB_COMPRESSION' selects the compression method for serialization. - The default is ZSTD (level 1). See Section~\ref{serialize_deserialize} for - other options. - -\item \verb'GxB_IMPORT' informs the \verb'GxB' pack methods - that they can trust their input data, or not. The default is to trust - the input, for faster packing. If the data is being packed from an - untrusted source, then additional checks should be made, and the - following descriptor setting should be used: - - {\footnotesize - \begin{verbatim} - GrB_set (desc, GxB_SECURE_IMPORT, GxB_IMPORT) ; \end{verbatim}} - -\end{itemize} - -The next sections describe the methods for a \verb'GrB_Descriptor': - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GrB_Descriptor_new' & create a descriptor & \ref{descriptor_new} \\ -\verb'GrB_Descriptor_wait' & wait for a descriptor & \ref{descriptor_wait} \\ -\verb'GrB_get' & get a parameter from a descriptor & \ref{get_set_descriptor} \\ -\verb'GrB_set' & set a parameter in a descriptor & \ref{get_set_descriptor} \\ -\verb'GrB_Descriptor_free' & free a descriptor & \ref{descriptor_free} \\ -\hline -\end{tabular} -} - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Descriptor\_new:} create a new descriptor} -%------------------------------------------------------------------------------- -\label{descriptor_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_Descriptor_new // create a new descriptor -( - GrB_Descriptor *descriptor // handle of descriptor to create -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Descriptor_new' creates a new descriptor, with all fields set to -their defaults (output is not replaced, the mask is not complemented, the mask -is valued not structural, neither input matrix is transposed, the method -used in \verb'C=A*B' is selected automatically, and \verb'GrB_mxm' leaves -the final sort as pending work). - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Descriptor\_wait:} wait for a descriptor} -%------------------------------------------------------------------------------- -\label{descriptor_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a descriptor -( - GrB_Descriptor descriptor, // descriptor to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating a user-defined descriptor, a GraphBLAS library may choose to -exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS does nothing except to ensure that \verb'd' is valid. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Descriptor\_free:} free a descriptor} -%------------------------------------------------------------------------------- -\label{descriptor_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a descriptor -( - GrB_Descriptor *descriptor // handle of descriptor to free -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Descriptor_free' frees a descriptor. -Either usage: - - {\small - \begin{verbatim} - GrB_Descriptor_free (&descriptor) ; - GrB_free (&descriptor) ; \end{verbatim}} - -\noindent -frees the \verb'descriptor' and sets \verb'descriptor' to \verb'NULL'. It -safely does nothing if passed a \verb'NULL' handle, or if -\verb'descriptor == NULL' on input. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_DESC\_*:} built-in descriptors} -%------------------------------------------------------------------------------- -\label{descriptor_predefined} - -Built-in descriptors are listed in the table below. A dash in the table -indicates the default. These descriptors may not be modified or freed. -Attempts to modify them result in an error (\verb'GrB_INVALID_VALUE'); attempts -to free them are silently ignored. - -% \verb'GrB_NULL' is the default descriptor, with all settings at their defaults: -% \verb'OUTP': do not replace the output, -% \verb'MASK': mask is valued and not complemented, -% \verb'INP0': first input not transposed, and -% \verb'INP1': second input not transposed. -% For these pre-defined descriptors, the -% \verb'GxB_SORT' setting is at their default values. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{|l|lllll|} -\hline -Descriptor & \verb'OUTP' & \verb'MASK' & \verb'MASK' & \verb'INP0' & \verb'INP1' \\ - & & structural & complement & & \\ -\hline -\verb'GrB_NULL' & - & - & - & - & - \\ -\verb'GrB_DESC_T1' & - & - & - & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_T0' & - & - & - & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_T0T1' & - & - & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_C' & - & - & \verb'GrB_COMP' & - & - \\ -\verb'GrB_DESC_CT1' & - & - & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_CT0' & - & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_CT0T1' & - & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_S' & - & \verb'GrB_STRUCTURE' & - & - & - \\ -\verb'GrB_DESC_ST1' & - & \verb'GrB_STRUCTURE' & - & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_ST0' & - & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_ST0T1' & - & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_SC' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & - \\ -\verb'GrB_DESC_SCT1' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_SCT0' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_SCT0T1' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_R' & \verb'GrB_REPLACE' & - & - & - & - \\ -\verb'GrB_DESC_RT1' & \verb'GrB_REPLACE' & - & - & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_RT0' & \verb'GrB_REPLACE' & - & - & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_RT0T1' & \verb'GrB_REPLACE' & - & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_RC' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & - & - \\ -\verb'GrB_DESC_RCT1' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_RCT0' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_RCT0T1' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_RS' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & - & - \\ -\verb'GrB_DESC_RST1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_RST0' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_RST0T1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\verb'GrB_DESC_RSC' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & - \\ -\verb'GrB_DESC_RSCT1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ -\verb'GrB_DESC_RSCT0' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ -\verb'GrB_DESC_RSCT0T1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ -\hline -\end{tabular}} - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_free:} free any GraphBLAS object} %======================= -%=============================================================================== -\label{free} - -Each of the ten objects has \verb'GrB_*_new' and \verb'GrB_*_free' methods -that are specific to each object. They can also be accessed by a generic -function, \verb'GrB_free', that works for all ten objects. If \verb'G' is any -of the ten objects, the statement - - {\footnotesize - \begin{verbatim} - GrB_free (&G) ; \end{verbatim} } - -\noindent -frees the object and sets the variable \verb'G' to \verb'NULL'. It is safe to -pass in a \verb'NULL' handle, or to free an object twice: - - {\footnotesize - \begin{verbatim} - GrB_free (NULL) ; // SuiteSparse:GraphBLAS safely does nothing - GrB_free (&G) ; // the object G is freed and G set to NULL - GrB_free (&G) ; // SuiteSparse:GraphBLAS safely does nothing \end{verbatim} } - -\noindent -However, the following sequence of operations is not safe. The first two are -valid but the last statement will lead to undefined behavior. - - {\footnotesize - \begin{verbatim} - H = G ; // valid; creates a 2nd handle of the same object - GrB_free (&G) ; // valid; G is freed and set to NULL; H now undefined - GrB_some_method (H) ; // not valid; H is undefined \end{verbatim}} - -Some objects are predefined, such as the built-in types. If a user application -attempts to free a built-in object, SuiteSparse:GraphBLAS will safely do -nothing. The \verb'GrB_free' function in SuiteSparse:GraphBLAS always -returns \verb'GrB_SUCCESS'. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{The mask, accumulator, and replace option} %%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{sec:maskaccum} - -After a GraphBLAS operation computes a result ${\bf T}$, (for example, ${\bf -T=AB}$ for \verb'GrB_mxm'), the results are assigned to an output matrix ${\bf -C}$ via the mask/ accumulator phase, written as ${\bf C \langle M \rangle = C -\odot T}$. This phase is affected by the \verb'GrB_REPLACE' option in the -descriptor, the presence of an optional binary accumulator operator ($\odot$), -the presence of the optional mask matrix ${\bf M}$, and the status of the mask -descriptor. The interplay of these options is summarized in -Table~\ref{tab:maskaccum}. - -The mask ${\bf M}$ may be present, or not. It may be structural or valued, and -it may be complemented, or not. These options may be combined, for a total of -8 cases, although the structural/valued option as no effect if ${\bf M}$ is not -present. If ${\bf M}$ is not present and not complemented, then $m_{ij}$ is -implicitly true. If not present yet complemented, then all $m_{ij}$ entries are -implicitly zero; in this case, ${\bf T}$ need not be computed at all. Either -${\bf C}$ is not modified, or all its entries are cleared if the replace option -is enabled. If ${\bf M}$ is present, and the structural option is used, then -$m_{ij}$ is treated as true if it is an entry in the matrix (its value is -ignored). Otherwise, the value of $m_{ij}$ is used. In both cases, entries -not present are implicitly zero. These values are negated if the mask is -complemented. All of these various cases are combined to give a single -effective value of the mask at position ${ij}$. - -The combination of all these options are presented in the -Table~\ref{tab:maskaccum}. The first column is the \verb'GrB_REPLACE' option. -The second column lists whether or not the accumulator operator is present. -The third column lists whether or not $c_{ij}$ exists on input to the -mask/accumulator phase (a dash means that it does not exist). The fourth -column lists whether or not the entry $t_{ij}$ is present in the result matrix -${\bf T}$. The mask column is the final effective value of $m_{ij}$, after -accounting for the presence of ${\bf M}$ and the mask options. Finally, the -last column states the result of the mask/accum step; if no action is listed in -this column, then $c_{ij}$ is not modified. - -Several important observations can be made from this table. First, -if no mask is present (and the mask-complement descriptor option is not used), -then only the first half of the table is used. In this case, the \verb'GrB_REPLACE' -option has no effect. The entire matrix ${\bf C}$ is modified. - -Consider the cases when $c_{ij}$ is present but $t_{ij}$ is not, and there is no -mask or the effective value of the mask is true for this ${ij}$ position. With -no accumulator operator, $c_{ij}$ is deleted. If the accumulator operator is -present and the replace option is not used, $c_{ij}$ remains unchanged. - -\begin{table} -{\small -\begin{tabular}{lllll|l} -\hline -repl & accum & ${\bf C}$ & ${\bf T}$ & mask & action taken by ${\bf C \langle M \rangle = C \odot T}$ \\ -\hline - - &- & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, update \\ - - &- & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ - - &- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $t_{ij}$ not present \\ - - &- & - & - & 1 & \\ - - &- & $c_{ij}$ & $t_{ij}$ & 0 & \\ - - &- & - & $t_{ij}$ & 0 & \\ - - &- & $c_{ij}$ & - & 0 & \\ - - &- & - & - & 0 & \\ -\hline - yes&- & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, update \\ - yes&- & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ - yes&- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $t_{ij}$ not present \\ - yes&- & - & - & 1 & \\ - yes&- & $c_{ij}$ & $t_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&- & - & $t_{ij}$ & 0 & \\ - yes&- & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&- & - & - & 0 & \\ -\hline - - &yes & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ - - &yes & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ - - &yes & $c_{ij}$ & - & 1 & \\ - - &yes & - & - & 1 & \\ - - &yes & $c_{ij}$ & $t_{ij}$ & 0 & \\ - - &yes & - & $t_{ij}$ & 0 & \\ - - &yes & $c_{ij}$ & - & 0 & \\ - - &yes & - & - & 0 & \\ -\hline - yes&yes & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ - yes&yes & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ - yes&yes & $c_{ij}$ & - & 1 & \\ - yes&yes & - & - & 1 & \\ - yes&yes & $c_{ij}$ & $t_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&yes & - & $t_{ij}$ & 0 & \\ - yes&yes & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&yes & - & - & 0 & \\ -\hline -\end{tabular} -} -\caption{Results of the mask/accumulator phase. \label{tab:maskaccum}} -\end{table} - -When there is no mask and the mask \verb'GrB_COMP' option is not selected, the -table simplifies (Table~\ref{tab:maskaccum_nomask}). The \verb'GrB_REPLACE' -option no longer has any effect. The \verb'GrB_SECOND_T' binary operator when -used as the accumulator unifies the first cases, shown in -Table~\ref{tab:maskaccum_nomask_2nd}. The only difference now is the behavior -when $c_{ij}$ is present but $t_{ij}$ is not. Finally, the effect of -\verb'GrB_FIRST_T' as the accumulator is shown in -Table~\ref{tab:maskaccum_nomask_1st}. - -\begin{table}[h] -\begin{center} -{\small -\begin{tabular}{lll|l} -\hline - accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ -\hline - - & $c_{ij}$ & $t_{ij}$ & $c_{ij} = t_{ij}$, update \\ - - & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ - - & $c_{ij}$ & - & delete $c_{ij}$ because $t_{ij}$ not present \\ - - & - & - & \\ -\hline - yes & $c_{ij}$ & $t_{ij}$ & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ - yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ - yes & $c_{ij}$ & - & \\ - yes & - & - & \\ -\hline -\end{tabular} -} -\caption{When no mask is present (and not complemented). -\label{tab:maskaccum_nomask}} -\end{center} -\end{table} - -\begin{table}[h] -\begin{center} -{\small -\begin{tabular}{lll|l} -\hline - accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ -\hline - yes & $c_{ij}$ & $t_{ij}$ & $c_{ij} = t_{ij}$, apply \verb'GrB_SECOND' accumulator \\ - yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ - yes & $c_{ij}$ & - & \\ - yes & - & - & \\ -\hline -\end{tabular} -} -\caption{No mask, with the SECOND operator as the accumulator. -\label{tab:maskaccum_nomask_2nd}} -\end{center} -\end{table} - -\begin{table}[h] -\begin{center} -{\small -\begin{tabular}{lll|l} -\hline - accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ -\hline - yes & $c_{ij}$ & $t_{ij}$ & \\ - yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ - yes & $c_{ij}$ & - & \\ - yes & - & - & \\ -\hline -\end{tabular} -} -\caption{No Mask, with the FIRST operator as the accumulator. -\label{tab:maskaccum_nomask_1st}} -\end{center} -\end{table} - -\newpage -%=============================================================================== -\section{{\sf GxB\_Context:} controlling computational resources} %============= -%=============================================================================== -\label{context} - -SuiteSparse:GraphBLAS v8.0.0 adds a new object, the \verb'GxB_Context', which -controls the number of threads used by OpenMP. In the future, this same object -will control the number of GPUs used. - -The \verb'GxB_Context' object is not needed if the user application is itself -single threaded, with all parallelism is inside GraphBLAS itself. The object -is also not needed if the user application is multi-threaded, but all user -threads create the same number of threads inside GraphBLAS (say each using a -single thread). In that case, \verb'GrB_set(GrB_GLOBAL,1,GxB_NTHREADS)' -can be used (for example). - -However, suppose the user application creates 5 threads of its own, on a -machine with 16 cores, and each thread wants to use a different number of -threads inside GraphBLAS (one user thread uses 8 OpenMP threads and the -the other four use 2 each, for example). This is where the \verb'GxB_Context' -object becomes essential. - -The default context is \verb'GxB_CONTEXT_WORLD', which is not created by the -user application but it can be modified. If a user thread does not create its -own context, then its computational resources are determine by this -\verb'GxB_CONTEXT_WORLD' object. The following \verb'GrB_set/get' methods -access this global object without naming it directly (where \verb'chunk' -is a \verb'GrB_Scalar' of type \verb'GrB_FP64' or \verb'GrB_FP32'): - - \begin{itemize} - \item \verb'GrB_set (GrB_GLOBAL, nthreads, GxB_NTHREADS)' - \item \verb'GrB_get (GrB_GLOBAL, &nthreads, GxB_NTHREADS)' - \item \verb'GrB_set (GrB_GLOBAL, chunk, GxB_CHUNK)' - \item \verb'GrB_get (GrB_GLOBAL, chunk, GxB_CHUNK)' - \end{itemize} - -The above methods control the OpenMP threads used by all user threads in the -user application. To allow each user thread to control its own OpenMP -threading, each user thread needs to create its own Context object via -\verb'GxB_Context_new'. Next, the user thread must {\em engage} this context -via \verb'GxB_Context_engage'; all subsequent calls to GraphBLAS from this -particular user thread will then use the number of OpenMP threads dictated by -this particular context. - -{\em Engaging} a \verb'GxB_Context' object assigns to a \verb'threadprivate' -space accessible only by this particular user thread, so that any calls to -GraphBLAS can access the settings in this object. - -The opposite operation is to {\em disengage} a context. This removes a -particular object from the \verb'threadprivate' space of the user thread -that is disengaging its context. - -After a context object is created, the user thread that owns it can modify -its settings in this object. An example appears in the \verb'GraphBLAS/Demo' -folder, part of which is listed below. - -{\footnotesize -\begin{verbatim} - - #pragma omp parallel for num_threads (nouter) schedule (dynamic, 1) - for (int k = 0 ; k < nmat ; k++) - { - // each user thread constructs its own context - GxB_Context Context = NULL ; - GxB_Context_new (&Context) ; - GrB_set (Context, ninner, GxB_NTHREADS) ; - GxB_Context_engage (Context) ; - - // kth user thread builds kth matrix with ninner threads - GrB_Matrix A = NULL ; - GrB_Matrix_new (&A, GrB_FP64, n, n) ; - GrB_Matrix_build (A, I, J, X, nvals, GrB_PLUS_FP64) ; - - // free the matrix just built - GrB_Matrix_free (&A) ; - - // each user thread frees its own context - GxB_Context_disengage (Context) ; - GxB_Context_free (&Context) ; - } -\end{verbatim} -} - -In this example, \verb'nouter' user threads are created. Inside the parallel -loop, each user thread creates and engages its own context object. In this -simple example, each user thread then uses \verb'ninner' threads to do some -work, although in principle each user thread to request a different number of -threads for each of its calls to GraphBLAS. This leads to nested parallelism, -so to use this context object effectively, the nested parallelism feature of -OpenMP must be enabled. - -The next sections describe the methods for a \verb'GxB_Context': - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS function & purpose & Section \\ -\hline -\verb'GxB_Context_new' & create a context & \ref{context_new} \\ -\verb'GrB_get' & get a value from a context & \ref{get_set_context} \\ -\verb'GrB_set' & set a value in a context & \ref{get_set_context} \\ -\verb'GxB_Context_engage' & engage a context & \ref{context_engage} \\ -\verb'GxB_Context_disengage' & disengage a context & \ref{context_disengage} \\ -\verb'GxB_Context_fprint' & check/print a context & \ref{context_print} \\ -\verb'GxB_Context_free' & free a context & \ref{context_free} \\ -\verb'GxB_Context_wait' & wait for a context & \ref{context_wait} \\ -\hline -\end{tabular} -} - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_new:} create a new context} -%------------------------------------------------------------------------------- -\label{context_new} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_new // create a new context -( - GxB_Context *Context // handle of context to create -) ; -\end{verbatim} } \end{mdframed} - -A new context is created and initialized with the current global settings for -\verb'GxB_NTHREADS' and \verb'GxB_CHUNK'. See \verb'GrB_get'. -The context object will not have an effect on any calls to GraphBLAS until it -is {\em engaged} by a user thread. - -\newpage -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_engage:} engaging context} -%------------------------------------------------------------------------------- -\label{context_engage} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_engage // engage a Context -( - GxB_Context Context // Context to engage -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Context_engage' sets the provided Context object as the Context for -this user thread. Multiple user threads can share a single Context. Any prior -Context for this user thread is superseded by the new Context (the prior one is -not freed). \verb'GrB_SUCCESS' is returned, and future calls to GraphBLAS by -this user thread will use the provided Context. - -If the Context on input is the \verb'GxB_CONTEXT_WORLD' object, then the -current Context is disengaged. That is, the following calls have the same -effect, setting the Context of this user thread to \verb'GxB_CONTEXT_WORLD': - -{\footnotesize -\begin{verbatim} - GxB_Context_engage (GxB_CONTEXT_WORLD) ; - GxB_Context_disengage (NULL) ; -\end{verbatim} } - -The result for both cases above is \verb'GrB_SUCCESS'. - -Error cases: If \verb'Context' is NULL on input, \verb'GrB_NULL_POINTER' is -returned. If a non-NULL Context is provided but it is faulty in some way, then -an error code is returned (\verb'GrB_INVALID_OBJECT' or -\verb'GrB_UNINITIALIZED_OBJECT'). If an error code is returned, the current -Context for this user thread is unmodified. - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_disengage:} disengaging context} -%------------------------------------------------------------------------------- -\label{context_disengage} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_disengage // disengage a Context -( - GxB_Context Context // Context to disengage -) ; -\end{verbatim} } \end{mdframed} - -If a NULL Context is provided or if the Context input parameter is -\verb'GxB_CONTEXT_WORLD', then any current Context for this user thread is -disengaged. If a valid non-NULL Context is provided and it matches the -current Context for this user thread, it is disengaged. In all of these -cases, \verb'GrB_SUCCESS' is returned. The user thread has no Context object and -any subsequent calls to GraphBLAS functions will use the world Context, -\verb'GxB_CONTEXT_WORLD'. - -Error cases: If a non-NULL Context is provided but it is faulty in some way, -then an error code is returned (\verb'GrB_INVALID_OBJECT' or -\verb'GrB_UNINITIALIZED_OBJECT'). If a non-NULL Context is provided on input -that doesn't match the current Context for this thread, then -\verb'GrB_INVALID_VALUE' is returned. If an error code is returned, the -current Context for this user thread is unmodified. - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_free:} free a context} -%------------------------------------------------------------------------------- -\label{context_free} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_free // free a context -( - GxB_Context *Context // handle of Context to free -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Context_free' frees a descriptor. -Either usage: - - {\small - \begin{verbatim} - GxB_Context_free (&Context) ; - GrB_free (&Context) ; \end{verbatim}} - -\noindent -frees the \verb'Context' and sets \verb'Context' to \verb'NULL'. It -safely does nothing if passed a \verb'NULL' handle, or if -\verb'Context == NULL' on input. - -%------------------------------------------------------------------------------- -\subsection{{\sf GxB\_Context\_wait:} wait for a context} -%------------------------------------------------------------------------------- -\label{context_wait} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_wait // wait for a context -( - GxB_Context Context, // context to wait for - GrB_WaitMode mode // GrB_COMPLETE or GrB_MATERIALIZE -) ; -\end{verbatim} -}\end{mdframed} - -After creating or modifying a context, a GraphBLAS library may choose to -exploit non-blocking mode to delay its creation. Currently, -SuiteSparse:GraphBLAS currently does nothing except to ensure that -\verb'Context' is valid. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{The SuiteSparse:GraphBLAS JIT} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{jit} - -SuiteSparse:GraphBLAS v8.0 adds a new JIT feature that greatly improves -performance of user-defined types and operators, and improves the performance -of built-in operators as well. The JIT can compile kernels that are specific -to the matrix type and the operators that work on it. In version v7.4.4 and -prior versions, user-defined types and operators were handled by {\em generic} -kernels that used function pointers for each operator and for any typecasting -required. Even built-in types and operators were sometimes handled by the -generic kernels, if any typecasting was done, or if the specific operator, -monoid, or semiring was disabled when GraphBLAS was compiled. - -\subsection{Using the JIT} - -Using the JIT in a user application is simple: by default, there is nothing -to do. LAGraph v1.0.1 can use the JIT (and PreJIT) kernels without changing -a single line of code.\footnote{LAGraph v1.0.1 does not work with GraphBLAS -v8.0.0 but not because of the JIT. LAGraph must be updated because it uses two -deprecated {\sf GxB\_SelectOp} operators; these are replaced with {\sf -GrB\_IndexUnaryOp} operators in the {\sf dev} branch of LAGraph, to appear -in a future release of LAGraph.} - -Currently, the JIT compiles kernels for the CPU only, but a CUDA JIT is in -progress to exploit NVIDIA GPUs, in collaboration with Joe Eaton and -Corey Nolet, with NVIDIA. - -When GraphBLAS is compiled, the \verb'cmake' build system creates a {\em cache} -folder where it will keep any kernels created and compiled by the JIT -(both source code and compiled libraries for each kernel). The -default folder is \verb'~/.SuiteSparse/GrB8.0.0' for SuiteSparse:GraphBLAS -version v8.0.0, where the tilde refers to the user's home directory. -The version numbers in the folder name are set automatically, so that a new -version will ignore kernels compiled by an older version of GraphBLAS. If the -\verb'GRAPHBLAS_CACHE_PATH' environment variable is set when GraphBLAS is -compiled, that variable defines the folder. If the user's home directory -cannot be determined and the \verb'GRAPHBLAS_CACHE_PATH' environment variable -is not set, then JIT compilation is disabled and only PreJIT kernels can be -used. The optional environment variable, \verb'GRAPHBLAS_CACHE_PATH', is also -read by \verb'GrB_init' when the user application runs. -See Section~\ref{cache_path} for a description of the valid characters -that can appear in the cache path. - -When the user application starts, it can modify the location of the cache -folder after calling \verb'GrB_init'. It can also modify the C compiler and -its flags, and can control when and how the JIT is used. -These changes are -made via \verb'GrB_set', and can be queried via -\verb'GrB_get'; refer to Section~\ref{options} for details, and -the \verb'GxB_JIT_*' settings: - -\vspace{0.15in} -{\footnotesize -\begin{tabular}{lll} -\hline -field & value & description \\ -\hline -\verb'GxB_JIT_C_COMPILER_NAME' & \verb'char *' & C compiler for JIT kernels \\ -\verb'GxB_JIT_C_COMPILER_FLAGS'& \verb'char *' & flags for the C compiler \\ -\verb'GxB_JIT_C_LINKER_FLAGS' & \verb'char *' & link flags for the C compiler \\ -\verb'GxB_JIT_C_LIBRARIES' & \verb'char *' & libraries to link against (no cmake) \\ -\verb'GxB_JIT_C_CMAKE_LIBS' & \verb'char *' & libraries to link against (with cmake) \\ -\verb'GxB_JIT_C_PREFACE' & \verb'char *' & C code as preface to JIT kernels \\ -\verb'GxB_JIT_C_CONTROL' & see below & CPU JIT control \\ -\verb'GxB_JIT_USE_CMAKE' & see below & CPU JIT control \\ -%\verb'GxB_JIT_ERROR_FALLBACK'& \verb'int32_t' & how to handle JIT compiler errors \\ -\verb'GxB_JIT_ERROR_LOG' & \verb'char *' & error log file \\ -\verb'GxB_JIT_CACHE_PATH' & \verb'char *' & folder with compiled kernels \\ -\hline -\end{tabular} -} -\vspace{0.15in} - -To control the JIT in the MATLAB \verb'@GrB' interface, use the \verb'GrB.jit' -method. Refer to \verb'help GrB.jit' for details. - -Kernels compiled during one run of a user application are kept in the cache -folder, so that when the user application runs again, the kernels do not have -to be compiled. If the kernel relies on user-defined types and/or operators, a -check is made the first time the compiled kernel is loaded. If the current -definition of the user-defined type or operator does not exactly match the -definition when the kernel was compiled, then the compiled kernel is discarded -and recompiled. The stale kernel is overwritten with the new one, so there is -no need to for the user to take any action to delete the stale kernel from the -cache path. If the cache path is changed via \verb'GrB_set', compiled kernels -in the old cache folder are not copied over. New ones are compiled instead. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_CONTROL} -%---------------------------------------- - -The usage of the CPU JIT can be controlled via \verb'GrB_get/set' using the -\verb'GxB_JIT_C_CONTROL' setting. If the JIT is enabled at compile time, the -initial setting is \verb'GxB_JIT_ON'. If the JIT is disabled at compile time -(by setting the cmake variable \verb'GRAPHBLAS_USE_JIT' to \verb'OFF'), the -initial setting is \verb'GxB_JIT_RUN', so that any PreJIT kernels can be run. -This setting can be modified; for example to disable the JIT and clear all -loaded JIT kernels from memory, use: - -\begin{verbatim} - GrB_set (GrB_GLOBAL, GxB_JIT_OFF, GxB_JIT_C_CONTROL) ; -\end{verbatim} - -The above call to \verb'GrB_set' does not clear any PreJIT kernels, however, -since those are integral components of the single compiled GraphBLAS library -and cannot be cleared (see Section~\ref{prejit}). It also does not clear any -compiled user functions, created by the JIT for \verb'GxB_*Op_new' when the -input function pointer is \verb'NULL'. - -The following settings are available for \verb'GxB_JIT_C_CONTROL'. -For examples on how to use it, see -\verb'GraphBLAS/Demo/Program/gauss_demo.c'. - -{\footnotesize -\begin{verbatim} -typedef enum -{ - GxB_JIT_OFF = 0, // do not use the JIT: free all JIT kernels if loaded - GxB_JIT_PAUSE = 1, // do not run JIT kernels but keep any loaded - GxB_JIT_RUN = 2, // run JIT kernels if already loaded; no load/compile - GxB_JIT_LOAD = 3, // able to load and run JIT kernels; may not compile - GxB_JIT_ON = 4, // full JIT: able to compile, load, and run -} -GxB_JIT_Control ; -\end{verbatim} } - -If the JIT is disabled at compile time via setting the \verb'GRAPHBLAS_USE_JIT' -option \verb'OFF', \verb'PreJIT' kernels are still available, and can be -controlled via the \verb'GxB_JIT_OFF', \verb'GxB_JIT_PAUSE', or -\verb'GxB_JIT_RUN' settings listed above. If the application tries to set the -control to \verb'GxB_JIT_LOAD' or \verb'GxB_JIT_ON', the setting is changed to -\verb'GxB_JIT_RUN' instead. This is not an error condition. The resulting -setting can be queried via \verb'GrB_get', if desired. - -If your copy of GraphBLAS has many PreJIT kernels compiled into it, or uses -many run-time JIT kernels, turning of the JIT with \verb'GxB_JIT_OFF' can be -costly. This setting clears the entire JIT hash table. Renabling the JIT and -using it will require the JIT table to be repopulated, including a check of -each PreJIT kernel the first time they are used. If you wish to temporarily -disable the JIT, consider switching the JIT control to \verb'GxB_JIT_PAUSE' and -then back to \verb'GxB_JIT_RUN' to reenable the JIT. - -%---------------------------------------- -\subsubsection{JIT error handling} -%---------------------------------------- - -The JIT control setting can be changed by GraphBLAS itself, based on -following error conditions. These changes affect all kernels, not just the -kernel causing the error. If any of these cases occur, the call to GraphBLAS -returns \verb'GxB_JIT_ERROR', unless GraphBLAS runs out of memory, in which -case it returns \verb'GrB_OUT_OF_MEMORY' instead. If the JIT is disabled -through any of these errors, it can be detected by \verb'GrB_get' to read the -\verb'GxB_JIT_C_CONTROL' state. - -\begin{itemize} - -\item When a kernel is loaded that relies on user-defined types and/or -operators, the definitions in the previously compiled kernel are checked -against the current definitions. If they do not match, the old one is -discarded, and a new kernel will be compiled. However, if the control is set -to \verb'GxB_JIT_LOAD', no new kernels may be compiled. To avoid a continual -reloading and checking of stale kernels, the control is changed from -\verb'GxB_JIT_LOAD' to \verb'GxB_JIT_RUN'. To solve this problem, delete the -compiled kernel with the stale definition, or enable the full JIT by setting -the control to \verb'GxB_JIT_ON' so that the kernel can recompiled with the -current definitions. - -\item If a new kernel is to be compiled with the control set to -\verb'GxB_JIT_ON' but the source file cannot be created in the cache folder, or -a compiler error occurs, further compilation is disabled. The control is -changed from \verb'GxB_JIT_ON' to \verb'GxB_JIT_LOAD'. -To solve this problem, make sure your application has write permission to the -cache path and that any user-defined types and operators are defined properly -so that no syntax error is detected by the compiler. - -\item If a kernel is loaded but the lookup of the kernel function itself in the -compiled library fails, the control is changed to \verb'GxB_JIT_RUN' to prevent -this error from occuring again. To solve this problem, delete the corrupted -compiled kernel from the cache folder. This case is unlikely to occur since no -user action can trigger it. It could indicate a system problem with loading -the kernel, or some kind of compiler error that allows the kernel to be -compiled but not loaded. - -\item If an out-of-memory condition occurs in the JIT, the JIT control is -set to \verb'GxB_JIT_PAUSE'. To solve this, try freeing up memory, use a -larger system, or solve smaller problems. - -\end{itemize} - -As a result of this automatic change in the JIT control setting, after the -first JIT error is returned, subsequent calls to GraphBLAS will likely succeed. -GraphBLAS will use a generic kernel instead. To re-enable the JIT for -subsequent calls to GraphBLAS, the user application must reset the -\verb'GxB_JIT_C_CONTROL' back to \verb'GxB_JIT_ON'. - -In many use cases of GraphBLAS (such as LAGraph), a function will create a type -or operator, use it, and then free it just before returning. It would be far -to costly to clear the loaded kernel and reload it each time the LAGraph -function is called, so any kernels that use this type or operator are kept -loaded when the type or operator is freed. The typical case is that when the -LAGraph function is called again, it will recreate the type or operator with -the identical name and definition. The kernels that use these types or -operators will still be loaded and can thus be used with no overhead. - -However, if a user-defined type or operator is freed and then redefined with -the same name but a different definition, any loaded kernels should be freed. -This case is not detected by GraphBLAS since it would be far too costly to -check each time a previously loaded kernel is called. As a result, this -condition is only checked when the kernel is first loaded. To avoid this -issue, if the user application frees a user-defined type or operator and -creates a new one with a different definition but with the same name, clear all -prior kernels by setting the control to \verb'GxB_JIT_OFF'. Then turn the JIT -back on with \verb'GxB_JIT_ON'. This clears all run-time JIT kernels so that -they will be checked when reloaded, and recompiled if their definitions -changed. All PreJIT kernels are flagged as unchecked, just as they were -flagged by \verb'GrB_init', so that they will be checked the next time they -run. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_COMPILER\_NAME} -%---------------------------------------- - -The \verb'GxB_JIT_C_COMPILER_NAME' string is the name of the C compiler to use, -or its full path. -By default it is set to the C compiler used to compile GraphBLAS itself. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_COMPILER\_FLAGS} -%---------------------------------------- - -The \verb'GxB_JIT_C_COMPILER_FLAGS' string is the C compiler flags. -By default it is set to the C compiler flags used to compile GraphBLAS itself. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_LINKER\_FLAGS} -%---------------------------------------- - -The \verb'GxB_JIT_C_LINKER_FLAGS' string only affects the kernel compilation -when cmake is not used to compile the kernels (see Section~\ref{use_cmake}). -By default it is set to the C link flags used to compile GraphBLAS itself. -If cmake is used to compile the kernels, then it determines the linker flags -itself, and this cannot be modified. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_LIBRARIES} -%---------------------------------------- - -The \verb'GxB_JIT_C_LIBRARIES' string is used to set the libraries to link -against when cmake is not being used to compile the kernels (see -Section~\ref{use_cmake}). For example, on Linux it is set by default to the -\verb'-lm', \verb'-ld', and OpenMP libraries used to link GraphBLAS itself. -Any standalone library name is prepended with \verb'-l'. If cmake is used to -compile the kernels, this string is ignored. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_CMAKE\_LIBS} -%---------------------------------------- - -The \verb'GxB_JIT_C_LIBRARIES' string is used to set the libraries to link -against when cmake is being used to compile the kernels (see -Section~\ref{use_cmake}). For example, on Linux it is set by default to the -\verb'm', \verb'dl', and OpenMP libraries used to link GraphBLAS itself. -Libraries in the string should normally be separated by semicolons. If cmake -is not used to compile the kernels, this string is ignored. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_C\_PREFACE} -%---------------------------------------- - -The \verb'GxB_JIT_C_PREFACE' string is added at the top of each JIT kernel. It -is useful for providing additional \verb'#include' files that GraphBLAS does -not provide. It can also be useful for diagnostics and for configuring the -\verb'PreJIT'. For example, suppose you wish to tag specific kernels as having -been constructed for particular parts of an application. The application can -modify this string to some unique comment, and then run some benchmarks that -call GraphBLAS. Any JIT kernels created will be tagged with this unique -comment, which may be helpful to select specific kernels to copy into the -\verb'PreJIT' folder. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_USE\_CMAKE} -%---------------------------------------- -\label{use_cmake} - -Two methods are provided for compiling the JIT kernels: cmake, and a direct -compiler/link command. On Windows, only cmake may be used, and this setting -is ignored (it is always true). On Linux or Mac, the default is false since -a direct compile/link is faster. However, it is possible that some compilers -are not handled properly with this method, so cmake can also be used on those -platforms by setting the value of \verb'GxB_JIT_USE_CMAKE' to true. - -Normally the same version of cmake should be used to compile both GraphBLAS and -the JIT kernels. However, compiling GraphBLAS itself requires cmake v3.16 or -later (v3.19 for some options), while compiling the JIT kernels only requires -cmake v3.13 or later. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_ERROR\_LOG} -%---------------------------------------- - -The \verb'GxB_JIT_ERROR_LOG' string is the filename of the optional error -log file. By default, this string is empty, which means that any compiler -errors are routed to the \verb'stderr' output of the user process. If set -to a non-empty string, any compiler errors are appended to this file. -The string may be \verb'NULL', which means the same as an empty string. - -%---------------------------------------- -\subsubsection{\sf GxB\_JIT\_CACHE\_PATH} -\label{cache_path} -%---------------------------------------- - -The \verb'GxB_JIT_CACHE_PATH' string is the full path to the user's cache -folder (described above). The default on Linux/Mac is -\verb'~/.SuiteSparse/GrB8.0.0' for GraphBLAS version 8.0.0. On Windows, -the cache folder is created inside the user's \verb'LOCALAPPDATA' folder, -called \verb'SuiteSparse/GrB8.0.0'. When GraphBLAS starts, -\verb'GrB_init' checks if the \verb'GRAPHBLAS_CACHE_PATH' environment variable -exists, and initializes the cache path with that value instead of using the -default. - -{\bf Restrictions:} the cache path is sanitized for security reasons. No spaces -are permitted. Backslashes are converted into forward slashes. It can contain -only charactors in the following list: - -\begin{verbatim} - abcdefghijklmnopqrstuvwxyz - ABCDEFGHIJKLMNOPQRSTUVWXYZ - 0123456789.-_/ -\end{verbatim} - -In addition, the second character in the string is allowed to be the colon -character (\verb':') to allow for the use of Windows drive letters. Any -character outside of these rules is converted into an underscore (\verb'_'). - -%------------------------------------------------------------------------------- -\subsection{Compilation options: {\sf GRAPHBLAS\_USE\_JIT} and {\sf GRAPHBLAS\_COMPACT}} -%------------------------------------------------------------------------------- - -The CPU JIT can be disabled at compile time by setting the -\verb'GRAPHBLAS_USE_JIT' option \verb'OFF' in the cmake build options. Good -performance will be obtained only by using the \verb'FactoryKernels' or the -\verb'PreJIT' kernels that are compiled into GraphBLAS when it is first -compiled with \verb'cmake'. By default, \verb'GRAPHBLAS_USE_JIT' is \verb'ON', -to enable the CPU JIT. - -With the introduction of the JIT kernels, it is now possible to obtain good -performance in GraphBLAS without compiling the many {\em factory kernels} that -appear in the \verb'GraphBLAS/Source/FactoryKernels' directory. If the JIT is -enabled, GraphBLAS will still be fast, once the JIT kernels are compiled, or by -using any \verb'PreJIT' kernels. To compile GraphBLAS without its -\verb'FactoryKernels', enable the \verb'COMPACT' option in the cmake build -options. By default, \verb'COMPACT' is off, to enable the -\verb'FactoryKernels'. - -When GraphBLAS is compiled with \verb'GRAPHBLAS_USE_JIT' set to \verb'OFF', the -\verb'GxB_JIT_C_CONTROL' may be set to \verb'GxB_JIT_OFF', -\verb'GxB_JIT_PAUSE', or \verb'GxB_JIT_RUN'. No kernels will be loaded at -run-time (the \verb'GxB_JIT_LOAD' setting is disabled and treated as -\verb'GxB_JIT_RUN'), and no new kernels will be compiled at run-time (the -\verb'GxB_JIT_ON' is disabled and treated as \verb'GxB_JIT_RUN'). Only -pre-existing \verb'PreJIT' kernels can be run, described in -Section~\ref{prejit}. - -If both \verb'GRAPHBLAS_USE_JIT' is set \verb'OFF' and -\verb'GRAPHBLAS_COMPACT' is set \verb'ON', all features of GraphBLAS will be -functional. The only fast kernels available will be the \verb'PreJIT' kernels -(if any). Otherwise, generic kernels will be used, in which every single -operator is implemented with a function pointer, and every scalar assignment -requires a \verb'memcpy'. Generic kernels are slow, so using this combination -of options is not recommended when preparing GraphBLAS for production use, -benchmarking, or for a Linux distro or other widely-used distribution, unless -you are able to run your application in advance and create all the JIT kernels -you need, and then copy them into \verb'GraphBLAS/PreJIT'. This would be -impossible to do for a general-purpose case such as a Linux distro, but -feasible for a more targetted application such as FalkorDB. - -%------------------------------------------------------------------------------- -\subsection{Adding {\sf PreJIT} kernels to GraphBLAS} -%------------------------------------------------------------------------------- -\label{prejit} - -When GraphBLAS runs, it constructs JIT kernels in the user's cache folder, -which by default is \verb'~/.SuiteSparse/GrB8.0.0' for v8.0.0. The -kernels placed in a subfolder (\verb'c') and inside that folder they are -further subdivided arbitrarily into subfolders (via an arbitary hash). The -files are split into subfolders because a single folder may grow too large for -efficient access. Once GraphBLAS has generated some kernels, some or all of -them kernels can then incorporated into the compiled GraphBLAS library by -copying them into the \verb'GraphBLAS/PreJIT' folder. Be sure to move any -\verb'*.c' files into the single \verb'GraphBLAS/PreJIT' folder; do not keep -the subfolder structure. - -If GraphBLAS is then recompiled via cmake, the build system will detect these -kernels, compile them, and make them available as pre-compiled JIT kernels. -The kernels are no longer ``Just-In-Time'' kernels since they are not compiled -at run-time. They are refered to as \verb'PreJIT' kernels since they were at -one time created at run-time by the GraphBLAS JIT, but are now compiled into -GraphBLAS before it runs. - -{\bf It's that simple.} Just copy the source files for any kernels you want -from your cache folder (typically \verb'~/.SuiteSparse/GrB8.0.0/c') into -\verb'GraphBLAS/PreJIT', and recompile GraphBLAS. There's no need to change -any other cmake setting, and no need to do anything different in any -applications that use GraphBLAS. Do not copy the compiled libraries; they are -not needed and will be ignored. Just copy the \verb'*.c' files. - -If the resulting GraphBLAS library is installed for system-wide usage (say in a -Linux distro, Python, RedisGraph, etc), the \verb'GraphBLAS/PreJIT' kernels -will be available to all users of that library. They are not disabled by the -\verb'GRAPHBLAS_USE_JIT' option. - -Once these kernels are moved to \verb'GraphBLAS/PreJIT' and GraphBLAS is -recompiled, they can be deleted from the cache folder. However, even if they -are left there, they will not be used since GraphBLAS will find these kernels -as PreJIT kernels inside the compiled library itself (\verb'libgraphblas.so' on -Linux, \verb'libgraphblas.dylib' on the Mac). GraphBLAS will not be any slower -if these kernels are left in the cache folder, and the compiled library size -will not be affected. - -If the GraphBLAS version is changed at all (even in the last digit), all -\verb'GB_jit_*.c' files in the \verb'GraphBLAS/PreJIT' folder should be -deleted. The version mismatch will be detected during the call to -\verb'GrB_init', and any stale kernels will be safely ignored. Likewise, if a -user-defined type or operator is changed, the relevant kernels should also be -deleted from \verb'GraphBLAS/PreJIT'. For example, the -\verb'GraphBLAS/Demo/Program/gauss_demo.c' program creates a user-defined -\verb'gauss' type, and two operators, \verb'addgauss' and \verb'multgauss'. It -then intentionally changes one of the operators just to test this feature. If -the type and/or operators are changed, then the \verb'*gauss*.c' files in the -\verb'GraphBLAS/PreJIT' folder should be deleted. - -GraphBLAS will safely detect any stale \verb'PreJIT' kernels by checking them -the first time they are run after calling \verb'GrB_init' and will not use them -if they are found to be stale. If the JIT control is set to \verb'GxB_JIT_OFF' -all PreJIT kernels are flagged as unchecked. If the JIT is then renabled by -setting the control to \verb'GxB_JIT_RUN' or \verb'GxB_JIT_ON', all PreJIT -kernels will be checked again and any stale kernels will be detected. - -If a stale PreJIT kernel is found, GraphBLAS will use its run-time JIT to -compile new ones with the current definitions, or it will punt to a generic -kernel if JIT compilation is disabled. GraphBLAS will be functional, and fast -if it can rely on a JIT kernel, but the unusable stale PreJIT kernels take up -space inside the compiled GraphBLAS library. The best practice is to delete -any stale kernels from the \verb'GraphBLAS/PreJIT' folder, or replace them with -newly compiled JIT kernels from the cache folder, and recompile GraphBLAS. - -It is safe to copy only a subset of the JIT kernels from the cache folder into -\verb'GraphBLAS/PreJIT'. You may also delete any files in -\verb'GraphBLAS/PreJIT' and recompile GraphBLAS without those kernels. If -GraphBLAS encounters a need for a particular kernel that has been removed from -\verb'GraphBLAS/PreJIT', it will create it at run-time via the JIT, if -permitted. If not permitted, by either compiling GraphBLAS with the -\verb'GRAPHBLAS_USE_JIT' option set ot \verb'OFF', or by using -\verb'GxB_JIT_C_CONTROL' at run-time, the factory kernel or generic kernel will -be used instead. The generic kernel will be slower than the PreJIT or JIT -kernel, but GraphBLAS will still be functional. - -In addition to a single \verb'README.txt' file, the \verb'GraphBLAS/PreJIT' -folder includes a \verb'.gitignore' file that prevents any files in the folder -from being synced via \verb'git'. If you wish to add your PreJIT kernels to a -fork of GraphBLAS, you will need to revise this \verb'.gitignore' file. - -%------------------------------------------------------------------------------- -\subsection{{\sf JIT} and {\sf PreJIT} performance considerations} -%------------------------------------------------------------------------------- -\label{jit_performance} - -To create a good set of PreJIT kernels for a particular user application, it is -necessary to run the application with many different kinds of workloads. Each -JIT or PreJIT kernel is specialized to the particular matrix format, data type, -operators, and descriptors of its inputs. GraphBLAS can change a matrix format -(from sparse to hypersparse, for example), at its discretion, thus triggering -the use of a different kernel. Some GraphBLAS methods use heuristics to select -between different methods based upon the sparsity structure or estimates of the -kind or amount of work required. In these cases, entirely different kernels -will be compiled. As a result, it's very difficult to predict which kernels -GraphBLAS will find the need to compile, and thus a wide set of test cases -should be used in an application to allow GraphBLAS to generate as many kernels -as could be expected to appear in production use. - -GraphBLAS can encounter very small matrices, and it will often select its -bitmap format to store them. This change of format will trigger a different -kernel than the sparse or hypersparse cases. There are many other cases like -that where specific kernels are only needed for small problems. In this case, -compiling an entirely new kernel is costly, since using a compiled kernel will -be no faster than the generic kernel. When benchmarking an application to -allow GraphBLAS to compile its JIT kernels, it may be useful to pause the JIT -via \verb'GxB_JIT_PAUSE', \verb'GxB_JIT_RUN', or \verb'GxB_JIT_LOAD', when the -application knows it is calling GraphBLAS for tiny problems. These three -settings keep any loaded JIT kernels in memory, but pauses the compilation of -any new JIT kernels. Then the control can be reset to \verb'GxB_JIT_ON' once -the application finishes with its tiny problems and moves to larger ones where -the JIT will improve performance. A future version of GraphBLAS may allow -this heuristic to be implemented inside GraphBLAS itself, but for now, the -JIT does not second guess the user application; if it wants a new kernel, -the JIT will compile it if the control is set to \verb'GxB_JIT_ON'. - -%------------------------------------------------------------------------------- -\subsection{Mixing JIT kernels: MATLAB and Apple Silicon} -%------------------------------------------------------------------------------- - -In general, the JIT kernels compiled by the C interface and the kernels -compiled while using GraphBLAS in MATLAB are interchangable, and the same cache -folder can be used for both. This is the default. - -However, when using the \verb'@GrB' MATLAB interface to GraphBLAS on Apple -Silicon, the MATLAB JIT kernels are compiled as x86 binaries and executed -inside MATLAB via Rosetta. The pure C installation may compile native Arm64 -binaries for its JIT kernels. Do not mix the two. In this case, set another -cache path for MATLAB using \verb'GrB.jit' in MATLAB, or using \verb'GrB_set' -in the C interface for your native Arm64 binaries. - -%------------------------------------------------------------------------------- -\subsection{Updating the JIT when GraphBLAS source code changes} -%------------------------------------------------------------------------------- - -If you edit the GraphBLAS source code itself or add any files to -\verb'GraphBLAS/PreJIT', read the instructions in -\verb'GraphBLAS/JITpackage/README.txt' for details on how to update the JIT -source code. - -If your cache folder (\verb'~/.SuiteSparse/GrBx.y.z') changes in any way -except via GraphBLAS itself, simply delete your cache folder. GraphBLAS will -then reconstruct the kernels there as needed. - -%------------------------------------------------------------------------------- -\subsection{Future plans for the {\sf JIT} and {\sf PreJIT}} -%------------------------------------------------------------------------------- -\label{jit_future} - -\subsubsection{Kernel fusion} -The introduction of the JIT and its related PreJIT kernels allow for the future -exploitation of kernel fusion via an aggressive exploitation of the GraphBLAS -non-blocking mode. In that mode, multiple calls to GraphBLAS can be fused into -a single kernel. There are far to many possible variants to allow a fused -kernel to appear in the \verb'GraphBLAS/Source/FactoryKernels' folder, but -specific fused kernels could be created by the JIT. - -\subsubsection{Heuristics for controlling the JIT} -As mentioned in Section~\ref{jit_performance}, GraphBLAS may compile JIT -kernels that are used for only tiny problems where the compile time of a single -kernel will dominate any performance gains from using the compiled kernel. A -heuristic could be introduced so that it compiles them only for larger -problems. The possible downside of this approach is that the same JIT kernels -might be needed later for larger problems. - -\subsubsection{CUDA / SYCL / OpenCL kernels} -The CUDA JIT will enable NVIDIA GPUs to be exploited. There are simply too -many kernels to create at compile time as the ``factory kernels.'' This CUDA -JIT is in progress. A related JIT for SYCL / OpenCL kernels is under -consideration. - -\subsubsection{Better performance for multithreaded user programs:} -This version is thread-safe when used in a multithread user application, but a -better JIT critical section (many readers, one writer) might be needed. The -current critical section may be sufficiently fast since the typical case of -work done inside the critical section is a single hash table lookup. However, -the performance issues related to this have not been tested. This has no -effect if all parallelism is exploited only within GraphBLAS. It only -affects the case when multiple user threads each call GraphBLAS in parallel -(using the \verb'GxB_Context'; see Section~\ref{context}). - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\input{GrB_get_set.tex} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{SuiteSparse:GraphBLAS Colon and Index Notation} %%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{colon} - -MATLAB/Octave uses a colon notation to index into matrices, such as -\verb'C=A(2:4,3:8)', which extracts \verb'C' as 3-by-6 submatrix from \verb'A', -from rows 2 through 4 and columns 3 to 8 of the matrix \verb'A'. A single -colon is used to denote all rows, \verb'C=A(:,9)', or all columns, -\verb'C=A(12,:)', which refers to the 9th column and 12th row of \verb'A', -respectively. An arbitrary integer list can be given as well, such as the -MATLAB/Octave statements: - - {\footnotesize - \begin{verbatim} - I = [2 1 4] ; - J = [3 5] ; - C = A (I,J) ; \end{verbatim} } -\noindent -which creates the 3-by-2 matrix \verb'C' as follows: -\[ -C = -\left[ -\begin{array}{cc} -a_{2,3} & a_{2,5} \\ -a_{1,3} & a_{1,5} \\ -a_{4,3} & a_{4,5} \\ -\end{array} -\right] -\] - -The GraphBLAS API can do the equivalent of \verb'C=A(I,J)', -\verb'C=A(:,J)', \verb'C=A(I,:)', and \verb'C=A(:,:)', by passing a parameter -\verb'const GrB_Index *I' as either an array of size \verb'ni', or as the -special value \verb'GrB_ALL', which corresponds to the stand-alone colon -\verb'C=A(:,J)', and the same can be done for \verb'J'.. To compute -\verb'C=A(2:4,3:8)' in GraphBLAS requires the user application to create two -explicit integer arrays \verb'I' and \verb'J' of size 3 and 5, respectively, -and then fill them with the explicit values \verb'[2,3,4]' and -\verb'[3,4,5,6,7,8]'. This works well if the lists are small, or if the matrix -has more entries than rows or columns. - -However, particularly with hypersparse matrices, the size of the explicit -arrays \verb'I' and \verb'J' can vastly exceed the number of entries in the -matrix. When using its hypersparse format, SuiteSparse:GraphBLAS allows the -user application to create a \verb'GrB_Matrix' with dimensions up to $2^{60}$, -with no memory constraints. The only constraint on memory usage in a -hypersparse matrix is the number of entries in the matrix. - -For example, creating a $n$-by-$n$ matrix \verb'A' of type \verb'GrB_FP64' with -$n=2^{60}$ and one million entries is trivial to do in Version 2.1 (and later) -of SuiteSparse:GraphBLAS, taking at most 24MB of space. SuiteSparse:GraphBLAS -Version 2.1 (or later) could do this on an old smartphone. However, using just -the pure GraphBLAS API, constructing \verb'C=A(0:(n/2),0:(n/2))' -in SuiteSparse Version 2.0 would require the creation of an integer array -\verb'I' of size $2^{59}$, containing the sequence 0, 1, 2, 3, ...., requiring -about 4 ExaBytes of memory (4 million terabytes). This is roughly 1000 times -larger than the memory size of the world's largest computer in 2018. - -SuiteSparse:GraphBLAS Version 2.1 and later extends the GraphBLAS API with a -full implementation of the MATLAB colon notation for integers, -\verb'I=begin:inc:end'. This extension allows the construction of the matrix -\verb'C=A(0:(n/2),0:(n/2))' in this example, with dimension $2^{59}$, probably -taking just milliseconds on an old smartphone. - -The \verb'GrB_extract', \verb'GrB_assign', and \verb'GxB_subassign' operations -(described in the Section~\ref{operations}) each have parameters that define a -list of integer indices, using two parameters: - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - const GrB_Index *I ; // an array, or a special value GrB_ALL - GrB_Index ni ; // the size of I, or a special value \end{verbatim}} - -\vspace{-0.05in} -These two parameters define five kinds of index lists, which can be used to -specify either an explicit or implicit list of row indices and/or column -indices. The length of the list of indices is denoted \verb'|I|'. This -discussion applies equally to the row indices \verb'I' and the column indices -\verb'J'. The five kinds are listed below. - -\begin{enumerate} -\item - An explicit list of indices, such as \verb'I = [2 1 4 7 2]' in MATLAB - notation, is handled by passing in \verb'I' as a pointer to an array of - size 5, and passing \verb'ni=5' as the size of the list. - The length of the explicit list is \verb'ni=|I|'. - Duplicates may appear, except that for some uses of \verb'GrB_assign' - and \verb'GxB_subassign', duplicates lead to undefined behavior - according to the GraphBLAS C API Specification. - SuiteSparse:GraphBLAS specifies how duplicates are handled in all cases, - as an addition to the specification. - See Section~\ref{duplicates} for details. - -\item To specify all rows of a matrix, use \verb'I = GrB_ALL'. The - parameter \verb'ni' is ignored. This is equivalent to \verb'C=A(:,J)' - in MATLAB. In GraphBLAS, this is the sequence \verb'0:(m-1)' if \verb'A' - has \verb'm' rows, with length \verb'|I|=m'. If \verb'J' is used the - columns of an \verb'm'-by-\verb'n' matrix, then \verb'J=GrB_ALL' refers to - all columns, and is the sequence \verb'0:(n-1)', of length \verb'|J|=n'. - - \begin{alert} - {\bf SPEC:} If \verb'I' or \verb'J' are \verb'GrB_ALL', the specification - requires that \verb'ni' be passed in as \verb'm' (the number of rows) - and \verb'nj' be passed in as \verb'n'. Any other value is an error. - SuiteSparse:GraphBLAS ignores these scalar inputs and treats them as if - they are equal to their only possible correct value. - \end{alert} - -\item To specify a contiguous range of indices, such as \verb'I=10:20' - in MATLAB, the array \verb'I' has size 2, and \verb'ni' is passed to - SuiteSparse:GraphBLAS as the special value \verb'ni = GxB_RANGE'. The - beginning index is \verb'I[GxB_BEGIN]' and the ending index is - \verb'I[GxB_END]'. Both values must be non-negative since - \verb'GrB_Index' is an unsigned integer (\verb'uint64_t'). The value of - \verb'I[GxB_INC]' is ignored. - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - // to specify I = 10:20 - GrB_Index I [2], ni = GxB_RANGE ; - I [GxB_BEGIN] = 10 ; // the start of the sequence - I [GxB_END ] = 20 ; // the end of the sequence \end{verbatim}} - - \vspace{-0.05in} - Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', - The sequence has length zero if $b > e$; otherwise the length is - $|I| = (e-b) + 1$. - -\item To specify a strided range of indices with a non-negative stride, - such as \verb'I=3:2:10', the array \verb'I' has size 3, and \verb'ni' has - the special value \verb'GxB_STRIDE'. This is the sequence 3, 5, 7, 9, of - length 4. Note that 10 does not appear in the list. The end point need - not appear if the increment goes past it. - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - // to specify I = 3:2:10 - GrB_Index I [3], ni = GxB_STRIDE ; - I [GxB_BEGIN ] = 3 ; // the start of the sequence - I [GxB_INC ] = 2 ; // the increment - I [GxB_END ] = 10 ; // the end of the sequence \end{verbatim}} - - \vspace{-0.05in} - The \verb'GxB_STRIDE' sequence is the same as the \verb'List' generated by - the following for loop: - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - int64_t k = 0 ; - GrB_Index *List = (a pointer to an array of large enough size) - for (int64_t i = I [GxB_BEGIN] ; i <= I [GxB_END] ; i += I [GxB_INC]) - { - // i is the kth entry in the sequence - List [k++] = i ; - } \end{verbatim}} - - \vspace{-0.05in} - Then passing the explicit array \verb'List' and its length \verb'ni=k' has - the same effect as passing in the array \verb'I' of size 3, with - \verb'ni=GxB_STRIDE'. The latter is simply much faster to produce, and - much more efficient for SuiteSparse:GraphBLAS to process. - - Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', and let - $\Delta$ = \verb'I[GxB_INC]'. The sequence has length zero if $b > e$ or - $\Delta=0$. Otherwise, the length of the sequence is - \[ - |I| = \Bigl\lfloor\dfrac{e-b}{\Delta}\Bigr\rfloor + 1 - \] - -\item - In MATLAB notation, if the stride is negative, the sequence is decreasing. - For example, \verb'10:-2:1' is the sequence 10, 8, 6, 4, 2, in that order. - In SuiteSparse:GraphBLAS, use \verb'ni = GxB_BACKWARDS', with an array - \verb'I' of size 3. The following example specifies defines the equivalent - of the MATLAB expression \verb'10:-2:1' in SuiteSparse:GraphBLAS: - - \vspace{-0.1in} - {\footnotesize - \begin{verbatim} - // to specify I = 10:-2:1 - GrB_Index I [3], ni = GxB_BACKWARDS ; - I [GxB_BEGIN ] = 10 ; // the start of the sequence - I [GxB_INC ] = 2 ; // the magnitude of the increment - I [GxB_END ] = 1 ; // the end of the sequence \end{verbatim}} - - \vspace{-0.1in} - The value -2 cannot be assigned to the \verb'GrB_Index' array \verb'I', - since that is an unsigned type. The signed increment is represented - instead with the special value \verb'ni = GxB_BACKWARDS'. - The \verb'GxB_BACKWARDS' sequence is the same as generated by the following - for loop: - - \vspace{-0.1in} - {\footnotesize - \begin{verbatim} - int64_t k = 0 ; - GrB_Index *List = (a pointer to an array of large enough size) - for (int64_t i = I [GxB_BEGIN] ; i >= I [GxB_END] ; i -= I [GxB_INC]) - { - // i is the kth entry in the sequence - List [k++] = i ; - } \end{verbatim}} - - \vspace{-0.1in} - Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', and let - $\Delta$ = \verb'I[GxB_INC]' (note that $\Delta$ is not negative). The - sequence has length zero if $b < e$ or $\Delta=0$. Otherwise, the length - of the sequence is - \[ - |I| = \Bigl\lfloor\dfrac{b-e}{\Delta}\Bigr\rfloor + 1 - \] - -\end{enumerate} - -Since \verb'GrB_Index' is an unsigned integer, all three values -\verb'I[GxB_BEGIN]', \verb'I[GxB_INC]', and \verb'I[GxB_END]' must -be non-negative. - -Just as in MATLAB, it is valid to specify an empty sequence of length zero. -For example, \verb'I = 5:3' has length zero in MATLAB and the same is -true for a \verb'GxB_RANGE' sequence in SuiteSparse:GraphBLAS, with -\verb'I[GxB_BEGIN]=5' and \verb'I[GxB_END]=3'. This has the same -effect as array \verb'I' with \verb'ni=0'. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{GraphBLAS Operations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{operations} - -The next sections define each of the GraphBLAS operations, also listed in the -table below. - -\vspace{0.2in} -{\small -\begin{tabular}{lll} -\hline -\verb'GrB_mxm' & matrix-matrix multiply & ${\bf C \langle M \rangle = C \odot AB}$ \\ -\verb'GrB_vxm' & vector-matrix multiply & ${\bf w^{\sf T}\langle m^{\sf T}\rangle = w^{\sf T}\odot u^{\sf T}A}$ \\ -\verb'GrB_mxv' & matrix-vector multiply & ${\bf w \langle m \rangle = w \odot Au}$ \\ -\hline -\verb'GrB_eWiseMult' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \otimes B)}$ \\ - & set intersection & ${\bf w \langle m \rangle = w \odot (u \otimes v)}$ \\ -\hline -\verb'GrB_eWiseAdd' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ - & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ -\hline -\verb'GxB_eWiseUnion'& element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ - & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ -\hline -\verb'GrB_extract' & extract submatrix & ${\bf C \langle M \rangle = C \odot A(I,J)}$ \\ - & & ${\bf w \langle m \rangle = w \odot u(i)}$ \\ -\hline -\verb'GxB_subassign' & assign submatrix, & ${\bf C (I,J) \langle M \rangle = C(I,J) \odot A}$ \\ - & with submask for ${\bf C(I,J)}$ - & ${\bf w (i) \langle m \rangle = w(i) \odot u}$ \\ -\hline -\verb'GrB_assign' & assign submatrix & ${\bf C \langle M \rangle (I,J) = C(I,J) \odot A}$ \\ - & with submask for ${\bf C}$ - & ${\bf w \langle m \rangle (i) = w(i) \odot u}$ \\ -\hline -\verb'GrB_apply' & apply unary operator & ${\bf C \langle M \rangle = C \odot} f{\bf (A)}$ \\ - & & ${\bf w \langle m \rangle = w \odot} f{\bf (u)}$ \\ - & apply binary operator & ${\bf C \langle M \rangle = C \odot} f(x,{\bf A})$ \\ - & & ${\bf C \langle M \rangle = C \odot} f({\bf A},y)$ \\ - & & ${\bf w \langle m \rangle = w \odot} f(x,{\bf x})$ \\ - & & ${\bf w \langle m \rangle = w \odot} f({\bf u},y)$ \\ - & apply index-unary op & ${\bf C \langle M \rangle = C \odot} f({\bf A},i,j,k)$ \\ - & & ${\bf w \langle m \rangle = w \odot} f({\bf u},i,0,k)$ \\ -\hline -\verb'GrB_select' & select entries & ${\bf C \langle M \rangle = C \odot} \mbox{select}({\bf A},i,j,k)$ \\ - & & ${\bf w \langle m \rangle = w \odot} \mbox{select}({\bf u},i,0,k)$ \\ -\hline -\verb'GrB_reduce' & reduce to vector & ${\bf w \langle m \rangle = w \odot} [{\oplus}_j {\bf A}(:,j)]$ \\ - & reduce to scalar & $s = s \odot [{\oplus}_{ij} {\bf A}(I,J)]$ \\ -\hline -\verb'GrB_transpose' & transpose & ${\bf C \langle M \rangle = C \odot A^{\sf T}}$ \\ -\hline -\verb'GrB_kronecker' & Kronecker product & ${\bf C \langle M \rangle = C \odot \mbox{kron}(A, B)}$ \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -If an error occurs, \verb'GrB_error(&err,C)' or \verb'GrB_error(&err,w)' -returns details about the error, for operations that return a modified matrix -\verb'C' or vector \verb'w'. The only operation that cannot return an error -string is reduction to a scalar with \verb'GrB_reduce'. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_mxm:} matrix-matrix multiply} %=========================== -%=============================================================================== -\label{mxm} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_mxm // C = accum (C, A*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_mxm' multiplies two sparse matrices \verb'A' and \verb'B' using the -\verb'semiring'. The input matrices \verb'A' and \verb'B' may be transposed -according to the descriptor, \verb'desc' (which may be \verb'NULL') and then -typecasted to match the multiply operator of the \verb'semiring'. Next, -\verb'T=A*B' is computed on the \verb'semiring', precisely defined in the -\verb'GB_spec_mxm.m' script in \verb'GraphBLAS/Test'. The actual algorithm -exploits sparsity and does not take $O(n^3)$ time, but it computes the -following: - -{\footnotesize -\begin{verbatim} -[m s] = size (A.matrix) ; -[s n] = size (B.matrix) ; -T.matrix = zeros (m, n, multiply.ztype) ; -T.pattern = zeros (m, n, 'logical') ; -T.matrix (:,:) = identity ; % the identity of the semiring's monoid -T.class = multiply.ztype ; % the ztype of the semiring's multiply op -A = cast (A.matrix, multiply.xtype) ; % the xtype of the semiring's multiply op -B = cast (B.matrix, multiply.ytype) ; % the ytype of the semiring's multiply op -for j = 1:n - for i = 1:m - for k = 1:s - % T (i,j) += A (i,k) * B (k,j), using the semiring - if (A.pattern (i,k) && B.pattern (k,j)) - z = multiply (A (i,k), B (k,j)) ; - T.matrix (i,j) = add (T.matrix (i,j), z) ; - T.pattern (i,j) = true ; - end - end - end -end \end{verbatim}} - -Finally, \verb'T' is typecasted into the type of \verb'C', and the results are -written back into \verb'C' via the \verb'accum' and \verb'Mask', ${\bf C -\langle M \rangle = C \odot T}$. The latter step is reflected in the MATLAB -function \verb'GB_spec_accum_mask.m', discussed in Section~\ref{accummask}. - -\paragraph{\bf Performance considerations:} -Suppose all matrices are in \verb'GrB_COLMAJOR' format, and \verb'B' is extremely -sparse but \verb'A' is not as sparse. Then computing \verb'C=A*B' is very -fast, and much faster than when \verb'A' is extremely sparse. For example, if -\verb'A' is square and \verb'B' is a column vector that is all nonzero except -for one entry \verb'B(j,0)=1', then \verb'C=A*B' is the same as extracting -column \verb'A(:,j)'. This is very fast if \verb'A' is stored by column but -slow if \verb'A' is stored by row. If \verb'A' is a sparse row with a single -entry \verb'A(0,i)=1', then \verb'C=A*B' is the same as extracting row -\verb'B(i,:)'. This is fast if \verb'B' is stored by row but slow if \verb'B' -is stored by column. - -If the user application needs to repeatedly extract rows and columns from a -matrix, whether by matrix multiplication or by \verb'GrB_extract', then keep -two copies: one stored by row, and other by column, and use the copy that -results in the fastest computation. - -By default, \verb'GrB_mxm', \verb'GrB_mxv', \verb'GrB_vxm', and -\verb'GrB_reduce' (to vector) can return their result in a jumbled state, with -the sort left pending. It can sometimes be faster for these methods to do the -sort as they compute their result. Use the \verb'GxB_SORT' descriptor setting -to select this option. Refer to Section~\ref{descriptor} for details. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_vxm:} vector-matrix multiply} %=========================== -%=============================================================================== -\label{vxm} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_vxm // w' = accum (w, u'*A) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for u'*A - const GrB_Vector u, // first input: vector u - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_vxm' multiplies a row vector \verb"u'" times a matrix \verb'A'. The -matrix \verb'A' may be first transposed according to \verb'desc' (as the second -input, \verb'GrB_INP1'); the column vector \verb'u' is never transposed via the -descriptor. The inputs \verb'u' and \verb'A' are typecasted to match the -\verb'xtype' and \verb'ytype' inputs, respectively, of the multiply operator of -the \verb'semiring'. Next, an intermediate column vector \verb"t=A'*u" is -computed on the \verb'semiring' using the same method as \verb'GrB_mxm'. -Finally, the column vector \verb't' is typecasted from the \verb'ztype' of the -multiply operator of the \verb'semiring' into the type of \verb'w', and the -results are written back into \verb'w' using the optional accumulator -\verb'accum' and \verb'mask'. - -The last step is ${\bf w \langle m \rangle = w \odot t}$, as described -in Section~\ref{accummask}, except that all the -terms are column vectors instead of matrices. - -\paragraph{\bf Performance considerations:} % u'=u'*A -If the \verb'GrB_STORAGE_ORIENTATION_HINT' of \verb'A' is \verb'GrB_ROWMAJOR', and the default -descriptor is used (\verb'A' is not transposed), then \verb'GrB_vxm' is faster -than than \verb'GrB_mxv' with its default descriptor, when the vector \verb'u' -is very sparse. -However, if the \verb'GrB_STORAGE_ORIENTATION_HINT' of \verb'A' is \verb'GrB_COLMAJOR', then -\verb'GrB_mxv' with its default descriptor is faster than \verb'GrB_vxm' with -its default descriptor, when the vector \verb'u' is very sparse. -Using the non-default \verb'GrB_TRAN' descriptor for \verb'A' makes the -\verb'GrB_vxm' operation equivalent to \verb'GrB_mxv' with its default -descriptor (with the operands reversed in the multiplier, as well). The -reverse is true as well; \verb'GrB_mxv' with \verb'GrB_TRAN' is the same as -\verb'GrB_vxm' with a default descriptor. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_mxv:} matrix-vector multiply} %=========================== -%=============================================================================== -\label{mxv} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_mxv // w = accum (w, A*u) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_mxv' multiplies a matrix \verb'A' times a column vector \verb'u'. -The matrix \verb'A' may be first transposed according to \verb'desc' (as the -first input); the column vector \verb'u' is never transposed via the -descriptor. The inputs \verb'A' and \verb'u' are typecasted to match the -\verb'xtype' and \verb'ytype' inputs, respectively, of the multiply operator of -the \verb'semiring'. Next, an intermediate column vector \verb't=A*u' is -computed on the \verb'semiring' using the same method as \verb'GrB_mxm'. -Finally, the column vector \verb't' is typecasted from the \verb'ztype' of the -multiply operator of the \verb'semiring' into the type of \verb'w', and the -results are written back into \verb'w' using the optional accumulator -\verb'accum' and \verb'mask'. - -The last step is ${\bf w \langle m \rangle = w \odot t}$, as described -in Section~\ref{accummask}, except that all the terms are column vectors instead -of matrices. - -\paragraph{\bf Performance considerations:} % u=A*u -Refer to the discussion of \verb'GrB_vxm'. In SuiteSparse:GraphBLAS, -\verb'GrB_mxv' is very efficient when \verb'u' is sparse or dense, when the -default descriptor is used, and when the matrix is \verb'GrB_COLMAJOR'. When -\verb'u' is very sparse and \verb'GrB_INP0' is set to its non-default -\verb'GrB_TRAN', then this method is not efficient if the matrix is in -\verb'GrB_COLMAJOR' format. If an application needs to perform \verb"A'*u" -repeatedly where \verb'u' is very sparse, then use the \verb'GrB_ROWMAJOR' format -for \verb'A' instead. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_eWiseMult:} element-wise operations, set intersection} %== -%=============================================================================== -\label{eWiseMult} - -Element-wise ``multiplication'' is shorthand for applying a binary operator -element-wise on two matrices or vectors \verb'A' and \verb'B', for all entries -that appear in the set intersection of the patterns of \verb'A' and \verb'B'. -This is like \verb'A.*B' for two sparse matrices in MATLAB, except that in -GraphBLAS any binary operator can be used, not just multiplication. - -The pattern of the result of the element-wise ``multiplication'' is exactly -this set intersection. Entries in \verb'A' but not \verb'B', or visa versa, do -not appear in the result. - -Let $\otimes$ denote the binary operator to be used. The computation ${\bf T = -A \otimes B}$ is given below. Entries not in the intersection of ${\bf A}$ and -${\bf B}$ do not appear in the pattern of ${\bf T}$. That is: - \vspace{-0.2in} - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ - \> \> $t_{ij} = a_{ij} \otimes b_{ij}$ \\ - \end{tabbing} } - \vspace{-0.2in} - -Depending on what kind of operator is used and what the implicit value is -assumed to be, this can give the Hadamard product. This is the case for -\verb'A.*B' in MATLAB since the implicit value is zero. However, computing a -Hadamard product is not necessarily the goal of the \verb'eWiseMult' operation. -It simply applies any binary operator, built-in or user-defined, to the set -intersection of \verb'A' and \verb'B', and discards any entry outside this -intersection. Its usefulness in a user's application does not depend upon it -computing a Hadamard product in all cases. The operator need not be -associative, commutative, nor have any particular property except for type -compatibility with \verb'A' and \verb'B', and the output matrix \verb'C'. - -The generic name for this operation is \verb'GrB_eWiseMult', which can be used -for both matrices and vectors. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_eWiseMult:} element-wise vector multiply} -%------------------------------------------------------------------------------- -\label{eWiseMult_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_eWiseMult // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const multiply, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Vector_eWiseMult' computes the element-wise ``multiplication'' of two -vectors \verb'u' and \verb'v', element-wise using any binary operator (not just -times). The vectors are not transposed via the descriptor. The vectors -\verb'u' and \verb'v' are first typecasted into the first and second inputs of -the \verb'multiply' operator. Next, a column vector \verb't' is computed, -denoted ${\bf t = u \otimes v}$. The pattern of \verb't' is the set -intersection of \verb'u' and \verb'v'. The result \verb't' has the type of the -output \verb'ztype' of the \verb'multiply' operator. - -The \verb'operator' is typically a \verb'GrB_BinaryOp', but the method is -type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the -additive operator of the monoid is used as the \verb'multiply' binary operator. -If given a semiring (\verb'GrB_Semiring'), the multiply operator of the -semiring is used as the \verb'multiply' binary operator. -% -The \verb'multiply' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -The next and final step is ${\bf w \langle m \rangle = w \odot t}$, as -described in Section~\ref{accummask}, except that all the terms are column -vectors instead of matrices. Note for all GraphBLAS operations, including this -one, the accumulator ${\bf w \odot t}$ is always applied in a set union manner, -even though ${\bf t = u \otimes v}$ for this operation is applied in a set -intersection manner. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_eWiseMult:} element-wise matrix multiply} -%------------------------------------------------------------------------------- -\label{eWiseMult_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_eWiseMult // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const multiply, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; -\end{verbatim} -} \end{mdframed} - -\verb'GrB_Matrix_eWiseMult' computes the element-wise ``multiplication'' of two -matrices \verb'A' and \verb'B', element-wise using any binary operator (not -just times). The input matrices may be transposed first, according to the -descriptor \verb'desc'. They are then typecasted into the first and second -inputs of the \verb'multiply' operator. Next, a matrix \verb'T' is computed, -denoted ${\bf T = A \otimes B}$. The pattern of \verb'T' is the set -intersection of \verb'A' and \verb'B'. The result \verb'T' has the type of the -output \verb'ztype' of the \verb'multiply' operator. - -The \verb'multiply' operator is typically a \verb'GrB_BinaryOp', but the method -is type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the -additive operator of the monoid is used as the \verb'multiply' binary operator. -If given a semiring (\verb'GrB_Semiring'), the multiply operator of the -semiring is used as the \verb'multiply' binary operator. -% -The \verb'multiply' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\vspace{0.05in} -The operation can be expressed in MATLAB notation as: - {\footnotesize - \begin{verbatim} - [nrows, ncols] = size (A.matrix) ; - T.matrix = zeros (nrows, ncols, multiply.ztype) ; - T.class = multiply.ztype ; - p = A.pattern & B.pattern ; - A = cast (A.matrix (p), multiply.xtype) ; - B = cast (B.matrix (p), multiply.ytype) ; - T.matrix (p) = multiply (A, B) ; - T.pattern = p ; \end{verbatim} } - -The final step is ${\bf C \langle M \rangle = C \odot T}$, as described in -Section~\ref{accummask}. Note for all GraphBLAS operations, including this -one, the accumulator ${\bf C \odot T}$ is always applied in a set union manner, -even though ${\bf T = A \otimes B}$ for this operation is applied in a set -intersection manner. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_eWiseAdd:} element-wise operations, set union} %========== -%=============================================================================== -\label{eWiseAdd} - -Element-wise ``addition'' is shorthand for applying a binary operator -element-wise on two matrices or vectors \verb'A' and \verb'B', for all entries -that appear in the set intersection of the patterns of \verb'A' and \verb'B'. -This is like \verb'A+B' for two sparse matrices in MATLAB, except that in -GraphBLAS any binary operator can be used, not just addition. The pattern of -the result of the element-wise ``addition'' is the set union of the pattern of -\verb'A' and \verb'B'. Entries in neither in \verb'A' nor in \verb'B' do -not appear in the result. - -Let $\oplus$ denote the binary operator to be used. The computation ${\bf T = -A \oplus B}$ is exactly the same as the computation with accumulator operator -as described in Section~\ref{accummask}. It acts like a sparse matrix -addition, except that any operator can be used. The pattern of ${\bf A \oplus -B}$ is the set union of the patterns of ${\bf A}$ and ${\bf B}$, and the -operator is applied only on the set intersection of ${\bf A}$ and ${\bf B}$. -Entries not in either the pattern of ${\bf A}$ or ${\bf B}$ do not appear in -the pattern of ${\bf T}$. That is: - \vspace{-0.2in} - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ - \> \> $t_{ij} = a_{ij} \oplus b_{ij}$ \\ - \> for all entries $(i,j)$ in ${\bf A \setminus B}$ \\ - \> \> $t_{ij} = a_{ij}$ \\ - \> for all entries $(i,j)$ in ${\bf B \setminus A}$ \\ - \> \> $t_{ij} = b_{ij}$ - \end{tabbing} - } - -The only difference between element-wise ``multiplication'' (${\bf T =A \otimes -B}$) and ``addition'' (${\bf T = A \oplus B}$) is the pattern of the result, -and what happens to entries outside the intersection. With $\otimes$ the -pattern of ${\bf T}$ is the intersection; with $\oplus$ it is the set union. -Entries outside the set intersection are dropped for $\otimes$, and kept for -$\oplus$; in both cases the operator is only applied to those (and only those) -entries in the intersection. Any binary operator can be used interchangeably -for either operation. - -Element-wise operations do not operate on the implicit values, even implicitly, -since the operations make no assumption about the semiring. As a result, the -results can be different from MATLAB, which can always assume the implicit -value is zero. For example, \verb'C=A-B' is the conventional matrix -subtraction in MATLAB. Computing \verb'A-B' in GraphBLAS with \verb'eWiseAdd' -will apply the \verb'MINUS' operator to the intersection, entries in \verb'A' -but not \verb'B' will be unchanged and appear in \verb'C', and entries in -neither \verb'A' nor \verb'B' do not appear in \verb'C'. For these cases, the -results matches the MATLAB \verb'C=A-B'. Entries in \verb'B' but not \verb'A' -do appear in \verb'C' but they are not negated; they cannot be subtracted from -an implicit value in \verb'A'. This is by design. If conventional matrix -subtraction of two sparse matrices is required, and the implicit value is known -to be zero, use \verb'GrB_apply' to negate the values in \verb'B', and then -use \verb'eWiseAdd' with the \verb'PLUS' operator, to compute \verb'A+(-B)'. - -The generic name for this operation is \verb'GrB_eWiseAdd', which can be used -for both matrices and vectors. - -There is another minor difference in two variants of the element-wise -functions. If given a \verb'semiring', the \verb'eWiseAdd' functions use the -binary operator of the semiring's monoid, while the \verb'eWiseMult' functions -use the multiplicative operator of the semiring. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_eWiseAdd:} element-wise vector addition} -%------------------------------------------------------------------------------- -\label{eWiseAdd_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_eWiseAdd // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_eWiseAdd' computes the element-wise ``addition'' of two -vectors \verb'u' and \verb'v', element-wise using any binary operator (not just -plus). The vectors are not transposed via the descriptor. Entries in the -intersection of \verb'u' and \verb'v' are first typecasted into the first and -second inputs of the \verb'add' operator. Next, a column vector \verb't' is -computed, denoted ${\bf t = u \oplus v}$. The pattern of \verb't' is the set -union of \verb'u' and \verb'v'. The result \verb't' has the type of the output -\verb'ztype' of the \verb'add' operator. - -The \verb'add' operator is typically a \verb'GrB_BinaryOp', but the method is -type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the -additive operator of the monoid is used as the \verb'add' binary operator. If -given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of -the semiring is used as the \verb'add' binary operator. -% -The \verb'add' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -The final step is ${\bf w \langle m \rangle = w \odot t}$, as described in -Section~\ref{accummask}, except that all the terms are column vectors instead -of matrices. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_eWiseAdd:} element-wise matrix addition} -%------------------------------------------------------------------------------- -\label{eWiseAdd_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_eWiseAdd // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_eWiseAdd' computes the element-wise ``addition'' of two -matrices \verb'A' and \verb'B', element-wise using any binary operator (not -just plus). The input matrices may be transposed first, according to the -descriptor \verb'desc'. Entries in the intersection then typecasted into the -first and second inputs of the \verb'add' operator. Next, a matrix \verb'T' is -computed, denoted ${\bf T = A \oplus B}$. The pattern of \verb'T' is the set -union of \verb'A' and \verb'B'. The result \verb'T' has the type of the output -\verb'ztype' of the \verb'add' operator. - -The \verb'add' operator is typically a \verb'GrB_BinaryOp', but the method is -type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the -additive operator of the monoid is used as the \verb'add' binary operator. If -given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of -the semiring is used as the \verb'add' binary operator. -% -The \verb'add' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\vspace{0.05in} -The operation can be expressed in MATLAB notation as: - {\footnotesize - \begin{verbatim} - [nrows, ncols] = size (A.matrix) ; - T.matrix = zeros (nrows, ncols, add.ztype) ; - p = A.pattern & B.pattern ; - A = GB_mex_cast (A.matrix (p), add.xtype) ; - B = GB_mex_cast (B.matrix (p), add.ytype) ; - T.matrix (p) = add (A, B) ; - p = A.pattern & ~B.pattern ; T.matrix (p) = cast (A.matrix (p), add.ztype) ; - p = ~A.pattern & B.pattern ; T.matrix (p) = cast (B.matrix (p), add.ztype) ; - T.pattern = A.pattern | B.pattern ; - T.class = add.ztype ; \end{verbatim} } -Except for when typecasting is performed, this is identical to how the -\verb'accum' operator is applied in Figure~\ref{fig_accummask}. - -The final step is ${\bf C \langle M \rangle = C \odot T}$, as described in -Section~\ref{accummask}. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_eWiseUnion:} element-wise operations, set union} %======== -%=============================================================================== -\label{eWiseUnion} - -\verb'GxB_eWiseUnion' computes a result with the same pattern -\verb'GrB_eWiseAdd', namely, a set union of its two inputs. It differs in how -the binary operator is applied. - -Let $\oplus$ denote the binary operator to be used. The operator is applied to -every entry in $\bf A$ and $\bf B$. A pair of scalars, $\alpha$ and $\beta$ -(\verb'alpha' and \verb'beta' in the API, respectively) define the -inputs to the operator when entries are present in one matrix but not the -other. - - \vspace{-0.2in} - {\small - \begin{tabbing} - \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ - \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ - \> \> $t_{ij} = a_{ij} \oplus b_{ij}$ \\ - \> for all entries $(i,j)$ in ${\bf A \setminus B}$ \\ - \> \> $t_{ij} = a_{ij} \oplus \beta $ \\ - \> for all entries $(i,j)$ in ${\bf B \setminus A}$ \\ - \> \> $t_{ij} = \alpha \oplus b_{ij}$ - \end{tabbing} - } - -\verb'GxB_eWiseUnion' is useful in contexts where \verb'GrB_eWiseAdd' cannot be -used because of the typecasting rules of GraphBLAS. In particular, suppose -\verb'A' and \verb'B' are matrices with a user-defined type, and suppose -\verb'<' is a user-defined operator that compares two entries of this type and -returns a Boolean value. Then \verb'C=A = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Scalar alpha, - const GrB_Vector v, // second input: vector v - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -Identical to \verb'GrB_Vector_eWiseAdd' except that two scalars are used -to define how to compute the result when entries are present in one of -the two input vectors (\verb'u' and \verb'v'), but not the other. -Each of the two input scalars, \verb'alpha' and \verb'beta' -must contain an entry. -When computing the result \verb't=u+v', -if \verb'u(i)' is present but \verb'v(i)' is not, then \verb't(i)=u(i)+beta'. -Likewise, -if \verb'v(i)' is present but \verb'u(i)' is not, then \verb't(i)=alpha+v(i)', -where \verb'+' denotes the binary operator, \verb'add'. -% -The \verb'add' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_eWiseUnion:} element-wise matrix addition} -%------------------------------------------------------------------------------- -\label{eWiseUnion_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_eWiseUnion // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar alpha, - const GrB_Matrix B, // second input: matrix B - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; -\end{verbatim} } \end{mdframed} - -Identical to \verb'GrB_Matrix_eWiseAdd' except that two scalars are used -to define how to compute the result when entries are present in one of -the two input matrices (\verb'A' and \verb'B'), but not the other. -Each of the two input scalars, \verb'alpha' and \verb'beta' -must contain an entry. -When computing the result \verb'T=A+B', -if \verb'A(i,j)' is present but \verb'B(i,j))' is not, then \verb'T(i,j)=A(i,j)+beta'. -Likewise, -if \verb'B(i,j)' is present but \verb'A(i,j)' is not, then \verb'T(i,j)=alpha+B(i,j)', -where \verb'+' denotes the binary operator, \verb'add'. -% -The \verb'add' operator may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_extract:} submatrix extraction } %======================== -%=============================================================================== -\label{extract} - -The \verb'GrB_extract' function is a generic name for three specific functions: -\verb'GrB_Vector_extract', \verb'GrB_Col_extract', and -\verb'GrB_Matrix_extract'. The generic name appears in the function signature, -but the specific function name is used when describing what each variation -does. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_extract:} extract subvector from vector} -%------------------------------------------------------------------------------- -\label{extract_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_extract // w = accum (w, u(I)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Vector u, // first input: vector u - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_extract' extracts a subvector from another vector, identical -to \verb't = u (I)' in MATLAB where \verb'I' is an integer vector of row -indices. Refer to \verb'GrB_Matrix_extract' for further details; vector -extraction is the same as matrix extraction with \verb'n'-by-1 matrices. -See Section~\ref{colon} for a description of \verb'I' and \verb'ni'. -The final step is ${\bf w \langle m \rangle = w \odot -t}$, as described in Section~\ref{accummask}, except that all the terms are -column vectors instead of matrices. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_extract:} extract submatrix from matrix} -%------------------------------------------------------------------------------- -\label{extract_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_extract // C = accum (C, A(I,J)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_extract' extracts a submatrix from another matrix, identical -to \verb'T = A(I,J)' in MATLAB where \verb'I' and \verb'J' are integer vectors -of row and column indices, respectively, except that indices are zero-based in -GraphBLAS and one-based in MATLAB. The input matrix \verb'A' may be transposed -first, via the descriptor. The type of \verb'T' and \verb'A' are the same. -The size of \verb'C' is \verb'|I|'-by-\verb'|J|'. -Entries outside \verb'A(I,J)' are not accessed and do not take part in the -computation. More precisely, assuming the matrix \verb'A' is not transposed, -the matrix \verb'T' is defined as follows: - - \vspace{-0.1in} - {\footnotesize - \begin{verbatim} - T.matrix = zeros (ni, nj) ; % a matrix of size ni-by-nj - T.pattern = false (ni, nj) ; - for i = 1:ni - for j = 1:nj - if (A (I(i),J(j)).pattern) - T (i,j).matrix = A (I(i),J(j)).matrix ; - T (i,j).pattern = true ; - end - end - end \end{verbatim}} - -\vspace{-0.1in} -If duplicate indices are present in \verb'I' or \verb'J', the above method -defines the result in \verb'T'. Duplicates result in the same values of -\verb'A' being copied into different places in \verb'T'. -See Section~\ref{colon} for a description of the row indices -\verb'I' and \verb'ni', and the column indices -\verb'J' and \verb'nj'. -The final step is ${\bf C \langle M \rangle = C \odot -T}$, as described in Section~\ref{accummask}. - -\paragraph{\bf Performance considerations:} % C=A(I,J) -If \verb'A' is not transposed via input descriptor: if \verb'|I|' is small, -then it is fastest if \verb'A' is \verb'GrB_ROWMAJOR'; if -\verb'|J|' is small, then it is fastest if \verb'A' is -\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Col\_extract:} extract column vector from matrix} -%------------------------------------------------------------------------------- -\label{extract_column} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_extract // w = accum (w, A(I,j)) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Col_extract' extracts a subvector from a matrix, identical to -\verb't = A (I,j)' in MATLAB where \verb'I' is an integer vector of row indices -and where \verb'j' is a single column index. The input matrix \verb'A' may be -transposed first, via the descriptor, which results in the extraction of a -single row \verb'j' from the matrix \verb'A', the result of which is a column -vector \verb'w'. The type of \verb't' and \verb'A' are the same. -The size of \verb'w' is \verb'|I|'-by-1. - -See Section~\ref{colon} for a description of the row indices -\verb'I' and \verb'ni'. -The final step is ${\bf w \langle m -\rangle = w \odot t}$, as described in Section~\ref{accummask}, except that -all the terms are column vectors instead of matrices. - -\paragraph{\bf Performance considerations:} % w = A(I,j) -If \verb'A' is not transposed: it is fastest if the format of \verb'A' is -\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_subassign:} submatrix assignment} %======================= -%=============================================================================== -\label{subassign} - -The methods described in this section are all variations of the form -\verb'C(I,J)=A', which modifies a submatrix of the matrix \verb'C'. All -methods can be used in their generic form with the single name -\verb'GxB_subassign'. This is reflected in the prototypes. However, to avoid -confusion between the different kinds of assignment, the name of the specific -function is used when describing each variation. If the discussion applies to -all variations, the simple name \verb'GxB_subassign' is used. - -See Section~\ref{colon} for a description of the row indices -\verb'I' and \verb'ni', and the column indices -\verb'J' and \verb'nj'. - -\verb'GxB_subassign' is very similar to \verb'GrB_assign', described in -Section~\ref{assign}. The two operations are compared and contrasted in -Section~\ref{compare_assign}. For a discussion of how duplicate indices -are handled in \verb'I' and \verb'J', see Section~\ref{duplicates}. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_subassign:} assign to a subvector } -%------------------------------------------------------------------------------- -\label{subassign_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Vector_subassign' operates on a subvector \verb'w(I)' of \verb'w', -modifying it with the vector \verb'u'. The method is identical to -\verb'GxB_Matrix_subassign' described in Section~\ref{subassign_matrix}, where -all matrices have a single column each. The \verb'mask' has the same size as -\verb'w(I)' and \verb'u'. The only other difference is that the input \verb'u' -in this method is not transposed via the \verb'GrB_INP0' descriptor. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_subassign:} assign to a submatrix } -%------------------------------------------------------------------------------- -\label{subassign_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J), Mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_subassign' operates only on a submatrix \verb'S' of \verb'C', -modifying it with the matrix \verb'A'. For this operation, the result is not -the entire matrix \verb'C', but a submatrix \verb'S=C(I,J)' of \verb'C'. The -steps taken are as follows, except that ${\bf A}$ may be optionally transposed -via the \verb'GrB_INP0' descriptor option. - -\vspace{0.1in} -\begin{tabular}{lll} -\hline -Step & GraphBLAS & description \\ - & notation & \\ -\hline -1 & ${\bf S} = {\bf C(I,J)}$ & extract the ${\bf C(I,J)}$ submatrix \\ -2 & ${\bf S \langle M \rangle} = {\bf S} \odot {\bf A}$ & apply the accumulator/mask to the submatrix ${\bf S}$\\ -3 & ${\bf C(I,J)}= {\bf S}$ & put the submatrix ${\bf S}$ back into ${\bf C(I,J)}$ \\ -\hline -\end{tabular} -\vspace{0.1in} - -The accumulator/mask step in Step 2 is the same as for all other GraphBLAS -operations, described in Section~\ref{accummask}, except that for -\verb'GxB_subassign', it is applied to just the submatrix ${\bf S} = {\bf -C(I,J)}$, and thus the \verb'Mask' has the same size as ${\bf A}$, -${\bf S}$, and ${\bf C(I,J)}$. - -The \verb'GxB_subassign' operation is the reverse of matrix extraction: - -\begin{itemize} -\item -For submatrix extraction, \verb'GrB_Matrix_extract', -the submatrix \verb'A(I,J)' appears on the right-hand side of the assignment, -\verb'C=A(I,J)', and entries outside of the submatrix are not accessed and do -not take part in the computation. - -\item -For submatrix assignment, \verb'GxB_Matrix_subassign', -the submatrix \verb'C(I,J)' appears on the left-hand-side of the assignment, -\verb'C(I,J)=A', and entries outside of the submatrix are not accessed and do -not take part in the computation. - -\end{itemize} - -In both methods, the accumulator and mask modify the submatrix of the -assignment; they simply differ on which side of the assignment the submatrix -resides on. In both cases, if the \verb'Mask' matrix is present it is the same -size as the submatrix: - -\begin{itemize} - -\item -For submatrix extraction, -${\bf C \langle M \rangle = C \odot A(I,J)}$ is computed, -where the submatrix is on the right. -The mask ${\bf M}$ has the same size as the submatrix ${\bf A(I,J)}$. - -\item -For submatrix assignment, -${\bf C(I,J) \langle M \rangle = C(I,J) \odot A}$ is computed, -where the submatrix is on the left. -The mask ${\bf M}$ has the same size as the submatrix ${\bf C(I,J)}$. - -\end{itemize} - -In Step 1, the submatrix \verb'S' is first computed by the -\verb'GrB_Matrix_extract' operation, \verb'S=C(I,J)'. - -Step 2 accumulates the results ${\bf S \langle M \rangle = S \odot T}$, -exactly as described in Section~\ref{accummask}, but operating on the submatrix -${\bf S}$, not ${\bf C}$, using the optional \verb'Mask' and \verb'accum' -operator. The matrix ${\bf T}$ is simply ${\bf T}={\bf A}$, or ${\bf T}={\bf -A}^{\sf T}$ if ${\bf A}$ is transposed via the \verb'desc' descriptor, -\verb'GrB_INP0'. The \verb'GrB_REPLACE' option in the descriptor clears ${\bf -S}$ after computing ${\bf Z = T}$ or ${\bf Z = C \odot T}$, not all of ${\bf -C}$ since this operation can only modify the specified submatrix of ${\bf C}$. - -Finally, Step 3 writes the result (which is the modified submatrix \verb'S' and -not all of \verb'C') back into the \verb'C' matrix that contains it, via the -assignment \verb'C(I,J)=S', using the reverse operation from the method -described for matrix extraction: - - {\footnotesize - \begin{verbatim} - for i = 1:ni - for j = 1:nj - if (S (i,j).pattern) - C (I(i),J(j)).matrix = S (i,j).matrix ; - C (I(i),J(j)).pattern = true ; - end - end - end \end{verbatim}} - -\paragraph{\bf Performance considerations:} % C(I,J) = A -If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if -the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true -if \verb'A' is transposed. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Col\_subassign:} assign to a sub-column of a matrix} -%------------------------------------------------------------------------------- -\label{subassign_column} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(I,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(I,j) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Col_subassign' modifies a single sub-column of a matrix \verb'C'. It -is the same as \verb'GxB_Matrix_subassign' where the index vector \verb'J[0]=j' -is a single column index (and thus \verb'nj=1'), and where all matrices in -\verb'GxB_Matrix_subassign' (except \verb'C') consist of a single column. The -\verb'mask' vector has the same size as \verb'u' and the sub-column -\verb'C(I,j)'. The input descriptor \verb'GrB_INP0' is ignored; the input -vector \verb'u' is not transposed. Refer to \verb'GxB_Matrix_subassign' for -further details. - -\paragraph{\bf Performance considerations:} % C(I,j) = u -\verb'GxB_Col_subassign' is much faster than \verb'GxB_Row_subassign' if the -format of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GxB_Row_subassign' is much -faster than \verb'GxB_Col_subassign' if the format of \verb'C' is -\verb'GrB_ROWMAJOR'. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Row\_subassign:} assign to a sub-row of a matrix} -%------------------------------------------------------------------------------- -\label{subassign_row} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - const GrB_Index i, // row index - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,J) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Row_subassign' modifies a single sub-row of a matrix \verb'C'. It is -the same as \verb'GxB_Matrix_subassign' where the index vector \verb'I[0]=i' is -a single row index (and thus \verb'ni=1'), and where all matrices in -\verb'GxB_Matrix_subassign' (except \verb'C') consist of a single row. The -\verb'mask' vector has the same size as \verb'u' and the sub-column -\verb'C(I,j)'. The input descriptor \verb'GrB_INP0' is ignored; the input -vector \verb'u' is not transposed. Refer to \verb'GxB_Matrix_subassign' for -further details. - -\paragraph{\bf Performance considerations:} % C(i,J) = u' -\verb'GxB_Col_subassign' is much faster than \verb'GxB_Row_subassign' if the -format of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GxB_Row_subassign' is much -faster than \verb'GxB_Col_subassign' if the format of \verb'C' is -\verb'GrB_ROWMAJOR'. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Vector\_subassign\_$<$type$>$:} assign a scalar to a subvector} -%------------------------------------------------------------------------------- -\label{subassign_vector_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - const x, // scalar to assign to w(I) - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Vector_subassign_' assigns a single scalar to an entire -subvector of the vector \verb'w'. The operation is exactly like setting a -single entry in an \verb'n'-by-1 matrix, \verb'A(I,0) = x', where the column -index for a vector is implicitly \verb'j=0'. For further details of this -function, see \verb'GxB_Matrix_subassign_' in -Section~\ref{subassign_matrix_scalar}. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GxB\_Matrix\_subassign\_$<$type$>$:} assign a scalar to a submatrix} -%------------------------------------------------------------------------------- -\label{subassign_matrix_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - const x, // scalar to assign to C(I,J) - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_Matrix_subassign_' assigns a single scalar to an entire -submatrix of \verb'C', like the {\em scalar expansion} \verb'C(I,J)=x' in -MATLAB. The scalar \verb'x' is implicitly expanded into a matrix \verb'A' of -size \verb'ni' by \verb'nj', with all entries present and equal to \verb'x', -and then the matrix \verb'A' is assigned to -\verb'C(I,J)' using the same method as in \verb'GxB_Matrix_subassign'. Refer -to that function in Section~\ref{subassign_matrix} for further details. -For the accumulation step, the scalar \verb'x' is typecasted directly into the -type of \verb'C' when the \verb'accum' operator is not applied to it, or into -the \verb'ytype' of the \verb'accum' operator, if \verb'accum' is not NULL, for -entries that are already present in \verb'C'. - -The \verb' x' notation is otherwise the same as -\verb'GrB_Matrix_setElement' (see Section~\ref{matrix_setElement}). Any value -can be passed to this function and its type will be detected, via the -\verb'_Generic' feature of C11. For a user-defined type, \verb'x' is a -\verb'void *' pointer that points to a memory space holding a single entry of a -scalar that has exactly the same user-defined type as the matrix \verb'C'. -This user-defined type must exactly match the user-defined type of \verb'C' -since no typecasting is done between user-defined types. - -If a \verb'void *' pointer is passed in and the type of the underlying scalar -does not exactly match the user-defined type of \verb'C', then results are -undefined. No error status will be returned since GraphBLAS has no way of -catching this error. -If \verb'x' is a \verb'GrB_Scalar' with no entry, then it is implicitly -expanded into a matrix \verb'A' of size \verb'ni' by \verb'nj', with no entries -present. - -\paragraph{\bf Performance considerations:} % C(I,J) = scalar -If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if -the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true -if \verb'A' is transposed. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_assign:} submatrix assignment} %========================== -%=============================================================================== -\label{assign} - -The methods described in this section are all variations of the form -\verb'C(I,J)=A', which modifies a submatrix of the matrix \verb'C'. All -methods can be used in their generic form with the single name -\verb'GrB_assign'. These methods are very similar to their -\verb'GxB_subassign' counterparts in Section~\ref{subassign}. They differ -primarily in the size of the \verb'Mask', and how the \verb'GrB_REPLACE' option -works. Section~\ref{compare_assign} compares -\verb'GxB_subassign' and \verb'GrB_assign'. - -See Section~\ref{colon} for a description of -\verb'I', \verb'ni', \verb'J', and \verb'nj'. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_assign:} assign to a subvector } -%------------------------------------------------------------------------------- -\label{assign_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_assign' operates on a subvector \verb'w(I)' of \verb'w', -modifying it with the vector \verb'u'. The \verb'mask' vector has the same -size as \verb'w'. The method is identical to \verb'GrB_Matrix_assign' -described in Section~\ref{assign_matrix}, where all matrices have a single -column each. The only other difference is that the input \verb'u' in this -method is not transposed via the \verb'GrB_INP0' descriptor. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_assign:} assign to a submatrix } -%------------------------------------------------------------------------------- -\label{assign_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_assign' operates on a submatrix \verb'S' of \verb'C', -modifying it with the matrix \verb'A'. It may also modify all of \verb'C', -depending on the input descriptor \verb'desc' and the \verb'Mask'. - -\vspace{0.1in} -\begin{tabular}{lll} -\hline -Step & GraphBLAS & description \\ - & notation & \\ -\hline -1 & ${\bf S} = {\bf C(I,J)}$ & extract ${\bf C(I,J)}$ submatrix \\ -2 & ${\bf S} = {\bf S} \odot {\bf A}$ & apply the accumulator (but not the mask) to ${\bf S}$\\ -3 & ${\bf Z} = {\bf C}$ & make a copy of ${\bf C}$ \\ -4 & ${\bf Z(I,J)} = {\bf S}$ & put the submatrix into ${\bf Z(I,J)}$ \\ -5 & ${\bf C \langle M \rangle = Z}$ & apply the mask/replace phase to all of ${\bf C}$ \\ -\hline -\end{tabular} -\vspace{0.1in} - -In contrast to \verb'GxB_subassign', the \verb'Mask' has the same as \verb'C'. - -Step 1 extracts the submatrix and then Step 2 applies the accumulator -(or ${\bf S}={\bf A}$ if \verb'accum' is \verb'NULL'). The \verb'Mask' is -not yet applied. - -Step 3 makes a copy of the ${\bf C}$ matrix, and then Step 4 writes the -submatrix ${\bf S}$ into ${\bf Z}$. This is the same as Step 3 of -\verb'GxB_subassign', except that it operates on a temporary matrix ${\bf Z}$. - -Finally, Step 5 writes ${\bf Z}$ back into ${\bf C}$ via the \verb'Mask', using -the Mask/Replace Phase described in Section~\ref{accummask}. If -\verb'GrB_REPLACE' is enabled, then all of ${\bf C}$ is cleared prior to -writing ${\bf Z}$ via the mask. As a result, the \verb'GrB_REPLACE' option can -delete entries outside the ${\bf C(I,J)}$ submatrix. - -\paragraph{\bf Performance considerations:} % C(I,J) = A -If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if -the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true -if \verb'A' is transposed. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Col\_assign:} assign to a sub-column of a matrix} -%------------------------------------------------------------------------------- -\label{assign_column} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(:,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(:,j) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Col_assign' modifies a single sub-column of a matrix \verb'C'. It is -the same as \verb'GrB_Matrix_assign' where the index vector \verb'J[0]=j' is a -single column index, and where all matrices in \verb'GrB_Matrix_assign' (except -\verb'C') consist of a single column. - -Unlike \verb'GrB_Matrix_assign', the \verb'mask' is a vector with the same size -as a single column of \verb'C'. - -The input descriptor \verb'GrB_INP0' is ignored; the input vector \verb'u' is -not transposed. Refer to \verb'GrB_Matrix_assign' for further details. - -\paragraph{\bf Performance considerations:} % C(I,j) = u -\verb'GrB_Col_assign' is much faster than \verb'GrB_Row_assign' if the format -of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GrB_Row_assign' is much faster than -\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GrB_ROWMAJOR'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Row\_assign:} assign to a sub-row of a matrix} -%------------------------------------------------------------------------------- -\label{assign_row} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,:), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - const GrB_Index i, // row index - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,:) and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Row_assign' modifies a single sub-row of a matrix \verb'C'. It is -the same as \verb'GrB_Matrix_assign' where the index vector \verb'I[0]=i' is -a single row index, and where all matrices in \verb'GrB_Matrix_assign' -(except \verb'C') consist of a single row. - -Unlike \verb'GrB_Matrix_assign', the \verb'mask' is a vector with the same size -as a single row of \verb'C'. - -The input descriptor \verb'GrB_INP0' is ignored; the input vector \verb'u' is -not transposed. Refer to \verb'GrB_Matrix_assign' for further details. - -\paragraph{\bf Performance considerations:} % C(i,J) = u' -\verb'GrB_Col_assign' is much faster than \verb'GrB_Row_assign' if the format -of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GrB_Row_assign' is much faster than -\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GrB_ROWMAJOR'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_assign\_$<$type$>$:} assign a scalar to a subvector} -%------------------------------------------------------------------------------- -\label{assign_vector_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - const x, // scalar to assign to w(I) - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_assign_' assigns a single scalar to an entire subvector -of the vector \verb'w'. The operation is exactly like setting a single entry -in an \verb'n'-by-1 matrix, \verb'A(I,0) = x', where the column index for a -vector is implicitly \verb'j=0'. The \verb'mask' vector has the same size as -\verb'w'. For further details of this function, see -\verb'GrB_Matrix_assign_' in the next section -(\ref{assign_matrix_scalar}). - -Following the C API Specification, results are well-defined if \verb'I' -contains duplicate indices. Duplicate indices are simply ignored. See -Section~\ref{duplicates} for more details. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_assign\_$<$type$>$:} assign a scalar to a submatrix} -%------------------------------------------------------------------------------- -\label{assign_matrix_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_assign // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - const x, // scalar to assign to C(I,J) - const GrB_Index *I, // row indices - const GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - const GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_assign_' assigns a single scalar to an entire -submatrix of \verb'C', like the {\em scalar expansion} \verb'C(I,J)=x' in -MATLAB. The scalar \verb'x' is implicitly expanded into a matrix \verb'A' of -size \verb'ni' by \verb'nj', and then the matrix \verb'A' is assigned to -\verb'C(I,J)' using the same method as in \verb'GrB_Matrix_assign'. Refer -to that function in Section~\ref{assign_matrix} for further details. - -The \verb'Mask' has the same size as \verb'C'. - -For the accumulation step, the scalar \verb'x' is typecasted directly into the -type of \verb'C' when the \verb'accum' operator is not applied to it, or into -the \verb'ytype' of the \verb'accum' operator, if \verb'accum' is not NULL, for -entries that are already present in \verb'C'. - -The \verb' x' notation is otherwise the same as -\verb'GrB_Matrix_setElement' (see Section~\ref{matrix_setElement}). Any value -can be passed to this function and its type will be detected, via the -\verb'_Generic' feature of C11. For a user-defined type, \verb'x' is a -\verb'void *' pointer that points to a memory space holding a single entry of a -scalar that has exactly the same user-defined type as the matrix \verb'C'. -This user-defined type must exactly match the user-defined type of \verb'C' -since no typecasting is done between user-defined types. - -If a \verb'void *' pointer is passed in and the type of the underlying scalar -does not exactly match the user-defined type of \verb'C', then results are -undefined. No error status will be returned since GraphBLAS has no way of -catching this error. - -If \verb'x' is a \verb'GrB_Scalar' with no entry, then it is implicitly -expanded into a matrix \verb'A' of size \verb'ni' by \verb'nj', with no entries -present. - -Following the C API Specification, results are well-defined if \verb'I' or -\verb'J' contain duplicate indices. Duplicate indices are simply ignored. See -Section~\ref{duplicates} for more details. - -\paragraph{\bf Performance considerations:} % C(I,J) = scalar -If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if -the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is -fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true -if \verb'A' is transposed. - -\newpage -%=============================================================================== -\subsection{Duplicate indices in {\sf GrB\_assign} and {\sf GxB\_subassign}} -%=============================================================================== -\label{duplicates} - -According to the GraphBLAS C API Specification if the index vectors \verb'I' or -\verb'J' contain duplicate indices, the results are undefined for -\verb'GrB_Matrix_assign', \verb'GrB_Matrix_assign', \verb'GrB_Col_assign', and -\verb'GrB_Row_assign'. Only the scalar assignment operations -(\verb'GrB_Matrix_assign_TYPE' and \verb'GrB_Matrix_assign_TYPE') are -well-defined when duplicates appear in \verb'I' and \verb'J'. In those two -functions, duplicate indices are ignored. - -As an extension to the specification, SuiteSparse:GraphBLAS provides a -definition of how duplicate indices are handled in all cases. If \verb'I' has -duplicate indices, they are ignored and the last unique entry in the list is -used. When no mask and no accumulator is present, the results are identical to -how MATLAB handles duplicate indices in the built-in expression -\verb'C(I,J)=A'. Details of how this is done is shown below. - -{\small -\begin{verbatim} - function C = subassign (C, I, J, A) - % submatrix assignment with pre-sort of I and J; and remove duplicates - - % delete duplicates from I, keeping the last one seen - [I2 I2k] = sort (I) ; - Idupl = [(I2 (1:end-1) == I2 (2:end)), false] ; - I2 = I2 (~Idupl) ; - I2k = I2k (~Idupl) ; - assert (isequal (I2, unique (I))) - - % delete duplicates from J, keeping the last one seen - [J2 J2k] = sort (J) ; - Jdupl = [(J2 (1:end-1) == J2 (2:end)), false] ; - J2 = J2 (~Jdupl) ; - J2k = J2k (~Jdupl) ; - assert (isequal (J2, unique (J))) - - % do the submatrix assignment, with no duplicates in I2 or J2 - C (I2,J2) = A (I2k,J2k) ; -\end{verbatim}} - -If a mask is present, then it is replaced with \verb'M = M (I2k, J2k)' for -\verb'GxB_subassign', or with \verb'M = M (I2, J2)' for \verb'GrB_assign'. -If an accumulator operator is present, it is applied after the duplicates -are removed, as (for example): - -{\small -\begin{verbatim} - C (I2,J2) = C (I2,J2) + A (I2k,J2k) ; -\end{verbatim}} - -These definitions allow the MATLAB/Octave interface to GraphBLAS to return the same -results for \verb'C(I,J)=A' for a \verb'GrB' object as they do for built-in -MATLAB/Octave matrices. They also allow the assignment to be done in parallel. - -Results are always well-defined in SuiteSparse:GraphBLAS, but they might not be -what you expect. For example, suppose the \verb'MIN' operator is being used -the following assigment to the vector \verb'x', and suppose \verb'I' contains -the entries \verb'[0 0]'. Suppose \verb'x' is initially empty, of length 1, -and suppose \verb'y' is a vector of length 2 with the values \verb'[5 7]'. - -{\small -\begin{verbatim} - #include "GraphBLAS.h" - #undef I /* complex.h #define's I, but I is used an array below */ - #include - int main (void) - { - GrB_init (GrB_NONBLOCKING) ; - GrB_Vector x, y ; - GrB_Vector_new (&x, GrB_INT32, 1) ; - GrB_Vector_new (&y, GrB_INT32, 2) ; - GrB_Index I [2] = {0, 0} ; - GrB_Vector_setElement (y, 5, 0) ; - GrB_Vector_setElement (y, 7, 1) ; - GrB_Vector_wait (&y) ; - GxB_print (x, 3) ; - GxB_print (y, 3) ; - GrB_assign (x, NULL, GrB_MIN_INT32, y, I, 2, NULL) ; - GrB_Vector_wait (&y) ; - GxB_print (x, 3) ; - GrB_finalize ( ) ; - } -\end{verbatim}} - -You might (wrongly) expect the result to be the vector \verb'x(0)=5', since -two entries seem to be assigned, and the min operator might be expected to -take the minimum of the two. This is not how SuiteSparse:GraphBLAS handles -duplicates. - -Instead, the first duplicate index of \verb'I' is discarded -(\verb'I [0] = 0', and \verb'y(0)=5'). -and only the second entry is used -(\verb'I [1] = 0', and \verb'y(1)=7'). -The output of the above program is: - -{\small -\begin{verbatim} - - 1x1 GraphBLAS int32_t vector, sparse by col: - x, no entries - - - 2x1 GraphBLAS int32_t vector, sparse by col: - y, 2 entries - - (0,0) 5 - (1,0) 7 - - - 1x1 GraphBLAS int32_t vector, sparse by col: - x, 1 entry - - (0,0) 7 - -\end{verbatim}} - -You see that the result is \verb'x(0)=7', since the \verb'y(0)=5' entry -has been ignored because of the duplicate indices in \verb'I'. - -\begin{alert} -{\bf SPEC:} Providing a well-defined behavior for duplicate -indices with matrix and vector assignment is an extension to the specification. -The specification only defines the behavior when assigning a scalar into a matrix -or vector, and states that duplicate indices otherwise lead to undefined -results. -\end{alert} - - -\newpage -%=============================================================================== -\subsection{Comparing {\sf GrB\_assign} and {\sf GxB\_subassign}} %============= -%=============================================================================== -\label{compare_assign} - -The \verb'GxB_subassign' and \verb'GrB_assign' operations are very similar, but -they differ in two ways: - -\begin{enumerate} -\item {\bf The Mask has a different size:} - The mask in \verb'GxB_subassign' has the same dimensions as \verb'w(I)' for - vectors and \verb'C(I,J)' for matrices. In \verb'GrB_assign', the mask is - the same size as \verb'w' or \verb'C', respectively (except for the row/col - variants). The two masks are related. If \verb'M' is the mask for - \verb'GrB_assign', then \verb'M(I,J)' is the mask for \verb'GxB_subassign'. - If there is no mask, or if \verb'I' and \verb'J' are both \verb'GrB_ALL', - the two masks are the same. - For \verb'GrB_Row_assign' and \verb'GrB_Col_assign', the \verb'mask' vector - is the same size as a row or column of \verb'C', respectively. For the - corresponding \verb'GxB_Row_subassign' and \verb'GxB_Col_subassign' - operations, the \verb'mask' is the same size as the sub-row \verb'C(i,J)' or - subcolumn \verb'C(I,j)', respectively. - -\item {\bf \verb'GrB_REPLACE' is different:} - They differ in how \verb'C' is affected in areas outside the \verb'C(I,J)' - submatrix. In \verb'GxB_subassign', the \verb'C(I,J)' submatrix is the - only part of \verb'C' that can be modified, and no part of \verb'C' outside - the submatrix is ever modified. In \verb'GrB_assign', it is possible to - delete entries in \verb'C' outside the submatrix, but only in one specific - manner. Suppose the mask \verb'M' is present (or, suppose it is not - present but \verb'GrB_COMP' is true). After (optionally) complementing the - mask, the value of \verb'M(i,j)' can be 0 for some entry outside the - \verb'C(I,J)' submatrix. If the \verb'GrB_REPLACE' descriptor is - true, \verb'GrB_assign' deletes this entry. - -\end{enumerate} - -\verb'GxB_subassign' and \verb'GrB_assign' are identical if \verb'GrB_REPLACE' -is set to its default value of false, and if the masks happen to be the same. -The two masks can be the same in two cases: either the \verb'Mask' input is -\verb'NULL' (and it is not complemented via \verb'GrB_COMP'), or \verb'I' and -\verb'J' are both \verb'GrB_ALL'. -If all these conditions hold, -the two algorithms are identical and have the same performance. Otherwise, -\verb'GxB_subassign' is much faster than \verb'GrB_assign' when the latter -must examine the entire matrix \verb'C' to delete entries (when -\verb'GrB_REPLACE' is true), and if it must deal with a much larger \verb'Mask' -matrix. However, both methods have specific uses. - -Consider using \verb'C(I,J)+=F' for many submatrices \verb'F' (for example, -when assembling a finite-element matrix). If the \verb'Mask' is meant as a -specification for which entries of \verb'C' should appear in the final result, -then use \verb'GrB_assign'. - -If instead the \verb'Mask' is meant to control which entries of the submatrix -\verb'C(I,J)' are modified by the finite-element \verb'F', then use -\verb'GxB_subassign'. This is particularly useful is the \verb'Mask' is a -template that follows along with the finite-element \verb'F', independent of -where it is applied to \verb'C'. Using \verb'GrB_assign' would be very -difficult in this case since a new \verb'Mask', the same size as \verb'C', -would need to be constructed for each finite-element \verb'F'. - -In GraphBLAS notation, the two methods can be described as follows: - -\vspace{0.05in} -\begin{tabular}{ll} -\hline -matrix and vector subassign & ${\bf C(I,J) \langle M \rangle} = {\bf C(I,J)} \odot {\bf A}$ \\ -matrix and vector assign & ${\bf C \langle M \rangle (I,J)} = {\bf C(I,J)} \odot {\bf A}$ \\ -\hline -\end{tabular} -\vspace{0.05in} - -This notation does not include the details of the \verb'GrB_COMP' and -\verb'GrB_REPLACE' descriptors, but it does illustrate the difference in the -\verb'Mask'. In the subassign, \verb'Mask' is the same size as \verb'C(I,J)' -and \verb'A'. If \verb'I[0]=i' and \verb'J[0]=j', Then \verb'Mask(0,0)' -controls how \verb'C(i,j)' is modified by the subassign, from the value -\verb'A(0,0)'. In the assign, \verb'Mask' is the same size as \verb'C', and -\verb'Mask(i,j)' controls how \verb'C(i,j)' is modified. - -The \verb'GxB_subassign' and \verb'GrB_assign' functions have the same -signatures; they differ only in how they consider the \verb'Mask' and the -\verb'GrB_REPLACE' descriptor - -Details of each step of the two operations are listed below: - -\vspace{0.1in} -\begin{tabular}{lll} -\hline -Step & \verb'GrB_Matrix_assign' & \verb'GxB_Matrix_subassign' \\ -\hline -1 & ${\bf S} = {\bf C(I,J)}$ & ${\bf S} = {\bf C(I,J)}$ \\ -2 & ${\bf S} = {\bf S} \odot {\bf A}$ & ${\bf S \langle M \rangle} = {\bf S} \odot {\bf A}$ \\ -3 & ${\bf Z} = {\bf C}$ & ${\bf C(I,J)}= {\bf S}$ \\ -4 & ${\bf Z(I,J)} = {\bf S}$ & \\ -5 & ${\bf C \langle M \rangle = Z}$ & \\ -\hline -\end{tabular} -\vspace{0.1in} - -Step 1 is the same. In the Accumulator Phase (Step 2), the expression -${\bf S} \odot {\bf A}$, -described in Section~\ref{accummask}, is the same in both -operations. The result is simply ${\bf A}$ if \verb'accum' is \verb'NULL'. It -only applies to the submatrix ${\bf S}$, not the whole matrix. -The result ${\bf S} \odot {\bf A}$ is used differently in the Mask/Replace -phase. - -The Mask/Replace Phase, described in Section~\ref{accummask} is different: -\begin{itemize} -\item - For \verb'GrB_assign' (Step 5), the mask is applied to all of ${\bf - C}$. The mask has the same size as ${\bf C}$. Just prior to making the - assignment via the mask, the \verb'GrB_REPLACE' option can be used to clear - all of ${\bf C}$ first. This is the only way in which entries in ${\bf C}$ that - are outside the ${\bf C(I,J)}$ submatrix can be modified by this operation. - -\item - For \verb'GxB_subassign' (Step 2b), the mask is applied to just - ${\bf S}$. The mask has the same size as ${\bf C(I,J)}$, ${\bf S}$, and - ${\bf A}$. Just prior to making the assignment via the mask, the - \verb'GrB_REPLACE' option can be used to clear ${\bf S}$ first. No entries - in ${\bf C}$ that are outside the ${\bf C(I,J)}$ can be modified by this - operation. Thus, \verb'GrB_REPLACE' has no effect on entries in ${\bf C}$ - outside the ${\bf C(I,J)}$ submatrix. - -\end{itemize} - -The differences between \verb'GrB_assign' and -\verb'GxB_subassign' can be seen in Tables~\ref{insubmatrix} and -\ref{outsubmatrix}. The first table considers the case when the entry $c_{ij}$ -is in the ${\bf C(I,J)}$ submatrix, and it describes what is computed for both -\verb'GrB_assign' and \verb'GxB_subassign'. They perform the -exact same computation; the only difference is how the value of the mask is -specified. Compare Table~\ref{insubmatrix} with Table~\ref{tab:maskaccum} -in Section~\ref{sec:maskaccum}. - -The first column of Table~\ref{insubmatrix} is {\em yes} if \verb'GrB_REPLACE' is enabled, -and a dash otherwise. The second column is {\em yes} if an accumulator -operator is given, and a dash otherwise. The third column is $c_{ij}$ if the -entry is present in ${\bf C}$, and a dash otherwise. The fourth column is -$a_{i'j'}$ if the corresponding entry is present in ${\bf A}$, where -$i={\bf I}(i')$ and $j={\bf J}(i')$. - -The {\em mask} column is 1 if the effective value of the mask mask allows ${\bf -C}$ to be modified, and 0 otherwise. This is $m_{ij}$ for \verb'GrB_assign', -and $m_{i'j'}$ for \verb'GxB_subassign', to reflect the difference in the mask, -but this difference is not reflected in the table. The value 1 or 0 is the -value of the entry in the mask after it is optionally complemented via the -\verb'GrB_COMP' option. - -Finally, the last column is the action taken in this case. It is left blank if -no action is taken, in which case $c_{ij}$ is not modified if present, or not -inserted into ${\bf C}$ if not present. - -\begin{table} -{\small -\begin{tabular}{lllll|l} -\hline -repl & accum & ${\bf C}$ & ${\bf A}$ & mask & action taken by \verb'GrB_assign' and \verb'GxB_subassign'\\ -\hline - - &- & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, update \\ - - &- & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ - - &- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $a_{i'j'}$ not present \\ - - &- & - & - & 1 & \\ - - &- & $c_{ij}$ & $a_{i'j'}$ & 0 & \\ - - &- & - & $a_{i'j'}$ & 0 & \\ - - &- & $c_{ij}$ & - & 0 & \\ - - &- & - & - & 0 & \\ -\hline - yes&- & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, update \\ - yes&- & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ - yes&- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $a_{i'j'}$ not present \\ - yes&- & - & - & 1 & \\ - yes&- & $c_{ij}$ & $a_{i'j'}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&- & - & $a_{i'j'}$ & 0 & \\ - yes&- & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&- & - & - & 0 & \\ -\hline - - &yes & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = c_{ij} \odot a_{i'j'}$, apply accumulator \\ - - &yes & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ - - &yes & $c_{ij}$ & - & 1 & \\ - - &yes & - & - & 1 & \\ - - &yes & $c_{ij}$ & $a_{i'j'}$ & 0 & \\ - - &yes & - & $a_{i'j'}$ & 0 & \\ - - &yes & $c_{ij}$ & - & 0 & \\ - - &yes & - & - & 0 & \\ -\hline - yes&yes & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = c_{ij} \odot a_{i'j'}$, apply accumulator \\ - yes&yes & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ - yes&yes & $c_{ij}$ & - & 1 & \\ - yes&yes & - & - & 1 & \\ - yes&yes & $c_{ij}$ & $a_{i'j'}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&yes & - & $a_{i'j'}$ & 0 & \\ - yes&yes & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes&yes & - & - & 0 & \\ -\hline -\end{tabular} -} -\caption{Results of assign and subassign for entries in the ${\bf C(I,J)}$ submatrix \label{insubmatrix}} -\end{table} - -\newpage -Table~\ref{outsubmatrix} illustrates how \verb'GrB_assign' and -\verb'GxB_subassign' differ for entries outside the submatrix. -\verb'GxB_subassign' never modifies any entry outside the ${\bf C(I,J)}$ -submatrix, but \verb'GrB_assign' can modify them in two cases listed in -Table~\ref{outsubmatrix}. When the \verb'GrB_REPLACE' option is selected, and -when the \verb'Mask(i,j)' for an entry $c_{ij}$ is false (or if the -\verb'Mask(i,j)' is true and \verb'GrB_COMP' is enabled via the descriptor), -then the entry is deleted by \verb'GrB_assign'. - -The fourth column of Table~\ref{outsubmatrix} differs from -Table~\ref{insubmatrix}, since entries in ${\bf A}$ never affect these entries. -Instead, for all index pairs outside the $I \times J$ submatrix, ${\bf C}$ and -${\bf Z}$ are identical (see Step 3 above). As a result, each section of the -table includes just two cases: either $c_{ij}$ is present, or not. This in -contrast to Table~\ref{insubmatrix}, where each section must consider four -different cases. - -The \verb'GrB_Row_assign' and \verb'GrB_Col_assign' operations are slightly -different. They only affect a single row or column of ${\bf C}$. -For \verb'GrB_Row_assign', Table~\ref{outsubmatrix} only applies to entries in -the single row \verb'C(i,J)' that are outside the list of indices, \verb'J'. -For \verb'GrB_Col_assign', Table~\ref{outsubmatrix} only applies to entries in -the single column \verb'C(I,j)' that are outside the list of indices, \verb'I'. - -\begin{table} -{\small -\begin{tabular}{lllll|l} -\hline -repl & accum & ${\bf C}$ & ${\bf C=Z}$ & mask & action taken by \verb'GrB_assign' \\ -\hline - - &- & $c_{ij}$ & $c_{ij}$ & 1 & \\ - - &- & - & - & 1 & \\ - - &- & $c_{ij}$ & $c_{ij}$ & 0 & \\ - - &- & - & - & 0 & \\ -\hline - yes & - & $c_{ij}$ & $c_{ij}$ & 1 & \\ - yes & - & - & - & 1 & \\ - yes & - & $c_{ij}$ & $c_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes & - & - & - & 0 & \\ -\hline - - &yes & $c_{ij}$ & $c_{ij}$ & 1 & \\ - - &yes & - & - & 1 & \\ - - &yes & $c_{ij}$ & $c_{ij}$ & 0 & \\ - - &yes & - & - & 0 & \\ -\hline - yes & yes & $c_{ij}$ & $c_{ij}$ & 1 & \\ - yes & yes & - & - & 1 & \\ - yes & yes & $c_{ij}$ & $c_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ - yes & yes & - & - & 0 & \\ -\hline -\end{tabular} -} -\caption{Results of assign for entries outside the -${\bf C(I,J)}$ submatrix. Subassign has no effect on these entries. \label{outsubmatrix}} -\end{table} - -%------------------------------------------------------------------------------- -\subsubsection{Example} -%------------------------------------------------------------------------------- - -The difference between \verb'GxB_subassign' and \verb'GrB_assign' is -illustrated in the following example. Consider the 2-by-2 matrix ${\bf C}$ -where all entries are present. - -\[ -{\bf C} = \left[ - \begin{array}{rr} - 11 & 12 \\ - 21 & 22 \\ - \end{array} - \right] -\] - -Suppose \verb'GrB_REPLACE' is true, and \verb'GrB_COMP' is false. Let the -\verb'Mask' be: - -\[ -{\bf M} = \left[ - \begin{array}{rr} - 1 & 1 \\ - 0 & 1 \\ - \end{array} - \right]. -\] - -Let ${\bf A} = 100$, and let the index sets be ${\bf I}=0$ and ${\bf J}=1$. -Consider the computation -${\bf C \langle M \rangle} (0,1) = {\bf C}(0,1) + {\bf A}$, -using the \verb'GrB_assign' operation. The result is: -\[ -{\bf C} = \left[ - \begin{array}{rr} - 11 & 112 \\ - - & 22 \\ - \end{array} - \right]. -\] -The $(0,1)$ entry is updated and the $(1,0)$ entry is deleted because -its \verb'Mask' is zero. The other two entries are not modified since ${\bf Z} -= {\bf C}$ outside the submatrix, and those two values are written back into -${\bf C}$ because their \verb'Mask' values are 1. The $(1,0)$ entry is deleted -because the entry ${\bf Z}(1,0)=21$ is prevented from being written back into -${\bf C}$ since \verb'Mask(1,0)=0'. - -Now consider the analogous \verb'GxB_subassign' operation. The \verb'Mask' has -the same size as ${\bf A}$, namely: -\[ -{\bf M} = \left[ - \begin{array}{r} - 1 \\ - \end{array} - \right]. -\] - -After computing -${\bf C} (0,1) {\bf \langle M \rangle} = {\bf C}(0,1) + {\bf A}$, -the result is - -\[ -{\bf C} = \left[ - \begin{array}{rr} - 11 & 112 \\ - 21 & 22 \\ - \end{array} - \right]. -\] - -Only the ${\bf C(I,J)}$ submatrix, the single entry ${\bf C}(0,1)$, is modified -by \verb'GxB_subassign'. The entry ${\bf C}(1,0)=21$ is unaffected by -\verb'GxB_subassign', but it is deleted by \verb'GrB_assign'. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{Performance of {\sf GxB\_subassign}, {\sf GrB\_assign} -and {\sf GrB\_*\_setElement}} -%------------------------------------------------------------------------------- - -When SuiteSparse:GraphBLAS uses non-blocking mode, the modifications to a -matrix by \verb'GxB_subassign', \verb'GrB_assign', and \verb'GrB_*_setElement' -can postponed, and computed all at once later on. This has a huge impact on -performance. - -A sequence of assignments is fast if their completion can be postponed for as -long as possible, or if they do not modify the pattern at all. Modifying the -pattern can be costly, but it is fast if non-blocking mode can be fully -exploited. - -Consider a sequence of $t$ submatrix assignments \verb'C(I,J)=C(I,J)+A' to an -$n$-by-$n$ matrix \verb'C' where each submatrix \verb'A' has size $a$-by-$a$ -with $s$ entries, and where \verb'C' starts with $c$ entries. -Assume the matrices are all stored in non-hypersparse form, by row -(\verb'GrB_ROWMAJOR'). - -If blocking mode is enabled, or if the sequence requires the matrix to be -completed after each assignment, each of the $t$ assignments takes $O(a + s -\log n)$ time to process the \verb'A' matrix and then $O(n + c + s \log s)$ -time to complete \verb'C'. The latter step uses \verb'GrB_*_build' to build an -update matrix and then merge it with \verb'C'. This step does not occur if the -sequence of assignments does not add new entries to the pattern of \verb'C', -however. Assuming in the worst case that the pattern does change, the total -time is $O (t \left[ a + s \log n + n + c + s \log s \right] )$. - -If the sequence can be computed with all updates postponed until the end of the -sequence, then the total time is no worse than $O(a + s \log n)$ to process -each \verb'A' matrix, for $t$ assignments, and then a single \verb'build' at -the end, taking $O(n + c + st \log st)$ time. -The total time is $O (t \left [a + s \log n \right] + (n + c + st \log st))$. -If no new entries appear in -\verb'C' the time drops to $O (t \left [a + s \log n \right])$, and in this -case, the time for both methods is the same; both are equally efficient. - -A few simplifying assumptions are useful to compare these times. Consider a -graph of $n$ nodes with $O(n)$ edges, and with a constant bound on the degree -of each node. The asymptotic bounds assume a worst-case scenario where -\verb'C' has a least some dense rows (thus the $\log n$ terms). If these -are not present, if both $t$ and $c$ are $O(n)$, and if $a$ and $s$ are -constants, then the total time with blocking mode becomes $O(n^2)$, assuming -the pattern of \verb'C' changes at each assignment. This very high for a -sparse graph problem. In contrast, the non-blocking time becomes $O(n \log n)$ -under these same assumptions, which is asymptotically much faster. - -\newpage -The difference in practice can be very dramatic, since $n$ can be many millions -for sparse graphs with $n$ nodes and $O(n)$, which can be handled on a -commodity laptop. - -The following guidelines should be considered when using -\verb'GxB_subassign', \verb'GrB_assign' and \verb'GrB_*_setElement'. - -\begin{enumerate} - -\item A sequence of assignments that does not modify the pattern at all is -fast, taking as little as $\Omega(1)$ time per entry modified. The worst case -time complexity is $O(\log n)$ per entry, assuming they all modify a dense -row of \verb'C' with \verb'n' entries, which can occur in practice. It is -more common, however, that most rows of \verb'C' have a constant number of -entries, independent of \verb'n'. No work is ever left pending when the -pattern of \verb'C' does not change. - -\item A sequence of assignments that modifies the entries that already exist in -the pattern of a matrix, or adds new entries to the pattern (using the same -\verb'accum' operator), but does not delete any entries, is fast. The matrix -is not completed until the end of the sequence. - -\item Similarly, a sequence that modifies existing entries, or deletes them, -but does not add new ones, is also fast. This sequence can also repeatedly -delete pre-existing entries and then reinstate them and still be fast. The -matrix is not completed until the end of the sequence. - -\item A sequence that mixes assignments of types (2) and (3) above can be -costly, since the matrix may need to be completed after each assignment. The -time complexity can become quadratic in the worst case. - -\item However, any single assignment takes no more than $O (a + s \log n + n + -c + s \log s )$ time, even including the time for a matrix completion, where -\verb'C' is $n$-by-$n$ with $c$ entries and \verb'A' is $a$-by-$a$ with $s$ -entries. This time is essentially linear in the size of the matrix \verb'C', -if \verb'A' is relatively small and sparse compared with \verb'C'. In this -case, $n+c$ are the two dominant terms. - -\item In general, \verb'GxB_subassign' is faster than \verb'GrB_assign'. -If \verb'GrB_REPLACE' is used with \verb'GrB_assign', the entire matrix -\verb'C' must be traversed. This is much slower than \verb'GxB_subassign', -which only needs to examine the \verb'C(I,J)' submatrix. Furthermore, -\verb'GrB_assign' must deal with a much larger \verb'Mask' matrix, whereas -\verb'GxB_subassign' has a smaller mask. Since its mask is smaller, -\verb'GxB_subassign' takes less time than \verb'GrB_assign' to access the mask. - -\end{enumerate} - -% see GraphBLAS/Test/test46.m - -Submatrix assignment in SuiteSparse:GraphBLAS is extremely efficient, even -without considering the advantages of non-blocking mode discussed in -Section~\ref{compare_assign}. It can be up to 1000x faster than MATLAB R2019b, -or even higher depending on the kind of matrix assignment. MATLAB logical -indexing (the mask of GraphBLAS) is extremely faster with GraphBLAS as compared -in MATLAB R2019b; differences of up to 250,000x have been observed (0.4 seconds -in GraphBLAS versus 28 hours in MATLAB). - -All of the 28 variants (each with their own source code) are either -asymptotically optimal, or to within a log factor of being asymptotically -optimal. The methods are also fully parallel. For hypersparse matrices, the -term $n$ in the expressions in the above discussion is dropped, and is replaced -with $h \log h$, at the worst case, where $h << n$ is the number of non-empty -columns of a hypersparse matrix stored by column, or the number of non-empty -rows of a hypersparse matrix stored by row. In many methods, $n$ is replaced -with $h$, not $h \log h$. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_apply:} apply a unary, binary, or index-unary operator} -%=============================================================================== -\label{apply} - -\verb'GrB_apply' is the generic name for 92 specific functions: - -\begin{packed_itemize} -\item -\verb'GrB_Vector_apply' and \verb'GrB_Matrix_apply' apply a unary operator to -the entries of a matrix (two variants). - -\item \verb'GrB_*_apply_BinaryOp1st_*' applies a binary -operator where a single scalar is provided as the $x$ input to the binary -operator. -There are 30 variants, depending on the type of the scalar: (matrix or vector) -x (13 built-in types, one for user-defined types, and a version for -\verb'GrB_Scalar'). - -\item \verb'GrB_*_apply_BinaryOp2nd_*' applies a binary operator where a -single scalar is provided as the $y$ input to the binary operator. -There are 30 variants, depending on the type of the scalar: (matrix or vector) -x (13 built-in types, one for user-defined types, and a version for -\verb'GrB_Scalar'). - -\item \verb'GrB_*_apply_IndexOp_*' applies a \verb'GrB_IndexUnaryOp', -single scalar is provided as the scalar $y$ input to the index-unary operator. -There are 30 variants, depending on the type of the scalar: (matrix or vector) -x (13 built-in types, one for user-defined types, and a version for -\verb'GrB_Scalar'). - -\end{packed_itemize} - -The generic -name appears in the function prototypes, but the specific function name is used -when describing each variation. When discussing features that apply to all -versions, the simple name \verb'GrB_apply' is used. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_apply:} apply a unary operator to a vector} -%------------------------------------------------------------------------------- -\label{apply_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_apply' applies a unary operator to the entries of a vector, -analogous to \verb't = op(u)' in MATLAB except the operator \verb'op' is only -applied to entries in the pattern of \verb'u'. Implicit values outside the -pattern of \verb'u' are not affected. The entries in \verb'u' are typecasted -into the \verb'xtype' of the unary operator. The vector \verb't' has the same -type as the \verb'ztype' of the unary operator. The final step is ${\bf w -\langle m \rangle = w \odot t}$, as described in Section~\ref{accummask}, -except that all the terms are column vectors instead of matrices. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_apply:} apply a unary operator to a matrix} -%------------------------------------------------------------------------------- -\label{apply_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // C = accum (C, op(A)) or op(A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_apply' -applies a unary operator to the entries of a matrix, analogous to -\verb'T = op(A)' in MATLAB except the operator \verb'op' is only applied to -entries in the pattern of \verb'A'. Implicit values outside the pattern of -\verb'A' are not affected. The input matrix \verb'A' may be transposed first. -The entries in \verb'A' are typecasted into the \verb'xtype' of the unary -operator. The matrix \verb'T' has the same type as the \verb'ztype' of the -unary operator. The final step is ${\bf C \langle M \rangle = C \odot T}$, as -described in Section~\ref{accummask}. - -The built-in \verb'GrB_IDENTITY_'$T$ operators (one for each built-in type $T$) -are very useful when combined with this function, enabling it to compute ${\bf -C \langle M \rangle = C \odot A}$. This makes \verb'GrB_apply' a direct -interface to the accumulator/mask function for both matrices and vectors. -The \verb'GrB_IDENTITY_'$T$ operators also provide the fastest stand-alone -typecasting methods in SuiteSparse:GraphBLAS, with all $13 \times 13=169$ -methods appearing as individual functions, to typecast between any of the 13 -built-in types. - -To compute ${\bf C \langle M \rangle = A}$ or ${\bf C \langle M \rangle = C -\odot A}$ for user-defined types, the user application would need to define an -identity operator for the type. Since GraphBLAS cannot detect that it is an -identity operator, it must call the operator to make the full copy \verb'T=A' -and apply the operator to each entry of the matrix or vector. - -The other GraphBLAS operation that provides a direct interface to the -accumulator/mask function is \verb'GrB_transpose', which does not require an -operator to perform this task. As a result, \verb'GrB_transpose' can be used -as an efficient and direct interface to the accumulator/mask function for -both built-in and user-defined types. However, it is only available for -matrices, not vectors. - -% \newpage -%=============================================================================== -\subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp1st:} apply a binary operator to a vector; 1st scalar binding} -%=============================================================================== -\label{vector_apply1st} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_apply_BinaryOp1st_' applies a binary operator -$z=f(x,y)$ to a vector, where a scalar $x$ is bound to the first input of the -operator. -The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Vector_apply'. - -The \verb'op' can be any binary operator except that it cannot be a -user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. -For backward compatibility with prior versions of SuiteSparse:GraphBLAS, -built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be -used, however. The equivalent index-unary operators are used in their place. - -\newpage -%=============================================================================== -\subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp2nd:} apply a binary operator to a vector; 2nd scalar binding} -%=============================================================================== -\label{vector_apply2nd} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_apply_BinaryOp2nd_' applies a binary operator -$z=f(x,y)$ to a vector, where a scalar $y$ is bound to the second input of the -operator. -The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Vector_apply'. - -The \verb'op' can be any binary operator except that it cannot be a -user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. -For backward compatibility with prior versions of SuiteSparse:GraphBLAS, -built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be -used, however. The equivalent index-unary operators are used in their place. - -% \newpage -%=============================================================================== -\subsubsection{{\sf GrB\_Vector\_apply\_IndexOp:} apply an index-unary operator to a vector} -%=============================================================================== -\label{vector_apply_idxunop} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_apply_IndexOp_' applies an index-unary operator -$z=f(x,i,0,y)$ to a vector. -The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Vector_apply'. - -% \newpage -%=============================================================================== -\subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp1st:} apply a binary operator to a matrix; 1st scalar binding} -%=============================================================================== -\label{matrix_apply1st} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_apply_BinaryOp1st_' applies a binary operator -$z=f(x,y)$ to a matrix, where a scalar $x$ is bound to the first input of the -operator. -The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Matrix_apply'. - -The \verb'op' can be any binary operator except that it cannot be a -user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. -For backward compatibility with prior versions of SuiteSparse:GraphBLAS, -built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be -used, however. The equivalent index-unary operators are used in their place. - -% \newpage -%=============================================================================== -\subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp2nd:} apply a binary operator to a matrix; 2nd scalar binding} -%=============================================================================== -\label{matrix_apply2nd} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_apply_BinaryOp2nd_' applies a binary operator -$z=f(x,y)$ to a matrix, where a scalar $x$ is bound to the second input of the -operator. -The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Matrix_apply'. - -The \verb'op' can be any binary operator except that it cannot be a -user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. -For backward compatibility with prior versions of SuiteSparse:GraphBLAS, -built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be -used, however. The equivalent index-unary operators are used in their place. - -%=============================================================================== -\subsubsection{{\sf GrB\_Matrix\_apply\_IndexOp:} apply an index-unary operator to a matrix} -%=============================================================================== -\label{matrix_apply_idxunop} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_apply // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_apply_IndexOp_' applies an index-unary operator -$z=f(x,i,j,y)$ to a matrix. -The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in -type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. -It is otherwise identical to \verb'GrB_Matrix_apply'. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_select:} select entries based on an index-unary operator} -%=============================================================================== -\label{select} - -The \verb'GrB_select' function is the generic name for 30 specific functions, -depending on whether it operates on a matrix or vector, and depending on the -type of the scalar \verb'y': (matrix or vector) x (13 built-in types, -\verb'void *' for user-defined types, and a \verb'GrB_Scalar'). The generic -name appears in the function prototypes, but the specific function name is used -when describing each variation. When discussing features that apply to both -versions, the simple name \verb'GrB_select' is used. - -% \newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_select:} select entries from a vector} -%------------------------------------------------------------------------------- -\label{select_vector} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_select // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_select_*' applies a \verb'GrB_IndexUnaryOp' operator to the -entries of a vector. If the operator evaluates as \verb'true' for the entry -\verb'u(i)', it is copied to the vector \verb't', or not copied if the operator -evaluates to \verb'false'. The vector \verb't' is then written to the result -\verb'w' via the mask/accumulator step. This operation operates on vectors -just as if they were \verb'm'-by-1 matrices, except that GraphBLAS never -transposes a vector via the descriptor. Refer to the next section -(\ref{select_matrix}) on \verb'GrB_Matrix_select' for more details. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_select:} apply a select operator to a matrix} -%------------------------------------------------------------------------------- -\label{select_matrix} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_select // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_select_*' applies a \verb'GrB_IndexUnaryOp' operator to the -entries of a matrix. If the operator evaluates as \verb'true' for the entry -\verb'A(i,j)', it is copied to the matrix \verb'T', or not copied if the -operator evaluates to \verb'false'. The input matrix \verb'A' may be -transposed first. The entries in \verb'A' are typecasted into the \verb'xtype' -of the select operator. The final step is ${\bf C \langle M \rangle = C \odot -T}$, as described in Section~\ref{accummask}. - -The matrix \verb'T' has the same size and type as \verb'A' (or the transpose of -\verb'A' if the input is transposed via the descriptor). The entries of -\verb'T' are a subset of those of \verb'A'. Each entry \verb'A(i,j)' of -\verb'A' is passed to the \verb'op', as $z=f(a_{ij},i,j,y)$. If -\verb'A' is transposed first then the operator is applied to entries in the -transposed matrix, \verb"A'". If $z$ is returned as true, then the entry is -copied into \verb'T', unchanged. If it returns false, the entry does not -appear in \verb'T'. - -The action of \verb'GrB_select' with the built-in index-unary operators is -described in the table below. The MATLAB analogs are precise for \verb'tril' -and \verb'triu', but shorthand for the other operations. The MATLAB -\verb'diag' function returns a column with the diagonal, if \verb'A' is a -matrix, whereas the matrix \verb'T' in \verb'GrB_select' always has the same -size as \verb'A' (or its transpose if the \verb'GrB_INP0' is set to -\verb'GrB_TRAN'). In the MATLAB analog column, \verb'diag' is as if it -operates like \verb'GrB_select', where \verb'T' is a matrix. - -The following operators may be used on matrices with a user-defined type: -\verb'GrB_ROWINDEX_*', -\verb'GrB_COLINDEX_*', -\verb'GrB_DIAGINDEX_*', -\verb'GrB_TRIL', \newline -\verb'GrB_TRIU', -\verb'GrB_DIAG', -\verb'GrB_OFFIAG', -\verb'GrB_COLLE', -\verb'GrB_COLGT', -\verb'GrB_ROWLE', -and -\verb'GrB_ROWGT'. - -For floating-point values, comparisons with \verb'NaN' always return false. -The \verb'GrB_VALUE*' operators should not be used with a scalar \verb'y' that is -equal to \verb'NaN'. For this case, create a user-defined index-unary operator that -performs the test with the ANSI C \verb'isnan' function instead. - -\vspace{0.2in} -\noindent -{\footnotesize -\begin{tabular}{lll} -\hline -GraphBLAS name & MATLAB/Octave & description \\ - & analog & \\ -\hline -\verb'GrB_ROWINDEX_*' & \verb'z=i+y' & select \verb'A(i,j)' if \verb'i != -y' \\ -\verb'GrB_COLINDEX_*' & \verb'z=j+y' & select \verb'A(i,j)' if \verb'j != -y' \\ -\verb'GrB_DIAGINDEX_*' & \verb'z=j-(i+y)' & select \verb'A(i,j)' if \verb'j != i+y' \\ -\hline -\verb'GrB_TRIL' & \verb'z=(j<=(i+y))' & select entries on or below the \verb'y'th diagonal \\ -\verb'GrB_TRIU' & \verb'z=(j>=(i+y))' & select entries on or above the \verb'y'th diagonal \\ -\verb'GrB_DIAG' & \verb'z=(j==(i+y))' & select entries on the \verb'y'th diagonal \\ -\verb'GrB_OFFDIAG' & \verb'z=(j!=(i+y))' & select entries not on the \verb'y'th diagonal \\ -\verb'GrB_COLLE' & \verb'z=(j<=y)' & select entries in columns 0 to \verb'y' \\ -\verb'GrB_COLGT' & \verb'z=(j>y)' & select entries in columns \verb'y+1' and above \\ -\verb'GrB_ROWLE' & \verb'z=(i<=y)' & select entries in rows 0 to \verb'y' \\ -\verb'GrB_ROWGT' & \verb'z=(i>y)' & select entries in rows \verb'y+1' and above \\ -\hline -\verb'GrB_VALUENE_T' & \verb'z=(aij!=y)' & select \verb'A(i,j)' if it is not equal to \verb'y'\\ -\verb'GrB_VALUEEQ_T' & \verb'z=(aij==y)' & select \verb'A(i,j)' is it equal to \verb'y'\\ -\verb'GrB_VALUEGT_T' & \verb'z=(aij>y)' & select \verb'A(i,j)' is it greater than \verb'y' \\ -\verb'GrB_VALUEGE_T' & \verb'z=(aij>=y)' & select \verb'A(i,j)' is it greater than or equal to \verb'y' \\ -\verb'GrB_VALUELT_T' & \verb'z=(aij = accum (w,reduce(A)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // reduce monoid for t=reduce(A) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_reduce_Monoid' -reduces a matrix to a column vector using a monoid, roughly analogous -to \verb"t = sum (A')" in MATLAB, in the default case, where \verb't' is a -column vector. By default, the method reduces across the rows to -obtain a column vector; use \verb'GrB_TRAN' to reduce down the columns. - -The input matrix \verb'A' may be transposed first. Its entries are then -typecast into the type of the \verb'reduce' operator or monoid. The reduction -is applied to all entries in \verb'A (i,:)' to produce the scalar \verb't (i)'. -This is done without the use of the identity value of the monoid. If the -\verb'i'th row \verb'A (i,:)' has no entries, then \verb'(i)' is not an entry -in \verb't' and its value is implicit. If \verb'A (i,:)' has a single entry, -then that is the result \verb't (i)' and \verb'reduce' is not applied at all -for the \verb'i'th row. Otherwise, multiple entries in row \verb'A (i,:)' are -reduced via the \verb'reduce' operator or monoid to obtain a single scalar, -the result \verb't (i)'. - -The final step is ${\bf w \langle m \rangle = w \odot t}$, as described -in Section~\ref{accummask}, except that all the -terms are column vectors instead of matrices. - -\newpage -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Vector\_reduce\_$<$type$>$:} reduce a vector to a scalar} -%------------------------------------------------------------------------------- -\label{reduce_vector_to_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (u)) -( - *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc // descriptor (currently unused) -) ; - -GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (u)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc // descriptor (currently unused) -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Vector_reduce_' -reduces a vector to a scalar, analogous to \verb't = sum (u)' in MATLAB, -except that in GraphBLAS any commutative and associative monoid can be used -in the reduction. - -The scalar \verb'c' can be a pointer C type: \verb'bool', \verb'int8_t', ... -\verb'float', \verb'double', or \verb'void *' for a user-defined type, -or a \verb'GrB_Scalar'. -If \verb'c' is a \verb'void *' pointer to a user-defined type, -the type must be identical to the type of the vector \verb'u'. -This cannot be checked by GraphBLAS and thus results are undefined if the -types are not the same. - -If the vector \verb'u' has no entries, that identity value of the \verb'monoid' -is copied into the scalar \verb't' (unless \verb'c' is a \verb'GrB_Scalar', -in which case \verb't' is an empty \verb'GrB_Scalar', with no entry). -Otherwise, all of the entries in the -vector are reduced to a single scalar using the \verb'monoid'. - -The descriptor is unused, but it appears in case it is needed in future -versions of the GraphBLAS API. -This function has no mask so its accumulator/mask step differs from the other -GraphBLAS operations. It does not use the methods described in -Section~\ref{accummask}, but uses the following method instead. - -If \verb'accum' is \verb'NULL', then the scalar \verb't' is typecast into the -type of \verb'c', and \verb'c = t' is the final result. Otherwise, the scalar -\verb't' is typecast into the \verb'ytype' of the \verb'accum' operator, and -the value of \verb'c' (on input) is typecast into the \verb'xtype' of the -\verb'accum' operator. Next, the scalar \verb'z = accum (c,t)' is computed, of -the \verb'ztype' of the \verb'accum' operator. Finally, \verb'z' is typecast -into the final result, \verb'c'. - -If \verb'c' is a non-opaque scalar, no error message can be returned by -\verb'GrB_error'. If \verb'c' is a \verb'GrB_Scalar', then -\verb'GrB_error(&err,c)' can be used to return an error string, if an error -occurs. - -%------------------------------------------------------------------------------- -\subsubsection{{\sf GrB\_Matrix\_reduce\_$<$type$>$:} reduce a matrix to a scalar} -%------------------------------------------------------------------------------- -\label{reduce_matrix_to_scalar} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (A)) -( - *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc // descriptor (currently unused) -) ; - -GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (A)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc // descriptor (currently unused) -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_Matrix_reduce_' reduces a matrix \verb'A' to a scalar, roughly -analogous to \verb't = sum (A (:))' in MATLAB. This function is identical to -reducing a vector to a scalar, since the positions of the entries in a matrix -or vector have no effect on the result. Refer to the reduction to scalar -described in the previous Section~\ref{reduce_vector_to_scalar}. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_transpose:} transpose a matrix} %========================= -%=============================================================================== -\label{transpose} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_transpose // C = accum (C, A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_transpose' -transposes a matrix \verb'A', just like the array transpose \verb"T = A.'" in -MATLAB. The internal result matrix \verb"T = A'" (or merely \verb"T = A" if -\verb'A' is transposed via the descriptor) has the same type as \verb'A'. The -final step is ${\bf C \langle M \rangle = C \odot T}$, as described in -Section~\ref{accummask}, which typecasts \verb'T' as needed and applies the -mask and accumulator. - -To be consistent with the rest of the GraphBLAS API regarding the -descriptor, the input matrix \verb'A' may be transposed first by -setting the \verb'GrB_INP0' setting to \verb'GrB_TRAN'. This results in -a double transpose, and thus \verb'A' is not transposed is computed. - -\newpage -%=============================================================================== -\subsection{{\sf GrB\_kronecker:} Kronecker product} %========================== -%=============================================================================== -\label{kron} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GrB_kronecker // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const op, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; -\end{verbatim} } \end{mdframed} - -\verb'GrB_kronecker' computes the Kronecker product, -${\bf C \langle M \rangle = C \odot \mbox{kron}(A,B)}$ where -\[ -\mbox{kron}{\bf (A,B)} = -\left[ - \begin{array}{ccc} - a_{00} \otimes {\bf B} & \ldots & a_{0,n-1} \otimes {\bf B} \\ - \vdots & \ddots & \vdots \\ - a_{m-1,0} \otimes {\bf B} & \ldots & a_{m-1,n-1} \otimes {\bf B} \\ - \end{array} -\right] -\] -The $\otimes$ operator is defined by the \verb'op' parameter. It is applied in -an element-wise fashion (like \verb'GrB_eWiseMult'), where the pattern of the -submatrix $a_{ij} \otimes {\bf B}$ is the same as the pattern of ${\bf B}$ if -$a_{ij}$ is an entry in the matrix ${\bf A}$, or empty otherwise. The input -matrices \verb'A' and \verb'B' can be of any dimension, and both matrices may -be transposed first via the descriptor, \verb'desc'. Entries in \verb'A' and -\verb'B' are typecast into the input types of the \verb'op'. The matrix -\verb'T=kron(A,B)' has the same type as the \verb'ztype' of the binary -operator, \verb'op'. The final step is ${\bf C \langle M \rangle = C \odot -T}$, as described in Section~\ref{accummask}. - -The operator \verb'op' may be a \verb'GrB_BinaryOp', a \verb'GrB_Monoid', or a -\verb'GrB_Semiring'. In the latter case, the multiplicative operator of -the semiring is used. -% -The \verb'op' may be a binary operator -created by \verb'GxB_BinaryOp_new_IndexOp'. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{fprint} - -The ten different objects handled by SuiteSparse:GraphBLAS are all opaque, -although nearly all of their contents can be extracted via methods such as -\verb'GrB_Matrix_extractTuples', \verb'GrB_Matrix_extractElement', -\verb'GrB_get', and so on. The GraphBLAS C API has no mechanism for -printing all the contents of GraphBLAS objects, but this is helpful for -debugging. Ten type-specific methods and two type-generic methods are -provided: - -\vspace{0.2in} -{\footnotesize -\begin{tabular}{ll} -\hline -\verb'GxB_Type_fprint' & print and check a \verb'GrB_Type' \\ -\verb'GxB_UnaryOp_fprint' & print and check a \verb'GrB_UnaryOp' \\ -\verb'GxB_BinaryOp_fprint' & print and check a \verb'GrB_BinaryOp' \\ -\verb'GxB_IndexUnaryOp_fprint' & print and check a \verb'GrB_IndexUnaryOp' \\ -\verb'GxB_IndexBinaryOp_fprint'& print and check a \verb'GxB_IndexBinaryOp' \\ -\verb'GxB_Monoid_fprint' & print and check a \verb'GrB_Monoid' \\ -\verb'GxB_Semiring_fprint' & print and check a \verb'GrB_Semiring' \\ -\verb'GxB_Descriptor_fprint' & print and check a \verb'GrB_Descriptor' \\ -\verb'GxB_Context_fprint' & print and check a \verb'GxB_Context' \\ -\verb'GxB_Matrix_fprint' & print and check a \verb'GrB_Matrix' \\ -\verb'GxB_Vector_fprint' & print and check a \verb'GrB_Vector' \\ -\verb'GxB_Scalar_fprint' & print and check a \verb'GrB_Scalar' \\ -\hline -\verb'GxB_fprint' & print/check any object to a file \\ -\verb'GxB_print' & print/check any object to \verb'stdout' \\ -\hline -\end{tabular} -} -\vspace{0.2in} - -These methods do not modify the status of any object, and thus they -cannot return an error string for use by \verb'GrB_error'. - -If a matrix or vector -has not been completed, the pending computations are guaranteed to {\em not} be -performed. The reason is simple. It is possible for a bug in the user -application (such as accessing memory outside the bounds of an array) to mangle -the internal content of a GraphBLAS object, and the \verb'GxB_*print' methods -can be helpful tools to track down this bug. If \verb'GxB_*print' attempted to -complete any computations prior to printing or checking the contents of the -matrix or vector, then further errors could occur, including a segfault. - -By contrast, GraphBLAS methods and operations that return values into -user-provided arrays or variables might finish pending operations before the -return these values, and this would change their state. Since they do not -change the state of any object, the \verb'GxB_*print' methods provide a useful -method for debugging, and for a quick understanding of what GraphBLAS is -computing while developing a user application. - -Each of the methods has a parameter of type \verb'GxB_Print_Level' that -specifies the amount to print: - -{\footnotesize -\begin{verbatim} -typedef enum -{ - GxB_SILENT = 0, // nothing is printed, just check the object - GxB_SUMMARY = 1, // print a terse summary - GxB_SHORT = 2, // short description, about 30 entries of a matrix - GxB_COMPLETE = 3, // print the entire contents of the object - GxB_SHORT_VERBOSE = 4, // GxB_SHORT but with "%.15g" for doubles - GxB_COMPLETE_VERBOSE = 5 // GxB_COMPLETE but with "%.15g" for doubles -} -GxB_Print_Level ; \end{verbatim}} - -The ten type-specific functions include an additional argument, the -\verb'name' string. The \verb'name' is printed at the beginning of the display -(assuming the print level is not \verb'GxB_SILENT') so that the object can be -more easily identified in the output. For the type-generic methods -\verb'GxB_fprint' and \verb'GxB_print', the \verb'name' string is the variable -name of the object itself. - -If the file \verb'f' is \verb'NULL', \verb'stdout' is used. -If \verb'name' is \verb'NULL', it is treated -as the empty string. These are not error conditions. - -The methods check their input objects carefully and extensively, even when -\verb'pr' is equal to \verb'GxB_SILENT'. The following error codes can be -returned: - -\begin{packed_itemize} -\item \verb'GrB_SUCCESS': object is valid -\item \verb'GrB_UNINITIALIZED_OBJECT': object is not initialized -\item \verb'GrB_INVALID_OBJECT': object is not valid -\item \verb'GrB_NULL_POINTER': object is a NULL pointer -\item \verb'GrB_INVALID_VALUE': \verb'fprintf' returned an I/O error. -\end{packed_itemize} - -The content of any GraphBLAS object is opaque, and subject to change. As a -result, the exact content and format of what is printed is -implementation-dependent, and will change from version to version of -SuiteSparse:GraphBLAS. Do not attempt to rely on the exact content or format -by trying to parse the resulting output via another program. The intent of -these functions is to produce a report of an object for visual inspection. If -the user application needs to extract content from a GraphBLAS matrix or -vector, use \verb'GrB_*_extractTuples' or the import/export methods instead. - -GraphBLAS matrices and vectors are zero-based, where indices of an $n$-by-$n$ -matrix are in the range 0 to $n-1$. However, MATLAB, Octave, and Julia prefer -to print their matrices and vectors as one-based. To enable 1-based printing, -use \verb'GrB_set (GrB_GLOBAL, true, GxB_PRINT_1BASED)'. Printing is done as zero-based by -default. - -% \newpage -%=============================================================================== -\subsection{{\sf GxB\_fprint:} Print a GraphBLAS object to a file} %============ -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_fprint // print and check a GraphBLAS object -( - GrB_ object, // object to print and check - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -The \verb'GxB_fprint' function prints the contents of any of the ten GraphBLAS -objects to the file \verb'f'. If \verb'f' is \verb'NULL', the results are -printed to \verb'stdout'. For example, to print the entire contents of a -matrix \verb'A' to the file \verb'f', use -\verb'GxB_fprint (A, GxB_COMPLETE, f)'. - -%=============================================================================== -\subsection{{\sf GxB\_print:} Print a GraphBLAS object to {\sf stdout}} %======= -%=============================================================================== -\label{gxb_print} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_print // print and check a GrB_Vector -( - GrB_ object, // object to print and check - GxB_Print_Level pr // print level -) ; -\end{verbatim} } \end{mdframed} - -\verb'GxB_print' is the same as \verb'GxB_fprint', except that it prints the -contents of the object to \verb'stdout' instead of a file \verb'f'. For -example, to print the entire contents of a matrix \verb'A', use -\verb'GxB_print (A, GxB_COMPLETE)'. - -%=============================================================================== -\subsection{{\sf GxB\_Type\_fprint:} Print a {\sf GrB\_Type}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Type_fprint // print and check a GrB_Type -( - GrB_Type type, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, \verb'GxB_Type_fprint (GrB_BOOL, "boolean type", GxB_COMPLETE, f)' -prints the contents of the \verb'GrB_BOOL' object to the file \verb'f'. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_UnaryOp\_fprint:} Print a {\sf GrB\_UnaryOp}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp -( - GrB_UnaryOp unaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GxB_UnaryOp_fprint (GrB_LNOT, "not", GxB_COMPLETE, f)' -prints the \verb'GrB_LNOT' unary operator to the file \verb'f'. - - -%=============================================================================== -\subsection{{\sf GxB\_BinaryOp\_fprint:} Print a {\sf GrB\_BinaryOp}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp -( - GrB_BinaryOp binaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GxB_BinaryOp_fprint (GrB_PLUS_FP64, "plus", GxB_COMPLETE, f)' prints the -\verb'GrB_PLUS_FP64' binary operator to the file \verb'f'. - - -%=============================================================================== -\subsection{{\sf GxB\_IndexUnaryOp\_fprint:} Print a {\sf GrB\_IndexUnaryOp}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp -( - GrB_IndexUnaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GrB_IndexUnaryOp_fprint (GrB_TRIL, "tril", GxB_COMPLETE, f)' prints -the \verb'GrB_TRIL' index-unary operator to the file \verb'f'. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_IndexBinaryOp\_fprint:} Print a {\sf GxB\_IndexBinaryOp}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp -( - GxB_IndexBinaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -%=============================================================================== -\subsection{{\sf GxB\_Monoid\_fprint:} Print a {\sf GrB\_Monoid}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid -( - GrB_Monoid monoid, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GxB_Monoid_fprint (GxB_PLUS_FP64_MONOID, "plus monoid",' -\verb'GxB_COMPLETE, f)' -prints the predefined \verb'GxB_PLUS_FP64_MONOID' (based on the binary -operator \verb'GrB_PLUS_FP64') to the file \verb'f'. - -%=============================================================================== -\subsection{{\sf GxB\_Semiring\_fprint:} Print a {\sf GrB\_Semiring}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring -( - GrB_Semiring semiring, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GxB_Semiring_fprint (GxB_PLUS_TIMES_FP64, "standard",' -\verb'GxB_COMPLETE, f)' -prints the predefined \verb'GxB_PLUS_TIMES_FP64' semiring to the file \verb'f'. - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_Descriptor\_fprint:} Print a {\sf GrB\_Descriptor}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor -( - GrB_Descriptor descriptor, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, -\verb'GxB_Descriptor_fprint (d, "descriptor", GxB_COMPLETE, f)' -prints the descriptor \verb'd' to the file \verb'f'. - -%=============================================================================== -\subsection{{\sf GxB\_Context\_fprint:} Print a {\sf GxB\_Context}} -%=============================================================================== -\label{context_print} - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Context_fprint // print and check a GxB_Context -( - GxB_Context Context, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -This method can be used to print the context created for a user thread, -or the contents of the \verb'GxB_CONTEXT_WORLD' object. - -%=============================================================================== -\subsection{{\sf GxB\_Matrix\_fprint:} Print a {\sf GrB\_Matrix}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix -( - GrB_Matrix A, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, \verb'GxB_Matrix_fprint (A, "my matrix", GxB_SHORT, f)' -prints about 30 entries from the matrix \verb'A' to the file \verb'f'. - - -\newpage -%=============================================================================== -\subsection{{\sf GxB\_Vector\_fprint:} Print a {\sf GrB\_Vector}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Vector_fprint // print and check a GrB_Vector -( - GrB_Vector v, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, \verb'GxB_Vector_fprint (v, "my vector", GxB_SHORT, f)' -prints about 30 entries from the vector \verb'v' to the file \verb'f'. - -%=============================================================================== -\subsection{{\sf GxB\_Scalar\_fprint:} Print a {\sf GrB\_Scalar}} -%=============================================================================== - -\begin{mdframed}[userdefinedwidth=6in] -{\footnotesize -\begin{verbatim} -GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar -( - GrB_Scalar s, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; -\end{verbatim} } \end{mdframed} - -For example, \verb'GxB_Scalar_fprint (s, "my scalar", GxB_SHORT, f)' -prints a short description of the scalar \verb's' to the file \verb'f'. - -%=============================================================================== -\subsection{Performance and portability considerations} -%=============================================================================== - -Even when the print level is \verb'GxB_SILENT', these methods extensively check -the contents of the objects passed to them, which can take some time. They -should be considered debugging tools only, not for final use in production. - -The return value of the \verb'GxB_*print' methods can be relied upon, but the -output to the file (or \verb'stdout') can change from version to version. If -these methods are eventually added to the GraphBLAS C API Specification, a -conforming implementation might never print anything at all, regardless of the -\verb'pr' value. This may be essential if the GraphBLAS library is installed -in a dedicated device, with no file output, for example. - -Some implementations may wish to print nothing at all if the matrix is not yet -completed, or just an indication that the matrix has pending operations and -cannot be printed, when non-blocking mode is employed. In this case, use -\verb'GrB_Matrix_wait', \verb'GrB_Vector_wait', or \verb'GxB_Scalar_wait' to -finish all pending computations first. If a matrix or vector has pending -operations, SuiteSparse:GraphBLAS prints a list of the {\em pending tuples}, -which are the entries not yet inserted into the primary data structure. It can -also print out entries that remain in the data structure but are awaiting -deletion; these are called {\em zombies} in the output report. - -Most of the rest of the report is self-explanatory. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Matrix and Vector iterators} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{iter} - -The \verb'GxB_Iterator' is an object that allows user applications to iterate -over the entries of a matrix or vector, one entry at a time. Iteration can -be done in a linear manner (analogous to reading a file one entry at a time, -from start to finish), or in a random-access pattern (analogous to -the \verb'fseek' method for repositioning the access to file to a different -position). - -Multiple iterators can be used on a single matrix or vector, even in parallel -by multiple user threads. While a matrix or vector is being used with an -iterator, the matrix or vector must not be modified. Doing so will lead to -undefined results. - -Since accessing a matrix or vector via an iterator requires many calls to -the iterator methods, they must be very fast. Error checking is skipped, -except for the methods that create, attach, or free an iterator. Methods -that advance an iterator or that access values or indices from a matrix or -vector do not return error conditions. Instead, they have well-defined -preconditions that must be met (and which should be checked by the user -application). If those preconditions are not met, results are undefined. - -The iterator methods are implemented in SuiteSparse:GraphBLAS as both macros -(via \verb'#define') and as functions of the same name that appear in the -compiled \verb'libgraphblas.so' library. This requires that the opaque -contents of the iterator object be defined in \verb'GraphBLAS.h' itself. The -user application must not access these contents directly, but can only do so -safely via the iterator methods provided by SuiteSparse:GraphBLAS. - -The iterator object can be used in one of four sets of methods, -for four different access patterns: - - \begin{enumerate} - \item {\em row iterator}: iterates across the rows of a matrix, and then - within each row to access the entries in a given row. Accessing all - the entries of a matrix using a row iterator requires an outer loop - (for the rows) and an inner loop (for the entries in each row). - A matrix can be accessed via a row iterator only if its format - (determined by \verb'GrB_get (A, &fmt,' \verb'GrB_STORAGE_ORIENTATION_HINT)') is by-row - (that is, \verb'GrB_ROWMAJOR'). - See Section~\ref{options}. - \item {\em column iterator}: iterates across the columns of a matrix, and - then within each column to access the entries in a given column. - Accessing all the entries of a matrix using a column iterator requires - an outer loop (for the columns) and an inner loop (for the entries in - each column). A matrix can be accessed via a column iterator only if - its format (determined by \verb'GrB_get (A, &fmt, GrB_STORAGE_ORIENTATION_HINT)') is - by-column (that is, \verb'GrB_COLMAJOR'). - See Section~\ref{options}. - \item {\em entry iterator}: iterates across the entries of a matrix. - Accessing all the entries of a matrix using an entry iterator requires - just a single loop. Any matrix can be accessed with an entry iterator. - \item {\em vector iterator}: iterates across the entries of a vector. - Accessing all the entries of a vector using a vector iterator requires - just a single loop. Any vector can be accessed with a vector iterator. - \end{enumerate} - -%=============================================================================== -\subsection{Creating and destroying an iterator} -%=============================================================================== - -The process for using an iterator starts with the creation of an iterator, with -\verb'GxB_Iterator_new'. This method creates an \verb'iterator' object but -does not {\em attach} it to any specific matrix or vector: - - {\footnotesize - \begin{verbatim} - GxB_Iterator iterator ; - GxB_Iterator_new (&iterator) ; \end{verbatim}} - -When finished, the \verb'iterator' is freed with either of these methods: - - {\footnotesize - \begin{verbatim} - GrB_free (&iterator) ; - GxB_Iterator_free (&iterator) ; \end{verbatim}} - -%=============================================================================== -\subsection{Attaching an iterator to a matrix or vector} -%=============================================================================== - -This new \verb'iterator' object can be {\em attached} to any matrix or vector, -and used as a row, column, or entry iterator for any matrix, or as an iterator -for any vector. The \verb'iterator' can be used in any of these methods before -it is freed, but with just one access method at a time. - -Once it is created, the \verb'iterator' must be attached to a matrix or -vector. This process also selects the method by which the \verb'iterator' -will be used for a matrix. Each of the four \verb'GxB_*Iterator_attach' -methods returns a \verb'GrB_Info' result. - - \begin{enumerate} - \item {\em row iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_rowIterator_attach (iterator, A, desc) ; \end{verbatim}} - \item {\em column iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_colIterator_attach (iterator, A, desc) ; \end{verbatim}} - \item {\em entry iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, desc) ; \end{verbatim}} - \item {\em vector iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, desc) ; \end{verbatim}} - \end{enumerate} - -On input to \verb'GxB_*Iterator_attach', the \verb'iterator' must already -exist, having been created by \verb'GxB_Iterator_new'. If the \verb'iterator' -is already attached to a matrix or vector, it is detached and then attached to -the given matrix \verb'A' or vector \verb'v'. - -The return values for row/column methods are: - - \begin{itemize} - \item - \verb'GrB_SUCCESS': if the \verb'iterator' is successfully - attached to the matrix \verb'A'. - \item - \verb'GrB_NULL_POINTER': if the \verb'iterator' or \verb'A' are NULL. - \item - \verb'GrB_INVALID_OBJECT': if the matrix \verb'A' is invalid. - \item - \verb'GrB_NOT_IMPLEMENTED': if the matrix \verb'A' cannot be iterated - in the requested access method (row iterators require the matrix to - be held by-row, and column iterators require the matrix to be held - by-column). - \item - \verb'GrB_OUT_OF_MEMORY': if the method runs out of memory. - \end{itemize} - -The other two methods (entry iterator for matrices, or the vector iterator) -return the same error codes, except that they -do not return \verb'GrB_NOT_IMPLEMENTED'. - -%=============================================================================== -\subsection{Seeking to an arbitrary position} -%=============================================================================== - -Attaching the \verb'iterator' to a matrix or vector does not define a specific -position for the \verb'iterator'. To use the \verb'iterator', a single call to -the corresponding {\em seek} method is required. These -\verb'GxB*_Iterator_*seek*' methods may also be used later on to change the -position of the iterator arbitrarily. - - \begin{enumerate} - \item {\em row iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_rowIterator_seekRow (iterator, row) ; - GrB_Index kount = GxB_rowIterator_kount (iterator) ; - GrB_Info info = GxB_rowIterator_kseek (iterator, k) ; \end{verbatim}} - - These methods move a row iterator to a specific row, defined in one of - two ways: (1) the row index itself (in range 0 to \verb'nrows'-1), or - (2) by specifying \verb'k', which moves the iterator to the \verb'k'th - {\em explicit} row (in the range 0 to \verb'kount'-1). For sparse, - bitmap, or full matrices, these two methods are identical. For - hypersparse matrices, not all rows are present in the data structure; - these {\em implicit} rows are skipped and not included in the - \verb'kount'. Implicit rows contain no entries. The - \verb'GxB_rowIterator_kount' method returns the \verb'kount' of the - matrix, where \verb'kount' is equal to \verb'nrows' for sparse, bitmap, - and matrices, and \verb'kount' $\le$ \verb'nrows' for hypersparse - matrices. All three methods listed above can be used for any row - iterator. - - The \verb'GxB_rowIterator_*seek*' methods return \verb'GrB_SUCCESS' if - the iterator has been moved to a row that contains at least one entry, - \verb'GrB_NO_VALUE' if the row has no entries, or \verb'GxB_EXHAUSTED' - if the row is out of bounds (\verb'row' $\ge$ \verb'nrows' or - if \verb'k' $\ge$ \verb'kount'). - None of these return conditions are - errors; they are all informational. - - For sparse, bitmap, and full matrices, \verb'GxB_rowIterator_seekRow' - always moves to the given row. For hypersparse matrices, if the - requested row is implicit, the iterator is moved to the first - explicit row following it. If no such row exists, the iterator - is exhausted and \verb'GxB_EXHAUSTED' is returned. - The \verb'GxB_rowIterator_kseek' method always moves to the \verb'k'th - explicit row, for any matrix. - Use \verb'GxB_rowIterator_getRowIndex', described below, to determine - the row index of the current position. - - Precondition: on input, the \verb'iterator' must have been successfully - attached to a matrix via a prior call to \verb'GxB_rowIterator_attach'. - Results are undefined if this precondition is not met. - - \item {\em column iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_colIterator_seekCol (iterator, col) ; - GrB_Index kount = GxB_colIterator_kount (iterator) ; - GrB_Info info = GxB_colIterator_kseek (iterator, k) ; \end{verbatim}} - - These methods move a column iterator to a specific column, defined in - one of two ways: (1) the column index itself (in range 0 to - \verb'ncols'-1), or (2) by specifying \verb'k', which moves the - iterator to the \verb'k'th {\em explicit} column (in the range 0 to - \verb'kount'-1). For sparse, bitmap, or full matrices, these two - methods are identical. For hypersparse matrices, not all columns are - present in the data structure; these {\em implicit} columns are skipped - and not included in the \verb'kount'. Implicit columns contain no - entries. The \verb'GxB_colIterator_kount' method returns the - \verb'kount' of the matrix, where \verb'kount' is equal to \verb'ncols' - for sparse, bitmap, and matrices, and \verb'kount' $\le$ \verb'ncols' - for hypersparse matrices. All three methods listed above can be used - for any column iterator. - - The \verb'GxB_colIterator_*seek*' methods return \verb'GrB_SUCCESS' if - the iterator has been moved to a column that contains at least one - entry, \verb'GrB_NO_VALUE' if the column has no entries, or - \verb'GxB_EXHAUSTED' if the column is out of bounds (\verb'col' $\ge$ - \verb'ncols' or \verb'k' $\ge$ \verb'kount'). - None of these return conditions are - errors; they are all informational. - - For sparse, bitmap, and full matrices, \verb'GxB_colIterator_seekCol' - always moves to the given column. For hypersparse matrices, if the - requested column is implicit, the iterator is moved to the first - explicit column following it. If no such column exists, the iterator - is exhausted and \verb'GxB_EXHAUSTED' is returned. - The \verb'GxB_colIterator_kseek' method always moves to the \verb'k'th - explicit column, for any matrix. - Use \newline - \verb'GxB_colIterator_getColIndex', described below, to determine - the column index of the current position. - - Precondition: on input, the \verb'iterator' must have been successfully - attached to a matrix via a prior call to \verb'GxB_colIterator_attach'. - Results are undefined if this precondition is not met. - - \item {\em entry iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Matrix_Iterator_seek (iterator, p) ; - GrB_Index pmax = GxB_Matrix_Iterator_getpmax (iterator) ; - GrB_Index p = GxB_Matrix_Iterator_getp (iterator); \end{verbatim}} - - The \verb'GxB_Matrix_Iterator_seek' method moves the \verb'iterator' to - the given position \verb'p', which is in the range 0 to \verb'pmax'-1, - where the value of \verb'pmax' is obtained from - \verb'GxB_Matrix_Iterator_getpmax'. - For sparse, hypersparse, and full matrices, \verb'pmax' is the same as - \verb'nvals' returned by \verb'GrB_Matrix_nvals'. For bitmap matrices, - \verb'pmax' is equal to \verb'nrows*ncols'. If \verb'p' $\ge$ - \verb'pmax', the iterator is exhausted and \verb'GxB_EXHAUSTED' is - returned. Otherwise, \verb'GrB_SUCCESS' is returned. - - All entries in the matrix are given an ordinal position, \verb'p'. - Seeking to position \verb'p' will either move the \verb'iterator' to - that particular position, or to the next higher position containing an - entry if there is entry at position \verb'p'. The latter case only - occurs for bitmap matrices. - Use \verb'GxB_Matrix_Iterator_getp' to determine the current - position of the iterator. - - Precondition: on input, the \verb'iterator' must have been successfully - attached to a matrix via a prior call to - \verb'GxB_Matrix_Iterator_attach'. Results are undefined if this - precondition is not met. - - \item {\em vector iterator}: - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Vector_Iterator_seek (iterator, p) ; - GrB_Index pmax = GxB_Vector_Iterator_getpmax (iterator) ; - GrB_Index p = GxB_Vector_Iterator_getp (iterator); \end{verbatim}} - - The \verb'GxB_Vector_Iterator_seek' method is identical to the - entry iterator of a matrix, but applied to a \verb'GrB_Vector' instead. - - Precondition: on input, the \verb'iterator' must have been successfully - attached to a vector via a prior call to - \verb'GxB_Vector_Iterator_attach'. Results are undefined if this - precondition is not met. - - \end{enumerate} - -%=============================================================================== -\subsection{Advancing to the next position} -%=============================================================================== - -For best performance, the {\em seek} methods described above should be used -with care, since some of them require $O(\log n)$ time. The fastest method -for changing the position of the iterator is the corresponding {\em next} -method, described below for each iterator: - - \begin{enumerate} - \item {\em row iterator}: To move to the next row. - - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_rowIterator_nextRow (iterator) ; \end{verbatim}} - - The row iterator is a 2-dimensional iterator, requiring an outer loop and - an inner loop. The outer loop iterates over the rows of the matrix, using - \verb'GxB_rowIterator_nextRow' to move to the next row. If the matrix is - hypersparse, the next row is always an explicit row; implicit rows are - skipped. The return conditions are identical to - \verb'GxB_rowIterator_seekRow'. - - Preconditions: on input, the row iterator must already be attached to a - matrix via a prior call to \verb'GxB_rowIterator_attach', and the - \verb'iterator' must be at a specific row, via a prior call to - \verb'GxB_rowIterator_*seek*' or \verb'GxB_rowIterator_nextRow'. - Results are undefined if these conditions are not met. - - \item {\em row iterator}: To move to the next entry within a row. - - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_rowIterator_nextCol (iterator) ; \end{verbatim}} - - The row iterator is moved to the next entry in the current row. - The method returns \verb'GrB_NO_VALUE' if the end of the row is reached. - The iterator does not move to the next row in this case. - The method returns \verb'GrB_SUCCESS' if the iterator has been moved - to a specific entry in the current row. - - Preconditions: the same as \verb'GxB_rowIterator_nextRow'. - - \item {\em column iterator}: To move to the next column - - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_colIterator_nextCol (iterator) ; \end{verbatim}} - - The column iterator is a 2-dimensional iterator, requiring an outer loop - and an inner loop. The outer loop iterates over the columns of the matrix, - using \verb'GxB_colIterator_nextCol' to move to the next column. If the - matrix is hypersparse, the next column is always an explicit column; - implicit columns are skipped. The return conditions are identical to - \verb'GxB_colIterator_seekCol'. - - Preconditions: on input, the column iterator must already be attached to a - matrix via a prior call to \verb'GxB_colIterator_attach', and the - \verb'iterator' must be at a specific column, via a prior call to - \verb'GxB_colIterator_*seek*' or \verb'GxB_colIterator_nextCol'. - Results are undefined if these conditions are not met. - - {\footnotesize - \item {\em column iterator}: To move to the next entry within a column. - - \begin{verbatim} - GrB_Info info = GxB_colIterator_nextRow (iterator) ; \end{verbatim}} - - The column iterator is moved to the next entry in the current column. - The method returns \verb'GrB_NO_VALUE' if the end of the column is reached. - The iterator does not move to the next column in this case. - The method returns \verb'GrB_SUCCESS' if the iterator has been moved - to a specific entry in the current column. - - Preconditions: the same as \verb'GxB_colIterator_nextCol'. - - \item {\em entry iterator}: To move to the next entry. - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Matrix_Iterator_next (iterator) ; \end{verbatim}} - - This method moves an iterator to the next entry of a matrix. - It returns \verb'GrB_SUCCESS' if the iterator is at an entry that - exists in the matrix, or \verb'GrB_EXHAUSTED' otherwise. - - Preconditions: on input, the entry iterator must be already attached to a - matrix via \verb'GxB_Matrix_Iterator_attach', and the position of the - iterator must also have been defined by a prior call to - \verb'GxB_Matrix_Iterator_seek' or \verb'GxB_Matrix_Iterator_next'. - Results are undefined if these conditions are not met. - - \item {\em vector iterator}: To move to the next entry. - {\footnotesize - \begin{verbatim} - GrB_Info info = GxB_Vector_Iterator_next (iterator) ; \end{verbatim}} - - This method moves an iterator to the next entry of a vector. - It returns \verb'GrB_SUCCESS' if the iterator is at an entry that - exists in the vector, or \verb'GrB_EXHAUSTED' otherwise. - - Preconditions: on input, the iterator must be already attached to a - vector via \verb'GxB_Vector_Iterator_attach', and the position of the - iterator must also have been defined by a prior call to - \verb'GxB_Vector_Iterator_seek' or \verb'GxB_Vector_Iterator_next'. - Results are undefined if these conditions are not met. - - \end{enumerate} - -%=============================================================================== -\subsection{Accessing the indices of the current entry} -%=============================================================================== - -Once the iterator is attached to a matrix or vector, and is placed in position -at an entry in the matrix or vector, the indices and value of this entry can be -obtained. The methods for accessing the value of the entry are described in -Section~\ref{getvalu}. Accessing the indices is performed with four different -sets of methods, depending on which access pattern is in use, described below: - - \begin{enumerate} - \item {\em row iterator}: To get the current row index. - {\footnotesize - \begin{verbatim} - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; \end{verbatim}} - - The method returns \verb'nrows(A)' if the iterator is exhausted, or the - current row index \verb'i' otherwise. There need not be any entry in the - current row. Zero is returned if the iterator is attached to the matrix - but \verb'GxB_rowIterator_*seek*' has not been called, but this does not - mean the iterator is positioned at row zero. - - Preconditions: on input, the iterator must be already successfully attached - to matrix as a row iterator via \verb'GxB_rowIterator_attach'. - Results are undefined if this condition is not met. - - \item {\em row iterator}: To get the current column index. - {\footnotesize - \begin{verbatim} - GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; \end{verbatim}} - - Preconditions: on input, the iterator must be already successfully attached - to matrix as a row iterator via \verb'GxB_rowIterator_attach', and in - addition, the row iterator must be positioned at a valid entry present in - the matrix. That is, the last call to \verb'GxB_rowIterator_*seek*' or - \verb'GxB_rowIterator_*next*', must have returned \verb'GrB_SUCCESS'. - Results are undefined if these conditions are not met. - - \item {\em column iterator}: To get the current column index. - {\footnotesize - \begin{verbatim} - GrB_Index j = GxB_colIterator_getColIndex (iterator) ; \end{verbatim}} - - The method returns \verb'ncols(A)' if the iterator is exhausted, or the - current column index \verb'j' otherwise. There need not be any entry in the - current column. Zero is returned if the iterator is attached to the matrix - but \verb'GxB_colIterator_*seek*' has not been called, but this does not - mean the iterator is positioned at column zero. - - Precondition: on input, the iterator must be already successfully attached - to matrix as a column iterator via \verb'GxB_colIterator_attach'. - Results are undefined if this condition is not met. - - \item {\em column iterator}: To get the current row index. - {\footnotesize - \begin{verbatim} - GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; \end{verbatim}} - - Preconditions: on input, the iterator must be already successfully attached - to matrix as a column iterator via \verb'GxB_colIterator_attach', and in - addition, the column iterator must be positioned at a valid entry present in - the matrix. That is, the last call to \verb'GxB_colIterator_*seek*' or - \verb'GxB_colIterator_*next*', must have returned \verb'GrB_SUCCESS'. - Results are undefined if these conditions are not met. - - \item {\em entry iterator}: To get the current row and column index. - {\footnotesize - \begin{verbatim} - GrB_Index i, j ; - GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; \end{verbatim}} - - Returns the row and column index of the current entry. - - Preconditions: on input, the entry iterator must be already attached to a - matrix via \verb'GxB_Matrix_Iterator_attach', and the position of the - iterator must also have been defined by a prior call to - \verb'GxB_Matrix_Iterator_seek' or \verb'GxB_Matrix_Iterator_next', with a - return value of \verb'GrB_SUCCESS'. - Results are undefined if these conditions are not met. - - \item {\em vector iterator}: To get the current index. - {\footnotesize - \begin{verbatim} - GrB_Index i = GxB_Vector_Iterator_getIndex (iterator) ; \end{verbatim}} - - Returns the index of the current entry. - - Preconditions: on input, the entry iterator must be already attached to a - matrix via \verb'GxB_Vector_Iterator_attach', and the position of the - iterator must also have been defined by a prior call to - \verb'GxB_Vector_Iterator_seek' or \verb'GxB_Vector_Iterator_next', with a - return value of \verb'GrB_SUCCESS'. - Results are undefined if these conditions are not met. - - \end{enumerate} - -%=============================================================================== -\subsection{Accessing the value of the current entry} -\label{getvalu} -%=============================================================================== - -So far, all methods that create or use an iterator have been split into four -sets of methods, for the row, column, or entry iterators attached to a matrix, -or for a vector iterator. Accessing the value is different. All four -iterators use the same set of methods to access the value of their current -entry. These methods return the value of the current entry at the position -determined by the iterator. The return value can of course be typecasted -using standard C syntax once the value is returned to the caller. - -Preconditions: on input, the prior call to \verb'GxB_*Iterator_*seek*', or -\verb'GxB_*Iterator_*next*' must have returned \verb'GrB_SUCCESS', indicating -that the iterator is at a valid current entry for either a matrix or vector. -No typecasting is permitted, in the sense that the method name must match the -type of the matrix or vector. -Results are undefined if these conditions are not met. - - {\footnotesize - \begin{verbatim} - // for built-in types: - bool value = GxB_Iterator_get_BOOL (iterator) ; - int8_t value = GxB_Iterator_get_INT8 (iterator) ; - int16_t value = GxB_Iterator_get_INT16 (iterator) ; - int32_t value = GxB_Iterator_get_INT32 (iterator) ; - int64_t value = GxB_Iterator_get_INT64 (iterator) ; - uint8_t value = GxB_Iterator_get_UINT8 (iterator) ; - uint16_t value = GxB_Iterator_get_UINT16 (iterator) ; - uint32_t value = GxB_Iterator_get_UINT32 (iterator) ; - uint64_t value = GxB_Iterator_get_UINT64 (iterator) ; - float value = GxB_Iterator_get_FP32 (iterator) ; - double value = GxB_Iterator_get_FP64 (iterator) ; - GxB_FC32_t value = GxB_Iterator_get_FC32 (iterator) ; - GxB_FC64_t value = GxB_Iterator_get_FC64 (iterator) ; - - // for user-defined types: - value ; - GxB_Iterator_get_UDT (iterator, (void *) &value) ; \end{verbatim}} - -%=============================================================================== -\newpage -\subsection{Example: row iterator for a matrix} -%=============================================================================== - -The following example uses a row iterator to access all of the entries -in a matrix \verb'A' of type \verb'GrB_FP64'. Note the inner and outer loops. -The outer loop iterates over all rows of the matrix. The inner loop iterates -over all entries in the row \verb'i'. This access pattern requires the matrix -to be held by-row, but otherwise it works for any matrix. If the matrix is -held by-column, then use the column iterator methods instead. - - {\footnotesize - \begin{verbatim} - // create an iterator - GxB_Iterator iterator ; - GxB_Iterator_new (&iterator) ; - // attach it to the matrix A, known to be type GrB_FP64 - GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } - // seek to A(0,:) - info = GxB_rowIterator_seekRow (iterator, 0) ; - while (info != GxB_EXHAUSTED) - { - // iterate over entries in A(i,:) - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; - while (info == GrB_SUCCESS) - { - // get the entry A(i,j) - GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; - double aij = GxB_Iterator_get_FP64 (iterator) ; - // move to the next entry in A(i,:) - info = GxB_rowIterator_nextCol (iterator) ; - } - // move to the next row, A(i+1,:), or a subsequent one if i+1 is implicit - info = GxB_rowIterator_nextRow (iterator) ; - } - GrB_free (&iterator) ; \end{verbatim}} - -%=============================================================================== -\newpage -\subsection{Example: column iterator for a matrix} -%=============================================================================== - -The column iterator is analgous to the row iterator. - -The following example uses a column iterator to access all of the entries in a -matrix \verb'A' of type \verb'GrB_FP64'. The outer loop iterates over all -columns of the matrix. The inner loop iterates over all entries in the column -\verb'j'. This access pattern requires the matrix to be held by-column, but -otherwise it works for any matrix. If the matrix is held by-row, then use -the row iterator methods instead. - - {\footnotesize - \begin{verbatim} - // create an iterator - GxB_Iterator iterator ; - GxB_Iterator_new (&iterator) ; - // attach it to the matrix A, known to be type GrB_FP64 - GrB_Info info = GxB_colIterator_attach (iterator, A, NULL) ; - // seek to A(:,0) - info = GxB_colIterator_seekCol (iterator, 0) ; - while (info != GxB_EXHAUSTED) - { - // iterate over entries in A(:,j) - GrB_Index j = GxB_colIterator_getColIndex (iterator) ; - while (info == GrB_SUCCESS) - { - // get the entry A(i,j) - GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; - double aij = GxB_Iterator_get_FP64 (iterator) ; - // move to the next entry in A(:,j) - info = GxB_colIterator_nextRow (iterator) ; - } - // move to the next column, A(:,j+1), or a subsequent one if j+1 is implicit - info = GxB_colIterator_nextCol (iterator) ; - } - GrB_free (&iterator) ; \end{verbatim}} - -%=============================================================================== -\newpage -\subsection{Example: entry iterator for a matrix} -%=============================================================================== - -The entry iterator allows for a simpler access pattern, with a single loop, but -using a row or column iterator is faster. The method works for any matrix. - - {\footnotesize - \begin{verbatim} - // create an iterator - GxB_Iterator iterator ; - GxB_Iterator_new (&iterator) ; - // attach it to the matrix A, known to be type GrB_FP64 - GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } - // seek to the first entry - info = GxB_Matrix_Iterator_seek (iterator, 0) ; - while (info != GxB_EXHAUSTED) - { - // get the entry A(i,j) - GrB_Index i, j ; - GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; - double aij = GxB_Iterator_get_FP64 (iterator) ; - // move to the next entry in A - info = GxB_Matrix_Iterator_next (iterator) ; - } - GrB_free (&iterator) ; \end{verbatim}} - -%=============================================================================== -\subsection{Example: vector iterator} -%=============================================================================== - -A vector iterator is used much like an entry iterator for a matrix. - - {\footnotesize - \begin{verbatim} - // create an iterator - GxB_Iterator iterator ; - GxB_Iterator_new (&iterator) ; - // attach it to the vector v, known to be type GrB_FP64 - GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, NULL) ; - if (info < 0) { handle the failure ... } - // seek to the first entry - info = GxB_Vector_Iterator_seek (iterator, 0) ; - while (info != GxB_EXHAUSTED) - { - // get the entry v(i) - GrB_Index i = GxB_Vector_Iterator_getIndex (iterator) ; - double vi = GxB_Iterator_get_FP64 (iterator) ; - // move to the next entry in v - info = GxB_Vector_Iterator_next (iterator) ; - } - GrB_free (&iterator) ; \end{verbatim}} - -%=============================================================================== -\newpage -\subsection{Performance} -%=============================================================================== - -I have benchmarked the performance of the row and column iterators to compute -\verb'y=0' and then \verb'y+=A*x' where \verb'y' is a dense vector and \verb'A' -is a sparse matrix, using a single thread. The row and column iterators are -very fast, sometimes only 1\% slower than calling \verb'GrB_mxv' to compute the -same thing (also assuming a single thread), for large problems. For sparse -matrices that average just 1 or 2 entries per row, the row iterator can be -about 30\% slower than \verb'GrB_mxv', likely because of the slightly higher -complexity of moving from one row to the next using these methods. - -It is possible to split up the problem for multiple user threads, each with its -own iterator. Given the low overhead of the row and column iterator for a -single thread, this should be very fast. Care must be taken to ensure a good -load balance. Simply spliting up the rows of a matrix and giving the same -number of rows to each user thread can result in imbalanced work. This is -handled internally in \verb'GrB_*' methods, but enabling parallelism when using -iterators is the responsibility of the user application. - -The entry iterators are easier to use but harder to implement. The methods -must internally fuse both inner and outer loops so that the user application can -use a single loop. As a result, the computation \verb'y+=A*x' can be up to -4x slower (about 2x typical) than when using \verb'GrB_mxv' with a single -thread. - -To obtain the best performace possible, many of the iterator methods are -implemented as macros in \verb'GraphBLAS.h'. Using macros is the default, -giving typical C and C++ applications access to the fastest methods possible. - -To ensure access to these methods when not using the macros, these methods are -also defined as regular functions that appear in the compiled -\verb'libgraphblas.so' library with the same name as the macros. Applications -that cannot use the macro versions can \verb'#undef' the macros after the -\verb'#include ' statement, and then they would access the regular -compiled functions in \verb'libgraphblas.so'. This non-macro approach is not -the default, and the iterator methods may be slightly slower. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Iso-Valued Matrices and Vectors } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{iso} - -The GraphBLAS C API states that the entries in all \verb'GrB_Matrix' and -\verb'GrB_Vector' objects have a numerical value, with either a built-in or -user-defined type. Representing an unweighted graph requires a value to be -placed on each edge, typically $a_{ij}=1$. Adding a structure-only data type -would not mix well with the rest of GraphBLAS, where all operators, monoids, -and semirings need to operate on a value, of some data type. And yet -unweighted graphs are very important in graph algorithms. - -The solution is simple, and exploiting it in SuiteSparse:GraphBLAS requires -nearly no extensions to the GraphBLAS C API. SuiteSparse:GraphBLAS can often -detect when the user application is creating a matrix or vector where all -entries in the sparsity pattern take on the same numerical value. - -For example, ${\bf C \langle C \rangle} = 1$, when the mask is structural, sets -all entries in $\bf C$ to the value 1. SuiteSparse:GraphBLAS detects this, and -performs this assignment in $O(1)$ time. It stores a single copy of this -``iso-value'' and sets an internal flag in the opaque data structure for $\bf -C$, which states that all entries in the pattern of $\bf C$ are equal to 1. -This saves both time and memory and allows for the efficient representation of -sparse adjacency matrices of unweighted graphs, yet does not change the C API. -To the user application, it still appears that $\bf C$ has \verb'nvals(C)' -entries, all equal to 1. - -Creating and operating on iso-valued matrices (or just {\em iso matrices} for -short) is significantly faster than creating matrices with different data -values. A matrix that is iso requires only $O(1)$ space for its numerical -values. The sparse and hypersparse formats require an additional $O(n+e)$ or -$O(e)$ integer space to hold the pattern of an $n$-by-$n$ matrix \verb'C', -respectively, and a matrix \verb'C' in bitmap format requires $O(n^2)$ space -for the bitmap. A full matrix requires no integer storage, so a matrix that is -both iso and full requires only $O(1)$ space, regardless of its dimension. - -The sections below a describe the methods that can be used to create iso -matrices and vectors. Let $a$, $b$, and $c$ denote the iso values of \verb'A', -\verb'B', and \verb'C', respectively. - -%------------------------------------------------------------------------------- -\subsection{Using iso matrices and vectors in a graph algorithm} -%------------------------------------------------------------------------------- -\label{iso_usage} - -There are two primary useful ways to use iso-valued matrices and vectors: (1) -as iso sparse/hypersparse adjacency matrices for unweighted graphs, and (2) as -iso full matrices or vectors used with operations that do not need to access -all of the content of the iso full matrix or vector. - -In the first use case, simply create a \verb'GrB_Matrix' with values that are -all the same (those in the sparsity pattern). The -\verb'GxB_Matrix_build_Scalar' method can be used for this, since it -guarantees that the time and work spent on the numerical part of the array -is only $O(1)$. The method still must spend $O(e)$ or $O(e \log e)$ time -on the integer arrays that represent the sparsity pattern, but the reduction -in time and work on the numerical part of the matrix will improve performance. - -The use of \verb'GxB_Matrix_build_Scalar' is optional. Matrices can also be -constructed with \verb'GrB*' methods. In particular, \verb'GrB_Matrix_build_*' -can be used. It first builds a non-iso matrix and then checks if all of the -values are the same, after assembling any duplicate entries. This does not -save time or memory for the construction of the matrix itself, but it will -lead to savings in time and memory later on, when the matrix is used. - -To ensure a matrix \verb'C' is iso-valued, simply use \verb'GrB_assign' to -compute \verb'C=1', or assign whatever value of scalar you wish. -It is essential to use a structural mask. Otherwise, it is not clear that -all entries in \verb'C' will be assigned the same value. The following -code takes $O(1)$ time, and it resets the size of the numerical part of the -\verb'C' matrix to be $O(1)$ in size: - -{\footnotesize -\begin{verbatim} - bool scalar = true ; - GrB_Matrix_assign (C, C, NULL, scalar, GrB_ALL, nrows, GrB_ALL, ncols, - GrB_DESC_S) ; \end{verbatim}} - -The MATLAB/Octave analog of the code above is \verb'C=spones(C)'. - -The second case for where iso matrices and vectors are useful is to use them -with operations that do not necessarily access all of their content. -Suppose you have a matrix \verb'A' of arbitrarily large dimension (say -\verb'n'-by-\verb'n' where \verb'n=2^60', of type \verb'GrB_FP64'). A matrix -this large can be represented by SuiteSparse:GraphBLAS, but only in a -hypersparse form. - -Now, suppose you wish to compute the maximum value in each row, reducing the -matrix to a vector. This can be done with \verb'GrB_reduce': - -{\footnotesize -\begin{verbatim} - GrB_Vector_new (&v, GrB_FP64, n) ; - GrB_reduce (v, NULL, GrB_MAX_MONOID_FP64, A, NULL) ; \end{verbatim}} - -It can also be done with \verb'GrB_mxv', by creating an iso full vector -\verb'x'. The creation of \verb'x' takes $O(1)$ time and memory, -and the \verb'GrB_mxv' computation takes $O(e)$ time (with modest assumptions; -if \verb'A' needs to be transposed the time would be $O(e \log e)$). - -{\footnotesize -\begin{verbatim} - GrB_Vector_new (&v, GrB_FP64, n) ; - GrB_Vector_new (&x, GrB_FP64, n) ; - GrB_assign (x, NULL, NULL, 1, GrB_ALL, n, NULL) ; - GrB_mxv (v, NULL, NULL, GrB_MAX_FIRST_SEMIRING_FP64, A, x, NULL) ; \end{verbatim}} - -The above computations are identical in SuiteSparse:GraphBLAS. Internally, -\verb'GrB_reduce' creates \verb'x' and calls \verb'GrB_mxv'. Using -\verb'GrB_mxm' directly gives the user application additional flexibility in -creating new computations that exploit the multiplicative operator in the -semiring. \verb'GrB_reduce' always uses the \verb'FIRST' operator in its -semiring, but any other binary operator can be used instead when using -\verb'GrB_mxv'. - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from matrix multiplication} -%------------------------------------------------------------------------------- -\label{iso_mxm} - -Consider \verb'GrB_mxm', \verb'GrB_mxv', and \verb'GrB_vxm', and - let \verb'C=A*B', where no mask is present, or \verb'C=A*B' where - \verb'C' is initially empty. If \verb'C' is not initially empty, - then these rules apply to a temporary matrix \verb'T=A*B', which is - initially empty and is then assigned to \verb'C' via \verb'C=T'. - - The iso property of \verb'C' is determined with the following rules, - where the first rule that fits defines the property and value of \verb'C'. - - \begin{itemize} - \item If the semiring includes a index-based multiplicative operator - (\verb'GxB_FIRSTI', \verb'GrB_SECONDI', and related operators), then - \verb'C' is never iso. - - \item Define an {\em iso-monoid} as a built-in monoid with the property - that reducing a set of $n>1$ identical values $x$ returns the same value - $x$. These are the \verb'MIN' \verb'MAX' \verb'LOR' \verb'LAND' \verb'BOR' - \verb'BAND' and \verb'ANY' monoids. All other monoids are not iso monoids: - \verb'PLUS', \verb'TIMES', \verb'LXNOR', \verb'EQ', \verb'BXOR', - \verb'BXNOR', and all user-defined monoids. Currently, there is no - mechanism for telling SuiteSparse:GraphBLAS that a user-defined monoid - is an iso-monoid. - - \item If the multiplicative op is \verb'PAIR' (same as \verb'ONEB'), - and the monoid is an - iso-monoid, or the \verb'EQ' or \verb'TIMES' monoids, then \verb'C' is - iso with a value of 1. - - \item If both \verb'B' and the monoid are iso, and the multiplicative op is - \verb'SECOND' or \verb'ANY', then \verb'C' is iso with a value of $b$. - - \item If both \verb'A' and the monoid are iso, and the multiplicative op is - \verb'FIRST' or \verb'ANY', then \verb'C' is iso with a value of $a$. - - \item If \verb'A', \verb'B', and the monoid are all iso, then \verb'C' - is iso, with a value $c=f(a,b)$, where $f$ is any multiplicative op - (including user-defined, which assumes that a user-defined $f$ has no - side effects). - - \item If \verb'A' and \verb'B' are both iso and full (all entries present, - regardless of the format of the matrices), then \verb'C' is iso and full. - Its iso value is computed in $O(\log(n))$ time, via a reduction of $n$ - copies of the value $t=f(a,b)$ to a scalar. The storage required to - represent \verb'C' is just $O(1)$, regardless of its dimension. - Technically, the \verb'PLUS' monoid could be computed as $c=nt$ in $O(1)$ - time, but the log-time reduction works for any monoid, including - user-defined ones. - - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from eWiseMult and kronecker} -%------------------------------------------------------------------------------- -\label{iso_emult} - -Consider \verb'GrB_eWiseMult'. Let -\verb'C=A.*B', or \verb'C=A.*B' with any mask and where \verb'C' is -initially empty, where \verb'.*' denotes a binary operator $f(x,y)$ -applied with \verb'eWiseMult'. These rules also apply to \verb'GrB_kronecker'. - - \begin{itemize} - \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then - \verb'C' is not iso. - - \item If the op is \verb'PAIR' (same as \verb'ONEB'), - then \verb'C' is iso with $c=1$. - - \item If \verb'B' is iso and the op is \verb'SECOND' or \verb'ANY', - then \verb'C' is iso with $c=b$. - - \item If \verb'A' is iso and the op is \verb'FIRST' or \verb'ANY', - then \verb'C' is iso with $c=a$. - - \item If both \verb'A' and \verb'B' are iso, - then \verb'C' is iso with $c=f(a,b)$. - - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from eWiseAdd} -%------------------------------------------------------------------------------- -\label{iso_add} - -Consider \verb'GrB_eWiseAdd', and also the accumulator phase of \verb'C+=T' -when an accumulator operator is present. Let \verb'C=A+B', or \verb'C=A+B' -with any mask and where \verb'C' is initially empty. - - \begin{itemize} - \item If both \verb'A' and \verb'B' are full (all entries present), then - the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used - instead. - - \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then - \verb'C' is not iso. - - \item If $a$ and $b$ differ (when typecasted to the type of \verb'C'), - then \verb'C' is not iso. - - \item If $c=f(a,b) = a = b$ holds, then \verb'C' is iso, - where $f(a,b)$ is the operator. - - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from eWiseUnion} -%------------------------------------------------------------------------------- -\label{iso_union} - -\verb'GxB_eWiseUnion' is very similar to \verb'GrB_eWiseAdd', but the rules -for when the result is iso-valued are very different. - - \begin{itemize} - \item If both \verb'A' and \verb'B' are full (all entries present), then - the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used - instead. - - \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then - \verb'C' is not iso. - - \item If the op is \verb'PAIR' (same as \verb'ONEB'), - then \verb'C' is iso with $c=1$. - - \item If \verb'B' is iso and the op is \verb'SECOND' or \verb'ANY', - and the input scalar \verb'beta' matches $b$ - (the iso-value of \verb'B'), - then \verb'C' is iso with $c=b$. - - \item If \verb'A' is iso and the op is \verb'FIRST' or \verb'ANY', - and the input scalar \verb'alpha' matches $a$ - (the iso-value of \verb'A'), - then \verb'C' is iso with $c=a$. - - \item If both \verb'A' and \verb'B' are iso, - and $f(a,b) = f(\alpha,b) = f(a,\beta)$, - then \verb'C' is iso with $c=f(a,b)$. - - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Reducing iso matrices to a scalar or vector} -%------------------------------------------------------------------------------- -\label{iso_reduce} - -If \verb'A' is iso with $e$ entries, reducing it to a scalar takes $O(\log(e))$ -time, regardless of the monoid used to reduce the matrix to a scalar. Reducing -\verb'A' to a vector \verb'c' is the same as the matrix-vector multiply -\verb"c=A*x" or \verb"c=A'*x", depending on the descriptor, where \verb'x' -is an iso full vector (refer to Section~\ref{iso_mxm}). - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from apply} -%------------------------------------------------------------------------------- -\label{iso_apply} - -Let \verb'C=f(A)' denote the application of a unary operator \verb'f', -and let \verb'C=f(A,s)' and \verb'C=f(s,A)' denote the application of a binary -operator with \verb's' a scalar. - - \begin{itemize} - \item If the operator is index-based (\verb'GxB_POSITION*', - \verb'GxB_FIRSTI', and related) then \verb'C' is not iso. - - \item If the operator is \verb'ONE' or \verb'PAIR' (same as \verb'ONEB'), - then \verb'C' iso with $c=1$. - - \item If the operator is \verb'FIRST' or \verb'ANY' with \verb'C=f(s,A)', - then \verb'C' iso with $c=s$. - - \item If the operator is \verb'SECOND' or \verb'ANY' with \verb'C=f(A,s)', - then \verb'C' iso with $c=s$. - - \item If \verb'A' is iso then \verb'C' is iso, with the following value - of $c$: - - \begin{itemize} - \item If the op is \verb'IDENTITY', then $c=a$. - \item If the op is unary with \verb'C=f(A)', then $c=f(a)$. - \item If the op is binary with \verb'C=f(s,A)', then $c=f(s,a)$. - \item If the op is binary with \verb'C=f(A,s)', then $c=f(a,s)$. - \end{itemize} - - - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from select} -%------------------------------------------------------------------------------- -\label{iso_select} - -Let \verb'C=select(A)' denote the application of a \verb'GrB_IndexUnaryOp' operator -in \verb'GrB_select'. - - \begin{itemize} - \item If \verb'A' is iso, then \verb'C' is iso with $c=a$. - \item If the operator is any \verb'GrB_VALUE*_BOOL' operator, - with no typecasting, and the test is true only for a single boolean - value, then \verb'C' is iso. - \item If the operator is \verb'GrB_VALUEEQ_*', with no typecasting, - then \verb'C' is iso, with $c=t$ where $t$ is the value of the scalar - \verb'y'. - \item If the operator is \verb'GrB_VALUELE_UINT*', with no typecasting, - and the scalar \verb'y' is zero, then \verb'C' is iso with $c=0$. - \item Otherwise, \verb'C' is not iso. - \end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from assign and subassign} -%------------------------------------------------------------------------------- -\label{iso_assign} - -These rules are somewhat complex. Consider the assignment \verb'C(I,J)=...' -with \verb'GrB_assign'. Internally, this assignment is converted into -\verb'C(I,J)=...' and then \verb'GxB_subassign' is used. Thus, -all of the rules below assume the form \verb'C(I,J)=...' where \verb'M' -has the same size as the submatrix \verb'C(I,J)'. - -\subsubsection{Assignment with no accumulator operator} - -If no accumulator operator is present, the following rules are used. - -\begin{itemize} -\item -For matrix assignment, \verb'A' must be iso. For scalar assignment, the single -scalar is implicitly expanded into an iso matrix \verb'A' of the right size. -If these rules do not hold, \verb'C' is not iso. - -\item -If \verb'A' is not iso, or if \verb'C' is not iso on input, then \verb'C' is -not iso on output. - -\item -If \verb'C' is iso or empty on input, and \verb'A' is iso (or scalar assignment -is begin performed) and the iso values $c$ and $a$ (or the scalar $s$) match, -then the following forms of assignment result in an iso matrix \verb'C' on -output: - - \begin{itemize} - \item \verb'C(I,J) = scalar' - \item \verb'C(I,J) = scalar' - \item \verb'C(I,J) = scalar' - \item \verb'C(I,J) = scalar' - \item \verb'C(I,J) = scalar' - \item \verb'C(I,J) = A' - \item \verb'C(I,J) = A' - \item \verb'C(I,J) = A' - \item \verb'C(I,J) = A' - \item \verb'C(I,J) = A' - \end{itemize} - -\item -For these forms of assignment, \verb'C' is always iso on output, regardless -of its iso property on input: - - \begin{itemize} - \item \verb'C = scalar' - \item \verb'C=scalar'; C empty on input. - \item \verb'C=scalar' - \end{itemize} - -\item -For these forms of assignment, \verb'C' is always iso on output if \verb'A' -is iso: - - \begin{itemize} - \item \verb'C = A' - \item \verb'C = A'; C empty on input. - \end{itemize} -\end{itemize} - - -\subsubsection{Assignment with an accumulator operator} - -If an accumulator operator is present, the following rules are used. -Index-based operators (\verb'GxB_FIRSTI' and related) cannot be used as -accumulator operators, so these rules do not consider that case. - -\begin{itemize} -\item -For matrix assignment, \verb'A' must be iso. For scalar assignment, the single -scalar is implicitly expanded into an iso matrix \verb'A' of the right size. -If these rules do not hold, \verb'C' is not iso. - -\item For these forms of assignment \verb'C' is iso if \verb'C' is -empty on input, or if $c=c+a$ for the where $a$ is the iso value of \verb'A' or -the value of the scalar for scalar assignment. - - \begin{itemize} - \item \verb'C(I,J) += scalar' - \item \verb'C(I,J) += scalar' - \item \verb'C(I,J) += scalar' - \item \verb'C(I,J) += scalar' - \item \verb'C(I,J) += scalar' - \item \verb'C(I,J) += A' - \item \verb'C(I,J) += A' - \item \verb'C(I,J) += A' - \item \verb'C(I,J) += A' - \item \verb'C(I,J) += A ' - \item \verb'C += A' - \end{itemize} -\end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from build methods} -%------------------------------------------------------------------------------- -\label{iso_build} - -\verb'GxB_Matrix_build_Scalar' and \verb'GxB_Vector_build_Scalar' -always construct an iso matrix/vector. - -\verb'GrB_Matrix_build' and \verb'GrB_Vector_build' can also construct iso -matrices and vectors. A non-iso matrix/vector is constructed first, and then -the entries are checked to see if they are all equal. The resulting iso-valued -matrix/vector will be efficient to use and will use less memory than a non-iso -matrix/vector. However, constructing an iso matrix/vector with -\verb'GrB_Matrix_build' and \verb'GrB_Vector_build' will take more time -and memory than constructing the matrix/vector with -\verb'GxB_Matrix_build_Scalar' or \verb'GxB_Vector_build_Scalar'. - -%------------------------------------------------------------------------------- -\subsection{Iso matrices from other methods} -%------------------------------------------------------------------------------- -\label{iso_other} - -\begin{itemize} -\item -For \verb'GrB_Matrix_dup' and \verb'GrB_Vector_dup', the output matrix/vector -has the same iso property as the input matrix/vector. - -\item -\verb'GrB_*_setElement_*' preserves the iso property of the matrix/vector it -modifies, if the input scalar is equal to the iso value of the matrix/vector. -If the matrix or vector has no entries, the first call to \verb'setElement' -makes it iso. This allows a sequence of \verb'setElement' calls with the same -scalar value to create an entire iso matrix or vector, if starting from -an empty matrix or vector. - -\item -\verb'GxB_Matrix_concat' constructs an iso matrix as its result if all input -tiles are either empty or iso. - -\item -\verb'GxB_Matrix_split' constructs its output tiles as iso if its input -matrix is iso. - -\item -\verb'GxB_Matrix_diag' and \verb'GrB_Matrix_diag' construct an iso matrix if -its input vector is iso. - -\item -\verb'GxB_Vector_diag' constructs an iso vector if its input matrix is iso. - -\item -\verb'GrB_*extract' constructs an iso matrix/vector if its input matrix/vector -is iso. - -\item -\verb'GrB_transpose' constructs an iso matrix if its input is iso. - -\item -The \verb'GxB_import/export/pack/unpack' methods preserve the iso property -of their matrices/vectors. -\end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Iso matrices not exploited} -%------------------------------------------------------------------------------- - -There are many cases where an matrix may have the iso property but it is not -detected by SuiteSparse:GraphBLAS. For example, if \verb'A' is non-iso, -\verb'C=A(I,J)' from \verb'GrB_extract' may be iso, if all entries in the -extracted submatrix have the same value. Future versions of -SuiteSparse:GraphBLAS may extend the rules described in this section to detect -these cases. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Performance} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{perf} - -Getting the best performance out of an algorithm that relies on GraphBLAS can -depend on many factors. This section describes some of the possible -performance pitfalls you can hit when using SuiteSparse:GraphBLAS, and how to -avoid them (or at least know when you've encountered them). - -%------------------------------------------------------------------------------- -\subsection{The burble is your friend} -%------------------------------------------------------------------------------- - -Turn on the burble with \verb'GrB_set (GrB_GLOBAL, true, GxB_BURBLE)'. You will get a -single line of output from each (significant) call to GraphBLAS. -The burble output can help you detect when you are likely using sub-optimal -methods, as described in the next sections. -When the JIT is in use the burble reports when a JIT kernel is run (which -is quick), loaded for the first time (which takes a small amount of time), -and when a JIT kernels is compiled (which can take a few tenths of a second -or more). The compiler command is printed in full. If you encounter a -compiler error, you can cut-and-paste the compiler command while outside -of your application to help track down the compiler error. - -%------------------------------------------------------------------------------- -\subsection{Data types and typecasting: use the JIT} -%------------------------------------------------------------------------------- - -If the JIT is disabled, -avoid mixing data types and relying on typecasting as much as possible. -SuiteSparse:GraphBLAS has a set of highly-tuned kernels for each data type, -and many operators and semirings, but there are too many combinations to -generate ahead of time. If typecasting is required, or if -SuiteSparse:GraphBLAS does not have a kernel for the specific operator or -semiring, the word \verb'generic' will appear in the burble. The generic -methods rely on function pointers for each operation on every scalar, so they -are slow. Enabling the JIT avoids this problem, since GraphBLAS can then -compile kernel specific to the types used. - -Without the JIT, -the only time that typecasting is fast is when computing \verb'C=A' via -\verb'GrB_assign' or \verb'GrB_apply', where the data types of \verb'C' and -\verb'A' can differ. In this case, one of $13^2 = 169$ kernels are called, -each of which performs the specific typecasting requested, without relying on -function pointers. - -%------------------------------------------------------------------------------- -\subsection{Matrix data structures: sparse, hypersparse, bitmap, or full} -%------------------------------------------------------------------------------- - -SuiteSparse:GraphBLAS tries to automatically determine the best data structure -for your matrices and vectors, selecting between sparse, hypersparse, bitmap, -and full formats. By default, all 4 formats can be used. A matrix typically -starts out hypersparse when it is created by \verb'GrB_Matrix_new', and then -changes during its lifetime, possibly taking on all four different formats -at different times. This can be modified via \verb'GrB_set'. For example, -this line of code: - - {\footnotesize - \begin{verbatim} - GrB_set (A, GxB_SPARSE + GxB_BITMAP, GxB_SPARSITY_CONTROL) ; \end{verbatim}} - -\noindent -tells SuiteSparse that the matrix \verb'A' can be held in either sparse or -bitmap format (at its discretion), but not hypersparse or full. The bitmap -format will be used if the matrix has enough entries, or sparse otherwise. -Sometimes this selection is best controlled by the user algorithm, so a single -format can be requested: - - {\footnotesize - \begin{verbatim} - GrB_set (A, GxB_SPARSE, GxB_SPARSITY_CONTROL) ; \end{verbatim}} - -This ensures that SuiteSparse will primarily use the sparse format. This is -still just a hint, however. The data structure is opaque and SuiteSparse is -free to choose otherwise. In particular, if you insist on using only the -\verb'GxB_FULL' format, then that format is used when all entries are present. -However, if the matrix is not actually full with all entries present, then the -bitmap format is used instead. The full format does not preserve the sparsity -structure in this case. Any GraphBLAS library must preserve the proper -structure, per the C Specification. This is critical in a graph algorithm, -since an edge $(i,j)$ of weight zero, say, is not the same as no edge $(i,j)$ -at all. - -%------------------------------------------------------------------------------- -\subsection{Matrix formats: by row or by column, or using the transpose of -a matrix} -%------------------------------------------------------------------------------- - -By default, SuiteSparse uses a simple rule: -all matrices are held by row, unless the consist of a single -column, in which case they are held by column. All vectors are treated as if -they are $n$-by-1 matrices with a single column. Changing formats from -row-oriented to column-oriented can have significant performance implications, -so SuiteSparse never tries to outguess the application. It just uses this -simple rule. - -However, there are cases where changing the format can greatly improve -performance. There are two ways to handle this, which in the end are -equivalent in the SuiteSparse internals. You can change the format (row to -column oriented, or visa versa), or work with the explicit transpose of a -matrix in the same storage orientation. - -There are cases where SuiteSparse must explicitly transpose an input matrix, or -the output matrix, in order to perform a computation. For example, if all -matrices are held in row-oriented fashion, SuiteSparse does not have a method -for computing \verb"C=A'*B", where \verb'A' is transposed. Thus, SuiteSparse -either computes a temporary transpose of its input matrix \verb'AT=A' and then -\verb'C=AT*B', or it swaps the computations, performing \verb"C=(B'*A)'", which -requires an explicit transpose of \verb'BT=B', and a transpose of the final -result to obtain \verb'C'. - -These temporary transposes are costly to compute, taking time and memory. They -are not kept, but are discarded when the method returns to the user -application. If you see the term \verb'transpose' in the burble output, and if -you need to perform this computation many times, try constructing your own -explicit transpose, say \verb"AT=A'", via \verb'GrB_transpose', or create a -copy of \verb'A' but held in another orientation via \verb'GrB_set'. For -example, assuming the default matrix format is by-row, and that \verb'A' is -\verb'm'-by-\verb'n' of type \verb'GrB_FP32': - - {\footnotesize - \begin{verbatim} - // method 1: AT = A' - GrB_Matrix_new (AT, GrB_FP32, n, m) ; - GrB_transpose (AT, NULL, NULL, A, NULL) ; - - // method 2: A2 = A but held by column instead of by row - // note: doing the set before the assign is faster than the reverse - GrB_Matrix_new (A2, GrB_FP32, m, n) ; - GrB_set (A2, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; - GrB_assign (A2, NULL, NULL, A, GrB_ALL, m, GrB_ALL, n, NULL) ; \end{verbatim}} - -Internally, the data structure for \verb'AT' and \verb'A2' are nearly identical -(that is, the tranpose of \verb'A' held in row format is the same as \verb'A' -held in column format). Using either of them in subsequent calls to GraphBLAS -will allow SuiteSparse to avoid computing an explicit transpose. The two -matrices \verb'AT' and \verb'A2' do differ in one very significant way: their -dimensions are different, and they behave differement mathematically. -Computing \verb"C=A'*B" using these matrices would differ: - - {\footnotesize - \begin{verbatim} - // method 1: C=A'*B using AT - GrB_mxm (C, NULL, NULL, semiring, AT, B, NULL) ; - - // method 2: C=A'*B using A2 - GrB_mxm (C, NULL, NULL, semiring, A2, B, GrB_DESC_T0) ; \end{verbatim}} - -The first method computes \verb'C=AT*B'. The second method computes -\verb"C=A2'*B", but the result of both computations is the same, and internally -the same kernels will be used. - -%------------------------------------------------------------------------------- -\subsection{Push/pull optimization} -%------------------------------------------------------------------------------- - -Closely related to the discussion above on when to use a matrix or its -transpose is the exploitation of ``push/pull'' direction optimization. In -linear algebraic terms, this is simply deciding whether to multiply by the -matrix or its transpose. Examples can be see in the BFS and -Betweeness-Centrality methods of LAGraph. Here is the BFS kernel: - - {\footnotesize - \begin{verbatim} - int sparsity = do_push ? GxB_SPARSE : GxB_BITMAP ; - GrB_set (q, sparsity, GxB_SPARSITY_CONTROL) ; - if (do_push) - { - // q'{!pi} = q'*A - GrB_vxm (q, pi, NULL, semiring, q, A, GrB_DESC_RSC) ; - } - else - { - // q{!pi} = AT*q - GrB_mxv (q, pi, NULL, semiring, AT, q, GrB_DESC_RSC) ; - }\end{verbatim}} - -The call to \verb'GrB_set' is optional, since SuiteSparse will likely already -determine that a bitmap format will work best when the frontier \verb'q' has -many entries, which is also when the pull step is fastest. The push step -relies on a sparse vector times sparse matrix method originally due to -Gustavson. The output is computed as a set union of all rows \verb'A(i,:)' -where \verb'q(i)' is present on input. This set union is very fast when -\verb'q' is very sparse. The pull step relies on a sequence of dot product -computations, one per possible entry in the output \verb'q', and it uses the -matrix \verb"AT" which is a row-oriented copy of the explicit transpose of the -adjacency matrix \verb'A'. - -Mathematically, the results of the two methods are identical, but internally, -the data format of the input matrices is very different (using \verb'A' held -by row, or \verb'AT' held by row which is the same as a copy of \verb'A' that -is held by column), and the algorithms used are very different. - -%------------------------------------------------------------------------------- -\subsection{Computing with full matrices and vectors} -%------------------------------------------------------------------------------- - -Sometimes the best approach to getting the highest performance is to use dense -vectors, and occassionaly dense matrices are tall-and-thin or short-and-fat. -Packages such as Julia, Octave, or MATLAB, when dealing with the conventional -plus-times semirings, assume that multiplying a sparse matrix \verb'A' times a -dense vector \verb'x', \verb'y=A*x', will result in a dense vector \verb'y'. -This is not always the case, however. GraphBLAS must always return a result -that respects the sparsity structure of the output matrix or vector. If the -$i$th row of \verb'A' has no entries then \verb'y(i)' must not appear as an -entry in the vector \verb'y', so it cannot be held as a full vector. As a -result, the following computation can be slower than it could be: - - {\footnotesize - \begin{verbatim} - GrB_mxv (y, NULL, NULL, semiring, A, x, NULL) ; \end{verbatim}} - -SuiteSparse must do extra work to compute the sparsity of this vector \verb'y', -but if this is not needed, and \verb'y' can be padded with zeros (or -the identity value of the monoid, to be precise), a faster method can be used, -by relying on the accumulator. Instead of computing \verb'y=A*x', set all -entries of \verb'y' to zero first, and then compute \verb'y+=A*x' where the -accumulator operator and type matches the monoid of the semiring. SuiteSparse -has special kernels for this case; you can see them in the burble as -\verb'F+=S*F' for example. - - {\footnotesize - \begin{verbatim} - // y = 0 - GrB_assign (y, NULL, NULL, 0, GrB_ALL, n, NULL) ; - // y += A*x - GrB_mxv (y, NULL, GrB_PLUS_FP32, GrB_PLUS_TIMES_SEMIRING_FP32, A, x, NULL) ; \end{verbatim}} - -You can see this computation in the LAGraph PageRank method, where all -entries of \verb'r' are set to the \verb'teleport' scalar first. - - {\footnotesize - \begin{verbatim} - for (iters = 0 ; iters < itermax && rdiff > tol ; iters++) - { - // swap t and r ; now t is the old score - GrB_Vector temp = t ; t = r ; r = temp ; - // w = t ./ d - GrB_eWiseMult (w, NULL, NULL, GrB_DIV_FP32, t, d, NULL) ; - // r = teleport - GrB_assign (r, NULL, NULL, teleport, GrB_ALL, n, NULL) ; - // r += A'*w - GrB_mxv (r, NULL, GrB_PLUS_FP32, LAGraph_plus_second_fp32, AT, w, NULL) ; - // t -= r - GrB_assign (t, NULL, GrB_MINUS_FP32, r, GrB_ALL, n, NULL) ; - // t = abs (t) - GrB_apply (t, NULL, NULL, GrB_ABS_FP32, t, NULL) ; - // rdiff = sum (t) - GrB_reduce (&rdiff, NULL, GrB_PLUS_MONOID_FP32, t, NULL) ; - } \end{verbatim}} - -SuiteSparse exploits the iso-valued property of the scalar-to-vector assignment -of \verb'y=0', or \verb'r=teleport', and performs these assignments in O(1) -time and space. Because the \verb'r' vector start out as full on input to -\verb'GrB_mxv', and because there is an accumulatr with no mask, no entries in -the input/output vector \verb'r' will be deleted, even if \verb'A' has empty -rows. The call to \verb'GrB_mxv' exploits this, and is able to use a fast -kernel for this computation. SuiteSparse does not need to compute the sparsity -pattern of the vector \verb'r'. - -%------------------------------------------------------------------------------- -\subsection{Iso-valued matrices and vectors} -%------------------------------------------------------------------------------- - -Using iso-valued matrices and vectors is always faster than using matrices and -vectors whose entries can have different values. Iso-valued matrices are very -important in graph algorithms. For example, an unweighted graph is best -represented as an iso-valued sparse matrix, and unweighted graphs are very -common. The burble output, or the \verb'GxB_print', \verb'GxB_Matrix_iso', or -\verb'GxB_Vector_iso' can all be used to report whether or not your matrix or -vector is iso-valued. - -Sometimes a matrix or vector may have values that are all the same, but -SuiteSparse hasn't detected this. If this occurs, you can force a matrix -or vector to be iso-valued by assigning a single scalar to all its entries. - - {\footnotesize - \begin{verbatim} - // C = 3.14159 - GrB_assign (C, C, NULL, 3.14159, GrB_ALL, m, GrB_ALL, n, GrB_DESC_S) ; \end{verbatim}} - -The matrix \verb'C' is used as its own mask. The descriptor is essential here, -telling the mask to be used in a structural sense, without regard to the values -of the entries in the mask. This assignment sets all entries that already -exist in \verb'C' to be equal to a single value, 3.14159. The sparsity -structure of \verb'C' does not change. Of course, any scalar can be used; the -value 1 is common for unweighted graphs. SuiteSparse:GraphBLAS performs the -above assignment in O(1) time and space, independent of the dimension of -\verb'C' or the number of entries in contains. - -%------------------------------------------------------------------------------- -\subsection{User-defined types and operators: use the JIT} -%------------------------------------------------------------------------------- - -If the JIT is disabled, these will be slow. With the JIT enabled, data types -and operators are just as fast as built-in types and operators. A CUDA JIT for -the GPU is in progress, collaboration with Joe Eaton and Corey Nolet. -A SYCL/OpenCL JIT is under consideration, but work has not yet been started. - -%------------------------------------------------------------------------------- -\subsection{About NUMA systems} -%------------------------------------------------------------------------------- - -I have tested this package extensively on multicore single-socket systems, but -have not yet optimized it for multi-socket systems with a NUMA architecture. -That will be done in a future release. If you publish benchmarks -with this package, please state the SuiteSparse:GraphBLAS version, and a caveat -if appropriate. If you see significant performance issues when going from a -single-socket to multi-socket system, I would like to hear from you so I can -look into it. - -\newpage -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Examples} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{examples} - -Several examples of how to use GraphBLAS are listed below. They all -appear in the \verb'Demo' folder of SuiteSparse:GraphBLAS. Programs in -the \verb'Demo' folder are meant as simple examples; for the fastest methods, -see LAgraph (Section~\ref{lagraph}). - -\begin{enumerate} -\item creating a random matrix -\item creating a finite-element matrix -\item reading a matrix from a file -\item complex numbers as a user-defined type -\item matrix import/export -\end{enumerate} - -Additional examples appear in the newly created LAGraph project, currently in -progress. - -%------------------------------------------------------------------------------- -\subsection{LAGraph} -%------------------------------------------------------------------------------- -\label{lagraph} - -The LAGraph project is a community-wide effort to create graph algorithms based -on GraphBLAS (any implementation of the API, not just SuiteSparse: GraphBLAS). -Some of the algorithms and utilities in LAGraph are listed in the table below. -Many additional algorithms are planned. Refer to -\url{https://github.com/GraphBLAS/LAGraph} for a current list of algorithms. All -functions in the \verb'Demo/' folder in SuiteSparse:GraphBLAS will eventually -be translated into algorithms or utilities for LAGraph, and then removed -from \verb'GraphBLAS/Demo'. - -To use LAGraph with SuiteSparse:GraphBLAS, place the two folders \verb'LAGraph' -and \verb'GraphBLAS' in the same parent directory. This allows the -\verb'cmake' script in LAGraph to find the copy of GraphBLAS. Alternatively, -the GraphBLAS source could be placed anywhere, as long as -\verb'sudo make install' is performed. - -%------------------------------------------------------------------------------- -\subsection{Creating a random matrix} -%------------------------------------------------------------------------------- -\label{random} - -The \verb'random_matrix' function in the \verb'Demo' folder generates a random -matrix with a specified dimension and number of entries, either symmetric or -unsymmetric, and with or without self-edges (diagonal entries in the matrix). -It relies on \verb'simple_rand*' functions in the \verb'Demo' folder to provide -a portable random number generator that creates the same sequence on any -computer and operating system. - -\verb'random_matrix' can use one of two methods: \verb'GrB_Matrix_setElement' -and \verb'GrB_Matrix_build'. The former method is very simple to use: - - {\footnotesize - \begin{verbatim} - GrB_Matrix_new (&A, GrB_FP64, nrows, ncols) ; - for (int64_t k = 0 ; k < ntuples ; k++) - { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; - if (no_self_edges && (i == j)) continue ; - double x = simple_rand_x ( ) ; - // A (i,j) = x - GrB_Matrix_setElement (A, x, i, j) ; - if (make_symmetric) - { - // A (j,i) = x - GrB_Matrix_setElement (A, x, j, i) ; - } - } \end{verbatim}} - -The above code can generate a million-by-million sparse \verb'double' matrix -with 200 million entries in 66 seconds (6 seconds of which is the time to -generate the random \verb'i', \verb'j', and \verb'x'), including the time -to finish all pending computations. The user application does not need to -create a list of all the tuples, nor does it need to know how many entries will -appear in the matrix. It just starts from an empty matrix and adds them one at -a time in arbitrary order. GraphBLAS handles the rest. This method is not -feasible in MATLAB. - -The next method uses \verb'GrB_Matrix_build'. It is more complex to use than -\verb'setElement' since it requires the user application to allocate and fill -the tuple lists, and it requires knowledge of how many entries will appear in -the matrix, or at least a good upper bound, before the matrix is constructed. -It is slightly faster, creating the same matrix in 60 seconds, 51 seconds -of which is spent in \verb'GrB_Matrix_build'. - - {\footnotesize - \begin{verbatim} - GrB_Index *I, *J ; - double *X ; - int64_t s = ((make_symmetric) ? 2 : 1) * nedges + 1 ; - I = malloc (s * sizeof (GrB_Index)) ; - J = malloc (s * sizeof (GrB_Index)) ; - X = malloc (s * sizeof (double )) ; - if (I == NULL || J == NULL || X == NULL) - { - // out of memory - if (I != NULL) free (I) ; - if (J != NULL) free (J) ; - if (X != NULL) free (X) ; - return (GrB_OUT_OF_MEMORY) ; - } - int64_t ntuples = 0 ; - for (int64_t k = 0 ; k < nedges ; k++) - { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; - if (no_self_edges && (i == j)) continue ; - double x = simple_rand_x ( ) ; - // A (i,j) = x - I [ntuples] = i ; - J [ntuples] = j ; - X [ntuples] = x ; - ntuples++ ; - if (make_symmetric) - { - // A (j,i) = x - I [ntuples] = j ; - J [ntuples] = i ; - X [ntuples] = x ; - ntuples++ ; - } - } - GrB_Matrix_build (A, I, J, X, ntuples, GrB_SECOND_FP64) ; \end{verbatim}} - -The equivalent \verb'sprandsym' function in MATLAB takes 150 seconds, but -\verb'sprandsym' uses a much higher-quality random number generator to create -the tuples \verb'[I,J,X]'. Considering just the time for -\verb'sparse(I,J,X,n,n)' in \verb'sprandsym' (equivalent to -\verb'GrB_Matrix_build'), the time is 70 seconds. That is, each of these three -methods, \verb'setElement' and \verb'build' in SuiteSparse:GraphBLAS, and -\verb'sparse' in MATLAB, are equally fast. - -%------------------------------------------------------------------------------- -\subsection{Creating a finite-element matrix} -%------------------------------------------------------------------------------- -\label{fem} - -Suppose a finite-element matrix is being constructed, with \verb'k=40,000' -finite-element matrices, each of size \verb'8'-by-\verb'8'. The following -operations (in pseudo-MATLAB notation) are very efficient in -SuiteSparse:GraphBLAS. - - {\footnotesize - \begin{verbatim} - A = sparse (m,n) ; % create an empty n-by-n sparse GraphBLAS matrix - for i = 1:k - construct a 8-by-8 sparse or dense finite-element F - I and J define where the matrix F is to be added: - I = a list of 8 row indices - J = a list of 8 column indices - % using GrB_assign, with the 'plus' accum operator: - A (I,J) = A (I,J) + F - end \end{verbatim}} - -If this were done in MATLAB or in GraphBLAS with blocking mode enabled, the -computations would be extremely slow. A far better approach is to construct a -list of tuples \verb'[I,J,X]' and to use \verb'sparse(I,J,X,n,n)'. This is -identical to creating the same list of tuples in GraphBLAS and using the -\verb'GrB_Matrix_build', which is equally fast. - -In SuiteSparse:GraphBLAS, the performance of both methods is essentially -identical, and roughly as fast as \verb'sparse' in MATLAB. Inside -SuiteSparse:GraphBLAS, \verb'GrB_assign' is doing the same thing. When -performing \verb'A(I,J)=A(I,J)+F', if it finds that it cannot quickly insert an -update into the \verb'A' matrix, it creates a list of pending tuples to be -assembled later on. When the matrix is ready for use in a subsequent -GraphBLAS operation (one that normally cannot use a matrix with pending -computations), the tuples are assembled all at once via -\verb'GrB_Matrix_build'. - -GraphBLAS operations on other matrices have no effect on when the pending -updates of a matrix are completed. Thus, any GraphBLAS method or operation can -be used to construct the \verb'F' matrix in the example above, without -affecting when the pending updates to \verb'A' are completed. - -The MATLAB \verb'wathen.m' script is part of Higham's \verb'gallery' of -matrices \cite{Higham}. It creates a finite-element matrix with random -coefficients for a 2D mesh of size \verb'nx'-by-\verb'ny', a matrix formulation -by Wathen \cite{Wathen}. The pattern of the matrix is fixed; just the values -are randomized. The GraphBLAS equivalent can use either -\verb'GrB_Matrix_build', or \verb'GrB_assign'. Both methods have good -performance. The \verb'GrB_Matrix_build' version below is about 15\% to 20\% -faster than the MATLAB \verb'wathen.m' function, regardless of the problem -size. It uses the identical algorithm as \verb'wathen.m'. - - {\footnotesize - \begin{verbatim} - int64_t ntriplets = nx*ny*64 ; - I = malloc (ntriplets * sizeof (int64_t)) ; - J = malloc (ntriplets * sizeof (int64_t)) ; - X = malloc (ntriplets * sizeof (double )) ; - if (I == NULL || J == NULL || X == NULL) - { - FREE_ALL ; - return (GrB_OUT_OF_MEMORY) ; - } - ntriplets = 0 ; - for (int j = 1 ; j <= ny ; j++) - { - for (int i = 1 ; i <= nx ; i++) - { - nn [0] = 3*j*nx + 2*i + 2*j + 1 ; - nn [1] = nn [0] - 1 ; - nn [2] = nn [1] - 1 ; - nn [3] = (3*j-1)*nx + 2*j + i - 1 ; - nn [4] = 3*(j-1)*nx + 2*i + 2*j - 3 ; - nn [5] = nn [4] + 1 ; - nn [6] = nn [5] + 1 ; - nn [7] = nn [3] + 1 ; - for (int krow = 0 ; krow < 8 ; krow++) nn [krow]-- ; - for (int krow = 0 ; krow < 8 ; krow++) - { - for (int kcol = 0 ; kcol < 8 ; kcol++) - { - I [ntriplets] = nn [krow] ; - J [ntriplets] = nn [kcol] ; - X [ntriplets] = em (krow,kcol) ; - ntriplets++ ; - } - } - } - } - // A = sparse (I,J,X,n,n) ; - GrB_Matrix_build (A, I, J, X, ntriplets, GrB_PLUS_FP64) ; \end{verbatim}} - -The \verb'GrB_assign' version has the advantage of not requiring the -user application to construct the tuple list, and is almost as fast as using -\verb'GrB_Matrix_build'. The code is more elegant than either the MATLAB -\verb'wathen.m' function or its GraphBLAS equivalent above. Its performance is -comparable with the other two methods, but slightly slower, being about 5\% -slower than the MATLAB \verb'wathen', and 20\% slower than the GraphBLAS -method above. - - {\footnotesize - \begin{verbatim} - GrB_Matrix_new (&F, GrB_FP64, 8, 8) ; - for (int j = 1 ; j <= ny ; j++) - { - for (int i = 1 ; i <= nx ; i++) - { - nn [0] = 3*j*nx + 2*i + 2*j + 1 ; - nn [1] = nn [0] - 1 ; - nn [2] = nn [1] - 1 ; - nn [3] = (3*j-1)*nx + 2*j + i - 1 ; - nn [4] = 3*(j-1)*nx + 2*i + 2*j - 3 ; - nn [5] = nn [4] + 1 ; - nn [6] = nn [5] + 1 ; - nn [7] = nn [3] + 1 ; - for (int krow = 0 ; krow < 8 ; krow++) nn [krow]-- ; - for (int krow = 0 ; krow < 8 ; krow++) - { - for (int kcol = 0 ; kcol < 8 ; kcol++) - { - // F (krow,kcol) = em (krow, kcol) - GrB_Matrix_setElement (F, em (krow,kcol), krow, kcol) ; - } - } - // A (nn,nn) += F - GrB_assign (A, NULL, GrB_PLUS_FP64, F, nn, 8, nn, 8, NULL) ; - } - } \end{verbatim}} - -Since there is no \verb'Mask', and since \verb'GrB_REPLACE' is not used, the call -to \verb'GrB_assign' in the example above is identical to \verb'GxB_subassign'. -Either one can be used, and their performance would be identical. - -Refer to the \verb'wathen.c' function in the \verb'Demo' folder, which -uses GraphBLAS to implement the two methods above, and two additional ones. - -%------------------------------------------------------------------------------- -\subsection{Reading a matrix from a file} -%------------------------------------------------------------------------------- -\label{read} - -See also \verb'LAGraph_mmread' and \verb'LAGraph_mmwrite', which -can read and write any matrix in Matrix Market format, and -\verb'LAGraph_binread' and \verb'LAGraph_binwrite', which read/write a matrix -from a binary file. The binary file I/O functions are much faster than -the \verb'read_matrix' function described here, and also much faster than -\verb'LAGraph_mmread' and \verb'LAGraph_mmwrite'. - -The \verb'read_matrix' function in the \verb'Demo' reads in a triplet matrix -from a file, one line per entry, and then uses \verb'GrB_Matrix_build' to -create the matrix. It creates a second copy with \verb'GrB_Matrix_setElement', -just to test that method and compare the run times. -Section~\ref{random} has already compared -\verb'build' versus \verb'setElement'. - -The function can return the matrix as-is, which may be rectangular or -unsymmetric. If an input parameter is set to make the matrix symmetric, -\verb'read_matrix' computes \verb"A=(A+A')/2" if \verb'A' is square (turning -all directed edges into undirected ones). If \verb'A' is rectangular, it -creates a bipartite graph, which is the same as the augmented matrix, -\verb"A = [0 A ; A' 0]". -If \verb'C' is an \verb'n'-by-\verb'n' matrix, then \verb"C=(C+C')/2" can be -computed as follows in GraphBLAS, (the \verb'scale2' function divides an entry -by 2): - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - GrB_Descriptor_new (&dt2) ; - GrB_set (dt2, GrB_TRAN, GrB_INP1) ; - GrB_Matrix_new (&A, GrB_FP64, n, n) ; - GrB_eWiseAdd (A, NULL, NULL, GrB_PLUS_FP64, C, C, dt2) ; // A=C+C' - GrB_free (&C) ; - GrB_Matrix_new (&C, GrB_FP64, n, n) ; - GrB_UnaryOp_new (&scale2_op, scale2, GrB_FP64, GrB_FP64) ; - GrB_apply (C, NULL, NULL, scale2_op, A, NULL) ; // C=A/2 - GrB_free (&A) ; - GrB_free (&scale2_op) ; \end{verbatim}} - -This is of course not nearly as elegant as \verb"A=(A+A')/2" in MATLAB, but -with minor changes it can work on any type and use any built-in operators -instead of \verb'PLUS', or it can use any user-defined operators and types. -The above code in SuiteSparse:GraphBLAS takes 0.60 seconds for the -\verb'Freescale2' matrix, slightly slower than MATLAB (0.55 seconds). - -Constructing the augmented system is more complicated using the GraphBLAS C API -Specification since it does not yet have a simple way of specifying a range of -row and column indices, as in \verb'A(10:20,30:50)' in MATLAB (\verb'GxB_RANGE' -is a SuiteSparse:GraphBLAS extension that is not in the Specification). Using -the C API in the Specification, the application must instead build a list of -indices first, \verb'I=[10, 11' \verb'...' \verb'20]'. - -Thus, to compute the MATLAB equivalent of \verb"A = [0 A ; A' 0]", index lists -\verb'I' and \verb'J' must first be constructed: - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - int64_t n = nrows + ncols ; - I = malloc (nrows * sizeof (int64_t)) ; - J = malloc (ncols * sizeof (int64_t)) ; - // I = 0:nrows-1 - // J = nrows:n-1 - if (I == NULL || J == NULL) - { - if (I != NULL) free (I) ; - if (J != NULL) free (J) ; - return (GrB_OUT_OF_MEMORY) ; - } - for (int64_t k = 0 ; k < nrows ; k++) I [k] = k ; - for (int64_t k = 0 ; k < ncols ; k++) J [k] = k + nrows ; \end{verbatim}} - -Once the index lists are generated, however, the resulting GraphBLAS operations -are fairly straightforward, computing \verb"A=[0 C ; C' 0]". - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - GrB_Descriptor_new (&dt1) ; - GrB_set (dt1, GrB_TRAN, GrB_INP0) ; - GrB_Matrix_new (&A, GrB_FP64, n, n) ; - // A (nrows:n-1, 0:nrows-1) = C' - GrB_assign (A, NULL, NULL, C, J, ncols, I, nrows, dt1) ; - // A (0:nrows-1, nrows:n-1) = C - GrB_assign (A, NULL, NULL, C, I, nrows, J, ncols, NULL) ; \end{verbatim}} - -This takes 1.38 seconds for the \verb'Freescale2' matrix, almost as fast as \newline -\verb"A=[sparse(m,m) C ; C' sparse(n,n)]" in MATLAB (1.25 seconds). -The \verb'GxB_Matrix_concat' function would be faster still (this example -was written prior to \verb'GxB_Matrix_concat' was added to SuiteSparse:GraphBLAS). - -Both calls to \verb'GrB_assign' use no accumulator, so the second one -causes the partial matrix \verb"A=[0 0 ; C' 0]" to be built first, followed by -the final build of \verb"A=[0 C ; C' 0]". A better method, but not an obvious -one, is to use the \verb'GrB_FIRST_FP64' accumulator for both assignments. An -accumulator enables SuiteSparse:GraphBLAS to determine that that entries -created by the first assignment cannot be deleted by the second, and thus it -need not force completion of the pending updates prior to the second -assignment. - -SuiteSparse:GraphBLAS also adds a \verb'GxB_RANGE' mechanism that mimics -the MATLAB colon notation. This speeds up the method and simplifies the -code the user needs to write to compute \verb"A=[0 C ; C' 0]": - - \vspace{-0.05in} - {\footnotesize - \begin{verbatim} - int64_t n = nrows + ncols ; - GrB_Matrix_new (&A, xtype, n, n) ; - GrB_Index I_range [3], J_range [3] ; - I_range [GxB_BEGIN] = 0 ; - I_range [GxB_END ] = nrows-1 ; - J_range [GxB_BEGIN] = nrows ; - J_range [GxB_END ] = ncols+nrows-1 ; - // A (nrows:n-1, 0:nrows-1) += C' - GrB_assign (A, NULL, GrB_FIRST_FP64, // or NULL, - C, J_range, GxB_RANGE, I_range, GxB_RANGE, dt1) ; - // A (0:nrows-1, nrows:n-1) += C - GrB_assign (A, NULL, GrB_FIRST_FP64, // or NULL, - C, I_range, GxB_RANGE, J_range, GxB_RANGE, NULL) ; \end{verbatim}} - -Any operator will suffice because it is not actually applied. An operator is -only applied to the set intersection, and the two assignments do not overlap. -If an \verb'accum' operator is used, only the final matrix is built, and the -time in GraphBLAS drops slightly to 1.25 seconds. This is a very small -improvement because in this particular case, SuiteSparse:GraphBLAS is able to -detect that no sorting is required for the first build, and the second one is a -simple concatenation. In general, however, allowing GraphBLAS to postpone -pending updates can lead to significant reductions in run time. - -%------------------------------------------------------------------------------- -\subsection{User-defined types and operators} -%------------------------------------------------------------------------------- -\label{user} - -The \verb'Demo' folder contains two working examples of user-defined types, -first discussed in Section~\ref{type_new}: \verb'double complex', and a -user-defined \verb'typedef' called \verb'wildtype' with a \verb'struct' -containing a string and a 4-by-4 \verb'float' matrix. - -{\bf Double Complex:} -Prior to v3.3, GraphBLAS did not have a native complex type. It now appears as -the \verb'GxB_FC64' predefined type, but a complex type can also easily added -as a user-defined type. The \verb'Complex_init' function in the -\verb'usercomplex.c' file in the \verb'Demo' folder creates the \verb'Complex' -type based on the C11 \verb'double complex' type. -It creates a full suite of operators that correspond to every -built-in GraphBLAS operator, both binary and unary. In addition, it -creates the operators listed in the following table, where $D$ is -\verb'double' and $C$ is \verb'Complex'. - -\vspace{0.1in} -{\footnotesize -\begin{tabular}{llll} -\hline -name & types & MATLAB/Octave & description \\ - & & equivalent & \\ -\hline -\verb'Complex_complex' & $D \times D \rightarrow C$ & \verb'z=complex(x,y)' & complex from real and imag. \\ -\hline -\verb'Complex_conj' & $C \rightarrow C$ & \verb'z=conj(x)' & complex conjugate \\ -\verb'Complex_real' & $C \rightarrow D$ & \verb'z=real(x)' & real part \\ -\verb'Complex_imag' & $C \rightarrow D$ & \verb'z=imag(x)' & imaginary part \\ -\verb'Complex_angle' & $C \rightarrow D$ & \verb'z=angle(x)' & phase angle \\ -\verb'Complex_complex_real' & $D \rightarrow C$ & \verb'z=complex(x,0)' & real to complex real \\ -\verb'Complex_complex_imag' & $D \rightarrow C$ & \verb'z=complex(0,x)' & real to complex imag. \\ -\hline -\end{tabular} -} - -The \verb'Complex_init' function creates two monoids (\verb'Complex_add_monoid' -and \verb'Complex_times_monoid') and a semiring \verb'Complex_plus_times' that -corresponds to the conventional linear algebra for complex matrices. The -include file \verb'usercomplex.h' in the \verb'Demo' folder is available so -that this user-defined \verb'Complex' type can easily be imported into any -other user application. When the user application is done, the -\verb'Complex_finalize' function frees the \verb'Complex' type and its -operators, monoids, and semiring. -NOTE: the \verb'Complex' type is not supported in this Demo in Microsoft -Visual Studio. - -{\bf Struct-based:} -In addition, the \verb'wildtype.c' program creates a user-defined -\verb'typedef' of a \verb'struct' containing a dense 4-by-4 \verb'float' -matrix, and a 64-character string. It constructs an additive monoid that adds -two 4-by-4 dense matrices, and a multiplier operator that multiplies two 4-by-4 -matrices. Each of these 4-by-4 matrices is treated by GraphBLAS as a -``scalar'' value, and they can be manipulated in the same way any other -GraphBLAS type can be manipulated. The purpose of this type is illustrate the -endless possibilities of user-defined types and their use in GraphBLAS. - -%------------------------------------------------------------------------------- -\subsection{User applications using OpenMP or other threading models} -%------------------------------------------------------------------------------- -\label{threads} - -An example demo program (\verb'openmp_demo') is included that illustrates how a -multi-threaded user application can use GraphBLAS. - -The results from the \verb'openmp_demo' program may appear out of order. This -is by design, simply to show that the user application is running in parallel. -The output of each thread should be the same. In particular, each thread -generates an intentional error, and later on prints it with \verb'GrB_error'. -It will print its own error, not an error from another thread. When all the -threads finish, the leader thread prints out each matrix generated by each -thread. - -GraphBLAS can also be combined with user applications that rely on MPI, the -Intel TBB threading library, POSIX pthreads, Microsoft Windows threads, or any -other threading library. If GraphBLAS itself is compiled with OpenMP, -it will be thread safe when combined with other libraries. -See Section~\ref{omp_parallelism} for thread-safety issues that can occur -if GraphBLAS is compiled without OpenMP. - -\newpage -%------------------------------------------------------------------------------- -\section{Compiling and Installing SuiteSparse:GraphBLAS} -%------------------------------------------------------------------------------- -\label{sec:install} - -%---------------------------------------- -\subsection{Quick Start} -%---------------------------------------- - -GraphBLAS requires \verb'cmake' version 3.20 or later. -It optionally can use OpenMP for best performance. -For OpenMP on the Mac, see Section~\ref{mac_openmp}. -Without OpenMP, GraphBLAS will be significantly slower since it is a highly -parallel package. - -A \verb'cmake' build system is available for Linux, Mac, and Windows. -For Linux or Mac, a simple Makefile wrapper is available that accesses this -cmake build system. Simply do: - - {\small - \begin{verbatim} - make - sudo make install \end{verbatim} } - -For Windows, open CMake and use the provided \verb'CMakeLists.txt' file -to build GraphBLAS in the \verb'GraphBLAS/build' folder. - -Next, try the demos with \verb'make demos'. -The output of the demos will be compared with expected -output files in \verb'Demo/Output'.\footnote{ -NOTE: -DO NOT publish benchmarks of these demos, and do not link against the -demo library in any user application. These codes are sometimes slow, -and are meant as simple illustrations only, not for performance. The fastest -methods are in LAGraph, not in GraphBLAS/Demo. Benchmark LAGraph -instead. Eventually, all GraphBLAS/Demos methods will be removed, and LAGraph -will serve all uses: for illustration, benchmarking, and production uses.} - -%---------------------------------------- -\subsection{Quick Start for MATLAB/Octave} -%---------------------------------------- - -As of GraphBLAS 9.2.0, a new and simpler method for compiling GraphBLAS and its -MATLAB interface has been added. In the MATLAB/Octave Command Window, simply -type: - - {\small - \begin{verbatim} - cd GraphBLAS/GraphBLAS - graphblas_install \end{verbatim} } - -This will use \verb'cmake' to compile the GraphBLAS library. You can skip the -details in the remainder of this section. Next, add your -\verb'GraphBLAS/GraphBLAS' folder to your path, by editting your -\verb'startup.m' script (usually in your \verb'Documents/MATLAB' folder). -Add this line: - - {\small - \begin{verbatim} - addpath ('/home/me/GraphBLAS/GraphBLAS') ; \end{verbatim} } - -\noindent -where \verb'/home/me/GraphBLAS' is the top-level folder containing your -copy of GraphBLAS. - -The \verb'graphblas_install' MATLAB script may fail to run \verb'cmake'. -If it does, it will print the following workaround, where the commands it -tells you to use will differ depending on the platform: - - {\small - \begin{verbatim} - Building GraphBLAS with cmake failed. Try this outside of MATLAB: - - cd /home/me/GraphBLAS/GraphBLAS/build - cmake .. - cmake --build . --config Release -j40 - - Then do this inside MATLAB: - - cd /home/me/GraphBLAS/GraphBLAS/@GrB/private - gbmake \end{verbatim} } - -\noindent -where \verb'/home/me/GraphBLAS' is your copy of GraphBLAS. - -%---------------------------------------- -\subsection{More details} -%---------------------------------------- - -%---------------------------------------- -\subsubsection{On Linux and Mac} -%---------------------------------------- - -GraphBLAS makes extensive use of features in the C11 standard, and thus a -C compiler supporting this version of the C standard is required to use -all features of GraphBLAS. - -{\bf Any version of the Intel \verb'icx' compiler is highly recommended.} In -most cases, the Intel \verb'icx' and the Intel OpenMP library (\verb'libiomp') -result in the best performance. The \verb'gcc' and the GNU OpenMP library -(\verb'libgomp') generally gives good performance: typically on par with icx -but in a few special cases significantly slower. The Intel \verb'icc' compiler -is not recommended; it results in poor performance for -\verb'#pragma omp atomic'. - -If you are using a C compiler that does not support the C11 standard, such as -\verb'cl' in Microsoft Visual Studio, then the \verb'_Generic' keyword is not -available. SuiteSparse:GraphBLAS will still compile, but you will not have -access to polymorphic functions such as \verb'GrB_assign'. You will need to -use the non-polymorphic functions instead. - -To compile SuiteSparse:GraphBLAS, simply type \verb'make' in the main GraphBLAS -folder, which compiles the library with your default system compiler. This -compile GraphBLAS using 8 threads, which will take a long time. To compile with -more threads (40, for this example), use: - - {\small - \begin{verbatim} - make JOBS=40 \end{verbatim} } - -To use a non-default compiler with 4 threads: - - {\small - \begin{verbatim} - make CC=icx CXX=icpx JOBS=4 \end{verbatim} } - -GraphBLAS v6.1.3 and later use the \verb'cpu_features' package by Google to -determine if the target architecture supports AVX2 and/or AVX512F (on Intel -x86\_64 architectures only). In case you have build issues with this package, -you can compile without it (and then AVX2 and AVX512F acceleration will not -be used): - - {\small - \begin{verbatim} - make CMAKE_OPTIONS='-DGBNCPUFEAT=1' \end{verbatim} } - -Without \verb'cpu_features', it is still possible to enable AVX2 and AVX512F. -Rather than relying on run-time tests, you can use these flags to enable -both AVX2 and AVX512F, without relying on \verb'cpu_features': - - {\small - \begin{verbatim} - make CMAKE_OPTIONS='-DGBNCPUFEAT=1 -DGBAVX2=1 -DGBAVX512F=1' \end{verbatim} } - -To use multiple options, separate them by a space. For example, to build -just the library but not \verb'cpu_features', and to enable -AVX2 but not AVX512F, and use 40 threads to compile: - - {\small - \begin{verbatim} - make CMAKE_OPTIONS='-DGBNCPUFEAT=1 -DGBAVX2=1' JOBS=40 \end{verbatim} } - -After compiling the library, you can compile the demos with -\verb'make all' and then \verb'make demos' while in the top-level -GraphBLAS folder. - -If \verb'cmake' or \verb'make' fail, it might be that your default compiler -does not support C11. Try another compiler. For example, try one of -these options. Go into the \verb'build' directory and type one of these: - - {\small - \begin{verbatim} - CC=gcc cmake .. - CC=gcc-11 cmake .. - CC=xlc cmake .. - CC=icx cmake .. \end{verbatim} } - -You can also do the following in the top-level GraphBLAS folder instead: - - {\small - \begin{verbatim} - CC=gcc make - CC=gcc-11 make - CC=xlc make - CC=icx make \end{verbatim} } - -For faster compilation, you can specify a parallel make. For example, -to use 32 parallel jobs and the \verb'gcc' compiler, do the following: - - {\small - \begin{verbatim} - JOBS=32 CC=gcc make \end{verbatim} } - -%---------------------------------------- -\subsubsection{On the Mac (Intel or ARM)} -%---------------------------------------- - -GraphBLAS requires \verb'cmake' v3.20 or later, and it optionally uses -\verb'make' to simplify the use of the cmake build system. It also needs -other Apple Command Line Tools from Xcode. -First install Xcode (see \url{https://developer.apple.com/xcode}), -and then install the command line tools for Xcode: - - {\small - \begin{verbatim} - xcode-select --install \end{verbatim} } - -Next, install brew, at \url{https://brew.sh}, or \verb'spack'. -Use brew or spack to install cmake version 3.20 or later. - -%---------------------------------------- -\subsubsection{On the Intel-based Mac} -%---------------------------------------- - -If you have the Intel compiler and its OpenMP library, then use the following -in the top-level \verb'GraphBLAS' folder. The Intel OpenMP library -will be found automatically: - - {\small - \begin{verbatim} - make CC=icc CXX=icpc \end{verbatim} } - -%---------------------------------------- -\subsubsection{MATLAB on the Mac (Apple Silicon based)} -%---------------------------------------- - -MATLAB on the Apple-Silicon-based Mac is now a native ARM64 application (as of -R2023b). GraphBLAS is not supported for earlier versions of MATLAB on Apple -Silicon. - -Note that GraphBLAS must use the same OpenMP library as MATLAB. This is -handled by the \verb'graphblas_install.m' script. - -%---------------------------------------- -\subsubsection{On Microsoft Windows} -\label{sec:windows} -%---------------------------------------- - -SuiteSparse:GraphBLAS can be compiled by the Microsoft C compiler (\verb'cl') -using Microsoft Visual Studio. However, that compiler is not C11 compliant. As -a result, GraphBLAS on Windows will have a few minor limitations. - -\begin{itemize} -\item The MS Visual Studio compiler does not support the \verb'_Generic' -keyword, required for the polymorphic GraphBLAS functions. So for example, you -will need to use \verb'GrB_Matrix_free' instead of just \verb'GrB_free'. - -\item Variable-length arrays are not supported, so user-defined -types are limited to 1024 bytes in size. This can be changed by editing -\verb'GB_VLA_MAXSIZE' in \verb'Source/GB_compiler.h', and recompiling -SuiteSparse:GraphBLAS. - -\item AVX acceleration is not enabled. - -\item You must compile with 64-bit computing enabled (x64). Otherwise, a -compiler error will occur (\verb'InterlockedExchange64', \verb'InterlockdOr64' -and other methods will not be found). - -\end{itemize} - -If you use a recent \verb'gcc' or \verb'icx' compiler on Windows other than the -Microsoft Compiler (\verb'cl'), these limitations can be avoided. - -The following instructions apply to Windows 10, CMake 3.16, and -Visual Studio 2019, but may work for earlier versions. - -\begin{enumerate} - -\item Install CMake 3.16 or later, if not already installed. - See \url{https://cmake.org/} for details. - -\item Install Microsoft Visual Studio, if not already installed. - See \url{https://visualstudio.microsoft.com/} for details. - Version 2019 is preferred, but earlier versions may also work. - -\item Open a terminal window and type this in the - \verb'GraphBLAS/build' folder: - - \vspace{-0.1in} - {\small - \begin{verbatim} - cmake .. \end{verbatim} } - \vspace{-0.1in} - - Alternatively, use the \verb'cmake' gui program to configure - the cmake build system for GraphBLAS. - -\item The \verb'cmake' command generates many files in - \verb'GraphBLAS/build', and the file \verb'graphblas.sln' in - particular. Open the generated \verb'graphblas.sln' file in Visual Studio. - -\item Optionally: right-click \verb'graphblas' in the left panel (Solution - Explorer) and select properties; then navigate to \verb'Configuration' - \verb'Properties', \verb'C/C++', \verb'General' and change the parameter - \verb'Multiprocessor Compilation' to \verb'Yes (/MP)'. Click \verb'OK'. - This will significantly speed up the compilation of GraphBLAS. - -\item Select the \verb'Build' menu item at the top of the window and - select \verb'Build Solution'. This should create a folder called - \verb'Release' and place the compiled \verb'graphblas.dll', - \verb'graphblas.lib', and \verb'graphblas.exp' files there. Please be - patient; some files may take a while to compile and sometimes may appear to - be stalled. Just wait. - -\item Alternatively, instead of opening Visual Studio, - type this command in the terminal window while in the \verb'build' folder: - {\small - \begin{verbatim} - cmake --build . --config Release - \end{verbatim}} - -\item Add the \verb'GraphBLAS/build/Release' folder to the Windows System path: - - \begin{itemize} - \item Open the \verb'Start Menu' and type \verb'Control Panel'. - \item Select the \verb'Control Panel' app. - \item When the app opens, select \verb'System and Security'. - \item Under \verb'System and Security', select \verb'System'. - \item From the top left side of the \verb'System' window, select - \verb'Advanced System Settings'. You may have to authenticate - at this step. - If you cannot authenticate, try setting the User Environment Variables - instead. - \item The \verb'Systems Properties' window should appear with the - \verb'Advanced' tab selected; - select \verb'Environment Variables'. - \item The \verb'Environment Variables' window displays 2 sections, one for - \verb'User' variables and the other for \verb'System' variables. Under - the \verb'Systems' variable section, scroll to and select \verb'Path', - then select \verb'Edit'. A editor window appears allowing to add, - modify, delete or re-order the parts of the \verb'Path'. - \item Add the full path of the \verb'GraphBLAS\build\Release' folder - (typically starting with \verb'C:\Users\you\'..., where \verb'you' is - your Windows username) to the \verb'Path'. - To use the MATLAB interface, add - the full path of the \verb'GraphBLAS\GraphBLAS\build\Release' folder - as well. - \item If the above steps do not work, you can instead copy the - \verb'graphblas.*' files from \verb'GraphBLAS\build\Release' into any - existing folder listed in your \verb'Path'. - \end{itemize} - -\item The \verb'GraphBLAS/Include/GraphBLAS.h' file must be included in user - applications via \verb'#include "GraphBLAS.h"'. This is already done for - you in the MATLAB/Octave interface discussed in the next section. - -\end{enumerate} - -%---------------------------------------- -\subsubsection{Mac using clang} -\label{mac_openmp} -%---------------------------------------- - -To use OpenMP with clang on the Mac, try installing it from the - \url{https://mac.r-project.org/openmp/} project. -Be sure to check that page for the OpenMP version -that matches your version of Apple Xcode. -For example, if using Xcode 13.3 to 13.4.1, use: - - {\scriptsize - \begin{verbatim} - curl -O https://mac.r-project.org/openmp/openmp-13.0.0-darwin21-Release.tar.gz - sudo tar fvxz openmp-13.0.0-darwin21-Release.tar.gz -C / - \end{verbatim} } - -These commands will install universal binaries (ARM and x86) for -\verb'libomp.dylib', and the following files: - - {\scriptsize - \begin{verbatim} - /usr/local/lib/libomp.dylib - /usr/local/include/ompt.h - /usr/local/include/omp.h - /usr/local/include/omp-tools.h - \end{verbatim} } - -Once you do this, the GraphBLAS cmake build system should find this copy of -OpenMP for clang. - -%---------------------------------------- -\subsubsection{Linking issues after installation} -%---------------------------------------- - -My Linux distro (Ubuntu 18.04) includes a copy of \verb'libgraphblas.so.1', -which is SuiteSparse:GraphBLAS v1.1.2. After installing SuiteSparse:GraphBLAS -in \verb'/usr/local/lib' (with \verb'sudo make install'), compiling a simple -stand-alone program links against \verb'libgraphblas.so.1' instead of the -latest version, while at the same time accessing the latest version of the -include file as \verb'/usr/local/include/GraphBLAS.h'. This command fails: - - {\small - \begin{verbatim} - gcc prog.c -lgraphblas \end{verbatim} } - -Revising my \verb'LD_LIBRARY_PATH' to put \verb'/usr/local/lib' first in the -library directory order didn't help. If you encounter this problem, try one of -the following options (all four work for me, and link against the proper -version, \verb'/usr/local/lib/libgraphblas.so.9.2.0' for example): - - {\small - \begin{verbatim} - gcc prog.c -l:libgraphblas.so.9 - gcc prog.c -l:libgraphblas.so.9.2.0 - gcc prog.c /usr/local/lib/libgraphblas.so - gcc prog.c -Wl,-v -L/usr/local/lib -lgraphblas \end{verbatim} } - -This \verb'prog.c' test program is a trivial one, which works in v1.0 and -later: - - {\small - \begin{verbatim} - #include - int main (void) - { - GrB_init (GrB_NONBLOCKING) ; - GrB_finalize ( ) ; - } \end{verbatim} } - -Compile the program above, then use this command to ensure -\verb'libgraphblas.so.9' appears: - - {\small - \begin{verbatim} - ldd a.out \end{verbatim} } - -%---------------------------------------- -\subsubsection{Running the tests} -%---------------------------------------- - -To run a short test, type \verb'make demo' at the top-level \verb'GraphBLAS' -folder. This will run all the demos in \verb'GraphBLAS/Demos'. MATLAB is not -required. - -To perform the extensive tests in the \verb'Test' folder, and the statement -coverage tests in \verb'Tcov', MATLAB R2018a or later is required. See the -\verb'README.txt' files in those two folders for instructions on how to run the -tests. The tests in the \verb'Test' folder have been ported to MATLAB on -Linux, MacOS, and Windows. The \verb'Tcov' tests do not work on Windows. The -MATLAB interface test (\verb'gbtest') works on all platforms; see the -\verb'GraphBLAS/GraphBLAS' folder for more details. - -%---------------------------------------- -\subsubsection{Cleaning up} -%---------------------------------------- - -To remove all compiled files, type \verb'make' \verb'distclean' in the top-level -GraphBLAS folder. - -%------------------------------------------------------------------------------- -\section{Release Notes} -%------------------------------------------------------------------------------- - -\begin{itemize} - -\item Feb 20, 2025: version 9.4.5 - - \begin{itemize} - \item (59) bug fix: the \verb'GxB_NO_INT32' and \verb'GxB_NOT_INT64' flags - in \verb'GB_control.h' did not completely remove some of the INT32 and - INT64 factory kernels. Caught by Erik Welch, NVIDIA. - - \item workaround for an AppleClang compiler bug: On the Mac, the - \verb'Source/mask/GB_masker.c' file - triggers a bug in AppleClang 16.0.0 with -O3 in (MacOS 14.6.1 (23G93), - Xcode 16.2, Apple clang version 16.0.0, clang-1600.0.26.6). It also - fails in MacOS 15.2 (Target: arm64-apple-darwin23.6.0). The bug is - triggered by these tests in LAGraph (v1.2 branch, unreleased, Jan 4, - 2025): - \begin{verbatim} - 39 - LAGraphX_BF (SIGTRAP) - 40 - LAGraphX_Coarsen_Matching (Failed) - 41 - LAGraphX_FastGraphletTransform (SIGTRAP) - 49 - LAGraphX_PageRankGX (SIGTRAP) - 54 - LAGraphX_SquareClustering (SIGTRAP) - 61 - LAGraphX_msf (Failed) - \end{verbatim} - When using clang, optimization is turned off for this file. This has - no impact on performance since \verb'GB_masker.c' is very simple, - consisting of a single sequence of calls to other methods. - \end{itemize} - -\item Feb 17, 2024: version 9.4.4 - - \begin{itemize} - \item (58) bug fix: semirings with user-defined monoids and the \verb'GrB_ONEB' or - \verb'GxB_PAIR' operators caused a JIT compiler error. Caught by Gabe Gomez. - \item (57) bug fix: GraphBLAS.h header: remove duplicate definitions of - \verb'GxB_MAX_FIRST_*' semirings (incompletely moved to 'historical' section - in 9.4.2). - \end{itemize} - -\item Nov 20, 2024: version 9.4.2 - - \begin{itemize} - \item clarified User Guide: regarding when the hyper-hash is built - \item JIT: reduced JIT kernel encodings - \item (also includes the updates from 9.4.0.beta and 9.4.1.beta listed below). - \end{itemize} - -\item Nov 15, 2024: version 9.4.1 (only released as BETA) - - \begin{itemize} - \item More JIT kernels: all JIT kernels for \verb'GrB_assign', - \verb'GxB_subassign', \verb'GrB_extract', \verb'GxB_sort' - \verb'GrB_kronecker', the stand-alone mask phase (an internal method that - computes $\bf C \langle M \rangle = Z$), and utilities have been created. - All kernels formerly tagged in the code as \verb'JIT: needed' are now - finished. - \item - removed Factory kernels for: types int8 and uint8, and semirings: - max\_min, max\_plus, max\_times, min\_max, min\_times, plus\_min, - plus\_max, - non-Boolean land/lor/lxor/lxnor, and integer times\_first/second, - to reduce size of compiled library. - JIT kernels will be used instead for these types and semirings. - \item \verb'GxB_IndexBinaryOp': finalized and named as \verb'GxB_*'. - \end{itemize} - -\item Oct 15, 2024: version 9.4.0 (only released as BETA) - - \begin{itemize} - \item new operator and associated methods: - added the draft \verb'G*B_IndexBinaryOp'. - \item JIT error-handling behavior changed: if a compiler error occurs in - the JIT, \verb'GxB_JIT_ERROR' is now returned. Previously, GraphBLAS - would fall back to a generic method if such an error occurred. - \end{itemize} - -\item Aug 12, 2024: version 9.3.1 - - \begin{itemize} - \item (56) bug fix: wrong type for fgetc return value in JITpackage; leads - to infinite loop on some systems when building GraphBLAS. - \end{itemize} - -\item Aug 2, 2024: version 9.3.0 - - \begin{itemize} - \item code restructuring: Source folder split into many subfolders, and - some files and internal functions renamed. No visible external change. - \item (55) bug fix: \verb'GrB_apply' with user-defined index-unary op and - generic kernel. - \item (54) bug fix: reducing a huge iso full matrix to a scalar resulted in - integer overflow if nrows*ncols was larger than about $2^{60}$. - \item reduced size of compiled library: \verb'int16' and \verb'uint16' - types and operators for FactoryKernels are disabled in - \verb'GB_control.h'. The JIT will always be used instead. - \end{itemize} - -\item May 22, 2024: version 9.2.0 - - \begin{itemize} - \item Added \verb'graphblas_install.m' for a simpler method of compiling - the MATLAB/Octave interface for GraphBLAS. - \item JIT: sanitizing the JIT cache path, better burble for compiler errors. - \item \verb'GrB_get/GrB_set': better handling of concurrent get/set between - different user threads. - \end{itemize} - -\item Mar 22, 2024: version 9.1.0 - - \begin{itemize} - \item minor updates to build system - \item C11 complex type detection: this is now detected and configured by - cmake, instead of using an \verb'#if' ... in the GraphBLAS.h header. - This change was required to port GraphBLAS to the clang-cl compiler - on Windows when it simulates the MSVC compiler. Also added a new - feature (thus the minor version update to 9.1.0): - \verb'GxB_HAVE_COMPLEX*' to - GraphBLAS.h to indicate which kind of complex data types are available - in C11 or MSVC. Contributed by Markus M\"{u}tzel. - \item (53) bug fix: eWiseAdd \verb'C=A+B' when \verb'M', \verb'A', - and \verb'B' are all hypersparse; access to \verb'M' was incorrect - (also affects \verb'C+=T' for any operation, if \verb'M' and - \verb'T' are both hypersparse). - \end{itemize} - -\item Mar 1, 2024: version 9.0.3 - - \begin{itemize} - \item (52) performance bug fix: JIT kernels since v8.3.1 were not compiled - with OpenMP. - \end{itemize} - -\item Feb 26, 2024: version 9.0.2 - - \begin{itemize} - \item GraphBLAS/Makefile \verb"make static" was incorrect. - \end{itemize} - -\item Jan 20, 2024: version 9.0.1 - - \begin{itemize} - \item minor updates to build system - \end{itemize} - -\item Version 9.0.0, Jan 10, 2024 - - \begin{itemize} - \item \verb'GrB_get/GrB_set': new functions from the v2.1 C API. - \item \verb'GrB_Type_new', \verb'GrB_UnaryOp_new', - \verb'GrB_IndexUnaryOp_new': no longer macros, since \verb'GrB_set' can - be used to set the names of the operators. These methods no longer - extract the name, so the default name is now the empty string. This is - because \verb'GrB_get/set' can only set these names once. This is a - non-compatible change of behavior for these 3 methods, so - SuiteSparse:GraphBLAS must become v9.0.0. - \item historical methods: many methods are replaced by \verb'GrB_get' and - \verb'GrB_set'. They remain in SuiteSparse:GraphBLAS but have been - declared historical. Terse prototypes exist in GraphBLAS.h, and any - discussion is removed from the User Guide: \verb'GxB_get', - \verb'GxB_set', and the methods they call, and many more. Use - \verb'GrB_get/set' in place those methods, and for: - \verb'GxB_*type_name', \verb'GxB_*type', \verb'GxB_Monoid_operator', - \verb'GxB_Monoid_identity', \verb'GxB_Monoid_terminal', - \verb'GxB_Semiring_add', \verb'GxB_Semiring_multiply'. Use \newline - \verb'GrB_STORAGE_ORIENTATION_HINT' in place of \verb'GxB_FORMAT'. - \item \verb'hyper_hash': constructed only if the number of non-empty - vectors in a hypersparse matrix is large ($> 1024$, by default). - \item minor updates to build system: \verb'*.pc' files for \verb'pkgconfig' - \end{itemize} - -\item Dec 30, 2023: version 8.3.1 - - \begin{itemize} - \item remove \verb'#undef I' from \verb'GraphBLAS.h', so as not to conflict - with the definition of \verb'I' from \verb'complex.h'. - \item major change to build system: by Markus M\"{u}tzel - \end{itemize} - -\item Oct 7, 2023: version 8.2.1 - - \begin{itemize} - \item (49) bug fix: \verb'GrB_mxm' saxpy4 and saxpy5 had incorrectly handling of - typecasting in v8.0.0 to v8.2.0 (caught by Erik Welch) - \item cross-compiler support: replace \verb'check_c_source_runs' with \verb'_compiles' - for GraphBLAS and SuiteSparse\_config, and remove check for - \verb'getenv("HOME")'. - \item cmake update: add "None" build type, from Antonio Rojas, for Arch Linux - \end{itemize} - -\item Version 8.2.0, Sept 8, 2023 - - \begin{itemize} - \item cmake updates: \verb'SuiteSparse::' namespace by Markus M\"{u}tzel. - \end{itemize} - -\item Version 8.0.2, June 16, 2023 - - \begin{itemize} - \item added \verb'-DJITINIT=option': use \verb'-DJITINIT' to set the - initial state of the \verb'GxB_JIT_C_CONTROL' (4:on, 3:load, 2:run, - 1:pause, 0:off). The default is 4 (on) if the JIT is enabled, or 2 - (run) if \verb'-DNJIT=1' is set. - \item xxHash: upgraded to latest version as of June 16, 2023 - \end{itemize} - -\item Version 8.0.1, May 27, 2023 - - \begin{itemize} - \item (48) bug fix: \verb'GrB_*_nvals' - returned \verb'UINT64_MAX' ('infinity') for a - \verb'GrB_Vector' of size n-by-$2^{60}$; it should return $2^{60}$. - Caught by Erik Welch, NVIDIA. - \item added \verb'GxB_Context_error' and \verb'GxB_Context_wait' - \item \verb'C++': changed complex typedefs for \verb'C++' that - include GraphBLAS.h. Update from Markus M\"{u}tzel. - \end{itemize} - -\item Version 8.0.0 (May 18, 2023) - - \begin{itemize} - \item version 8: This version is a major SO version increase, since - it removes a few minor user-visible features from - SuiteSparse:GraphBLAS: the \verb'GrB_Descriptor' no longer supports - threading control, and some features of the \verb'GxB_SelectOp' are - removed (see below). Enum values have been changed for compatibility - with the upcoming \verb'GrB_set/get' features in the V2.1 C API. - \item The JIT: GraphBLAS v8.0.0 includes a JIT for the CPU kernels, - which can compile kernels at run-time. Added \verb'GxB_set/get' - options and environment variables to control the JIT. The - \verb'GxB_*Op_new' methods can accept NULL function pointers, if the - strings are provided, valid, and the JIT is enabled. - \item \verb'GxB_Type_new': the size of the type can be given as zero, - in which case the size is determined via a JIT kernel. - \item \verb'GxB_UnaryOp_new', \verb'GxB_BinaryOp_new', and - \verb'GxB_IndexUnaryOp_new': the function pointer can be given as - \verb'NULL', in which case the function is created by the JIT. - \item math kernels: revised for CUDA JIT. More accurate complex - floating-point for Mac OS on Apple Silicon. - \item \verb'Demo/wildtype_demo': change to double so that CPU and GPU - versions compute the same result. - \item \verb'GxB_get': can return malloc/calloc/realloc/free - \item \verb'GxB_Context': - an object for controlling computational resources: - number of OpenMP threads, the chunk factor, and (draft) GPU id. - \item \verb'GrB_Descriptor': - removed ability to control the number of OpenMP threads from the - descriptor (a rarely used feature). Replaced with the - \verb'GxB_Context' object. - \item \verb'GxB_SelectOp': GraphBLAS no longer supports - user-defined \verb'GxB_SelectOps'. Use a \verb'GrB_IndexUnaryOp' - instead. The \verb'GxB_SelectOp_new' and - \verb'GxB_SelectOp_free' functions are removed entirely. - The built-in \verb'GxB_SelectOps', \verb'GxB_Matrix_select', - \verb'GxB_Vector_select', and \verb'GxB_select' still work. However, - the \verb'GxB_EQ_THUNK', \verb'GxB_EQ_ZERO', \verb'GxB_NE_THUNK', and - \verb'GxB_NE_ZERO' operators no longer work on user-defined types, - as they did in v7.4.4 and earlier. - Create a user-defined \verb'GrB_IndexUnaryOp' to compute these - operations instead, and use \verb'GrB_select'. - \item \verb'alternative/Makefile': removed; not compatible with the JIT. - \item \verb'zstd': upgraded to v1.5.5 (Apr 4, 2023) - \end{itemize} - -\item Version 7.4.4 (Mar 25, 2023) - - \begin{itemize} - \item (47) bug fix: OpenMP atomics require \verb'seq_cst' on the ARM. - Revised \verb'GB_atomics.h' accordingly, and added them for all - architectures (caught by G{\'{a}}bor Sz{\'{a}}rnyas). - \end{itemize} - -\item Version 7.4.3 (Jan 20, 2023) - - \begin{itemize} - \item debug: turned on in \verb'GrB_Matrix_removeElement' by mistake. - \end{itemize} - -\item Version 7.4.2 (Jan 17, 2023) - - \begin{itemize} - \item minor change to build system: for SuiteSparse v7.0.0. - \item deprecation notice: in GraphBLAS v8.0.0, the ability to set the - number of threads, and chunk size, in the descriptor will be removed. - It still appears in v7.x, but will be replaced by a Context object - in v8.0.0. - \end{itemize} - -\item Version 7.4.1 (Dec 29, 2022) - - \begin{itemize} - \item global free pool: disabled. Benefit for single-thread user - applications was modest, and it causes too much contention in a - critical section when the user application is multi-threaded. - \item \verb'GrB_mxm': revised task creation heuristics for - sparse-times-sparse for better performance. - \end{itemize} - -\item Version 7.4.0 (Dec 23, 2022) - - \begin{itemize} - \item add non-\verb'va_arg' methods: \verb'va_arg'-based \verb'GxB_get/set' - methods are C11 but cause issues for cffi in Python. As a - temporary workaround, new methods have been added that do not use - \verb'va_arg'. The existing \verb'GxB_get/set' methods are not - changed. The new methods are not in the user guide, since all of the - \verb'GxB_get/set' methods will be superceded with \verb'GrB_get/set' - in the v2.1 C API. At that point, all \verb'GxB_get/set' methods will - become historical (kept, not deprecated, but removed from the user - guide). - \end{itemize} - -\item Version 7.3.3 (Dec 9, 2022) - - \begin{itemize} - \item \verb'stdatomic.h': using \verb'#include ' and - \newline - \verb'atomic_compare_exchange_weak' - instead of GCC/clang/icx \verb'__atomic_*' variants. - Added \verb'-latomic' if required. - \item chunk factor for C=A*B (saxpy3 method): - revised for non-builtin-semirings - \end{itemize} - -\item Version 7.3.2 (Nov 12, 2022) - - \begin{packed_itemize} - \item \verb'cmake_modules': minor revision to build system, to sync - with SuiteSparse v6.0.0 - \item Added option \verb'-DNOPENMP=1' to disable OpenMP parallelism. - \end{packed_itemize} - -\item Version 7.3.1 (Oct 21, 2022) - - \begin{packed_itemize} - \item workaround for a bug in the Microsoft Visual Studio Compiler, - MSC 19.2x (in vs2019). - \end{packed_itemize} - -\item Version 7.3.0 (Oct 14, 2022) - - \begin{packed_itemize} - \item \verb'GrB_Matrix': changes to the internal data structure - \item minor internal changes: \verb'A->nvals' for sparse/hypersparse - \item more significant changes: added hyper-hash for - hypersparse case, speeds up many operations on hypersparse matrices. - Based on \cite{Green19}. - \item \verb'GxB_unpack_HyperHash' and \verb'GxB_pack_HyperHash': - to pack/unpack the hyper-hash - \item \verb'@GrB' MATLAB/Octave interface: changed license to Apache-2.0. - \item MATLAB library: renamed to \verb'libgraphblas_matlab.so' - \item performance: faster \verb'C=A*B' when using a single thread and - \verb'B' is a sparse vector with many entries. - \end{packed_itemize} - -\item Version 7.2.0 (Aug 8, 2022) - - \begin{packed_itemize} - \item added ZSTD as a compression option for serialize/deserialize: - Version 1.5.3 by Yann Collet, - \url{https://github.com/facebook/zstd.git}. - Copyright (c) 2016-present, Facebook, Inc. All rights reserved. - Included in SuiteSparse:GraphBLAS via its BSD-3-clause license. - The default method is now ZSTD, level 1. - \item \verb'GxB_Matrix_reshape*' added. - \item MATLAB interface: \verb'reshape', \verb'C(:)=A', \verb'C=A(:)' are - faster. Better error messages. - \end{packed_itemize} - -\item Version 7.1.2 (July 8, 2022) - - \begin{packed_itemize} - \item MATLAB interface: linear indexing added for C(:)=A, C=A(:), and - single-output I=find(C). Faster bandwidth, istriu, istril, - isbanded, isdiag. C(I,J)=A can now grow the size of A. - \end{packed_itemize} - -\item Version 7.1.1 (June 3, 2022) - - \begin{packed_itemize} - \item minor updates to documentation and error messages - \item MATLAB interface: minor revision of GrB.deserialize - \end{packed_itemize} - -\item Version 7.1.0 (May 20, 2022) - - \begin{packed_itemize} - \item added cube root: \verb'GxB_CBRT_FP32' and \verb'GxB_CBRT_FP64' - unary operators - \item added \verb'GxB_Matrix_isStoredElement' - and \verb'GxB_Vector_isStoredElement' - \end{packed_itemize} - -\item Version 7.0.4 (Apr 25, 2022) - - \begin{packed_itemize} - \item (46) bug fix: user-defined type size was incorrectly limited - to 128 bytes. Caught by Erik Welch. - \end{packed_itemize} - -\item Version 7.0.3 (Apr 8, 2022) - - \begin{packed_itemize} - \item faster transpose when using 2 threads - \end{packed_itemize} - -\item Version 7.0.2 (Apr 5, 2022) - - \begin{packed_itemize} - \item (45) bug fix: vector iterator was broken for iterating across a - vector in bitmap format. Caught by Erik Welch. - \end{packed_itemize} - -\item Version 7.0.1 (Apr 3, 2022) - - \begin{packed_itemize} - \item added revised ACM TOMS submission to the Doc folder - \end{packed_itemize} - -\item Version 7.0.0 (Apr 2, 2022) - - \begin{packed_itemize} - \item (44) spec bug: \verb'GrB_Matrix_diag' - was implemented in v5.2.x and v6.x with the wrong signature. - This fix requires the major release to change, from v6.x to v7.x. - \item (43) performance bug fix for \verb'GrB_mxm': - auto selection for saxpy method (Hash vs Gustavson) revised. - \item \verb'GrB_assign': better performance for \verb'C(i,j)=scalar' and - \verb'C(i,j)+=scalar' when \verb'i' and \verb'j' have length 1 (scalar - assigment with no scalar expansion). - \end{packed_itemize} - -\item Version 6.2.5 (Mar 14, 2022) - - \begin{packed_itemize} - \item For SuiteSparse v5.11.0. - \end{packed_itemize} - -\item Version 6.2.4 (Mar 8, 2022) - - \begin{packed_itemize} - \item (42) bug fix: \verb'GrB_mxm' with 0-by-0 iso full matrices. - Caught by Henry Amuasi in the Python - grblas interface, then triaged and isolated by Erik Welch. - \end{packed_itemize} - -\item Version 6.2.3 (Mar 5, 2022) - - \begin{packed_itemize} - \item minor update to documentation in \verb'GrB.build': - no change to any code - \end{packed_itemize} - -\item Version 6.2.2 (Feb 28, 2022) - - \begin{packed_itemize} - \item revised output of \verb'GxB_*_sort' to return newly created matrices - C and P as full or bitmap matrices, as appropriate, instead of - sparse/hypersparse, following their sparsity control settings. - \end{packed_itemize} - -\item Version 6.2.1 (Feb 14, 2022) - - \begin{packed_itemize} - \item (41) bug fix: \verb'GxB_Iterator_get' used \verb'(void *) + size' - arithmetic - \end{packed_itemize} - -\item Version 6.2.0 (Feb 14, 2022) - - \begin{packed_itemize} - \item added the \verb'GxB_Iterator' object and its methods. See - Section~\ref{iter}. - \item \verb'@GrB' interface: revised sparse-times-full rule for the - conventional semiring (the syntax \verb'C=A*B'), so that - sparse-times-full results in \verb'C' as full, - but hypersparse-times-sparse is not full - (typically sparse or hypersparse). - \end{packed_itemize} - -\item Version 6.1.4 (Jan 12, 2022) - - \begin{packed_itemize} - \item added Section~\ref{perf} to User Guide: how to get the best - performance out of algorithms based on GraphBLAS. - \item \verb'cpu_features': no longer built as a separate library, - but built directly into \verb'libgraphblas.so' and - \verb'libgraphblas.a'. Added compile-time flags to - optionally disable the use of \verb'cpu_features' completely. - \item Octave 7: port to Apple Silicon (thanks to - G{\'{a}}bor Sz{\'{a}}rnyas). - \item min/max monoids: real case (FP32 and FP64) no longer terminal - \item \verb'@GrB' interface: overloaded \verb'C=A*B' syntax where one - matrix is full always results in a full matrix \verb'C'. - \item Faster \verb'C=A*B' for sparse-times-full and full-times-sparse - for \verb'@GrB' interface. - \end{packed_itemize} - -\item Version 6.1.3 (Jan 1, 2022) - - \begin{packed_itemize} - \item performance: task creation for \verb'GrB_mxm' - had a minor flaw (results were correct but parallelism suffered). - Performance improvement of up to 10x when nnz(A)<=Z' not returning \verb'C' - as iso if \verb'Z 'iso and \verb'C' initially - empty. Caught by Erik Welch, Anaconda. - \item performance improvements: \verb'C=A*B': sparse/hyper times - bitmap/full, and visa versa, including \verb'C += A*B' when \verb'C' is - full. - \end{packed_itemize} - -\item Version 5.1.10 (Oct 27, 2021) - - \begin{packed_itemize} - \item (35) bug fix: \verb'GB_selector'; \verb'A->plen' and \verb'C->plen' - not updated correctly. Caught by Jeffry Lovitz, Redis. - \end{packed_itemize} - -\item Version 5.1.9 (Oct 26, 2021) - - \begin{packed_itemize} - \item (34) bug fix: in-place test incorrect for \verb"C+=A'*B" using dot4 - \item (33) bug fix: disable free pool if OpenMP not available - \end{packed_itemize} - -\item Version 5.1.8 (Oct 5, 2021) - - \begin{packed_itemize} - \item (32) bug fix: C=A*B when A is sparse and B is iso and bitmap. - Caught by Mark Blanco, CMU. - \end{packed_itemize} - -\item Version 5.1.7 (Aug 23, 2021) - - \begin{packed_itemize} - \item (31) bug fix: \verb'GrB_apply', when done in-place and matrix starts - non-iso and becomes iso, gave the wrong iso result. - Caught by Fabian Murariu. - \end{packed_itemize} - -\item Version 5.1.6 (Aug 16, 2021) - - \begin{packed_itemize} - \item one-line change to \verb'C=A*B': faster symbolic analysis when a - vector \verb'C(:,j)' is dense (for CSC) or \verb'C(i,:)' for CSR. - \end{packed_itemize} - -\item Version 5.1.5 (July 15, 2021) - - \begin{packed_itemize} - \item submission to ACM Transactions on Mathematical Software as - a Collected Algorithm of the ACM. - \end{packed_itemize} - -\item Version 5.1.4 (July 6, 2021) - - \begin{packed_itemize} - \item faster Octave interface. Octave v7 or later is required. - \item (30) bug fix: 1-based printing not enabled for pending tuples. - Caught by Will Kimmerer, while working on the Julia interface. - \end{packed_itemize} - -\item Version 5.1.3 (July 3, 2021) - - \begin{packed_itemize} - \item added \verb'GxB_Matrix_iso' and \verb'GxB_Vector_iso': - to query if a matrix or vector is held as iso-valued - \item (29) bug fix: \verb'Matrix_pack_*R' into a matrix previously held by - column, or \verb'Matrix_pack*C' into a matrix by row, would flip the - dimensions. - Caught by Erik Welch, Anaconda. - \item (28) bug fix: \verb'kron(A,B)' with iso input matrices - \verb'A' and \verb'B' fixed. - Caught by Michel Pelletier, Graphegon. - \item (27) bug fix: v5.1.0 had a wrong version of a file; posted by mistake. - Caught by Michel Pelletier, Graphegon. - \end{packed_itemize} - -\item Version 5.1.2 (June 30, 2021) - - \begin{packed_itemize} - \item iso matrices added: these are matrices and vectors whose - values in the sparsity pattern are all the same. This is an internal - change to the opaque data structures of the \verb'GrB_Matrix' and - \verb'GrB_Vector' with very little change to the API. - \item added \verb'GxB_Matrix_build_Scalar' - and \verb'GxB_Vector_build_Scalar', - which always build iso matrices and vectors. - \item import/export methods can now import/export iso matrices and vectors. - \item added \verb'GrB.argmin/argmax' to MATLAB/Octave interface - \item added \verb'GxB_*_pack/unpack' methods in place of - import/export. - \item added \verb'GxB_PRINT_1BASED' to the global settings. - \item added \verb'GxB_*_memoryUsage' - \item port to Octave: \verb'gbmake' and \verb'gbtest' - work in Octave7 to build and test - the \verb'@GrB' interface to GraphBLAS. Octave 7.0.0 is required. - \end{packed_itemize} - -\item Version 5.0.6 (May 24, 2021) - - \begin{packed_itemize} - \item BFS and triangle counting demos removed from GraphBLAS/Demo: - see LAGraph for these algorithms. Eventually, all of GraphBLAS/Demo - will be deleted, once LAGraph includes all the methods included there. - \end{packed_itemize} - -\item Version 5.0.5 (May 17, 2021) - - \begin{packed_itemize} - \item (26) performance bug fix: reduce-to-vector where \verb'A' is - hypersparse CSR with a transposed descriptor (or CSC with no - transpose), and some cases for \verb'GrB_mxm/mxv/vxm' when computing - \verb'C=A*B' with A hypersparse CSC and \verb'B' bitmap/full (or - \verb'A' bitmap/full and \verb'B' hypersparse CSR), the wrong internal - method was being selected via the auto-selection strategy, resulting in - a significant slowdown in some cases. - \end{packed_itemize} - -\item Version 5.0.4 (May 13, 2021) - - \begin{packed_itemize} - \item \verb'@GrB' MATLAB/Octave interface: changed license - to GNU General Public License v3.0 or later. - It was licensed under Apache-2.0 in Version 5.0.3 and earlier. - Changed back to Apache-2.0 for Version 7.3.0; see above. - \end{packed_itemize} - -\item Version 5.0.3 (May 12, 2021) - - \begin{packed_itemize} - \item (25) bug fix: disabling \verb'ANY_PAIR' semirings by editing - \verb'Source/GB_control.h' would cause a segfault if those disabled - semirings were used. - \item demos are no longer built by default - \item (24) bug fix: new functions in v5.0.2 not declared as \verb'extern' - in \verb'GraphBLAS.h'. - \item \verb'GrB_Matrix_reduce_BinaryOp' reinstated from v4.0.3; - same limit on built-in ops that correspond to known monoids. - \end{packed_itemize} - -\item Version 5.0.2 (May 5, 2021) - - \begin{packed_itemize} - \item (23) bug fix: \verb'GrB_Matrix_apply_BinaryOp1st' and \verb'2nd' - were using the - wrong descriptors for \verb'GrB_INP0' and \verb'GrB_INP1'. - Caught by Erik Welch, Anaconda. - \item memory pool added for faster allocation/free of small blocks - \item \verb'@GrB' interface ported to MATLAB R2021a. - \item \verb'GxB_PRINTF' and \verb'GxB_FLUSH' global options added. - \item \verb'GxB_Matrix_diag': construct a diagonal matrix from a vector - \item \verb'GxB_Vector_diag': extract a diagonal from a matrix - \item \verb'concat/split': methods to concatenate and split matrices. - \item \verb'import/export': - size of arrays now in bytes, not entries. This change - is required for better internal memory management, and it is not - backward compatible with the \verb'GxB*import/export' functions in v4.0. - A new parameter, \verb'is_uniform', has been added to all import/export - methods, which indicates that the matrix values are all the same. - \item (22) bug fix: SIMD vectorization was missing - \verb'reduction(+,task_cnvals)' in - \verb'GB_dense_subassign_06d_template.c'. Caught by Jeff Huang, Texas - A\&M, with his software package for race-condition detection. - \item \verb'GrB_Matrix_reduce_BinaryOp': removed. Use a monoid instead, - with \verb'GrB_reduce' or \verb'GrB_Matrix_reduce_Monoid'. - \end{packed_itemize} - -\item Version 4.0.3 (Jan 19, 2021) - - \begin{packed_itemize} - \item faster min/max monoids - \item \verb'G=GrB(G)' converts \verb'G' from v3 object to v4 - \end{packed_itemize} - -\item Version 4.0.2 (Jan 13, 2021) - - \begin{packed_itemize} - \item ability to load \verb'*.mat' files saved with the v3 \verb'GrB' - \end{packed_itemize} - -\item Version 4.0.1 (Jan 4, 2021) - - \begin{packed_itemize} - \item significant performance improvements: compared with v3.3.3, - up to 5x faster in breadth-first-search (using - \verb'LAGraph_bfs_parent2'), and 2x faster in - Betweenness-Centrality (using \verb'LAGraph_bc_batch5'). - \item \verb'GrB_wait(void)', with no inputs: removed - \item \verb'GrB_wait(&object)': polymorphic function added - \item \verb'GrB_*_nvals': no longer guarantees completion; - use \verb'GrB_wait(&object)' - or non-polymorphic \verb'GrB_*_wait (&object)' instead - \item \verb'GrB_error': now has two parameters: a string - (\verb'char **') and an object. - \item \verb'GrB_Matrix_reduce_BinaryOp' limited to built-in operators that - correspond to known monoids. - \item \verb'GrB_*_extractTuples': may return indices out of order - \item removed internal features: GBI iterator, slice and hyperslice matrices - \item bitmap/full matrices and vectors added - \item index-based operators and semirings: - \verb'GxB_FIRSTI_INT32' and related ops - \item jumbled matrices: sort left pending, like zombies and pending tuples - \item \verb'GxB_get/set': added \verb'GxB_SPARSITY_*' - (hyper, sparse, bitmap, or full) and \verb'GxB_BITMAP_SWITCH'. - \item \verb'GxB_HYPER': enum renamed to \verb'GxB_HYPER_SWITCH' - \item \verb'GxB*import/export': API modified - \item \verb'GxB_SelectOp': \verb'nrows' and \verb'ncols' removed - from function signature. - \item OpenMP tasking removed from mergesort and replaced with parallel - for loops. Just as fast on Linux/Mac; now the performance ports to - Windows. - \item \verb'GxB_BURBLE' added as a supported feature. This was an - undocumented feature of prior versions. - \item bug fix: \verb'A({lo,hi})=scalar' - \verb'A(lo:hi)=scalar' was OK - \end{packed_itemize} - -\item Version 3.3.3 (July 14, 2020). - Bug fix: \verb'w=A*u' with mask non-empty and u empty. - -\item Version 3.3.2 (July 3, 2020). Minor changes to build system. - -\item Version 3.3.1 (June 30, 2020). Bug fix to \verb'GrB_assign' and - \verb'GxB_subassign' when the assignment is simple (\verb'C=A') but - with typecasting. - -\item Version 3.3.0 (June 26, 2020). Compliant with V1.3 of the C API - (except that the polymorphic \verb'GrB_wait(&object)' doesn't appear yet; - it will appear in V4.0). - - Added complex types (\verb'GxB_FC32' and \verb'GxB_FC64'), many unary - operators, binary operators, monoids, and semirings. Added bitwise - operators, and their monoids and semirings. Added the predefined monoids - and semirings from the v1.3 specification. \verb'@GrB' interface: added complex - matrices and operators, and changed behavior of integer operations to more - closely match the behavior on built-in integer matrices. The rules for - typecasting large floating point values to integers has changed. The - specific object-based \verb'GrB_Matrix_wait', \verb'GrB_Vector_wait', etc, - functions have been added. The no-argument \verb'GrB_wait()' is - deprecated. Added \verb'GrB_getVersion', \verb'GrB_Matrix_resize', - \verb'GrB_Vector_resize', \verb'GrB_kronecker', \verb'GrB_*_wait', scalar - binding with binary operators for \verb'GrB_apply', \newline - \verb'GrB_Matrix_removeElement', and \verb'GrB_Vector_removeElement'. - -\item Version 3.2.0 (Feb 20, 2020). Faster \verb'GrB_mxm', \verb'GrB_mxv', and - \verb'GrB_vxm', and faster operations on dense matrices/vectors. Removed - compile-time user objects (\verb'GxB_*_define'), since these were not - compatible with the faster matrix operations. Added the \verb'ANY' and - \verb'PAIR' operators. Added the predefined descriptors, - \verb'GrB_DESC_*'. Added the structural mask option. Changed default - chunk size to 65,536. \verb'@GrB' interface modified: \verb'GrB.init' is - now optional. - -\item Version 3.1.2 (Dec, 2019). Changes to allow SuiteSparse:GraphBLAS - to be compiled with the Microsoft Visual Studio compiler. This compiler - does not support the \verb'_Generic' keyword, so the polymorphic functions - are not available. Use the equivalent non-polymorphic functions instead, - when compiling GraphBLAS with MS Visual Studio. In addition, - variable-length arrays are not supported, so user-defined types are limited - to 128 bytes in size. These changes have no effect if you have an C11 - compliant compiler. - - \verb'@GrB' interface modified: \verb'GrB.init' is now required. - -\item Version 3.1.0 (Oct 1, 2019). \verb'@GrB' interface added. See the - \newline \verb'GraphBLAS/GraphBLAS' folder for details and documentation, - and Section~\ref{octave}. - -\item Version 3.0 (July 26, 2019), with OpenMP parallelism. - -The version number is increased to 3.0, since -this version is not backward compatible with V2.x. The \verb'GxB_select' -operation changes; the \verb'Thunk' parameter was formerly a -\verb'const void *' pointer, and is now a \verb'GxB_Scalar'. A new parameter -is added to \verb'GxB_SelectOp_new', to define the expected type of -\verb'Thunk'. A new parameter is added to \verb'GxB_init', to specify whether -or not the user-provided memory management functions are thread safe. - -The remaining changes add new features, and are upward compatible with V2.x. -The major change is the addition of OpenMP parallelism. This addition has no -effect on the API, except that round-off errors can differ with the number of -threads used, for floating-point types. \verb'GxB_set' can optionally define -the number of threads to use (the default is \verb'omp_get_max_threads'). The -number of threads can also defined globally, and/or in the -\verb'GrB_Descriptor'. The \verb'RDIV' and \verb'RMINUS' operators are added, -which are defined as $f(x,y)=y/x$ and $f(x,y)=y-x$, respectively. Additional -options are added to \verb'GxB_get'. - -\item Version 2.3.3 (May 2019): Collected Algorithm of the ACM. -No changes from V2.3.2 other than the documentation. - -\item Version 2.3 (Feb 2019) improves the performance of many GraphBLAS -operations, including an early-exit for monoids. These changes have a -significant impact on breadth-first-search (a performance bug was also fixed in -the two BFS \verb'Demo' codes). The matrix and vector import/export functions -were added (Section~\ref{pack_unpack}), in support of the new LAGraph project -(\url{https://github.com/GraphBLAS/LAGraph}, see also Section~\ref{lagraph}). -LAGraph includes a push-pull BFS in GraphBLAS that is faster than two versions -in the \verb'Demo' folder. \verb'GxB_init' was added to allow the memory -manager functions (\verb'malloc', etc) to be specified. - -\item -Version 2.2 (Nov 2018) -adds user-defined objects at compile-time, via user \verb'*.m4' files placed in -\verb'GraphBLAS/User', which use the \verb'GxB_*_define' macros -(NOTE: feature removed in v3.2). -The default matrix format is now \verb'GxB_BY_ROW'. -Also added are the \verb'GxB_*print' methods for printing the contents of each -GraphBLAS object (Section~\ref{fprint}). PageRank demos have been added to -the \verb'Demos' folder. - -\item -Version 2.1 (Oct 2018) was -a major update with support for new matrix formats -(by row or column, and hypersparse matrices), and colon notation -(\verb'I=begin:end' or \verb'I=begin:inc:end'). Some graph algorithms are more -naturally expressed with matrices stored by row, and this version includes the -new \verb'GxB_BY_ROW' format. The default format in Version 2.1 and -prior versions is by column. -New extensions to GraphBLAS in this version include \verb'GxB_get', -\verb'GxB_set', and \verb'GxB_AxB_METHOD', \verb'GxB_RANGE', \verb'GxB_STRIDE', -and \verb'GxB_BACKWARDS', and their related definitions, described in -Sections~\ref{descriptor},~\ref{options},~and~\ref{colon}. - -\item -Version 2.0 (March 2018) addressed changes in the GraphBLAS C API -Specification and added \verb'GxB_kron' and \verb'GxB_resize'. - -\item -Version 1.1 (Dec 2017) primarily improved the performance. - -\item -Version 1.0 was released on Nov 25, 2017. -\end{itemize} - -%------------------------------------------------------------------------------- -\subsection{Regarding historical and deprecated functions and symbols} -%------------------------------------------------------------------------------- - -When a \verb'GxB*' function or symbol is added to the C API Specification with -a \verb'GrB*' name, the new \verb'GrB*' name should be used instead, if -possible. However, the old \verb'GxB*' name will be kept as long as possible -for historical reasons. Historical functions and symbols will not always be -documented here in the SuiteSparse:GraphBLAS User Guide, but they will be kept -in \verb'GraphbBLAS.h' and kept in good working order in the library. -Historical functions and symbols would only be removed in the very unlikely -case that they cause a serious conflict with future methods. - -The following methods have been fully deprecated and removed. The older -versions of \verb'GrB_wait' and \verb'GrB_error' methods have been removed -since they are incompatible with the latest versions, per the C API -Specification. The \verb'GxB_SelectOp_new' and \verb'GxB_SelectOp_free' -methods have been removed, and some of the built-in operators have been been -revised (specifically, the \verb'GxB_EQ_THUNK', \verb'GxB_EQ_ZERO', -\verb'GxB_NE_THUNK', and \verb'GxB_NE_ZERO' operators no longer work on -user-defined types). - -% \newpage -%------------------------------------------------------------------------------- -\section{Acknowledgments} -%------------------------------------------------------------------------------- - -I would like to thank Jeremy Kepner (MIT Lincoln Laboratory Supercomputing -Center), and the GraphBLAS API Committee: Ayd\i n Bulu\c{c} (Lawrence Berkeley -National Laboratory), Timothy G. Mattson (Intel Corporation) Scott McMillan -(Software Engineering Institute at Carnegie Mellon University), Jos\'e Moreira -(IBM Corporation), Carl Yang (UC Davis), and Benjamin Brock (UC Berkeley), for -creating the GraphBLAS specification and for patiently answering my many -questions while I was implementing it. - -I would like to thank Tim Mattson and Henry Gabb, Intel, Inc., for their -collaboration and for the support of Intel. - -I would like to thank Joe Eaton and Corey Nolet for their collaboration on the -CUDA kernels (still in progress), and for the support of NVIDIA. - -I would like to thank Pat Quillen for his -collaboration and for the support of MathWorks. - -I would like to thank John Eaton for his collaboration on the integration -with Octave 7. - -I would like to thank Michel Pelletier for his collaboration and work on the -pygraphblas interface, and Jim Kitchen and Erik Welch for their work on -Anaconda's python interface. - -I would like to thank Will Kimmerer for his collaboration and work on the -Julia interface. - -I would like to thank John Gilbert (UC Santa Barbara) for our many discussions -on GraphBLAS, and for our decades-long conversation and collaboration on sparse -matrix computations. - -I would like to thank S\'ebastien Villemot (Debian Developer, -\url{http://sebastien.villemot.name}) for helping me with various build issues -and other code issues with GraphBLAS (and all of SuiteSparse) for its packaging -in Debian Linux. - -I would like to thank G{\'{a}}bor Sz{\'{a}}rnyas for porting the \verb'@GrB' -interface to Octave 7 on Apple Silicon. - -I would like to thank Markus M\"{u}tzel -for his help in porting the updates -to GraphBLAS v7.4.1 and SuiteSparse v7.0.0 to Windows. - -I would like to thank Roi Lipman, Redis (\url{https://redislabs.com}), for -our many discussions on GraphBLAS and for enabling its use in RedisGraph -(\url{https://redislabs.com/redis-enterprise/technology/redisgraph/}), a graph -database module for Redis. Based on SuiteSparse:GraphBLAS, RedisGraph is up -600x faster than the fastest graph databases ({\footnotesize -\url{https://youtu.be/9h3Qco_x0QE} \newline -\url{https://redislabs.com/blog/new-redisgraph-1-0-achieves-600x-faster-performance-graph-databases/}}). - -SuiteSparse:GraphBLAS was developed with support from -NVIDIA, Intel, MIT Lincoln Lab, MathWorks, Redis, IBM, -the National Science Foundation (1514406, 1835499), and Julia Computing. - -%------------------------------------------------------------------------------- -\section{Additional Resources} -%------------------------------------------------------------------------------- - -See \url{http://graphblas.org} for the GraphBLAS community page. See -\url{https://github.com/GraphBLAS/GraphBLAS-Pointers} for an up-to-date list of -additional resources on GraphBLAS, maintained by G{\'{a}}bor Sz{\'{a}}rnyas. - -%------------------------------------------------------------------------------- -% References -%------------------------------------------------------------------------------- -{\footnotesize -\addcontentsline{toc}{section}{References} -\bibliographystyle{annotate} -\bibliography{GraphBLAS_UserGuide.bib} -} -\end{document} diff --git a/GraphBLAS/Doc/GraphBLAS_version.tex b/GraphBLAS/Doc/GraphBLAS_version.tex index 63faaa91f2..3e82a43eaf 100644 --- a/GraphBLAS/Doc/GraphBLAS_version.tex +++ b/GraphBLAS/Doc/GraphBLAS_version.tex @@ -1,5 +1,5 @@ % version of SuiteSparse:GraphBLAS \date{VERSION -9.4.5, -Feb 20, 2025} +10.0.0, +Mar 3, 2025} diff --git a/GraphBLAS/Doc/Makefile b/GraphBLAS/Doc/Makefile index 26b393ca65..0135593d19 100644 --- a/GraphBLAS/Doc/Makefile +++ b/GraphBLAS/Doc/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Doc/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- @@ -10,7 +10,80 @@ # creates the user guide GraphBLAS_UserGuide.pdf: GraphBLAS_UserGuide.tex GraphBLAS_UserGuide.bib \ - GraphBLAS_API_version.tex GraphBLAS_version.tex GrB_get_set.tex + GraphBLAS_API_version.tex GraphBLAS_version.tex Makefile \ + UserGuide/GrB_abstract.tex \ + UserGuide/GrB_acknowledgements.tex \ + UserGuide/GrB_colon.tex \ + UserGuide/GrB_concepts.tex \ + UserGuide/GrB_context.tex \ + UserGuide/GrB_examples.tex \ + UserGuide/GrB_get_set_BinaryOp.tex \ + UserGuide/GrB_get_set_Context.tex \ + UserGuide/GrB_get_set_Descriptor.tex \ + UserGuide/GrB_get_set_enum.tex \ + UserGuide/GrB_get_set_Global.tex \ + UserGuide/GrB_get_set_IndexBinaryOp.tex \ + UserGuide/GrB_get_set_IndexUnaryOp.tex \ + UserGuide/GrB_get_set_integers.tex \ + UserGuide/GrB_get_set_Matrix.tex \ + UserGuide/GrB_get_set_Monoid.tex \ + UserGuide/GrB_get_set_Scalar.tex \ + UserGuide/GrB_get_set_Semiring.tex \ + UserGuide/GrB_get_set_Serialize.tex \ + UserGuide/GrB_get_set.tex \ + UserGuide/GrB_get_set_Type.tex \ + UserGuide/GrB_get_set_UnaryOp.tex \ + UserGuide/GrB_get_set_Vector.tex \ + UserGuide/GrB_init.tex \ + UserGuide/GrB_installing.tex \ + UserGuide/GrB_interfaces.tex \ + UserGuide/GrB_intro.tex \ + UserGuide/GrB_iso.tex \ + UserGuide/GrB_iterator.tex \ + UserGuide/GrB_jit.tex \ + UserGuide/GrB_mask.tex \ + UserGuide/GrB_matlab_performance.tex \ + UserGuide/GrB_objects_BinaryOp.tex \ + UserGuide/GrB_objects_Container.tex \ + UserGuide/GrB_objects_Descriptor.tex \ + UserGuide/GrB_objects_formats.tex \ + UserGuide/GrB_objects_free.tex \ + UserGuide/GrB_objects_import.tex \ + UserGuide/GrB_objects_IndexBinaryOp.tex \ + UserGuide/GrB_objects_IndexUnaryOp.tex \ + UserGuide/GrB_objects_Matrix.tex \ + UserGuide/GrB_objects_Monoid.tex \ + UserGuide/GrB_objects_Scalar.tex \ + UserGuide/GrB_objects_Semiring.tex \ + UserGuide/GrB_objects_Serialize.tex \ + UserGuide/GrB_objects_sort.tex \ + UserGuide/GrB_objects.tex \ + UserGuide/GrB_objects_Type.tex \ + UserGuide/GrB_objects_UnaryOp.tex \ + UserGuide/GrB_objects_Vector.tex \ + UserGuide/GrB_operations_apply.tex \ + UserGuide/GrB_operations_assign_duplicates.tex \ + UserGuide/GrB_operations_assign.tex \ + UserGuide/GrB_operations_assign_vs_subassign.tex \ + UserGuide/GrB_operations_eWiseAdd.tex \ + UserGuide/GrB_operations_eWiseMult.tex \ + UserGuide/GrB_operations_eWiseUnion.tex \ + UserGuide/GrB_operations_extract.tex \ + UserGuide/GrB_operations_kronecker.tex \ + UserGuide/GrB_operations_mxm.tex \ + UserGuide/GrB_operations_mxv.tex \ + UserGuide/GrB_operations_reduce.tex \ + UserGuide/GrB_operations_select.tex \ + UserGuide/GrB_operations_subassign.tex \ + UserGuide/GrB_operations.tex \ + UserGuide/GrB_operations_transpose.tex \ + UserGuide/GrB_operations_vxm.tex \ + UserGuide/GrB_performance.tex \ + UserGuide/GrB_print.tex \ + UserGuide/GrB_references.tex \ + UserGuide/GrB_release.tex \ + UserGuide/GrB_resources.tex \ + UserGuide/GrB_v10.tex pdflatex GraphBLAS_UserGuide.tex bibtex GraphBLAS_UserGuide pdflatex GraphBLAS_UserGuide.tex diff --git a/GraphBLAS/Doc/UserGuide/GrB_abstract.tex b/GraphBLAS/Doc/UserGuide/GrB_abstract.tex new file mode 100644 index 0000000000..a50e7b5771 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_abstract.tex @@ -0,0 +1,23 @@ + +\begin{abstract} +SuiteSparse:GraphBLAS is a full 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 for creating high-performance graph algorithms based on the elegant +mathematics of sparse matrix operations on a semiring. + +When compared with MATLAB R2021a, some methods in GraphBLAS are up to +a million times faster than MATLAB, even when using the same syntax. +Typical speedups are in the range 2x to 30x. +The statement \verb'C(M)=A' when using MATLAB sparse matrices takes +$O(e^2)$ time where $e$ is the number of entries in \verb'C'. GraphBLAS +can perform the same computation with the exact same syntax, but +in $O(e \log e)$ time (or $O(e)$ in some cases), and in practice that +means GraphBLAS can compute \verb'C(M)=A' for a large problem in under +a second, while MATLAB takes about 4 to 5 days. + +SuiteSparse:GraphBLAS is under the Apache-2.0 license. +\end{abstract} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_acknowledgements.tex b/GraphBLAS/Doc/UserGuide/GrB_acknowledgements.tex new file mode 100644 index 0000000000..2518e0177b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_acknowledgements.tex @@ -0,0 +1,60 @@ + +% \newpage +%------------------------------------------------------------------------------- +\section{Acknowledgments} +%------------------------------------------------------------------------------- + +I would like to thank Jeremy Kepner (MIT Lincoln Laboratory Supercomputing +Center), and the GraphBLAS API Committee: Ayd\i n Bulu\c{c} (Lawrence Berkeley +National Laboratory), Timothy G. Mattson (Intel Corporation) Scott McMillan +(Software Engineering Institute at Carnegie Mellon University), Jos\'e Moreira +(IBM Corporation), Carl Yang (UC Davis), and Benjamin Brock (UC Berkeley), for +creating the GraphBLAS specification and for patiently answering my many +questions while I was implementing it. + +I would like to thank Tim Mattson and Henry Gabb, Intel, Inc., for their +collaboration and for the support of Intel. + +I would like to thank Joe Eaton and Corey Nolet for their collaboration on the +CUDA kernels (still in progress), and for the support of NVIDIA. + +I would like to thank Pat Quillen for his +collaboration and for the support of MathWorks. + +I would like to thank John Eaton for his collaboration on the integration +with Octave 7. + +I would like to thank Michel Pelletier for his collaboration and work on the +pygraphblas interface, and Jim Kitchen and Erik Welch for their work on +Anaconda's python interface. + +I would like to thank Will Kimmerer for his collaboration and work on the +Julia interface. + +I would like to thank John Gilbert (UC Santa Barbara) for our many discussions +on GraphBLAS, and for our decades-long conversation and collaboration on sparse +matrix computations. + +I would like to thank S\'ebastien Villemot (Debian Developer, +\url{http://sebastien.villemot.name}) for helping me with various build issues +and other code issues with GraphBLAS (and all of SuiteSparse) for its packaging +in Debian Linux. + +I would like to thank G{\'{a}}bor Sz{\'{a}}rnyas for porting the \verb'@GrB' +interface to Octave 7 on Apple Silicon. + +I would like to thank Markus M\"{u}tzel +for his help in porting the updates +to GraphBLAS v7.4.1 and SuiteSparse v7.0.0 to Windows. + +I would like to thank Roi Lipman, Redis (\url{https://falkordb.com}), for +our many discussions on GraphBLAS and for enabling its use in RedisGraph and FalkorDB, a graph +database module for Redis. Based on SuiteSparse:GraphBLAS, FalkorDB is up +600x faster than the fastest graph databases ({\footnotesize +\url{https://youtu.be/9h3Qco_x0QE} \newline +\url{https://redislabs.com/blog/new-redisgraph-1-0-achieves-600x-faster-performance-graph-databases/}}). + +SuiteSparse:GraphBLAS was developed with support from +NVIDIA, Intel, MIT Lincoln Lab, MathWorks, Redis, FalkorDB, IBM, +the National Science Foundation (1514406, 1835499), and Julia Computing. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_colon.tex b/GraphBLAS/Doc/UserGuide/GrB_colon.tex new file mode 100644 index 0000000000..a9d16dc0bf --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_colon.tex @@ -0,0 +1,231 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{SuiteSparse:GraphBLAS Colon and Index Notation} %%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{colon} + +MATLAB/Octave uses a colon notation to index into matrices, such as +\verb'C=A(2:4,3:8)', which extracts \verb'C' as 3-by-6 submatrix from \verb'A', +from rows 2 through 4 and columns 3 to 8 of the matrix \verb'A'. A single +colon is used to denote all rows, \verb'C=A(:,9)', or all columns, +\verb'C=A(12,:)', which refers to the 9th column and 12th row of \verb'A', +respectively. An arbitrary integer list can be given as well, such as the +MATLAB/Octave statements: + + {\footnotesize + \begin{verbatim} + I = [2 1 4] ; + J = [3 5] ; + C = A (I,J) ; \end{verbatim} } +\noindent +which creates the 3-by-2 matrix \verb'C' as follows: +\[ +C = +\left[ +\begin{array}{cc} +a_{2,3} & a_{2,5} \\ +a_{1,3} & a_{1,5} \\ +a_{4,3} & a_{4,5} \\ +\end{array} +\right] +\] + +The GraphBLAS API can do the equivalent of \verb'C=A(I,J)', +\verb'C=A(:,J)', \verb'C=A(I,:)', and \verb'C=A(:,:)', by passing a parameter +\verb'const GrB_Index *I' as either an array of size \verb'ni', or as the +special value \verb'GrB_ALL', which corresponds to the stand-alone colon +\verb'C=A(:,J)', and the same can be done for \verb'J'.. To compute +\verb'C=A(2:4,3:8)' in GraphBLAS requires the user application to create two +explicit integer arrays \verb'I' and \verb'J' of size 3 and 5, respectively, +and then fill them with the explicit values \verb'[2,3,4]' and +\verb'[3,4,5,6,7,8]'. This works well if the lists are small, or if the matrix +has more entries than rows or columns. + +However, particularly with hypersparse matrices, the size of the explicit +arrays \verb'I' and \verb'J' can vastly exceed the number of entries in the +matrix. When using its hypersparse format, SuiteSparse:GraphBLAS allows the +user application to create a \verb'GrB_Matrix' with dimensions up to $2^{60}$, +with no memory constraints. The only constraint on memory usage in a +hypersparse matrix is the number of entries in the matrix. + +For example, creating a $n$-by-$n$ matrix \verb'A' of type \verb'GrB_FP64' with +$n=2^{60}$ and one million entries is trivial to do in Version 2.1 (and later) +of SuiteSparse:GraphBLAS, taking at most 24MB of space. SuiteSparse:GraphBLAS +Version 2.1 (or later) could do this on an old smartphone. However, using just +the pure GraphBLAS API, constructing \verb'C=A(0:(n/2),0:(n/2))' +in SuiteSparse Version 2.0 would require the creation of an integer array +\verb'I' of size $2^{59}$, containing the sequence 0, 1, 2, 3, ...., requiring +about 4 ExaBytes of memory (4 million terabytes). This is roughly 1000 times +larger than the memory size of the world's largest computer in 2018. + +SuiteSparse:GraphBLAS Version 2.1 and later extends the GraphBLAS API with a +full implementation of the MATLAB colon notation for integers, +\verb'I=begin:inc:end'. This extension allows the construction of the matrix +\verb'C=A(0:(n/2),0:(n/2))' in this example, with dimension $2^{59}$, probably +taking just milliseconds on an old smartphone. + +The \verb'GrB_extract', \verb'GrB_assign', and \verb'GxB_subassign' operations +(described in the Section~\ref{operations}) each have parameters that define a +list of integer indices, using two parameters: + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + const GrB_Index *I ; // an array, or a special value GrB_ALL + GrB_Index ni ; // the size of I, or a special value \end{verbatim}} + +\vspace{-0.05in} +These two parameters define five kinds of index lists, which can be used to +specify either an explicit or implicit list of row indices and/or column +indices. The length of the list of indices is denoted \verb'|I|'. This +discussion applies equally to the row indices \verb'I' and the column indices +\verb'J'. The five kinds are listed below. + +\begin{enumerate} +\item + An explicit list of indices, such as \verb'I = [2 1 4 7 2]' in MATLAB + notation, is handled by passing in \verb'I' as a pointer to an array of + size 5, and passing \verb'ni=5' as the size of the list. + The length of the explicit list is \verb'ni=|I|'. + Duplicates may appear, except that for some uses of \verb'GrB_assign' + and \verb'GxB_subassign', duplicates lead to undefined behavior + according to the GraphBLAS C API Specification. + SuiteSparse:GraphBLAS specifies how duplicates are handled in all cases, + as an addition to the specification. + See Section~\ref{duplicates} for details. + +\item To specify all rows of a matrix, use \verb'I = GrB_ALL'. The + parameter \verb'ni' is ignored. This is equivalent to \verb'C=A(:,J)' + in MATLAB. In GraphBLAS, this is the sequence \verb'0:(m-1)' if \verb'A' + has \verb'm' rows, with length \verb'|I|=m'. If \verb'J' is used the + columns of an \verb'm'-by-\verb'n' matrix, then \verb'J=GrB_ALL' refers to + all columns, and is the sequence \verb'0:(n-1)', of length \verb'|J|=n'. + + \begin{alert} + {\bf SPEC:} If \verb'I' or \verb'J' are \verb'GrB_ALL', the specification + requires that \verb'ni' be passed in as \verb'm' (the number of rows) + and \verb'nj' be passed in as \verb'n'. Any other value is an error. + SuiteSparse:GraphBLAS ignores these scalar inputs and treats them as if + they are equal to their only possible correct value. + \end{alert} + +\item To specify a contiguous range of indices, such as \verb'I=10:20' + in MATLAB, the array \verb'I' has size 2, and \verb'ni' is passed to + SuiteSparse:GraphBLAS as the special value \verb'ni = GxB_RANGE'. The + beginning index is \verb'I[GxB_BEGIN]' and the ending index is + \verb'I[GxB_END]'. Both values must be non-negative since + \verb'GrB_Index' is an unsigned integer (\verb'uint64_t'). The value of + \verb'I[GxB_INC]' is ignored. + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + // to specify I = 10:20 + GrB_Index I [2], ni = GxB_RANGE ; + I [GxB_BEGIN] = 10 ; // the start of the sequence + I [GxB_END ] = 20 ; // the end of the sequence \end{verbatim}} + + \vspace{-0.05in} + Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', + The sequence has length zero if $b > e$; otherwise the length is + $|I| = (e-b) + 1$. + +\item To specify a strided range of indices with a non-negative stride, + such as \verb'I=3:2:10', the array \verb'I' has size 3, and \verb'ni' has + the special value \verb'GxB_STRIDE'. This is the sequence 3, 5, 7, 9, of + length 4. Note that 10 does not appear in the list. The end point need + not appear if the increment goes past it. + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + // to specify I = 3:2:10 + GrB_Index I [3], ni = GxB_STRIDE ; + I [GxB_BEGIN ] = 3 ; // the start of the sequence + I [GxB_INC ] = 2 ; // the increment + I [GxB_END ] = 10 ; // the end of the sequence \end{verbatim}} + + \vspace{-0.05in} + The \verb'GxB_STRIDE' sequence is the same as the \verb'List' generated by + the following for loop: + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + int64_t k = 0 ; + GrB_Index *List = (a pointer to an array of large enough size) + for (int64_t i = I [GxB_BEGIN] ; i <= I [GxB_END] ; i += I [GxB_INC]) + { + // i is the kth entry in the sequence + List [k++] = i ; + } \end{verbatim}} + + \vspace{-0.05in} + Then passing the explicit array \verb'List' and its length \verb'ni=k' has + the same effect as passing in the array \verb'I' of size 3, with + \verb'ni=GxB_STRIDE'. The latter is simply much faster to produce, and + much more efficient for SuiteSparse:GraphBLAS to process. + + Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', and let + $\Delta$ = \verb'I[GxB_INC]'. The sequence has length zero if $b > e$ or + $\Delta=0$. Otherwise, the length of the sequence is + \[ + |I| = \Bigl\lfloor\dfrac{e-b}{\Delta}\Bigr\rfloor + 1 + \] + +\item + In MATLAB notation, if the stride is negative, the sequence is decreasing. + For example, \verb'10:-2:1' is the sequence 10, 8, 6, 4, 2, in that order. + In SuiteSparse:GraphBLAS, use \verb'ni = GxB_BACKWARDS', with an array + \verb'I' of size 3. The following example specifies defines the equivalent + of the MATLAB expression \verb'10:-2:1' in SuiteSparse:GraphBLAS: + + \vspace{-0.1in} + {\footnotesize + \begin{verbatim} + // to specify I = 10:-2:1 + GrB_Index I [3], ni = GxB_BACKWARDS ; + I [GxB_BEGIN ] = 10 ; // the start of the sequence + I [GxB_INC ] = 2 ; // the magnitude of the increment + I [GxB_END ] = 1 ; // the end of the sequence \end{verbatim}} + + \vspace{-0.1in} + The value -2 cannot be assigned to the \verb'GrB_Index' array \verb'I', + since that is an unsigned type. The signed increment is represented + instead with the special value \verb'ni = GxB_BACKWARDS'. + The \verb'GxB_BACKWARDS' sequence is the same as generated by the following + for loop: + + \vspace{-0.1in} + {\footnotesize + \begin{verbatim} + int64_t k = 0 ; + GrB_Index *List = (a pointer to an array of large enough size) + for (int64_t i = I [GxB_BEGIN] ; i >= I [GxB_END] ; i -= I [GxB_INC]) + { + // i is the kth entry in the sequence + List [k++] = i ; + } \end{verbatim}} + + \vspace{-0.1in} + Let $b$ = \verb'I[GxB_BEGIN]', let $e$ = \verb'I[GxB_END]', and let + $\Delta$ = \verb'I[GxB_INC]' (note that $\Delta$ is not negative). The + sequence has length zero if $b < e$ or $\Delta=0$. Otherwise, the length + of the sequence is + \[ + |I| = \Bigl\lfloor\dfrac{b-e}{\Delta}\Bigr\rfloor + 1 + \] + +\end{enumerate} + +Since \verb'GrB_Index' is an unsigned integer, all three values +\verb'I[GxB_BEGIN]', \verb'I[GxB_INC]', and \verb'I[GxB_END]' must +be non-negative. + +Just as in MATLAB, it is valid to specify an empty sequence of length zero. +For example, \verb'I = 5:3' has length zero in MATLAB and the same is +true for a \verb'GxB_RANGE' sequence in SuiteSparse:GraphBLAS, with +\verb'I[GxB_BEGIN]=5' and \verb'I[GxB_END]=3'. This has the same +effect as array \verb'I' with \verb'ni=0'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_concepts.tex b/GraphBLAS/Doc/UserGuide/GrB_concepts.tex new file mode 100644 index 0000000000..bd796ecab5 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_concepts.tex @@ -0,0 +1,609 @@ +% UserGuide/GrB_concepts.tex: Basic Concepts +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Basic Concepts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{basic} + +Since the {\em GraphBLAS C API Specification} provides a precise definition of +GraphBLAS, not every detail of every function is provided here. For example, +some error codes returned by GraphBLAS are self-explanatory, but since a +specification must precisely define all possible error codes a function can +return, these are listed in detail in the {\em GraphBLAS C API Specification}. +However, including them here is not essential and the additional information on +the page might detract from a clearer view of the essential features of the +GraphBLAS functions. + +This User Guide also assumes the reader is familiar with MATLAB/Octave. +MATLAB supports only the conventional plus-times semiring on sparse +double and complex matrices, but a MATLAB-like notation easily extends to the +arbitrary semirings used in GraphBLAS. The matrix multiplication in the +example in the Introduction can be written in MATLAB notation as +\verb'C=A*B', if the Boolean \verb'OR-AND' semiring is understood. Relying on +a MATLAB-like notation allows the description in this User Guide to be +expressive, easy to understand, and terse at the same time. {\em The GraphBLAS +C API Specification} also makes use of some MATLAB-like language, such +as the colon notation. + +MATLAB notation will always appear here in fixed-width font, such as +\verb'C=A*B(:,j)'. In standard mathematical notation it would be written as +the matrix-vector multiplication ${\bf C = A b}_j$ where ${\bf b}_j$ is the +$j$th column of the matrix ${\bf B}$. The GraphBLAS standard is a C API and +SuiteSparse:GraphBLAS is written in C, and so a great deal of C syntax appears +here as well, also in fixed-width font. This User Guide alternates between all +three styles as needed. + +%=============================================================================== +\subsection{Graphs and sparse matrices} %======================================= +%=============================================================================== +\label{sparse} + +Graphs can be huge, with many nodes and edges. A dense adjacency matrix ${\bf +A}$ for a graph of $n$ nodes takes $O(n^2)$ memory, which is impossible if $n$ +is, say, a million. Let $|{\bf A}|$ denote the number of entries in a matrix. +Most graphs arising in practice are sparse, however, with only $|{\bf A}|=O(n)$ +edges, where $|{\bf A}|$ denotes the number of edges in the graph, or the +number of explicit entries present in the data structure for the matrix ${\bf +A}$. Sparse graphs with millions of nodes and edges can easily be created by +representing them as sparse matrices, where only explicit values need to be +stored. Some graphs are {\em hypersparse}, with ${|\bf A}| << n$. +SuiteSparse:GraphBLAS supports three kinds of sparse matrix formats: a regular +sparse format, taking $O(n+|{\bf A}|)$ space, a hypersparse format taking only +$O(|{\bf A}|)$ space, and a bitmap form, taking $O(n^2)$ space. Full matrices +are also represented in $O(n^2)$ space. Using its hypersparse format, creating +a sparse matrix of size $n$-by-$n$ where $n=2^{60}$ (about $10^{18}$) can be +done on quite easily on a commodity laptop, limited only by $|{\bf A}|$. +To the GraphBLAS user application, all matrices look alike, since these formats +are opaque, and SuiteSparse:GraphBLAS switches between them at will. + +A sparse matrix data structure only stores a subset of the possible $n^2$ +entries, and it assumes the values of entries not stored have some implicit +value. In conventional linear algebra, this implicit value is zero, but it +differs with different semirings. Explicit values are called {\em entries} and +they appear in the data structure. The {\em pattern} (also called the +{\em structure}) of a matrix defines where its explicit entries appear. It +will be referenced in one of two equivalent ways. It can be viewed as a set of +indices $(i,j)$, where $(i,j)$ is in the pattern of a matrix ${\bf A}$ if ${\bf +A}(i,j)$ is an explicit value. It can also be viewed as a Boolean matrix ${\bf +S}$ where ${\bf S}(i,j)$ is true if $(i,j)$ is an explicit entry and false +otherwise. In MATLAB notation, \verb'S=spones(A)' or \verb'S=(A~=0)', if the +implicit value is zero. The \verb'(i,j)' pairs, and their values, can also be +extracted from the matrix via the MATLAB expression \verb'[I,J,X]=find(A)', +where the \verb'k'th tuple \verb'(I(k),J(k),X(k))' represents the explicit +entry \verb'A(I(k),J(k))', with numerical value \verb'X(k)' equal to $a_{ij}$, +with row index $i$=\verb'I(k)' and column index $j$=\verb'J(k)'. + +The entries in the pattern of ${\bf A}$ can take on any value, including the +implicit value, whatever it happens to be. This differs slightly from MATLAB, +which always drops all explicit zeros from its sparse matrices. This is a +minor difference but GraphBLAS cannot drop explicit zeros. For example, in the +max-plus tropical algebra, the implicit value is negative infinity, and zero +has a different meaning. Here, the MATLAB notation used will assume that no +explicit entries are ever dropped because their explicit value happens to match +the implicit value. + +{\em Graph Algorithms in the Language on Linear Algebra}, Kepner and Gilbert, +eds., provides a framework for understanding how graph algorithms can be +expressed as matrix computations \cite{KepnerGilbert2011}. For additional +background on sparse matrix algorithms, see also \cite{Davis06book} and +\cite{DavisRajamanickamSidLakhdar16}. + +%=============================================================================== +\subsection{Overview of GraphBLAS methods and operations} %===================== +%=============================================================================== +\label{overview} + +GraphBLAS provides a collection of {\em methods} to create, query, and free its +objects: matrices, vectors, scalars, types, operators, monoids, semirings, a +descriptor object used for parameter settings, a context object (for +controlling parallelism), and a container object (for moving data in and out of +GraphBLAS), and an iterator object. Details are given in +Section~\ref{objects}. Once these objects are created they can be used in +mathematical {\em operations} (not to be confused with the how the term {\em +operator} is used in GraphBLAS). A short summary of these operations and their +nearest MATLAB/Octave analog is given in the table below. + +% \vspace{0.1in} +\begin{tabular}{ll} +operation & approximate MATLAB/Octave analog \\ +\hline +matrix multiplication & \verb'C=A*B' \\ +element-wise operations & \verb'C=A+B' and \verb'C=A.*B' \\ +reduction to a vector or scalar & \verb's=sum(A)' \\ +apply unary operator & \verb'C=-A' \\ +transpose & \verb"C=A'" \\ +submatrix extraction & \verb'C=A(I,J)' \\ +submatrix assignment & \verb'C(I,J)=A' \\ +select & \verb'C=tril(A)' \\ +\hline +\end{tabular} +\vspace{0.1in} + +GraphBLAS can do far more than what MATLAB/Octave can do in these rough +analogs, but the list provides a first step in describing what GraphBLAS can +do. Details of each GraphBLAS operation are given in Section~\ref{operations}. +With this brief overview, the full scope of GraphBLAS extensions of these +operations can now be described. + +SuiteSparse:GraphBLAS has 13 built-in scalar types: Boolean, single and double +precision floating-point (real and complex), and 8, 16, 32, and 64-bit signed +and unsigned integers. In addition, user-defined scalar types can be created +from nearly any C \verb'typedef', as long as the entire type fits in a +fixed-size contiguous block of memory (of arbitrary size). All of these types +can be used to create GraphBLAS sparse matrices, vectors, or scalars. + +The scalar addition of conventional matrix multiplication is replaced with a +{\em monoid}. A monoid is an associative and commutative binary operator +\verb'z=f(x,y)' where all three domains are the same (the types of \verb'x', +\verb'y', and \verb'z'), and where the operator has an identity value \verb'id' +such that \verb'f(x,id)=f(id,x)=x'. Performing matrix multiplication with a +semiring uses a monoid in place of the ``add'' operator, scalar addition being +just one of many possible monoids. The identity value of addition is zero, +since $x+0=0+x=x$. GraphBLAS includes many built-in operators suitable for +use as a monoid: min (with an identity value of positive infinity), max (whose +identity is negative infinity), add (identity is zero), multiply (with an +identity of one), four logical operators: AND, OR, exclusive-OR, and +Boolean equality (XNOR), four bitwise operators (AND, OR, XOR, and XNOR), +and the ANY operator. +See Section~\ref{any_pair} for more details on the unusual ANY operator. +User-created monoids can be defined with any associative and +commutative operator that has an identity value. + +Finally, a semiring can use any built-in or user-defined binary operator +\verb'z=f(x,y)' as its ``multiply'' operator, as long as the type of its +output, \verb'z' matches the type of the semiring's monoid. +The user application can create any semiring based on any types, monoids, +and multiply operators, as long these few rules are followed. + +Just considering built-in types and operators, GraphBLAS can perform +\verb'C=A*B' in thousands of unique semirings. With typecasting, any of these +semirings can be applied to matrices \verb'C', \verb'A', and \verb'B' of 13 +predefined types, in any combination. This results in millions of possible +kinds of sparse matrix multiplication supported by GraphBLAS, and this is +counting just built-in types and operators. By contrast, MATLAB provides just +two semirings for its sparse matrix multiplication \verb'C=A*B': +plus-times-double and plus-times-complex, not counting the typecasting that +MATLAB does when multiplying a real matrix times a complex matrix. + +A monoid can also be used in a reduction operation, like \verb's=sum(A)' in +MATLAB. MATLAB provides the plus, times, min, and max reductions of a real or +complex sparse matrix as \verb's=sum(A)', \verb's=prod(A)', \verb's=min(A)', +and \verb's=max(A)', respectively. In GraphBLAS, any monoid can be used (min, +max, plus, times, AND, OR, exclusive-OR, equality, bitwise operators, +or any user-defined monoid on any user-defined type). + +Element-wise operations are also expanded from what can be done in MATLAB. +Consider matrix addition, \verb'C=A+B' in MATLAB. The pattern of the result is +the set union of the pattern of \verb'A' and \verb'B'. In GraphBLAS, any +binary operator can be used in this set-union ``addition.'' The operator is +applied to entries in the intersection. Entries in \verb'A' but not \verb'B', +or visa-versa, are copied directly into \verb'C', without any application of +the binary operator. The accumulator operation for ${\bf Z = C \odot T}$ +described in Section~\ref{accummask} is one example of this set-union +application of an arbitrary binary operator. + +Consider element-wise multiplication, \verb'C=A.*B' in MATLAB. The operator +(multiply in this case) is applied to entries in the set intersection, and the +pattern of \verb'C' just this set intersection. Entries in \verb'A' but not +\verb'B', or visa-versa, do not appear in \verb'C'. In GraphBLAS, any binary +operator can be used in this manner, not just scalar multiplication. The +difference between element-wise ``add'' and ``multiply'' is not the operators, +but whether or not the pattern of the result is the set union or the set +intersection. In both cases, the operator is only applied to the set +intersection. + +Finally, GraphBLAS includes a {\em non-blocking} mode where operations can be +left pending, and saved for later. This is very useful for submatrix +assignment (\verb'C(I,J)=A' where \verb'I' and \verb'J' are integer vectors), +or scalar assignment (\verb'C(i,j)=x' where \verb'i' and \verb'j' are scalar +integers). Because of how MATLAB stores its matrices, adding and deleting +individual entries is very costly. For example, this is very slow in MATLAB, +taking $O(e^2)$ time (where $e$ is the number of entries added to the matrix): + + \begin{mdframed} + {\footnotesize + \begin{verbatim} + A = sparse (m,n) ; % an empty sparse matrix + for k = 1:e + compute a value x, row index i, and column index j + A (i,j) = x ; + end\end{verbatim}}\end{mdframed} + +The above code is very easy read and simple to write, but exceedingly slow. In +MATLAB, the method below is preferred and is far faster, taking at most +$O(e \log e +n)$ time. It can easily be a million times faster +than the method above. Unfortunately the second method below is a little +harder to read and a little less natural to write: + + \begin{mdframed} + {\footnotesize + \begin{verbatim} + I = zeros (e,1) ; + J = zeros (e,1) ; + X = zeros (e,1) ; + for k = 1:e + compute a value x, row index i, and column index j + I (k) = i ; + J (k) = j ; + X (k) = x ; + end + A = sparse (I,J,X,m,n) ; \end{verbatim}} \end{mdframed} + +GraphBLAS can do both methods. SuiteSparse:GraphBLAS stores its matrices in a +format that allows for pending computations, which are done later in bulk, and +as a result it can do both methods above equally as fast as the MATLAB +\verb'sparse' function, allowing the user to write simpler code. + +%=============================================================================== +\subsection{The accumulator and the mask} %===================================== +%=============================================================================== +\label{accummask} + +Most GraphBLAS operations can be modified via transposing input matrices, using +an accumulator operator, applying a mask or its complement, and by clearing all +entries the matrix \verb'C' after using it in the accumulator operator but +before the final results are written back into it. All of these steps are +optional, and are controlled by a descriptor object that holds parameter +settings (see Section~\ref{descriptor}) that control the following options: + +\begin{itemize} +\item the input matrices \verb'A' and/or \verb'B' can be transposed first. + +\item an accumulator operator can be used, like the plus in the statement + \verb'C=C+A*B'. The accumulator operator can be any binary operator, and + an element-wise ``add'' (set union) is performed using the operator. + +\item an optional {\em mask} can be used to selectively write the results to + the output. The mask is a sparse Boolean matrix \verb'Mask' whose size is + the same size as the result. If \verb'Mask(i,j)' is true, then the + corresponding entry in the output can be modified by the computation. If + \verb'Mask(i,j)' is false, then the corresponding in the output is + protected and cannot be modified by the computation. The \verb'Mask' + matrix acts exactly like logical matrix indexing in MATLAB, with one + minor difference: in GraphBLAS notation, the mask operation is $\bf C + \langle M \rangle = Z$, where the mask $\bf M$ appears only on the + left-hand side. In MATLAB, it would appear on both sides as + \verb'C(Mask)=Z(Mask)'. If no mask is provided, the \verb'Mask' matrix is + implicitly all true. This is indicated by passing the value + \verb'GrB_NULL' in place of the \verb'Mask' argument in GraphBLAS + operations. + +\end{itemize} + +\noindent +This process can be described in mathematical notation as: + \vspace{-0.2in} + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> ${\bf A = A}^{\sf T}$, if requested via descriptor (first input option) \\ + \> ${\bf B = B}^{\sf T}$, if requested via descriptor (second input option) \\ + \> ${\bf T}$ is computed according to the specific operation \\ + \> ${\bf C \langle M \rangle = C \odot T}$, + accumulating and writing the results back via the mask + \end{tabbing} } +\noindent +The application of the mask and the accumulator operator is written as +${\bf C \langle M \rangle = C \odot T}$ where ${\bf Z = C \odot T}$ denotes the +application of the accumulator operator, and +${\bf C \langle M \rangle = Z}$ +denotes the mask operator via the Boolean matrix ${\bf M}$. The Accumulator +Phase, ${\bf Z = C \odot T}$, is performed as follows: + + % \vspace{-0.2in} + % accum: Z = C odot T + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> {\bf Accumulator Phase}: compute ${\bf Z = C \odot T}$: \\ + \> \> if \verb'accum' is \verb'NULL' \\ + \> \>\> ${\bf Z = T}$ \\ + \> \> else \\ + \> \>\> ${\bf Z = C \odot T}$ + \end{tabbing}} +The accumulator operator is $\odot$ in GraphBLAS notation, or \verb'accum' +in the code. The pattern of ${\bf C \odot T}$ is the set union of the +patterns of ${\bf C}$ and ${\bf T}$, and the operator is applied only on the +set intersection of ${\bf C}$ and ${\bf T}$. Entries in neither the pattern +of ${\bf C}$ nor ${\bf T}$ do not appear in the pattern of ${\bf Z}$. That is: + % \newpage + \vspace{-0.2in} + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> for all entries $(i,j)$ in ${\bf C \cap T}$ + (that is, entries in both ${\bf C}$ and ${\bf T}$) \\ + \> \> $z_{ij} = c_{ij} \odot t_{ij}$ \\ + \> for all entries $(i,j)$ in ${\bf C \setminus T}$ + (that is, entries in ${\bf C}$ but not ${\bf T}$) \\ + \> \> $z_{ij} = c_{ij}$ \\ + \> for all entries $(i,j)$ in ${\bf T \setminus C}$ + (that is, entries in ${\bf T}$ but not ${\bf C}$) \\ + \> \> $z_{ij} = t_{ij}$ + \end{tabbing} } +The Accumulator Phase is followed by the Mask/Replace Phase, +${\bf C \langle M \rangle = Z}$ +as controlled by the \verb'GrB_REPLACE' and \verb'GrB_COMP' descriptor options: + \vspace{-0.2in} + % mask/replace/scmp: C = Z + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \>{\bf Mask/Replace Phase}: compute ${\bf C \langle M \rangle = Z}$: \\ + \> \> if (\verb'GrB_REPLACE') delete all entries in ${\bf C}$ \\ + \> \> if \verb'Mask' is \verb'NULL' \\ + \> \>\> if (\verb'GrB_COMP') \\ + \> \>\>\> ${\bf C}$ is not modified \\ + \> \>\> else \\ + \> \>\>\> ${\bf C = Z}$ \\ + \> \> else \\ + \> \>\> if (\verb'GrB_COMP') \\ + \> \>\>\> ${\bf C \langle \neg M \rangle = Z}$ \\ + \> \>\> else \\ + \> \>\>\> ${\bf C \langle M \rangle = Z}$ + \end{tabbing} } +Both phases of the accum/mask process are illustrated in MATLAB notation in +Figure~\ref{fig_accummask}. + +\begin{figure} +\begin{mdframed}[leftmargin=-0.4in,userdefinedwidth=5.8in] +{\footnotesize +\begin{verbatim} +function C = accum_mask (C, Mask, accum, T, C_replace, Mask_complement) +[m n] = size (C.matrix) ; +Z.matrix = zeros (m, n) ; +Z.pattern = false (m, n) ; + +if (isempty (accum)) + Z = T ; % no accum operator +else + % Z = accum (C,T), like Z=C+T but with an binary operator, accum + p = C.pattern & T.pattern ; Z.matrix (p) = accum (C.matrix (p), T.matrix (p)); + p = C.pattern & ~T.pattern ; Z.matrix (p) = C.matrix (p) ; + p = ~C.pattern & T.pattern ; Z.matrix (p) = T.matrix (p) ; + Z.pattern = C.pattern | T.pattern ; +end + +% apply the mask to the values and pattern +C.matrix = mask (C.matrix, Mask, Z.matrix, C_replace, Mask_complement) ; +C.pattern = mask (C.pattern, Mask, Z.pattern, C_replace, Mask_complement) ; +end + +function C = mask (C, Mask, Z, C_replace, Mask_complement) +% replace C if requested +if (C_replace) + C (:,:) = 0 ; +end +if (isempty (Mask)) % if empty, Mask is implicit ones(m,n) + % implicitly, Mask = ones (size (C)) + if (~Mask_complement) + C = Z ; % this is the default + else + C = C ; % Z need never have been computed + end +else + % apply the mask + if (~Mask_complement) + C (Mask) = Z (Mask) ; + else + C (~Mask) = Z (~Mask) ; + end +end +end \end{verbatim} } +\end{mdframed} +\caption{Applying the mask and accumulator, ${\bf C \langle M \rangle = C \odot T}$\label{fig_accummask}} +\end{figure} + +A GraphBLAS operation starts with its primary +computation, producing a result \verb'T'; for matrix multiply, \verb'T=A*B', or +if \verb'A' is transposed first, \verb"T=A'*B", for example. Applying the +accumulator, mask (or its complement) to obtain the final result matrix +\verb'C' can be expressed in the MATLAB \verb'accum_mask' function shown in the +figure. This function is an exact, fully functional, and nearly-complete +description of the GraphBLAS accumulator/mask operation. The only aspects it +does not consider are typecasting (see Section~\ref{typecasting}), and the +value of the implicit identity (for those, see another version in the +\verb'Test' folder). + +One aspect of GraphBLAS cannot be as easily expressed in a MATLAB sparse +matrix: namely, what is the implicit value of entries not in the pattern? To +accommodate this difference in the \verb'accum_mask' MATLAB function, each +sparse matrix \verb'A' is represented with its values \verb'A.matrix' and its +pattern, \verb'A.pattern'. The latter could be expressed as the sparse matrix +\verb'A.pattern=spones(A)' or \verb'A.pattern=(A~=0)' in MATLAB, if the +implicit value is zero. With different semirings, entries not in the pattern +can be \verb'1', \verb'+Inf', \verb'-Inf', or whatever is the identity value of +the monoid. As a result, Figure~\ref{fig_accummask} performs its computations +on two MATLAB matrices: the values in \verb'A.matrix' and the pattern in the +logical matrix \verb'A.pattern'. Implicit values are untouched. + +The final computation in Figure~\ref{fig_accummask} with a complemented +\verb'Mask' is easily expressed in MATLAB as \verb'C(~Mask)=Z(~Mask)' but this +is costly if \verb'Mask' is very sparse (the typical case). It can be computed +much faster in MATLAB without complementing the sparse \verb'Mask' via: + + {\footnotesize + \begin{verbatim} + R = Z ; R (Mask) = C (Mask) ; C = R ; \end{verbatim} } + +A set of MATLAB functions that precisely compute the ${\bf C \langle M \rangle += C \odot T}$ operation according to the full GraphBLAS specification is +provided in SuiteSparse:GraphBLAS as \verb'GB_spec_accum.m', which computes +${\bf Z=C\odot T}$, and \verb'GB_spec_mask.m', which computes ${\bf C \langle M +\rangle = Z}$. SuiteSparse:GraphBLAS includes a complete list of +\verb'GB_spec_*' functions that illustrate every GraphBLAS operation. + +The methods in Figure~\ref{fig_accummask} rely heavily on MATLAB's logical +matrix indexing. For those unfamiliar with logical indexing in MATLAB, here is +short summary. Logical matrix indexing in MATLAB is written as \verb'A(Mask)' +where \verb'A' is any matrix and \verb'Mask' is a logical matrix the same size +as \verb'A'. The expression \verb'x=A(Mask)' produces a column vector \verb'x' +consisting of the entries of \verb'A' where \verb'Mask' is true. On the +left-hand side, logical submatrix assignment \verb'A(Mask)=x' does the +opposite, copying the components of the vector \verb'x' into the places in +\verb'A' where \verb'Mask' is true. For example, to negate all values greater +than 10 using logical indexing in MATLAB: + + \begin{mdframed} + {\footnotesize + \begin{verbatim} + >> A = magic (4) + A = + 16 2 3 13 + 5 11 10 8 + 9 7 6 12 + 4 14 15 1 + >> A (A>10) = - A (A>10) + A = + -16 2 3 -13 + 5 -11 10 8 + 9 7 6 -12 + 4 -14 -15 1 \end{verbatim} } \end{mdframed} + +In MATLAB, logical indexing with a sparse matrix \verb'A' and sparse logical +matrix \verb'Mask' is a built-in method. The Mask operator in GraphBLAS works +identically as sparse logical indexing in MATLAB, but is typically far faster +in SuiteSparse:GraphBLAS than the same operation using MATLAB sparse matrices. + +%=============================================================================== +\subsection{Typecasting} %====================================================== +%=============================================================================== +\label{typecasting} + +If an operator \verb'z=f(x)' or \verb'z=f(x,y)' is used with inputs that do not +match its inputs \verb'x' or \verb'y', or if its result \verb'z' does not match +the type of the matrix it is being stored into, then the values are typecasted. +Typecasting in GraphBLAS extends beyond just operators. Almost all GraphBLAS +methods and operations are able to typecast their results, as needed. + +If one type can be typecasted into the other, they are said to be {\em +compatible}. All built-in types are compatible with each other. GraphBLAS +cannot typecast user-defined types thus any user-defined type is only +compatible with itself. When GraphBLAS requires inputs of a specific type, or +when one type cannot be typecast to another, the GraphBLAS function returns an +error code, \verb'GrB_DOMAIN_MISMATCH' (refer to Section~\ref{error} for a +complete list of error codes). Typecasting can only be done between built-in +types, and it follows the rules of the ANSI C language (not MATLAB) wherever +the rules of ANSI C are well-defined. + +However, unlike MATLAB, the C11 language specification states that the +results of typecasting a \verb'float' or \verb'double' to an integer type is +not always defined. In SuiteSparse:GraphBLAS, whenever C leaves the result +undefined the rules used in MATLAB are followed. In particular \verb'+Inf' +converts to the largest integer value, \verb'-Inf' converts to the smallest +(zero for unsigned integers), and \verb'NaN' converts to zero. Positive values +outside the range of the integer are converted to the largest positive integer, +and negative values less than the most negative integer are converted to that +most negative integer. Other than these special cases, SuiteSparse:GraphBLAS +trusts the C compiler for the rest of its typecasting. + +Typecasting to \verb'bool' is fully defined in the C language specification, +even for \verb'NaN'. The result is \verb'false' if the value compares equal to +zero, and true otherwise. Thus \verb'NaN' converts to \verb'true'. This is +unlike MATLAB, which does not allow a typecast of a \verb'NaN' to the MATLAB +logical type. + +\begin{alert} +{\bf SPEC:} the GraphBLAS API C Specification states that typecasting follows +the rules of ANSI C. Yet C leaves some typecasting undefined. All typecasting +between built-in types in SuiteSparse:GraphBLAS is precisely defined, as an +extension to the specification. +\end{alert} + +\begin{alert} +{\bf SPEC:} Some functions do not make use of all of their inputs; in +particular the binary operators \verb'FIRST', \verb'SECOND', and \verb'ONEB', +and many of the index unary operators. The Specification requires that the +inputs to these operators must be compatible with (that is, can be typecasted +to) the inputs to the operators, even if those inputs are not used and no +typecasting would ever occur. As an extension to the specification, +SuiteSparse:GraphBLAS does not perform this error check on unused inputs of +built-in operators. For example, the \verb'GrB_FIRST_INT64' operator can be +used in \verb'GrB_eWiseMult(C,..,A,B,...)' on a matrix \verb'B' of any type, +including user-defined types. For this case, the matrix \verb'A' must be +compatible with \verb'GrB_INT64'. +\end{alert} + +%=============================================================================== +\subsection{Notation and list of GraphBLAS operations} %======================== +%=============================================================================== +\label{list} + +As a summary of what GraphBLAS can do, the following table lists all GraphBLAS +operations. Upper case letters denote a matrix, lower case letters are +vectors, and ${\bf AB}$ denote the multiplication of two matrices over a +semiring. + +Each operation takes an optional \verb'GrB_Descriptor' argument that modifies +the operation. The input matrices ${\bf A}$ and ${\bf B}$ can be optionally +transposed, the mask ${\bf M}$ can be complemented, and ${\bf C}$ can be +cleared of its entries after it is used in ${\bf Z = C \odot T}$ but before +the ${\bf C \langle M \rangle = Z}$ assignment. +Vectors are never transposed via the descriptor. + +Let ${\bf A \oplus B}$ denote the element-wise operator that produces a set +union pattern (like \verb'A+B' in MATLAB). Any binary operator can be used +this way in GraphBLAS, not just plus. Let ${\bf A \otimes B}$ denote the +element-wise operator that produces a set intersection pattern (like +\verb'A.*B' in MATLAB); any binary operator can be used this way, not just +times. + +Reduction of a matrix ${\bf A}$ to a vector reduces the $i$th row of ${\bf A}$ +to a scalar $w_i$. This is like \verb"w=sum(A')" since by default, MATLAB +reduces down the columns, not across the rows. + +\vspace{0.05in} +{\footnotesize +\begin{tabular}{lll} +\hline +\verb'GrB_mxm' & matrix-matrix multiply & ${\bf C \langle M \rangle = C \odot AB}$ \\ +\verb'GrB_vxm' & vector-matrix multiply & ${\bf w^{\sf T}\langle m^{\sf T}\rangle = w^{\sf T}\odot u^{\sf T}A}$ \\ +\verb'GrB_mxv' & matrix-vector multiply & ${\bf w \langle m \rangle = w \odot Au}$ \\ +\hline +\verb'GrB_eWiseMult' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \otimes B)}$ \\ + & set intersection & ${\bf w \langle m \rangle = w \odot (u \otimes v)}$ \\ +\hline +\verb'GrB_eWiseAdd' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ + & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ +\hline +\verb'GxB_eWiseUnion'& element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ + & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ +\hline +\verb'GrB_extract' & extract submatrix & ${\bf C \langle M \rangle = C \odot A(I,J)}$ \\ + & & ${\bf w \langle m \rangle = w \odot u(i)}$ \\ +\hline +\verb'GxB_subassign' & assign submatrix & ${\bf C (I,J) \langle M \rangle = C(I,J) \odot A}$ \\ + & (with submask for ${\bf C(I,J)}$) + & ${\bf w (i) \langle m \rangle = w(i) \odot u}$ \\ +\hline +\verb'GrB_assign' & assign submatrix & ${\bf C \langle M \rangle (I,J) = C(I,J) \odot A}$ \\ + & (with mask for ${\bf C}$) + & ${\bf w \langle m \rangle (i) = w(i) \odot u}$ \\ +\hline +\verb'GrB_apply' & apply unary operator & ${\bf C \langle M \rangle = C \odot} f{\bf (A)}$ \\ + & & ${\bf w \langle m \rangle = w \odot} f{\bf (u)}$ \\ + & apply binary operator & ${\bf C \langle M \rangle = C \odot} f({\bf A},y)$ \\ + & & ${\bf C \langle M \rangle = C \odot} f(x,{\bf A})$ \\ + & & ${\bf w \langle m \rangle = w \odot} f({\bf u},y)$ \\ + & & ${\bf w \langle m \rangle = w \odot} f(x,{\bf u})$ \\ + & apply index-unary op & ${\bf C \langle M \rangle = C \odot} f({\bf A},i,j,k)$ \\ + & & ${\bf w \langle m \rangle = w \odot} f({\bf u},i,0,k)$ \\ +\hline +\verb'GrB_select' & select entries & ${\bf C \langle M \rangle = C \odot} \mbox{select}({\bf A},i,j,k)$ \\ + & & ${\bf w \langle m \rangle = w \odot} \mbox{select}({\bf u},i,0,k)$ \\ +\hline +\verb'GrB_reduce' & reduce to vector & ${\bf w \langle m \rangle = w \odot} [{\oplus}_j {\bf A}(:,j)]$ \\ + & reduce to scalar & $s = s \odot [{\oplus}_{ij} {\bf A}(i,j)]$ \\ +\hline +\verb'GrB_transpose' & transpose & ${\bf C \langle M \rangle = C \odot A^{\sf T}}$ \\ +\hline +\verb'GrB_kronecker' & Kronecker product & ${\bf C \langle M \rangle = C \odot \mbox{kron}(A, B)}$ \\ +\hline +\end{tabular} +} +\vspace{0.15in} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_context.tex b/GraphBLAS/Doc/UserGuide/GrB_context.tex new file mode 100644 index 0000000000..749e235457 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_context.tex @@ -0,0 +1,251 @@ + +\newpage +%=============================================================================== +\section{{\sf GxB\_Context:} controlling computational resources} %============= +%=============================================================================== +\label{context} + +SuiteSparse:GraphBLAS v8.0.0 adds a new object, the \verb'GxB_Context', which +controls the number of threads used by OpenMP. In the future, this same object +will control the number of GPUs used. + +The \verb'GxB_Context' object is not needed if the user application is itself +single threaded, with all parallelism is inside GraphBLAS itself. The object +is also not needed if the user application is multi-threaded, but all user +threads create the same number of threads inside GraphBLAS (say each using a +single thread). In that case, \verb'GrB_set(GrB_GLOBAL,1,GxB_NTHREADS)' +can be used (for example). + +However, suppose the user application creates 5 threads of its own, on a +machine with 16 cores, and each thread wants to use a different number of +threads inside GraphBLAS (one user thread uses 8 OpenMP threads and the +the other four use 2 each, for example). This is where the \verb'GxB_Context' +object becomes essential. + +The default context is \verb'GxB_CONTEXT_WORLD', which is not created by the +user application but it can be modified. If a user thread does not create its +own context, then its computational resources are determine by this +\verb'GxB_CONTEXT_WORLD' object. The following \verb'GrB_set/get' methods +access this global object without naming it directly (where \verb'chunk' +is a \verb'GrB_Scalar' of type \verb'GrB_FP64' or \verb'GrB_FP32'): + + \begin{itemize} + \item \verb'GrB_set (GrB_GLOBAL, nthreads, GxB_NTHREADS)' + \item \verb'GrB_get (GrB_GLOBAL, &nthreads, GxB_NTHREADS)' + \item \verb'GrB_set (GrB_GLOBAL, chunk, GxB_CHUNK)' + \item \verb'GrB_get (GrB_GLOBAL, chunk, GxB_CHUNK)' + \end{itemize} + +The above methods control the OpenMP threads used by all user threads in the +user application. To allow each user thread to control its own OpenMP +threading, each user thread needs to create its own Context object via +\verb'GxB_Context_new'. Next, the user thread must {\em engage} this context +via \verb'GxB_Context_engage'; all subsequent calls to GraphBLAS from this +particular user thread will then use the number of OpenMP threads dictated by +this particular context. + +{\em Engaging} a \verb'GxB_Context' object assigns to a \verb'threadprivate' +space accessible only by this particular user thread, so that any calls to +GraphBLAS can access the settings in this object. + +The opposite operation is to {\em disengage} a context. This removes a +particular object from the \verb'threadprivate' space of the user thread +that is disengaging its context. + +After a context object is created, the user thread that owns it can modify +its settings in this object. An example appears in the \verb'GraphBLAS/Demo' +folder, part of which is listed below. + +{\footnotesize +\begin{verbatim} + + #pragma omp parallel for num_threads (nouter) schedule (dynamic, 1) + for (int k = 0 ; k < nmat ; k++) + { + // each user thread constructs its own context + GxB_Context Context = NULL ; + GxB_Context_new (&Context) ; + GrB_set (Context, ninner, GxB_NTHREADS) ; + GxB_Context_engage (Context) ; + + // kth user thread builds kth matrix with ninner threads + GrB_Matrix A = NULL ; + GrB_Matrix_new (&A, GrB_FP64, n, n) ; + GrB_Matrix_build (A, I, J, X, nvals, GrB_PLUS_FP64) ; + + // free the matrix just built + GrB_Matrix_free (&A) ; + + // each user thread frees its own context + GxB_Context_disengage (Context) ; + GxB_Context_free (&Context) ; + } +\end{verbatim} +} + +In this example, \verb'nouter' user threads are created. Inside the parallel +loop, each user thread creates and engages its own context object. In this +simple example, each user thread then uses \verb'ninner' threads to do some +work, although in principle each user thread to request a different number of +threads for each of its calls to GraphBLAS. This leads to nested parallelism, +so to use this context object effectively, the nested parallelism feature of +OpenMP must be enabled. + +The next sections describe the methods for a \verb'GxB_Context': + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GxB_Context_new' & create a context & \ref{context_new} \\ +\verb'GxB_Context_engage' & engage a context & \ref{context_engage} \\ +\verb'GxB_Context_disengage' & disengage a context & \ref{context_disengage} \\ +\verb'GxB_Context_free' & free a context & \ref{context_free} \\ +\verb'GxB_Context_wait' & wait for a context & \ref{context_wait} \\ +\hline +\hline +\verb'GrB_get' & get a value from a context & \ref{get_set_context} \\ +\verb'GrB_set' & set a value in a context & \ref{get_set_context} \\ +\hline +\hline +\verb'GxB_Context_fprint' & check/print a context & \ref{context_print} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsection{{\sf GxB\_Context\_new:} create a new context} +%------------------------------------------------------------------------------- +\label{context_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Context_new // create a new context +( + GxB_Context *Context // handle of context to create +) ; +\end{verbatim} } \end{mdframed} + +A new context is created and initialized with the current global settings for +\verb'GxB_NTHREADS' and \verb'GxB_CHUNK'. See \verb'GrB_get'. +The context object will not have an effect on any calls to GraphBLAS until it +is {\em engaged} by a user thread. + +%------------------------------------------------------------------------------- +\subsection{{\sf GxB\_Context\_engage:} engaging context} +%------------------------------------------------------------------------------- +\label{context_engage} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Context_engage // engage a Context +( + GxB_Context Context // Context to engage +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Context_engage' sets the provided Context object as the Context for +this user thread. Multiple user threads can share a single Context. Any prior +Context for this user thread is superseded by the new Context (the prior one is +not freed). \verb'GrB_SUCCESS' is returned, and future calls to GraphBLAS by +this user thread will use the provided Context. + +If the Context on input is the \verb'GxB_CONTEXT_WORLD' object, then the +current Context is disengaged. That is, the following calls have the same +effect, setting the Context of this user thread to \verb'GxB_CONTEXT_WORLD': + +{\footnotesize +\begin{verbatim} + GxB_Context_engage (GxB_CONTEXT_WORLD) ; + GxB_Context_disengage (NULL) ; +\end{verbatim} } + +The result for both cases above is \verb'GrB_SUCCESS'. + +Error cases: If \verb'Context' is NULL on input, \verb'GrB_NULL_POINTER' is +returned. If a non-NULL Context is provided but it is faulty in some way, then +an error code is returned (\verb'GrB_INVALID_OBJECT' or +\verb'GrB_UNINITIALIZED_OBJECT'). If an error code is returned, the current +Context for this user thread is unmodified. + +%------------------------------------------------------------------------------- +\subsection{{\sf GxB\_Context\_disengage:} disengaging context} +%------------------------------------------------------------------------------- +\label{context_disengage} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Context_disengage // disengage a Context +( + GxB_Context Context // Context to disengage +) ; +\end{verbatim} } \end{mdframed} + +If a NULL Context is provided or if the Context input parameter is +\verb'GxB_CONTEXT_WORLD', then any current Context for this user thread is +disengaged. If a valid non-NULL Context is provided and it matches the +current Context for this user thread, it is disengaged. In all of these +cases, \verb'GrB_SUCCESS' is returned. The user thread has no Context object and +any subsequent calls to GraphBLAS functions will use the world Context, +\verb'GxB_CONTEXT_WORLD'. + +Error cases: If a non-NULL Context is provided but it is faulty in some way, +then an error code is returned (\verb'GrB_INVALID_OBJECT' or +\verb'GrB_UNINITIALIZED_OBJECT'). If a non-NULL Context is provided on input +that doesn't match the current Context for this thread, then +\verb'GrB_INVALID_VALUE' is returned. If an error code is returned, the +current Context for this user thread is unmodified. + +%------------------------------------------------------------------------------- +\subsection{{\sf GxB\_Context\_free:} free a context} +%------------------------------------------------------------------------------- +\label{context_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a context +( + GxB_Context *Context // handle of Context to free +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Context_free' frees a descriptor. +Either usage: + + {\small + \begin{verbatim} + GxB_Context_free (&Context) ; + GrB_free (&Context) ; \end{verbatim}} + +\noindent +frees the \verb'Context' and sets \verb'Context' to \verb'NULL'. It +safely does nothing if passed a \verb'NULL' handle, or if +\verb'Context == NULL' on input. + +%------------------------------------------------------------------------------- +\subsection{{\sf GxB\_Context\_wait:} wait for a context} +%------------------------------------------------------------------------------- +\label{context_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a context +( + GxB_Context Context, // context to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating or modifying a context, a GraphBLAS library may choose to +exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing except to ensure that +\verb'Context' is valid. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_examples.tex b/GraphBLAS/Doc/UserGuide/GrB_examples.tex new file mode 100644 index 0000000000..3ee57a18fc --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_examples.tex @@ -0,0 +1,488 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Examples} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{examples} + +Several examples of how to use GraphBLAS are listed below. They all +appear in the \verb'Demo' folder of SuiteSparse:GraphBLAS. Programs in +the \verb'Demo' folder are meant as simple examples; for the fastest methods, +see LAgraph (Section~\ref{lagraph}). + +\begin{enumerate} +\item creating a random matrix +\item creating a finite-element matrix +\item reading a matrix from a file +\item complex numbers as a user-defined type +\item matrix import/export +\end{enumerate} + +Additional examples appear in the newly created LAGraph project, currently in +progress. + +%------------------------------------------------------------------------------- +\subsection{LAGraph} +%------------------------------------------------------------------------------- +\label{lagraph} + +The LAGraph project is a community-wide effort to create graph algorithms based +on GraphBLAS (any implementation of the API, not just SuiteSparse: GraphBLAS). +Some of the algorithms and utilities in LAGraph are listed in the table below. +Many additional algorithms are planned. Refer to +\url{https://github.com/GraphBLAS/LAGraph} for a current list of algorithms. All +functions in the \verb'Demo/' folder in SuiteSparse:GraphBLAS will eventually +be translated into algorithms or utilities for LAGraph, and then removed +from \verb'GraphBLAS/Demo'. + +To use LAGraph with SuiteSparse:GraphBLAS, place the two folders \verb'LAGraph' +and \verb'GraphBLAS' in the same parent directory. This allows the +\verb'cmake' script in LAGraph to find the copy of GraphBLAS. Alternatively, +the GraphBLAS source could be placed anywhere, as long as +\verb'sudo make install' is performed. + +%------------------------------------------------------------------------------- +\subsection{Creating a random matrix} +%------------------------------------------------------------------------------- +\label{random} + +The \verb'random_matrix' function in the \verb'Demo' folder generates a random +matrix with a specified dimension and number of entries, either symmetric or +unsymmetric, and with or without self-edges (diagonal entries in the matrix). +It relies on \verb'simple_rand*' functions in the \verb'Demo' folder to provide +a portable random number generator that creates the same sequence on any +computer and operating system. + +\verb'random_matrix' can use one of two methods: \verb'GrB_Matrix_setElement' +and \verb'GrB_Matrix_build'. The former method is very simple to use: + + {\footnotesize + \begin{verbatim} + GrB_Matrix_new (&A, GrB_FP64, nrows, ncols) ; + for (int64_t k = 0 ; k < ntuples ; k++) + { + GrB_Index i = simple_rand_i ( ) % nrows ; + GrB_Index j = simple_rand_i ( ) % ncols ; + if (no_self_edges && (i == j)) continue ; + double x = simple_rand_x ( ) ; + // A (i,j) = x + GrB_Matrix_setElement (A, x, i, j) ; + if (make_symmetric) + { + // A (j,i) = x + GrB_Matrix_setElement (A, x, j, i) ; + } + } \end{verbatim}} + +The above code can generate a million-by-million sparse \verb'double' matrix +with 200 million entries in 66 seconds (6 seconds of which is the time to +generate the random \verb'i', \verb'j', and \verb'x'), including the time +to finish all pending computations. The user application does not need to +create a list of all the tuples, nor does it need to know how many entries will +appear in the matrix. It just starts from an empty matrix and adds them one at +a time in arbitrary order. GraphBLAS handles the rest. This method is not +feasible in MATLAB. + +The next method uses \verb'GrB_Matrix_build'. It is more complex to use than +\verb'setElement' since it requires the user application to allocate and fill +the tuple lists, and it requires knowledge of how many entries will appear in +the matrix, or at least a good upper bound, before the matrix is constructed. +It is slightly faster, creating the same matrix in 60 seconds, 51 seconds +of which is spent in \verb'GrB_Matrix_build'. + + {\footnotesize + \begin{verbatim} + GrB_Index *I, *J ; + double *X ; + int64_t s = ((make_symmetric) ? 2 : 1) * nedges + 1 ; + I = malloc (s * sizeof (GrB_Index)) ; + J = malloc (s * sizeof (GrB_Index)) ; + X = malloc (s * sizeof (double )) ; + if (I == NULL || J == NULL || X == NULL) + { + // out of memory + if (I != NULL) free (I) ; + if (J != NULL) free (J) ; + if (X != NULL) free (X) ; + return (GrB_OUT_OF_MEMORY) ; + } + int64_t ntuples = 0 ; + for (int64_t k = 0 ; k < nedges ; k++) + { + GrB_Index i = simple_rand_i ( ) % nrows ; + GrB_Index j = simple_rand_i ( ) % ncols ; + if (no_self_edges && (i == j)) continue ; + double x = simple_rand_x ( ) ; + // A (i,j) = x + I [ntuples] = i ; + J [ntuples] = j ; + X [ntuples] = x ; + ntuples++ ; + if (make_symmetric) + { + // A (j,i) = x + I [ntuples] = j ; + J [ntuples] = i ; + X [ntuples] = x ; + ntuples++ ; + } + } + GrB_Matrix_build (A, I, J, X, ntuples, GrB_SECOND_FP64) ; \end{verbatim}} + +The equivalent \verb'sprandsym' function in MATLAB takes 150 seconds, but +\verb'sprandsym' uses a much higher-quality random number generator to create +the tuples \verb'[I,J,X]'. Considering just the time for +\verb'sparse(I,J,X,n,n)' in \verb'sprandsym' (equivalent to +\verb'GrB_Matrix_build'), the time is 70 seconds. That is, each of these three +methods, \verb'setElement' and \verb'build' in SuiteSparse:GraphBLAS, and +\verb'sparse' in MATLAB, are equally fast. + +%------------------------------------------------------------------------------- +\subsection{Creating a finite-element matrix} +%------------------------------------------------------------------------------- +\label{fem} + +Suppose a finite-element matrix is being constructed, with \verb'k=40,000' +finite-element matrices, each of size \verb'8'-by-\verb'8'. The following +operations (in pseudo-MATLAB notation) are very efficient in +SuiteSparse:GraphBLAS. + + {\footnotesize + \begin{verbatim} + A = sparse (m,n) ; % create an empty n-by-n sparse GraphBLAS matrix + for i = 1:k + construct a 8-by-8 sparse or dense finite-element F + I and J define where the matrix F is to be added: + I = a list of 8 row indices + J = a list of 8 column indices + % using GrB_assign, with the 'plus' accum operator: + A (I,J) = A (I,J) + F + end \end{verbatim}} + +If this were done in MATLAB or in GraphBLAS with blocking mode enabled, the +computations would be extremely slow. A far better approach is to construct a +list of tuples \verb'[I,J,X]' and to use \verb'sparse(I,J,X,n,n)'. This is +identical to creating the same list of tuples in GraphBLAS and using the +\verb'GrB_Matrix_build', which is equally fast. + +In SuiteSparse:GraphBLAS, the performance of both methods is essentially +identical, and roughly as fast as \verb'sparse' in MATLAB. Inside +SuiteSparse:GraphBLAS, \verb'GrB_assign' is doing the same thing. When +performing \verb'A(I,J)=A(I,J)+F', if it finds that it cannot quickly insert an +update into the \verb'A' matrix, it creates a list of pending tuples to be +assembled later on. When the matrix is ready for use in a subsequent +GraphBLAS operation (one that normally cannot use a matrix with pending +computations), the tuples are assembled all at once via +\verb'GrB_Matrix_build'. + +GraphBLAS operations on other matrices have no effect on when the pending +updates of a matrix are completed. Thus, any GraphBLAS method or operation can +be used to construct the \verb'F' matrix in the example above, without +affecting when the pending updates to \verb'A' are completed. + +The MATLAB \verb'wathen.m' script is part of Higham's \verb'gallery' of +matrices \cite{Higham}. It creates a finite-element matrix with random +coefficients for a 2D mesh of size \verb'nx'-by-\verb'ny', a matrix formulation +by Wathen \cite{Wathen}. The pattern of the matrix is fixed; just the values +are randomized. The GraphBLAS equivalent can use either +\verb'GrB_Matrix_build', or \verb'GrB_assign'. Both methods have good +performance. The \verb'GrB_Matrix_build' version below is about 15\% to 20\% +faster than the MATLAB \verb'wathen.m' function, regardless of the problem +size. It uses the identical algorithm as \verb'wathen.m'. + + {\footnotesize + \begin{verbatim} + int64_t ntriplets = nx*ny*64 ; + I = malloc (ntriplets * sizeof (int64_t)) ; + J = malloc (ntriplets * sizeof (int64_t)) ; + X = malloc (ntriplets * sizeof (double )) ; + if (I == NULL || J == NULL || X == NULL) + { + FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + ntriplets = 0 ; + for (int j = 1 ; j <= ny ; j++) + { + for (int i = 1 ; i <= nx ; i++) + { + nn [0] = 3*j*nx + 2*i + 2*j + 1 ; + nn [1] = nn [0] - 1 ; + nn [2] = nn [1] - 1 ; + nn [3] = (3*j-1)*nx + 2*j + i - 1 ; + nn [4] = 3*(j-1)*nx + 2*i + 2*j - 3 ; + nn [5] = nn [4] + 1 ; + nn [6] = nn [5] + 1 ; + nn [7] = nn [3] + 1 ; + for (int krow = 0 ; krow < 8 ; krow++) nn [krow]-- ; + for (int krow = 0 ; krow < 8 ; krow++) + { + for (int kcol = 0 ; kcol < 8 ; kcol++) + { + I [ntriplets] = nn [krow] ; + J [ntriplets] = nn [kcol] ; + X [ntriplets] = em (krow,kcol) ; + ntriplets++ ; + } + } + } + } + // A = sparse (I,J,X,n,n) ; + GrB_Matrix_build (A, I, J, X, ntriplets, GrB_PLUS_FP64) ; \end{verbatim}} + +The \verb'GrB_assign' version has the advantage of not requiring the +user application to construct the tuple list, and is almost as fast as using +\verb'GrB_Matrix_build'. The code is more elegant than either the MATLAB +\verb'wathen.m' function or its GraphBLAS equivalent above. Its performance is +comparable with the other two methods, but slightly slower, being about 5\% +slower than the MATLAB \verb'wathen', and 20\% slower than the GraphBLAS +method above. + + {\footnotesize + \begin{verbatim} + GrB_Matrix_new (&F, GrB_FP64, 8, 8) ; + for (int j = 1 ; j <= ny ; j++) + { + for (int i = 1 ; i <= nx ; i++) + { + nn [0] = 3*j*nx + 2*i + 2*j + 1 ; + nn [1] = nn [0] - 1 ; + nn [2] = nn [1] - 1 ; + nn [3] = (3*j-1)*nx + 2*j + i - 1 ; + nn [4] = 3*(j-1)*nx + 2*i + 2*j - 3 ; + nn [5] = nn [4] + 1 ; + nn [6] = nn [5] + 1 ; + nn [7] = nn [3] + 1 ; + for (int krow = 0 ; krow < 8 ; krow++) nn [krow]-- ; + for (int krow = 0 ; krow < 8 ; krow++) + { + for (int kcol = 0 ; kcol < 8 ; kcol++) + { + // F (krow,kcol) = em (krow, kcol) + GrB_Matrix_setElement (F, em (krow,kcol), krow, kcol) ; + } + } + // A (nn,nn) += F + GrB_assign (A, NULL, GrB_PLUS_FP64, F, nn, 8, nn, 8, NULL) ; + } + } \end{verbatim}} + +Since there is no \verb'Mask', and since \verb'GrB_REPLACE' is not used, the call +to \verb'GrB_assign' in the example above is identical to \verb'GxB_subassign'. +Either one can be used, and their performance would be identical. + +Refer to the \verb'wathen.c' function in the \verb'Demo' folder, which +uses GraphBLAS to implement the two methods above, and two additional ones. + +%------------------------------------------------------------------------------- +\subsection{Reading a matrix from a file} +%------------------------------------------------------------------------------- +\label{read} + +See also \verb'LAGraph_mmread' and \verb'LAGraph_mmwrite', which +can read and write any matrix in Matrix Market format, and +\verb'LAGraph_binread' and \verb'LAGraph_binwrite', which read/write a matrix +from a binary file. The binary file I/O functions are much faster than +the \verb'read_matrix' function described here, and also much faster than +\verb'LAGraph_mmread' and \verb'LAGraph_mmwrite'. + +The \verb'read_matrix' function in the \verb'Demo' reads in a triplet matrix +from a file, one line per entry, and then uses \verb'GrB_Matrix_build' to +create the matrix. It creates a second copy with \verb'GrB_Matrix_setElement', +just to test that method and compare the run times. +Section~\ref{random} has already compared +\verb'build' versus \verb'setElement'. + +The function can return the matrix as-is, which may be rectangular or +unsymmetric. If an input parameter is set to make the matrix symmetric, +\verb'read_matrix' computes \verb"A=(A+A')/2" if \verb'A' is square (turning +all directed edges into undirected ones). If \verb'A' is rectangular, it +creates a bipartite graph, which is the same as the augmented matrix, +\verb"A = [0 A ; A' 0]". +If \verb'C' is an \verb'n'-by-\verb'n' matrix, then \verb"C=(C+C')/2" can be +computed as follows in GraphBLAS, (the \verb'scale2' function divides an entry +by 2): + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + GrB_Descriptor_new (&dt2) ; + GrB_set (dt2, GrB_TRAN, GrB_INP1) ; + GrB_Matrix_new (&A, GrB_FP64, n, n) ; + GrB_eWiseAdd (A, NULL, NULL, GrB_PLUS_FP64, C, C, dt2) ; // A=C+C' + GrB_free (&C) ; + GrB_Matrix_new (&C, GrB_FP64, n, n) ; + GrB_UnaryOp_new (&scale2_op, scale2, GrB_FP64, GrB_FP64) ; + GrB_apply (C, NULL, NULL, scale2_op, A, NULL) ; // C=A/2 + GrB_free (&A) ; + GrB_free (&scale2_op) ; \end{verbatim}} + +This is of course not nearly as elegant as \verb"A=(A+A')/2" in MATLAB, but +with minor changes it can work on any type and use any built-in operators +instead of \verb'PLUS', or it can use any user-defined operators and types. +The above code in SuiteSparse:GraphBLAS takes 0.60 seconds for the +\verb'Freescale2' matrix, slightly slower than MATLAB (0.55 seconds). + +Constructing the augmented system is more complicated using the GraphBLAS C API +Specification since it does not yet have a simple way of specifying a range of +row and column indices, as in \verb'A(10:20,30:50)' in MATLAB (\verb'GxB_RANGE' +is a SuiteSparse:GraphBLAS extension that is not in the Specification). Using +the C API in the Specification, the application must instead build a list of +indices first, \verb'I=[10, 11' \verb'...' \verb'20]'. + +Thus, to compute the MATLAB equivalent of \verb"A = [0 A ; A' 0]", index lists +\verb'I' and \verb'J' must first be constructed: + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + int64_t n = nrows + ncols ; + I = malloc (nrows * sizeof (int64_t)) ; + J = malloc (ncols * sizeof (int64_t)) ; + // I = 0:nrows-1 + // J = nrows:n-1 + if (I == NULL || J == NULL) + { + if (I != NULL) free (I) ; + if (J != NULL) free (J) ; + return (GrB_OUT_OF_MEMORY) ; + } + for (int64_t k = 0 ; k < nrows ; k++) I [k] = k ; + for (int64_t k = 0 ; k < ncols ; k++) J [k] = k + nrows ; \end{verbatim}} + +Once the index lists are generated, however, the resulting GraphBLAS operations +are fairly straightforward, computing \verb"A=[0 C ; C' 0]". + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + GrB_Descriptor_new (&dt1) ; + GrB_set (dt1, GrB_TRAN, GrB_INP0) ; + GrB_Matrix_new (&A, GrB_FP64, n, n) ; + // A (nrows:n-1, 0:nrows-1) = C' + GrB_assign (A, NULL, NULL, C, J, ncols, I, nrows, dt1) ; + // A (0:nrows-1, nrows:n-1) = C + GrB_assign (A, NULL, NULL, C, I, nrows, J, ncols, NULL) ; \end{verbatim}} + +This takes 1.38 seconds for the \verb'Freescale2' matrix, almost as fast as \newline +\verb"A=[sparse(m,m) C ; C' sparse(n,n)]" in MATLAB (1.25 seconds). +The \verb'GxB_Matrix_concat' function would be faster still (this example +was written prior to \verb'GxB_Matrix_concat' was added to SuiteSparse:GraphBLAS). + +Both calls to \verb'GrB_assign' use no accumulator, so the second one +causes the partial matrix \verb"A=[0 0 ; C' 0]" to be built first, followed by +the final build of \verb"A=[0 C ; C' 0]". A better method, but not an obvious +one, is to use the \verb'GrB_FIRST_FP64' accumulator for both assignments. An +accumulator enables SuiteSparse:GraphBLAS to determine that that entries +created by the first assignment cannot be deleted by the second, and thus it +need not force completion of the pending updates prior to the second +assignment. + +SuiteSparse:GraphBLAS also adds a \verb'GxB_RANGE' mechanism that mimics +the MATLAB colon notation. This speeds up the method and simplifies the +code the user needs to write to compute \verb"A=[0 C ; C' 0]": + + \vspace{-0.05in} + {\footnotesize + \begin{verbatim} + int64_t n = nrows + ncols ; + GrB_Matrix_new (&A, xtype, n, n) ; + GrB_Index I_range [3], J_range [3] ; + I_range [GxB_BEGIN] = 0 ; + I_range [GxB_END ] = nrows-1 ; + J_range [GxB_BEGIN] = nrows ; + J_range [GxB_END ] = ncols+nrows-1 ; + // A (nrows:n-1, 0:nrows-1) += C' + GrB_assign (A, NULL, GrB_FIRST_FP64, // or NULL, + C, J_range, GxB_RANGE, I_range, GxB_RANGE, dt1) ; + // A (0:nrows-1, nrows:n-1) += C + GrB_assign (A, NULL, GrB_FIRST_FP64, // or NULL, + C, I_range, GxB_RANGE, J_range, GxB_RANGE, NULL) ; \end{verbatim}} + +Any operator will suffice because it is not actually applied. An operator is +only applied to the set intersection, and the two assignments do not overlap. +If an \verb'accum' operator is used, only the final matrix is built, and the +time in GraphBLAS drops slightly to 1.25 seconds. This is a very small +improvement because in this particular case, SuiteSparse:GraphBLAS is able to +detect that no sorting is required for the first build, and the second one is a +simple concatenation. In general, however, allowing GraphBLAS to postpone +pending updates can lead to significant reductions in run time. + +%------------------------------------------------------------------------------- +\subsection{User-defined types and operators} +%------------------------------------------------------------------------------- +\label{user} + +The \verb'Demo' folder contains two working examples of user-defined types, +first discussed in Section~\ref{type_new}: \verb'double complex', and a +user-defined \verb'typedef' called \verb'wildtype' with a \verb'struct' +containing a string and a 4-by-4 \verb'float' matrix. + +{\bf Double Complex:} +Prior to v3.3, GraphBLAS did not have a native complex type. It now appears as +the \verb'GxB_FC64' predefined type, but a complex type can also easily added +as a user-defined type. The \verb'Complex_init' function in the +\verb'usercomplex.c' file in the \verb'Demo' folder creates the \verb'Complex' +type based on the C11 \verb'double complex' type. +It creates a full suite of operators that correspond to every +built-in GraphBLAS operator, both binary and unary. In addition, it +creates the operators listed in the following table, where $D$ is +\verb'double' and $C$ is \verb'Complex'. + +\vspace{0.1in} +{\footnotesize +\begin{tabular}{llll} +\hline +name & types & MATLAB/Octave & description \\ + & & equivalent & \\ +\hline +\verb'Complex_complex' & $D \times D \rightarrow C$ & \verb'z=complex(x,y)' & complex from real and imag. \\ +\hline +\verb'Complex_conj' & $C \rightarrow C$ & \verb'z=conj(x)' & complex conjugate \\ +\verb'Complex_real' & $C \rightarrow D$ & \verb'z=real(x)' & real part \\ +\verb'Complex_imag' & $C \rightarrow D$ & \verb'z=imag(x)' & imaginary part \\ +\verb'Complex_angle' & $C \rightarrow D$ & \verb'z=angle(x)' & phase angle \\ +\verb'Complex_complex_real' & $D \rightarrow C$ & \verb'z=complex(x,0)' & real to complex real \\ +\verb'Complex_complex_imag' & $D \rightarrow C$ & \verb'z=complex(0,x)' & real to complex imag. \\ +\hline +\end{tabular} +} + +The \verb'Complex_init' function creates two monoids (\verb'Complex_add_monoid' +and \verb'Complex_times_monoid') and a semiring \verb'Complex_plus_times' that +corresponds to the conventional linear algebra for complex matrices. The +include file \verb'usercomplex.h' in the \verb'Demo' folder is available so +that this user-defined \verb'Complex' type can easily be imported into any +other user application. When the user application is done, the +\verb'Complex_finalize' function frees the \verb'Complex' type and its +operators, monoids, and semiring. +NOTE: the \verb'Complex' type is not supported in this Demo in Microsoft +Visual Studio. + +{\bf Struct-based:} +In addition, the \verb'wildtype.c' program creates a user-defined +\verb'typedef' of a \verb'struct' containing a dense 4-by-4 \verb'float' +matrix, and a 64-character string. It constructs an additive monoid that adds +two 4-by-4 dense matrices, and a multiplier operator that multiplies two 4-by-4 +matrices. Each of these 4-by-4 matrices is treated by GraphBLAS as a +``scalar'' value, and they can be manipulated in the same way any other +GraphBLAS type can be manipulated. The purpose of this type is illustrate the +endless possibilities of user-defined types and their use in GraphBLAS. + +%------------------------------------------------------------------------------- +\subsection{User applications using OpenMP or other threading models} +%------------------------------------------------------------------------------- +\label{threads} + +An example demo program (\verb'context_demo') is included that illustrates how a +multi-threaded user application can use GraphBLAS, where each user thread +calls GraphBLAS simultaneously, with nested parallelism. + +GraphBLAS can also be combined with user applications that rely on MPI, the +Intel TBB threading library, POSIX pthreads, Microsoft Windows threads, or any +other threading library. If GraphBLAS itself is compiled with OpenMP, +it will be thread safe when combined with other libraries. +See Section~\ref{omp_parallelism} for thread-safety issues that can occur +if GraphBLAS is compiled without OpenMP. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set.tex new file mode 100644 index 0000000000..9b11297b6d --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set.tex @@ -0,0 +1,177 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newpage +\section{GraphBLAS Options ({\sf GrB\_get} and {\sf GrB\_set})} +\label{options} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +GraphBLAS includes two methods, \verb'GrB_get' and \verb'GrB_set' +that allow the user to query GraphBLAS objects and change their state. These +two methods are polymorphic wrappers for a suite of methods for each object. + +The general polymorphic signatures of these methods are given below: + +{\footnotesize +\begin{verbatim} + GrB_Info GrB_get (object, value, int field) ; + GrB_Info GrB_set (object, value, int field) ; + GrB_Info GrB_set (object, void *value, int field, size_t s) ; \end{verbatim}} + +\noindent +where \verb'object' can be any GraphBLAS object. The \verb'value' can be a +\verb'GrB_Scalar', an \verb'int32_t' (or a pointer to \verb'int32_t' for +\verb'GrB_get'), a string (\verb'char *'), or a \verb'void *' pointer. In the +latter case, \verb'GrB_set' requires an additional parameter (\verb'size_t s') +that specifies the size of the object pointed to by \verb'void *value'. + +The non-polymorphic names have the following format, where \verb'[OBJ]' +is any GraphBLAS object. + +{\footnotesize +\begin{verbatim} + GrB_Info GrB_[OBJ]_get_[KIND] (object, value, int field) ; + GrB_Info GrB_[OBJ]_set_[KIND] (object, value, int field) ; + GrB_Info GrB_[OBJ]_set_VOID (object, void *value, int field, size_t s) ; \end{verbatim}} + +The \verb'[KIND]' suffix defines the type of second parameter, and can be: + \verb'Scalar' (for \verb'GrB_Scalar'), + \verb'String' (for \verb'char *'), + \verb'INT32' (for \verb'int32_t'), and + \verb'SIZE' (for \verb'size_t *' for \verb'GrB_get' only), and + \verb'VOID' (for \verb'void *'). + +The tables below list all the valid fields that can be used for each object. +Each table contains four columns: (1) the \verb'int', +(2) a column labelled R/W, (3) a column defining the C type, and a description. +For the R/W column: + +\begin{itemize} +\item If the R/W column of a table is R, then the value can be read by \verb'GrB_get' + but not written by \verb'GrB_set'. +\item R/W means that both \verb'GrB_get' and \verb'GrB_set' can be used any number of times, + with different values. +\item R/W1 means that \verb'GrB_get' can be done multiple times, + but \verb'GrB_set' can be used only once. + Subsequent calls to \verb'GrB_set' return the error code \verb'GrB_ALREADY_SET'. +\item W means that only \verb'GrB_set' can be used (any number of times), + but \verb'GrB_get' cannot be done. +\end{itemize} + +The second parameter (\verb'value') of \verb'GrB_get' and \verb'GrB_set' can take on several +different C types, and it can also be a \verb'GrB_Scalar' that holds a value +with the given C type (or that can be typecasted to the given C type): + +\begin{itemize} +\item \verb'int32_t': + For \verb'GrB_set' the \verb'value' parameter is \verb'int32_t'. + For \verb'GrB_get' the \verb'value' parameter is \verb'int32_t *.' + The following example sets the global number of threads, and then + retrieves that \verb'value' into \verb'nthreads'. + + {\footnotesize + \begin{verbatim} + GrB_set (GrB_GLOBAL, 8, GxB_NTHREADS) ; + int32_t nthreads ; + GrB_get (GrB_GLOBAL, &nthreads, GxB_NTHREADS) ; + printf ("nthreads: %d\n", nthreads) ; \end{verbatim} } + + A \verb'GrB_Scalar' can also be used for an \verb'int32_t' \verb'value'. + For \verb'GrB_set', the scalar must not be empty. + Here is the same example but using a \verb'GrB_Scalar' instead: + + {\footnotesize + \begin{verbatim} + GrB_Scalar s ; + GrB_Scalar_new (s, GrB_INT32) ; + GrB_Scalar_setElement (s, 8) ; + GrB_set (GrB_GLOBAL, s, GxB_NTHREADS) ; + GrB_get (GrB_GLOBAL, s, GxB_NTHREADS) ; + int32_t nthreads ; + GrB_Scalar_extractElement (&nthreads, s) ; + printf ("nthreads: %d\n", nthreads) ; \end{verbatim} } + +\item \verb'char *': + The \verb'value' parameter is \verb'char *' for both \verb'GrB_get' and + \verb'GrB_set'. A \verb'GrB_Scalar' cannot be used. The size of the + string required for \verb'GrB_get' is given by using a \verb'size_t *' + parameter with the same field. For example: + + {\footnotesize + \begin{verbatim} + size_t len ; + GrB_get (GrB_GLOBAL, &len, GrB_NAME) ; + char *name = malloc (len) ; + GrB_get (GrB_GLOBAL, name, GrB_NAME) ; + printf ("The library is: %s\n", name) ; + free (name) ; \end{verbatim} } + + To get the current JIT C compiler and then set it to something else: + + {\footnotesize + \begin{verbatim} + size_t len ; + GrB_get (GrB_GLOBAL, &len, GxB_JIT_C_COMPILER_NAME) ; + char *compiler = malloc (len) ; + GrB_get (GrB_GLOBAL, compiler, GxB_JIT_C_COMPILER_NAME) ; + printf ("The current JIT compiler is: %s\n", compiler) ; + GrB_set (GrB_GLOBAL, "gcc", GxB_JIT_C_COMPILER_NAME) ; + GrB_get (GrB_GLOBAL, &len, GxB_JIT_C_COMPILER_NAME) ; + char *new_compiler = malloc (len) ; + GrB_get (GrB_GLOBAL, new_compiler, GxB_JIT_C_COMPILER_NAME) ; + printf ("The new JIT compiler is: %s\n", new_compiler) ; + free (compiler) ; + free (new_compiler) ; \end{verbatim} } + +\item Other scalar data types (typically \verb'double'): + Only a \verb'GrB_Scalar' can be used. When using \verb'GrB_set' with a + \verb'GrB_Scalar', the scalar cannot be empty. For example, to get then + set the global \verb'GxB_HYPER_SWITCH' parameter to 0.3: + + {\footnotesize + \begin{verbatim} + GrB_Scalar s ; + GrB_Scalar_new (s, GrB_FP64) ; + GrB_get (GrB_GLOBAL, s, GxB_HYPER_SWITCH) ; + double hs ; + GrB_Scalar_extractElement (&hs, s) ; + printf ("current hyper_switch: %g\n", hs) ; + GrB_Scalar_setElement (s, 0.3) ; + GrB_set (GrB_GLOBAL, s, GxB_HYPER_SWITCH) ; \end{verbatim} } + +\item \verb'void *': + This type is used for all other cases. + For \verb'GrB_get', the array must have the right size, just like a + \verb'char *' string. Use the same field first, but with + \verb'size_t *value' as the second parameter to obtain the size of the + \verb'void *' array, then use \verb'GrB_get' with a \verb'void *' array of + the right size. In some cases, the size is always the same. For example, + to query the operator of a monoid: + + {\footnotesize + \begin{verbatim} + GrB_BinaryOp op ; + GrB_get (GrB_PLUS_MONOID_FP64, (void *) &op, GxB_MONOID_OPERATOR) ; + assert (op == GrB_PLUS_FP64) ; \end{verbatim} } + + For \verb'GrB_set', a fourth parameter is required to tell GraphBLAS the + size of the input array. + +\end{itemize} + +\input{UserGuide/GrB_get_set_enum.tex} +\input{UserGuide/GrB_get_set_Global.tex} +\input{UserGuide/GrB_get_set_Type.tex} +\input{UserGuide/GrB_get_set_UnaryOp.tex} +\input{UserGuide/GrB_get_set_IndexUnaryOp.tex} +\input{UserGuide/GrB_get_set_BinaryOp.tex} +\input{UserGuide/GrB_get_set_IndexBinaryOp.tex} +\input{UserGuide/GrB_get_set_Monoid.tex} +\input{UserGuide/GrB_get_set_Semiring.tex} +\input{UserGuide/GrB_get_set_Matrix.tex} +\input{UserGuide/GrB_get_set_Vector.tex} +\input{UserGuide/GrB_get_set_Scalar.tex} +\input{UserGuide/GrB_get_set_integers.tex} +\input{UserGuide/GrB_get_set_Descriptor.tex} +\input{UserGuide/GrB_get_set_Context.tex} +\input{UserGuide/GrB_get_set_Serialize.tex} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_BinaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_BinaryOp.tex new file mode 100644 index 0000000000..6ced3c71c2 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_BinaryOp.tex @@ -0,0 +1,68 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_BinaryOp} Options} +\label{get_set_binop} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_BinaryOp op, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_BinaryOp op, char * value, int f) ; +GrB_Info GrB_get (GrB_BinaryOp op, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_BinaryOp op, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_BinaryOp op, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) + name of the operator. For built-in operators, this returns the GraphBLAS + name (\verb'"GrB_LOR"' for \verb'GrB_LOR', for example). + For user-defined operators, the name can be any string of any length. It + is not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C function to enable its use in the JIT. + The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including + the \verb'nul' terminating byte. It can be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + definition for a user-defined operator, as a C function; built-in operators + return an empty string. It can be set at most once. \\ +\verb'GxB_THETA' & R & \verb'GrB_Scalar' & + value of \verb'Theta', if any. + The type of the \verb'GrB_Scalar' + must match the \verb'Theta' type of the underlying + index-binary operator exactly. \\ +\hline +\end{tabular} +} + +Built-in operators cannot be modified by \verb'GrB_set'. User-defined +operators can be used without setting their name or definition, but they can be +used in JIT kernels only when both the JIT C name and the definition are set. + +To use the JIT, all monoids and semirings that access this binary operator must +be defined after the user-defined operator has been given both a name and a +definition. GraphBLAS can use a monoid or semiring that uses a binary operator +without a name, but it cannot use the JIT, even if the operator is given a name +later on after the operator is created. + +The \verb'*THETA*' options can only be used in the binary operator was +created by \verb'GxB_BinaryOp_new_IndexOp'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Context.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Context.tex new file mode 100644 index 0000000000..9c612bb722 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Context.tex @@ -0,0 +1,57 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GxB\_Context} Options} +\label{get_set_context} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GxB_Context Context, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GxB_Context Context, char * value, int f) ; +GrB_Info GrB_get (GxB_Context Context, int32_t * value, int f) ; +GrB_Info GrB_get (GxB_Context Context, size_t * value, int f) ; + +GrB_Info GrB_set (GxB_Context Context, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GxB_Context Context, char * value, int f) ; +GrB_Info GrB_set (GxB_Context Context, int32_t value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{3.5in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GxB_NTHREADS' & R/W & \verb'int32_t' & number of OpenMP threads to use; + See Section~\ref{omp_parallelism} \\ +\verb'GxB_CHUNK' & R/W & \verb'double' & chunk factor for task creation; + See Section~\ref{omp_parallelism} \\ +\hline +\verb'GrB_NAME' & R/W & \verb'char *' & name of the context. + This can be set any number of times for user-defined contexts. Built-in + contexts have the same name as the variable name (\verb'"GxB_CONTEXT_WORLD"' + for the \verb'GxB_CONTEXT_WORLD' context, for example) \\ +\hline +\end{tabular} +} + +NOTE: the non-polymorphic names for this method are +\verb'GxB_Context_get_[KIND]' and \verb'GxB_Context_set_[KIND]', where +\verb'KIND' can be: + \verb'Scalar' (for \verb'GrB_Scalar'), + \verb'String' (for \verb'char *'), + \verb'INT' (for \verb'int32_t'), and + \verb'SIZE' (for \verb'size_t *' for \verb'GrB_get' only), and + \verb'VOID' (for \verb'void *'). +The non-polymorphic suffix of \verb'INT' is used here instead of +\verb'INT32' because \verb'GxB_Context_*_INT32' appear as historical methods +in version v8.0 and earlier, which are now deprecated. + +For the \verb'int32_t' type, the use of the polymorphic \verb'GrB_set' and +\verb'GrB_get' accesses the correct version of this method. When using +non-polymorphic methods, the use of \verb'GxB_Context_get_INT' and +\verb'GxB_Context_set_INT' is recommended. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Descriptor.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Descriptor.tex new file mode 100644 index 0000000000..9c27e17624 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Descriptor.tex @@ -0,0 +1,159 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Descriptor} Options} +\label{get_set_descriptor} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Descriptor desc, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Descriptor desc, char * value, int f) ; +GrB_Info GrB_get (GrB_Descriptor desc, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Descriptor desc, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_Descriptor desc, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GrB_Descriptor desc, char * value, int f) ; +GrB_Info GrB_set (GrB_Descriptor desc, int32_t value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{3.3in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_OUTP' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_REPLACE' \\ +\verb'GrB_MASK' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT', \verb'GrB_COMP', \verb'GrB_STRUCTURE', or + \newline \verb'GrB_COMP_STRUCTURE' \\ +\verb'GrB_INP0' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_TRAN' \\ +\verb'GrB_INP1' & R/W & \verb'int32_t'& \verb'GrB_DEFAULT' or \verb'GrB_TRAN' \\ +\verb'GxB_AxB_METHOD' & R/W & \verb'int32_t'& Method used by \verb'GrB_mxm' (\verb'GrB_DEFAULT', \newline + \verb'GxB_AxB_GUSTAVSON'. \verb'GxB_AxB_HASH', \newline + \verb'GxB_AxB_SAXPY', or \verb'GxB_AxB_DOT'). \\ +\verb'GxB_SORT' & R/W & \verb'int32_t'& if true, \verb'GrB_mxm' returns its output in sorted form. \\ +\verb'GxB_COMPRESSION' & R/W & \verb'int32_t'& compression method for serialize methods. \\ +% \verb'GxB_IMPORT' & R/W & \verb'int32_t'& \verb'GxB_FAST_IMPORT' or \verb'GxB_SECURE_IMPORT' for \verb'GxB*_pack*' methods. \\ +\verb'GxB_ROWINDEX_LIST' & R/W & \verb'int32_t' & how the \verb'GrB_Vector I' is intrepretted. \\ +\verb'GxB_COLINDEX_LIST' & R/W & \verb'int32_t' & how the \verb'GrB_Vector J' is intrepretted. \\ +\verb'GxB_VALUE_LIST' & R/W & \verb'int32_t' & how \verb'GrB_Vector X' is intrepretted (for \verb'GrB_build' only). \\ +\hline +\verb'GrB_NAME' & R/W & \verb'char *' & name of the descriptor. + This can be set any number of times for user-defined descriptors. Built-in + descriptors have the same name as the variable name (\verb'"GrB_DESC_T1"' + for the \verb'GrB_DESC_T1' descriptor, for example) \\ +\hline +\end{tabular} +} + +The following table describes each option. +See Section~\ref{descriptor} for more details. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{|l|p{2.4in}|p{2.2in}|} +\hline +Descriptor & Default & Non-default \\ +field & & \\ +\hline + +\verb'GrB_OUTP' + & \verb'GrB_DEFAULT': + The output matrix is not cleared. The operation computes + ${\bf C \langle M \rangle = C \odot T}$. + & \verb'GrB_REPLACE': + After computing ${\bf Z=C\odot T}$, + the output {\bf C} is cleared of all entries. + Then ${\bf C \langle M \rangle = Z}$ is performed. \\ + +\hline + +\verb'GrB_MASK' + & \verb'GrB_DEFAULT': + The Mask is not complemented. \verb'Mask(i,j)=1' means the value $C_{ij}$ + can be modified by the operation, while \verb'Mask(i,j)=0' means the value + $C_{ij}$ shall not be modified by the operation. + & \verb'GrB_COMP': + The Mask is complemented. \verb'Mask(i,j)=0' means the value $C_{ij}$ + can be modified by the operation, while \verb'Mask(i,j)=1' means the value + $C_{ij}$ shall not be modified by the operation. \\ + & + & \verb'GrB_STRUCTURE': + The values of the Mask are ignored. If \verb'Mask(i,j)' is an entry + in the \verb'Mask' matrix, it is treated as if \verb'Mask(i,j)=1'. + The two options \verb'GrB_COMP' and \verb'GrB_STRUCTURE' can be + combined, with two subsequent calls, or with a single call with the setting + \verb'GrB_COMP+GrB_STRUCTURE'. \\ + +\hline + +\verb'GrB_INP0' + & \verb'GrB_DEFAULT': + The first input is not transposed prior to using it in the operation. + & \verb'GrB_TRAN': + The first input is transposed prior to using it in the operation. Only + matrices are transposed, never vectors. \\ + +\hline + +\verb'GrB_INP1' + & \verb'GrB_DEFAULT': + The second input is not transposed prior to using it in the operation. + & \verb'GrB_TRAN': + The second input is transposed prior to using it in the operation. Only + matrices are transposed, never vectors. \\ + +\hline + +\verb'GxB_AxB_METHOD' + & \verb'GrB_DEFAULT': + The method for \verb'C=A*B' is selected automatically. + & \verb'GxB_AxB_'{\em method}: The selected method is used to compute + \verb'C=A*B'. \\ + +\hline + +\verb'GxB_SORT' + & \verb'GrB_DEFAULT': + The computation of \verb'C=A*B' may leave \verb'C' in a jumbled state; + \verb'GrB_wait' will finalize the matrix. + & any nonzero value: \verb'C=A*B' always returns \verb'C' in final, + sorted form. \\ + +\hline + +\verb'GxB_COMPRESSION' + & \verb'GrB_DEFAULT': + Serialize methods will use the default method, ZSTD (level 1) + & See Section~\ref{serialize_deserialize} \\ + +% \hline +% \verb'GxB_IMPORT' +% & \verb'GrB_DEFAULT': fast import +% & \verb'GxB_SECURE_IMPORT': secure import \\ + +\hline +\verb'GxB_ROWINDEX_LIST' + & \verb'GrB_DEFAULT' or \verb'GxB_USE_VALUES': use the values of \verb'I' + & \verb'GxB_USE_INDICES': use the indices of \verb'I'; + \verb'GxB_IS_STRIDE': \verb'I' is a strided range (\verb'lo:inc:hi') \\ + +\hline +\verb'GxB_COLINDEX_LIST' + & \verb'GrB_DEFAULT' or \verb'GxB_USE_VALUES': use the values of \verb'J' + & \verb'GxB_USE_INDICES': use the indices of \verb'J'; + \verb'GxB_IS_STRIDE': \verb'J' is a strided range (\verb'lo:inc:hi') \\ + +\hline +\verb'GxB_VALUE_LIST' + & \verb'GrB_DEFAULT' or \verb'GxB_USE_VALUES': use the values of \verb'X' + & \verb'GxB_USE_INDICES': use the indices \\ + +\hline +\end{tabular} +} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Global.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Global.tex new file mode 100644 index 0000000000..d6e694acdd --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Global.tex @@ -0,0 +1,282 @@ + +%------------------------------------------------------------------------------- +\subsection{Global Options ({\sf GrB\_Global})} +\label{get_set_global} +%------------------------------------------------------------------------------- + +A single object \verb'GrB_GLOBAL' whose type is \verb'GrB_Global' is used to +denote global settings to read or modify. To use it with \verb'GrB_get' and +\verb'GrB_set', pass in \verb'GrB_GLOBAL' as the first parameter. + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Global g, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Global g, char * value, int f) ; +GrB_Info GrB_get (GrB_Global g, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Global g, size_t * value, int f) ; +GrB_Info GrB_get (GrB_Global g, void * value, int f) ; + +GrB_Info GrB_set (GrB_Global g, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GrB_Global g, char * value, int f) ; +GrB_Info GrB_set (GrB_Global g, int32_t value, int f) ; +GrB_Info GrB_set (GrB_Global g, void * value, int f, size_t s) ; +\end{verbatim} +}\end{mdframed} + + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.5in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_LIBRARY_VER_MAJOR' & R & \verb'int32_t'& major version of the library \\ +\verb'GrB_LIBRARY_VER_MINOR' & R & \verb'int32_t'& minor version of the library \\ +\verb'GrB_LIBRARY_VER_PATCH' & R & \verb'int32_t'& patch version of the library \\ +\verb'GrB_API_VER_MAJOR' & R & \verb'int32_t'& major version of the API \\ +\verb'GrB_API_VER_MINOR' & R & \verb'int32_t'& major version of the API \\ +\verb'GrB_API_VER_PATCH' & R & \verb'int32_t'& major version of the API \\ +\verb'GrB_BLOCKING_MODE' & R & \verb'int32_t'& blocking mode (\verb'GrB_BLOCKING' \newline + or \verb'GrB_NONBLOCKING') \\ +\verb'GxB_LIBRARY_OPENMP' & R & \verb'int32_t'& if OpenMP is in use (true/false) \\ +\verb'GrB_STORAGE_ORIENTATION_HINT' & R/W & \verb'int32_t'& see \verb'GrB_Orientation': default + format for matrices. \\ +% Matrices are held by row, unless this +% value is set to \verb'GrB_COLMAJOR'. \\ +\verb'GxB_NTHREADS' & R/W & \verb'int32_t'& number of OpenMP threads used. \newline + See Section~\ref{omp_parallelism}. \\ +% \verb'GxB_GPU_ID' & R/W & \verb'int32_t'& which GPU to use \\ +\verb'GxB_BURBLE' & R/W & \verb'int32_t'& diagnostic output (true/false). \newline + See Section~\ref{diag}. \\ +\verb'GxB_PRINT_1BASED' & R/W & \verb'int32_t'& matrices printed as 1-based or 0-based \\ +\verb'GxB_INCLUDE_READONLY_STATISTICS' &R/W& \verb'int32_t'& include read-only memory in statistics \\ +\verb'GxB_JIT_C_CONTROL' & R/W & \verb'int32_t'& see Section~\ref{jit} \\ +\verb'GxB_JIT_USE_CMAKE' & R/W & \verb'int32_t'& " \\ +\verb'GxB_ROWINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for row indices (32 or 64) \\ +\verb'GxB_COLINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for column indices (32 or 64) \\ +\verb'GxB_OFFSET_INTEGER_HINT' & R/W & \verb'int32_t'& hint for offsets (32 or 64) \\ +\hline +\verb'GxB_HYPER_SWITCH' & R/W & \verb'double' & global hypersparsity control. \newline + See Section~\ref{hypersparse}. \\ +\verb'GxB_HYPER_HASH' & R/W & \verb'int64_t' & global hypersparsity (hyper-hash) + control \\ +\verb'GxB_CHUNK' & R/W & \verb'double' & global chunk size for parallel task creation. + See Section~\ref{omp_parallelism}. \\ +\hline +\verb'GrB_NAME' & R & \verb'char *' & name of the library \newline + (\verb'"SuiteSparse:GraphBLAS"') \\ +\verb'GxB_LIBRARY_DATE' & R & \verb'char *' & library release date \\ +\verb'GxB_LIBRARY_ABOUT' & R & \verb'char *' & details about the library \\ +\verb'GxB_LIBRARY_LICENSE' & R & \verb'char *' & license of the library \\ +\verb'GxB_LIBRARY_COMPILE_DATE' & R & \verb'char *' & date the library was compiled \\ +\verb'GxB_LIBRARY_COMPILE_TIME' & R & \verb'char *' & time the library was compiled \\ +\verb'GxB_LIBRARY_URL' & R & \verb'char *' & URL for the library \\ +\verb'GxB_API_DATE' & R & \verb'char *' & C API release date \\ +\verb'GxB_API_ABOUT' & R & \verb'char *' & about the C API \\ +\verb'GxB_API_URL' & R & \verb'char *' & URL for the C API \\ +\verb'GxB_COMPILER_NAME' & R & \verb'char *' & name of the compiler used to compile the library \\ +\hline +\end{tabular} +} +\vspace{0.05in} + +\vspace{0.1in} +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.5in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GxB_JIT_C_COMPILER_NAME' & R/W & \verb'char *' & See Section~\ref{jit} \\ +\verb'GxB_JIT_C_COMPILER_FLAGS' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_C_LINKER_FLAGS' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_C_LIBRARIES' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_C_CMAKE_LIBS' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_C_PREFACE' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_ERROR_LOG' & R/W & \verb'char *' & " \\ +\verb'GxB_JIT_CACHE_PATH' & R/W & \verb'char *' & " \\ +\hline +\verb'GxB_BITMAP_SWITCH' & R/W & \verb'void *' & \verb'double' array of size \newline + \verb'GxB_NBITMAP_SWITCH'. \newline + See Section~\ref{bitmap_switch}. \\ +\verb'GxB_COMPILER_VERSION' & R & \verb'void *' & \verb'int32_t' array of size 3. + The version of the compiler used to + compile the library. \\ +\verb'GxB_PRINTF' & W & \verb'void *' & pointer to \verb'printf' function for diagnostic output. + See Section~\ref{diag}. \\ +\verb'GxB_FLUSH' & W & \verb'void *' & pointer to \verb'flush' function for diagnostic output. + See Section~\ref{diag}. \\ +\verb'GxB_MALLOC_FUNCTION' & R & \verb'void *' & malloc function \\ +\verb'GxB_CALLOC_FUNCTION' & R & \verb'void *' & calloc function \\ +\verb'GxB_REALLOC_FUNCTION' & R & \verb'void *' & realloc function \\ +\verb'GxB_FREE_FUNCTION' & R & \verb'void *' & free function \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsubsection{Global diagnostic settings} +\label{diag} +%------------------------------------------------------------------------------- + +\verb'GrB_set (GrB_GLOBAL, ..., GxB_BURBLE)' controls the burble setting. It can also be +controlled via \verb'GrB.burble(b)' in the MATLAB/Octave interface. + +{\footnotesize +\begin{verbatim} + GrB_set (GrB_GLOBAL, true, GxB_BURBLE) ; // enable burble + GrB_set (GrB_GLOBAL, false, GxB_BURBLE) ; // disable burble \end{verbatim}} + +If enabled, SuiteSparse:GraphBLAS reports which internal kernels it uses, and +how much time is spent. If you see the word \verb'generic', it means that +SuiteSparse:GraphBLAS was unable to use its JIT kernels, or its faster kernels +in \verb'Source/FactoryKernels', but used a generic kernel that relies on +function pointers. This is done for user-defined types and operators when they +cannot be used in the JIT, and when typecasting is performed. Generic kernels +are typically slower than the JIT kernels or kernels in +\verb'Source/FactoryKernels'. + +If you see a lot of \verb'wait' statements, it may mean that a lot of time is +spent finishing a matrix or vector. This may be the result of an inefficient +use of the \verb'setElement' and \verb'assign' methods. If this occurs you +might try changing the sparsity format of a vector or matrix to +\verb'GxB_BITMAP', assuming there's enough space for it. + +The following setting allows the user application to change the +function used to print diagnostic output: + +{\small +\begin{verbatim} + GrB_set (GrB_GLOBAL, (void *) printf, GxB_PRINTF, sizeof (void *)) ; \end{verbatim} } + +This also controls the output of the +\verb'GxB_*print' functions. By default this parameter is \verb'NULL', in +which case the C11 \verb'printf' function is used. The parameter is a +function pointer with the same signature as the C11 \verb'printf' +function. The MATLAB/Octave interface to GraphBLAS sets it to \verb'mexPrintf' +so that GraphBLAS can print to the MATLAB/Octave Command Window. + +After each call to the \verb'printf' function, an optional +\verb'flush' function is called, which is \verb'NULL' by default. If +\verb'NULL', the function is not used. This can be changed with: + +{\small +\begin{verbatim} + GrB_set (GrB_GLOBAL, (void *) flush, GxB_FLUSH, sizeof (void *)) ; \end{verbatim} } + +The \verb'flush' function takes no +arguments, and returns an \verb'int' which is 0 if successful, or any nonzero +value on failure (the same output as the C11 \verb'fflush' function, +except that \verb'flush' has no inputs). + +%------------------------------------------------------------------------------- +\subsubsection{OpenMP parallelism} +%------------------------------------------------------------------------------- +\label{omp_parallelism} + +SuiteSparse:GraphBLAS is a parallel library, based on OpenMP. By +default, all GraphBLAS operations will use up to the maximum number of threads +specified by the \verb'omp_get_max_threads' OpenMP function. For small +problems, GraphBLAS may choose to use fewer threads, using two parameters: the +maximum number of threads to use (which may differ from the +\verb'omp_get_max_threads' value), and a parameter called the \verb'chunk'. +Suppose \verb'work' is a measure of the work an operation needs to perform (say +the number of entries in the two input matrices for \verb'GrB_eWiseAdd'). No +more than \verb'floor(work/chunk)' threads will be used (or one thread if the +ratio is less than 1). + +\verb'GxB_NTHREADS' controls how many threads a method uses. + By default (if set to zero, or \verb'GrB_DEFAULT'), all available threads + are used. The maximum available threads is controlled by the global + setting, which is \verb'omp_get_max_threads ( )' by default. If set to + some positive integer \verb'nthreads' less than this maximum, at most + \verb'nthreads' threads will be used. + +\verb'GxB_CHUNK' is a \verb'double' value that controls how many threads + a method uses for small problems. +The default \verb'chunk' value is 65,536, but this may change in future +versions, or it may be modified when GraphBLAS is installed on a particular +machine. + +Both parameters can be set in two ways: + +\begin{itemize} + +\item Globally: If the following methods are used, then all subsequent +GraphBLAS operations will use these settings. Note the typecast, +\verb'(double)' \verb'chunk'. This is necessary if a literal constant such as +\verb'20000' is passed as this argument. The type of the constant must be +\verb'double'. + + {\footnotesize + \begin{verbatim} + int32_t nthreads_max = 40 ; + GrB_set (GrB_GLOBAL, nthreads_max, GxB_NTHREADS) ; + GrB_Scalar_new (&s, GrB_FP64) ; + GrB_Scalar_setElement (s, (double) 20000) ; + GrB_set (GrB_GLOBAL, s, GxB_CHUNK) ; \end{verbatim} } + +\item Context: this object can be used to choose a different number of +threads used in calls to GraphBLAS from different user threads, exploiting +nested parallelism. Refer to Section~\ref{context}. If a thread has engaged a +context object, it ignores the global settings for \verb'GxB_NTHREADS' and +\verb'GxB_CHUNK', and uses the settings in its own context instead. + +\end{itemize} + +The smaller of \verb'nthreads_max' and \verb'floor(work/chunk)' is used for any +given GraphBLAS operation, except that a single thread is used if this value is +zero or less. + +If either parameter is set to \verb'GrB_DEFAULT', then default values are used. +The default for \verb'nthreads_max' is the return value from +\verb'omp_get_max_threads', and the default chunk size is currently 65,536. + +If a descriptor value for either parameter is left at its default, or set to +\verb'GrB_DEFAULT', then the global setting is used. This global setting may +have been modified from its default, and this modified value will be used. + +For example, suppose \verb'omp_get_max_threads' reports 8 threads. If \newline +\verb'GrB_set (GrB_GLOBAL, 4, GxB_NTHREADS)' is used, then the global setting is four +threads, not eight. + +GraphBLAS may be compiled without OpenMP, by setting \verb'-DNOPENMP=1'. +The library will be thread-safe, with one exception. \verb'GrB_wait' is +intended to provide thread-safety by flushing the cache of one user thread +so the object can be safely read by another thread. This is accomplished +with \verb'pragma omp flush', but if OpenMP is not available, this does +nothing. If OpenMP is not available or \verb'-DNOPEMP=1' is used, then +user applications need to ensure their own thread safety when one user thread +computes a result that is then read by another thread. + +You can query GraphBLAS at run-time to ask if it was compiled with OpenMP: + +{\small +\begin{verbatim} + bool have_openmp ; + GrB_get (GrB_GLOBAL, &have_openmp, GxB_LIBRARY_OPENMP) ; + if (!have_openmp) printf ("GraphBLAS not compiled with OpenMP\n") ; \end{verbatim}} + +Compiling GraphBLAS without OpenMP is not recommended for installation in a +package manager (Linux, conda-forge, spack, brew, vcpkg, etc). + +%------------------------------------------------------------------------------- +\subsubsection{Other global options} +%------------------------------------------------------------------------------- + +\verb'GrB_BLOCKING_MODE' can only be queried by \verb'GrB_get'; it cannot be +modified by \verb'GrB_set'. The mode is the value passed to \verb'GrB_init' +(blocking or non-blocking). + +All threads in the same user application share the same global options, +including hypersparsity, bitmap options, and CSR/CSC format determined by +\verb'GrB_set', and the blocking mode determined by \verb'GrB_init'. +Specific format and hypersparsity parameters of each matrix are specific to +that matrix and can be independently changed. + +The \verb'GrB_LIBRARY_*' and \verb'GxB_LIBRARY_*' options can be used to query +the current implementation of SuiteSparse:GraphBLAS. The \verb'GrB_API_*' and +\verb'GxB_API_*' options can be used to query the current GraphBLAS C API +Specification. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexBinaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexBinaryOp.tex new file mode 100644 index 0000000000..29f7921a3a --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexBinaryOp.tex @@ -0,0 +1,60 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GxB\_IndexBinaryOp} Options} +\label{get_set_idxbinop} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GxB_IndexBinaryOp op, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, char * value, int f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, int32_t * value, int f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, size_t * value, int f) ; + +GrB_Info GrB_set (GxB_IndexBinaryOp op, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) + name of the operator. + For user-defined operators, the name can be any string of any length. It + is not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C function to enable its use in the JIT. + The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including + the \verb'nul' terminating byte. It can be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + definition for a user-defined operator, as a C function; built-in operators + return an empty string. It can be set at most once. \\ +\hline +\end{tabular} +} + +There are no built-in index-binary operators, but if there are in the future, +they will not be be modified by \verb'GrB_set'. User-defined operators can be +used without setting their name or definition, but they can be used in JIT +kernels only when both the JIT C name and the definition are set. + +To use the JIT, all semirings that access this index-binary operator must +be defined after the user-defined operator has been given both a name and a +definition. GraphBLAS can use a semiring that uses a binary operator +without a name, but it cannot use the JIT, even if the operator is given a name +later on after the operator is created. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexUnaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexUnaryOp.tex new file mode 100644 index 0000000000..2583039274 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_IndexUnaryOp.tex @@ -0,0 +1,51 @@ +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_IndexUnaryOp} Options} +\label{get_set_idxunop} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_IndexUnaryOp op, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_IndexUnaryOp op, char * value, int f) ; +GrB_Info GrB_get (GrB_IndexUnaryOp op, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_IndexUnaryOp op, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_IndexUnaryOp op, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (idxunop) + name of the operator. For built-in operators, this returns the GraphBLAS + name (\verb'"GrB_TRIL"' for \verb'GrB_TRIL', for example). + For user-defined operators, the name can be any string of any length. It + is not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C function to enable its use in the JIT. + The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including + the \verb'nul' terminating byte. It can be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + definition for a user-defined operator, as a C function; built-in operators + return an empty string. It can be set at most once. \\ +\hline +\end{tabular} +} + +Built-in operators cannot be modified by \verb'GrB_set'. User-defined +operators can be used without setting their name or definition, but they can be +used in JIT kernels only when both the JIT C name and the definition are set. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Matrix.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Matrix.tex new file mode 100644 index 0000000000..cb5e5d3f42 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Matrix.tex @@ -0,0 +1,331 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Matrix} Options} +\label{get_set_matrix} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Matrix A, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Matrix A, char * value, int f) ; +GrB_Info GrB_get (GrB_Matrix A, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Matrix A, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_Matrix A, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GrB_Matrix A, char * value, int f) ; +GrB_Info GrB_set (GrB_Matrix A, int32_t value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.2in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_STORAGE_ORIENTATION_HINT' & R/W & \verb'int32_t'& See \verb'GrB_Orientation', \newline + and Section~\ref{storage_orientation}. \\ +\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& matrix type \\ +\verb'GxB_SPARSITY_CONTROL' & R/W & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_IS_READONLY' & R & \verb'int32_t'& true if it has any read-only components \\ +\verb'GxB_WILL_WAIT' & R & \verb'int32_t'& will \verb'GrB_wait' do anything (Section~\ref{wait_status}) \\ +\verb'GxB_ISO' & R/W & \verb'int32_t'& iso status (Section~\ref{iso_status}) \\ +\verb'GxB_ROWINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for row indices (32 or 64) \\ +\verb'GxB_COLINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for column indices (32 or 64) \\ +\verb'GxB_OFFSET_INTEGER_BITS' & R & \verb'int32_t'& number of bits for offsets (32 or 64) \\ +\verb'GxB_ROWINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for row indices (0, 32, 64) \\ +\verb'GxB_COLINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for column indices (0, 32, 64) \\ +\verb'GxB_OFFSET_INTEGER_HINT' & R/W & \verb'int32_t'& hint for offsets (0, 32, 64) \\ +\hline +\verb'GrB_NAME' & R/W & \verb'char *' & name of the matrix. + This can be set any number of times. \\ +\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the matrix. \\ +\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the matrix. \\ +\hline +\verb'GxB_HYPER_SWITCH' & R/W & \verb'double' & See Section~\ref{hypersparse} \\ +\verb'GxB_BITMAP_SWITCH' & R/W & \verb'double' & See Section~\ref{bitmap_switch} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsubsection{Storing a matrix by row or by column} +\label{storage_orientation} +%------------------------------------------------------------------------------- + +The GraphBLAS \verb'GrB_Matrix' is entirely opaque to the user application, and +the GraphBLAS API does not specify how the matrix should be stored. However, +choices made in how the matrix is represented in a particular implementation, +such as SuiteSparse:GraphBLAS, can have a large impact on performance. + +Many graph algorithms are just as fast in any format, but some algorithms are +much faster in one format or the other. For example, suppose the user +application stores a directed graph as a matrix \verb'A', with the edge $(i,j)$ +represented as the value \verb'A(i,j)', and the application makes many accesses +to the $i$th row of the matrix, with \verb'GrB_Col_extract' +\verb'(w,...,A,GrB_ALL,...,i,desc)' with the transposed descriptor +(\verb'GrB_INP0' set to \verb'GrB_TRAN'). If the matrix is stored by column +this can be extremely slow, just like the expression \verb'w=A(i,:)' in MATLAB, +where \verb'i' is a scalar. Since this is a typical use-case in graph +algorithms, the default format in SuiteSparse:GraphBLAS is to store its +matrices by row, in Compressed Sparse Row format (CSR). + +MATLAB stores its sparse matrices by column, in ``non-hypersparse'' format, in +what is called the Compressed Sparse Column format, or CSC for short. An +\verb'm'-by-\verb'n' matrix in MATLAB is represented as a set of \verb'n' +column vectors, each with a sorted list of row indices and values of the +nonzero entries in that column. As a result, \verb'w=A(:,j)' is very fast in +MATLAB, since the result is already held in the data structure a single list, +the $j$th column vector. However, \verb'w=A(i,:)' is very slow in MATLAB, +since every column in the matrix has to be searched to see if it contains row +\verb'i'. In MATLAB, if many such accesses are made, it is much better to +transpose the matrix (say \verb"AT=A'") and then use \verb"w=AT(:,i)" instead. +This can have a dramatic impact on the performance of MATLAB. + +Likewise, if \verb'u' is a very sparse column vector and \verb'A' is stored by +column, then \verb"w=u'*A" (via \verb'GrB_vxm') is slower than \verb'w=A*u' +(via \verb'GrB_mxv'). The opposite is true if the matrix is stored by row. + +SuiteSparse:GraphBLAS stores its matrices by row, by default (with one +exception described below). However, it can also be instructed to store any +selected matrices, or all matrices, by column instead (just like MATLAB), so +that \verb'w=A(:,j)' (via \verb'GrB_Col_extract') is very fast. The change in +data format has no effect on the result, just the time and memory usage. To +use a column-oriented format by default, the following can be done in a user +application that tends to access its matrices by column. + + {\footnotesize + \begin{verbatim} + GrB_init (...) ; + // just after GrB_init: do the following: + GrB_set (GrB_GLOBAL, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; \end{verbatim} } + +If this is done, and no other \verb'GrB_set' calls are made with \newline +\verb'GrB_STORAGE_ORIENATION_HINT', all matrices will be stored by column. +The default format is \verb'GrB_ROWMAJOR'. + +All vectors (\verb'GrB_Vector') are held by column, and this cannot be changed. + +By default, matrices of size \verb'm-by-1' are held by column, regardless of +the global setting described above. Matrices of size \verb'1-by-n' with +\verb'n' not equal to 1 are held by row, regardless of the global setting. +The global setting only affects matrices with both \verb'm > 1' and \verb'n > 1'. +Empty matrices (\verb'0-by-0') are also controlled by the global setting. + +After creating a matrix with \verb'GrB_Matrix_new (&A, ...)', +its format can be changed arbitrarily with: + + {\footnotesize + \begin{verbatim} + GrB_set (A, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; + GrB_set (A, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; \end{verbatim} } + +If set to other values (\verb'GrB_BOTH' or \verb'GrB_UNKNOWN'), the +format is changed to \verb'GrB_ROWMAJOR'. + +With this setting, even an \verb'm-by-1' matrix can then be changed to be held +by row, for example. Likewise, once a \verb'1-by-n' matrix is created, it can +be converted to column-oriented format. + +%------------------------------------------------------------------------------- +\subsubsection{Hypersparse matrices} +\label{hypersparse} +%------------------------------------------------------------------------------- + +MATLAB can store an \verb'm'-by-\verb'n' matrix with a very large value of +\verb'm', since a CSC data structure takes $O(n+|{\bf A}|)$ memory, independent +of \verb'm', where $|{\bf A}|$ is the number of nonzeros in the matrix. It +cannot store a matrix with a huge \verb'n', and this structure is also +inefficient when $|{\bf A}|$ is much smaller than \verb'n'. In contrast, +SuiteSparse:GraphBLAS can store its matrices in {\em hypersparse} format, +taking only $O(|{\bf A}|)$ memory, independent of how it is stored (by row or +by column) and independent of both \verb'm' and \verb'n' +\cite{BulucGilbert08,BulucGilbert12}. + +In both the CSR and CSC formats, the matrix is held as a set of sparse vectors. +In non-hypersparse format, the set of sparse vectors is itself dense; all +vectors are present, even if they are empty. For example, an +\verb'm'-by-\verb'n' matrix in non-hypersparse CSC format contains \verb'n' +sparse vectors. Each column vector takes at least one integer to represent, +even for a column with no entries. This allows for quick lookup for a +particular vector, but the memory required is $O(n+|{\bf A}|)$. With a +hypersparse CSC format, the set of vectors itself is sparse, and columns with +no entries take no memory at all. The drawback of the hypersparse format is +that finding an arbitrary column vector \verb'j', such as for the computation +\verb'C=A(:,j)', takes $O(\log k)$ time if there $k \le n$ vectors in the data +structure. One advantage of the hypersparse structure is the memory required +for an \verb'm'-by-\verb'n' hypersparse CSC matrix is only $O(|{\bf A}|)$, +independent of \verb'm' and \verb'n'. Algorithms that must visit all non-empty +columns of a matrix are much faster when working with hypersparse matrices, +since empty columns can be skipped. + +The \verb'hyper_switch' parameter controls the hypersparsity of the internal +data structure for a matrix. The parameter is typically in the range 0 to 1. +The default is \verb'hyper_switch' = \verb'GxB_HYPER_DEFAULT', which is an +\verb'extern' \verb'const' \verb'double' value, currently set to 0.0625, or +1/16. This default ratio may change in the future. + +The \verb'hyper_switch' determines how the matrix is converted between the +hypersparse and non-hypersparse formats. Let $n$ be the number of columns of a +CSC matrix, or the number of rows of a CSR matrix. The matrix can have at most +$n$ non-empty vectors. + +Let $k$ be the actual number of non-empty vectors. That is, for the CSC +format, $k \le n$ is the number of columns that have at least one entry. Let +$h$ be the value of \verb'hyper_switch'. + +If a matrix is currently hypersparse, it can be converted to non-hypersparse if +the either condition $n \le 1$ or $k > 2nh$ holds, or both. Otherwise, it +stays hypersparse. Note that if $n \le 1$ the matrix is always stored as +non-hypersparse. + +If currently non-hypersparse, it can be converted to hypersparse if +both conditions $n > 1$ and $k \le nh$ hold. Otherwise, it stays +non-hypersparse. Note that if $n \le 1$ the matrix always remains +non-hypersparse. + +The default value of \verb'hyper_switch' is assigned at startup by +\verb'GrB_init', and can then be modified globally with \verb'GrB_set'. All +new matrices are created with the same \verb'hyper_switch', determined by the +global value. Once a particular matrix \verb'A' has been constructed, its +hypersparsity ratio can be modified from the default with: + + {\footnotesize + \begin{verbatim} + double hyper_switch = 0.2 ; + GrB_set (A, hyper_switch, GxB_HYPER_SWITCH) ; \end{verbatim}} + +To force a matrix to always be non-hypersparse, use \verb'hyper_switch' equal to +\verb'GxB_NEVER_HYPER'. To force a matrix to always stay hypersparse, set +\verb'hyper_switch' to \verb'GxB_ALWAYS_HYPER'. + +A \verb'GrB_Matrix' can thus be held in one of four formats: any combination of +hyper/non-hyper and CSR/CSC. All \verb'GrB_Vector' objects are always stored +in non-hypersparse CSC format. + +A new matrix created via \verb'GrB_Matrix_new' starts with $k=0$ and is created +in hypersparse form by default unless $n \le 1$ or if $h<0$, where $h$ is the +global \verb'hyper_switch' value. The matrix is created in either +\verb'GrB_ROWMAJOR' or \verb'GrB_COLMAJOR' format, as determined by the last call +to +\verb'GrB_set(GrB_GLOBAL,' \verb'..., GrB_STORAGE_ORIENTATION_HINT,...)' or \verb'GrB_init'. + +A new matrix \verb'C' created via \verb'GrB_dup (&C,A)' inherits the CSR/CSC +format, hypersparsity format, and \verb'hyper_switch' from \verb'A'. + +%------------------------------------------------------------------------------- +\subsubsection{Bitmap matrices} +\label{bitmap_switch} +%------------------------------------------------------------------------------- + +By default, SuiteSparse:GraphBLAS switches between all four formats +(hypersparse, sparse, bitmap, and full) automatically. Let $d = |{\bf A}|/mn$ +for an $m$-by-$n$ matrix $\bf A$ with $|{\bf A}|$ entries. If the matrix is +currently in sparse or hypersparse format, and is modified so that $d$ exceeds +a given threshold, it is converted into bitmap format. The default threshold +is controlled by the \verb'GxB_BITMAP_SWITCH' setting, which can be set +globally, or for a particular matrix or vector. + +The default value of the switch to bitmap format depends on $\min(m,n)$, for a +matrix of size $m$-by-$n$. For the global setting, the bitmap switch is a +\verb'double' array of size \verb'GxB_NBITMAP_SWITCH'. The defaults are given +below: + +\vspace{0.2in} +{\small +\begin{tabular}{lll} +parameter & default & matrix sizes \\ +\hline +\verb'bitmap_switch [0]' & 0.04 & $\min(m,n) = 1$ (and all vectors) \\ +\verb'bitmap_switch [1]' & 0.05 & $\min(m,n) = 2$ \\ +\verb'bitmap_switch [2]' & 0.06 & $\min(m,n) = 3$ to 4 \\ +\verb'bitmap_switch [3]' & 0.08 & $\min(m,n) = 5$ to 8 \\ +\verb'bitmap_switch [4]' & 0.10 & $\min(m,n) = 9$ to 16\\ +\verb'bitmap_switch [5]' & 0.20 & $\min(m,n) = 17$ to 32\\ +\verb'bitmap_switch [6]' & 0.30 & $\min(m,n) = 33$ to 64 \\ +\verb'bitmap_switch [7]' & 0.40 & $\min(m,n) > 64$ \\ +\end{tabular} +} +\vspace{0.2in} + +That is, by default a \verb'GrB_Vector' is held in bitmap format if its density +exceeds 4\%. To change the global settings, do the following: + +{\footnotesize +\begin{verbatim} + double bswitch [GxB_NBITMAP_SWITCH] = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 } ; + GrB_set (GrB_GLOBAL, (void *) bswitch, GxB_BITMAP_SWITCH, + GxB_NBITMAP_SWITCH * sizeof (double)) ; +\end{verbatim} +} + +If the matrix is currently in bitmap format, it is converted to full if all +entries are present, or to sparse/hypersparse if $d$ drops below $b/2$, if its +bitmap switch is $b$. A matrix or vector with $d$ between $b/2$ and $b$ +remains in its current format. + +%------------------------------------------------------------------------------- +\subsubsection{Sparsity status} +\label{sparsity_status} +%------------------------------------------------------------------------------- + +The sparsity status of a matrix can be queried with the following, which +returns a value of \verb'GxB_HYPERSPARSE' (1), \verb'GxB_SPARSE' (2), +\verb'GxB_BITMAP' (4), or \verb'GxB_FULL' (8). + +{\footnotesize +\begin{verbatim} + int32_t sparsity ; + GrB_get (A, &sparsity, GxB_SPARSITY_STATUS) ; \end{verbatim}} + +The sparsity format of a matrix can be controlled with the field set to +\verb'GxB_SPARSITY_CONTROL', for which the \verb'value' can be any mix (a sum or bitwise +or) of \verb'GxB_HYPERSPARSE', \verb'GxB_SPARSE', \verb'GxB_BITMAP', and +\verb'GxB_FULL'. By default, a matrix or vector can be held in any format, +with the default setting \verb'GxB_AUTO_SPARSITY', which is equal to +\verb'GxB_HYPERSPARSE' + \verb'GxB_SPARSE' + \verb'GxB_BITMAP' + +\verb'GxB_FULL' (15). To enable a matrix to take on just \verb'GxB_SPARSE' or +\verb'GxB_FULL' formats, but not \verb'GxB_HYPERSPARSE' or \verb'GxB_BITMAP', +for example, use the following: + +{\footnotesize +\begin{verbatim} + GrB_set (A, GxB_SPARSE + GxB_FULL, GxB_SPARSITY_CONTROL) ; \end{verbatim}} + +In this case, SuiteSparse:GraphBLAS will hold the matrix in sparse format +(\verb'CSR' or \verb'CSC', depending on its +\verb'GrB_STORAGE_ORIENTATION_HINT'), unless all entries are present, in which +case it will be converted to full format. + +Only the least significant 4 bits of the sparsity control are considered, so +the formats can be bitwise negated. For example, to allow for any format +except full: + +{\footnotesize +\begin{verbatim} + GrB_set (A, ~GxB_FULL, GxB_SPARSITY_CONTROL) ; \end{verbatim}} + +%------------------------------------------------------------------------------- +\subsubsection{iso status} +\label{iso_status} +%------------------------------------------------------------------------------- + +The \verb'GxB_ISO' option allows the iso status of a matrix or vector to be +queried. The option can be set, as well. If set true, this asks GraphBLAS to +attempt to revise the storage of the matrix to make it iso-valued. GraphBLAS +will check all the values, and if they are all the same, the matrix is +converted to an iso-valued format. If set false, the matrix is revised so that +it is held in a non-iso format, if it is stored in iso-valued form. + +%------------------------------------------------------------------------------- +\subsubsection{wait status} +\label{wait_status} +%------------------------------------------------------------------------------- + +The \verb'GxB_WILL_WAIT' option can be queried with \verb'GrB_get' to determine +if a call to \verb'GrB_wait' on the matrix, vector, or scalar will do any work. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Monoid.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Monoid.tex new file mode 100644 index 0000000000..ef90b4a645 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Monoid.tex @@ -0,0 +1,94 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Monoid} Options} +\label{get_set_monoid} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Monoid monoid, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Monoid monoid, char * value, int f) ; +GrB_Info GrB_get (GrB_Monoid monoid, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Monoid monoid, size_t * value, int f) ; +GrB_Info GrB_get (GrB_Monoid monoid, void * value, int f) ; + +GrB_Info GrB_set (GrB_Monoid monoid, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.5in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code \newline + (see \verb'GrB_Type_code') \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (monoid) + name of the monoid. For built-in monoids, this returns the GraphBLAS + name (\verb'"GrB_LOR_MONOID_BOOL"' for \verb'GrB_LOR_MONOID_BOOL', for example). + For user-defined monoids, the name can be any string of any length. It is + not used by the JIT. It can be set at most once. \\ +\hline +\verb'GxB_MONOID_IDENTITY' & R & \verb'GrB_Scalar' & + identity value of the monoid. The type of the \verb'GrB_Scalar' + must match the monoid type exactly. \\ +\verb'GxB_MONOID_TERMINAL' & R & \verb'GrB_Scalar' & + terminal value of a terminal monoid. The type of the \verb'GrB_Scalar' + must match the monoid type exactly. If the monoid is not terminal, + the \verb'GrB_Scalar' is returned with no entry. \\ +\hline +\verb'GxB_MONOID_OPERATOR' & R & \verb'void *' & + binary operator of the monoid, as a \verb'GrB_BinaryOp' \\ +\hline +\end{tabular} +} + +Built-in monoids cannot be modified by \verb'GrB_set'. + +For \verb'GxB_MONOID_OPERATOR', +the \verb'op' is returned as an alias, not as a new object. For example, +if a monoid is created with a user-defined binary operator, the following usage +returns a shallow copy of the operator: + + {\footnotesize + \begin{verbatim} + GrB_BinaryOp binop ; + GrB_BinaryOp_new (&binop, func, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; + GrB_Monoid monoid ; + GrB_Monoid_new (&monoid, binop, (bool) false) ; \end{verbatim} } + +With the above objects defined, the following two code snippets do the same thing: + + {\footnotesize + \begin{verbatim} + // getting an alias to the binary operator directly: + GrB_BinaryOp op ; + op = binop ; \end{verbatim} } + + {\footnotesize + \begin{verbatim} + // getting an alias to the binary operator using GrB_get: + GrB_BinaryOp op ; + GrB_get (monoid, (void *) &op, GxB_MONOID_OPERATOR) ; + assert (op == binop) ; \end{verbatim} } + +As a result, it is not valid to free both the \verb'op' and the \verb'binop', +since they are the same object. This usage returns the built-in \verb'GrB_LOR' +operator of the corresponding built-in monoid: + + {\footnotesize + \begin{verbatim} + GrB_BinaryOp op ; + GrB_get (GrB_LOR_MONOID, (void *) &op, GxB_MONOID_OPERATOR) ; + assert (op == GrB_LOR) ; \end{verbatim} } + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Scalar.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Scalar.tex new file mode 100644 index 0000000000..914489765d --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Scalar.tex @@ -0,0 +1,48 @@ + + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Scalar} Options} +\label{get_set_scalar} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Scalar s, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Scalar s, char * value, int f) ; +GrB_Info GrB_get (GrB_Scalar s, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Scalar s, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_Scalar s, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GrB_Scalar s, char * value, int f) ; +GrB_Info GrB_set (GrB_Scalar s, int32_t value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{3in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline + +\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& scalar type \\ +\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_IS_READONLY' & R & \verb'int32_t'& true if it has any read-only components \\ +\verb'GxB_WILL_WAIT' & R & \verb'int32_t'& will \verb'GrB_wait' do anything (Section~\ref{wait_status}) \\ +\verb'GxB_ISO' & R/W & \verb'int32_t'& iso status (Section~\ref{iso_status}) \\ +\hline +\verb'GrB_NAME' & R/W & \verb'char *' & name of the scalar. \\ +% This can be set any number of times. \\ +\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the scalar. \\ +\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the scalar. \\ +\hline +\end{tabular} +} +\vspace{0.1in} + +See Section~\ref{get_set_matrix}; a \verb'GrB_Scalar' is treated as if it were +a 1-by-1 matrix, and is always in column major form. It is never hypersparse. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Semiring.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Semiring.tex new file mode 100644 index 0000000000..68a5896c14 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Semiring.tex @@ -0,0 +1,106 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Semiring} Options} +\label{get_set_semiring} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Semiring semiring, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Semiring semiring, char * value, int f) ; +GrB_Info GrB_get (GrB_Semiring semiring, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Semiring semiring, size_t * value, int f) ; +GrB_Info GrB_get (GrB_Semiring semiring, void * value, int f) ; + +GrB_Info GrB_set (GrB_Semiring semiring, GrB_Scalar value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') + of the multiplicative operator \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code + of the multiplicative operator \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code + of the multiplicative operator, + and the monoid type. \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type + of the multiplicative operator \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type + of the multiplicative operator \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type + of the multiplicative operator, + and the monoid type. \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (semiring) + name of the semiring. For built-in semirings, this returns the GraphBLAS + name (\verb'"GrB_LOR_LAND_SEMIRING_BOOL"' for \verb'GrB_LOR_LAND_SEMIRING_BOOL', + for example). For user-defined semirings, the name can be any string of any + length. It is not used by the JIT. It can be set at most once. \\ +\verb'GxB_THETA' & R & \verb'GrB_Scalar' & + value of \verb'Theta', if any. + The type of the \verb'GrB_Scalar' + must match the \verb'Theta' type of the underlying + index-binary operator exactly. \\ +\hline +\end{tabular} +} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.5in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GxB_MONOID_IDENTITY' & R & \verb'GrB_Scalar' & + identity value of the monoid. The type of the \verb'GrB_Scalar' + must match the monoid type exactly. \\ +\verb'GxB_MONOID_TERMINAL' & R & \verb'GrB_Scalar' & + terminal value of a terminal monoid. The type of the \verb'GrB_Scalar' + must match the monoid type exactly. If the monoid is not terminal, + the \verb'GrB_Scalar' is returned with no entry. \\ +\hline +\verb'GxB_MONOID_OPERATOR' & R & \verb'void *' & + binary operator of the monoid, as a \verb'GrB_BinaryOp'; + See Section~\ref{get_set_monoid} \\ +\verb'GxB_SEMIRING_MONOID' & R & \verb'void *' & + monoid of the semiring, as a \verb'GrB_Monoid' \\ +\verb'GxB_SEMIRING_MULTIPLY' & R & \verb'void *' & + multiplicative operator of the semiring, as a \verb'GrB_BinaryOp' \\ +\hline +\end{tabular} +} + +Built-in semirings cannot be modified by \verb'GrB_set'. + +The \verb'GxB_SEMIRING_MONOID' option returns the \verb'GrB_Monoid' of the +semiring. The \verb'GxB_SEMIRING_MULTIPLY' option returns the +\verb'GrB_BinaryOp' for the multiplicative operator of the semiring. For +example: + + {\footnotesize + \begin{verbatim} + // getting an alias to the monoid and multiply operator using GrB_get: + GrB_BinaryOp op ; + GrB_Monoid mon ; + GrB_Semiring semiring = GrB_PLUS_TIMES_FP32 ; + GrB_get (semiring, (void *) &mon, GxB_SEMIRING_MONOID) ; + GrB_get (semiring, (void *) &op, GxB_SEMIRING_MULTIPLY) ; + assert (op == GrB_TIMES_FP32) ; + assert (mon == GrB_PLUS_MONOID_FP32) ; \end{verbatim} } + +The binary op and monoid returned are aliases, not new objects. + +The \verb'*THETA*' options can only be used in the multiplicative binary +operator of the semiring was created by \verb'GxB_BinaryOp_new_IndexOp'. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Serialize.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Serialize.tex new file mode 100644 index 0000000000..90df648ddd --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Serialize.tex @@ -0,0 +1,57 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{Options for inspecting a serialized blob} +\label{get_set_blob} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6.5in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (const void *blob, GrB_Scalar value, int f, size_t blobsize) ; +GrB_Info GrB_get (const void *blob, char * value, int f, size_t blobsize) ; +GrB_Info GrB_get (const void *blob, int32_t * value, int f, size_t blobsize) ; +GrB_Info GrB_get (const void *blob, size_t * value, int f, size_t blobsize) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.2in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_STORAGE_ORIENTATION_HINT' & R & \verb'int32_t'& See \verb'GrB_Orientation', \newline + and Section~\ref{storage_orientation}. \\ +\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& type of matrix in the blob \\ +\verb'GxB_SPARSITY_CONTROL' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_ISO' & R & \verb'int32_t'& iso status (Section~\ref{iso_status}) \\ +\verb'GxB_ROWINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for row indices (32 or 64) \\ +\verb'GxB_COLINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for column indices (32 or 64) \\ +\verb'GxB_OFFSET_INTEGER_BITS' & R & \verb'int32_t'& number of bits for offsets (32 or 64) \\ +\verb'GxB_ROWINDEX_INTEGER_HINT' & R & \verb'int32_t'& hint for row indices (0, 32, 64) \\ +\verb'GxB_COLINDEX_INTEGER_HINT' & R & \verb'int32_t'& hint for column indices (0, 32, 64) \\ +\verb'GxB_OFFSET_INTEGER_HINT' & R & \verb'int32_t'& hint for offsets (0, 32, 64) \\ +\hline +\verb'GrB_NAME' & R & \verb'char *' & name of the matrix in the blob. \\ +\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the matrix in the blob. \\ +\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the matrix in the blob. \\ +\hline +\verb'GxB_HYPER_SWITCH' & R & \verb'double' & See Section~\ref{hypersparse} \\ +\verb'GxB_BITMAP_SWITCH' & R & \verb'double' & See Section~\ref{bitmap_switch} \\ +\hline +\end{tabular} +} + +The \verb'GrB_Matrix_serialize' and \verb'GxB_Matrix_serialize' methods create +a {\em blob} as a single array of bytes that contains all content of a +\verb'GrB_Matrix'. These \verb'GrB_get' methods can query a blob for the same +values that can be queried for a \verb'GrB_Matrix'. The blob cannot be +modified by \verb'GrB_set'. + +Note that these \verb'GrB_get' methods add a fourth parameter, the size of +the blob. All other \verb'GrB_get' methods have just three parameters: +the object, the value, and the field. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Type.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Type.tex new file mode 100644 index 0000000000..ee7fed7dfc --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Type.tex @@ -0,0 +1,72 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Type} Options} +\label{get_set_type} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Type t, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Type t, char * value, int f) ; +GrB_Info GrB_get (GrB_Type t, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Type t, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_Type t, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.85in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& type code (see \verb'GrB_Type_Code') \\ +\verb'GrB_SIZE' & R & \verb'size_t' & \verb'sizeof' the type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (type) + name of the type. For built-in types, this returns the GraphBLAS + name (\verb'"GrB_FP32"' for \verb'GrB_FP32', for example). + For user-defined types, the name can be any string of any length. It is + not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C type to enable its use in the JIT. For + built-in types, this returns the C name of the type (\verb'"float"' for + \verb'GrB_FP32', for example). The length of the name can be at most + \verb'GxB_MAX_NAME_LEN', including the \verb'nul' terminating byte. It can + be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + type definition, as a C \verb'typedef'; + built-in types return an empty string. + It can be set at most once. \\ +\hline +\end{tabular} +} + +Built-in types cannot be modified by \verb'GrB_set'. User-defined types can be +used without setting their name or definition, but they can be used in JIT +kernels only when both the JIT C name and the definition are set. + +To use the JIT, all operators, monoids, and semirings that access this type +must be defined after the user-defined type has been given both a name and a +definition. GraphBLAS can use an operator that uses a type without a name, +but it cannot use the JIT, even if the type is given a name later on after +the operator is created. + +The size of the type can be returned as a \verb'size_t' C scalar, or as a +\verb'GrB_Scalar', normally of type \verb'GrB_UINT64', with the examples below. + +{\footnotesize +\begin{verbatim} + size_t size ; + GrB_get (GrB_FP32, &size, GrB_SIZE) ; + assert (size == sizeof (float)) ; + + GrB_Scalar s ; + GrB_Scalar_new (&s, GrB_UINT64) ; + GrB_get (GrB_FP32, s, GrB_SIZE) ; + GrB_Scalar_extractElement (&size, s) ; + assert (size == sizeof (float)) ; \end{verbatim}} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_UnaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_UnaryOp.tex new file mode 100644 index 0000000000..efeda06ba1 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_UnaryOp.tex @@ -0,0 +1,50 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_UnaryOp} Options} +\label{get_set_unop} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_UnaryOp op, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_UnaryOp op, char * value, int f) ; +GrB_Info GrB_get (GrB_UnaryOp op, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_UnaryOp op, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_UnaryOp op, char * value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& input type code (see \verb'GrB_Type_code') \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (unop) + name of the operator. For built-in operators, this returns the GraphBLAS + name (\verb'"GrB_LNOT"' for \verb'GrB_LNOT', for example). + For user-defined operators, the name can be any string of any length. It + is not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C function to enable its use in the JIT. + The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including + the \verb'nul' terminating byte. It can be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + definition for a user-defined operator, as a C function; built-in operators + return an empty string. It can be set at most once. \\ +\hline +\end{tabular} +} + +Built-in operators cannot be modified by \verb'GrB_set'. User-defined +operators can be used without setting their name or definition, but they can be +used in JIT kernels only when both the JIT C name and the definition are set. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_Vector.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_Vector.tex new file mode 100644 index 0000000000..eb208ccf1d --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_Vector.tex @@ -0,0 +1,55 @@ + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GrB\_Vector} Options} +\label{get_set_vector} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GrB_Vector v, GrB_Scalar value, int f) ; +GrB_Info GrB_get (GrB_Vector v, char * value, int f) ; +GrB_Info GrB_get (GrB_Vector v, int32_t * value, int f) ; +GrB_Info GrB_get (GrB_Vector v, size_t * value, int f) ; + +GrB_Info GrB_set (GrB_Vector v, GrB_Scalar value, int f) ; +GrB_Info GrB_set (GrB_Vector v, char * value, int f) ; +GrB_Info GrB_set (GrB_Vector v, int32_t value, int f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{3in}|} +\hline +\verb'int field' & R/W & C type & description \\ +\hline +\verb'GrB_EL_TYPE_CODE' & R & \verb'int32_t'& vector type \\ +\verb'GxB_SPARSITY_CONTROL' & R/W & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_SPARSITY_STATUS' & R & \verb'int32_t'& See Section~\ref{sparsity_status} \\ +\verb'GxB_IS_READONLY' & R & \verb'int32_t'& true if it has any read-only components \\ +\verb'GxB_WILL_WAIT' & R & \verb'int32_t'& will \verb'GrB_wait' do anything (Section~\ref{wait_status}) \\ +\verb'GxB_ISO' & R/W & \verb'int32_t'& iso status (Section~\ref{iso_status}) \\ +\verb'GxB_ROWINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for row indices (32 or 64) \\ +\verb'GxB_COLINDEX_INTEGER_BITS' & R & \verb'int32_t'& number of bits for column indices (32 or 64) \\ +\verb'GxB_OFFSET_INTEGER_BITS' & R & \verb'int32_t'& number of bits for offsets (32 or 64) \\ +\verb'GxB_ROWINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for row indices (0, 32, 64) \\ +\verb'GxB_COLINDEX_INTEGER_HINT' & R/W & \verb'int32_t'& hint for column indices (0, 32, 64) \\ +\verb'GxB_OFFSET_INTEGER_HINT' & R/W & \verb'int32_t'& hint for offsets (0, 32, 64) \\ +\hline +\verb'GrB_NAME' & R/W & \verb'char *' & name of the vector. \\ +% This can be set any number of times. \\ +\verb'GrB_EL_TYPE_STRING' & R & \verb'char *' & name of the type of the vector. \\ +\verb'GxB_JIT_C_NAME' & R & \verb'char *' & JIT C name of the type of the vector. \\ +\hline +\verb'GxB_BITMAP_SWITCH' & R/W & \verb'double' & See Section~\ref{bitmap_switch} \\ +\hline +\end{tabular} +} + +See Section~\ref{get_set_matrix}; a \verb'GrB_Vector' is treated as if it were +an $n$-by-1 matrix, and is always in column major form. It is never +hypersparse. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_enum.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_enum.tex new file mode 100644 index 0000000000..1bac485804 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_enum.tex @@ -0,0 +1,164 @@ + +%------------------------------------------------------------------------------- +\subsection{Enum types for get/set} +\label{get_set_enums} +%------------------------------------------------------------------------------- + +The get/set methods share a \verb'int' (enum) type to specify which component +of the object is to be set or retrieved. + +{\footnotesize +\begin{verbatim} +typedef enum +{ + // GrB_Descriptor only: + GrB_OUTP_FIELD = 0, // descriptor for output of a method + GrB_MASK_FIELD = 1, // descriptor for the mask input of a method + GrB_INP0_FIELD = 2, // descriptor for the first input of a method + GrB_INP1_FIELD = 3, // descriptor for the second input of a method + + // all objects, including GrB_GLOBAL: + GrB_NAME = 10, // name of the object, as a string + + // GrB_GLOBAL only: + GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, // C API version + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, // GrB_Mode + + // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize?): + GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation + + // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize): + GrB_EL_TYPE_CODE = 102, // a GrB_Type_code (see below) + GrB_EL_TYPE_STRING = 106, // name of the type + + // GrB_*Op, GrB_Monoid, and GrB_Semiring: + GrB_INP1_TYPE_CODE = 103, // GrB_Type_code + GrB_INP2_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP1_TYPE_STRING = 107, // name of the type, as a string + GrB_INP2_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, + + // GrB_Type (readable only): + GrB_SIZE = 110, // size of the type + + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp + GxB_JIT_C_NAME = 7041, // C type or function name + GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition + + // GrB_Monoid and GrB_Semiring: + GxB_MONOID_IDENTITY = 7043, // monoid identity value + GxB_MONOID_TERMINAL = 7044, // monoid terminal value + GxB_MONOID_OPERATOR = 7045, // monoid binary operator + + // GrB_Semiring only: + GxB_SEMIRING_MONOID = 7046, // semiring monoid + GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring: + GxB_THETA = 7052, // to get the value of theta + + // GrB_get/GrB_set for GrB_Matrix, GrB_Vector, GrB_Scalr and GrB_GLOBAL: + GxB_ROWINDEX_INTEGER_HINT = 7053, // hint for row indices + GxB_COLINDEX_INTEGER_HINT = 7054, // hint for column indices + GxB_OFFSET_INTEGER_HINT = 7056, // hint for offsets + GxB_HYPER_SWITCH = 7000, // switch to hypersparse (double value) + GxB_HYPER_HASH = 7048, // hyper_hash control (global int64 value, + // or bool per matrix) + GxB_BITMAP_SWITCH = 7001, // switch to bitmap (double value) + + // GrB_get/GrB_set for GrB_Matrix, GrB_Vector, GrB_Scalar: + GxB_ISO = 7079, // get: returns the current iso status + // set true: make the matrix iso-valued, if possible. + // set false: make the matrix non-iso-valued. + GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below + + // GrB_get for GrB_Matrix, GrB_Vector, GrB_Scalar: + GxB_ROWINDEX_INTEGER_BITS = 7057, // # bits for row indices + GxB_COLINDEX_INTEGER_BITS = 7058, // # bits for column indices + GxB_OFFSET_INTEGER_BITS = 7059, // # bits for offsets + GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) + GxB_IS_READONLY = 7078, // true if it has any read-only components + GxB_WILL_WAIT = 7076, // true if GrB_wait(A) will do anything + + // GrB_get for GrB_GLOBAL: + GxB_LIBRARY_DATE = 7006, // date of the library (char *) + GxB_LIBRARY_ABOUT = 7007, // about the library (char *) + GxB_LIBRARY_URL = 7008, // URL for the library (char *) + GxB_LIBRARY_LICENSE = 7009, // license of the library (char *) + GxB_LIBRARY_COMPILE_DATE = 7010, // date library was compiled (char *) + GxB_LIBRARY_COMPILE_TIME = 7011, // time library was compiled (char *) + GxB_API_DATE = 7013, // date of the API (char *) + GxB_API_ABOUT = 7014, // about the API (char *) + GxB_API_URL = 7015, // URL for the API (char *) + GxB_COMPILER_VERSION = 7016, // compiler version (3 int's) + GxB_COMPILER_NAME = 7017, // compiler name (char *) + GxB_LIBRARY_OPENMP = 7018, // library compiled with OpenMP + GxB_MALLOC_FUNCTION = 7037, // malloc function pointer + GxB_CALLOC_FUNCTION = 7038, // calloc function pointer + GxB_REALLOC_FUNCTION = 7039, // realloc function pointer + GxB_FREE_FUNCTION = 7040, // free function pointer + + // GrB_get/GrB_set for GrB_GLOBAL: + #define GxB_NTHREADS 7086 + #define GxB_CHUNK 7087 + GxB_GLOBAL_NTHREADS = GxB_NTHREADS, // max number of threads to use + GxB_GLOBAL_CHUNK = GxB_CHUNK, // chunk size for small problems. + GxB_BURBLE = 7019, // diagnostic output (bool *) + GxB_PRINTF = 7020, // printf function diagnostic output + GxB_FLUSH = 7021, // flush function diagnostic output + GxB_PRINT_1BASED = 7023, // print matrices as 0-based or 1-based + GxB_INCLUDE_READONLY_STATISTICS = 7077, // include read-only memory in + // memory usage statistics + GxB_JIT_C_COMPILER_NAME = 7024, // CPU JIT C compiler name + GxB_JIT_C_COMPILER_FLAGS = 7025, // CPU JIT C compiler flags + GxB_JIT_C_LINKER_FLAGS = 7026, // CPU JIT C linker flags + GxB_JIT_C_LIBRARIES = 7027, // CPU JIT C libraries + GxB_JIT_C_PREFACE = 7028, // CPU JIT C preface + GxB_JIT_C_CONTROL = 7029, // CPU JIT C control + GxB_JIT_CACHE_PATH = 7030, // CPU/CUDA JIT path for compiled kernels + GxB_JIT_C_CMAKE_LIBS = 7031, // CPU JIT C libraries when using cmake + GxB_JIT_USE_CMAKE = 7032, // CPU JIT: use cmake or direct compile + GxB_JIT_ERROR_LOG = 7033, // CPU JIT: error log file + +} GxB_Option_Field ; + +typedef enum +{ + GrB_ROWMAJOR = 0, + GrB_COLMAJOR = 1, + GrB_BOTH = 2, + GrB_UNKNOWN = 3, +} +GrB_Orientation ; + +typedef enum +{ + GrB_UDT_CODE = 0, // user-defined type + GrB_BOOL_CODE = 1, // GraphBLAS: GrB_BOOL C: bool + GrB_INT8_CODE = 2, // GraphBLAS: GrB_INT8 C: int8_t + GrB_UINT8_CODE = 3, // GraphBLAS: GrB_UINT8 C: uint8_t + GrB_INT16_CODE = 4, // GraphBLAS: GrB_INT16 C: int16_t + GrB_UINT16_CODE = 5, // GraphBLAS: GrB_UINT16 C: uint16_t + GrB_INT32_CODE = 6, // GraphBLAS: GrB_INT32 C: int32_t + GrB_UINT32_CODE = 7, // GraphBLAS: GrB_UINT32 C: uint32_t + GrB_INT64_CODE = 8, // GraphBLAS: GrB_INT64 C: int64_t + GrB_UINT64_CODE = 9, // GraphBLAS: GrB_UINT64 C: uint64_t + GrB_FP32_CODE = 10, // GraphBLAS: GrB_FP32 C: float + GrB_FP64_CODE = 11, // GraphBLAS: GrB_FP64 C: double + GxB_FC32_CODE = 7070, // GraphBLAS: GxB_FC32 C: float complex + GxB_FC64_CODE = 7071, // GraphBLAS: GxB_FC64 C: double complex +} +GrB_Type_Code ; \end{verbatim}} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_get_set_integers.tex b/GraphBLAS/Doc/UserGuide/GrB_get_set_integers.tex new file mode 100644 index 0000000000..922896ad89 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_get_set_integers.tex @@ -0,0 +1,68 @@ + +%------------------------------------------------------------------------------- +\subsection{Controlling the sizes of integers} +%------------------------------------------------------------------------------- +\label{integer_bits} + +Different integers are used for different parts of the matrix/vector/scalar +data structure. The decision as to which integers to use is determined by the +dimensions and number of entries in the matrix. The decisions can also be +modified by \verb'GrB_set' and queried by \verb'GrB_get'. A matrix can have up +to three different kinds of integers. If a matrix is $m$-by-$n$ with $e$ +entries, with default settings: + +\begin{packed_itemize} +\item if $m > 2^{31}$: 64-bit integers must be used for the row indices of a +matrix; otherwise, 32-bit integers may be used. +\item if $n > 2^{31}$: 64-bit integers must be used for the column indices of a +matrix; otherwise, 32-bit integers may be used. +\item if $e > 2^{32}$: 64-bit integers must be used for the row/column offsets of +a matrix; otherwise 32-bit integers may be used. +\end{packed_itemize} + +This gives up to 8 different matrix types when the matrix is hypersparse. +Sparse matrices use just two of these integer types (a sparse CSR matrix, held +by row, does not store any row indices). example, if a matrix held in sparse +CSR format (\verb'GxB_SPARSE'), of size $m$-by-$n$ with $e$ entries, then the +value of $m$ does not affect the integers used to store the matrix. Bitmap and +full matrices use no arrays of integers at all, and are not affected by these +settings. For + +These decisions can be revised on a global basis and a per matrix/vector basis. +Three fields can be used for \verb'GrB_get' and \verb'GrB_get', for the +\verb'GrB_GLOBAL', \verb'GrB_Matrix', \verb'GrB_Vector', and \verb'GrB_Scalar' +objects: + +\begin{packed_itemize} +\item \verb'GxB_ROWINDEX_INTEGER_HINT': for the global setting, this can be +set to 32 (the default) or 64. The default (32) means that 32-bit integers are +used if the number of rows of a matrix or length of a vector is not too +large ($>2^{31}$), and 64-bit integers are used otherwise. On a per +matrix/vector basis, setting this hint changes the integers used for row +indices in the vector or matrix. The setting of zero is the default for +individual matrices/vectors, which means the global setting is used. +\item \verb'GxB_COLINDEX_INTEGER_HINT': the same as the row index hint above, +except for column indices. This setting has little effect on a +\verb'GrB_Vector', since it is held internally by GraphBLAS as an $m$-by-1 +matrix. +\item \verb'GxB_OFFSET_INTEGER_HINT': Internally, a sparse or hypersparse +matrix or vector holds an offset array with the cumulative sum of the number of +entries in each row (if held by row) or column (if held by column). A global +setting of 32 is the default, so that 32-bit integers are used if the matrix +has fewer than $2^{32}$ entries. If this setting is changed to 64, then 64-bit +integers are always used. +\end{packed_itemize} + +Once an object is created, the sizes of its three integers can be +queried by \verb'GrB_get' with the following fields. Each query returns the +result of 32 or 64, as an integer, to denote if 32-bit or 64-bit integers are +used for that component of the matrix/vector. Bitmap and full matrices always +return 64. + +\begin{packed_itemize} +\item \verb'GxB_ROWINDEX_INTEGER_BITS': query the number of bits in the row index integer. +\item \verb'GxB_COLINDEX_INTEGER_BITS': query the number of bits in the column index integer. +\item \verb'GxB_OFFSET_INTEGER_BITS': query the number of bits in the offset integer. +\end{packed_itemize} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_init.tex b/GraphBLAS/Doc/UserGuide/GrB_init.tex new file mode 100644 index 0000000000..1924c4e3cb --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_init.tex @@ -0,0 +1,435 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{GraphBLAS Initialization/Finalization} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{init_and_fini} + +A user application that directly relies on GraphBLAS must include the +\verb'GraphBLAS.h' header file: + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} + #include "GraphBLAS.h" +\end{verbatim} +} \end{mdframed} + +The \verb'GraphBLAS.h' file defines functions, types, and macros prefixed with +\verb'GrB_' and \verb'GxB_' that may be used in user applications. The prefix +\verb'GrB_' denotes items that appear in the official {\em GraphBLAS C API +Specification}. The prefix \verb'GxB_' refers to SuiteSparse-specific +extensions to the GraphBLAS API. + +The \verb'GraphBLAS.h' file includes all the definitions required to use +GraphBLAS, including the following macros that can assist a user application in +compiling and using GraphBLAS. + +There are two version numbers associated with SuiteSparse:GraphBLAS: +the version of the {\em GraphBLAS C API Specification} it +conforms to, and the version of the implementation itself. These can +be used in the following manner in a user application: + +{\footnotesize +\begin{verbatim} + #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 (5,2,0) + ... use features from version 5.2.0 (or later) + of a specific GraphBLAS implementation + #endif \end{verbatim}} + +SuiteSparse:GraphBLAS also defines the following strings with \verb'#define'. +Refer to the \verb'GraphBLAS.h' file for details. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{ll} +\hline +Macro & purpose \\ +\hline +\verb'GxB_IMPLEMENTATION_ABOUT' + & this particular implementation, copyright, and URL \\ +\verb'GxB_IMPLEMENTATION_DATE' + & the date of this implementation \\ +\verb'GxB_SPEC_ABOUT' + & the GraphBLAS specification for this implementation \\ +\verb'GxB_SPEC_DATE' + & the date of the GraphBLAS specification \\ +\verb'GxB_IMPLEMENTATION_LICENSE' + & the license for this particular implementation \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +Finally, SuiteSparse:GraphBLAS gives itself a unique name of the form +\verb'GxB_SUITESPARSE_GRAPHBLAS' that the user application can use in +\verb'#ifdef' tests. This is helpful in case a particular implementation +provides non-standard features that extend the GraphBLAS specification, such as +additional predefined built-in operators, or if a GraphBLAS implementation does +not yet fully implement all of the GraphBLAS specification. + +For example, SuiteSparse:GraphBLAS predefines additional built-in operators not +in the specification. If the user application wishes to use these in any +GraphBLAS implementation, an \verb'#ifdef' can control when they are used. +Refer to the examples in the \verb'GraphBLAS/Demo' folder. + +As another example, the GraphBLAS API states that an +implementation need not define the order in which \verb'GrB_Matrix_build' +assembles duplicate tuples in its \verb'[I,J,X]' input arrays. As a result, no +particular ordering should be relied upon in general. However, +SuiteSparse:GraphBLAS does guarantee an ordering, and this guarantee will be +kept in future versions of SuiteSparse:GraphBLAS as well. Since not all +implementations will ensure a particular ordering, the following can be used to +exploit the ordering returned by SuiteSparse:GraphBLAS. + + {\footnotesize + \begin{verbatim} + #ifdef GxB_SUITESPARSE_GRAPHBLAS + // duplicates in I, J, X assembled in a specific order; + // results are well-defined even if op is not associative. + GrB_Matrix_build (C, I, J, X, nvals, op) ; + #else + // duplicates in I, J, X assembled in no particular order; + // results are undefined if op is not associative. + GrB_Matrix_build (C, I, J, X, nvals, op) ; + #endif \end{verbatim}} + +The remainder of this section describes GraphBLAS functions that start or finalize GraphBLAS, +error handling, and the GraphBLAS integer. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function/type & purpose & Section \\ +\hline +\verb'GrB_Index' & the GraphBLAS integer & \ref{grbindex} \\ +\verb'GrB_init' & start up GraphBLAS & \ref{init} \\ +\verb'GrB_getVersion'& C API supported by the library & \ref{getVersion} \\ +\verb'GxB_init' & start up GraphBLAS with different \verb'malloc' & \ref{xinit} \\ +\verb'GrB_Info' & status code returned by GraphBLAS functions & \ref{info} \\ +\verb'GrB_error' & get more details on the last error & \ref{error} \\ +\verb'GrB_finalize' & finish GraphBLAS & \ref{finalize} \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +%=============================================================================== +\subsection{{\sf GrB\_Index:} the GraphBLAS integer} %========================== +%=============================================================================== +\label{grbindex} + +Matrix and vector dimensions and indexing rely on a specific integer, +\verb'GrB_Index', which is defined in \verb'GraphBLAS.h' as + + {\footnotesize + \begin{verbatim} + typedef uint64_t GrB_Index ; \end{verbatim}} + +Row and column indices of an \verb'nrows'-by-\verb'ncols' matrix range from +zero to the \verb'nrows-1' for the rows, and zero to \verb'ncols-1' for the +columns. Indices are zero-based, like C, and not one-based, like +MATLAB/Octave. In SuiteSparse:GraphBLAS, the largest permitted index value +is \verb'GrB_INDEX_MAX', defined as $2^{60}-1$. The largest permitted +matrix or vector dimension is $2^{60}$ (that is, \verb'GrB_INDEX_MAX+1'). +The largest \verb'GrB_Matrix' that +SuiteSparse: GraphBLAS can construct is thus $2^{60}$-by-$2^{60}$. An +$n$-by-$n$ matrix $\bf A$ that size can easily be constructed in practice with +$O(|{\bf A}|)$ memory requirements, where $|{\bf A}|$ denotes the number of +entries that explicitly appear in the pattern of ${\bf A}$. The time and +memory required to construct a matrix that large does not depend on $n$, since +SuiteSparse:GraphBLAS can represent ${\bf A}$ in hypersparse form (see +Section~\ref{hypersparse}). The largest \verb'GrB_Vector' that can be +constructed is $2^{60}$-by-1. + +Internally, GraphBLAS may store its integer indices using 32-bit integers +(as of GraphBLAS v10.0.0). See Section~\ref{integer_bits} for details. + +%=============================================================================== +\subsection{{\sf GrB\_init:} initialize GraphBLAS} %============================ +%=============================================================================== +\label{init} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +typedef enum +{ + GrB_NONBLOCKING = 0, // methods may return with pending computations + GrB_BLOCKING = 1 // no computations are ever left pending +} +GrB_Mode ; +\end{verbatim} +}\end{mdframed} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_init // start up GraphBLAS +( + int mode // blocking or non-blocking mode (GrB_Mode) +) ; +\end{verbatim} +}\end{mdframed} + +\hypertarget{link:init}{\mbox{ }}% +\verb'GrB_init' must be called before any other GraphBLAS operation. It +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. Non-blocking mode can be much faster than blocking mode, by many +orders of magnitude in extreme cases. Blocking mode should be used only when +debugging a user application. The mode cannot be changed once it is set by +\verb'GrB_init'. + +GraphBLAS objects are opaque. This allows GraphBLAS to +postpone operations and then do them later in a more efficient manner by +rearranging them and grouping them together. In non-blocking mode, the +computations required to construct an opaque GraphBLAS object might not be +finished when the GraphBLAS method or operation returns to the user. However, +user-provided arrays are not opaque, and GraphBLAS methods and operations that +read them (such as \verb'GrB_Matrix_build') or write to them (such as +\verb'GrB_Matrix_extractTuples') always finish reading them, or creating them, +when the method or operation returns to the user application. + +All methods and operations that extract values from a GraphBLAS object and +return them into non-opaque user arrays always ensure that the user-visible +arrays are fully populated when they return: \verb'GrB_*_reduce' (to scalar), +\verb'GrB_*_nvals', \verb'GrB_*_extractElement', and +\verb'GrB_*_extractTuples'. These functions do {\em not} guarantee that the +opaque objects they depend on are finalized. To do that, use +\verb'GrB_wait' instead. + +SuiteSparse:GraphBLAS is multithreaded internally, via OpenMP, and it is also +safe to use in a multithreaded user application. See Section~\ref{sec:install} +for details. +User threads must not operate on the same matrices at the same time, with one +exception. Multiple user threads can use the same matrices or vectors as +inputs to GraphBLAS operations or methods, but only if they have no +pending operations (use \verb'GrB_wait' +first). User threads cannot simultaneously modify a matrix or vector via any +GraphBLAS operation or method. + +It is safe to use the internal parallelism in SuiteSparse:GraphBLAS on +matrices, vectors, and scalars that are not yet completed. The library +handles this on its own. The \verb'GrB_wait' function is only +needed when a user application makes multiple calls to GraphBLAS in parallel, +from multiple user threads. + +With multiple user threads, exactly one user thread must call \verb'GrB_init' +before any user thread may call any \verb'GrB_*' or \verb'GxB_*' function. +When the user application is finished, exactly one user thread must call +\verb'GrB_finalize', after which no user thread may call any \verb'GrB_*' or +\verb'GxB_*' function. +The mode of a GraphBLAS session can be queried with \verb'GrB_get'; +see Section~\ref{options} for details. + +%=============================================================================== +\subsection{{\sf GrB\_getVersion:} determine the C API Version} %=============== +%=============================================================================== +\label{getVersion} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_getVersion // run-time access to C API version number +( + unsigned int *version, // returns GRB_VERSION + unsigned int *subversion // returns GRB_SUBVERSION +) ; +\end{verbatim} +}\end{mdframed} + +GraphBLAS defines two compile-time constants that +define the version of the C API Specification +that is implemented by the library: +\verb'GRB_VERSION' and \verb'GRB_SUBVERSION'. +If the user program was compiled with one +version of the library but linked with a different one later on, the +compile-time version check with \verb'GRB_VERSION' would be stale. +\verb'GrB_getVersion' thus provides a run-time access of the version of the C +API Specification supported by the library. + +%=============================================================================== +\subsection{{\sf GxB\_init:} initialize with alternate malloc} %================ +%=============================================================================== +\label{xinit} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_init // start up GraphBLAS and also define malloc +( + int mode, // blocking or non-blocking mode (GrB_Mode) + // pointers to memory management functions. + void * (* user_malloc_func ) (size_t), + void * (* user_calloc_func ) (size_t, size_t), + void * (* user_realloc_func ) (void *, size_t), + void (* user_free_func ) (void *) +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GxB_init' is identical to \verb'GrB_init', except that it also redefines +the memory management functions that SuiteSparse:GraphBLAS will use. Giving +the user application control over this is particularly important when using the +\verb'GxB_*serialize' and \verb'GxB_Container' methods described in Section +\ref{serialize_deserialize} and \ref{container}, since they require the user +application and GraphBLAS to use the same memory manager. +\verb'user_calloc_func' and \verb'user_realloc_func' are optional, and +may be \verb'NULL'. If \verb'NULL', then the \verb'user_malloc_func' is +relied on instead, for all memory allocations. +These functions can only be set once, when GraphBLAS starts. +They can be queried using \verb'GrB_get' (see +Section~\ref{get_set_global}). +Either +\verb'GrB_init' or \verb'GxB_init' must be called before any other GraphBLAS +operation, but not both. The functions passed to \verb'GxB_init' must be +thread-safe. +The following usage is identical to \verb'GrB_init(mode)': + + {\footnotesize + \begin{verbatim} + GxB_init (mode, malloc, calloc, realloc, free) ; \end{verbatim}} + +%=============================================================================== +\subsection{{\sf GrB\_Info:} status code returned by GraphBLAS} %=============== +%=============================================================================== +\label{info} + +Each GraphBLAS method and operation returns its status to the caller as its +return value, an enumerated type (an \verb'enum') called \verb'GrB_Info'. The +first two values in the following table denote a successful status, the rest +are error codes. + +\vspace{0.2in} +\noindent +{\small +\begin{tabular}{lrp{2.8in}} +\hline +Error & value & description \\ +\hline +\verb'GrB_SUCCESS' & 0 & the method or operation was successful \\ +\verb'GrB_NO_VALUE' & 1 & the method was successful, but the entry \\ + & & does not appear in the matrix or vector. \\ +\verb'GxB_EXHAUSTED' & 2 & the iterator is exhausted \\ +\hline +\hline +\verb'GrB_UNINITIALIZED_OBJECT' & -1 & object has not been initialized \\ +\verb'GrB_NULL_POINTER' & -2 & input pointer is \verb'NULL' \\ +\verb'GrB_INVALID_VALUE' & -3 & generic error code; some value is bad \\ +\verb'GrB_INVALID_INDEX' & -4 & a row or column index is out of bounds \\ +\verb'GrB_DOMAIN_MISMATCH' & -5 & object domains are not compatible \\ +\verb'GrB_DIMENSION_MISMATCH' & -6 & matrix dimensions do not match \\ +\verb'GrB_OUTPUT_NOT_EMPTY' & -7 & output matrix already has values in it \\ +\verb'GrB_NOT_IMPLEMENTED' & -8 & not implemented in SS:GrB \\ +\verb'GrB_ALREADY_SET' & -9 & field already written to \\ +\verb'GrB_PANIC' & -101 & unrecoverable error \\ +\verb'GrB_OUT_OF_MEMORY' & -102 & out of memory \\ +\verb'GrB_INSUFFICIENT_SPACE' & -103 & output array not large enough \\ +\verb'GrB_INVALID_OBJECT' & -104 & object is corrupted \\ +\verb'GrB_INDEX_OUT_OF_BOUNDS' & -105 & a row or column index is out of bounds \\ +\verb'GrB_EMPTY_OBJECT' & -106 & a input scalar has no entry \\ +\verb'GxB_JIT_ERROR' &-7001 & JIT compiler error \\ +\verb'GxB_OUTPUT_IS_READONLY' &-7003 & output has read-only components \\ +\hline +\end{tabular} +\vspace{0.2in} +} + +Not all GraphBLAS methods or operations can return all status codes. +In the discussions of each method and operation in this User Guide, most of the +obvious error code returns are not discussed. For example, if a required input +is a \verb'NULL' pointer, then \verb'GrB_NULL_POINTER' is returned. Only error +codes specific to the method or that require elaboration are discussed here. +For a full list of the status codes that each GraphBLAS function can return, +refer to {\em The GraphBLAS C API Specification} \cite{spec,spec2}. + +%=============================================================================== +\subsection{{\sf GrB\_error:} get more details on the last error} %============= +%=============================================================================== +\label{error} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_error // return a string describing the last error +( + const char **error, // error string + object // a GrB_matrix, GrB_Vector, etc. +) ; +\end{verbatim} +}\end{mdframed} + +Each GraphBLAS method and operation returns a \verb'GrB_Info' error code. The +\verb'GrB_error' function returns additional information on the error for a +particular object in a null-terminated string. The string returned by +\verb'GrB_error' is never a \verb'NULL' string, but it may have length zero +(with the first entry being the \verb"'\0'" string-termination value). The +string must not be freed or modified. + + {\footnotesize + \begin{verbatim} + info = GrB_some_method_here (C, ...) ; + if (! (info == GrB_SUCCESS || info == GrB_NO_VALUE)) + { + char *err ; + GrB_error (&err, C) ; + printf ("info: %d error: %s\n", info, err) ; + } \end{verbatim}} + +If the matrix \verb'C' has no error status, or if the error is not recorded in +the string, an empty non-null string is returned. In particular, out-of-memory +conditions result in an empty string from \verb'GrB_error'. + +SuiteSparse:GraphBLAS reports many helpful details via \verb'GrB_error'. For +example, if a row or column index is out of bounds, the report will state what +those bounds are. If a matrix dimension is incorrect, the mismatching +dimensions will be provided. Refer to +the output of the example programs in the \verb'Demo' and \verb'Test' folder, +which intentionally generate errors to illustrate the use of \verb'GrB_error'. + +The only functions in GraphBLAS that return an error string are functions that +have a single input/output argument \verb'C', as a \verb'GrB_Matrix', +\verb'GrB_Vector', \verb'GrB_Scalar', or \verb'GrB_Descriptor'. Methods that +create these objects (such as \verb'GrB_Matrix_new') return a \verb'NULL' +object on failure, so these methods cannot also return an error string in +their output argument. + +Any subsequent GraphBLAS method that modifies the object \verb'C' clears the +error string. + +Note that \verb'GrB_NO_VALUE' is an not error, but an informational status. +\verb'GrB_*_extractElment(&x,A,i,j)', which does \verb'x=A(i,j)', returns this +value to indicate that \verb'A(i,j)' is not present in the matrix. That +method does not have an input/output object so it cannot return an error +string. + +%=============================================================================== +\subsection{{\sf GrB\_finalize:} finish GraphBLAS} %============================ +%=============================================================================== +\label{finalize} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_finalize ( ) ; // finish GraphBLAS +\end{verbatim} +}\end{mdframed} + +\verb'GrB_finalize' must be called as the last GraphBLAS operation, even after +all calls to \verb'GrB_free'. All GraphBLAS objects created by the user +application should be freed first, before calling \verb'GrB_finalize' since +\verb'GrB_finalize' will not free those objects. In non-blocking mode, +GraphBLAS may leave some computations as pending. These computations can be +safely abandoned if the user application frees all GraphBLAS objects it has +created and then calls \verb'GrB_finalize'. When the user application is +finished, exactly one user thread must call \verb'GrB_finalize'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_installing.tex b/GraphBLAS/Doc/UserGuide/GrB_installing.tex new file mode 100644 index 0000000000..3e46bbb312 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_installing.tex @@ -0,0 +1,472 @@ + +\newpage +%------------------------------------------------------------------------------- +\section{Compiling and Installing SuiteSparse:GraphBLAS} +%------------------------------------------------------------------------------- +\label{sec:install} + +%---------------------------------------- +\subsection{Quick Start} +%---------------------------------------- + +GraphBLAS requires \verb'cmake' version 3.20 or later. +It optionally can use OpenMP for best performance. +For OpenMP on the Mac, see Section~\ref{mac_openmp}. +Without OpenMP, GraphBLAS will be significantly slower since it is a highly +parallel package. + +A \verb'cmake' build system is available for Linux, Mac, and Windows. +For Linux or Mac, a simple Makefile wrapper is available that accesses this +cmake build system. Simply do: + + {\small + \begin{verbatim} + make + sudo make install \end{verbatim} } + +For Windows, open CMake and use the provided \verb'CMakeLists.txt' file +to build GraphBLAS in the \verb'GraphBLAS/build' folder. + +Next, try the demos with \verb'make demos'. +The output of the demos will be compared with expected +output files in \verb'Demo/Output'.\footnote{ +NOTE: +DO NOT publish benchmarks of these demos, and do not link against the +demo library in any user application. These codes are sometimes slow, +and are meant as simple illustrations only, not for performance. The fastest +methods are in LAGraph, not in GraphBLAS/Demo. Benchmark LAGraph +instead. Eventually, all GraphBLAS/Demos methods will be removed, and LAGraph +will serve all uses: for illustration, benchmarking, and production uses.} + +%---------------------------------------- +\subsection{Requirements} +%---------------------------------------- + +GraphBLAS requires \verb'cmake' version 3.20 or later. +It optionally can use OpenMP for best performance. +It requires the lz4 and zstd compression packages, but they are bundled +with the GraphBLAS distribution and compiled into the GraphBLAS library +by the cmake script. + +Using the GraphBLAS JIT has many requirements, but it greatly increases +performance, particularly with user-defined types and operators, and when +typecasting is done with built-in types and operators. + +The cmake build script sets up the JIT to use the compiler and compiler +flags used to build GraphBLAS itself. If the target environment does not +have a compiler (the Apple iPad for example), then the JIT will not work. + +The JIT requires access to a cache folder, which should be preserved +even after a program that uses GraphBLAS finishes, so that JIT kernels do not +have to continually be recompiled. By default the folder is +\verb'~/.SuiteSparse/GrBX.Y.Z' on Linux/Mac, where \verb'X.Y.Z' is the version +of GraphBLAS you have. On Windows, the location is determined by your +\verb'LOCALAPPDATA' environment variable, where the folder is +\verb'SuiteSparse/GrBX.Y.Z' inside that location. File locking is required, +so if the file system does not support file locking, the JIT will not work and +performance will suffer (the \verb'make demos' will fail since it tests this +condition). If this occurs, try making your \verb'SuiteSparse' cache folder +a link to another a location on another file system that supports file locking, +or set an environment variable, \verb'GRAPHBLAS_CACHE_PATH', to point to your +a cache folder location on a file system that supports file locking. + +%---------------------------------------- +\subsection{Quick Start for MATLAB/Octave} +%---------------------------------------- + +As of GraphBLAS 9.2.0, a new and simpler method for compiling GraphBLAS and its +MATLAB interface has been added. In the MATLAB/Octave Command Window, simply +type: + + {\small + \begin{verbatim} + cd GraphBLAS/GraphBLAS + graphblas_install \end{verbatim} } + +This will use \verb'cmake' to compile the GraphBLAS library. You can skip the +details in the remainder of this section. Next, add your +\verb'GraphBLAS/GraphBLAS' folder to your path, by editting your +\verb'startup.m' script (usually in your \verb'Documents/MATLAB' folder). +Add this line: + + {\small + \begin{verbatim} + addpath ('/home/me/GraphBLAS/GraphBLAS') ; \end{verbatim} } + +\noindent +where \verb'/home/me/GraphBLAS' is the top-level folder containing your +copy of GraphBLAS. + +The \verb'graphblas_install' MATLAB script may fail to run \verb'cmake'. +If it does, it will print the following workaround, where the commands it +tells you to use will differ depending on the platform: + + {\small + \begin{verbatim} + Building GraphBLAS with cmake failed. Try this outside of MATLAB: + + cd /home/me/GraphBLAS/GraphBLAS/build + cmake .. + cmake --build . --config Release -j40 + + Then do this inside MATLAB: + + cd /home/me/GraphBLAS/GraphBLAS/@GrB/private + gbmake \end{verbatim} } + +\noindent +where \verb'/home/me/GraphBLAS' is your copy of GraphBLAS. + +%---------------------------------------- +\subsection{More details} +%---------------------------------------- + +%---------------------------------------- +\subsubsection{On Linux and Mac} +%---------------------------------------- + +GraphBLAS makes extensive use of features in the C11 standard, and thus a +C compiler supporting this version of the C standard is required to use +all features of GraphBLAS. + +{\bf Any version of the Intel \verb'icx' compiler is highly recommended.} In +most cases, the Intel \verb'icx' and the Intel OpenMP library (\verb'libiomp') +result in the best performance. The \verb'gcc' and the GNU OpenMP library +(\verb'libgomp') generally gives good performance: typically on par with icx +but in a few special cases significantly slower. The Intel \verb'icc' compiler +is not recommended; it results in poor performance for +\verb'#pragma omp atomic'. + +If you are using a C compiler that does not support the C11 standard, such as +\verb'cl' in Microsoft Visual Studio, then the \verb'_Generic' keyword is not +available. SuiteSparse:GraphBLAS will still compile, but you will not have +access to polymorphic functions such as \verb'GrB_assign'. You will need to +use the non-polymorphic functions instead. + +To compile SuiteSparse:GraphBLAS, simply type \verb'make' in the main GraphBLAS +folder, which compiles the library with your default system compiler. This +compile GraphBLAS using 8 threads, which will take a long time. To compile with +more threads (40, for this example), use: + + {\small + \begin{verbatim} + make JOBS=40 \end{verbatim} } + +To use a non-default compiler with 4 threads: + + {\small + \begin{verbatim} + make CC=icx CXX=icpx JOBS=4 \end{verbatim} } + +GraphBLAS v6.1.3 and later use the \verb'cpu_features' package by Google to +determine if the target architecture supports AVX2 and/or AVX512F (on Intel +x86\_64 architectures only). In case you have build issues with this package, +you can compile without it (and then AVX2 and AVX512F acceleration will not +be used): + + {\small + \begin{verbatim} + make CMAKE_OPTIONS='-DGBNCPUFEAT=1' \end{verbatim} } + +Without \verb'cpu_features', it is still possible to enable AVX2 and AVX512F. +Rather than relying on run-time tests, you can use these flags to enable +both AVX2 and AVX512F, without relying on \verb'cpu_features': + + {\small + \begin{verbatim} + make CMAKE_OPTIONS='-DGBNCPUFEAT=1 -DGBAVX2=1 -DGBAVX512F=1' \end{verbatim} } + +To use multiple options, separate them by a space. For example, to build +just the library but not \verb'cpu_features', and to enable +AVX2 but not AVX512F, and use 40 threads to compile: + + {\small + \begin{verbatim} + make CMAKE_OPTIONS='-DGBNCPUFEAT=1 -DGBAVX2=1' JOBS=40 \end{verbatim} } + +After compiling the library, you can compile the demos with +\verb'make all' and then \verb'make demos' while in the top-level +GraphBLAS folder. + +If \verb'cmake' or \verb'make' fail, it might be that your default compiler +does not support C11. Try another compiler. For example, try one of +these options. Go into the \verb'build' directory and type one of these: + + {\small + \begin{verbatim} + CC=gcc cmake .. + CC=gcc-11 cmake .. + CC=xlc cmake .. + CC=icx cmake .. \end{verbatim} } + +You can also do the following in the top-level GraphBLAS folder instead: + + {\small + \begin{verbatim} + CC=gcc make + CC=gcc-11 make + CC=xlc make + CC=icx make \end{verbatim} } + +For faster compilation, you can specify a parallel make. For example, +to use 32 parallel jobs and the \verb'gcc' compiler, do the following: + + {\small + \begin{verbatim} + JOBS=32 CC=gcc make \end{verbatim} } + +%---------------------------------------- +\subsubsection{On the Mac (Intel or ARM)} +%---------------------------------------- + +GraphBLAS requires \verb'cmake' v3.20 or later, and it optionally uses +\verb'make' to simplify the use of the cmake build system. It also needs +other Apple Command Line Tools from Xcode. +First install Xcode (see \url{https://developer.apple.com/xcode}), +and then install the command line tools for Xcode: + + {\small + \begin{verbatim} + xcode-select --install \end{verbatim} } + +Next, install brew, at \url{https://brew.sh}, or \verb'spack'. +Use brew or spack to install cmake version 3.20 or later. + +%---------------------------------------- +\subsubsection{On the Intel-based Mac} +%---------------------------------------- + +If you have the Intel compiler and its OpenMP library, then use the following +in the top-level \verb'GraphBLAS' folder. The Intel OpenMP library +will be found automatically: + + {\small + \begin{verbatim} + make CC=icc CXX=icpc \end{verbatim} } + +%---------------------------------------- +\subsubsection{MATLAB on the Mac (Apple Silicon based)} +%---------------------------------------- + +MATLAB on the Apple-Silicon-based Mac is now a native ARM64 application (as of +R2023b). GraphBLAS is not supported for earlier versions of MATLAB on Apple +Silicon. + +Note that GraphBLAS must use the same OpenMP library as MATLAB. This is +handled by the \verb'graphblas_install.m' script. + +%---------------------------------------- +\subsubsection{On Microsoft Windows} +\label{sec:windows} +%---------------------------------------- + +SuiteSparse:GraphBLAS can be compiled by the Microsoft C compiler (\verb'cl') +using Microsoft Visual Studio. However, that compiler is not C11 compliant. As +a result, GraphBLAS on Windows will have a few minor limitations. + +\begin{itemize} +\item The MS Visual Studio compiler does not support the \verb'_Generic' +keyword, required for the polymorphic GraphBLAS functions. So for example, you +will need to use \verb'GrB_Matrix_free' instead of just \verb'GrB_free'. + +\item Variable-length arrays are not supported, so user-defined +types are limited to 1024 bytes in size. This can be changed by editing +\verb'GB_VLA_MAXSIZE' in \verb'Source/GB_compiler.h', and recompiling +SuiteSparse:GraphBLAS. + +\item AVX acceleration is not enabled. + +\item You must compile with 64-bit computing enabled (x64). Otherwise, a +compiler error will occur (\verb'InterlockedExchange64', \verb'InterlockdOr64' +and other methods will not be found). + +\end{itemize} + +If you use a recent \verb'gcc' or \verb'icx' compiler on Windows other than the +Microsoft Compiler (\verb'cl'), these limitations can be avoided. + +The following instructions apply to Windows 10, CMake 3.16, and +Visual Studio 2019, but may work for earlier versions. + +\begin{enumerate} + +\item Install CMake 3.16 or later, if not already installed. + See \url{https://cmake.org/} for details. + +\item Install Microsoft Visual Studio, if not already installed. + See \url{https://visualstudio.microsoft.com/} for details. + Version 2019 is preferred, but earlier versions may also work. + +\item Open a terminal window and type this in the + \verb'GraphBLAS/build' folder: + + \vspace{-0.1in} + {\small + \begin{verbatim} + cmake .. \end{verbatim} } + \vspace{-0.1in} + + Alternatively, use the \verb'cmake' gui program to configure + the cmake build system for GraphBLAS. + +\item The \verb'cmake' command generates many files in + \verb'GraphBLAS/build', and the file \verb'graphblas.sln' in + particular. Open the generated \verb'graphblas.sln' file in Visual Studio. + +\item Optionally: right-click \verb'graphblas' in the left panel (Solution + Explorer) and select properties; then navigate to \verb'Configuration' + \verb'Properties', \verb'C/C++', \verb'General' and change the parameter + \verb'Multiprocessor Compilation' to \verb'Yes (/MP)'. Click \verb'OK'. + This will significantly speed up the compilation of GraphBLAS. + +\item Select the \verb'Build' menu item at the top of the window and + select \verb'Build Solution'. This should create a folder called + \verb'Release' and place the compiled \verb'graphblas.dll', + \verb'graphblas.lib', and \verb'graphblas.exp' files there. Please be + patient; some files may take a while to compile and sometimes may appear to + be stalled. Just wait. + +\item Alternatively, instead of opening Visual Studio, + type this command in the terminal window while in the \verb'build' folder: + {\small + \begin{verbatim} + cmake --build . --config Release + \end{verbatim}} + +\item Add the \verb'GraphBLAS/build/Release' folder to the Windows System path: + + \begin{itemize} + \item Open the \verb'Start Menu' and type \verb'Control Panel'. + \item Select the \verb'Control Panel' app. + \item When the app opens, select \verb'System and Security'. + \item Under \verb'System and Security', select \verb'System'. + \item From the top left side of the \verb'System' window, select + \verb'Advanced System Settings'. You may have to authenticate + at this step. + If you cannot authenticate, try setting the User Environment Variables + instead. + \item The \verb'Systems Properties' window should appear with the + \verb'Advanced' tab selected; + select \verb'Environment Variables'. + \item The \verb'Environment Variables' window displays 2 sections, one for + \verb'User' variables and the other for \verb'System' variables. Under + the \verb'Systems' variable section, scroll to and select \verb'Path', + then select \verb'Edit'. A editor window appears allowing to add, + modify, delete or re-order the parts of the \verb'Path'. + \item Add the full path of the \verb'GraphBLAS\build\Release' folder + (typically starting with \verb'C:\Users\you\'..., where \verb'you' is + your Windows username) to the \verb'Path'. + To use the MATLAB interface, add + the full path of the \verb'GraphBLAS\GraphBLAS\build\Release' folder + as well. + \item If the above steps do not work, you can instead copy the + \verb'graphblas.*' files from \verb'GraphBLAS\build\Release' into any + existing folder listed in your \verb'Path'. + \end{itemize} + +\item The \verb'GraphBLAS/Include/GraphBLAS.h' file must be included in user + applications via \verb'#include "GraphBLAS.h"'. This is already done for + you in the MATLAB/Octave interface discussed in the next section. + +\end{enumerate} + +%---------------------------------------- +\subsubsection{Mac using clang} +\label{mac_openmp} +%---------------------------------------- + +To use OpenMP with clang on the Mac, try installing it from the + \url{https://mac.r-project.org/openmp/} project. +Be sure to check that page for the OpenMP version +that matches your version of Apple Xcode. +For example, if using Xcode 13.3 to 13.4.1, use: + + {\scriptsize + \begin{verbatim} + curl -O https://mac.r-project.org/openmp/openmp-13.0.0-darwin21-Release.tar.gz + sudo tar fvxz openmp-13.0.0-darwin21-Release.tar.gz -C / + \end{verbatim} } + +These commands will install universal binaries (ARM and x86) for +\verb'libomp.dylib', and the following files: + + {\scriptsize + \begin{verbatim} + /usr/local/lib/libomp.dylib + /usr/local/include/ompt.h + /usr/local/include/omp.h + /usr/local/include/omp-tools.h + \end{verbatim} } + +Once you do this, the GraphBLAS cmake build system should find this copy of +OpenMP for clang. + +%---------------------------------------- +\subsubsection{Linking issues after installation} +%---------------------------------------- + +My Linux distro (Ubuntu 18.04) includes a copy of \verb'libgraphblas.so.1', +which is SuiteSparse:GraphBLAS v1.1.2. After installing SuiteSparse:GraphBLAS +in \verb'/usr/local/lib' (with \verb'sudo make install'), compiling a simple +stand-alone program links against \verb'libgraphblas.so.1' instead of the +latest version, while at the same time accessing the latest version of the +include file as \verb'/usr/local/include/GraphBLAS.h'. This command fails: + + {\small + \begin{verbatim} + gcc prog.c -lgraphblas \end{verbatim} } + +Revising my \verb'LD_LIBRARY_PATH' to put \verb'/usr/local/lib' first in the +library directory order didn't help. If you encounter this problem, try one of +the following options (all four work for me, and link against the proper +version, \verb'/usr/local/lib/libgraphblas.so.9.2.0' for example): + + {\small + \begin{verbatim} + gcc prog.c -l:libgraphblas.so.9 + gcc prog.c -l:libgraphblas.so.9.2.0 + gcc prog.c /usr/local/lib/libgraphblas.so + gcc prog.c -Wl,-v -L/usr/local/lib -lgraphblas \end{verbatim} } + +This \verb'prog.c' test program is a trivial one, which works in v1.0 and +later: + + {\small + \begin{verbatim} + #include + int main (void) + { + GrB_init (GrB_NONBLOCKING) ; + GrB_finalize ( ) ; + } \end{verbatim} } + +Compile the program above, then use this command to ensure +\verb'libgraphblas.so.9' appears: + + {\small + \begin{verbatim} + ldd a.out \end{verbatim} } + +%---------------------------------------- +\subsubsection{Running the tests} +%---------------------------------------- + +To run a short test, type \verb'make demo' at the top-level \verb'GraphBLAS' +folder. This will run all the demos in \verb'GraphBLAS/Demos'. MATLAB is not +required. + +To perform the extensive tests in the \verb'Test' folder, and the statement +coverage tests in \verb'Tcov', MATLAB R2018a or later is required. See the +\verb'README.txt' files in those two folders for instructions on how to run the +tests. The tests in the \verb'Test' folder have been ported to MATLAB on +Linux, MacOS, and Windows. The \verb'Tcov' tests do not work on Windows. The +MATLAB interface test (\verb'gbtest') works on all platforms; see the +\verb'GraphBLAS/GraphBLAS' folder for more details. + +%---------------------------------------- +\subsubsection{Cleaning up} +%---------------------------------------- + +To remove all compiled files, type \verb'make' \verb'distclean' in the top-level +GraphBLAS folder. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_interfaces.tex b/GraphBLAS/Doc/UserGuide/GrB_interfaces.tex new file mode 100644 index 0000000000..a52d3353c7 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_interfaces.tex @@ -0,0 +1,124 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Interfaces to MATLAB, Octave, Python, Julia, Go, Java, ...} %%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The MATLAB/Octave interface to SuiteSparse:GraphBLAS is included with this +distribution, described in Section~\ref{octave}. +Python, Julia, Go, and Java interfaces are available. +These are not part of the SuiteSparse:GraphBLAS distribution. +See the links below. + +%=============================================================================== +\subsection{MATLAB/Octave Interface} +%=============================================================================== +\label{octave} + +An easy-to-use MATLAB/Octave interface for SuiteSparse:GraphBLAS is available; +see the documentation in the \verb'GraphBLAS/GraphBLAS' folder for details. +Start with the \verb'README.md' file in that directory. An easy-to-read output +of the MATLAB demos can be found in \verb'GraphBLAS/GraphBLAS/demo/html'. + +The MATLAB/Octave interface adds the \verb'@GrB' class, which is an opaque +MATLAB/Octave object that contains a GraphBLAS matrix, either double or single +precision (real or complex), boolean, or any of the built-in integer types. +MATLAB/Octave sparse and full matrices can be arbitrarily mixed with GraphBLAS +matrices. The following overloaded operators and methods all work as you would +expect for any matrix. The matrix multiplication \verb'A*B' uses the +conventional \verb'PLUS_TIMES' semiring. + +{\footnotesize +\begin{verbatim} + A+B A-B A*B A.*B A./B A.\B A.^b A/b C=A(I,J) + -A +A ~A A' A.' A&B A|B b\A C(I,J)=A + A~=B A>B A==B A<=B A>=B A=1', or assign whatever value of scalar you wish. +It is essential to use a structural mask. Otherwise, it is not clear that +all entries in \verb'C' will be assigned the same value. The following +code takes $O(1)$ time, and it resets the size of the numerical part of the +\verb'C' matrix to be $O(1)$ in size: + +{\footnotesize +\begin{verbatim} + bool scalar = true ; + GrB_Matrix_assign (C, C, NULL, scalar, GrB_ALL, nrows, GrB_ALL, ncols, + GrB_DESC_S) ; \end{verbatim}} + +The MATLAB/Octave analog of the code above is \verb'C=spones(C)'. + +The second case for where iso matrices and vectors are useful is to use them +with operations that do not necessarily access all of their content. +Suppose you have a matrix \verb'A' of arbitrarily large dimension (say +\verb'n'-by-\verb'n' where \verb'n=2^60', of type \verb'GrB_FP64'). A matrix +this large can be represented by SuiteSparse:GraphBLAS, but only in a +hypersparse form. + +Now, suppose you wish to compute the maximum value in each row, reducing the +matrix to a vector. This can be done with \verb'GrB_reduce': + +{\footnotesize +\begin{verbatim} + GrB_Vector_new (&v, GrB_FP64, n) ; + GrB_reduce (v, NULL, GrB_MAX_MONOID_FP64, A, NULL) ; \end{verbatim}} + +It can also be done with \verb'GrB_mxv', by creating an iso full vector +\verb'x'. The creation of \verb'x' takes $O(1)$ time and memory, +and the \verb'GrB_mxv' computation takes $O(e)$ time (with modest assumptions; +if \verb'A' needs to be transposed the time would be $O(e \log e)$). + +{\footnotesize +\begin{verbatim} + GrB_Vector_new (&v, GrB_FP64, n) ; + GrB_Vector_new (&x, GrB_FP64, n) ; + GrB_assign (x, NULL, NULL, 1, GrB_ALL, n, NULL) ; + GrB_mxv (v, NULL, NULL, GrB_MAX_FIRST_SEMIRING_FP64, A, x, NULL) ; \end{verbatim}} + +The above computations are identical in SuiteSparse:GraphBLAS. Internally, +\verb'GrB_reduce' creates \verb'x' and calls \verb'GrB_mxv'. Using +\verb'GrB_mxm' directly gives the user application additional flexibility in +creating new computations that exploit the multiplicative operator in the +semiring. \verb'GrB_reduce' always uses the \verb'FIRST' operator in its +semiring, but any other binary operator can be used instead when using +\verb'GrB_mxv'. + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from matrix multiplication} +%------------------------------------------------------------------------------- +\label{iso_mxm} + +Consider \verb'GrB_mxm', \verb'GrB_mxv', and \verb'GrB_vxm', and + let \verb'C=A*B', where no mask is present, or \verb'C=A*B' where + \verb'C' is initially empty. If \verb'C' is not initially empty, + then these rules apply to a temporary matrix \verb'T=A*B', which is + initially empty and is then assigned to \verb'C' via \verb'C=T'. + + The iso property of \verb'C' is determined with the following rules, + where the first rule that fits defines the property and value of \verb'C'. + + \begin{itemize} + \item If the semiring includes a index-based multiplicative operator + (\verb'GxB_FIRSTI', \verb'GrB_SECONDI', and related operators), then + \verb'C' is never iso. + + \item Define an {\em iso-monoid} as a built-in monoid with the property + that reducing a set of $n>1$ identical values $x$ returns the same value + $x$. These are the \verb'MIN' \verb'MAX' \verb'LOR' \verb'LAND' \verb'BOR' + \verb'BAND' and \verb'ANY' monoids. All other monoids are not iso monoids: + \verb'PLUS', \verb'TIMES', \verb'LXNOR', \verb'EQ', \verb'BXOR', + \verb'BXNOR', and all user-defined monoids. Currently, there is no + mechanism for telling SuiteSparse:GraphBLAS that a user-defined monoid + is an iso-monoid. + + \item If the multiplicative op is \verb'PAIR' (same as \verb'ONEB'), + and the monoid is an + iso-monoid, or the \verb'EQ' or \verb'TIMES' monoids, then \verb'C' is + iso with a value of 1. + + \item If both \verb'B' and the monoid are iso, and the multiplicative op is + \verb'SECOND' or \verb'ANY', then \verb'C' is iso with a value of $b$. + + \item If both \verb'A' and the monoid are iso, and the multiplicative op is + \verb'FIRST' or \verb'ANY', then \verb'C' is iso with a value of $a$. + + \item If \verb'A', \verb'B', and the monoid are all iso, then \verb'C' + is iso, with a value $c=f(a,b)$, where $f$ is any multiplicative op + (including user-defined, which assumes that a user-defined $f$ has no + side effects). + + \item If \verb'A' and \verb'B' are both iso and full (all entries present, + regardless of the format of the matrices), then \verb'C' is iso and full. + Its iso value is computed in $O(\log(n))$ time, via a reduction of $n$ + copies of the value $t=f(a,b)$ to a scalar. The storage required to + represent \verb'C' is just $O(1)$, regardless of its dimension. + Technically, the \verb'PLUS' monoid could be computed as $c=nt$ in $O(1)$ + time, but the log-time reduction works for any monoid, including + user-defined ones. + + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from eWiseMult and kronecker} +%------------------------------------------------------------------------------- +\label{iso_emult} + +Consider \verb'GrB_eWiseMult'. Let +\verb'C=A.*B', or \verb'C=A.*B' with any mask and where \verb'C' is +initially empty, where \verb'.*' denotes a binary operator $f(x,y)$ +applied with \verb'eWiseMult'. These rules also apply to \verb'GrB_kronecker'. + + \begin{itemize} + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then + \verb'C' is not iso. + + \item If the op is \verb'PAIR' (same as \verb'ONEB'), + then \verb'C' is iso with $c=1$. + + \item If \verb'B' is iso and the op is \verb'SECOND' or \verb'ANY', + then \verb'C' is iso with $c=b$. + + \item If \verb'A' is iso and the op is \verb'FIRST' or \verb'ANY', + then \verb'C' is iso with $c=a$. + + \item If both \verb'A' and \verb'B' are iso, + then \verb'C' is iso with $c=f(a,b)$. + + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from eWiseAdd} +%------------------------------------------------------------------------------- +\label{iso_add} + +Consider \verb'GrB_eWiseAdd', and also the accumulator phase of \verb'C+=T' +when an accumulator operator is present. Let \verb'C=A+B', or \verb'C=A+B' +with any mask and where \verb'C' is initially empty. + + \begin{itemize} + \item If both \verb'A' and \verb'B' are full (all entries present), then + the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used + instead. + + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then + \verb'C' is not iso. + + \item If $a$ and $b$ differ (when typecasted to the type of \verb'C'), + then \verb'C' is not iso. + + \item If $c=f(a,b) = a = b$ holds, then \verb'C' is iso, + where $f(a,b)$ is the operator. + + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from eWiseUnion} +%------------------------------------------------------------------------------- +\label{iso_union} + +\verb'GxB_eWiseUnion' is very similar to \verb'GrB_eWiseAdd', but the rules +for when the result is iso-valued are very different. + + \begin{itemize} + \item If both \verb'A' and \verb'B' are full (all entries present), then + the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used + instead. + + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then + \verb'C' is not iso. + + \item If the op is \verb'PAIR' (same as \verb'ONEB'), + then \verb'C' is iso with $c=1$. + + \item If \verb'B' is iso and the op is \verb'SECOND' or \verb'ANY', + and the input scalar \verb'beta' matches $b$ + (the iso-value of \verb'B'), + then \verb'C' is iso with $c=b$. + + \item If \verb'A' is iso and the op is \verb'FIRST' or \verb'ANY', + and the input scalar \verb'alpha' matches $a$ + (the iso-value of \verb'A'), + then \verb'C' is iso with $c=a$. + + \item If both \verb'A' and \verb'B' are iso, + and $f(a,b) = f(\alpha,b) = f(a,\beta)$, + then \verb'C' is iso with $c=f(a,b)$. + + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Reducing iso matrices to a scalar or vector} +%------------------------------------------------------------------------------- +\label{iso_reduce} + +If \verb'A' is iso with $e$ entries, reducing it to a scalar takes $O(\log(e))$ +time, regardless of the monoid used to reduce the matrix to a scalar. Reducing +\verb'A' to a vector \verb'c' is the same as the matrix-vector multiply +\verb"c=A*x" or \verb"c=A'*x", depending on the descriptor, where \verb'x' +is an iso full vector (refer to Section~\ref{iso_mxm}). + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from apply} +%------------------------------------------------------------------------------- +\label{iso_apply} + +Let \verb'C=f(A)' denote the application of a unary operator \verb'f', +and let \verb'C=f(A,s)' and \verb'C=f(s,A)' denote the application of a binary +operator with \verb's' a scalar. + + \begin{itemize} + \item If the operator is index-based (\verb'GxB_POSITION*', + \verb'GxB_FIRSTI', and related) then \verb'C' is not iso. + + \item If the operator is \verb'ONE' or \verb'PAIR' (same as \verb'ONEB'), + then \verb'C' iso with $c=1$. + + \item If the operator is \verb'FIRST' or \verb'ANY' with \verb'C=f(s,A)', + then \verb'C' iso with $c=s$. + + \item If the operator is \verb'SECOND' or \verb'ANY' with \verb'C=f(A,s)', + then \verb'C' iso with $c=s$. + + \item If \verb'A' is iso then \verb'C' is iso, with the following value + of $c$: + + \begin{itemize} + \item If the op is \verb'IDENTITY', then $c=a$. + \item If the op is unary with \verb'C=f(A)', then $c=f(a)$. + \item If the op is binary with \verb'C=f(s,A)', then $c=f(s,a)$. + \item If the op is binary with \verb'C=f(A,s)', then $c=f(a,s)$. + \end{itemize} + + + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from select} +%------------------------------------------------------------------------------- +\label{iso_select} + +Let \verb'C=select(A)' denote the application of a \verb'GrB_IndexUnaryOp' operator +in \verb'GrB_select'. + + \begin{itemize} + \item If \verb'A' is iso, then \verb'C' is iso with $c=a$. + \item If the operator is any \verb'GrB_VALUE*_BOOL' operator, + with no typecasting, and the test is true only for a single boolean + value, then \verb'C' is iso. + \item If the operator is \verb'GrB_VALUEEQ_*', with no typecasting, + then \verb'C' is iso, with $c=t$ where $t$ is the value of the scalar + \verb'y'. + \item If the operator is \verb'GrB_VALUELE_UINT*', with no typecasting, + and the scalar \verb'y' is zero, then \verb'C' is iso with $c=0$. + \item Otherwise, \verb'C' is not iso. + \end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from assign and subassign} +%------------------------------------------------------------------------------- +\label{iso_assign} + +These rules are somewhat complex. Consider the assignment \verb'C(I,J)=...' +with \verb'GrB_assign'. Internally, this assignment is converted into +\verb'C(I,J)=...' and then \verb'GxB_subassign' is used. Thus, +all of the rules below assume the form \verb'C(I,J)=...' where \verb'M' +has the same size as the submatrix \verb'C(I,J)'. + +\subsubsection{Assignment with no accumulator operator} + +If no accumulator operator is present, the following rules are used. + +\begin{itemize} +\item +For matrix assignment, \verb'A' must be iso. For scalar assignment, the single +scalar is implicitly expanded into an iso matrix \verb'A' of the right size. +If these rules do not hold, \verb'C' is not iso. + +\item +If \verb'A' is not iso, or if \verb'C' is not iso on input, then \verb'C' is +not iso on output. + +\item +If \verb'C' is iso or empty on input, and \verb'A' is iso (or scalar assignment +is begin performed) and the iso values $c$ and $a$ (or the scalar $s$) match, +then the following forms of assignment result in an iso matrix \verb'C' on +output: + + \begin{itemize} + \item \verb'C(I,J) = scalar' + \item \verb'C(I,J) = scalar' + \item \verb'C(I,J) = scalar' + \item \verb'C(I,J) = scalar' + \item \verb'C(I,J) = scalar' + \item \verb'C(I,J) = A' + \item \verb'C(I,J) = A' + \item \verb'C(I,J) = A' + \item \verb'C(I,J) = A' + \item \verb'C(I,J) = A' + \end{itemize} + +\item +For these forms of assignment, \verb'C' is always iso on output, regardless +of its iso property on input: + + \begin{itemize} + \item \verb'C = scalar' + \item \verb'C=scalar'; C empty on input. + \item \verb'C=scalar' + \end{itemize} + +\item +For these forms of assignment, \verb'C' is always iso on output if \verb'A' +is iso: + + \begin{itemize} + \item \verb'C = A' + \item \verb'C = A'; C empty on input. + \end{itemize} +\end{itemize} + + +\subsubsection{Assignment with an accumulator operator} + +If an accumulator operator is present, the following rules are used. +Index-based operators (\verb'GxB_FIRSTI' and related) cannot be used as +accumulator operators, so these rules do not consider that case. + +\begin{itemize} +\item +For matrix assignment, \verb'A' must be iso. For scalar assignment, the single +scalar is implicitly expanded into an iso matrix \verb'A' of the right size. +If these rules do not hold, \verb'C' is not iso. + +\item For these forms of assignment \verb'C' is iso if \verb'C' is +empty on input, or if $c=c+a$ for the where $a$ is the iso value of \verb'A' or +the value of the scalar for scalar assignment. + + \begin{itemize} + \item \verb'C(I,J) += scalar' + \item \verb'C(I,J) += scalar' + \item \verb'C(I,J) += scalar' + \item \verb'C(I,J) += scalar' + \item \verb'C(I,J) += scalar' + \item \verb'C(I,J) += A' + \item \verb'C(I,J) += A' + \item \verb'C(I,J) += A' + \item \verb'C(I,J) += A' + \item \verb'C(I,J) += A ' + \item \verb'C += A' + \end{itemize} +\end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from build methods} +%------------------------------------------------------------------------------- +\label{iso_build} + +\verb'GxB_Matrix_build_Scalar' and \verb'GxB_Vector_build_Scalar' +always construct an iso matrix/vector. + +\verb'GrB_Matrix_build' and \verb'GrB_Vector_build' can also construct iso +matrices and vectors. A non-iso matrix/vector is constructed first, and then +the entries are checked to see if they are all equal. The resulting iso-valued +matrix/vector will be efficient to use and will use less memory than a non-iso +matrix/vector. However, constructing an iso matrix/vector with +\verb'GrB_Matrix_build' and \verb'GrB_Vector_build' will take more time +and memory than constructing the matrix/vector with +\verb'GxB_Matrix_build_Scalar' or \verb'GxB_Vector_build_Scalar'. + +%------------------------------------------------------------------------------- +\subsection{Iso matrices from other methods} +%------------------------------------------------------------------------------- +\label{iso_other} + +\begin{itemize} +\item +For \verb'GrB_Matrix_dup' and \verb'GrB_Vector_dup', the output matrix/vector +has the same iso property as the input matrix/vector. + +\item +\verb'GrB_*_setElement_*' preserves the iso property of the matrix/vector it +modifies, if the input scalar is equal to the iso value of the matrix/vector. +If the matrix or vector has no entries, the first call to \verb'setElement' +makes it iso. This allows a sequence of \verb'setElement' calls with the same +scalar value to create an entire iso matrix or vector, if starting from +an empty matrix or vector. + +\item +\verb'GxB_Matrix_concat' constructs an iso matrix as its result if all input +tiles are either empty or iso. + +\item +\verb'GxB_Matrix_split' constructs its output tiles as iso if its input +matrix is iso. + +\item +\verb'GxB_Matrix_diag' and \verb'GrB_Matrix_diag' construct an iso matrix if +its input vector is iso. + +\item +\verb'GxB_Vector_diag' constructs an iso vector if its input matrix is iso. + +\item +\verb'GrB_*extract' constructs an iso matrix/vector if its input matrix/vector +is iso. + +\item +\verb'GrB_transpose' constructs an iso matrix if its input is iso. + +\item +The \verb'GxB_Container' methods preserve the iso property +of their matrices/vectors. +\end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Iso matrices not exploited} +%------------------------------------------------------------------------------- + +There are many cases where an matrix may have the iso property but it is not +detected by SuiteSparse:GraphBLAS. For example, if \verb'A' is non-iso, +\verb'C=A(I,J)' from \verb'GrB_extract' may be iso, if all entries in the +extracted submatrix have the same value. Future versions of +SuiteSparse:GraphBLAS may extend the rules described in this section to detect +these cases. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_iterator.tex b/GraphBLAS/Doc/UserGuide/GrB_iterator.tex new file mode 100644 index 0000000000..8099bbbeab --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_iterator.tex @@ -0,0 +1,707 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Matrix and Vector iterators} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{iter} + +The \verb'GxB_Iterator' is an object that allows user applications to iterate +over the entries of a matrix or vector, one entry at a time. Iteration can +be done in a linear manner (analogous to reading a file one entry at a time, +from start to finish), or in a random-access pattern (analogous to +the \verb'fseek' method for repositioning the access to file to a different +position). + +Multiple iterators can be used on a single matrix or vector, even in parallel +by multiple user threads. While a matrix or vector is being used with an +iterator, the matrix or vector must not be modified. Doing so will lead to +undefined results. + +Since accessing a matrix or vector via an iterator requires many calls to +the iterator methods, they must be very fast. Error checking is skipped, +except for the methods that create, attach, or free an iterator. Methods +that advance an iterator or that access values or indices from a matrix or +vector do not return error conditions. Instead, they have well-defined +preconditions that must be met (and which should be checked by the user +application). If those preconditions are not met, results are undefined. + +The iterator methods are implemented in SuiteSparse:GraphBLAS as both macros +(via \verb'#define') and as functions of the same name that appear in the +compiled \verb'libgraphblas.so' library. This requires that the opaque +contents of the iterator object be defined in \verb'GraphBLAS.h' itself. The +user application must not access these contents directly, but can only do so +safely via the iterator methods provided by SuiteSparse:GraphBLAS. + +The iterator object can be used in one of four sets of methods, +for four different access patterns: + + \begin{enumerate} + \item {\em row iterator}: iterates across the rows of a matrix, and then + within each row to access the entries in a given row. Accessing all + the entries of a matrix using a row iterator requires an outer loop + (for the rows) and an inner loop (for the entries in each row). + A matrix can be accessed via a row iterator only if its format + (determined by \verb'GrB_get (A, &fmt,' \verb'GrB_STORAGE_ORIENTATION_HINT)') is by-row + (that is, \verb'GrB_ROWMAJOR'). + See Section~\ref{options}. + \item {\em column iterator}: iterates across the columns of a matrix, and + then within each column to access the entries in a given column. + Accessing all the entries of a matrix using a column iterator requires + an outer loop (for the columns) and an inner loop (for the entries in + each column). A matrix can be accessed via a column iterator only if + its format (determined by \verb'GrB_get (A, &fmt, GrB_STORAGE_ORIENTATION_HINT)') is + by-column (that is, \verb'GrB_COLMAJOR'). + See Section~\ref{options}. + \item {\em entry iterator}: iterates across the entries of a matrix. + Accessing all the entries of a matrix using an entry iterator requires + just a single loop. Any matrix can be accessed with an entry iterator. + \item {\em vector iterator}: iterates across the entries of a vector. + Accessing all the entries of a vector using a vector iterator requires + just a single loop. Any vector can be accessed with a vector iterator. + \end{enumerate} + +%=============================================================================== +\subsection{Creating and destroying an iterator} +%=============================================================================== + +The process for using an iterator starts with the creation of an iterator, with +\verb'GxB_Iterator_new'. This method creates an \verb'iterator' object but +does not {\em attach} it to any specific matrix or vector: + + {\footnotesize + \begin{verbatim} + GxB_Iterator iterator ; + GxB_Iterator_new (&iterator) ; \end{verbatim}} + +When finished, the \verb'iterator' is freed with either of these methods: + + {\footnotesize + \begin{verbatim} + GrB_free (&iterator) ; + GxB_Iterator_free (&iterator) ; \end{verbatim}} + +%=============================================================================== +\subsection{Attaching an iterator to a matrix or vector} +%=============================================================================== + +This new \verb'iterator' object can be {\em attached} to any matrix or vector, +and used as a row, column, or entry iterator for any matrix, or as an iterator +for any vector. The \verb'iterator' can be used in any of these methods before +it is freed, but with just one access method at a time. + +Once it is created, the \verb'iterator' must be attached to a matrix or +vector. This process also selects the method by which the \verb'iterator' +will be used for a matrix. Each of the four \verb'GxB_*Iterator_attach' +methods returns a \verb'GrB_Info' result. + + \begin{enumerate} + \item {\em row iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_rowIterator_attach (iterator, A, desc) ; \end{verbatim}} + \item {\em column iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_colIterator_attach (iterator, A, desc) ; \end{verbatim}} + \item {\em entry iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, desc) ; \end{verbatim}} + \item {\em vector iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, desc) ; \end{verbatim}} + \end{enumerate} + +On input to \verb'GxB_*Iterator_attach', the \verb'iterator' must already +exist, having been created by \verb'GxB_Iterator_new'. If the \verb'iterator' +is already attached to a matrix or vector, it is detached and then attached to +the given matrix \verb'A' or vector \verb'v'. + +The return values for row/column methods are: + + \begin{itemize} + \item + \verb'GrB_SUCCESS': if the \verb'iterator' is successfully + attached to the matrix \verb'A'. + \item + \verb'GrB_NULL_POINTER': if the \verb'iterator' or \verb'A' are NULL. + \item + \verb'GrB_INVALID_OBJECT': if the matrix \verb'A' is invalid. + \item + \verb'GrB_NOT_IMPLEMENTED': if the matrix \verb'A' cannot be iterated + in the requested access method (row iterators require the matrix to + be held by-row, and column iterators require the matrix to be held + by-column). + \item + \verb'GrB_OUT_OF_MEMORY': if the method runs out of memory. + \end{itemize} + +The other two methods (entry iterator for matrices, or the vector iterator) +return the same error codes, except that they +do not return \verb'GrB_NOT_IMPLEMENTED'. + +%=============================================================================== +\subsection{Seeking to an arbitrary position} +%=============================================================================== + +Attaching the \verb'iterator' to a matrix or vector does not define a specific +position for the \verb'iterator'. To use the \verb'iterator', a single call to +the corresponding {\em seek} method is required. These +\verb'GxB*_Iterator_*seek*' methods may also be used later on to change the +position of the iterator arbitrarily. + + \begin{enumerate} + \item {\em row iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_rowIterator_seekRow (iterator, row) ; + GrB_Index kount = GxB_rowIterator_kount (iterator) ; + GrB_Info info = GxB_rowIterator_kseek (iterator, k) ; \end{verbatim}} + + These methods move a row iterator to a specific row, defined in one of + two ways: (1) the row index itself (in range 0 to \verb'nrows'-1), or + (2) by specifying \verb'k', which moves the iterator to the \verb'k'th + {\em explicit} row (in the range 0 to \verb'kount'-1). For sparse, + bitmap, or full matrices, these two methods are identical. For + hypersparse matrices, not all rows are present in the data structure; + these {\em implicit} rows are skipped and not included in the + \verb'kount'. Implicit rows contain no entries. The + \verb'GxB_rowIterator_kount' method returns the \verb'kount' of the + matrix, where \verb'kount' is equal to \verb'nrows' for sparse, bitmap, + and matrices, and \verb'kount' $\le$ \verb'nrows' for hypersparse + matrices. All three methods listed above can be used for any row + iterator. + + The \verb'GxB_rowIterator_*seek*' methods return \verb'GrB_SUCCESS' if + the iterator has been moved to a row that contains at least one entry, + \verb'GrB_NO_VALUE' if the row has no entries, or \verb'GxB_EXHAUSTED' + if the row is out of bounds (\verb'row' $\ge$ \verb'nrows' or + if \verb'k' $\ge$ \verb'kount'). + None of these return conditions are + errors; they are all informational. + + For sparse, bitmap, and full matrices, \verb'GxB_rowIterator_seekRow' + always moves to the given row. For hypersparse matrices, if the + requested row is implicit, the iterator is moved to the first + explicit row following it. If no such row exists, the iterator + is exhausted and \verb'GxB_EXHAUSTED' is returned. + The \verb'GxB_rowIterator_kseek' method always moves to the \verb'k'th + explicit row, for any matrix. + Use \verb'GxB_rowIterator_getRowIndex', described below, to determine + the row index of the current position. + + Precondition: on input, the \verb'iterator' must have been successfully + attached to a matrix via a prior call to \verb'GxB_rowIterator_attach'. + Results are undefined if this precondition is not met. + + \item {\em column iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_colIterator_seekCol (iterator, col) ; + GrB_Index kount = GxB_colIterator_kount (iterator) ; + GrB_Info info = GxB_colIterator_kseek (iterator, k) ; \end{verbatim}} + + These methods move a column iterator to a specific column, defined in + one of two ways: (1) the column index itself (in range 0 to + \verb'ncols'-1), or (2) by specifying \verb'k', which moves the + iterator to the \verb'k'th {\em explicit} column (in the range 0 to + \verb'kount'-1). For sparse, bitmap, or full matrices, these two + methods are identical. For hypersparse matrices, not all columns are + present in the data structure; these {\em implicit} columns are skipped + and not included in the \verb'kount'. Implicit columns contain no + entries. The \verb'GxB_colIterator_kount' method returns the + \verb'kount' of the matrix, where \verb'kount' is equal to \verb'ncols' + for sparse, bitmap, and matrices, and \verb'kount' $\le$ \verb'ncols' + for hypersparse matrices. All three methods listed above can be used + for any column iterator. + + The \verb'GxB_colIterator_*seek*' methods return \verb'GrB_SUCCESS' if + the iterator has been moved to a column that contains at least one + entry, \verb'GrB_NO_VALUE' if the column has no entries, or + \verb'GxB_EXHAUSTED' if the column is out of bounds (\verb'col' $\ge$ + \verb'ncols' or \verb'k' $\ge$ \verb'kount'). + None of these return conditions are + errors; they are all informational. + + For sparse, bitmap, and full matrices, \verb'GxB_colIterator_seekCol' + always moves to the given column. For hypersparse matrices, if the + requested column is implicit, the iterator is moved to the first + explicit column following it. If no such column exists, the iterator + is exhausted and \verb'GxB_EXHAUSTED' is returned. + The \verb'GxB_colIterator_kseek' method always moves to the \verb'k'th + explicit column, for any matrix. + Use \newline + \verb'GxB_colIterator_getColIndex', described below, to determine + the column index of the current position. + + Precondition: on input, the \verb'iterator' must have been successfully + attached to a matrix via a prior call to \verb'GxB_colIterator_attach'. + Results are undefined if this precondition is not met. + + \item {\em entry iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Matrix_Iterator_seek (iterator, p) ; + GrB_Index pmax = GxB_Matrix_Iterator_getpmax (iterator) ; + GrB_Index p = GxB_Matrix_Iterator_getp (iterator); \end{verbatim}} + + The \verb'GxB_Matrix_Iterator_seek' method moves the \verb'iterator' to + the given position \verb'p', which is in the range 0 to \verb'pmax'-1, + where the value of \verb'pmax' is obtained from + \verb'GxB_Matrix_Iterator_getpmax'. + For sparse, hypersparse, and full matrices, \verb'pmax' is the same as + \verb'nvals' returned by \verb'GrB_Matrix_nvals'. For bitmap matrices, + \verb'pmax' is equal to \verb'nrows*ncols'. If \verb'p' $\ge$ + \verb'pmax', the iterator is exhausted and \verb'GxB_EXHAUSTED' is + returned. Otherwise, \verb'GrB_SUCCESS' is returned. + + All entries in the matrix are given an ordinal position, \verb'p'. + Seeking to position \verb'p' will either move the \verb'iterator' to + that particular position, or to the next higher position containing an + entry if there is entry at position \verb'p'. The latter case only + occurs for bitmap matrices. + Use \verb'GxB_Matrix_Iterator_getp' to determine the current + position of the iterator. + + Precondition: on input, the \verb'iterator' must have been successfully + attached to a matrix via a prior call to + \verb'GxB_Matrix_Iterator_attach'. Results are undefined if this + precondition is not met. + + \item {\em vector iterator}: + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Vector_Iterator_seek (iterator, p) ; + GrB_Index pmax = GxB_Vector_Iterator_getpmax (iterator) ; + GrB_Index p = GxB_Vector_Iterator_getp (iterator); \end{verbatim}} + + The \verb'GxB_Vector_Iterator_seek' method is identical to the + entry iterator of a matrix, but applied to a \verb'GrB_Vector' instead. + + Precondition: on input, the \verb'iterator' must have been successfully + attached to a vector via a prior call to + \verb'GxB_Vector_Iterator_attach'. Results are undefined if this + precondition is not met. + + \end{enumerate} + +%=============================================================================== +\subsection{Advancing to the next position} +%=============================================================================== + +For best performance, the {\em seek} methods described above should be used +with care, since some of them require $O(\log n)$ time. The fastest method +for changing the position of the iterator is the corresponding {\em next} +method, described below for each iterator: + + \begin{enumerate} + \item {\em row iterator}: To move to the next row. + + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_rowIterator_nextRow (iterator) ; \end{verbatim}} + + The row iterator is a 2-dimensional iterator, requiring an outer loop and + an inner loop. The outer loop iterates over the rows of the matrix, using + \verb'GxB_rowIterator_nextRow' to move to the next row. If the matrix is + hypersparse, the next row is always an explicit row; implicit rows are + skipped. The return conditions are identical to + \verb'GxB_rowIterator_seekRow'. + + Preconditions: on input, the row iterator must already be attached to a + matrix via a prior call to \verb'GxB_rowIterator_attach', and the + \verb'iterator' must be at a specific row, via a prior call to + \verb'GxB_rowIterator_*seek*' or \verb'GxB_rowIterator_nextRow'. + Results are undefined if these conditions are not met. + + \item {\em row iterator}: To move to the next entry within a row. + + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_rowIterator_nextCol (iterator) ; \end{verbatim}} + + The row iterator is moved to the next entry in the current row. + The method returns \verb'GrB_NO_VALUE' if the end of the row is reached. + The iterator does not move to the next row in this case. + The method returns \verb'GrB_SUCCESS' if the iterator has been moved + to a specific entry in the current row. + + Preconditions: the same as \verb'GxB_rowIterator_nextRow'. + + \item {\em column iterator}: To move to the next column + + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_colIterator_nextCol (iterator) ; \end{verbatim}} + + The column iterator is a 2-dimensional iterator, requiring an outer loop + and an inner loop. The outer loop iterates over the columns of the matrix, + using \verb'GxB_colIterator_nextCol' to move to the next column. If the + matrix is hypersparse, the next column is always an explicit column; + implicit columns are skipped. The return conditions are identical to + \verb'GxB_colIterator_seekCol'. + + Preconditions: on input, the column iterator must already be attached to a + matrix via a prior call to \verb'GxB_colIterator_attach', and the + \verb'iterator' must be at a specific column, via a prior call to + \verb'GxB_colIterator_*seek*' or \verb'GxB_colIterator_nextCol'. + Results are undefined if these conditions are not met. + + {\footnotesize + \item {\em column iterator}: To move to the next entry within a column. + + \begin{verbatim} + GrB_Info info = GxB_colIterator_nextRow (iterator) ; \end{verbatim}} + + The column iterator is moved to the next entry in the current column. + The method returns \verb'GrB_NO_VALUE' if the end of the column is reached. + The iterator does not move to the next column in this case. + The method returns \verb'GrB_SUCCESS' if the iterator has been moved + to a specific entry in the current column. + + Preconditions: the same as \verb'GxB_colIterator_nextCol'. + + \item {\em entry iterator}: To move to the next entry. + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Matrix_Iterator_next (iterator) ; \end{verbatim}} + + This method moves an iterator to the next entry of a matrix. + It returns \verb'GrB_SUCCESS' if the iterator is at an entry that + exists in the matrix, or \verb'GrB_EXHAUSTED' otherwise. + + Preconditions: on input, the entry iterator must be already attached to a + matrix via \verb'GxB_Matrix_Iterator_attach', and the position of the + iterator must also have been defined by a prior call to + \verb'GxB_Matrix_Iterator_seek' or \verb'GxB_Matrix_Iterator_next'. + Results are undefined if these conditions are not met. + + \item {\em vector iterator}: To move to the next entry. + {\footnotesize + \begin{verbatim} + GrB_Info info = GxB_Vector_Iterator_next (iterator) ; \end{verbatim}} + + This method moves an iterator to the next entry of a vector. + It returns \verb'GrB_SUCCESS' if the iterator is at an entry that + exists in the vector, or \verb'GrB_EXHAUSTED' otherwise. + + Preconditions: on input, the iterator must be already attached to a + vector via \verb'GxB_Vector_Iterator_attach', and the position of the + iterator must also have been defined by a prior call to + \verb'GxB_Vector_Iterator_seek' or \verb'GxB_Vector_Iterator_next'. + Results are undefined if these conditions are not met. + + \end{enumerate} + +%=============================================================================== +\subsection{Accessing the indices of the current entry} +%=============================================================================== + +Once the iterator is attached to a matrix or vector, and is placed in position +at an entry in the matrix or vector, the indices and value of this entry can be +obtained. The methods for accessing the value of the entry are described in +Section~\ref{getvalu}. Accessing the indices is performed with four different +sets of methods, depending on which access pattern is in use, described below: + + \begin{enumerate} + \item {\em row iterator}: To get the current row index. + {\footnotesize + \begin{verbatim} + GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; \end{verbatim}} + + The method returns \verb'nrows(A)' if the iterator is exhausted, or the + current row index \verb'i' otherwise. There need not be any entry in the + current row. Zero is returned if the iterator is attached to the matrix + but \verb'GxB_rowIterator_*seek*' has not been called, but this does not + mean the iterator is positioned at row zero. + + Preconditions: on input, the iterator must be already successfully attached + to matrix as a row iterator via \verb'GxB_rowIterator_attach'. + Results are undefined if this condition is not met. + + \item {\em row iterator}: To get the current column index. + {\footnotesize + \begin{verbatim} + GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; \end{verbatim}} + + Preconditions: on input, the iterator must be already successfully attached + to matrix as a row iterator via \verb'GxB_rowIterator_attach', and in + addition, the row iterator must be positioned at a valid entry present in + the matrix. That is, the last call to \verb'GxB_rowIterator_*seek*' or + \verb'GxB_rowIterator_*next*', must have returned \verb'GrB_SUCCESS'. + Results are undefined if these conditions are not met. + + \item {\em column iterator}: To get the current column index. + {\footnotesize + \begin{verbatim} + GrB_Index j = GxB_colIterator_getColIndex (iterator) ; \end{verbatim}} + + The method returns \verb'ncols(A)' if the iterator is exhausted, or the + current column index \verb'j' otherwise. There need not be any entry in the + current column. Zero is returned if the iterator is attached to the matrix + but \verb'GxB_colIterator_*seek*' has not been called, but this does not + mean the iterator is positioned at column zero. + + Precondition: on input, the iterator must be already successfully attached + to matrix as a column iterator via \verb'GxB_colIterator_attach'. + Results are undefined if this condition is not met. + + \item {\em column iterator}: To get the current row index. + {\footnotesize + \begin{verbatim} + GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; \end{verbatim}} + + Preconditions: on input, the iterator must be already successfully attached + to matrix as a column iterator via \verb'GxB_colIterator_attach', and in + addition, the column iterator must be positioned at a valid entry present in + the matrix. That is, the last call to \verb'GxB_colIterator_*seek*' or + \verb'GxB_colIterator_*next*', must have returned \verb'GrB_SUCCESS'. + Results are undefined if these conditions are not met. + + \item {\em entry iterator}: To get the current row and column index. + {\footnotesize + \begin{verbatim} + GrB_Index i, j ; + GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; \end{verbatim}} + + Returns the row and column index of the current entry. + + Preconditions: on input, the entry iterator must be already attached to a + matrix via \verb'GxB_Matrix_Iterator_attach', and the position of the + iterator must also have been defined by a prior call to + \verb'GxB_Matrix_Iterator_seek' or \verb'GxB_Matrix_Iterator_next', with a + return value of \verb'GrB_SUCCESS'. + Results are undefined if these conditions are not met. + + \item {\em vector iterator}: To get the current index. + {\footnotesize + \begin{verbatim} + GrB_Index i = GxB_Vector_Iterator_getIndex (iterator) ; \end{verbatim}} + + Returns the index of the current entry. + + Preconditions: on input, the entry iterator must be already attached to a + matrix via \verb'GxB_Vector_Iterator_attach', and the position of the + iterator must also have been defined by a prior call to + \verb'GxB_Vector_Iterator_seek' or \verb'GxB_Vector_Iterator_next', with a + return value of \verb'GrB_SUCCESS'. + Results are undefined if these conditions are not met. + + \end{enumerate} + +%=============================================================================== +\subsection{Accessing the value of the current entry} +\label{getvalu} +%=============================================================================== + +So far, all methods that create or use an iterator have been split into four +sets of methods, for the row, column, or entry iterators attached to a matrix, +or for a vector iterator. Accessing the value is different. All four +iterators use the same set of methods to access the value of their current +entry. These methods return the value of the current entry at the position +determined by the iterator. The return value can of course be typecasted +using standard C syntax once the value is returned to the caller. + +Preconditions: on input, the prior call to \verb'GxB_*Iterator_*seek*', or +\verb'GxB_*Iterator_*next*' must have returned \verb'GrB_SUCCESS', indicating +that the iterator is at a valid current entry for either a matrix or vector. +No typecasting is permitted, in the sense that the method name must match the +type of the matrix or vector. +Results are undefined if these conditions are not met. + + {\footnotesize + \begin{verbatim} + // for built-in types: + bool value = GxB_Iterator_get_BOOL (iterator) ; + int8_t value = GxB_Iterator_get_INT8 (iterator) ; + int16_t value = GxB_Iterator_get_INT16 (iterator) ; + int32_t value = GxB_Iterator_get_INT32 (iterator) ; + int64_t value = GxB_Iterator_get_INT64 (iterator) ; + uint8_t value = GxB_Iterator_get_UINT8 (iterator) ; + uint16_t value = GxB_Iterator_get_UINT16 (iterator) ; + uint32_t value = GxB_Iterator_get_UINT32 (iterator) ; + uint64_t value = GxB_Iterator_get_UINT64 (iterator) ; + float value = GxB_Iterator_get_FP32 (iterator) ; + double value = GxB_Iterator_get_FP64 (iterator) ; + GxB_FC32_t value = GxB_Iterator_get_FC32 (iterator) ; + GxB_FC64_t value = GxB_Iterator_get_FC64 (iterator) ; + + // for user-defined types: + value ; + GxB_Iterator_get_UDT (iterator, (void *) &value) ; \end{verbatim}} + +%=============================================================================== +\newpage +\subsection{Example: row iterator for a matrix} +%=============================================================================== + +The following example uses a row iterator to access all of the entries +in a matrix \verb'A' of type \verb'GrB_FP64'. Note the inner and outer loops. +The outer loop iterates over all rows of the matrix. The inner loop iterates +over all entries in the row \verb'i'. This access pattern requires the matrix +to be held by-row, but otherwise it works for any matrix. If the matrix is +held by-column, then use the column iterator methods instead. + + {\footnotesize + \begin{verbatim} + // create an iterator + GxB_Iterator iterator ; + GxB_Iterator_new (&iterator) ; + // attach it to the matrix A, known to be type GrB_FP64 + GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; + if (info < 0) { handle the failure ... } + // seek to A(0,:) + info = GxB_rowIterator_seekRow (iterator, 0) ; + while (info != GxB_EXHAUSTED) + { + // iterate over entries in A(i,:) + GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; + while (info == GrB_SUCCESS) + { + // get the entry A(i,j) + GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; + double aij = GxB_Iterator_get_FP64 (iterator) ; + // move to the next entry in A(i,:) + info = GxB_rowIterator_nextCol (iterator) ; + } + // move to the next row, A(i+1,:), or a subsequent one if i+1 is implicit + info = GxB_rowIterator_nextRow (iterator) ; + } + GrB_free (&iterator) ; \end{verbatim}} + +%=============================================================================== +\newpage +\subsection{Example: column iterator for a matrix} +%=============================================================================== + +The column iterator is analgous to the row iterator. + +The following example uses a column iterator to access all of the entries in a +matrix \verb'A' of type \verb'GrB_FP64'. The outer loop iterates over all +columns of the matrix. The inner loop iterates over all entries in the column +\verb'j'. This access pattern requires the matrix to be held by-column, but +otherwise it works for any matrix. If the matrix is held by-row, then use +the row iterator methods instead. + + {\footnotesize + \begin{verbatim} + // create an iterator + GxB_Iterator iterator ; + GxB_Iterator_new (&iterator) ; + // attach it to the matrix A, known to be type GrB_FP64 + GrB_Info info = GxB_colIterator_attach (iterator, A, NULL) ; + // seek to A(:,0) + info = GxB_colIterator_seekCol (iterator, 0) ; + while (info != GxB_EXHAUSTED) + { + // iterate over entries in A(:,j) + GrB_Index j = GxB_colIterator_getColIndex (iterator) ; + while (info == GrB_SUCCESS) + { + // get the entry A(i,j) + GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; + double aij = GxB_Iterator_get_FP64 (iterator) ; + // move to the next entry in A(:,j) + info = GxB_colIterator_nextRow (iterator) ; + } + // move to the next column, A(:,j+1), or a subsequent one if j+1 is implicit + info = GxB_colIterator_nextCol (iterator) ; + } + GrB_free (&iterator) ; \end{verbatim}} + +%=============================================================================== +\newpage +\subsection{Example: entry iterator for a matrix} +%=============================================================================== + +The entry iterator allows for a simpler access pattern, with a single loop, but +using a row or column iterator is faster. The method works for any matrix. + + {\footnotesize + \begin{verbatim} + // create an iterator + GxB_Iterator iterator ; + GxB_Iterator_new (&iterator) ; + // attach it to the matrix A, known to be type GrB_FP64 + GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, NULL) ; + if (info < 0) { handle the failure ... } + // seek to the first entry + info = GxB_Matrix_Iterator_seek (iterator, 0) ; + while (info != GxB_EXHAUSTED) + { + // get the entry A(i,j) + GrB_Index i, j ; + GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; + double aij = GxB_Iterator_get_FP64 (iterator) ; + // move to the next entry in A + info = GxB_Matrix_Iterator_next (iterator) ; + } + GrB_free (&iterator) ; \end{verbatim}} + +%=============================================================================== +\subsection{Example: vector iterator} +%=============================================================================== + +A vector iterator is used much like an entry iterator for a matrix. + + {\footnotesize + \begin{verbatim} + // create an iterator + GxB_Iterator iterator ; + GxB_Iterator_new (&iterator) ; + // attach it to the vector v, known to be type GrB_FP64 + GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, NULL) ; + if (info < 0) { handle the failure ... } + // seek to the first entry + info = GxB_Vector_Iterator_seek (iterator, 0) ; + while (info != GxB_EXHAUSTED) + { + // get the entry v(i) + GrB_Index i = GxB_Vector_Iterator_getIndex (iterator) ; + double vi = GxB_Iterator_get_FP64 (iterator) ; + // move to the next entry in v + info = GxB_Vector_Iterator_next (iterator) ; + } + GrB_free (&iterator) ; \end{verbatim}} + +%=============================================================================== +\newpage +\subsection{Performance} +%=============================================================================== + +I have benchmarked the performance of the row and column iterators to compute +\verb'y=0' and then \verb'y+=A*x' where \verb'y' is a dense vector and \verb'A' +is a sparse matrix, using a single thread. The row and column iterators are +very fast, sometimes only 1\% slower than calling \verb'GrB_mxv' to compute the +same thing (also assuming a single thread), for large problems. For sparse +matrices that average just 1 or 2 entries per row, the row iterator can be +about 30\% slower than \verb'GrB_mxv', likely because of the slightly higher +complexity of moving from one row to the next using these methods. + +It is possible to split up the problem for multiple user threads, each with its +own iterator. Given the low overhead of the row and column iterator for a +single thread, this should be very fast. Care must be taken to ensure a good +load balance. Simply spliting up the rows of a matrix and giving the same +number of rows to each user thread can result in imbalanced work. This is +handled internally in \verb'GrB_*' methods, but enabling parallelism when using +iterators is the responsibility of the user application. + +The entry iterators are easier to use but harder to implement. The methods +must internally fuse both inner and outer loops so that the user application can +use a single loop. As a result, the computation \verb'y+=A*x' can be up to +4x slower (about 2x typical) than when using \verb'GrB_mxv' with a single +thread. + +To obtain the best performace possible, many of the iterator methods are +implemented as macros in \verb'GraphBLAS.h'. Using macros is the default, +giving typical C and C++ applications access to the fastest methods possible. + +To ensure access to these methods when not using the macros, these methods are +also defined as regular functions that appear in the compiled +\verb'libgraphblas.so' library with the same name as the macros. Applications +that cannot use the macro versions can \verb'#undef' the macros after the +\verb'#include ' statement, and then they would access the regular +compiled functions in \verb'libgraphblas.so'. This non-macro approach is not +the default, and the iterator methods may be slightly slower. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_jit.tex b/GraphBLAS/Doc/UserGuide/GrB_jit.tex new file mode 100644 index 0000000000..b1c4300665 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_jit.tex @@ -0,0 +1,564 @@ + + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{The SuiteSparse:GraphBLAS JIT} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{jit} + +SuiteSparse:GraphBLAS v8.0 adds a new JIT feature that greatly improves +performance of user-defined types and operators, and improves the performance +of built-in operators as well. The JIT can compile kernels that are specific +to the matrix type and the operators that work on it. In version v7.4.4 and +prior versions, user-defined types and operators were handled by {\em generic} +kernels that used function pointers for each operator and for any typecasting +required. Even built-in types and operators were sometimes handled by the +generic kernels, if any typecasting was done, or if the specific operator, +monoid, or semiring was disabled when GraphBLAS was compiled. + +\subsection{Using the JIT} + +Using the JIT in a user application is simple: by default, there is nothing to +do. The current release, LAGraph v1.1.4, can use the JIT (and PreJIT) kernels +without changing a single line of code. + +Currently, the JIT compiles kernels for the CPU only, but a CUDA JIT is in +progress to exploit NVIDIA GPUs, in collaboration with Joe Eaton and +Corey Nolet, with NVIDIA. + +When GraphBLAS is compiled, the \verb'cmake' build system creates a {\em cache} +folder where it will keep any kernels created and compiled by the JIT +(both source code and compiled libraries for each kernel). The +default folder is \verb'~/.SuiteSparse/GrB8.0.0' for SuiteSparse:GraphBLAS +version v8.0.0, where the tilde refers to the user's home directory. +The version numbers in the folder name are set automatically, so that a new +version will ignore kernels compiled by an older version of GraphBLAS. If the +\verb'GRAPHBLAS_CACHE_PATH' environment variable is set when GraphBLAS is +compiled, that variable defines the folder. If the user's home directory +cannot be determined and the \verb'GRAPHBLAS_CACHE_PATH' environment variable +is not set, then JIT compilation is disabled and only PreJIT kernels can be +used. The optional environment variable, \verb'GRAPHBLAS_CACHE_PATH', is also +read by \verb'GrB_init' when the user application runs. The filesystem holding +the cache folder must support file locking. See Section~\ref{cache_path} for a +description of the valid characters that can appear in the cache path. + +The user application can modify the location of the cache folder after calling +\verb'GrB_init'. It can also modify the C compiler and its flags, and can +control when and how the JIT is used. These changes are made via +\verb'GrB_set', and can be queried via \verb'GrB_get'; refer to +Section~\ref{options} for details, and the \verb'GxB_JIT_*' settings: + +\vspace{0.15in} +{\footnotesize +\begin{tabular}{lll} +\hline +field & value & description \\ +\hline +\verb'GxB_JIT_C_COMPILER_NAME' & \verb'char *' & C compiler for JIT kernels \\ +\verb'GxB_JIT_C_COMPILER_FLAGS'& \verb'char *' & flags for the C compiler \\ +\verb'GxB_JIT_C_LINKER_FLAGS' & \verb'char *' & link flags for the C compiler \\ +\verb'GxB_JIT_C_LIBRARIES' & \verb'char *' & libraries to link against (no cmake) \\ +\verb'GxB_JIT_C_CMAKE_LIBS' & \verb'char *' & libraries to link against (with cmake) \\ +\verb'GxB_JIT_C_PREFACE' & \verb'char *' & C code as preface to JIT kernels \\ +\verb'GxB_JIT_C_CONTROL' & see below & CPU JIT control \\ +\verb'GxB_JIT_USE_CMAKE' & see below & CPU JIT control \\ +\verb'GxB_JIT_ERROR_LOG' & \verb'char *' & error log file \\ +\verb'GxB_JIT_CACHE_PATH' & \verb'char *' & folder with compiled kernels \\ +\hline +\end{tabular} +} +\vspace{0.15in} + +To control the JIT in the MATLAB \verb'@GrB' interface, use the \verb'GrB.jit' +method. Refer to \verb'help GrB.jit' for details. + +Kernels compiled during one run of a user application are kept in the cache +folder, so that when the user application runs again, the kernels do not have +to be compiled. If the kernel relies on user-defined types and/or operators, a +check is made the first time the compiled kernel is loaded. If the current +definition of the user-defined type or operator does not exactly match the +definition when the kernel was compiled, then the compiled kernel is discarded +and recompiled. The stale kernel is overwritten with the new one, so there is +no need to for the user to take any action to delete the stale kernel from the +cache path. If the cache path is changed via \verb'GrB_set', compiled kernels +in the old cache folder are not copied over. New ones are compiled instead. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_CONTROL} +%---------------------------------------- + +The usage of the CPU JIT can be controlled via \verb'GrB_get/set' using the +\verb'GxB_JIT_C_CONTROL' setting. If the JIT is enabled at compile time, the +initial setting is \verb'GxB_JIT_ON'. If the JIT is disabled at compile time +(by setting the cmake variable \verb'GRAPHBLAS_USE_JIT' to \verb'OFF'), the +initial setting is \verb'GxB_JIT_RUN', so that any PreJIT kernels can be run. +This setting can be modified; for example to disable the JIT and clear all +loaded JIT kernels from memory, use: + +\begin{verbatim} + GrB_set (GrB_GLOBAL, GxB_JIT_OFF, GxB_JIT_C_CONTROL) ; +\end{verbatim} + +The above call to \verb'GrB_set' does not clear any PreJIT kernels, however, +since those are integral components of the single compiled GraphBLAS library +and cannot be cleared (see Section~\ref{prejit}). It also does not clear any +compiled user functions, created by the JIT for \verb'GxB_*Op_new' when the +input function pointer is \verb'NULL'. + +The following settings are available for \verb'GxB_JIT_C_CONTROL'. +For examples on how to use it, see +\verb'GraphBLAS/Demo/Program/gauss_demo.c'. + +{\footnotesize +\begin{verbatim} +typedef enum +{ + GxB_JIT_OFF = 0, // do not use the JIT: free all JIT kernels if loaded + GxB_JIT_PAUSE = 1, // do not run JIT kernels but keep any loaded + GxB_JIT_RUN = 2, // run JIT kernels if already loaded; no load/compile + GxB_JIT_LOAD = 3, // able to load and run JIT kernels; may not compile + GxB_JIT_ON = 4, // full JIT: able to compile, load, and run +} +GxB_JIT_Control ; +\end{verbatim} } + +If the JIT is disabled at compile time via setting the \verb'GRAPHBLAS_USE_JIT' +option \verb'OFF', \verb'PreJIT' kernels are still available, and can be +controlled via the \verb'GxB_JIT_OFF', \verb'GxB_JIT_PAUSE', or +\verb'GxB_JIT_RUN' settings listed above. If the application tries to set the +control to \verb'GxB_JIT_LOAD' or \verb'GxB_JIT_ON', the setting is changed to +\verb'GxB_JIT_RUN' instead. This is not an error condition. The resulting +setting can be queried via \verb'GrB_get', if desired. + +If your copy of GraphBLAS has many PreJIT kernels compiled into it, or uses +many run-time JIT kernels, turning of the JIT with \verb'GxB_JIT_OFF' can be +costly. This setting clears the entire JIT hash table. Renabling the JIT and +using it will require the JIT table to be repopulated, including a check of +each PreJIT kernel the first time they are used. If you wish to temporarily +disable the JIT, consider switching the JIT control to \verb'GxB_JIT_PAUSE' and +then back to \verb'GxB_JIT_RUN' to reenable the JIT. + +%---------------------------------------- +\subsubsection{JIT error handling} +%---------------------------------------- + +The JIT control setting can be changed by GraphBLAS itself, based on +following error conditions. These changes affect all kernels, not just the +kernel causing the error. If any of these cases occur, the call to GraphBLAS +returns \verb'GxB_JIT_ERROR', unless GraphBLAS runs out of memory, in which +case it returns \verb'GrB_OUT_OF_MEMORY' instead. If the JIT is disabled +through any of these errors, it can be detected by \verb'GrB_get' to read the +\verb'GxB_JIT_C_CONTROL' state. + +\begin{itemize} + +\item When a kernel is loaded that relies on user-defined types and/or +operators, the definitions in the previously compiled kernel are checked +against the current definitions. If they do not match, the old one is +discarded, and a new kernel will be compiled. However, if the control is set +to \verb'GxB_JIT_LOAD', no new kernels may be compiled. To avoid a continual +reloading and checking of stale kernels, the control is changed from +\verb'GxB_JIT_LOAD' to \verb'GxB_JIT_RUN'. To solve this problem, delete the +compiled kernel with the stale definition, or enable the full JIT by setting +the control to \verb'GxB_JIT_ON' so that the kernel can recompiled with the +current definitions. + +\item If a new kernel is to be compiled with the control set to +\verb'GxB_JIT_ON' but the source file cannot be created in the cache folder, or +a compiler error occurs, further compilation is disabled. The control is +changed from \verb'GxB_JIT_ON' to \verb'GxB_JIT_LOAD'. +To solve this problem, make sure your application has write permission to the +cache path and that any user-defined types and operators are defined properly +so that no syntax error is detected by the compiler. + +\item If a kernel is loaded but the lookup of the kernel function itself in the +compiled library fails, the control is changed to \verb'GxB_JIT_RUN' to prevent +this error from occuring again. To solve this problem, delete the corrupted +compiled kernel from the cache folder. This case is unlikely to occur since no +user action can trigger it. It could indicate a system problem with loading +the kernel, or some kind of compiler error that allows the kernel to be +compiled but not loaded. + +\item If an out-of-memory condition occurs in the JIT, the JIT control is +set to \verb'GxB_JIT_PAUSE'. This condition is not likely since the JIT does +not use a lot of memory. + +\end{itemize} + +As a result of this automatic change in the JIT control setting, after the +first JIT error is returned, subsequent calls to GraphBLAS will likely succeed. +GraphBLAS will use a generic kernel instead. To re-enable the JIT for +subsequent calls to GraphBLAS, the user application must reset the +\verb'GxB_JIT_C_CONTROL' back to \verb'GxB_JIT_ON'. + +In many use cases of GraphBLAS (such as LAGraph), a function will create a type +or operator, use it, and then free it just before returning. It would be far +too costly to clear the loaded kernel and reload it each time the LAGraph +function is called, so any kernels that use this type or operator are kept +loaded when the type or operator is freed. The typical case is that when the +LAGraph function is called again, it will recreate the type or operator with +the identical name and definition. The kernels that use these types or +operators will still be loaded and can thus be used with no overhead. + +However, if a user-defined type or operator is freed and then redefined with +the same name but a different definition, any loaded kernels should be freed. +This case is not detected by GraphBLAS since it would be far too costly to +check each time a previously loaded kernel is called. As a result, this +condition is only checked when the kernel is first loaded. To avoid this +issue, if the user application frees a user-defined type or operator and +creates a new one with a different definition but with the same name, clear all +prior kernels by setting the control to \verb'GxB_JIT_OFF'. Then turn the JIT +back on with \verb'GxB_JIT_ON'. This clears all run-time JIT kernels so that +they will be checked when reloaded, and recompiled if their definitions +changed. All PreJIT kernels are flagged as unchecked, just as they were +flagged by \verb'GrB_init', so that they will be checked the next time they +run. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_COMPILER\_NAME} +%---------------------------------------- + +The \verb'GxB_JIT_C_COMPILER_NAME' string is the name of the C compiler to use, +or its full path. +By default it is set to the C compiler used to compile GraphBLAS itself. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_COMPILER\_FLAGS} +%---------------------------------------- + +The \verb'GxB_JIT_C_COMPILER_FLAGS' string is the C compiler flags. +By default it is set to the C compiler flags used to compile GraphBLAS itself. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_LINKER\_FLAGS} +%---------------------------------------- + +The \verb'GxB_JIT_C_LINKER_FLAGS' string only affects the kernel compilation +when cmake is not used to compile the kernels (see Section~\ref{use_cmake}). +By default it is set to the C link flags used to compile GraphBLAS itself. +If cmake is used to compile the kernels, then it determines the linker flags +itself, and this cannot be modified. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_LIBRARIES} +%---------------------------------------- + +The \verb'GxB_JIT_C_LIBRARIES' string is used to set the libraries to link +against when cmake is not being used to compile the kernels (see +Section~\ref{use_cmake}). For example, on Linux it is set by default to the +\verb'-lm', \verb'-ld', and OpenMP libraries used to link GraphBLAS itself. +Any standalone library name is prepended with \verb'-l'. If cmake is used to +compile the kernels, this string is ignored. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_CMAKE\_LIBS} +%---------------------------------------- + +The \verb'GxB_JIT_C_LIBRARIES' string is used to set the libraries to link +against when cmake is being used to compile the kernels (see +Section~\ref{use_cmake}). For example, on Linux it is set by default to the +\verb'm', \verb'dl', and OpenMP libraries used to link GraphBLAS itself. +Libraries in the string should normally be separated by semicolons. If cmake +is not used to compile the kernels, this string is ignored. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_C\_PREFACE} +%---------------------------------------- + +The \verb'GxB_JIT_C_PREFACE' string is added at the top of each JIT kernel. It +is useful for providing additional \verb'#include' files that GraphBLAS does +not provide. It can also be useful for diagnostics and for configuring the +\verb'PreJIT'. For example, suppose you wish to tag specific kernels as having +been constructed for particular parts of an application. The application can +modify this string to some unique comment, and then run some benchmarks that +call GraphBLAS. Any JIT kernels created will be tagged with this unique +comment, which may be helpful to select specific kernels to copy into the +\verb'PreJIT' folder. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_USE\_CMAKE} +%---------------------------------------- +\label{use_cmake} + +Two methods are provided for compiling the JIT kernels: cmake, and a direct +compiler/link command. On Windows, only cmake may be used, and this setting +is ignored (it is always true). On Linux or Mac, the default is false since +a direct compile/link is faster. However, it is possible that some compilers +are not handled properly with this method, so cmake can also be used on those +platforms by setting the value of \verb'GxB_JIT_USE_CMAKE' to true. + +Normally the same version of cmake should be used to compile both GraphBLAS and +the JIT kernels. However, compiling GraphBLAS itself requires cmake v3.16 or +later (v3.19 for some options), while compiling the JIT kernels only requires +cmake v3.13 or later. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_ERROR\_LOG} +%---------------------------------------- + +The \verb'GxB_JIT_ERROR_LOG' string is the filename of the optional error +log file. By default, this string is empty, which means that any compiler +errors are routed to the \verb'stderr' output of the user process. If set +to a non-empty string, any compiler errors are appended to this file. +The string may be \verb'NULL', which means the same as an empty string. + +%---------------------------------------- +\subsubsection{\sf GxB\_JIT\_CACHE\_PATH} +\label{cache_path} +%---------------------------------------- + +The \verb'GxB_JIT_CACHE_PATH' string is the full path to the user's cache +folder (described above). The default on Linux/Mac is +\verb'~/.SuiteSparse/GrB8.0.0' for GraphBLAS version 8.0.0. On Windows, +the cache folder is created inside the user's \verb'LOCALAPPDATA' folder, +called \verb'SuiteSparse/GrB8.0.0'. When GraphBLAS starts, +\verb'GrB_init' checks if the \verb'GRAPHBLAS_CACHE_PATH' environment variable +exists, and initializes the cache path with that value instead of using the +default. + +{\bf Restrictions:} the cache path is sanitized for security reasons. No spaces +are permitted. Backslashes are converted into forward slashes. It can contain +only charactors in the following list: + +\begin{verbatim} + abcdefghijklmnopqrstuvwxyz + ABCDEFGHIJKLMNOPQRSTUVWXYZ + 0123456789.-_/ +\end{verbatim} + +In addition, the second character in the string is allowed to be the colon +character (\verb':') to allow for the use of Windows drive letters. Any +character outside of these rules is converted into an underscore (\verb'_'). + +%------------------------------------------------------------------------------- +\subsection{Compilation options: {\sf GRAPHBLAS\_USE\_JIT} and {\sf GRAPHBLAS\_COMPACT}} +%------------------------------------------------------------------------------- + +The CPU JIT can be disabled at compile time by setting the +\verb'GRAPHBLAS_USE_JIT' option \verb'OFF' in the cmake build options. Good +performance will be obtained only by using the \verb'FactoryKernels' or the +\verb'PreJIT' kernels that are compiled into GraphBLAS when it is first +compiled with \verb'cmake'. By default, \verb'GRAPHBLAS_USE_JIT' is \verb'ON', +to enable the CPU JIT. + +With the introduction of the JIT kernels, it is now possible to obtain good +performance in GraphBLAS without compiling the many {\em factory kernels} that +appear in the \verb'GraphBLAS/Source/FactoryKernels' directory. If the JIT is +enabled, GraphBLAS will still be fast, once the JIT kernels are compiled, or by +using any \verb'PreJIT' kernels. To compile GraphBLAS without its +\verb'FactoryKernels', enable the \verb'COMPACT' option in the cmake build +options. By default, \verb'COMPACT' is off, to enable the +\verb'FactoryKernels'. + +When GraphBLAS is compiled with \verb'GRAPHBLAS_USE_JIT' set to \verb'OFF', the +\verb'GxB_JIT_C_CONTROL' may be set to \verb'GxB_JIT_OFF', +\verb'GxB_JIT_PAUSE', or \verb'GxB_JIT_RUN'. No kernels will be loaded at +run-time (the \verb'GxB_JIT_LOAD' setting is disabled and treated as +\verb'GxB_JIT_RUN'), and no new kernels will be compiled at run-time (the +\verb'GxB_JIT_ON' is disabled and treated as \verb'GxB_JIT_RUN'). Only +pre-existing \verb'PreJIT' kernels can be run, described in +Section~\ref{prejit}. + +If both \verb'GRAPHBLAS_USE_JIT' is set \verb'OFF' and +\verb'GRAPHBLAS_COMPACT' is set \verb'ON', all features of GraphBLAS will be +functional. The only fast kernels available will be the \verb'PreJIT' kernels +(if any). Otherwise, generic kernels will be used, in which every single +operator is implemented with a function pointer, and every scalar assignment +requires a \verb'memcpy'. Generic kernels are slow, so using this combination +of options is not recommended when preparing GraphBLAS for production use, +benchmarking, or for a Linux distro or other widely-used distribution, unless +you are able to run your application in advance and create all the JIT kernels +you need, and then copy them into \verb'GraphBLAS/PreJIT'. This would be +impossible to do for a general-purpose case such as a Linux distro, but +feasible for a more targetted application such as FalkorDB. + +%------------------------------------------------------------------------------- +\subsection{Adding {\sf PreJIT} kernels to GraphBLAS} +%------------------------------------------------------------------------------- +\label{prejit} + +When GraphBLAS runs, it constructs JIT kernels in the user's cache folder, +which by default is \verb'~/.SuiteSparse/GrB8.0.0' for v8.0.0. The +kernels placed in a subfolder (\verb'c') and inside that folder they are +further subdivided arbitrarily into subfolders (via an arbitary hash). The +files are split into subfolders because a single folder may grow too large for +efficient access. Once GraphBLAS has generated some kernels, some or all of +them kernels can then incorporated into the compiled GraphBLAS library by +copying them into the \verb'GraphBLAS/PreJIT' folder. Be sure to move any +\verb'*.c' files into the single \verb'GraphBLAS/PreJIT' folder; do not keep +the subfolder structure. + +If GraphBLAS is then recompiled via cmake, the build system will detect these +kernels, compile them, and make them available as pre-compiled JIT kernels. +The kernels are no longer ``Just-In-Time'' kernels since they are not compiled +at run-time. They are refered to as \verb'PreJIT' kernels since they were at +one time created at run-time by the GraphBLAS JIT, but are now compiled into +GraphBLAS before it runs. + +{\bf It's that simple.} Just copy the source files for any kernels you want +from your cache folder (typically \verb'~/.SuiteSparse/GrB8.0.0/c') into +\verb'GraphBLAS/PreJIT', and recompile GraphBLAS. There's no need to change +any other cmake setting, and no need to do anything different in any +applications that use GraphBLAS. Do not copy the compiled libraries; they are +not needed and will be ignored. Just copy the \verb'*.c' files. + +If the resulting GraphBLAS library is installed for system-wide usage (say in a +Linux distro, Python, RedisGraph, FalkorDB, etc), the \verb'GraphBLAS/PreJIT' +kernels will be available to all users of that library. They are not disabled +by the \verb'GRAPHBLAS_USE_JIT' option. + +Once these kernels are moved to \verb'GraphBLAS/PreJIT' and GraphBLAS is +recompiled, they can be deleted from the cache folder. However, even if they +are left there, they will not be used since GraphBLAS will find these kernels +as PreJIT kernels inside the compiled library itself (\verb'libgraphblas.so' on +Linux, \verb'libgraphblas.dylib' on the Mac). GraphBLAS will not be any slower +if these kernels are left in the cache folder, and the compiled library size +will not be affected. + +If the GraphBLAS version is changed at all (even in the last digit), all +\verb'GB_jit_*.c' files in the \verb'GraphBLAS/PreJIT' folder should be +deleted. The version mismatch will be detected during the call to +\verb'GrB_init', and any stale kernels will be safely ignored. Likewise, if a +user-defined type or operator is changed, the relevant kernels should also be +deleted from \verb'GraphBLAS/PreJIT'. For example, the +\verb'GraphBLAS/Demo/Program/gauss_demo.c' program creates a user-defined +\verb'gauss' type, and two operators, \verb'addgauss' and \verb'multgauss'. It +then intentionally changes one of the operators just to test this feature. If +the type and/or operators are changed, then the \verb'*gauss*.c' files in the +\verb'GraphBLAS/PreJIT' folder should be deleted. + +GraphBLAS will safely detect any stale \verb'PreJIT' kernels by checking them +the first time they are run after calling \verb'GrB_init' and will not use them +if they are found to be stale. If the JIT control is set to \verb'GxB_JIT_OFF' +all PreJIT kernels are flagged as unchecked. If the JIT is then renabled by +setting the control to \verb'GxB_JIT_RUN' or \verb'GxB_JIT_ON', all PreJIT +kernels will be checked again and any stale kernels will be detected. + +If a stale PreJIT kernel is found, GraphBLAS will use its run-time JIT to +compile new ones with the current definitions, or it will punt to a generic +kernel if JIT compilation is disabled. GraphBLAS will be functional, and fast +if it can rely on a JIT kernel, but the unusable stale PreJIT kernels take up +space inside the compiled GraphBLAS library. The best practice is to delete +any stale kernels from the \verb'GraphBLAS/PreJIT' folder, or replace them with +newly compiled JIT kernels from the cache folder, and recompile GraphBLAS. + +It is safe to copy only a subset of the JIT kernels from the cache folder into +\verb'GraphBLAS/PreJIT'. You may also delete any files in +\verb'GraphBLAS/PreJIT' and recompile GraphBLAS without those kernels. If +GraphBLAS encounters a need for a particular kernel that has been removed from +\verb'GraphBLAS/PreJIT', it will create it at run-time via the JIT, if +permitted. If not permitted, by either compiling GraphBLAS with the +\verb'GRAPHBLAS_USE_JIT' option set ot \verb'OFF', or by using +\verb'GxB_JIT_C_CONTROL' at run-time, the factory kernel or generic kernel will +be used instead. The generic kernel will be slower than the PreJIT or JIT +kernel, but GraphBLAS will still be functional. + +In addition to a single \verb'README.txt' file, the \verb'GraphBLAS/PreJIT' +folder includes a \verb'.gitignore' file that prevents any files in the folder +from being synced via \verb'git'. If you wish to add your PreJIT kernels to a +fork of GraphBLAS, you will need to revise this \verb'.gitignore' file. + +%------------------------------------------------------------------------------- +\subsection{{\sf JIT} and {\sf PreJIT} performance considerations} +%------------------------------------------------------------------------------- +\label{jit_performance} + +To create a good set of PreJIT kernels for a particular user application, it is +necessary to run the application with many different kinds of workloads. Each +JIT or PreJIT kernel is specialized to the particular matrix format, data type, +operators, and descriptors of its inputs. GraphBLAS can change a matrix format +(from sparse to hypersparse, for example), at its discretion, thus triggering +the use of a different kernel. Some GraphBLAS methods use heuristics to select +between different methods based upon the sparsity structure or estimates of the +kind or amount of work required. In these cases, entirely different kernels +will be compiled. As a result, it's very difficult to predict which kernels +GraphBLAS will find the need to compile, and thus a wide set of test cases +should be used in an application to allow GraphBLAS to generate as many kernels +as could be expected to appear in production use. + +GraphBLAS can encounter very small matrices, and it will often select its +bitmap format to store them. This change of format will trigger a different +kernel than the sparse or hypersparse cases. There are many other cases like +that where specific kernels are only needed for small problems. In this case, +compiling an entirely new kernel is costly, since using a compiled kernel will +be no faster than the generic kernel. When benchmarking an application to +allow GraphBLAS to compile its JIT kernels, it may be useful to pause the JIT +via \verb'GxB_JIT_PAUSE', \verb'GxB_JIT_RUN', or \verb'GxB_JIT_LOAD', when the +application knows it is calling GraphBLAS for tiny problems. These three +settings keep any loaded JIT kernels in memory, but pauses the compilation of +any new JIT kernels. Then the control can be reset to \verb'GxB_JIT_ON' once +the application finishes with its tiny problems and moves to larger ones where +the JIT will improve performance. A future version of GraphBLAS may allow +this heuristic to be implemented inside GraphBLAS itself, but for now, the +JIT does not second guess the user application; if it wants a new kernel, +the JIT will compile it if the control is set to \verb'GxB_JIT_ON'. + +%------------------------------------------------------------------------------- +\subsection{Mixing JIT kernels: MATLAB and Apple Silicon} +%------------------------------------------------------------------------------- + +In general, the JIT kernels compiled by the C interface and the kernels +compiled while using GraphBLAS in MATLAB are interchangable, and the same cache +folder can be used for both. This is the default. + +However, when using the \verb'@GrB' MATLAB interface to GraphBLAS on Apple +Silicon, using an older version of MATLAB, the MATLAB JIT kernels are compiled +as x86 binaries and executed inside MATLAB via Rosetta. The pure C +installation may compile native Arm64 binaries for its JIT kernels. Do not mix +the two. In this case, set another cache path for MATLAB using \verb'GrB.jit' +in MATLAB, or using \verb'GrB_set' in the C interface for your native Arm64 +binaries. + +This issue does not apply to for recent MATLAB versions on the Mac, +which are native. + +%------------------------------------------------------------------------------- +\subsection{Updating the JIT when GraphBLAS source code changes} +%------------------------------------------------------------------------------- + +If you edit the GraphBLAS source code itself or add any files to +\verb'GraphBLAS/PreJIT', read the instructions in +\verb'GraphBLAS/JITpackage/README.txt' for details on how to update the JIT +source code. + +If your cache folder (\verb'~/.SuiteSparse/GrBx.y.z') changes in any way +except via GraphBLAS itself, simply delete your cache folder. GraphBLAS will +then reconstruct the kernels there as needed. + +%------------------------------------------------------------------------------- +\subsection{Future plans for the {\sf JIT} and {\sf PreJIT}} +%------------------------------------------------------------------------------- +\label{jit_future} + +\subsubsection{Kernel fusion} +The introduction of the JIT and its related PreJIT kernels allow for the future +exploitation of kernel fusion via an aggressive exploitation of the GraphBLAS +non-blocking mode. In that mode, multiple calls to GraphBLAS can be fused into +a single kernel. There are far to many possible variants to allow a fused +kernel to appear in the \verb'GraphBLAS/Source/FactoryKernels' folder, but +specific fused kernels could be created by the JIT. + +\subsubsection{Heuristics for controlling the JIT} +As mentioned in Section~\ref{jit_performance}, GraphBLAS may compile JIT +kernels that are used for only tiny problems where the compile time of a single +kernel will dominate any performance gains from using the compiled kernel. A +heuristic could be introduced so that it compiles them only for larger +problems. The possible downside of this approach is that the same JIT kernels +might be needed later for larger problems. + +\subsubsection{CUDA / SYCL / OpenCL kernels} +The CUDA JIT will enable NVIDIA GPUs to be exploited. There are simply too +many kernels to create at compile time as the ``factory kernels.'' This CUDA +JIT is in progress. A related JIT for SYCL / OpenCL kernels is under +consideration. + +\subsubsection{Better performance for multithreaded user programs:} +This version is thread-safe when used in a multithread user application, but a +better JIT critical section (many readers, one writer) might be needed. The +current critical section may be sufficiently fast since the typical case of +work done inside the critical section is a single hash table lookup. However, +the performance issues related to this have not been tested. This has no +effect if all parallelism is exploited only within GraphBLAS. It only +affects the case when multiple user threads each call GraphBLAS in parallel +(using the \verb'GxB_Context'; see Section~\ref{context}). + diff --git a/GraphBLAS/Doc/UserGuide/GrB_mask.tex b/GraphBLAS/Doc/UserGuide/GrB_mask.tex new file mode 100644 index 0000000000..95fec95728 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_mask.tex @@ -0,0 +1,169 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{The mask, accumulator, and replace option} %%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{sec:maskaccum} + +After a GraphBLAS operation computes a result ${\bf T}$, (for example, ${\bf +T=AB}$ for \verb'GrB_mxm'), the results are assigned to an output matrix ${\bf +C}$ via the mask/ accumulator phase, written as ${\bf C \langle M \rangle = C +\odot T}$. This phase is affected by the \verb'GrB_REPLACE' option in the +descriptor, the presence of an optional binary accumulator operator ($\odot$), +the presence of the optional mask matrix ${\bf M}$, and the status of the mask +descriptor. The interplay of these options is summarized in +Table~\ref{tab:maskaccum}. + +The mask ${\bf M}$ may be present, or not. It may be structural or valued, and +it may be complemented, or not. These options may be combined, for a total of +8 cases, although the structural/valued option as no effect if ${\bf M}$ is not +present. If ${\bf M}$ is not present and not complemented, then $m_{ij}$ is +implicitly true. If not present yet complemented, then all $m_{ij}$ entries are +implicitly zero; in this case, ${\bf T}$ need not be computed at all. Either +${\bf C}$ is not modified, or all its entries are cleared if the replace option +is enabled. If ${\bf M}$ is present, and the structural option is used, then +$m_{ij}$ is treated as true if it is an entry in the matrix (its value is +ignored). Otherwise, the value of $m_{ij}$ is used. In both cases, entries +not present are implicitly zero. These values are negated if the mask is +complemented. All of these various cases are combined to give a single +effective value of the mask at position ${ij}$. + +The combination of all these options are presented in the +Table~\ref{tab:maskaccum}. The first column is the \verb'GrB_REPLACE' option. +The second column lists whether or not the accumulator operator is present. +The third column lists whether or not $c_{ij}$ exists on input to the +mask/accumulator phase (a dash means that it does not exist). The fourth +column lists whether or not the entry $t_{ij}$ is present in the result matrix +${\bf T}$. The mask column is the final effective value of $m_{ij}$, after +accounting for the presence of ${\bf M}$ and the mask options. Finally, the +last column states the result of the mask/accum step; if no action is listed in +this column, then $c_{ij}$ is not modified. + +Several important observations can be made from this table. First, +if no mask is present (and the mask-complement descriptor option is not used), +then only the first half of the table is used. In this case, the \verb'GrB_REPLACE' +option has no effect. The entire matrix ${\bf C}$ is modified. + +Consider the cases when $c_{ij}$ is present but $t_{ij}$ is not, and there is no +mask or the effective value of the mask is true for this ${ij}$ position. With +no accumulator operator, $c_{ij}$ is deleted. If the accumulator operator is +present and the replace option is not used, $c_{ij}$ remains unchanged. + +\begin{table} +{\small +\begin{tabular}{lllll|l} +\hline +repl & accum & ${\bf C}$ & ${\bf T}$ & mask & action taken by ${\bf C \langle M \rangle = C \odot T}$ \\ +\hline + - &- & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, update \\ + - &- & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ + - &- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $t_{ij}$ not present \\ + - &- & - & - & 1 & \\ + - &- & $c_{ij}$ & $t_{ij}$ & 0 & \\ + - &- & - & $t_{ij}$ & 0 & \\ + - &- & $c_{ij}$ & - & 0 & \\ + - &- & - & - & 0 & \\ +\hline + yes&- & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, update \\ + yes&- & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ + yes&- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $t_{ij}$ not present \\ + yes&- & - & - & 1 & \\ + yes&- & $c_{ij}$ & $t_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&- & - & $t_{ij}$ & 0 & \\ + yes&- & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&- & - & - & 0 & \\ +\hline + - &yes & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ + - &yes & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ + - &yes & $c_{ij}$ & - & 1 & \\ + - &yes & - & - & 1 & \\ + - &yes & $c_{ij}$ & $t_{ij}$ & 0 & \\ + - &yes & - & $t_{ij}$ & 0 & \\ + - &yes & $c_{ij}$ & - & 0 & \\ + - &yes & - & - & 0 & \\ +\hline + yes&yes & $c_{ij}$ & $t_{ij}$ & 1 & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ + yes&yes & - & $t_{ij}$ & 1 & $c_{ij} = t_{ij}$, insert \\ + yes&yes & $c_{ij}$ & - & 1 & \\ + yes&yes & - & - & 1 & \\ + yes&yes & $c_{ij}$ & $t_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&yes & - & $t_{ij}$ & 0 & \\ + yes&yes & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&yes & - & - & 0 & \\ +\hline +\end{tabular} +} +\caption{Results of the mask/accumulator phase. \label{tab:maskaccum}} +\end{table} + +When there is no mask and the mask \verb'GrB_COMP' option is not selected, the +table simplifies (Table~\ref{tab:maskaccum_nomask}). The \verb'GrB_REPLACE' +option no longer has any effect. The \verb'GrB_SECOND_T' binary operator when +used as the accumulator unifies the first cases, shown in +Table~\ref{tab:maskaccum_nomask_2nd}. The only difference now is the behavior +when $c_{ij}$ is present but $t_{ij}$ is not. Finally, the effect of +\verb'GrB_FIRST_T' as the accumulator is shown in +Table~\ref{tab:maskaccum_nomask_1st}. + +\begin{table}[h] +\begin{center} +{\small +\begin{tabular}{lll|l} +\hline + accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ +\hline + - & $c_{ij}$ & $t_{ij}$ & $c_{ij} = t_{ij}$, update \\ + - & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ + - & $c_{ij}$ & - & delete $c_{ij}$ because $t_{ij}$ not present \\ + - & - & - & \\ +\hline + yes & $c_{ij}$ & $t_{ij}$ & $c_{ij} = c_{ij} \odot t_{ij}$, apply accumulator \\ + yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ + yes & $c_{ij}$ & - & \\ + yes & - & - & \\ +\hline +\end{tabular} +} +\caption{When no mask is present (and not complemented). +\label{tab:maskaccum_nomask}} +\end{center} +\end{table} + +\begin{table}[h] +\begin{center} +{\small +\begin{tabular}{lll|l} +\hline + accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ +\hline + yes & $c_{ij}$ & $t_{ij}$ & $c_{ij} = t_{ij}$, apply \verb'GrB_SECOND' accumulator \\ + yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ + yes & $c_{ij}$ & - & \\ + yes & - & - & \\ +\hline +\end{tabular} +} +\caption{No mask, with the SECOND operator as the accumulator. +\label{tab:maskaccum_nomask_2nd}} +\end{center} +\end{table} + +\begin{table}[h] +\begin{center} +{\small +\begin{tabular}{lll|l} +\hline + accum & ${\bf C}$ & ${\bf T}$ & action taken by ${\bf C = C \odot T}$ \\ +\hline + yes & $c_{ij}$ & $t_{ij}$ & \\ + yes & - & $t_{ij}$ & $c_{ij} = t_{ij}$, insert \\ + yes & $c_{ij}$ & - & \\ + yes & - & - & \\ +\hline +\end{tabular} +} +\caption{No Mask, with the FIRST operator as the accumulator. +\label{tab:maskaccum_nomask_1st}} +\end{center} +\end{table} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_matlab_performance.tex b/GraphBLAS/Doc/UserGuide/GrB_matlab_performance.tex new file mode 100644 index 0000000000..1d5ee33151 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_matlab_performance.tex @@ -0,0 +1,93 @@ + +%=============================================================================== +\subsection{Performance of MATLAB versus GraphBLAS} +%=============================================================================== +\label{matlab_performance} + +MATLAB R2021a uses SuiteSparse:GraphBLAS as a built-in library, but +uses it only for \verb'C=A*B' when both \verb'A' and \verb'B' are sparse. In +prior versions of MATLAB, \verb'C=A*B' relied on the \verb'SFMULT' and +\verb'SSMULT' packages in SuiteSparse, which are single-threaded (also written +by this author). The GraphBLAS \verb'GrB_mxm' is up to 30x faster on a 20-core +Intel Xeon, compared with \verb'C=A*B' in MATLAB R2020b and earlier. With +MATLAB R2021a and later, the performance of \verb'C=A*B' when using MATLAB +sparse matrices is identical to the performance for GraphBLAS matrices, since +the same code is being used by both (\verb'GrB_mxm'). + +Other methods in GraphBLAS are also faster, some {\em extremely} so, but are +not yet exploited as built-in operations MATLAB. In particular, the statement +\verb'C(M)=A' (where \verb'M' is a logical matrix) takes under a second for a +large sparse problem when using GraphBLAS via its \verb'@GrB' interface. By +stark contrast, MATLAB would take about 4 or 5 days, a speedup of about +500,000x. For a smaller problem, GraphBLAS takes 0.4 seconds while MATLAB +takes 28 hours (a speedup of about 250,000x). Both cases use the same +statement with the same syntax (\verb'C(M)=A') and compute exactly the same +result. Below are the results for \verb'n'-by-\verb'n' matrices in GraphBLAS +v5.0.6 and MATLAB R2020a, on a Dell XPS13 laptop (16GB RAM, Intel(R) Core(TM) +i7-8565U CPU @ 1.80GHz with 4 hardware cores). GraphBLAS is using 4 threads. + +\vspace{0.10in} +{\scriptsize +\begin{tabular}{rrr|rrr} +\hline +\verb'n' & \verb'nnz(C)' & \verb'nnz(M)' & GraphBLAS (sec) & MATLAB (sec) & speedup \\ +\hline +2,048 & 20,432 & 2,048 & 0.005 & 0.024 & 4.7 \\ +4,096 & 40,908 & 4,096 & 0.003 & 0.115 & 39 \\ +8,192 & 81,876 & 8,191 & 0.009 & 0.594 & 68 \\ +16,384 & 163,789 & 16,384 & 0.009 & 2.53 & 273 \\ +32,768 & 327,633 & 32,767 & 0.014 & 12.4 & 864 \\ +65,536 & 655,309 & 65,536 & 0.025 & 65.9 & 2,617 \\ +131,072 & 1,310,677 & 131,070 & 0.055 & 276.2 & 4,986 \\ +262,144 & 2,621,396 & 262,142 & 0.071 & 1,077 & 15,172 \\ +524,288 & 5,242,830 & 524,288 & 0.114 & 5,855 & 51,274 \\ +1,048,576 & 10,485,713 & 1,048,576 & 0.197 & 27,196 & 137,776 \\ +2,097,152 & 20,971,475 & 2,097,152 & 0.406 & 100,799 & 248,200 \\ +4,194,304 & 41,942,995 & 4,194,304 & 0.855 & 4 to 5 days? & 500,000?\\ +\hline +\end{tabular}} +\vspace{0.10in} + +The assignment \verb'C(I,J)=A' in MATLAB, when using \verb'@GrB' objects, is up +to 1000x faster than the same statement with the same syntax, when using MATLAB +sparse matrices instead. Matrix concatenation \verb'C = [A B]' is about 17 +times faster in GraphBLAS, on a 20-core Intel Xeon. For more details, see the +\verb'GraphBLAS/GraphBLAS/demo' folder and its contents. + +Below is a comparison of other methods in SuiteSparse:GraphBLAS, compared with +MATLAB 2021a. SuiteSparse:GraphBLAS: v6.1.4 (Jan 12, 2022), was used, compiled +with gcc 11.2.0. The system is an Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz +(20 hardware cores, 40 threads), Ubuntu 20.04, 256GB RAM. Full details appear +in the \verb'GraphBLAS/GraphBLAS/demo/benchmark' folder. For this matrix, +SuiteSparse:GraphBLAS is anywhere from 3x to 17x faster than the built-in +methods in MATLAB. This matrix is not special, but is typical of the relative +performance of many large matrices. Note that two of these (\verb'C=L*S' and +\verb'C=S*R') rely on an older version of SuiteSparse:GraphBLAS (v3.3.3) built +into MATLAB R2021a. + +{\footnotesize +\begin{verbatim} + Legend: + S: large input sparse matrix (n-by-n), the GAP-twitter matrix + x: dense vector (1-by-n or n-by-1) + F: dense matrix (4-by-n or n-by-4) + L: 8-by-n sparse matrix, about 1000 entries + R: n-by-8 sparse matrix, about 1000 entries + B: n-by-n sparse matrix, about nnz(S)/10 entries + p,q: random permutation vectors + + GAP/GAP-twitter: n: 61.5784 million nnz: 1468.36 million + (run time in seconds): + y=S*x: MATLAB: 22.8012 GrB: 2.4018 speedup: 9.49 + y=x*S: MATLAB: 16.1618 GrB: 1.1610 speedup: 13.92 + C=S*F: MATLAB: 30.6121 GrB: 9.7052 speedup: 3.15 + C=F*S: MATLAB: 26.4044 GrB: 1.5245 speedup: 17.32 + C=L*S: MATLAB: 19.1228 GrB: 2.4301 speedup: 7.87 + C=S*R: MATLAB: 0.0087 GrB: 0.0020 speedup: 4.40 + C=S' MATLAB: 224.7268 GrB: 22.6855 speedup: 9.91 + C=S+S: MATLAB: 14.3368 GrB: 1.5539 speedup: 9.23 + C=S+B: MATLAB: 15.5600 GrB: 1.5098 speedup: 10.31 + C=S(p,q) MATLAB: 95.6219 GrB: 15.9468 speedup: 6.00 \end{verbatim} +} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects.tex b/GraphBLAS/Doc/UserGuide/GrB_objects.tex new file mode 100644 index 0000000000..d4d9e43227 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects.tex @@ -0,0 +1,73 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{GraphBLAS Objects and their Methods} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{objects} + +SuiteSparse:GraphBLAS defines 14 different objects to represent matrices, vectors, +scalars, data types, operators (binary, unary, and index-unary), monoids, +semirings, a {\em descriptor} object used to specify optional parameters +that modify the behavior of a GraphBLAS operation, a {\em context} +object for controlling computational resources, a matrix/vector iterator, +and a container object for moving data in and out of the GraphBLAS opaque +matrix/vector objects. + +The GraphBLAS API makes a distinction between {\em methods} and {\em +operations}. A method is a function that works on a GraphBLAS object, creating +it, destroying it, or querying its contents. An operation (not to be confused +with an operator) acts on matrices and/or vectors in a semiring. + +\vspace{0.1in} +\noindent +{\small +\begin{tabular}{ll} +\hline +\verb'GrB_Type' & a scalar data type \\ +\verb'GrB_UnaryOp' & a unary operator $z=f(x)$, where $z$ and $x$ are scalars\\ +\verb'GrB_BinaryOp' & a binary operator $z=f(x,y)$, where $z$, $x$, and $y$ are scalars\\ +\verb'GrB_IndexUnaryOp' & an index-unary operator \\ +\verb'GxB_IndexBinaryOp' & an index-binary operator \\ +\verb'GrB_Monoid' & an associative and commutative binary operator \\ + & and its identity value \\ +\verb'GrB_Semiring' & a monoid that defines the ``plus'' and a binary operator\\ + & that defines the ``multiply'' for an algebraic semiring \\ +\verb'GrB_Matrix' & a 2D sparse matrix of any type \\ +\verb'GrB_Vector' & a 1D sparse column vector of any type \\ +\verb'GrB_Scalar' & a scalar of any type \\ +\verb'GrB_Descriptor'& a collection of parameters that modify an operation \\ +\verb'GxB_Context' & allocating computational resources \\ +\verb'GxB_Iterator' & a matrix/vector iterator (See Section~\ref{iter}) \\ +\verb'GxB_Container' & for moving data between GraphBLAS and a user application \\ +\hline +\end{tabular} +} +\vspace{0.1in} + +Most of these objects are implemented in C as an opaque handle, which is a +pointer to a data structure held by GraphBLAS. User applications may not +examine the content of the object directly; instead, they can pass the handle +back to GraphBLAS which will do the work. Assigning one handle to another +is valid but it does not make a copy of the underlying object. + +The \verb'GxB_Container' object is non-opaque but includes opaque objects +as its contents. All other objects are entirely opaque. + +\input{UserGuide/GrB_objects_Type.tex} +\input{UserGuide/GrB_objects_UnaryOp.tex} +\input{UserGuide/GrB_objects_BinaryOp.tex} +\input{UserGuide/GrB_objects_IndexUnaryOp.tex} +\input{UserGuide/GrB_objects_IndexBinaryOp.tex} +\input{UserGuide/GrB_objects_Monoid.tex} +\input{UserGuide/GrB_objects_Semiring.tex} +\input{UserGuide/GrB_objects_Scalar.tex} +\input{UserGuide/GrB_objects_Vector.tex} +\input{UserGuide/GrB_objects_Matrix.tex} +\input{UserGuide/GrB_objects_Serialize.tex} +\input{UserGuide/GrB_objects_Container.tex} +\input{UserGuide/GrB_objects_formats.tex} +\input{UserGuide/GrB_objects_import.tex} +\input{UserGuide/GrB_objects_sort.tex} +\input{UserGuide/GrB_objects_Descriptor.tex} +\input{UserGuide/GrB_objects_free.tex} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_BinaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_BinaryOp.tex new file mode 100644 index 0000000000..3908175941 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_BinaryOp.tex @@ -0,0 +1,529 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== +%=============================================================================== +\label{binaryop} + +A binary operator is a scalar function of the form $z=f(x,y)$. The types of +$z$, $x$, and $y$ need not be the same. The built-in binary operators are +listed in the tables below. The notation $T$ refers to any of the 13 +built-in types, but two of those types are SuiteSparse extensions +(\verb'GxB_FC32' and \verb'GxB_FC64'). For those types, the operator name +always starts with \verb'GxB', not \verb'GrB'). +The notation $R$ refers to any real type (all but \verb'FC32' and \verb'FC64'). + +The six \verb'GxB_IS*' comparators and the \verb'GxB_*' logical +operators all return a result one for true and zero for false, in the same +domain $T$ or $R$ as their inputs. These six comparators are useful +as ``multiply'' operators for creating semirings with non-Boolean monoids. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary operators for all 13 types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +% numeric TxT->T +\verb'GrB_FIRST_'$T$ & $T \times T \rightarrow T$ & $z = x$ & first argument \\ +\verb'GrB_SECOND_'$T$ & $T \times T \rightarrow T$ & $z = y$ & second argument \\ +\verb'GxB_ANY_'$T$ & $T \times T \rightarrow T$ & $z = x$ or $y$ & pick $x$ or $y$ arbitrarily \\ +\verb'GrB_ONEB_'$T$ & $T \times T \rightarrow T$ & $z = 1$ & one \\ +\verb'GxB_PAIR_'$T$ & $T \times T \rightarrow T$ & $z = 1$ & one (historical) \\ +\verb'GrB_PLUS_'$T$ & $T \times T \rightarrow T$ & $z = x+y$ & addition \\ +\verb'GrB_MINUS_'$T$ & $T \times T \rightarrow T$ & $z = x-y$ & subtraction \\ +\verb'GxB_RMINUS_'$T$ & $T \times T \rightarrow T$ & $z = y-x$ & reverse subtraction \\ +\verb'GrB_TIMES_'$T$ & $T \times T \rightarrow T$ & $z = xy$ & multiplication \\ +\verb'GrB_DIV_'$T$ & $T \times T \rightarrow T$ & $z = x/y$ & division \\ +\verb'GxB_RDIV_'$T$ & $T \times T \rightarrow T$ & $z = y/x$ & reverse division \\ +\verb'GxB_POW_'$T$ & $T \times T \rightarrow T$ & $z = x^y$ & power \\ +\hline +% TxT->T comparators +\verb'GxB_ISEQ_'$T$ & $T \times T \rightarrow T$ & $z = (x == y)$ & equal \\ +\verb'GxB_ISNE_'$T$ & $T \times T \rightarrow T$ & $z = (x \ne y)$ & not equal \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +The \verb'GxB_POW_*' operators for real types do not return a complex result, +and thus $z = f(x,y) = x^y$ is undefined if $x$ is negative and $y$ is not an +integer. To compute a complex result, use \verb'GxB_POW_FC32' or +\verb'GxB_POW_FC64'. + +Operators that require the domain to be ordered (\verb'MIN', \verb'MAX', +less-than, greater-than, and so on) are not defined for +complex types. These are listed in the following table: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary operators for all non-complex types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +% numeric RxR->R +\verb'GrB_MIN_'$R$ & $R \times R \rightarrow R$ & $z = \min(x,y)$ & minimum \\ +\verb'GrB_MAX_'$R$ & $R \times R \rightarrow R$ & $z = \max(x,y)$ & maximum \\ +\hline +% RxR->R comparators +\verb'GxB_ISGT_'$R$ & $R \times R \rightarrow R$ & $z = (x > y)$ & greater than \\ +\verb'GxB_ISLT_'$R$ & $R \times R \rightarrow R$ & $z = (x < y)$ & less than \\ +\verb'GxB_ISGE_'$R$ & $R \times R \rightarrow R$ & $z = (x \ge y)$ & greater than or equal \\ +\verb'GxB_ISLE_'$R$ & $R \times R \rightarrow R$ & $z = (x \le y)$ & less than or equal \\ +\hline +% RxR->R logical +\verb'GxB_LOR_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \vee (y \ne 0) $ & logical OR \\ +\verb'GxB_LAND_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \wedge (y \ne 0) $ & logical AND \\ +\verb'GxB_LXOR_'$R$ & $R \times R \rightarrow R$ & $z = (x \ne 0) \veebar (y \ne 0) $ & logical XOR \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +Another set of six kinds of built-in comparators have the form $T +\times T \rightarrow $\verb'bool'. Note that when $T$ is \verb'bool', the six +operators give the same results as the six \verb'GxB_IS*_BOOL' operators in the +table above. These six comparators are useful as ``multiply'' +operators for creating semirings with Boolean monoids. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary comparators for all 13 types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +% 6 TxT -> bool comparators +\verb'GrB_EQ_'$T$ & $T \times T \rightarrow $\verb'bool' & $z = (x == y)$ & equal \\ +\verb'GrB_NE_'$T$ & $T \times T \rightarrow $\verb'bool' & $z = (x \ne y)$ & not equal \\ +\hline +\multicolumn{4}{ }{\mbox{ }} \\ +\hline +\multicolumn{4}{|c|}{Binary comparators for non-complex types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +\verb'GrB_GT_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x > y)$ & greater than \\ +\verb'GrB_LT_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x < y)$ & less than \\ +\verb'GrB_GE_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x \ge y)$ & greater than or equal \\ +\verb'GrB_LE_'$R$ & $R \times R \rightarrow $\verb'bool' & $z = (x \le y)$ & less than or equal \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +GraphBLAS has four built-in binary operators that operate purely in +the Boolean domain. The first three are identical to the \verb'GxB_L*_BOOL' +operators described above, just with a shorter name. The \verb'GrB_LXNOR' +operator is the same as \verb'GrB_EQ_BOOL'. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary operators for the boolean type only} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +% 3 bool x bool -> bool +\verb'GrB_LOR' & \verb'bool' + $\times$ \verb'bool' + $\rightarrow$ \verb'bool' & $z = x \vee y $ & logical OR \\ +\verb'GrB_LAND' & \verb'bool' + $\times$ \verb'bool' + $\rightarrow$ \verb'bool' & $z = x \wedge y $ & logical AND \\ +\verb'GrB_LXOR' & \verb'bool' + $\times$ \verb'bool' + $\rightarrow$ \verb'bool' & $z = x \veebar y $ & logical XOR \\ +\verb'GrB_LXNOR' & \verb'bool' + $\times$ \verb'bool' + $\rightarrow$ \verb'bool' & $z = \lnot (x \veebar y) $ & logical XNOR \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +The following operators are defined for real floating-point types only (\verb'GrB_FP32' and \verb'GrB_FP64'). +They are identical to the C11 functions of the same name. The last one in the table constructs +the corresponding complex type. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary operators for the real floating-point types only} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +\verb'GxB_ATAN2_'$F$ & $F \times F \rightarrow F$ & $z = \tan^{-1}(y/x)$ & 4-quadrant arc tangent \\ +\verb'GxB_HYPOT_'$F$ & $F \times F \rightarrow F$ & $z = \sqrt{x^2+y^2}$ & hypotenuse \\ +\verb'GxB_FMOD_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'fmod' \\ +\verb'GxB_REMAINDER_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'remainder' \\ +\verb'GxB_LDEXP_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'ldexp' \\ +\verb'GxB_COPYSIGN_'$F$ & $F \times F \rightarrow F$ & & C11 \verb'copysign' \\ +\hline +\verb'GxB_CMPLX_'$F$ & $F \times F \rightarrow Z$ & $z = x + y \times i$ & complex from real \& imag \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +Eight bitwise operators are predefined for signed and unsigned integers. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Binary operators for signed and unsigned integers} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +\verb'GrB_BOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=x|y' & bitwise logical OR \\ +\verb'GrB_BAND_'$I$ & $I \times I \rightarrow I$ & \verb'z=x&y' & bitwise logical AND \\ +\verb'GrB_BXOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=x^y' & bitwise logical XOR \\ +\verb'GrB_BXNOR_'$I$ & $I \times I \rightarrow I$ & \verb'z=~(x^y)' & bitwise logical XNOR \\ +\hline +\verb'GxB_BGET_'$I$ & $I \times I \rightarrow I$ & & get bit y of x \\ +\verb'GxB_BSET_'$I$ & $I \times I \rightarrow I$ & & set bit y of x \\ +\verb'GxB_BCLR_'$I$ & $I \times I \rightarrow I$ & & clear bit y of x \\ +\verb'GxB_BSHIFT_'$I$ & $I \times $\verb'int8'$ \rightarrow I$ & & bit shift \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +There are two sets of built-in comparators in SuiteSparse:Graph\-BLAS, +but they are not redundant. They are identical except for the type (domain) of +their output, $z$. The \verb'GrB_EQ_'$T$ and related operators compare their +inputs of type $T$ and produce a Boolean result of true or false. The +\verb'GxB_ISEQ_'$T$ and related operators compute the same thing and produce a +result with same type $T$ as their input operands, returning one for true or +zero for false. The \verb'IS*' comparators are useful when combining +comparators with other non-Boolean operators. For example, a \verb'PLUS-ISEQ' +semiring counts how many terms are true. With this semiring, +matrix multiplication ${\bf C=AB}$ for two weighted undirected graphs ${\bf A}$ +and ${\bf B}$ computes $c_{ij}$ as the number of edges node $i$ and $j$ have in +common that have identical edge weights. Since the output type of the +``multiplier'' operator in a semiring must match the type of its monoid, the +Boolean \verb'EQ' cannot be combined with a non-Boolean \verb'PLUS' monoid to +perform this operation. + +Likewise, SuiteSparse:GraphBLAS has two sets of logical OR, AND, and XOR +operators. Without the \verb'_'$T$ suffix, the three operators \verb'GrB_LOR', +\verb'GrB_LAND', and \verb'GrB_LXOR' operate purely in the Boolean domain, +where all input and output types are \verb'GrB_BOOL'. The second set +(\verb'GxB_LOR_'$T$ \verb'GxB_LAND_'$T$ and \verb'GxB_LXOR_'$T$) provides +Boolean operators to all 11 real domains, implicitly typecasting their inputs from +type $T$ to Boolean and returning a value of type $T$ that is 1 for true or +zero for false. The set of \verb'GxB_L*_'$T$ operators are useful since they +can be combined with non-Boolean monoids in a semiring. + +Floating-point operations follow the IEEE 754 standard. Thus, computing $x/0$ +for a floating-point $x$ results in \verb'+Inf' if $x$ is positive, \verb'-Inf' +if $x$ is negative, and \verb'NaN' if $x$ is zero. The application is not +terminated. However, integer division by zero normally terminates an +application. SuiteSparse:GraphBLAS avoids this by adopting the same rules as +MATLAB, which are analogous to how the IEEE standard handles floating-point +division by zero. For integers, when $x$ is positive, $x/0$ is the largest +positive integer, for negative $x$ it is the minimum integer, and 0/0 results +in zero. For example, for an integer $x$ of type \verb'GrB_INT32', 1/0 is +$2^{31}-1$ and (-1)/0 is $-2^{31}$. Refer to Section~\ref{type} for a list of +integer ranges. + +%=============================================================================== +\subsubsection{GraphBLAS binary operators based on index binary operators} +%=============================================================================== + +Eight binary operators based on underlying index binary operators are +predefined. They differ when used in a semiring and when used in +\verb'GrB_eWise*' and \verb'GrB_apply'. These index-based binary operators +cannot be used in \verb'GrB_build', nor can they be used as the \verb'accum' +operator for any operation. + +The built-in index-based binary operators do not depend on the type or numerical value +of their inputs, just their position in a matrix or vector. For a vector, $j$ +is always 0, and $i$ is the index into the vector. There are two types $N$ +available: \verb'INT32' and \verb'INT64', which is the type of the output $z$. +User-defined index-based operators are not defined by \verb'GrB_BinaryOp_new', +but by \verb'GxB_BinaryOp_new_IndexOp' instead. See Section~\ref{idxbinaryop} +for details. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ +\multicolumn{4}{|c|}{when used as a multiplicative operator in a semiring} \\ +\hline +GraphBLAS name & types (domains) & $z=f(a_{ik},b_{kj})$ & description \\ +\hline +\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $a_{ik}$ (0-based) \\ +\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $a_{ik}$ (1-based) \\ +\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = k$ & column index of $a_{ik}$ (0-based) \\ +\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = k+1$ & column index of $a_{ik}$ (1-based) \\ +\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = k$ & row index of $b_{kj}$ (0-based) \\ +\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = k+1$ & row index of $b_{kj}$ (1-based) \\ +\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $b_{kj}$ (0-based) \\ +\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $b_{kj}$ (1-based) \\ +\hline +\end{tabular} +} + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ +\multicolumn{4}{|c|}{when used in all other methods} \\ +\hline +GraphBLAS name & types (domains) & $z=f(a_{ij},b_{ij})$ & description \\ +\hline +\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $a_{ij}$ (0-based) \\ +\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $a_{ij}$ (1-based) \\ +\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $a_{ij}$ (0-based) \\ +\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $a_{ij}$ (1-based) \\ +\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = i$ & row index of $b_{ij}$ (0-based) \\ +\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index of $b_{ij}$ (1-based) \\ +\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index of $b_{ij}$ (0-based) \\ +\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index of $b_{ij}$ (1-based) \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +Finally, one special binary operator can only be used as input to +\verb'GrB_Matrix_build' or \verb'GrB_Vector_build': the \verb'GxB_IGNORE_DUP' +operator. If \verb'dup' is \verb'NULL', any duplicates in the \verb'GrB*build' +methods result in an error. If \verb'dup' is the special binary operator +\verb'GxB_IGNORE_DUP', then any duplicates are ignored. If duplicates appear, +the last one in the list of tuples is taken and the prior ones ignored. This +is not an error. + +The next sections define the following methods for the \verb'GrB_BinaryOp' +object: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_BinaryOp_new' & create a user-defined binary operator & \ref{binaryop_new} \\ +\verb'GxB_BinaryOp_new' & create a named user-defined binary operator & \ref{binaryop_new_named} \\ +\verb'GrB_BinaryOp_wait' & wait for a user-defined binary operator & \ref{binaryop_wait} \\ +\verb'GrB_BinaryOp_free' & free a user-defined binary operator & \ref{binaryop_free} \\ +\verb'GrB_get' & get properties of an operator & \ref{get_set_binop} \\ +\verb'GrB_set' & set the operator name/definition & \ref{get_set_binop} \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_BinaryOp\_new:} create a user-defined binary operator} +%------------------------------------------------------------------------------- +\label{binaryop_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_BinaryOp_new +( + GrB_BinaryOp *binaryop, // handle for the new binary operator + void *function, // pointer to the binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype // type of input y +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GrB_BinaryOp_new' creates a new binary operator. The new operator is +returned in the \verb'binaryop' handle, which must not be \verb'NULL' on input. +On output, its contents contains a pointer to the new binary operator. + +The three types \verb'xtype', \verb'ytype', and \verb'ztype' are the GraphBLAS +types of the inputs $x$ and $y$, and output $z$ of the user-defined function +$z=f(x,y)$. These types may be built-in types or user-defined types, in any +combination. The three types need not be the same, but they must be previously +defined before passing them to \verb'GrB_BinaryOp_new'. + +The final argument to \verb'GrB_BinaryOp_new' is a pointer to a user-defined +function with the following signature: + + {\footnotesize + \begin{verbatim} + void (*f) (void *z, const void *x, const void *y) ; \end{verbatim} } + +When the function \verb'f' is called, the arguments \verb'z', \verb'x', and +\verb'y' are passed as \verb'(void *)' pointers, but they will be pointers to +values of the correct type, defined by \verb'ztype', \verb'xtype', and +\verb'ytype', respectively, when the operator was created. + +{\bf NOTE:} SuiteSparse:GraphBLAS may call the function with the pointers +\verb'z' and \verb'x' equal to one another, in which case \verb'z=f(z,y)' +should be computed. Future versions may use additional pointer aliasing. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_BinaryOp\_new:} create a named user-defined binary operator} +%------------------------------------------------------------------------------- +\label{binaryop_new_named} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_BinaryOp_new +( + GrB_BinaryOp *op, // handle for the new binary operator + GxB_binary_function function, // pointer to the binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + const char *binop_name, // name of the user function + const char *binop_defn // definition of the user function +) ; +\end{verbatim} }\end{mdframed} + +Creates a named \verb'GrB_BinaryOp'. Only the first 127 characters of +\verb'binop_name' are used. The \verb'binop_defn' is a string containing the +entire function itself. For example: + +{\footnotesize +\begin{verbatim} +void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; } ; +... +GrB_Type AbsDiff ; +GxB_BinaryOp_new (&AbsDiff, absdiff, GrB_FP64, GrB_FP64, GrB_FP64, "absdiff", + "void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; }") ; \end{verbatim}} + +The two strings \verb'binop_name' and \verb'binop_defn' are optional, but are +required to enable the JIT compilation of kernels that use this operator. + +If the JIT is enabled, or if the corresponding JIT kernel has been copied +into the \verb'PreJIT' folder, the \verb'function' may be \verb'NULL'. In this +case, a JIT kernel is compiled that contains just the user-defined function. +If the JIT is disabled and the \verb'function' is \verb'NULL', this method +returns \verb'GrB_NULL_POINTER'. + +The above example is identical to the following usage, except that +\verb'GrB_BinaryOp_new' requires a non-NULL function pointer. + +{\footnotesize +\begin{verbatim} +void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; } ; +... +GrB_Type AbsDiff ; +GrB_BinaryOp_new (&AbsDiff, absdiff, GrB_FP64, GrB_FP64, GrB_FP64) ; +GrB_set (AbsDiff, "absdiff", GxB_JIT_C_NAME) ; +GrB_set (AbsDiff, + "void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; }", + GxB_JIT_C_DEFINITION) ;\end{verbatim}} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_BinaryOp\_wait:} wait for a binary operator} +%------------------------------------------------------------------------------- +\label{binaryop_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a user-defined binary operator +( + GrB_BinaryOp binaryop, // binary operator to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined binary operator, a GraphBLAS library may choose +to exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing for except to ensure that the +\verb'binaryop' is valid. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_BinaryOp\_free:} free a user-defined binary operator} +%------------------------------------------------------------------------------- +\label{binaryop_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created binary operator +( + GrB_BinaryOp *binaryop // handle of binary operator to free +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_BinaryOp_free' frees a user-defined binary operator. +Either usage: + + {\small + \begin{verbatim} + GrB_BinaryOp_free (&op) ; + GrB_free (&op) ; \end{verbatim}} + +\noindent +frees the \verb'op' and sets \verb'op' to \verb'NULL'. +It safely does nothing if passed a \verb'NULL' +handle, or if \verb'op == NULL' on input. +It does nothing at all if passed a built-in binary operator. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf ANY} and {\sf PAIR} ({\sf ONEB}) operators} +%------------------------------------------------------------------------------- +\label{any_pair} + +The \verb'GxB_PAIR' operator (also called \verb'GrB_ONEB') is simple to describe: +just $f(x,y)=1$. It is called +the \verb'PAIR' operator since it returns $1$ in a semiring when a pair of +entries $a_{ik}$ and $b_{kj}$ is found in the matrix multiply. This operator +is simple yet very useful. It allows purely structural computations to be +performed on matrices of any type, without having to typecast them to Boolean +with all values being true. Typecasting need not be performed on the inputs to +the \verb'PAIR' operator, and the \verb'PAIR' operator does not need to access +the values of the matrix. This cuts memory accesses, so it is a very fast +operator to use. + +The \verb'GxB_PAIR_T' operator is a SuiteSparse:GraphBLAS extension. +It has since been added to the v2.0 C API Specification as \verb'GrB_ONEB_T'. +They are identical, but the latter name should be used for compatibility +with other GraphBLAS libraries. + +The \verb'ANY' operator is very unusual, but very powerful. It is the function +$f_{\mbox{any}}(x,y)=x$, or $y$, where GraphBLAS has to freedom to select +either $x$, or $y$, at its own discretion. Do not confuse the \verb'ANY' +operator with the \verb'any' function in MATLAB/Octave, which computes a reduction +using the logical OR operator. + +The \verb'ANY' function is associative and commutative, and can thus serve as +an operator for a monoid. The selection of $x$ are $y$ is not randomized. +Instead, SuiteSparse:GraphBLAS uses this freedom to compute as fast a result as +possible. When used as the monoid in a dot product, \[ c_{ij} = \sum_k a_{ik} +b_{kj} \] for example, the computation can terminate as soon as any matching +pair of entries is found. When used in a parallel saxpy-style computation, the +\verb'ANY' operator allows for a relaxed form of synchronization to be used, +resulting in a fast benign race condition. + +Because of this benign race condition, the result of the \verb'ANY' monoid can +be non-deterministic, unless it is coupled with the \verb'PAIR' multiplicative +operator. In this case, the \verb'ANY_PAIR' semiring will return a +deterministic result, since $f_{\mbox{any}}(1,1)$ is always 1. + +When paired with a different operator, the results are non-deterministic. This +gives a powerful method when computing results for which any value selected by +the \verb'ANY' operator is valid. One such example is the breadth-first-search +tree. Suppose node $j$ is at level $v$, and there are multiple nodes $i$ at +level $v-1$ for which the edge $(i,j)$ exists in the graph. Any of these nodes +$i$ can serve as a valid parent in the BFS tree. Using the \verb'ANY' +operator, GraphBLAS can quickly compute a valid BFS tree; if it used again on +the same inputs, it might return a different, yet still valid, BFS tree, due to +the non-deterministic nature of intra-thread synchronization. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Container.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Container.tex new file mode 100644 index 0000000000..633415473a --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Container.tex @@ -0,0 +1,535 @@ +\newpage +%------------------------------------------------------------------------------- +\subsection{The GxB\_Container object and its methods} +%------------------------------------------------------------------------------- +\label{container} + +A new set of \verb'load/unload' methods are introduced in GraphBLAS v10 to move +data between a \verb'GrB_Matrix' or \verb'GrB_Vector' and a new +\verb'GxB_Container' object. This object is non-opaque but contains opaque +objects. Its primary components are five dense \verb'GrB_Vectors' that hold +the contents of the matrix/vector. The data in these dense vectors can then be +loaded/unloaded via \verb'GxB_Vector_load' and \verb'GxB_Vector_unload'. + +Moving data from a \verb'GrB_Matrix' into user-visible C arrays is a two-step +process. The data is first moved into a \verb'GxB_Container' using \newline +\verb'GxB_unload_Matrix_into_Container', and then from the Container into C +arrays with \verb'GxB_Vector_unload'. Moving data in the opposite direction is +also a two-step process: first load the C array into a \verb'GrB_Vector' +component of a \verb'GxB_Container' with \verb'GxB_Vector_load', and then from +the \verb'GxB_Container' into a \verb'GrB_Matrix' using the +\verb'GxB_load_Matrix_from_Container' method. + +The following methods are available. The first two do not use the +Container object, but instead move data to/from a dense \verb'GrB_Vector': + +\begin{itemize} + +\item \verb'GxB_Vector_load': this method moves data in O(1) time from a + user-visible C array into a \verb'GrB_Vector'. The vector length and type + are revised to match the new data from the C array. Ownership is normally + transferred to the \verb'GrB_Vector', but this can be revised with a + \verb'handling' parameter. The C array is passed in as a \verb'void *' + pointer, and its type is indicated by a \verb'GrB_Type' parameter. See + Section~\ref{vector_load} for details. + +\item \verb'GxB_Vector_unload': this method moves data in O(1) time from a + \verb'GrB_Vector' into a user-visible C array. The length of the + \verb'GrB_Vector' is reduced to zero, to denote that it no longer holds any + content. The vector must be dense; it must have the same number of entries + as its size (that is \verb'GrB_Vector_nvals' and \verb'GrB_Vector_size' + must return the same value). The C array is returned as a \verb'void *' + pointer, and its type is indicated by a \verb'GrB_Type' parameter. See + Section~\ref{vector_unload} for details. + +\end{itemize} + +The next six methods rely on the \verb'GxB_Container' object: + +\begin{itemize} +\item \verb'GxB_Container_new': creates a container + (see Section~\ref{container_new}). + +\item \verb'GxB_Container_free': frees a container + (see Section~\ref{container_free}). + +\item \verb'GxB_load_Matrix_from_Container': moves all of the data from a + \verb'GxB_Container' into a \verb'GrB_Matrix' in O(1) time + (see Section~\ref{load_matrix_from_container}). + +\item \verb'GxB_load_Vector_from_Container': moves all of the data from a + \verb'GxB_Container' into a \verb'GrB_Vector' in O(1) time + (see Section~\ref{load_vector_from_container}). + +\item \verb'GxB_unload_Matrix_into_Container': moves all of the data from + a \verb'GrB_Matrix' into a \verb'GxB_Container' in O(1) time + (see Section~\ref{unload_matrix_into_container}). + +\item \verb'GxB_unload_Vector_into_Container': moves all of the data from + a \verb'GrB_Vector' into a \verb'GxB_Container' in O(1) time + (see Section~\ref{unload_vector_into_container}). + +\end{itemize} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_load:} load data into a vector} +%------------------------------------------------------------------------------- +\label{vector_load} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_load +( + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + int handling, // GrB_DEFAULT (0): transfer ownership to GraphBLAS + // GxB_IS_READONLY: X treated as read-only; + // ownership kept by the user application + const GrB_Descriptor desc // currently unused; for future expansion +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Vector_load' loads data from a C array into a \verb'GrB_Vector' in +O(1) time. + +On input, the \verb'GrB_Vector V' must already exist, but its content (type, +size, and entries) are ignored. On output, any prior content of \verb'V' is +freed, and its data is replaced with the C array \verb'X' of length \verb'n' +entries, whose type is given by the \verb'type' parameter. The size of +\verb'V' becomes \verb'n', and its type is changed to match the \verb'type' +parameter. + +After this method returns, \verb'GrB_Vector_size' and \verb'GrB_Vector_nvals' +will both return \verb'n'. That is, the vector \verb'V' is a dense vector. +It is held in the \verb'GxB_FULL' data format, in \verb'GrB_COLMAJOR' +orientation. + +The size in bytes of \verb'X' is also provided on input as \verb'X_size'; this +must be at least \verb'n' times the size of the given \verb'type', but it can +be larger. This size is maintained and returned to the user application by +\verb'GxB_Vector_unload'. The error code \verb'GrB_INVALID_VALUE' is returned +if \verb'X_size' is too small. + +The \verb'handling' parameter provides control over the ownership of the array +\verb'X'. By default, ownership of \verb'X' is handed over to the +\verb'GrB_Vector V'. In this case, the vector \verb'V' acts as a normal +GraphBLAS vector. It can be modified or freed as usual. Freeing \verb'V' with +\verb'GrB_Vector_free' will also free \verb'X'. The array \verb'X' is returned +as \verb'NULL' to denote this change of ownership. + +If the \verb'handling' parameter is \verb'GxB_IS_READONLY', then \verb'X' is +still owned by the user application. It remains non-\verb'NULL' when this +method returns. The resulting vector \verb'V' can be used as an input to any +GraphBLAS method, but it cannot be modified (except that it can be freed). +If a call is made that attempts to modify a matrix with read-only components, +an error is returned (\verb'GxB_OUTPUT_IS_READONLY'). +Freeing the vector \verb'V' does not modify \verb'X', however. It simply +frees the rest of the object \verb'V'. + +Note that this method does not rely on the \verb'GxB_Container' object. +Instead, it loads a C array \verb'X' directly into a dense \verb'GrB_Vector V'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_unload:} unload data from a vector} +%------------------------------------------------------------------------------- +\label{vector_unload} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_unload +( + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + int *handling, // see GxB_Vector_load + const GrB_Descriptor desc // currently unused; for future expansion +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Vector_unload' unloads data from \verb'GrB_Vector' into a C array in +O(1) time (unless the vector has pending work that must be finished first). + +On input, the vector \verb'V' must have all possible entries present (that is, +\verb'GrB_Vector_nvals' and \verb'GrB_Vector_size' must return the same value). +The vector can be in any internal data format; it does not have to be in the +\verb'GxB_FULL' format on input, but it must be in \verb'GrB_COLMAJOR' +orientation. If any entries are missing, the unload is not performed and +\verb'GrB_INVALID_OBJECT' is returned. + +On output, the size of \verb'V' is reduced to zero, and it holds no entries but +its type is unchanged. The array \verb'X' is returned to the caller with the +entries from the vector. The type of \verb'X' is given by the \verb'type' +parameter. The number of entries in \verb'V' is returned as \verb'n'. +The size of \verb'X' in bytes is returned as \verb'X_size'. + +The \verb'handling' parameter informs the user application of the ownership of +the array \verb'X'. If it was created by GraphBLAS, or passed into GraphBLAS +via \verb'GxB_Vector_load' with \verb'handling' set to \verb'GrB_DEFAULT', then +this is returned to the user as handling set to \verb'GrB_DEFAULT'. This +denotes that ownership of the array \verb'X' has been transfered from GraphBLAS +to the user application. The user application is now responsible for freeing +the array \verb'X'. + +If the \verb'handling' parameter is returned as \verb'GxB_IS_READONLY', then +this array \verb'X' was originally passed to GraphBLAS via +\verb'GxB_Vector_load' with a \verb'handling' parameter of +\verb'GxB_IS_READONLY'. The ownership of the array \verb'X' is not changed; it +remains owned by the user application. The user application is still +responsible for freeing the array \verb'X', but caution must be observed so +that it is not freed twice. + +Note that this method does not rely on the \verb'GxB_Container' object. +Instead, it unloads a dense \verb'GrB_Vector' \verb'V' directly into a +C array \verb'X'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Container\_new:} create a container} +%------------------------------------------------------------------------------- +\label{container_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Container_new (GxB_Container *Container) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Container_new' creates a new container. It has the following +definition (extra space for future expansion excluded for clarity): + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +struct GxB_Container_struct +{ + uint64_t nrows, ncols ; + int64_t nrows_nonempty, ncols_nonempty ; + uint64_t nvals ; + int32_t format ; // GxB_HYPERSPARSE, GxB_SPARSE, GxB_BITMAP, or GxB_FULL + int32_t orientation ; // GrB_ROWMAJOR or GrB_COLMAJOR + GrB_Vector p, h, b, i, x ; // dense vector components + GrB_Matrix Y ; + bool iso, jumbled ; +} ; +typedef struct GxB_Container_struct *GxB_Container ; \end{verbatim} +} \end{mdframed} + +The \verb'Container' holds all of the data from a single GraphBLAS matrix or +vector, with any data type and any data format. It contains extra space for +future data formats (not shown above). Each scalar component is described +below: + +\begin{itemize} +\item \verb'nrows': the number of rows of a matrix, or the size of a vector. +\item \verb'ncols': the number of columns of a matrix, or 1 for a vector. +\item \verb'nrows_nonempty': if known, this value must give the exact number + of non-empty rows of a matrix or vector (that is, the number of + rows have at least one entry). If not known, this value must be + set to -1. +\item \verb'ncols_nonempty': if known, this value must give the exact number + of non-empty columns of a matrix or vector (that is, the number of + columns have at least one entry). If not known, this value must be + set to -1. +\item \verb'nvals': the number of entries in the matrix or vector. +\item \verb'format': this defines the data format of a matrix or vector. + Currently, GraphBLAS supports four formats, described in + Section~\ref{formats}, each with two orientations. A \verb'GrB_Vector' + cannot be held in \verb'GxB_HYPERSPARSE' format. +\item \verb'orientation': whether the matrix is held by row or by column. + This is always \verb'GrB_COLMAJOR' for a container holding data for a + \verb'GrB_Vector', and for data holding an $n$-by-1 \verb'GrB_Matrix' + with a single column. +\item \verb'iso': if true, all of the entries in the matrix have the same + value, and only a single value is stored in the \verb'x' component of + the Container. +\item \verb'jumbled': if true, the indices in any given row (if in row-major + orientation) or column (if column-major) may appear out of order. + Otherwise, they must appear in ascending order. + A jumbled matrix or vector must not have any read-only components. +\end{itemize} + +The Container holds five dense \verb'GrB_Vector' objects that hold the primary +data for the matrix or vector, and a single \verb'GrB_Matrix' \verb'Y' that +holds an optional optimization structure called the hyper-hash. These +components are fully described in Section~\ref{formats}. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Container\_free:} free a container} +%------------------------------------------------------------------------------- +\label{container_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free (GxB_Container *Container) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Container_free' frees a container. It also frees all its opaque +components. Any read-only array inside these opaque objects is not freed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_load\_Matrix\_from\_Container:} load a matrix from a container} +%------------------------------------------------------------------------------- +\label{load_matrix_from_container} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_load_Matrix_from_Container // GrB_Matrix <- GxB_Container +( + GrB_Matrix A, // matrix to load from the Container. On input, + // A is a matrix of any size or type; on output + // any prior size, type, or contents is freed + // and overwritten with the Container. + GxB_Container Container, // Container with contents to load into A + const GrB_Descriptor desc // currently unused +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_load_Matrix_from_Container' moves all of the data from a +\verb'GxB_Container' into a \verb'GrB_Matrix' in O(1) time. + +The container vectors \verb'p', \verb'h', and \verb'i' may be any signed or +unsigned integer type of size 32 or 64 bits. Any other types will result in +an error. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_load\_Vector\_from\_Container:} load a vector from a container} +%------------------------------------------------------------------------------- +\label{load_vector_from_container} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} + +GrB_Info GxB_load_Vector_from_Container // GrB_Vector <- GxB_Container +( + GrB_Vector V, // GrB_Vector to load from the Container + GxB_Container Container, // Container with contents to load into V + const GrB_Descriptor desc // currently unused +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_load_Vector_from_Container' moves all of the data from a +\verb'GxB_Container' into a \verb'GrB_Vector' in O(1) time. + +The container format may not be \verb'GxB_HYPERSPARSE'. +The container vectors \verb'p' and \verb'i' may be any signed or +unsigned integer type of size 32 or 64 bits. Any other types will result in +an error. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_unload\_Matrix\_into\_Container:} unload a matrix into a container} +%------------------------------------------------------------------------------- +\label{unload_matrix_into_container} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_unload_Matrix_into_Container // GrB_Matrix -> GxB_Container +( + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + const GrB_Descriptor desc // currently unused +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_unload_Matrix_into_Container': moves all of the data from +a \verb'GrB_Matrix' into a \verb'GxB_Container' in O(1) time. + +The container vector \verb'p' is unloaded as \verb'GrB_UINT32' or \verb'GrB_UINT64', +while \verb'h', and \verb'i' are unloaded as \verb'GrB_INT32' or \verb'GrB_INT64'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_unload\_Vector\_into\_Container:} unload a vector into a container} +%------------------------------------------------------------------------------- +\label{unload_vector_into_container} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_unload_Vector_into_Container // GrB_Vector -> GxB_Container +( + GrB_Vector V, // vector to unload into the Container + GxB_Container Container, // Container to hold the contents of V + const GrB_Descriptor desc // currently unused +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_unload_Vector_into_Container': moves all of the data from +a \verb'GrB_Vector' into a \verb'GxB_Container' in O(1) time. + +The container vector \verb'p' is unloaded as \verb'GrB_UINT32' or \verb'GrB_UINT64', +while \verb'i' is unloaded as \verb'GrB_INT32' or \verb'GrB_INT64'. + +%------------------------------------------------------------------------------- +\subsubsection{Container example: unloading/loading an entire matrix into C arrays} +%------------------------------------------------------------------------------- +\label{container_example} + +The following example unloads a +\verb'GrB_Matrix A' of size \verb'nrows'-by-\verb'ncols', +with \verb'nvals' entries, of type \verb'xtype'. The example takes will take O(1) time, +and the only \verb'mallocs' are in \verb'GxB_Container_new' (which can be reused for +an arbitrary number of load/unload cycles), and the only frees are in +\verb'GxB_Container_free'. + +Note that getting C arrays from a \verb'GrB_Matrix' is a 2-step process: +First unload the matrix A into a Container, giving \verb'GrB_Vector' objects +\verb'Container->p', +\verb'Container->i', \verb'Container->x', etc, and then unload those dense vectors into +C arrays. This may seem tedious but it allows everything to be done in +O(1) time and space (often no new malloc'd space), and it allows support for +arbitrary integers for the \verb'p', \verb'h', and \verb'i' components of a matrix. +It also makes for a simple API overall. + +{\footnotesize +\begin{verbatim} +GxB_Container_new (&Container) ; // requires several O(1)-sized mallocs + +// no malloc/free will occur below, until GxB_Container_free. + +for (as many times as you like) +{ + + GxB_unload_Matrix_into_Container (A, Container, desc) ; + // A is now 0-by-0 with nvals(A)=0. Its type is unchanged. + + // All of the following is optional; if any item in the Container is not + // needed by the user, it can be left as-is, and then it will be put + // back into A at the end. (This is done for the Container->Y). + + // to extract numerical values from the Container: + void *x = NULL ; + uint64_t nvals = 0, nheld = 0 ; + GrB_Type xtype = NULL ; + int x_handling, p_handling, h_handling, i_handling, b_handling ; + uint64_t x_size, p_size, h_size, i_size, b_size ; + GxB_Vector_unload (Container->x, &x, &xtype, &nheld, &x_size, &x_handling, + desc) ; + + // The C array x now has size nheld and contains the values of the original + // GrB_Matrix A, with type xtype being the original type of the matrix A. + // The Container->x GrB_Vector still exists but it now has length 0. + // If the matrix A was iso-valued, nheld == 1. + + // to extract the sparsity pattern from the Container: + GrB_Type ptype = NULL, htype = NULL, itype = NULL, btype = NULL ; + void *p = NULL, *h = NULL, *i = NULL, *b = NULL ; + uint64_t plen = 0, plen1 = 0, nheld = 0 ; + + switch (Container->format) + { + case GxB_HYPERSPARSE : + // The Container->Y matrix can be unloaded here as well, + // if desired. Its use is optional. + GxB_Vector_unload (Container->h, &h, &htype, &plen, &h_size, + &h_handling, desc) ; + case GxB_SPARSE : + GxB_Vector_unload (Container->p, &p, &ptype, &plen1, &p_size, + &p_handling, desc) ; + GxB_Vector_unload (Container->i, &i, &itype, &nvals, &i_size, + &i_handling, desc) ; + break ; + case GxB_BITMAP : + GxB_Vector_unload (Container->b, &b, &btype, &nheld, &b_size, + &b_handling, desc) ; + break ; + } + + // Now the C arrays (p, h, i, b, and x) are all populated and owned by the + // user application. They can be modified here, if desired. Their C type + // is (void *), and their actual types correspond to ptype, htype, itype, + // btype, and xtype). + + // to load them back into A, first load them into the Container->[phbix] + // vectors: + switch (Container->format) + { + case GxB_HYPERSPARSE : + // The Container->Y matrix can be loaded here as well, + // if desired. Its use is optional. + GxB_Vector_load (Container->h, &h, htype, plen, h_size, + h_handling, desc) ; + case GxB_SPARSE : + GxB_Vector_load (Container->p, &p, ptype, plen1, p_size, + p_handling, desc) ; + GxB_Vector_load (Container->i, &i, itype, nvals, i_size, + i_handling, desc) ; + break ; + case GxB_BITMAP : + GxB_Vector_load (Container->b, &b, btype, nheld, b_size, + b_handling, desc) ; + break ; + } + GxB_Vector_load (Container->x, &x, xtype, nheld, x_size, + x_handling, desc) ; + + // Now the C arrays p, h, i, b, and x are all NULL. They are in the + // Container->p,h,b,i,x GrB_Vectors. Load A from the non-opaque Container: + + GxB_load_Matrix_from_Container (A, Container, desc) ; + // A is now back to its original state. The Container and its p,h,b,i,x + // GrB_Vectors exist but its vectors all have length 0. + +} + +GxB_Container_free (&Container) ; // does several O(1)-sized free's +\end{verbatim}} + +%------------------------------------------------------------------------------- +\subsubsection{Container example: unloading/loading, but not using C arrays} +%------------------------------------------------------------------------------- +\label{container_example2} + +Using the container is very simple if the resulting Container \verb'GrB_Vector' +components are used directly by GraphBLAS, with no need for C arrays. For +example, in a push/relabel maxflow algorithm, there is a need to extract the +tuples from a \verb'GrB_Vector' \verb'Delta', followed by a call to +\verb'GrB_Matrix_build' to create a matrix from that data. In GraphBLAS v9 and +earlier, extracting the tuples requires a copy. In v10, it can be done using +the container, without requiring a copy of the contents of \verb'Delta'. + +{\footnotesize +\begin{verbatim} +GxB_Container_new (&Container) ; +for (...) +{ + GrB_Vector Delta, J_Vector ; // computed by GraphBLAS (not shown) + GrB_Matrix DeltaMatrix ; + ... + GxB_unload_Vector_into_Container (Delta, Container, desc) ; + GxB_Matrix_build_Vector (DeltaMatrix, Container->i, J_vector, + Container->x, GrB_PLUS_FP32, NULL) ; + GxB_load_Vector_from_Container (Delta, Container, desc) ; +} +GxB_Container_free (&Container) ; +\end{verbatim}} + +The contents of the \verb'Delta' vector can be used unloaded in to the +container for use by \verb'GxB_Matrix_build_Vector', in O(1) time, and then +loaded back afterwards, also in O(1) time. The construction of the +\verb'DeltaMatrix' takes the same time as \verb'GrB_Matrix_build', but the +extra copy that would be required for \verb'GrB_Vector_extractTuples' is +entirely avoided. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Descriptor.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Descriptor.tex new file mode 100644 index 0000000000..c595c0c72b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Descriptor.tex @@ -0,0 +1,434 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %===================== +%=============================================================================== +\label{descriptor} + +A GraphBLAS {\em descriptor} modifies the behavior of a GraphBLAS operation. +If the descriptor is \verb'GrB_NULL', defaults are used. + +The access to these parameters and their values is governed +by two \verb'enum' types, \verb'GrB_Desc_Field' and \verb'GrB_Desc_Value': + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +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_AxB_METHOD = 1000, // descriptor for selecting C=A*B algorithm + GxB_SORT = 35 // control sort in GrB_mxm + GxB_COMPRESSION = 36, // select compression for serialize + GxB_ROWINDEX_LIST = 7062, // how GrB_Vector I is intrepretted + GxB_COLINDEX_LIST = 7063, // how GrB_Vector J is intrepretted + GxB_VALUE_LIST = 7064, // how GrB_Vector X is intrepretted +} +GrB_Desc_Field ; + +typedef enum +{ + // for all GrB_Descriptor fields: + GrB_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 complement of the mask + GrB_STRUCTURE = 4, // use the structure of the mask + // for GrB_INP0 and GrB_INP1 only: + GrB_TRAN = 3, // use the transpose of the input + // 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) + // for GxB_ROWINDEX_LIST, GxB_COLINDEX_LIST, and GxB_VALUE_LIST: + // GxB_USE_VALUES = ((int) GrB_DEFAULT) // use the values of the vector + GxB_USE_INDICES = 7060, // use the indices of the vector + GxB_IS_STRIDE = 7061, // use the values, of size 3, for lo:hi:inc +} +GrB_Desc_Value ; +\end{verbatim} } \end{mdframed} + +\newpage + +\begin{itemize} +\item \verb'GrB_OUTP' is a parameter that modifies the output of a + GraphBLAS operation. In the default case, the output is not cleared, and + ${\bf Z = C \odot T}$ then ${\bf C \langle M \rangle = Z}$ are computed + as-is, where ${\bf T}$ is the results of the particular GraphBLAS + operation. + + In the non-default case, ${\bf Z = C \odot T}$ is first computed, using the + results of ${\bf T}$ and the accumulator $\odot$. After this is done, if + the \verb'GrB_OUTP' descriptor field is set to \verb'GrB_REPLACE', then the + output is cleared of its entries. Next, the assignment ${\bf C \langle M + \rangle = Z}$ is performed. + +\item \verb'GrB_MASK' is a parameter that modifies the \verb'Mask', + even if the mask is not present. + + If this parameter is set to its default value, and if the mask is not + present (\verb'Mask==NULL') then implicitly \verb'Mask(i,j)=1' for all + \verb'i' and \verb'j'. If the mask is present then \verb'Mask(i,j)=1' + means that \verb'C(i,j)' is to be modified by the ${\bf C \langle M \rangle + = Z}$ update. Otherwise, if \verb'Mask(i,j)=0', then \verb'C(i,j)' is not + modified, even if \verb'Z(i,j)' is an entry with a different value; that + value is simply discarded. + + If the \verb'GrB_MASK' parameter is set to \verb'GrB_COMP', then the + use of the mask is complemented. In this case, if the mask is not present + (\verb'Mask==NULL') then implicitly \verb'Mask(i,j)=0' for all \verb'i' and + \verb'j'. This means that none of ${\bf C}$ is modified and the entire + computation of ${\bf Z}$ might as well have been skipped. That is, a + complemented empty mask means no modifications are made to the output + object at all, except perhaps to clear it in accordance with the + \verb'GrB_OUTP' descriptor. With a complemented mask, if the mask is + present then \verb'Mask(i,j)=0' means that \verb'C(i,j)' is to be modified + by the ${\bf C \langle M \rangle = Z}$ update. Otherwise, if + \verb'Mask(i,j)=1', then \verb'C(i,j)' is not modified, even if + \verb'Z(i,j)' is an entry with a different value; that value is simply + discarded. + + If the \verb'GrB_MASK' parameter is set to \verb'GrB_STRUCTURE', + then the values of the mask are ignored, and just the pattern of the + entries is used. Any entry \verb'M(i,j)' in the pattern is treated as if + it were true. + + The \verb'GrB_COMP' and \verb'GrB_STRUCTURE' settings can be combined, + either by setting the mask option twice (once with each value), or by + setting the mask option to \verb'GrB_COMP+GrB_STRUCTURE' (the latter is an + extension to the specification). + + Using a parameter to complement the \verb'Mask' is very useful because + constructing the actual complement of a very sparse mask is impossible + since it has too many entries. If the number of places in \verb'C' + that should be modified is very small, then use a sparse mask without + complementing it. If the number of places in \verb'C' that should + be protected from modification is very small, then use a sparse mask + to indicate those places, and use a descriptor \verb'GrB_MASK' that + complements the use of the mask. + +\item \verb'GrB_INP0' and \verb'GrB_INP1' modify the use of the + first and second input matrices \verb'A' and \verb'B' of the GraphBLAS + operation. + + If the \verb'GrB_INP0' is set to \verb'GrB_TRAN', then \verb'A' is + transposed before using it in the operation. Likewise, if + \verb'GrB_INP1' is set to \verb'GrB_TRAN', then the second input, + typically called \verb'B', is transposed. + + Vectors and scalars are never transposed via the descriptor. If a method's + first parameter is a matrix and the second a vector or scalar, then + \verb'GrB_INP0' modifies the matrix parameter and + \verb'GrB_INP1' is ignored. If a method's first parameter is a + vector or scalar and the second a matrix, then \verb'GrB_INP1' + modifies the matrix parameter and \verb'GrB_INP0' is ignored. + + To clarify this in each function, the inputs are labeled as + \verb'first input:' and \verb'second input:' in the function signatures. + +\item \verb'GxB_AxB_METHOD' suggests the method that should be + used to compute \verb'C=A*B'. All the methods compute the same result, + except they may have different floating-point roundoff errors. This + descriptor should be considered as a hint; SuiteSparse:GraphBLAS is + free to ignore it. + + \begin{itemize} + + \item \verb'GrB_DEFAULT' means that a method is selected automatically. + + \item \verb'GxB_AxB_SAXPY': select any saxpy-based method: + \verb'GxB_AxB_GUSTAVSON', and/or + \verb'GxB_AxB_HASH', or any mix of the two, + in contrast to the dot-product method. + + \item \verb'GxB_AxB_GUSTAVSON': an extended version of Gustavson's method + \cite{Gustavson78}, which is a very good general-purpose method, but + sometimes the workspace can be too large. Assuming all matrices are stored + by column, it computes \verb'C(:,j)=A*B(:,j)' with a sequence of {\em + saxpy} operations (\verb'C(:,j)+=A(:,k)*B(k:,j)' for each nonzero + \verb'B(k,j)'). In the {\em coarse Gustavson} method, each internal thread + requires workspace of size $m$, to the number of rows of \verb'C', which is + not suitable if the matrices are extremely sparse or if there are many + threads. For the {\em fine Gustavson} method, threads can share workspace + and update it via atomic operations. If all matrices are stored by row, + then it computes \verb'C(i,:)=A(i,:)*B' in a sequence of sparse {\em saxpy} + operations, and using workspace of size $n$ per thread, or group of + threads, corresponding to the number of columns of \verb'C'. + + \item \verb'GxB_AxB_HASH': a hash-based method, based on + \cite{10.1145/3229710.3229720}. It is very efficient for hypersparse + matrices, matrix-vector-multiply, and when $|{\bf B}|$ is small. + SuiteSparse:GraphBLAS includes a {\em coarse hash} method, in which + each thread has its own hash workspace, and a {\em fine hash} + method, in which groups of threads share a single hash workspace, + as concurrent data structure, using atomics. + +% [2] Yusuke Nagasaka, Satoshi Matsuoka, Ariful Azad, and Aydin Buluc. 2018. +% High-Performance Sparse Matrix-Matrix Products on Intel KNL and Multicore +% Architectures. In Proc. 47th Intl. Conf. on Parallel Processing (ICPP '18). +% Association for Computing Machinery, New York, NY, USA, Article 34, 1–10. +% DOI:https://doi.org/10.1145/3229710.3229720 + +\item \verb'GxB_AxB_DOT': computes \verb"C(i,j)=A(i,:)*B(j,:)'", for each + entry \verb'C(i,j)'. If the mask is present and not complemented, only + entries for which \verb'M(i,j)=1' are computed. This is a very specialized + method that works well only if the mask is present, very sparse, and not + complemented, when \verb'C' is small, or when \verb'C' is bitmap or full. + For example, it works very well + when \verb'A' and \verb'B' are tall and thin, and \verb"C=A*B'" or + \verb"C=A*B'" are computed. These expressions assume all matrices are in + CSR format. If in CSC format, then the dot-product method used for + \verb"A'*B". The method is impossibly slow if \verb'C' is large and the + mask is not present, since it takes $\Omega(mn)$ time if \verb'C' is + $m$-by-$n$ in that case. It does not use any workspace at all. Since it + uses no workspace, it can work very well for extremely sparse or + hypersparse matrices, when the mask is present and not complemented. + + \end{itemize} + +\item \verb'GxB_SORT' provides a hint to \verb'GrB_mxm', \verb'GrB_mxv', + \verb'GrB_vxm', and \verb'GrB_reduce' (to vector). These methods can leave + the output matrix or vector in a jumbled state, where the final sort is + left as pending work. This is typically fastest, since some algorithms can + tolerate jumbled matrices on input, and sometimes the sort can be skipped + entirely. However, if the matrix or vector will be immediately exported in + unjumbled form, or provided as input to a method that requires it to not be + jumbled, then sorting it during the matrix multiplication is faster. + By default, these methods leave the result in jumbled form (a {\em lazy + sort}), if \verb'GxB_SORT' is set to zero (\verb'GrB_DEFAULT'). A nonzero + value will inform the matrix multiplication to sort its result, instead. + +\item \verb'GxB_COMPRESSION' selects the compression method for serialization. + The default is ZSTD (level 1). See Section~\ref{serialize_deserialize} for + other options. + +\end{itemize} + +The next sections describe the methods for a \verb'GrB_Descriptor': + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Descriptor_new' & create a descriptor & \ref{descriptor_new} \\ +\verb'GrB_Descriptor_wait' & wait for a descriptor & \ref{descriptor_wait} \\ +\verb'GrB_Descriptor_free' & free a descriptor & \ref{descriptor_free} \\ +\verb'GrB_get' & get a parameter from a descriptor & \ref{get_set_descriptor} \\ +\verb'GrB_set' & set a parameter in a descriptor & \ref{get_set_descriptor} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Descriptor\_new:} create a new descriptor} +%------------------------------------------------------------------------------- +\label{descriptor_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Descriptor_new // create a new descriptor +( + GrB_Descriptor *descriptor // handle of descriptor to create +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Descriptor_new' creates a new descriptor, with all fields set to +their defaults (output is not replaced, the mask is not complemented, the mask +is valued not structural, neither input matrix is transposed, the method +used in \verb'C=A*B' is selected automatically, and \verb'GrB_mxm' leaves +the final sort as pending work). + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Descriptor\_wait:} wait for a descriptor} +%------------------------------------------------------------------------------- +\label{descriptor_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a descriptor +( + GrB_Descriptor descriptor, // descriptor to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined descriptor, a GraphBLAS library may choose to +exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS does nothing except to ensure that \verb'd' is valid. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Descriptor\_free:} free a descriptor} +%------------------------------------------------------------------------------- +\label{descriptor_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a descriptor +( + GrB_Descriptor *descriptor // handle of descriptor to free +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Descriptor_free' frees a descriptor. +Either usage: + + {\small + \begin{verbatim} + GrB_Descriptor_free (&descriptor) ; + GrB_free (&descriptor) ; \end{verbatim}} + +\noindent +frees the \verb'descriptor' and sets \verb'descriptor' to \verb'NULL'. It +safely does nothing if passed a \verb'NULL' handle, or if +\verb'descriptor == NULL' on input. + +%------------------------------------------------------------------------------- +\subsubsection{Descriptor settings for \sf{GrB\_Vector} parameters} +%------------------------------------------------------------------------------- +\label{ijxvector} + +Several methods GraphBLAS v10 accept \verb'GrB_Vector' parameters for their index +lists \verb'I' and \verb'J', which appear only as \verb'uint64_t *' C arrays in +the v2.1 C Specification. Likewise, several methods accept a \verb'GrB_Vector' +parameter \verb'X', where the related method in the Specification accepts only +a raw C array of a given type. + +By default, \verb'GrB_Vector' inputs \verb'I', \verb'J', and \verb'X' are +interpretted as if their values are first extracted with +\verb'GrB_Vector_extractTuples', where the values are extracted in order (with +ascending indices), and their values are then passed to the method. +The actual method is much faster; GraphBLAS uses the values directly. + +This behavior can be revised via the descriptor for the method. Three settings +are available: + +\begin{itemize} +\item \verb'GxB_ROWINDEX_LIST': how the \verb'GrB_Vector I' is intrepretted. +\item \verb'GxB_COLINDEX_LIST': how the \verb'GrB_Vector J' is intrepretted. +\item \verb'GxB_VALUE_LIST': how \verb'GrB_Vector X' is intrepretted (for \verb'GrB_build' only). +\end{itemize} + +These can be set to one of the following values: + +\begin{itemize} +\item \verb'GrB_DEFAULT' or \verb'GxB_USE_VALUES': use the values of the vector (default). + +\item \verb'GxB_USE_INDICES': use the indices of the vector. + This acts as if the indices are first extracted into a C array with + \verb'GrB_Vector_extractTuples', where the indices are extracted in ascending order, + and then this C array is then passed to the method. + The actual method is much faster; GraphBLAS uses the indices directly. + +\item \verb'GxB_IS_STRIDE': use the values, of size 3, for a strided range, + or \verb'lo:inc:hi' in MATLAB notation. This usage is limited to the + \verb'I' and \verb'J' vectors (except this option may not be used for + \verb'GrB_build'). The vector must have exactly three entries, + \verb'lo', \verb'hi', and \verb'inc', in that order. + +\end{itemize} + +The \verb'GxB_IS_STRIDE' option is fully described in Section~\ref{colon}. In +that section, there are many options available. Here, the \verb'GrB_Vector' +\verb'I' or \verb'J' must have length exactly three. The first entry present +is the start of the sequence (\verb'lo'), the second entry is the end of the +sequence (\verb'hi') and the third entry is the stride (\verb'inc'). This +corresponds to the \verb'GxB_STRIDE' option when passing a \verb'uint64_t *' +array. To use a stride of one, simply set the third entry to 1; this +corresponds to the \verb'GxB_RANGE' option when passing a \verb'uint64_t *' +array. To use a negative stride, simply pass in the vector with a signed data +type (\verb'GrB_INT32' or \verb'GrB_INT64' as appropriate; this corresponds to +the \verb'GxB_BACKWARDS' option desribed in Section~\ref{colon}). +These three values appear in this order to be consistent \verb'GxB_BEGIN' (0), +\verb'GxB_END' (1), and \verb'GxB_INC' (2). + +When using the \verb'_Vector' methods, the \verb'GrB_Vector' objects \verb'I', +\verb'J', and \verb'X' may be sparse. If the vectors are sparse, +\verb'GrB_Vector_extractTuples' returns a dense list of indices or values, and +this is how the \verb'I,J,X' vectors may be used in the new methods in +GraphBLAS v10 with the \verb'_Vector' suffix at then end of their name. + +To use the \verb'GrB_ALL' option, specifying all the rows or columns of a +matrix or all indices of a vector, pass in the corresponding \verb'GrB_Vector' +\verb'I' or \verb'J' as a NULL pointer. + + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_DESC\_*:} built-in descriptors} +%------------------------------------------------------------------------------- +\label{descriptor_predefined} + +Built-in descriptors are listed in the table below. A dash in the table +indicates the default. These descriptors may not be modified or freed. +Attempts to modify them result in an error (\verb'GrB_INVALID_VALUE'); attempts +to free them are silently ignored. + +% \verb'GrB_NULL' is the default descriptor, with all settings at their defaults: +% \verb'OUTP': do not replace the output, +% \verb'MASK': mask is valued and not complemented, +% \verb'INP0': first input not transposed, and +% \verb'INP1': second input not transposed. +% For these pre-defined descriptors, the +% \verb'GxB_SORT' setting is at their default values. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{|l|lllll|} +\hline +Descriptor & \verb'OUTP' & \verb'MASK' & \verb'MASK' & \verb'INP0' & \verb'INP1' \\ + & & structural & complement & & \\ +\hline +\verb'GrB_NULL' & - & - & - & - & - \\ +\verb'GrB_DESC_T1' & - & - & - & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_T0' & - & - & - & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_T0T1' & - & - & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_C' & - & - & \verb'GrB_COMP' & - & - \\ +\verb'GrB_DESC_CT1' & - & - & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_CT0' & - & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_CT0T1' & - & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_S' & - & \verb'GrB_STRUCTURE' & - & - & - \\ +\verb'GrB_DESC_ST1' & - & \verb'GrB_STRUCTURE' & - & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_ST0' & - & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_ST0T1' & - & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_SC' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & - \\ +\verb'GrB_DESC_SCT1' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_SCT0' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_SCT0T1' & - & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_R' & \verb'GrB_REPLACE' & - & - & - & - \\ +\verb'GrB_DESC_RT1' & \verb'GrB_REPLACE' & - & - & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_RT0' & \verb'GrB_REPLACE' & - & - & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_RT0T1' & \verb'GrB_REPLACE' & - & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_RC' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & - & - \\ +\verb'GrB_DESC_RCT1' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_RCT0' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_RCT0T1' & \verb'GrB_REPLACE' & - & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_RS' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & - & - \\ +\verb'GrB_DESC_RST1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_RST0' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_RST0T1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & - & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\verb'GrB_DESC_RSC' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & - \\ +\verb'GrB_DESC_RSCT1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & - & \verb'GrB_TRAN' \\ +\verb'GrB_DESC_RSCT0' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & - \\ +\verb'GrB_DESC_RSCT0T1' & \verb'GrB_REPLACE' & \verb'GrB_STRUCTURE' & \verb'GrB_COMP' & \verb'GrB_TRAN' & \verb'GrB_TRAN' \\ +\hline +\end{tabular}} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_IndexBinaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_IndexBinaryOp.tex new file mode 100644 index 0000000000..8069d6b8c7 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_IndexBinaryOp.tex @@ -0,0 +1,287 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS index-binary operators: {\sf GxB\_IndexBinaryOp}} +%=============================================================================== +\label{idxbinaryop} + +An index-binary operator is a scalar function of the following form: +\[ +z=f(x,i_x,j_x,y,i_y,j_y,\Theta), +\] +where the value $x$ appears at row $i_x$ and column $j_x$ in its matrix, +and the value $y$ appears at row $i_y$ and column $j_y$ in its matrix. +The value $\Theta$ is a scalar that is the same for all uses of the operator. +See our IEEE HPEC'24 paper for more details (\cite{idxbinop}), +in the \verb'GraphBLAS/Doc' folder. + +When used in an element-wise method for $\bf C = A \oplus B$ and related +methods (\verb'GrB_eWiseAdd', \verb'GxB_eWiseUnion', or \verb'GrB_eWiseMult'), +operator is used for a pair of entries +$a_{ij}$ and $b_{ij}$, as +\[ +z=f(a_{ij},i,j,b_{ij},i,j,\Theta). +\] +When used in \verb'GrB_kronecker', it is used on a pair of entries +$a_{i_1,j_1}$ and $b_{i_2,j_2}$, as +\[ +z=f(a_{ij},i_1,j_1,b_{ij},i_2,j_2,\Theta). +\] +When used as the multiplicative operator in a semiring, to compute +$\bf C = A \oplus.\otimes B$, the operator is used as +\[ +z=f(a_{ik},i,k,b_{kj},k,j,\Theta) +\] +to compute an entry to be summed by the monoid of the semiring. + +No GraphBLAS operations directly use the \verb'GxB_IndexBinaryOp'. Instead, +the operator is coupled with a scalar \verb'Theta' value to create a new +index-based binary operator, which is simply a special case of a +\verb'GrB_BinaryOp'. The resulting \verb'GrB_BinaryOp' can then be passed to +element-wise methods and as the multiplicative operator of a new semiring. + +The signature of the index-binary function \verb'f' is as follows: + +{\footnotesize +\begin{verbatim} +void f +( + void *z, // output value z, of type ztype + const void *x, // input value x of type xtype; value of v(ix) or A(ix,jx) + GrB_Index ix, // row index of v(ix) or A(ix,jx) + GrB_Index jx, // column index of A(ix,jx), or zero for v(ix) + const void *y, // input value y of type ytype; value of w(iy) or B(iy,jy) + GrB_Index iy, // row index of w(iy) or B(iy,jy) + GrB_Index jy, // column index of B(iy,jy), or zero for w(iy) + const void *theta // input scalar theta of type theta_type +) ; \end{verbatim}} + +The following binary operators (\verb'GrB_BinaryOp' objects) are pre-defined, +where $N$ can be \verb'INT32' or \verb'INT64'. These operators do not use +\verb'theta'. Instead, the offset of 1 in \verb'GxB_FIRSTI1' is fixed into +the operator itself. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Built-in index-based binary operators for any type} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i_x$ & row index of $x$ (0-based) \\ +\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i_x+1$ & row index of $x$ (1-based) \\ +\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = j_x$ & column index of $x$ (0-based) \\ +\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = j_x+1$ & column index of $x$ (1-based) \\ +\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = i_y$ & row index of $y$ (0-based) \\ +\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = i_y+1$ & row index of $y$ (1-based) \\ +\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j_y$ & column index of $y$ (0-based) \\ +\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j_y+1$ & column index of $y$ (1-based) \\ +\hline +\end{tabular} +} + +\vspace{0.2in} +The following methods operate on the \verb'GxB_IndexBinaryOp' object: + +\vspace{0.1in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GxB_IndexBinaryOp_new' & create a named user-defined index-binary operator & \ref{idxbinop_new_named} \\ +\verb'GxB_IndexBinaryOp_wait' & wait for a user-defined index-binary operator & \ref{idxbinop_wait} \\ +\verb'GxB_IndexBinaryOp_free' & free a user-defined index-binary operator & \ref{idxbinop_free} \\ +\verb'GxB_BinaryOp_new_IndexOp' & create a new index-based \verb'GrB_BinaryOp' & \ref{binop_new_idxop} \\ +\verb'GrB_get' & get properties of an operator & \ref{get_set_idxbinop} \\ +\verb'GrB_set' & set the operator name/definition & \ref{get_set_idxbinop} \\ +\hline +\end{tabular} +} +\vspace{0.1in} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_new:} create a user-defined index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_new_named} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_new +( + GxB_IndexBinaryOp *op, // handle for the new index binary operator + GxB_index_binary_function function, // pointer to the index binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + GrB_Type theta_type, // type of input theta + const char *idxbinop_name, // name of the user function + const char *idxbinop_defn // definition of the user function +) ; +\end{verbatim} }\end{mdframed} + +Creates a named \verb'GxB_IndexBinaryOp'. Only the first 127 characters of +\verb'idxbinop_name' are used. The \verb'ixdbinop_defn' is a string containing +the entire function itself. + +The two strings \verb'idxbinop_name' and \verb'idxbinop_defn' are optional, but +are required to enable the JIT compilation of kernels that use this operator. +For example, the following operator can be used to compute the argmax of a +matrix with a single call to \verb'GrB_mxv'. It returns a vector \verb'c' +where \verb'c(i) = (k,v)', where the largest value in the $i$th row of \verb'A' +has value \verb'v' and appears in column \verb'k'. If multiple values in the +$i$th row have the same largest value, the one with the smallest column index +is returned. + +{\footnotesize +\begin{verbatim} + typedef struct { int64_t k ; double v ; } tuple_fp64 ; + #define FP64_K "typedef struct { int64_t k ; double v ; } tuple_fp64 ;" + void make_fp64 (tuple_fp64 *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx ; + z->v = (*x) ; + } + void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + #define MAX_FP64 (a string containing the max_fp64 function above) + + // create the types and operators: + GrB_Scalar Theta ; // unused, but cannot be NULL + GrB_Scalar_new (&Theta, GrB_BOOL) ; + GrB_Scalar_setElement_BOOL (Theta, 0) ; + GxB_IndexBinaryOp Iop ; + GrB_BinaryOp Bop, MonOp ; + GrB_Type Tuple ; + GxB_Type_new (&Tuple, sizeof (tuple_fp64), "tuple_fp64", FP64_K) ; + GxB_IndexBinaryOp_new (&Iop, make_fp64, Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, + "make_fp64", MAKE_FP64)) ; + GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta) ; + tuple_fp64 id ; + memset (&id, 0, sizeof (tuple_fp64)) ; + id.k = INT64_MAX ; + id.v = (double) (-INFINITY) ; + GxB_BinaryOp_new (&MonOp, max_fp64, Tuple, Tuple, Tuple, "max_fp64", MAX_FP64) ; + GrB_Monoid MonOp ; + GrB_Semiring Semiring ; + GrB_Monoid_new_UDT (&Monoid, MonOp, &id) ; + GrB_Semiring_new (&Semiring, Monoid, Bop) ; + + // compute the argmax of each row of a GrB_FP64 matrix A: + // y = zeros (ncols,1) ; + GrB_Vector y ; + GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; + GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; + // c = A*y using the argmax semiring + GrB_Vector_new (&c, Tuple, nrows, 1)) ; + GrB_mxv (c, NULL, NULL, Semiring, A, y, NULL) ; \end{verbatim}} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_wait:} wait for an index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_wait +( + GxB_IndexBinaryOp op, + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined index-binary operator, a GraphBLAS library may choose +to exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing except to ensure that the +\verb'op' is valid. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_free:} free a user-defined index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created index-binary operator +( + GxB_IndexBinaryOp *op // handle of IndexBinaryOp to free +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GxB_IndexBinaryOp_free' frees a user-defined index-binary operator. Either usage: + + {\small + \begin{verbatim} + GxB_IndexBinaryOp_free (&op) ; + GrB_free (&op) ; \end{verbatim}} + +\noindent +frees the \verb'op' and sets \verb'op' to \verb'NULL'. It safely +does nothing if passed a \verb'NULL' handle, or if \verb'op == NULL' on +input. No built-in index-binary operators exist, but if they did, +the method does nothing at all if passed a built-in index-binary operator. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_BinaryOp\_new\_IndexOp:} create a index-based binary operator} +%------------------------------------------------------------------------------- +\label{binop_new_idxop} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_BinaryOp_new_IndexOp +( + GrB_BinaryOp *binop, // handle of binary op to create + GxB_IndexBinaryOp idxbinop, // based on this index binary op + GrB_Scalar theta // theta value to bind to the new binary op +) ; +\end{verbatim} +}\end{mdframed} + +The \verb'GxB_IndexBinaryOp' cannot be directly used in any GraphBLAS operation +such as \verb'GrB_mxm'. Instead, it must be used to create a new index-based +\verb'GrB_BinaryOp'. The resulting binary operator can then be used to as the +multiplicative operator in a new user-defined semiring, or as the primary +binary operator of the element-wise operations (\verb'eWiseAdd', +\verb'eWiseUnion', \verb'eWiseMult', or \verb'kronecker'). + +The resulting binary operator cannot be used as the \verb'accum' operator in +any GraphBLAS operation. It also cannot be used in other places where a binary +operator appears, including \verb'GrB_*_build', \verb'GrB_apply', +\verb'GrB_reduce' and \verb'GrB_*_sort'. + +The \verb'GxB_BinaryOp_new_IndexOp' method creates this index-based binary +operator. It takes two input parameters: an index-binary operator, and a +scalar \verb'Theta'. The value of \verb'Theta' is copied into this new binary +operator, and the value cannot be changed. To change \verb'Theta', the binary +operator must be freed, and any semiring that would like to use the new value +of \verb'Theta' must also be recreated. + +An example of its use is given in Section~\ref{idxbinop_new_named}. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_IndexUnaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_IndexUnaryOp.tex new file mode 100644 index 0000000000..5ab1d81516 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_IndexUnaryOp.tex @@ -0,0 +1,270 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS IndexUnaryOp operators: {\sf GrB\_IndexUnaryOp}} %======== +%=============================================================================== +\label{idxunop} + +An index-unary operator is a scalar function of the form +$z=f(a_{ij},i,j,y)$ that is applied to the entries $a_{ij}$ of an +$m$-by-$n$ matrix. It can be used in \verb'GrB_apply' (Section~\ref{apply}) or +in \verb'GrB_select' (Section~\ref{select}) to select entries from a matrix or +vector. + +The signature of the index-unary function \verb'f' is as follows: + +{\footnotesize +\begin{verbatim} +void f +( + 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 of type ytype +) ; \end{verbatim}} + +The following built-in operators are available. Operators that do not depend +on the value of \verb'A(i,j)' can be used on any matrix or vector, including +those of user-defined type. In the table, \verb'y' is a +scalar whose type matches the suffix of the operator. The \verb'VALUEEQ' and +\verb'VALUENE' operators are defined for any built-in type. The other +\verb'VALUE' operators are defined only for real (not complex) built-in types. +Any index computations are done in \verb'int64_t' arithmetic; the result is +typecasted to \verb'int32_t' for the \verb'*INDEX_INT32' operators. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS name & MATLAB/Octave & description \\ + & analog & \\ +\hline +\verb'GrB_ROWINDEX_INT32' & \verb'z=i+y' & row index of \verb'A(i,j)', as int32 \\ +\verb'GrB_ROWINDEX_INT64' & \verb'z=i+y' & row index of \verb'A(i,j)', as int64 \\ +\verb'GrB_COLINDEX_INT32' & \verb'z=j+y' & column index of \verb'A(i,j)', as int32 \\ +\verb'GrB_COLINDEX_INT64' & \verb'z=j+y' & column index of \verb'A(i,j)', as int64 \\ +\verb'GrB_DIAGINDEX_INT32' & \verb'z=j-(i+y)' & column diagonal index of \verb'A(i,j)', as int32 \\ +\verb'GrB_DIAGINDEX_INT64' & \verb'z=j-(i+y)' & column diagonal index of \verb'A(i,j)', as int64 \\ +\hline +\verb'GrB_TRIL' & \verb'z=(j<=(i+y))' & true for entries on or below the \verb'y'th diagonal \\ +\verb'GrB_TRIU' & \verb'z=(j>=(i+y))' & true for entries on or above the \verb'y'th diagonal \\ +\verb'GrB_DIAG' & \verb'z=(j==(i+y))' & true for entries on the \verb'y'th diagonal \\ +\verb'GrB_OFFDIAG' & \verb'z=(j!=(i+y))' & true for entries not on the \verb'y'th diagonal \\ +\verb'GrB_COLLE' & \verb'z=(j<=y)' & true for entries in columns 0 to \verb'y' \\ +\verb'GrB_COLGT' & \verb'z=(j>y)' & true for entries in columns \verb'y+1' and above \\ +\verb'GrB_ROWLE' & \verb'z=(i<=y)' & true for entries in rows 0 to \verb'y' \\ +\verb'GrB_ROWGT' & \verb'z=(i>y)' & true for entries in rows \verb'y+1' and above \\ +\hline +\verb'GrB_VALUENE_T' & \verb'z=(aij!=y)' & true if \verb'A(i,j)' is not equal to \verb'y'\\ +\verb'GrB_VALUEEQ_T' & \verb'z=(aij==y)' & true if \verb'A(i,j)' is equal to \verb'y'\\ +\verb'GrB_VALUEGT_T' & \verb'z=(aij>y)' & true if \verb'A(i,j)' is greater than \verb'y' \\ +\verb'GrB_VALUEGE_T' & \verb'z=(aij>=y)' & true if \verb'A(i,j)' is greater than or equal to \verb'y' \\ +\verb'GrB_VALUELT_T' & \verb'z=(aij 1' and \verb'n > 1'. Empty matrices (\verb'0-by-0') are +also controlled by the global setting. + +Once a matrix is created, its format (by-row or by-column) can be arbitrarily +changed with \verb'GrB_set (A, fmt, GrB_STORAGE_ORIENTATION_HINT)' +with \verb'fmt' equal to \verb'GrB_COLMAJOR' or \verb'GrB_ROWMAJOR'. + +\begin{alert} +{\bf SPEC:} \verb'nrows' and/or \verb'ncols' may be zero. +as an extension to the specification. +\end{alert} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_wait:} wait for a matrix} +%------------------------------------------------------------------------------- +\label{matrix_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a matrix +( + GrB_Matrix C, // matrix to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +In non-blocking mode, the computations for a \verb'GrB_Matrix' may be delayed. +In this case, the matrix is not yet safe to use by multiple independent user +threads. A user application may force completion of a matrix \verb'C' via +\verb'GrB_Matrix_wait(C,mode)'. +With a \verb'mode' of \verb'GrB_MATERIALIZE', +all pending computations are finished, and afterwards different user threads may +simultaneously call GraphBLAS operations that use the matrix \verb'C' as an +input parameter. +See Section~\ref{omp_parallelism} +if GraphBLAS is compiled without OpenMP. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_dup:} copy a matrix} +%------------------------------------------------------------------------------- +\label{matrix_dup} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_dup // make an exact copy of a matrix +( + GrB_Matrix *C, // handle of output matrix to create + const GrB_Matrix A // input matrix to copy +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_dup' makes a deep copy of a sparse matrix. +In GraphBLAS, it is possible, and valid, to write the following: + + {\footnotesize + \begin{verbatim} + GrB_Matrix A, C ; + GrB_Matrix_new (&A, GrB_FP64, n) ; + C = A ; // C is a shallow copy of A \end{verbatim}} + +Then \verb'C' and \verb'A' can be used interchangeably. However, only a +pointer reference is made, and modifying one of them modifies both, and freeing +one of them leaves the other as a dangling handle that should not be used. If +two different matrices are needed, then this should be used instead: + + {\footnotesize + \begin{verbatim} + GrB_Matrix A, C ; + GrB_Matrix_new (&A, GrB_FP64, n) ; + GrB_Matrix_dup (&C, A) ; // like C = A, but making a deep copy \end{verbatim}} + +Then \verb'C' and \verb'A' are two different matrices that currently have the +same set of values, but they do not depend on each other. Modifying one has +no effect on the other. +The \verb'GrB_NAME' is copied into the new matrix. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_clear:} clear a matrix of all entries} +%------------------------------------------------------------------------------- +\label{matrix_clear} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_clear // clear a matrix of all entries; +( // type and dimensions remain unchanged + GrB_Matrix A // matrix to clear +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_clear' clears all entries from a matrix. All values +\verb'A(i,j)' are now equal to the implicit value, depending on what semiring +ring is used to perform computations on the matrix. The pattern of \verb'A' is +empty, just as if it were created fresh with \verb'GrB_Matrix_new'. Analogous +with \verb'A (:,:) = 0' in MATLAB. The type and dimensions of \verb'A' do not +change. Any pending updates to the matrix are discarded. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_nrows:} return the number of rows of a matrix} +%------------------------------------------------------------------------------- +\label{matrix_nrows} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix +( + GrB_Index *nrows, // matrix has nrows rows + const GrB_Matrix A // matrix to query +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_nrows' returns the number of rows of a matrix +(\verb'nrows=size(A,1)' in MATLAB). + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_ncols:} return the number of columns of a matrix} +%------------------------------------------------------------------------------- +\label{matrix_ncols} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix +( + GrB_Index *ncols, // matrix has ncols columns + const GrB_Matrix A // matrix to query +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Matrix_ncols' returns the number of columns of a matrix +(\verb'ncols=size(A,2)' in MATLAB). + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_nvals:} return the number of entries in a matrix} +%------------------------------------------------------------------------------- +\label{matrix_nvals} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix +( + GrB_Index *nvals, // matrix has nvals entries + const GrB_Matrix A // matrix to query +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_nvals' returns the number of entries in a matrix. Roughly +analogous to \verb'nvals = nnz(A)' in MATLAB, except that the implicit value in +GraphBLAS need not be zero and \verb'nnz' (short for ``number of nonzeros'') in +MATLAB is better described as ``number of entries'' in GraphBLAS. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_build:} build a matrix from a set of tuples} +%------------------------------------------------------------------------------- +\label{matrix_build} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_build // build a matrix from (I,J,X) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Index *I, // array of row indices of tuples + const GrB_Index *J, // array of column indices of tuples + const *X, // array of values of tuples + GrB_Index nvals, // number of tuples + const GrB_BinaryOp dup // binary function to assemble duplicates +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_build' constructs a sparse matrix \verb'C' from a set of +tuples, \verb'I', \verb'J', and \verb'X', each of length \verb'nvals'. The +matrix \verb'C' must have already been initialized with \verb'GrB_Matrix_new', +and it must have no entries in it before calling \verb'GrB_Matrix_build'. Thus +the dimensions and type of \verb'C' are not changed by this function, but are +inherited from the prior call to \verb'GrB_Matrix_new' or +\verb'GrB_matrix_dup'. + +An error is returned (\verb'GrB_INDEX_OUT_OF_BOUNDS') if any row index in +\verb'I' is greater than or equal to the number of rows of \verb'C', or if any +column index in \verb'J' is greater than or equal to the number of columns of +\verb'C' + +Any duplicate entries with identical indices are assembled using the binary +\verb'dup' operator provided on input. All three types (\verb'x', \verb'y', +\verb'z' for \verb'z=dup(x,y)') must be identical. The types of \verb'dup', +\verb'C' and \verb'X' must all be compatible. See Section~\ref{typecasting} +regarding typecasting and compatibility. The values in \verb'X' are +typecasted, if needed, into the type of \verb'dup'. Duplicates are then +assembled into a matrix \verb'T' of the same type as \verb'dup', using +\verb'T(i,j) = dup (T (i,j), X (k))'. After \verb'T' is constructed, it is +typecasted into the result \verb'C'. That is, typecasting does not occur at +the same time as the assembly of duplicates. + +If \verb'dup' is \verb'NULL', any duplicates result in an error. +If \verb'dup' is the special binary operator \verb'GxB_IGNORE_DUP', then +any duplicates are ignored. If duplicates appear, the last one in the +list of tuples is taken and the prior ones ignored. This is not an error. + +\begin{alert} +{\bf SPEC:} As an extension to the specification, results are defined even if +\verb'dup' is non-associative and/or non-commutative. +\end{alert} + +The GraphBLAS API requires \verb'dup' to be associative so +that entries can be assembled in any order, and states that the result is +undefined if \verb'dup' is not associative. However, SuiteSparse:GraphBLAS +guarantees a well-defined order of assembly. Entries in the tuples +\verb'[I,J,X]' are first sorted in increasing order of row and column index, +with ties broken by the position of the tuple in the \verb'[I,J,X]' list. If +duplicates appear, they are assembled in the order they appear in the +\verb'[I,J,X]' input. That is, if the same indices \verb'i' and \verb'j' +appear in positions \verb'k1', \verb'k2', \verb'k3', and \verb'k4' in +\verb'[I,J,X]', where \verb'k1 < k2 < k3 < k4', then the following operations +will occur in order: + + {\footnotesize + \begin{verbatim} + T (i,j) = X (k1) ; + T (i,j) = dup (T (i,j), X (k2)) ; + T (i,j) = dup (T (i,j), X (k3)) ; + T (i,j) = dup (T (i,j), X (k4)) ; \end{verbatim}} + +This is a well-defined order but the user should not depend upon it when using +other GraphBLAS implementations since the GraphBLAS API does not +require this ordering. + +However, SuiteSparse:GraphBLAS guarantees this ordering, even when it compute +the result in parallel. With this well-defined order, several operators become +very useful. In particular, the \verb'SECOND' operator results in the last +tuple overwriting the earlier ones. The \verb'FIRST' operator means the value +of the first tuple is used and the others are discarded. + +The acronym \verb'dup' is used here for the name of binary function used for +assembling duplicates, but this should not be confused with the \verb'_dup' +suffix in the name of the function \verb'GrB_Matrix_dup'. The latter function +does not apply any operator at all, nor any typecasting, but simply makes a +pure deep copy of a matrix. + +The parameter \verb'X' is a pointer to any C equivalent built-in type, or a +\verb'void *' pointer. The \verb'GrB_Matrix_build' function uses the +\verb'_Generic' feature of C11 to detect the type of pointer passed as the +parameter \verb'X'. If \verb'X' is a pointer to a built-in type, then the +function can do the right typecasting. If \verb'X' is a \verb'void *' pointer, +then it can only assume \verb'X' to be a pointer to a user-defined type that is +the same user-defined type of \verb'C' and \verb'dup'. This function has no +way of checking this condition that the \verb'void * X' pointer points to an +array of the correct user-defined type, so behavior is undefined if the user +breaks this condition. + +The \verb'GrB_Matrix_build' method is analogous to \verb'C = sparse (I,J,X)' in +MATLAB, with several important extensions that go beyond that which MATLAB can +do. In particular, the MATLAB \verb'sparse' function only provides one option +for assembling duplicates (summation), and it can only build double, double +complex, and logical sparse matrices. +% +The \verb'dup' operator cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_build\_Vector:} build a matrix from a set of tuples} +%------------------------------------------------------------------------------- +\label{matrix_build_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_build // build a matrix from (I,J,X) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_build_Vector' is identical to \verb'GrB_Matrix_build', except +that the inputs \verb'I', \verb'J', and \verb'X' are \verb'GrB_Vector' objects, +each with \verb'nvals' entries. The interpretation of \verb'I_vector', +\verb'J_vector', and \verb'X_vector' are controlled by descriptor settings +\verb'GxB_ROWINDEX_LIST', \verb'GxB_COLINDEX_LIST', and \verb'GxB_VALUE_LIST', +respectively. The method can use either the indices or values of each of the +input vectors; the default is to use the values. See Section~\ref{ijxvector} for +details. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_build\_Scalar:} build a matrix from a set of tuples} +%------------------------------------------------------------------------------- +\label{matrix_build_Scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_build // build a matrix from (I,J,scalar) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Index *I, // array of row indices of tuples + const GrB_Index *J, // array of column indices of tuples + GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_build_Scalar' constructs a sparse matrix \verb'C' from a set +of tuples defined the index arrays \verb'I' and \verb'J' of length +\verb'nvals', and a scalar. The scalar is the value of all of the tuples. +Unlike \verb'GrB_Matrix_build', there is no \verb'dup' operator to handle +duplicate entries. Instead, any duplicates are silently ignored (if the number +of duplicates is desired, simply compare the input \verb'nvals' with the value +returned by \verb'GrB_Vector_nvals' after the matrix is constructed). All +entries in the sparsity pattern of \verb'C' are identical, and equal to the +input scalar value. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_build\_Scalar\_Vector:} build a matrix from a set of tuples} +%------------------------------------------------------------------------------- +\label{matrix_build_Scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_build // build a matrix from (I,J,scalar) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_build_Scalar_Vector' is identical to +\verb'GxB_Matrix_build_Scalar', except that the inputs \verb'I', \verb'J', and +\verb'X' are \verb'GrB_Vector' objects, each with \verb'nvals' entries. The +interpretation of \verb'I_vector' and \verb'J_vector' are controlled by +descriptor settings \verb'GxB_ROWINDEX_LIST' and \verb'GxB_VALUE_LIST', +respectively. The method can use either the indices or values of the +\verb'I_input' and \verb'J_vector' vectors; the default is to use the values. +See Section~\ref{ijxvector} for details. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_setElement:} add an entry to a matrix} +%------------------------------------------------------------------------------- +\label{matrix_setElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_setElement // C (i,j) = x +( + GrB_Matrix C, // matrix to modify + x, // scalar to assign to C(i,j) + GrB_Index i, // row index + GrB_Index j // column index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_setElement' sets a single entry in a matrix, \verb'C(i,j)=x'. +If the entry is already present in the pattern of \verb'C', it is overwritten +with the new value. If the entry is not present, it is added to \verb'C'. In +either case, no entry is ever deleted by this function. Passing in a value of +\verb'x=0' simply creates an explicit entry at position \verb'(i,j)' whose +value is zero, even if the implicit value is assumed to be zero. + +An error is returned (\verb'GrB_INVALID_INDEX') if the row index \verb'i' is +greater than or equal to the number of rows of \verb'C', or if the column index +\verb'j' is greater than or equal to the number of columns of \verb'C'. Note +that this error code differs from the same kind of condition in +\verb'GrB_Matrix_build', which returns \verb'GrB_INDEX_OUT_OF_BOUNDS'. This is +because \verb'GrB_INVALID_INDEX' is an API error, and is caught immediately +even in non-blocking mode, whereas \verb'GrB_INDEX_OUT_OF_BOUNDS' is an +execution error whose detection may wait until the computation completes +sometime later. + +The scalar \verb'x' is typecasted into the type of \verb'C'. Any value can be +passed to this function and its type will be detected, via the \verb'_Generic' +feature of C11. For a user-defined type, \verb'x' is a \verb'void *' +pointer that points to a memory space holding a single entry of this +user-defined type. This user-defined type must exactly match the user-defined +type of \verb'C' since no typecasting is done between user-defined types. +% +If \verb'x' is a \verb'GrB_Scalar' and contains no entry, then the +entry \verb'C(i,j)' is removed (if it exists). The action taken is +identical to \verb'GrB_Matrix_removeElement(C,i,j)' in this case. + +{\bf Performance considerations:} % BLOCKING: setElement, *assign +SuiteSparse:GraphBLAS exploits the non-blocking mode to greatly improve the +performance of this method. Refer to the example shown in +Section~\ref{overview}. If the entry exists in the pattern already, it is +updated right away and the work is not left pending. Otherwise, it is placed +in a list of pending updates, and the later on the updates are done all at +once, using the same algorithm used for \verb'GrB_Matrix_build'. In other +words, \verb'setElement' in SuiteSparse:GraphBLAS builds its own internal list +of tuples \verb'[I,J,X]', and then calls \verb'GrB_Matrix_build' whenever the +matrix is needed in another computation, or whenever \verb'GrB_Matrix_wait' is +called. + +As a result, if calls to \verb'setElement' are mixed with calls to most other +methods and operations (even \verb'extractElement') then the pending updates +are assembled right away, which will be slow. Performance will be good if many +\verb'setElement' updates are left pending, and performance will be poor if the +updates are assembled frequently. + +A few methods and operations can be intermixed with \verb'setElement', in +particular, some forms of the \verb'GrB_assign' and \verb'GxB_subassign' +operations are compatible with the pending updates from \verb'setElement'. +Section~\ref{compare_assign} gives more details on which \verb'GxB_subassign' +and \verb'GrB_assign' operations can be interleaved with calls to +\verb'setElement' without forcing updates to be assembled. Other methods that +do not access the existing entries may also be done without forcing the updates +to be assembled, namely \verb'GrB_Matrix_clear' (which erases all pending +updates), \verb'GrB_Matrix_free', \verb'GrB_Matrix_ncols', +\verb'GrB_Matrix_nrows', \verb'GrB_get', and of course +\verb'GrB_Matrix_setElement' itself. All other methods and operations cause +the updates to be assembled. Future versions of SuiteSparse:GraphBLAS may +extend this list. + +See Section~\ref{random} for an example of how to use +\verb'GrB_Matrix_setElement'. +If an error occurs, \verb'GrB_error(&err,C)' returns details about the error. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_extractElement:} get an entry from a matrix} +%------------------------------------------------------------------------------- +\label{matrix_extractElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_extractElement // x = A(i,j) +( + *x, // extracted scalar (non-opaque C scalar) + const GrB_Matrix A, // matrix to extract a scalar from + GrB_Index i, // row index + GrB_Index j // column index +) ; +GrB_Info GrB_Matrix_extractElement // x = A(i,j) +( + GrB_Scalar x, // extracted GrB_Scalar + const GrB_Matrix A, // matrix to extract a scalar from + GrB_Index i, // row index + GrB_Index j // column index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_extractElement' extracts a single entry from a matrix +\verb'x=A(i,j)'. +An error is returned (\verb'GrB_INVALID_INDEX') if the row index \verb'i' is +greater than or equal to the number of rows of \verb'C', or if column index +\verb'j' is greater than or equal to the number of columns of \verb'C'. +If the entry is present, \verb'x=A(i,j)' is performed and the scalar \verb'x' +is returned with this value. The method returns \verb'GrB_SUCCESS'. +If no entry is present at \verb'A(i,j)', and \verb'x' is a non-opaque C scalar, +then \verb'x' is not modified, and the return value of +\verb'GrB_Matrix_extractElement' is \verb'GrB_NO_VALUE'. If \verb'x' is a +\verb'GrB_Scalar', then \verb'x' is returned as an empty scalar with no entry, +and \verb'GrB_SUCCESS' is returned. + +The function knows the type of the pointer \verb'x', so it can do typecasting +as needed, from the type of \verb'A' into the type of \verb'x'. User-defined +types cannot be typecasted, so if \verb'A' has a user-defined type then +\verb'x' must be a \verb'void *' pointer that points to a memory space the same +size as a single scalar of the type of \verb'A'. + +Currently, this method causes all pending updates from +\verb'GrB_setElement', \verb'GrB_assign', or \verb'GxB_subassign' to be +assembled, so its use can have performance implications. Calls to this +function should not be arbitrarily intermixed with calls to these other two +functions. Everything will work correctly and results will be predictable, it +will just be slow. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_isStoredElement:} check if entry present in matrix} +%------------------------------------------------------------------------------- +\label{matrix_isStoredElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_isStoredElement +( + const GrB_Matrix A, // check for A(i,j) + GrB_Index i, // row index + GrB_Index j // column index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_isStoredElement' check if the single entry \verb'A(i,j)' is +present in the matrix \verb'A'. It returns \verb'GrB_SUCCESS' if the entry is +present, or \verb'GrB_NO_VALUE' otherwise. The value of \verb'A(i,j)' is not +returned. It is otherwise identical to \verb'GrB_Matrix_extractElement'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_removeElement:} remove an entry from a matrix} +%------------------------------------------------------------------------------- +\label{matrix_removeElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_removeElement +( + GrB_Matrix C, // matrix to remove an entry from + GrB_Index i, // row index + GrB_Index j // column index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_removeElement' removes a single entry \verb'A(i,j)' from a +matrix. If no entry is present at \verb'A(i,j)', then the matrix is not +modified. If an error occurs, \verb'GrB_error(&err,A)' returns details about +the error. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_extractTuples:} get all entries from a matrix} +%------------------------------------------------------------------------------- +\label{matrix_extractTuples} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) +( + GrB_Index *I, // array for returning row indices of tuples + GrB_Index *J, // array for returning col indices of tuples + *X, // array for returning values of tuples + GrB_Index *nvals, // I,J,X size on input; # tuples on output + const GrB_Matrix A // matrix to extract tuples from +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_extractTuples' extracts all the entries from the matrix +\verb'A', returning them as a list of tuples, analogous to +\verb'[I,J,X]=find(A)' in MATLAB. Entries in the tuples \verb'[I,J,X]' are +unique. No pair of row and column indices \verb'(i,j)' appears more than once. + +The GraphBLAS API states the tuples can be returned in any order. If +\verb'GrB_wait' is called first, then SuiteSparse:GraphBLAS chooses to +always return them in sorted order, depending on whether the matrix is stored +by row or by column. Otherwise, the indices can be returned in any order. + +The number of tuples in the matrix \verb'A' is given by +\verb'GrB_Matrix_nvals(&anvals,A)'. If \verb'anvals' is larger than the size +of the arrays (\verb'nvals' in the parameter list), an error +\verb'GrB_INSUFFICIENT_SIZE' is returned, and no tuples are extracted. If +\verb'nvals' is larger than \verb'anvals', then only the first \verb'anvals' +entries in the arrays \verb'I' \verb'J', and \verb'X' are modified, containing +all the tuples of \verb'A', and the rest of \verb'I' \verb'J', and \verb'X' are +left unchanged. On output, \verb'nvals' contains the number of tuples +extracted. + +\begin{alert} +{\bf SPEC:} As an extension to the specification, the arrays \verb'I', +\verb'J', and/or \verb'X' may be passed in as \verb'NULL' pointers. +\verb'GrB_Matrix_extractTuples' does not return a component specified as +\verb'NULL'. This is not an error condition. +\end{alert} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_extractTuples\_Vector:} get all entries from a matrix} +%------------------------------------------------------------------------------- +\label{matrix_extractTuples_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) +( + GrB_Vector I_vector, // row indices + GrB_Vector J_vector, // col indices + GrB_Vector X_vector, // values + const GrB_Matrix A, // matrix to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_extractTuples_Vector' is identical to +\verb'GrB_Matrix_extractTuples' except that its three outputs are +\verb'GrB_Vector' objects. The vectors \verb'I_vector', \verb'J_vector', and +\verb'X_vector' objects must exist on input. On output, any prior content is +erased and their type, dimensions, and values are revised to contain dense +vectors of length \verb'nvals'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_resize:} resize a matrix} +%------------------------------------------------------------------------------- +\label{matrix_resize} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_resize // change the size of a matrix +( + GrB_Matrix A, // matrix to modify + const GrB_Index nrows_new, // new number of rows in matrix + const GrB_Index ncols_new // new number of columns in matrix +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_resize' changes the size of a matrix. If the dimensions +decrease, entries that fall outside the resized matrix are deleted. Unlike +\verb'GxB_Matrix_reshape*' (see Sections \ref{matrix_reshape} and +\ref{matrix_reshapedup}), entries remain in their same position after resizing +the matrix. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_reshape:} reshape a matrix} +%------------------------------------------------------------------------------- +\label{matrix_reshape} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place +( + // input/output: + GrB_Matrix C, // input/output matrix, reshaped in place + // input: + bool by_col, // true if reshape by column, false if by row + GrB_Index nrows_new, // new number of rows of C + GrB_Index ncols_new, // new number of columns of C + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_reshape' changes the size of a matrix \verb'C', taking entries +from the input matrix either column-wise or row-wise. If matrix \verb'C' on +input is \verb'nrows'-by-\verb'ncols', and the requested dimensions of +\verb'C' on output are \verb'nrows_new'-by-\verb'nrows_cols', then +the condition \verb'nrows*ncols == nrows_new*nrows_cols' must hold. +The matrix \verb'C' is modified in-place, as both an input and output for +this method. To create a new matrix, use \verb'GxB_Matrix_reshapeDup' +instead (Section \ref{matrix_reshapedup}). + +For example, if \verb'C' is 3-by-4 on input, and is reshaped column-wise to +have dimensions 2-by-6: + +\begin{verbatim} + C on input C on output (by_col true) + 00 01 02 03 00 20 11 02 22 13 + 10 11 12 13 10 01 21 12 03 23 + 20 21 22 23 +\end{verbatim} + +If the same \verb'C' on input is reshaped row-wise to dimensions 2-by-6: + +\begin{verbatim} + C on input C on output (by_col false) + 00 01 02 03 00 01 02 03 10 11 + 10 11 12 13 12 13 20 21 22 23 + 20 21 22 23 +\end{verbatim} + +NOTE: because an intermediate linear index must be computed for each entry, +\verb'GxB_Matrix_reshape' cannot be used on matrices for which +\verb'nrows*ncols' exceeds $2^{60}$. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_reshapeDup:} reshape a matrix} +%------------------------------------------------------------------------------- +\label{matrix_reshapedup} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix +( + // output: + GrB_Matrix *C, // newly created output matrix, not in place + // input: + GrB_Matrix A, // input matrix, not modified + bool by_col, // true if reshape by column, false if by row + GrB_Index nrows_new, // number of rows of C + GrB_Index ncols_new, // number of columns of C + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_reshapeDup' is identical to \verb'GxB_Matrix_reshape' (see +Section \ref{matrix_reshape}), except that creates a new output matrix +\verb'C' that is reshaped from the input matrix \verb'A'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_concat:} concatenate matrices } +%------------------------------------------------------------------------------- +\label{matrix_concat} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Descriptor desc // unused, except threading control +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_concat' concatenates an array of matrices (\verb'Tiles') into +a single \verb'GrB_Matrix' \verb'C'. + +\verb'Tiles' is an \verb'm'-by-\verb'n' dense array of matrices held in +row-major format, where \verb'Tiles [i*n+j]' is the $(i,j)$th tile, and where +\verb'm' $> 0$ and \verb'n' $> 0$ must hold. Let $A_{i,j}$ denote the +$(i,j)$th tile. The matrix \verb'C' is constructed by concatenating these +tiles together, as: + +\[ +C = +\left[ +\begin{array}{ccccc} + A_{0,0} & A_{0,1} & A_{0,2} & \cdots & A_{0,n-1} \\ + A_{1,0} & A_{1,1} & A_{1,2} & \cdots & A_{1,n-1} \\ + \cdots & \\ + A_{m-1,0} & A_{m-1,1} & A_{m-1,2} & \cdots & A_{m-1,n-1} +\end{array} +\right] +\] + +On input, the matrix \verb'C' must already exist. Any existing entries in +\verb'C' are discarded. \verb'C' must have dimensions \verb'nrows' by +\verb'ncols' where \verb'nrows' is the sum of the number of rows in the +matrices $A_{i,0}$ for all $i$, and \verb'ncols' is the sum of the number of +columns in the matrices $A_{0,j}$ for all $j$. All matrices in any given tile +row $i$ must have the same number of rows (that is, and all matrices in any +given tile column $j$ must have the same number of columns). + +The type of \verb'C' is unchanged, and all matrices $A_{i,j}$ are typecasted +into the type of \verb'C'. Any settings made to \verb'C' by +\verb'GrB_set' (format by row or by column, bitmap switch, hyper +switch, and sparsity control) are unchanged. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_split:} split a matrix } +%------------------------------------------------------------------------------- +\label{matrix_split} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices +( + GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Index *Tile_nrows, // array of size m + const GrB_Index *Tile_ncols, // array of size n + const GrB_Matrix A, // input matrix to split + const GrB_Descriptor desc // unused, except threading control +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_split' does the opposite of \verb'GxB_Matrix_concat'. It +splits a single input matrix \verb'A' into a 2D array of tiles. On input, the +\verb'Tiles' array must be a non-\verb'NULL' pointer to a previously allocated +array of size at least \verb'm*n' where both \verb'm' and \verb'n' must be +greater than zero. The \verb'Tiles_nrows' array has size \verb'm', and +\verb'Tiles_ncols' has size \verb'n'. The $(i,j)$th tile has dimension +\verb'Tiles_nrows[i]'-by-\verb'Tiles_ncols[j]'. The sum of +\verb'Tiles_nrows [0:m-1]' must equal the number of rows of \verb'A', and the +sum of \verb'Tiles_ncols [0:n-1]' must equal the number of columns of \verb'A'. +The type of each tile is the same as the type of \verb'A'; no typecasting is +done. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_diag:} construct a diagonal matrix} +%------------------------------------------------------------------------------- +\label{matrix_diag} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_diag // construct a diagonal matrix from a vector +( + GrB_Matrix *C, // output matrix + const GrB_Vector v, // input vector + int64_t k +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_diag' constructs a matrix from a vector. Let $n$ be the +length of the \verb'v' vector, from \verb'GrB_Vector_size (&n, v)'. If +\verb'k' = 0, then \verb'C' is an $n$-by-$n$ diagonal matrix with the entries +from \verb'v' along the main diagonal of \verb'C', with \verb'C(i,i)=v(i)'. If +\verb'k' is nonzero, \verb'C' is square with dimension $n+|k|$. If \verb'k' is +positive, it denotes diagonals above the main diagonal, with +\verb'C(i,i+k)=v(i)'. +If \verb'k' is negative, it denotes diagonals below the main diagonal of +\verb'C', with \verb'C(i-k,i)=v(i)'. This behavior is identical to the MATLAB +statement \verb'C=diag(v,k)', where \verb'v' is a vector. + +The output matrix \verb'C' is a newly-constructed square matrix with the +same type as the input vector \verb'v'. No typecasting is performed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_diag:} build a diagonal matrix} +%------------------------------------------------------------------------------- +\label{matrix_diag_GxB} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_diag // build a diagonal matrix from a vector +( + GrB_Matrix C, // output matrix + const GrB_Vector v, // input vector + int64_t k, + const GrB_Descriptor desc // unused, except threading control +) ; +\end{verbatim} } \end{mdframed} + +Identical to \verb'GrB_Matrix_diag', except for the extra parameter +(a \verb'descriptor' to provide control over the number of threads used), +and this method is not a constructor. + +The matrix \verb'C' must already exist on input, of the correct size. It must +be square of dimension $n+|k|$ where the vector \verb'v' has length $n$. Any +existing entries in \verb'C' are discarded. The type of \verb'C' is preserved, +so that if the type of \verb'C' and \verb'v' differ, the entries are typecasted +into the type of \verb'C'. Any settings made to \verb'C' by +\verb'GrB_set' (format by row or by column, bitmap switch, hyper +switch, and sparsity control) are unchanged. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_memoryUsage:} memory used by a matrix} +%------------------------------------------------------------------------------- +\label{matrix_memusage} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix +( + size_t *size, // # of bytes used by the matrix A + const GrB_Matrix A // matrix to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the memory space required for a matrix, in bytes. +By default, any read-only components are not included in the total memory. +This can be changed with via \verb'GrB_set'; see Section~\ref{get_set_global}. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_type:} type of a matrix} +%------------------------------------------------------------------------------- +\label{matrix_type} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_type // get the type of a matrix +( + GrB_Type *type, // returns the type of the matrix + const GrB_Matrix A // matrix to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the type of a matrix. The \verb'type' parameter is not allocated. +Calling \verb'GxB_Matrix_type' is identical to making a shallow pointer copy +of the type used to create a matrix. In particular, suppose a matrix is +created, and a copy of its type is saved at the same time: + +{\footnotesize +\begin{verbatim} + GrB_Matrix_new (&A, atype, m, n) ; + GrB_Type save_type = atype ; +\end{verbatim}} + +Sometime later, while the matrix \verb'A' and its type \verb'atype' have not +been freed, the following two code fragments are identical: + +{\footnotesize +\begin{verbatim} + // using GxB_Matrix_type: + GrB_Type atype2 ; + GxB_Matrix_type (&atype2, A) ; + assert (atype2 == save_type) ; + + // without GxB_Matrix_type: + GrB_Type atype2 = save_type ; +\end{verbatim}} + +As a result, freeing \verb'atype2' would be the same as freeing the original +\verb'atype'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_free:} free a matrix} +%------------------------------------------------------------------------------- +\label{matrix_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a matrix +( + GrB_Matrix *A // handle of matrix to free +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_free' frees a matrix. Either usage: + + {\small + \begin{verbatim} + GrB_Matrix_free (&A) ; + GrB_free (&A) ; \end{verbatim}} + +\noindent +frees the matrix \verb'A' and sets \verb'A' to \verb'NULL'. It safely does +nothing if passed a \verb'NULL' handle, or if \verb'A == NULL' on input. Any +pending updates to the matrix are abandoned. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Monoid.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Monoid.tex new file mode 100644 index 0000000000..7f8fa2aeb0 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Monoid.tex @@ -0,0 +1,283 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS monoids: {\sf GrB\_Monoid}} %============================= +%=============================================================================== +\label{monoid} + +A {\em monoid} is defined on a single domain (that is, a single type), $T$. It +consists of an associative binary operator $z=f(x,y)$ whose three operands $x$, +$y$, and $z$ are all in this same domain $T$ (that is $T \times T \rightarrow +T$). The operator must also have an identity element, or ``zero'' in this +domain, such that $f(x,0)=f(0,x)=x$. Recall that an associative operator +$f(x,y)$ is one for which the condition $f(a, f(b,c)) = f(f (a,b),c)$ always +holds. That is, operator can be applied in any order and the results remain +the same. If used in a semiring, the operator must also be commutative. + +The 77 predefined monoids are listed in the table below, which +includes nearly all monoids that can be constructed from built-in binary +operators. A few additional monoids can be defined with \verb'GrB_Monoid_new' +using built-in operators, such as bitwise monoids for signed integers. +Recall that $T$ denotes any built-in type (including boolean, integer, floating +point real, and complex), $R$ denotes any non-complex type (including bool), +$I$ denotes any integer type, and $Z$ denotes any complex type. Let $S$ denote +the 10 non-boolean real types. Let $U$ denote all unsigned integer types. + +The table lists the GraphBLAS monoid, its type, expression, identity +value, and {\em terminal} value (if any). For these built-in monoids, the +terminal values are the {\em annihilators} of the function, which is the value +$z$ so that $z=f(z,y)$ regardless of the value of $y$. For example +$\min(-\infty,y) = -\infty$ for any $y$. For integer domains, $+\infty$ and +$-\infty$ are the largest and smallest integer in their range. With unsigned +integers, the smallest value is zero, and thus \verb'GrB_MIN_MONOID_UINT8' has an +identity of 255 and a terminal value of 0. + +When computing with a monoid, the computation can terminate early if the +terminal value arises. No further work is needed since the result will not +change. This value is called the terminal value instead of the annihilator, +since a user-defined operator can be created with a terminal value that is not +an annihilator. See Section~\ref{monoid_terminal_new} for an example. + +The \verb'GxB_ANY_*' monoid can terminate as soon as it finds any value at all. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{lllll} +\hline +GraphBLAS & types (domains) & expression & identity & terminal \\ +operator & & $z=f(x,y)$ & & \\ +\hline +% numeric SxS -> S +\verb'GrB_PLUS_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = x+y$ & 0 & none \\ +\verb'GrB_TIMES_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = xy$ & 1 & 0 or none (see note) \\ +\verb'GrB_MIN_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = \min(x,y)$ & $+\infty$ & $-\infty$ \\ +\verb'GrB_MAX_MONOID_'$S$ & $S \times S \rightarrow S$ & $z = \max(x,y)$ & $-\infty$ & $+\infty$ \\ +\hline +% complex ZxZ -> Z +\verb'GxB_PLUS_'$Z$\verb'_MONOID' & $Z \times Z \rightarrow Z$ & $z = x+y$ & 0 & none \\ +\verb'GxB_TIMES_'$Z$\verb'_MONOID' & $Z \times Z \rightarrow Z$ & $z = xy$ & 1 & none \\ +\hline +% any TxT -> T +\verb'GxB_ANY_'$T$\verb'_MONOID' & $T \times T \rightarrow T$ & $z = x$ or $y$ & any & any \\ +\hline +% bool x bool -> bool +\verb'GrB_LOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \vee y $ & false & true \\ +\verb'GrB_LAND_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \wedge y $ & true & false \\ +\verb'GrB_LXOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z = x \veebar y $ & false & none \\ +\verb'GrB_LXNOR_MONOID' & \verb'bool' $\times$ \verb'bool' $\rightarrow$ \verb'bool' & $z =(x == y)$ & true & none \\ +\hline +% bitwise: UxU -> U +\verb'GxB_BOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x|y' & all bits zero & all bits one \\ +\verb'GxB_BAND_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x&y' & all bits one & all bits zero \\ +\verb'GxB_BXOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=x^y' & all bits zero & none \\ +\verb'GxB_BXNOR_'$U$\verb'_MONOID' & $U$ $\times$ $U$ $\rightarrow$ $U$ & \verb'z=~(x^y)' & all bits one & none \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +% 40: (min,max,+,*) x (int8,16,32,64, uint8,16,32,64, fp32, fp64) +The C API Specification includes 44 predefined monoids, with the naming +convention \verb'GrB_op_MONOID_type'. Forty monoids are available for the four +operators \verb'MIN', \verb'MAX', \verb'PLUS', and \verb'TIMES', each with the +10 non-boolean real types. Four boolean monoids are predefined: +\verb'GrB_LOR_MONOID_BOOL', \verb'GrB_LAND_MONOID_BOOL', +\verb'GrB_LXOR_MONOID_BOOL', and \verb'GrB_LXNOR_MONOID_BOOL'. + +% 13 ANY +% 4 complex (PLUS, TIMES) +% 16 bitwise +% 33 total +These all appear in SuiteSparse:GraphBLAS, which adds 33 additional predefined +\verb'GxB*' monoids, with the naming convention \verb'GxB_op_type_MONOID'. The +\verb'ANY' operator can be used for all 13 types (including complex). The +\verb'PLUS' and \verb'TIMES' operators are provided for both complex types, for +4 additional complex monoids. Sixteen monoids are predefined for four bitwise +operators (\verb'BOR', \verb'BAND', \verb'BXOR', and \verb'BNXOR'), each with +four unsigned integer types (\verb'UINT8', \verb'UINT16', \verb'UINT32', and +\verb'UINT64'). + +{\bf NOTE:} +The \verb'GrB_TIMES_FP*' operators do not have a terminal value of zero, since +they comply with the IEEE 754 standard, and \verb'0*NaN' is not zero, but +\verb'NaN'. Technically, their terminal value is \verb'NaN', but this value is +rare in practice and thus the terminal condition is not worth checking. + +The next sections define the following methods for the \verb'GrB_Monoid' +object: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Monoid_new' & create a user-defined monoid & \ref{monoid_new} \\ +\verb'GrB_Monoid_wait' & wait for a user-defined monoid & \ref{monoid_wait} \\ +\verb'GxB_Monoid_terminal_new' & create a monoid that has a terminal value & \ref{monoid_terminal_new} \\ +\verb'GrB_Monoid_free' & free a monoid & \ref{monoid_free} \\ +\verb'GrB_get' & get properties of a monoid & \ref{get_set_monoid} \\ +\verb'GrB_set' & set the monoid name & \ref{get_set_monoid} \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Monoid\_new:} create a monoid} +%------------------------------------------------------------------------------- +\label{monoid_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Monoid_new // create a monoid +( + GrB_Monoid *monoid, // handle of monoid to create + GrB_BinaryOp op, // binary operator of the monoid + identity // identity value of the monoid +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Monoid_new' creates a monoid. The operator, \verb'op', must be an +associative binary operator, either built-in or user-defined. + +In the definition above, \verb'' is a place-holder for the specific type +of the monoid. For built-in types, it is the C type corresponding to the +built-in type (see Section~\ref{type}), such as \verb'bool', \verb'int32_t', +\verb'float', or \verb'double'. In this case, \verb'identity' is a +scalar value of the particular type, not a pointer. For +user-defined types, \verb'' is \verb'void *', and thus \verb'identity' is +a not a scalar itself but a \verb'void *' pointer to a memory location +containing the identity value of the user-defined operator, \verb'op'. + +If \verb'op' is a built-in operator with a known identity value, then the +\verb'identity' parameter is ignored, and its known identity value is used +instead. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Monoid\_wait:} wait for a monoid} +%------------------------------------------------------------------------------- +\label{monoid_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a user-defined monoid +( + GrB_Monoid monoid, // monoid to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined monoid, a GraphBLAS library may choose to exploit +non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS +currently does nothing except to ensure that the \verb'monoid' is valid. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Monoid\_terminal\_new:} create a monoid with terminal} +%------------------------------------------------------------------------------- +\label{monoid_terminal_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Monoid_terminal_new // create a monoid that has a terminal value +( + GrB_Monoid *monoid, // handle of monoid to create + GrB_BinaryOp op, // binary operator of the monoid + identity, // identity value of the monoid + terminal // terminal value of the monoid +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Monoid_terminal_new' is identical to \verb'GrB_Monoid_new', except +that it allows for the specification of a {\em terminal value}. The +\verb'' of the terminal value is the same as the \verb'identity' +parameter; see Section~\ref{monoid_new} for details. + +The terminal value of a monoid is the value $z$ for which $z=f(z,y)$ for any +$y$, where $z=f(x,y)$ is the binary operator of the monoid. This is also +called the {\em annihilator}, but the term {\em terminal value} is used here. +This is because all annihilators are terminal values, but a terminal value need +not be an annihilator, as described in the \verb'MIN' example below. + +If the terminal value is encountered during computation, the rest of the +computations can be skipped. This can greatly improve the performance of +\verb'GrB_reduce', and matrix multiply in specific cases (when a dot product +method is used). For example, using \verb'GrB_reduce' to compute the sum of +all entries in a \verb'GrB_FP32' matrix with $e$ entries takes $O(e)$ time, +since a monoid based on \verb'GrB_PLUS_FP32' has no terminal value. By +contrast, a reduction using \verb'GrB_LOR' on a \verb'GrB_BOOL' matrix can take +as little as $O(1)$ time, if a \verb'true' value is found in the matrix very +early. + +Monoids based on the built-in \verb'GrB_MIN_*' and \verb'GrB_MAX_*' operators +(for any type), the boolean \verb'GrB_LOR', and the boolean \verb'GrB_LAND' +operators all have terminal values. For example, the identity value of +\verb'GrB_LOR' is \verb'false', and its terminal value is \verb'true'. When +computing a reduction of a set of boolean values to a single value, once a +\verb'true' is seen, the computation can exit early since the result is now +known. + +If \verb'op' is a built-in operator with known identity and terminal values, +then the \verb'identity' and \verb'terminal' parameters are ignored, and its +known identity and terminal values are used instead. + +There may be cases in which the user application needs to use a non-standard +terminal value for a built-in operator. For example, suppose the matrix has +type \verb'GrB_FP32', but all values in the matrix are known to be +non-negative. The annihilator value of \verb'MIN' is \verb'-INFINITY', but +this will never be seen. However, the computation could terminate when +finding the value zero. This is an example of using a terminal value that is +not actually an annihilator, but it functions like one since the monoid will +operate strictly on non-negative values. + +In this case, a monoid created with \verb'GrB_MIN_FP32' will not terminate +early, because the identity and terminal inputs are ignored when using +\verb'GrB_Monoid_new' with a built-in operator as its input. +To create a monoid that can terminate early, create a user-defined operator +that computes the same thing as \verb'GrB_MIN_FP32', and then create a monoid +based on this user-defined operator with a terminal value of zero and an +identity of \verb'+INFINITY'. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Monoid\_free:} free a monoid} +%------------------------------------------------------------------------------- +\label{monoid_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created monoid +( + GrB_Monoid *monoid // handle of monoid to free +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Monoid_frees' frees a monoid. Either usage: + + {\small + \begin{verbatim} + GrB_Monoid_free (&monoid) ; + GrB_free (&monoid) ; \end{verbatim}} + +\noindent +frees the \verb'monoid' and sets \verb'monoid' to \verb'NULL'. It safely does +nothing if passed a \verb'NULL' handle, or if \verb'monoid == NULL' on input. +It does nothing at all if passed a built-in monoid. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Scalar.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Scalar.tex new file mode 100644 index 0000000000..127b6cf5c6 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Scalar.tex @@ -0,0 +1,277 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS scalars: {\sf GrB\_Scalar}} %============================= +%=============================================================================== +\label{scalar} + +This section describes a set of methods that create, modify, query, +and destroy a GraphBLAS scalar, \verb'GrB_Scalar': + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Scalar_new' & create a scalar & \ref{scalar_new} \\ +\verb'GrB_Scalar_wait' & wait for a scalar & \ref{scalar_wait} \\ +\verb'GrB_Scalar_dup' & copy a scalar & \ref{scalar_dup} \\ +\verb'GrB_Scalar_clear' & clear a scalar of its entry & \ref{scalar_clear} \\ +\verb'GrB_Scalar_nvals' & return number of entries in a scalar & \ref{scalar_nvals} \\ +\verb'GrB_Scalar_setElement' & set the single entry of a scalar & \ref{scalar_setElement} \\ +\verb'GrB_Scalar_extractElement' & get the single entry from a scalar & \ref{scalar_extractElement} \\ +\verb'GxB_Scalar_memoryUsage' & memory used by a scalar & \ref{scalar_memusage} \\ +\verb'GxB_Scalar_type' & type of a scalar & \ref{scalar_type} \\ +\verb'GrB_Scalar_free' & free a scalar & \ref{scalar_free} \\ +\hline +\hline +\verb'GrB_get' & get properties of a scalar & \ref{get_set_scalar} \\ +\verb'GrB_set' & set properties of a scalar & \ref{get_set_scalar} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_new:} create a scalar} +%------------------------------------------------------------------------------- +\label{scalar_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry +( + GrB_Scalar *s, // handle of GrB_Scalar to create + GrB_Type type // type of GrB_Scalar to create +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Scalar_new' creates a new scalar with no +entry in it, of the given type. This is analogous to MATLAB/Octave statement +\verb's = sparse(0)', except that GraphBLAS can create scalars any +type. The pattern of the new scalar is empty. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_wait:} wait for a scalar} +%------------------------------------------------------------------------------- +\label{scalar_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a scalar +( + GrB_Scalar s, // scalar to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +In non-blocking mode, the computations for a \verb'GrB_Scalar' may be delayed. +In this case, the scalar is not yet safe to use by multiple independent user +threads. A user application may force completion of a scalar \verb's' via +\verb'GrB_Scalar_wait(s,mode)'. +With a \verb'mode' of \verb'GrB_MATERIALIZE', +all pending computations are finished, and afterwards different user threads may +simultaneously call GraphBLAS operations that use the scalar \verb's' as an +input parameter. +See Section~\ref{omp_parallelism} +if GraphBLAS is compiled without OpenMP. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_dup:} copy a scalar} +%------------------------------------------------------------------------------- +\label{scalar_dup} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar +( + GrB_Scalar *s, // handle of output GrB_Scalar to create + const GrB_Scalar t // input GrB_Scalar to copy +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Scalar_dup' makes a deep copy of a scalar. +In GraphBLAS, it is possible, and valid, to write the following: + + {\footnotesize + \begin{verbatim} + GrB_Scalar t, s ; + GrB_Scalar_new (&t, GrB_FP64) ; + s = t ; // s is a shallow copy of t \end{verbatim}} + +Then \verb's' and \verb't' can be used interchangeably. However, only a pointer +reference is made, and modifying one of them modifies both, and freeing one of +them leaves the other as a dangling handle that should not be used. +If two different scalars are needed, then this should be used instead: + + {\footnotesize + \begin{verbatim} + GrB_Scalar t, s ; + GrB_Scalar_new (&t, GrB_FP64) ; + GrB_Scalar_dup (&s, t) ; // like s = t, but making a deep copy \end{verbatim}} + +Then \verb's' and \verb't' are two different scalars that currently have +the same value, but they do not depend on each other. Modifying one has no +effect on the other. +The \verb'GrB_NAME' is copied into the new scalar. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_clear:} clear a scalar of its entry} +%------------------------------------------------------------------------------- +\label{scalar_clear} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry +( // type remains unchanged. + GrB_Scalar s // GrB_Scalar to clear +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Scalar_clear' clears the entry from a scalar. The pattern of +\verb's' is empty, just as if it were created fresh with \verb'GrB_Scalar_new'. +Analogous with \verb's = sparse (0)' in MATLAB/Octave. The type of \verb's' does not +change. Any pending updates to the scalar are discarded. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_nvals:} return the number of entries in a scalar} +%------------------------------------------------------------------------------- +\label{scalar_nvals} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar +( + GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) + const GrB_Scalar s // GrB_Scalar to query +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Scalar_nvals' returns the number of entries in a scalar, which +is either 0 or 1. Roughly analogous to \verb'nvals = nnz(s)' in MATLAB/Octave, +except that the implicit value in GraphBLAS need not be zero and \verb'nnz' +(short for ``number of nonzeros'') in MATLAB is better described as ``number of +entries'' in GraphBLAS. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_setElement:} set the single entry of a scalar} +%------------------------------------------------------------------------------- +\label{scalar_setElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_setElement // s = x +( + GrB_Scalar s, // GrB_Scalar to modify + x // user scalar to assign to s +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Scalar_setElement' sets the single entry in a scalar, like +\verb's = sparse(x)' in MATLAB notation. For further details of this function, +see \verb'GrB_Matrix_setElement' in Section~\ref{matrix_setElement}. +If an error occurs, \verb'GrB_error(&err,s)' returns details about the error. +The scalar \verb'x' can be any non-opaque C scalar corresponding to +a built-in type, or \verb'void *' for a user-defined type. It cannot be +a \verb'GrB_Scalar'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_extractElement:} get the single entry from a scalar} +%------------------------------------------------------------------------------- +\label{scalar_extractElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Scalar_extractElement // x = s +( + *x, // user scalar extracted + const GrB_Scalar s // GrB_Sclar to extract an entry from +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Scalar_extractElement' extracts the single entry from a sparse +scalar, like \verb'x = full(s)' in MATLAB. Further details of this method are +discussed in Section~\ref{matrix_extractElement}, which discusses +\verb'GrB_Matrix_extractElement'. {\bf NOTE: } if no entry is present in the +scalar \verb's', then \verb'x' is not modified, and the return value of +\verb'GrB_Scalar_extractElement' is \verb'GrB_NO_VALUE'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Scalar\_memoryUsage:} memory used by a scalar} +%------------------------------------------------------------------------------- +\label{scalar_memusage} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar +( + size_t *size, // # of bytes used by the scalar s + const GrB_Scalar s // GrB_Scalar to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the memory space required for a scalar, in bytes. +By default, any read-only components are not included in the total memory. +This can be changed with via \verb'GrB_set'; see Section~\ref{get_set_global}. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Scalar\_type:} type of a scalar} +%------------------------------------------------------------------------------- +\label{scalar_type} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Scalar_type // get the type of a GrB_Scalar +( + GrB_Type *type, // returns the type of the GrB_Scalar + const GrB_Scalar s // GrB_Scalar to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the type of a scalar. See \verb'GxB_Matrix_type' for details +(Section~\ref{matrix_type}). + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Scalar\_free:} free a scalar} +%------------------------------------------------------------------------------- +\label{scalar_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a GrB_Scalar +( + GrB_Scalar *s // handle of GrB_Scalar to free +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Scalar_free' frees a scalar. Either usage: + + {\small + \begin{verbatim} + GrB_Scalar_free (&s) ; + GrB_free (&s) ; \end{verbatim}} + +\noindent +frees the scalar \verb's' and sets \verb's' to \verb'NULL'. It safely +does nothing if passed a \verb'NULL' handle, or if \verb's == NULL' on input. +Any pending updates to the scalar are abandoned. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Semiring.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Semiring.tex new file mode 100644 index 0000000000..17a1cb545b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Semiring.tex @@ -0,0 +1,206 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS semirings: {\sf GrB\_Semiring}} %========================= +%=============================================================================== +\label{semiring} + +A {\em semiring} defines all the operators required to define the +multiplication of two sparse matrices in GraphBLAS, ${\bf C=AB}$. The ``add'' +operator is a commutative and associative monoid, and the binary ``multiply'' +operator defines a function $z=fmult(x,y)$ where the type of $z$ matches the +exactly with the monoid type. SuiteSparse:GraphBLAS includes 1,473 predefined +built-in semirings. The next sections define the following methods for the +\verb'GrB_Semiring' object: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Semiring_new' & create a user-defined semiring & \ref{semiring_new} \\ +\verb'GrB_Semiring_wait' & wait for a user-defined semiring & \ref{semiring_wait} \\ +\verb'GrB_Semiring_free' & free a semiring & \ref{semiring_free} \\ +\verb'GrB_get' & get properties of a semiring & \ref{get_set_semiring} \\ +\verb'GrB_set' & set the semiring name & \ref{get_set_semiring} \\ +\hline +\end{tabular} +} + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Semiring\_new:} create a semiring} +%------------------------------------------------------------------------------- +\label{semiring_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Semiring_new // create a semiring +( + GrB_Semiring *semiring, // handle of semiring to create + GrB_Monoid add, // add monoid of the semiring + GrB_BinaryOp multiply // multiply operator of the semiring +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Semiring_new' creates a new semiring, with \verb'add' being the +additive monoid and \verb'multiply' being the binary ``multiply'' operator. In +addition to the standard error cases, the function returns +\verb'GrB_DOMAIN_MISMATCH' if the output (\verb'ztype') domain of +\verb'multiply' does not match the domain of the \verb'add' monoid. + +The v2.0 C API Specification for GraphBLAS includes 124 predefined semirings, +with names of the form \verb'GrB_add_mult_SEMIRING_type', where \verb'add' is +the operator of the additive monoid, \verb'mult' is the multiply operator, and +\verb'type' is the type of the input $x$ to the multiply operator, $f(x,y)$. +The name of the domain for the additive monoid does not appear in the name, +since it always matches the type of the output of the \verb'mult' operator. +Twelve kinds of \verb'GrB*' semirings are available for all 10 real, non-boolean types: + \verb'PLUS_TIMES', \verb'PLUS_MIN', + \verb'MIN_PLUS', \verb'MIN_TIMES', \verb'MIN_FIRST', \verb'MIN_SECOND', \verb'MIN_MAX', + \verb'MAX_PLUS', \verb'MAX_TIMES', \verb'MAX_FIRST', \verb'MAX_SECOND', and \verb'MAX_MIN'. +Four semirings are for boolean types only: + \verb'LOR_LAND', \verb'LAND_LOR', \verb'LXOR_LAND', and \verb'LXNOR_LOR'. + +SuiteSparse:GraphBLAS pre-defines 1,553 semirings from built-in types and +operators, listed below. The naming convention is \verb'GxB_add_mult_type'. +The 124 \verb'GrB*' semirings are a subset of the list below, included with two +names: \verb'GrB*' and \verb'GxB*'. If the \verb'GrB*' name is provided, its +use is preferred, for portability to other GraphBLAS implementations. + +\vspace{-0.05in} +\begin{itemize} +\item 1000 semirings with a multiplier $T \times T \rightarrow T$ where $T$ is + any of the 10 non-Boolean, real types, from the complete cross product of: + + \vspace{-0.05in} + \begin{itemize} + \item 5 monoids (\verb'MIN', \verb'MAX', \verb'PLUS', \verb'TIMES', \verb'ANY') + \item 20 multiply operators + (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), + \verb'MIN', \verb'MAX', + \verb'PLUS', \verb'MINUS', \verb'RMINUS', \verb'TIMES', \verb'DIV', \verb'RDIV', + \verb'ISEQ', \verb'ISNE', \verb'ISGT', + \verb'ISLT', \verb'ISGE', \verb'ISLE', + \verb'LOR', \verb'LAND', \verb'LXOR'). + \item 10 non-Boolean types, $T$ + \end{itemize} + +\item 300 semirings with a comparator $T \times T \rightarrow$ + \verb'bool', where $T$ is non-Boolean and real, from the complete cross product of: + + \vspace{-0.05in} + \begin{itemize} + \item 5 Boolean monoids + (\verb'LAND', \verb'LOR', \verb'LXOR', \verb'EQ', \verb'ANY') + \item 6 multiply operators + (\verb'EQ', \verb'NE', \verb'GT', \verb'LT', \verb'GE', \verb'LE') + \item 10 non-Boolean types, $T$ + \end{itemize} + +\item 55 semirings with purely Boolean types, \verb'bool' $\times$ \verb'bool' + $\rightarrow$ \verb'bool', from the complete cross product of: + + \vspace{-0.05in} + \begin{itemize} + \item 5 Boolean monoids + (\verb'LAND', \verb'LOR', \verb'LXOR', \verb'EQ', \verb'ANY') + \item 11 multiply operators + (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), + \verb'LOR', \verb'LAND', \verb'LXOR', + \verb'EQ', \verb'GT', \verb'LT', \verb'GE', \verb'LE') + \end{itemize} + +\item 54 complex semirings, $Z \times Z \rightarrow Z$ where $Z$ is + \verb'GxB_FC32' (single precision complex) or + \verb'GxB_FC64' (double precision complex): + + \vspace{-0.05in} + \begin{itemize} + \item 3 complex monoids (\verb'PLUS', \verb'TIMES', \verb'ANY') + \item 9 complex multiply operators + (\verb'FIRST', \verb'SECOND', \verb'PAIR' (same as \verb'ONEB'), + \verb'PLUS', \verb'MINUS', + \verb'TIMES', \verb'DIV', \verb'RDIV', \verb'RMINUS') + \item 2 complex types, $Z$ + \end{itemize} + +\item 64 bitwise semirings, $U \times U \rightarrow U$ where $U$ is + an unsigned integer. + + \vspace{-0.05in} + \begin{itemize} + \item 4 bitwise monoids (\verb'BOR', \verb'BAND', \verb'BXOR', \verb'BXNOR') + \item 4 bitwise multiply operators (the same list) + \item 4 unsigned integer types + \end{itemize} + +\item 80 index-based semirings, $X \times X \rightarrow N$ where $N$ is + \verb'INT32' or \verb'INT64': + + \vspace{-0.05in} + \begin{itemize} + \item 5 monoids (\verb'MIN', \verb'MAX', \verb'PLUS', \verb'TIMES', \verb'ANY') + \item 8 index-based operators + (\verb'FIRSTI', \verb'FIRSTI1', \verb'FIRSTJ', \verb'FIRSTJ1', + \verb'SECONDI', \verb'SECONDI1', \verb'SECONDJ', \verb'SECONDJ1') + \item 2 integer types (\verb'INT32', \verb'INT64') + \end{itemize} + +\end{itemize} +% +The \verb'multiply' operator can be any a binary operator, including one +created by \verb'GxB_BinaryOp_new_IndexOp'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Semiring\_wait:} wait for a semiring} +%------------------------------------------------------------------------------- +\label{semiring_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a user-defined semiring +( + GrB_Semiring semiring, // semiring to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined semiring, a GraphBLAS library may choose to +exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing except to ensure that the +\verb'semiring' is valid. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Semiring\_free:} free a semiring} +%------------------------------------------------------------------------------- +\label{semiring_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created semiring +( + GrB_Semiring *semiring // handle of semiring to free +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Semiring_free' frees a semiring. Either usage: + + {\small + \begin{verbatim} + GrB_Semiring_free (&semiring) ; + GrB_free (&semiring) ; \end{verbatim}} + +\noindent +frees the \verb'semiring' and sets \verb'semiring' to \verb'NULL'. It safely +does nothing if passed a \verb'NULL' handle, or if \verb'semiring == NULL' on +input. It does nothing at all if passed a built-in semiring. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Serialize.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Serialize.tex new file mode 100644 index 0000000000..d7e0eeac0b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Serialize.tex @@ -0,0 +1,405 @@ + +\newpage +%=============================================================================== +\subsection{Serialize/deserialize methods} +%=============================================================================== +\label{serialize_deserialize} + +{\em Serialization} takes an opaque GraphBLAS object (a vector or matrix) and +encodes it in a single non-opaque array of bytes, the {\em blob}. The blob can +only be deserialized by the same library that created it (SuiteSparse:GraphBLAS +in this case). The array of bytes can be written to a file, sent to another +process over an MPI channel, or operated on in any other way that moves the +bytes around. The contents of the array cannot be interpreted except by +deserialization back into a vector or matrix, by the same library (and +sometimes the same version) that created the blob. + +All versions of SuiteSparse:GraphBLAS that implement +serialization/deserialization use essentially the same format for the blob, so +the library versions are compatible with each other. Version v9.0.0 adds the +\verb'GrB_NAME' and \verb'GrB_EL_TYPE_STRING' to the blob in an upward +compatible manner, so that older versions of SuiteSparse:GraphBLAS can read the blobs +created by v9.0.0; they simply ignore those components. + +SuiteSparse:GraphBLAS v10 adds +32/64-bit integers, and can read the blobs created by any prior version of +GraphBLAS (they are deserialized with all 64-bit integers however). If an older +version of SuiteSparse:GraphBLAS (v9 or earlier) attempts to deserialize a blob +containing a matrix with 32-bit integers, it will safely report that the blob +is invalid and refuse to deserialize it. If SuiteSparse:GraphBLAS v10 creates a +serialized blob with all-64-bit integers, then it can be read correctly by +SuiteSparse:GraphBLAS v9, and likely also by earlier versions of the library. + +There are two forms of serialization: \verb'GrB*serialize' and +\verb'GxB*serialize'. For the \verb'GrB' form, the blob must first be +allocated by the user application, and it must be large enough to hold the +serialized matrix or vector. By contrast \verb'GxB*serialize' allocates +the blob itself. + +By default, ZSTD (level 1) compression is used for serialization, but other +options can be selected via the descriptor: +\verb'GrB_set (desc, method,' \verb'GxB_COMPRESSION)', where \verb'method' is an +integer selected from the following options: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{ll} +\hline +method & description \\ +\hline +\verb'GxB_COMPRESSION_NONE' & no compression \\ +\verb'GxB_COMPRESSION_DEFAULT' & ZSTD, with default level 1 \\ +\verb'GxB_COMPRESSION_LZ4' & LZ4 \\ +\verb'GxB_COMPRESSION_LZ4HC' & LZ4HC, with default level 9 \\ +\verb'GxB_COMPRESSION_ZSTD' & ZSTD, with default level 1 \\ +\hline +\end{tabular} } +\vspace{0.2in} + +The LZ4HC method can be modified by adding a level of zero to 9, with 9 being +the default. Higher levels lead to a more compact blob, at the cost of extra +computational time. This level is simply added to the method, so to compress a +vector with LZ4HC with level 6, use: + + {\footnotesize + \begin{verbatim} + GrB_set (desc, GxB_COMPRESSION_LZ4HC + 6, GxB_COMPRESSION) ; \end{verbatim}} + +The ZSTD method can be specified as level 1 to 19, with 1 being the default. +To compress with ZSTD at level 6, use: + + {\footnotesize + \begin{verbatim} + GrB_set (desc, GxB_COMPRESSION_ZSTD + 6, GxB_COMPRESSION) ; \end{verbatim}} + +Deserialization of untrusted data is a common security problem; see +\url{https://cwe.mitre.org/data/definitions/502.html}. The deserialization +methods in SuiteSparse:GraphBLAS do a few basic checks so that no out-of-bounds +access occurs during deserialization, but the output matrix or vector itself +may still be corrupted. If the data is untrusted, use \verb'GxB_*_fprint' with +the print level set to \verb'GxB_SILENT' to +check the matrix or vector after deserializing it: + +{\footnotesize +\begin{verbatim} + info = GxB_Vector_fprint (w, "w deserialized", GxB_SILENT, NULL) ; + if (info != GrB_SUCCESS) GrB_free (&w) ; + info = GxB_Matrix_fprint (A, "A deserialized", GxB_SILENT, NULL) ; + if (info != GrB_SUCCESS) GrB_free (&A) ; \end{verbatim}} + +The following methods are described in this Section: + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +% \verb'GrB_Vector_serializeSize' & return size of serialized vector & \ref{vector_serialize_size} \\ +% \verb'GrB_Vector_serialize' & serialize a vector & \ref{vector_serialize} \\ +\verb'GxB_Vector_serialize' & serialize a vector & \ref{vector_serialize_GxB} \\ +% \verb'GrB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize} \\ +\verb'GxB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize_GxB} \\ +\hline +\verb'GrB_Matrix_serializeSize' & return size of serialized matrix & \ref{matrix_serialize_size} \\ +\verb'GrB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize} \\ +\verb'GxB_Matrix_serialize' & serialize a matrix & \ref{matrix_serialize_GxB} \\ +\verb'GrB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize} \\ +\verb'GxB_Matrix_deserialize' & deserialize a matrix & \ref{matrix_deserialize_GxB} \\ +\hline +\verb'GrB_get' & get blob properties & \ref{get_set_blob} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +% \subsubsection{{\sf GrB\_Vector\_serializeSize:} return size of serialized vector} +%------------------------------------------------------------------------------- +% \label{vector_serialize_size} + +% \begin{mdframed}[userdefinedwidth=6in] +% {\footnotesize +% \begin{verbatim} +% GrB_Info GrB_Vector_serializeSize // estimate the size of a blob +% ( +% // output: +% GrB_Index *blob_size_handle, // upper bound on the required size of the +% // blob on output. +% // input: +% GrB_Vector u // vector to serialize +%) ; +%\end{verbatim} +%} \end{mdframed} +% +% \verb'GrB_Vector_serializeSize' returns an upper bound on the size of the blob +% needed to serialize a \verb'GrB_Vector' using \verb'GrB_Vector_serialize'. +% After the vector is serialized, the actual size used is returned, and the blob +% may be \verb'realloc''d to that size if desired. +% This method is not required for \verb'GxB_Vector_serialize'. + +% \newpage +%------------------------------------------------------------------------------- +% \subsubsection{{\sf GrB\_Vector\_serialize:} serialize a vector} +%------------------------------------------------------------------------------- +% \label{vector_serialize} + +% \begin{mdframed}[userdefinedwidth=6in] +% {\footnotesize +% \begin{verbatim} +% GrB_Info GrB_Vector_serialize // serialize a GrB_Vector to a blob +% ( +% // output: +% void *blob, // the blob, already allocated in input +% // input/output: +% GrB_Index *blob_size_handle, // size of the blob on input. On output, +% // the # of bytes used in the blob. +% // input: +% GrB_Vector u // vector to serialize +% ) ; +% \end{verbatim} +% } \end{mdframed} +% +% \verb'GrB_Vector_serialize' serializes a vector into a single array of bytes +% (the blob), which must be already allocated by the user application. +% On input, \verb'&blob_size' is the size of the allocated blob in bytes. +% On output, it is reduced to the numbed of bytes actually used to serialize +% the vector. After calling \verb'GrB_Vector_serialize', the blob may be +% \verb'realloc''d to this revised size if desired (this is optional). +% ZSTD (level 1) compression is used to construct a compact blob. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_serialize:} serialize a vector} +%------------------------------------------------------------------------------- +\label{vector_serialize_GxB} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_serialize // serialize a GrB_Vector to a blob +( + // output: + void **blob_handle, // the blob, allocated on output + GrB_Index *blob_size_handle, // size of the blob on output + // input: + GrB_Vector u, // vector to serialize + const GrB_Descriptor desc // descriptor to select compression method +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Vector_serialize' serializes a vector into a single array of bytes +(the blob), which is \verb'malloc''ed and filled with the serialized vector. +By default, ZSTD (level 1) compression is used, but other options can be +selected via the descriptor. Serializing a vector is identical to serializing +a matrix; see Section \ref{matrix_serialize_GxB} for more information. + +%------------------------------------------------------------------------------- +% \subsubsection{{\sf GrB\_Vector\_deserialize:} deserialize a vector} +%------------------------------------------------------------------------------- +% \label{vector_deserialize} + +% \begin{mdframed}[userdefinedwidth=6in] +% {\footnotesize +% \begin{verbatim} +% GrB_Info GrB_Vector_deserialize // deserialize blob into a GrB_Vector +% ( +% // output: +% GrB_Vector *w, // output vector created from the blob +% // input: +% GrB_Type type, // type of the vector w. Required if the blob holds a +% // vector of user-defined type. May be NULL if blob +% // holds a built-in type; otherwise must match the +% // type of w. +% const void *blob, // the blob +% GrB_Index blob_size // size of the blob +% ) ; +% \end{verbatim} +% } \end{mdframed} +% +% This method creates a vector \verb'w' by deserializing the contents of the +% blob, constructed by either \verb'GrB_Vector_serialize' or +% \verb'GxB_Vector_serialize'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_deserialize:} deserialize a vector} +%------------------------------------------------------------------------------- +\label{vector_deserialize_GxB} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector +( + // output: + GrB_Vector *w, // output vector created from the blob + // input: + GrB_Type type, // type of the vector w. See GxB_Matrix_deserialize. + const void *blob, // the blob + GrB_Index blob_size, // size of the blob + const GrB_Descriptor desc +) ; +\end{verbatim} +} \end{mdframed} + +This method creates a vector \verb'w' by deserializing the contents of the +blob, constructed by +% either \verb'GrB_Vector_serialize' or +\verb'GxB_Vector_serialize'. +Deserializing a vector is identical to deserializing a matrix; +see Section \ref{matrix_deserialize_GxB} for more information. + +The blob is allocated with the \verb'malloc' function passed to +\verb'GxB_init', or the C11 \verb'malloc' if \verb'GrB_init' was used +to initialize GraphBLAS. The blob must be freed by the matching \verb'free' +method, either the \verb'free' function passed to \verb'GxB_init' or +the C11 \verb'free' if \verb'GrB_init' was used. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_serializeSize:} return size of serialized matrix} +%------------------------------------------------------------------------------- +\label{matrix_serialize_size} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_serializeSize // estimate the size of a blob +( + // output: + GrB_Index *blob_size_handle, // upper bound on the required size of the + // blob on output. + // input: + GrB_Matrix A // matrix to serialize +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Matrix_serializeSize' returns an upper bound on the size of the blob +needed to serialize a \verb'GrB_Matrix' with \verb'GrB_Matrix_serialize'. +After the matrix is serialized, the actual size used is returned, and the blob +may be \verb'realloc''d to that size if desired. +This method is not required for \verb'GxB_Matrix_serialize'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_serialize:} serialize a matrix} +%------------------------------------------------------------------------------- +\label{matrix_serialize} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_serialize // serialize a GrB_Matrix to a blob +( + // output: + void *blob, // the blob, already allocated in input + // input/output: + GrB_Index *blob_size_handle, // size of the blob on input. On output, + // the # of bytes used in the blob. + // input: + GrB_Matrix A // matrix to serialize +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Matrix_serialize' serializes a matrix into a single array of bytes +(the blob), which must be already allocated by the user application. +On input, \verb'&blob_size' is the size of the allocated blob in bytes. +On output, it is reduced to the numbed of bytes actually used to serialize +the matrix. After calling \verb'GrB_Matrix_serialize', the blob may be +\verb'realloc''d to this revised size if desired (this is optional). +ZSTD (level 1) compression is used to construct a compact blob. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_serialize:} serialize a matrix} +%------------------------------------------------------------------------------- +\label{matrix_serialize_GxB} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob +( + // output: + void **blob_handle, // the blob, allocated on output + GrB_Index *blob_size_handle, // size of the blob on output + // input: + GrB_Matrix A, // matrix to serialize + const GrB_Descriptor desc // descriptor to select compression method +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Matrix_serialize' is identical to \verb'GrB_Matrix_serialize', except +that it does not require a pre-allocated blob. Instead, it allocates the blob +internally, and fills it with the serialized matrix. By default, ZSTD (level 1) +compression is used, but other options can be selected via the descriptor. + +The blob is allocated with the \verb'malloc' function passed to +\verb'GxB_init', or the C11 \verb'malloc' if \verb'GrB_init' was used +to initialize GraphBLAS. The blob must be freed by the matching \verb'free' +method, either the \verb'free' function passed to \verb'GxB_init' or +the C11 \verb'free' if \verb'GrB_init' was used. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_deserialize:} deserialize a matrix} +%------------------------------------------------------------------------------- +\label{matrix_deserialize} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_deserialize // deserialize blob into a GrB_Matrix +( + // output: + GrB_Matrix *C, // output matrix created from the blob + // input: + GrB_Type type, // type of the matrix C. Required if the blob holds a + // matrix of user-defined type. May be NULL if blob + // holds a built-in type; otherwise must match the + // type of C. + const void *blob, // the blob + GrB_Index blob_size // size of the blob +) ; +\end{verbatim} +} \end{mdframed} + +This method creates a matrix \verb'A' by deserializing the contents of the +blob, constructed by either \verb'GrB_Matrix_serialize' or +\verb'GxB_Matrix_serialize'. + +% extended in the v2.1 C API (type may be NULL): +The \verb'type' may be \verb'NULL' if the blob holds a serialized matrix with a +built-in type. In this case, the type is determined automatically. For +user-defined types, the \verb'type' must match the type of the matrix in the +blob. The \verb'GrB_get' method can be used to query the blob for the name of +this type. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_deserialize:} deserialize a matrix} +%------------------------------------------------------------------------------- +\label{matrix_deserialize_GxB} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_deserialize // deserialize blob into a GrB_Matrix +( + // output: + GrB_Matrix *C, // output matrix created from the blob + // input: + GrB_Type type, // type of the matrix C. Required if the blob holds a + // matrix of user-defined type. May be NULL if blob + // holds a built-in type; otherwise must match the + // type of C. + const void *blob, // the blob + GrB_Index blob_size, // size of the blob + const GrB_Descriptor desc +) ; +\end{verbatim} +} \end{mdframed} + +Identical to \verb'GrB_Matrix_deserialize'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Type.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Type.tex new file mode 100644 index 0000000000..d06b7d8aec --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Type.tex @@ -0,0 +1,347 @@ + +\newpage +%=============================================================================== +\subsection{The GraphBLAS type: {\sf GrB\_Type}} %============================== +%=============================================================================== +\label{type} + +A GraphBLAS \verb'GrB_Type' defines the type of scalar values that a matrix or +vector contains, and the type of scalar operands for a unary or binary +operator. There are 13 built-in types, and a user application can define +any types of its own as well. The built-in types correspond to built-in types +in C (in the \verb'#include' files \verb'stdbool.h', \verb'stdint.h', and +\verb'complex.h') as listed in the following table. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{llll} +\hline +GraphBLAS & C type & description & range \\ +type & & & \\ +\hline +\verb'GrB_BOOL' & \verb'bool' & Boolean & true (1), false (0) \\ +\hline +\verb'GrB_INT8' & \verb'int8_t' & 8-bit signed integer & -128 to 127 \\ +\verb'GrB_INT16' & \verb'int16_t' & 16-bit integer & $-2^{15}$ to $2^{15}-1$ \\ +\verb'GrB_INT32' & \verb'int32_t' & 32-bit integer & $-2^{31}$ to $2^{31}-1$ \\ +\verb'GrB_INT64' & \verb'int64_t' & 64-bit integer & $-2^{63}$ to $2^{63}-1$ \\ +\hline +\verb'GrB_UINT8' & \verb'uint8_t' & 8-bit unsigned integer & 0 to 255 \\ +\verb'GrB_UINT16' & \verb'uint16_t' & 16-bit unsigned integer & 0 to $2^{16}-1$ \\ +\verb'GrB_UINT32' & \verb'uint32_t' & 32-bit unsigned integer & 0 to $2^{32}-1$ \\ +\verb'GrB_UINT64' & \verb'uint64_t' & 64-bit unsigned integer & 0 to $2^{64}-1$ \\ +\hline +\verb'GrB_FP32' & \verb'float' & 32-bit IEEE 754 & \verb'-Inf' to \verb'+Inf'\\ +\verb'GrB_FP64' & \verb'double' & 64-bit IEEE 754 & \verb'-Inf' to \verb'+Inf'\\ +\hline +\verb'GxB_FC32' & \verb'float complex' & 32-bit complex & \verb'-Inf' to \verb'+Inf'\\ +\verb'GxB_FC64' & \verb'double complex' & 64-bit complex & \verb'-Inf' to \verb'+Inf'\\ +\hline +\end{tabular} +} +\vspace{0.2in} + +The C11 definitions of \verb'float complex' and \verb'double complex' +are not always available. The \verb'GraphBLAS.h' header defines them as +\verb'GxB_FC32_t' and \verb'GxB_FC64_t', respectively. + +The user application can also define new types based on any \verb'typedef' in +the C language whose values are held in a contiguous region of memory of fixed +size. For example, a user-defined \verb'GrB_Type' could be created to hold any +C \verb'struct' whose content is self-contained. A C \verb'struct' containing +pointers might be problematic because GraphBLAS would not know to dereference +the pointers to traverse the entire ``scalar'' entry, but this can be done if +the objects referenced by these pointers are not moved. A user-defined complex +type with real and imaginary types can be defined, or even a ``scalar'' type +containing a fixed-sized dense matrix (see Section~\ref{type_new}). The +possibilities are endless. GraphBLAS can create and operate on sparse matrices +and vectors in any of these types, including any user-defined ones. For +user-defined types, GraphBLAS simply moves the data around itself (via +\verb'memcpy'), and then passes the values back to user-defined functions when +it needs to do any computations on the type. The next sections describe the +methods for the \verb'GrB_Type' object: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Type_new' & create a user-defined type & \ref{type_new} \\ +\verb'GxB_Type_new' & create a user-defined type, + with name and definition & \ref{type_new_named} \\ +\verb'GrB_Type_wait' & wait for a user-defined type & \ref{type_wait} \\ +\verb'GxB_Type_from_name'& return the type from its name & \ref{type_from_name} \\ +\verb'GrB_Type_free' & free a user-defined type & \ref{type_free} \\ +\verb'GrB_get' & get properties of a type & \ref{get_set_type} \\ +\verb'GrB_set' & set the type name/definitition & \ref{get_set_type} \\ +\hline +\end{tabular} +} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Type\_new:} create a user-defined type} +%------------------------------------------------------------------------------- +\label{type_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +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 +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GrB_Type_new' creates a new user-defined type. The \verb'type' is a +handle, or a pointer to an opaque object. The handle itself must not be +\verb'NULL' on input, but the content of the handle can be undefined. On +output, the handle contains a pointer to a newly created type. +The \verb'ctype' is the type in C that will be used to construct the new +GraphBLAS type. It can be either a built-in C type, or defined by a +\verb'typedef'. +The second parameter should be passed as \verb'sizeof(ctype)'. The only +requirement on the C type is that \verb'sizeof(ctype)' is valid in C, and +that the type reside in a contiguous block of memory so that it can be moved +with \verb'memcpy'. For example, to create a user-defined type called +\verb'Complex' for double-precision complex values using the C11 +\verb'double complex' type, the following can be used. A complete example can +be found in the \verb'usercomplex.c' and \verb'usercomplex.h' files in the +\verb'Demo' folder. + + {\footnotesize + \begin{verbatim} + #include + #include + GrB_Type Complex ; + GrB_Type_new (&Complex, sizeof (double complex)) ; \end{verbatim} } + +To demonstrate the flexibility of the \verb'GrB_Type', consider a ``scalar'' +consisting of 4-by-4 floating-point matrix and a string. This type might be +useful for the 4-by-4 translation/rotation/scaling matrices that arise in +computer graphics, along with a string containing a description or even a +regular expression that can be parsed and executed in a user-defined operator. +All that is required is a fixed-size type, where \verb'sizeof(ctype)' is +a constant. + + {\footnotesize + \begin{verbatim} + typedef struct + { + float stuff [4][4] ; + char whatstuff [64] ; + } + wildtype ; + GrB_Type WildType ; + GrB_Type_new (&WildType, sizeof (wildtype)) ; \end{verbatim} } + +With this type a sparse matrix can be created in which each entry consists of a +4-by-4 dense matrix \verb'stuff' and a 64-character string \verb'whatstuff'. +GraphBLAS treats this 4-by-4 as a ``scalar.'' Any GraphBLAS method or operation +that simply moves data can be used with this type without any further +information from the user application. For example, entries of this type can +be assigned to and extracted from a matrix or vector, and matrices containing +this type can be transposed. A working example (\verb'wildtype.c' +in the \verb'Demo' folder) creates matrices and multiplies them with +a user-defined semiring with this type. + +Performing arithmetic on matrices and vectors with user-defined types requires +operators to be defined. Refer to Section~\ref{user} for more details on these +example user-defined types. + +User defined types created by \verb'GrB_Type_new' will not work with +the JIT; use \verb'GxB_Type_new' instead. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Type\_new:} create a user-defined type (with name and definition)} +%------------------------------------------------------------------------------- +\label{type_new_named} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Type_new // create a new named GraphBLAS type +( + GrB_Type *type, // handle of user type to create + size_t sizeof_ctype, // size = sizeof (ctype) of the C type + const char *type_name, // name of the type (max 128 characters) + const char *type_defn // typedef for the type (no max length) +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GxB_Type_new' creates a type with a name and definition that are known to +GraphBLAS, as strings. The \verb'type_name' is any valid string (max length of 128 +characters, including the required null-terminating character) that may +appear as the name of a C type created by a C \verb'typedef' statement. It must +not contain any white-space characters. For example, to create a type of size +16*4+1 = 65 bytes, with a 4-by-4 dense float array and a 32-bit integer: + + {\footnotesize + \begin{verbatim} + typedef struct { float x [4][4] ; int color ; } myquaternion ; + GrB_Type MyQtype ; + GxB_Type_new (&MyQtype, sizeof (myquaternion), "myquaternion", + "typedef struct { float x [4][4] ; int color ; } myquaternion ;") ; \end{verbatim}} + +The \verb'type_name' and \verb'type_defn' are both null-terminated strings. +The two strings are optional, but are +required to enable the JIT compilation of kernels that use this type. +At most \verb'GxB_MAX_NAME_LEN' (128) characters are accessed in \verb'type_name'; +characters beyond that limit are silently ignored. + +If the \verb'sizeof_ctype' is zero, and the strings are valid, a +JIT kernel is compiled just to determine the size of the type. This is +feature useful for interfaces in languages other than C, which could create +valid strings for C types but would not have a reliable way to determine the +size of the type. + +The above example is identical to the following usage, except that +\verb'GrB_Type_new' requires \verb'sizeof_ctype' to be nonzero, and equal +to the size of the C type. + + {\footnotesize + \begin{verbatim} + typedef struct { float x [4][4] ; int color ; } myquaternion ; + GrB_Type MyQtype ; + GxB_Type_new (&MyQtype, sizeof (myquaternion)) ; + GrB_set (MyQtype, "myquaternion", GxB_JIT_C_NAME) ; + GrB_set (MyQtype, "typedef struct { float x [4][4] ; int color ; } myquaternion ;" + GxB_JIT_C_DEFINITION) ; \end{verbatim}} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Type\_wait:} wait for a type} +%------------------------------------------------------------------------------- +\label{type_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a user-defined type +( + GrB_Type type, // type to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined type, a GraphBLAS library may choose to exploit +non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS +currently does nothing except to ensure that \verb'type' is valid. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Type\_from\_name:} return the type from its name} +%------------------------------------------------------------------------------- +\label{type_from_name} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Type_from_name // return the built-in GrB_Type from a name +( + GrB_Type *type, // built-in type, or NULL if user-defined + const char *type_name // array of size at least GxB_MAX_NAME_LEN +) ; +\end{verbatim} +}\end{mdframed} + +Returns the built-in type from the corresponding name of the type. The following +examples both return \verb'type' as \verb'GrB_BOOL'. + +{\footnotesize +\begin{verbatim} + GxB_Type_from_name (&type, "bool") ; + GxB_Type_from_name (&type, "GrB_BOOL") ; \end{verbatim} } + +If the name is from a user-defined type, the \verb'type' is returned as +\verb'NULL'. This is not an error condition. The user application must itself +do this translation since GraphBLAS does not keep a registry of all +user-defined types. + +With this function, a user application can manage the translation for +both built-in types and its own user-defined types, as in the following +example. + +{\footnotesize +\begin{verbatim} + typedef struct { double x ; char stuff [16] ; } myfirsttype ; + typedef struct { float z [4][4] ; int color ; } myquaternion ; + GrB_Type MyType1, MyQType ; + GxB_Type_new (&MyType1, sizeof (myfirsttype), "myfirsttype", + "typedef struct { double x ; char stuff [16] ; } myfirsttype ;") ; + GxB_Type_new (&MyQType, sizeof (myquaternion), "myquaternion", + "typedef struct { float z [4][4] ; int color ; } myquaternion ;") ; + + GrB_Matrix A ; + // ... create a matrix A of some built-in or user-defined type + + // later on, to query the type of A: + size_t typesize ; + GrB_Scalar_new (s, GrB_UINT64) ; + GrB_get (type, s, GrB_SIZE) ; + GrB_Scalar_extractElement (&typesize, GrB_UINT64) ; + GrB_Type atype ; + char atype_name [GxB_MAX_NAME_LEN] ; + GrB_get (A, atype_name, GrB_EL_TYPE_STRING) ; + GxB_Type_from_name (&atype, atype_name) ; + if (atype == NULL) + { + // This is not yet an error. It means that A has a user-defined type. + if ((strcmp (atype_name, "myfirsttype")) == 0) atype = MyType1 ; + else if ((strcmp (atype_name, "myquaternion")) == 0) atype = MyQType ; + else { ... this is now an error ... the type of A is unknown. } + }\end{verbatim} } + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Type\_free:} free a user-defined type} +%------------------------------------------------------------------------------- +\label{type_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-defined type +( + GrB_Type *type // handle of user-defined type to free +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GrB_Type_free' frees a user-defined type. +Either usage: + + {\small + \begin{verbatim} + GrB_Type_free (&type) ; + GrB_free (&type) ; \end{verbatim}} + +\noindent +frees the user-defined \verb'type' and +sets \verb'type' to \verb'NULL'. +It safely does nothing if passed a \verb'NULL' +handle, or if \verb'type == NULL' on input. + +It is safe to attempt to free a built-in type. SuiteSparse:GraphBLAS silently +ignores the request and returns \verb'GrB_SUCCESS'. A user-defined type should +not be freed until all operations using the type are completed. +SuiteSparse:GraphBLAS attempts to detect this condition but it must query a +freed object in its attempt. This is hazardous and not recommended. +Operations on such objects whose type has been freed leads to undefined +behavior. + +It is safe to first free a type, and then a matrix of that type, but after the +type is freed the matrix can no longer be used. The only safe thing that can +be done with such a matrix is to free it. + +The function signature of \verb'GrB_Type_free' uses the generic name +\verb'GrB_free', which can free any GraphBLAS object. See Section~\ref{free} +details. GraphBLAS includes many such generic functions. When describing a +specific variation, a function is described with its specific name in this User +Guide (such as \verb'GrB_Type_free'). When discussing features applicable to +all specific forms, the generic name is used instead (such as \verb'GrB_free'). + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_UnaryOp.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_UnaryOp.tex new file mode 100644 index 0000000000..c99c2434b7 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_UnaryOp.tex @@ -0,0 +1,368 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== +%=============================================================================== +\label{unaryop} + +A unary operator is a scalar function of the form $z=f(x)$. The domain (type) +of $z$ and $x$ need not be the same. + +In the notation in the tables +below, $T$ is any of the 13 built-in types and is a place-holder for +\verb'BOOL', \verb'INT8', \verb'UINT8', ... +\verb'FP32', \verb'FP64', \verb'FC32', or \verb'FC64'. +For example, \verb'GrB_AINV_INT32' is a unary operator that computes +\verb'z=-x' for two values \verb'x' and \verb'z' of type \verb'GrB_INT32'. + +The notation $R$ refers to any real type (all but \verb'FC32' and \verb'FC64'), +$I$ refers to any integer type (\verb'INT*' and \verb'UINT*'), +$F$ refers to any real or complex floating point type +(\verb'FP32', \verb'FP64', \verb'FC32', or \verb'FC64'), +$Z$ refers to any complex floating point type +(\verb'FC32' or \verb'FC64'), +and $N$ refers to \verb'INT32' or \verb'INT64'. + +The logical negation operator \verb'GrB_LNOT' only works on Boolean types. The +\verb'GxB_LNOT_'$R$ functions operate on inputs of type $R$, implicitly +typecasting their input to Boolean and returning result of type $R$, with a +value 1 for true and 0 for false. The operators \verb'GxB_LNOT_BOOL' and +\verb'GrB_LNOT' are identical. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Unary operators for all types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x)$ & description \\ +\hline +\verb'GxB_ONE_'$T$ & $T \rightarrow T$ & $z = 1$ & one \\ +\verb'GrB_IDENTITY_'$T$ & $T \rightarrow T$ & $z = x$ & identity \\ +\verb'GrB_AINV_'$T$ & $T \rightarrow T$ & $z = -x$ & additive inverse \\ +\verb'GrB_MINV_'$T$ & $T \rightarrow T$ & $z = 1/x$ & multiplicative inverse \\ +\hline +\end{tabular} + +\vspace{0.2in} +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Unary operators for real and integer types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x)$ & description \\ +\hline +\verb'GrB_ABS_'$T$ & $R \rightarrow R$ & $z = |x|$ & absolute value \\ +\verb'GrB_LNOT' & \verb'bool' + $\rightarrow$ + \verb'bool' & $z = \lnot x$ & logical negation \\ +\verb'GxB_LNOT_'$R$ & $R \rightarrow R$ & $z = \lnot (x \ne 0)$ & logical negation \\ +\verb'GrB_BNOT_'$I$ & $I \rightarrow I$ & $z = \lnot x$ & bitwise negation \\ +\hline +\end{tabular} + +\vspace{0.2in} +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Index-based unary operators for any type (including user-defined)} \\ +\hline +GraphBLAS name & types (domains) & $z=f(a_{ij})$ & description \\ +\hline +\verb'GxB_POSITIONI_'$N$ & $ \rightarrow N$ & $z = i$ & row index (0-based) \\ +\verb'GxB_POSITIONI1_'$N$ & $ \rightarrow N$ & $z = i+1$ & row index (1-based) \\ +\verb'GxB_POSITIONJ_'$N$ & $ \rightarrow N$ & $z = j$ & column index (0-based) \\ +\verb'GxB_POSITIONJ1_'$N$ & $ \rightarrow N$ & $z = j+1$ & column index (1-based) \\ +\hline +\end{tabular} +\vspace{0.2in} + +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Unary operators for floating-point types (real and complex)} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x)$ & description \\ +\hline +\verb'GxB_SQRT_'$F$ & $F \rightarrow F$ & $z = \sqrt(x)$ & square root \\ +\verb'GxB_LOG_'$F$ & $F \rightarrow F$ & $z = \log_e(x)$ & natural logarithm \\ +\verb'GxB_EXP_'$F$ & $F \rightarrow F$ & $z = e^x$ & natural exponent \\ +\hline +\verb'GxB_LOG10_'$F$ & $F \rightarrow F$ & $z = \log_{10}(x)$ & base-10 logarithm \\ +\verb'GxB_LOG2_'$F$ & $F \rightarrow F$ & $z = \log_2(x)$ & base-2 logarithm \\ +\verb'GxB_EXP2_'$F$ & $F \rightarrow F$ & $z = 2^x$ & base-2 exponent \\ +\hline +\verb'GxB_EXPM1_'$F$ & $F \rightarrow F$ & $z = e^x - 1$ & natural exponent - 1 \\ +\verb'GxB_LOG1P_'$F$ & $F \rightarrow F$ & $z = \log(x+1)$ & natural log of $x+1$ \\ +\hline +\verb'GxB_SIN_'$F$ & $F \rightarrow F$ & $z = \sin(x)$ & sine \\ +\verb'GxB_COS_'$F$ & $F \rightarrow F$ & $z = \cos(x)$ & cosine \\ +\verb'GxB_TAN_'$F$ & $F \rightarrow F$ & $z = \tan(x)$ & tangent \\ +\hline +\verb'GxB_ASIN_'$F$ & $F \rightarrow F$ & $z = \sin^{-1}(x)$ & inverse sine \\ +\verb'GxB_ACOS_'$F$ & $F \rightarrow F$ & $z = \cos^{-1}(x)$ & inverse cosine \\ +\verb'GxB_ATAN_'$F$ & $F \rightarrow F$ & $z = \tan^{-1}(x)$ & inverse tangent \\ +\hline +\verb'GxB_SINH_'$F$ & $F \rightarrow F$ & $z = \sinh(x)$ & hyperbolic sine \\ +\verb'GxB_COSH_'$F$ & $F \rightarrow F$ & $z = \cosh(x)$ & hyperbolic cosine \\ +\verb'GxB_TANH_'$F$ & $F \rightarrow F$ & $z = \tanh(x)$ & hyperbolic tangent \\ +\hline +\verb'GxB_ASINH_'$F$ & $F \rightarrow F$ & $z = \sinh^{-1}(x)$ & inverse hyperbolic sine \\ +\verb'GxB_ACOSH_'$F$ & $F \rightarrow F$ & $z = \cosh^{-1}(x)$ & inverse hyperbolic cosine \\ +\verb'GxB_ATANH_'$F$ & $F \rightarrow F$ & $z = \tanh^{-1}(x)$ & inverse hyperbolic tangent \\ +\hline +\verb'GxB_SIGNUM_'$F$ & $F \rightarrow F$ & $z = \sgn(x)$ & sign, or signum function \\ +\verb'GxB_CEIL_'$F$ & $F \rightarrow F$ & $z = \lceil x \rceil $ & ceiling function \\ +\verb'GxB_FLOOR_'$F$ & $F \rightarrow F$ & $z = \lfloor x \rfloor $ & floor function \\ +\verb'GxB_ROUND_'$F$ & $F \rightarrow F$ & $z = \mbox{round}(x)$ & round to nearest \\ +\verb'GxB_TRUNC_'$F$ & $F \rightarrow F$ & $z = \mbox{trunc}(x)$ & round towards zero \\ +\hline +\verb'GxB_ISINF_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isinf}(x)$ & true if $\pm \infty$ \\ +\verb'GxB_ISNAN_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isnan}(x)$ & true if \verb'NaN' \\ +\verb'GxB_ISFINITE_'$F$ & $F \rightarrow $ \verb'bool' & $z = \mbox{isfinite}(x)$ & true if finite \\ +\hline +\end{tabular} +\vspace{0.2in} + +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Unary operators for floating-point types (real only)} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x)$ & description \\ +\hline +\verb'GxB_LGAMMA_'$R$ & $R \rightarrow R$ & $z = \log(|\Gamma (x)|)$ & log of gamma function \\ +\verb'GxB_TGAMMA_'$R$ & $R \rightarrow R$ & $z = \Gamma(x)$ & gamma function \\ +\verb'GxB_ERF_'$R$ & $R \rightarrow R$ & $z = \erf(x)$ & error function \\ +\verb'GxB_ERFC_'$R$ & $R \rightarrow R$ & $z = \erfc(x)$ & complimentary error function \\ +\verb'GxB_CBRT_'$R$ & $R \rightarrow R$ & $z = x^{1/3}$ & cube root \\ +\hline +\verb'GxB_FREXPX_'$R$ & $R \rightarrow R$ & $z = \mbox{frexpx}(x)$ & normalized fraction \\ +\verb'GxB_FREXPE_'$R$ & $R \rightarrow R$ & $z = \mbox{frexpe}(x)$ & normalized exponent \\ +\hline +\end{tabular} +\vspace{0.2in} + +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Unary operators for complex types} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x)$ & description \\ +\hline +\verb'GxB_CONJ_'$Z$ & $Z \rightarrow Z$ & $z = \overline{x}$ & complex conjugate \\ +\verb'GxB_ABS_'$Z$ & $Z \rightarrow F$ & $z = |x|$ & absolute value \\ +\verb'GxB_CREAL_'$Z$ & $Z \rightarrow F$ & $z = \mbox{real}(x)$ & real part \\ +\verb'GxB_CIMAG_'$Z$ & $Z \rightarrow F$ & $z = \mbox{imag}(x)$ & imaginary part \\ +\verb'GxB_CARG_'$Z$ & $Z \rightarrow F$ & $z = \mbox{carg}(x)$ & angle \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +Built-in index-based unary operators return the row or column index of an entry. For a +matrix $z=f(a_{ij})$ returns $z = i$ or $z = j$, or +1 for 1-based indices. +The latter is useful in the MATLAB/Octave interface, where row and column indices are +1-based. When applied to a vector, $j$ is always zero, and $i$ is the index in +the vector. These built-in unary operators come in two types: \verb'INT32' and +\verb'INT64', which is the type of the output, $z$. The functions are agnostic +to the type of their inputs; they only depend on the position of the entries, +not their values. +User-defined index-based operators cannot be defined by \verb'GrB_UnaryOp_new'; +use \verb'GrB_IndexUnaryOp_new' instead; see Section~\ref{idxunop}. + +\verb'GxB_FREXPX' and \verb'GxB_FREXPE' return the mantissa and exponent, +respectively, from the C11 \verb'frexp' function. The exponent is +returned as a floating-point value, not an integer. + +The operators \verb'GxB_EXPM1_FC*' and \verb'GxB_LOG1P_FC*' for complex +types are currently not accurate. They will be revised in a future version. + +The functions \verb'casin', \verb'casinf', \verb'casinh', and \verb'casinhf' +provided by Microsoft Visual Studio for computing $\sin^{-1}(x)$ and +$\sinh^{-1}(x)$ when $x$ is complex do not compute the correct result. Thus, +the unary operators \verb'GxB_ASIN_FC32', \verb'GxB_ASIN_FC64' +\verb'GxB_ASINH_FC32', and \verb'GxB_ASINH_FC64' do not work properly if the MS +Visual Studio compiler is used. These functions work properly if the gcc, icc, +or clang compilers are used on Linux or MacOS. + +Integer division by zero normally terminates an application, but this is +avoided in SuiteSparse:GraphBLAS. For details, see the binary +\verb'GrB_DIV_'$T$ operators. + +\begin{alert} +{\bf SPEC:} The definition of integer division by zero is an extension to the +specification. +\end{alert} + +The next sections define the following methods for the \verb'GrB_UnaryOp' +object: + +\vspace{0.1in} +{\footnotesize +\noindent +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_UnaryOp_new' & create a user-defined unary operator & \ref{unaryop_new} \\ +\verb'GxB_UnaryOp_new' & create a named user-defined unary operator & \ref{unaryop_new_named} \\ +\verb'GrB_UnaryOp_wait' & wait for a user-defined unary operator & \ref{unaryop_wait} \\ +\verb'GrB_UnaryOp_free' & free a user-defined unary operator & \ref{unaryop_free} \\ +\verb'GrB_get' & get properties of an operator & \ref{get_set_unop} \\ +\verb'GrB_set' & set the operator name/definition & \ref{get_set_unop} \\ +\hline +\end{tabular} +} +\vspace{0.1in} + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_UnaryOp\_new:} create a user-defined unary operator} +%------------------------------------------------------------------------------- +\label{unaryop_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_UnaryOp_new // create a new user-defined unary operator +( + GrB_UnaryOp *unaryop, // handle for the new unary operator + void *function, // pointer to the unary function + GrB_Type ztype, // type of output z + GrB_Type xtype // type of input x +) ; +\end{verbatim} }\end{mdframed} + +\verb'GrB_UnaryOp_new' creates a new unary operator. The new operator is +returned in the \verb'unaryop' handle, which must not be \verb'NULL' on input. +On output, its contents contains a pointer to the new unary operator. + +The two types \verb'xtype' and \verb'ztype' are the GraphBLAS types of the +input $x$ and output $z$ of the user-defined function $z=f(x)$. These types +may be built-in types or user-defined types, in any combination. The two types +need not be the same, but they must be previously defined before passing them +to \verb'GrB_UnaryOp_new'. + +The \verb'function' argument to \verb'GrB_UnaryOp_new' is a pointer to a +user-defined function with the following signature: + + {\footnotesize + \begin{verbatim} + void (*f) (void *z, const void *x) ; \end{verbatim} } + +When the function \verb'f' is called, the arguments \verb'z' and \verb'x' are +passed as \verb'(void *)' pointers, but they will be pointers to values of the +correct type, defined by \verb'ztype' and \verb'xtype', respectively, when the +operator was created. + +{\bf NOTE:} +The pointers passed to a user-defined operator may not be unique. That is, the +user function may be called with multiple pointers that point to the same +space, such as when \verb'z=f(z,y)' is to be computed by a binary operator, or +\verb'z=f(z)' for a unary operator. Any parameters passed to the user-callable +function may be aliased to each other. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_UnaryOp\_new:} create a named user-defined unary operator} +%------------------------------------------------------------------------------- +\label{unaryop_new_named} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_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 + const char *unop_name, // name of the user function + const char *unop_defn // definition of the user function +) ; +\end{verbatim} }\end{mdframed} + +Creates a named \verb'GrB_UnaryOp'. Only the first 127 characters of +\verb'unop_name' are used. The \verb'unop_defn' is a string containing the +entire function itself. For example: + + {\footnotesize + \begin{verbatim} + void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ; + ... + GrB_Type Square ; + GxB_UnaryOp_new (&Square, square, GrB_FP64, GrB_FP64, "square", + "void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ;") ; + \end{verbatim}} + +The two strings \verb'unop_name' and \verb'unop_defn' are optional, but are +required to enable the JIT compilation of kernels that use this operator. + +If JIT compilation is enabled, or if the corresponding JIT kernel has been +copied into the \verb'PreJIT' folder, the \verb'function' may be \verb'NULL'. +In this case, a JIT kernel is compiled that contains just the user-defined +function. If the JIT is disabled and the \verb'function' is \verb'NULL', this +method returns \verb'GrB_NULL_POINTER'. + +The above example is identical to the following usage, except that +\verb'GrB_UnaryOp_new' requires a non-NULL function pointer. + + {\footnotesize + \begin{verbatim} + void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ; + ... + GrB_Type Square ; + GrB_UnaryOp_new (&Square, square, GrB_FP64, GrB_FP64) ; + GrB_set (Square, "square", GxB_JIT_C_NAME) ; + GrB_set (Square, "void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ;", + GxB_JIT_C_DEFINITION) ; \end{verbatim}} + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_UnaryOp\_wait:} wait for a unary operator} +%------------------------------------------------------------------------------- +\label{unaryop_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a user-defined unary operator +( + GrB_UnaryOp unaryop, // unary operator to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined unary operator, a GraphBLAS library may choose to +exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing except to ensure that the +\verb'unaryop' is valid. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_UnaryOp\_free:} free a user-defined unary operator} +%------------------------------------------------------------------------------- +\label{unaryop_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created unary operator +( + GrB_UnaryOp *unaryop // handle of unary operator to free +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GrB_UnaryOp_free' frees a user-defined unary operator. +Either usage: + + {\small + \begin{verbatim} + GrB_UnaryOp_free (&unaryop) ; + GrB_free (&unaryop) ; \end{verbatim}} + +\noindent +frees the \verb'unaryop' and sets \verb'unaryop' to \verb'NULL'. +It safely does nothing if passed a \verb'NULL' +handle, or if \verb'unaryop == NULL' on input. +It does nothing at all if passed a built-in unary operator. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_Vector.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_Vector.tex new file mode 100644 index 0000000000..43268191ed --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_Vector.tex @@ -0,0 +1,609 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS vectors: {\sf GrB\_Vector}} %============================= +%=============================================================================== +\label{vector} + +This section describes a set of methods that create, modify, query, +and destroy a GraphBLAS sparse vector, \verb'GrB_Vector': + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GrB_Vector_new' & create a vector & \ref{vector_new} \\ +\verb'GrB_Vector_wait' & wait for a vector & \ref{vector_wait} \\ +\verb'GrB_Vector_dup' & copy a vector & \ref{vector_dup} \\ +\verb'GrB_Vector_clear' & clear a vector of all entries & \ref{vector_clear} \\ +\verb'GrB_Vector_size' & size of a vector & \ref{vector_size} \\ +\verb'GrB_Vector_nvals' & number of entries in a vector & \ref{vector_nvals} \\ +\verb'GrB_Vector_build' & build a vector from tuples & \ref{vector_build} \\ +\verb'GxB_Vector_build_Vector' & build a vector from tuples & \ref{vector_build_Vector} \\ +\verb'GxB_Vector_build_Scalar' & build a vector from tuples & \ref{vector_build_Scalar} \\ +\verb'GxB_Vector_build_Scalar_Vector' & build a vector from tuples & \ref{vector_build_Scalar_Vector} \\ +\verb'GrB_Vector_setElement' & add an entry to a vector & \ref{vector_setElement} \\ +\verb'GrB_Vector_extractElement' & get an entry from a vector & \ref{vector_extractElement} \\ +\verb'GxB_Vector_isStoredElement'& check if entry present in vector & \ref{vector_isStoredElement} \\ +\verb'GrB_Vector_removeElement' & remove an entry from a vector & \ref{vector_removeElement} \\ +\verb'GrB_Vector_extractTuples' & get all entries from a vector & \ref{vector_extractTuples} \\ +\verb'GxB_Vector_extractTuples_Vector' & get all entries from a vector & \ref{vector_extractTuples_Vector} \\ +\verb'GrB_Vector_resize' & resize a vector & \ref{vector_resize} \\ +\verb'GxB_Vector_diag' & extract a diagonal from a matrix & \ref{vector_diag} \\ +\verb'GxB_Vector_memoryUsage' & memory used by a vector & \ref{vector_memusage} \\ +\verb'GxB_Vector_type' & type of the matrix & \ref{vector_type} \\ +\verb'GrB_Vector_free' & free a vector & \ref{vector_free} \\ +\hline +\hline +% NOTE: GrB_Vector_serialize / deserialize does not appear in the 2.0 C API. +% \verb'GrB_Vector_serializeSize' & return size of serialized vector & \ref{vector_serialize_size} \\ +% \verb'GrB_Vector_serialize' & serialize a vector & \ref{vector_serialize} \\ +\verb'GxB_Vector_serialize' & serialize a vector & \ref{vector_serialize_GxB} \\ +% \verb'GrB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize} \\ +\verb'GxB_Vector_deserialize' & deserialize a vector & \ref{vector_deserialize_GxB} \\ +\hline +\hline +\verb'GxB_Vector_sort' & sort a vector & \ref{vector_sort} \\ +\hline +\hline +\verb'GrB_get' & get properties of a vector & \ref{get_set_vector} \\ +\verb'GrB_set' & set properties of a vector & \ref{get_set_vector} \\ +\end{tabular} +} + +\vspace{0.2in} +Refer to +Section~\ref{serialize_deserialize} for serialization/deserialization methods +and to +Section~\ref{sorting_methods} for sorting methods. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_new:} create a vector} +%------------------------------------------------------------------------------- +\label{vector_new} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_new // create a new vector with no entries +( + GrB_Vector *v, // handle of vector to create + GrB_Type type, // type of vector to create + GrB_Index n // vector dimension is n-by-1 +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_new' creates a new \verb'n'-by-\verb'1' sparse vector with no +entries in it, of the given type. This is analogous to MATLAB/Octave statement +\verb'v = sparse (n,1)', except that GraphBLAS can create sparse vectors any +type. The pattern of the new vector is empty. + +\begin{alert} +{\bf SPEC:} \verb'n' may be zero, as an extension to the specification. +\end{alert} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_wait:} wait for a vector} +%------------------------------------------------------------------------------- +\label{vector_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_wait // wait for a vector +( + GrB_Vector w, // vector to wait for + int mode // GrB_COMPLETE or GrB_MATERIALIZE +) ; +\end{verbatim} +}\end{mdframed} + +In non-blocking mode, the computations for a \verb'GrB_Vector' may be delayed. +In this case, the vector is not yet safe to use by multiple independent user +threads. A user application may force completion of a vector \verb'w' via +\verb'GrB_Vector_wait(w,mode)'. +With a \verb'mode' of \verb'GrB_MATERIALIZE', +all pending computations are finished, and afterwards different user threads may +simultaneously call GraphBLAS operations that use the vector \verb'w' as an +input parameter. +See Section~\ref{omp_parallelism} +if GraphBLAS is compiled without OpenMP. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_dup:} copy a vector} +%------------------------------------------------------------------------------- +\label{vector_dup} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_dup // make an exact copy of a vector +( + GrB_Vector *w, // handle of output vector to create + const GrB_Vector u // input vector to copy +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_dup' makes a deep copy of a sparse vector. +In GraphBLAS, it is possible, and valid, to write the following: + + {\footnotesize + \begin{verbatim} + GrB_Vector u, w ; + GrB_Vector_new (&u, GrB_FP64, n) ; + w = u ; // w is a shallow copy of u \end{verbatim}} + +Then \verb'w' and \verb'u' can be used interchangeably. However, only a pointer +reference is made, and modifying one of them modifies both, and freeing one of +them leaves the other as a dangling handle that should not be used. +If two different vectors are needed, then this should be used instead: + + {\footnotesize + \begin{verbatim} + GrB_Vector u, w ; + GrB_Vector_new (&u, GrB_FP64, n) ; + GrB_Vector_dup (&w, u) ; // like w = u, but making a deep copy \end{verbatim}} + +Then \verb'w' and \verb'u' are two different vectors that currently have the +same set of values, but they do not depend on each other. Modifying one has +no effect on the other. +The \verb'GrB_NAME' is copied into the new vector. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_clear:} clear a vector of all entries} +%------------------------------------------------------------------------------- +\label{vector_clear} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_clear // clear a vector of all entries; +( // type and dimension remain unchanged. + GrB_Vector v // vector to clear +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_clear' clears all entries from a vector. All values +\verb'v(i)' are now equal to the implicit value, depending on what semiring +ring is used to perform computations on the vector. The pattern of \verb'v' is +empty, just as if it were created fresh with \verb'GrB_Vector_new'. Analogous +with \verb'v (:) = sparse(0)' in MATLAB. The type and dimension of \verb'v' do +not change. Any pending updates to the vector are discarded. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_size:} return the size of a vector} +%------------------------------------------------------------------------------- +\label{vector_size} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_size // get the dimension of a vector +( + GrB_Index *n, // vector dimension is n-by-1 + const GrB_Vector v // vector to query +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_size' returns the size of a vector (the number of rows). +Analogous to \verb'n = length(v)' or \verb'n = size(v,1)' in MATLAB. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_nvals:} return the number of entries in a vector} +%------------------------------------------------------------------------------- +\label{vector_nvals} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_nvals // get the number of entries in a vector +( + GrB_Index *nvals, // vector has nvals entries + const GrB_Vector v // vector to query +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_nvals' returns the number of entries in a vector. Roughly +analogous to \verb'nvals = nnz(v)' in MATLAB, except that the implicit value in +GraphBLAS need not be zero and \verb'nnz' (short for ``number of nonzeros'') in +MATLAB is better described as ``number of entries'' in GraphBLAS. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_build:} build a vector from a set of tuples} +%------------------------------------------------------------------------------- +\label{vector_build} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_build // build a vector from (I,X) tuples +( + GrB_Vector w, // vector to build + const GrB_Index *I, // array of row indices of tuples + const *X, // array of values of tuples + GrB_Index nvals, // number of tuples + const GrB_BinaryOp dup // binary function to assemble duplicates +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_build' constructs a sparse vector \verb'w' from a set of +tuples, \verb'I' and \verb'X', each of length \verb'nvals'. The vector +\verb'w' must have already been initialized with \verb'GrB_Vector_new', and it +must have no entries in it before calling \verb'GrB_Vector_build'. +This function is just like \verb'GrB_Matrix_build' (see +Section~\ref{matrix_build}), except that it builds a sparse vector instead of a +sparse matrix. For a description of what \verb'GrB_Vector_build' does, refer +to \verb'GrB_Matrix_build'. For a vector, the list of column indices \verb'J' +in \verb'GrB_Matrix_build' is implicitly a vector of length \verb'nvals' all +equal to zero. Otherwise the methods are identical. + +If \verb'dup' is \verb'NULL', any duplicates result in an error. +If \verb'dup' is the special binary operator \verb'GxB_IGNORE_DUP', then +any duplicates are ignored. If duplicates appear, the last one in the +list of tuples is taken and the prior ones ignored. This is not an error. +% +The \verb'dup' operator cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +\begin{alert} +{\bf SPEC:} Results are defined even if \verb'dup' is non-associative and/or +non-commutative. +\end{alert} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_build\_Vector:} build a vector from a set of tuples} +%------------------------------------------------------------------------------- +\label{vector_build_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_build // build a vector from (I,X) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Vector_build_Vector' is identical to \verb'GrB_Vector_build', except +that the inputs \verb'I' and \verb'X' are \verb'GrB_Vector' objects, each with +\verb'nvals' entries. The interpretation of \verb'I_vector' and +\verb'X_vector' are controlled by descriptor settings \verb'GxB_ROWINDEX_LIST' +and \verb'GxB_VALUE_LIST', respectively. The method can use either the indices +or values of each of the input vectors; the default is to use the values. See +Section~\ref{ijxvector} for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_build\_Scalar:} build a vector from a set of tuples} +%------------------------------------------------------------------------------- +\label{vector_build_Scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_build // build a vector from (I,scalar) tuples +( + GrB_Vector w, // vector to build + const GrB_Index *I, // array of row indices of tuples + GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_build_Scalar' constructs a sparse vector \verb'w' from a set +of tuples defined by the index array \verb'I' of length \verb'nvals', and a +scalar. The scalar is the value of all of the tuples. Unlike +\verb'GrB_Vector_build', there is no \verb'dup' operator to handle duplicate +entries. Instead, any duplicates are silently ignored (if the number of +duplicates is desired, simply compare the input \verb'nvals' with the value +returned by \verb'GrB_Vector_nvals' after the vector is constructed). All +entries in the sparsity pattern of \verb'w' are identical, and equal to the +input scalar value. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_build\_Scalar\_Vector:} build a vector from a set of tuples} +%------------------------------------------------------------------------------- +\label{vector_build_Scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_build // build a vector from (I,scalar) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_build_Scalar_Vector' is identical to +\verb'GxB_Vector_build_Scalar', except that the inputs \verb'I' and \verb'X' +are \verb'GrB_Vector' objects, each with \verb'nvals' entries. The +interpretation of \verb'I_vector' is controlled by the descriptor setting +\verb'GxB_ROWINDEX_LIST'. The method +can use either the indices or values of the \verb'I_input' vector; the default +is to use the values. See Section~\ref{ijxvector} for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_setElement:} add an entry to a vector} +%------------------------------------------------------------------------------- +\label{vector_setElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_setElement // w(i) = x +( + GrB_Vector w, // vector to modify + x, // scalar to assign to w(i) + GrB_Index i // index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_setElement' sets a single entry in a vector, \verb'w(i) = x'. +The operation is exactly like setting a single entry in an \verb'n'-by-1 +matrix, \verb'A(i,0) = x', where the column index for a vector is implicitly +\verb'j=0'. For further details of this function, see +\verb'GrB_Matrix_setElement' in Section~\ref{matrix_setElement}. +If an error occurs, \verb'GrB_error(&err,w)' returns details about the error. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_extractElement:} get an entry from a vector} +%------------------------------------------------------------------------------- +\label{vector_extractElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_extractElement // x = v(i) +( + *x, // scalar extracted (non-opaque, C scalar) + const GrB_Vector v, // vector to extract an entry from + GrB_Index i // index +) ; + +GrB_Info GrB_Vector_extractElement // x = v(i) +( + GrB_Scalar x, // GrB_Scalar extracted + const GrB_Vector v, // vector to extract an entry from + GrB_Index i // index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_extractElement' extracts a single entry from a vector, +\verb'x = v(i)'. The method is identical to extracting a single entry +\verb'x = A(i,0)' from an \verb'n'-by-1 matrix; see +Section~\ref{matrix_extractElement}. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_isStoredElement:} check if entry present in vector} +%------------------------------------------------------------------------------- +\label{vector_isStoredElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_isStoredElement +( + const GrB_Vector v, // check presence of entry v(i) + GrB_Index i // index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_isStoredElement' checks if a single entry \verb'v(i)' +is present, returning \verb'GrB_SUCCESS' if the entry is present or +\verb'GrB_NO_VALUE' otherwise. The value of \verb'v(i)' is not returned. +See also Section~\ref{matrix_isStoredElement}. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_removeElement:} remove an entry from a vector} +%------------------------------------------------------------------------------- +\label{vector_removeElement} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_removeElement +( + GrB_Vector w, // vector to remove an entry from + GrB_Index i // index +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_removeElement' removes a single entry \verb'w(i)' from a vector. +If no entry is present at \verb'w(i)', then the vector is not modified. +If an error occurs, \verb'GrB_error(&err,w)' returns details about the error. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_extractTuples:} get all entries from a vector} +%------------------------------------------------------------------------------- +\label{vector_extractTuples} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) +( + GrB_Index *I, // array for returning row indices of tuples + *X, // array for returning values of tuples + GrB_Index *nvals, // I, X size on input; # tuples on output + const GrB_Vector v // vector to extract tuples from +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_extractTuples' extracts all tuples from a sparse vector, +analogous to \verb'[I,~,X] = find(v)' in MATLAB/Octave. This function is +identical to its \verb'GrB_Matrix_extractTuples' counterpart, except that the +array of column indices \verb'J' does not appear in this function. Refer to +Section~\ref{matrix_extractTuples} where further details of this function are +described. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_extractTuples\_Vector:} get all entries from a vector} +%------------------------------------------------------------------------------- +\label{vector_extractTuples_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) +( + GrB_Vector I_vector, // row indices + GrB_Vector X_vector, // values + const GrB_Vector V, // vectors to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) ; + +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_extractTuples_Vector' is identical to +\verb'GrB_Vector_extractTuples' except that its two outputs are +\verb'GrB_Vector' objects. The vectors \verb'I_vector' and \verb'X_vector' +objects must exist on input. On output, any prior content is erased and +their type, dimensions, and values are revised to contain dense vectors of +length \verb'nvals'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_resize:} resize a vector} +%------------------------------------------------------------------------------- +\label{vector_resize} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Vector_resize // change the size of a vector +( + GrB_Vector u, // vector to modify + GrB_Index nrows_new // new number of rows in vector +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_resize' changes the size of a vector. If the dimension +decreases, entries that fall outside the resized vector are deleted. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_diag:} extract a diagonal from a matrix} +%------------------------------------------------------------------------------- +\label{vector_diag} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_diag // extract a diagonal from a matrix +( + GrB_Vector v, // output vector + const GrB_Matrix A, // input matrix + int64_t k, + const GrB_Descriptor desc // unused, except threading control +) ; +\end{verbatim} } \end{mdframed} + + +\verb'GxB_Vector_diag' extracts a vector \verb'v' from an input matrix +\verb'A', which may be rectangular. If \verb'k' = 0, the main diagonal of +\verb'A' is extracted; \verb'k' $> 0$ denotes diagonals above the main diagonal +of \verb'A', and \verb'k' $< 0$ denotes diagonals below the main diagonal of +\verb'A'. Let \verb'A' have dimension $m$-by-$n$. If \verb'k' is in the range +0 to $n-1$, then \verb'v' has length $\min(m,n-k)$. If \verb'k' is negative +and in the range -1 to $-m+1$, then \verb'v' has length $\min(m+k,n)$. If +\verb'k' is outside these ranges, \verb'v' has length 0 (this is not an error). +This function computes the same thing as the MATLAB/Octave statement +\verb'v=diag(A,k)' when \verb'A' is a matrix, except that +\verb'GxB_Vector_diag' can also do typecasting. + +The vector \verb'v' must already exist on input, and +\verb'GrB_Vector_size (&len,v)' must return \verb'len' = 0 if \verb'k' $\ge n$ +or \verb'k' $\le -m$, \verb'len' $=\min(m,n-k)$ if \verb'k' is in the range 0 +to $n-1$, and \verb'len' $=\min(m+k,n)$ if \verb'k' is in the range -1 to +$-m+1$. Any existing entries in \verb'v' are discarded. The type of \verb'v' +is preserved, so that if the type of \verb'A' and \verb'v' differ, the entries +are typecasted into the type of \verb'v'. Any settings made to \verb'v' by +\verb'GrB_set' (bitmap switch and sparsity control) are +unchanged. + +\newpage + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_memoryUsage:} memory used by a vector} +%------------------------------------------------------------------------------- +\label{vector_memusage} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector +( + size_t *size, // # of bytes used by the vector v + const GrB_Vector v // vector to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the memory space required for a vector, in bytes. +By default, any read-only components are not included in the total memory. +This can be changed with via \verb'GrB_set'; see Section~\ref{get_set_global}. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_type:} type of a vector} +%------------------------------------------------------------------------------- +\label{vector_type} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_type // get the type of a vector +( + GrB_Type *type, // returns the type of the vector + const GrB_Vector v // vector to query +) ; +\end{verbatim} } \end{mdframed} + +Returns the type of a vector. See \verb'GxB_Matrix_type' for details +(Section~\ref{matrix_type}). + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_free:} free a vector} +%------------------------------------------------------------------------------- +\label{vector_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a vector +( + GrB_Vector *v // handle of vector to free +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_free' frees a vector. Either usage: + + {\small + \begin{verbatim} + GrB_Vector_free (&v) ; + GrB_free (&v) ; \end{verbatim}} + +\noindent +frees the vector \verb'v' and sets \verb'v' to \verb'NULL'. It safely does +nothing if passed a \verb'NULL' handle, or if \verb'v == NULL' on input. Any +pending updates to the vector are abandoned. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_formats.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_formats.tex new file mode 100644 index 0000000000..11dba06aa4 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_formats.tex @@ -0,0 +1,361 @@ +\newpage +%------------------------------------------------------------------------------- +\subsection{SuiteSparse:GraphBLAS data formats} +%------------------------------------------------------------------------------- +\label{formats} + +SuiteSparse:GraphBLAS uses four distinct data formats: sparse, hypersparse, +bitmap, and full, each in row-major or column-major orientations, for eight +different variants (each of which are listed below). +Each of these eight total variants can be iso-valued, where if +\verb'Container->iso' is true the numerical values are all the same, and +\verb'Container->x' holds a single entry with this value. +Each of the sparse and hypersparse formats can appear in {\em jumbled} form, +where the indices within any given row (if the orientation is row-major) +or column may be out of order. If \verb'Container->jumbled' is false, then +the indices appear in ascending order. + +The \verb'p', \verb'h', and \verb'i' vectors in the Container have an integer +type, either \verb'GrB_UINT32' or \verb'GrB_UINT64'. These appear below as +just \verb'integer', but the actual corresponding C type (\verb'uint32_t' or +\verb'uint64_t') must be used for each component. + +%------------------------------------------------------------------------------- +\subsubsection{Sparse, held by row} +%------------------------------------------------------------------------------- +\label{format_sparse_by_row} + +A sparse matrix in CSR format, held by row, has a \verb'Container->format' +value of \verb'GxB_SPARSE' and a \verb'Container->orientation' of +\verb'GrB_ROWMAJOR'. It requires three arrays: + +\begin{itemize} +\item \verb'integer Ap [nrows+1] ;' The \verb'Ap' array is the row +``pointer'' array. It does not actual contain pointers, but integer offsets. +More precisely, it is an integer array that defines where the column indices +and values appear in \verb'Aj' and \verb'Ax', for each row. The number of +entries in row \verb'i' is given by the expression \verb'Ap [i+1] - Ap [i]'. + +\item \verb'integer Aj [nvals] ;' The \verb'Aj' array defines the +column indices of entries in each row. + +\item \verb'type Ax [nvals] ;' The \verb'Ax' array defines the values of +entries in each row. +\end{itemize} + +The content of the three arrays \verb'Ap' \verb'Aj', and \verb'Ax' is very +specific. This content is not checked, since this function takes only +$O(1)$ time. Results are undefined if the following specification is not +followed exactly. + +The column indices of entries in the ith row of the matrix are held in +\verb'Aj [Ap [i] ... Ap[i+1]]', and the corresponding values are held in the +same positions in \verb'Ax'. Column indices must be in the range 0 to +\verb'ncols'-1. If \verb'jumbled' is \verb'false', column indices must appear +in ascending order within each row. If \verb'jumbled' is \verb'true', column +indices may appear in any order within each row. No duplicate column indices +may appear in any row. \verb'Ap [0]' must equal zero, and \verb'Ap [nrows]' +must equal \verb'nvals'. The \verb'Ap' array must be of size \verb'nrows'+1 +(or larger), and the \verb'Aj' and \verb'Ax' arrays must have size at least +\verb'nvals'. + +An example of the CSR format is shown below. Consider the following +matrix with 10 nonzero entries, and suppose the zeros are not stored. + + \begin{equation} + \label{eqn:Aexample} + A = \left[ + \begin{array}{cccc} + 4.5 & 0 & 3.2 & 0 \\ + 3.1 & 2.9 & 0 & 0.9 \\ + 0 & 1.7 & 3.0 & 0 \\ + 3.5 & 0.4 & 0 & 1.0 \\ + \end{array} + \right] + \end{equation} + +The \verb'Ap' array has length 5, since the matrix is 4-by-4. The first entry +must always zero, and \verb'Ap [5] = 10' is the number of entries. +The content of the arrays is shown below: + +{\footnotesize +\begin{verbatim} + integer Ap [ ] = { 0, 2, 5, 7, 10 } ; + integer Aj [ ] = { 0, 2, 0, 1, 3, 1, 2, 0, 1, 3 } ; + double Ax [ ] = { 4.5, 3.2, 3.1, 2.9, 0.9, 1.7, 3.0, 3.5, 0.4, 1.0 } ; \end{verbatim} } + +Spaces have been added to the \verb'Ap' array, just for illustration. Row zero +is in \verb'Aj [0..1]' (column indices) and \verb'Ax [0..1]' (values), starting +at \verb'Ap [0] = 0' and ending at \verb'Ap [0+1]-1 = 1'. The list of column +indices of row one is at \verb'Aj [2..4]' and row two is in \verb'Aj [5..6]'. +The last row (three) appears \verb'Aj [7..9]', because \verb'Ap [3] = 7' and +\verb'Ap [4]-1 = 10-1 = 9'. The corresponding numerical values appear in the +same positions in \verb'Ax'. + +To iterate over the rows and entries of this matrix, the following code can be +used (assuming it has type \verb'GrB_FP64'): + + {\footnotesize + \begin{verbatim} + integer nvals = Ap [nrows] ; + for (integer i = 0 ; i < nrows ; i++) + { + // get A(i,:) + for (integer p = Ap [i] ; p < Ap [i+1] ; p++) + { + // get A(i,j) + integer j = Aj [p] ; // column index + double aij = Ax [iso ? 0 : p] ; // numerical value + } + } \end{verbatim}} + +In the container, the three arrays \verb'Ap', \verb'Aj' and \verb'Ax' +are held in three \verb'GrB_Vector' objects: +\verb'Container->p', +\verb'Container->i', and +\verb'Container->x', respectively. + +%------------------------------------------------------------------------------- +\subsubsection{Sparse, held by column} +%------------------------------------------------------------------------------- +\label{format_sparse_by_col} + +This format is the transpose of sparse-by-row. A sparse matrix in CSC format, +held by column, has a \verb'Container->format' value of \verb'GxB_SPARSE' and a +\verb'Container->orientation' of \verb'GrB_COLMAJOR'. It requires three +arrays: \verb'Ap', \verb'Ai', and \verb'Ax'. + +The column ``pointer'' array \verb'Ap' has size \verb'ncols+1'. The row +indices of the columns are in \verb'Ai', and if \verb'jumbled' is false, +they must appear in ascending order in +each column. The corresponding numerical values are held in \verb'Ax'. The +row indices of column \verb'j' are held in \verb'Ai [Ap [j]...Ap [j+1]-1]', +and the corresponding numerical values are in the same locations in \verb'Ax'. + +The same matrix from Equation~\ref{eqn:Aexample} in +the last section (repeated here): + + \begin{equation} + A = \left[ + \begin{array}{cccc} + 4.5 & 0 & 3.2 & 0 \\ + 3.1 & 2.9 & 0 & 0.9 \\ + 0 & 1.7 & 3.0 & 0 \\ + 3.5 & 0.4 & 0 & 1.0 \\ + \end{array} + \right] + \end{equation} + +is held in CSC form as follows: + +{\footnotesize +\begin{verbatim} + integer Ap [ ] = { 0, 3, 6, 8, 10 } ; + integer Ai [ ] = { 0, 1, 3, 1, 2, 3, 0, 2, 1, 3 } ; + double Ax [ ] = { 4.5, 3.1, 3.5, 2.9, 1.7, 0.4, 3.2, 3.0, 0.9, 1.0 } ; \end{verbatim} } + +That is, the row indices of column 1 (the second column) are in +\verb'Ai [3..5]', and the values in the same place in \verb'Ax', +since \verb'Ap [1] = 3' and \verb'Ap [2]-1 = 5'. + +To iterate over the columns and entries of this matrix, the following code can +be used (assuming it has type \verb'GrB_FP64'): + + {\footnotesize + \begin{verbatim} + integer nvals = Ap [ncols] ; + for (integer j = 0 ; j < ncols ; j++) + { + // get A(:,j) + for (integer p = Ap [j] ; p < Ap [j+1] ; p++) + { + // get A(i,j) + integer i = Ai [p] ; // row index + double aij = Ax [iso ? 0 : p] ; // numerical value + } + } \end{verbatim}} + +In the container, the three arrays \verb'Ap', \verb'Ai' and \verb'Ax' +are held in three \verb'GrB_Vector' objects: +\verb'Container->p', +\verb'Container->i', and +\verb'Container->x', respectively. + +%------------------------------------------------------------------------------- +\subsubsection{Hypersparse, held by row} +%------------------------------------------------------------------------------- +\label{format_hypersparse_by_row} + +The hypersparse HyperCSR format is identical to the CSR format, except that the +\verb'Ap' array itself becomes sparse, if the matrix has rows that are +completely empty. An array \verb'Ah' of size \verb'nvec' provides a list of +rows that appear in the data structure. For example, consider +Equation~\ref{eqn:Ahyper}, which is a sparser version of the matrix in +Equation~\ref{eqn:Aexample}. Row 2 and column 1 of this matrix are all empty. + + \begin{equation} + \label{eqn:Ahyper} + A = \left[ + \begin{array}{cccc} + 4.5 & 0 & 3.2 & 0 \\ + 3.1 & 0 & 0 & 0.9 \\ + 0 & 0 & 0 & 0 \\ + 3.5 & 0 & 0 & 1.0 \\ + \end{array} + \right] + \end{equation} + +The conventional CSR format would appear as follows. Since the third row (row +2) is all zero, accessing \verb'Ai [Ap [2] ... Ap [3]-1]' gives an empty set +(\verb'[2..1]'), and the number of entries in this row is +\verb'Ap [i+1] - Ap [i]' \verb'= Ap [3] - Ap [2] = 0'. + +{\footnotesize +\begin{verbatim} + integer Ap [ ] = { 0, 2,2, 4, 5 } ; + integer Aj [ ] = { 0, 2, 0, 3, 0 3 } + double Ax [ ] = { 4.5, 3.2, 3.1, 0.9, 3.5, 1.0 } ; \end{verbatim} } + +A hypersparse CSR format for this same matrix would discard +these duplicate integers in \verb'Ap'. Doing so requires +another array, \verb'Ah', that keeps track of the rows that appear +in the data structure. + +{\footnotesize +\begin{verbatim} + integer nvec = 3 ; + integer Ah [ ] = { 0, 1, 3 } ; + integer Ap [ ] = { 0, 2, 4, 5 } ; + integer Aj [ ] = { 0, 2, 0, 3, 0 3 } + double Ax [ ] = { 4.5, 3.2, 3.1, 0.9, 3.5, 1.0 } ; \end{verbatim} } + +Note that the \verb'Aj' and \verb'Ax' arrays are the same in the CSR and +HyperCSR formats. If \verb'jumbled' is false, the row indices in \verb'Ah' +must appear in ascending order, and no duplicates can appear. To iterate over +this data structure (assuming it has type \verb'GrB_FP64'): + + {\footnotesize + \begin{verbatim} + integer nvals = Ap [nvec] ; + for (integer k = 0 ; k < nvec ; k++) + { + integer i = Ah [k] ; // row index + // get A(i,:) + for (integer p = Ap [k] ; p < Ap [k+1] ; p++) + { + // get A(i,j) + integer j = Aj [p] ; // column index + double aij = Ax [iso ? 0 : p] ; // numerical value + } + } \end{verbatim}} + +\vspace{-0.05in} +This is more complex than the CSR format, but it requires at most +$O(e)$ space, where $A$ is $m$-by-$n$ with $e$ = \verb'nvals' entries. The +CSR format requires $O(m+e)$ space. If $e << m$, then the size $m+1$ +of \verb'Ap' can dominate the memory required. In the hypersparse form, +\verb'Ap' takes on size \verb'nvec+1', and \verb'Ah' has size \verb'nvec', +where \verb'nvec' is the number of rows that appear in the data structure. +The CSR format can be viewed as a dense array (of size \verb'nrows') +of sparse row vectors. By contrast, the hypersparse CSR format is a sparse +array (of size \verb'nvec') of sparse row vectors. + +In the container, the four arrays \verb'Ap', \verb'Ah', \verb'Aj' and \verb'Ax' +are held in four \verb'GrB_Vector' objects: +\verb'Container->p', +\verb'Container->h', +\verb'Container->i', and \newline +\verb'Container->x', respectively. + +In addition, the container may hold an optional optimization structure, +\verb'Container->Y', called the hyper-hash. This is a \verb'GrB_Matrix' that +holds the inverse of the \verb'Container->h' array (called \verb'Y' because it +looks like an upside-down \verb'h'). If a matrix is being loaded from raw +data, the hyper-hash is not yet constructed, so the \verb'Container->Y' matrix +should be set to \verb'NULL'. GraphBLAS will compute it when needed. + +When a matrix is unload into a container, GraphBLAS will place the hyper-hash +matrix there if it has been computed. If the matrix is subsequently loaded +from the container, and \verb'Container->h' is unchanged, then leaving the +hyper-hash unmodified will preserve this optional optimization data structure. +If instead \verb'Container->h' is revised, the hyper-hash in +\verb'Container->Y' must be freed (or at least removed from the container) when +the matrix is loaded from the container.. + +A \verb'GrB_Vector' is never held in hypersparse format. + +%------------------------------------------------------------------------------- +\subsubsection{Hypersparse, held by column} +%------------------------------------------------------------------------------- +\label{format_hypersparse_by_col} + +The hypersparse-by-column format is the transpose of the hypersparse-by-row format. +The \verb'Container->format' is \verb'GxB_HYPERSPARSE' and the \newline +\verb'Container->orientation' is \verb'GrB_COLMAJOR'. +In the container, the four arrays \verb'Ap', \verb'Ah', \verb'Ai' and \verb'Ax' +are held in four \verb'GrB_Vector' objects: +\verb'Container->p', +\verb'Container->h', +\verb'Container->i', and +\verb'Container->x', respectively. +A \verb'GrB_Vector' is never held in hypersparse format. + +%------------------------------------------------------------------------------- +\subsubsection{Bitmap, held by row} +%------------------------------------------------------------------------------- +\label{format_bitmap_by_row} + +The \verb'Container->format' is \verb'GxB_BITMAP' and the +\verb'Container->orientation' is \verb'GrB_ROWMAJOR'. +This format requires two arrays, \verb'Ab' and \verb'Ax', each of which are +size \verb'nrows*ncols'. They correspond to \verb'Container->b' and +\verb'Container->x' in the \verb'GxB_Container' object. These arrays define +the pattern and values of the matrix \verb'A': + +\begin{itemize} +\item \verb'int8_t Ab [nrows*ncols] ;' The \verb'Ab' array defines which +entries of \verb'A' are present. If \verb'Ab[i*ncols+j]=1', then the entry +$A(i,j)$ is present, with value \verb'Ax[i*ncols+j]'. If +\verb'Ab[i*ncols+j]=0', then the entry $A(i,j)$ is not present. The \verb'Ab' +array must contain only 0s and 1s. The \verb'nvals' input must exactly match +the number of 1s in the \verb'Ab' array. +\item \verb'type Ax [nrows*ncols] ;' The \verb'Ax' array defines the values of +entries in the matrix. If \verb'Ab[p]' is zero, the value of \verb'Ax[p]' is +ignored. If the matrix is iso-valued, \verb'Ax' has size 1. +\end{itemize} + +%------------------------------------------------------------------------------- +\subsubsection{Bitmap, held by column} +%------------------------------------------------------------------------------- +\label{format_bitmap_by_col} + +This is the transpose of the bitmap-by-row format. +The \verb'Container->format' is \verb'GxB_BITMAP' and the +\verb'Container->orientation' is \verb'GrB_COLMAJOR'. +The value of the entry $A(i,j)$ is held in \verb'Ax [i+j*nrows]', or +in \verb'Ax[0]' if the matrix is iso-valued. +It is present if \verb'Ab [i+j*nrows]' is 1, and not present if zero. + +%------------------------------------------------------------------------------- +\subsubsection{Full, held by row} +%------------------------------------------------------------------------------- +\label{format_full_by_row} + +The \verb'Container->format' is \verb'GxB_FULL' and the +\verb'Container->orientation' is \verb'GrB_ROWMAJOR'. This format is held in a +single \verb'GrB_Vector', \verb'Container->x'. The $A(i,j)$ entry is in +position \verb'i*ncols+j' in this array, or in position 0 if the matrix is +iso-valued. All entries are present. + +%------------------------------------------------------------------------------- +\subsubsection{Full, held by column} +%------------------------------------------------------------------------------- +\label{format_full_by_col} + +This is the transpose of the full-by-row format. +The \verb'Container->format' is \verb'GxB_FULL' and the +\verb'Container->orientation' is \verb'GrB_COLMAJOR'. This format is held in a +single \verb'GrB_Vector', \verb'Container->x'. The $A(i,j)$ entry is in +position \verb'i+j*nrows' in this array, or in position 0 if the matrix is +iso-valued. All entries are present. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_free.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_free.tex new file mode 100644 index 0000000000..3e89bd3221 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_free.tex @@ -0,0 +1,41 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_free:} free any GraphBLAS object} %======================= +%=============================================================================== +\label{free} + +Each of the ten objects has \verb'GrB_*_new' and \verb'GrB_*_free' methods +that are specific to each object. They can also be accessed by a generic +function, \verb'GrB_free', that works for all ten objects. If \verb'G' is any +of the ten objects, the statement + + {\footnotesize + \begin{verbatim} + GrB_free (&G) ; \end{verbatim} } + +\noindent +frees the object and sets the variable \verb'G' to \verb'NULL'. It is safe to +pass in a \verb'NULL' handle, or to free an object twice: + + {\footnotesize + \begin{verbatim} + GrB_free (NULL) ; // SuiteSparse:GraphBLAS safely does nothing + GrB_free (&G) ; // the object G is freed and G set to NULL + GrB_free (&G) ; // SuiteSparse:GraphBLAS safely does nothing \end{verbatim} } + +\noindent +However, the following sequence of operations is not safe. The first two are +valid but the last statement will lead to undefined behavior. + + {\footnotesize + \begin{verbatim} + H = G ; // valid; creates a 2nd handle of the same object + GrB_free (&G) ; // valid; G is freed and set to NULL; H now undefined + GrB_some_method (H) ; // not valid; H is undefined \end{verbatim}} + +Some objects are predefined, such as the built-in types. If a user application +attempts to free a built-in object, SuiteSparse:GraphBLAS will safely do +nothing. The \verb'GrB_free' function in SuiteSparse:GraphBLAS always +returns \verb'GrB_SUCCESS'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_import.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_import.tex new file mode 100644 index 0000000000..e0f66d399f --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_import.tex @@ -0,0 +1,228 @@ + +\newpage +%=============================================================================== +\subsection{GraphBLAS import/export: using copy semantics} %==================== +%=============================================================================== +\label{GrB_import_export} + +The v2.0 C API includes import/export methods for matrices (not vectors) using +a different strategy as compared to the \verb'GxB_Container' methods. The +\verb'GxB_Container' methods are based on {\em move semantics}, in which +ownership of arrays is passed between SuiteSparse:GraphBLAS and the user +application. This allows the \verb'GxB_Container' methods to work in $O(1)$ +time, and require no additional memory, but it requires that GraphBLAS and the +user application agree on which memory manager to use. This is done via +\verb'GxB_init'. This allows GraphBLAS to \verb'malloc' an array that can be +later \verb'free'd by the user application, and visa versa. + +The \verb'GrB' import/export methods take a different approach. The data +is always copied in and out between the opaque GraphBLAS matrix and the +user arrays. This takes $\Omega(e)$ time, if the matrix has $e$ entries, +and requires more memory. It has the advantage that it does not require +GraphBLAS and the user application to agree on what memory manager to use, +since no ownership of allocated arrays is changed. + +The format for \verb'GrB_Matrix_import' and \verb'GrB_Matrix_export' is +controlled by the following enum: + +{\footnotesize +\begin{verbatim} +typedef enum +{ + GrB_CSR_FORMAT = 0, // CSR format (equiv to GxB_SPARSE with GrB_ROWMAJOR) + GrB_CSC_FORMAT = 1, // CSC format (equiv to GxB_SPARSE with GrB_COLMAJOR) + GrB_COO_FORMAT = 2 // triplet format (like input to GrB*build) +} +GrB_Format ; \end{verbatim}} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_import:} import a matrix} +%------------------------------------------------------------------------------- +\label{GrB_matrix_import} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_import // import a matrix +( + GrB_Matrix *A, // handle of matrix to create + GrB_Type type, // type of matrix to create + GrB_Index nrows, // number of rows of the matrix + GrB_Index ncols, // number of columns of the matrix + const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO + const GrB_Index *Ai, // row indices for CSR, CSC + const *Ax, // values + GrB_Index Ap_len, // number of entries in Ap (not # of bytes) + GrB_Index Ai_len, // number of entries in Ai (not # of bytes) + GrB_Index Ax_len, // number of entries in Ax (not # of bytes) + int format // import format (GrB_Format) +) ; +\end{verbatim} +} \end{mdframed} + +The \verb'GrB_Matrix_import' method copies from user-provided arrays into an +opaque \verb'GrB_Matrix' and \verb'GrB_Matrix_export' copies data out, from an +opaque \verb'GrB_Matrix' into user-provided arrays. + +The suffix \verb'TYPE' in the prototype above is one of \verb'BOOL', +\verb'INT8', \verb'INT16', etc, for built-n types, or \verb'UDT' for +user-defined types. The type of the \verb'Ax' array must match this type. No +typecasting is performed. + +Unlike the \verb'GxB_Container' methods, memory is not handed off between the +user application and GraphBLAS. The three arrays \verb'Ap', \verb'Ai'. and +\verb'Ax' are not modified, and are still owned by the user application when +the method finishes. + +\verb'GrB_Matrix_import' does not support the creation of matrices with 32-bit +integer indices. + +The matrix can be imported in one of three different formats: + +\begin{packed_itemize} + \item \verb'GrB_CSR_FORMAT': % CSR format (equiv to GxB_SPARSE with GrB_ROWMAJOR) + Compressed-row format. \verb'Ap' is an array of size \verb'nrows+1'. + The arrays \verb'Ai' and \verb'Ax' are of size \verb'nvals = Ap [nrows]', + and \verb'Ap[0]' must be zero. + The column indices of entries in the \verb'i'th row appear in + \verb'Ai[Ap[i]...Ap[i+1]-1]', and the values of those entries appear in + the same locations in \verb'Ax'. + The column indices need not be in any particular order. + See Section~\ref{format_sparse_by_row} for details of the sparse-by-row (CSR) format. + + \item \verb'GrB_CSC_FORMAT': % CSC format (equiv to GxB_SPARSE with GrB_COLMAJOR) + Compressed-column format. \verb'Ap' is an array of size \verb'ncols+1'. + The arrays \verb'Ai' and \verb'Ax' are of size \verb'nvals = Ap [ncols]', + and \verb'Ap[0]' must be zero. + The row indices of entries in the \verb'j'th column appear in + \verb'Ai[Ap[j]...Ap[j+1]-1]', and the values of those entries appear in + the same locations in \verb'Ax'. + The row indices need not be in any particular order. + See Section~\ref{format_sparse_by_col} for details of the sparse-by-column (CSC) format. + + \item \verb'GrB_COO_FORMAT': % triplet format (like input to GrB*build) + Coordinate format. This is the same format as the \verb'I', \verb'J', + \verb'X' inputs to \verb'GrB_Matrix_build'. The three arrays + \verb'Ap', \verb'Ai', and \verb'Ax' have the same size. The \verb'k'th + tuple has row index \verb'Ai[k]', column index \verb'Ap[k]', and value + \verb'Ax[k]'. The tuples can appear any order, but no duplicates are + permitted. + +% \item \verb'GrB_DENSE_ROW_FORMAT': % FullR format (GxB_FULL with GrB_ROWMAJOR) +% Dense matrix format, held by row. Only the \verb'Ax' array is used, of +% size \verb'nrows*ncols'. +% It holds the matrix in dense format, in row major order. +% +% \item \verb'GrB_DENSE_COL_FORMAT': % FullC format (GxB_FULL with GrB_ROWMAJOR) +% Dense matrix format, held by column. Only the \verb'Ax' array is used, of +% size \verb'nrows*ncols'. +% It holds the matrix in dense format, in column major order. + +\end{packed_itemize} + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_export:} export a matrix} +%------------------------------------------------------------------------------- +\label{GrB_matrix_export} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_export // export a matrix +( + GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO + GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC + *Ax, // values (must match the type of A_input) + GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) + GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) + GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) + int format, // export format (GrB_Format) + GrB_Matrix A // matrix to export +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Matrix_export' copies the contents of a matrix into three +user-provided arrays, using any one of the three different formats +described in Section~\ref{GrB_matrix_import}. The size of the arrays must be +at least as large as the lengths returned by \verb'GrB_Matrix_exportSize'. The +matrix \verb'A' is not modified. + +On input, the size of the three arrays \verb'Ap', \verb'Ai', and \verb'Ax' is +given by \verb'Ap_len', \verb'Ai_len', and \verb'Ax_len', respectively. These +values are in terms of the number of entries in these arrays, not the number of +bytes. On output, these three value are adjusted to report the number of +entries written to the three arrays. + +The suffix \verb'TYPE' in the prototype above is one of \verb'BOOL', +\verb'INT8', \verb'INT16', etc, for built-n types, or \verb'UDT' for +user-defined types. The type of the \verb'Ax' array must match this type. No +typecasting is performed. + +\verb'GrB_Matrix_export' always exports the indices and offsets of the matrix +using 64-bit integer indices, even if they are held internally using 32-bit +integers. + +% The \verb'GrB_DENSE_ROW_FORMAT' and \verb'GrB_DENSE_COL_FORMAT' formats can +% only be used if all entries are present in the matrix. That is, +% \verb'GrB_Matrix_nvals (&nvals,A)' must return \verb'nvals' equal to +% \verb'nrows*ncols'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_exportSize:} determine size of export} +%------------------------------------------------------------------------------- +\label{export_size} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export +( + GrB_Index *Ap_len, // # of entries required for Ap (not # of bytes) + GrB_Index *Ai_len, // # of entries required for Ai (not # of bytes) + GrB_Index *Ax_len, // # of entries required for Ax (not # of bytes) + int format, // export format (GrB_Format) + GrB_Matrix A // matrix to export +) ; +\end{verbatim} +} \end{mdframed} + +Returns the required sizes of the arrays \verb'Ap', \verb'Ai', and \verb'Ax' +for exporting a matrix using \verb'GrB_Matrix_export', using the same +\verb'format'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_exportHint:} determine best export format} +%------------------------------------------------------------------------------- +\label{export_hint} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_Matrix_exportHint // suggest the best export format +( + int *format, // export format (GrB_Format) + GrB_Matrix A // matrix to export +) ; +\end{verbatim} +} \end{mdframed} + +This method suggests the most efficient format for the export of a given +matrix. For SuiteSparse:GraphBLAS, the hint depends on the current +format of the \verb'GrB_Matrix': + +\begin{packed_itemize} +\item \verb'GxB_SPARSE', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' +\item \verb'GxB_SPARSE', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' +\item \verb'GxB_HYPERSPARSE': export as \verb'GrB_COO_FORMAT' +\item \verb'GxB_BITMAP', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' +\item \verb'GxB_BITMAP', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' +%\item \verb'GxB_FULL', \verb'GrB_ROWMAJOR': export as \verb'GrB_DENSE_ROW_FORMAT' +%\item \verb'GxB_FULL', \verb'GrB_COLMAJOR': export as \verb'GrB_DENSE_COL_FORMAT' +\item \verb'GxB_FULL', \verb'GrB_ROWMAJOR': export as \verb'GrB_CSR_FORMAT' +\item \verb'GxB_FULL', \verb'GrB_COLMAJOR': export as \verb'GrB_CSC_FORMAT' +\end{packed_itemize} + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_objects_sort.tex b/GraphBLAS/Doc/UserGuide/GrB_objects_sort.tex new file mode 100644 index 0000000000..792b1ae98e --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_objects_sort.tex @@ -0,0 +1,100 @@ + + +\newpage +%=============================================================================== +\subsection{Sorting methods} +%=============================================================================== +\label{sorting_methods} + +\verb'GxB_Matrix_sort' provides a mechanism to sort all the rows or +all the columns of a matrix, and \verb'GxB_Vector_sort' sorts all the +entries in a vector. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_sort:} sort a vector} +%------------------------------------------------------------------------------- +\label{vector_sort} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_sort +( + // output: + GrB_Vector w, // vector of sorted values + GrB_Vector p, // vector containing the permutation + // input + GrB_BinaryOp op, // comparator op + GrB_Vector u, // vector to sort + const GrB_Descriptor desc +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Vector_sort' is identical to sorting the single column of an +\verb'n'-by-1 matrix. +Refer to Section \ref{matrix_sort} for details. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_sort:} sort the rows/columns of a matrix} +%------------------------------------------------------------------------------- +\label{matrix_sort} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_sort +( + // output: + GrB_Matrix C, // matrix of sorted values + GrB_Matrix P, // matrix containing the permutations + // input + GrB_BinaryOp op, // comparator op + GrB_Matrix A, // matrix to sort + const GrB_Descriptor desc +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GxB_Matrix_sort' sorts all the rows or all the columns of a matrix. +Each row (or column) is sorted separately. The rows are sorted by default. +To sort the columns, use \verb'GrB_DESC_T0'. A comparator operator is +provided to define the sorting order (ascending or descending). +For example, to sort a \verb'GrB_FP64' matrix in ascending order, +use \verb'GrB_LT_FP64' as the \verb'op', and to sort in descending order, +use \verb'GrB_GT_FP64'. + +The \verb'op' must have a return value of \verb'GrB_BOOL', and the types of +its two inputs must be the same. The entries in \verb'A' are typecasted to +the inputs of the \verb'op', if necessary. Matrices with user-defined types +can be sorted with a user-defined comparator operator, whose two input types +must match the type of \verb'A', and whose output is \verb'GrB_BOOL'. + +The two matrix outputs are \verb'C' and \verb'P'. Any entries present on input +in \verb'C' or \verb'P' are discarded on output. The type of \verb'C' must +match the type of \verb'A' exactly. The dimensions of \verb'C', \verb'P', and +\verb'A' must also match exactly (even with the \verb'GrB_DESC_T0' +descriptor). + +With the default sort (by row), suppose \verb'A(i,:)' contains \verb'k' +entries. In this case, \verb'C(i,0:k-1)' contains the values of those entries +in sorted order, and \verb'P(i,0:k-1)' contains their corresponding column +indices in the matrix \verb'A'. If two values are the same, ties are broken +according column index. + +If the matrix is sorted by column, and \verb'A(:,j)' contains \verb'k' entries, +then \verb'C(0:k-1,j)' contains the values of those entries in sorted order, +and \verb'P(0:k-1,j)' contains their corresponding row indices in the matrix +\verb'A'. If two values are the same, ties are broken according row index. + +The outputs \verb'C' and \verb'P' are both optional; either one (but not both) +may be \verb'NULL', in which case that particular output matrix is not +computed. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations.tex b/GraphBLAS/Doc/UserGuide/GrB_operations.tex new file mode 100644 index 0000000000..4cafb50c40 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations.tex @@ -0,0 +1,83 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{GraphBLAS Operations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{operations} + +The next sections define each of the GraphBLAS operations, also listed in the +table below. + +\vspace{0.2in} +{\small +\begin{tabular}{lll} +\hline +\verb'GrB_mxm' & matrix-matrix multiply & ${\bf C \langle M \rangle = C \odot AB}$ \\ +\verb'GrB_vxm' & vector-matrix multiply & ${\bf w^{\sf T}\langle m^{\sf T}\rangle = w^{\sf T}\odot u^{\sf T}A}$ \\ +\verb'GrB_mxv' & matrix-vector multiply & ${\bf w \langle m \rangle = w \odot Au}$ \\ +\hline +\verb'GrB_eWiseMult' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \otimes B)}$ \\ + & set intersection & ${\bf w \langle m \rangle = w \odot (u \otimes v)}$ \\ +\hline +\verb'GrB_eWiseAdd' & element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ + & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ +\hline +\verb'GxB_eWiseUnion'& element-wise, & ${\bf C \langle M \rangle = C \odot (A \oplus B)}$ \\ + & set union & ${\bf w \langle m \rangle = w \odot (u \oplus v)}$ \\ +\hline +\verb'GrB_extract' & extract submatrix & ${\bf C \langle M \rangle = C \odot A(I,J)}$ \\ + & & ${\bf w \langle m \rangle = w \odot u(i)}$ \\ +\hline +\verb'GrB_assign' & assign submatrix & ${\bf C \langle M \rangle (I,J) = C(I,J) \odot A}$ \\ + & with submask for ${\bf C}$ + & ${\bf w \langle m \rangle (i) = w(i) \odot u}$ \\ +\hline +\verb'GxB_subassign' & assign submatrix, & ${\bf C (I,J) \langle M \rangle = C(I,J) \odot A}$ \\ + & with submask for ${\bf C(I,J)}$ + & ${\bf w (i) \langle m \rangle = w(i) \odot u}$ \\ +\hline +\verb'GrB_apply' & apply unary operator & ${\bf C \langle M \rangle = C \odot} f{\bf (A)}$ \\ + & & ${\bf w \langle m \rangle = w \odot} f{\bf (u)}$ \\ + & apply binary operator & ${\bf C \langle M \rangle = C \odot} f(x,{\bf A})$ \\ + & & ${\bf C \langle M \rangle = C \odot} f({\bf A},y)$ \\ + & & ${\bf w \langle m \rangle = w \odot} f(x,{\bf x})$ \\ + & & ${\bf w \langle m \rangle = w \odot} f({\bf u},y)$ \\ + & apply index-unary op & ${\bf C \langle M \rangle = C \odot} f({\bf A},i,j,k)$ \\ + & & ${\bf w \langle m \rangle = w \odot} f({\bf u},i,0,k)$ \\ +\hline +\verb'GrB_select' & select entries & ${\bf C \langle M \rangle = C \odot} \mbox{select}({\bf A},i,j,k)$ \\ + & & ${\bf w \langle m \rangle = w \odot} \mbox{select}({\bf u},i,0,k)$ \\ +\hline +\verb'GrB_reduce' & reduce to vector & ${\bf w \langle m \rangle = w \odot} [{\oplus}_j {\bf A}(:,j)]$ \\ + & reduce to scalar & $s = s \odot [{\oplus}_{ij} {\bf A}(I,J)]$ \\ +\hline +\verb'GrB_transpose' & transpose & ${\bf C \langle M \rangle = C \odot A^{\sf T}}$ \\ +\hline +\verb'GrB_kronecker' & Kronecker product & ${\bf C \langle M \rangle = C \odot \mbox{kron}(A, B)}$ \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +If an error occurs, \verb'GrB_error(&err,C)' or \verb'GrB_error(&err,w)' +returns details about the error, for operations that return a modified matrix +\verb'C' or vector \verb'w'. The only operation that cannot return an error +string is reduction to a C scalar with \verb'GrB_reduce'. + +\input{UserGuide/GrB_operations_mxm.tex} +\input{UserGuide/GrB_operations_vxm.tex} +\input{UserGuide/GrB_operations_mxv.tex} +\input{UserGuide/GrB_operations_eWiseMult.tex} +\input{UserGuide/GrB_operations_eWiseAdd.tex} +\input{UserGuide/GrB_operations_eWiseUnion.tex} +\input{UserGuide/GrB_operations_extract.tex} +\input{UserGuide/GrB_operations_assign.tex} +\input{UserGuide/GrB_operations_subassign.tex} +\input{UserGuide/GrB_operations_assign_duplicates.tex} +\input{UserGuide/GrB_operations_assign_vs_subassign.tex} +\input{UserGuide/GrB_operations_apply.tex} +\input{UserGuide/GrB_operations_select.tex} +\input{UserGuide/GrB_operations_reduce.tex} +\input{UserGuide/GrB_operations_transpose.tex} +\input{UserGuide/GrB_operations_kronecker.tex} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_apply.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_apply.tex new file mode 100644 index 0000000000..c677be5505 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_apply.tex @@ -0,0 +1,312 @@ + + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_apply:} apply a unary, binary, or index-unary operator} +%=============================================================================== +\label{apply} + +\verb'GrB_apply' is the generic name for 92 specific functions: + +\begin{packed_itemize} +\item +\verb'GrB_Vector_apply' and \verb'GrB_Matrix_apply' apply a unary operator to +the entries of a matrix (two variants). + +\item \verb'GrB_*_apply_BinaryOp1st_*' applies a binary +operator where a single scalar is provided as the $x$ input to the binary +operator. +There are 30 variants, depending on the type of the scalar: (matrix or vector) +x (13 built-in types, one for user-defined types, and a version for +\verb'GrB_Scalar'). + +\item \verb'GrB_*_apply_BinaryOp2nd_*' applies a binary operator where a +single scalar is provided as the $y$ input to the binary operator. +There are 30 variants, depending on the type of the scalar: (matrix or vector) +x (13 built-in types, one for user-defined types, and a version for +\verb'GrB_Scalar'). + +\item \verb'GrB_*_apply_IndexOp_*' applies a \verb'GrB_IndexUnaryOp', +single scalar is provided as the scalar $y$ input to the index-unary operator. +There are 30 variants, depending on the type of the scalar: (matrix or vector) +x (13 built-in types, one for user-defined types, and a version for +\verb'GrB_Scalar'). + +\end{packed_itemize} + +The generic +name appears in the function prototypes, but the specific function name is used +when describing each variation. When discussing features that apply to all +versions, the simple name \verb'GrB_apply' is used. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_apply:} apply a unary operator to a vector} +%------------------------------------------------------------------------------- +\label{apply_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // w = accum (w, op(u)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_apply' applies a unary operator to the entries of a vector, +analogous to \verb't = op(u)' in MATLAB except the operator \verb'op' is only +applied to entries in the pattern of \verb'u'. Implicit values outside the +pattern of \verb'u' are not affected. The entries in \verb'u' are typecasted +into the \verb'xtype' of the unary operator. The vector \verb't' has the same +type as the \verb'ztype' of the unary operator. The final step is ${\bf w +\langle m \rangle = w \odot t}$, as described in Section~\ref{accummask}, +except that all the terms are column vectors instead of matrices. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_apply:} apply a unary operator to a matrix} +%------------------------------------------------------------------------------- +\label{apply_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // C = accum (C, op(A)) or op(A') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_apply' +applies a unary operator to the entries of a matrix, analogous to +\verb'T = op(A)' in MATLAB except the operator \verb'op' is only applied to +entries in the pattern of \verb'A'. Implicit values outside the pattern of +\verb'A' are not affected. The input matrix \verb'A' may be transposed first. +The entries in \verb'A' are typecasted into the \verb'xtype' of the unary +operator. The matrix \verb'T' has the same type as the \verb'ztype' of the +unary operator. The final step is ${\bf C \langle M \rangle = C \odot T}$, as +described in Section~\ref{accummask}. + +The built-in \verb'GrB_IDENTITY_'$T$ operators (one for each built-in type $T$) +are very useful when combined with this function, enabling it to compute ${\bf +C \langle M \rangle = C \odot A}$. This makes \verb'GrB_apply' a direct +interface to the accumulator/mask function for both matrices and vectors. +The \verb'GrB_IDENTITY_'$T$ operators also provide the fastest stand-alone +typecasting methods in SuiteSparse:GraphBLAS, with all $13 \times 13=169$ +methods appearing as individual functions, to typecast between any of the 13 +built-in types. + +To compute ${\bf C \langle M \rangle = A}$ or ${\bf C \langle M \rangle = C +\odot A}$ for user-defined types, the user application would need to define an +identity operator for the type. Since GraphBLAS cannot detect that it is an +identity operator, it must call the operator to make the full copy \verb'T=A' +and apply the operator to each entry of the matrix or vector. + +The other GraphBLAS operation that provides a direct interface to the +accumulator/mask function is \verb'GrB_transpose', which does not require an +operator to perform this task. As a result, \verb'GrB_transpose' can be used +as an efficient and direct interface to the accumulator/mask function for +both built-in and user-defined types. However, it is only available for +matrices, not vectors. + +% \newpage +%=============================================================================== +\subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp1st:} apply a binary operator to a vector; 1st scalar binding} +%=============================================================================== +\label{vector_apply1st} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // w = accum (w, op(x,u)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + x, // first input: scalar x + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_apply_BinaryOp1st_' applies a binary operator +$z=f(x,y)$ to a vector, where a scalar $x$ is bound to the first input of the +operator. +The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Vector_apply'. + +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +\newpage +%=============================================================================== +\subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp2nd:} apply a binary operator to a vector; 2nd scalar binding} +%=============================================================================== +\label{vector_apply2nd} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // w = accum (w, op(u,y)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_apply_BinaryOp2nd_' applies a binary operator +$z=f(x,y)$ to a vector, where a scalar $y$ is bound to the second input of the +operator. +The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Vector_apply'. + +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +% \newpage +%=============================================================================== +\subsubsection{{\sf GrB\_Vector\_apply\_IndexOp:} apply an index-unary operator to a vector} +%=============================================================================== +\label{vector_apply_idxunop} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // w = accum (w, op(u,y)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_apply_IndexOp_' applies an index-unary operator +$z=f(x,i,0,y)$ to a vector. +The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Vector_apply'. + +% \newpage +%=============================================================================== +\subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp1st:} apply a binary operator to a matrix; 1st scalar binding} +%=============================================================================== +\label{matrix_apply1st} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // C=accum(C,op(x,A)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + x, // first input: scalar x + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_apply_BinaryOp1st_' applies a binary operator +$z=f(x,y)$ to a matrix, where a scalar $x$ is bound to the first input of the +operator. +The scalar \verb'x' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Matrix_apply'. + +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +% \newpage +%=============================================================================== +\subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp2nd:} apply a binary operator to a matrix; 2nd scalar binding} +%=============================================================================== +\label{matrix_apply2nd} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // C=accum(C,op(A,y)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_apply_BinaryOp2nd_' applies a binary operator +$z=f(x,y)$ to a matrix, where a scalar $x$ is bound to the second input of the +operator. +The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Matrix_apply'. + +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +%=============================================================================== +\subsubsection{{\sf GrB\_Matrix\_apply\_IndexOp:} apply an index-unary operator to a matrix} +%=============================================================================== +\label{matrix_apply_idxunop} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_apply // C=accum(C,op(A,y)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_apply_IndexOp_' applies an index-unary operator +$z=f(x,i,j,y)$ to a matrix. +The scalar \verb'y' can be a non-opaque C scalar corresponding to a built-in +type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. +It is otherwise identical to \verb'GrB_Matrix_apply'. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_assign.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_assign.tex new file mode 100644 index 0000000000..1cdc5a9b13 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_assign.tex @@ -0,0 +1,454 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_assign:} submatrix assignment} %========================== +%=============================================================================== +\label{assign} + +The methods described in this section are all variations of the form +\verb'C(I,J)=A', which modifies a submatrix of the matrix \verb'C'. All +methods can be used in their generic form with the single name +\verb'GrB_assign'. These methods are very similar to their +\verb'GxB_subassign' counterparts in Section~\ref{subassign}. They differ +primarily in the size of the \verb'Mask', and how the \verb'GrB_REPLACE' option +works. Section~\ref{compare_assign} compares +\verb'GxB_subassign' and \verb'GrB_assign'. + +See Section~\ref{colon} for a description of +\verb'I', \verb'ni', \verb'J', and \verb'nj'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_assign:} assign to a subvector } +%------------------------------------------------------------------------------- +\label{assign_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // w(I) = accum (w(I),u) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_assign' operates on a subvector \verb'w(I)' of \verb'w', +modifying it with the vector \verb'u'. The \verb'mask' vector has the same +size as \verb'w'. The method is identical to \verb'GrB_Matrix_assign' +described in Section~\ref{assign_matrix}, where all matrices have a single +column each. The only other difference is that the input \verb'u' in this +method is not transposed via the \verb'GrB_INP0' descriptor. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_assign\_Vector:} assign to a subvector } +%------------------------------------------------------------------------------- +\label{assign_vector_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // w(I) = accum (w(I),u) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_assign_Vector' is identical to \verb'GrB_Vector_assign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_assign:} assign to a submatrix } +%------------------------------------------------------------------------------- +\label{assign_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C, Mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_assign' operates on a submatrix \verb'S' of \verb'C', +modifying it with the matrix \verb'A'. It may also modify all of \verb'C', +depending on the input descriptor \verb'desc' and the \verb'Mask'. + +\vspace{0.1in} +\begin{tabular}{lll} +\hline +Step & GraphBLAS & description \\ + & notation & \\ +\hline +1 & ${\bf S} = {\bf C(I,J)}$ & extract ${\bf C(I,J)}$ submatrix \\ +2 & ${\bf S} = {\bf S} \odot {\bf A}$ & apply the accumulator (but not the mask) to ${\bf S}$\\ +3 & ${\bf Z} = {\bf C}$ & make a copy of ${\bf C}$ \\ +4 & ${\bf Z(I,J)} = {\bf S}$ & put the submatrix into ${\bf Z(I,J)}$ \\ +5 & ${\bf C \langle M \rangle = Z}$ & apply the mask/replace phase to all of ${\bf C}$ \\ +\hline +\end{tabular} +\vspace{0.1in} + +In contrast to \verb'GxB_subassign', the \verb'Mask' has the same as \verb'C'. + +Step 1 extracts the submatrix and then Step 2 applies the accumulator +(or ${\bf S}={\bf A}$ if \verb'accum' is \verb'NULL'). The \verb'Mask' is +not yet applied. + +Step 3 makes a copy of the ${\bf C}$ matrix, and then Step 4 writes the +submatrix ${\bf S}$ into ${\bf Z}$. This is the same as Step 3 of +\verb'GxB_subassign', except that it operates on a temporary matrix ${\bf Z}$. + +Finally, Step 5 writes ${\bf Z}$ back into ${\bf C}$ via the \verb'Mask', using +the Mask/Replace Phase described in Section~\ref{accummask}. If +\verb'GrB_REPLACE' is enabled, then all of ${\bf C}$ is cleared prior to +writing ${\bf Z}$ via the mask. As a result, the \verb'GrB_REPLACE' option can +delete entries outside the ${\bf C(I,J)}$ submatrix. + +\paragraph{\bf Performance considerations:} % C(I,J) = A +If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if +the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is +fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true +if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_assign\_Vector:} assign to a submatrix } +%------------------------------------------------------------------------------- +\label{assign_matrix_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_assign_Vector' is identical to \verb'GrB_Matrix_assign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries, and the column indices are given by the \verb'GrB_Vector J' with +\verb'nj' entries. The interpretation of \verb'I_vector' and \verb'J_vector' +are controlled by descriptor setting \verb'GxB_ROWINDEX_LIST' and +\verb'GxB_COLINDEX_LIST', respectively. The method can use either the indices +or values of each of the input vectors, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Col\_assign:} assign to a sub-column of a matrix} +%------------------------------------------------------------------------------- +\label{assign_column} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for C(:,j) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Col_assign' modifies a single sub-column of a matrix \verb'C'. It is +the same as \verb'GrB_Matrix_assign' where the index vector \verb'J[0]=j' is a +single column index, and where all matrices in \verb'GrB_Matrix_assign' (except +\verb'C') consist of a single column. + +Unlike \verb'GrB_Matrix_assign', the \verb'mask' is a vector with the same size +as a single column of \verb'C'. + +The input descriptor \verb'GrB_INP0' is ignored; the input vector \verb'u' is +not transposed. Refer to \verb'GrB_Matrix_assign' for further details. + +\paragraph{\bf Performance considerations:} % C(I,j) = u +\verb'GrB_Col_assign' is much faster than \verb'GrB_Row_assign' if the format +of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GrB_Row_assign' is much faster than +\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GrB_ROWMAJOR'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Col\_assign\_Vector:} assign to a sub-column of a matrix} +%------------------------------------------------------------------------------- +\label{assign_column_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Col_assign_Vector' is identical to \verb'GrB_Col_assign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Row\_assign:} assign to a sub-row of a matrix} +%------------------------------------------------------------------------------- +\label{assign_row} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(i,J) = accum (C(i,J),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + const GrB_Index i, // row index + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(i,:) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Row_assign' modifies a single sub-row of a matrix \verb'C'. It is +the same as \verb'GrB_Matrix_assign' where the index vector \verb'I[0]=i' is +a single row index, and where all matrices in \verb'GrB_Matrix_assign' +(except \verb'C') consist of a single row. + +Unlike \verb'GrB_Matrix_assign', the \verb'mask' is a vector with the same size +as a single row of \verb'C'. + +The input descriptor \verb'GrB_INP0' is ignored; the input vector \verb'u' is +not transposed. Refer to \verb'GrB_Matrix_assign' for further details. + +\paragraph{\bf Performance considerations:} % C(i,J) = u' +\verb'GrB_Col_assign' is much faster than \verb'GrB_Row_assign' if the format +of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GrB_Row_assign' is much faster than +\verb'GrB_Col_assign' if the format of \verb'C' is \verb'GrB_ROWMAJOR'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Row\_assign\_Vector:} assign to a sub-row of a matrix} +%------------------------------------------------------------------------------- +\label{assign_row_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(i,J) = accum (C(i,J),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Row_assign_Vector' is identical to \verb'GrB_Row_assign', +except that the column indices are given by the \verb'GrB_Vector J' with \verb'nj' +entries. The interpretation of \verb'J_vector' is controlled by descriptor +setting \verb'GxB_COLINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_assign\_$<$type$>$:} assign a scalar to a subvector} +%------------------------------------------------------------------------------- +\label{assign_vector_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) + const x, // scalar to assign to w(I) + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_assign_' assigns a single scalar to an entire subvector +of the vector \verb'w'. The operation is exactly like setting a single entry +in an \verb'n'-by-1 matrix, \verb'A(I,0) = x', where the column index for a +vector is implicitly \verb'j=0'. The \verb'mask' vector has the same size as +\verb'w'. +If \verb'x' is a \verb'GrB_Scalar', the nonpolymorphic name of the method is +\verb'GrB_Vector_assign_Scalar'. +For further details of this function, see +\verb'GrB_Matrix_assign_' in the next section +(\ref{assign_matrix_scalar}). +Following the C API Specification, results are well-defined if \verb'I' +contains duplicate indices. Duplicate indices are simply ignored. See +Section~\ref{duplicates} for more details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_assign\_Scalar\_Vector:} assign a scalar to a subvector} +%------------------------------------------------------------------------------- +\label{assign_vector_scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_assign_Scalar_Vector' is identical to \verb'GrB_Vector_assign_Scalar', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_assign\_$<$type$>$:} assign a scalar to a submatrix} +%------------------------------------------------------------------------------- +\label{assign_matrix_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const x, // scalar to assign to C(I,J) + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C and Mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_assign_' assigns a single scalar to an entire +submatrix of \verb'C', like the {\em scalar expansion} \verb'C(I,J)=x' in +MATLAB. The scalar \verb'x' is implicitly expanded into a matrix \verb'A' of +size \verb'ni' by \verb'nj', and then the matrix \verb'A' is assigned to +\verb'C(I,J)' using the same method as in \verb'GrB_Matrix_assign'. Refer +to that function in Section~\ref{assign_matrix} for further details. + +The \verb'Mask' has the same size as \verb'C'. + +For the accumulation step, the scalar \verb'x' is typecasted directly into the +type of \verb'C' when the \verb'accum' operator is not applied to it, or into +the \verb'ytype' of the \verb'accum' operator, if \verb'accum' is not NULL, for +entries that are already present in \verb'C'. + +The \verb' x' notation is otherwise the same as +\verb'GrB_Matrix_setElement' (see Section~\ref{matrix_setElement}). Any value +can be passed to this function and its type will be detected, via the +\verb'_Generic' feature of C11. For a user-defined type, \verb'x' is a +\verb'void *' pointer that points to a memory space holding a single entry of a +scalar that has exactly the same user-defined type as the matrix \verb'C'. +This user-defined type must exactly match the user-defined type of \verb'C' +since no typecasting is done between user-defined types. + +If a \verb'void *' pointer is passed in and the type of the underlying scalar +does not exactly match the user-defined type of \verb'C', then results are +undefined. No error status will be returned since GraphBLAS has no way of +catching this error. + +If \verb'x' is a \verb'GrB_Scalar', the nonpolymorphic name of the method is \newline +\verb'GrB_Matrix_assign_Scalar'. In this case, if \verb'x' has no entry, then +it is implicitly expanded into a matrix \verb'A' of size \verb'ni' by +\verb'nj', with no entries present. + +Following the C API Specification, results are well-defined if \verb'I' or +\verb'J' contain duplicate indices. Duplicate indices are simply ignored. See +Section~\ref{duplicates} for more details. + +\paragraph{\bf Performance considerations:} % C(I,J) = scalar +If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if +the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is +fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true +if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_assign\_Scalar\_Vector:} assign a scalar to a submatrix} +%------------------------------------------------------------------------------- +\label{assign_matrix_scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_assign // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_assign_Scalar_Vector' is identical to \verb'GrB_Matrix_assign_Scalar', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries, and the column indices are given by the \verb'GrB_Vector J' with +\verb'nj' entries. The interpretation of \verb'I_vector' and \verb'J_vector' +are controlled by descriptor setting \verb'GxB_ROWINDEX_LIST' and +\verb'GxB_COLINDEX_LIST', respectively. The method can use either the indices +or values of each of the input vectors, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_assign_duplicates.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_assign_duplicates.tex new file mode 100644 index 0000000000..64cdbd95b0 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_assign_duplicates.tex @@ -0,0 +1,132 @@ + + +\newpage +%=============================================================================== +\subsection{Duplicate indices in {\sf GrB\_assign} and {\sf GxB\_subassign}} +%=============================================================================== +\label{duplicates} + +According to the GraphBLAS C API Specification if the index vectors \verb'I' or +\verb'J' contain duplicate indices, the results are undefined for +\verb'GrB_Matrix_assign', \verb'GrB_Matrix_assign', \verb'GrB_Col_assign', and +\verb'GrB_Row_assign'. Only the scalar assignment operations +(\verb'GrB_Matrix_assign_TYPE' and \verb'GrB_Matrix_assign_TYPE') are +well-defined when duplicates appear in \verb'I' and \verb'J'. In those two +functions, duplicate indices are ignored. + +As an extension to the specification, SuiteSparse:GraphBLAS provides a +definition of how duplicate indices are handled in all cases. If \verb'I' has +duplicate indices, they are ignored and the last unique entry in the list is +used. When no mask and no accumulator is present, the results are identical to +how MATLAB handles duplicate indices in the built-in expression +\verb'C(I,J)=A'. Details of how this is done is shown below. + +{\small +\begin{verbatim} + function C = subassign (C, I, J, A) + % submatrix assignment with pre-sort of I and J; and remove duplicates + + % delete duplicates from I, keeping the last one seen + [I2 I2k] = sort (I) ; + Idupl = [(I2 (1:end-1) == I2 (2:end)), false] ; + I2 = I2 (~Idupl) ; + I2k = I2k (~Idupl) ; + assert (isequal (I2, unique (I))) + + % delete duplicates from J, keeping the last one seen + [J2 J2k] = sort (J) ; + Jdupl = [(J2 (1:end-1) == J2 (2:end)), false] ; + J2 = J2 (~Jdupl) ; + J2k = J2k (~Jdupl) ; + assert (isequal (J2, unique (J))) + + % do the submatrix assignment, with no duplicates in I2 or J2 + C (I2,J2) = A (I2k,J2k) ; +\end{verbatim}} + +If a mask is present, then it is replaced with \verb'M = M (I2k, J2k)' for +\verb'GxB_subassign', or with \verb'M = M (I2, J2)' for \verb'GrB_assign'. +If an accumulator operator is present, it is applied after the duplicates +are removed, as (for example): + +{\small +\begin{verbatim} + C (I2,J2) = C (I2,J2) + A (I2k,J2k) ; +\end{verbatim}} + +These definitions allow the MATLAB/Octave interface to GraphBLAS to return the same +results for \verb'C(I,J)=A' for a \verb'GrB' object as they do for built-in +MATLAB/Octave matrices. They also allow the assignment to be done in parallel. + +Results are always well-defined in SuiteSparse:GraphBLAS, but they might not be +what you expect. For example, suppose the \verb'MIN' operator is being used +the following assigment to the vector \verb'x', and suppose \verb'I' contains +the entries \verb'[0 0]'. Suppose \verb'x' is initially empty, of length 1, +and suppose \verb'y' is a vector of length 2 with the values \verb'[5 7]'. + +{\small +\begin{verbatim} + #include "GraphBLAS.h" + #undef I /* complex.h #define's I, but I is used an array below */ + #include + int main (void) + { + GrB_init (GrB_NONBLOCKING) ; + GrB_Vector x, y ; + GrB_Vector_new (&x, GrB_INT32, 1) ; + GrB_Vector_new (&y, GrB_INT32, 2) ; + GrB_Index I [2] = {0, 0} ; + GrB_Vector_setElement (y, 5, 0) ; + GrB_Vector_setElement (y, 7, 1) ; + GrB_Vector_wait (&y) ; + GxB_print (x, 3) ; + GxB_print (y, 3) ; + GrB_assign (x, NULL, GrB_MIN_INT32, y, I, 2, NULL) ; + GrB_Vector_wait (&y) ; + GxB_print (x, 3) ; + GrB_finalize ( ) ; + } +\end{verbatim}} + +You might (wrongly) expect the result to be the vector \verb'x(0)=5', since +two entries seem to be assigned, and the min operator might be expected to +take the minimum of the two. This is not how SuiteSparse:GraphBLAS handles +duplicates. + +Instead, the first duplicate index of \verb'I' is discarded +(\verb'I [0] = 0', and \verb'y(0)=5'). +and only the second entry is used +(\verb'I [1] = 0', and \verb'y(1)=7'). +The output of the above program is: + +{\small +\begin{verbatim} + + 1x1 GraphBLAS int32_t vector, sparse by col: + x, no entries + + + 2x1 GraphBLAS int32_t vector, sparse by col: + y, 2 entries + + (0,0) 5 + (1,0) 7 + + + 1x1 GraphBLAS int32_t vector, sparse by col: + x, 1 entry + + (0,0) 7 + +\end{verbatim}} + +You see that the result is \verb'x(0)=7', since the \verb'y(0)=5' entry +has been ignored because of the duplicate indices in \verb'I'. + +\begin{alert} +{\bf SPEC:} Providing a well-defined behavior for duplicate indices with matrix +and vector assignment is an extension to the specification. The specification +only defines the behavior when assigning a scalar into a matrix or vector, and +states that duplicate indices otherwise lead to undefined results. +\end{alert} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_assign_vs_subassign.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_assign_vs_subassign.tex new file mode 100644 index 0000000000..bf83aecd7b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_assign_vs_subassign.tex @@ -0,0 +1,456 @@ + +\newpage +%=============================================================================== +\subsection{Comparing {\sf GrB\_assign} and {\sf GxB\_subassign}} %============= +%=============================================================================== +\label{compare_assign} + +The \verb'GxB_subassign' and \verb'GrB_assign' operations are very similar, but +they differ in two ways: + +\begin{enumerate} +\item {\bf The Mask has a different size:} + The mask in \verb'GxB_subassign' has the same dimensions as \verb'w(I)' for + vectors and \verb'C(I,J)' for matrices. In \verb'GrB_assign', the mask is + the same size as \verb'w' or \verb'C', respectively (except for the row/col + variants). The two masks are related. If \verb'M' is the mask for + \verb'GrB_assign', then \verb'M(I,J)' is the mask for \verb'GxB_subassign'. + If there is no mask, or if \verb'I' and \verb'J' are both \verb'GrB_ALL', + the two masks are the same. + For \verb'GrB_Row_assign' and \verb'GrB_Col_assign', the \verb'mask' vector + is the same size as a row or column of \verb'C', respectively. For the + corresponding \verb'GxB_Row_subassign' and \verb'GxB_Col_subassign' + operations, the \verb'mask' is the same size as the sub-row \verb'C(i,J)' or + subcolumn \verb'C(I,j)', respectively. + +\item {\bf \verb'GrB_REPLACE' is different:} + They differ in how \verb'C' is affected in areas outside the \verb'C(I,J)' + submatrix. In \verb'GxB_subassign', the \verb'C(I,J)' submatrix is the + only part of \verb'C' that can be modified, and no part of \verb'C' outside + the submatrix is ever modified. In \verb'GrB_assign', it is possible to + delete entries in \verb'C' outside the submatrix, but only in one specific + manner. Suppose the mask \verb'M' is present (or, suppose it is not + present but \verb'GrB_COMP' is true). After (optionally) complementing the + mask, the value of \verb'M(i,j)' can be 0 for some entry outside the + \verb'C(I,J)' submatrix. If the \verb'GrB_REPLACE' descriptor is + true, \verb'GrB_assign' deletes this entry. + +\end{enumerate} + +\verb'GxB_subassign' and \verb'GrB_assign' are identical if \verb'GrB_REPLACE' +is set to its default value of false, and if the masks happen to be the same. +The two masks can be the same in two cases: either the \verb'Mask' input is +\verb'NULL' (and it is not complemented via \verb'GrB_COMP'), or \verb'I' and +\verb'J' are both \verb'GrB_ALL'. +If all these conditions hold, +the two algorithms are identical and have the same performance. Otherwise, +\verb'GxB_subassign' is much faster than \verb'GrB_assign' when the latter +must examine the entire matrix \verb'C' to delete entries (when +\verb'GrB_REPLACE' is true), and if it must deal with a much larger \verb'Mask' +matrix. However, both methods have specific uses. + +Consider using \verb'C(I,J)+=F' for many submatrices \verb'F' (for example, +when assembling a finite-element matrix). If the \verb'Mask' is meant as a +specification for which entries of \verb'C' should appear in the final result, +then use \verb'GrB_assign'. + +If instead the \verb'Mask' is meant to control which entries of the submatrix +\verb'C(I,J)' are modified by the finite-element \verb'F', then use +\verb'GxB_subassign'. This is particularly useful is the \verb'Mask' is a +template that follows along with the finite-element \verb'F', independent of +where it is applied to \verb'C'. Using \verb'GrB_assign' would be very +difficult in this case since a new \verb'Mask', the same size as \verb'C', +would need to be constructed for each finite-element \verb'F'. + +In GraphBLAS notation, the two methods can be described as follows: + +\vspace{0.05in} +\begin{tabular}{ll} +\hline +matrix and vector subassign & ${\bf C(I,J) \langle M \rangle} = {\bf C(I,J)} \odot {\bf A}$ \\ +matrix and vector assign & ${\bf C \langle M \rangle (I,J)} = {\bf C(I,J)} \odot {\bf A}$ \\ +\hline +\end{tabular} +\vspace{0.05in} + +This notation does not include the details of the \verb'GrB_COMP' and +\verb'GrB_REPLACE' descriptors, but it does illustrate the difference in the +\verb'Mask'. In the subassign, \verb'Mask' is the same size as \verb'C(I,J)' +and \verb'A'. If \verb'I[0]=i' and \verb'J[0]=j', Then \verb'Mask(0,0)' +controls how \verb'C(i,j)' is modified by the subassign, from the value +\verb'A(0,0)'. In the assign, \verb'Mask' is the same size as \verb'C', and +\verb'Mask(i,j)' controls how \verb'C(i,j)' is modified. + +The \verb'GxB_subassign' and \verb'GrB_assign' functions have the same +signatures; they differ only in how they consider the \verb'Mask' and the +\verb'GrB_REPLACE' descriptor + +Details of each step of the two operations are listed below: + +\vspace{0.1in} +\begin{tabular}{lll} +\hline +Step & \verb'GrB_Matrix_assign' & \verb'GxB_Matrix_subassign' \\ +\hline +1 & ${\bf S} = {\bf C(I,J)}$ & ${\bf S} = {\bf C(I,J)}$ \\ +2 & ${\bf S} = {\bf S} \odot {\bf A}$ & ${\bf S \langle M \rangle} = {\bf S} \odot {\bf A}$ \\ +3 & ${\bf Z} = {\bf C}$ & ${\bf C(I,J)}= {\bf S}$ \\ +4 & ${\bf Z(I,J)} = {\bf S}$ & \\ +5 & ${\bf C \langle M \rangle = Z}$ & \\ +\hline +\end{tabular} +\vspace{0.1in} + +Step 1 is the same. In the Accumulator Phase (Step 2), the expression +${\bf S} \odot {\bf A}$, +described in Section~\ref{accummask}, is the same in both +operations. The result is simply ${\bf A}$ if \verb'accum' is \verb'NULL'. It +only applies to the submatrix ${\bf S}$, not the whole matrix. +The result ${\bf S} \odot {\bf A}$ is used differently in the Mask/Replace +phase. + +The Mask/Replace Phase, described in Section~\ref{accummask} is different: +\begin{itemize} +\item + For \verb'GrB_assign' (Step 5), the mask is applied to all of ${\bf + C}$. The mask has the same size as ${\bf C}$. Just prior to making the + assignment via the mask, the \verb'GrB_REPLACE' option can be used to clear + all of ${\bf C}$ first. This is the only way in which entries in ${\bf C}$ that + are outside the ${\bf C(I,J)}$ submatrix can be modified by this operation. + +\item + For \verb'GxB_subassign' (Step 2b), the mask is applied to just + ${\bf S}$. The mask has the same size as ${\bf C(I,J)}$, ${\bf S}$, and + ${\bf A}$. Just prior to making the assignment via the mask, the + \verb'GrB_REPLACE' option can be used to clear ${\bf S}$ first. No entries + in ${\bf C}$ that are outside the ${\bf C(I,J)}$ can be modified by this + operation. Thus, \verb'GrB_REPLACE' has no effect on entries in ${\bf C}$ + outside the ${\bf C(I,J)}$ submatrix. + +\end{itemize} + +The differences between \verb'GrB_assign' and +\verb'GxB_subassign' can be seen in Tables~\ref{insubmatrix} and +\ref{outsubmatrix}. The first table considers the case when the entry $c_{ij}$ +is in the ${\bf C(I,J)}$ submatrix, and it describes what is computed for both +\verb'GrB_assign' and \verb'GxB_subassign'. They perform the +exact same computation; the only difference is how the value of the mask is +specified. Compare Table~\ref{insubmatrix} with Table~\ref{tab:maskaccum} +in Section~\ref{sec:maskaccum}. + +The first column of Table~\ref{insubmatrix} is {\em yes} if \verb'GrB_REPLACE' is enabled, +and a dash otherwise. The second column is {\em yes} if an accumulator +operator is given, and a dash otherwise. The third column is $c_{ij}$ if the +entry is present in ${\bf C}$, and a dash otherwise. The fourth column is +$a_{i'j'}$ if the corresponding entry is present in ${\bf A}$, where +$i={\bf I}(i')$ and $j={\bf J}(i')$. + +The {\em mask} column is 1 if the effective value of the mask mask allows ${\bf +C}$ to be modified, and 0 otherwise. This is $m_{ij}$ for \verb'GrB_assign', +and $m_{i'j'}$ for \verb'GxB_subassign', to reflect the difference in the mask, +but this difference is not reflected in the table. The value 1 or 0 is the +value of the entry in the mask after it is optionally complemented via the +\verb'GrB_COMP' option. + +Finally, the last column is the action taken in this case. It is left blank if +no action is taken, in which case $c_{ij}$ is not modified if present, or not +inserted into ${\bf C}$ if not present. + +\begin{table} +{\small +\begin{tabular}{lllll|l} +\hline +repl & accum & ${\bf C}$ & ${\bf A}$ & mask & action taken by \verb'GrB_assign' and \verb'GxB_subassign'\\ +\hline + - &- & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, update \\ + - &- & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ + - &- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $a_{i'j'}$ not present \\ + - &- & - & - & 1 & \\ + - &- & $c_{ij}$ & $a_{i'j'}$ & 0 & \\ + - &- & - & $a_{i'j'}$ & 0 & \\ + - &- & $c_{ij}$ & - & 0 & \\ + - &- & - & - & 0 & \\ +\hline + yes&- & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, update \\ + yes&- & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ + yes&- & $c_{ij}$ & - & 1 & delete $c_{ij}$ because $a_{i'j'}$ not present \\ + yes&- & - & - & 1 & \\ + yes&- & $c_{ij}$ & $a_{i'j'}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&- & - & $a_{i'j'}$ & 0 & \\ + yes&- & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&- & - & - & 0 & \\ +\hline + - &yes & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = c_{ij} \odot a_{i'j'}$, apply accumulator \\ + - &yes & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ + - &yes & $c_{ij}$ & - & 1 & \\ + - &yes & - & - & 1 & \\ + - &yes & $c_{ij}$ & $a_{i'j'}$ & 0 & \\ + - &yes & - & $a_{i'j'}$ & 0 & \\ + - &yes & $c_{ij}$ & - & 0 & \\ + - &yes & - & - & 0 & \\ +\hline + yes&yes & $c_{ij}$ & $a_{i'j'}$ & 1 & $c_{ij} = c_{ij} \odot a_{i'j'}$, apply accumulator \\ + yes&yes & - & $a_{i'j'}$ & 1 & $c_{ij} = a_{i'j'}$, insert \\ + yes&yes & $c_{ij}$ & - & 1 & \\ + yes&yes & - & - & 1 & \\ + yes&yes & $c_{ij}$ & $a_{i'j'}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&yes & - & $a_{i'j'}$ & 0 & \\ + yes&yes & $c_{ij}$ & - & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes&yes & - & - & 0 & \\ +\hline +\end{tabular} +} +\caption{Results of assign and subassign for entries in the ${\bf C(I,J)}$ submatrix \label{insubmatrix}} +\end{table} + +\newpage +Table~\ref{outsubmatrix} illustrates how \verb'GrB_assign' and +\verb'GxB_subassign' differ for entries outside the submatrix. +\verb'GxB_subassign' never modifies any entry outside the ${\bf C(I,J)}$ +submatrix, but \verb'GrB_assign' can modify them in two cases listed in +Table~\ref{outsubmatrix}. When the \verb'GrB_REPLACE' option is selected, and +when the \verb'Mask(i,j)' for an entry $c_{ij}$ is false (or if the +\verb'Mask(i,j)' is true and \verb'GrB_COMP' is enabled via the descriptor), +then the entry is deleted by \verb'GrB_assign'. + +The fourth column of Table~\ref{outsubmatrix} differs from +Table~\ref{insubmatrix}, since entries in ${\bf A}$ never affect these entries. +Instead, for all index pairs outside the $I \times J$ submatrix, ${\bf C}$ and +${\bf Z}$ are identical (see Step 3 above). As a result, each section of the +table includes just two cases: either $c_{ij}$ is present, or not. This in +contrast to Table~\ref{insubmatrix}, where each section must consider four +different cases. + +The \verb'GrB_Row_assign' and \verb'GrB_Col_assign' operations are slightly +different. They only affect a single row or column of ${\bf C}$. +For \verb'GrB_Row_assign', Table~\ref{outsubmatrix} only applies to entries in +the single row \verb'C(i,J)' that are outside the list of indices, \verb'J'. +For \verb'GrB_Col_assign', Table~\ref{outsubmatrix} only applies to entries in +the single column \verb'C(I,j)' that are outside the list of indices, \verb'I'. + +\begin{table} +{\small +\begin{tabular}{lllll|l} +\hline +repl & accum & ${\bf C}$ & ${\bf C=Z}$ & mask & action taken by \verb'GrB_assign' \\ +\hline + - &- & $c_{ij}$ & $c_{ij}$ & 1 & \\ + - &- & - & - & 1 & \\ + - &- & $c_{ij}$ & $c_{ij}$ & 0 & \\ + - &- & - & - & 0 & \\ +\hline + yes & - & $c_{ij}$ & $c_{ij}$ & 1 & \\ + yes & - & - & - & 1 & \\ + yes & - & $c_{ij}$ & $c_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes & - & - & - & 0 & \\ +\hline + - &yes & $c_{ij}$ & $c_{ij}$ & 1 & \\ + - &yes & - & - & 1 & \\ + - &yes & $c_{ij}$ & $c_{ij}$ & 0 & \\ + - &yes & - & - & 0 & \\ +\hline + yes & yes & $c_{ij}$ & $c_{ij}$ & 1 & \\ + yes & yes & - & - & 1 & \\ + yes & yes & $c_{ij}$ & $c_{ij}$ & 0 & delete $c_{ij}$ (because of \verb'GrB_REPLACE') \\ + yes & yes & - & - & 0 & \\ +\hline +\end{tabular} +} +\caption{Results of assign for entries outside the +${\bf C(I,J)}$ submatrix. Subassign has no effect on these entries. \label{outsubmatrix}} +\end{table} + +%------------------------------------------------------------------------------- +\subsubsection{Example} +%------------------------------------------------------------------------------- + +The difference between \verb'GxB_subassign' and \verb'GrB_assign' is +illustrated in the following example. Consider the 2-by-2 matrix ${\bf C}$ +where all entries are present. + +\[ +{\bf C} = \left[ + \begin{array}{rr} + 11 & 12 \\ + 21 & 22 \\ + \end{array} + \right] +\] + +Suppose \verb'GrB_REPLACE' is true, and \verb'GrB_COMP' is false. Let the +\verb'Mask' be: + +\[ +{\bf M} = \left[ + \begin{array}{rr} + 1 & 1 \\ + 0 & 1 \\ + \end{array} + \right]. +\] + +Let ${\bf A} = 100$, and let the index sets be ${\bf I}=0$ and ${\bf J}=1$. +Consider the computation +${\bf C \langle M \rangle} (0,1) = {\bf C}(0,1) + {\bf A}$, +using the \verb'GrB_assign' operation. The result is: +\[ +{\bf C} = \left[ + \begin{array}{rr} + 11 & 112 \\ + - & 22 \\ + \end{array} + \right]. +\] +The $(0,1)$ entry is updated and the $(1,0)$ entry is deleted because +its \verb'Mask' is zero. The other two entries are not modified since ${\bf Z} += {\bf C}$ outside the submatrix, and those two values are written back into +${\bf C}$ because their \verb'Mask' values are 1. The $(1,0)$ entry is deleted +because the entry ${\bf Z}(1,0)=21$ is prevented from being written back into +${\bf C}$ since \verb'Mask(1,0)=0'. + +Now consider the analogous \verb'GxB_subassign' operation. The \verb'Mask' has +the same size as ${\bf A}$, namely: +\[ +{\bf M} = \left[ + \begin{array}{r} + 1 \\ + \end{array} + \right]. +\] + +After computing +${\bf C} (0,1) {\bf \langle M \rangle} = {\bf C}(0,1) + {\bf A}$, +the result is + +\[ +{\bf C} = \left[ + \begin{array}{rr} + 11 & 112 \\ + 21 & 22 \\ + \end{array} + \right]. +\] + +Only the ${\bf C(I,J)}$ submatrix, the single entry ${\bf C}(0,1)$, is modified +by \verb'GxB_subassign'. The entry ${\bf C}(1,0)=21$ is unaffected by +\verb'GxB_subassign', but it is deleted by \verb'GrB_assign'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{Performance of {\sf GxB\_subassign}, {\sf GrB\_assign} +and {\sf GrB\_*\_setElement}} +%------------------------------------------------------------------------------- + +When SuiteSparse:GraphBLAS uses non-blocking mode, the modifications to a +matrix by \verb'GxB_subassign', \verb'GrB_assign', and \verb'GrB_*_setElement' +can postponed, and computed all at once later on. This has a huge impact on +performance. + +A sequence of assignments is fast if their completion can be postponed for as +long as possible, or if they do not modify the pattern at all. Modifying the +pattern can be costly, but it is fast if non-blocking mode can be fully +exploited. + +Consider a sequence of $t$ submatrix assignments \verb'C(I,J)=C(I,J)+A' to an +$n$-by-$n$ matrix \verb'C' where each submatrix \verb'A' has size $a$-by-$a$ +with $s$ entries, and where \verb'C' starts with $c$ entries. +Assume the matrices are all stored in non-hypersparse form, by row +(\verb'GrB_ROWMAJOR'). + +If blocking mode is enabled, or if the sequence requires the matrix to be +completed after each assignment, each of the $t$ assignments takes $O(a + s +\log n)$ time to process the \verb'A' matrix and then $O(n + c + s \log s)$ +time to complete \verb'C'. The latter step uses \verb'GrB_*_build' to build an +update matrix and then merge it with \verb'C'. This step does not occur if the +sequence of assignments does not add new entries to the pattern of \verb'C', +however. Assuming in the worst case that the pattern does change, the total +time is $O (t \left[ a + s \log n + n + c + s \log s \right] )$. + +If the sequence can be computed with all updates postponed until the end of the +sequence, then the total time is no worse than $O(a + s \log n)$ to process +each \verb'A' matrix, for $t$ assignments, and then a single \verb'build' at +the end, taking $O(n + c + st \log st)$ time. +The total time is $O (t \left [a + s \log n \right] + (n + c + st \log st))$. +If no new entries appear in +\verb'C' the time drops to $O (t \left [a + s \log n \right])$, and in this +case, the time for both methods is the same; both are equally efficient. + +A few simplifying assumptions are useful to compare these times. Consider a +graph of $n$ nodes with $O(n)$ edges, and with a constant bound on the degree +of each node. The asymptotic bounds assume a worst-case scenario where +\verb'C' has a least some dense rows (thus the $\log n$ terms). If these +are not present, if both $t$ and $c$ are $O(n)$, and if $a$ and $s$ are +constants, then the total time with blocking mode becomes $O(n^2)$, assuming +the pattern of \verb'C' changes at each assignment. This very high for a +sparse graph problem. In contrast, the non-blocking time becomes $O(n \log n)$ +under these same assumptions, which is asymptotically much faster. + +\newpage +The difference in practice can be very dramatic, since $n$ can be many millions +for sparse graphs with $n$ nodes and $O(n)$, which can be handled on a +commodity laptop. + +The following guidelines should be considered when using +\verb'GxB_subassign', \verb'GrB_assign' and \verb'GrB_*_setElement'. + +\begin{enumerate} + +\item A sequence of assignments that does not modify the pattern at all is +fast, taking as little as $\Omega(1)$ time per entry modified. The worst case +time complexity is $O(\log n)$ per entry, assuming they all modify a dense +row of \verb'C' with \verb'n' entries, which can occur in practice. It is +more common, however, that most rows of \verb'C' have a constant number of +entries, independent of \verb'n'. No work is ever left pending when the +pattern of \verb'C' does not change. + +\item A sequence of assignments that modifies the entries that already exist in +the pattern of a matrix, or adds new entries to the pattern (using the same +\verb'accum' operator), but does not delete any entries, is fast. The matrix +is not completed until the end of the sequence. + +\item Similarly, a sequence that modifies existing entries, or deletes them, +but does not add new ones, is also fast. This sequence can also repeatedly +delete pre-existing entries and then reinstate them and still be fast. The +matrix is not completed until the end of the sequence. + +\item A sequence that mixes assignments of types (2) and (3) above can be +costly, since the matrix may need to be completed after each assignment. The +time complexity can become quadratic in the worst case. + +\item However, any single assignment takes no more than $O (a + s \log n + n + +c + s \log s )$ time, even including the time for a matrix completion, where +\verb'C' is $n$-by-$n$ with $c$ entries and \verb'A' is $a$-by-$a$ with $s$ +entries. This time is essentially linear in the size of the matrix \verb'C', +if \verb'A' is relatively small and sparse compared with \verb'C'. In this +case, $n+c$ are the two dominant terms. + +\item In general, \verb'GxB_subassign' is faster than \verb'GrB_assign'. +If \verb'GrB_REPLACE' is used with \verb'GrB_assign', the entire matrix +\verb'C' must be traversed. This is much slower than \verb'GxB_subassign', +which only needs to examine the \verb'C(I,J)' submatrix. Furthermore, +\verb'GrB_assign' must deal with a much larger \verb'Mask' matrix, whereas +\verb'GxB_subassign' has a smaller mask. Since its mask is smaller, +\verb'GxB_subassign' takes less time than \verb'GrB_assign' to access the mask. + +\end{enumerate} + +% see GraphBLAS/Test/test46.m + +Submatrix assignment in SuiteSparse:GraphBLAS is extremely efficient, even +without considering the advantages of non-blocking mode discussed in +Section~\ref{compare_assign}. It can be up to 1000x faster than MATLAB R2019b, +or even higher depending on the kind of matrix assignment. MATLAB logical +indexing (the mask of GraphBLAS) is extremely faster with GraphBLAS as compared +in MATLAB R2019b; differences of up to 250,000x have been observed (0.4 seconds +in GraphBLAS versus 28 hours in MATLAB). + +All of the algorithmic variants of assign/subassign in SuiteSparse:GraphBLAS +are either asymptotically optimal, or to within a log factor of being +asymptotically optimal. The methods are also fully parallel. For hypersparse +matrices, the term $n$ in the expressions in the above discussion is dropped, +and is replaced with $h \log h$, at the worst case, where $h << n$ is the +number of non-empty columns of a hypersparse matrix stored by column, or the +number of non-empty rows of a hypersparse matrix stored by row. In many +methods, $n$ is replaced with $h$, not $h \log h$. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseAdd.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseAdd.tex new file mode 100644 index 0000000000..7a1a82b5f9 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseAdd.tex @@ -0,0 +1,171 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_eWiseAdd:} element-wise operations, set union} %========== +%=============================================================================== +\label{eWiseAdd} + +Element-wise ``addition'' is shorthand for applying a binary operator +element-wise on two matrices or vectors \verb'A' and \verb'B', for all entries +that appear in the set intersection of the patterns of \verb'A' and \verb'B'. +This is like \verb'A+B' for two sparse matrices in MATLAB, except that in +GraphBLAS any binary operator can be used, not just addition. The pattern of +the result of the element-wise ``addition'' is the set union of the pattern of +\verb'A' and \verb'B'. Entries in neither in \verb'A' nor in \verb'B' do +not appear in the result. + +Let $\oplus$ denote the binary operator to be used. The computation ${\bf T = +A \oplus B}$ is exactly the same as the computation with accumulator operator +as described in Section~\ref{accummask}. It acts like a sparse matrix +addition, except that any operator can be used. The pattern of ${\bf A \oplus +B}$ is the set union of the patterns of ${\bf A}$ and ${\bf B}$, and the +operator is applied only on the set intersection of ${\bf A}$ and ${\bf B}$. +Entries not in either the pattern of ${\bf A}$ or ${\bf B}$ do not appear in +the pattern of ${\bf T}$. That is: + \vspace{-0.2in} + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ + \> \> $t_{ij} = a_{ij} \oplus b_{ij}$ \\ + \> for all entries $(i,j)$ in ${\bf A \setminus B}$ \\ + \> \> $t_{ij} = a_{ij}$ \\ + \> for all entries $(i,j)$ in ${\bf B \setminus A}$ \\ + \> \> $t_{ij} = b_{ij}$ + \end{tabbing} + } + +The only difference between element-wise ``multiplication'' (${\bf T =A \otimes +B}$) and ``addition'' (${\bf T = A \oplus B}$) is the pattern of the result, +and what happens to entries outside the intersection. With $\otimes$ the +pattern of ${\bf T}$ is the intersection; with $\oplus$ it is the set union. +Entries outside the set intersection are dropped for $\otimes$, and kept for +$\oplus$; in both cases the operator is only applied to those (and only those) +entries in the intersection. Any binary operator can be used interchangeably +for either operation. + +Element-wise operations do not operate on the implicit values, even implicitly, +since the operations make no assumption about the semiring. As a result, the +results can be different from MATLAB, which can always assume the implicit +value is zero. For example, \verb'C=A-B' is the conventional matrix +subtraction in MATLAB. Computing \verb'A-B' in GraphBLAS with \verb'eWiseAdd' +will apply the \verb'MINUS' operator to the intersection, entries in \verb'A' +but not \verb'B' will be unchanged and appear in \verb'C', and entries in +neither \verb'A' nor \verb'B' do not appear in \verb'C'. For these cases, the +results matches the MATLAB \verb'C=A-B'. Entries in \verb'B' but not \verb'A' +do appear in \verb'C' but they are not negated; they cannot be subtracted from +an implicit value in \verb'A'. This is by design. If conventional matrix +subtraction of two sparse matrices is required, and the implicit value is known +to be zero, use \verb'GrB_apply' to negate the values in \verb'B', and then +use \verb'eWiseAdd' with the \verb'PLUS' operator, to compute \verb'A+(-B)'. + +The generic name for this operation is \verb'GrB_eWiseAdd', which can be used +for both matrices and vectors. + +There is another minor difference in two variants of the element-wise +functions. If given a \verb'semiring', the \verb'eWiseAdd' functions use the +binary operator of the semiring's monoid, while the \verb'eWiseMult' functions +use the multiplicative operator of the semiring. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_eWiseAdd:} element-wise vector addition} +%------------------------------------------------------------------------------- +\label{eWiseAdd_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_eWiseAdd // w = accum (w, u+v) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_eWiseAdd' computes the element-wise ``addition'' of two +vectors \verb'u' and \verb'v', element-wise using any binary operator (not just +plus). The vectors are not transposed via the descriptor. Entries in the +intersection of \verb'u' and \verb'v' are first typecasted into the first and +second inputs of the \verb'add' operator. Next, a column vector \verb't' is +computed, denoted ${\bf t = u \oplus v}$. The pattern of \verb't' is the set +union of \verb'u' and \verb'v'. The result \verb't' has the type of the output +\verb'ztype' of the \verb'add' operator. + +The \verb'add' operator is typically a \verb'GrB_BinaryOp', but the method is +type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the +additive operator of the monoid is used as the \verb'add' binary operator. If +given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of +the semiring is used as the \verb'add' binary operator. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +The final step is ${\bf w \langle m \rangle = w \odot t}$, as described in +Section~\ref{accummask}, except that all the terms are column vectors instead +of matrices. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_eWiseAdd:} element-wise matrix addition} +%------------------------------------------------------------------------------- +\label{eWiseAdd_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_eWiseAdd // C = accum (C, A+B) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_eWiseAdd' computes the element-wise ``addition'' of two +matrices \verb'A' and \verb'B', element-wise using any binary operator (not +just plus). The input matrices may be transposed first, according to the +descriptor \verb'desc'. Entries in the intersection then typecasted into the +first and second inputs of the \verb'add' operator. Next, a matrix \verb'T' is +computed, denoted ${\bf T = A \oplus B}$. The pattern of \verb'T' is the set +union of \verb'A' and \verb'B'. The result \verb'T' has the type of the output +\verb'ztype' of the \verb'add' operator. + +The \verb'add' operator is typically a \verb'GrB_BinaryOp', but the method is +type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the +additive operator of the monoid is used as the \verb'add' binary operator. If +given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of +the semiring is used as the \verb'add' binary operator. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +\vspace{0.05in} +The operation can be expressed in MATLAB notation as: + {\footnotesize + \begin{verbatim} + [nrows, ncols] = size (A.matrix) ; + T.matrix = zeros (nrows, ncols, add.ztype) ; + p = A.pattern & B.pattern ; + A = GB_mex_cast (A.matrix (p), add.xtype) ; + B = GB_mex_cast (B.matrix (p), add.ytype) ; + T.matrix (p) = add (A, B) ; + p = A.pattern & ~B.pattern ; T.matrix (p) = cast (A.matrix (p), add.ztype) ; + p = ~A.pattern & B.pattern ; T.matrix (p) = cast (B.matrix (p), add.ztype) ; + T.pattern = A.pattern | B.pattern ; + T.class = add.ztype ; \end{verbatim} } +Except for when typecasting is performed, this is identical to how the +\verb'accum' operator is applied in Figure~\ref{fig_accummask}. + +The final step is ${\bf C \langle M \rangle = C \odot T}$, as described in +Section~\ref{accummask}. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseMult.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseMult.tex new file mode 100644 index 0000000000..9b87362e29 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseMult.tex @@ -0,0 +1,150 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_eWiseMult:} element-wise operations, set intersection} %== +%=============================================================================== +\label{eWiseMult} + +Element-wise ``multiplication'' is shorthand for applying a binary operator +element-wise on two matrices or vectors \verb'A' and \verb'B', for all entries +that appear in the set intersection of the patterns of \verb'A' and \verb'B'. +This is like \verb'A.*B' for two sparse matrices in MATLAB, except that in +GraphBLAS any binary operator can be used, not just multiplication. + +The pattern of the result of the element-wise ``multiplication'' is exactly +this set intersection. Entries in \verb'A' but not \verb'B', or visa versa, do +not appear in the result. + +Let $\otimes$ denote the binary operator to be used. The computation ${\bf T = +A \otimes B}$ is given below. Entries not in the intersection of ${\bf A}$ and +${\bf B}$ do not appear in the pattern of ${\bf T}$. That is: + \vspace{-0.2in} + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ + \> \> $t_{ij} = a_{ij} \otimes b_{ij}$ \\ + \end{tabbing} } + \vspace{-0.2in} + +Depending on what kind of operator is used and what the implicit value is +assumed to be, this can give the Hadamard product. This is the case for +\verb'A.*B' in MATLAB since the implicit value is zero. However, computing a +Hadamard product is not necessarily the goal of the \verb'eWiseMult' operation. +It simply applies any binary operator, built-in or user-defined, to the set +intersection of \verb'A' and \verb'B', and discards any entry outside this +intersection. Its usefulness in a user's application does not depend upon it +computing a Hadamard product in all cases. The operator need not be +associative, commutative, nor have any particular property except for type +compatibility with \verb'A' and \verb'B', and the output matrix \verb'C'. + +The generic name for this operation is \verb'GrB_eWiseMult', which can be used +for both matrices and vectors. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_eWiseMult:} element-wise vector multiply} +%------------------------------------------------------------------------------- +\label{eWiseMult_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_eWiseMult // w = accum (w, u.*v) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const multiply, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Vector_eWiseMult' computes the element-wise ``multiplication'' of two +vectors \verb'u' and \verb'v', element-wise using any binary operator (not just +times). The vectors are not transposed via the descriptor. The vectors +\verb'u' and \verb'v' are first typecasted into the first and second inputs of +the \verb'multiply' operator. Next, a column vector \verb't' is computed, +denoted ${\bf t = u \otimes v}$. The pattern of \verb't' is the set +intersection of \verb'u' and \verb'v'. The result \verb't' has the type of the +output \verb'ztype' of the \verb'multiply' operator. + +The \verb'operator' is typically a \verb'GrB_BinaryOp', but the method is +type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the +additive operator of the monoid is used as the \verb'multiply' binary operator. +If given a semiring (\verb'GrB_Semiring'), the multiply operator of the +semiring is used as the \verb'multiply' binary operator. +% +The \verb'multiply' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +The next and final step is ${\bf w \langle m \rangle = w \odot t}$, as +described in Section~\ref{accummask}, except that all the terms are column +vectors instead of matrices. Note for all GraphBLAS operations, including this +one, the accumulator ${\bf w \odot t}$ is always applied in a set union manner, +even though ${\bf t = u \otimes v}$ for this operation is applied in a set +intersection manner. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_eWiseMult:} element-wise matrix multiply} +%------------------------------------------------------------------------------- +\label{eWiseMult_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_eWiseMult // C = accum (C, A.*B) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const multiply, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B +) ; +\end{verbatim} +} \end{mdframed} + +\verb'GrB_Matrix_eWiseMult' computes the element-wise ``multiplication'' of two +matrices \verb'A' and \verb'B', element-wise using any binary operator (not +just times). The input matrices may be transposed first, according to the +descriptor \verb'desc'. They are then typecasted into the first and second +inputs of the \verb'multiply' operator. Next, a matrix \verb'T' is computed, +denoted ${\bf T = A \otimes B}$. The pattern of \verb'T' is the set +intersection of \verb'A' and \verb'B'. The result \verb'T' has the type of the +output \verb'ztype' of the \verb'multiply' operator. + +The \verb'multiply' operator is typically a \verb'GrB_BinaryOp', but the method +is type-generic for this parameter. If given a monoid (\verb'GrB_Monoid'), the +additive operator of the monoid is used as the \verb'multiply' binary operator. +If given a semiring (\verb'GrB_Semiring'), the multiply operator of the +semiring is used as the \verb'multiply' binary operator. +% +The \verb'multiply' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +\vspace{0.05in} +The operation can be expressed in MATLAB notation as: + {\footnotesize + \begin{verbatim} + [nrows, ncols] = size (A.matrix) ; + T.matrix = zeros (nrows, ncols, multiply.ztype) ; + T.class = multiply.ztype ; + p = A.pattern & B.pattern ; + A = cast (A.matrix (p), multiply.xtype) ; + B = cast (B.matrix (p), multiply.ytype) ; + T.matrix (p) = multiply (A, B) ; + T.pattern = p ; \end{verbatim} } + +The final step is ${\bf C \langle M \rangle = C \odot T}$, as described in +Section~\ref{accummask}. Note for all GraphBLAS operations, including this +one, the accumulator ${\bf C \odot T}$ is always applied in a set union manner, +even though ${\bf T = A \otimes B}$ for this operation is applied in a set +intersection manner. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseUnion.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseUnion.tex new file mode 100644 index 0000000000..726fbc60a9 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_eWiseUnion.tex @@ -0,0 +1,127 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GxB\_eWiseUnion:} element-wise operations, set union} %======== +%=============================================================================== +\label{eWiseUnion} + +\verb'GxB_eWiseUnion' computes a result with the same pattern +\verb'GrB_eWiseAdd', namely, a set union of its two inputs. It differs in how +the binary operator is applied. + +Let $\oplus$ denote the binary operator to be used. The operator is applied to +every entry in $\bf A$ and $\bf B$. A pair of scalars, $\alpha$ and $\beta$ +(\verb'alpha' and \verb'beta' in the API, respectively) define the +inputs to the operator when entries are present in one matrix but not the +other. + + \vspace{-0.2in} + {\small + \begin{tabbing} + \hspace{2em} \= \hspace{2em} \= \hspace{2em} \= \\ + \> for all entries $(i,j)$ in ${\bf A \cap B}$ \\ + \> \> $t_{ij} = a_{ij} \oplus b_{ij}$ \\ + \> for all entries $(i,j)$ in ${\bf A \setminus B}$ \\ + \> \> $t_{ij} = a_{ij} \oplus \beta $ \\ + \> for all entries $(i,j)$ in ${\bf B \setminus A}$ \\ + \> \> $t_{ij} = \alpha \oplus b_{ij}$ + \end{tabbing} + } + +\verb'GxB_eWiseUnion' is useful in contexts where \verb'GrB_eWiseAdd' cannot be +used because of the typecasting rules of GraphBLAS. In particular, suppose +\verb'A' and \verb'B' are matrices with a user-defined type, and suppose +\verb'<' is a user-defined operator that compares two entries of this type and +returns a Boolean value. Then \verb'C=A = accum (w, u+v) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Scalar alpha, + const GrB_Vector v, // second input: vector v + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +Identical to \verb'GrB_Vector_eWiseAdd' except that two scalars are used +to define how to compute the result when entries are present in one of +the two input vectors (\verb'u' and \verb'v'), but not the other. +Each of the two input scalars, \verb'alpha' and \verb'beta' +must contain an entry. +When computing the result \verb't=u+v', +if \verb'u(i)' is present but \verb'v(i)' is not, then \verb't(i)=u(i)+beta'. +Likewise, +if \verb'v(i)' is present but \verb'u(i)' is not, then \verb't(i)=alpha+v(i)', +where \verb'+' denotes the binary operator, \verb'add'. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_eWiseUnion:} element-wise matrix addition} +%------------------------------------------------------------------------------- +\label{eWiseUnion_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_eWiseUnion // C = accum (C, A+B) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar alpha, + const GrB_Matrix B, // second input: matrix B + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for C, M, A, and B +) ; +\end{verbatim} } \end{mdframed} + +Identical to \verb'GrB_Matrix_eWiseAdd' except that two scalars are used +to define how to compute the result when entries are present in one of +the two input matrices (\verb'A' and \verb'B'), but not the other. +Each of the two input scalars, \verb'alpha' and \verb'beta' +must contain an entry. +When computing the result \verb'T=A+B', +if \verb'A(i,j)' is present but \verb'B(i,j))' is not, then \verb'T(i,j)=A(i,j)+beta'. +Likewise, +if \verb'B(i,j)' is present but \verb'A(i,j)' is not, then \verb'T(i,j)=alpha+B(i,j)', +where \verb'+' denotes the binary operator, \verb'add'. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_extract.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_extract.tex new file mode 100644 index 0000000000..a909b40e8b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_extract.tex @@ -0,0 +1,228 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_extract:} submatrix extraction } %======================== +%=============================================================================== +\label{extract} + +The \verb'GrB_extract' function is a generic name for three specific functions: +\verb'GrB_Vector_extract', \verb'GrB_Col_extract', and +\verb'GrB_Matrix_extract'. The generic name appears in the function signature, +but the specific function name is used when describing what each variation +does. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_extract:} extract subvector from vector} +%------------------------------------------------------------------------------- +\label{extract_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // w = accum (w, u(I)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_extract' extracts a subvector from another vector, identical +to \verb't = u (I)' in MATLAB where \verb'I' is an integer vector of row +indices. Refer to \verb'GrB_Matrix_extract' for further details; vector +extraction is the same as matrix extraction with \verb'n'-by-1 matrices. +See Section~\ref{colon} for a description of \verb'I' and \verb'ni'. +The final step is ${\bf w \langle m \rangle = w \odot +t}$, as described in Section~\ref{accummask}, except that all the terms are +column vectors instead of matrices. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_extract\_Vector:} extract subvector from vector} +%------------------------------------------------------------------------------- +\label{extract_vector_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // w = accum (w, u(I)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_extract_Vector' is identical to \verb'GrB_Vector_extract', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_extract:} extract submatrix from matrix} +%------------------------------------------------------------------------------- +\label{extract_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // C = accum (C, A(I,J)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C, Mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_extract' extracts a submatrix from another matrix, identical +to \verb'T = A(I,J)' in MATLAB where \verb'I' and \verb'J' are integer vectors +of row and column indices, respectively, except that indices are zero-based in +GraphBLAS and one-based in MATLAB. The input matrix \verb'A' may be transposed +first, via the descriptor. The type of \verb'T' and \verb'A' are the same. +The size of \verb'C' is \verb'|I|'-by-\verb'|J|'. +Entries outside \verb'A(I,J)' are not accessed and do not take part in the +computation. More precisely, assuming the matrix \verb'A' is not transposed, +the matrix \verb'T' is defined as follows: + + \vspace{-0.1in} + {\footnotesize + \begin{verbatim} + T.matrix = zeros (ni, nj) ; % a matrix of size ni-by-nj + T.pattern = false (ni, nj) ; + for i = 1:ni + for j = 1:nj + if (A (I(i),J(j)).pattern) + T (i,j).matrix = A (I(i),J(j)).matrix ; + T (i,j).pattern = true ; + end + end + end \end{verbatim}} + +\vspace{-0.1in} +If duplicate indices are present in \verb'I' or \verb'J', the above method +defines the result in \verb'T'. Duplicates result in the same values of +\verb'A' being copied into different places in \verb'T'. +See Section~\ref{colon} for a description of the row indices +\verb'I' and \verb'ni', and the column indices +\verb'J' and \verb'nj'. +The final step is ${\bf C \langle M \rangle = C \odot +T}$, as described in Section~\ref{accummask}. + +\paragraph{\bf Performance considerations:} % C=A(I,J) +If \verb'A' is not transposed via input descriptor: if \verb'|I|' is small, +then it is fastest if \verb'A' is \verb'GrB_ROWMAJOR'; if +\verb'|J|' is small, then it is fastest if \verb'A' is +\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_extract\_Vector:} extract submatrix from matrix} +%------------------------------------------------------------------------------- +\label{extract_matrix_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // C = accum (C, A(I,J)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C, M, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_extract_Vector' is identical to \verb'GrB_Matrix_extract', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries, and the column indices are given by the \verb'GrB_Vector J' with +\verb'nj' entries. The interpretation of \verb'I_vector' and \verb'J_vector' +are controlled by descriptor setting \verb'GxB_ROWINDEX_LIST' and +\verb'GxB_COLINDEX_LIST', respectively. The method can use either the indices +or values of each of the input vectors, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Col\_extract:} extract column vector from matrix} +%------------------------------------------------------------------------------- +\label{extract_column} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // w = accum (w, A(I,j)) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Col_extract' extracts a subvector from a matrix, identical to +\verb't = A (I,j)' in MATLAB where \verb'I' is an integer vector of row indices +and where \verb'j' is a single column index. The input matrix \verb'A' may be +transposed first, via the descriptor, which results in the extraction of a +single row \verb'j' from the matrix \verb'A', the result of which is a column +vector \verb'w'. The type of \verb't' and \verb'A' are the same. +The size of \verb'w' is \verb'|I|'-by-1. + +See Section~\ref{colon} for a description of the row indices +\verb'I' and \verb'ni'. +The final step is ${\bf w \langle m +\rangle = w \odot t}$, as described in Section~\ref{accummask}, except that +all the terms are column vectors instead of matrices. + +\paragraph{\bf Performance considerations:} % w = A(I,j) +If \verb'A' is not transposed: it is fastest if the format of \verb'A' is +\verb'GrB_COLMAJOR'. The opposite is true if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Col\_extract\_Vector:} extract column vector from matrix} +%------------------------------------------------------------------------------- +\label{extract_column_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_extract // w = accum (w, A(I,j)) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Col_extract_Vector' is identical to \verb'GrB_Col_extract', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_kronecker.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_kronecker.tex new file mode 100644 index 0000000000..e87b18764d --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_kronecker.tex @@ -0,0 +1,52 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_kronecker:} Kronecker product} %========================== +%=============================================================================== +\label{kron} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_kronecker // C = accum (C, kron(A,B)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const op, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_kronecker' computes the Kronecker product, +${\bf C \langle M \rangle = C \odot \mbox{kron}(A,B)}$ where +\[ +\mbox{kron}{\bf (A,B)} = +\left[ + \begin{array}{ccc} + a_{00} \otimes {\bf B} & \ldots & a_{0,n-1} \otimes {\bf B} \\ + \vdots & \ddots & \vdots \\ + a_{m-1,0} \otimes {\bf B} & \ldots & a_{m-1,n-1} \otimes {\bf B} \\ + \end{array} +\right] +\] +The $\otimes$ operator is defined by the \verb'op' parameter. It is applied in +an element-wise fashion (like \verb'GrB_eWiseMult'), where the pattern of the +submatrix $a_{ij} \otimes {\bf B}$ is the same as the pattern of ${\bf B}$ if +$a_{ij}$ is an entry in the matrix ${\bf A}$, or empty otherwise. The input +matrices \verb'A' and \verb'B' can be of any dimension, and both matrices may +be transposed first via the descriptor, \verb'desc'. Entries in \verb'A' and +\verb'B' are typecast into the input types of the \verb'op'. The matrix +\verb'T=kron(A,B)' has the same type as the \verb'ztype' of the binary +operator, \verb'op'. The final step is ${\bf C \langle M \rangle = C \odot +T}$, as described in Section~\ref{accummask}. + +The operator \verb'op' may be a \verb'GrB_BinaryOp', a \verb'GrB_Monoid', or a +\verb'GrB_Semiring'. In the latter case, the multiplicative operator of +the semiring is used. +% +The \verb'op' may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_mxm.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_mxm.tex new file mode 100644 index 0000000000..098a8afb80 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_mxm.tex @@ -0,0 +1,83 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_mxm:} matrix-matrix multiply} %=========================== +%=============================================================================== +\label{mxm} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_mxm // C = accum (C, A*B) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_mxm' multiplies two sparse matrices \verb'A' and \verb'B' using the +\verb'semiring'. The input matrices \verb'A' and \verb'B' may be transposed +according to the descriptor, \verb'desc' (which may be \verb'NULL') and then +typecasted to match the multiply operator of the \verb'semiring'. Next, +\verb'T=A*B' is computed on the \verb'semiring', precisely defined in the +\verb'GB_spec_mxm.m' script in \verb'GraphBLAS/Test'. The actual algorithm +exploits sparsity and does not take $O(n^3)$ time, but it computes the +following: + +{\footnotesize +\begin{verbatim} +[m s] = size (A.matrix) ; +[s n] = size (B.matrix) ; +T.matrix = zeros (m, n, multiply.ztype) ; +T.pattern = zeros (m, n, 'logical') ; +T.matrix (:,:) = identity ; % the identity of the semiring's monoid +T.class = multiply.ztype ; % the ztype of the semiring's multiply op +A = cast (A.matrix, multiply.xtype) ; % the xtype of the semiring's multiply op +B = cast (B.matrix, multiply.ytype) ; % the ytype of the semiring's multiply op +for j = 1:n + for i = 1:m + for k = 1:s + % T (i,j) += A (i,k) * B (k,j), using the semiring + if (A.pattern (i,k) && B.pattern (k,j)) + z = multiply (A (i,k), B (k,j)) ; + T.matrix (i,j) = add (T.matrix (i,j), z) ; + T.pattern (i,j) = true ; + end + end + end +end \end{verbatim}} + +Finally, \verb'T' is typecasted into the type of \verb'C', and the results are +written back into \verb'C' via the \verb'accum' and \verb'Mask', ${\bf C +\langle M \rangle = C \odot T}$. The latter step is reflected in the MATLAB +function \verb'GB_spec_accum_mask.m', discussed in Section~\ref{accummask}. + +\paragraph{\bf Performance considerations:} +Suppose all matrices are in \verb'GrB_COLMAJOR' format, and \verb'B' is extremely +sparse but \verb'A' is not as sparse. Then computing \verb'C=A*B' is very +fast, and much faster than when \verb'A' is extremely sparse. For example, if +\verb'A' is square and \verb'B' is a column vector that is all nonzero except +for one entry \verb'B(j,0)=1', then \verb'C=A*B' is the same as extracting +column \verb'A(:,j)'. This is very fast if \verb'A' is stored by column but +slow if \verb'A' is stored by row. If \verb'A' is a sparse row with a single +entry \verb'A(0,i)=1', then \verb'C=A*B' is the same as extracting row +\verb'B(i,:)'. This is fast if \verb'B' is stored by row but slow if \verb'B' +is stored by column. + +If the user application needs to repeatedly extract rows and columns from a +matrix, whether by matrix multiplication or by \verb'GrB_extract', then keep +two copies: one stored by row, and other by column, and use the copy that +results in the fastest computation. + +By default, \verb'GrB_mxm', \verb'GrB_mxv', \verb'GrB_vxm', and +\verb'GrB_reduce' (to vector) can return their result in a jumbled state, with +the sort left pending. It can sometimes be faster for these methods to do the +sort as they compute their result. Use the \verb'GxB_SORT' descriptor setting +to select this option. Refer to Section~\ref{descriptor} for details. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_mxv.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_mxv.tex new file mode 100644 index 0000000000..ec227ffca6 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_mxv.tex @@ -0,0 +1,49 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_mxv:} matrix-vector multiply} %=========================== +%=============================================================================== +\label{mxv} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_mxv // w = accum (w, A*u) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_mxv' multiplies a matrix \verb'A' times a column vector \verb'u'. +The matrix \verb'A' may be first transposed according to \verb'desc' (as the +first input); the column vector \verb'u' is never transposed via the +descriptor. The inputs \verb'A' and \verb'u' are typecasted to match the +\verb'xtype' and \verb'ytype' inputs, respectively, of the multiply operator of +the \verb'semiring'. Next, an intermediate column vector \verb't=A*u' is +computed on the \verb'semiring' using the same method as \verb'GrB_mxm'. +Finally, the column vector \verb't' is typecasted from the \verb'ztype' of the +multiply operator of the \verb'semiring' into the type of \verb'w', and the +results are written back into \verb'w' using the optional accumulator +\verb'accum' and \verb'mask'. + +The last step is ${\bf w \langle m \rangle = w \odot t}$, as described +in Section~\ref{accummask}, except that all the terms are column vectors instead +of matrices. + +\paragraph{\bf Performance considerations:} % u=A*u +Refer to the discussion of \verb'GrB_vxm'. In SuiteSparse:GraphBLAS, +\verb'GrB_mxv' is very efficient when \verb'u' is sparse or dense, when the +default descriptor is used, and when the matrix is \verb'GrB_COLMAJOR'. When +\verb'u' is very sparse and \verb'GrB_INP0' is set to its non-default +\verb'GrB_TRAN', then this method is not efficient if the matrix is in +\verb'GrB_COLMAJOR' format. If an application needs to perform \verb"A'*u" +repeatedly where \verb'u' is very sparse, then use the \verb'GrB_ROWMAJOR' format +for \verb'A' instead. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_reduce.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_reduce.tex new file mode 100644 index 0000000000..564b024a79 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_reduce.tex @@ -0,0 +1,152 @@ + + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_reduce:} reduce to a vector or scalar} %================== +%=============================================================================== +\label{reduce} + +The generic function name \verb'GrB_reduce' may be used for all specific +functions discussed in this section. When the details of a specific function +are discussed, the specific name is used for clarity. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_reduce\_Monoid} reduce a matrix to a vector} +%------------------------------------------------------------------------------- +\label{reduce_to_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_reduce // w = accum (w,reduce(A)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // reduce monoid for t=reduce(A) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_reduce_Monoid' +reduces a matrix to a column vector using a monoid, roughly analogous +to \verb"t = sum (A')" in MATLAB, in the default case, where \verb't' is a +column vector. By default, the method reduces across the rows to +obtain a column vector; use \verb'GrB_TRAN' to reduce down the columns. + +The input matrix \verb'A' may be transposed first. Its entries are then +typecast into the type of the \verb'reduce' operator or monoid. The reduction +is applied to all entries in \verb'A (i,:)' to produce the scalar \verb't (i)'. +This is done without the use of the identity value of the monoid. If the +\verb'i'th row \verb'A (i,:)' has no entries, then \verb'(i)' is not an entry +in \verb't' and its value is implicit. If \verb'A (i,:)' has a single entry, +then that is the result \verb't (i)' and \verb'reduce' is not applied at all +for the \verb'i'th row. Otherwise, multiple entries in row \verb'A (i,:)' are +reduced via the \verb'reduce' operator or monoid to obtain a single scalar, +the result \verb't (i)'. + +The final step is ${\bf w \langle m \rangle = w \odot t}$, as described +in Section~\ref{accummask}, except that all the +terms are column vectors instead of matrices. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_reduce\_$<$type$>$:} reduce a vector to a scalar} +%------------------------------------------------------------------------------- +\label{reduce_vector_to_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (u)) +( + *c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Vector u, // vector to reduce + const GrB_Descriptor desc // descriptor (currently unused) +) ; + +GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (u)) +( + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Vector u, // vector to reduce + const GrB_Descriptor desc // descriptor (currently unused) +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_reduce_' +reduces a vector to a scalar, analogous to \verb't = sum (u)' in MATLAB, +except that in GraphBLAS any commutative and associative monoid can be used +in the reduction. + +The scalar \verb'c' can be a pointer C type: \verb'bool', \verb'int8_t', ... +\verb'float', \verb'double', or \verb'void *' for a user-defined type, +or a \verb'GrB_Scalar'. +If \verb'c' is a \verb'void *' pointer to a user-defined type, +the type must be identical to the type of the vector \verb'u'. +This cannot be checked by GraphBLAS and thus results are undefined if the +types are not the same. + +If the vector \verb'u' has no entries, that identity value of the \verb'monoid' +is copied into the scalar \verb't' (unless \verb'c' is a \verb'GrB_Scalar', +in which case \verb't' is an empty \verb'GrB_Scalar', with no entry). +Otherwise, all of the entries in the +vector are reduced to a single scalar using the \verb'monoid'. + +The descriptor is unused, but it appears in case it is needed in future +versions of the GraphBLAS API. +This function has no mask so its accumulator/mask step differs from the other +GraphBLAS operations. It does not use the methods described in +Section~\ref{accummask}, but uses the following method instead. + +If \verb'accum' is \verb'NULL', then the scalar \verb't' is typecast into the +type of \verb'c', and \verb'c = t' is the final result. Otherwise, the scalar +\verb't' is typecast into the \verb'ytype' of the \verb'accum' operator, and +the value of \verb'c' (on input) is typecast into the \verb'xtype' of the +\verb'accum' operator. Next, the scalar \verb'z = accum (c,t)' is computed, of +the \verb'ztype' of the \verb'accum' operator. Finally, \verb'z' is typecast +into the final result, \verb'c'. + +If \verb'c' is a non-opaque scalar, no error message can be returned by +\verb'GrB_error'. If \verb'c' is a \verb'GrB_Scalar', then +\verb'GrB_error(&err,c)' can be used to return an error string, if an error +occurs. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_reduce\_$<$type$>$:} reduce a matrix to a scalar} +%------------------------------------------------------------------------------- +\label{reduce_matrix_to_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (A)) +( + *c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Matrix A, // matrix to reduce + const GrB_Descriptor desc // descriptor (currently unused) +) ; + +GrB_Info GrB_reduce // c = accum (c, reduce_to_scalar (A)) +( + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Matrix A, // matrix to reduce + const GrB_Descriptor desc // descriptor (currently unused) +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_reduce_' reduces a matrix \verb'A' to a scalar, roughly +analogous to \verb't = sum (A (:))' in MATLAB. This function is identical to +reducing a vector to a scalar, since the positions of the entries in a matrix +or vector have no effect on the result. Refer to the reduction to scalar +described in the previous Section~\ref{reduce_vector_to_scalar}. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_select.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_select.tex new file mode 100644 index 0000000000..57461b4b8c --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_select.tex @@ -0,0 +1,146 @@ + + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_select:} select entries based on an index-unary operator} +%=============================================================================== +\label{select} + +The \verb'GrB_select' function is the generic name for 30 specific functions, +depending on whether it operates on a matrix or vector, and depending on the +type of the scalar \verb'y': (matrix or vector) x (13 built-in types, +\verb'void *' for user-defined types, and a \verb'GrB_Scalar'). The generic +name appears in the function prototypes, but the specific function name is used +when describing each variation. When discussing features that apply to both +versions, the simple name \verb'GrB_select' is used. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Vector\_select:} select entries from a vector} +%------------------------------------------------------------------------------- +\label{select_vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_select // w = accum (w, op(u)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Vector_select_*' applies a \verb'GrB_IndexUnaryOp' operator to the +entries of a vector. If the operator evaluates as \verb'true' for the entry +\verb'u(i)', it is copied to the vector \verb't', or not copied if the operator +evaluates to \verb'false'. The vector \verb't' is then written to the result +\verb'w' via the mask/accumulator step. This operation operates on vectors +just as if they were \verb'm'-by-1 matrices, except that GraphBLAS never +transposes a vector via the descriptor. Refer to the next section +(\ref{select_matrix}) on \verb'GrB_Matrix_select' for more details. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GrB\_Matrix\_select:} apply a select operator to a matrix} +%------------------------------------------------------------------------------- +\label{select_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_select // C=accum(C,op(A)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_Matrix_select_*' applies a \verb'GrB_IndexUnaryOp' operator to the +entries of a matrix. If the operator evaluates as \verb'true' for the entry +\verb'A(i,j)', it is copied to the matrix \verb'T', or not copied if the +operator evaluates to \verb'false'. The input matrix \verb'A' may be +transposed first. The entries in \verb'A' are typecasted into the \verb'xtype' +of the select operator. The final step is ${\bf C \langle M \rangle = C \odot +T}$, as described in Section~\ref{accummask}. + +The matrix \verb'T' has the same size and type as \verb'A' (or the transpose of +\verb'A' if the input is transposed via the descriptor). The entries of +\verb'T' are a subset of those of \verb'A'. Each entry \verb'A(i,j)' of +\verb'A' is passed to the \verb'op', as $z=f(a_{ij},i,j,y)$. If +\verb'A' is transposed first then the operator is applied to entries in the +transposed matrix, \verb"A'". If $z$ is returned as true, then the entry is +copied into \verb'T', unchanged. If it returns false, the entry does not +appear in \verb'T'. + +The action of \verb'GrB_select' with the built-in index-unary operators is +described in the table below. The MATLAB analogs are precise for \verb'tril' +and \verb'triu', but shorthand for the other operations. The MATLAB +\verb'diag' function returns a column with the diagonal, if \verb'A' is a +matrix, whereas the matrix \verb'T' in \verb'GrB_select' always has the same +size as \verb'A' (or its transpose if the \verb'GrB_INP0' is set to +\verb'GrB_TRAN'). In the MATLAB analog column, \verb'diag' is as if it +operates like \verb'GrB_select', where \verb'T' is a matrix. + +The following operators may be used on matrices with a user-defined type: +\verb'GrB_ROWINDEX_*', +\verb'GrB_COLINDEX_*', +\verb'GrB_DIAGINDEX_*', +\verb'GrB_TRIL', \newline +\verb'GrB_TRIU', +\verb'GrB_DIAG', +\verb'GrB_OFFIAG', +\verb'GrB_COLLE', +\verb'GrB_COLGT', +\verb'GrB_ROWLE', +and +\verb'GrB_ROWGT'. + +For floating-point values, comparisons with \verb'NaN' always return false. +The \verb'GrB_VALUE*' operators should not be used with a scalar \verb'y' that is +equal to \verb'NaN'. For this case, create a user-defined index-unary operator that +performs the test with the ANSI C \verb'isnan' function instead. + +\vspace{0.2in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS name & MATLAB/Octave & description \\ + & analog & \\ +\hline +\verb'GrB_ROWINDEX_*' & \verb'z=i+y' & select \verb'A(i,j)' if \verb'i != -y' \\ +\verb'GrB_COLINDEX_*' & \verb'z=j+y' & select \verb'A(i,j)' if \verb'j != -y' \\ +\verb'GrB_DIAGINDEX_*' & \verb'z=j-(i+y)' & select \verb'A(i,j)' if \verb'j != i+y' \\ +\hline +\verb'GrB_TRIL' & \verb'z=(j<=(i+y))' & select entries on or below the \verb'y'th diagonal \\ +\verb'GrB_TRIU' & \verb'z=(j>=(i+y))' & select entries on or above the \verb'y'th diagonal \\ +\verb'GrB_DIAG' & \verb'z=(j==(i+y))' & select entries on the \verb'y'th diagonal \\ +\verb'GrB_OFFDIAG' & \verb'z=(j!=(i+y))' & select entries not on the \verb'y'th diagonal \\ +\verb'GrB_COLLE' & \verb'z=(j<=y)' & select entries in columns 0 to \verb'y' \\ +\verb'GrB_COLGT' & \verb'z=(j>y)' & select entries in columns \verb'y+1' and above \\ +\verb'GrB_ROWLE' & \verb'z=(i<=y)' & select entries in rows 0 to \verb'y' \\ +\verb'GrB_ROWGT' & \verb'z=(i>y)' & select entries in rows \verb'y+1' and above \\ +\hline +\verb'GrB_VALUENE_T' & \verb'z=(aij!=y)' & select \verb'A(i,j)' if it is not equal to \verb'y'\\ +\verb'GrB_VALUEEQ_T' & \verb'z=(aij==y)' & select \verb'A(i,j)' is it equal to \verb'y'\\ +\verb'GrB_VALUEGT_T' & \verb'z=(aij>y)' & select \verb'A(i,j)' is it greater than \verb'y' \\ +\verb'GrB_VALUEGE_T' & \verb'z=(aij>=y)' & select \verb'A(i,j)' is it greater than or equal to \verb'y' \\ +\verb'GrB_VALUELT_T' & \verb'z=(aij = accum (w(I),u) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w(I) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_subassign' operates on a subvector \verb'w(I)' of \verb'w', +modifying it with the vector \verb'u'. The method is identical to +\verb'GxB_Matrix_subassign' described in Section~\ref{subassign_matrix}, where +all matrices have a single column each. The \verb'mask' has the same size as +\verb'w(I)' and \verb'u'. The only other difference is that the input \verb'u' +in this method is not transposed via the \verb'GrB_INP0' descriptor. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_subassign\_Vector:} assign to a subvector } +%------------------------------------------------------------------------------- +\label{subassign_vector_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // w(I) = accum (w(I),u) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_subassign_Vector' is identical to \verb'GxB_Vector_subassign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_subassign:} assign to a submatrix } +%------------------------------------------------------------------------------- +\label{subassign_matrix} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(I,J), Mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_subassign' operates only on a submatrix \verb'S' of \verb'C', +modifying it with the matrix \verb'A'. For this operation, the result is not +the entire matrix \verb'C', but a submatrix \verb'S=C(I,J)' of \verb'C'. The +steps taken are as follows, except that ${\bf A}$ may be optionally transposed +via the \verb'GrB_INP0' descriptor option. + +\vspace{0.1in} +\begin{tabular}{lll} +\hline +Step & GraphBLAS & description \\ + & notation & \\ +\hline +1 & ${\bf S} = {\bf C(I,J)}$ & extract the ${\bf C(I,J)}$ submatrix \\ +2 & ${\bf S \langle M \rangle} = {\bf S} \odot {\bf A}$ & apply the accumulator/mask to the submatrix ${\bf S}$\\ +3 & ${\bf C(I,J)}= {\bf S}$ & put the submatrix ${\bf S}$ back into ${\bf C(I,J)}$ \\ +\hline +\end{tabular} +\vspace{0.1in} + +The accumulator/mask step in Step 2 is the same as for all other GraphBLAS +operations, described in Section~\ref{accummask}, except that for +\verb'GxB_subassign', it is applied to just the submatrix ${\bf S} = {\bf +C(I,J)}$, and thus the \verb'Mask' has the same size as ${\bf A}$, +${\bf S}$, and ${\bf C(I,J)}$. + +The \verb'GxB_subassign' operation is the reverse of matrix extraction: + +\begin{itemize} +\item +For submatrix extraction, \verb'GrB_Matrix_extract', +the submatrix \verb'A(I,J)' appears on the right-hand side of the assignment, +\verb'C=A(I,J)', and entries outside of the submatrix are not accessed and do +not take part in the computation. + +\item +For submatrix assignment, \verb'GxB_Matrix_subassign', +the submatrix \verb'C(I,J)' appears on the left-hand-side of the assignment, +\verb'C(I,J)=A', and entries outside of the submatrix are not accessed and do +not take part in the computation. + +\end{itemize} + +In both methods, the accumulator and mask modify the submatrix of the +assignment; they simply differ on which side of the assignment the submatrix +resides on. In both cases, if the \verb'Mask' matrix is present it is the same +size as the submatrix: + +\begin{itemize} + +\item +For submatrix extraction, +${\bf C \langle M \rangle = C \odot A(I,J)}$ is computed, +where the submatrix is on the right. +The mask ${\bf M}$ has the same size as the submatrix ${\bf A(I,J)}$. + +\item +For submatrix assignment, +${\bf C(I,J) \langle M \rangle = C(I,J) \odot A}$ is computed, +where the submatrix is on the left. +The mask ${\bf M}$ has the same size as the submatrix ${\bf C(I,J)}$. + +\end{itemize} + +In Step 1, the submatrix \verb'S' is first computed by the +\verb'GrB_Matrix_extract' operation, \verb'S=C(I,J)'. + +Step 2 accumulates the results ${\bf S \langle M \rangle = S \odot T}$, +exactly as described in Section~\ref{accummask}, but operating on the submatrix +${\bf S}$, not ${\bf C}$, using the optional \verb'Mask' and \verb'accum' +operator. The matrix ${\bf T}$ is simply ${\bf T}={\bf A}$, or ${\bf T}={\bf +A}^{\sf T}$ if ${\bf A}$ is transposed via the \verb'desc' descriptor, +\verb'GrB_INP0'. The \verb'GrB_REPLACE' option in the descriptor clears ${\bf +S}$ after computing ${\bf Z = T}$ or ${\bf Z = C \odot T}$, not all of ${\bf +C}$ since this operation can only modify the specified submatrix of ${\bf C}$. + +Finally, Step 3 writes the result (which is the modified submatrix \verb'S' and +not all of \verb'C') back into the \verb'C' matrix that contains it, via the +assignment \verb'C(I,J)=S', using the reverse operation from the method +described for matrix extraction: + + {\footnotesize + \begin{verbatim} + for i = 1:ni + for j = 1:nj + if (S (i,j).pattern) + C (I(i),J(j)).matrix = S (i,j).matrix ; + C (I(i),J(j)).pattern = true ; + end + end + end \end{verbatim}} + +\paragraph{\bf Performance considerations:} % C(I,J) = A +If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if +the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is +fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true +if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_subassign\_Vector:} assign to a submatrix } +%------------------------------------------------------------------------------- +\label{subassign_matrix_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_subassign_Vector' is identical to \verb'GxB_Matrix_subassign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries, and the column indices are given by the \verb'GrB_Vector J' with +\verb'nj' entries. The interpretation of \verb'I_vector' and \verb'J_vector' +are controlled by descriptor setting \verb'GxB_ROWINDEX_LIST' and +\verb'GxB_COLINDEX_LIST', respectively. The method can use either the indices +or values of each of the input vectors, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Col\_subassign:} assign to a sub-column of a matrix} +%------------------------------------------------------------------------------- +\label{subassign_column} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for C(I,j) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Col_subassign' modifies a single sub-column of a matrix \verb'C'. It +is the same as \verb'GxB_Matrix_subassign' where the index vector \verb'J[0]=j' +is a single column index (and thus \verb'nj=1'), and where all matrices in +\verb'GxB_Matrix_subassign' (except \verb'C') consist of a single column. The +\verb'mask' vector has the same size as \verb'u' and the sub-column +\verb'C(I,j)'. The input descriptor \verb'GrB_INP0' is ignored; the input +vector \verb'u' is not transposed. Refer to \verb'GxB_Matrix_subassign' for +further details. + +\paragraph{\bf Performance considerations:} % C(I,j) = u +\verb'GxB_Col_subassign' is much faster than \verb'GxB_Row_subassign' if the +format of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GxB_Row_subassign' is much +faster than \verb'GxB_Col_subassign' if the format of \verb'C' is +\verb'GrB_ROWMAJOR'. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Col\_subassign\_Vector:} assign to a sub-column of a matrix} +%------------------------------------------------------------------------------- +\label{subassign_column_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + const GrB_Index j, // column index + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Col_subassign_Vector' is identical to \verb'GxB_Col_subassign', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Row\_subassign:} assign to a sub-row of a matrix} +%------------------------------------------------------------------------------- +\label{subassign_row} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(i,J) = accum (C(i,J),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + const GrB_Index i, // row index + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(i,J) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Row_subassign' modifies a single sub-row of a matrix \verb'C'. It is +the same as \verb'GxB_Matrix_subassign' where the index vector \verb'I[0]=i' is +a single row index (and thus \verb'ni=1'), and where all matrices in +\verb'GxB_Matrix_subassign' (except \verb'C') consist of a single row. The +\verb'mask' vector has the same size as \verb'u' and the sub-column +\verb'C(I,j)'. The input descriptor \verb'GrB_INP0' is ignored; the input +vector \verb'u' is not transposed. Refer to \verb'GxB_Matrix_subassign' for +further details. + +\paragraph{\bf Performance considerations:} % C(i,J) = u' +\verb'GxB_Col_subassign' is much faster than \verb'GxB_Row_subassign' if the +format of \verb'C' is \verb'GrB_COLMAJOR'. \verb'GxB_Row_subassign' is much +faster than \verb'GxB_Col_subassign' if the format of \verb'C' is +\verb'GrB_ROWMAJOR'. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Row\_subassign\_Vector:} assign to a sub-row of a matrix} +%------------------------------------------------------------------------------- +\label{subassign_row_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Row_subassign_Vector // C(i,J) = accum (C(i,J),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + const GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Row_subassign_Vector' is identical to \verb'GrB_Row_subassign', +except that the column indices are given by the \verb'GrB_Vector J' with \verb'nj' +entries. The interpretation of \verb'J_vector' is controlled by descriptor +setting \verb'GxB_COLINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_subassign\_$<$type$>$:} assign a scalar to a subvector} +%------------------------------------------------------------------------------- +\label{subassign_vector_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) + const x, // scalar to assign to w(I) + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w(I) and mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_subassign_' assigns a single scalar to an entire +subvector of the vector \verb'w'. The operation is exactly like setting a +single entry in an \verb'n'-by-1 matrix, \verb'A(I,0) = x', where the column +index for a vector is implicitly \verb'j=0'. +If \verb'x' is a \verb'GrB_Scalar', the nonpolymorphic name of the method is +\verb'GxB_Vector_subassign_Scalar'. +For further details of this +function, see \verb'GxB_Matrix_subassign_' in +Section~\ref{subassign_matrix_scalar}. + + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Vector\_subassign\_Scalar\_Vector:} assign a scalar to a subvector} +%------------------------------------------------------------------------------- +\label{subassign_vector_scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Vector_subassign_Scalar_Vector' is identical to \verb'GxB_Vector_subassign_Scalar', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries. The interpretation of \verb'I_vector' is controlled by descriptor +setting \verb'GxB_ROWINDEX_LIST'. The method can use either the indices or +values of the input vector, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_subassign\_$<$type$>$:} assign a scalar to a submatrix} +%------------------------------------------------------------------------------- +\label{subassign_matrix_scalar} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const x, // scalar to assign to C(I,J) + const GrB_Index *I, // row indices + const GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + const GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(I,J) and Mask +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_subassign_' assigns a single scalar to an entire +submatrix of \verb'C', like the {\em scalar expansion} \verb'C(I,J)=x' in +MATLAB. The scalar \verb'x' is implicitly expanded into a matrix \verb'A' of +size \verb'ni' by \verb'nj', with all entries present and equal to \verb'x', +and then the matrix \verb'A' is assigned to +\verb'C(I,J)' using the same method as in \verb'GxB_Matrix_subassign'. Refer +to that function in Section~\ref{subassign_matrix} for further details. +For the accumulation step, the scalar \verb'x' is typecasted directly into the +type of \verb'C' when the \verb'accum' operator is not applied to it, or into +the \verb'ytype' of the \verb'accum' operator, if \verb'accum' is not NULL, for +entries that are already present in \verb'C'. + +The \verb' x' notation is otherwise the same as +\verb'GrB_Matrix_setElement' (see Section~\ref{matrix_setElement}). Any value +can be passed to this function and its type will be detected, via the +\verb'_Generic' feature of C11. For a user-defined type, \verb'x' is a +\verb'void *' pointer that points to a memory space holding a single entry of a +scalar that has exactly the same user-defined type as the matrix \verb'C'. +This user-defined type must exactly match the user-defined type of \verb'C' +since no typecasting is done between user-defined types. + +If a \verb'void *' pointer is passed in and the type of the underlying scalar +does not exactly match the user-defined type of \verb'C', then results are +undefined. No error status will be returned since GraphBLAS has no way of +catching this error. + +If \verb'x' is a \verb'GrB_Scalar', the nonpolymorphic name of the method is \newline +\verb'GxB_Matrix_subassign_Scalar'. In this case, if \verb'x' has no entry, then +it is implicitly expanded into a matrix \verb'A' of size \verb'ni' by +\verb'nj', with no entries present. + +\paragraph{\bf Performance considerations:} % C(I,J) = scalar +If \verb'A' is not transposed: if \verb'|I|' is small, then it is fastest if +the format of \verb'C' is \verb'GrB_ROWMAJOR'; if \verb'|J|' is small, then it is +fastest if the format of \verb'C' is \verb'GrB_COLMAJOR'. The opposite is true +if \verb'A' is transposed. + +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_Matrix\_subassign\_Scalar\_Vector:} assign a scalar to a submatrix} +%------------------------------------------------------------------------------- +\label{subassign_matrix_scalar_Vector} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_subassign // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_Matrix_subassign_Scalar_Vector' is identical to \verb'GxB_Matrix_subassign_Scalar', +except that the row indices are given by the \verb'GrB_Vector I' with \verb'ni' +entries, and the column indices are given by the \verb'GrB_Vector J' with +\verb'nj' entries. The interpretation of \verb'I_vector' and \verb'J_vector' +are controlled by descriptor setting \verb'GxB_ROWINDEX_LIST' and +\verb'GxB_COLINDEX_LIST', respectively. The method can use either the indices +or values of each of the input vectors, or it can use the values as a stride +(\verb'lo:inc:hi'); the default is to use the values. See Section~\ref{ijxvector} +for details. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_transpose.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_transpose.tex new file mode 100644 index 0000000000..aa38d68d51 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_transpose.tex @@ -0,0 +1,35 @@ + + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_transpose:} transpose a matrix} %========================= +%=============================================================================== +\label{transpose} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_transpose // C = accum (C, A') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, Mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_transpose' +transposes a matrix \verb'A', just like the array transpose \verb"T = A.'" in +MATLAB. The internal result matrix \verb"T = A'" (or merely \verb"T = A" if +\verb'A' is transposed via the descriptor) has the same type as \verb'A'. The +final step is ${\bf C \langle M \rangle = C \odot T}$, as described in +Section~\ref{accummask}, which typecasts \verb'T' as needed and applies the +mask and accumulator. + +To be consistent with the rest of the GraphBLAS API regarding the +descriptor, the input matrix \verb'A' may be transposed first by +setting the \verb'GrB_INP0' setting to \verb'GrB_TRAN'. This results in +a double transpose, and thus \verb'A' is not transposed is computed. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_operations_vxm.tex b/GraphBLAS/Doc/UserGuide/GrB_operations_vxm.tex new file mode 100644 index 0000000000..c69fe9e401 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_operations_vxm.tex @@ -0,0 +1,52 @@ + +\newpage +%=============================================================================== +\subsection{{\sf GrB\_vxm:} vector-matrix multiply} %=========================== +%=============================================================================== +\label{vxm} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_vxm // w' = accum (w, u'*A) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for u'*A + const GrB_Vector u, // first input: vector u + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A +) ; +\end{verbatim} } \end{mdframed} + +\verb'GrB_vxm' multiplies a row vector \verb"u'" times a matrix \verb'A'. The +matrix \verb'A' may be first transposed according to \verb'desc' (as the second +input, \verb'GrB_INP1'); the column vector \verb'u' is never transposed via the +descriptor. The inputs \verb'u' and \verb'A' are typecasted to match the +\verb'xtype' and \verb'ytype' inputs, respectively, of the multiply operator of +the \verb'semiring'. Next, an intermediate column vector \verb"t=A'*u" is +computed on the \verb'semiring' using the same method as \verb'GrB_mxm'. +Finally, the column vector \verb't' is typecasted from the \verb'ztype' of the +multiply operator of the \verb'semiring' into the type of \verb'w', and the +results are written back into \verb'w' using the optional accumulator +\verb'accum' and \verb'mask'. + +The last step is ${\bf w \langle m \rangle = w \odot t}$, as described +in Section~\ref{accummask}, except that all the +terms are column vectors instead of matrices. + +\paragraph{\bf Performance considerations:} % u'=u'*A +If the \verb'GrB_STORAGE_ORIENTATION_HINT' of \verb'A' is \verb'GrB_ROWMAJOR', and the default +descriptor is used (\verb'A' is not transposed), then \verb'GrB_vxm' is faster +than than \verb'GrB_mxv' with its default descriptor, when the vector \verb'u' +is very sparse. +However, if the \verb'GrB_STORAGE_ORIENTATION_HINT' of \verb'A' is \verb'GrB_COLMAJOR', then +\verb'GrB_mxv' with its default descriptor is faster than \verb'GrB_vxm' with +its default descriptor, when the vector \verb'u' is very sparse. +Using the non-default \verb'GrB_TRAN' descriptor for \verb'A' makes the +\verb'GrB_vxm' operation equivalent to \verb'GrB_mxv' with its default +descriptor (with the operands reversed in the multiplier, as well). The +reverse is true as well; \verb'GrB_mxv' with \verb'GrB_TRAN' is the same as +\verb'GrB_vxm' with a default descriptor. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_performance.tex b/GraphBLAS/Doc/UserGuide/GrB_performance.tex new file mode 100644 index 0000000000..7fc50b481e --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_performance.tex @@ -0,0 +1,315 @@ + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Performance} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{perf} + +Getting the best performance out of an algorithm that relies on GraphBLAS can +depend on many factors. This section describes some of the possible +performance pitfalls you can hit when using SuiteSparse:GraphBLAS, and how to +avoid them (or at least know when you've encountered them). + +%------------------------------------------------------------------------------- +\subsection{The burble is your friend} +%------------------------------------------------------------------------------- + +Turn on the burble with \verb'GrB_set (GrB_GLOBAL, true, GxB_BURBLE)'. You will get a +single line of output from each (significant) call to GraphBLAS. +The burble output can help you detect when you are likely using sub-optimal +methods, as described in the next sections. +When the JIT is in use the burble reports when a JIT kernel is run (which +is quick), loaded for the first time (which takes a small amount of time), +and when a JIT kernels is compiled (which can take a few tenths of a second +or more). The compiler command is printed in full. If you encounter a +compiler error, you can cut-and-paste the compiler command while outside +of your application to help track down the compiler error. + +%------------------------------------------------------------------------------- +\subsection{Data types and typecasting: use the JIT} +%------------------------------------------------------------------------------- + +If the JIT is disabled, +avoid mixing data types and relying on typecasting as much as possible. +SuiteSparse:GraphBLAS has a set of highly-tuned kernels for each data type, +and many operators and semirings, but there are too many combinations to +generate ahead of time. If typecasting is required, or if +SuiteSparse:GraphBLAS does not have a kernel for the specific operator or +semiring, the word \verb'generic' will appear in the burble. The generic +methods rely on function pointers for each operation on every scalar, so they +are slow. Enabling the JIT avoids this problem, since GraphBLAS can then +compile kernel specific to the types used. + +Without the JIT, +the only time that typecasting is fast is when computing \verb'C=A' via +\verb'GrB_assign' or \verb'GrB_apply', where the data types of \verb'C' and +\verb'A' can differ. In this case, one of $13^2 = 169$ kernels are called, +each of which performs the specific typecasting requested, without relying on +function pointers. + +%------------------------------------------------------------------------------- +\subsection{Matrix data structures: sparse, hypersparse, bitmap, or full} +%------------------------------------------------------------------------------- + +SuiteSparse:GraphBLAS tries to automatically determine the best data structure +for your matrices and vectors, selecting between sparse, hypersparse, bitmap, +and full formats. By default, all 4 formats can be used. A matrix typically +starts out hypersparse when it is created by \verb'GrB_Matrix_new', and then +changes during its lifetime, possibly taking on all four different formats +at different times. This can be modified via \verb'GrB_set'. For example, +this line of code: + + {\footnotesize + \begin{verbatim} + GrB_set (A, GxB_SPARSE + GxB_BITMAP, GxB_SPARSITY_CONTROL) ; \end{verbatim}} + +\noindent +tells SuiteSparse that the matrix \verb'A' can be held in either sparse or +bitmap format (at its discretion), but not hypersparse or full. The bitmap +format will be used if the matrix has enough entries, or sparse otherwise. +Sometimes this selection is best controlled by the user algorithm, so a single +format can be requested: + + {\footnotesize + \begin{verbatim} + GrB_set (A, GxB_SPARSE, GxB_SPARSITY_CONTROL) ; \end{verbatim}} + +This ensures that SuiteSparse will primarily use the sparse format. This is +still just a hint, however. The data structure is opaque and SuiteSparse is +free to choose otherwise. In particular, if you insist on using only the +\verb'GxB_FULL' format, then that format is used when all entries are present. +However, if the matrix is not actually full with all entries present, then the +bitmap format is used instead. The full format does not preserve the sparsity +structure in this case. Any GraphBLAS library must preserve the proper +structure, per the C Specification. This is critical in a graph algorithm, +since an edge $(i,j)$ of weight zero, say, is not the same as no edge $(i,j)$ +at all. + +%------------------------------------------------------------------------------- +\subsection{Matrix formats: by row or by column, or using the transpose of +a matrix} +%------------------------------------------------------------------------------- + +By default, SuiteSparse uses a simple rule: +all matrices are held by row, unless the consist of a single +column, in which case they are held by column. All vectors are treated as if +they are $n$-by-1 matrices with a single column. Changing formats from +row-oriented to column-oriented can have significant performance implications, +so SuiteSparse never tries to outguess the application. It just uses this +simple rule. + +However, there are cases where changing the format can greatly improve +performance. There are two ways to handle this, which in the end are +equivalent in the SuiteSparse internals. You can change the format (row to +column oriented, or visa versa), or work with the explicit transpose of a +matrix in the same storage orientation. + +There are cases where SuiteSparse must explicitly transpose an input matrix, or +the output matrix, in order to perform a computation. For example, if all +matrices are held in row-oriented fashion, SuiteSparse does not have a method +for computing \verb"C=A'*B", where \verb'A' is transposed. Thus, SuiteSparse +either computes a temporary transpose of its input matrix \verb'AT=A' and then +\verb'C=AT*B', or it swaps the computations, performing \verb"C=(B'*A)'", which +requires an explicit transpose of \verb'BT=B', and a transpose of the final +result to obtain \verb'C'. + +These temporary transposes are costly to compute, taking time and memory. They +are not kept, but are discarded when the method returns to the user +application. If you see the term \verb'transpose' in the burble output, and if +you need to perform this computation many times, try constructing your own +explicit transpose, say \verb"AT=A'", via \verb'GrB_transpose', or create a +copy of \verb'A' but held in another orientation via \verb'GrB_set'. For +example, assuming the default matrix format is by-row, and that \verb'A' is +\verb'm'-by-\verb'n' of type \verb'GrB_FP32': + + {\footnotesize + \begin{verbatim} + // method 1: AT = A' + GrB_Matrix_new (AT, GrB_FP32, n, m) ; + GrB_transpose (AT, NULL, NULL, A, NULL) ; + + // method 2: A2 = A but held by column instead of by row + // note: doing the set before the assign is faster than the reverse + GrB_Matrix_new (A2, GrB_FP32, m, n) ; + GrB_set (A2, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT) ; + GrB_assign (A2, NULL, NULL, A, GrB_ALL, m, GrB_ALL, n, NULL) ; \end{verbatim}} + +Internally, the data structure for \verb'AT' and \verb'A2' are nearly identical +(that is, the tranpose of \verb'A' held in row format is the same as \verb'A' +held in column format). Using either of them in subsequent calls to GraphBLAS +will allow SuiteSparse to avoid computing an explicit transpose. The two +matrices \verb'AT' and \verb'A2' do differ in one very significant way: their +dimensions are different, and they behave differement mathematically. +Computing \verb"C=A'*B" using these matrices would differ: + + {\footnotesize + \begin{verbatim} + // method 1: C=A'*B using AT + GrB_mxm (C, NULL, NULL, semiring, AT, B, NULL) ; + + // method 2: C=A'*B using A2 + GrB_mxm (C, NULL, NULL, semiring, A2, B, GrB_DESC_T0) ; \end{verbatim}} + +The first method computes \verb'C=AT*B'. The second method computes +\verb"C=A2'*B", but the result of both computations is the same, and internally +the same kernels will be used. + +%------------------------------------------------------------------------------- +\subsection{Push/pull optimization} +%------------------------------------------------------------------------------- + +Closely related to the discussion above on when to use a matrix or its +transpose is the exploitation of ``push/pull'' direction optimization. In +linear algebraic terms, this is simply deciding whether to multiply by the +matrix or its transpose. Examples can be see in the BFS and +Betweeness-Centrality methods of LAGraph. Here is the BFS kernel: + + {\footnotesize + \begin{verbatim} + int sparsity = do_push ? GxB_SPARSE : GxB_BITMAP ; + GrB_set (q, sparsity, GxB_SPARSITY_CONTROL) ; + if (do_push) + { + // q'{!pi} = q'*A + GrB_vxm (q, pi, NULL, semiring, q, A, GrB_DESC_RSC) ; + } + else + { + // q{!pi} = AT*q + GrB_mxv (q, pi, NULL, semiring, AT, q, GrB_DESC_RSC) ; + }\end{verbatim}} + +The call to \verb'GrB_set' is optional, since SuiteSparse will likely already +determine that a bitmap format will work best when the frontier \verb'q' has +many entries, which is also when the pull step is fastest. The push step +relies on a sparse vector times sparse matrix method originally due to +Gustavson. The output is computed as a set union of all rows \verb'A(i,:)' +where \verb'q(i)' is present on input. This set union is very fast when +\verb'q' is very sparse. The pull step relies on a sequence of dot product +computations, one per possible entry in the output \verb'q', and it uses the +matrix \verb"AT" which is a row-oriented copy of the explicit transpose of the +adjacency matrix \verb'A'. + +Mathematically, the results of the two methods are identical, but internally, +the data format of the input matrices is very different (using \verb'A' held +by row, or \verb'AT' held by row which is the same as a copy of \verb'A' that +is held by column), and the algorithms used are very different. + +%------------------------------------------------------------------------------- +\subsection{Computing with full matrices and vectors} +%------------------------------------------------------------------------------- + +Sometimes the best approach to getting the highest performance is to use dense +vectors, and occassionaly dense matrices are tall-and-thin or short-and-fat. +Packages such as Julia, Octave, or MATLAB, when dealing with the conventional +plus-times semirings, assume that multiplying a sparse matrix \verb'A' times a +dense vector \verb'x', \verb'y=A*x', will result in a dense vector \verb'y'. +This is not always the case, however. GraphBLAS must always return a result +that respects the sparsity structure of the output matrix or vector. If the +$i$th row of \verb'A' has no entries then \verb'y(i)' must not appear as an +entry in the vector \verb'y', so it cannot be held as a full vector. As a +result, the following computation can be slower than it could be: + + {\footnotesize + \begin{verbatim} + GrB_mxv (y, NULL, NULL, semiring, A, x, NULL) ; \end{verbatim}} + +SuiteSparse must do extra work to compute the sparsity of this vector \verb'y', +but if this is not needed, and \verb'y' can be padded with zeros (or +the identity value of the monoid, to be precise), a faster method can be used, +by relying on the accumulator. Instead of computing \verb'y=A*x', set all +entries of \verb'y' to zero first, and then compute \verb'y+=A*x' where the +accumulator operator and type matches the monoid of the semiring. SuiteSparse +has special kernels for this case; you can see them in the burble as +\verb'F+=S*F' for example. + + {\footnotesize + \begin{verbatim} + // y = 0 + GrB_assign (y, NULL, NULL, 0, GrB_ALL, n, NULL) ; + // y += A*x + GrB_mxv (y, NULL, GrB_PLUS_FP32, GrB_PLUS_TIMES_SEMIRING_FP32, A, x, NULL) ; \end{verbatim}} + +You can see this computation in the LAGraph PageRank method, where all +entries of \verb'r' are set to the \verb'teleport' scalar first. + + {\footnotesize + \begin{verbatim} + for (iters = 0 ; iters < itermax && rdiff > tol ; iters++) + { + // swap t and r ; now t is the old score + GrB_Vector temp = t ; t = r ; r = temp ; + // w = t ./ d + GrB_eWiseMult (w, NULL, NULL, GrB_DIV_FP32, t, d, NULL) ; + // r = teleport + GrB_assign (r, NULL, NULL, teleport, GrB_ALL, n, NULL) ; + // r += A'*w + GrB_mxv (r, NULL, GrB_PLUS_FP32, LAGraph_plus_second_fp32, AT, w, NULL) ; + // t -= r + GrB_assign (t, NULL, GrB_MINUS_FP32, r, GrB_ALL, n, NULL) ; + // t = abs (t) + GrB_apply (t, NULL, NULL, GrB_ABS_FP32, t, NULL) ; + // rdiff = sum (t) + GrB_reduce (&rdiff, NULL, GrB_PLUS_MONOID_FP32, t, NULL) ; + } \end{verbatim}} + +SuiteSparse exploits the iso-valued property of the scalar-to-vector assignment +of \verb'y=0', or \verb'r=teleport', and performs these assignments in O(1) +time and space. Because the \verb'r' vector start out as full on input to +\verb'GrB_mxv', and because there is an accumulatr with no mask, no entries in +the input/output vector \verb'r' will be deleted, even if \verb'A' has empty +rows. The call to \verb'GrB_mxv' exploits this, and is able to use a fast +kernel for this computation. SuiteSparse does not need to compute the sparsity +pattern of the vector \verb'r'. + +%------------------------------------------------------------------------------- +\subsection{Iso-valued matrices and vectors} +%------------------------------------------------------------------------------- + +Using iso-valued matrices and vectors is always faster than using matrices and +vectors whose entries can have different values. Iso-valued matrices are very +important in graph algorithms. For example, an unweighted graph is best +represented as an iso-valued sparse matrix, and unweighted graphs are very +common. The burble output, \verb'GxB_print', or \verb'GrB_get' +can all be used to report whether or not your matrix or +vector is iso-valued. + +Sometimes a matrix or vector may have values that are all the same, but +SuiteSparse hasn't detected this. If this occurs, you can force a matrix +or vector to be iso-valued by assigning a single scalar to all its entries. + + {\footnotesize + \begin{verbatim} + // C = 3.14159 + GrB_assign (C, C, NULL, 3.14159, GrB_ALL, m, GrB_ALL, n, GrB_DESC_S) ; \end{verbatim}} + +The matrix \verb'C' is used as its own mask. The descriptor is essential here, +telling the mask to be used in a structural sense, without regard to the values +of the entries in the mask. This assignment sets all entries that already +exist in \verb'C' to be equal to a single value, 3.14159. The sparsity +structure of \verb'C' does not change. Of course, any scalar can be used; the +value 1 is common for unweighted graphs. SuiteSparse:GraphBLAS performs the +above assignment in O(1) time and space, independent of the dimension of +\verb'C' or the number of entries in contains. + +%------------------------------------------------------------------------------- +\subsection{User-defined types and operators: use the JIT} +%------------------------------------------------------------------------------- + +If the JIT is disabled, these will be slow. With the JIT enabled, data types +and operators are just as fast as built-in types and operators. A CUDA JIT for +the GPU is in progress, collaboration with Joe Eaton and Corey Nolet. +A SYCL/OpenCL JIT is under consideration, but work has not yet been started. + +%------------------------------------------------------------------------------- +\subsection{About NUMA systems} +%------------------------------------------------------------------------------- + +I have tested this package extensively on multicore single-socket systems, but +have not yet optimized it for multi-socket systems with a NUMA architecture. +That will be done in a future release. If you publish benchmarks +with this package, please state the SuiteSparse:GraphBLAS version, and a caveat +if appropriate. If you see significant performance issues when going from a +single-socket to multi-socket system, I would like to hear from you so I can +look into it. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_print.tex b/GraphBLAS/Doc/UserGuide/GrB_print.tex new file mode 100644 index 0000000000..eb18a1a5f0 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_print.tex @@ -0,0 +1,422 @@ +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{fprint} + +The ten different objects handled by SuiteSparse:GraphBLAS are all opaque, +although nearly all of their contents can be extracted via methods such as +\verb'GrB_Matrix_extractTuples', \verb'GrB_Matrix_extractElement', +\verb'GrB_get', and so on. The GraphBLAS C API has no mechanism for +printing all the contents of GraphBLAS objects, but this is helpful for +debugging. Ten type-specific methods and two type-generic methods are +provided: + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{ll} +\hline +\verb'GxB_Type_fprint' & print and check a \verb'GrB_Type' \\ +\verb'GxB_UnaryOp_fprint' & print and check a \verb'GrB_UnaryOp' \\ +\verb'GxB_BinaryOp_fprint' & print and check a \verb'GrB_BinaryOp' \\ +\verb'GxB_IndexUnaryOp_fprint' & print and check a \verb'GrB_IndexUnaryOp' \\ +\verb'GxB_IndexBinaryOp_fprint'& print and check a \verb'GxB_IndexBinaryOp' \\ +\verb'GxB_Monoid_fprint' & print and check a \verb'GrB_Monoid' \\ +\verb'GxB_Semiring_fprint' & print and check a \verb'GrB_Semiring' \\ +\verb'GxB_Descriptor_fprint' & print and check a \verb'GrB_Descriptor' \\ +\verb'GxB_Context_fprint' & print and check a \verb'GxB_Context' \\ +\verb'GxB_Matrix_fprint' & print and check a \verb'GrB_Matrix' \\ +\verb'GxB_Vector_fprint' & print and check a \verb'GrB_Vector' \\ +\verb'GxB_Scalar_fprint' & print and check a \verb'GrB_Scalar' \\ +\hline +\verb'GxB_fprint' & print/check any object to a file \\ +\verb'GxB_print' & print/check any object to \verb'stdout' \\ +\hline +\end{tabular} +} +\vspace{0.2in} + +These methods do not modify the status of any object, and thus they +cannot return an error string for use by \verb'GrB_error'. + +If a matrix or vector +has not been completed, the pending computations are guaranteed to {\em not} be +performed. The reason is simple. It is possible for a bug in the user +application (such as accessing memory outside the bounds of an array) to mangle +the internal content of a GraphBLAS object, and the \verb'GxB_*print' methods +can be helpful tools to track down this bug. If \verb'GxB_*print' attempted to +complete any computations prior to printing or checking the contents of the +matrix or vector, then further errors could occur, including a segfault. + +By contrast, GraphBLAS methods and operations that return values into +user-provided arrays or variables might finish pending operations before the +return these values, and this would change their state. Since they do not +change the state of any object, the \verb'GxB_*print' methods provide a useful +method for debugging, and for a quick understanding of what GraphBLAS is +computing while developing a user application. + +Each of the methods has a parameter of type \verb'GxB_Print_Level' that +specifies the amount to print: + +{\footnotesize +\begin{verbatim} +typedef enum +{ + GxB_SILENT = 0, // nothing is printed, just check the object + GxB_SUMMARY = 1, // print a terse summary + GxB_SHORT = 2, // short description, about 30 entries of a matrix + GxB_COMPLETE = 3, // print the entire contents of the object + GxB_SHORT_VERBOSE = 4, // GxB_SHORT but with "%.15g" for doubles + GxB_COMPLETE_VERBOSE = 5 // GxB_COMPLETE but with "%.15g" for doubles +} +GxB_Print_Level ; \end{verbatim}} + +The ten type-specific functions include an additional argument, the +\verb'name' string. The \verb'name' is printed at the beginning of the display +(assuming the print level is not \verb'GxB_SILENT') so that the object can be +more easily identified in the output. For the type-generic methods +\verb'GxB_fprint' and \verb'GxB_print', the \verb'name' string is the variable +name of the object itself. + +If the file \verb'f' is \verb'NULL', \verb'stdout' is used. +If \verb'name' is \verb'NULL', it is treated +as the empty string. These are not error conditions. + +The methods check their input objects carefully and extensively, even when +\verb'pr' is equal to \verb'GxB_SILENT'. The following error codes can be +returned: + +\begin{packed_itemize} +\item \verb'GrB_SUCCESS': object is valid +\item \verb'GrB_UNINITIALIZED_OBJECT': object is not initialized +\item \verb'GrB_INVALID_OBJECT': object is not valid +\item \verb'GrB_NULL_POINTER': object is a NULL pointer +\item \verb'GrB_INVALID_VALUE': \verb'fprintf' returned an I/O error. +\end{packed_itemize} + +The content of any GraphBLAS object is opaque, and subject to change. As a +result, the exact content and format of what is printed is +implementation-dependent, and will change from version to version of +SuiteSparse:GraphBLAS. Do not attempt to rely on the exact content or format +by trying to parse the resulting output via another program. The intent of +these functions is to produce a report of an object for visual inspection. If +the user application needs to extract content from a GraphBLAS matrix or +vector, use \verb'GrB_*_extractTuples' or the import/export methods instead. + +GraphBLAS matrices and vectors are zero-based, where indices of an $n$-by-$n$ +matrix are in the range 0 to $n-1$. However, MATLAB, Octave, and Julia prefer +to print their matrices and vectors as one-based. To enable 1-based printing, +use \verb'GrB_set (GrB_GLOBAL, true, GxB_PRINT_1BASED)'. Printing is done as zero-based by +default. + +% \newpage +%=============================================================================== +\subsection{{\sf GxB\_fprint:} Print a GraphBLAS object to a file} %============ +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_fprint // print and check a GraphBLAS object +( + GrB_ object, // object to print and check + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +The \verb'GxB_fprint' function prints the contents of any of the ten GraphBLAS +objects to the file \verb'f'. If \verb'f' is \verb'NULL', the results are +printed to \verb'stdout'. For example, to print the entire contents of a +matrix \verb'A' to the file \verb'f', use +\verb'GxB_fprint (A, GxB_COMPLETE, f)'. + +%=============================================================================== +\subsection{{\sf GxB\_print:} Print a GraphBLAS object to {\sf stdout}} %======= +%=============================================================================== +\label{gxb_print} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_print // print and check a GrB_Vector +( + GrB_ object, // object to print and check + int pr, // print level (GxB_Print_Level) +) ; +\end{verbatim} } \end{mdframed} + +\verb'GxB_print' is the same as \verb'GxB_fprint', except that it prints the +contents of the object to \verb'stdout' instead of a file \verb'f'. For +example, to print the entire contents of a matrix \verb'A', use +\verb'GxB_print (A, GxB_COMPLETE)'. + +%=============================================================================== +\subsection{{\sf GxB\_Type\_fprint:} Print a {\sf GrB\_Type}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Type_fprint // print and check a GrB_Type +( + GrB_Type type, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, \verb'GxB_Type_fprint (GrB_BOOL, "boolean type", GxB_COMPLETE, f)' +prints the contents of the \verb'GrB_BOOL' object to the file \verb'f'. + +\newpage +%=============================================================================== +\subsection{{\sf GxB\_UnaryOp\_fprint:} Print a {\sf GrB\_UnaryOp}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp +( + GrB_UnaryOp unaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GxB_UnaryOp_fprint (GrB_LNOT, "not", GxB_COMPLETE, f)' +prints the \verb'GrB_LNOT' unary operator to the file \verb'f'. + + +%=============================================================================== +\subsection{{\sf GxB\_BinaryOp\_fprint:} Print a {\sf GrB\_BinaryOp}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp +( + GrB_BinaryOp binaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GxB_BinaryOp_fprint (GrB_PLUS_FP64, "plus", GxB_COMPLETE, f)' prints the +\verb'GrB_PLUS_FP64' binary operator to the file \verb'f'. + + +%=============================================================================== +\subsection{{\sf GxB\_IndexUnaryOp\_fprint:} Print a {\sf GrB\_IndexUnaryOp}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp +( + GrB_IndexUnaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GrB_IndexUnaryOp_fprint (GrB_TRIL, "tril", GxB_COMPLETE, f)' prints +the \verb'GrB_TRIL' index-unary operator to the file \verb'f'. + +\newpage +%=============================================================================== +\subsection{{\sf GxB\_IndexBinaryOp\_fprint:} Print a {\sf GxB\_IndexBinaryOp}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp +( + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +%=============================================================================== +\subsection{{\sf GxB\_Monoid\_fprint:} Print a {\sf GrB\_Monoid}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid +( + GrB_Monoid monoid, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GxB_Monoid_fprint (GxB_PLUS_FP64_MONOID, "plus monoid",' +\verb'GxB_COMPLETE, f)' +prints the predefined \verb'GxB_PLUS_FP64_MONOID' (based on the binary +operator \verb'GrB_PLUS_FP64') to the file \verb'f'. + +%=============================================================================== +\subsection{{\sf GxB\_Semiring\_fprint:} Print a {\sf GrB\_Semiring}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring +( + GrB_Semiring semiring, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GxB_Semiring_fprint (GxB_PLUS_TIMES_FP64, "standard",' +\verb'GxB_COMPLETE, f)' +prints the predefined \verb'GxB_PLUS_TIMES_FP64' semiring to the file \verb'f'. + +\newpage +%=============================================================================== +\subsection{{\sf GxB\_Descriptor\_fprint:} Print a {\sf GrB\_Descriptor}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor +( + GrB_Descriptor descriptor, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, +\verb'GxB_Descriptor_fprint (d, "descriptor", GxB_COMPLETE, f)' +prints the descriptor \verb'd' to the file \verb'f'. + +%=============================================================================== +\subsection{{\sf GxB\_Context\_fprint:} Print a {\sf GxB\_Context}} +%=============================================================================== +\label{context_print} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Context_fprint // print and check a GxB_Context +( + GxB_Context Context, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +This method can be used to print the context created for a user thread, +or the contents of the \verb'GxB_CONTEXT_WORLD' object. + +%=============================================================================== +\subsection{{\sf GxB\_Matrix\_fprint:} Print a {\sf GrB\_Matrix}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix +( + GrB_Matrix A, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, \verb'GxB_Matrix_fprint (A, "my matrix", GxB_SHORT, f)' +prints about 30 entries from the matrix \verb'A' to the file \verb'f'. + + +\newpage +%=============================================================================== +\subsection{{\sf GxB\_Vector\_fprint:} Print a {\sf GrB\_Vector}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Vector_fprint // print and check a GrB_Vector +( + GrB_Vector v, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, \verb'GxB_Vector_fprint (v, "my vector", GxB_SHORT, f)' +prints about 30 entries from the vector \verb'v' to the file \verb'f'. + +%=============================================================================== +\subsection{{\sf GxB\_Scalar\_fprint:} Print a {\sf GrB\_Scalar}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar +( + GrB_Scalar s, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + +For example, \verb'GxB_Scalar_fprint (s, "my scalar", GxB_SHORT, f)' +prints a short description of the scalar \verb's' to the file \verb'f'. + +%=============================================================================== +\subsection{Performance and portability considerations} +%=============================================================================== + +Even when the print level is \verb'GxB_SILENT', these methods extensively check +the contents of the objects passed to them, which can take some time. They +should be considered debugging tools only, not for final use in production. + +The return value of the \verb'GxB_*print' methods can be relied upon, but the +output to the file (or \verb'stdout') can change from version to version. If +these methods are eventually added to the GraphBLAS C API Specification, a +conforming implementation might never print anything at all, regardless of the +\verb'pr' value. This may be essential if the GraphBLAS library is installed +in a dedicated device, with no file output, for example. + +Some implementations may wish to print nothing at all if the matrix is not yet +completed, or just an indication that the matrix has pending operations and +cannot be printed, when non-blocking mode is employed. In this case, use +\verb'GrB_Matrix_wait', \verb'GrB_Vector_wait', or \verb'GxB_Scalar_wait' to +finish all pending computations first. If a matrix or vector has pending +operations, SuiteSparse:GraphBLAS prints a list of the {\em pending tuples}, +which are the entries not yet inserted into the primary data structure. It can +also print out entries that remain in the data structure but are awaiting +deletion; these are called {\em zombies} in the output report. + +Most of the rest of the report is self-explanatory. + diff --git a/GraphBLAS/Doc/UserGuide/GrB_references.tex b/GraphBLAS/Doc/UserGuide/GrB_references.tex new file mode 100644 index 0000000000..9392edea1d --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_references.tex @@ -0,0 +1,10 @@ + +%------------------------------------------------------------------------------- +% References +%------------------------------------------------------------------------------- +{\footnotesize +\addcontentsline{toc}{section}{References} +\bibliographystyle{annotate} +\bibliography{GraphBLAS_UserGuide.bib} +} + diff --git a/GraphBLAS/Doc/UserGuide/GrB_release.tex b/GraphBLAS/Doc/UserGuide/GrB_release.tex new file mode 100644 index 0000000000..ec3c276208 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_release.tex @@ -0,0 +1,1032 @@ + +%------------------------------------------------------------------------------- +\section{Release Notes} +%------------------------------------------------------------------------------- + +\begin{itemize} + +\item Mar 1, 2025: version 10.0.0 + + \begin{itemize} + + \item 32/64 bit matrices and vectors: the \verb'GrB_Matrix' and + \verb'GrB_Vector' now exploit 32-bit integers when possible. New + methods added to pass 32-bit integer arrays to/from \verb'GrB_build', + \verb'extract', \verb'assign', \verb'subassign', and + \verb'extractTuples'. New object, the \verb'GxB_Container' added for + fast import/export of matrices/vectors with arbitrary integer content. + + \item \verb'GrB_Field': this enum is strongly deprecated, and replaced with + \verb'typedef int GrB_Field'. This is an upward-compatible change to + the API, and will allow the creation of a future mathematical field + object in GraphBLAS. This type should not be used; use an int instead. + It will be replaced in a future version of GraphBLAS. + + \item enum parameters: replaced all enum parameters with int, to simplify + future updates to enum parameters, including the \verb'GrB_Field'. + + \item \verb'GxB_JIT_ERROR': added in 9.4.x, changed value to avoid conflict + with LAGraph error codes. + + \item pack/unpack: these are declared historical; they still work but use + 64-bit integers only. Use the new \verb'GxB_Container' methods + instead. + + \item \verb'GxB_Matrix_iso' and \verb'GxB_Vector_iso': declared + historical; use \verb'GrB_get' with the new \verb'GxB_ISO' enum. + + \item \verb'GxB_Matrix_type', \verb'GxB_Vector_type', + \verb'GxB_Scalar_type': no longer historical; + added back to the user guide. + + \item Summary: the API is upward-compatible with 9.4.x, but only after + the user application is recompiled with GraphBLAS v10.0.0. + As a result, the SO version must increase from 9 to 10. + + \end{itemize} + +\item Feb 20, 2025: version 9.4.5 + + \begin{itemize} + \item (59) bug fix: the \verb'GxB_NO_INT32' and \verb'GxB_NOT_INT64' flags + in \verb'GB_control.h' did not completely remove some of the INT32 and + INT64 factory kernels. Caught by Erik Welch, NVIDIA. + + \item workaround for an AppleClang compiler bug: On the Mac, the + \verb'Source/mask/GB_masker.c' file + triggers a bug in AppleClang 16.0.0 with -O3 in (MacOS 14.6.1 (23G93), + Xcode 16.2, Apple clang version 16.0.0, clang-1600.0.26.6). It also + fails in MacOS 15.2 (Target: arm64-apple-darwin23.6.0). The bug is + triggered by these tests in LAGraph (v1.2 branch, unreleased, Jan 4, + 2025): + \begin{verbatim} + 39 - LAGraphX_BF (SIGTRAP) + 40 - LAGraphX_Coarsen_Matching (Failed) + 41 - LAGraphX_FastGraphletTransform (SIGTRAP) + 49 - LAGraphX_PageRankGX (SIGTRAP) + 54 - LAGraphX_SquareClustering (SIGTRAP) + 61 - LAGraphX_msf (Failed) + \end{verbatim} + When using clang, optimization is turned off for this file. This has + no impact on performance since \verb'GB_masker.c' is very simple, + consisting of a single sequence of calls to other methods. + \end{itemize} + +\item Feb 17, 2024: version 9.4.4 + + \begin{itemize} + \item (58) bug fix: semirings with user-defined monoids and the \verb'GrB_ONEB' or + \verb'GxB_PAIR' operators caused a JIT compiler error. Caught by Gabe Gomez. + \item (57) bug fix: GraphBLAS.h header: remove duplicate definitions of + \verb'GxB_MAX_FIRST_*' semirings (incompletely moved to 'historical' section + in 9.4.2). + \end{itemize} + +\item Nov 20, 2024: version 9.4.2 + + \begin{itemize} + \item clarified User Guide: regarding when the hyper-hash is built + \item JIT: reduced JIT kernel encodings + \item (also includes the updates from 9.4.0.beta and 9.4.1.beta listed below). + \end{itemize} + +\item Nov 15, 2024: version 9.4.1 (only released as BETA) + + \begin{itemize} + \item More JIT kernels: all JIT kernels for \verb'GrB_assign', + \verb'GxB_subassign', \verb'GrB_extract', \verb'GxB_sort' + \verb'GrB_kronecker', the stand-alone mask phase (an internal method that + computes $\bf C \langle M \rangle = Z$), and utilities have been created. + All kernels formerly tagged in the code as \verb'JIT: needed' are now + finished. + \item + removed Factory kernels for: types int8 and uint8, and semirings: + max\_min, max\_plus, max\_times, min\_max, min\_times, plus\_min, + plus\_max, + non-Boolean land/lor/lxor/lxnor, and integer times\_first/second, + to reduce size of compiled library. + JIT kernels will be used instead for these types and semirings. + \item \verb'GxB_IndexBinaryOp': finalized and named as \verb'GxB_*'. + \end{itemize} + +\item Oct 15, 2024: version 9.4.0 (only released as BETA) + + \begin{itemize} + \item new operator and associated methods: + added the draft \verb'G*B_IndexBinaryOp'. + \item JIT error-handling behavior changed: if a compiler error occurs in + the JIT, \verb'GxB_JIT_ERROR' is now returned. Previously, GraphBLAS + would fall back to a generic method if such an error occurred. + \end{itemize} + +\item Aug 12, 2024: version 9.3.1 + + \begin{itemize} + \item (56) bug fix: wrong type for fgetc return value in JITpackage; leads + to infinite loop on some systems when building GraphBLAS. + \end{itemize} + +\item Aug 2, 2024: version 9.3.0 + + \begin{itemize} + \item code restructuring: Source folder split into many subfolders, and + some files and internal functions renamed. No visible external change. + \item (55) bug fix: \verb'GrB_apply' with user-defined index-unary op and + generic kernel. + \item (54) bug fix: reducing a huge iso full matrix to a scalar resulted in + integer overflow if nrows*ncols was larger than about $2^{60}$. + \item reduced size of compiled library: \verb'int16' and \verb'uint16' + types and operators for FactoryKernels are disabled in + \verb'GB_control.h'. The JIT will always be used instead. + \end{itemize} + +\item May 22, 2024: version 9.2.0 + + \begin{itemize} + \item Added \verb'graphblas_install.m' for a simpler method of compiling + the MATLAB/Octave interface for GraphBLAS. + \item JIT: sanitizing the JIT cache path, better burble for compiler errors. + \item \verb'GrB_get/GrB_set': better handling of concurrent get/set between + different user threads. + \end{itemize} + +\item Mar 22, 2024: version 9.1.0 + + \begin{itemize} + \item minor updates to build system + \item C11 complex type detection: this is now detected and configured by + cmake, instead of using an \verb'#if' ... in the GraphBLAS.h header. + This change was required to port GraphBLAS to the clang-cl compiler + on Windows when it simulates the MSVC compiler. Also added a new + feature (thus the minor version update to 9.1.0): + \verb'GxB_HAVE_COMPLEX*' to + GraphBLAS.h to indicate which kind of complex data types are available + in C11 or MSVC. Contributed by Markus M\"{u}tzel. + \item (53) bug fix: eWiseAdd \verb'C=A+B' when \verb'M', \verb'A', + and \verb'B' are all hypersparse; access to \verb'M' was incorrect + (also affects \verb'C+=T' for any operation, if \verb'M' and + \verb'T' are both hypersparse). + \end{itemize} + +\item Mar 1, 2024: version 9.0.3 + + \begin{itemize} + \item (52) performance bug fix: JIT kernels since v8.3.1 were not compiled + with OpenMP. + \end{itemize} + +\item Feb 26, 2024: version 9.0.2 + + \begin{itemize} + \item GraphBLAS/Makefile \verb"make static" was incorrect. + \end{itemize} + +\item Jan 20, 2024: version 9.0.1 + + \begin{itemize} + \item minor updates to build system + \end{itemize} + +\item Version 9.0.0, Jan 10, 2024 + + \begin{itemize} + \item \verb'GrB_get/GrB_set': new functions from the v2.1 C API. + \item \verb'GrB_Type_new', \verb'GrB_UnaryOp_new', + \verb'GrB_IndexUnaryOp_new': no longer macros, since \verb'GrB_set' can + be used to set the names of the operators. These methods no longer + extract the name, so the default name is now the empty string. This is + because \verb'GrB_get/set' can only set these names once. This is a + non-compatible change of behavior for these 3 methods, so + SuiteSparse:GraphBLAS must become v9.0.0. + \item historical methods: many methods are replaced by \verb'GrB_get' and + \verb'GrB_set'. They remain in SuiteSparse:GraphBLAS but have been + declared historical. Terse prototypes exist in GraphBLAS.h, and any + discussion is removed from the User Guide: \verb'GxB_get', + \verb'GxB_set', and the methods they call, and many more. Use + \verb'GrB_get/set' in place those methods, and for: + \verb'GxB_*type_name', \verb'GxB_*type', \verb'GxB_Monoid_operator', + \verb'GxB_Monoid_identity', \verb'GxB_Monoid_terminal', + \verb'GxB_Semiring_add', \verb'GxB_Semiring_multiply'. Use \newline + \verb'GrB_STORAGE_ORIENTATION_HINT' in place of \verb'GxB_FORMAT'. + \item \verb'hyper_hash': constructed only if the number of non-empty + vectors in a hypersparse matrix is large ($> 1024$, by default). + \item minor updates to build system: \verb'*.pc' files for \verb'pkgconfig' + \end{itemize} + +\item Dec 30, 2023: version 8.3.1 + + \begin{itemize} + \item remove \verb'#undef I' from \verb'GraphBLAS.h', so as not to conflict + with the definition of \verb'I' from \verb'complex.h'. + \item major change to build system: by Markus M\"{u}tzel + \end{itemize} + +\item Oct 7, 2023: version 8.2.1 + + \begin{itemize} + \item (49) bug fix: \verb'GrB_mxm' saxpy4 and saxpy5 had incorrectly handling of + typecasting in v8.0.0 to v8.2.0 (caught by Erik Welch) + \item cross-compiler support: replace \verb'check_c_source_runs' with \verb'_compiles' + for GraphBLAS and SuiteSparse\_config, and remove check for + \verb'getenv("HOME")'. + \item cmake update: add "None" build type, from Antonio Rojas, for Arch Linux + \end{itemize} + +\item Version 8.2.0, Sept 8, 2023 + + \begin{itemize} + \item cmake updates: \verb'SuiteSparse::' namespace by Markus M\"{u}tzel. + \end{itemize} + +\item Version 8.0.2, June 16, 2023 + + \begin{itemize} + \item added \verb'-DJITINIT=option': use \verb'-DJITINIT' to set the + initial state of the \verb'GxB_JIT_C_CONTROL' (4:on, 3:load, 2:run, + 1:pause, 0:off). The default is 4 (on) if the JIT is enabled, or 2 + (run) if \verb'-DNJIT=1' is set. + \item xxHash: upgraded to latest version as of June 16, 2023 + \end{itemize} + +\item Version 8.0.1, May 27, 2023 + + \begin{itemize} + \item (48) bug fix: \verb'GrB_*_nvals' + returned \verb'UINT64_MAX' ('infinity') for a + \verb'GrB_Vector' of size n-by-$2^{60}$; it should return $2^{60}$. + Caught by Erik Welch, NVIDIA. + \item added \verb'GxB_Context_error' and \verb'GxB_Context_wait' + \item \verb'C++': changed complex typedefs for \verb'C++' that + include GraphBLAS.h. Update from Markus M\"{u}tzel. + \end{itemize} + +\item Version 8.0.0 (May 18, 2023) + + \begin{itemize} + \item version 8: This version is a major SO version increase, since + it removes a few minor user-visible features from + SuiteSparse:GraphBLAS: the \verb'GrB_Descriptor' no longer supports + threading control, and some features of the \verb'GxB_SelectOp' are + removed (see below). Enum values have been changed for compatibility + with the upcoming \verb'GrB_set/get' features in the V2.1 C API. + \item The JIT: GraphBLAS v8.0.0 includes a JIT for the CPU kernels, + which can compile kernels at run-time. Added \verb'GxB_set/get' + options and environment variables to control the JIT. The + \verb'GxB_*Op_new' methods can accept NULL function pointers, if the + strings are provided, valid, and the JIT is enabled. + \item \verb'GxB_Type_new': the size of the type can be given as zero, + in which case the size is determined via a JIT kernel. + \item \verb'GxB_UnaryOp_new', \verb'GxB_BinaryOp_new', and + \verb'GxB_IndexUnaryOp_new': the function pointer can be given as + \verb'NULL', in which case the function is created by the JIT. + \item math kernels: revised for CUDA JIT. More accurate complex + floating-point for Mac OS on Apple Silicon. + \item \verb'Demo/wildtype_demo': change to double so that CPU and GPU + versions compute the same result. + \item \verb'GxB_get': can return malloc/calloc/realloc/free + \item \verb'GxB_Context': + an object for controlling computational resources: + number of OpenMP threads, the chunk factor, and (draft) GPU id. + \item \verb'GrB_Descriptor': + removed ability to control the number of OpenMP threads from the + descriptor (a rarely used feature). Replaced with the + \verb'GxB_Context' object. + \item \verb'GxB_SelectOp': GraphBLAS no longer supports + user-defined \verb'GxB_SelectOps'. Use a \verb'GrB_IndexUnaryOp' + instead. The \verb'GxB_SelectOp_new' and + \verb'GxB_SelectOp_free' functions are removed entirely. + The built-in \verb'GxB_SelectOps', \verb'GxB_Matrix_select', + \verb'GxB_Vector_select', and \verb'GxB_select' still work. However, + the \verb'GxB_EQ_THUNK', \verb'GxB_EQ_ZERO', \verb'GxB_NE_THUNK', and + \verb'GxB_NE_ZERO' operators no longer work on user-defined types, + as they did in v7.4.4 and earlier. + Create a user-defined \verb'GrB_IndexUnaryOp' to compute these + operations instead, and use \verb'GrB_select'. + \item \verb'alternative/Makefile': removed; not compatible with the JIT. + \item \verb'zstd': upgraded to v1.5.5 (Apr 4, 2023) + \end{itemize} + +\item Version 7.4.4 (Mar 25, 2023) + + \begin{itemize} + \item (47) bug fix: OpenMP atomics require \verb'seq_cst' on the ARM. + Revised \verb'GB_atomics.h' accordingly, and added them for all + architectures (caught by G{\'{a}}bor Sz{\'{a}}rnyas). + \end{itemize} + +\item Version 7.4.3 (Jan 20, 2023) + + \begin{itemize} + \item debug: turned on in \verb'GrB_Matrix_removeElement' by mistake. + \end{itemize} + +\item Version 7.4.2 (Jan 17, 2023) + + \begin{itemize} + \item minor change to build system: for SuiteSparse v7.0.0. + \item deprecation notice: in GraphBLAS v8.0.0, the ability to set the + number of threads, and chunk size, in the descriptor will be removed. + It still appears in v7.x, but will be replaced by a Context object + in v8.0.0. + \end{itemize} + +\item Version 7.4.1 (Dec 29, 2022) + + \begin{itemize} + \item global free pool: disabled. Benefit for single-thread user + applications was modest, and it causes too much contention in a + critical section when the user application is multi-threaded. + \item \verb'GrB_mxm': revised task creation heuristics for + sparse-times-sparse for better performance. + \end{itemize} + +\item Version 7.4.0 (Dec 23, 2022) + + \begin{itemize} + \item add non-\verb'va_arg' methods: \verb'va_arg'-based \verb'GxB_get/set' + methods are C11 but cause issues for cffi in Python. As a + temporary workaround, new methods have been added that do not use + \verb'va_arg'. The existing \verb'GxB_get/set' methods are not + changed. The new methods are not in the user guide, since all of the + \verb'GxB_get/set' methods will be superceded with \verb'GrB_get/set' + in the v2.1 C API. At that point, all \verb'GxB_get/set' methods will + become historical (kept, not deprecated, but removed from the user + guide). + \end{itemize} + +\item Version 7.3.3 (Dec 9, 2022) + + \begin{itemize} + \item \verb'stdatomic.h': using \verb'#include ' and + \newline + \verb'atomic_compare_exchange_weak' + instead of GCC/clang/icx \verb'__atomic_*' variants. + Added \verb'-latomic' if required. + \item chunk factor for C=A*B (saxpy3 method): + revised for non-builtin-semirings + \end{itemize} + +\item Version 7.3.2 (Nov 12, 2022) + + \begin{packed_itemize} + \item \verb'cmake_modules': minor revision to build system, to sync + with SuiteSparse v6.0.0 + \item Added option \verb'-DNOPENMP=1' to disable OpenMP parallelism. + \end{packed_itemize} + +\item Version 7.3.1 (Oct 21, 2022) + + \begin{packed_itemize} + \item workaround for a bug in the Microsoft Visual Studio Compiler, + MSC 19.2x (in vs2019). + \end{packed_itemize} + +\item Version 7.3.0 (Oct 14, 2022) + + \begin{packed_itemize} + \item \verb'GrB_Matrix': changes to the internal data structure + \item minor internal changes: \verb'A->nvals' for sparse/hypersparse + \item more significant changes: added hyper-hash for + hypersparse case, speeds up many operations on hypersparse matrices. + Based on \cite{Green19}. + \item \verb'GxB_unpack_HyperHash' and \verb'GxB_pack_HyperHash': + to pack/unpack the hyper-hash + \item \verb'@GrB' MATLAB/Octave interface: changed license to Apache-2.0. + \item MATLAB library: renamed to \verb'libgraphblas_matlab.so' + \item performance: faster \verb'C=A*B' when using a single thread and + \verb'B' is a sparse vector with many entries. + \end{packed_itemize} + +\item Version 7.2.0 (Aug 8, 2022) + + \begin{packed_itemize} + \item added ZSTD as a compression option for serialize/deserialize: + Version 1.5.3 by Yann Collet, + \url{https://github.com/facebook/zstd.git}. + Copyright (c) 2016-present, Facebook, Inc. All rights reserved. + Included in SuiteSparse:GraphBLAS via its BSD-3-clause license. + The default method is now ZSTD, level 1. + \item \verb'GxB_Matrix_reshape*' added. + \item MATLAB interface: \verb'reshape', \verb'C(:)=A', \verb'C=A(:)' are + faster. Better error messages. + \end{packed_itemize} + +\item Version 7.1.2 (July 8, 2022) + + \begin{packed_itemize} + \item MATLAB interface: linear indexing added for C(:)=A, C=A(:), and + single-output I=find(C). Faster bandwidth, istriu, istril, + isbanded, isdiag. C(I,J)=A can now grow the size of A. + \end{packed_itemize} + +\item Version 7.1.1 (June 3, 2022) + + \begin{packed_itemize} + \item minor updates to documentation and error messages + \item MATLAB interface: minor revision of GrB.deserialize + \end{packed_itemize} + +\item Version 7.1.0 (May 20, 2022) + + \begin{packed_itemize} + \item added cube root: \verb'GxB_CBRT_FP32' and \verb'GxB_CBRT_FP64' + unary operators + \item added \verb'GxB_Matrix_isStoredElement' + and \verb'GxB_Vector_isStoredElement' + \end{packed_itemize} + +\item Version 7.0.4 (Apr 25, 2022) + + \begin{packed_itemize} + \item (46) bug fix: user-defined type size was incorrectly limited + to 128 bytes. Caught by Erik Welch. + \end{packed_itemize} + +\item Version 7.0.3 (Apr 8, 2022) + + \begin{packed_itemize} + \item faster transpose when using 2 threads + \end{packed_itemize} + +\item Version 7.0.2 (Apr 5, 2022) + + \begin{packed_itemize} + \item (45) bug fix: vector iterator was broken for iterating across a + vector in bitmap format. Caught by Erik Welch. + \end{packed_itemize} + +\item Version 7.0.1 (Apr 3, 2022) + + \begin{packed_itemize} + \item added revised ACM TOMS submission to the Doc folder + \end{packed_itemize} + +\item Version 7.0.0 (Apr 2, 2022) + + \begin{packed_itemize} + \item (44) spec bug: \verb'GrB_Matrix_diag' + was implemented in v5.2.x and v6.x with the wrong signature. + This fix requires the major release to change, from v6.x to v7.x. + \item (43) performance bug fix for \verb'GrB_mxm': + auto selection for saxpy method (Hash vs Gustavson) revised. + \item \verb'GrB_assign': better performance for \verb'C(i,j)=scalar' and + \verb'C(i,j)+=scalar' when \verb'i' and \verb'j' have length 1 (scalar + assigment with no scalar expansion). + \end{packed_itemize} + +\item Version 6.2.5 (Mar 14, 2022) + + \begin{packed_itemize} + \item For SuiteSparse v5.11.0. + \end{packed_itemize} + +\item Version 6.2.4 (Mar 8, 2022) + + \begin{packed_itemize} + \item (42) bug fix: \verb'GrB_mxm' with 0-by-0 iso full matrices. + Caught by Henry Amuasi in the Python + grblas interface, then triaged and isolated by Erik Welch. + \end{packed_itemize} + +\item Version 6.2.3 (Mar 5, 2022) + + \begin{packed_itemize} + \item minor update to documentation in \verb'GrB.build': + no change to any code + \end{packed_itemize} + +\item Version 6.2.2 (Feb 28, 2022) + + \begin{packed_itemize} + \item revised output of \verb'GxB_*_sort' to return newly created matrices + C and P as full or bitmap matrices, as appropriate, instead of + sparse/hypersparse, following their sparsity control settings. + \end{packed_itemize} + +\item Version 6.2.1 (Feb 14, 2022) + + \begin{packed_itemize} + \item (41) bug fix: \verb'GxB_Iterator_get' used \verb'(void *) + size' + arithmetic + \end{packed_itemize} + +\item Version 6.2.0 (Feb 14, 2022) + + \begin{packed_itemize} + \item added the \verb'GxB_Iterator' object and its methods. See + Section~\ref{iter}. + \item \verb'@GrB' interface: revised sparse-times-full rule for the + conventional semiring (the syntax \verb'C=A*B'), so that + sparse-times-full results in \verb'C' as full, + but hypersparse-times-sparse is not full + (typically sparse or hypersparse). + \end{packed_itemize} + +\item Version 6.1.4 (Jan 12, 2022) + + \begin{packed_itemize} + \item added Section~\ref{perf} to User Guide: how to get the best + performance out of algorithms based on GraphBLAS. + \item \verb'cpu_features': no longer built as a separate library, + but built directly into \verb'libgraphblas.so' and + \verb'libgraphblas.a'. Added compile-time flags to + optionally disable the use of \verb'cpu_features' completely. + \item Octave 7: port to Apple Silicon (thanks to + G{\'{a}}bor Sz{\'{a}}rnyas). + \item min/max monoids: real case (FP32 and FP64) no longer terminal + \item \verb'@GrB' interface: overloaded \verb'C=A*B' syntax where one + matrix is full always results in a full matrix \verb'C'. + \item Faster \verb'C=A*B' for sparse-times-full and full-times-sparse + for \verb'@GrB' interface. + \end{packed_itemize} + +\item Version 6.1.3 (Jan 1, 2022) + + \begin{packed_itemize} + \item performance: task creation for \verb'GrB_mxm' + had a minor flaw (results were correct but parallelism suffered). + Performance improvement of up to 10x when nnz(A)<=Z' not returning \verb'C' + as iso if \verb'Z 'iso and \verb'C' initially + empty. Caught by Erik Welch, Anaconda. + \item performance improvements: \verb'C=A*B': sparse/hyper times + bitmap/full, and visa versa, including \verb'C += A*B' when \verb'C' is + full. + \end{packed_itemize} + +\item Version 5.1.10 (Oct 27, 2021) + + \begin{packed_itemize} + \item (35) bug fix: \verb'GB_selector'; \verb'A->plen' and \verb'C->plen' + not updated correctly. Caught by Jeffry Lovitz, Redis. + \end{packed_itemize} + +\item Version 5.1.9 (Oct 26, 2021) + + \begin{packed_itemize} + \item (34) bug fix: in-place test incorrect for \verb"C+=A'*B" using dot4 + \item (33) bug fix: disable free pool if OpenMP not available + \end{packed_itemize} + +\item Version 5.1.8 (Oct 5, 2021) + + \begin{packed_itemize} + \item (32) bug fix: C=A*B when A is sparse and B is iso and bitmap. + Caught by Mark Blanco, CMU. + \end{packed_itemize} + +\item Version 5.1.7 (Aug 23, 2021) + + \begin{packed_itemize} + \item (31) bug fix: \verb'GrB_apply', when done in-place and matrix starts + non-iso and becomes iso, gave the wrong iso result. + Caught by Fabian Murariu. + \end{packed_itemize} + +\item Version 5.1.6 (Aug 16, 2021) + + \begin{packed_itemize} + \item one-line change to \verb'C=A*B': faster symbolic analysis when a + vector \verb'C(:,j)' is dense (for CSC) or \verb'C(i,:)' for CSR. + \end{packed_itemize} + +\item Version 5.1.5 (July 15, 2021) + + \begin{packed_itemize} + \item submission to ACM Transactions on Mathematical Software as + a Collected Algorithm of the ACM. + \end{packed_itemize} + +\item Version 5.1.4 (July 6, 2021) + + \begin{packed_itemize} + \item faster Octave interface. Octave v7 or later is required. + \item (30) bug fix: 1-based printing not enabled for pending tuples. + Caught by Will Kimmerer, while working on the Julia interface. + \end{packed_itemize} + +\item Version 5.1.3 (July 3, 2021) + + \begin{packed_itemize} + \item added \verb'GxB_Matrix_iso' and \verb'GxB_Vector_iso': + to query if a matrix or vector is held as iso-valued + \item (29) bug fix: \verb'Matrix_pack_*R' into a matrix previously held by + column, or \verb'Matrix_pack*C' into a matrix by row, would flip the + dimensions. + Caught by Erik Welch, Anaconda. + \item (28) bug fix: \verb'kron(A,B)' with iso input matrices + \verb'A' and \verb'B' fixed. + Caught by Michel Pelletier, Graphegon. + \item (27) bug fix: v5.1.0 had a wrong version of a file; posted by mistake. + Caught by Michel Pelletier, Graphegon. + \end{packed_itemize} + +\item Version 5.1.2 (June 30, 2021) + + \begin{packed_itemize} + \item iso matrices added: these are matrices and vectors whose + values in the sparsity pattern are all the same. This is an internal + change to the opaque data structures of the \verb'GrB_Matrix' and + \verb'GrB_Vector' with very little change to the API. + \item added \verb'GxB_Matrix_build_Scalar' + and \verb'GxB_Vector_build_Scalar', + which always build iso matrices and vectors. + \item import/export methods can now import/export iso matrices and vectors. + \item added \verb'GrB.argmin/argmax' to MATLAB/Octave interface + \item added \verb'GxB_*_pack/unpack' methods in place of + import/export. + \item added \verb'GxB_PRINT_1BASED' to the global settings. + \item added \verb'GxB_*_memoryUsage' + \item port to Octave: \verb'gbmake' and \verb'gbtest' + work in Octave7 to build and test + the \verb'@GrB' interface to GraphBLAS. Octave 7.0.0 is required. + \end{packed_itemize} + +\item Version 5.0.6 (May 24, 2021) + + \begin{packed_itemize} + \item BFS and triangle counting demos removed from GraphBLAS/Demo: + see LAGraph for these algorithms. Eventually, all of GraphBLAS/Demo + will be deleted, once LAGraph includes all the methods included there. + \end{packed_itemize} + +\item Version 5.0.5 (May 17, 2021) + + \begin{packed_itemize} + \item (26) performance bug fix: reduce-to-vector where \verb'A' is + hypersparse CSR with a transposed descriptor (or CSC with no + transpose), and some cases for \verb'GrB_mxm/mxv/vxm' when computing + \verb'C=A*B' with A hypersparse CSC and \verb'B' bitmap/full (or + \verb'A' bitmap/full and \verb'B' hypersparse CSR), the wrong internal + method was being selected via the auto-selection strategy, resulting in + a significant slowdown in some cases. + \end{packed_itemize} + +\item Version 5.0.4 (May 13, 2021) + + \begin{packed_itemize} + \item \verb'@GrB' MATLAB/Octave interface: changed license + to GNU General Public License v3.0 or later. + It was licensed under Apache-2.0 in Version 5.0.3 and earlier. + Changed back to Apache-2.0 for Version 7.3.0; see above. + \end{packed_itemize} + +\item Version 5.0.3 (May 12, 2021) + + \begin{packed_itemize} + \item (25) bug fix: disabling \verb'ANY_PAIR' semirings by editing + \verb'Source/GB_control.h' would cause a segfault if those disabled + semirings were used. + \item demos are no longer built by default + \item (24) bug fix: new functions in v5.0.2 not declared as \verb'extern' + in \verb'GraphBLAS.h'. + \item \verb'GrB_Matrix_reduce_BinaryOp' reinstated from v4.0.3; + same limit on built-in ops that correspond to known monoids. + \end{packed_itemize} + +\item Version 5.0.2 (May 5, 2021) + + \begin{packed_itemize} + \item (23) bug fix: \verb'GrB_Matrix_apply_BinaryOp1st' and \verb'2nd' + were using the + wrong descriptors for \verb'GrB_INP0' and \verb'GrB_INP1'. + Caught by Erik Welch, Anaconda. + \item memory pool added for faster allocation/free of small blocks + \item \verb'@GrB' interface ported to MATLAB R2021a. + \item \verb'GxB_PRINTF' and \verb'GxB_FLUSH' global options added. + \item \verb'GxB_Matrix_diag': construct a diagonal matrix from a vector + \item \verb'GxB_Vector_diag': extract a diagonal from a matrix + \item \verb'concat/split': methods to concatenate and split matrices. + \item \verb'import/export': + size of arrays now in bytes, not entries. This change + is required for better internal memory management, and it is not + backward compatible with the \verb'GxB*import/export' functions in v4.0. + A new parameter, \verb'is_uniform', has been added to all import/export + methods, which indicates that the matrix values are all the same. + \item (22) bug fix: SIMD vectorization was missing + \verb'reduction(+,task_cnvals)' in + \verb'GB_dense_subassign_06d_template.c'. Caught by Jeff Huang, Texas + A\&M, with his software package for race-condition detection. + \item \verb'GrB_Matrix_reduce_BinaryOp': removed. Use a monoid instead, + with \verb'GrB_reduce' or \verb'GrB_Matrix_reduce_Monoid'. + \end{packed_itemize} + +\item Version 4.0.3 (Jan 19, 2021) + + \begin{packed_itemize} + \item faster min/max monoids + \item \verb'G=GrB(G)' converts \verb'G' from v3 object to v4 + \end{packed_itemize} + +\item Version 4.0.2 (Jan 13, 2021) + + \begin{packed_itemize} + \item ability to load \verb'*.mat' files saved with the v3 \verb'GrB' + \end{packed_itemize} + +\item Version 4.0.1 (Jan 4, 2021) + + \begin{packed_itemize} + \item significant performance improvements: compared with v3.3.3, + up to 5x faster in breadth-first-search (using + \verb'LAGraph_bfs_parent2'), and 2x faster in + Betweenness-Centrality (using \verb'LAGraph_bc_batch5'). + \item \verb'GrB_wait(void)', with no inputs: removed + \item \verb'GrB_wait(&object)': polymorphic function added + \item \verb'GrB_*_nvals': no longer guarantees completion; + use \verb'GrB_wait(&object)' + or non-polymorphic \verb'GrB_*_wait (&object)' instead + \item \verb'GrB_error': now has two parameters: a string + (\verb'char **') and an object. + \item \verb'GrB_Matrix_reduce_BinaryOp' limited to built-in operators that + correspond to known monoids. + \item \verb'GrB_*_extractTuples': may return indices out of order + \item removed internal features: GBI iterator, slice and hyperslice matrices + \item bitmap/full matrices and vectors added + \item index-based operators and semirings: + \verb'GxB_FIRSTI_INT32' and related ops + \item jumbled matrices: sort left pending, like zombies and pending tuples + \item \verb'GxB_get/set': added \verb'GxB_SPARSITY_*' + (hyper, sparse, bitmap, or full) and \verb'GxB_BITMAP_SWITCH'. + \item \verb'GxB_HYPER': enum renamed to \verb'GxB_HYPER_SWITCH' + \item \verb'GxB*import/export': API modified + \item \verb'GxB_SelectOp': \verb'nrows' and \verb'ncols' removed + from function signature. + \item OpenMP tasking removed from mergesort and replaced with parallel + for loops. Just as fast on Linux/Mac; now the performance ports to + Windows. + \item \verb'GxB_BURBLE' added as a supported feature. This was an + undocumented feature of prior versions. + \item bug fix: \verb'A({lo,hi})=scalar' + \verb'A(lo:hi)=scalar' was OK + \end{packed_itemize} + +\item Version 3.3.3 (July 14, 2020). + Bug fix: \verb'w=A*u' with mask non-empty and u empty. + +\item Version 3.3.2 (July 3, 2020). Minor changes to build system. + +\item Version 3.3.1 (June 30, 2020). Bug fix to \verb'GrB_assign' and + \verb'GxB_subassign' when the assignment is simple (\verb'C=A') but + with typecasting. + +\item Version 3.3.0 (June 26, 2020). Compliant with V1.3 of the C API + (except that the polymorphic \verb'GrB_wait(&object)' doesn't appear yet; + it will appear in V4.0). + + Added complex types (\verb'GxB_FC32' and \verb'GxB_FC64'), many unary + operators, binary operators, monoids, and semirings. Added bitwise + operators, and their monoids and semirings. Added the predefined monoids + and semirings from the v1.3 specification. \verb'@GrB' interface: added complex + matrices and operators, and changed behavior of integer operations to more + closely match the behavior on built-in integer matrices. The rules for + typecasting large floating point values to integers has changed. The + specific object-based \verb'GrB_Matrix_wait', \verb'GrB_Vector_wait', etc, + functions have been added. The no-argument \verb'GrB_wait()' is + deprecated. Added \verb'GrB_getVersion', \verb'GrB_Matrix_resize', + \verb'GrB_Vector_resize', \verb'GrB_kronecker', \verb'GrB_*_wait', scalar + binding with binary operators for \verb'GrB_apply', \newline + \verb'GrB_Matrix_removeElement', and \verb'GrB_Vector_removeElement'. + +\item Version 3.2.0 (Feb 20, 2020). Faster \verb'GrB_mxm', \verb'GrB_mxv', and + \verb'GrB_vxm', and faster operations on dense matrices/vectors. Removed + compile-time user objects (\verb'GxB_*_define'), since these were not + compatible with the faster matrix operations. Added the \verb'ANY' and + \verb'PAIR' operators. Added the predefined descriptors, + \verb'GrB_DESC_*'. Added the structural mask option. Changed default + chunk size to 65,536. \verb'@GrB' interface modified: \verb'GrB.init' is + now optional. + +\item Version 3.1.2 (Dec, 2019). Changes to allow SuiteSparse:GraphBLAS + to be compiled with the Microsoft Visual Studio compiler. This compiler + does not support the \verb'_Generic' keyword, so the polymorphic functions + are not available. Use the equivalent non-polymorphic functions instead, + when compiling GraphBLAS with MS Visual Studio. In addition, + variable-length arrays are not supported, so user-defined types are limited + to 128 bytes in size. These changes have no effect if you have an C11 + compliant compiler. + + \verb'@GrB' interface modified: \verb'GrB.init' is now required. + +\item Version 3.1.0 (Oct 1, 2019). \verb'@GrB' interface added. See the + \newline \verb'GraphBLAS/GraphBLAS' folder for details and documentation, + and Section~\ref{octave}. + +\item Version 3.0 (July 26, 2019), with OpenMP parallelism. + +The version number is increased to 3.0, since +this version is not backward compatible with V2.x. The \verb'GxB_select' +operation changes; the \verb'Thunk' parameter was formerly a +\verb'const void *' pointer, and is now a \verb'GxB_Scalar'. A new parameter +is added to \verb'GxB_SelectOp_new', to define the expected type of +\verb'Thunk'. A new parameter is added to \verb'GxB_init', to specify whether +or not the user-provided memory management functions are thread safe. + +The remaining changes add new features, and are upward compatible with V2.x. +The major change is the addition of OpenMP parallelism. This addition has no +effect on the API, except that round-off errors can differ with the number of +threads used, for floating-point types. \verb'GxB_set' can optionally define +the number of threads to use (the default is \verb'omp_get_max_threads'). The +number of threads can also defined globally, and/or in the +\verb'GrB_Descriptor'. The \verb'RDIV' and \verb'RMINUS' operators are added, +which are defined as $f(x,y)=y/x$ and $f(x,y)=y-x$, respectively. Additional +options are added to \verb'GxB_get'. + +\item Version 2.3.3 (May 2019): Collected Algorithm of the ACM. +No changes from V2.3.2 other than the documentation. + +\item Version 2.3 (Feb 2019) improves the performance of many GraphBLAS +operations, including an early-exit for monoids. These changes have a +significant impact on breadth-first-search (a performance bug was also fixed in +the two BFS \verb'Demo' codes). The matrix and vector import/export functions +were added, in support of the new LAGraph project +(\url{https://github.com/GraphBLAS/LAGraph}, see also Section~\ref{lagraph}). +LAGraph includes a push-pull BFS in GraphBLAS that is faster than two versions +in the \verb'Demo' folder. \verb'GxB_init' was added to allow the memory +manager functions (\verb'malloc', etc) to be specified. + +\item +Version 2.2 (Nov 2018) +adds user-defined objects at compile-time, via user \verb'*.m4' files placed in +\verb'GraphBLAS/User', which use the \verb'GxB_*_define' macros +(NOTE: feature removed in v3.2). +The default matrix format is now \verb'GxB_BY_ROW'. +Also added are the \verb'GxB_*print' methods for printing the contents of each +GraphBLAS object (Section~\ref{fprint}). PageRank demos have been added to +the \verb'Demos' folder. + +\item +Version 2.1 (Oct 2018) was +a major update with support for new matrix formats +(by row or column, and hypersparse matrices), and colon notation +(\verb'I=begin:end' or \verb'I=begin:inc:end'). Some graph algorithms are more +naturally expressed with matrices stored by row, and this version includes the +new \verb'GxB_BY_ROW' format. The default format in Version 2.1 and +prior versions is by column. +New extensions to GraphBLAS in this version include \verb'GxB_get', +\verb'GxB_set', and \verb'GxB_AxB_METHOD', \verb'GxB_RANGE', \verb'GxB_STRIDE', +and \verb'GxB_BACKWARDS', and their related definitions, described in +Sections~\ref{descriptor},~\ref{options},~and~\ref{colon}. + +\item +Version 2.0 (March 2018) addressed changes in the GraphBLAS C API +Specification and added \verb'GxB_kron' and \verb'GxB_resize'. + +\item +Version 1.1 (Dec 2017) primarily improved the performance. + +\item +Version 1.0 was released on Nov 25, 2017. +\end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Regarding historical and deprecated functions and symbols} +%------------------------------------------------------------------------------- + +When a \verb'GxB*' function or symbol is added to the C API Specification with +a \verb'GrB*' name, the new \verb'GrB*' name should be used instead, if +possible. However, the old \verb'GxB*' name will be kept as long as possible +for historical reasons. Historical functions and symbols will not always be +documented here in the SuiteSparse:GraphBLAS User Guide, but they will be kept +in \verb'GraphbBLAS.h' and kept in good working order in the library. +Historical functions and symbols would only be removed in the very unlikely +case that they cause a serious conflict with future methods. + +The following methods have been fully deprecated and removed. The older +versions of \verb'GrB_wait' and \verb'GrB_error' methods have been removed +since they are incompatible with the latest versions, per the C API +Specification. The \verb'GxB_SelectOp_new' and \verb'GxB_SelectOp_free' +methods have been removed, and some of the built-in operators have been been +revised (specifically, the \verb'GxB_EQ_THUNK', \verb'GxB_EQ_ZERO', +\verb'GxB_NE_THUNK', and \verb'GxB_NE_ZERO' operators no longer work on +user-defined types). + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_resources.tex b/GraphBLAS/Doc/UserGuide/GrB_resources.tex new file mode 100644 index 0000000000..43ea709577 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_resources.tex @@ -0,0 +1,10 @@ + +%------------------------------------------------------------------------------- +\section{Additional Resources} +%------------------------------------------------------------------------------- + +See \url{http://graphblas.org} for the GraphBLAS community page. See +\url{https://github.com/GraphBLAS/GraphBLAS-Pointers} for an up-to-date list of +additional resources on GraphBLAS, maintained by G{\'{a}}bor Sz{\'{a}}rnyas. + + diff --git a/GraphBLAS/Doc/UserGuide/GrB_v10.tex b/GraphBLAS/Doc/UserGuide/GrB_v10.tex new file mode 100644 index 0000000000..3ad7b5f961 --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/GrB_v10.tex @@ -0,0 +1,277 @@ + +\newpage +%=============================================================================== +\section{Changes in GraphBLAS v10: 32/64 bit integers} +%=============================================================================== + +GraphBLAS v10 adds a new feature that improves performance and reduces memory +requirements for GraphBLAS matrices and vectors: the use of any mix of 32-bit +and 64-bit integers in the internal data structures for the \verb'GrB_Matrix', +\verb'GrB_Vector', and \verb'GrB_Scalar' (the latter is nominally revised, but +only because SuiteSparse:GraphBLAS stores its \verb'GrB_Scalar' as a 1-by-1 matrix). + +All prior methods work without any modification to the user application, +so v10 is upward-compatible with prior versions of GraphBLAS. + +%------------------------------------------------------------------------------- +\subsection{Controlling the sizes of integers} +%------------------------------------------------------------------------------- + +Different integers are used for different parts of the matrix/vector data +structure. The decision as to which integers to use is determined by the +dimensions and number of entries in the matrix. The decisions can also be +modified by \verb'GrB_set' and queried by \verb'GrB_get'. A matrix can have up +to three different kinds of integers. If a matrix is $m$-by-$n$ with $e$ +entries, with default settings: + +\begin{itemize} +\item if $m > 2^{31}$: 64-bit integers must be used for the row indices of a +matrix; otherwise, 32-bit integers may be used. +\item if $n > 2^{31}$: 64-bit integers must be used for the column indices of a +matrix; otherwise, 32-bit integers may be used. +\item if $e > 2^{32}$: 64-bit integers must be used for the row/column offsets of +a matrix; otherwise 32-bit integers may be used. +\end{itemize} + +See Section~\ref{integer_bits} for details. + +%------------------------------------------------------------------------------- +\subsection{Passing arrays to/from GraphBLAS} +%------------------------------------------------------------------------------- +\label{ijxvector_methods} + +Several of the methods in the GraphBLAS v2.1 C API use plain C arrays of type +\verb'uint64_t' to pass lists of integers to GraphBLAS. These are extended to +allow any integers arrays to be passed, by adding new methods where all plain C +arrays (including pointers to numerical values for \verb'build' and +\verb'extractTuples') are replaced with \verb'GrB_Vector's. The new methods +are given a name that matches the method they revised, with a \verb'_Vector' +appended on the end. All of the new methods are accessible via the polymorphic +interface, using the existing polymorphic name. In the methods below, all +\verb'I', \verb'J', and \verb'X' parameters become \verb'GrB_Vector' objects. + +\begin{itemize} + +\item \verb'GrB_Vector_build': build a vector from (I,X) or (I,scalar) tuples. + + \begin{itemize} + \item \verb'GxB_Vector_build_Vector (w, I, X, dup, desc)' \newline + (see Section~\ref{vector_build_Vector}). + \item \verb'GxB_Vector_build_Scalar_Vector (w, I, scalar, desc)' \newline + (see Section~\ref{vector_build_Scalar_Vector}). + \end{itemize} + +\item \verb'GrB_Matrix_build': build a matrix from (I,J,X) or (I,J,scalar) tuples. + + \begin{itemize} + \item \verb'GxB_Matrix_build_Vector (C, I, J, X, dup, desc)' \newline + (see Section~\ref{matrix_build_Vector}). + \item \verb'GxB_Matrix_build_Scalar_Vector (C, I, J, scalar, desc)' \newline + (see Section~\ref{matrix_build_Scalar_Vector}). + \end{itemize} + +\item \verb'GrB_Vector_extractTuples': extract (I,X) tuples from a vector. + + \begin{itemize} + \item \verb'GxB_Vector_extractTuples_Vector (I, X, v, desc)' \newline + (see Section~\ref{vector_extractTuples_Vector}). + \end{itemize} + +\item \verb'GrB_Matrix_extractTuples': extract (I,J,X) tuples from a matrix. + + \begin{itemize} + \item \verb'GxB_Matrix_extractTuples_Vector (I, J, X, A, desc)' \newline + (see Section~\ref{matrix_extractTuples_Vector}). + \end{itemize} + +\item \verb'GrB_assign': ${\bf C \langle M \rangle (I,J) = C(I,J) \odot A}$ + + \begin{itemize} + + \item \verb'GxB_Vector_assign_Vector (w, mask, accum, u, I, desc)' \newline + (see Section~\ref{assign_vector_Vector}). + + \item \verb'GxB_Matrix_assign_Vector (C, Mask, accum, A, I, J, desc)' \newline + (see Section~\ref{assign_matrix_Vector}). + + \item \verb'GxB_Col_assign_Vector (C, mask, accum, u, I, j, desc)' \newline + (see Section~\ref{assign_column_Vector}). + + \item \verb'GxB_Row_assign_Vector (C, mask, accum, u, i, J, desc)' \newline + (see Section~\ref{assign_row_Vector}). + + \item \verb'GxB_Vector_assign_Scalar_Vector (w, mask, accum, scalar, I, desc)' \newline + (see Section~\ref{assign_vector_scalar_Vector}). + + \item \verb'GxB_Matrix_assign_Scalar_Vector (C, Mask, accum, scalar, I, J, desc)' \newline + (see Section~\ref{assign_matrix_scalar_Vector}). + + \end{itemize} + +\item \verb'GrB_subassign': ${\bf C (I,J) \langle M \rangle = C(I,J) \odot A}$ + + \begin{itemize} + \item \verb'GxB_Vector_subassign_Vector (w, mask, accum, u, I, desc)' \newline + (see Section~\ref{subassign_vector_Vector}). + + \item \verb'GxB_Matrix_subassign_Vector (C, Mask, accum, A, I, J, desc)' \newline + (see Section~\ref{subassign_matrix_Vector}). + + \item \verb'GxB_Col_subassign_Vector (C, mask, accum, u, I, j, desc)' \newline + (see Section~\ref{subassign_column_Vector}). + + \item \verb'GxB_Row_subassign_Vector (C, mask, accum, u, i, J, desc)' \newline + (see Section~\ref{subassign_row_Vector}). + + \item \verb'GxB_Vector_subassign_Scalar_Vector (w, mask, accum, scalar, I, desc)' \newline + (see Section~\ref{subassign_vector_scalar_Vector}). + + \item \verb'GxB_Matrix_subassign_Scalar_Vector (C, Mask, accum, scalar, I, J, desc)' \newline + (see Section~\ref{subassign_matrix_scalar_Vector}). + + \end{itemize} + +\item \verb'GrB_extract': ${\bf C \langle M \rangle = C \odot A(I,J)}$ + + \begin{itemize} + + \item \verb'GxB_Vector_extract_Vector (w, mask, accum, u, I, desc)' \newline + (see Section~\ref{extract_vector_Vector}). + + \item \verb'GxB_Matrix_extract_Vector (C, Mask, accum, A, I, J, desc)' \newline + (see Section~\ref{extract_matrix_Vector}). + + \item \verb'GxB_Col_extract_Vector (w, mask, accum, A, I, j, desc)' \newline + (see Section~\ref{extract_column_Vector}). + + \end{itemize} + +\end{itemize} + +In each of the above methods where \verb'I', \verb'J', and \verb'X' are +\verb'GrB_Vector' inputs to the method (all but \verb'extractTuples'), the +vectors can be interpretted in up to 3 different ways. For the first two ways, +suppose \verb'extractTuples' is used to extract two lists from a vector +\verb'I', \verb'J', or \verb'X': values and indices. Then either of those two +lists can then be used by the method. The default is to use the values, +but the indices can be selected by changing the following descriptor fields: + +\begin{itemize} +\item \verb'GxB_ROWINDEX_LIST': how the \verb'GrB_Vector I' is intrepretted. +\item \verb'GxB_COLINDEX_LIST': how the \verb'GrB_Vector J' is intrepretted. +\item \verb'GxB_VALUE_LIST': how \verb'GrB_Vector X' is intrepretted (for \verb'GrB_build' only). +\end{itemize} + +These can be set to one of the following values: + +\begin{itemize} +\item \verb'GrB_DEFAULT' or \verb'GxB_USE_VALUES': use the values of the vector (default). +\item \verb'GxB_USE_INDICES': use the indices of the vector. +\item \verb'GxB_IS_STRIDE': use the values, of size 3, for a strided range, + or \verb'lo:inc:hi' in MATLAB notation. This usage is limited to the + \verb'I' and \verb'J' vectors (except this option may not be used for + \verb'GrB_build'). The vector must have exactly three entries, + \verb'lo', \verb'hi', and \verb'inc', in that order. +\end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Container methods: loading/unloading data to/from a matrix or vector} +%------------------------------------------------------------------------------- +\label{container_v10} + +The new methods described in the previous Section~\ref{ijxvector_methods} +provide \verb'GrB_Vector' inputs and outputs. This section gives an overview +of how data is moved between these opaque objects and user-visible C arrays, +using the new \verb'load/unload' methods. + +See Section~\ref{container} for all of the details of the new +load/unload methods, using a new {\em Container} object. + +Methods in the v2.1 GraphBLAS C Specification can be used, but these methods +require a copy (\verb'GrB_*_build', \verb'GrB_*_extractTuples', +\verb'GrB_*_import' and \verb'GrB_*_export'). The following two methods +accomplish this task when the vectors are dense, with all possible entries +present. + +\begin{itemize} + +\item \verb'GxB_Vector_load': this method moves data in O(1) time from a user-visible + C array into a \verb'GrB_Vector'. The vector length and type are revised + to match the new data from the C array. Ownership is normally transferred + to the \verb'GrB_Vector', but this can be revised with a \verb'handling' + parameter. The C array is passed in as a \verb'void *' pointer, and its + type is indicated by a \verb'GrB_Type' parameter. See + Section~\ref{vector_load} for details. + +\item \verb'GxB_Vector_unload': this method moves data in O(1) time from a + \verb'GrB_Vector' into a user-visible C array (assuming the vector has no + pending work; if so, that work is done first). The length of the + \verb'GrB_Vector' is reduced to zero, to denote that it no longer holds any + content. The vector must be dense; it must have the same number of entries + as its size (that is \verb'GrB_Vector_nvals' and \verb'GrB_Vector_size' + must return the same value). The C array is returned as a \verb'void *' + pointer, and its type is indicated by a \verb'GrB_Type' parameter. See + Section~\ref{vector_unload} for details. + +\end{itemize} + +To move data between a \verb'GrB_Matrix' or \verb'GrB_Vector' in all other +cases, a new \verb'GxB_Container' object is introduced. This object is +non-opaque but contains opaque objects. Its primary components are five dense +\verb'GrB_Vectors' that hold the contents of the matrix/vector. The data in +these dense vectors can then be loaded/unloaded via \verb'GxB_Vector_load' and +\verb'GxB_Vector_unload'. + +The following methods operate on the Container object: + +\begin{itemize} +\item \verb'GxB_Container_new': creates a container. + (see Section~\ref{container_new}). + +\item \verb'GxB_Container_free': frees a container. + (see Section~\ref{container_free}). + +\item \verb'GxB_load_Matrix_from_Container': moves all of the data from a + \verb'GxB_Container' into a \verb'GrB_Matrix' in O(1) time. + (see Section~\ref{load_matrix_from_container}). + +\item \verb'GxB_load_Vector_from_Container': moves all of the data from a + \verb'GxB_Container' into a \verb'GrB_Vector' in O(1) time. + (see Section~\ref{load_vector_from_container}). + +\item \verb'GxB_unload_Matrix_into_Container': moves all of the data from + a \verb'GrB_Matrix' into a \verb'GxB_Container' in O(1) time. + (see Section~\ref{unload_matrix_into_container}). + +\item \verb'GxB_unload_Vector_into_Container': moves all of the data from + a \verb'GrB_Vector' into a \verb'GxB_Container' in O(1) time. + (see Section~\ref{unload_vector_into_container}). + +\end{itemize} + +%------------------------------------------------------------------------------- +\subsection{Historical methods: pack/unpack} +%------------------------------------------------------------------------------- + +GraphBLAS v5.1.0 (released in June 2021) added a suite of \verb'GxB_pack' and +\verb'GxB_unpack' methods to move data between opaque objects +(\verb'GrB_Matrix' and \verb'GrB_Vector') and user-visible C arrays, in $O(1)$ +time unless the data format needed to be revised. + +These methods are now declared {\em historical}, which means they will be kept +in working order but will no longer be documented. Refer to the GraphBLAS +v9.4.5 User Guide for documentaion for the pack/unpack methods. + +In GraphBLAS v10, these methods still pack/unpack their contents into +\verb'uint64_t *' user arrays. If the matrix has 32-bit integers, this +requires a copy and typecast. Thus, performance will be degraded for existing +user codes that expect $O(1)$ time to pack/unpack their matrices/vectors. + +Extending the pack/unpack to handle arbitary C integer arrays would lead to an +explosion in the number of methods in the API, and it would get worse if other +integers are added (16-bit and 128-bit for example). Rather than extend +pack/unpack to handle a wide range of integer types, new methods using the +\verb'GxB_Container' are introduced instead (see Section~\ref{container_v10}), +to rapidly move data into/out of a \verb'GrB_Matrix' or \verb'GrB_Vector' in +O(1) time and space. + diff --git a/GraphBLAS/Doc/UserGuide/Makefile b/GraphBLAS/Doc/UserGuide/Makefile new file mode 100644 index 0000000000..610f40129b --- /dev/null +++ b/GraphBLAS/Doc/UserGuide/Makefile @@ -0,0 +1,13 @@ +#------------------------------------------------------------------------------- +# GraphBLAS/Doc/UserGuide/Makefile +#------------------------------------------------------------------------------- + +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +#------------------------------------------------------------------------------- + +# creates the user guide +all: + ( cd .. ; make ) + diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc32.c index ab5fa9a475..dc9c95d459 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_div_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc64.c index 4b643533e3..8b3ccf8b87 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_div_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp32.c index 82421c46e9..492cae4bdd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_div_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp64.c index 516465c21d..0a0ea75441 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_div_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int16.c index 9547d7c5f5..43d50927db 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int32.c index d7c1363545..8639a3a108 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int64.c index 3aaefedf57..f15e56d1b5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_div_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int8.c index 3452602b6a..18b59bd062 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint16.c index 5d85c84556..ec42ede6fc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint32.c index 2095ed6af4..0e2c584347 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint64.c index efc57b5f36..234efd1b84 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_div_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint8.c index bea13f40b2..036ab5df3b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_div_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_div_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_div_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_bool.c index e28f182e6f..734632a002 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp32.c index 2cf4a6aae7..520daf2703 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp64.c index 943d3aeafe..5f2e3fd144 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int16.c index 5c534febb2..9107345c5b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int32.c index 96d735fb78..5689b59863 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int64.c index 811bceb900..98b67fa1e7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int8.c index 252f310a65..b309f47b51 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint16.c index 5e416053eb..76d029277b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint32.c index 6f4b7bd38c..70b1e8ed10 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint64.c index da4382fcea..5c9328de42 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint8.c index fcdc3f5f82..c298daf40c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_eq_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_eq_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_bool.c index 08c8b09fd7..d20de55be9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc32.c index fc184d992e..75b287fae2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -361,5 +360,7 @@ GrB_Info GB (_Asaxpy3B__any_first_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc64.c index e25787ec04..7d96b9d016 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_first_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp32.c index ac44c08102..e4dfb83bb9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -359,5 +358,7 @@ GrB_Info GB (_Asaxpy3B__any_first_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp64.c index 9b5e234380..14ce045a57 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -359,5 +358,7 @@ GrB_Info GB (_Asaxpy3B__any_first_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int16.c index 20244c756f..8be47e8d0c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int32.c index 50ae76db78..251d12951d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int64.c index 9a1a8fea6e..aada0de41e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -359,5 +358,7 @@ GrB_Info GB (_Asaxpy3B__any_first_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int8.c index 2e4a0d0ca9..5516684cf5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint16.c index 7867fcfae0..935daa628e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint32.c index 41b1db4f61..0f24543eff 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint64.c index 8d03991168..20fd58f7f9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -359,5 +358,7 @@ GrB_Info GB (_Asaxpy3B__any_first_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint8.c index 5fda203bc7..8af98fb1fb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_first_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_first_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_first_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int32.c index d115c2b0f3..920ef51221 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_firsti1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -361,5 +360,7 @@ GrB_Info GB (_Asaxpy3B__any_firsti1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int64.c index ae0ca09bc4..ff3484ad9d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_firsti1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -362,5 +361,7 @@ GrB_Info GB (_Asaxpy3B__any_firsti1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int32.c index 1e3a8ed8ed..dc109ed089 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_firsti_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_firsti_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int64.c index 0a72981224..69853783d2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firsti_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_firsti_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -361,5 +360,7 @@ GrB_Info GB (_Asaxpy3B__any_firsti_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int32.c index 301cae615b..bd1e77f756 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_firstj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -362,5 +361,7 @@ GrB_Info GB (_Asaxpy3B__any_firstj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int64.c index b0ce56bb4d..15bd086b88 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_firstj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -363,5 +362,7 @@ GrB_Info GB (_Asaxpy3B__any_firstj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int32.c index c55736159d..a831f6d61d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_firstj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_firstj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int64.c index 81f0008847..a3df8f8257 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_firstj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_firstj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -361,5 +360,7 @@ GrB_Info GB (_Asaxpy3B__any_firstj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_bool.c index b5bd8228c1..c9154d80c6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp32.c index 0b13bbe414..9354bcf329 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp64.c index 09524dc222..8b733b44cf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int16.c index d03e66bece..dee8a62517 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int32.c index 9f40e7cdc1..626cd3ead9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int64.c index 986784c6df..37bcf567cb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int8.c index c96cd9837f..f65a1fff1c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint16.c index 3444eb1808..bbf31b200b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint32.c index 54c917f2db..d51f4f7a2b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint64.c index e381f3ec43..75efbbb511 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint8.c index 269243e182..bbe0ea8b6d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ge_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_ge_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_bool.c index 53643954fe..2e21b31a46 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp32.c index 6c4cea246c..24040057b0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp64.c index 0a6c256318..d8cfd30b1c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int16.c index 7c692acdec..f629a4a208 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int32.c index 307eb3ade7..bcdb42c9c0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int64.c index 44d6d8d1f6..b08976e7cf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int8.c index fa3121c602..298e8380a2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint16.c index b6546828b8..b4495e73e1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint32.c index 76ee4a25ed..da680a6a6b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint64.c index a03861a254..b0478a2890 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint8.c index bd75896967..04287879b1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_gt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_gt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_land_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_land_bool.c index cd7a243a3d..1e98d4758d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_land_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_land_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_land_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_bool.c index 146ede6d33..c8f7802f21 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp32.c index 042ff997d8..78a1ac7e8b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp64.c index 9d0dc61d31..b9f54d6e46 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int16.c index de357914a4..0a45991649 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int32.c index f087ecb614..044b438fc4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int64.c index 7bb60ce029..937a9a0ffc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int8.c index b2f07c51b6..1b85c91951 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint16.c index 8e0c762e58..6df6db4f8d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint32.c index 0c09f4c372..5d78030a77 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint64.c index df10f1d45b..0ea9d9db8b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint8.c index 272c70ec28..d062945a4d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_le_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_le_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_le_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lor_bool.c index 1b57187492..3fa6c77167 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_lor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_bool.c index 09eeec6572..d468cf46a1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp32.c index ddfa77f421..ef2d777f24 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp64.c index 0136ef3fda..eeb0460660 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int16.c index e1829dd875..8328cd5821 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int32.c index 1a8a0b21ea..f56b820c6f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int64.c index 70de260b7c..86f3b5d003 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int8.c index 49877c5989..7d56e54cb4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint16.c index c3f7d8d1ca..49cca36b12 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint32.c index 3e8144bf9f..7d55fb8426 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint64.c index 8ae456514a..ff0efa2073 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint8.c index 092cf5f95b..7d64914647 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_lt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_lxor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_lxor_bool.c index 564ffdb44a..6fb3d9e084 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_lxor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_lxor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_lxor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp32.c index 3785c1fd2b..e6a9aea100 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_max_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp64.c index f1f6532a00..1f5c580a25 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_max_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int16.c index fd7a39080b..a353edfe09 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int32.c index 03a1f5ec96..045610a9c0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int64.c index 9376a40c88..860e1296b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_max_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int8.c index 48cfb1cc83..5e1d8f6134 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint16.c index 629608cf87..5a38dd6034 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint32.c index c24d8726ab..cf3abe7071 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint64.c index 40aba846ef..bf09031a2a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_max_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint8.c index 579c9a86dc..c0522c34b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_max_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_max_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_max_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp32.c index 87ea721cd4..e88be20288 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_min_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp64.c index 4119ed4bf2..713490507e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_min_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int16.c index 6fafb0f076..08c6d10751 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int32.c index 6365dc5e1f..307f7eeaa1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int64.c index 9952ead30f..00edcba9c7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_min_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int8.c index eab7dfcfc6..a1aefc521d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint16.c index 2414b90f21..332d3eb5f3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint32.c index 98fbb52582..82d4466deb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint64.c index 84987fd3f5..e5a46b0a75 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_min_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint8.c index ae558388d6..61581dd435 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_min_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_min_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_min_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc32.c index c852ea1f34..ef8261e001 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc64.c index d5af0541e3..1b1d77b187 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp32.c index 57472b1f00..8c3166dcb6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp64.c index 7f5925a740..85893c9515 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int16.c index f650b73fa7..52dafe6fa8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int32.c index 81c2377b70..13ecdd2077 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int64.c index 13d7746c70..28bdc01e95 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int8.c index 5ecb548a88..4dbe552329 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint16.c index 1b73b6e90e..105a57ea23 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint32.c index b40502e47c..e8b0396339 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint64.c index dfc3dea095..dd3898fa0a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint8.c index 2f306c0f7a..4fb2338f21 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_minus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_minus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp32.c index 1e16614bc7..f64d860394 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp64.c index 730f1880d4..2b843314ac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int16.c index 668c4819a4..93e768257d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int32.c index 33dad8e0c2..76f926952d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int64.c index 35f5f2c225..96bbbbb97b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int8.c index 377d38c6ba..f8d937d646 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint16.c index 2929bd2309..5bdd9d18ad 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint32.c index ab0b98c2d3..9367b1363e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint64.c index ca87597de7..1da8b0686c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint8.c index a0fedcf373..80034b4f53 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_ne_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_ne_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc32.c index 93167f3226..6b4b351175 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc64.c index b4fd91df1a..067c15a953 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp32.c index a50c75e10e..c3b3b88097 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp64.c index 4693fffcaa..4c9d309083 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int16.c index 70229d7bd5..5216ed9d29 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int32.c index 2163e3af4a..ee3f701ab8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int64.c index 8e45bbdc00..6b9191bf7d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int8.c index ffecb154ed..dc2175650c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint16.c index ce4f332bf8..31ef507c5e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint32.c index c7602e539f..0ac9ba8f0f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint64.c index 8f4868183c..6945ef2258 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint8.c index ac749e437a..6106458402 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_plus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_plus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc32.c index 1a41a73e54..ab6d163868 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc64.c index 6c467f3d6a..c93fc85046 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp32.c index a26d50ff30..f56c893067 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp64.c index b125bf51ae..6d5bef2a50 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int16.c index e79a0ed78e..038552c872 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int32.c index 27ba67da75..bd54bb44d4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int64.c index ccde51c771..541cbfc49c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int8.c index 40693f1747..2b6dc18d4c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint16.c index 18101cca75..91b829ef4a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint32.c index 63e5f9ecff..2b43c3c589 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint64.c index daf7a64af4..976f23c7ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint8.c index c49d949986..0928cfcb6f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_rdiv_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc32.c index 5d807bc93e..ad5a62f96a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc64.c index dfab56db00..c5f2658294 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp32.c index b87e206f72..5f7420197b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp64.c index f026ee6cb8..b670beeff3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int16.c index 2812726f1f..aaf4b01fb7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int32.c index d3c852748a..a35a4c0b1c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int64.c index eb3ff772f7..19b362b596 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int8.c index 6f0dd9c457..44f7f22767 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint16.c index 585b56151b..4e2c465f45 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint32.c index 143788eb4d..13bad96fb0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint64.c index 20cb911fc5..90585df18e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint8.c index 4b881f5ff1..d28b197177 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_rminus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_rminus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_bool.c index a5f5d8a1dc..4ff749e278 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_bool.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc32.c index 9281292544..a358a97ce4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_second_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc64.c index b09d9685ee..748e276be3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_second_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp32.c index fbb14c3bea..6483d965ad 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_second_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp64.c index 6c1d27c7ca..f942864172 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_second_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int16.c index 3343c47eae..a96bf5db14 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int32.c index 84141ef7ed..8a918120b2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int64.c index 9c05bb9d43..14d5f4757a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_second_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int8.c index 907f6669da..a38b2532e8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint16.c index 135d5b96ea..b933a6df7a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint32.c index af3a35bf14..42d9c15dfb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint64.c index c343aa7181..a1d39baaa8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_second_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint8.c index b13a8095ef..16629e89e6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_second_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_second_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_second_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int32.c index 07dd15d252..b0e464f971 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_secondj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -362,5 +361,7 @@ GrB_Info GB (_Asaxpy3B__any_secondj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int64.c index 9cf593bd7a..76e6a009ca 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_secondj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -363,5 +362,7 @@ GrB_Info GB (_Asaxpy3B__any_secondj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int32.c index 8de5226f5e..06d015ccb4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_secondj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_secondj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int64.c index 2d084fdb35..adffbd316c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_secondj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_secondj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -361,5 +360,7 @@ GrB_Info GB (_Asaxpy3B__any_secondj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc32.c index 452905c72b..3d17864143 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -360,5 +359,7 @@ GrB_Info GB (_Asaxpy3B__any_times_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc64.c index e982bb480c..23c34d93d7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -356,5 +355,7 @@ GrB_Info GB (_Asaxpy3B__any_times_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp32.c index 0c67bdcdd7..57b35e7e5f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_times_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp64.c index eb0064cf86..7395790da5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_times_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int16.c index 139c7d0575..9968e40ed9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int16.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int32.c index 03be32d73d..33a21d8153 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int32.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int64.c index 064da10edc..a252d08d5b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int64.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_times_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int8.c index c78715e62b..6ee51b4f12 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_int8.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint16.c index 07760566e0..0fe5d9d795 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint32.c index 68dd7b9e7a..396fc81600 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint64.c index 1219ae7320..af246591fe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -358,5 +357,7 @@ GrB_Info GB (_Asaxpy3B__any_times_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint8.c index 30eab0c204..2a8e80922f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__any_times_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__any_times_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -357,5 +356,7 @@ GrB_Info GB (_Asaxpy3B__any_times_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint16.c index bc54155bde..d7278b2040 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__band_band_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_band_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint32.c index 328216ddbb..9534df3658 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__band_band_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_band_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint64.c index 21a7f2d13e..be84ace1bd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__band_band_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__band_band_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint8.c index b0e1fff6a8..3e46eee88c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_band_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__band_band_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_band_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint16.c index 7fa045e978..ed05357dc3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__band_bor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint32.c index c3c4af5b3f..5cf204ff0f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__band_bor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint64.c index 5b9b164e25..81a45fe450 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__band_bor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint8.c index ccce807ed0..64d996fcf0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__band_bor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint16.c index 54843fe4fe..fa4d268192 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxnor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint32.c index 60775b7405..6b3a8f96c7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxnor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint64.c index c62124613f..ea95cddbf0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxnor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint8.c index cba50e8142..8108d81e2b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxnor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint16.c index 0b611b8122..3fc2968420 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint32.c index e6d21ce52f..aca5e1b7b7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint64.c index b1ff2d9872..0d3a6e9314 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint8.c index 6b6513ebec..aae2ce1c21 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__band_bxor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__band_bxor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint16.c index 0350c2017a..6b98b99398 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bor_band_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint32.c index 98e7afdd58..7ac8f281d3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bor_band_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint64.c index 62ec09af3c..a837147f85 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bor_band_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint8.c index 5de6d1ac9e..38079d12fe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_band_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bor_band_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint16.c index 2f6bcb8899..580781e94b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint32.c index e4a7814f42..6a46796cfa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint64.c index 090e0dcc35..77daa03ab2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint8.c index 1006c67677..72be1e90bd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint16.c index 1e0197101e..4de1fabef6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxnor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint32.c index 79571e664a..fcdae92280 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxnor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint64.c index 9c28a343d5..cd1d1f7d19 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxnor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint8.c index f536bda2ed..d17f8f34b0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxnor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint16.c index 851e5b694c..860a5eb232 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint32.c index 934049e9c8..f4ee649dcb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint64.c index 8757cee3af..95ff5ca8e8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint8.c index cb36d64d3e..30c9434d4f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bor_bxor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bor_bxor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint16.c index 352d30ef14..2f1f7a6486 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_band_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint32.c index e43de43f90..d54015f679 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_band_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint64.c index a9a720dfb5..686de8c158 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_band_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint8.c index 359559b292..c09231003c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_band_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_band_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint16.c index 84731c654e..7d6b3929db 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint32.c index 3bed9b9b6e..8d91718994 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint64.c index 8be3595a83..fce27432b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint8.c index 779ca4d170..be91c4ba89 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c index e40941ad8d..41311d21bb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxnor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c index 71c531b00d..58bfabcc1e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxnor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c index 37ce1ff955..52877efcd5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxnor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c index 4f91784938..4e0fed9c94 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxnor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c index d0080baf16..7ddeb88604 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c index 654d1f3dca..21fb01b12a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c index 7344b93b23..2c6c06cacb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c index 5054715263..4f2335b8c1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxnor_bxor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint16.c index 7c2dc8f832..779b2d191d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_band_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint32.c index 54a4bae154..7f0ed67114 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_band_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint64.c index 7b4ad50b6f..599470f9bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_band_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint8.c index 8c8a69964c..a6a90e508f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_band_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_band_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint16.c index 691d59e58f..f05baee6b2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint32.c index 3dd475a4ff..f3526a6d36 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint64.c index 907405d1e9..c393e5ea50 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint8.c index 3ddc662eff..96f7c30ef9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c index e5a0d8457a..854b027f81 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxnor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c index 82e8225ed1..d5e4db4290 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxnor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c index f8b7f4c4f9..23b629c074 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxnor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c index f74e62560d..abe10fc904 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxnor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint16.c index cd7382a0b9..a758a1188d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint32.c index 8dfe15b086..075f7b840f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint64.c index 6a66895056..5e69e523ea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint8.c index 021c931f07..3b4eb22d15 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__bxor_bxor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__bxor_bxor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_bool.c index 0669bb665f..a9706175aa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp32.c index cadcd5225f..da1474ff87 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp64.c index 628ba25ca7..59349a9905 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int16.c index cb0294990f..a4fa30a652 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int32.c index 570433f0a6..ed406178bb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int64.c index 362c028fee..a35a7c021a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int8.c index 7e175f15b9..6958a4f935 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint16.c index 6b80816eb1..b6d37f2581 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint32.c index 273a4843af..e4f7959bca 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint64.c index f3a0bd7f20..a6e386d26a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint8.c index 1acf522b77..9146025627 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_eq_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_eq_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_first_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_first_bool.c index 778e5b8627..8a708334ea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_first_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_first_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -459,5 +458,7 @@ GrB_Info GB (_Asaxpy3B__eq_first_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_bool.c index 0c8d0098c0..183d6af74c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp32.c index 4c18ca3af0..0bcd789c5e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp64.c index f046c24f76..24a51d2e20 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int16.c index 45e0d84aa1..5723e74c6d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int32.c index 68972c7af9..6e329ad5d9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int64.c index d3182e80cc..e3f2d2c160 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int8.c index 13f67cd2ab..7c683e6497 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint16.c index 3f023dff2c..3f6f7ba613 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint32.c index c825c00d63..3048fd4b13 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint64.c index 2c1ec1c45a..f8d09d5ca5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint8.c index e67868cec3..f442faddb3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ge_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ge_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_bool.c index edf3363389..b0689866cf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp32.c index f324804e2a..cdffa189d2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp64.c index bfbb4dba2b..6085c4806c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int16.c index 8c947884e7..5230f20772 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int32.c index daebb60a11..62fbd80d90 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int64.c index 5e00658a83..d5d2df9492 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int8.c index ddebcfbe00..c9e9d351b2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint16.c index 71c3acb209..fe3c1b3f15 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint32.c index decda8cf72..83cd5fc768 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint64.c index e8c8be61d5..707b10bbfc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint8.c index e394f8cef4..624485271e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_gt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_gt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_land_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_land_bool.c index 7d588366b1..3a9187c16e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_land_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_land_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_land_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_bool.c index 56600c83d8..ef29fc82ef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp32.c index ef0584d741..2595a23fc9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp64.c index 5778e65b86..58bdbc79a0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int16.c index ab5e038803..de437fb338 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int32.c index 667b389411..52407c1544 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int64.c index 55dfbb5f4b..bd7b1238e9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int8.c index 2fb8b66052..0ef1039772 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint16.c index 26ba904c25..81271ff4fc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint32.c index 08f4fe40be..442e4307e0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint64.c index 3cf94b34f3..3b4b533f19 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint8.c index 97ffe0e39d..20f680c52c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_le_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_le_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lor_bool.c index b44d512026..9118940ee9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_bool.c index 7cf799ba54..000cdb1b69 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp32.c index c2e69244e9..7688d6f799 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp64.c index 03b2aee810..0be1265dbf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int16.c index 36f8c9bc31..4cdc42963a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int32.c index 08e341e507..6a9aa41800 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int64.c index ed6f8d2839..7e598910d9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int8.c index 56367d6b3d..13dfed0c3d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint16.c index 6c504f3397..010c313481 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint32.c index 5503d137eb..3bbede3be3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint64.c index da06e06d69..c58822fe46 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint8.c index d2c21c56cc..f533963dcf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_lxor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_lxor_bool.c index d1f19fc5f9..c420ac9bcf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_lxor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_lxor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_lxor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp32.c index 4a5b157348..a4b5eee067 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp64.c index 5eb2bcfc83..c15f02acf5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int16.c index f36ed80bb3..bfe5407410 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int32.c index efbe81cb5b..9d3161f86e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int64.c index 1c56524e40..04c5f89fd6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int8.c index 36cabb71ae..cd57fd1cab 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_int8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint16.c index e0204770de..e63b648098 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint32.c index eedc864147..2a566bd904 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint64.c index 0ad834d772..6a62ca2a66 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint8.c index 9053888d1f..f9157fc037 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_ne_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__eq_ne_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__eq_second_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__eq_second_bool.c index bd128340d1..5afd4a94ef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__eq_second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__eq_second_bool.c @@ -2,7 +2,7 @@ // GB_AxB__eq_second_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__eq_second_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__include2.h b/GraphBLAS/FactoryKernels/GB_AxB__include2.h index 0811dc17d7..a494ceeb4a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__include2.h +++ b/GraphBLAS/FactoryKernels/GB_AxB__include2.h @@ -2,7 +2,7 @@ // GB_AxB__include2.h: definitions for GB_AxB__*.c methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_AxB.h diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_bool.c index 3775de0772..664431870f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp32.c index f897fad00e..311ef0cadb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp64.c index 21cc34554b..91288faa1a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int16.c index b4cff827ef..a31bc1308b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int32.c index 1043adaa60..c2757cd472 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int64.c index abc4a67691..4668806e65 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int8.c index 1a28d49142..c32f722dfd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint16.c index b01c445496..5af17bd7ac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint32.c index 5d62ab62a8..729d955bed 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint64.c index 80acdb8a90..839b0dab0a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint8.c index 23b33ed74d..2330628991 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_eq_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_eq_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_first_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_first_bool.c index db34994254..2dfcd2cd3d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_first_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_first_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__land_first_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_bool.c index 24aff59a63..05d4702661 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp32.c index 0ddcec1215..983b1eead2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp64.c index 4e712552b8..6b4e92c2be 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int16.c index 96c87c0cb4..e854a46a8b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int32.c index 62dbadb72e..e5ce9c4726 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int64.c index 3e6ec78139..d3929f2849 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int8.c index 67687b58e7..f9c39b5009 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint16.c index a54b61bfe5..1fb26b73e4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint32.c index d5d038dd2b..25ee0a1cc9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint64.c index b2ae4881c5..7d658428c4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint8.c index 194c3c38bd..32aefaaed2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ge_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_ge_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_bool.c index a6cfdc6273..c1d7abb117 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp32.c index 1202685648..7b4fa9769c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp64.c index 1a972654af..10f4fbecb1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int16.c index f45296df36..efcf59d694 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int32.c index 37c1085cb8..18a5dae2d1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int64.c index 60b54896bc..89ff8b77b5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int8.c index 194aec706d..be653c4f2b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint16.c index fc5f0f5eaa..85ce1dc6cf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint32.c index a1da877d3d..715c7d571e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint64.c index 844e2ece66..d8b3f4c1ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint8.c index 43fd77db81..19f2138aa8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_gt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_gt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_land_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_land_bool.c index 0b1f22303b..ac45d671e2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_land_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_land_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_land_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_bool.c index 9eb28838fa..3b8fcc6edf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp32.c index 1e5ff60e76..4ae1e6ad62 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp64.c index f797c909ef..41857ce229 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int16.c index 4f133e7080..8380543c2e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int32.c index 729faa4c93..7ada9570c4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int64.c index cabddde5c3..865fa31fb7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int8.c index ac20f8962f..b527db8df6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint16.c index 34aad5dd34..3456a4d2bd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint32.c index 6528fd83e7..48795d43f6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint64.c index f6cba32b41..9085adbe2f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint8.c index 133bdb343e..38bbe7ac04 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_le_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_le_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_le_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lor_bool.c index c664aadaa0..d8968b2eb7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_lor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_bool.c index a856c5cddf..dc592c2e75 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp32.c index 75cf8d7cf5..d5740a5f5d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp64.c index f0dae3231f..1d5a9cbaf6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int16.c index 5e8436937c..7e6379eaf1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int32.c index 7892261062..d25e9e2ffe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int64.c index 596f924cf5..faddd77ca3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int8.c index a098e6eeb9..f65cde0df3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint16.c index d796537b72..ce883397e1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint32.c index 931c7e7dcf..639731b731 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint64.c index e75dcb43f0..aaf4d0c576 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint8.c index fb67206a90..1e9faa0e0b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_lt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_lxor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_lxor_bool.c index 0c8ad02eae..d655e6421d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_lxor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_lxor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_lxor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp32.c index 3d5f681365..37cea4c221 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp64.c index bd5f32b819..1cfcf63d86 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int16.c index 3e23135204..0dcbb997d5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int16.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int32.c index 813b72895e..76c35b2686 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int64.c index f18d412e57..2e084bc8e3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int8.c index a903f1938e..b9d183b43f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_int8.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint16.c index 96c06bbab9..d99fb3fe42 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint32.c index 10efbee29e..353135d9c8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint64.c index 42e45ace50..4562c24324 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint8.c index 24e4049343..1a052b55fe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_ne_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__land_ne_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__land_second_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__land_second_bool.c index a537e3f6dc..7baa4a6ce6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__land_second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__land_second_bool.c @@ -2,7 +2,7 @@ // GB_AxB__land_second_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__land_second_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_bool.c index 89dc9df495..6cd1d39405 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp32.c index 8eef813f91..3faab8b25e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp64.c index 8d61d71d81..429d2c3fb5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int16.c index c1baa01e64..adca20deb2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int32.c index 67b29f3c76..d70949a939 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int64.c index f53c4c98a8..772bc8355f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int8.c index 44667798fc..af45f104fa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint16.c index b5ec5232ce..74dc11b630 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint32.c index af2f0f43ca..7966686449 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint64.c index b41027a60c..49d73df5b5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint8.c index aaa4408f52..b387347e77 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_eq_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_eq_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_first_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_first_bool.c index b83d2b5543..2594753122 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_first_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_first_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__lor_first_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_bool.c index 31255b702d..34e283fef4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp32.c index 75594d6473..802c901f32 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp64.c index cf09ca4bf3..17e5d414cf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int16.c index 6b236f30e7..6deeaa2e9b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int32.c index 933a1c703e..d6de0594dc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int64.c index f8b5301ed5..3a94dbb1a6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int8.c index 562901fdf7..b7d3589638 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint16.c index 5c6159cf60..028e2fcce3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint32.c index 87df86e023..e6822b584c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint64.c index ca014d5618..2cb86b7e62 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint8.c index 5412fd152b..697be6740f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ge_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ge_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_bool.c index 624a5bcc4d..72f04e45f7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp32.c index ce73b1a52c..13c247db6f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp64.c index 6bc21d9c03..1643340dea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int16.c index 8b236c28a9..9544b958fa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int32.c index a20f1d8bbc..31d46022e1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int64.c index e8f2b56b75..dcf2fc2b9f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int8.c index b178e65e64..8cf1b555dc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint16.c index 99743ff3b4..166b50477f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint32.c index 5bdaf7be2b..d9d82d7436 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint64.c index b40ddbfc4c..8d244d87ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint8.c index 544d22e591..0ca981d6a1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_gt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_gt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_land_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_land_bool.c index 9335a93816..b27d935e2f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_land_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_land_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_land_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_bool.c index 6e504209ef..c74b93ee05 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp32.c index 723a9a9800..b8e21a01bd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp64.c index 68d1552f70..0e64a8d5dc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int16.c index 236f7b1659..95de89c42a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int32.c index d371a2dc55..672bb1c6f3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int64.c index 073552aaf5..8ffef5294c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int8.c index 6d6bf735e5..91f8589242 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint16.c index cae7f3e561..c9e368d065 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint32.c index 04b3067386..1858eeeacf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint64.c index 53fa806e3e..746316ea65 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint8.c index 556f019f32..4b51c29f54 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_le_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_le_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lor_bool.c index 555de3fe68..7994ee2671 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_bool.c index 13a4a4932b..a8bf1b49ba 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp32.c index a515e3b46c..2dd2d98f87 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp64.c index 08c0ee010b..27535a5ebd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int16.c index aa1e7c85a7..fc3bc8265b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int32.c index 782ad7aff4..e2328aa889 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int64.c index 04cb2cbfde..8aedad3a32 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int8.c index 93aabc92c1..9f803c14cd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint16.c index 207d37ceee..d02960d9c9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint32.c index d79ee0db35..bc132302d7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint64.c index 64ba9a7b22..5adae6cb1c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint8.c index b6bb307a48..d6e95a3ae1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_lxor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_lxor_bool.c index 943b4ad7da..074c10a63a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_lxor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_lxor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_lxor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp32.c index c77d2dc8ff..3e678deb84 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp64.c index 62b85e75d8..2700ad636f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int16.c index c168cfd63b..20ebd48bdd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int32.c index adebee6a59..1e2faaecac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int64.c index 782688017c..5b1876c79e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int8.c index 5a068f3fd0..d87c26e416 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint16.c index efd54ee9ca..308b3c6965 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint32.c index fb1d0a727e..f7fd656769 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint64.c index 62c0271884..ade4ab1df2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint8.c index 9d3223c572..9168d027fb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_ne_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lor_ne_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lor_second_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lor_second_bool.c index be999680e7..a8e902c858 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lor_second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lor_second_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lor_second_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__lor_second_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_bool.c index 0875c446b5..9c8f24b625 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp32.c index 163f841ba5..59efa10f3d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp64.c index 63f5ed05e0..72cf40e47b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int16.c index 208206fb86..74a509d55d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int32.c index 9d517d72f6..d075bdf9a3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int64.c index de03a502f0..620ef1ca58 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int8.c index 11fa66cd93..d62c07a56c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint16.c index 2d6afce8e8..a0c10c78ed 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint32.c index db2629d666..c2d1697af8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint64.c index a098835c08..a223bdf53f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint8.c index 207daeeceb..25e34a5da2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_eq_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_eq_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_first_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_first_bool.c index 2181534dd9..602deb10c1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_first_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_first_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__lxor_first_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_bool.c index fc16363f80..117a02f7f5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp32.c index a829941a27..e1ed904721 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp64.c index 1131720485..334fdcfeb5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int16.c index 0e6fb7909c..cd0261d3b1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int32.c index b629ae77aa..4a7aaf842e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int64.c index a4d2775a63..fe8f6024b6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int8.c index 299578cd1a..b26da20dff 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint16.c index 35c33547fa..05c7bc565c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint32.c index 17c15d56df..39f16200f4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint64.c index 03345e34e4..f18cbde64f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint8.c index 224e0e76e1..9f827dbc0e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ge_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ge_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_bool.c index 8f1168beab..f1f860d19a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp32.c index 3959f7c2fd..6ccdd00cc4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp64.c index 43a97cf900..692ab7cb0e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int16.c index 129c644728..ab07f7a005 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int32.c index 538f250ff1..6354ce3a68 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int64.c index d708fd3132..09504f1074 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int8.c index b6dafec9c6..cdf4f3ca1c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint16.c index 63e99a5cac..c2208afa75 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint32.c index 0db8e0b13a..ac002bbbe7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint64.c index d48833dda2..d4b5caf123 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint8.c index bc9e1f325f..19e6d33998 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_gt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_gt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_land_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_land_bool.c index 02801168bc..ac34f36a99 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_land_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_land_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_land_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_bool.c index 9882dc23cf..605cb92ad1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp32.c index 47add980c4..3bfffdac13 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp64.c index 0e0a72440b..2a794ed027 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int16.c index 554f13c5b8..ec1488c1c3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int32.c index 5f7cf99d08..ba9bfd853b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int64.c index 92a227b2a3..8fc7aea651 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int8.c index 0d641f391e..eb49ebb14e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint16.c index 1ff58b6235..74d014c525 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint32.c index 73785498db..ae933ecd32 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint64.c index 7b1c1506dd..8c54f0d57c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint8.c index d99cfb1d1b..81b158b544 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_le_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_le_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lor_bool.c index 2626d5de31..8bdb5dcd45 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_bool.c index 606037b93b..9f2c20c35f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp32.c index 7e9998eea0..dd20f306b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp64.c index 2c912e8367..aa82e313da 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int16.c index 99380e2d65..cfbe87555a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int32.c index 250c4b179d..cfd3513dfe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int64.c index c602de9369..8841a398d0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int8.c index a990dcc529..a7c06b9eb3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint16.c index ff8e274b01..337fe155f9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint32.c index ceaa5d9950..f57f7adff9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint64.c index 9d624853d6..a292ddc4fb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint8.c index 1e52e17f38..0ff3e555bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lt_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lt_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lxor_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lxor_bool.c index 9d7a55f87b..6cea994f52 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_lxor_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_lxor_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_lxor_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp32.c index 1de1b596a7..ecade24237 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp64.c index d5056bbb6d..84066f809c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int16.c index b79ad3f5b9..63456220e9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int32.c index 15ef91b6d1..1df136bafb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int64.c index e85bfb0aa8..002f86e5c3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int8.c index a7ecbb42ef..bbe27bd971 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_int8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint16.c index f70c8968c9..ccf8f7e758 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint32.c index 9c555114a0..326bbc30f9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint64.c index c6e9838181..5009146efe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint8.c index 4576c917e2..66e4ecedb3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_ne_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_ne_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_pair_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_pair_bool.c index 44ad7fec0d..5fe4238a11 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_pair_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_pair_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_pair_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__lxor_pair_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__lxor_second_bool.c b/GraphBLAS/FactoryKernels/GB_AxB__lxor_second_bool.c index e52779a680..8798565d4f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__lxor_second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__lxor_second_bool.c @@ -2,7 +2,7 @@ // GB_AxB__lxor_second_bool.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__lxor_second_bool) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp32.c index 29210b0b66..1a04f03010 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_div_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp64.c index 160fd2884d..cfee7d08de 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_div_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int16.c index aded75447f..6a6ac6166b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_div_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int32.c index 8e8a79549d..6eae772dfa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_div_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int64.c index 6aae1e4683..ffda150459 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_div_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int8.c index 5616c6f34d..b65d4e47e9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_div_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint16.c index ea7c0ad44b..0e49a52b9f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_div_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint32.c index c89c60ce85..5310518ded 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_div_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint64.c index af8737a5d4..fb23a37e79 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_div_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint8.c index 6a13fecd90..2ef6143c83 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_div_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_div_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_div_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp32.c index 30580322a3..a7e4fa5629 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__max_first_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp64.c index 6ae4d744a3..1fdf61a0b2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__max_first_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int16.c index 97c183e7a5..b6f40efab9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_first_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int32.c index 44ba5d8533..298ef208e4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_first_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int64.c index eaff231bbe..e6fffa34bb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_first_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int8.c index eb153ecaf3..75284e238f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_first_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint16.c index 90864160c8..4e8fd18dd0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_first_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint32.c index a4ad5fa6c5..a92944e530 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_first_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint64.c index ca4b5a6e98..7f7e500c16 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -468,5 +467,7 @@ GrB_Info GB (_Asaxpy3B__max_first_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint8.c index 203aa55936..ff952e2eac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_first_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_first_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_first_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int32.c index 338ce5e22d..1b87ce5356 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_firsti1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__max_firsti1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int64.c index 6225ab20db..825f1093bd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_firsti1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_firsti1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int32.c index 328aa6eb2e..61ce2fc7ad 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_firsti_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__max_firsti_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int64.c index c2eefeece6..87c46089f3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firsti_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_firsti_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_firsti_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int32.c index a57e3727f6..d944c29395 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_firstj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_firstj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int64.c index 8284813b65..7c157e015d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_firstj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -468,5 +467,7 @@ GrB_Info GB (_Asaxpy3B__max_firstj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int32.c index 5bc7030795..e7cd149daf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_firstj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_firstj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int64.c index b4fed100e5..e0ea319981 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_firstj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_firstj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_firstj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp32.c index c45c3fbc42..2985a20365 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_max_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp64.c index ba82bb07fa..3dbf8bd638 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_max_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int16.c index cbb8f10ef6..1bc0cec5e8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_max_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int32.c index 4e957daa80..82fed3959e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_max_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int64.c index 46fec35377..f8f8dc060b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_max_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int8.c index c73b057b8f..50cd900be5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_max_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint16.c index 8045eab1c9..985bbbe176 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_max_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint32.c index a9eacda86d..434a4db53d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_max_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint64.c index 5cdb7c4b5a..72d63de8d1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_max_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint8.c index 20a4738ced..ccc4c24eb3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_max_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_max_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_max_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp32.c index aa3e749e6d..492fa8a1bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_min_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp64.c index d40bcd38bb..19255e167a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_min_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int16.c index f1bae22233..c06b1717d1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_min_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int32.c index 8c894e5809..4092ab0da9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_min_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int64.c index 701cfcac76..d5cc181786 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_min_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int8.c index f67f87d681..8dffedd40c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_min_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint16.c index 422461883f..e9230a9582 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_min_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint32.c index 77df58efd7..d363a7dae5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_min_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint64.c index 91ecef7c81..f4eda76140 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_min_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint8.c index b9cade61b9..c95125a6ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_min_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_min_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_min_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp32.c index 8dc77f41cc..e4d4b9c536 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp64.c index b40107cbd8..6a2d73271a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int16.c index e0cf1e90cf..941ceb8ee2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int32.c index 8ab096d9d8..8f049d4288 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int64.c index 02f214c7c5..3b9f5bbcd0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int8.c index 6c8ad8fe59..e2e84a32d4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint16.c index 65e4982cee..5b0f327065 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint32.c index da0b5ec3ea..c31419213b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint64.c index 7f49d4fd3a..9006a2817e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint8.c index 514b223f06..bed4315b8c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_minus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_minus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp32.c index fecbd8c4f0..e9cb7a24ff 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp64.c index 5b0a3cb9a8..820298ddd9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int16.c index 23a1eb20ef..32fd2cb945 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int32.c index a142b1f6b4..89fffa3faa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int64.c index 6c71c0c72e..8334386f7d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int8.c index 5a92e15f49..946b9a06fb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint16.c index e099976e65..3f3cae2d6b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint32.c index 5ff1e1dd11..56531efeb5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint64.c index 21e2767d6c..a2a5850c06 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint8.c index 3874e56f4c..4f49f88170 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_plus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_plus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp32.c index 624d6a07b2..ff593853ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp64.c index 7013503320..312f46b9a7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int16.c index 561629ebbd..4551131bd3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int32.c index d26e479368..0495ba7c7d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int64.c index fd731ebd78..4ed5bdd5be 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int8.c index 6929d47f6e..2980f25499 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint16.c index 26d1c8a260..66aee832eb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint32.c index 024c716ed6..f2191ce4ea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint64.c index 41cdea448d..b880381330 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint8.c index 8d5b6a1f43..e64993d54e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_rdiv_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp32.c index d71ead7172..5e9f2037e7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp64.c index 26f6a5dfc9..5db0ebd8fd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int16.c index 571bbb0fe2..7bbd844431 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int32.c index 73d77a9eb3..4c3338c080 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int64.c index e0626fc7fe..21d6c9a01d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int8.c index 6099b70831..b4b13b0218 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint16.c index 56bcd71bbb..34efb53381 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint32.c index a62353d519..5242497137 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint64.c index b2432b6e8a..e2ebb6d000 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint8.c index df1193c1b2..73dfc382af 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_rminus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_rminus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp32.c index 06d76c0886..505ebc09c6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_second_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp64.c index e83181fc3d..9e66e5a927 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_second_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int16.c index 96a9d7e8cf..332e1eef66 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_second_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int32.c index 44567921af..16feb0828c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_second_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int64.c index 54e1f8e783..961f033d67 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_second_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int8.c index 8856c9e806..590eebd63b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_second_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint16.c index e770fda368..91ea9418ea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_second_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint32.c index 52fb3c4504..2676df2b97 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_second_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint64.c index 8fc1a7cd87..469d94de8e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_second_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint8.c index b0065c4e9b..645485a226 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_second_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_second_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_second_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int32.c index 6778d5146d..9c6a4458bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_secondj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_secondj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int64.c index 6c4413025b..223951a4ce 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_secondj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_secondj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int32.c index 450c6cf463..f50c17dfff 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_secondj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__max_secondj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int64.c index 364f08b242..795379ba81 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_secondj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_secondj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_secondj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp32.c index a1808f0d83..a9fadc8221 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_times_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp64.c index 7190a7447c..941cd1f6c4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__max_times_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int16.c index 630b5bd2fb..e7b1152d50 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int16.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_times_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int32.c index 3128066341..c417edaeea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int32.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__max_times_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int64.c index a9371ccc25..b26f93a5e7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int64.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__max_times_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int8.c index 6634fe08ef..e4d12bd290 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_int8.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_times_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint16.c index d66453c63c..abec558ce3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_times_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint32.c index 51bf2e64f2..86e9bc0ac6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_times_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint64.c index 9ec767cd17..2198993a6a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__max_times_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint8.c index fa4ad28f5b..72ed3001a6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__max_times_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__max_times_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__max_times_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp32.c index 5d9f788bcf..5471a416ca 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_div_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp64.c index dfab1c4b2e..e45a84151b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_div_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int16.c index 4b036a1071..862279cf06 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_div_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int32.c index 704dd842b9..8686a5284e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_div_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int64.c index 0edd1f2a15..ca57b9042c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_div_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int8.c index 8e142070e0..e6b494121f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_div_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint16.c index bbcf327363..79121a1f77 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_div_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint32.c index 6d3c45a9e2..191f3e11b3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_div_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint64.c index f805da5e45..2eacd2c891 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_div_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint8.c index ac83192254..c288424a10 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_div_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_div_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_div_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp32.c index 3e14a973ae..6803701643 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__min_first_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp64.c index 6cdef3e347..6f15c1b4ee 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__min_first_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int16.c index ec506fbb11..289f73af0c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_first_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int32.c index 7bdb78cbac..b7b0a371d6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_first_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int64.c index c67ed686b8..8e1cc5e9d7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_first_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int8.c index aef368ff0f..a0f2f72d09 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_first_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint16.c index 3e0d056d16..f44c48f847 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_first_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint32.c index 8512ce9c4a..6adfbcbb2d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_first_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint64.c index fb48fe2e7c..9feb1823e1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -468,5 +467,7 @@ GrB_Info GB (_Asaxpy3B__min_first_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint8.c index e0d6553b29..bda481e7e3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_first_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_first_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_first_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int32.c index b8600eb833..2e129cda4f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_firsti1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__min_firsti1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int64.c index 90d2700b3c..ceb809ddfe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_firsti1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_firsti1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int32.c index afdc136cb1..1e069b62d8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_firsti_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__min_firsti_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int64.c index f71e818a48..b652ed33fc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firsti_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_firsti_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_firsti_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int32.c index bf71dab79c..e41cb98a55 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_firstj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_firstj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int64.c index 0c4e6fa4cb..a9ade7e8ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_firstj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -468,5 +467,7 @@ GrB_Info GB (_Asaxpy3B__min_firstj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int32.c index b167e78031..f975d3ea9e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_firstj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_firstj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int64.c index db55959310..46725e13ef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_firstj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_firstj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_firstj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp32.c index 51d97294ec..5f4b4c60e9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_max_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp64.c index ac04ed96e1..8f39c57a5c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_max_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int16.c index 4e0da6d45f..62a4e854b1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_max_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int32.c index 7322cd7204..b4b1741eea 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_max_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int64.c index f7890abff4..c19b1ef9c8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_max_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int8.c index 57a66e68f3..249c1c8a7a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_max_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint16.c index f7d6b6d622..40b005cbf3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_max_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint32.c index 57f168b1b5..6718d5e184 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_max_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint64.c index 49c1f236dc..c67abde90f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_max_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint8.c index 5965606293..1785c29173 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_max_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_max_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_max_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp32.c index c2bbf7f59c..a9263399ac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_min_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp64.c index a5cf3ac6a3..1547ddb8da 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_min_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int16.c index ce07516455..5f83d3ff78 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_min_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int32.c index ef5db08c99..f7378411dd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_min_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int64.c index 0bc08e1f7b..bf52794fd3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_min_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int8.c index a288d2a8e1..56febd8c79 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_min_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint16.c index b317407483..ea00a7b36f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_min_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint32.c index 003d19674c..1ec8a8f42c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_min_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint64.c index 9616d184af..9879872f1e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_min_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint8.c index 0971dc07c3..8c91102d47 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_min_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_min_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_min_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp32.c index 41e330199a..6077672421 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp64.c index a3bddf3673..54b8cee435 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int16.c index 6d99899589..7a96322d5d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int32.c index e8f5dbc113..39efb09619 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int64.c index 73ee947ec3..5bc0300f79 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int8.c index eeb3447857..dd0d5863e0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint16.c index 2ac04707e0..425ad48536 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint32.c index 2df186a14f..1464e53f25 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint64.c index fbb89c6520..6d9eda0399 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint8.c index 7262624fb8..475085cb05 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_minus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_minus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp32.c index 665081f060..b95fa3e1dc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp64.c index 07e93e1c0e..9ec3e66370 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int16.c index a5767d7ae5..cea876b858 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int32.c index a0fe4550c1..8636943f7f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int64.c index 64b3fd2978..8f86f88d0d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int8.c index 72a35b5eb2..f9bea435b7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint16.c index aaa954ebb5..6d4518bb26 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint32.c index a827bd07b6..71a7966139 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint64.c index 596b189774..954dd81192 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint8.c index 0466a2922d..9e41e00dc4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_plus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_plus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp32.c index 9a0278a928..d406edc905 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp64.c index c3ed9e831a..c96331f438 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int16.c index f71af7cb89..df93e4e4f8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int32.c index ada992f635..69d34eb285 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int64.c index 55db22663c..9500da3001 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int8.c index 780f939cf3..396c994659 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint16.c index 8cbbae1e2d..367a2e775a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint32.c index 30bbabf86d..6bc2c939d6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint64.c index a5789ad74f..eca4a70467 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint8.c index 9b0e80be36..d94f0244b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_rdiv_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp32.c index 2db24cda73..71abf86218 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp64.c index 4988ff2347..516ac14f6e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int16.c index a000baa33d..2941a47c74 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int32.c index 747086ca1e..a0de326442 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int64.c index 0b653f991f..a19c767dee 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int8.c index e737c7d83d..03344e80ef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint16.c index 6a62f92616..6250dd6d8f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint32.c index 342aa5dd1d..da175a4113 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint64.c index 89c974fbf8..00250ae7e4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint8.c index 0c3d88bfaa..48f57d82b5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_rminus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_rminus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp32.c index c9d0e9b72a..5f32e0c262 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_second_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp64.c index b4c4c79161..baa8d96f9d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_second_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int16.c index 78b04ab626..52005f7659 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_second_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int32.c index d8f46ac89b..10f0adfe88 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_second_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int64.c index 8a08679d8c..97536a2312 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_second_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int8.c index 1f422cdd68..392f12bdda 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_second_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint16.c index 1878dcfb7f..bae4ccdf27 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_second_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint32.c index bbe11a72ac..ff752ce424 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_second_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint64.c index 76c1d945d5..a36e83bca4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_second_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint8.c index d49c81d444..6e7c189eb9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_second_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_second_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_second_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int32.c index cde5e41e7b..76ad967061 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_secondj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_secondj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int64.c index e47305b047..234679d905 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_secondj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_secondj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int32.c index 7e1cfba103..e79234864b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_secondj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__min_secondj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int64.c index 2153d52ff9..63d3ea6289 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_secondj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_secondj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_secondj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp32.c index eeed9f26b1..b576a2dbe3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_times_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp64.c index 238f312df6..ee16226bd7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__min_times_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int16.c index 6c64dd56c5..c1f2d2fcf4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int16.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_times_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int32.c index 85bce94129..c4cb18c106 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int32.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__min_times_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int64.c index 9d1e1df905..11e0e1a16c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int64.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__min_times_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int8.c index 81e98fa227..093ca01c9b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_int8.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_times_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint16.c index ef0f5883d3..96747351ab 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_times_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint32.c index d87048ca54..a709ea8a09 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_times_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint64.c index 23a16cc712..fc5ae6f036 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__min_times_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint8.c index 410e2977e0..4d024caa52 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__min_times_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__min_times_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__min_times_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc32.c index 9162bd759c..804e0ebd79 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc64.c index ce6f17c30e..c492631153 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp32.c index fede413e35..7296b37cdb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp64.c index 17a46c3ca6..3b453e3f23 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int16.c index 385428e74b..ac620de237 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int32.c index 62827a0ac8..05bddc28af 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int64.c index 230d72959c..93ae55a1f7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int8.c index caf4efc9dd..0fad98ec61 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint16.c index ff6fede9df..9a00268e41 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint32.c index 6f1fd84f73..de1423400c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint64.c index b90a8090e7..750fbfa337 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint8.c index 97b3b95799..1b42163eff 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_div_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_div_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc32.c index d744d54050..9c926e897c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc64.c index 72141af872..d7fd9c6fdb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp32.c index ec1b6e2b31..2d5c406f2f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp64.c index 6f2c37e560..b4de67830c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int16.c index 01aa1cb8d6..885c3ead76 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int32.c index ca660c78ab..5be4700303 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int64.c index b12582abbc..be9fe3fa35 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int8.c index 3c48b6e7c0..871a40e008 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint16.c index d48ae38407..7739dc6bca 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint32.c index 6e9e355f2b..edfbcefe4e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint64.c index bbfb8aad2a..b5e06288d8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint8.c index ff69d0b9ff..448393269c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_first_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_first_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -462,5 +461,7 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int32.c index ceae9bd34c..c5055794f7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firsti1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__plus_firsti1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int64.c index 16c95fa22e..32a684dccd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firsti1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__plus_firsti1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int32.c index b580af8005..dc030b9af0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firsti_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_firsti_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int64.c index 2dcfde7d91..e7ba12d0d9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firsti_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firsti_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_firsti_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int32.c index 37130ea4f0..0f1464d3e5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firstj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_firstj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int64.c index ced095e907..034d468169 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firstj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_firstj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int32.c index 9ddbd565f6..f198caf8f5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firstj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_firstj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int64.c index a0b2cc54b8..b25f50022d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_firstj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_firstj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_firstj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp32.c index c37cf82f24..ee841431f3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp64.c index 485ad8b2c1..41d6bc8fd1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int16.c index aa95efaf07..05f880dbbc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int32.c index d2e4c704d5..ca4ad0760b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int64.c index 5de304fafb..871a88c7ec 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int8.c index 426077c39f..00fc189b44 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint16.c index d1ebd911fb..84d0440794 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint32.c index b107f7a578..8e26bc5a22 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint64.c index 2e39051596..c7ca79659b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint8.c index 235565f56a..03d1d018e3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_land_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_land_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp32.c index 558cabeb7e..880c8218a5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp64.c index f5cf9102ca..b570d577c8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int16.c index 7f571fe363..c84c0754e5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int32.c index fb95f2e5d9..ea77b1f0f7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int64.c index 460ecb9966..7162b964d8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int8.c index 99019ebe5e..03bc5cfdc3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint16.c index a134c74d4d..7ba8f1e054 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint32.c index 0d868f2df5..1108da96e3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint64.c index a241f867a2..5b7b3dce69 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint8.c index 709e225ac3..18e22ccae4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp32.c index f102f5dc91..ac4994c1bb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp64.c index e7051bced0..3880d9df00 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int16.c index 18b0bef6bf..e6dd098f3b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int32.c index 19bc447e7e..9fc9bc5a86 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int64.c index c4fb620f49..b8f7411539 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int8.c index 7783680f22..0da4c9a8e5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint16.c index e183725d79..102528e6fc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint32.c index 1e7659e2da..f867b8a8d5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint64.c index 97bfb418d8..8e6adbf210 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint8.c index 52f47e1e47..ad6a6dabe3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_lxor_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_lxor_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp32.c index ee8c42b825..404c131af7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp64.c index 6bd4905987..d05198ed7c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int16.c index 0c162e9ffb..bd5f4c5883 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int32.c index 610322bff5..8612ad0eda 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int64.c index c66080f6ad..9a783a4a11 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int8.c index 6a2dd47cd2..a10be675c8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint16.c index d357ea1e92..75f7027c18 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint32.c index 03f9e7599f..5c2053089c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint64.c index 9bea1dbf44..fe35e1c222 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint8.c index 3737e4e92b..9fef08588c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_max_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_max_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp32.c index c7c1c5426d..8ab1137835 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp64.c index 6b873c95c0..721bb6bd7d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int16.c index aeca60a4c2..abefa36199 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int32.c index 0b99d796b0..18c8d12650 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int64.c index baa0be6ede..5d13559f9b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int8.c index 7332bf531a..767beafbb2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint16.c index c891672f1d..49c6de03c7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint32.c index 70d27afdf6..3af30982ca 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint64.c index 52839e6c44..73c1f27c5f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint8.c index 343efd9791..69203ba79d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_min_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_min_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc32.c index ad59a11ff4..6d7f700062 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc64.c index 87aa526927..4d64bcc45a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp32.c index 16ee229d7c..225bd09254 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp64.c index 686362b9ab..bc4f9cd977 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int16.c index 7959e31865..b5fb356e5d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int32.c index 2e7f32e076..b39534cc2d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int64.c index 73985778b3..2bb22055e5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int8.c index 4ddbc6f51c..5895a6ba10 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint16.c index ece1950a05..6e5b6484d8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint32.c index ca20f247b4..59c13c92d5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint64.c index 5b5a09fefc..bc5e74ffef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint8.c index 516cc906b8..6cdb67a59b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_minus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_minus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc32.c index b05369a308..ecbbf9bcc2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc64.c index 48c844e963..e2899be683 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp32.c index 60034a8eb7..ddee737d51 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp64.c index 3fb1973b64..4310c8696c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int16.c index eab61c790b..64ab235103 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int32.c index 66248f0cb8..6f8e8d65b4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int64.c index e4f1c0c8fc..c2a3409c71 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int8.c index 611f7ab7c5..346f77a063 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint16.c index c23a353ab2..4914d05f4d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint32.c index 1ae15af373..757cd886dc 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint64.c index 2286492440..2b7e4ea174 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -467,5 +466,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint8.c index aaa3cdb4d2..aaf6d8e6bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_pair_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_pair_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc32.c index 3076610120..9e5fee3045 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc64.c index 3f5af4219d..dad2795d66 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp32.c index 72a8790585..4e88d2719f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp64.c index 991f2ca229..d3ccb1f7cd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int16.c index b3428eb997..8b27be7715 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int32.c index 5d2a36e844..c754e9189f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int64.c index 5f4c92777f..e0d0627611 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int8.c index 56d20dbd74..77e39529e6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint16.c index 58ec8f0b75..3ff65e1cb4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint32.c index 0f9cdf0464..2ee854173f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint64.c index b9e62f1fe0..f96acf2715 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint8.c index 6a3d7123ad..8b9498ffc3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_plus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_plus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc32.c index 8557a8dc9a..091fe75e26 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc64.c index b3b18deb3b..a62596d9fa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp32.c index 5f5648bca5..a804b1c211 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp64.c index 69a46c30d1..adcdc51bb8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int16.c index db6af97383..1cc57951d8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int32.c index 41292c82a8..9b2b042c3c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int64.c index 65c41fe623..58171b76e3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int8.c index d4be4de3c0..36bf6f926a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint16.c index eb99cb752b..ebfc77ddfa 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint32.c index f918ca1239..0825b42ca7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint64.c index 76036d6be2..7233100b01 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint8.c index abae69a7be..198ac00741 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rdiv_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc32.c index 40ac3c938f..92d69bdf72 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc64.c index 2c39e3ba2f..497c1671fd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp32.c index 6bad7f656e..aa23d26e03 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp64.c index ca1187d89c..0c1026aef8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int16.c index 8962570d82..c0d737b4f0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int32.c index faad15a3d3..fe92a8e160 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int64.c index 85a55c69ff..dc275cf897 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int8.c index 490e7139d0..1c7e351e1b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint16.c index 77bf421aba..328018d661 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint32.c index dab785deae..7857ef14c7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint64.c index db711490f3..fa2414c6ac 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint8.c index fc0c2688a9..9688106849 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_rminus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_rminus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc32.c index c738421824..5d841e9dd7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc64.c index 2de7c09d01..c63443cd4e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp32.c index ed6d0f6040..888b626481 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp64.c index 649f2b2f9f..30c66700a7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int16.c index 5f6ab04607..cbf4cf234f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int32.c index b56c368208..7d370ea665 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int64.c index 746ddc210d..b23aec0f86 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int8.c index d5546c3ee3..703b57aa9d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint16.c index f2bb3cb3cf..d36953f8a7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint32.c index f4bad664e3..bafa849e5b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint64.c index c6ef2c490d..6cd9fb68ba 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint8.c index cc4c481fc2..8e75f58d34 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_second_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_second_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int32.c index 24e1be6531..b61488e06b 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_secondj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_secondj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int64.c index a199fd6fd6..c0bb21697c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_secondj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -466,5 +465,7 @@ GrB_Info GB (_Asaxpy3B__plus_secondj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int32.c index a5cdcb3a78..0fc0e10d29 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_secondj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_secondj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int64.c index d5f9f48929..09d94c2527 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_secondj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_secondj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_secondj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc32.c index acea50d301..5799a713d2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc64.c index 826b04e4cf..547f933ab4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp32.c index 4f99228de3..93b993746c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -531,5 +530,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp64.c index b48d9c2415..f53e3f5df0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -531,5 +530,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int16.c index 64ad118c0c..f3d3f4022e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int32.c index 1a3c3132f3..182ea6fbf5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int64.c index 9f1492bc5d..2de9baa62e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int8.c index 8a515ce86a..e68e7c6238 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_int8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint16.c index e6eb22900b..605b86a263 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint32.c index 3833b4ae88..e60abae649 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint64.c index 2dbbe91d4a..6bd0ff8c00 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint8.c index 896fed148d..e2c4cd2b90 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__plus_times_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__plus_times_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc32.c index 4db197786c..1d827c34c6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_div_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc64.c index 4e7e6b17cc..c33be91b36 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_div_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp32.c index 838614aaf3..39b241b75f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_div_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp64.c index b8b8db9967..c126ae792f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_div_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int16.c index ce34c9b802..440ecfa248 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_div_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int32.c index c2847105e4..ce8bec96ed 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_div_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int64.c index 536ee3de5b..883508eed5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_div_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int8.c index 4d702d6343..cdde475a63 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_div_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint16.c index cb7de2e51b..13eab898a6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_div_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint32.c index 08be58a173..c8fe883ff6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_div_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint64.c index 163cb8c554..25582a6e61 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_div_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint8.c index 7bc3cdc08b..d282eef17c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_div_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_div_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_div_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc32.c index d05fdda979..5d31bb5a46 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__times_first_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc64.c index 401a65a55f..215b3f12fd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -458,5 +457,7 @@ GrB_Info GB (_Asaxpy3B__times_first_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp32.c index c35d470f16..b9b0a5079e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__times_first_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp64.c index b31a5ea2f4..abe5ab26a0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -461,5 +460,7 @@ GrB_Info GB (_Asaxpy3B__times_first_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int16.c index 89118d2ef4..3f2842c280 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_first_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int32.c index 310d072adf..4c9f81ef26 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_first_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int64.c index d91877374e..ac6f79d030 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_first_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int8.c index b4a81a12cb..8af8b6c2e4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_first_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint16.c index a00d31d75b..b54776b48f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_first_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint32.c index a0ae02e127..b81aa705f6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_first_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint64.c index a04d1bde1d..48a4e0c627 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_first_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint8.c index 9e2281e62a..63f7023c88 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_first_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_first_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_first_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int32.c index 96dca28122..229c794640 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_firsti1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_firsti1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int64.c index 846904d3f4..f7ed99dda3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_firsti1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_firsti1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int32.c index b3bcadb7d5..bb6cbcb382 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_firsti_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_firsti_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int64.c index 68888e0297..e4585b4abd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firsti_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_firsti_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_firsti_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int32.c index df53557736..b442b35e2c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_firstj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_firstj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int64.c index 18322a4233..f38b1ceb80 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_firstj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_firstj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int32.c index 830c4d74c7..d684cd08a1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_firstj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_firstj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int64.c index 7ea4597589..a6ad0501dd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_firstj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_firstj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_firstj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp32.c index 94858994b5..7874bb1b16 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_max_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp64.c index 491680637c..e335ebcb0e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_max_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int16.c index c9b0c71d9d..1e90fcec81 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_max_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int32.c index 21df36d0e4..a946297c34 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_max_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int64.c index 7351dc6829..46510a717c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_max_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int8.c index 1987313ff5..abd4805ea1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_max_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint16.c index 792d7e3322..e44e78d72d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_max_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint32.c index 07f68965be..eb4ac3d81d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_max_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint64.c index 7eff3ed520..b6b9b55ffd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_max_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint8.c index a2d25b5e86..881e41b697 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_max_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_max_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_max_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp32.c index 423ca10822..1c4d19d64d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_min_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp64.c index 70941a612d..6764ee4017 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_min_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int16.c index 90fb3a7c53..0d62268e8c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_min_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int32.c index a228c3b1cf..b2f4fe6c09 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_min_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int64.c index 04f8119fff..7ca5b631a6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_min_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int8.c index 8a495ff649..3447e52185 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_min_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint16.c index 706d710ed1..59244158b1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_min_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint32.c index 123e1a43c0..954430db15 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_min_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint64.c index 511966397a..98ce71c282 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_min_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint8.c index 42223a76ce..508d83dff1 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_min_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_min_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_min_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc32.c index b7eb67e023..e9765767c8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc64.c index 82ec5d6ad2..06ffc56fc8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp32.c index d427ebaf82..bde9ac5f29 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp64.c index 8047acfa03..ad444fe46c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int16.c index 93401c7835..7562c726e2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int32.c index 3e7461d495..e315def704 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int64.c index 6d7a17a5ea..d77cf6b1d4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int8.c index a690900ae9..b000f935ef 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint16.c index a5020d8751..e1800f15f0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint32.c index 6ba4ea29e4..7f263d5ba2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint64.c index 6c67709187..e31800fd45 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint8.c index 7e9435553f..8d53623f8c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_minus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_minus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc32.c index 3fafe592e6..9f99a9968e 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc64.c index 2b716f1a35..eb6c3956a0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp32.c index d40b23b9a8..e19a6f9ca6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp64.c index cb531077be..970b1e2157 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int16.c index 535075095f..bdb9103f05 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int32.c index 34c352c0c9..f3d977e285 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int64.c index 542617d8b4..9f609eb61a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int8.c index a0d39c944e..922077acb7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint16.c index ea84d01c97..047522b014 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint32.c index efab3eb637..e804453f42 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint64.c index 58e96bc4af..07991c71fe 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint8.c index ee2c67af13..05ddee412f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_plus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_plus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc32.c index 9ace35a11c..b5bba21b5a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc64.c index e90075d59c..ecc0a92939 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp32.c index 358d136577..620817eaf3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp64.c index 766efdbb55..3cc1183b23 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int16.c index 71f8268ce9..496957bad4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int32.c index 8e0eba881d..ad76c220f0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int64.c index d9c46dd329..8b9cc0a9dd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int8.c index cb7f523988..43b595c7bb 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint16.c index 80ba9f11ca..75d2970426 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint32.c index e76ee2a875..a977c955ab 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint64.c index 62e0967204..d040953b71 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint8.c index 2fe1ad8ca9..8fe2925a1f 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_rdiv_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc32.c index 73b062e556..7bf9fa582c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc64.c index 9645050646..df1a514ab2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp32.c index 07e3ad7426..b3824bd382 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp64.c index 8b6aa912e6..2ef8c8ce61 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int16.c index d54ab27758..45c1d5bbc5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int32.c index f029e2eb67..614679c0a4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int64.c index fc83d7371d..fa8e6417e9 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int8.c index 629e8ac753..2454871294 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint16.c index e5874b7269..d67ccc407d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint32.c index 461bd0f21e..788987648d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint64.c index 77c69b0d2c..9fb2b508d6 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint8.c index 20e3edcc4d..9067f740a0 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_rminus_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_rminus_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc32.c index d093527c40..a66b066df3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_second_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc64.c index 29f5d16300..556eec65b8 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_second_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp32.c index 8b929e4521..0564503768 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_second_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp64.c index 982c81ab8d..05cf234a72 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_second_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int16.c index 78bce391ed..a1ebf8b84a 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_second_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int32.c index 7eb8a805b0..064eb7b1cd 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_second_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int64.c index c8b2e9a0d6..4bf31e74c7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_second_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int8.c index 3707b67dd2..03c1d65035 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_second_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint16.c index a898e1ca71..6a547c4c94 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_second_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint32.c index 2761b39021..9c7ddf6151 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_second_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint64.c index fcdfc69736..71c3ce38bf 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_second_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint8.c index 7eebc40245..7321279a90 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_second_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_second_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_second_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int32.c index e73b296ac7..c19afbb92d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_secondj1_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_secondj1_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int64.c index 3de13b7c62..0812ce45b5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj1_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_secondj1_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -465,5 +464,7 @@ GrB_Info GB (_Asaxpy3B__times_secondj1_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int32.c index 80fb73b328..33975532a7 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_secondj_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_secondj_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int64.c index bda597809f..e8af31f93d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_secondj_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_secondj_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_secondj_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc32.c index 82d54dd869..d7cd8d3184 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc32.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_fc32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_times_fc32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc64.c index 99b2d2e899..5f1c0659c4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fc64.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_fc64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -457,5 +456,7 @@ GrB_Info GB (_Asaxpy3B__times_times_fc64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp32.c index 7ca39594d9..5d9cd0b77d 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp32.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_fp32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_times_fp32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp64.c index ca03717b92..ddbbb940ae 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_fp64.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_fp64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -460,5 +459,7 @@ GrB_Info GB (_Asaxpy3B__times_times_fp64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int16.c index 4ec5f36846..673f6f61f4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int16.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_int16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_times_int16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int32.c index 815ac50ef7..749b9b4a9c 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int32.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_int32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_times_int32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int64.c index 5c523c57ef..0318bc39b2 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int64.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_int64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_times_int64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int8.c index 67d8bbabca..e163a24eb5 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_int8.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_int8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_times_int8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint16.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint16.c index f27d101686..6059913be4 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint16.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_uint16.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_times_uint16) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint32.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint32.c index 80da442623..8332e8ce23 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint32.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_uint32.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -463,5 +462,7 @@ GrB_Info GB (_Asaxpy3B__times_times_uint32) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint64.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint64.c index 37fcf66b99..a4f14d7254 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint64.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_uint64.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_times_uint64) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint8.c b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint8.c index 3f915e215d..77ce413ec3 100644 --- a/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_AxB__times_times_uint8.c @@ -2,7 +2,7 @@ // GB_AxB__times_times_uint8.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_AxB__include2.h" @@ -464,5 +463,7 @@ GrB_Info GB (_Asaxpy3B__times_times_uint8) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__atan2_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__atan2_fp32.c index bec45b3048..12024a4689 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__atan2_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__atan2_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__atan2_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__atan2_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__atan2_fp64.c index 74cbf3d460..f1db4fff24 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__atan2_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__atan2_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__atan2_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_int16.c b/GraphBLAS/FactoryKernels/GB_aop__band_int16.c index ac20db3fcf..0c9d69edd4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_int32.c b/GraphBLAS/FactoryKernels/GB_aop__band_int32.c index 7c4ed7f451..76350dc9b3 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_int64.c b/GraphBLAS/FactoryKernels/GB_aop__band_int64.c index daee3e566f..a0b0047bb0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_int8.c b/GraphBLAS/FactoryKernels/GB_aop__band_int8.c index e4e5960bba..70fc718577 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__band_uint16.c index f299978c8e..bde239cddc 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__band_uint32.c index 2487185ee6..6271fcf9bb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__band_uint64.c index 71d09b1fcd..c84ee23deb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__band_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__band_uint8.c index 64d86e50cb..638b50e6b4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__band_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__band_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_int16.c index 577eac05f9..6aebb202f7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_int32.c index e4541b23df..f1c4415e07 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_int64.c index 25fdf6f932..4caa8df79e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_int8.c index e9c9ac07d9..4d9a62280b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint16.c index 5e6a7670bd..e0da7df8e7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint32.c index 6f62d4fbe2..c5244e3a8f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint64.c index 1d5539047f..c4da2417f1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint8.c index 46190e3c15..e3f5b41e92 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bclr_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bclr_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bclr_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bget_int16.c index a69bee8837..dc82837d1e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bget_int32.c index 181995149d..30b57efd63 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bget_int64.c index eedaf7d40b..b5e42d4487 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bget_int8.c index a4cc74f7f8..2ca7a709d1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bget_uint16.c index 2eda3e1841..917361df07 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bget_uint32.c index 51f0483d2d..8976332f33 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bget_uint64.c index 1f54826a82..ec42bc57da 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bget_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bget_uint8.c index f7ff3832ea..420694a8ea 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bget_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bget_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bget_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bor_int16.c index ddf9501c7c..dc9b0eaaab 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bor_int32.c index 91cbae1da4..8da4201157 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bor_int64.c index 7f8588e279..f5f5a01965 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bor_int8.c index eef00cd90c..e0365c4208 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bor_uint16.c index a06df08987..7d451ed9fe 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bor_uint32.c index 0e286cde45..e007ab7e0d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bor_uint64.c index d2325e8cf6..e863f3377b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bor_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bor_uint8.c index a8343120f3..f3185db9aa 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bor_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bor_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bset_int16.c index cc0b8ee3b4..682480a070 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bset_int32.c index 9355a82768..979ab402a4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bset_int64.c index 8bfa3f22c5..81ba623229 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bset_int8.c index c5b3124093..b47fb76f81 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bset_uint16.c index 6964790e1b..08e6174a5c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bset_uint32.c index 1feb4cd159..53efdad134 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bset_uint64.c index 47cadfb22a..22c36b5217 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bset_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bset_uint8.c index baef2213fd..9199552cfd 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bset_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bset_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bset_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_int16.c index 1a02e65da5..2d71dcd28e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_int32.c index d67108e05a..fe0a378313 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_int64.c index b4739bf8c8..3dda043af0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_int8.c index d3450c6d2c..5725aec95b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint16.c index b3a9232de9..a26c7a6bc0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint32.c index 8e3c0363b1..62118a8089 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint64.c index f9c4fe5de9..67a1e1e252 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint8.c index 9c490c4177..6abec0361e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bshift_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bshift_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bshift_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int16.c index 01c0d98f51..bb00660542 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int32.c index bd82492edd..c889c6b189 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int64.c index 02af0a3fb6..8945a5602e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int8.c index b7b4f67de2..4106ad0004 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint16.c index 29b479b5ea..74c0415b3a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint32.c index 25acf9a678..f78c282cb7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint64.c index 447d6c984d..819ae4e0d4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint8.c index c7f6b44162..d63537d7c7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxnor_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_int16.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_int16.c index e621e549e5..40e7053c33 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_int32.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_int32.c index 761a2f61d5..b6a8d92a9e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_int64.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_int64.c index 966f3814be..1549d51ebe 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_int8.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_int8.c index 6fec34d7e0..ce9e3a6e01 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint16.c index 4affe75b4a..5644b26bfd 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint32.c index 3ccf015257..1dea5b1532 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint64.c index 5c25cc562a..980be05f12 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint8.c index 82280b5b2c..9fe5626865 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__bxor_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__bxor_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__copysign_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__copysign_fp32.c index 3161abb151..b14c0982e0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__copysign_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__copysign_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__copysign_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__copysign_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__copysign_fp64.c index 6b233556e8..355a9706fe 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__copysign_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__copysign_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__copysign_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__div_fc32.c index 68ded3a2ec..a120974733 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__div_fc64.c index a2ce36536e..8ade93d0ca 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__div_fp32.c index f0c7501ac6..3a9a54e39b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__div_fp64.c index a36ccbe04a..d9e87b1541 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_int16.c b/GraphBLAS/FactoryKernels/GB_aop__div_int16.c index db675c5c95..1b7fb7498b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_int32.c b/GraphBLAS/FactoryKernels/GB_aop__div_int32.c index 543a9db1a2..e9809ab056 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_int64.c b/GraphBLAS/FactoryKernels/GB_aop__div_int64.c index 02fff3bc7e..c20b6923a0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_int8.c b/GraphBLAS/FactoryKernels/GB_aop__div_int8.c index e43212401d..bf728b7a30 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__div_uint16.c index d4e4787cd9..0173c6c8a5 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__div_uint32.c index 76cfae4555..1efd41eda4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__div_uint64.c index 4b9800448c..ff02e6bb78 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__div_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__div_uint8.c index a6fb87464d..55e90352c1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__div_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__div_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__eq_bool.c b/GraphBLAS/FactoryKernels/GB_aop__eq_bool.c index 5a2436330a..3d2b909d32 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__eq_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__eq_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__fmod_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__fmod_fp32.c index bf4bb0cae8..1510958d1d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__fmod_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__fmod_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__fmod_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__fmod_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__fmod_fp64.c index 15b3abba65..4bb6ccfd42 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__fmod_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__fmod_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__fmod_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__ge_bool.c b/GraphBLAS/FactoryKernels/GB_aop__ge_bool.c index aacaa7e611..b3174cf94e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__ge_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__ge_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__gt_bool.c b/GraphBLAS/FactoryKernels/GB_aop__gt_bool.c index 12f0b75e4a..a93450d52a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__gt_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__gt_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__hypot_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__hypot_fp32.c index 5889dc6b66..818b597cfe 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__hypot_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__hypot_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__hypot_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__hypot_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__hypot_fp64.c index 271fb76d72..d74611fa06 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__hypot_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__hypot_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__hypot_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__include.h b/GraphBLAS/FactoryKernels/GB_aop__include.h index 61795d224f..f1a27ff028 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__include.h +++ b/GraphBLAS/FactoryKernels/GB_aop__include.h @@ -2,7 +2,7 @@ // GB_aop__include.h: definitions for GB_aop__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_aop.h diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_bool.c b/GraphBLAS/FactoryKernels/GB_aop__land_bool.c index 896c70008f..9bd68f6a94 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__land_fp32.c index 51986b33f1..0028e8ad74 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__land_fp64.c index 18993ba487..e622dc414f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_int16.c b/GraphBLAS/FactoryKernels/GB_aop__land_int16.c index 94e4698958..e0694e9964 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_int32.c b/GraphBLAS/FactoryKernels/GB_aop__land_int32.c index c42b605195..d48fddbe35 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_int64.c b/GraphBLAS/FactoryKernels/GB_aop__land_int64.c index 242fb92775..70dc30eb79 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_int8.c b/GraphBLAS/FactoryKernels/GB_aop__land_int8.c index 7a775fbd5e..d29fe055f7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__land_uint16.c index fecad9758c..0a349ce72f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__land_uint32.c index 32f6084948..b328ee2a5f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__land_uint64.c index 64c9a71ccb..c0575a9854 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__land_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__land_uint8.c index 2b40ed9cbf..daeb5ed5e9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__land_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__land_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__land_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp32.c index 052d068e69..aa7f9dd231 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__ldexp_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp64.c index 6ba872dd2e..fe3d6f6ff0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__ldexp_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__ldexp_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__le_bool.c b/GraphBLAS/FactoryKernels/GB_aop__le_bool.c index 57d08c518a..e6530e61a7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__le_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__le_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_bool.c b/GraphBLAS/FactoryKernels/GB_aop__lor_bool.c index a4a9a1b818..17dcc46503 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__lor_fp32.c index 619b5b40d4..5f5d8617e7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__lor_fp64.c index 12e95520df..145cf2d76f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_int16.c b/GraphBLAS/FactoryKernels/GB_aop__lor_int16.c index c71b79c17f..78e31f9bba 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_int32.c b/GraphBLAS/FactoryKernels/GB_aop__lor_int32.c index f605cefc90..9ae9190d02 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_int64.c b/GraphBLAS/FactoryKernels/GB_aop__lor_int64.c index f17e1c20bd..1c0b96e3c1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_int8.c b/GraphBLAS/FactoryKernels/GB_aop__lor_int8.c index 7bdedee370..3ccd6aa3b6 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__lor_uint16.c index 0d03bff934..bd4258d412 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__lor_uint32.c index cbbaa37a5d..a10e8751ce 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__lor_uint64.c index 2673e6cd61..20197c7f3d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lor_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__lor_uint8.c index 83e7240c4f..b4db7be32c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lor_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lor_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lt_bool.c b/GraphBLAS/FactoryKernels/GB_aop__lt_bool.c index ef3d422c40..2a8b43a9aa 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lt_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lt_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_bool.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_bool.c index 6b1da2cadd..7ae547dad4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_fp32.c index 01c37f39e1..7075ac1af1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_fp64.c index 6d53b0de9b..6dfbedfebc 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_int16.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_int16.c index 52dbbfe8c0..1fb896c0b8 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_int32.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_int32.c index b530f04b39..00d568bd89 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_int64.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_int64.c index 761ff0fdb3..fc847a40a4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_int8.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_int8.c index 9b6ff05078..4684506b22 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint16.c index a9b0c02065..43e0c0f043 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint32.c index 1e5cd9d30c..39cec80406 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint64.c index bb7f891eec..0fb577d751 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint8.c index 2a45f5796b..3cd9319e15 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__lxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__lxor_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__lxor_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__max_fp32.c index 8c4aebfb75..b5ffd3b6e0 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__max_fp64.c index 8b203253a4..1570a1031c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_int16.c b/GraphBLAS/FactoryKernels/GB_aop__max_int16.c index 9e3490f75e..a956c1417d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_int32.c b/GraphBLAS/FactoryKernels/GB_aop__max_int32.c index e715b39420..ab999ce04d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_int64.c b/GraphBLAS/FactoryKernels/GB_aop__max_int64.c index ca7c01f035..81b9cbf46a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_int8.c b/GraphBLAS/FactoryKernels/GB_aop__max_int8.c index 056d892996..01c635c216 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__max_uint16.c index cad46b2992..0f0426a888 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__max_uint32.c index 2ea9b77ec9..4bf0110479 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__max_uint64.c index 2b4cf284f8..ec5c785688 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__max_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__max_uint8.c index 47434971ef..487b60cd35 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__max_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__max_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__min_fp32.c index 26d9637c61..17edc4b38f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__min_fp64.c index d98d385b6d..8560fdcdd7 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_int16.c b/GraphBLAS/FactoryKernels/GB_aop__min_int16.c index a5a6143ff7..7c6d554047 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_int32.c b/GraphBLAS/FactoryKernels/GB_aop__min_int32.c index 69d31626a4..9e40947832 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_int64.c b/GraphBLAS/FactoryKernels/GB_aop__min_int64.c index 25a6c7ce63..e398627410 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_int8.c b/GraphBLAS/FactoryKernels/GB_aop__min_int8.c index 92ca3a1766..27adce6bcf 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__min_uint16.c index 7c419dd1a6..fa217c387d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__min_uint32.c index 710381b43d..e37796a8df 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__min_uint64.c index ab707d7f60..272b5b5b76 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__min_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__min_uint8.c index d3a40fc001..99da67d2a1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__min_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__min_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__minus_fc32.c index e0d9922845..426bf0e95e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__minus_fc64.c index 4661e41b29..d4c11ed001 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__minus_fp32.c index b17f1154cd..67682dc361 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__minus_fp64.c index ac241bc0f1..40e21e4d87 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_int16.c b/GraphBLAS/FactoryKernels/GB_aop__minus_int16.c index db04b4f726..55cec6f928 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_int32.c b/GraphBLAS/FactoryKernels/GB_aop__minus_int32.c index bb5263e81f..52afd16f6b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_int64.c b/GraphBLAS/FactoryKernels/GB_aop__minus_int64.c index 005a35ac42..e4e453cf3c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_int8.c b/GraphBLAS/FactoryKernels/GB_aop__minus_int8.c index 7b7e92dfdf..2b5b503578 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__minus_uint16.c index 4557d0f44a..f1b6bc3636 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__minus_uint32.c index d4e2f65ed1..b5e73d75a9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__minus_uint64.c index c53ec11ad7..c93fb25c6b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__minus_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__minus_uint8.c index ad701b0a7d..b2dd4beb9f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__minus_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__minus_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_bool.c b/GraphBLAS/FactoryKernels/GB_aop__pair_bool.c index b2b7a51c3c..67000abf61 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__pair_fc32.c index 7df4504c1c..490a0d8a7e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__pair_fc64.c index d50f396951..df4b33c454 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__pair_fp32.c index 4bb799c375..98c5c17fdb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__pair_fp64.c index d3eed9c6af..d016a3c47c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_int16.c b/GraphBLAS/FactoryKernels/GB_aop__pair_int16.c index 5b11ba0c57..f321e8b854 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_int32.c b/GraphBLAS/FactoryKernels/GB_aop__pair_int32.c index 89fd7120f6..ca4ef5b3c4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_int64.c b/GraphBLAS/FactoryKernels/GB_aop__pair_int64.c index b0980da3e6..4b684de75d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_int8.c b/GraphBLAS/FactoryKernels/GB_aop__pair_int8.c index 40442db719..ab0bde4460 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__pair_uint16.c index 4c5a2c2c6d..03495c1fe3 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__pair_uint32.c index 9222ee0c82..14cbb4d90e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__pair_uint64.c index 2d9e40d25a..5395d14933 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pair_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__pair_uint8.c index d10ebe8f92..92cf381feb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pair_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pair_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pair_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__plus_fc32.c index fa534f3ab0..8c3f709ce3 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__plus_fc64.c index 757be5dfc7..82c49d7947 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__plus_fp32.c index 18e3688688..36f162126f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__plus_fp64.c index ff634d7e10..228159a2e9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_int16.c b/GraphBLAS/FactoryKernels/GB_aop__plus_int16.c index 6c194761fb..3ffe9a8419 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_int32.c b/GraphBLAS/FactoryKernels/GB_aop__plus_int32.c index c602b5a444..06a99e5c5c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_int64.c b/GraphBLAS/FactoryKernels/GB_aop__plus_int64.c index 469e1f55dc..09f3b27157 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_int8.c b/GraphBLAS/FactoryKernels/GB_aop__plus_int8.c index 4811c99978..f6a4858059 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__plus_uint16.c index 6c64d98ee2..56b49712c9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__plus_uint32.c index fdca1f888e..50070fd7ae 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__plus_uint64.c index 003bd0cfbd..a8961ebab2 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__plus_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__plus_uint8.c index b7629b3d46..e737b5e14a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__plus_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__plus_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__pow_fc32.c index e69f767887..7de0c1a424 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__pow_fc64.c index 9ba8329c15..bd370aa49a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__pow_fp32.c index 35d6c5d514..e1b2ffb5ef 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__pow_fp64.c index 3fea4eb024..87ae43d3bc 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_int16.c b/GraphBLAS/FactoryKernels/GB_aop__pow_int16.c index 26f0cbb7d2..c614dea938 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_int32.c b/GraphBLAS/FactoryKernels/GB_aop__pow_int32.c index 2d16716cb8..dc97e8d083 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_int64.c b/GraphBLAS/FactoryKernels/GB_aop__pow_int64.c index 2fb0bf4f07..8d872efa4c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_int8.c b/GraphBLAS/FactoryKernels/GB_aop__pow_int8.c index 6586e8983c..1150e70376 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__pow_uint16.c index 8366fa8a43..d9fc1a129e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__pow_uint32.c index b03999a889..d9095d7be5 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__pow_uint64.c index 543f04500b..81fde0669b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__pow_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__pow_uint8.c index d3749f0d57..2b6f6cc243 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__pow_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__pow_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__pow_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc32.c index d5fb9f16b9..c3c6b539b6 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc64.c index fd4bfe8982..dbc867e019 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp32.c index 349cb6c885..7f76c85427 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp64.c index a0d2d73d18..9fe6f2e6c1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int16.c index 4f3f1c630a..48074d4883 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int32.c index 1dd65ea9e8..3388e45329 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int64.c index c42425832c..3c166b77fb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int8.c index 9d5f2a2b02..a52aaaf200 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint16.c index 0eede503b1..25fe7ef321 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint32.c index 3334924beb..56fb97c4c8 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint64.c index 920a0d8c3b..676973575d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint8.c index 7a02e345ca..ff0f01d233 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rdiv_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__remainder_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__remainder_fp32.c index b978fa53e8..234975c0f3 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__remainder_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__remainder_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__remainder_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__remainder_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__remainder_fp64.c index dc472854de..4a862171ae 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__remainder_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__remainder_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__remainder_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_fc32.c index 57f917a97c..eada2bf7fd 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_fc64.c index 55b6822eb3..58e1c6ae46 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_fp32.c index caff1e9ddb..858fd090a4 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_fp64.c index ef5dbc2971..c12ac21a77 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_int16.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_int16.c index a8df1a66de..5f85c487e3 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_int32.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_int32.c index 26634aecac..052ee65702 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_int64.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_int64.c index af4cb85b8a..53b4e55bd2 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_int8.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_int8.c index 33e31444d0..d8adfe0013 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint16.c index 77a72d5255..6ab1d80b9e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint32.c index 8c5c0b66c7..e65e645e21 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint64.c index 0b0e49901a..e4cc28f09a 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint8.c index 9758f3c351..764d7afc6e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__rminus_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__rminus_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_bool.c b/GraphBLAS/FactoryKernels/GB_aop__second_bool.c index 3e367a247c..2156c67d27 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_bool.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__second_fc32.c index bd85d668c5..fae2e34a56 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__second_fc64.c index 976ee20de9..9b804836d9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__second_fp32.c index 41e39e5f3e..5f04481f93 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__second_fp64.c index 541156cd9f..3bbf0076bb 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_int16.c b/GraphBLAS/FactoryKernels/GB_aop__second_int16.c index 47ebf7f477..3c6701c4f5 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_int32.c b/GraphBLAS/FactoryKernels/GB_aop__second_int32.c index d5553de97e..a21364e152 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_int64.c b/GraphBLAS/FactoryKernels/GB_aop__second_int64.c index ea96d784f3..e3ae4af3d1 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_int8.c b/GraphBLAS/FactoryKernels/GB_aop__second_int8.c index e113dccbe6..8fe472337b 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__second_uint16.c index 2e71aa3677..dd699015f9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__second_uint32.c index bbbc48cf39..f4347dd9ef 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__second_uint64.c index 0fc66ccb05..a0147c9ee9 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__second_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__second_uint8.c index 717e570554..aa009be782 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__second_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__second_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_fc32.c b/GraphBLAS/FactoryKernels/GB_aop__times_fc32.c index 5faf5f9507..7f9edcc20e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_fc32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_fc64.c b/GraphBLAS/FactoryKernels/GB_aop__times_fc64.c index 17730d158d..112057b54e 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_fc64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_fp32.c b/GraphBLAS/FactoryKernels/GB_aop__times_fp32.c index a4ec556499..231cb3eb16 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_fp32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_fp64.c b/GraphBLAS/FactoryKernels/GB_aop__times_fp64.c index 1dc72a7a17..dbddd3683d 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_fp64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_int16.c b/GraphBLAS/FactoryKernels/GB_aop__times_int16.c index c9407d047e..9f64443ff5 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_int16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_int32.c b/GraphBLAS/FactoryKernels/GB_aop__times_int32.c index 861296db0d..1c6fb290f5 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_int32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_int64.c b/GraphBLAS/FactoryKernels/GB_aop__times_int64.c index 6996695555..e18a958a45 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_int64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_int8.c b/GraphBLAS/FactoryKernels/GB_aop__times_int8.c index 633f130410..9b6c74ff57 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_int8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_uint16.c b/GraphBLAS/FactoryKernels/GB_aop__times_uint16.c index fc4e75fb33..f7159789cc 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_uint16.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_uint32.c b/GraphBLAS/FactoryKernels/GB_aop__times_uint32.c index ad449b9d24..a08473d99c 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_uint32.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_uint64.c b/GraphBLAS/FactoryKernels/GB_aop__times_uint64.c index c9c4893112..260a560e8f 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_uint64.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_aop__times_uint8.c b/GraphBLAS/FactoryKernels/GB_aop__times_uint8.c index d339cd4b86..8aaafab793 100644 --- a/GraphBLAS/FactoryKernels/GB_aop__times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_aop__times_uint8.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -114,5 +113,7 @@ GrB_Info GB (_subassign_22__times_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__bool.c b/GraphBLAS/FactoryKernels/GB_as__bool.c index a97917991f..997cd5a576 100644 --- a/GraphBLAS/FactoryKernels/GB_as__bool.c +++ b/GraphBLAS/FactoryKernels/GB_as__bool.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__fc32.c b/GraphBLAS/FactoryKernels/GB_as__fc32.c index 66f2e79c78..d4f77cbfd9 100644 --- a/GraphBLAS/FactoryKernels/GB_as__fc32.c +++ b/GraphBLAS/FactoryKernels/GB_as__fc32.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__fc64.c b/GraphBLAS/FactoryKernels/GB_as__fc64.c index efb03dba80..5d6a359068 100644 --- a/GraphBLAS/FactoryKernels/GB_as__fc64.c +++ b/GraphBLAS/FactoryKernels/GB_as__fc64.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__fp32.c b/GraphBLAS/FactoryKernels/GB_as__fp32.c index 47b8351ad2..a85585cc50 100644 --- a/GraphBLAS/FactoryKernels/GB_as__fp32.c +++ b/GraphBLAS/FactoryKernels/GB_as__fp32.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__fp64.c b/GraphBLAS/FactoryKernels/GB_as__fp64.c index aa1ea1f494..0a1a1d6bb2 100644 --- a/GraphBLAS/FactoryKernels/GB_as__fp64.c +++ b/GraphBLAS/FactoryKernels/GB_as__fp64.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__include.h b/GraphBLAS/FactoryKernels/GB_as__include.h index 1555de0271..7a5bb3701f 100644 --- a/GraphBLAS/FactoryKernels/GB_as__include.h +++ b/GraphBLAS/FactoryKernels/GB_as__include.h @@ -2,7 +2,7 @@ // GB_as__include.h: definitions for GB_as__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_as.h diff --git a/GraphBLAS/FactoryKernels/GB_as__int16.c b/GraphBLAS/FactoryKernels/GB_as__int16.c index 1e92522acb..0d4df71b38 100644 --- a/GraphBLAS/FactoryKernels/GB_as__int16.c +++ b/GraphBLAS/FactoryKernels/GB_as__int16.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__int32.c b/GraphBLAS/FactoryKernels/GB_as__int32.c index 422c7f9e29..2d2ddc40de 100644 --- a/GraphBLAS/FactoryKernels/GB_as__int32.c +++ b/GraphBLAS/FactoryKernels/GB_as__int32.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__int64.c b/GraphBLAS/FactoryKernels/GB_as__int64.c index 2cac543b04..44578c4f1c 100644 --- a/GraphBLAS/FactoryKernels/GB_as__int64.c +++ b/GraphBLAS/FactoryKernels/GB_as__int64.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__int8.c b/GraphBLAS/FactoryKernels/GB_as__int8.c index 481589e9ca..304918f638 100644 --- a/GraphBLAS/FactoryKernels/GB_as__int8.c +++ b/GraphBLAS/FactoryKernels/GB_as__int8.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__uint16.c b/GraphBLAS/FactoryKernels/GB_as__uint16.c index 27dec31847..c8524c8278 100644 --- a/GraphBLAS/FactoryKernels/GB_as__uint16.c +++ b/GraphBLAS/FactoryKernels/GB_as__uint16.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__uint32.c b/GraphBLAS/FactoryKernels/GB_as__uint32.c index 4b66316b65..d7ac71e92c 100644 --- a/GraphBLAS/FactoryKernels/GB_as__uint32.c +++ b/GraphBLAS/FactoryKernels/GB_as__uint32.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__uint64.c b/GraphBLAS/FactoryKernels/GB_as__uint64.c index a048f4b753..4e4ec2d402 100644 --- a/GraphBLAS/FactoryKernels/GB_as__uint64.c +++ b/GraphBLAS/FactoryKernels/GB_as__uint64.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_as__uint8.c b/GraphBLAS/FactoryKernels/GB_as__uint8.c index 231dcae4aa..deb4a035f7 100644 --- a/GraphBLAS/FactoryKernels/GB_as__uint8.c +++ b/GraphBLAS/FactoryKernels/GB_as__uint8.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,6 @@ #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -115,5 +114,7 @@ GrB_Info GB (_subassign_25__uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_bool.c b/GraphBLAS/FactoryKernels/GB_bld__any_bool.c index a2006c2cbf..d6b34c800a 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_fc32.c b/GraphBLAS/FactoryKernels/GB_bld__any_fc32.c index 440fea2258..5ed876dc73 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_fc32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_fc32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_fc64.c b/GraphBLAS/FactoryKernels/GB_bld__any_fc64.c index f8ff8ba967..bfadac32c5 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_fc64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_fc64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__any_fp32.c index 7b1abdb413..0db7f2464c 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__any_fp64.c index 779f4e8919..d2ec710b1b 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_int16.c b/GraphBLAS/FactoryKernels/GB_bld__any_int16.c index 99d47be179..6cf07eee7d 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_int32.c b/GraphBLAS/FactoryKernels/GB_bld__any_int32.c index dcab321f77..83dbac5f70 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_int64.c b/GraphBLAS/FactoryKernels/GB_bld__any_int64.c index a972e046d0..931ba16acb 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_int8.c b/GraphBLAS/FactoryKernels/GB_bld__any_int8.c index c4c27a7239..9c1105a7ac 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__any_uint16.c index 8cf4b02353..80d91d59a0 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__any_uint32.c index 8e60dddefc..865cea2d44 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__any_uint64.c index 42847ac552..d662724064 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__any_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__any_uint8.c index 94dde5aa9c..d1dbb0369a 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__any_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__any_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__any_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__any_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__eq_bool.c b/GraphBLAS/FactoryKernels/GB_bld__eq_bool.c index 8159df01cd..c2fffa4cab 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__eq_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = (Tx [k] == Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__eq_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_bool.c b/GraphBLAS/FactoryKernels/GB_bld__first_bool.c index 6165fb06ea..7433eb06ec 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_fc32.c b/GraphBLAS/FactoryKernels/GB_bld__first_fc32.c index e8b862ce15..bf8f838c07 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_fc32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_fc32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_fc64.c b/GraphBLAS/FactoryKernels/GB_bld__first_fc64.c index 024cae3c5c..3e335c5d43 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_fc64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_fc64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__first_fp32.c index b58b967155..f38873dcd5 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__first_fp64.c index 417c07200f..89dea3c111 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_int16.c b/GraphBLAS/FactoryKernels/GB_bld__first_int16.c index cde3254c89..4b21a63511 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_int32.c b/GraphBLAS/FactoryKernels/GB_bld__first_int32.c index 26f53208f6..8a1262b1a1 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_int64.c b/GraphBLAS/FactoryKernels/GB_bld__first_int64.c index 36c45240ae..160ca6fe03 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_int8.c b/GraphBLAS/FactoryKernels/GB_bld__first_int8.c index 7d801a928d..a379593d86 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__first_uint16.c index 70c96a71bf..b81d43b544 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__first_uint32.c index e70ae44b50..663e89cbf8 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__first_uint64.c index b5edcb81df..919cd0999d 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__first_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__first_uint8.c index b78e94fbf7..87bb8aeb15 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__first_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) +#define GB_DUP_IS_FIRST #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__first_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__include.h b/GraphBLAS/FactoryKernels/GB_bld__include.h index 371c2ee40d..53e47c0a22 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__include.h +++ b/GraphBLAS/FactoryKernels/GB_bld__include.h @@ -2,7 +2,7 @@ // GB_bld__include.h: definitions for GB_bld__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_bld.h @@ -11,12 +11,16 @@ GrB_Info GB (_bld__min_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -25,12 +29,16 @@ GrB_Info GB (_bld__min_int8) GrB_Info GB (_bld__min_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -39,12 +47,16 @@ GrB_Info GB (_bld__min_int16) GrB_Info GB (_bld__min_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -53,12 +65,16 @@ GrB_Info GB (_bld__min_int32) GrB_Info GB (_bld__min_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -67,12 +83,16 @@ GrB_Info GB (_bld__min_int64) GrB_Info GB (_bld__min_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -81,12 +101,16 @@ GrB_Info GB (_bld__min_uint8) GrB_Info GB (_bld__min_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -95,12 +119,16 @@ GrB_Info GB (_bld__min_uint16) GrB_Info GB (_bld__min_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -109,12 +137,16 @@ GrB_Info GB (_bld__min_uint32) GrB_Info GB (_bld__min_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -123,12 +155,16 @@ GrB_Info GB (_bld__min_uint64) GrB_Info GB (_bld__min_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -137,12 +173,16 @@ GrB_Info GB (_bld__min_fp32) GrB_Info GB (_bld__min_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -151,12 +191,16 @@ GrB_Info GB (_bld__min_fp64) GrB_Info GB (_bld__max_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -165,12 +209,16 @@ GrB_Info GB (_bld__max_int8) GrB_Info GB (_bld__max_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -179,12 +227,16 @@ GrB_Info GB (_bld__max_int16) GrB_Info GB (_bld__max_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -193,12 +245,16 @@ GrB_Info GB (_bld__max_int32) GrB_Info GB (_bld__max_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -207,12 +263,16 @@ GrB_Info GB (_bld__max_int64) GrB_Info GB (_bld__max_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -221,12 +281,16 @@ GrB_Info GB (_bld__max_uint8) GrB_Info GB (_bld__max_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -235,12 +299,16 @@ GrB_Info GB (_bld__max_uint16) GrB_Info GB (_bld__max_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -249,12 +317,16 @@ GrB_Info GB (_bld__max_uint32) GrB_Info GB (_bld__max_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -263,12 +335,16 @@ GrB_Info GB (_bld__max_uint64) GrB_Info GB (_bld__max_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -277,12 +353,16 @@ GrB_Info GB (_bld__max_fp32) GrB_Info GB (_bld__max_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -291,12 +371,16 @@ GrB_Info GB (_bld__max_fp64) GrB_Info GB (_bld__any_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -305,12 +389,16 @@ GrB_Info GB (_bld__any_bool) GrB_Info GB (_bld__any_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -319,12 +407,16 @@ GrB_Info GB (_bld__any_int8) GrB_Info GB (_bld__any_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -333,12 +425,16 @@ GrB_Info GB (_bld__any_int16) GrB_Info GB (_bld__any_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -347,12 +443,16 @@ GrB_Info GB (_bld__any_int32) GrB_Info GB (_bld__any_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -361,12 +461,16 @@ GrB_Info GB (_bld__any_int64) GrB_Info GB (_bld__any_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -375,12 +479,16 @@ GrB_Info GB (_bld__any_uint8) GrB_Info GB (_bld__any_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -389,12 +497,16 @@ GrB_Info GB (_bld__any_uint16) GrB_Info GB (_bld__any_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -403,12 +515,16 @@ GrB_Info GB (_bld__any_uint32) GrB_Info GB (_bld__any_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -417,12 +533,16 @@ GrB_Info GB (_bld__any_uint64) GrB_Info GB (_bld__any_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -431,12 +551,16 @@ GrB_Info GB (_bld__any_fp32) GrB_Info GB (_bld__any_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -445,12 +569,16 @@ GrB_Info GB (_bld__any_fp64) GrB_Info GB (_bld__any_fc32) ( GxB_FC32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -459,12 +587,16 @@ GrB_Info GB (_bld__any_fc32) GrB_Info GB (_bld__any_fc64) ( GxB_FC64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -473,12 +605,16 @@ GrB_Info GB (_bld__any_fc64) GrB_Info GB (_bld__plus_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -487,12 +623,16 @@ GrB_Info GB (_bld__plus_int8) GrB_Info GB (_bld__plus_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -501,12 +641,16 @@ GrB_Info GB (_bld__plus_int16) GrB_Info GB (_bld__plus_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -515,12 +659,16 @@ GrB_Info GB (_bld__plus_int32) GrB_Info GB (_bld__plus_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -529,12 +677,16 @@ GrB_Info GB (_bld__plus_int64) GrB_Info GB (_bld__plus_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -543,12 +695,16 @@ GrB_Info GB (_bld__plus_uint8) GrB_Info GB (_bld__plus_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -557,12 +713,16 @@ GrB_Info GB (_bld__plus_uint16) GrB_Info GB (_bld__plus_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -571,12 +731,16 @@ GrB_Info GB (_bld__plus_uint32) GrB_Info GB (_bld__plus_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -585,12 +749,16 @@ GrB_Info GB (_bld__plus_uint64) GrB_Info GB (_bld__plus_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -599,12 +767,16 @@ GrB_Info GB (_bld__plus_fp32) GrB_Info GB (_bld__plus_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -613,12 +785,16 @@ GrB_Info GB (_bld__plus_fp64) GrB_Info GB (_bld__plus_fc32) ( GxB_FC32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -627,12 +803,16 @@ GrB_Info GB (_bld__plus_fc32) GrB_Info GB (_bld__plus_fc64) ( GxB_FC64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -641,12 +821,16 @@ GrB_Info GB (_bld__plus_fc64) GrB_Info GB (_bld__times_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -655,12 +839,16 @@ GrB_Info GB (_bld__times_int8) GrB_Info GB (_bld__times_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -669,12 +857,16 @@ GrB_Info GB (_bld__times_int16) GrB_Info GB (_bld__times_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -683,12 +875,16 @@ GrB_Info GB (_bld__times_int32) GrB_Info GB (_bld__times_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -697,12 +893,16 @@ GrB_Info GB (_bld__times_int64) GrB_Info GB (_bld__times_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -711,12 +911,16 @@ GrB_Info GB (_bld__times_uint8) GrB_Info GB (_bld__times_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -725,12 +929,16 @@ GrB_Info GB (_bld__times_uint16) GrB_Info GB (_bld__times_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -739,12 +947,16 @@ GrB_Info GB (_bld__times_uint32) GrB_Info GB (_bld__times_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -753,12 +965,16 @@ GrB_Info GB (_bld__times_uint64) GrB_Info GB (_bld__times_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -767,12 +983,16 @@ GrB_Info GB (_bld__times_fp32) GrB_Info GB (_bld__times_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -781,12 +1001,16 @@ GrB_Info GB (_bld__times_fp64) GrB_Info GB (_bld__times_fc32) ( GxB_FC32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -795,12 +1019,16 @@ GrB_Info GB (_bld__times_fc32) GrB_Info GB (_bld__times_fc64) ( GxB_FC64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -809,12 +1037,16 @@ GrB_Info GB (_bld__times_fc64) GrB_Info GB (_bld__lor_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -823,12 +1055,16 @@ GrB_Info GB (_bld__lor_bool) GrB_Info GB (_bld__land_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -837,12 +1073,16 @@ GrB_Info GB (_bld__land_bool) GrB_Info GB (_bld__lxor_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -851,12 +1091,16 @@ GrB_Info GB (_bld__lxor_bool) GrB_Info GB (_bld__eq_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -865,12 +1109,16 @@ GrB_Info GB (_bld__eq_bool) GrB_Info GB (_bld__any_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -879,12 +1127,16 @@ GrB_Info GB (_bld__any_bool) GrB_Info GB (_bld__first_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -893,12 +1145,16 @@ GrB_Info GB (_bld__first_bool) GrB_Info GB (_bld__first_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -907,12 +1163,16 @@ GrB_Info GB (_bld__first_int8) GrB_Info GB (_bld__first_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -921,12 +1181,16 @@ GrB_Info GB (_bld__first_int16) GrB_Info GB (_bld__first_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -935,12 +1199,16 @@ GrB_Info GB (_bld__first_int32) GrB_Info GB (_bld__first_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -949,12 +1217,16 @@ GrB_Info GB (_bld__first_int64) GrB_Info GB (_bld__first_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -963,12 +1235,16 @@ GrB_Info GB (_bld__first_uint8) GrB_Info GB (_bld__first_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -977,12 +1253,16 @@ GrB_Info GB (_bld__first_uint16) GrB_Info GB (_bld__first_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -991,12 +1271,16 @@ GrB_Info GB (_bld__first_uint32) GrB_Info GB (_bld__first_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1005,12 +1289,16 @@ GrB_Info GB (_bld__first_uint64) GrB_Info GB (_bld__first_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1019,12 +1307,16 @@ GrB_Info GB (_bld__first_fp32) GrB_Info GB (_bld__first_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1033,12 +1325,16 @@ GrB_Info GB (_bld__first_fp64) GrB_Info GB (_bld__first_fc32) ( GxB_FC32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1047,12 +1343,16 @@ GrB_Info GB (_bld__first_fc32) GrB_Info GB (_bld__first_fc64) ( GxB_FC64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1061,12 +1361,16 @@ GrB_Info GB (_bld__first_fc64) GrB_Info GB (_bld__second_bool) ( bool *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const bool *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1075,12 +1379,16 @@ GrB_Info GB (_bld__second_bool) GrB_Info GB (_bld__second_int8) ( int8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1089,12 +1397,16 @@ GrB_Info GB (_bld__second_int8) GrB_Info GB (_bld__second_int16) ( int16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1103,12 +1415,16 @@ GrB_Info GB (_bld__second_int16) GrB_Info GB (_bld__second_int32) ( int32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1117,12 +1433,16 @@ GrB_Info GB (_bld__second_int32) GrB_Info GB (_bld__second_int64) ( int64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const int64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1131,12 +1451,16 @@ GrB_Info GB (_bld__second_int64) GrB_Info GB (_bld__second_uint8) ( uint8_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint8_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1145,12 +1469,16 @@ GrB_Info GB (_bld__second_uint8) GrB_Info GB (_bld__second_uint16) ( uint16_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint16_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1159,12 +1487,16 @@ GrB_Info GB (_bld__second_uint16) GrB_Info GB (_bld__second_uint32) ( uint32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1173,12 +1505,16 @@ GrB_Info GB (_bld__second_uint32) GrB_Info GB (_bld__second_uint64) ( uint64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const uint64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1187,12 +1523,16 @@ GrB_Info GB (_bld__second_uint64) GrB_Info GB (_bld__second_fp32) ( float *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const float *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1201,12 +1541,16 @@ GrB_Info GB (_bld__second_fp32) GrB_Info GB (_bld__second_fp64) ( double *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const double *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1215,12 +1559,16 @@ GrB_Info GB (_bld__second_fp64) GrB_Info GB (_bld__second_fc32) ( GxB_FC32_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC32_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1229,12 +1577,16 @@ GrB_Info GB (_bld__second_fc32) GrB_Info GB (_bld__second_fc64) ( GxB_FC64_t *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GxB_FC64_t *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads diff --git a/GraphBLAS/FactoryKernels/GB_bld__land_bool.c b/GraphBLAS/FactoryKernels/GB_bld__land_bool.c index 32b960f89e..7fc399378b 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__land_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = (Tx [k] && Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__land_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__lor_bool.c b/GraphBLAS/FactoryKernels/GB_bld__lor_bool.c index cc4f535dfe..01b2496caf 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__lor_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = (Tx [k] || Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__lor_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__lxor_bool.c b/GraphBLAS/FactoryKernels/GB_bld__lxor_bool.c index fe494bc456..166903ed5d 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__lxor_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = (Tx [k] != Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__lxor_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__max_fp32.c index 20688d68b5..a893893e35 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if ((Sx [i] > Tx [k]) || (Tx [k] != Tx [k])) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__max_fp64.c index 2a9f620fb1..527773a018 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if ((Sx [i] > Tx [k]) || (Tx [k] != Tx [k])) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_int16.c b/GraphBLAS/FactoryKernels/GB_bld__max_int16.c index 4222745dd6..e81820ac17 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_int32.c b/GraphBLAS/FactoryKernels/GB_bld__max_int32.c index 95c593848d..bc100fa269 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_int64.c b/GraphBLAS/FactoryKernels/GB_bld__max_int64.c index d630a7d8c5..90f8b39dc0 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_int8.c b/GraphBLAS/FactoryKernels/GB_bld__max_int8.c index bda0622de0..2f4dfccf8e 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__max_uint16.c index 46d7549f47..82e58156a1 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__max_uint32.c index 2cfe546211..0a95cbf4a6 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__max_uint64.c index 537fd1fa5c..063b185508 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__max_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__max_uint8.c index ace9c24282..f0a86ee6ed 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__max_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] > Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__max_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__min_fp32.c index 3cdebe22f5..366f63a043 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if ((Sx [i] < Tx [k]) || (Tx [k] != Tx [k])) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__min_fp64.c index 8b46721849..220d92e78e 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if ((Sx [i] < Tx [k]) || (Tx [k] != Tx [k])) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_int16.c b/GraphBLAS/FactoryKernels/GB_bld__min_int16.c index 443fbbc360..e01a891040 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_int32.c b/GraphBLAS/FactoryKernels/GB_bld__min_int32.c index 1f856870ee..7160c51fe0 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_int64.c b/GraphBLAS/FactoryKernels/GB_bld__min_int64.c index a39102337e..340d44d325 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_int8.c b/GraphBLAS/FactoryKernels/GB_bld__min_int8.c index 349c4f1125..d6fa88704f 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__min_uint16.c index 525d01d471..2d66028f05 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__min_uint32.c index fdc5a61b92..bae079570e 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__min_uint64.c index e72d593481..87de9ed7a0 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__min_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__min_uint8.c index 4e674fd8a8..1c1bbf3e36 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__min_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) if (Sx [i] < Tx [k]) { Tx [k] = Sx [i] ; } + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__min_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_fc32.c b/GraphBLAS/FactoryKernels/GB_bld__plus_fc32.c index b06d3db9c8..9383b5906e 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_fc32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = GB_FC32_add (Tx [k], Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_fc32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_fc64.c b/GraphBLAS/FactoryKernels/GB_bld__plus_fc64.c index 984fced4ee..2fdfb25073 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_fc64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = GB_FC64_add (Tx [k], Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_fc64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__plus_fp32.c index ddd9f3837a..92e56c0bbe 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__plus_fp64.c index b78d80cdca..f444d4a52d 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_int16.c b/GraphBLAS/FactoryKernels/GB_bld__plus_int16.c index 78f16cf864..360f9400ba 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_int32.c b/GraphBLAS/FactoryKernels/GB_bld__plus_int32.c index fdde5b55ac..30ca155645 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_int64.c b/GraphBLAS/FactoryKernels/GB_bld__plus_int64.c index 017e9f55ce..c8a3275f1a 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_int8.c b/GraphBLAS/FactoryKernels/GB_bld__plus_int8.c index 8cb361fdd2..9a9a1f5930 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__plus_uint16.c index cf1f6b43b3..70d4562b89 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__plus_uint32.c index 0ab078161d..1d986c7121 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__plus_uint64.c index 1d2490bc6c..6645408837 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__plus_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__plus_uint8.c index 95b8a28010..44c52ec295 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__plus_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] += Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__plus_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_bool.c b/GraphBLAS/FactoryKernels/GB_bld__second_bool.c index f557e75f56..8088184082 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_bool.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_bool) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_fc32.c b/GraphBLAS/FactoryKernels/GB_bld__second_fc32.c index 9e6815d912..501f5e6be9 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_fc32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_fc32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_fc64.c b/GraphBLAS/FactoryKernels/GB_bld__second_fc64.c index 30db69e81e..2ec7d9ac1b 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_fc64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_fc64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__second_fp32.c index 762750719f..9d28ece04e 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__second_fp64.c index 2cade87535..7a74423539 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_int16.c b/GraphBLAS/FactoryKernels/GB_bld__second_int16.c index ac1fb2495e..7d9a2de4b4 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_int32.c b/GraphBLAS/FactoryKernels/GB_bld__second_int32.c index 0c2804cb24..3e8483aa59 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_int64.c b/GraphBLAS/FactoryKernels/GB_bld__second_int64.c index e3580e63b3..e2c481d014 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_int8.c b/GraphBLAS/FactoryKernels/GB_bld__second_int8.c index 8153efde08..1b9303d1c4 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__second_uint16.c index 51ee8b4f87..df5dc2bd45 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__second_uint32.c index 64acd1b0a8..312dcf2d92 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__second_uint64.c index 415453b77a..14e8a3e9bd 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__second_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__second_uint8.c index f8901b4deb..c0662cfd3f 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__second_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__second_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_fc32.c b/GraphBLAS/FactoryKernels/GB_bld__times_fc32.c index 3f0c82474f..48b4dcfda5 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_fc32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = GB_FC32_mul (Tx [k], Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_fc32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_fc64.c b/GraphBLAS/FactoryKernels/GB_bld__times_fc64.c index 29cfc320f1..c8835221fe 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_fc64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] = GB_FC64_mul (Tx [k], Sx [i]) + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_fc64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_fp32.c b/GraphBLAS/FactoryKernels/GB_bld__times_fp32.c index daf2ba813a..cbceee3513 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_fp32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_fp32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_fp64.c b/GraphBLAS/FactoryKernels/GB_bld__times_fp64.c index 5b713fbde4..a85611ab3b 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_fp64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_fp64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_int16.c b/GraphBLAS/FactoryKernels/GB_bld__times_int16.c index 6c60073c06..8385c6d9a2 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_int16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_int16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_int32.c b/GraphBLAS/FactoryKernels/GB_bld__times_int32.c index fe07eb280c..a4c030622c 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_int32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_int32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_int64.c b/GraphBLAS/FactoryKernels/GB_bld__times_int64.c index e72810d46c..d3920c3a1c 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_int64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_int64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_int8.c b/GraphBLAS/FactoryKernels/GB_bld__times_int8.c index ddb74574ab..6768ce8b9b 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_int8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_int8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_uint16.c b/GraphBLAS/FactoryKernels/GB_bld__times_uint16.c index af3cbdbcd8..b51b3e7191 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_uint16.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_uint16) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_uint32.c b/GraphBLAS/FactoryKernels/GB_bld__times_uint32.c index 74a1f65afa..313f387d20 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_uint32.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_uint32) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_uint64.c b/GraphBLAS/FactoryKernels/GB_bld__times_uint64.c index 8c3166d76c..268e9995a1 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_uint64.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_uint64) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_bld__times_uint8.c b/GraphBLAS/FactoryKernels/GB_bld__times_uint8.c index c30c28ec06..e36bb18f1f 100644 --- a/GraphBLAS/FactoryKernels/GB_bld__times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_bld__times_uint8.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,6 +20,7 @@ // dup operator: Tx [k] += Sx [i], no typecast here #define GB_BLD_DUP(Tx,k,Sx,i) Tx [k] *= Sx [i] + #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -47,12 +48,16 @@ GrB_Info GB (_bld__times_uint8) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -61,10 +66,16 @@ GrB_Info GB (_bld__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__atan2_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__atan2_fp32.c index 016b068f7a..94c935856f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__atan2_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__atan2_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ATAN2) || defined(GxB_NO_FP32) || defined(GxB_NO_ATAN2_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__atan2_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__atan2_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__atan2_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__atan2_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__atan2_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__atan2_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__atan2_fp64.c index e2be7fe170..be1acd9149 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__atan2_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__atan2_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ATAN2) || defined(GxB_NO_FP64) || defined(GxB_NO_ATAN2_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__atan2_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__atan2_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__atan2_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__atan2_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__atan2_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_int16.c b/GraphBLAS/FactoryKernels/GB_ew__band_int16.c index fa41a30de4..36772c9030 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_INT16) || defined(GxB_NO_BAND_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__band_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__band_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__band_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__band_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__band_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__band_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__band_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_int32.c b/GraphBLAS/FactoryKernels/GB_ew__band_int32.c index 6fafbec066..a40ea85eb4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_INT32) || defined(GxB_NO_BAND_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__band_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__band_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__band_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__band_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__band_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__band_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__band_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_int64.c b/GraphBLAS/FactoryKernels/GB_ew__band_int64.c index 9209488c25..7cb9d931d9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_INT64) || defined(GxB_NO_BAND_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__band_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__band_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__band_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__band_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__band_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__band_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__band_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_int8.c b/GraphBLAS/FactoryKernels/GB_ew__band_int8.c index 215e38305a..31cdfaa18d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_INT8) || defined(GxB_NO_BAND_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__band_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__band_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__band_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__band_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__band_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__band_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__band_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__band_uint16.c index fe3f922f7b..e12ba793e7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_UINT16) || defined(GxB_NO_BAND_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__band_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__band_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__band_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__band_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__band_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__band_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__band_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__band_uint32.c index 322ace7224..d32827646c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_UINT32) || defined(GxB_NO_BAND_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__band_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__band_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__band_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__band_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__band_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__band_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__band_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__band_uint64.c index 0d3aa83a16..82f7c8edc5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_UINT64) || defined(GxB_NO_BAND_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__band_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__band_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__band_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__band_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__band_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__band_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__band_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__band_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__band_uint8.c index d7d6c248de..e04b700f63 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__band_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__band_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BAND) || defined(GxB_NO_UINT8) || defined(GxB_NO_BAND_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__band_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__band_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__band_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__band_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__band_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__band_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__band_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_int16.c index cc9021a8d7..caacb0ca6d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_INT16) || defined(GxB_NO_BCLR_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_int32.c index ff667d63a4..16e42c4739 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_INT32) || defined(GxB_NO_BCLR_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_int64.c index c5cb6a3b8c..20f91c4fc8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_INT64) || defined(GxB_NO_BCLR_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_int8.c index 29c401aab4..21504e3028 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_INT8) || defined(GxB_NO_BCLR_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint16.c index 762bb5b85e..67ae7d7981 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_UINT16) || defined(GxB_NO_BCLR_UINT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint32.c index 5a31738b83..bca365c34d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_UINT32) || defined(GxB_NO_BCLR_UINT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint64.c index a08ab3dcca..62d6c758ed 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_UINT64) || defined(GxB_NO_BCLR_UINT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint8.c index 5ac145f2c9..5e12301bc6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bclr_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bclr_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BCLR) || defined(GxB_NO_UINT8) || defined(GxB_NO_BCLR_UINT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bclr_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bclr_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bclr_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bclr_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bget_int16.c index 7ea2a8f0c9..17148174d1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_INT16) || defined(GxB_NO_BGET_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bget_int32.c index ac8b42a67a..f15c1104ca 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_INT32) || defined(GxB_NO_BGET_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bget_int64.c index 0aa61c0409..04926ea0c4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_INT64) || defined(GxB_NO_BGET_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bget_int8.c index 06283a3e64..7ba3d1be9e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_INT8) || defined(GxB_NO_BGET_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bget_uint16.c index 57866b469b..83cc5a1808 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_UINT16) || defined(GxB_NO_BGET_UINT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bget_uint32.c index c33c86d6e8..0fb81e2cce 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_UINT32) || defined(GxB_NO_BGET_UINT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bget_uint64.c index 5a66c77381..6082063bdc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_UINT64) || defined(GxB_NO_BGET_UINT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bget_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bget_uint8.c index d2beec54ff..26a8b4e898 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bget_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bget_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BGET) || defined(GxB_NO_UINT8) || defined(GxB_NO_BGET_UINT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bget_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bget_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bget_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bget_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bget_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bget_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bor_int16.c index d7cb501759..940ddb9246 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_INT16) || defined(GxB_NO_BOR_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bor_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bor_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bor_int32.c index 07d8d765f7..15deaf7feb 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_INT32) || defined(GxB_NO_BOR_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bor_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bor_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bor_int64.c index bc777d8917..6d8fcf4690 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_INT64) || defined(GxB_NO_BOR_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bor_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bor_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bor_int8.c index e7b6bb251e..ee21e84dcf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_INT8) || defined(GxB_NO_BOR_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bor_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bor_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bor_uint16.c index 7559d9849f..78648b16ff 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_UINT16) || defined(GxB_NO_BOR_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bor_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bor_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bor_uint32.c index a243e7e6fd..a049c1895a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_UINT32) || defined(GxB_NO_BOR_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bor_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bor_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bor_uint64.c index a75a95452d..9426dc1539 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_UINT64) || defined(GxB_NO_BOR_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bor_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bor_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bor_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bor_uint8.c index 0b9cbc8d66..78737db105 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bor_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BOR) || defined(GxB_NO_UINT8) || defined(GxB_NO_BOR_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bor_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bor_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bset_int16.c index 6783e18213..e82379d60c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_INT16) || defined(GxB_NO_BSET_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bset_int32.c index 77390aa2ee..60f5e8cb29 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_INT32) || defined(GxB_NO_BSET_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bset_int64.c index 7635bc9c83..ba9c8657f2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_INT64) || defined(GxB_NO_BSET_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bset_int8.c index eb90f5aabf..d498c9d8f3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_INT8) || defined(GxB_NO_BSET_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bset_uint16.c index 522e6426ec..d4d26d1c9c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_UINT16) || defined(GxB_NO_BSET_UINT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bset_uint32.c index 140cbb50de..a28b46c921 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_UINT32) || defined(GxB_NO_BSET_UINT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bset_uint64.c index 0f85fa665f..b0fe51cd79 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_UINT64) || defined(GxB_NO_BSET_UINT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bset_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bset_uint8.c index 88719b8c57..1d21c7ec80 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bset_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bset_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSET) || defined(GxB_NO_UINT8) || defined(GxB_NO_BSET_UINT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bset_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bset_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bset_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bset_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bset_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bset_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_int16.c index affbca1d65..9872be6a94 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE int16_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_INT16) || defined(GxB_NO_BSHIFT_INT16)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_int32.c index fd496e5eb2..2af59fb0e2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE int32_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_INT32) || defined(GxB_NO_BSHIFT_INT32)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_int64.c index 22e5831b9a..d3df0b2ec2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE int64_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_INT64) || defined(GxB_NO_BSHIFT_INT64)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_int8.c index accc437cb4..c430be2549 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_INT8) || defined(GxB_NO_BSHIFT_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bshift_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__bshift_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__bshift_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__bshift_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__bshift_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__bshift_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint16.c index d3cf942b34..82d46b28c4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE uint16_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_UINT16) || defined(GxB_NO_BSHIFT_UINT16)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint32.c index 79a901eab6..1093eb7005 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE uint32_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_UINT32) || defined(GxB_NO_BSHIFT_UINT32)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint64.c index 16b045ab72..2747e47a40 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE uint64_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_UINT64) || defined(GxB_NO_BSHIFT_UINT64)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint8.c index 693b612662..4a58bfabfd 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bshift_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bshift_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,7 @@ #define GB_C_TYPE uint8_t #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BSHIFT) || defined(GxB_NO_UINT8) || defined(GxB_NO_BSHIFT_UINT8)) @@ -182,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +199,7 @@ GrB_Info GB (_AemultB_02__bshift_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_03__bshift_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -250,7 +250,7 @@ GrB_Info GB (_AemultB_04__bshift_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -352,7 +352,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -363,6 +363,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -387,7 +388,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -397,10 +398,13 @@ GrB_Info GB (_bind2nd_tran__bshift_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int16.c index 2f1a044250..43c49d0c19 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_INT16) || defined(GxB_NO_BXNOR_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxnor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxnor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxnor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int32.c index c7931d8987..c130cef732 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_INT32) || defined(GxB_NO_BXNOR_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxnor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxnor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxnor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int64.c index b6348df1ce..b2cd87a3c8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_INT64) || defined(GxB_NO_BXNOR_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxnor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxnor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxnor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int8.c index 4705e7559f..dfa4d1021c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_INT8) || defined(GxB_NO_BXNOR_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxnor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxnor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxnor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint16.c index 37dd39930d..65a36b6f88 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_UINT16) || defined(GxB_NO_BXNOR_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint32.c index a8923d3214..b686a63b1f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_UINT32) || defined(GxB_NO_BXNOR_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint64.c index a39a713c7d..50711f7066 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_UINT64) || defined(GxB_NO_BXNOR_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint8.c index ae6bbad6a7..00c679032a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxnor_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXNOR) || defined(GxB_NO_UINT8) || defined(GxB_NO_BXNOR_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_int16.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_int16.c index f9bcc7fd22..0e99b9ba07 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_INT16) || defined(GxB_NO_BXOR_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxor_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxor_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_int32.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_int32.c index cff8959ae5..0beb661c4b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_INT32) || defined(GxB_NO_BXOR_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxor_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxor_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_int64.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_int64.c index 88268e017d..8dd777ed07 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_INT64) || defined(GxB_NO_BXOR_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxor_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxor_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_int8.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_int8.c index 9d10c238e0..7a4a3a32a5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_INT8) || defined(GxB_NO_BXOR_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__bxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__bxor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__bxor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__bxor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__bxor_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__bxor_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint16.c index f0ffa7a57e..b4cb7b5e18 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_UINT16) || defined(GxB_NO_BXOR_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxor_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint32.c index 0283fc8773..e1189be6ff 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_UINT32) || defined(GxB_NO_BXOR_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxor_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint64.c index 9c05d30b7a..eb619293f9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_UINT64) || defined(GxB_NO_BXOR_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxor_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint8.c index 4c3ddb3fed..fbb5697b82 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__bxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__bxor_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_BXOR) || defined(GxB_NO_UINT8) || defined(GxB_NO_BXOR_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__bxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__bxor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__bxor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__bxor_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp32.c index 7ab9714046..35901fa253 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = GJ_CMPLX32 (Bx [(B_iso) ? 0 : (pB)], 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_CMPLX) || defined(GxB_NO_FP32) || defined(GxB_NO_CMPLX_FP32)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -227,7 +227,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -252,7 +252,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -354,7 +354,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -365,6 +365,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -389,7 +390,7 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -399,10 +400,13 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp64.c index 350ff178c4..369a4b01f0 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__cmplx_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = GJ_CMPLX64 (Bx [(B_iso) ? 0 : (pB)], 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_CMPLX) || defined(GxB_NO_FP64) || defined(GxB_NO_CMPLX_FP64)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -227,7 +227,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -252,7 +252,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -354,7 +354,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -365,6 +365,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -389,7 +390,7 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -399,10 +400,13 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__copysign_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__copysign_fp32.c index 42371883a0..76ab9282e7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__copysign_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__copysign_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_COPYSIGN) || defined(GxB_NO_FP32) || defined(GxB_NO_COPYSIGN_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__copysign_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__copysign_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__copysign_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__copysign_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__copysign_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__copysign_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__copysign_fp64.c index 1aa9c1cf73..56e01c4186 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__copysign_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__copysign_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_COPYSIGN) || defined(GxB_NO_FP64) || defined(GxB_NO_COPYSIGN_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__copysign_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__copysign_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__copysign_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__copysign_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__copysign_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__div_fc32.c index 1be74c6cd6..eb099f51d3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_FC32) || defined(GxB_NO_DIV_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__div_fc64.c index 7f11bc1431..f097cdee7f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_FC64) || defined(GxB_NO_DIV_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__div_fp32.c index 1a2de5c9b6..2542582152 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_FP32) || defined(GxB_NO_DIV_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__div_fp64.c index 9658b579df..b87d3854e6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_FP64) || defined(GxB_NO_DIV_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_int16.c b/GraphBLAS/FactoryKernels/GB_ew__div_int16.c index c39f95e28e..0d1b22ef0b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_INT16) || defined(GxB_NO_DIV_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_int32.c b/GraphBLAS/FactoryKernels/GB_ew__div_int32.c index 17e0819c32..41a6e3da8f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_INT32) || defined(GxB_NO_DIV_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_int64.c b/GraphBLAS/FactoryKernels/GB_ew__div_int64.c index 168df00cba..4e9fbd545a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_INT64) || defined(GxB_NO_DIV_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_int8.c b/GraphBLAS/FactoryKernels/GB_ew__div_int8.c index e6167f4a14..8476717e4c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_INT8) || defined(GxB_NO_DIV_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__div_uint16.c index 5d18d6eea0..64cdcb7f77 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_UINT16) || defined(GxB_NO_DIV_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__div_uint32.c index 3c0ad8ad8c..994845e73f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_UINT32) || defined(GxB_NO_DIV_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__div_uint64.c index ef2684ce65..05b7fcad20 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_UINT64) || defined(GxB_NO_DIV_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__div_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__div_uint8.c index a68e806fab..9926f332e4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__div_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__div_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_DIV) || defined(GxB_NO_UINT8) || defined(GxB_NO_DIV_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__div_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__div_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__div_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__div_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__div_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__div_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__div_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_bool.c b/GraphBLAS/FactoryKernels/GB_ew__eq_bool.c index 1a5bf40654..885f1bb5a8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_BOOL) || defined(GxB_NO_EQ_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__eq_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__eq_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__eq_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__eq_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__eq_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__eq_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__eq_fc32.c index 77754fda21..2222529861 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = (GB_crealf (Bx [(B_iso) ? 0 : (pB)]) != 0) || (GB_cimagf (Bx [(B_iso) ? 0 : (pB)]) != 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_FC32) || defined(GxB_NO_EQ_FC32)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__eq_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__eq_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -226,7 +226,7 @@ GrB_Info GB (_AemultB_04__eq_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -328,7 +328,7 @@ GrB_Info GB (_bind1st_tran__eq_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -339,6 +339,7 @@ GrB_Info GB (_bind1st_tran__eq_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -363,7 +364,7 @@ GrB_Info GB (_bind2nd_tran__eq_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -373,10 +374,13 @@ GrB_Info GB (_bind2nd_tran__eq_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__eq_fc64.c index cd3af6187b..a526379227 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = (GB_creal (Bx [(B_iso) ? 0 : (pB)]) != 0) || (GB_cimag (Bx [(B_iso) ? 0 : (pB)]) != 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_FC64) || defined(GxB_NO_EQ_FC64)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__eq_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__eq_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -226,7 +226,7 @@ GrB_Info GB (_AemultB_04__eq_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -328,7 +328,7 @@ GrB_Info GB (_bind1st_tran__eq_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -339,6 +339,7 @@ GrB_Info GB (_bind1st_tran__eq_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -363,7 +364,7 @@ GrB_Info GB (_bind2nd_tran__eq_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -373,10 +374,13 @@ GrB_Info GB (_bind2nd_tran__eq_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__eq_fp32.c index 2cc4e60fce..eca0155e03 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_FP32) || defined(GxB_NO_EQ_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__eq_fp64.c index 8e4e1e4403..e12749d992 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_FP64) || defined(GxB_NO_EQ_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_int16.c b/GraphBLAS/FactoryKernels/GB_ew__eq_int16.c index d3ab5f7e8a..3b5e387ebf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_INT16) || defined(GxB_NO_EQ_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_int32.c b/GraphBLAS/FactoryKernels/GB_ew__eq_int32.c index 42f3574943..102aa1521f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_INT32) || defined(GxB_NO_EQ_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_int64.c b/GraphBLAS/FactoryKernels/GB_ew__eq_int64.c index 412602c972..d6309f7530 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_INT64) || defined(GxB_NO_EQ_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_int8.c b/GraphBLAS/FactoryKernels/GB_ew__eq_int8.c index 755490272c..c74a1b712a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_INT8) || defined(GxB_NO_EQ_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__eq_uint16.c index 8476f39260..fb2034181c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_UINT16) || defined(GxB_NO_EQ_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__eq_uint32.c index 054e52dc31..6133a4e2fe 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_UINT32) || defined(GxB_NO_EQ_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__eq_uint64.c index a3f287730e..3cf5d7135a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_UINT64) || defined(GxB_NO_EQ_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__eq_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__eq_uint8.c index ac39fd9d30..8ca504f6f2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__eq_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__eq_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_UINT8) || defined(GxB_NO_EQ_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__eq_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__eq_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__eq_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__eq_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__eq_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_bool.c b/GraphBLAS/FactoryKernels/GB_ew__first_bool.c index 666d0616a0..9a8ef5fd27 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_BOOL) || defined(GxB_NO_FIRST_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__first_fc32.c index 347fb2648b..a2d8928393 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FC32) || defined(GxB_NO_FIRST_FC32) || GB_COMPILER_MSC_2019_OR_NEWER) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__first_fc64.c index d37464f8ee..6f96edee2b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FC64) || defined(GxB_NO_FIRST_FC64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__first_fp32.c index 63c6177b28..21f949eff4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FP32) || defined(GxB_NO_FIRST_FP32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__first_fp64.c index f1fbb919ed..0313da933c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FP64) || defined(GxB_NO_FIRST_FP64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_int16.c b/GraphBLAS/FactoryKernels/GB_ew__first_int16.c index 7405ea59f3..c18b4872b6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT16) || defined(GxB_NO_FIRST_INT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_int32.c b/GraphBLAS/FactoryKernels/GB_ew__first_int32.c index 488b94bde8..b5a04ad69a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT32) || defined(GxB_NO_FIRST_INT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_int64.c b/GraphBLAS/FactoryKernels/GB_ew__first_int64.c index 8810c09e96..f98c2c2b25 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT64) || defined(GxB_NO_FIRST_INT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_int8.c b/GraphBLAS/FactoryKernels/GB_ew__first_int8.c index 6e5961d92e..3260c24e50 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT8) || defined(GxB_NO_FIRST_INT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__first_uint16.c index ae02fa179d..b6774ca950 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT16) || defined(GxB_NO_FIRST_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__first_uint32.c index ff62927211..a2db32a154 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT32) || defined(GxB_NO_FIRST_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__first_uint64.c index 744cc346b5..4db7aa5c48 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT64) || defined(GxB_NO_FIRST_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__first_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__first_uint8.c index c5caef2658..5618e537f2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__first_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__first_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT8) || defined(GxB_NO_FIRST_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__first_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__first_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__first_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -330,5 +331,7 @@ GrB_Info GB (_AemultB_bitmap__first_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__fmod_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__fmod_fp32.c index d42514dd79..56b26e31d3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__fmod_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__fmod_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FMOD) || defined(GxB_NO_FP32) || defined(GxB_NO_FMOD_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__fmod_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__fmod_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__fmod_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__fmod_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__fmod_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__fmod_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__fmod_fp64.c index fcd2971bc0..43de6b4706 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__fmod_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__fmod_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FMOD) || defined(GxB_NO_FP64) || defined(GxB_NO_FMOD_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__fmod_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__fmod_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__fmod_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__fmod_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__fmod_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_bool.c b/GraphBLAS/FactoryKernels/GB_ew__ge_bool.c index f61f7c2b7c..37f059a604 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_BOOL) || defined(GxB_NO_GE_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__ge_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__ge_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__ge_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -392,7 +393,7 @@ GrB_Info GB (_bind1st_tran__ge_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -403,6 +404,7 @@ GrB_Info GB (_bind1st_tran__ge_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -427,7 +429,7 @@ GrB_Info GB (_bind2nd_tran__ge_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -437,10 +439,13 @@ GrB_Info GB (_bind2nd_tran__ge_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__ge_fp32.c index bfc7ae775e..5371458108 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_FP32) || defined(GxB_NO_GE_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__ge_fp64.c index e84cf95267..1134c8c575 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_FP64) || defined(GxB_NO_GE_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_int16.c b/GraphBLAS/FactoryKernels/GB_ew__ge_int16.c index 3209d20172..028b5c1b66 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_INT16) || defined(GxB_NO_GE_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_int32.c b/GraphBLAS/FactoryKernels/GB_ew__ge_int32.c index 4cc7a8b3ce..5ca754abc5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_INT32) || defined(GxB_NO_GE_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_int64.c b/GraphBLAS/FactoryKernels/GB_ew__ge_int64.c index ab54f6873c..05d8d69fba 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_INT64) || defined(GxB_NO_GE_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_int8.c b/GraphBLAS/FactoryKernels/GB_ew__ge_int8.c index 305f251e28..90e09f012b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_INT8) || defined(GxB_NO_GE_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__ge_uint16.c index fd8cfeeb1f..7de47cd676 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_UINT16) || defined(GxB_NO_GE_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__ge_uint32.c index 064d710837..2a92d19ce8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_UINT32) || defined(GxB_NO_GE_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__ge_uint64.c index ce83e7f128..43dbd65ce6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_UINT64) || defined(GxB_NO_GE_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ge_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__ge_uint8.c index 43d2c827ff..8316a45fc6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ge_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ge_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GE) || defined(GxB_NO_UINT8) || defined(GxB_NO_GE_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ge_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__ge_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__ge_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__ge_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__ge_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__ge_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_bool.c b/GraphBLAS/FactoryKernels/GB_ew__gt_bool.c index c6c19fc110..f806b5c25d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_BOOL) || defined(GxB_NO_GT_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__gt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__gt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__gt_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -392,7 +393,7 @@ GrB_Info GB (_bind1st_tran__gt_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -403,6 +404,7 @@ GrB_Info GB (_bind1st_tran__gt_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -427,7 +429,7 @@ GrB_Info GB (_bind2nd_tran__gt_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -437,10 +439,13 @@ GrB_Info GB (_bind2nd_tran__gt_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__gt_fp32.c index fb1d7d7a9c..f7121741f4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_FP32) || defined(GxB_NO_GT_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__gt_fp64.c index aecc41bd03..8e67808ccd 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_FP64) || defined(GxB_NO_GT_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_int16.c b/GraphBLAS/FactoryKernels/GB_ew__gt_int16.c index 214cd288e0..7348296055 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_INT16) || defined(GxB_NO_GT_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_int32.c b/GraphBLAS/FactoryKernels/GB_ew__gt_int32.c index c8eb114bd7..49d8d6f7a3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_INT32) || defined(GxB_NO_GT_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_int64.c b/GraphBLAS/FactoryKernels/GB_ew__gt_int64.c index dc9f69b401..54d3868b02 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_INT64) || defined(GxB_NO_GT_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_int8.c b/GraphBLAS/FactoryKernels/GB_ew__gt_int8.c index 6b6f6b19a7..0c758da19c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_INT8) || defined(GxB_NO_GT_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__gt_uint16.c index 3d20ff9859..a4db9c8e85 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_UINT16) || defined(GxB_NO_GT_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__gt_uint32.c index cfcad54165..c3e69d349b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_UINT32) || defined(GxB_NO_GT_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__gt_uint64.c index 6bfc1fda34..0c3b7016ae 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_UINT64) || defined(GxB_NO_GT_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__gt_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__gt_uint8.c index 7e598be14f..6bf3068765 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__gt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__gt_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_GT) || defined(GxB_NO_UINT8) || defined(GxB_NO_GT_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__gt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__gt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__gt_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__gt_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__gt_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__gt_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__hypot_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__hypot_fp32.c index 835c368eb4..61d538aef9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__hypot_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__hypot_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_HYPOT) || defined(GxB_NO_FP32) || defined(GxB_NO_HYPOT_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__hypot_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__hypot_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__hypot_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__hypot_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__hypot_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__hypot_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__hypot_fp64.c index e4ba3fd085..ea67cfe293 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__hypot_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__hypot_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_HYPOT) || defined(GxB_NO_FP64) || defined(GxB_NO_HYPOT_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__hypot_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__hypot_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_04__hypot_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -324,7 +325,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -335,6 +336,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -359,7 +361,7 @@ GrB_Info GB (_bind2nd_tran__hypot_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -369,10 +371,13 @@ GrB_Info GB (_bind2nd_tran__hypot_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__include.h b/GraphBLAS/FactoryKernels/GB_ew__include.h index 459559edbc..34c3c01191 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__include.h +++ b/GraphBLAS/FactoryKernels/GB_ew__include.h @@ -2,7 +2,7 @@ // GB_ew__include.h: definitions for GB_ew__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_ew.h @@ -115,7 +115,7 @@ GrB_Info GB (_AemultB_02__first_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -129,7 +129,7 @@ GrB_Info GB (_AemultB_03__first_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -142,7 +142,7 @@ GrB_Info GB (_AemultB_04__first_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -269,7 +269,7 @@ GrB_Info GB (_AemultB_02__first_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +283,7 @@ GrB_Info GB (_AemultB_03__first_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -296,7 +296,7 @@ GrB_Info GB (_AemultB_04__first_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -423,7 +423,7 @@ GrB_Info GB (_AemultB_02__first_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -437,7 +437,7 @@ GrB_Info GB (_AemultB_03__first_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -450,7 +450,7 @@ GrB_Info GB (_AemultB_04__first_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -577,7 +577,7 @@ GrB_Info GB (_AemultB_02__first_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -591,7 +591,7 @@ GrB_Info GB (_AemultB_03__first_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -604,7 +604,7 @@ GrB_Info GB (_AemultB_04__first_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -731,7 +731,7 @@ GrB_Info GB (_AemultB_02__first_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -745,7 +745,7 @@ GrB_Info GB (_AemultB_03__first_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -758,7 +758,7 @@ GrB_Info GB (_AemultB_04__first_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -885,7 +885,7 @@ GrB_Info GB (_AemultB_02__first_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -899,7 +899,7 @@ GrB_Info GB (_AemultB_03__first_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -912,7 +912,7 @@ GrB_Info GB (_AemultB_04__first_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1039,7 +1039,7 @@ GrB_Info GB (_AemultB_02__first_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1053,7 +1053,7 @@ GrB_Info GB (_AemultB_03__first_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1066,7 +1066,7 @@ GrB_Info GB (_AemultB_04__first_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1193,7 +1193,7 @@ GrB_Info GB (_AemultB_02__first_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1207,7 +1207,7 @@ GrB_Info GB (_AemultB_03__first_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1220,7 +1220,7 @@ GrB_Info GB (_AemultB_04__first_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1347,7 +1347,7 @@ GrB_Info GB (_AemultB_02__first_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1361,7 +1361,7 @@ GrB_Info GB (_AemultB_03__first_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1374,7 +1374,7 @@ GrB_Info GB (_AemultB_04__first_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1501,7 +1501,7 @@ GrB_Info GB (_AemultB_02__first_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1515,7 +1515,7 @@ GrB_Info GB (_AemultB_03__first_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1528,7 +1528,7 @@ GrB_Info GB (_AemultB_04__first_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1655,7 +1655,7 @@ GrB_Info GB (_AemultB_02__first_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1669,7 +1669,7 @@ GrB_Info GB (_AemultB_03__first_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1682,7 +1682,7 @@ GrB_Info GB (_AemultB_04__first_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1809,7 +1809,7 @@ GrB_Info GB (_AemultB_02__first_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1823,7 +1823,7 @@ GrB_Info GB (_AemultB_03__first_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1836,7 +1836,7 @@ GrB_Info GB (_AemultB_04__first_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -1963,7 +1963,7 @@ GrB_Info GB (_AemultB_02__first_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1977,7 +1977,7 @@ GrB_Info GB (_AemultB_03__first_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -1990,7 +1990,7 @@ GrB_Info GB (_AemultB_04__first_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2117,7 +2117,7 @@ GrB_Info GB (_AemultB_02__second_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2131,7 +2131,7 @@ GrB_Info GB (_AemultB_03__second_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2144,7 +2144,7 @@ GrB_Info GB (_AemultB_04__second_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2271,7 +2271,7 @@ GrB_Info GB (_AemultB_02__second_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2285,7 +2285,7 @@ GrB_Info GB (_AemultB_03__second_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2298,7 +2298,7 @@ GrB_Info GB (_AemultB_04__second_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2425,7 +2425,7 @@ GrB_Info GB (_AemultB_02__second_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2439,7 +2439,7 @@ GrB_Info GB (_AemultB_03__second_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2452,7 +2452,7 @@ GrB_Info GB (_AemultB_04__second_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2579,7 +2579,7 @@ GrB_Info GB (_AemultB_02__second_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2593,7 +2593,7 @@ GrB_Info GB (_AemultB_03__second_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2606,7 +2606,7 @@ GrB_Info GB (_AemultB_04__second_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2733,7 +2733,7 @@ GrB_Info GB (_AemultB_02__second_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2747,7 +2747,7 @@ GrB_Info GB (_AemultB_03__second_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2760,7 +2760,7 @@ GrB_Info GB (_AemultB_04__second_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -2887,7 +2887,7 @@ GrB_Info GB (_AemultB_02__second_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -2901,7 +2901,7 @@ GrB_Info GB (_AemultB_03__second_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -2914,7 +2914,7 @@ GrB_Info GB (_AemultB_04__second_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3041,7 +3041,7 @@ GrB_Info GB (_AemultB_02__second_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3055,7 +3055,7 @@ GrB_Info GB (_AemultB_03__second_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3068,7 +3068,7 @@ GrB_Info GB (_AemultB_04__second_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3195,7 +3195,7 @@ GrB_Info GB (_AemultB_02__second_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3209,7 +3209,7 @@ GrB_Info GB (_AemultB_03__second_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3222,7 +3222,7 @@ GrB_Info GB (_AemultB_04__second_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3349,7 +3349,7 @@ GrB_Info GB (_AemultB_02__second_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3363,7 +3363,7 @@ GrB_Info GB (_AemultB_03__second_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3376,7 +3376,7 @@ GrB_Info GB (_AemultB_04__second_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3503,7 +3503,7 @@ GrB_Info GB (_AemultB_02__second_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3517,7 +3517,7 @@ GrB_Info GB (_AemultB_03__second_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3530,7 +3530,7 @@ GrB_Info GB (_AemultB_04__second_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3657,7 +3657,7 @@ GrB_Info GB (_AemultB_02__second_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3671,7 +3671,7 @@ GrB_Info GB (_AemultB_03__second_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3684,7 +3684,7 @@ GrB_Info GB (_AemultB_04__second_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3811,7 +3811,7 @@ GrB_Info GB (_AemultB_02__second_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3825,7 +3825,7 @@ GrB_Info GB (_AemultB_03__second_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3838,7 +3838,7 @@ GrB_Info GB (_AemultB_04__second_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -3965,7 +3965,7 @@ GrB_Info GB (_AemultB_02__second_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -3979,7 +3979,7 @@ GrB_Info GB (_AemultB_03__second_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -3992,7 +3992,7 @@ GrB_Info GB (_AemultB_04__second_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -4595,7 +4595,7 @@ GrB_Info GB (_AemultB_02__min_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -4608,7 +4608,7 @@ GrB_Info GB (_AemultB_04__min_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -4643,7 +4643,7 @@ GrB_Info GB (_bind1st_tran__min_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4664,7 +4664,7 @@ GrB_Info GB (_bind2nd_tran__min_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4785,7 +4785,7 @@ GrB_Info GB (_AemultB_02__min_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -4798,7 +4798,7 @@ GrB_Info GB (_AemultB_04__min_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -4833,7 +4833,7 @@ GrB_Info GB (_bind1st_tran__min_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4854,7 +4854,7 @@ GrB_Info GB (_bind2nd_tran__min_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4975,7 +4975,7 @@ GrB_Info GB (_AemultB_02__min_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -4988,7 +4988,7 @@ GrB_Info GB (_AemultB_04__min_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5023,7 +5023,7 @@ GrB_Info GB (_bind1st_tran__min_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5044,7 +5044,7 @@ GrB_Info GB (_bind2nd_tran__min_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5165,7 +5165,7 @@ GrB_Info GB (_AemultB_02__min_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -5178,7 +5178,7 @@ GrB_Info GB (_AemultB_04__min_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5213,7 +5213,7 @@ GrB_Info GB (_bind1st_tran__min_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5234,7 +5234,7 @@ GrB_Info GB (_bind2nd_tran__min_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5355,7 +5355,7 @@ GrB_Info GB (_AemultB_02__min_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -5368,7 +5368,7 @@ GrB_Info GB (_AemultB_04__min_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5403,7 +5403,7 @@ GrB_Info GB (_bind1st_tran__min_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5424,7 +5424,7 @@ GrB_Info GB (_bind2nd_tran__min_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5545,7 +5545,7 @@ GrB_Info GB (_AemultB_02__min_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -5558,7 +5558,7 @@ GrB_Info GB (_AemultB_04__min_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5593,7 +5593,7 @@ GrB_Info GB (_bind1st_tran__min_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5614,7 +5614,7 @@ GrB_Info GB (_bind2nd_tran__min_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5735,7 +5735,7 @@ GrB_Info GB (_AemultB_02__min_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -5748,7 +5748,7 @@ GrB_Info GB (_AemultB_04__min_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5783,7 +5783,7 @@ GrB_Info GB (_bind1st_tran__min_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5804,7 +5804,7 @@ GrB_Info GB (_bind2nd_tran__min_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5925,7 +5925,7 @@ GrB_Info GB (_AemultB_02__min_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -5938,7 +5938,7 @@ GrB_Info GB (_AemultB_04__min_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -5973,7 +5973,7 @@ GrB_Info GB (_bind1st_tran__min_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5994,7 +5994,7 @@ GrB_Info GB (_bind2nd_tran__min_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6115,7 +6115,7 @@ GrB_Info GB (_AemultB_02__min_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -6128,7 +6128,7 @@ GrB_Info GB (_AemultB_04__min_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -6163,7 +6163,7 @@ GrB_Info GB (_bind1st_tran__min_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6184,7 +6184,7 @@ GrB_Info GB (_bind2nd_tran__min_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6305,7 +6305,7 @@ GrB_Info GB (_AemultB_02__min_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -6318,7 +6318,7 @@ GrB_Info GB (_AemultB_04__min_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -6353,7 +6353,7 @@ GrB_Info GB (_bind1st_tran__min_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6374,7 +6374,7 @@ GrB_Info GB (_bind2nd_tran__min_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6495,7 +6495,7 @@ GrB_Info GB (_AemultB_02__max_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -6508,7 +6508,7 @@ GrB_Info GB (_AemultB_04__max_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -6543,7 +6543,7 @@ GrB_Info GB (_bind1st_tran__max_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6564,7 +6564,7 @@ GrB_Info GB (_bind2nd_tran__max_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6685,7 +6685,7 @@ GrB_Info GB (_AemultB_02__max_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -6698,7 +6698,7 @@ GrB_Info GB (_AemultB_04__max_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -6733,7 +6733,7 @@ GrB_Info GB (_bind1st_tran__max_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6754,7 +6754,7 @@ GrB_Info GB (_bind2nd_tran__max_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6875,7 +6875,7 @@ GrB_Info GB (_AemultB_02__max_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -6888,7 +6888,7 @@ GrB_Info GB (_AemultB_04__max_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -6923,7 +6923,7 @@ GrB_Info GB (_bind1st_tran__max_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6944,7 +6944,7 @@ GrB_Info GB (_bind2nd_tran__max_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7065,7 +7065,7 @@ GrB_Info GB (_AemultB_02__max_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -7078,7 +7078,7 @@ GrB_Info GB (_AemultB_04__max_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -7113,7 +7113,7 @@ GrB_Info GB (_bind1st_tran__max_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7134,7 +7134,7 @@ GrB_Info GB (_bind2nd_tran__max_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7255,7 +7255,7 @@ GrB_Info GB (_AemultB_02__max_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -7268,7 +7268,7 @@ GrB_Info GB (_AemultB_04__max_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -7303,7 +7303,7 @@ GrB_Info GB (_bind1st_tran__max_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7324,7 +7324,7 @@ GrB_Info GB (_bind2nd_tran__max_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7445,7 +7445,7 @@ GrB_Info GB (_AemultB_02__max_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -7458,7 +7458,7 @@ GrB_Info GB (_AemultB_04__max_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -7493,7 +7493,7 @@ GrB_Info GB (_bind1st_tran__max_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7514,7 +7514,7 @@ GrB_Info GB (_bind2nd_tran__max_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7635,7 +7635,7 @@ GrB_Info GB (_AemultB_02__max_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -7648,7 +7648,7 @@ GrB_Info GB (_AemultB_04__max_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -7683,7 +7683,7 @@ GrB_Info GB (_bind1st_tran__max_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7704,7 +7704,7 @@ GrB_Info GB (_bind2nd_tran__max_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7825,7 +7825,7 @@ GrB_Info GB (_AemultB_02__max_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -7838,7 +7838,7 @@ GrB_Info GB (_AemultB_04__max_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -7873,7 +7873,7 @@ GrB_Info GB (_bind1st_tran__max_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7894,7 +7894,7 @@ GrB_Info GB (_bind2nd_tran__max_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8015,7 +8015,7 @@ GrB_Info GB (_AemultB_02__max_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8028,7 +8028,7 @@ GrB_Info GB (_AemultB_04__max_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -8063,7 +8063,7 @@ GrB_Info GB (_bind1st_tran__max_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8084,7 +8084,7 @@ GrB_Info GB (_bind2nd_tran__max_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8205,7 +8205,7 @@ GrB_Info GB (_AemultB_02__max_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8218,7 +8218,7 @@ GrB_Info GB (_AemultB_04__max_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -8253,7 +8253,7 @@ GrB_Info GB (_bind1st_tran__max_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8274,7 +8274,7 @@ GrB_Info GB (_bind2nd_tran__max_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8395,7 +8395,7 @@ GrB_Info GB (_AemultB_02__plus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8408,7 +8408,7 @@ GrB_Info GB (_AemultB_04__plus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -8443,7 +8443,7 @@ GrB_Info GB (_bind1st_tran__plus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8464,7 +8464,7 @@ GrB_Info GB (_bind2nd_tran__plus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8585,7 +8585,7 @@ GrB_Info GB (_AemultB_02__plus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8598,7 +8598,7 @@ GrB_Info GB (_AemultB_04__plus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -8633,7 +8633,7 @@ GrB_Info GB (_bind1st_tran__plus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8654,7 +8654,7 @@ GrB_Info GB (_bind2nd_tran__plus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8775,7 +8775,7 @@ GrB_Info GB (_AemultB_02__plus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8788,7 +8788,7 @@ GrB_Info GB (_AemultB_04__plus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -8823,7 +8823,7 @@ GrB_Info GB (_bind1st_tran__plus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8844,7 +8844,7 @@ GrB_Info GB (_bind2nd_tran__plus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -8965,7 +8965,7 @@ GrB_Info GB (_AemultB_02__plus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -8978,7 +8978,7 @@ GrB_Info GB (_AemultB_04__plus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9013,7 +9013,7 @@ GrB_Info GB (_bind1st_tran__plus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9034,7 +9034,7 @@ GrB_Info GB (_bind2nd_tran__plus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9155,7 +9155,7 @@ GrB_Info GB (_AemultB_02__plus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -9168,7 +9168,7 @@ GrB_Info GB (_AemultB_04__plus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9203,7 +9203,7 @@ GrB_Info GB (_bind1st_tran__plus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9224,7 +9224,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9345,7 +9345,7 @@ GrB_Info GB (_AemultB_02__plus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -9358,7 +9358,7 @@ GrB_Info GB (_AemultB_04__plus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9393,7 +9393,7 @@ GrB_Info GB (_bind1st_tran__plus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9414,7 +9414,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9535,7 +9535,7 @@ GrB_Info GB (_AemultB_02__plus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -9548,7 +9548,7 @@ GrB_Info GB (_AemultB_04__plus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9583,7 +9583,7 @@ GrB_Info GB (_bind1st_tran__plus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9604,7 +9604,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9725,7 +9725,7 @@ GrB_Info GB (_AemultB_02__plus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -9738,7 +9738,7 @@ GrB_Info GB (_AemultB_04__plus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9773,7 +9773,7 @@ GrB_Info GB (_bind1st_tran__plus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9794,7 +9794,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9915,7 +9915,7 @@ GrB_Info GB (_AemultB_02__plus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -9928,7 +9928,7 @@ GrB_Info GB (_AemultB_04__plus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -9963,7 +9963,7 @@ GrB_Info GB (_bind1st_tran__plus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -9984,7 +9984,7 @@ GrB_Info GB (_bind2nd_tran__plus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10105,7 +10105,7 @@ GrB_Info GB (_AemultB_02__plus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -10118,7 +10118,7 @@ GrB_Info GB (_AemultB_04__plus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -10153,7 +10153,7 @@ GrB_Info GB (_bind1st_tran__plus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10174,7 +10174,7 @@ GrB_Info GB (_bind2nd_tran__plus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10295,7 +10295,7 @@ GrB_Info GB (_AemultB_02__plus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -10308,7 +10308,7 @@ GrB_Info GB (_AemultB_04__plus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -10343,7 +10343,7 @@ GrB_Info GB (_bind1st_tran__plus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10364,7 +10364,7 @@ GrB_Info GB (_bind2nd_tran__plus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10485,7 +10485,7 @@ GrB_Info GB (_AemultB_02__plus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -10498,7 +10498,7 @@ GrB_Info GB (_AemultB_04__plus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -10533,7 +10533,7 @@ GrB_Info GB (_bind1st_tran__plus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10554,7 +10554,7 @@ GrB_Info GB (_bind2nd_tran__plus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10675,7 +10675,7 @@ GrB_Info GB (_AemultB_02__minus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -10689,7 +10689,7 @@ GrB_Info GB (_AemultB_03__minus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -10702,7 +10702,7 @@ GrB_Info GB (_AemultB_04__minus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -10737,7 +10737,7 @@ GrB_Info GB (_bind1st_tran__minus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10758,7 +10758,7 @@ GrB_Info GB (_bind2nd_tran__minus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10879,7 +10879,7 @@ GrB_Info GB (_AemultB_02__minus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -10893,7 +10893,7 @@ GrB_Info GB (_AemultB_03__minus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -10906,7 +10906,7 @@ GrB_Info GB (_AemultB_04__minus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -10941,7 +10941,7 @@ GrB_Info GB (_bind1st_tran__minus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -10962,7 +10962,7 @@ GrB_Info GB (_bind2nd_tran__minus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11083,7 +11083,7 @@ GrB_Info GB (_AemultB_02__minus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -11097,7 +11097,7 @@ GrB_Info GB (_AemultB_03__minus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -11110,7 +11110,7 @@ GrB_Info GB (_AemultB_04__minus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -11145,7 +11145,7 @@ GrB_Info GB (_bind1st_tran__minus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11166,7 +11166,7 @@ GrB_Info GB (_bind2nd_tran__minus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11287,7 +11287,7 @@ GrB_Info GB (_AemultB_02__minus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -11301,7 +11301,7 @@ GrB_Info GB (_AemultB_03__minus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -11314,7 +11314,7 @@ GrB_Info GB (_AemultB_04__minus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -11349,7 +11349,7 @@ GrB_Info GB (_bind1st_tran__minus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11370,7 +11370,7 @@ GrB_Info GB (_bind2nd_tran__minus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11491,7 +11491,7 @@ GrB_Info GB (_AemultB_02__minus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -11505,7 +11505,7 @@ GrB_Info GB (_AemultB_03__minus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -11518,7 +11518,7 @@ GrB_Info GB (_AemultB_04__minus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -11553,7 +11553,7 @@ GrB_Info GB (_bind1st_tran__minus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11574,7 +11574,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11695,7 +11695,7 @@ GrB_Info GB (_AemultB_02__minus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -11709,7 +11709,7 @@ GrB_Info GB (_AemultB_03__minus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -11722,7 +11722,7 @@ GrB_Info GB (_AemultB_04__minus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -11757,7 +11757,7 @@ GrB_Info GB (_bind1st_tran__minus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11778,7 +11778,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11899,7 +11899,7 @@ GrB_Info GB (_AemultB_02__minus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -11913,7 +11913,7 @@ GrB_Info GB (_AemultB_03__minus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -11926,7 +11926,7 @@ GrB_Info GB (_AemultB_04__minus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -11961,7 +11961,7 @@ GrB_Info GB (_bind1st_tran__minus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -11982,7 +11982,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12103,7 +12103,7 @@ GrB_Info GB (_AemultB_02__minus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -12117,7 +12117,7 @@ GrB_Info GB (_AemultB_03__minus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -12130,7 +12130,7 @@ GrB_Info GB (_AemultB_04__minus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -12165,7 +12165,7 @@ GrB_Info GB (_bind1st_tran__minus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12186,7 +12186,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12307,7 +12307,7 @@ GrB_Info GB (_AemultB_02__minus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -12321,7 +12321,7 @@ GrB_Info GB (_AemultB_03__minus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -12334,7 +12334,7 @@ GrB_Info GB (_AemultB_04__minus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -12369,7 +12369,7 @@ GrB_Info GB (_bind1st_tran__minus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12390,7 +12390,7 @@ GrB_Info GB (_bind2nd_tran__minus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12511,7 +12511,7 @@ GrB_Info GB (_AemultB_02__minus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -12525,7 +12525,7 @@ GrB_Info GB (_AemultB_03__minus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -12538,7 +12538,7 @@ GrB_Info GB (_AemultB_04__minus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -12573,7 +12573,7 @@ GrB_Info GB (_bind1st_tran__minus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12594,7 +12594,7 @@ GrB_Info GB (_bind2nd_tran__minus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12715,7 +12715,7 @@ GrB_Info GB (_AemultB_02__minus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -12729,7 +12729,7 @@ GrB_Info GB (_AemultB_03__minus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -12742,7 +12742,7 @@ GrB_Info GB (_AemultB_04__minus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -12777,7 +12777,7 @@ GrB_Info GB (_bind1st_tran__minus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12798,7 +12798,7 @@ GrB_Info GB (_bind2nd_tran__minus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -12919,7 +12919,7 @@ GrB_Info GB (_AemultB_02__minus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -12933,7 +12933,7 @@ GrB_Info GB (_AemultB_03__minus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -12946,7 +12946,7 @@ GrB_Info GB (_AemultB_04__minus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -12981,7 +12981,7 @@ GrB_Info GB (_bind1st_tran__minus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13002,7 +13002,7 @@ GrB_Info GB (_bind2nd_tran__minus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13123,7 +13123,7 @@ GrB_Info GB (_AemultB_02__rminus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -13137,7 +13137,7 @@ GrB_Info GB (_AemultB_03__rminus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -13150,7 +13150,7 @@ GrB_Info GB (_AemultB_04__rminus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -13185,7 +13185,7 @@ GrB_Info GB (_bind1st_tran__rminus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13206,7 +13206,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13327,7 +13327,7 @@ GrB_Info GB (_AemultB_02__rminus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -13341,7 +13341,7 @@ GrB_Info GB (_AemultB_03__rminus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -13354,7 +13354,7 @@ GrB_Info GB (_AemultB_04__rminus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -13389,7 +13389,7 @@ GrB_Info GB (_bind1st_tran__rminus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13410,7 +13410,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13531,7 +13531,7 @@ GrB_Info GB (_AemultB_02__rminus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -13545,7 +13545,7 @@ GrB_Info GB (_AemultB_03__rminus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -13558,7 +13558,7 @@ GrB_Info GB (_AemultB_04__rminus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -13593,7 +13593,7 @@ GrB_Info GB (_bind1st_tran__rminus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13614,7 +13614,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13735,7 +13735,7 @@ GrB_Info GB (_AemultB_02__rminus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -13749,7 +13749,7 @@ GrB_Info GB (_AemultB_03__rminus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -13762,7 +13762,7 @@ GrB_Info GB (_AemultB_04__rminus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -13797,7 +13797,7 @@ GrB_Info GB (_bind1st_tran__rminus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13818,7 +13818,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -13939,7 +13939,7 @@ GrB_Info GB (_AemultB_02__rminus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -13953,7 +13953,7 @@ GrB_Info GB (_AemultB_03__rminus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -13966,7 +13966,7 @@ GrB_Info GB (_AemultB_04__rminus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -14001,7 +14001,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14022,7 +14022,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14143,7 +14143,7 @@ GrB_Info GB (_AemultB_02__rminus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -14157,7 +14157,7 @@ GrB_Info GB (_AemultB_03__rminus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -14170,7 +14170,7 @@ GrB_Info GB (_AemultB_04__rminus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -14205,7 +14205,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14226,7 +14226,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14347,7 +14347,7 @@ GrB_Info GB (_AemultB_02__rminus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -14361,7 +14361,7 @@ GrB_Info GB (_AemultB_03__rminus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -14374,7 +14374,7 @@ GrB_Info GB (_AemultB_04__rminus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -14409,7 +14409,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14430,7 +14430,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14551,7 +14551,7 @@ GrB_Info GB (_AemultB_02__rminus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -14565,7 +14565,7 @@ GrB_Info GB (_AemultB_03__rminus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -14578,7 +14578,7 @@ GrB_Info GB (_AemultB_04__rminus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -14613,7 +14613,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14634,7 +14634,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14755,7 +14755,7 @@ GrB_Info GB (_AemultB_02__rminus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -14769,7 +14769,7 @@ GrB_Info GB (_AemultB_03__rminus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -14782,7 +14782,7 @@ GrB_Info GB (_AemultB_04__rminus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -14817,7 +14817,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14838,7 +14838,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -14959,7 +14959,7 @@ GrB_Info GB (_AemultB_02__rminus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -14973,7 +14973,7 @@ GrB_Info GB (_AemultB_03__rminus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -14986,7 +14986,7 @@ GrB_Info GB (_AemultB_04__rminus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15021,7 +15021,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15042,7 +15042,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15163,7 +15163,7 @@ GrB_Info GB (_AemultB_02__rminus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -15177,7 +15177,7 @@ GrB_Info GB (_AemultB_03__rminus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -15190,7 +15190,7 @@ GrB_Info GB (_AemultB_04__rminus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15225,7 +15225,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15246,7 +15246,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15367,7 +15367,7 @@ GrB_Info GB (_AemultB_02__rminus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -15381,7 +15381,7 @@ GrB_Info GB (_AemultB_03__rminus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -15394,7 +15394,7 @@ GrB_Info GB (_AemultB_04__rminus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15429,7 +15429,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15450,7 +15450,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15571,7 +15571,7 @@ GrB_Info GB (_AemultB_02__times_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -15584,7 +15584,7 @@ GrB_Info GB (_AemultB_04__times_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15619,7 +15619,7 @@ GrB_Info GB (_bind1st_tran__times_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15640,7 +15640,7 @@ GrB_Info GB (_bind2nd_tran__times_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15761,7 +15761,7 @@ GrB_Info GB (_AemultB_02__times_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -15774,7 +15774,7 @@ GrB_Info GB (_AemultB_04__times_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15809,7 +15809,7 @@ GrB_Info GB (_bind1st_tran__times_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15830,7 +15830,7 @@ GrB_Info GB (_bind2nd_tran__times_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -15951,7 +15951,7 @@ GrB_Info GB (_AemultB_02__times_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -15964,7 +15964,7 @@ GrB_Info GB (_AemultB_04__times_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -15999,7 +15999,7 @@ GrB_Info GB (_bind1st_tran__times_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16020,7 +16020,7 @@ GrB_Info GB (_bind2nd_tran__times_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16141,7 +16141,7 @@ GrB_Info GB (_AemultB_02__times_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -16154,7 +16154,7 @@ GrB_Info GB (_AemultB_04__times_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -16189,7 +16189,7 @@ GrB_Info GB (_bind1st_tran__times_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16210,7 +16210,7 @@ GrB_Info GB (_bind2nd_tran__times_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16331,7 +16331,7 @@ GrB_Info GB (_AemultB_02__times_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -16344,7 +16344,7 @@ GrB_Info GB (_AemultB_04__times_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -16379,7 +16379,7 @@ GrB_Info GB (_bind1st_tran__times_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16400,7 +16400,7 @@ GrB_Info GB (_bind2nd_tran__times_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16521,7 +16521,7 @@ GrB_Info GB (_AemultB_02__times_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -16534,7 +16534,7 @@ GrB_Info GB (_AemultB_04__times_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -16569,7 +16569,7 @@ GrB_Info GB (_bind1st_tran__times_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16590,7 +16590,7 @@ GrB_Info GB (_bind2nd_tran__times_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16711,7 +16711,7 @@ GrB_Info GB (_AemultB_02__times_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -16724,7 +16724,7 @@ GrB_Info GB (_AemultB_04__times_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -16759,7 +16759,7 @@ GrB_Info GB (_bind1st_tran__times_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16780,7 +16780,7 @@ GrB_Info GB (_bind2nd_tran__times_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16901,7 +16901,7 @@ GrB_Info GB (_AemultB_02__times_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -16914,7 +16914,7 @@ GrB_Info GB (_AemultB_04__times_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -16949,7 +16949,7 @@ GrB_Info GB (_bind1st_tran__times_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -16970,7 +16970,7 @@ GrB_Info GB (_bind2nd_tran__times_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17091,7 +17091,7 @@ GrB_Info GB (_AemultB_02__times_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -17104,7 +17104,7 @@ GrB_Info GB (_AemultB_04__times_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -17139,7 +17139,7 @@ GrB_Info GB (_bind1st_tran__times_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17160,7 +17160,7 @@ GrB_Info GB (_bind2nd_tran__times_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17281,7 +17281,7 @@ GrB_Info GB (_AemultB_02__times_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -17294,7 +17294,7 @@ GrB_Info GB (_AemultB_04__times_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -17329,7 +17329,7 @@ GrB_Info GB (_bind1st_tran__times_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17350,7 +17350,7 @@ GrB_Info GB (_bind2nd_tran__times_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17471,7 +17471,7 @@ GrB_Info GB (_AemultB_02__times_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -17484,7 +17484,7 @@ GrB_Info GB (_AemultB_04__times_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -17519,7 +17519,7 @@ GrB_Info GB (_bind1st_tran__times_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17540,7 +17540,7 @@ GrB_Info GB (_bind2nd_tran__times_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17661,7 +17661,7 @@ GrB_Info GB (_AemultB_02__times_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -17674,7 +17674,7 @@ GrB_Info GB (_AemultB_04__times_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -17709,7 +17709,7 @@ GrB_Info GB (_bind1st_tran__times_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17730,7 +17730,7 @@ GrB_Info GB (_bind2nd_tran__times_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17851,7 +17851,7 @@ GrB_Info GB (_AemultB_02__div_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -17865,7 +17865,7 @@ GrB_Info GB (_AemultB_03__div_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -17878,7 +17878,7 @@ GrB_Info GB (_AemultB_04__div_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -17913,7 +17913,7 @@ GrB_Info GB (_bind1st_tran__div_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -17934,7 +17934,7 @@ GrB_Info GB (_bind2nd_tran__div_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18055,7 +18055,7 @@ GrB_Info GB (_AemultB_02__div_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -18069,7 +18069,7 @@ GrB_Info GB (_AemultB_03__div_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -18082,7 +18082,7 @@ GrB_Info GB (_AemultB_04__div_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -18117,7 +18117,7 @@ GrB_Info GB (_bind1st_tran__div_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18138,7 +18138,7 @@ GrB_Info GB (_bind2nd_tran__div_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18259,7 +18259,7 @@ GrB_Info GB (_AemultB_02__div_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -18273,7 +18273,7 @@ GrB_Info GB (_AemultB_03__div_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -18286,7 +18286,7 @@ GrB_Info GB (_AemultB_04__div_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -18321,7 +18321,7 @@ GrB_Info GB (_bind1st_tran__div_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18342,7 +18342,7 @@ GrB_Info GB (_bind2nd_tran__div_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18463,7 +18463,7 @@ GrB_Info GB (_AemultB_02__div_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -18477,7 +18477,7 @@ GrB_Info GB (_AemultB_03__div_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -18490,7 +18490,7 @@ GrB_Info GB (_AemultB_04__div_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -18525,7 +18525,7 @@ GrB_Info GB (_bind1st_tran__div_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18546,7 +18546,7 @@ GrB_Info GB (_bind2nd_tran__div_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18667,7 +18667,7 @@ GrB_Info GB (_AemultB_02__div_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -18681,7 +18681,7 @@ GrB_Info GB (_AemultB_03__div_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -18694,7 +18694,7 @@ GrB_Info GB (_AemultB_04__div_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -18729,7 +18729,7 @@ GrB_Info GB (_bind1st_tran__div_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18750,7 +18750,7 @@ GrB_Info GB (_bind2nd_tran__div_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18871,7 +18871,7 @@ GrB_Info GB (_AemultB_02__div_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -18885,7 +18885,7 @@ GrB_Info GB (_AemultB_03__div_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -18898,7 +18898,7 @@ GrB_Info GB (_AemultB_04__div_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -18933,7 +18933,7 @@ GrB_Info GB (_bind1st_tran__div_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -18954,7 +18954,7 @@ GrB_Info GB (_bind2nd_tran__div_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19075,7 +19075,7 @@ GrB_Info GB (_AemultB_02__div_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -19089,7 +19089,7 @@ GrB_Info GB (_AemultB_03__div_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -19102,7 +19102,7 @@ GrB_Info GB (_AemultB_04__div_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -19137,7 +19137,7 @@ GrB_Info GB (_bind1st_tran__div_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19158,7 +19158,7 @@ GrB_Info GB (_bind2nd_tran__div_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19279,7 +19279,7 @@ GrB_Info GB (_AemultB_02__div_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -19293,7 +19293,7 @@ GrB_Info GB (_AemultB_03__div_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -19306,7 +19306,7 @@ GrB_Info GB (_AemultB_04__div_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -19341,7 +19341,7 @@ GrB_Info GB (_bind1st_tran__div_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19362,7 +19362,7 @@ GrB_Info GB (_bind2nd_tran__div_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19483,7 +19483,7 @@ GrB_Info GB (_AemultB_02__div_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -19497,7 +19497,7 @@ GrB_Info GB (_AemultB_03__div_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -19510,7 +19510,7 @@ GrB_Info GB (_AemultB_04__div_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -19545,7 +19545,7 @@ GrB_Info GB (_bind1st_tran__div_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19566,7 +19566,7 @@ GrB_Info GB (_bind2nd_tran__div_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19687,7 +19687,7 @@ GrB_Info GB (_AemultB_02__div_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -19701,7 +19701,7 @@ GrB_Info GB (_AemultB_03__div_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -19714,7 +19714,7 @@ GrB_Info GB (_AemultB_04__div_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -19749,7 +19749,7 @@ GrB_Info GB (_bind1st_tran__div_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19770,7 +19770,7 @@ GrB_Info GB (_bind2nd_tran__div_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19891,7 +19891,7 @@ GrB_Info GB (_AemultB_02__div_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -19905,7 +19905,7 @@ GrB_Info GB (_AemultB_03__div_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -19918,7 +19918,7 @@ GrB_Info GB (_AemultB_04__div_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -19953,7 +19953,7 @@ GrB_Info GB (_bind1st_tran__div_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -19974,7 +19974,7 @@ GrB_Info GB (_bind2nd_tran__div_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20095,7 +20095,7 @@ GrB_Info GB (_AemultB_02__div_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -20109,7 +20109,7 @@ GrB_Info GB (_AemultB_03__div_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -20122,7 +20122,7 @@ GrB_Info GB (_AemultB_04__div_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -20157,7 +20157,7 @@ GrB_Info GB (_bind1st_tran__div_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20178,7 +20178,7 @@ GrB_Info GB (_bind2nd_tran__div_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20299,7 +20299,7 @@ GrB_Info GB (_AemultB_02__rdiv_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -20313,7 +20313,7 @@ GrB_Info GB (_AemultB_03__rdiv_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -20326,7 +20326,7 @@ GrB_Info GB (_AemultB_04__rdiv_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -20361,7 +20361,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20382,7 +20382,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20503,7 +20503,7 @@ GrB_Info GB (_AemultB_02__rdiv_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -20517,7 +20517,7 @@ GrB_Info GB (_AemultB_03__rdiv_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -20530,7 +20530,7 @@ GrB_Info GB (_AemultB_04__rdiv_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -20565,7 +20565,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20586,7 +20586,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20707,7 +20707,7 @@ GrB_Info GB (_AemultB_02__rdiv_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -20721,7 +20721,7 @@ GrB_Info GB (_AemultB_03__rdiv_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -20734,7 +20734,7 @@ GrB_Info GB (_AemultB_04__rdiv_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -20769,7 +20769,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20790,7 +20790,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20911,7 +20911,7 @@ GrB_Info GB (_AemultB_02__rdiv_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -20925,7 +20925,7 @@ GrB_Info GB (_AemultB_03__rdiv_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -20938,7 +20938,7 @@ GrB_Info GB (_AemultB_04__rdiv_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -20973,7 +20973,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -20994,7 +20994,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21115,7 +21115,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -21129,7 +21129,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -21142,7 +21142,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -21177,7 +21177,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21198,7 +21198,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21319,7 +21319,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -21333,7 +21333,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -21346,7 +21346,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -21381,7 +21381,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21402,7 +21402,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21523,7 +21523,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -21537,7 +21537,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -21550,7 +21550,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -21585,7 +21585,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21606,7 +21606,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21727,7 +21727,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -21741,7 +21741,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -21754,7 +21754,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -21789,7 +21789,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21810,7 +21810,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -21931,7 +21931,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -21945,7 +21945,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -21958,7 +21958,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -21993,7 +21993,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22014,7 +22014,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22135,7 +22135,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -22149,7 +22149,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -22162,7 +22162,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -22197,7 +22197,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22218,7 +22218,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22339,7 +22339,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -22353,7 +22353,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -22366,7 +22366,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -22401,7 +22401,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22422,7 +22422,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22543,7 +22543,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -22557,7 +22557,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -22570,7 +22570,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -22605,7 +22605,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22626,7 +22626,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22739,7 +22739,7 @@ GrB_Info GB (_AemultB_02__eq_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -22752,7 +22752,7 @@ GrB_Info GB (_AemultB_04__eq_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -22787,7 +22787,7 @@ GrB_Info GB (_bind1st_tran__eq_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22808,7 +22808,7 @@ GrB_Info GB (_bind2nd_tran__eq_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22921,7 +22921,7 @@ GrB_Info GB (_AemultB_02__eq_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -22934,7 +22934,7 @@ GrB_Info GB (_AemultB_04__eq_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -22969,7 +22969,7 @@ GrB_Info GB (_bind1st_tran__eq_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -22990,7 +22990,7 @@ GrB_Info GB (_bind2nd_tran__eq_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23103,7 +23103,7 @@ GrB_Info GB (_AemultB_02__eq_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -23116,7 +23116,7 @@ GrB_Info GB (_AemultB_04__eq_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -23151,7 +23151,7 @@ GrB_Info GB (_bind1st_tran__eq_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23172,7 +23172,7 @@ GrB_Info GB (_bind2nd_tran__eq_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23285,7 +23285,7 @@ GrB_Info GB (_AemultB_02__eq_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -23298,7 +23298,7 @@ GrB_Info GB (_AemultB_04__eq_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -23333,7 +23333,7 @@ GrB_Info GB (_bind1st_tran__eq_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23354,7 +23354,7 @@ GrB_Info GB (_bind2nd_tran__eq_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23467,7 +23467,7 @@ GrB_Info GB (_AemultB_02__eq_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -23480,7 +23480,7 @@ GrB_Info GB (_AemultB_04__eq_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -23515,7 +23515,7 @@ GrB_Info GB (_bind1st_tran__eq_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23536,7 +23536,7 @@ GrB_Info GB (_bind2nd_tran__eq_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23649,7 +23649,7 @@ GrB_Info GB (_AemultB_02__eq_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -23662,7 +23662,7 @@ GrB_Info GB (_AemultB_04__eq_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -23697,7 +23697,7 @@ GrB_Info GB (_bind1st_tran__eq_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23718,7 +23718,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23831,7 +23831,7 @@ GrB_Info GB (_AemultB_02__eq_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -23844,7 +23844,7 @@ GrB_Info GB (_AemultB_04__eq_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -23879,7 +23879,7 @@ GrB_Info GB (_bind1st_tran__eq_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -23900,7 +23900,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24013,7 +24013,7 @@ GrB_Info GB (_AemultB_02__eq_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24026,7 +24026,7 @@ GrB_Info GB (_AemultB_04__eq_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24061,7 +24061,7 @@ GrB_Info GB (_bind1st_tran__eq_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24082,7 +24082,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24195,7 +24195,7 @@ GrB_Info GB (_AemultB_02__eq_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24208,7 +24208,7 @@ GrB_Info GB (_AemultB_04__eq_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24243,7 +24243,7 @@ GrB_Info GB (_bind1st_tran__eq_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24264,7 +24264,7 @@ GrB_Info GB (_bind2nd_tran__eq_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24377,7 +24377,7 @@ GrB_Info GB (_AemultB_02__eq_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24390,7 +24390,7 @@ GrB_Info GB (_AemultB_04__eq_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24425,7 +24425,7 @@ GrB_Info GB (_bind1st_tran__eq_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24446,7 +24446,7 @@ GrB_Info GB (_bind2nd_tran__eq_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24559,7 +24559,7 @@ GrB_Info GB (_AemultB_02__eq_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24572,7 +24572,7 @@ GrB_Info GB (_AemultB_04__eq_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24607,7 +24607,7 @@ GrB_Info GB (_bind1st_tran__eq_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24628,7 +24628,7 @@ GrB_Info GB (_bind2nd_tran__eq_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24723,7 +24723,7 @@ GrB_Info GB (_AemultB_02__eq_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24736,7 +24736,7 @@ GrB_Info GB (_AemultB_04__eq_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24771,7 +24771,7 @@ GrB_Info GB (_bind1st_tran__eq_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24792,7 +24792,7 @@ GrB_Info GB (_bind2nd_tran__eq_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24887,7 +24887,7 @@ GrB_Info GB (_AemultB_02__eq_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -24900,7 +24900,7 @@ GrB_Info GB (_AemultB_04__eq_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -24935,7 +24935,7 @@ GrB_Info GB (_bind1st_tran__eq_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -24956,7 +24956,7 @@ GrB_Info GB (_bind2nd_tran__eq_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25069,7 +25069,7 @@ GrB_Info GB (_AemultB_02__ne_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25082,7 +25082,7 @@ GrB_Info GB (_AemultB_04__ne_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -25117,7 +25117,7 @@ GrB_Info GB (_bind1st_tran__ne_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25138,7 +25138,7 @@ GrB_Info GB (_bind2nd_tran__ne_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25251,7 +25251,7 @@ GrB_Info GB (_AemultB_02__ne_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25264,7 +25264,7 @@ GrB_Info GB (_AemultB_04__ne_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -25299,7 +25299,7 @@ GrB_Info GB (_bind1st_tran__ne_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25320,7 +25320,7 @@ GrB_Info GB (_bind2nd_tran__ne_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25433,7 +25433,7 @@ GrB_Info GB (_AemultB_02__ne_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25446,7 +25446,7 @@ GrB_Info GB (_AemultB_04__ne_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -25481,7 +25481,7 @@ GrB_Info GB (_bind1st_tran__ne_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25502,7 +25502,7 @@ GrB_Info GB (_bind2nd_tran__ne_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25615,7 +25615,7 @@ GrB_Info GB (_AemultB_02__ne_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25628,7 +25628,7 @@ GrB_Info GB (_AemultB_04__ne_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -25663,7 +25663,7 @@ GrB_Info GB (_bind1st_tran__ne_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25684,7 +25684,7 @@ GrB_Info GB (_bind2nd_tran__ne_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25797,7 +25797,7 @@ GrB_Info GB (_AemultB_02__ne_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25810,7 +25810,7 @@ GrB_Info GB (_AemultB_04__ne_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -25845,7 +25845,7 @@ GrB_Info GB (_bind1st_tran__ne_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25866,7 +25866,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -25979,7 +25979,7 @@ GrB_Info GB (_AemultB_02__ne_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -25992,7 +25992,7 @@ GrB_Info GB (_AemultB_04__ne_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26027,7 +26027,7 @@ GrB_Info GB (_bind1st_tran__ne_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26048,7 +26048,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26161,7 +26161,7 @@ GrB_Info GB (_AemultB_02__ne_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -26174,7 +26174,7 @@ GrB_Info GB (_AemultB_04__ne_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26209,7 +26209,7 @@ GrB_Info GB (_bind1st_tran__ne_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26230,7 +26230,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26343,7 +26343,7 @@ GrB_Info GB (_AemultB_02__ne_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -26356,7 +26356,7 @@ GrB_Info GB (_AemultB_04__ne_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26391,7 +26391,7 @@ GrB_Info GB (_bind1st_tran__ne_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26412,7 +26412,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26525,7 +26525,7 @@ GrB_Info GB (_AemultB_02__ne_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -26538,7 +26538,7 @@ GrB_Info GB (_AemultB_04__ne_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26573,7 +26573,7 @@ GrB_Info GB (_bind1st_tran__ne_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26594,7 +26594,7 @@ GrB_Info GB (_bind2nd_tran__ne_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26707,7 +26707,7 @@ GrB_Info GB (_AemultB_02__ne_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -26720,7 +26720,7 @@ GrB_Info GB (_AemultB_04__ne_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26755,7 +26755,7 @@ GrB_Info GB (_bind1st_tran__ne_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26776,7 +26776,7 @@ GrB_Info GB (_bind2nd_tran__ne_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26871,7 +26871,7 @@ GrB_Info GB (_AemultB_02__ne_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -26884,7 +26884,7 @@ GrB_Info GB (_AemultB_04__ne_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -26919,7 +26919,7 @@ GrB_Info GB (_bind1st_tran__ne_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -26940,7 +26940,7 @@ GrB_Info GB (_bind2nd_tran__ne_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27035,7 +27035,7 @@ GrB_Info GB (_AemultB_02__ne_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -27048,7 +27048,7 @@ GrB_Info GB (_AemultB_04__ne_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -27083,7 +27083,7 @@ GrB_Info GB (_bind1st_tran__ne_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27104,7 +27104,7 @@ GrB_Info GB (_bind2nd_tran__ne_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27217,7 +27217,7 @@ GrB_Info GB (_AemultB_02__gt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -27231,7 +27231,7 @@ GrB_Info GB (_AemultB_03__gt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -27244,7 +27244,7 @@ GrB_Info GB (_AemultB_04__gt_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -27279,7 +27279,7 @@ GrB_Info GB (_bind1st_tran__gt_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27300,7 +27300,7 @@ GrB_Info GB (_bind2nd_tran__gt_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27413,7 +27413,7 @@ GrB_Info GB (_AemultB_02__gt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -27427,7 +27427,7 @@ GrB_Info GB (_AemultB_03__gt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -27440,7 +27440,7 @@ GrB_Info GB (_AemultB_04__gt_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -27475,7 +27475,7 @@ GrB_Info GB (_bind1st_tran__gt_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27496,7 +27496,7 @@ GrB_Info GB (_bind2nd_tran__gt_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27609,7 +27609,7 @@ GrB_Info GB (_AemultB_02__gt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -27623,7 +27623,7 @@ GrB_Info GB (_AemultB_03__gt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -27636,7 +27636,7 @@ GrB_Info GB (_AemultB_04__gt_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -27671,7 +27671,7 @@ GrB_Info GB (_bind1st_tran__gt_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27692,7 +27692,7 @@ GrB_Info GB (_bind2nd_tran__gt_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27805,7 +27805,7 @@ GrB_Info GB (_AemultB_02__gt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -27819,7 +27819,7 @@ GrB_Info GB (_AemultB_03__gt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -27832,7 +27832,7 @@ GrB_Info GB (_AemultB_04__gt_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -27867,7 +27867,7 @@ GrB_Info GB (_bind1st_tran__gt_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -27888,7 +27888,7 @@ GrB_Info GB (_bind2nd_tran__gt_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28001,7 +28001,7 @@ GrB_Info GB (_AemultB_02__gt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28015,7 +28015,7 @@ GrB_Info GB (_AemultB_03__gt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -28028,7 +28028,7 @@ GrB_Info GB (_AemultB_04__gt_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -28063,7 +28063,7 @@ GrB_Info GB (_bind1st_tran__gt_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28084,7 +28084,7 @@ GrB_Info GB (_bind2nd_tran__gt_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28197,7 +28197,7 @@ GrB_Info GB (_AemultB_02__gt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28211,7 +28211,7 @@ GrB_Info GB (_AemultB_03__gt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -28224,7 +28224,7 @@ GrB_Info GB (_AemultB_04__gt_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -28259,7 +28259,7 @@ GrB_Info GB (_bind1st_tran__gt_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28280,7 +28280,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28393,7 +28393,7 @@ GrB_Info GB (_AemultB_02__gt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28407,7 +28407,7 @@ GrB_Info GB (_AemultB_03__gt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -28420,7 +28420,7 @@ GrB_Info GB (_AemultB_04__gt_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -28455,7 +28455,7 @@ GrB_Info GB (_bind1st_tran__gt_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28476,7 +28476,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28589,7 +28589,7 @@ GrB_Info GB (_AemultB_02__gt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28603,7 +28603,7 @@ GrB_Info GB (_AemultB_03__gt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -28616,7 +28616,7 @@ GrB_Info GB (_AemultB_04__gt_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -28651,7 +28651,7 @@ GrB_Info GB (_bind1st_tran__gt_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28672,7 +28672,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28785,7 +28785,7 @@ GrB_Info GB (_AemultB_02__gt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28799,7 +28799,7 @@ GrB_Info GB (_AemultB_03__gt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -28812,7 +28812,7 @@ GrB_Info GB (_AemultB_04__gt_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -28847,7 +28847,7 @@ GrB_Info GB (_bind1st_tran__gt_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28868,7 +28868,7 @@ GrB_Info GB (_bind2nd_tran__gt_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -28981,7 +28981,7 @@ GrB_Info GB (_AemultB_02__gt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -28995,7 +28995,7 @@ GrB_Info GB (_AemultB_03__gt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29008,7 +29008,7 @@ GrB_Info GB (_AemultB_04__gt_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -29043,7 +29043,7 @@ GrB_Info GB (_bind1st_tran__gt_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29064,7 +29064,7 @@ GrB_Info GB (_bind2nd_tran__gt_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29177,7 +29177,7 @@ GrB_Info GB (_AemultB_02__gt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -29191,7 +29191,7 @@ GrB_Info GB (_AemultB_03__gt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29204,7 +29204,7 @@ GrB_Info GB (_AemultB_04__gt_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -29239,7 +29239,7 @@ GrB_Info GB (_bind1st_tran__gt_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29260,7 +29260,7 @@ GrB_Info GB (_bind2nd_tran__gt_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29373,7 +29373,7 @@ GrB_Info GB (_AemultB_02__lt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -29387,7 +29387,7 @@ GrB_Info GB (_AemultB_03__lt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29400,7 +29400,7 @@ GrB_Info GB (_AemultB_04__lt_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -29435,7 +29435,7 @@ GrB_Info GB (_bind1st_tran__lt_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29456,7 +29456,7 @@ GrB_Info GB (_bind2nd_tran__lt_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29569,7 +29569,7 @@ GrB_Info GB (_AemultB_02__lt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -29583,7 +29583,7 @@ GrB_Info GB (_AemultB_03__lt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29596,7 +29596,7 @@ GrB_Info GB (_AemultB_04__lt_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -29631,7 +29631,7 @@ GrB_Info GB (_bind1st_tran__lt_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29652,7 +29652,7 @@ GrB_Info GB (_bind2nd_tran__lt_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29765,7 +29765,7 @@ GrB_Info GB (_AemultB_02__lt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -29779,7 +29779,7 @@ GrB_Info GB (_AemultB_03__lt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29792,7 +29792,7 @@ GrB_Info GB (_AemultB_04__lt_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -29827,7 +29827,7 @@ GrB_Info GB (_bind1st_tran__lt_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29848,7 +29848,7 @@ GrB_Info GB (_bind2nd_tran__lt_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -29961,7 +29961,7 @@ GrB_Info GB (_AemultB_02__lt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -29975,7 +29975,7 @@ GrB_Info GB (_AemultB_03__lt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -29988,7 +29988,7 @@ GrB_Info GB (_AemultB_04__lt_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -30023,7 +30023,7 @@ GrB_Info GB (_bind1st_tran__lt_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30044,7 +30044,7 @@ GrB_Info GB (_bind2nd_tran__lt_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30157,7 +30157,7 @@ GrB_Info GB (_AemultB_02__lt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -30171,7 +30171,7 @@ GrB_Info GB (_AemultB_03__lt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -30184,7 +30184,7 @@ GrB_Info GB (_AemultB_04__lt_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -30219,7 +30219,7 @@ GrB_Info GB (_bind1st_tran__lt_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30240,7 +30240,7 @@ GrB_Info GB (_bind2nd_tran__lt_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30353,7 +30353,7 @@ GrB_Info GB (_AemultB_02__lt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -30367,7 +30367,7 @@ GrB_Info GB (_AemultB_03__lt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -30380,7 +30380,7 @@ GrB_Info GB (_AemultB_04__lt_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -30415,7 +30415,7 @@ GrB_Info GB (_bind1st_tran__lt_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30436,7 +30436,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30549,7 +30549,7 @@ GrB_Info GB (_AemultB_02__lt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -30563,7 +30563,7 @@ GrB_Info GB (_AemultB_03__lt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -30576,7 +30576,7 @@ GrB_Info GB (_AemultB_04__lt_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -30611,7 +30611,7 @@ GrB_Info GB (_bind1st_tran__lt_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30632,7 +30632,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30745,7 +30745,7 @@ GrB_Info GB (_AemultB_02__lt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -30759,7 +30759,7 @@ GrB_Info GB (_AemultB_03__lt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -30772,7 +30772,7 @@ GrB_Info GB (_AemultB_04__lt_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -30807,7 +30807,7 @@ GrB_Info GB (_bind1st_tran__lt_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30828,7 +30828,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -30941,7 +30941,7 @@ GrB_Info GB (_AemultB_02__lt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -30955,7 +30955,7 @@ GrB_Info GB (_AemultB_03__lt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -30968,7 +30968,7 @@ GrB_Info GB (_AemultB_04__lt_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31003,7 +31003,7 @@ GrB_Info GB (_bind1st_tran__lt_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31024,7 +31024,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31137,7 +31137,7 @@ GrB_Info GB (_AemultB_02__lt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -31151,7 +31151,7 @@ GrB_Info GB (_AemultB_03__lt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -31164,7 +31164,7 @@ GrB_Info GB (_AemultB_04__lt_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31199,7 +31199,7 @@ GrB_Info GB (_bind1st_tran__lt_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31220,7 +31220,7 @@ GrB_Info GB (_bind2nd_tran__lt_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31333,7 +31333,7 @@ GrB_Info GB (_AemultB_02__lt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -31347,7 +31347,7 @@ GrB_Info GB (_AemultB_03__lt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -31360,7 +31360,7 @@ GrB_Info GB (_AemultB_04__lt_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31395,7 +31395,7 @@ GrB_Info GB (_bind1st_tran__lt_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31416,7 +31416,7 @@ GrB_Info GB (_bind2nd_tran__lt_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31529,7 +31529,7 @@ GrB_Info GB (_AemultB_02__ge_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -31543,7 +31543,7 @@ GrB_Info GB (_AemultB_03__ge_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -31556,7 +31556,7 @@ GrB_Info GB (_AemultB_04__ge_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31591,7 +31591,7 @@ GrB_Info GB (_bind1st_tran__ge_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31612,7 +31612,7 @@ GrB_Info GB (_bind2nd_tran__ge_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31725,7 +31725,7 @@ GrB_Info GB (_AemultB_02__ge_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -31739,7 +31739,7 @@ GrB_Info GB (_AemultB_03__ge_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -31752,7 +31752,7 @@ GrB_Info GB (_AemultB_04__ge_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31787,7 +31787,7 @@ GrB_Info GB (_bind1st_tran__ge_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31808,7 +31808,7 @@ GrB_Info GB (_bind2nd_tran__ge_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -31921,7 +31921,7 @@ GrB_Info GB (_AemultB_02__ge_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -31935,7 +31935,7 @@ GrB_Info GB (_AemultB_03__ge_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -31948,7 +31948,7 @@ GrB_Info GB (_AemultB_04__ge_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -31983,7 +31983,7 @@ GrB_Info GB (_bind1st_tran__ge_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32004,7 +32004,7 @@ GrB_Info GB (_bind2nd_tran__ge_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32117,7 +32117,7 @@ GrB_Info GB (_AemultB_02__ge_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -32131,7 +32131,7 @@ GrB_Info GB (_AemultB_03__ge_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -32144,7 +32144,7 @@ GrB_Info GB (_AemultB_04__ge_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -32179,7 +32179,7 @@ GrB_Info GB (_bind1st_tran__ge_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32200,7 +32200,7 @@ GrB_Info GB (_bind2nd_tran__ge_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32313,7 +32313,7 @@ GrB_Info GB (_AemultB_02__ge_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -32327,7 +32327,7 @@ GrB_Info GB (_AemultB_03__ge_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -32340,7 +32340,7 @@ GrB_Info GB (_AemultB_04__ge_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -32375,7 +32375,7 @@ GrB_Info GB (_bind1st_tran__ge_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32396,7 +32396,7 @@ GrB_Info GB (_bind2nd_tran__ge_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32509,7 +32509,7 @@ GrB_Info GB (_AemultB_02__ge_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -32523,7 +32523,7 @@ GrB_Info GB (_AemultB_03__ge_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -32536,7 +32536,7 @@ GrB_Info GB (_AemultB_04__ge_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -32571,7 +32571,7 @@ GrB_Info GB (_bind1st_tran__ge_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32592,7 +32592,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32705,7 +32705,7 @@ GrB_Info GB (_AemultB_02__ge_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -32719,7 +32719,7 @@ GrB_Info GB (_AemultB_03__ge_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -32732,7 +32732,7 @@ GrB_Info GB (_AemultB_04__ge_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -32767,7 +32767,7 @@ GrB_Info GB (_bind1st_tran__ge_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32788,7 +32788,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32901,7 +32901,7 @@ GrB_Info GB (_AemultB_02__ge_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -32915,7 +32915,7 @@ GrB_Info GB (_AemultB_03__ge_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -32928,7 +32928,7 @@ GrB_Info GB (_AemultB_04__ge_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -32963,7 +32963,7 @@ GrB_Info GB (_bind1st_tran__ge_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -32984,7 +32984,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33097,7 +33097,7 @@ GrB_Info GB (_AemultB_02__ge_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -33111,7 +33111,7 @@ GrB_Info GB (_AemultB_03__ge_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -33124,7 +33124,7 @@ GrB_Info GB (_AemultB_04__ge_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -33159,7 +33159,7 @@ GrB_Info GB (_bind1st_tran__ge_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33180,7 +33180,7 @@ GrB_Info GB (_bind2nd_tran__ge_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33293,7 +33293,7 @@ GrB_Info GB (_AemultB_02__ge_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -33307,7 +33307,7 @@ GrB_Info GB (_AemultB_03__ge_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -33320,7 +33320,7 @@ GrB_Info GB (_AemultB_04__ge_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -33355,7 +33355,7 @@ GrB_Info GB (_bind1st_tran__ge_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33376,7 +33376,7 @@ GrB_Info GB (_bind2nd_tran__ge_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33489,7 +33489,7 @@ GrB_Info GB (_AemultB_02__ge_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -33503,7 +33503,7 @@ GrB_Info GB (_AemultB_03__ge_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -33516,7 +33516,7 @@ GrB_Info GB (_AemultB_04__ge_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -33551,7 +33551,7 @@ GrB_Info GB (_bind1st_tran__ge_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33572,7 +33572,7 @@ GrB_Info GB (_bind2nd_tran__ge_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33685,7 +33685,7 @@ GrB_Info GB (_AemultB_02__le_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -33699,7 +33699,7 @@ GrB_Info GB (_AemultB_03__le_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -33712,7 +33712,7 @@ GrB_Info GB (_AemultB_04__le_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -33747,7 +33747,7 @@ GrB_Info GB (_bind1st_tran__le_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33768,7 +33768,7 @@ GrB_Info GB (_bind2nd_tran__le_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33881,7 +33881,7 @@ GrB_Info GB (_AemultB_02__le_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -33895,7 +33895,7 @@ GrB_Info GB (_AemultB_03__le_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -33908,7 +33908,7 @@ GrB_Info GB (_AemultB_04__le_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -33943,7 +33943,7 @@ GrB_Info GB (_bind1st_tran__le_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33964,7 +33964,7 @@ GrB_Info GB (_bind2nd_tran__le_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34077,7 +34077,7 @@ GrB_Info GB (_AemultB_02__le_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34091,7 +34091,7 @@ GrB_Info GB (_AemultB_03__le_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -34104,7 +34104,7 @@ GrB_Info GB (_AemultB_04__le_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -34139,7 +34139,7 @@ GrB_Info GB (_bind1st_tran__le_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34160,7 +34160,7 @@ GrB_Info GB (_bind2nd_tran__le_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34273,7 +34273,7 @@ GrB_Info GB (_AemultB_02__le_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34287,7 +34287,7 @@ GrB_Info GB (_AemultB_03__le_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -34300,7 +34300,7 @@ GrB_Info GB (_AemultB_04__le_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -34335,7 +34335,7 @@ GrB_Info GB (_bind1st_tran__le_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34356,7 +34356,7 @@ GrB_Info GB (_bind2nd_tran__le_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34469,7 +34469,7 @@ GrB_Info GB (_AemultB_02__le_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34483,7 +34483,7 @@ GrB_Info GB (_AemultB_03__le_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -34496,7 +34496,7 @@ GrB_Info GB (_AemultB_04__le_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -34531,7 +34531,7 @@ GrB_Info GB (_bind1st_tran__le_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34552,7 +34552,7 @@ GrB_Info GB (_bind2nd_tran__le_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34665,7 +34665,7 @@ GrB_Info GB (_AemultB_02__le_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34679,7 +34679,7 @@ GrB_Info GB (_AemultB_03__le_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -34692,7 +34692,7 @@ GrB_Info GB (_AemultB_04__le_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -34727,7 +34727,7 @@ GrB_Info GB (_bind1st_tran__le_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34748,7 +34748,7 @@ GrB_Info GB (_bind2nd_tran__le_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34861,7 +34861,7 @@ GrB_Info GB (_AemultB_02__le_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34875,7 +34875,7 @@ GrB_Info GB (_AemultB_03__le_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -34888,7 +34888,7 @@ GrB_Info GB (_AemultB_04__le_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -34923,7 +34923,7 @@ GrB_Info GB (_bind1st_tran__le_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -34944,7 +34944,7 @@ GrB_Info GB (_bind2nd_tran__le_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35057,7 +35057,7 @@ GrB_Info GB (_AemultB_02__le_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -35071,7 +35071,7 @@ GrB_Info GB (_AemultB_03__le_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -35084,7 +35084,7 @@ GrB_Info GB (_AemultB_04__le_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -35119,7 +35119,7 @@ GrB_Info GB (_bind1st_tran__le_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35140,7 +35140,7 @@ GrB_Info GB (_bind2nd_tran__le_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35253,7 +35253,7 @@ GrB_Info GB (_AemultB_02__le_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -35267,7 +35267,7 @@ GrB_Info GB (_AemultB_03__le_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -35280,7 +35280,7 @@ GrB_Info GB (_AemultB_04__le_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -35315,7 +35315,7 @@ GrB_Info GB (_bind1st_tran__le_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35336,7 +35336,7 @@ GrB_Info GB (_bind2nd_tran__le_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35449,7 +35449,7 @@ GrB_Info GB (_AemultB_02__le_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -35463,7 +35463,7 @@ GrB_Info GB (_AemultB_03__le_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -35476,7 +35476,7 @@ GrB_Info GB (_AemultB_04__le_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -35511,7 +35511,7 @@ GrB_Info GB (_bind1st_tran__le_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35532,7 +35532,7 @@ GrB_Info GB (_bind2nd_tran__le_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35645,7 +35645,7 @@ GrB_Info GB (_AemultB_02__le_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -35659,7 +35659,7 @@ GrB_Info GB (_AemultB_03__le_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -35672,7 +35672,7 @@ GrB_Info GB (_AemultB_04__le_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -35707,7 +35707,7 @@ GrB_Info GB (_bind1st_tran__le_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35728,7 +35728,7 @@ GrB_Info GB (_bind2nd_tran__le_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35841,7 +35841,7 @@ GrB_Info GB (_AemultB_02__lor_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -35854,7 +35854,7 @@ GrB_Info GB (_AemultB_04__lor_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -35889,7 +35889,7 @@ GrB_Info GB (_bind1st_tran__lor_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35910,7 +35910,7 @@ GrB_Info GB (_bind2nd_tran__lor_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36023,7 +36023,7 @@ GrB_Info GB (_AemultB_02__lor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36036,7 +36036,7 @@ GrB_Info GB (_AemultB_04__lor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36071,7 +36071,7 @@ GrB_Info GB (_bind1st_tran__lor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36092,7 +36092,7 @@ GrB_Info GB (_bind2nd_tran__lor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36205,7 +36205,7 @@ GrB_Info GB (_AemultB_02__lor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36218,7 +36218,7 @@ GrB_Info GB (_AemultB_04__lor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36253,7 +36253,7 @@ GrB_Info GB (_bind1st_tran__lor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36274,7 +36274,7 @@ GrB_Info GB (_bind2nd_tran__lor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36387,7 +36387,7 @@ GrB_Info GB (_AemultB_02__lor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36400,7 +36400,7 @@ GrB_Info GB (_AemultB_04__lor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36435,7 +36435,7 @@ GrB_Info GB (_bind1st_tran__lor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36456,7 +36456,7 @@ GrB_Info GB (_bind2nd_tran__lor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36569,7 +36569,7 @@ GrB_Info GB (_AemultB_02__lor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36582,7 +36582,7 @@ GrB_Info GB (_AemultB_04__lor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36617,7 +36617,7 @@ GrB_Info GB (_bind1st_tran__lor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36638,7 +36638,7 @@ GrB_Info GB (_bind2nd_tran__lor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36751,7 +36751,7 @@ GrB_Info GB (_AemultB_02__lor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36764,7 +36764,7 @@ GrB_Info GB (_AemultB_04__lor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36799,7 +36799,7 @@ GrB_Info GB (_bind1st_tran__lor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36820,7 +36820,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -36933,7 +36933,7 @@ GrB_Info GB (_AemultB_02__lor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -36946,7 +36946,7 @@ GrB_Info GB (_AemultB_04__lor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -36981,7 +36981,7 @@ GrB_Info GB (_bind1st_tran__lor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37002,7 +37002,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37115,7 +37115,7 @@ GrB_Info GB (_AemultB_02__lor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -37128,7 +37128,7 @@ GrB_Info GB (_AemultB_04__lor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -37163,7 +37163,7 @@ GrB_Info GB (_bind1st_tran__lor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37184,7 +37184,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37297,7 +37297,7 @@ GrB_Info GB (_AemultB_02__lor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -37310,7 +37310,7 @@ GrB_Info GB (_AemultB_04__lor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -37345,7 +37345,7 @@ GrB_Info GB (_bind1st_tran__lor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37366,7 +37366,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37479,7 +37479,7 @@ GrB_Info GB (_AemultB_02__lor_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -37492,7 +37492,7 @@ GrB_Info GB (_AemultB_04__lor_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -37527,7 +37527,7 @@ GrB_Info GB (_bind1st_tran__lor_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37548,7 +37548,7 @@ GrB_Info GB (_bind2nd_tran__lor_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37661,7 +37661,7 @@ GrB_Info GB (_AemultB_02__lor_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -37674,7 +37674,7 @@ GrB_Info GB (_AemultB_04__lor_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -37709,7 +37709,7 @@ GrB_Info GB (_bind1st_tran__lor_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37730,7 +37730,7 @@ GrB_Info GB (_bind2nd_tran__lor_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37843,7 +37843,7 @@ GrB_Info GB (_AemultB_02__land_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -37856,7 +37856,7 @@ GrB_Info GB (_AemultB_04__land_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -37891,7 +37891,7 @@ GrB_Info GB (_bind1st_tran__land_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -37912,7 +37912,7 @@ GrB_Info GB (_bind2nd_tran__land_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38025,7 +38025,7 @@ GrB_Info GB (_AemultB_02__land_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38038,7 +38038,7 @@ GrB_Info GB (_AemultB_04__land_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38073,7 +38073,7 @@ GrB_Info GB (_bind1st_tran__land_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38094,7 +38094,7 @@ GrB_Info GB (_bind2nd_tran__land_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38207,7 +38207,7 @@ GrB_Info GB (_AemultB_02__land_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38220,7 +38220,7 @@ GrB_Info GB (_AemultB_04__land_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38255,7 +38255,7 @@ GrB_Info GB (_bind1st_tran__land_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38276,7 +38276,7 @@ GrB_Info GB (_bind2nd_tran__land_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38389,7 +38389,7 @@ GrB_Info GB (_AemultB_02__land_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38402,7 +38402,7 @@ GrB_Info GB (_AemultB_04__land_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38437,7 +38437,7 @@ GrB_Info GB (_bind1st_tran__land_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38458,7 +38458,7 @@ GrB_Info GB (_bind2nd_tran__land_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38571,7 +38571,7 @@ GrB_Info GB (_AemultB_02__land_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38584,7 +38584,7 @@ GrB_Info GB (_AemultB_04__land_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38619,7 +38619,7 @@ GrB_Info GB (_bind1st_tran__land_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38640,7 +38640,7 @@ GrB_Info GB (_bind2nd_tran__land_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38753,7 +38753,7 @@ GrB_Info GB (_AemultB_02__land_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38766,7 +38766,7 @@ GrB_Info GB (_AemultB_04__land_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38801,7 +38801,7 @@ GrB_Info GB (_bind1st_tran__land_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38822,7 +38822,7 @@ GrB_Info GB (_bind2nd_tran__land_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -38935,7 +38935,7 @@ GrB_Info GB (_AemultB_02__land_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -38948,7 +38948,7 @@ GrB_Info GB (_AemultB_04__land_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -38983,7 +38983,7 @@ GrB_Info GB (_bind1st_tran__land_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39004,7 +39004,7 @@ GrB_Info GB (_bind2nd_tran__land_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39117,7 +39117,7 @@ GrB_Info GB (_AemultB_02__land_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -39130,7 +39130,7 @@ GrB_Info GB (_AemultB_04__land_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39165,7 +39165,7 @@ GrB_Info GB (_bind1st_tran__land_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39186,7 +39186,7 @@ GrB_Info GB (_bind2nd_tran__land_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39299,7 +39299,7 @@ GrB_Info GB (_AemultB_02__land_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -39312,7 +39312,7 @@ GrB_Info GB (_AemultB_04__land_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39347,7 +39347,7 @@ GrB_Info GB (_bind1st_tran__land_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39368,7 +39368,7 @@ GrB_Info GB (_bind2nd_tran__land_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39481,7 +39481,7 @@ GrB_Info GB (_AemultB_02__land_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -39494,7 +39494,7 @@ GrB_Info GB (_AemultB_04__land_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39529,7 +39529,7 @@ GrB_Info GB (_bind1st_tran__land_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39550,7 +39550,7 @@ GrB_Info GB (_bind2nd_tran__land_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39663,7 +39663,7 @@ GrB_Info GB (_AemultB_02__land_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -39676,7 +39676,7 @@ GrB_Info GB (_AemultB_04__land_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39711,7 +39711,7 @@ GrB_Info GB (_bind1st_tran__land_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39732,7 +39732,7 @@ GrB_Info GB (_bind2nd_tran__land_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39845,7 +39845,7 @@ GrB_Info GB (_AemultB_02__lxor_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -39858,7 +39858,7 @@ GrB_Info GB (_AemultB_04__lxor_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39893,7 +39893,7 @@ GrB_Info GB (_bind1st_tran__lxor_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -39914,7 +39914,7 @@ GrB_Info GB (_bind2nd_tran__lxor_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40027,7 +40027,7 @@ GrB_Info GB (_AemultB_02__lxor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40040,7 +40040,7 @@ GrB_Info GB (_AemultB_04__lxor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40075,7 +40075,7 @@ GrB_Info GB (_bind1st_tran__lxor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40096,7 +40096,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40209,7 +40209,7 @@ GrB_Info GB (_AemultB_02__lxor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40222,7 +40222,7 @@ GrB_Info GB (_AemultB_04__lxor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40257,7 +40257,7 @@ GrB_Info GB (_bind1st_tran__lxor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40278,7 +40278,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40391,7 +40391,7 @@ GrB_Info GB (_AemultB_02__lxor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40404,7 +40404,7 @@ GrB_Info GB (_AemultB_04__lxor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40439,7 +40439,7 @@ GrB_Info GB (_bind1st_tran__lxor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40460,7 +40460,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40573,7 +40573,7 @@ GrB_Info GB (_AemultB_02__lxor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40586,7 +40586,7 @@ GrB_Info GB (_AemultB_04__lxor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40621,7 +40621,7 @@ GrB_Info GB (_bind1st_tran__lxor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40642,7 +40642,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40755,7 +40755,7 @@ GrB_Info GB (_AemultB_02__lxor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40768,7 +40768,7 @@ GrB_Info GB (_AemultB_04__lxor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40803,7 +40803,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40824,7 +40824,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -40937,7 +40937,7 @@ GrB_Info GB (_AemultB_02__lxor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40950,7 +40950,7 @@ GrB_Info GB (_AemultB_04__lxor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -40985,7 +40985,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41006,7 +41006,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41119,7 +41119,7 @@ GrB_Info GB (_AemultB_02__lxor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -41132,7 +41132,7 @@ GrB_Info GB (_AemultB_04__lxor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -41167,7 +41167,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41188,7 +41188,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41301,7 +41301,7 @@ GrB_Info GB (_AemultB_02__lxor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -41314,7 +41314,7 @@ GrB_Info GB (_AemultB_04__lxor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -41349,7 +41349,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41370,7 +41370,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41483,7 +41483,7 @@ GrB_Info GB (_AemultB_02__lxor_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -41496,7 +41496,7 @@ GrB_Info GB (_AemultB_04__lxor_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -41531,7 +41531,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41552,7 +41552,7 @@ GrB_Info GB (_bind2nd_tran__lxor_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41665,7 +41665,7 @@ GrB_Info GB (_AemultB_02__lxor_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -41678,7 +41678,7 @@ GrB_Info GB (_AemultB_04__lxor_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -41713,7 +41713,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41734,7 +41734,7 @@ GrB_Info GB (_bind2nd_tran__lxor_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41829,7 +41829,7 @@ GrB_Info GB (_AemultB_02__atan2_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -41843,7 +41843,7 @@ GrB_Info GB (_AemultB_03__atan2_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -41856,7 +41856,7 @@ GrB_Info GB (_AemultB_04__atan2_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -41891,7 +41891,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -41912,7 +41912,7 @@ GrB_Info GB (_bind2nd_tran__atan2_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42007,7 +42007,7 @@ GrB_Info GB (_AemultB_02__atan2_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42021,7 +42021,7 @@ GrB_Info GB (_AemultB_03__atan2_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -42034,7 +42034,7 @@ GrB_Info GB (_AemultB_04__atan2_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42069,7 +42069,7 @@ GrB_Info GB (_bind1st_tran__atan2_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42090,7 +42090,7 @@ GrB_Info GB (_bind2nd_tran__atan2_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42185,7 +42185,7 @@ GrB_Info GB (_AemultB_02__hypot_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42198,7 +42198,7 @@ GrB_Info GB (_AemultB_04__hypot_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42233,7 +42233,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42254,7 +42254,7 @@ GrB_Info GB (_bind2nd_tran__hypot_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42349,7 +42349,7 @@ GrB_Info GB (_AemultB_02__hypot_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42362,7 +42362,7 @@ GrB_Info GB (_AemultB_04__hypot_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42397,7 +42397,7 @@ GrB_Info GB (_bind1st_tran__hypot_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42418,7 +42418,7 @@ GrB_Info GB (_bind2nd_tran__hypot_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42513,7 +42513,7 @@ GrB_Info GB (_AemultB_02__fmod_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42527,7 +42527,7 @@ GrB_Info GB (_AemultB_03__fmod_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -42540,7 +42540,7 @@ GrB_Info GB (_AemultB_04__fmod_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42575,7 +42575,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42596,7 +42596,7 @@ GrB_Info GB (_bind2nd_tran__fmod_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42691,7 +42691,7 @@ GrB_Info GB (_AemultB_02__fmod_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42705,7 +42705,7 @@ GrB_Info GB (_AemultB_03__fmod_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -42718,7 +42718,7 @@ GrB_Info GB (_AemultB_04__fmod_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42753,7 +42753,7 @@ GrB_Info GB (_bind1st_tran__fmod_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42774,7 +42774,7 @@ GrB_Info GB (_bind2nd_tran__fmod_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42869,7 +42869,7 @@ GrB_Info GB (_AemultB_02__remainder_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -42883,7 +42883,7 @@ GrB_Info GB (_AemultB_03__remainder_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -42896,7 +42896,7 @@ GrB_Info GB (_AemultB_04__remainder_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -42931,7 +42931,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -42952,7 +42952,7 @@ GrB_Info GB (_bind2nd_tran__remainder_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43047,7 +43047,7 @@ GrB_Info GB (_AemultB_02__remainder_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43061,7 +43061,7 @@ GrB_Info GB (_AemultB_03__remainder_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43074,7 +43074,7 @@ GrB_Info GB (_AemultB_04__remainder_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43109,7 +43109,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43130,7 +43130,7 @@ GrB_Info GB (_bind2nd_tran__remainder_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43225,7 +43225,7 @@ GrB_Info GB (_AemultB_02__copysign_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43239,7 +43239,7 @@ GrB_Info GB (_AemultB_03__copysign_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43252,7 +43252,7 @@ GrB_Info GB (_AemultB_04__copysign_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43287,7 +43287,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43308,7 +43308,7 @@ GrB_Info GB (_bind2nd_tran__copysign_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43403,7 +43403,7 @@ GrB_Info GB (_AemultB_02__copysign_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43417,7 +43417,7 @@ GrB_Info GB (_AemultB_03__copysign_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43430,7 +43430,7 @@ GrB_Info GB (_AemultB_04__copysign_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43465,7 +43465,7 @@ GrB_Info GB (_bind1st_tran__copysign_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43486,7 +43486,7 @@ GrB_Info GB (_bind2nd_tran__copysign_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43581,7 +43581,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43595,7 +43595,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43608,7 +43608,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43643,7 +43643,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43664,7 +43664,7 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43759,7 +43759,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43773,7 +43773,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43786,7 +43786,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43821,7 +43821,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43842,7 +43842,7 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -43937,7 +43937,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -43951,7 +43951,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -43964,7 +43964,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -43999,7 +43999,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44020,7 +44020,7 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44115,7 +44115,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44129,7 +44129,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -44142,7 +44142,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -44177,7 +44177,7 @@ GrB_Info GB (_bind1st_tran__cmplx_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44198,7 +44198,7 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44293,7 +44293,7 @@ GrB_Info GB (_AemultB_02__bor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44306,7 +44306,7 @@ GrB_Info GB (_AemultB_04__bor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -44341,7 +44341,7 @@ GrB_Info GB (_bind1st_tran__bor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44362,7 +44362,7 @@ GrB_Info GB (_bind2nd_tran__bor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44457,7 +44457,7 @@ GrB_Info GB (_AemultB_02__bor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44470,7 +44470,7 @@ GrB_Info GB (_AemultB_04__bor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -44505,7 +44505,7 @@ GrB_Info GB (_bind1st_tran__bor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44526,7 +44526,7 @@ GrB_Info GB (_bind2nd_tran__bor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44621,7 +44621,7 @@ GrB_Info GB (_AemultB_02__bor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44634,7 +44634,7 @@ GrB_Info GB (_AemultB_04__bor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -44669,7 +44669,7 @@ GrB_Info GB (_bind1st_tran__bor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44690,7 +44690,7 @@ GrB_Info GB (_bind2nd_tran__bor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44785,7 +44785,7 @@ GrB_Info GB (_AemultB_02__bor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44798,7 +44798,7 @@ GrB_Info GB (_AemultB_04__bor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -44833,7 +44833,7 @@ GrB_Info GB (_bind1st_tran__bor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44854,7 +44854,7 @@ GrB_Info GB (_bind2nd_tran__bor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -44967,7 +44967,7 @@ GrB_Info GB (_AemultB_02__bor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -44980,7 +44980,7 @@ GrB_Info GB (_AemultB_04__bor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45015,7 +45015,7 @@ GrB_Info GB (_bind1st_tran__bor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45036,7 +45036,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45149,7 +45149,7 @@ GrB_Info GB (_AemultB_02__bor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -45162,7 +45162,7 @@ GrB_Info GB (_AemultB_04__bor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45197,7 +45197,7 @@ GrB_Info GB (_bind1st_tran__bor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45218,7 +45218,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45331,7 +45331,7 @@ GrB_Info GB (_AemultB_02__bor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -45344,7 +45344,7 @@ GrB_Info GB (_AemultB_04__bor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45379,7 +45379,7 @@ GrB_Info GB (_bind1st_tran__bor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45400,7 +45400,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45513,7 +45513,7 @@ GrB_Info GB (_AemultB_02__bor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -45526,7 +45526,7 @@ GrB_Info GB (_AemultB_04__bor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45561,7 +45561,7 @@ GrB_Info GB (_bind1st_tran__bor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45582,7 +45582,7 @@ GrB_Info GB (_bind2nd_tran__bor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45677,7 +45677,7 @@ GrB_Info GB (_AemultB_02__band_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -45690,7 +45690,7 @@ GrB_Info GB (_AemultB_04__band_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45725,7 +45725,7 @@ GrB_Info GB (_bind1st_tran__band_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45746,7 +45746,7 @@ GrB_Info GB (_bind2nd_tran__band_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45841,7 +45841,7 @@ GrB_Info GB (_AemultB_02__band_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -45854,7 +45854,7 @@ GrB_Info GB (_AemultB_04__band_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -45889,7 +45889,7 @@ GrB_Info GB (_bind1st_tran__band_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -45910,7 +45910,7 @@ GrB_Info GB (_bind2nd_tran__band_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46005,7 +46005,7 @@ GrB_Info GB (_AemultB_02__band_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46018,7 +46018,7 @@ GrB_Info GB (_AemultB_04__band_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46053,7 +46053,7 @@ GrB_Info GB (_bind1st_tran__band_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46074,7 +46074,7 @@ GrB_Info GB (_bind2nd_tran__band_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46169,7 +46169,7 @@ GrB_Info GB (_AemultB_02__band_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46182,7 +46182,7 @@ GrB_Info GB (_AemultB_04__band_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46217,7 +46217,7 @@ GrB_Info GB (_bind1st_tran__band_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46238,7 +46238,7 @@ GrB_Info GB (_bind2nd_tran__band_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46351,7 +46351,7 @@ GrB_Info GB (_AemultB_02__band_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46364,7 +46364,7 @@ GrB_Info GB (_AemultB_04__band_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46399,7 +46399,7 @@ GrB_Info GB (_bind1st_tran__band_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46420,7 +46420,7 @@ GrB_Info GB (_bind2nd_tran__band_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46533,7 +46533,7 @@ GrB_Info GB (_AemultB_02__band_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46546,7 +46546,7 @@ GrB_Info GB (_AemultB_04__band_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46581,7 +46581,7 @@ GrB_Info GB (_bind1st_tran__band_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46602,7 +46602,7 @@ GrB_Info GB (_bind2nd_tran__band_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46715,7 +46715,7 @@ GrB_Info GB (_AemultB_02__band_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46728,7 +46728,7 @@ GrB_Info GB (_AemultB_04__band_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46763,7 +46763,7 @@ GrB_Info GB (_bind1st_tran__band_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46784,7 +46784,7 @@ GrB_Info GB (_bind2nd_tran__band_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46897,7 +46897,7 @@ GrB_Info GB (_AemultB_02__band_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -46910,7 +46910,7 @@ GrB_Info GB (_AemultB_04__band_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -46945,7 +46945,7 @@ GrB_Info GB (_bind1st_tran__band_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -46966,7 +46966,7 @@ GrB_Info GB (_bind2nd_tran__band_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47061,7 +47061,7 @@ GrB_Info GB (_AemultB_02__bxor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47074,7 +47074,7 @@ GrB_Info GB (_AemultB_04__bxor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47109,7 +47109,7 @@ GrB_Info GB (_bind1st_tran__bxor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47130,7 +47130,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47225,7 +47225,7 @@ GrB_Info GB (_AemultB_02__bxor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47238,7 +47238,7 @@ GrB_Info GB (_AemultB_04__bxor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47273,7 +47273,7 @@ GrB_Info GB (_bind1st_tran__bxor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47294,7 +47294,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47389,7 +47389,7 @@ GrB_Info GB (_AemultB_02__bxor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47402,7 +47402,7 @@ GrB_Info GB (_AemultB_04__bxor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47437,7 +47437,7 @@ GrB_Info GB (_bind1st_tran__bxor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47458,7 +47458,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47553,7 +47553,7 @@ GrB_Info GB (_AemultB_02__bxor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47566,7 +47566,7 @@ GrB_Info GB (_AemultB_04__bxor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47601,7 +47601,7 @@ GrB_Info GB (_bind1st_tran__bxor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47622,7 +47622,7 @@ GrB_Info GB (_bind2nd_tran__bxor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47735,7 +47735,7 @@ GrB_Info GB (_AemultB_02__bxor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47748,7 +47748,7 @@ GrB_Info GB (_AemultB_04__bxor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47783,7 +47783,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47804,7 +47804,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47917,7 +47917,7 @@ GrB_Info GB (_AemultB_02__bxor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -47930,7 +47930,7 @@ GrB_Info GB (_AemultB_04__bxor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -47965,7 +47965,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -47986,7 +47986,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48099,7 +48099,7 @@ GrB_Info GB (_AemultB_02__bxor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48112,7 +48112,7 @@ GrB_Info GB (_AemultB_04__bxor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48147,7 +48147,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48168,7 +48168,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48281,7 +48281,7 @@ GrB_Info GB (_AemultB_02__bxor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48294,7 +48294,7 @@ GrB_Info GB (_AemultB_04__bxor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48329,7 +48329,7 @@ GrB_Info GB (_bind1st_tran__bxor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48350,7 +48350,7 @@ GrB_Info GB (_bind2nd_tran__bxor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48445,7 +48445,7 @@ GrB_Info GB (_AemultB_02__bxnor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48458,7 +48458,7 @@ GrB_Info GB (_AemultB_04__bxnor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48493,7 +48493,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48514,7 +48514,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48609,7 +48609,7 @@ GrB_Info GB (_AemultB_02__bxnor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48622,7 +48622,7 @@ GrB_Info GB (_AemultB_04__bxnor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48657,7 +48657,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48678,7 +48678,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48773,7 +48773,7 @@ GrB_Info GB (_AemultB_02__bxnor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48786,7 +48786,7 @@ GrB_Info GB (_AemultB_04__bxnor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48821,7 +48821,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48842,7 +48842,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -48937,7 +48937,7 @@ GrB_Info GB (_AemultB_02__bxnor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -48950,7 +48950,7 @@ GrB_Info GB (_AemultB_04__bxnor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -48985,7 +48985,7 @@ GrB_Info GB (_bind1st_tran__bxnor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49006,7 +49006,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49119,7 +49119,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -49132,7 +49132,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -49167,7 +49167,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49188,7 +49188,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49301,7 +49301,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -49314,7 +49314,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -49349,7 +49349,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49370,7 +49370,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49483,7 +49483,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -49496,7 +49496,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -49531,7 +49531,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49552,7 +49552,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49665,7 +49665,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -49678,7 +49678,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -49713,7 +49713,7 @@ GrB_Info GB (_bind1st_tran__bxnor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49734,7 +49734,7 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49829,7 +49829,7 @@ GrB_Info GB (_AemultB_02__bget_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -49843,7 +49843,7 @@ GrB_Info GB (_AemultB_03__bget_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -49856,7 +49856,7 @@ GrB_Info GB (_AemultB_04__bget_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -49891,7 +49891,7 @@ GrB_Info GB (_bind1st_tran__bget_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -49912,7 +49912,7 @@ GrB_Info GB (_bind2nd_tran__bget_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50007,7 +50007,7 @@ GrB_Info GB (_AemultB_02__bget_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50021,7 +50021,7 @@ GrB_Info GB (_AemultB_03__bget_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50034,7 +50034,7 @@ GrB_Info GB (_AemultB_04__bget_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50069,7 +50069,7 @@ GrB_Info GB (_bind1st_tran__bget_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50090,7 +50090,7 @@ GrB_Info GB (_bind2nd_tran__bget_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50185,7 +50185,7 @@ GrB_Info GB (_AemultB_02__bget_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50199,7 +50199,7 @@ GrB_Info GB (_AemultB_03__bget_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50212,7 +50212,7 @@ GrB_Info GB (_AemultB_04__bget_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50247,7 +50247,7 @@ GrB_Info GB (_bind1st_tran__bget_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50268,7 +50268,7 @@ GrB_Info GB (_bind2nd_tran__bget_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50363,7 +50363,7 @@ GrB_Info GB (_AemultB_02__bget_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50377,7 +50377,7 @@ GrB_Info GB (_AemultB_03__bget_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50390,7 +50390,7 @@ GrB_Info GB (_AemultB_04__bget_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50425,7 +50425,7 @@ GrB_Info GB (_bind1st_tran__bget_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50446,7 +50446,7 @@ GrB_Info GB (_bind2nd_tran__bget_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50541,7 +50541,7 @@ GrB_Info GB (_AemultB_02__bget_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50555,7 +50555,7 @@ GrB_Info GB (_AemultB_03__bget_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50568,7 +50568,7 @@ GrB_Info GB (_AemultB_04__bget_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50603,7 +50603,7 @@ GrB_Info GB (_bind1st_tran__bget_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50624,7 +50624,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50719,7 +50719,7 @@ GrB_Info GB (_AemultB_02__bget_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50733,7 +50733,7 @@ GrB_Info GB (_AemultB_03__bget_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50746,7 +50746,7 @@ GrB_Info GB (_AemultB_04__bget_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50781,7 +50781,7 @@ GrB_Info GB (_bind1st_tran__bget_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50802,7 +50802,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50897,7 +50897,7 @@ GrB_Info GB (_AemultB_02__bget_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -50911,7 +50911,7 @@ GrB_Info GB (_AemultB_03__bget_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -50924,7 +50924,7 @@ GrB_Info GB (_AemultB_04__bget_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -50959,7 +50959,7 @@ GrB_Info GB (_bind1st_tran__bget_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -50980,7 +50980,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51075,7 +51075,7 @@ GrB_Info GB (_AemultB_02__bget_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51089,7 +51089,7 @@ GrB_Info GB (_AemultB_03__bget_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51102,7 +51102,7 @@ GrB_Info GB (_AemultB_04__bget_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -51137,7 +51137,7 @@ GrB_Info GB (_bind1st_tran__bget_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51158,7 +51158,7 @@ GrB_Info GB (_bind2nd_tran__bget_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51253,7 +51253,7 @@ GrB_Info GB (_AemultB_02__bset_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51267,7 +51267,7 @@ GrB_Info GB (_AemultB_03__bset_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51280,7 +51280,7 @@ GrB_Info GB (_AemultB_04__bset_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -51315,7 +51315,7 @@ GrB_Info GB (_bind1st_tran__bset_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51336,7 +51336,7 @@ GrB_Info GB (_bind2nd_tran__bset_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51431,7 +51431,7 @@ GrB_Info GB (_AemultB_02__bset_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51445,7 +51445,7 @@ GrB_Info GB (_AemultB_03__bset_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51458,7 +51458,7 @@ GrB_Info GB (_AemultB_04__bset_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -51493,7 +51493,7 @@ GrB_Info GB (_bind1st_tran__bset_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51514,7 +51514,7 @@ GrB_Info GB (_bind2nd_tran__bset_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51609,7 +51609,7 @@ GrB_Info GB (_AemultB_02__bset_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51623,7 +51623,7 @@ GrB_Info GB (_AemultB_03__bset_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51636,7 +51636,7 @@ GrB_Info GB (_AemultB_04__bset_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -51671,7 +51671,7 @@ GrB_Info GB (_bind1st_tran__bset_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51692,7 +51692,7 @@ GrB_Info GB (_bind2nd_tran__bset_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51787,7 +51787,7 @@ GrB_Info GB (_AemultB_02__bset_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51801,7 +51801,7 @@ GrB_Info GB (_AemultB_03__bset_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51814,7 +51814,7 @@ GrB_Info GB (_AemultB_04__bset_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -51849,7 +51849,7 @@ GrB_Info GB (_bind1st_tran__bset_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51870,7 +51870,7 @@ GrB_Info GB (_bind2nd_tran__bset_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -51965,7 +51965,7 @@ GrB_Info GB (_AemultB_02__bset_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -51979,7 +51979,7 @@ GrB_Info GB (_AemultB_03__bset_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -51992,7 +51992,7 @@ GrB_Info GB (_AemultB_04__bset_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52027,7 +52027,7 @@ GrB_Info GB (_bind1st_tran__bset_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52048,7 +52048,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52143,7 +52143,7 @@ GrB_Info GB (_AemultB_02__bset_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -52157,7 +52157,7 @@ GrB_Info GB (_AemultB_03__bset_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -52170,7 +52170,7 @@ GrB_Info GB (_AemultB_04__bset_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52205,7 +52205,7 @@ GrB_Info GB (_bind1st_tran__bset_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52226,7 +52226,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52321,7 +52321,7 @@ GrB_Info GB (_AemultB_02__bset_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -52335,7 +52335,7 @@ GrB_Info GB (_AemultB_03__bset_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -52348,7 +52348,7 @@ GrB_Info GB (_AemultB_04__bset_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52383,7 +52383,7 @@ GrB_Info GB (_bind1st_tran__bset_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52404,7 +52404,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52499,7 +52499,7 @@ GrB_Info GB (_AemultB_02__bset_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -52513,7 +52513,7 @@ GrB_Info GB (_AemultB_03__bset_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -52526,7 +52526,7 @@ GrB_Info GB (_AemultB_04__bset_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52561,7 +52561,7 @@ GrB_Info GB (_bind1st_tran__bset_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52582,7 +52582,7 @@ GrB_Info GB (_bind2nd_tran__bset_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52677,7 +52677,7 @@ GrB_Info GB (_AemultB_02__bclr_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -52691,7 +52691,7 @@ GrB_Info GB (_AemultB_03__bclr_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -52704,7 +52704,7 @@ GrB_Info GB (_AemultB_04__bclr_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52739,7 +52739,7 @@ GrB_Info GB (_bind1st_tran__bclr_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52760,7 +52760,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52855,7 +52855,7 @@ GrB_Info GB (_AemultB_02__bclr_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -52869,7 +52869,7 @@ GrB_Info GB (_AemultB_03__bclr_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -52882,7 +52882,7 @@ GrB_Info GB (_AemultB_04__bclr_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -52917,7 +52917,7 @@ GrB_Info GB (_bind1st_tran__bclr_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -52938,7 +52938,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53033,7 +53033,7 @@ GrB_Info GB (_AemultB_02__bclr_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53047,7 +53047,7 @@ GrB_Info GB (_AemultB_03__bclr_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53060,7 +53060,7 @@ GrB_Info GB (_AemultB_04__bclr_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53095,7 +53095,7 @@ GrB_Info GB (_bind1st_tran__bclr_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53116,7 +53116,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53211,7 +53211,7 @@ GrB_Info GB (_AemultB_02__bclr_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53225,7 +53225,7 @@ GrB_Info GB (_AemultB_03__bclr_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53238,7 +53238,7 @@ GrB_Info GB (_AemultB_04__bclr_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53273,7 +53273,7 @@ GrB_Info GB (_bind1st_tran__bclr_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53294,7 +53294,7 @@ GrB_Info GB (_bind2nd_tran__bclr_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53389,7 +53389,7 @@ GrB_Info GB (_AemultB_02__bclr_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53403,7 +53403,7 @@ GrB_Info GB (_AemultB_03__bclr_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53416,7 +53416,7 @@ GrB_Info GB (_AemultB_04__bclr_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53451,7 +53451,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53472,7 +53472,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53567,7 +53567,7 @@ GrB_Info GB (_AemultB_02__bclr_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53581,7 +53581,7 @@ GrB_Info GB (_AemultB_03__bclr_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53594,7 +53594,7 @@ GrB_Info GB (_AemultB_04__bclr_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53629,7 +53629,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53650,7 +53650,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53745,7 +53745,7 @@ GrB_Info GB (_AemultB_02__bclr_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53759,7 +53759,7 @@ GrB_Info GB (_AemultB_03__bclr_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53772,7 +53772,7 @@ GrB_Info GB (_AemultB_04__bclr_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53807,7 +53807,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53828,7 +53828,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53923,7 +53923,7 @@ GrB_Info GB (_AemultB_02__bclr_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -53937,7 +53937,7 @@ GrB_Info GB (_AemultB_03__bclr_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -53950,7 +53950,7 @@ GrB_Info GB (_AemultB_04__bclr_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -53985,7 +53985,7 @@ GrB_Info GB (_bind1st_tran__bclr_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54006,7 +54006,7 @@ GrB_Info GB (_bind2nd_tran__bclr_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54101,7 +54101,7 @@ GrB_Info GB (_AemultB_02__bshift_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -54115,7 +54115,7 @@ GrB_Info GB (_AemultB_03__bshift_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -54128,7 +54128,7 @@ GrB_Info GB (_AemultB_04__bshift_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -54163,7 +54163,7 @@ GrB_Info GB (_bind1st_tran__bshift_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54184,7 +54184,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54279,7 +54279,7 @@ GrB_Info GB (_AemultB_02__bshift_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -54293,7 +54293,7 @@ GrB_Info GB (_AemultB_03__bshift_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -54306,7 +54306,7 @@ GrB_Info GB (_AemultB_04__bshift_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -54341,7 +54341,7 @@ GrB_Info GB (_bind1st_tran__bshift_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54362,7 +54362,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54457,7 +54457,7 @@ GrB_Info GB (_AemultB_02__bshift_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -54471,7 +54471,7 @@ GrB_Info GB (_AemultB_03__bshift_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -54484,7 +54484,7 @@ GrB_Info GB (_AemultB_04__bshift_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -54519,7 +54519,7 @@ GrB_Info GB (_bind1st_tran__bshift_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54540,7 +54540,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54635,7 +54635,7 @@ GrB_Info GB (_AemultB_02__bshift_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -54649,7 +54649,7 @@ GrB_Info GB (_AemultB_03__bshift_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -54662,7 +54662,7 @@ GrB_Info GB (_AemultB_04__bshift_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -54697,7 +54697,7 @@ GrB_Info GB (_bind1st_tran__bshift_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54718,7 +54718,7 @@ GrB_Info GB (_bind2nd_tran__bshift_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54813,7 +54813,7 @@ GrB_Info GB (_AemultB_02__bshift_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -54827,7 +54827,7 @@ GrB_Info GB (_AemultB_03__bshift_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -54840,7 +54840,7 @@ GrB_Info GB (_AemultB_04__bshift_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -54875,7 +54875,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54896,7 +54896,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -54991,7 +54991,7 @@ GrB_Info GB (_AemultB_02__bshift_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55005,7 +55005,7 @@ GrB_Info GB (_AemultB_03__bshift_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55018,7 +55018,7 @@ GrB_Info GB (_AemultB_04__bshift_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55053,7 +55053,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55074,7 +55074,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55169,7 +55169,7 @@ GrB_Info GB (_AemultB_02__bshift_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55183,7 +55183,7 @@ GrB_Info GB (_AemultB_03__bshift_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55196,7 +55196,7 @@ GrB_Info GB (_AemultB_04__bshift_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55231,7 +55231,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55252,7 +55252,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55347,7 +55347,7 @@ GrB_Info GB (_AemultB_02__bshift_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55361,7 +55361,7 @@ GrB_Info GB (_AemultB_03__bshift_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55374,7 +55374,7 @@ GrB_Info GB (_AemultB_04__bshift_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55409,7 +55409,7 @@ GrB_Info GB (_bind1st_tran__bshift_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55430,7 +55430,7 @@ GrB_Info GB (_bind2nd_tran__bshift_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55525,7 +55525,7 @@ GrB_Info GB (_AemultB_02__pow_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55539,7 +55539,7 @@ GrB_Info GB (_AemultB_03__pow_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55552,7 +55552,7 @@ GrB_Info GB (_AemultB_04__pow_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55587,7 +55587,7 @@ GrB_Info GB (_bind1st_tran__pow_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55608,7 +55608,7 @@ GrB_Info GB (_bind2nd_tran__pow_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55703,7 +55703,7 @@ GrB_Info GB (_AemultB_02__pow_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55717,7 +55717,7 @@ GrB_Info GB (_AemultB_03__pow_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55730,7 +55730,7 @@ GrB_Info GB (_AemultB_04__pow_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55765,7 +55765,7 @@ GrB_Info GB (_bind1st_tran__pow_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55786,7 +55786,7 @@ GrB_Info GB (_bind2nd_tran__pow_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55881,7 +55881,7 @@ GrB_Info GB (_AemultB_02__pow_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -55895,7 +55895,7 @@ GrB_Info GB (_AemultB_03__pow_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -55908,7 +55908,7 @@ GrB_Info GB (_AemultB_04__pow_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -55943,7 +55943,7 @@ GrB_Info GB (_bind1st_tran__pow_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -55964,7 +55964,7 @@ GrB_Info GB (_bind2nd_tran__pow_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56059,7 +56059,7 @@ GrB_Info GB (_AemultB_02__pow_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56073,7 +56073,7 @@ GrB_Info GB (_AemultB_03__pow_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56086,7 +56086,7 @@ GrB_Info GB (_AemultB_04__pow_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -56121,7 +56121,7 @@ GrB_Info GB (_bind1st_tran__pow_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56142,7 +56142,7 @@ GrB_Info GB (_bind2nd_tran__pow_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56237,7 +56237,7 @@ GrB_Info GB (_AemultB_02__pow_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56251,7 +56251,7 @@ GrB_Info GB (_AemultB_03__pow_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56264,7 +56264,7 @@ GrB_Info GB (_AemultB_04__pow_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -56299,7 +56299,7 @@ GrB_Info GB (_bind1st_tran__pow_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56320,7 +56320,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56415,7 +56415,7 @@ GrB_Info GB (_AemultB_02__pow_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56429,7 +56429,7 @@ GrB_Info GB (_AemultB_03__pow_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56442,7 +56442,7 @@ GrB_Info GB (_AemultB_04__pow_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -56477,7 +56477,7 @@ GrB_Info GB (_bind1st_tran__pow_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56498,7 +56498,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56593,7 +56593,7 @@ GrB_Info GB (_AemultB_02__pow_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56607,7 +56607,7 @@ GrB_Info GB (_AemultB_03__pow_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56620,7 +56620,7 @@ GrB_Info GB (_AemultB_04__pow_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -56655,7 +56655,7 @@ GrB_Info GB (_bind1st_tran__pow_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56676,7 +56676,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56771,7 +56771,7 @@ GrB_Info GB (_AemultB_02__pow_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56785,7 +56785,7 @@ GrB_Info GB (_AemultB_03__pow_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56798,7 +56798,7 @@ GrB_Info GB (_AemultB_04__pow_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -56833,7 +56833,7 @@ GrB_Info GB (_bind1st_tran__pow_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56854,7 +56854,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -56949,7 +56949,7 @@ GrB_Info GB (_AemultB_02__pow_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -56963,7 +56963,7 @@ GrB_Info GB (_AemultB_03__pow_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -56976,7 +56976,7 @@ GrB_Info GB (_AemultB_04__pow_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -57011,7 +57011,7 @@ GrB_Info GB (_bind1st_tran__pow_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57032,7 +57032,7 @@ GrB_Info GB (_bind2nd_tran__pow_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57127,7 +57127,7 @@ GrB_Info GB (_AemultB_02__pow_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -57141,7 +57141,7 @@ GrB_Info GB (_AemultB_03__pow_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -57154,7 +57154,7 @@ GrB_Info GB (_AemultB_04__pow_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -57189,7 +57189,7 @@ GrB_Info GB (_bind1st_tran__pow_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57210,7 +57210,7 @@ GrB_Info GB (_bind2nd_tran__pow_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57305,7 +57305,7 @@ GrB_Info GB (_AemultB_02__pow_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -57319,7 +57319,7 @@ GrB_Info GB (_AemultB_03__pow_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -57332,7 +57332,7 @@ GrB_Info GB (_AemultB_04__pow_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -57367,7 +57367,7 @@ GrB_Info GB (_bind1st_tran__pow_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57388,7 +57388,7 @@ GrB_Info GB (_bind2nd_tran__pow_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57483,7 +57483,7 @@ GrB_Info GB (_AemultB_02__pow_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -57497,7 +57497,7 @@ GrB_Info GB (_AemultB_03__pow_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -57510,7 +57510,7 @@ GrB_Info GB (_AemultB_04__pow_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -57545,7 +57545,7 @@ GrB_Info GB (_bind1st_tran__pow_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -57566,7 +57566,7 @@ GrB_Info GB (_bind2nd_tran__pow_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_bool.c b/GraphBLAS/FactoryKernels/GB_ew__land_bool.c index e9b302066e..4621ecfa47 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_BOOL) || defined(GxB_NO_LAND_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__land_fp32.c index e5da632c7a..afd4a2d039 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_FP32) || defined(GxB_NO_LAND_FP32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__land_fp64.c index 6e1f2908db..26f66fd756 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_FP64) || defined(GxB_NO_LAND_FP64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_int16.c b/GraphBLAS/FactoryKernels/GB_ew__land_int16.c index a25a084f9a..0fe2b8046f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_INT16) || defined(GxB_NO_LAND_INT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_int32.c b/GraphBLAS/FactoryKernels/GB_ew__land_int32.c index b711a2bf36..49dd883dcc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_INT32) || defined(GxB_NO_LAND_INT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_int64.c b/GraphBLAS/FactoryKernels/GB_ew__land_int64.c index 505617f2b9..1f23fd2d32 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_INT64) || defined(GxB_NO_LAND_INT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_int8.c b/GraphBLAS/FactoryKernels/GB_ew__land_int8.c index 56e896463d..f744945cc0 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_INT8) || defined(GxB_NO_LAND_INT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__land_uint16.c index df80e60763..60d6fe727e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_UINT16) || defined(GxB_NO_LAND_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__land_uint32.c index c9eb188f60..b8a8ea720b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_UINT32) || defined(GxB_NO_LAND_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__land_uint64.c index c33424440f..2314b464be 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_UINT64) || defined(GxB_NO_LAND_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__land_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__land_uint8.c index 0a94570e06..2afd8f8d9a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__land_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__land_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_UINT8) || defined(GxB_NO_LAND_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__land_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__land_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__land_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__land_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__land_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__land_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__land_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp32.c index 94bb3f5f32..a638ec20d3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LDEXP) || defined(GxB_NO_FP32) || defined(GxB_NO_LDEXP_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp64.c index 0a65c7f966..eaad21c1f9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ldexp_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LDEXP) || defined(GxB_NO_FP64) || defined(GxB_NO_LDEXP_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__ldexp_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_bool.c b/GraphBLAS/FactoryKernels/GB_ew__le_bool.c index 8c6c38994e..f62e01d59e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_BOOL) || defined(GxB_NO_LE_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__le_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__le_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__le_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -392,7 +393,7 @@ GrB_Info GB (_bind1st_tran__le_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -403,6 +404,7 @@ GrB_Info GB (_bind1st_tran__le_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -427,7 +429,7 @@ GrB_Info GB (_bind2nd_tran__le_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -437,10 +439,13 @@ GrB_Info GB (_bind2nd_tran__le_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__le_fp32.c index 74a6771734..ddcb16420d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_FP32) || defined(GxB_NO_LE_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__le_fp64.c index 8d8081a45d..91cc3cd523 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_FP64) || defined(GxB_NO_LE_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_int16.c b/GraphBLAS/FactoryKernels/GB_ew__le_int16.c index 0fdda64108..f40f2f3ea2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_INT16) || defined(GxB_NO_LE_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_int32.c b/GraphBLAS/FactoryKernels/GB_ew__le_int32.c index 9aa74dade3..6c51b66ab7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_INT32) || defined(GxB_NO_LE_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_int64.c b/GraphBLAS/FactoryKernels/GB_ew__le_int64.c index 6a76b1c61c..9e19120037 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_INT64) || defined(GxB_NO_LE_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_int8.c b/GraphBLAS/FactoryKernels/GB_ew__le_int8.c index 7871509d4d..46636dbd6c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_INT8) || defined(GxB_NO_LE_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__le_uint16.c index 1335d1c6e6..54ef79e179 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_UINT16) || defined(GxB_NO_LE_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__le_uint32.c index 50ba6c2044..616f5e7697 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_UINT32) || defined(GxB_NO_LE_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__le_uint64.c index 2c8654306c..d2c546d09d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_UINT64) || defined(GxB_NO_LE_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__le_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__le_uint8.c index df6431fced..c0574260fb 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__le_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__le_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LE) || defined(GxB_NO_UINT8) || defined(GxB_NO_LE_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__le_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__le_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__le_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__le_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__le_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__le_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__le_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_bool.c b/GraphBLAS/FactoryKernels/GB_ew__lor_bool.c index 1ecea612d3..51b8e91836 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_BOOL) || defined(GxB_NO_LOR_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__lor_fp32.c index 09c6bc6554..922668d8ba 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_FP32) || defined(GxB_NO_LOR_FP32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__lor_fp64.c index e042c289e8..f272a01ba9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_FP64) || defined(GxB_NO_LOR_FP64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_int16.c b/GraphBLAS/FactoryKernels/GB_ew__lor_int16.c index 84bcbe1f23..ee5dcdd2c1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_INT16) || defined(GxB_NO_LOR_INT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_int32.c b/GraphBLAS/FactoryKernels/GB_ew__lor_int32.c index b93d5962d9..09303daedf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_INT32) || defined(GxB_NO_LOR_INT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_int64.c b/GraphBLAS/FactoryKernels/GB_ew__lor_int64.c index ae3db5c954..63130f2a0e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_INT64) || defined(GxB_NO_LOR_INT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_int8.c b/GraphBLAS/FactoryKernels/GB_ew__lor_int8.c index 2909f3ab03..9168a81200 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_INT8) || defined(GxB_NO_LOR_INT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__lor_uint16.c index fac0c8f217..bcfccfb747 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_UINT16) || defined(GxB_NO_LOR_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__lor_uint32.c index 8f50715989..acb4a32f39 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_UINT32) || defined(GxB_NO_LOR_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__lor_uint64.c index 151bf6848b..3ee02fb1bc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_UINT64) || defined(GxB_NO_LOR_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lor_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__lor_uint8.c index 8f7850a4ee..3ee4eb7f26 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lor_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_UINT8) || defined(GxB_NO_LOR_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lor_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lor_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_bool.c b/GraphBLAS/FactoryKernels/GB_ew__lt_bool.c index 021d1b6a99..66b71467a0 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_BOOL) || defined(GxB_NO_LT_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -265,7 +266,7 @@ GrB_Info GB (_AemultB_03__lt_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -290,7 +291,7 @@ GrB_Info GB (_AemultB_04__lt_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -392,7 +393,7 @@ GrB_Info GB (_bind1st_tran__lt_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -403,6 +404,7 @@ GrB_Info GB (_bind1st_tran__lt_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -427,7 +429,7 @@ GrB_Info GB (_bind2nd_tran__lt_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -437,10 +439,13 @@ GrB_Info GB (_bind2nd_tran__lt_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__lt_fp32.c index 0af17da183..8ea4142f1b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_FP32) || defined(GxB_NO_LT_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__lt_fp64.c index a2d6351e7f..b7d2cec4e5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_FP64) || defined(GxB_NO_LT_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_int16.c b/GraphBLAS/FactoryKernels/GB_ew__lt_int16.c index cd0464d266..a0c4f9fbfd 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_INT16) || defined(GxB_NO_LT_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_int32.c b/GraphBLAS/FactoryKernels/GB_ew__lt_int32.c index a69f662096..6f43be43ee 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_INT32) || defined(GxB_NO_LT_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_int64.c b/GraphBLAS/FactoryKernels/GB_ew__lt_int64.c index ee8427ad01..9480e65cac 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_INT64) || defined(GxB_NO_LT_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_int8.c b/GraphBLAS/FactoryKernels/GB_ew__lt_int8.c index 2cc972ef79..3cb4b120c5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_INT8) || defined(GxB_NO_LT_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__lt_uint16.c index dadc4ec616..67518dfcc9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_UINT16) || defined(GxB_NO_LT_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__lt_uint32.c index b3e0b2b9ee..539d45c37d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_UINT32) || defined(GxB_NO_LT_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__lt_uint64.c index c13868fb89..833cb0ea32 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_UINT64) || defined(GxB_NO_LT_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lt_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__lt_uint8.c index fc41a59318..cb50bf4fce 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lt_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lt_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LT) || defined(GxB_NO_UINT8) || defined(GxB_NO_LT_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__lt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -268,7 +268,7 @@ GrB_Info GB (_AemultB_03__lt_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -293,7 +293,7 @@ GrB_Info GB (_AemultB_04__lt_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -395,7 +395,7 @@ GrB_Info GB (_bind1st_tran__lt_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -406,6 +406,7 @@ GrB_Info GB (_bind1st_tran__lt_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -430,7 +431,7 @@ GrB_Info GB (_bind2nd_tran__lt_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -440,10 +441,13 @@ GrB_Info GB (_bind2nd_tran__lt_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_bool.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_bool.c index 4d59537a0f..3e78478df1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_BOOL) || defined(GxB_NO_LXOR_BOOL)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_bool) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_bool) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_bool) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_bool) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_fp32.c index 56ebcab9fe..3cf3d05185 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_FP32) || defined(GxB_NO_LXOR_FP32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_fp64.c index 7acc184e9e..eb19b89068 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_FP64) || defined(GxB_NO_LXOR_FP64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_int16.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_int16.c index dbee985210..4a4a274593 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_INT16) || defined(GxB_NO_LXOR_INT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_int32.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_int32.c index 954bb2263a..e0cd83f581 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_INT32) || defined(GxB_NO_LXOR_INT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_int64.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_int64.c index c49eec7a62..47636cd7cf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_INT64) || defined(GxB_NO_LXOR_INT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_int8.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_int8.c index 0c868518f7..23e18f53aa 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_INT8) || defined(GxB_NO_LXOR_INT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint16.c index 69463db3a2..ffd41105b9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_UINT16) || defined(GxB_NO_LXOR_UINT16)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint32.c index 9020b6b5df..109a0de337 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_UINT32) || defined(GxB_NO_LXOR_UINT32)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint64.c index 27bf2a6160..1cec4ad3cc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_UINT64) || defined(GxB_NO_LXOR_UINT64)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint8.c index 80fe2e9a56..ad8a8b3770 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__lxor_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__lxor_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_UINT8) || defined(GxB_NO_LXOR_UINT8)) #define GB_DISABLE 1 @@ -222,7 +223,7 @@ GrB_Info GB (_AemultB_08__lxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -239,7 +240,7 @@ GrB_Info GB (_AemultB_02__lxor_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -264,7 +265,7 @@ GrB_Info GB (_AemultB_04__lxor_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -366,7 +367,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -377,6 +378,7 @@ GrB_Info GB (_bind1st_tran__lxor_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -401,7 +403,7 @@ GrB_Info GB (_bind2nd_tran__lxor_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -411,10 +413,13 @@ GrB_Info GB (_bind2nd_tran__lxor_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__max_fp32.c index 2ff172b6a6..9388398288 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_FP32) || defined(GxB_NO_MAX_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__max_fp64.c index 103e51c153..e5e781bb05 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_FP64) || defined(GxB_NO_MAX_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_int16.c b/GraphBLAS/FactoryKernels/GB_ew__max_int16.c index 2b7f501a1f..6fc0469942 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT16) || defined(GxB_NO_MAX_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_int32.c b/GraphBLAS/FactoryKernels/GB_ew__max_int32.c index 2d796c54db..31f5db2084 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT32) || defined(GxB_NO_MAX_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_int64.c b/GraphBLAS/FactoryKernels/GB_ew__max_int64.c index 34d42e6016..cbb338f359 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT64) || defined(GxB_NO_MAX_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_int8.c b/GraphBLAS/FactoryKernels/GB_ew__max_int8.c index 49faecab1b..e91df5a2ea 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT8) || defined(GxB_NO_MAX_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__max_uint16.c index 5dce9f3e8d..e326e03b2a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT16) || defined(GxB_NO_MAX_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__max_uint32.c index 7a092c9533..8c5d9e3ecf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT32) || defined(GxB_NO_MAX_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__max_uint64.c index b918d20f00..4c4984f2d3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT64) || defined(GxB_NO_MAX_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__max_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__max_uint8.c index beb8090eb5..78b5b84c8e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__max_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT8) || defined(GxB_NO_MAX_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__max_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__max_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__max_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__max_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__max_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__max_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__min_fp32.c index 9c4ddd8448..3a9fcb52f1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_FP32) || defined(GxB_NO_MIN_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__min_fp64.c index da061bbb13..c8774efd8a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_FP64) || defined(GxB_NO_MIN_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_int16.c b/GraphBLAS/FactoryKernels/GB_ew__min_int16.c index 8b3f692e12..17f2ec0faf 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT16) || defined(GxB_NO_MIN_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_int32.c b/GraphBLAS/FactoryKernels/GB_ew__min_int32.c index cd7eb6e64f..98e9940183 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT32) || defined(GxB_NO_MIN_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_int64.c b/GraphBLAS/FactoryKernels/GB_ew__min_int64.c index 0e05370f33..4a0ec34cdc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT64) || defined(GxB_NO_MIN_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_int8.c b/GraphBLAS/FactoryKernels/GB_ew__min_int8.c index fade4a488d..9cf223c38d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT8) || defined(GxB_NO_MIN_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__min_uint16.c index 309db8e00d..5dea5be915 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT16) || defined(GxB_NO_MIN_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__min_uint32.c index 410abdf1ff..776ef3f969 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT32) || defined(GxB_NO_MIN_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__min_uint64.c index 90c739f634..6a8c19ecfd 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT64) || defined(GxB_NO_MIN_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__min_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__min_uint8.c index 3849cf2201..5aa566a2a3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__min_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT8) || defined(GxB_NO_MIN_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__min_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__min_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__min_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__min_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__min_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__min_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__minus_fc32.c index 15d49f8ae1..f4750ac810 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_FC32) || defined(GxB_NO_MINUS_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__minus_fc64.c index fc0d7691ab..fcd167199a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_FC64) || defined(GxB_NO_MINUS_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__minus_fp32.c index 98ed119300..38cd386e8e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_FP32) || defined(GxB_NO_MINUS_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__minus_fp64.c index c9243f3630..33c05b90c7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_FP64) || defined(GxB_NO_MINUS_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_int16.c b/GraphBLAS/FactoryKernels/GB_ew__minus_int16.c index e54ae0d1bc..3f153e4af8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_INT16) || defined(GxB_NO_MINUS_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_int32.c b/GraphBLAS/FactoryKernels/GB_ew__minus_int32.c index 18f67c9069..cf8d4a3bb3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_INT32) || defined(GxB_NO_MINUS_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_int64.c b/GraphBLAS/FactoryKernels/GB_ew__minus_int64.c index 6a13a33053..063aa034ed 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_INT64) || defined(GxB_NO_MINUS_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_int8.c b/GraphBLAS/FactoryKernels/GB_ew__minus_int8.c index bd6d7e36a7..4abf39b7d4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_INT8) || defined(GxB_NO_MINUS_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__minus_uint16.c index fa612c682d..a967488d06 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_UINT16) || defined(GxB_NO_MINUS_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__minus_uint32.c index b1e0950398..15760e7ac8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_UINT32) || defined(GxB_NO_MINUS_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__minus_uint64.c index c0fec09765..0a075a3fba 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_UINT64) || defined(GxB_NO_MINUS_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__minus_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__minus_uint8.c index 904e44b00a..e14c2ed686 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__minus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__minus_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MINUS) || defined(GxB_NO_UINT8) || defined(GxB_NO_MINUS_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__minus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__minus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__minus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__minus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__minus_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__minus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__minus_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__ne_fc32.c index a5c5029a31..1603980c6f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = (GB_crealf (Bx [(B_iso) ? 0 : (pB)]) != 0) || (GB_cimagf (Bx [(B_iso) ? 0 : (pB)]) != 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_FC32) || defined(GxB_NO_NE_FC32)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__ne_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__ne_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -226,7 +226,7 @@ GrB_Info GB (_AemultB_04__ne_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -328,7 +328,7 @@ GrB_Info GB (_bind1st_tran__ne_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -339,6 +339,7 @@ GrB_Info GB (_bind1st_tran__ne_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -363,7 +364,7 @@ GrB_Info GB (_bind2nd_tran__ne_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -373,10 +374,13 @@ GrB_Info GB (_bind2nd_tran__ne_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__ne_fc64.c index c7aacbee3f..0b2d9d21fe 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -45,6 +44,7 @@ #define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = (GB_creal (Bx [(B_iso) ? 0 : (pB)]) != 0) || (GB_cimag (Bx [(B_iso) ? 0 : (pB)]) != 0) #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_FC64) || defined(GxB_NO_NE_FC64)) @@ -184,7 +184,7 @@ GrB_Info GB (_AemultB_08__ne_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +201,7 @@ GrB_Info GB (_AemultB_02__ne_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -226,7 +226,7 @@ GrB_Info GB (_AemultB_04__ne_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -328,7 +328,7 @@ GrB_Info GB (_bind1st_tran__ne_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -339,6 +339,7 @@ GrB_Info GB (_bind1st_tran__ne_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -363,7 +364,7 @@ GrB_Info GB (_bind2nd_tran__ne_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -373,10 +374,13 @@ GrB_Info GB (_bind2nd_tran__ne_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__ne_fp32.c index c4c4a82eae..3fb50aab1e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_FP32) || defined(GxB_NO_NE_FP32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__ne_fp64.c index 553e81f4a2..f6012ad1d5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_FP64) || defined(GxB_NO_NE_FP64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_int16.c b/GraphBLAS/FactoryKernels/GB_ew__ne_int16.c index 72806b313c..b663c62c35 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_INT16) || defined(GxB_NO_NE_INT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_int32.c b/GraphBLAS/FactoryKernels/GB_ew__ne_int32.c index 84265d7849..4a898712d5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_INT32) || defined(GxB_NO_NE_INT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_int64.c b/GraphBLAS/FactoryKernels/GB_ew__ne_int64.c index 8d4dea0278..9c2899af44 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_INT64) || defined(GxB_NO_NE_INT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_int8.c b/GraphBLAS/FactoryKernels/GB_ew__ne_int8.c index 3009af41ad..73941f5f24 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_INT8) || defined(GxB_NO_NE_INT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__ne_uint16.c index 6c065f5eaf..4f19019365 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_UINT16) || defined(GxB_NO_NE_UINT16)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__ne_uint32.c index c71596b226..a544525c68 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_UINT32) || defined(GxB_NO_NE_UINT32)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__ne_uint64.c index f90250a8b8..0504496a96 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_UINT64) || defined(GxB_NO_NE_UINT64)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__ne_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__ne_uint8.c index 6cb2ba2eab..656e4134b4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__ne_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__ne_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -44,6 +43,7 @@ #define GB_CTYPE_IS_ATYPE 0 #define GB_CTYPE_IS_BTYPE 0 +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_NE) || defined(GxB_NO_UINT8) || defined(GxB_NO_NE_UINT8)) @@ -225,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_02__ne_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -267,7 +267,7 @@ GrB_Info GB (_AemultB_04__ne_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -369,7 +369,7 @@ GrB_Info GB (_bind1st_tran__ne_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -380,6 +380,7 @@ GrB_Info GB (_bind1st_tran__ne_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -404,7 +405,7 @@ GrB_Info GB (_bind2nd_tran__ne_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -414,10 +415,13 @@ GrB_Info GB (_bind2nd_tran__ne_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_bool.c b/GraphBLAS/FactoryKernels/GB_ew__pair_bool.c index ac1de284dc..3088fa3851 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_BOOL) || defined(GxB_NO_PAIR_BOOL)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_bool) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__pair_fc32.c index c5ecdcc294..b490aacede 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_FC32) || defined(GxB_NO_PAIR_FC32)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_fc32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__pair_fc64.c index ff826791c0..8183a95936 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_FC64) || defined(GxB_NO_PAIR_FC64)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_fc64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__pair_fp32.c index fce880a5c1..a1e48a62c8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_FP32) || defined(GxB_NO_PAIR_FP32)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_fp32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__pair_fp64.c index be64057ba1..33f0bc8eef 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_FP64) || defined(GxB_NO_PAIR_FP64)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_fp64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_int16.c b/GraphBLAS/FactoryKernels/GB_ew__pair_int16.c index a2f6b3c442..d6f5f65b5f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_INT16) || defined(GxB_NO_PAIR_INT16)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_int16) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_int32.c b/GraphBLAS/FactoryKernels/GB_ew__pair_int32.c index f30b2ef309..30eb13895a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_INT32) || defined(GxB_NO_PAIR_INT32)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_int32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_int64.c b/GraphBLAS/FactoryKernels/GB_ew__pair_int64.c index 3eb3d7ed41..57961c5c67 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_INT64) || defined(GxB_NO_PAIR_INT64)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_int64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_int8.c b/GraphBLAS/FactoryKernels/GB_ew__pair_int8.c index bd505dcdf9..3299db09c7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_INT8) || defined(GxB_NO_PAIR_INT8)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_int8) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__pair_uint16.c index f376dbf297..db1bd4c229 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_UINT16) || defined(GxB_NO_PAIR_UINT16)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_uint16) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__pair_uint32.c index c96e099f18..8b605e09df 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_UINT32) || defined(GxB_NO_PAIR_UINT32)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_uint32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__pair_uint64.c index 2f6bbebdd6..4c0a5dae91 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_UINT64) || defined(GxB_NO_PAIR_UINT64)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_uint64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pair_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__pair_uint8.c index a47a12b3c6..019f3eae58 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pair_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pair_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PAIR) || defined(GxB_NO_UINT8) || defined(GxB_NO_PAIR_UINT8)) #define GB_DISABLE 1 @@ -114,5 +115,7 @@ GrB_Info GB (_AaddB__pair_uint8) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__plus_fc32.c index 7db4d22892..d881191adc 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FC32) || defined(GxB_NO_PLUS_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__plus_fc64.c index 3dfb66bf88..6d032ecdb2 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FC64) || defined(GxB_NO_PLUS_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__plus_fp32.c index 869020d722..bf03044422 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FP32) || defined(GxB_NO_PLUS_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__plus_fp64.c index 16d21d1f46..6bcc5dbf68 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FP64) || defined(GxB_NO_PLUS_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_int16.c b/GraphBLAS/FactoryKernels/GB_ew__plus_int16.c index 6c19d808a2..dbdfc85eb4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT16) || defined(GxB_NO_PLUS_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_int32.c b/GraphBLAS/FactoryKernels/GB_ew__plus_int32.c index 3c382de53d..0eb4b3712d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT32) || defined(GxB_NO_PLUS_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_int64.c b/GraphBLAS/FactoryKernels/GB_ew__plus_int64.c index 546920109b..2f4b29bb97 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT64) || defined(GxB_NO_PLUS_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_int8.c b/GraphBLAS/FactoryKernels/GB_ew__plus_int8.c index c17db371b2..812283ac94 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT8) || defined(GxB_NO_PLUS_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__plus_uint16.c index 2011ba0cd5..4a8967ec03 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT16) || defined(GxB_NO_PLUS_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__plus_uint32.c index 3dca91b1d5..6c8ce59a2c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT32) || defined(GxB_NO_PLUS_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__plus_uint64.c index f9dc55ef5e..08fd60fd2a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT64) || defined(GxB_NO_PLUS_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__plus_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__plus_uint8.c index 73c4d67f40..daed898e4b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__plus_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT8) || defined(GxB_NO_PLUS_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__plus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__plus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__plus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__plus_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__plus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__plus_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__pow_fc32.c index e75a594249..deb637075b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_FC32) || defined(GxB_NO_POW_FC32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__pow_fc64.c index 4f9c56de5f..7f07bcf586 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_FC64) || defined(GxB_NO_POW_FC64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__pow_fp32.c index fae64f6b87..981a007cbb 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_FP32) || defined(GxB_NO_POW_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__pow_fp64.c index 0c483ef4c0..fb795e903c 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_FP64) || defined(GxB_NO_POW_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_int16.c b/GraphBLAS/FactoryKernels/GB_ew__pow_int16.c index 0136dd0344..14a72309da 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_INT16) || defined(GxB_NO_POW_INT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_int32.c b/GraphBLAS/FactoryKernels/GB_ew__pow_int32.c index d82b7f7665..64c3a8dfab 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_INT32) || defined(GxB_NO_POW_INT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_int64.c b/GraphBLAS/FactoryKernels/GB_ew__pow_int64.c index 385e3a507c..cc6144b1a5 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_INT64) || defined(GxB_NO_POW_INT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_int8.c b/GraphBLAS/FactoryKernels/GB_ew__pow_int8.c index e27a37d43a..fa037ffec1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_INT8) || defined(GxB_NO_POW_INT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__pow_uint16.c index 0a5820fab2..d1ccca3918 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_UINT16) || defined(GxB_NO_POW_UINT16)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__pow_uint32.c index 2d3a8981f3..4a27b7e50d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_UINT32) || defined(GxB_NO_POW_UINT32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__pow_uint64.c index 02638d59d2..8e8b595142 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_UINT64) || defined(GxB_NO_POW_UINT64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__pow_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__pow_uint8.c index ee63e0c4ce..d6758ddde3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__pow_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__pow_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_POW) || defined(GxB_NO_UINT8) || defined(GxB_NO_POW_UINT8)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__pow_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__pow_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__pow_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__pow_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__pow_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__pow_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__pow_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc32.c index 15c9a4404c..892c5a9642 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_FC32) || defined(GxB_NO_RDIV_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc64.c index eb9ac11ffe..6e618c6c05 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_FC64) || defined(GxB_NO_RDIV_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp32.c index 3c402b18cc..9f9df86723 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_FP32) || defined(GxB_NO_RDIV_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp64.c index b27b1e72b4..70d0bfe7d4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_FP64) || defined(GxB_NO_RDIV_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int16.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int16.c index ef8b4cd4a4..483b537039 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_INT16) || defined(GxB_NO_RDIV_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int32.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int32.c index d8d6e99981..a94c3c2609 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_INT32) || defined(GxB_NO_RDIV_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int64.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int64.c index 4d974a5d4b..a746a3619f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_INT64) || defined(GxB_NO_RDIV_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int8.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int8.c index 8fb4ce5e2f..53b3f78638 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_INT8) || defined(GxB_NO_RDIV_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint16.c index abb554ee90..d48b2a6d8d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_UINT16) || defined(GxB_NO_RDIV_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint32.c index 55d9f34302..d0e48f575d 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_UINT32) || defined(GxB_NO_RDIV_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint64.c index 3f9f0ad2d2..891305d9b3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_UINT64) || defined(GxB_NO_RDIV_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint8.c index 35bfca3b14..4996432706 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rdiv_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RDIV) || defined(GxB_NO_UINT8) || defined(GxB_NO_RDIV_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rdiv_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__remainder_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__remainder_fp32.c index ed7b75c2c5..024d7bfd06 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__remainder_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__remainder_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_REMAINDER) || defined(GxB_NO_FP32) || defined(GxB_NO_REMAINDER_FP32)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__remainder_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__remainder_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__remainder_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__remainder_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__remainder_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__remainder_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__remainder_fp64.c index 86a4ac6db4..ad3571bf76 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__remainder_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__remainder_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_REMAINDER) || defined(GxB_NO_FP64) || defined(GxB_NO_REMAINDER_FP64)) #define GB_DISABLE 1 @@ -180,7 +181,7 @@ GrB_Info GB (_AemultB_08__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -197,7 +198,7 @@ GrB_Info GB (_AemultB_02__remainder_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_03__remainder_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -248,7 +249,7 @@ GrB_Info GB (_AemultB_04__remainder_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -350,7 +351,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -361,6 +362,7 @@ GrB_Info GB (_bind1st_tran__remainder_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -385,7 +387,7 @@ GrB_Info GB (_bind2nd_tran__remainder_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -395,10 +397,13 @@ GrB_Info GB (_bind2nd_tran__remainder_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_fc32.c index 671a571377..6542af6fd8 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_FC32) || defined(GxB_NO_RMINUS_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_fc64.c index ad9ea9fe1d..2aad303b4e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_FC64) || defined(GxB_NO_RMINUS_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_fp32.c index 218521615e..b20696980b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_FP32) || defined(GxB_NO_RMINUS_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_fp64.c index 4137a9e147..139fd96a64 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_FP64) || defined(GxB_NO_RMINUS_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_int16.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_int16.c index 9e30a452b8..4b26b4bf40 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_INT16) || defined(GxB_NO_RMINUS_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_int32.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_int32.c index 5e310df533..7959443625 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_INT32) || defined(GxB_NO_RMINUS_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_int64.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_int64.c index 995455f25f..ea7c6a0d49 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_INT64) || defined(GxB_NO_RMINUS_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_int8.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_int8.c index 311da8339f..96170644f3 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_INT8) || defined(GxB_NO_RMINUS_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint16.c index 847ce570f6..668a8e595f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_UINT16) || defined(GxB_NO_RMINUS_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint32.c index ed422d9226..f6a0a422ac 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_UINT32) || defined(GxB_NO_RMINUS_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint64.c index b614e0fe5a..9b53276ba9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_UINT64) || defined(GxB_NO_RMINUS_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint8.c index b819a5be8d..1918465be4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__rminus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__rminus_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_RMINUS) || defined(GxB_NO_UINT8) || defined(GxB_NO_RMINUS_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__rminus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -284,7 +285,7 @@ GrB_Info GB (_AemultB_03__rminus_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -309,7 +310,7 @@ GrB_Info GB (_AemultB_04__rminus_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -411,7 +412,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -422,6 +423,7 @@ GrB_Info GB (_bind1st_tran__rminus_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -446,7 +448,7 @@ GrB_Info GB (_bind2nd_tran__rminus_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -456,10 +458,13 @@ GrB_Info GB (_bind2nd_tran__rminus_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_bool.c b/GraphBLAS/FactoryKernels/GB_ew__second_bool.c index 499b56f513..1407d255b9 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_bool.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_bool.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_BOOL) || defined(GxB_NO_SECOND_BOOL)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_bool) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_bool) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__second_fc32.c index 45560fa7a2..92b6d2fc91 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FC32) || defined(GxB_NO_SECOND_FC32) || GB_COMPILER_MSC_2019_OR_NEWER) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__second_fc64.c index 9ea97e108b..84b07995e4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FC64) || defined(GxB_NO_SECOND_FC64)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__second_fp32.c index 09a30462c6..e1a6c83e00 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FP32) || defined(GxB_NO_SECOND_FP32)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__second_fp64.c index 7b9b6aadbf..27d2c27774 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FP64) || defined(GxB_NO_SECOND_FP64)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_int16.c b/GraphBLAS/FactoryKernels/GB_ew__second_int16.c index 7d9511f10b..39331c45d4 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT16) || defined(GxB_NO_SECOND_INT16)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_int32.c b/GraphBLAS/FactoryKernels/GB_ew__second_int32.c index 45426ac128..0de82d637b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT32) || defined(GxB_NO_SECOND_INT32)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_int64.c b/GraphBLAS/FactoryKernels/GB_ew__second_int64.c index b0748f85db..dc714bf1d7 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT64) || defined(GxB_NO_SECOND_INT64)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_int8.c b/GraphBLAS/FactoryKernels/GB_ew__second_int8.c index 28fc9875b4..7d21877ce6 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT8) || defined(GxB_NO_SECOND_INT8)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__second_uint16.c index 67cf83f245..dbba6df0cd 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT16) || defined(GxB_NO_SECOND_UINT16)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__second_uint32.c index 85b667cc15..da9f6d1356 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT32) || defined(GxB_NO_SECOND_UINT32)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__second_uint64.c index bfe0c8fdf9..46bf2db44a 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT64) || defined(GxB_NO_SECOND_UINT64)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__second_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__second_uint8.c index ce33996f12..447faf3e02 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__second_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__second_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -43,6 +42,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT8) || defined(GxB_NO_SECOND_UINT8)) #define GB_DISABLE 1 @@ -223,7 +224,7 @@ GrB_Info GB (_AemultB_08__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +241,7 @@ GrB_Info GB (_AemultB_02__second_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -266,7 +267,7 @@ GrB_Info GB (_AemultB_03__second_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -291,7 +292,7 @@ GrB_Info GB (_AemultB_04__second_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -331,5 +332,7 @@ GrB_Info GB (_AemultB_bitmap__second_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_fc32.c b/GraphBLAS/FactoryKernels/GB_ew__times_fc32.c index 54b5483855..7dc6adfaf1 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_fc32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FC32) || defined(GxB_NO_TIMES_FC32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_fc32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_fc32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_fc32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_fc32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_fc32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_fc32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_fc64.c b/GraphBLAS/FactoryKernels/GB_ew__times_fc64.c index 01d6c3aae3..40efec1fae 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_fc64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FC64) || defined(GxB_NO_TIMES_FC64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_fc64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_fc64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_fc64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_fc64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_fc64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_fc64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_fp32.c b/GraphBLAS/FactoryKernels/GB_ew__times_fp32.c index faaee9bbde..dd4e265e80 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_fp32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FP32) || defined(GxB_NO_TIMES_FP32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_fp32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_fp32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_fp32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_fp32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_fp32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_fp32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_fp64.c b/GraphBLAS/FactoryKernels/GB_ew__times_fp64.c index daea39745e..8782aae028 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_fp64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FP64) || defined(GxB_NO_TIMES_FP64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_fp64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_fp64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_fp64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_fp64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_fp64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_fp64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_int16.c b/GraphBLAS/FactoryKernels/GB_ew__times_int16.c index 715ad9f177..c7310d487b 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_int16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT16) || defined(GxB_NO_TIMES_INT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_int16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_int16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_int16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_int16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_int16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_int16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_int32.c b/GraphBLAS/FactoryKernels/GB_ew__times_int32.c index 211b31675f..8c4f00426f 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_int32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT32) || defined(GxB_NO_TIMES_INT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_int32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_int32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_int32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_int32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_int32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_int32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_int64.c b/GraphBLAS/FactoryKernels/GB_ew__times_int64.c index 2072a7aca6..1c3f9eeb62 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_int64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT64) || defined(GxB_NO_TIMES_INT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_int64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_int64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_int64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_int64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_int64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_int64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_int8.c b/GraphBLAS/FactoryKernels/GB_ew__times_int8.c index 60faa0eabe..38d5ded755 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_int8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT8) || defined(GxB_NO_TIMES_INT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_int8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_int8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_int8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_int8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_int8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_int8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_uint16.c b/GraphBLAS/FactoryKernels/GB_ew__times_uint16.c index 86107bbfd7..c298b13694 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_uint16.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT16) || defined(GxB_NO_TIMES_UINT16)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_uint16) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_uint16) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_uint16) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_uint16) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_uint16) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_uint16) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_uint32.c b/GraphBLAS/FactoryKernels/GB_ew__times_uint32.c index d38c314618..daf5a25542 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_uint32.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT32) || defined(GxB_NO_TIMES_UINT32)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_uint32) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_uint32) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_uint32) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_uint32) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_uint32) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_uint32) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_uint64.c b/GraphBLAS/FactoryKernels/GB_ew__times_uint64.c index 5e342b527d..23ab398ead 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_uint64.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT64) || defined(GxB_NO_TIMES_UINT64)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_uint64) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_uint64) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_uint64) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_uint64) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_uint64) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_uint64) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_ew__times_uint8.c b/GraphBLAS/FactoryKernels/GB_ew__times_uint8.c index 368867770e..de9bcb257e 100644 --- a/GraphBLAS/FactoryKernels/GB_ew__times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_ew__times_uint8.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -42,6 +41,8 @@ // C matrix: #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 + // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT8) || defined(GxB_NO_TIMES_UINT8)) #define GB_DISABLE 1 @@ -241,7 +242,7 @@ GrB_Info GB (_AemultB_08__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -258,7 +259,7 @@ GrB_Info GB (_AemultB_02__times_uint8) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -283,7 +284,7 @@ GrB_Info GB (_AemultB_04__times_uint8) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -385,7 +386,7 @@ GrB_Info GB (_bind1st_tran__times_uint8) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -396,6 +397,7 @@ GrB_Info GB (_bind1st_tran__times_uint8) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -420,7 +422,7 @@ GrB_Info GB (_bind2nd_tran__times_uint8) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -430,10 +432,13 @@ GrB_Info GB (_bind2nd_tran__times_uint8) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_bool.c b/GraphBLAS/FactoryKernels/GB_red__any_bool.c index 060e2ad614..bb679ae684 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_bool.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_bool.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_fc32.c b/GraphBLAS/FactoryKernels/GB_red__any_fc32.c index 96b05600a1..bd13373cc5 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_fc32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_fc64.c b/GraphBLAS/FactoryKernels/GB_red__any_fc64.c index 9d6d6a783f..600838d1e2 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_fc64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_fp32.c b/GraphBLAS/FactoryKernels/GB_red__any_fp32.c index c346ecfa0d..0e8fb57469 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_fp32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_fp64.c b/GraphBLAS/FactoryKernels/GB_red__any_fp64.c index a4e58307c7..0fbf9bc425 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_fp64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_int16.c b/GraphBLAS/FactoryKernels/GB_red__any_int16.c index 4ba66b63a6..78dc22144c 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_int16.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_int16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_int32.c b/GraphBLAS/FactoryKernels/GB_red__any_int32.c index 83907db9df..865b7c5f66 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_int32.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_int32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_int64.c b/GraphBLAS/FactoryKernels/GB_red__any_int64.c index 8e20b70be4..27483b0909 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_int64.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_int64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_int8.c b/GraphBLAS/FactoryKernels/GB_red__any_int8.c index 18843d1ef0..afb1ce5448 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_int8.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_int8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_uint16.c b/GraphBLAS/FactoryKernels/GB_red__any_uint16.c index 9388cee9ea..20a127733a 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_uint16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_uint32.c b/GraphBLAS/FactoryKernels/GB_red__any_uint32.c index 30b1225be7..2cb07cd135 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_uint32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_uint64.c b/GraphBLAS/FactoryKernels/GB_red__any_uint64.c index 6c7296b5b1..0b6a714a6c 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_uint64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__any_uint8.c b/GraphBLAS/FactoryKernels/GB_red__any_uint8.c index 444b3d1f5f..bd5c422487 100644 --- a/GraphBLAS/FactoryKernels/GB_red__any_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_red__any_uint8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,5 +78,7 @@ GrB_Info GB (_red__any_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__eq_bool.c b/GraphBLAS/FactoryKernels/GB_red__eq_bool.c index d648441d99..513a77c5a4 100644 --- a/GraphBLAS/FactoryKernels/GB_red__eq_bool.c +++ b/GraphBLAS/FactoryKernels/GB_red__eq_bool.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__eq_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__include.h b/GraphBLAS/FactoryKernels/GB_red__include.h index 3564ccc169..a55c90d112 100644 --- a/GraphBLAS/FactoryKernels/GB_red__include.h +++ b/GraphBLAS/FactoryKernels/GB_red__include.h @@ -2,7 +2,7 @@ // GB_red__include.h: definitions for GB_red__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_red.h diff --git a/GraphBLAS/FactoryKernels/GB_red__land_bool.c b/GraphBLAS/FactoryKernels/GB_red__land_bool.c index a85d118ca8..81d349b127 100644 --- a/GraphBLAS/FactoryKernels/GB_red__land_bool.c +++ b/GraphBLAS/FactoryKernels/GB_red__land_bool.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == false) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == false) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const bool zterminal = false // panel size #define GB_PANEL 8 @@ -82,5 +81,7 @@ GrB_Info GB (_red__land_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__lor_bool.c b/GraphBLAS/FactoryKernels/GB_red__lor_bool.c index 5b99eaf8df..9e0dbdc614 100644 --- a/GraphBLAS/FactoryKernels/GB_red__lor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_red__lor_bool.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == true) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == true) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const bool zterminal = true // panel size #define GB_PANEL 8 @@ -82,5 +81,7 @@ GrB_Info GB (_red__lor_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__lxor_bool.c b/GraphBLAS/FactoryKernels/GB_red__lxor_bool.c index 7cc6c08246..68f45c6251 100644 --- a/GraphBLAS/FactoryKernels/GB_red__lxor_bool.c +++ b/GraphBLAS/FactoryKernels/GB_red__lxor_bool.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__lxor_bool) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_fp32.c b/GraphBLAS/FactoryKernels/GB_red__max_fp32.c index 01d98aa06a..6e9a68da9e 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_fp32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__max_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_fp64.c b/GraphBLAS/FactoryKernels/GB_red__max_fp64.c index 9c9222d65e..37fa3f2133 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_fp64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__max_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_int16.c b/GraphBLAS/FactoryKernels/GB_red__max_int16.c index 2bde283ec0..ae62641542 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_int16.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_int16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT16_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT16_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int16_t zterminal = INT16_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_int32.c b/GraphBLAS/FactoryKernels/GB_red__max_int32.c index d4ad01150b..ed8c0b8c04 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_int32.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_int32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT32_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT32_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int32_t zterminal = INT32_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_int64.c b/GraphBLAS/FactoryKernels/GB_red__max_int64.c index 1082b1708f..9365c803c4 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_int64.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_int64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT64_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT64_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int64_t zterminal = INT64_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_int8.c b/GraphBLAS/FactoryKernels/GB_red__max_int8.c index bdb6350046..8a0bf17a62 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_int8.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_int8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT8_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT8_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int8_t zterminal = INT8_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_uint16.c b/GraphBLAS/FactoryKernels/GB_red__max_uint16.c index a610407e53..31f0cfd12c 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_uint16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == UINT16_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == UINT16_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint16_t zterminal = UINT16_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_uint32.c b/GraphBLAS/FactoryKernels/GB_red__max_uint32.c index 65020e9949..9dc8ec1160 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_uint32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == UINT32_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == UINT32_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint32_t zterminal = UINT32_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_uint64.c b/GraphBLAS/FactoryKernels/GB_red__max_uint64.c index 8f40be4a82..d9f918d286 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_uint64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == UINT64_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == UINT64_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint64_t zterminal = UINT64_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__max_uint8.c b/GraphBLAS/FactoryKernels/GB_red__max_uint8.c index 803bd30cee..55188049e0 100644 --- a/GraphBLAS/FactoryKernels/GB_red__max_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_red__max_uint8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == UINT8_MAX) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == UINT8_MAX) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint8_t zterminal = UINT8_MAX // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__max_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_fp32.c b/GraphBLAS/FactoryKernels/GB_red__min_fp32.c index 75b035f3cc..e25b545394 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_fp32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__min_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_fp64.c b/GraphBLAS/FactoryKernels/GB_red__min_fp64.c index d475059327..b4e64a5e28 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_fp64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__min_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_int16.c b/GraphBLAS/FactoryKernels/GB_red__min_int16.c index 75cbaaa237..524d7259b3 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_int16.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_int16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT16_MIN) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT16_MIN) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int16_t zterminal = INT16_MIN // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_int32.c b/GraphBLAS/FactoryKernels/GB_red__min_int32.c index 8dfdd8f851..0829b7ee5a 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_int32.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_int32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT32_MIN) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT32_MIN) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int32_t zterminal = INT32_MIN // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_int64.c b/GraphBLAS/FactoryKernels/GB_red__min_int64.c index 1b0e89cb24..87f19d321e 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_int64.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_int64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT64_MIN) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT64_MIN) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int64_t zterminal = INT64_MIN // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_int8.c b/GraphBLAS/FactoryKernels/GB_red__min_int8.c index cd5e150b7d..d3befabd03 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_int8.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_int8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == INT8_MIN) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == INT8_MIN) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int8_t zterminal = INT8_MIN // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_uint16.c b/GraphBLAS/FactoryKernels/GB_red__min_uint16.c index 244f96a01e..800fa4eda9 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_uint16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint16_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_uint32.c b/GraphBLAS/FactoryKernels/GB_red__min_uint32.c index 5dabf1dc4f..2588dcfece 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_uint32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint32_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_uint64.c b/GraphBLAS/FactoryKernels/GB_red__min_uint64.c index b6dff01981..73fe47d3d9 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_uint64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint64_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__min_uint8.c b/GraphBLAS/FactoryKernels/GB_red__min_uint8.c index b5171ce372..fb42ca9fb1 100644 --- a/GraphBLAS/FactoryKernels/GB_red__min_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_red__min_uint8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint8_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__min_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_fc32.c b/GraphBLAS/FactoryKernels/GB_red__plus_fc32.c index 7752a8d9ec..b8ee0905de 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_fc32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_fc64.c b/GraphBLAS/FactoryKernels/GB_red__plus_fc64.c index c74f8e447d..8d00425112 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_fc64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_fp32.c b/GraphBLAS/FactoryKernels/GB_red__plus_fp32.c index 2728393d4a..7c5a4a67de 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_fp32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_fp64.c b/GraphBLAS/FactoryKernels/GB_red__plus_fp64.c index a0f4b49c16..8945c3cffa 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_fp64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_int16.c b/GraphBLAS/FactoryKernels/GB_red__plus_int16.c index 6ee98e8d24..3e5912fff9 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_int16.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_int16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_int32.c b/GraphBLAS/FactoryKernels/GB_red__plus_int32.c index f1308119e2..14cb962cd4 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_int32.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_int32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_int64.c b/GraphBLAS/FactoryKernels/GB_red__plus_int64.c index 35c3b98fb2..4389030c58 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_int64.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_int64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_int8.c b/GraphBLAS/FactoryKernels/GB_red__plus_int8.c index ddb6e9f4af..b4904e48df 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_int8.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_int8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_uint16.c b/GraphBLAS/FactoryKernels/GB_red__plus_uint16.c index cf48b5b1fd..55819cac75 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_uint16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_uint32.c b/GraphBLAS/FactoryKernels/GB_red__plus_uint32.c index 1d49feac08..bab805b151 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_uint32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_uint64.c b/GraphBLAS/FactoryKernels/GB_red__plus_uint64.c index cf1d15e3c0..4a1b4a7eaa 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_uint64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__plus_uint8.c b/GraphBLAS/FactoryKernels/GB_red__plus_uint8.c index f677b5b0b4..a35fd36438 100644 --- a/GraphBLAS/FactoryKernels/GB_red__plus_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_red__plus_uint8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__plus_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_fc32.c b/GraphBLAS/FactoryKernels/GB_red__times_fc32.c index 085eea7692..77b473cd46 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_fc32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__times_fc32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_fc64.c b/GraphBLAS/FactoryKernels/GB_red__times_fc64.c index 6ef5d0742c..b11d2ba153 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_fc64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__times_fc64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_fp32.c b/GraphBLAS/FactoryKernels/GB_red__times_fp32.c index de331ace2a..feb35c359f 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_fp32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__times_fp32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_fp64.c b/GraphBLAS/FactoryKernels/GB_red__times_fp64.c index d063698bd5..a0d677a930 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_fp64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -77,5 +77,7 @@ GrB_Info GB (_red__times_fp64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_int16.c b/GraphBLAS/FactoryKernels/GB_red__times_int16.c index ffba5e1b80..c671d2c3a2 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_int16.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_int16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int16_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_int16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_int32.c b/GraphBLAS/FactoryKernels/GB_red__times_int32.c index 236eade760..d1a6dfb81d 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_int32.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_int32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int32_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_int32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_int64.c b/GraphBLAS/FactoryKernels/GB_red__times_int64.c index b4ba930ce2..292c504ec4 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_int64.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_int64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int64_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_int64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_int8.c b/GraphBLAS/FactoryKernels/GB_red__times_int8.c index ba0dc6faf8..a98136bc5d 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_int8.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_int8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const int8_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_int8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_uint16.c b/GraphBLAS/FactoryKernels/GB_red__times_uint16.c index ee674f9d72..5bf5a04994 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_uint16.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint16_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_uint16) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_uint32.c b/GraphBLAS/FactoryKernels/GB_red__times_uint32.c index 52e0d3b1e3..819cf33660 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_uint32.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint32_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_uint32) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_uint64.c b/GraphBLAS/FactoryKernels/GB_red__times_uint64.c index 22a5800d4a..2c057a1ff7 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_uint64.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint64_t zterminal = 0 // panel size #define GB_PANEL 16 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_uint64) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_red__times_uint8.c b/GraphBLAS/FactoryKernels/GB_red__times_uint8.c index ce91b4a223..ed945fc350 100644 --- a/GraphBLAS/FactoryKernels/GB_red__times_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_red__times_uint8.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,6 @@ #define GB_MONOID_IS_TERMINAL 1 #define GB_TERMINAL_CONDITION(z,zterminal) (z == 0) #define GB_IF_TERMINAL_BREAK(z,zterminal) if (z == 0) { break ; } -#define GB_DECLARE_TERMINAL_CONST(zterminal) const uint8_t zterminal = 0 // panel size #define GB_PANEL 64 @@ -82,5 +81,7 @@ GrB_Info GB (_red__times_uint8) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_bool.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_bool.c index 4f95a75f6b..6b6e276879 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_bool.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_bool.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_bool) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_bool) GrB_Info GB (_sel_phase2__eq_thunk_bool) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_bool) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_bool) GrB_Info GB (_sel_bitmap__eq_thunk_bool) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc32.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc32.c index 760148cfc3..61591262ec 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc32) GrB_Info GB (_sel_phase2__eq_thunk_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc32) GrB_Info GB (_sel_bitmap__eq_thunk_fc32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc64.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc64.c index bf7ead8103..283a0b805f 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fc64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc64) GrB_Info GB (_sel_phase2__eq_thunk_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc64) GrB_Info GB (_sel_bitmap__eq_thunk_fc64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp32.c index 58d4830ffc..22c256c47a 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp32) GrB_Info GB (_sel_phase2__eq_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp32) GrB_Info GB (_sel_bitmap__eq_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp64.c index 6730057e8e..2440f2b739 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp64) GrB_Info GB (_sel_phase2__eq_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp64) GrB_Info GB (_sel_bitmap__eq_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int16.c index 01afb7fedc..d2b256a96b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int16) GrB_Info GB (_sel_phase2__eq_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_int16) GrB_Info GB (_sel_bitmap__eq_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int32.c index 8695beb722..a81ae44b30 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int32) GrB_Info GB (_sel_phase2__eq_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_int32) GrB_Info GB (_sel_bitmap__eq_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int64.c index f6a5693e90..8e97c14399 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int64) GrB_Info GB (_sel_phase2__eq_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_int64) GrB_Info GB (_sel_bitmap__eq_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int8.c index 3ba5c0b001..c5aeca895b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int8) GrB_Info GB (_sel_phase2__eq_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_int8) GrB_Info GB (_sel_bitmap__eq_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint16.c index 60c5354ffc..59c09e6ebf 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint16) GrB_Info GB (_sel_phase2__eq_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint16) GrB_Info GB (_sel_bitmap__eq_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint32.c index adf2708cf5..48cf8f8b64 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint32) GrB_Info GB (_sel_phase2__eq_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint32) GrB_Info GB (_sel_bitmap__eq_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint64.c index 2bdb22c33d..7dfd5466d4 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint64) GrB_Info GB (_sel_phase2__eq_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint64) GrB_Info GB (_sel_bitmap__eq_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint8.c index 803dcc4a1b..0b4af58741 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__eq_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -26,9 +25,9 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -47,10 +46,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint8) GrB_Info GB (_sel_phase2__eq_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -58,7 +55,6 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -70,9 +66,8 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint8) GrB_Info GB (_sel_bitmap__eq_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp32.c index 637725a0bb..234bdd4ffc 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp32) GrB_Info GB (_sel_phase2__ge_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp32) GrB_Info GB (_sel_bitmap__ge_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp64.c index d6d2f75b01..789700f2d0 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp64) GrB_Info GB (_sel_phase2__ge_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp64) GrB_Info GB (_sel_bitmap__ge_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int16.c index 11fb34ffd0..25b070756c 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int16) GrB_Info GB (_sel_phase2__ge_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_int16) GrB_Info GB (_sel_bitmap__ge_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int32.c index 1e8514472b..ba4c44a959 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int32) GrB_Info GB (_sel_phase2__ge_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_int32) GrB_Info GB (_sel_bitmap__ge_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int64.c index 282609e12e..8f696a93c4 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int64) GrB_Info GB (_sel_phase2__ge_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_int64) GrB_Info GB (_sel_bitmap__ge_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int8.c index 29a3eaa1d5..3ae195767b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int8) GrB_Info GB (_sel_phase2__ge_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_int8) GrB_Info GB (_sel_bitmap__ge_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint16.c index c324c1bbc8..5313349405 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint16) GrB_Info GB (_sel_phase2__ge_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint16) GrB_Info GB (_sel_bitmap__ge_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint32.c index 939c9622d8..28d65120eb 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint32) GrB_Info GB (_sel_phase2__ge_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint32) GrB_Info GB (_sel_bitmap__ge_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint64.c index 4abdf37c28..444c87a93a 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint64) GrB_Info GB (_sel_phase2__ge_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint64) GrB_Info GB (_sel_bitmap__ge_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint8.c index 8d9db3e3bd..7816e884d4 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ge_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint8) GrB_Info GB (_sel_phase2__ge_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint8) GrB_Info GB (_sel_bitmap__ge_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp32.c index f457dd00ad..cd2b771404 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp32) GrB_Info GB (_sel_phase2__gt_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp32) GrB_Info GB (_sel_bitmap__gt_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp64.c index 95c934677b..af904178a1 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp64) GrB_Info GB (_sel_phase2__gt_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp64) GrB_Info GB (_sel_bitmap__gt_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int16.c index 7b620b71e2..00dedf129f 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int16) GrB_Info GB (_sel_phase2__gt_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_int16) GrB_Info GB (_sel_bitmap__gt_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int32.c index 0e6575670d..e44d510f11 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int32) GrB_Info GB (_sel_phase2__gt_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_int32) GrB_Info GB (_sel_bitmap__gt_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int64.c index 261cefc666..2e0e606c86 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int64) GrB_Info GB (_sel_phase2__gt_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_int64) GrB_Info GB (_sel_bitmap__gt_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int8.c index e11ed6bd04..c1d9da5467 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int8) GrB_Info GB (_sel_phase2__gt_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_int8) GrB_Info GB (_sel_bitmap__gt_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint16.c index a84a809d59..3290889d0d 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint16) GrB_Info GB (_sel_phase2__gt_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint16) GrB_Info GB (_sel_bitmap__gt_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint32.c index 1bf3f20aaa..19a18b2d32 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint32) GrB_Info GB (_sel_phase2__gt_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint32) GrB_Info GB (_sel_bitmap__gt_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint64.c index 5efa681c74..182a8996d1 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint64) GrB_Info GB (_sel_phase2__gt_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint64) GrB_Info GB (_sel_bitmap__gt_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint8.c index f1cb237819..cc416f4ae4 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__gt_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint8) GrB_Info GB (_sel_phase2__gt_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint8) GrB_Info GB (_sel_bitmap__gt_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__include.h b/GraphBLAS/FactoryKernels/GB_sel__include.h index 483a0ff945..401b2eb072 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__include.h +++ b/GraphBLAS/FactoryKernels/GB_sel__include.h @@ -2,7 +2,7 @@ // GB_sel__include.h: definitions for GB_sel__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_sel.h @@ -11,10 +11,8 @@ GrB_Info GB (_sel_phase2__nonzombie_bool) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -25,10 +23,8 @@ GrB_Info GB (_sel_phase2__nonzombie_bool) GrB_Info GB (_sel_phase2__nonzombie_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -39,10 +35,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int8) GrB_Info GB (_sel_phase2__nonzombie_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -53,10 +47,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int16) GrB_Info GB (_sel_phase2__nonzombie_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -67,10 +59,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int32) GrB_Info GB (_sel_phase2__nonzombie_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -81,10 +71,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int64) GrB_Info GB (_sel_phase2__nonzombie_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -95,10 +83,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint8) GrB_Info GB (_sel_phase2__nonzombie_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -109,10 +95,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint16) GrB_Info GB (_sel_phase2__nonzombie_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -123,10 +107,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint32) GrB_Info GB (_sel_phase2__nonzombie_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -137,10 +119,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint64) GrB_Info GB (_sel_phase2__nonzombie_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -151,10 +131,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fp32) GrB_Info GB (_sel_phase2__nonzombie_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -165,10 +143,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fp64) GrB_Info GB (_sel_phase2__nonzombie_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -179,10 +155,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fc32) GrB_Info GB (_sel_phase2__nonzombie_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -193,9 +167,9 @@ GrB_Info GB (_sel_phase2__nonzombie_fc64) GrB_Info GB (_sel_phase1__ne_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -205,10 +179,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int8) GrB_Info GB (_sel_phase2__ne_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -218,8 +190,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int8) GrB_Info GB (_sel_bitmap__ne_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -228,9 +199,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_int8) GrB_Info GB (_sel_phase1__ne_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -240,10 +211,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int16) GrB_Info GB (_sel_phase2__ne_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -253,8 +222,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int16) GrB_Info GB (_sel_bitmap__ne_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -263,9 +231,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_int16) GrB_Info GB (_sel_phase1__ne_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -275,10 +243,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int32) GrB_Info GB (_sel_phase2__ne_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -288,8 +254,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int32) GrB_Info GB (_sel_bitmap__ne_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -298,9 +263,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_int32) GrB_Info GB (_sel_phase1__ne_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -310,10 +275,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int64) GrB_Info GB (_sel_phase2__ne_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -323,8 +286,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int64) GrB_Info GB (_sel_bitmap__ne_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -333,9 +295,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_int64) GrB_Info GB (_sel_phase1__ne_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -345,10 +307,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint8) GrB_Info GB (_sel_phase2__ne_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -358,8 +318,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint8) GrB_Info GB (_sel_bitmap__ne_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -368,9 +327,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_uint8) GrB_Info GB (_sel_phase1__ne_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -380,10 +339,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint16) GrB_Info GB (_sel_phase2__ne_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -393,8 +350,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint16) GrB_Info GB (_sel_bitmap__ne_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -403,9 +359,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_uint16) GrB_Info GB (_sel_phase1__ne_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -415,10 +371,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint32) GrB_Info GB (_sel_phase2__ne_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -428,8 +382,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint32) GrB_Info GB (_sel_bitmap__ne_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -438,9 +391,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_uint32) GrB_Info GB (_sel_phase1__ne_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -450,10 +403,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint64) GrB_Info GB (_sel_phase2__ne_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -463,8 +414,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint64) GrB_Info GB (_sel_bitmap__ne_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -473,9 +423,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_uint64) GrB_Info GB (_sel_phase1__ne_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -485,10 +435,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp32) GrB_Info GB (_sel_phase2__ne_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -498,8 +446,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp32) GrB_Info GB (_sel_bitmap__ne_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -508,9 +455,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_fp32) GrB_Info GB (_sel_phase1__ne_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -520,10 +467,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp64) GrB_Info GB (_sel_phase2__ne_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -533,8 +478,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp64) GrB_Info GB (_sel_bitmap__ne_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -543,9 +487,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_fp64) GrB_Info GB (_sel_phase1__ne_thunk_fc32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -555,10 +499,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc32) GrB_Info GB (_sel_phase2__ne_thunk_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -568,8 +510,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc32) GrB_Info GB (_sel_bitmap__ne_thunk_fc32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -578,9 +519,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_fc32) GrB_Info GB (_sel_phase1__ne_thunk_fc64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -590,10 +531,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc64) GrB_Info GB (_sel_phase2__ne_thunk_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -603,8 +542,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc64) GrB_Info GB (_sel_bitmap__ne_thunk_fc64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -613,9 +551,9 @@ GrB_Info GB (_sel_bitmap__ne_thunk_fc64) GrB_Info GB (_sel_phase1__eq_thunk_bool) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -625,10 +563,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_bool) GrB_Info GB (_sel_phase2__eq_thunk_bool) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -638,8 +574,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_bool) GrB_Info GB (_sel_bitmap__eq_thunk_bool) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -648,9 +583,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_bool) GrB_Info GB (_sel_phase1__eq_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -660,10 +595,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int8) GrB_Info GB (_sel_phase2__eq_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -673,8 +606,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int8) GrB_Info GB (_sel_bitmap__eq_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -683,9 +615,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_int8) GrB_Info GB (_sel_phase1__eq_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -695,10 +627,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int16) GrB_Info GB (_sel_phase2__eq_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -708,8 +638,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int16) GrB_Info GB (_sel_bitmap__eq_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -718,9 +647,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_int16) GrB_Info GB (_sel_phase1__eq_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -730,10 +659,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int32) GrB_Info GB (_sel_phase2__eq_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -743,8 +670,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int32) GrB_Info GB (_sel_bitmap__eq_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -753,9 +679,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_int32) GrB_Info GB (_sel_phase1__eq_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -765,10 +691,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_int64) GrB_Info GB (_sel_phase2__eq_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -778,8 +702,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int64) GrB_Info GB (_sel_bitmap__eq_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -788,9 +711,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_int64) GrB_Info GB (_sel_phase1__eq_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -800,10 +723,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint8) GrB_Info GB (_sel_phase2__eq_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -813,8 +734,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint8) GrB_Info GB (_sel_bitmap__eq_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -823,9 +743,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_uint8) GrB_Info GB (_sel_phase1__eq_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -835,10 +755,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint16) GrB_Info GB (_sel_phase2__eq_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -848,8 +766,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint16) GrB_Info GB (_sel_bitmap__eq_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -858,9 +775,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_uint16) GrB_Info GB (_sel_phase1__eq_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -870,10 +787,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint32) GrB_Info GB (_sel_phase2__eq_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -883,8 +798,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint32) GrB_Info GB (_sel_bitmap__eq_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -893,9 +807,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_uint32) GrB_Info GB (_sel_phase1__eq_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -905,10 +819,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_uint64) GrB_Info GB (_sel_phase2__eq_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -918,8 +830,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint64) GrB_Info GB (_sel_bitmap__eq_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -928,9 +839,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_uint64) GrB_Info GB (_sel_phase1__eq_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -940,10 +851,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp32) GrB_Info GB (_sel_phase2__eq_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -953,8 +862,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp32) GrB_Info GB (_sel_bitmap__eq_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -963,9 +871,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_fp32) GrB_Info GB (_sel_phase1__eq_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -975,10 +883,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fp64) GrB_Info GB (_sel_phase2__eq_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -988,8 +894,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp64) GrB_Info GB (_sel_bitmap__eq_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -998,9 +903,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_fp64) GrB_Info GB (_sel_phase1__eq_thunk_fc32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1010,10 +915,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc32) GrB_Info GB (_sel_phase2__eq_thunk_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1023,8 +926,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc32) GrB_Info GB (_sel_bitmap__eq_thunk_fc32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1033,9 +935,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_fc32) GrB_Info GB (_sel_phase1__eq_thunk_fc64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1045,10 +947,8 @@ GrB_Info GB (_sel_phase1__eq_thunk_fc64) GrB_Info GB (_sel_phase2__eq_thunk_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1058,8 +958,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc64) GrB_Info GB (_sel_bitmap__eq_thunk_fc64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1068,9 +967,9 @@ GrB_Info GB (_sel_bitmap__eq_thunk_fc64) GrB_Info GB (_sel_phase1__gt_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1080,10 +979,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int8) GrB_Info GB (_sel_phase2__gt_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1093,8 +990,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int8) GrB_Info GB (_sel_bitmap__gt_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1103,9 +999,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_int8) GrB_Info GB (_sel_phase1__gt_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1115,10 +1011,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int16) GrB_Info GB (_sel_phase2__gt_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1128,8 +1022,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int16) GrB_Info GB (_sel_bitmap__gt_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1138,9 +1031,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_int16) GrB_Info GB (_sel_phase1__gt_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1150,10 +1043,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int32) GrB_Info GB (_sel_phase2__gt_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1163,8 +1054,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int32) GrB_Info GB (_sel_bitmap__gt_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1173,9 +1063,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_int32) GrB_Info GB (_sel_phase1__gt_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1185,10 +1075,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_int64) GrB_Info GB (_sel_phase2__gt_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1198,8 +1086,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int64) GrB_Info GB (_sel_bitmap__gt_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1208,9 +1095,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_int64) GrB_Info GB (_sel_phase1__gt_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1220,10 +1107,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint8) GrB_Info GB (_sel_phase2__gt_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1233,8 +1118,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint8) GrB_Info GB (_sel_bitmap__gt_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1243,9 +1127,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_uint8) GrB_Info GB (_sel_phase1__gt_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1255,10 +1139,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint16) GrB_Info GB (_sel_phase2__gt_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1268,8 +1150,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint16) GrB_Info GB (_sel_bitmap__gt_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1278,9 +1159,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_uint16) GrB_Info GB (_sel_phase1__gt_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1290,10 +1171,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint32) GrB_Info GB (_sel_phase2__gt_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1303,8 +1182,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint32) GrB_Info GB (_sel_bitmap__gt_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1313,9 +1191,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_uint32) GrB_Info GB (_sel_phase1__gt_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1325,10 +1203,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_uint64) GrB_Info GB (_sel_phase2__gt_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1338,8 +1214,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint64) GrB_Info GB (_sel_bitmap__gt_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1348,9 +1223,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_uint64) GrB_Info GB (_sel_phase1__gt_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1360,10 +1235,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp32) GrB_Info GB (_sel_phase2__gt_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1373,8 +1246,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp32) GrB_Info GB (_sel_bitmap__gt_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1383,9 +1255,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_fp32) GrB_Info GB (_sel_phase1__gt_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1395,10 +1267,8 @@ GrB_Info GB (_sel_phase1__gt_thunk_fp64) GrB_Info GB (_sel_phase2__gt_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1408,8 +1278,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp64) GrB_Info GB (_sel_bitmap__gt_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1418,9 +1287,9 @@ GrB_Info GB (_sel_bitmap__gt_thunk_fp64) GrB_Info GB (_sel_phase1__ge_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1430,10 +1299,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int8) GrB_Info GB (_sel_phase2__ge_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1443,8 +1310,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int8) GrB_Info GB (_sel_bitmap__ge_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1453,9 +1319,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_int8) GrB_Info GB (_sel_phase1__ge_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1465,10 +1331,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int16) GrB_Info GB (_sel_phase2__ge_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1478,8 +1342,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int16) GrB_Info GB (_sel_bitmap__ge_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1488,9 +1351,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_int16) GrB_Info GB (_sel_phase1__ge_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1500,10 +1363,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int32) GrB_Info GB (_sel_phase2__ge_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1513,8 +1374,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int32) GrB_Info GB (_sel_bitmap__ge_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1523,9 +1383,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_int32) GrB_Info GB (_sel_phase1__ge_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1535,10 +1395,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_int64) GrB_Info GB (_sel_phase2__ge_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1548,8 +1406,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int64) GrB_Info GB (_sel_bitmap__ge_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1558,9 +1415,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_int64) GrB_Info GB (_sel_phase1__ge_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1570,10 +1427,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint8) GrB_Info GB (_sel_phase2__ge_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1583,8 +1438,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint8) GrB_Info GB (_sel_bitmap__ge_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1593,9 +1447,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_uint8) GrB_Info GB (_sel_phase1__ge_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1605,10 +1459,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint16) GrB_Info GB (_sel_phase2__ge_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1618,8 +1470,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint16) GrB_Info GB (_sel_bitmap__ge_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1628,9 +1479,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_uint16) GrB_Info GB (_sel_phase1__ge_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1640,10 +1491,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint32) GrB_Info GB (_sel_phase2__ge_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1653,8 +1502,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint32) GrB_Info GB (_sel_bitmap__ge_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1663,9 +1511,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_uint32) GrB_Info GB (_sel_phase1__ge_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1675,10 +1523,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_uint64) GrB_Info GB (_sel_phase2__ge_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1688,8 +1534,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint64) GrB_Info GB (_sel_bitmap__ge_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1698,9 +1543,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_uint64) GrB_Info GB (_sel_phase1__ge_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1710,10 +1555,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp32) GrB_Info GB (_sel_phase2__ge_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1723,8 +1566,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp32) GrB_Info GB (_sel_bitmap__ge_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1733,9 +1575,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_fp32) GrB_Info GB (_sel_phase1__ge_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1745,10 +1587,8 @@ GrB_Info GB (_sel_phase1__ge_thunk_fp64) GrB_Info GB (_sel_phase2__ge_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1758,8 +1598,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp64) GrB_Info GB (_sel_bitmap__ge_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1768,9 +1607,9 @@ GrB_Info GB (_sel_bitmap__ge_thunk_fp64) GrB_Info GB (_sel_phase1__lt_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1780,10 +1619,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int8) GrB_Info GB (_sel_phase2__lt_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1793,8 +1630,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int8) GrB_Info GB (_sel_bitmap__lt_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1803,9 +1639,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_int8) GrB_Info GB (_sel_phase1__lt_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1815,10 +1651,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int16) GrB_Info GB (_sel_phase2__lt_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1828,8 +1662,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int16) GrB_Info GB (_sel_bitmap__lt_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1838,9 +1671,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_int16) GrB_Info GB (_sel_phase1__lt_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1850,10 +1683,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int32) GrB_Info GB (_sel_phase2__lt_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1863,8 +1694,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int32) GrB_Info GB (_sel_bitmap__lt_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1873,9 +1703,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_int32) GrB_Info GB (_sel_phase1__lt_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1885,10 +1715,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int64) GrB_Info GB (_sel_phase2__lt_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1898,8 +1726,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int64) GrB_Info GB (_sel_bitmap__lt_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1908,9 +1735,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_int64) GrB_Info GB (_sel_phase1__lt_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1920,10 +1747,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint8) GrB_Info GB (_sel_phase2__lt_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1933,8 +1758,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint8) GrB_Info GB (_sel_bitmap__lt_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1943,9 +1767,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_uint8) GrB_Info GB (_sel_phase1__lt_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1955,10 +1779,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint16) GrB_Info GB (_sel_phase2__lt_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1968,8 +1790,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint16) GrB_Info GB (_sel_bitmap__lt_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -1978,9 +1799,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_uint16) GrB_Info GB (_sel_phase1__lt_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -1990,10 +1811,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint32) GrB_Info GB (_sel_phase2__lt_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2003,8 +1822,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint32) GrB_Info GB (_sel_bitmap__lt_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2013,9 +1831,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_uint32) GrB_Info GB (_sel_phase1__lt_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2025,10 +1843,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint64) GrB_Info GB (_sel_phase2__lt_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2038,8 +1854,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint64) GrB_Info GB (_sel_bitmap__lt_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2048,9 +1863,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_uint64) GrB_Info GB (_sel_phase1__lt_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2060,10 +1875,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp32) GrB_Info GB (_sel_phase2__lt_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2073,8 +1886,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp32) GrB_Info GB (_sel_bitmap__lt_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2083,9 +1895,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_fp32) GrB_Info GB (_sel_phase1__lt_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2095,10 +1907,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp64) GrB_Info GB (_sel_phase2__lt_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2108,8 +1918,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp64) GrB_Info GB (_sel_bitmap__lt_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2118,9 +1927,9 @@ GrB_Info GB (_sel_bitmap__lt_thunk_fp64) GrB_Info GB (_sel_phase1__le_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2130,10 +1939,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int8) GrB_Info GB (_sel_phase2__le_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2143,8 +1950,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int8) GrB_Info GB (_sel_bitmap__le_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2153,9 +1959,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_int8) GrB_Info GB (_sel_phase1__le_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2165,10 +1971,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int16) GrB_Info GB (_sel_phase2__le_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2178,8 +1982,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int16) GrB_Info GB (_sel_bitmap__le_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2188,9 +1991,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_int16) GrB_Info GB (_sel_phase1__le_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2200,10 +2003,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int32) GrB_Info GB (_sel_phase2__le_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2213,8 +2014,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int32) GrB_Info GB (_sel_bitmap__le_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2223,9 +2023,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_int32) GrB_Info GB (_sel_phase1__le_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2235,10 +2035,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int64) GrB_Info GB (_sel_phase2__le_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2248,8 +2046,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int64) GrB_Info GB (_sel_bitmap__le_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2258,9 +2055,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_int64) GrB_Info GB (_sel_phase1__le_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2270,10 +2067,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint8) GrB_Info GB (_sel_phase2__le_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2283,8 +2078,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint8) GrB_Info GB (_sel_bitmap__le_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2293,9 +2087,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_uint8) GrB_Info GB (_sel_phase1__le_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2305,10 +2099,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint16) GrB_Info GB (_sel_phase2__le_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2318,8 +2110,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint16) GrB_Info GB (_sel_bitmap__le_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2328,9 +2119,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_uint16) GrB_Info GB (_sel_phase1__le_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2340,10 +2131,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint32) GrB_Info GB (_sel_phase2__le_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2353,8 +2142,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint32) GrB_Info GB (_sel_bitmap__le_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2363,9 +2151,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_uint32) GrB_Info GB (_sel_phase1__le_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2375,10 +2163,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint64) GrB_Info GB (_sel_phase2__le_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2388,8 +2174,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint64) GrB_Info GB (_sel_bitmap__le_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2398,9 +2183,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_uint64) GrB_Info GB (_sel_phase1__le_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2410,10 +2195,8 @@ GrB_Info GB (_sel_phase1__le_thunk_fp32) GrB_Info GB (_sel_phase2__le_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2423,8 +2206,7 @@ GrB_Info GB (_sel_phase2__le_thunk_fp32) GrB_Info GB (_sel_bitmap__le_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads @@ -2433,9 +2215,9 @@ GrB_Info GB (_sel_bitmap__le_thunk_fp32) GrB_Info GB (_sel_phase1__le_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2445,10 +2227,8 @@ GrB_Info GB (_sel_phase1__le_thunk_fp64) GrB_Info GB (_sel_phase2__le_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -2458,8 +2238,7 @@ GrB_Info GB (_sel_phase2__le_thunk_fp64) GrB_Info GB (_sel_bitmap__le_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp32.c index 306f760b15..927f351b28 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_fp32) GrB_Info GB (_sel_phase2__le_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_fp32) GrB_Info GB (_sel_bitmap__le_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp64.c index 6efc255677..027e0fc9e7 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_fp64) GrB_Info GB (_sel_phase2__le_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_fp64) GrB_Info GB (_sel_bitmap__le_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int16.c index b037857b5c..f56f0a4513 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int16) GrB_Info GB (_sel_phase2__le_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_int16) GrB_Info GB (_sel_bitmap__le_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int32.c index 82d8163c52..906174c5aa 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int32) GrB_Info GB (_sel_phase2__le_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_int32) GrB_Info GB (_sel_bitmap__le_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int64.c index b9a8b3a0bc..ea7a02c25b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int64) GrB_Info GB (_sel_phase2__le_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_int64) GrB_Info GB (_sel_bitmap__le_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int8.c index 7cb928e75f..7aa9fbf1be 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_int8) GrB_Info GB (_sel_phase2__le_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_int8) GrB_Info GB (_sel_bitmap__le_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint16.c index 37ff221b25..da41cb5f6d 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint16) GrB_Info GB (_sel_phase2__le_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_uint16) GrB_Info GB (_sel_bitmap__le_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint32.c index 0980f15de0..3ecd7d37c1 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint32) GrB_Info GB (_sel_phase2__le_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_uint32) GrB_Info GB (_sel_bitmap__le_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint64.c index 15f6f06b0d..728a1ea0ef 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint64) GrB_Info GB (_sel_phase2__le_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_uint64) GrB_Info GB (_sel_bitmap__le_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint8.c index f2587882e3..89923b860b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__le_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__le_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__le_thunk_uint8) GrB_Info GB (_sel_phase2__le_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__le_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__le_thunk_uint8) GrB_Info GB (_sel_bitmap__le_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp32.c index 0e214a4700..2fc18677c2 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp32) GrB_Info GB (_sel_phase2__lt_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp32) GrB_Info GB (_sel_bitmap__lt_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp64.c index 5cc0f6f2d5..58847652ef 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_fp64) GrB_Info GB (_sel_phase2__lt_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp64) GrB_Info GB (_sel_bitmap__lt_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int16.c index 44ad6246fc..f8b5e09e53 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int16) GrB_Info GB (_sel_phase2__lt_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_int16) GrB_Info GB (_sel_bitmap__lt_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int32.c index 4448acf37a..d118f92526 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int32) GrB_Info GB (_sel_phase2__lt_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_int32) GrB_Info GB (_sel_bitmap__lt_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int64.c index c2d98ae2c1..5239b6bcda 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int64) GrB_Info GB (_sel_phase2__lt_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_int64) GrB_Info GB (_sel_bitmap__lt_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int8.c index 95fe4f2ab6..3e24c2d153 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_int8) GrB_Info GB (_sel_phase2__lt_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_int8) GrB_Info GB (_sel_bitmap__lt_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint16.c index cbf78a370e..6bb9b2c907 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint16) GrB_Info GB (_sel_phase2__lt_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint16) GrB_Info GB (_sel_bitmap__lt_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint32.c index 49b955a51e..189b535da8 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint32) GrB_Info GB (_sel_phase2__lt_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint32) GrB_Info GB (_sel_bitmap__lt_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint64.c index 237a5c8b68..8a57d2a77f 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint64) GrB_Info GB (_sel_phase2__lt_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint64) GrB_Info GB (_sel_bitmap__lt_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint8.c index a05ed53225..7b15a511a4 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__lt_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__lt_thunk_uint8) GrB_Info GB (_sel_phase2__lt_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint8) GrB_Info GB (_sel_bitmap__lt_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc32.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc32.c index 0a2e62d60e..dd046ae17e 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc32) GrB_Info GB (_sel_phase2__ne_thunk_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc32) GrB_Info GB (_sel_bitmap__ne_thunk_fc32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc64.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc64.c index 8d941cf004..37e9d1d2dc 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fc64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fc64) GrB_Info GB (_sel_phase2__ne_thunk_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc64) GrB_Info GB (_sel_bitmap__ne_thunk_fc64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp32.c index 4c1b899f5f..d22c8e1586 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp32) GrB_Info GB (_sel_phase2__ne_thunk_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp32) GrB_Info GB (_sel_bitmap__ne_thunk_fp32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp64.c index 0295f1ca73..30436693f9 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_fp64) GrB_Info GB (_sel_phase2__ne_thunk_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp64) GrB_Info GB (_sel_bitmap__ne_thunk_fp64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int16.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int16.c index 6b8b082a44..eb13fda57b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_int16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int16) GrB_Info GB (_sel_phase2__ne_thunk_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_int16) GrB_Info GB (_sel_bitmap__ne_thunk_int16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int32.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int32.c index 0277796e30..c0ac8aa5aa 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_int32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int32) GrB_Info GB (_sel_phase2__ne_thunk_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_int32) GrB_Info GB (_sel_bitmap__ne_thunk_int32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int64.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int64.c index 7f5d06f871..21c42b8d10 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_int64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int64) GrB_Info GB (_sel_phase2__ne_thunk_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_int64) GrB_Info GB (_sel_bitmap__ne_thunk_int64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int8.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int8.c index 82f5b78404..59f8a52e38 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_int8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_int8) GrB_Info GB (_sel_phase2__ne_thunk_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_int8) GrB_Info GB (_sel_bitmap__ne_thunk_int8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint16.c index 21e9226c81..286cb9250f 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint16) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint16) GrB_Info GB (_sel_phase2__ne_thunk_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint16) GrB_Info GB (_sel_bitmap__ne_thunk_uint16) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint32.c index eb56bbd07b..0f6b1ae3b0 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint32) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint32) GrB_Info GB (_sel_phase2__ne_thunk_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint32) GrB_Info GB (_sel_bitmap__ne_thunk_uint32) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint64.c index 8502f5f702..abb743a479 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint64) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint64) GrB_Info GB (_sel_phase2__ne_thunk_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint64) GrB_Info GB (_sel_bitmap__ne_thunk_uint64) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint8.c index 8eefa03589..621ef32037 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__ne_thunk_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,9 +24,9 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint8) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -46,10 +45,8 @@ GrB_Info GB (_sel_phase1__ne_thunk_uint8) GrB_Info GB (_sel_phase2__ne_thunk_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -57,7 +54,6 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -69,9 +65,8 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint8) GrB_Info GB (_sel_bitmap__ne_thunk_uint8) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_bool.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_bool.c index 00048051d7..359e4669ad 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_bool.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_bool.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_bool) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_bool) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc32.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc32.c index 94058c6ba4..75a69ccc1e 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fc32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_fc32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc64.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc64.c index 596552a461..019daa2061 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fc64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fc64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_fc64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp32.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp32.c index 38f0172fe2..ff2712667d 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fp32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_fp32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp64.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp64.c index cc1617d155..00173f1f7b 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_fp64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_fp64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_fp64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int16.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int16.c index 043a43bf15..a924693b26 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_int16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int32.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int32.c index ca2490c06b..ad697e1422 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_int32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int64.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int64.c index 6b0b34cb25..487ea212cc 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_int64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int8.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int8.c index 300bad912e..eee7635aa0 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_int8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_int8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_int8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint16.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint16.c index 70237d3317..2f35c985a9 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint16.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint16) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_uint16) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint32.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint32.c index fbe65bf9bc..cafe926edd 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint32.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint32) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_uint32) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint64.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint64.c index fc673dc84a..25b05d99d9 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint64.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint64) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_uint64) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint8.c b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint8.c index 9de9671c81..c2f7c40ca9 100644 --- a/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_sel__nonzombie_uint8.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -25,10 +24,8 @@ GrB_Info GB (_sel_phase2__nonzombie_uint8) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -36,7 +33,6 @@ GrB_Info GB (_sel_phase2__nonzombie_uint8) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_bool_bool.c b/GraphBLAS/FactoryKernels/GB_uop__abs_bool_bool.c deleted file mode 100644 index 5bee5f6698..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_bool_bool.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_BOOL) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE bool -#define GB_X_TYPE bool - -// A matrix -#define GB_A_TYPE bool -#define GB_DECLAREA(aij) bool aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE bool - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ABS) || defined(GxB_NO_BOOL)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__abs_bool_bool) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__abs_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fc32.c index 26fc26adb4..563793ad4e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fp32.c index 5bdb1aa313..36eacca0a8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fc64.c index b1a535654f..e5c8fe0222 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fp64.c index c7758c7e09..15b519ccc1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__abs_int16_int16.c index 18be0cb6b1..015f7e2151 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_int16_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_int16_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_int16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_int16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__abs_int32_int32.c index 7f8e6795ba..e0b316f6b4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_int32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_int32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_int32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_int32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__abs_int64_int64.c index c9b0b8fb68..f1edd80b6d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_int64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_int64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_int64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_int64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__abs_int8_int8.c index b7f56dcdd5..fe72b1b8a3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_int8_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__abs_int8_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__abs_int8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__abs_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__abs_int8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__abs_uint16_uint16.c deleted file mode 100644 index 29abf09606..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_uint16_uint16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t - -// A matrix -#define GB_A_TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ABS) || defined(GxB_NO_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__abs_uint16_uint16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__abs_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__abs_uint32_uint32.c deleted file mode 100644 index f68af92f2b..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_uint32_uint32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t - -// A matrix -#define GB_A_TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ABS) || defined(GxB_NO_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__abs_uint32_uint32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__abs_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__abs_uint64_uint64.c deleted file mode 100644 index a9e73122ad..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_uint64_uint64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t - -// A matrix -#define GB_A_TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ABS) || defined(GxB_NO_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__abs_uint64_uint64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__abs_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__abs_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__abs_uint8_uint8.c deleted file mode 100644 index 4bad0e16a2..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__abs_uint8_uint8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t - -// A matrix -#define GB_A_TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ABS) || defined(GxB_NO_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__abs_uint8_uint8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__abs_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__acos_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__acos_fc32_fc32.c index 3f4fbd76d2..49f9579fd4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acos_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acos_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acos_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acos_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acos_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acos_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__acos_fc64_fc64.c index cd499651c0..2716eaca74 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acos_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acos_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acos_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acos_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acos_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acos_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__acos_fp32_fp32.c index 56ab8e8881..117002c5da 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acos_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acos_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acos_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acos_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acos_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acos_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__acos_fp64_fp64.c index 3f29b6952b..0b813791d4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acos_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acos_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acos_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acos_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acos_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acosh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__acosh_fc32_fc32.c index f0c0ea3907..95031c301b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acosh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acosh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acosh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acosh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acosh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acosh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__acosh_fc64_fc64.c index 6b5a7b9483..b63bf70363 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acosh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acosh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acosh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acosh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acosh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acosh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__acosh_fp32_fp32.c index c2c9a07320..8833ef8c0e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acosh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acosh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acosh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acosh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acosh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__acosh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__acosh_fp64_fp64.c index b60eb60c67..c2c9faf748 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__acosh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__acosh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__acosh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__acosh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__acosh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_bool_bool.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_bool_bool.c deleted file mode 100644 index 0ab4a07627..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_bool_bool.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_BOOL) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = x -#define GB_Z_TYPE bool -#define GB_X_TYPE bool - -// A matrix -#define GB_A_TYPE bool -#define GB_DECLAREA(aij) bool aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE bool - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_AINV) || defined(GxB_NO_BOOL)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__ainv_bool_bool) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__ainv_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_fc32_fc32.c index 7db40e40ce..7a1b93514b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_fc64_fc64.c index 76bb676dbb..4dd483d811 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_fp32_fp32.c index cf8b6225b5..b79364f163 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_fp64_fp64.c index bf2cf614ce..e9913e0e09 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_int16_int16.c index a88afdafb7..95de54caf9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_int16_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_int16_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_int16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_int16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_int32_int32.c index ca3449c5f3..77b78eee72 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_int32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_int32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_int32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_int32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_int64_int64.c index 938b854d6e..e893d3d636 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_int64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_int64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_int64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_int64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_int8_int8.c index 30aa21f738..059699e7c4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_int8_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ainv_int8_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ainv_int8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ainv_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ainv_int8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_uint16_uint16.c deleted file mode 100644 index efa9b36dd8..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint16_uint16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = -x -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t - -// A matrix -#define GB_A_TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_AINV) || defined(GxB_NO_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__ainv_uint16_uint16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__ainv_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_uint32_uint32.c deleted file mode 100644 index b3461e123c..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint32_uint32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = -x -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t - -// A matrix -#define GB_A_TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_AINV) || defined(GxB_NO_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__ainv_uint32_uint32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__ainv_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_uint64_uint64.c deleted file mode 100644 index 9c67f8f26f..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint64_uint64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = -x -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t - -// A matrix -#define GB_A_TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_AINV) || defined(GxB_NO_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__ainv_uint64_uint64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__ainv_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__ainv_uint8_uint8.c deleted file mode 100644 index f71c5b7e87..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__ainv_uint8_uint8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = -x -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t - -// A matrix -#define GB_A_TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_AINV) || defined(GxB_NO_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__ainv_uint8_uint8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__ainv_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__asin_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__asin_fc32_fc32.c index e659ff4e93..7827d5f8f3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asin_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asin_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asin_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asin_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asin_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asin_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__asin_fc64_fc64.c index 353c971224..8d91a7d800 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asin_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asin_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asin_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asin_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asin_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asin_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__asin_fp32_fp32.c index 593029d549..5c8ea7d581 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asin_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asin_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asin_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asin_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asin_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asin_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__asin_fp64_fp64.c index ef0067c88b..b399e2d37e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asin_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asin_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asin_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asin_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asin_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asinh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__asinh_fc32_fc32.c index d2f25ff3e7..79983e4831 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asinh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asinh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asinh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asinh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asinh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asinh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__asinh_fc64_fc64.c index 49bca9fbb9..2d98778591 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asinh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asinh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asinh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asinh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asinh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asinh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__asinh_fp32_fp32.c index e832e02d40..79a706c954 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asinh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asinh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asinh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asinh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asinh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__asinh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__asinh_fp64_fp64.c index df4a01a344..48bb438b0e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__asinh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__asinh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__asinh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__asinh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__asinh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atan_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__atan_fc32_fc32.c index 49ce5f8fa7..3ede173153 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atan_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atan_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atan_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atan_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atan_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atan_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__atan_fc64_fc64.c index a6251520fb..ca041c47b5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atan_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atan_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atan_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atan_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atan_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atan_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__atan_fp32_fp32.c index 5065f15524..f0e18f203b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atan_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atan_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atan_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atan_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atan_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atan_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__atan_fp64_fp64.c index 6ae05b659a..ca394f0757 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atan_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atan_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atan_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atan_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atan_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atanh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__atanh_fc32_fc32.c index d93132ff18..4ea59841f0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atanh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atanh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atanh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atanh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atanh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atanh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__atanh_fc64_fc64.c index acfa49f0e6..756893c2f5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atanh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atanh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atanh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atanh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atanh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atanh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__atanh_fp32_fp32.c index a014227d7b..89a0db7973 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atanh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atanh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atanh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atanh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atanh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__atanh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__atanh_fp64_fp64.c index c4f9834bc5..9b28739dc9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__atanh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__atanh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__atanh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__atanh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__atanh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_int16_int16.c deleted file mode 100644 index 9e14bc85a0..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_int16_int16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = ~(x) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t - -// A matrix -#define GB_A_TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_BNOT) || defined(GxB_NO_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__bnot_int16_int16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__bnot_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_int32_int32.c deleted file mode 100644 index 3534932f8c..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_int32_int32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = ~(x) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t - -// A matrix -#define GB_A_TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_BNOT) || defined(GxB_NO_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__bnot_int32_int32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__bnot_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_int64_int64.c deleted file mode 100644 index 71af98e168..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_int64_int64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = ~(x) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t - -// A matrix -#define GB_A_TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_BNOT) || defined(GxB_NO_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__bnot_int64_int64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__bnot_int64_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_int8_int8.c deleted file mode 100644 index 494ede6057..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_int8_int8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = ~(x) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t - -// A matrix -#define GB_A_TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_BNOT) || defined(GxB_NO_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__bnot_int8_int8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__bnot_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint16_uint16.c index 460d53d4f3..d04e53e54f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint16_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint16_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__bnot_uint16_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__bnot_uint16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__bnot_uint16_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint32_uint32.c index 3de990ef36..7a7fde85dc 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint32_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint32_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__bnot_uint32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__bnot_uint32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__bnot_uint32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint64_uint64.c index 35c913951a..bc675ce25d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint64_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint64_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__bnot_uint64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__bnot_uint64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__bnot_uint64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint8_uint8.c index c20360a117..4cb832d3cb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__bnot_uint8_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__bnot_uint8_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__bnot_uint8_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__bnot_uint8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__bnot_uint8_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__carg_fp32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__carg_fp32_fc32.c index 9e2770a0ad..c5dbfe636c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__carg_fp32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__carg_fp32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__carg_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__carg_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__carg_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__carg_fp64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__carg_fp64_fc64.c index 4056f098bf..0e4be7526c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__carg_fp64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__carg_fp64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__carg_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__carg_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__carg_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp32_fp32.c index e14d94ba45..3f00e6abae 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cbrt_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cbrt_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cbrt_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp64_fp64.c index 39e5aba1e7..7c4407802d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cbrt_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cbrt_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cbrt_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cbrt_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ceil_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__ceil_fc32_fc32.c index 5bebe99800..e1e77fdcbd 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ceil_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ceil_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ceil_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ceil_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ceil_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ceil_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__ceil_fc64_fc64.c index 2b560186a4..33ada8da11 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ceil_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ceil_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ceil_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ceil_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ceil_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ceil_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__ceil_fp32_fp32.c index 0c87f67be9..f3d46a7f6e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ceil_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ceil_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ceil_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ceil_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ceil_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__ceil_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__ceil_fp64_fp64.c index 750b30dd64..83312df65a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__ceil_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__ceil_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__ceil_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__ceil_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__ceil_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cimag_fp32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__cimag_fp32_fc32.c index 5b341ae818..86a1c0c956 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cimag_fp32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cimag_fp32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cimag_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cimag_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cimag_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cimag_fp64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__cimag_fp64_fc64.c index c00496b0dc..d925d9addd 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cimag_fp64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cimag_fp64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cimag_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cimag_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cimag_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__conj_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__conj_fc32_fc32.c index 876cb44aee..d27f807c40 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__conj_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__conj_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__conj_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__conj_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__conj_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__conj_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__conj_fc64_fc64.c index fde9949f78..a749fd9737 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__conj_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__conj_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__conj_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__conj_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__conj_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cos_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__cos_fc32_fc32.c index 323b9fba87..6abd4648f9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cos_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cos_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cos_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cos_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cos_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cos_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__cos_fc64_fc64.c index 2ec9f032be..519c514ef5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cos_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cos_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cos_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cos_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cos_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cos_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__cos_fp32_fp32.c index 259a241320..cfc971e815 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cos_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cos_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cos_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cos_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cos_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cos_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__cos_fp64_fp64.c index 0d413395dd..827781e1e8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cos_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cos_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cos_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cos_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cos_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cosh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__cosh_fc32_fc32.c index c57d7a1b80..27060db1f9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cosh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cosh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cosh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cosh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cosh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cosh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__cosh_fc64_fc64.c index 63d889041a..ec5eef8651 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cosh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cosh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cosh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cosh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cosh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cosh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__cosh_fp32_fp32.c index f7f631a142..4bfc01597c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cosh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cosh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cosh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cosh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cosh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__cosh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__cosh_fp64_fp64.c index 526a35dba3..2b29682b13 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__cosh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__cosh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__cosh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__cosh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__cosh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__creal_fp32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__creal_fp32_fc32.c index 2fea8b6067..85af22d087 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__creal_fp32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__creal_fp32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__creal_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__creal_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__creal_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__creal_fp64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__creal_fp64_fc64.c index 673bcd5806..916b9fe0d0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__creal_fp64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__creal_fp64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__creal_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__creal_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__creal_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__erf_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__erf_fp32_fp32.c index 06cd176322..323ecf99e1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__erf_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__erf_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__erf_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__erf_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__erf_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__erf_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__erf_fp64_fp64.c index c2ba605c3a..8ca12c0e15 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__erf_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__erf_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__erf_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__erf_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__erf_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__erfc_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__erfc_fp32_fp32.c index 62d8d29819..f1cbc023a0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__erfc_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__erfc_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__erfc_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__erfc_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__erfc_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__erfc_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__erfc_fp64_fp64.c index 37c22c6517..cc066ddfe7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__erfc_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__erfc_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__erfc_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__erfc_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__erfc_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp2_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__exp2_fc32_fc32.c index a79e1e7ae9..0099994b0c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp2_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp2_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp2_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp2_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp2_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp2_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__exp2_fc64_fc64.c index 44418858c3..ef222ba5b1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp2_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp2_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp2_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp2_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp2_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp2_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__exp2_fp32_fp32.c index 7fe73a627c..265855c6aa 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp2_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp2_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp2_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp2_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp2_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp2_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__exp2_fp64_fp64.c index 81aea7287d..85690738a1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp2_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp2_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp2_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp2_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp2_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__exp_fc32_fc32.c index 4d50e636e2..7699316b55 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__exp_fc64_fc64.c index 9afd6a66e7..b35842afae 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__exp_fp32_fp32.c index a8ee4f16e6..1f60635685 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__exp_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__exp_fp64_fp64.c index 4ecf2a6ca7..1be640b952 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__exp_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__exp_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__exp_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__exp_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__exp_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__expm1_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__expm1_fc32_fc32.c index 3711af2009..e3bcdb4b6d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__expm1_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__expm1_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__expm1_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__expm1_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__expm1_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__expm1_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__expm1_fc64_fc64.c index bd09610727..b2c0ea9f1d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__expm1_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__expm1_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__expm1_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__expm1_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__expm1_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__expm1_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__expm1_fp32_fp32.c index cf154322e2..d79fd31789 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__expm1_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__expm1_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__expm1_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__expm1_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__expm1_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__expm1_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__expm1_fp64_fp64.c index 522b753169..cf973125a1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__expm1_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__expm1_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__expm1_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__expm1_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__expm1_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__floor_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__floor_fc32_fc32.c index 078d464000..0bb804a52c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__floor_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__floor_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__floor_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__floor_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__floor_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__floor_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__floor_fc64_fc64.c index fc42750479..91fd3a4321 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__floor_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__floor_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__floor_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__floor_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__floor_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__floor_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__floor_fp32_fp32.c index 3c4d38ad62..498e7a08ce 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__floor_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__floor_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__floor_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__floor_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__floor_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__floor_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__floor_fp64_fp64.c index 7abd978cb6..5ce90e026f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__floor_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__floor_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__floor_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__floor_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__floor_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp32_fp32.c index dc0b3156b2..65541dc8c4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__frexpe_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__frexpe_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__frexpe_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp64_fp64.c index 7d98a773a8..49ba658848 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__frexpe_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__frexpe_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__frexpe_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__frexpe_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp32_fp32.c index a5a8da913b..8040a55bc0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__frexpx_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__frexpx_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__frexpx_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp64_fp64.c index b1b1dac1b4..e1aa847a6a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__frexpx_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__frexpx_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__frexpx_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__frexpx_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_bool.c index bdea7fcb77..2b0efcd6f6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_bool_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_bool_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc32.c index 5113d12566..5709d1c6ab 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc64.c index 30b4f95585..5e40142dc1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp32.c index 5c3321d388..444f78738a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp64.c index 75275da8e3..8930ac429a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int16.c index c22885ba7a..9638204eae 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int32.c index efc7e93871..4cc2926842 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int64.c index d3f3a0f038..7273a3148e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int8.c index 26c52eb9d5..b57f420383 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint16.c index bbc93be5a4..be59c65392 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint32.c index a86a5e62c2..a91cdee3da 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint64.c index 6a04376765..0d8df0ed23 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint8.c index 40ec6695af..1666f143f0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_bool_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_bool_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_bool_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_bool.c index 17895dee8d..47cbe6dc88 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc32.c index 00453a4bc6..ab7ddd9c47 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc64.c index bd894af04a..8fcb1a9df4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp32.c index e563f2b99d..673e8cafd5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp64.c index 9c740910e7..75eb011b0e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int16.c index 51d70b99b2..07f8daf599 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int32.c index 998375d47e..8e069c14a9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int64.c index eac4d8e368..4fef50682a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int8.c index f1b818302e..d69de84b7b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint16.c index a83e2018d9..ba9c405472 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint32.c index 0580b9982b..61e9f2e562 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint64.c index 65e4387ff2..bdfe8a6362 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint8.c index ed5a3e5169..38a86bbdee 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc32_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_bool.c index 4bc013f9fb..5c21385a01 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc32.c index a0a969427d..d0454c5819 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc64.c index a69d02febc..729b294ec8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp32.c index e81df8a45a..8b3565689e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp64.c index 8d338dffed..c524354ef0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int16.c index e95fa6dffe..b69634fbb7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int32.c index 9ad76b0cc9..bf75535d16 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int64.c index e4fc7baba9..b4cddac7de 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int8.c index 010046580d..1e4c05566f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint16.c index b1eba58571..b6daebf48d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint32.c index e0d5870f8e..49035808f8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint64.c index acd95e6a9b..bac232bf29 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint8.c index a168c889dc..472c7d7ef3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fc64_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fc64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fc64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_bool.c index c92075e7d1..92b3f64ccb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc32.c index 87ca784bb3..ab147815ee 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc64.c index 9d43cc19af..fe3cff5ede 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp32.c index e9c8bd0e13..7c124a4cdb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp64.c index 9c36791ff5..41b95434e7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int16.c index d429fd9e3c..8804bca279 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int32.c index 71211404a4..02a68ac8ad 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int64.c index a3fb88ee2d..73fce70080 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int8.c index a64006d62f..e8e31cd558 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint16.c index bb23cbf6e3..1a388d98e3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint32.c index 9b41df496a..35a0d64726 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint64.c index 705ad19d8c..c69ebebcff 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint8.c index 51b38ba163..f4487fbe98 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp32_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_bool.c index 817f855ce9..d758c046a2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc32.c index bf57979ff8..4963f7e455 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc64.c index e3ad4370ee..9f4187cd0e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp32.c index fc97e38c6c..f157018bed 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp64.c index 6b80334ece..8878b6d070 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int16.c index 5b5fe34ef0..0831ca3330 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int32.c index e321599bd7..16958106b6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int64.c index ef204975da..3a08464a11 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int8.c index 031f124909..3252c3a166 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint16.c index 8d02eea6af..535c5b983d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint32.c index c196c367f7..7dd5689b0c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint64.c index aaa5ce7b72..a5482ff615 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint8.c index 22a7719bb9..e9d3c98f92 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_fp64_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_fp64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_fp64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_bool.c index c9e32f88b7..fda7a865c7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc32.c index c8986e7f69..1ee66c5abc 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc64.c index 0f681ac923..afe97f0708 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp32.c index 1d0f86b02b..e00a2cbc6d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp64.c index 836c68968b..8f844e0dc9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int16.c index e829218e80..d01dbc2ad8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_int16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int32.c index ae5436d67a..ce19ce4fc9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int64.c index 3efb662f98..ed3f2ac7ef 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int8.c index 6469bb6e30..e38ae1847f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint16.c index 6f353bcc90..fa74a8f8ea 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint32.c index a6b1f791bc..69f7276764 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint64.c index d21a272d40..5eae7ba776 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint8.c index 53f68278b6..276a22f0cb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int16_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int16_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int16_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_bool.c index 8443947fd8..e6db953373 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc32.c index 5919ab38f6..b698d61bf9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc64.c index 431a8edfbe..4a0ac18d0d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp32.c index fc5afc2ed1..d2c9ab7583 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp64.c index fa2a524fe5..1fb290121c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int16.c index 7370b6ab4c..3bd7a8b308 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int32.c index c63bc3d42d..052a99e261 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_int32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int64.c index 11363f7bdd..abe6572b73 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int8.c index 155c4c6aec..fc5917deb4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint16.c index 90b0eae678..3d05e706d2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint32.c index 01a2acda8d..3f924597a3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint64.c index e29ed504eb..c5145fbbac 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint8.c index 9a323b60ae..41715c3f7b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int32_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_bool.c index d5944af3c7..89dad48c5a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc32.c index b5aa20abc2..5900dacd7d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc64.c index 07d15f129a..c8388ef22d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp32.c index 4811e69da2..3420c92f94 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp64.c index 9f49c47f8a..010f3e267c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int16.c index 15fa0f1221..a8888a5ff0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int32.c index 988a75fd38..7ad03a9495 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int64.c index 1d903a6a98..e64909c020 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_int64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int8.c index 289453af3f..2697dd9137 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint16.c index 39f0cc54f9..fbbe991a0b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint32.c index e120e21535..0b149897dc 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint64.c index 98a0706ffd..79c442de3d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint8.c index 2f53242337..584099b842 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int64_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_bool.c index e8190453e7..1952b082be 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc32.c index 859968fddb..329f6ad3bc 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc64.c index dc6825574e..a4c70d997c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp32.c index dd5c4b9eeb..bc28dd8584 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp64.c index 48938e579a..e1c6eca2c6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int16.c index c279e042ea..ab1929c096 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int32.c index dda7e65771..faa0341476 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int64.c index 77ba4ebf14..0451763edf 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int8.c index 86cf401b75..89efb3123b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_int8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint16.c index ee6ff12194..a572be497d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint32.c index ceb90934eb..bbc785a6e6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint64.c index a18b2ca1d8..f36076e4a1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint8.c index f6265cb40e..bee2c04bbf 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_int8_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE int8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_int8_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_int8_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_bool.c index 55a111ff6c..f862300d99 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc32.c index eb624dd3d8..292533fa0c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc64.c index 6c63c931c2..d27b744240 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp32.c index 39ac69b162..7afb1f9d2d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp64.c index c492b251dc..8cda8cf4d2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int16.c index 9e9d94f36f..43fcd175d1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int32.c index 81a9afa03e..f8ad294791 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int64.c index bc6203ffe0..c63e253030 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int8.c index 374aead75b..c9d86d943e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint16.c index 3a3c50e0eb..54bb0e4800 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_uint16_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint32.c index fff0fa3a40..dff1af6e3f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint64.c index 981395c664..7d9dd963b2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint8.c index 42ee9b3b8f..c5423ab304 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint16_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint16_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint16_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint16_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_bool.c index 6d5fcdee52..d0653f4bfe 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc32.c index 4655828a85..7aad094b25 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc64.c index c78bb742ba..dcd4278e16 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp32.c index 369b6deba8..4eeaa475bb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp64.c index c928db5b1a..d001d45f3f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int16.c index aba3a1a396..574fb6cf3f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int32.c index 6f4b1d43d1..5f514fe0d2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int64.c index 8200856727..9947cffa08 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int8.c index c69768bc92..2acd98fea5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint16.c index 57b862719b..442866dac8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint32.c index b8f29836c9..a087f1c3f1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_uint32_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint64.c index db87322c5e..68f83b0de7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint8.c index b1644e80dc..9f7e53cd7d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint32_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint32_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_bool.c index 5257d49f74..cff480dc39 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc32.c index a120d84c1b..d2ee406d31 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc64.c index ae1a440c64..2174c879ce 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp32.c index 6fa2b3635a..3bded2da38 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp64.c index 5061442764..044a9c0950 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int16.c index c02a725c47..9f97dc5f56 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int32.c index 86997706ae..eebf76c429 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int64.c index 64d8e6042d..a9e8a77e3f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int8.c index 8e1991e760..d827e01896 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint16.c index a43f90e52a..eace39445e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint32.c index b497ded794..35cf8a07e8 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint64.c index 2d2ae6a585..a6361a1ae5 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_uint64_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint8.c index fdbfd60457..231ba37436 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint64_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint64_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_bool.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_bool.c index 70173f6e56..f807d866cd 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc32.c index 6e9cbcc469..b763e786e1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc64.c index fb664f7e0e..40b1d8a83d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp32.c index 48291aee68..5f6f3b0b37 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp64.c index 2aa1773058..db04cb2a2b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int16.c index 169f3bb1d0..b195e411c1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int32.c index 3086d25ea6..140d475078 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int64.c index d2d6d1e131..a6a3db8ef6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int8.c index 0a4a3a4821..89fbdc2f0f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_int8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint16.c index e19ae520c6..7f15390970 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint16.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint16.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint32.c index 63815606f5..f030018665 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint64.c index 6333a5a3e7..0a1e296156 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -61,7 +62,7 @@ GrB_Info GB (_uop_apply__identity_uint8_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -74,7 +75,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -83,10 +84,13 @@ GrB_Info GB (_uop_tran__identity_uint8_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint8.c index ebebb29613..4edb4dfb3c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint8.c +++ b/GraphBLAS/FactoryKernels/GB_uop__identity_uint8_uint8.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ // C matrix #define GB_C_TYPE uint8_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -53,7 +54,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -62,10 +63,13 @@ GrB_Info GB (_uop_tran__identity_uint8_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__include.h b/GraphBLAS/FactoryKernels/GB_uop__include.h index 5d051c3229..47dab8af81 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__include.h +++ b/GraphBLAS/FactoryKernels/GB_uop__include.h @@ -2,7 +2,7 @@ // GB_uop__include.h: definitions for GB_uop__*.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_uop.h @@ -13,7 +13,7 @@ GrB_Info GB (_uop_tran__identity_bool_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33,7 +33,7 @@ GrB_Info GB (_uop_tran__identity_bool_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -53,7 +53,7 @@ GrB_Info GB (_uop_tran__identity_bool_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -73,7 +73,7 @@ GrB_Info GB (_uop_tran__identity_bool_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -93,7 +93,7 @@ GrB_Info GB (_uop_tran__identity_bool_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -113,7 +113,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -133,7 +133,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -153,7 +153,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -173,7 +173,7 @@ GrB_Info GB (_uop_tran__identity_bool_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -193,7 +193,7 @@ GrB_Info GB (_uop_tran__identity_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -213,7 +213,7 @@ GrB_Info GB (_uop_tran__identity_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -233,7 +233,7 @@ GrB_Info GB (_uop_tran__identity_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -253,7 +253,7 @@ GrB_Info GB (_uop_tran__identity_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -273,7 +273,7 @@ GrB_Info GB (_uop_tran__identity_int8_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -284,7 +284,7 @@ GrB_Info GB (_uop_tran__identity_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -304,7 +304,7 @@ GrB_Info GB (_uop_tran__identity_int8_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -324,7 +324,7 @@ GrB_Info GB (_uop_tran__identity_int8_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -344,7 +344,7 @@ GrB_Info GB (_uop_tran__identity_int8_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -364,7 +364,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -384,7 +384,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -404,7 +404,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -424,7 +424,7 @@ GrB_Info GB (_uop_tran__identity_int8_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -444,7 +444,7 @@ GrB_Info GB (_uop_tran__identity_int8_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -464,7 +464,7 @@ GrB_Info GB (_uop_tran__identity_int8_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -484,7 +484,7 @@ GrB_Info GB (_uop_tran__identity_int8_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -504,7 +504,7 @@ GrB_Info GB (_uop_tran__identity_int8_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -524,7 +524,7 @@ GrB_Info GB (_uop_tran__identity_int16_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -544,7 +544,7 @@ GrB_Info GB (_uop_tran__identity_int16_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -555,7 +555,7 @@ GrB_Info GB (_uop_tran__identity_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -575,7 +575,7 @@ GrB_Info GB (_uop_tran__identity_int16_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -595,7 +595,7 @@ GrB_Info GB (_uop_tran__identity_int16_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -615,7 +615,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -635,7 +635,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -655,7 +655,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -675,7 +675,7 @@ GrB_Info GB (_uop_tran__identity_int16_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -695,7 +695,7 @@ GrB_Info GB (_uop_tran__identity_int16_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -715,7 +715,7 @@ GrB_Info GB (_uop_tran__identity_int16_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -735,7 +735,7 @@ GrB_Info GB (_uop_tran__identity_int16_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -755,7 +755,7 @@ GrB_Info GB (_uop_tran__identity_int16_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -775,7 +775,7 @@ GrB_Info GB (_uop_tran__identity_int32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -795,7 +795,7 @@ GrB_Info GB (_uop_tran__identity_int32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -815,7 +815,7 @@ GrB_Info GB (_uop_tran__identity_int32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -826,7 +826,7 @@ GrB_Info GB (_uop_tran__identity_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -846,7 +846,7 @@ GrB_Info GB (_uop_tran__identity_int32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -866,7 +866,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -886,7 +886,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -906,7 +906,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -926,7 +926,7 @@ GrB_Info GB (_uop_tran__identity_int32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -946,7 +946,7 @@ GrB_Info GB (_uop_tran__identity_int32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -966,7 +966,7 @@ GrB_Info GB (_uop_tran__identity_int32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -986,7 +986,7 @@ GrB_Info GB (_uop_tran__identity_int32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1006,7 +1006,7 @@ GrB_Info GB (_uop_tran__identity_int32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1026,7 +1026,7 @@ GrB_Info GB (_uop_tran__identity_int64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1046,7 +1046,7 @@ GrB_Info GB (_uop_tran__identity_int64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1066,7 +1066,7 @@ GrB_Info GB (_uop_tran__identity_int64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1086,7 +1086,7 @@ GrB_Info GB (_uop_tran__identity_int64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1097,7 +1097,7 @@ GrB_Info GB (_uop_tran__identity_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1117,7 +1117,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1137,7 +1137,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1157,7 +1157,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1177,7 +1177,7 @@ GrB_Info GB (_uop_tran__identity_int64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1197,7 +1197,7 @@ GrB_Info GB (_uop_tran__identity_int64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1217,7 +1217,7 @@ GrB_Info GB (_uop_tran__identity_int64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1237,7 +1237,7 @@ GrB_Info GB (_uop_tran__identity_int64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1257,7 +1257,7 @@ GrB_Info GB (_uop_tran__identity_int64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1277,7 +1277,7 @@ GrB_Info GB (_uop_tran__identity_uint8_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1297,7 +1297,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1317,7 +1317,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1337,7 +1337,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1357,7 +1357,7 @@ GrB_Info GB (_uop_tran__identity_uint8_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1368,7 +1368,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1388,7 +1388,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1408,7 +1408,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1428,7 +1428,7 @@ GrB_Info GB (_uop_tran__identity_uint8_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1448,7 +1448,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1468,7 +1468,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1488,7 +1488,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1508,7 +1508,7 @@ GrB_Info GB (_uop_tran__identity_uint8_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1528,7 +1528,7 @@ GrB_Info GB (_uop_tran__identity_uint16_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1548,7 +1548,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1568,7 +1568,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1588,7 +1588,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1608,7 +1608,7 @@ GrB_Info GB (_uop_tran__identity_uint16_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1628,7 +1628,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1639,7 +1639,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1659,7 +1659,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1679,7 +1679,7 @@ GrB_Info GB (_uop_tran__identity_uint16_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1699,7 +1699,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1719,7 +1719,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1739,7 +1739,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1759,7 +1759,7 @@ GrB_Info GB (_uop_tran__identity_uint16_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1779,7 +1779,7 @@ GrB_Info GB (_uop_tran__identity_uint32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1799,7 +1799,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1819,7 +1819,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1839,7 +1839,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1859,7 +1859,7 @@ GrB_Info GB (_uop_tran__identity_uint32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1879,7 +1879,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1899,7 +1899,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1910,7 +1910,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1930,7 +1930,7 @@ GrB_Info GB (_uop_tran__identity_uint32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1950,7 +1950,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1970,7 +1970,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1990,7 +1990,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2010,7 +2010,7 @@ GrB_Info GB (_uop_tran__identity_uint32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2030,7 +2030,7 @@ GrB_Info GB (_uop_tran__identity_uint64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2050,7 +2050,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2070,7 +2070,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2090,7 +2090,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2110,7 +2110,7 @@ GrB_Info GB (_uop_tran__identity_uint64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2130,7 +2130,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2150,7 +2150,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2170,7 +2170,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2181,7 +2181,7 @@ GrB_Info GB (_uop_tran__identity_uint64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2201,7 +2201,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2221,7 +2221,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2241,7 +2241,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2261,7 +2261,7 @@ GrB_Info GB (_uop_tran__identity_uint64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2281,7 +2281,7 @@ GrB_Info GB (_uop_tran__identity_fp32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2301,7 +2301,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2321,7 +2321,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2341,7 +2341,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2361,7 +2361,7 @@ GrB_Info GB (_uop_tran__identity_fp32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2381,7 +2381,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2401,7 +2401,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2421,7 +2421,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2441,7 +2441,7 @@ GrB_Info GB (_uop_tran__identity_fp32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2452,7 +2452,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2472,7 +2472,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2492,7 +2492,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2512,7 +2512,7 @@ GrB_Info GB (_uop_tran__identity_fp32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2532,7 +2532,7 @@ GrB_Info GB (_uop_tran__identity_fp64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2552,7 +2552,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2572,7 +2572,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2592,7 +2592,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2612,7 +2612,7 @@ GrB_Info GB (_uop_tran__identity_fp64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2632,7 +2632,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2652,7 +2652,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2672,7 +2672,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2692,7 +2692,7 @@ GrB_Info GB (_uop_tran__identity_fp64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2712,7 +2712,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2723,7 +2723,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2743,7 +2743,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2763,7 +2763,7 @@ GrB_Info GB (_uop_tran__identity_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2783,7 +2783,7 @@ GrB_Info GB (_uop_tran__identity_fc32_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2803,7 +2803,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2823,7 +2823,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2843,7 +2843,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2863,7 +2863,7 @@ GrB_Info GB (_uop_tran__identity_fc32_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2883,7 +2883,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2903,7 +2903,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2923,7 +2923,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2943,7 +2943,7 @@ GrB_Info GB (_uop_tran__identity_fc32_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2963,7 +2963,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2983,7 +2983,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -2994,7 +2994,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3014,7 +3014,7 @@ GrB_Info GB (_uop_tran__identity_fc32_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3034,7 +3034,7 @@ GrB_Info GB (_uop_tran__identity_fc64_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3054,7 +3054,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3074,7 +3074,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3094,7 +3094,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3114,7 +3114,7 @@ GrB_Info GB (_uop_tran__identity_fc64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3134,7 +3134,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3154,7 +3154,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3174,7 +3174,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3194,7 +3194,7 @@ GrB_Info GB (_uop_tran__identity_fc64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3214,7 +3214,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3234,7 +3234,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3254,7 +3254,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3265,27 +3265,7 @@ GrB_Info GB (_uop_tran__identity_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__ainv_bool_bool) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__ainv_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3305,7 +3285,7 @@ GrB_Info GB (_uop_tran__ainv_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3325,7 +3305,7 @@ GrB_Info GB (_uop_tran__ainv_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3345,7 +3325,7 @@ GrB_Info GB (_uop_tran__ainv_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3365,87 +3345,7 @@ GrB_Info GB (_uop_tran__ainv_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__ainv_uint8_uint8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__ainv_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__ainv_uint16_uint16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__ainv_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__ainv_uint32_uint32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__ainv_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__ainv_uint64_uint64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__ainv_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3465,7 +3365,7 @@ GrB_Info GB (_uop_tran__ainv_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3485,7 +3385,7 @@ GrB_Info GB (_uop_tran__ainv_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3505,7 +3405,7 @@ GrB_Info GB (_uop_tran__ainv_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3525,27 +3425,7 @@ GrB_Info GB (_uop_tran__ainv_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__abs_bool_bool) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__abs_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3565,7 +3445,7 @@ GrB_Info GB (_uop_tran__abs_int8_int8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3585,7 +3465,7 @@ GrB_Info GB (_uop_tran__abs_int16_int16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3605,7 +3485,7 @@ GrB_Info GB (_uop_tran__abs_int32_int32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3625,87 +3505,7 @@ GrB_Info GB (_uop_tran__abs_int64_int64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__abs_uint8_uint8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__abs_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__abs_uint16_uint16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__abs_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__abs_uint32_uint32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__abs_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__abs_uint64_uint64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__abs_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3725,7 +3525,7 @@ GrB_Info GB (_uop_tran__abs_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -3745,94 +3545,14 @@ GrB_Info GB (_uop_tran__abs_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_bool_bool) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_int8_int8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_int16_int16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_int32_int32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads ) ; -GrB_Info GB (_uop_apply__minv_int64_int64) +GrB_Info GB (_uop_apply__minv_fp32_fp32) ( GB_void *Cx, const GB_void *Ax, @@ -3841,18 +3561,18 @@ GrB_Info GB (_uop_apply__minv_int64_int64) int nthreads ) ; -GrB_Info GB (_uop_tran__minv_int64_int64) +GrB_Info GB (_uop_tran__minv_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads ) ; -GrB_Info GB (_uop_apply__minv_uint8_uint8) +GrB_Info GB (_uop_apply__minv_fp64_fp64) ( GB_void *Cx, const GB_void *Ax, @@ -3861,18 +3581,18 @@ GrB_Info GB (_uop_apply__minv_uint8_uint8) int nthreads ) ; -GrB_Info GB (_uop_tran__minv_uint8_uint8) +GrB_Info GB (_uop_tran__minv_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads ) ; -GrB_Info GB (_uop_apply__minv_uint16_uint16) +GrB_Info GB (_uop_apply__minv_fc32_fc32) ( GB_void *Cx, const GB_void *Ax, @@ -3881,18 +3601,18 @@ GrB_Info GB (_uop_apply__minv_uint16_uint16) int nthreads ) ; -GrB_Info GB (_uop_tran__minv_uint16_uint16) +GrB_Info GB (_uop_tran__minv_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads ) ; -GrB_Info GB (_uop_apply__minv_uint32_uint32) +GrB_Info GB (_uop_apply__minv_fc64_fc64) ( GB_void *Cx, const GB_void *Ax, @@ -3901,118 +3621,18 @@ GrB_Info GB (_uop_apply__minv_uint32_uint32) int nthreads ) ; -GrB_Info GB (_uop_tran__minv_uint32_uint32) +GrB_Info GB (_uop_tran__minv_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads ) ; -GrB_Info GB (_uop_apply__minv_uint64_uint64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_fp32_fp32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_fp32_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_fp64_fp64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_fp64_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_fc32_fc32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_fc32_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__minv_fc64_fc64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__minv_fc64_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_bool_bool) +GrB_Info GB (_uop_apply__lnot_bool_bool) ( GB_void *Cx, const GB_void *Ax, @@ -4025,287 +3645,7 @@ GrB_Info GB (_uop_tran__lnot_bool_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_int8_int8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_int16_int16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_int32_int32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_int64_int64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_int64_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_uint8_uint8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_uint16_uint16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_uint32_uint32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_uint64_uint64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_fp32_fp32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_fp32_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__lnot_fp64_fp64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__lnot_fp64_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__bnot_int8_int8) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__bnot_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__bnot_int16_int16) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__bnot_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__bnot_int32_int32) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__bnot_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_uop_apply__bnot_int64_int64) -( - GB_void *Cx, - const GB_void *Ax, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_uop_tran__bnot_int64_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4325,7 +3665,7 @@ GrB_Info GB (_uop_tran__bnot_uint8_uint8) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4345,7 +3685,7 @@ GrB_Info GB (_uop_tran__bnot_uint16_uint16) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4365,7 +3705,7 @@ GrB_Info GB (_uop_tran__bnot_uint32_uint32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4385,7 +3725,7 @@ GrB_Info GB (_uop_tran__bnot_uint64_uint64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4405,7 +3745,7 @@ GrB_Info GB (_uop_tran__sqrt_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4425,7 +3765,7 @@ GrB_Info GB (_uop_tran__sqrt_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4445,7 +3785,7 @@ GrB_Info GB (_uop_tran__sqrt_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4465,7 +3805,7 @@ GrB_Info GB (_uop_tran__sqrt_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4485,7 +3825,7 @@ GrB_Info GB (_uop_tran__log_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4505,7 +3845,7 @@ GrB_Info GB (_uop_tran__log_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4525,7 +3865,7 @@ GrB_Info GB (_uop_tran__log_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4545,7 +3885,7 @@ GrB_Info GB (_uop_tran__log_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4565,7 +3905,7 @@ GrB_Info GB (_uop_tran__exp_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4585,7 +3925,7 @@ GrB_Info GB (_uop_tran__exp_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4605,7 +3945,7 @@ GrB_Info GB (_uop_tran__exp_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4625,7 +3965,7 @@ GrB_Info GB (_uop_tran__exp_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4645,7 +3985,7 @@ GrB_Info GB (_uop_tran__sin_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4665,7 +4005,7 @@ GrB_Info GB (_uop_tran__sin_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4685,7 +4025,7 @@ GrB_Info GB (_uop_tran__sin_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4705,7 +4045,7 @@ GrB_Info GB (_uop_tran__sin_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4725,7 +4065,7 @@ GrB_Info GB (_uop_tran__cos_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4745,7 +4085,7 @@ GrB_Info GB (_uop_tran__cos_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4765,7 +4105,7 @@ GrB_Info GB (_uop_tran__cos_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4785,7 +4125,7 @@ GrB_Info GB (_uop_tran__cos_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4805,7 +4145,7 @@ GrB_Info GB (_uop_tran__tan_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4825,7 +4165,7 @@ GrB_Info GB (_uop_tran__tan_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4845,7 +4185,7 @@ GrB_Info GB (_uop_tran__tan_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4865,7 +4205,7 @@ GrB_Info GB (_uop_tran__tan_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4885,7 +4225,7 @@ GrB_Info GB (_uop_tran__asin_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4905,7 +4245,7 @@ GrB_Info GB (_uop_tran__asin_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4925,7 +4265,7 @@ GrB_Info GB (_uop_tran__asin_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4945,7 +4285,7 @@ GrB_Info GB (_uop_tran__asin_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4965,7 +4305,7 @@ GrB_Info GB (_uop_tran__acos_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -4985,7 +4325,7 @@ GrB_Info GB (_uop_tran__acos_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5005,7 +4345,7 @@ GrB_Info GB (_uop_tran__acos_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5025,7 +4365,7 @@ GrB_Info GB (_uop_tran__acos_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5045,7 +4385,7 @@ GrB_Info GB (_uop_tran__atan_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5065,7 +4405,7 @@ GrB_Info GB (_uop_tran__atan_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5085,7 +4425,7 @@ GrB_Info GB (_uop_tran__atan_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5105,7 +4445,7 @@ GrB_Info GB (_uop_tran__atan_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5125,7 +4465,7 @@ GrB_Info GB (_uop_tran__sinh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5145,7 +4485,7 @@ GrB_Info GB (_uop_tran__sinh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5165,7 +4505,7 @@ GrB_Info GB (_uop_tran__sinh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5185,7 +4525,7 @@ GrB_Info GB (_uop_tran__sinh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5205,7 +4545,7 @@ GrB_Info GB (_uop_tran__cosh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5225,7 +4565,7 @@ GrB_Info GB (_uop_tran__cosh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5245,7 +4585,7 @@ GrB_Info GB (_uop_tran__cosh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5265,7 +4605,7 @@ GrB_Info GB (_uop_tran__cosh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5285,7 +4625,7 @@ GrB_Info GB (_uop_tran__tanh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5305,7 +4645,7 @@ GrB_Info GB (_uop_tran__tanh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5325,7 +4665,7 @@ GrB_Info GB (_uop_tran__tanh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5345,7 +4685,7 @@ GrB_Info GB (_uop_tran__tanh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5365,7 +4705,7 @@ GrB_Info GB (_uop_tran__asinh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5385,7 +4725,7 @@ GrB_Info GB (_uop_tran__asinh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5405,7 +4745,7 @@ GrB_Info GB (_uop_tran__asinh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5425,7 +4765,7 @@ GrB_Info GB (_uop_tran__asinh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5445,7 +4785,7 @@ GrB_Info GB (_uop_tran__acosh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5465,7 +4805,7 @@ GrB_Info GB (_uop_tran__acosh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5485,7 +4825,7 @@ GrB_Info GB (_uop_tran__acosh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5505,7 +4845,7 @@ GrB_Info GB (_uop_tran__acosh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5525,7 +4865,7 @@ GrB_Info GB (_uop_tran__atanh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5545,7 +4885,7 @@ GrB_Info GB (_uop_tran__atanh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5565,7 +4905,7 @@ GrB_Info GB (_uop_tran__atanh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5585,7 +4925,7 @@ GrB_Info GB (_uop_tran__atanh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5605,7 +4945,7 @@ GrB_Info GB (_uop_tran__signum_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5625,7 +4965,7 @@ GrB_Info GB (_uop_tran__signum_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5645,7 +4985,7 @@ GrB_Info GB (_uop_tran__signum_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5665,7 +5005,7 @@ GrB_Info GB (_uop_tran__signum_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5685,7 +5025,7 @@ GrB_Info GB (_uop_tran__ceil_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5705,7 +5045,7 @@ GrB_Info GB (_uop_tran__ceil_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5725,7 +5065,7 @@ GrB_Info GB (_uop_tran__ceil_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5745,7 +5085,7 @@ GrB_Info GB (_uop_tran__ceil_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5765,7 +5105,7 @@ GrB_Info GB (_uop_tran__floor_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5785,7 +5125,7 @@ GrB_Info GB (_uop_tran__floor_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5805,7 +5145,7 @@ GrB_Info GB (_uop_tran__floor_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5825,7 +5165,7 @@ GrB_Info GB (_uop_tran__floor_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5845,7 +5185,7 @@ GrB_Info GB (_uop_tran__round_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5865,7 +5205,7 @@ GrB_Info GB (_uop_tran__round_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5885,7 +5225,7 @@ GrB_Info GB (_uop_tran__round_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5905,7 +5245,7 @@ GrB_Info GB (_uop_tran__round_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5925,7 +5265,7 @@ GrB_Info GB (_uop_tran__trunc_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5945,7 +5285,7 @@ GrB_Info GB (_uop_tran__trunc_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5965,7 +5305,7 @@ GrB_Info GB (_uop_tran__trunc_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -5985,7 +5325,7 @@ GrB_Info GB (_uop_tran__trunc_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6005,7 +5345,7 @@ GrB_Info GB (_uop_tran__exp2_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6025,7 +5365,7 @@ GrB_Info GB (_uop_tran__exp2_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6045,7 +5385,7 @@ GrB_Info GB (_uop_tran__exp2_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6065,7 +5405,7 @@ GrB_Info GB (_uop_tran__exp2_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6085,7 +5425,7 @@ GrB_Info GB (_uop_tran__expm1_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6105,7 +5445,7 @@ GrB_Info GB (_uop_tran__expm1_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6125,7 +5465,7 @@ GrB_Info GB (_uop_tran__expm1_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6145,7 +5485,7 @@ GrB_Info GB (_uop_tran__expm1_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6165,7 +5505,7 @@ GrB_Info GB (_uop_tran__log10_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6185,7 +5525,7 @@ GrB_Info GB (_uop_tran__log10_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6205,7 +5545,7 @@ GrB_Info GB (_uop_tran__log10_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6225,7 +5565,7 @@ GrB_Info GB (_uop_tran__log10_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6245,7 +5585,7 @@ GrB_Info GB (_uop_tran__log1p_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6265,7 +5605,7 @@ GrB_Info GB (_uop_tran__log1p_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6285,7 +5625,7 @@ GrB_Info GB (_uop_tran__log1p_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6305,7 +5645,7 @@ GrB_Info GB (_uop_tran__log1p_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6325,7 +5665,7 @@ GrB_Info GB (_uop_tran__log2_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6345,7 +5685,7 @@ GrB_Info GB (_uop_tran__log2_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6365,7 +5705,7 @@ GrB_Info GB (_uop_tran__log2_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6385,7 +5725,7 @@ GrB_Info GB (_uop_tran__log2_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6405,7 +5745,7 @@ GrB_Info GB (_uop_tran__frexpx_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6425,7 +5765,7 @@ GrB_Info GB (_uop_tran__frexpx_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6445,7 +5785,7 @@ GrB_Info GB (_uop_tran__frexpe_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6465,7 +5805,7 @@ GrB_Info GB (_uop_tran__frexpe_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6485,7 +5825,7 @@ GrB_Info GB (_uop_tran__lgamma_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6505,7 +5845,7 @@ GrB_Info GB (_uop_tran__lgamma_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6525,7 +5865,7 @@ GrB_Info GB (_uop_tran__tgamma_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6545,7 +5885,7 @@ GrB_Info GB (_uop_tran__tgamma_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6565,7 +5905,7 @@ GrB_Info GB (_uop_tran__erf_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6585,7 +5925,7 @@ GrB_Info GB (_uop_tran__erf_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6605,7 +5945,7 @@ GrB_Info GB (_uop_tran__erfc_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6625,7 +5965,7 @@ GrB_Info GB (_uop_tran__erfc_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6645,7 +5985,7 @@ GrB_Info GB (_uop_tran__cbrt_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6665,7 +6005,7 @@ GrB_Info GB (_uop_tran__cbrt_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6685,7 +6025,7 @@ GrB_Info GB (_uop_tran__conj_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6705,7 +6045,7 @@ GrB_Info GB (_uop_tran__conj_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6725,7 +6065,7 @@ GrB_Info GB (_uop_tran__abs_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6745,7 +6085,7 @@ GrB_Info GB (_uop_tran__abs_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6765,7 +6105,7 @@ GrB_Info GB (_uop_tran__creal_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6785,7 +6125,7 @@ GrB_Info GB (_uop_tran__creal_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6805,7 +6145,7 @@ GrB_Info GB (_uop_tran__cimag_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6825,7 +6165,7 @@ GrB_Info GB (_uop_tran__cimag_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6845,7 +6185,7 @@ GrB_Info GB (_uop_tran__carg_fp32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6865,7 +6205,7 @@ GrB_Info GB (_uop_tran__carg_fp64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6885,7 +6225,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6905,7 +6245,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6925,7 +6265,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6945,7 +6285,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6965,7 +6305,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -6985,7 +6325,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7005,7 +6345,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7025,7 +6365,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7045,7 +6385,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7065,7 +6405,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7085,7 +6425,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -7105,7 +6445,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads diff --git a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc32.c index 728c077eb9..b616e99626 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isfinite_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc64.c index 466b300cb5..5f241ff60b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isfinite_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp32.c index 6bf21bf5d1..d0664264ee 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isfinite_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp64.c index d515ecb9bb..6e7267c999 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isfinite_bool_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isfinite_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc32.c index 3f4010501a..792244de76 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isinf_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isinf_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc64.c index 3a05b7bc65..a2a4658bc1 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isinf_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isinf_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp32.c index acad9c4f0c..afb5fc3ad9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isinf_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isinf_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp64.c index eebed858d8..abeadafc75 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isinf_bool_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isinf_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isinf_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isinf_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc32.c index 8a626316e4..36a5da1454 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isnan_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isnan_bool_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc64.c index 2a13b9d2cc..61ea3f7e62 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isnan_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isnan_bool_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp32.c index ee391141f4..ce1e7b3b68 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isnan_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isnan_bool_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp64.c index dd3409cc86..c2e0de6505 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__isnan_bool_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__isnan_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__isnan_bool_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__isnan_bool_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp32_fp32.c index f95d93cb2c..67cbb9a93c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__lgamma_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__lgamma_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__lgamma_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp64_fp64.c index 0aaf8aa202..a0be4e4443 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__lgamma_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__lgamma_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__lgamma_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__lgamma_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_bool_bool.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_bool_bool.c index cd58a45527..3646b15b0f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_bool_bool.c +++ b/GraphBLAS/FactoryKernels/GB_uop__lnot_bool_bool.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE bool +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__lnot_bool_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__lnot_bool_bool) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__lnot_bool_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_fp32_fp32.c deleted file mode 100644 index 5b867f7fdd..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_fp32_fp32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_FP32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE float -#define GB_X_TYPE float - -// A matrix -#define GB_A_TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE float - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_fp32_fp32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_fp32_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_fp64_fp64.c deleted file mode 100644 index d2ae4053d2..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_fp64_fp64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_FP64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE double -#define GB_X_TYPE double - -// A matrix -#define GB_A_TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE double - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_fp64_fp64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_fp64_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_int16_int16.c deleted file mode 100644 index acc3644a07..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_int16_int16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t - -// A matrix -#define GB_A_TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_int16_int16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_int32_int32.c deleted file mode 100644 index 314786402a..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_int32_int32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t - -// A matrix -#define GB_A_TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_int32_int32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_int64_int64.c deleted file mode 100644 index 8d3188bd0f..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_int64_int64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t - -// A matrix -#define GB_A_TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_int64_int64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_int64_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_int8_int8.c deleted file mode 100644 index 1ae8ec03d4..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_int8_int8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t - -// A matrix -#define GB_A_TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_int8_int8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_uint16_uint16.c deleted file mode 100644 index 75732cef21..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint16_uint16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t - -// A matrix -#define GB_A_TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_uint16_uint16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_uint32_uint32.c deleted file mode 100644 index 3cfa8c5a4d..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint32_uint32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t - -// A matrix -#define GB_A_TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_uint32_uint32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_uint64_uint64.c deleted file mode 100644 index 216b7c0313..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint64_uint64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t - -// A matrix -#define GB_A_TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_uint64_uint64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__lnot_uint8_uint8.c deleted file mode 100644 index 39675431e3..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__lnot_uint8_uint8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = !(x != 0) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t - -// A matrix -#define GB_A_TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_LNOT) || defined(GxB_NO_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__lnot_uint8_uint8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__lnot_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__log10_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__log10_fc32_fc32.c index 7b7e76bee7..858a7e25b2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log10_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log10_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log10_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log10_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log10_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log10_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__log10_fc64_fc64.c index fd49eb3a2c..1053e49517 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log10_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log10_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log10_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log10_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log10_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log10_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__log10_fp32_fp32.c index 9324adf035..2896d76c87 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log10_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log10_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log10_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log10_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log10_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log10_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__log10_fp64_fp64.c index 34fe814126..0d573b120f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log10_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log10_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log10_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log10_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log10_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log1p_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__log1p_fc32_fc32.c index 3abb25e153..7eea032045 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log1p_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log1p_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log1p_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log1p_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log1p_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log1p_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__log1p_fc64_fc64.c index f6e7aae23a..63a86ce438 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log1p_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log1p_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log1p_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log1p_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log1p_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log1p_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__log1p_fp32_fp32.c index 12924f9984..98b63934d0 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log1p_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log1p_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log1p_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log1p_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log1p_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log1p_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__log1p_fp64_fp64.c index da6c7d4eea..db12c10653 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log1p_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log1p_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log1p_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log1p_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log1p_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log2_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__log2_fc32_fc32.c index 0815f0480f..d69384c3eb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log2_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log2_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log2_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log2_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log2_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log2_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__log2_fc64_fc64.c index 7b88516514..d267561d9e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log2_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log2_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log2_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log2_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log2_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log2_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__log2_fp32_fp32.c index 36cb86f0a6..9e69953add 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log2_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log2_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log2_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log2_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log2_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log2_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__log2_fp64_fp64.c index 968cd11809..021aeb9923 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log2_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log2_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log2_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log2_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log2_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__log_fc32_fc32.c index 8eced390b1..ea676dec13 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__log_fc64_fc64.c index cb5c4e331c..c5d8a6a3e9 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__log_fp32_fp32.c index e0293ef6e9..9446135381 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__log_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__log_fp64_fp64.c index 27dfd92c97..21b1bacdd6 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__log_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__log_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__log_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__log_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__log_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_bool_bool.c b/GraphBLAS/FactoryKernels/GB_uop__minv_bool_bool.c deleted file mode 100644 index d3e227121c..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_bool_bool.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_BOOL) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = true -#define GB_Z_TYPE bool -#define GB_X_TYPE bool - -// A matrix -#define GB_A_TYPE bool -#define GB_DECLAREA(aij) -#define GB_GETA(aij,Ax,pA,A_iso) - -// C matrix -#define GB_C_TYPE bool - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_BOOL)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_bool_bool) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_bool_bool) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__minv_fc32_fc32.c index c26ab92f8b..b6dbed30c2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__minv_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__minv_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__minv_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__minv_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__minv_fc64_fc64.c index c3f6bcdfa7..c1e4281ccb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__minv_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__minv_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__minv_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__minv_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__minv_fp32_fp32.c index 6436fb6082..c082b13caf 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__minv_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__minv_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__minv_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__minv_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__minv_fp64_fp64.c index 763a8f00af..005370be43 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__minv_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__minv_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__minv_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__minv_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_int16_int16.c b/GraphBLAS/FactoryKernels/GB_uop__minv_int16_int16.c deleted file mode 100644 index fecce60209..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_int16_int16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_int16 (1, x) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t - -// A matrix -#define GB_A_TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_int16_int16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_int16_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_int32_int32.c b/GraphBLAS/FactoryKernels/GB_uop__minv_int32_int32.c deleted file mode 100644 index a8888328d3..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_int32_int32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_int32 (1, x) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t - -// A matrix -#define GB_A_TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_int32_int32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_int32_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_int64_int64.c b/GraphBLAS/FactoryKernels/GB_uop__minv_int64_int64.c deleted file mode 100644 index 2ceafede8e..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_int64_int64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_int64 (1, x) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t - -// A matrix -#define GB_A_TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_int64_int64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_int64_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_int8_int8.c b/GraphBLAS/FactoryKernels/GB_uop__minv_int8_int8.c deleted file mode 100644 index 542f5e0f17..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_int8_int8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_INT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_int8 (1, x) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t - -// A matrix -#define GB_A_TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE int8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_int8_int8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_int8_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_uint16_uint16.c b/GraphBLAS/FactoryKernels/GB_uop__minv_uint16_uint16.c deleted file mode 100644 index ee7af49aa5..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_uint16_uint16.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT16) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_uint16 (1, x) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t - -// A matrix -#define GB_A_TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint16_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_uint16_uint16) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_uint16_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_uint32_uint32.c b/GraphBLAS/FactoryKernels/GB_uop__minv_uint32_uint32.c deleted file mode 100644 index e1d2b80a97..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_uint32_uint32.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT32) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_uint32 (1, x) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t - -// A matrix -#define GB_A_TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint32_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_uint32_uint32) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_uint32_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_uint64_uint64.c b/GraphBLAS/FactoryKernels/GB_uop__minv_uint64_uint64.c deleted file mode 100644 index 517905fc38..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_uint64_uint64.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT64) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_uint64 (1, x) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t - -// A matrix -#define GB_A_TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint64_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_uint64_uint64) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_uint64_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__minv_uint8_uint8.c b/GraphBLAS/FactoryKernels/GB_uop__minv_uint8_uint8.c deleted file mode 100644 index 55da284f9e..0000000000 --- a/GraphBLAS/FactoryKernels/GB_uop__minv_uint8_uint8.c +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_uop.c: hard-coded functions for each built-in unary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_control.h" -#if defined (GxB_NO_UINT8) -#define GB_TYPE_ENABLED 0 -#else -#define GB_TYPE_ENABLED 1 -#endif - -#if GB_TYPE_ENABLED -#include "GB.h" -#include "FactoryKernels/GB_uop__include.h" - -// unary operator: z = f(x) -#define GB_UNARYOP(z,x) z = GB_idiv_uint8 (1, x) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t - -// A matrix -#define GB_A_TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] - -// C matrix -#define GB_C_TYPE uint8_t - -// cij = op (aij) -#define GB_APPLY_OP(pC,pA) \ -{ \ - /* aij = Ax [pA] */ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ - GB_UNARYOP (Cx [pC], aij) ; \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_MINV) || defined(GxB_NO_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "omp/include/GB_kernel_shared_definitions.h" - -//------------------------------------------------------------------------------ -// Cx = op (cast (Ax)): apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_apply__minv_uint8_uint8) -( - GB_void *Cx_out, // Cx and Ax may be aliased - const GB_void *Ax_in, // A is always non-iso for this kernel - const int8_t *restrict Ab, // A->b if A is bitmap - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_unop_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (cast (A')): transpose, typecast, and apply a unary operator -//------------------------------------------------------------------------------ - -GrB_Info GB (_uop_tran__minv_uint8_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - -#endif - diff --git a/GraphBLAS/FactoryKernels/GB_uop__round_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__round_fc32_fc32.c index 618f1495fe..27660c3c0c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__round_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__round_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__round_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__round_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__round_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__round_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__round_fc64_fc64.c index 682b956ef5..c80de23693 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__round_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__round_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__round_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__round_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__round_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__round_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__round_fp32_fp32.c index 6cd4e35c5d..a0869f9872 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__round_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__round_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__round_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__round_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__round_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__round_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__round_fp64_fp64.c index 6bbe86b3d7..bcb9c2cf13 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__round_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__round_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__round_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__round_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__round_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__signum_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__signum_fc32_fc32.c index 7bf3ee7966..0c81e973bb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__signum_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__signum_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__signum_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__signum_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__signum_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__signum_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__signum_fc64_fc64.c index 29e12c9e15..97df203996 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__signum_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__signum_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__signum_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__signum_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__signum_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__signum_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__signum_fp32_fp32.c index cacaf287af..d2e849b6af 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__signum_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__signum_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__signum_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__signum_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__signum_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__signum_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__signum_fp64_fp64.c index 54725147e7..e5d031648d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__signum_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__signum_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__signum_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__signum_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__signum_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sin_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__sin_fc32_fc32.c index 5f57456400..21cbae2d5c 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sin_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sin_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sin_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sin_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sin_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sin_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__sin_fc64_fc64.c index 3e6e4f9742..b4632af24b 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sin_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sin_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sin_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sin_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sin_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sin_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__sin_fp32_fp32.c index 1d3160ae94..4437083907 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sin_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sin_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sin_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sin_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sin_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sin_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__sin_fp64_fp64.c index 83520c1ac4..f444cb2065 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sin_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sin_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sin_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sin_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sin_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sinh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__sinh_fc32_fc32.c index 41d9eee32f..774c78cdb7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sinh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sinh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sinh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sinh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sinh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sinh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__sinh_fc64_fc64.c index 2395a5d19b..56c9b8d3c7 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sinh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sinh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sinh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sinh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sinh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sinh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__sinh_fp32_fp32.c index 7d6b70af8f..89a9555af4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sinh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sinh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sinh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sinh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sinh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sinh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__sinh_fp64_fp64.c index 753a0e1f09..581d228034 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sinh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sinh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sinh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sinh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sinh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc32_fc32.c index 7b32ca1e63..4794db07a4 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sqrt_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sqrt_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sqrt_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc64_fc64.c index ce82f043f7..d9832b4fb2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sqrt_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sqrt_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sqrt_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp32_fp32.c index c35b128578..75c84113ff 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sqrt_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sqrt_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sqrt_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp64_fp64.c index 00fd8edf26..e349ed3512 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__sqrt_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__sqrt_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__sqrt_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__sqrt_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tan_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__tan_fc32_fc32.c index 08cc11ea41..43bc79404f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tan_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tan_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tan_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tan_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tan_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tan_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__tan_fc64_fc64.c index f35b7ddeff..4287f71eeb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tan_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tan_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tan_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tan_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tan_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tan_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__tan_fp32_fp32.c index 1668cfb27e..afac0a815a 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tan_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tan_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tan_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tan_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tan_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tan_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__tan_fp64_fp64.c index 02acac0961..9be0c6bbcb 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tan_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tan_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tan_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tan_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tan_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tanh_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__tanh_fc32_fc32.c index 9feffb6838..e0b7a47cd2 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tanh_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tanh_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tanh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tanh_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tanh_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tanh_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__tanh_fc64_fc64.c index 243d13fb99..07c4e61541 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tanh_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tanh_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tanh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tanh_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tanh_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tanh_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__tanh_fp32_fp32.c index 842d622979..639462f13f 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tanh_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tanh_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tanh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tanh_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tanh_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tanh_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__tanh_fp64_fp64.c index 35ff415a46..25d125da43 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tanh_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tanh_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tanh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tanh_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tanh_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp32_fp32.c index 726631aa53..2e12e0a517 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tgamma_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tgamma_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tgamma_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp64_fp64.c index 2dc1e996f8..31d9365bb3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__tgamma_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__tgamma_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__tgamma_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__tgamma_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__trunc_fc32_fc32.c b/GraphBLAS/FactoryKernels/GB_uop__trunc_fc32_fc32.c index a7113b0f2c..745a90347e 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__trunc_fc32_fc32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__trunc_fc32_fc32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC32_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__trunc_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__trunc_fc32_fc32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__trunc_fc32_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__trunc_fc64_fc64.c b/GraphBLAS/FactoryKernels/GB_uop__trunc_fc64_fc64.c index 092dd21c6a..d187136dd3 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__trunc_fc64_fc64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__trunc_fc64_fc64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE GxB_FC64_t +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__trunc_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__trunc_fc64_fc64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__trunc_fc64_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__trunc_fp32_fp32.c b/GraphBLAS/FactoryKernels/GB_uop__trunc_fp32_fp32.c index 064fe395ce..3bb7ec6d46 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__trunc_fp32_fp32.c +++ b/GraphBLAS/FactoryKernels/GB_uop__trunc_fp32_fp32.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE float +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__trunc_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__trunc_fp32_fp32) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__trunc_fp32_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/FactoryKernels/GB_uop__trunc_fp64_fp64.c b/GraphBLAS/FactoryKernels/GB_uop__trunc_fp64_fp64.c index d296d51f7e..c2614b4e3d 100644 --- a/GraphBLAS/FactoryKernels/GB_uop__trunc_fp64_fp64.c +++ b/GraphBLAS/FactoryKernels/GB_uop__trunc_fp64_fp64.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,7 @@ // C matrix #define GB_C_TYPE double +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -66,7 +67,7 @@ GrB_Info GB (_uop_apply__trunc_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -79,7 +80,7 @@ GrB_Info GB (_uop_tran__trunc_fp64_fp64) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -88,10 +89,13 @@ GrB_Info GB (_uop_tran__trunc_fp64_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/GraphBLAS/@GrB/private/.gitignore b/GraphBLAS/GraphBLAS/.gitignore similarity index 100% rename from GraphBLAS/GraphBLAS/@GrB/private/.gitignore rename to GraphBLAS/GraphBLAS/.gitignore diff --git a/GraphBLAS/GraphBLAS/@GrB/GrB.m b/GraphBLAS/GraphBLAS/@GrB/GrB.m index 986c4137a8..d737ed1745 100644 --- a/GraphBLAS/GraphBLAS/@GrB/GrB.m +++ b/GraphBLAS/GraphBLAS/@GrB/GrB.m @@ -343,11 +343,16 @@ % % info: % GrB.binopinfo (op, type) list properties of a binary operator +% list = GrB.binops list all binary ops % GrB.descriptorinfo (d) list properties of a descriptor % GrB.monoidinfo (op, type) list properties of a monoid +% list = GrB.monoids list all monoids % GrB.selectopinfo (op, type) list properties of a select operator +% list = GrB.selectops list all selectops % GrB.semiringinfo (s, type) list properties of a semiring +% list = GrB.semirings list all semirings % GrB.unopinfo (op, type) list properties of a unary operator +% list = GrB.unops list all unary ops % % basic matrices: % C = GrB.false (...) all-false logical matrix @@ -569,7 +574,7 @@ % % See also sparse. % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 properties (SetAccess = private, GetAccess = private) @@ -985,6 +990,7 @@ C = assign (Cin, M, accum, A, I, J, desc) ; [v, parent] = bfs (A, s, varargin) ; % uses GrB matrices binopinfo (op, type) ; + list = binops ; C = build (I, J, X, m, n, dup, type, desc) ; b = burble (b) ; C = cell2mat (A) ; @@ -1017,6 +1023,7 @@ C = load (filename) ; iset = mis (A, check) ; % uses GrB matrices monoidinfo (monoid, type) ; + list = monoids ; C = mxm (Cin, M, accum, semiring, A, B, desc) ; result = nonz (A, varargin) ; s = normdiff (A, B, kind) ; @@ -1029,7 +1036,9 @@ filename_used = save (C, filename) ; C = select (Cin, M, accum, selectop, A, b, desc) ; selectopinfo (op, type) ; + list = selectops ; semiringinfo (s, type) ; + list = semirings ; blob = serialize (A, method, level) ; C = speye (m, n, type) ; C = subassign (Cin, M, accum, A, I, J, desc) ; @@ -1039,12 +1048,11 @@ s = tricount (A, check, d) ; % uses GrB matrices s = type (A) ; unopinfo (op, type) ; + list = unops ; v = version ; v = ver ; C = vreduce (Cin, M, accum, monoid, A, desc) ; - t = timing (c) ; % timing for diagnositics only, requires -DGB_TIMING - % these were formerly overloaded methods, now Static methods C = false (varargin) ; C = true (varargin) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/MATLAB_vs_GrB.m b/GraphBLAS/GraphBLAS/@GrB/MATLAB_vs_GrB.m index 208e57f698..ae729d5336 100644 --- a/GraphBLAS/GraphBLAS/@GrB/MATLAB_vs_GrB.m +++ b/GraphBLAS/GraphBLAS/@GrB/MATLAB_vs_GrB.m @@ -264,7 +264,7 @@ %% For more details, see the GraphBLAS user guide in GraphBLAS/Doc. % See also GrB, sparse. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 help GrB.MATLAB_vs_GrB ; diff --git a/GraphBLAS/GraphBLAS/@GrB/abs.m b/GraphBLAS/GraphBLAS/@GrB/abs.m index ce0d677e9c..bbda24627c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/abs.m +++ b/GraphBLAS/GraphBLAS/@GrB/abs.m @@ -5,7 +5,7 @@ % % See also GrB/sign. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acos.m b/GraphBLAS/GraphBLAS/@GrB/acos.m index 3eb178ecc8..65a20077de 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acos.m +++ b/GraphBLAS/GraphBLAS/@GrB/acos.m @@ -6,7 +6,7 @@ % % See also GrB/cos, GrB/cosh, GrB/acosh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acosh.m b/GraphBLAS/GraphBLAS/@GrB/acosh.m index 40489bcabd..43519a9dff 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acosh.m +++ b/GraphBLAS/GraphBLAS/@GrB/acosh.m @@ -6,7 +6,7 @@ % % See also GrB/cos, GrB/acos, GrB/cosh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acot.m b/GraphBLAS/GraphBLAS/@GrB/acot.m index ddd971eed3..e72f51b73d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acot.m +++ b/GraphBLAS/GraphBLAS/@GrB/acot.m @@ -5,7 +5,7 @@ % % See also GrB/cot, GrB/coth, GrB/acoth. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acoth.m b/GraphBLAS/GraphBLAS/@GrB/acoth.m index 66a9974629..593c52c2da 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acoth.m +++ b/GraphBLAS/GraphBLAS/@GrB/acoth.m @@ -6,7 +6,7 @@ % % See also GrB/cot, GrB/acot, GrB/coth. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acsc.m b/GraphBLAS/GraphBLAS/@GrB/acsc.m index f113063fd7..a48af10ed2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acsc.m +++ b/GraphBLAS/GraphBLAS/@GrB/acsc.m @@ -5,7 +5,7 @@ % % See also GrB/csc, GrB/csch, GrB/acsch. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/acsch.m b/GraphBLAS/GraphBLAS/@GrB/acsch.m index 68eadad664..8ec94043eb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/acsch.m +++ b/GraphBLAS/GraphBLAS/@GrB/acsch.m @@ -5,7 +5,7 @@ % % See also GrB/csc, GrB/acsc, GrB/csch. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/all.m b/GraphBLAS/GraphBLAS/@GrB/all.m index 377e8436b7..b906ae9b8e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/all.m +++ b/GraphBLAS/GraphBLAS/@GrB/all.m @@ -9,7 +9,7 @@ % % See also GrB/any, GrB/nnz, GrB/prod, GrB.entries. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/amd.m b/GraphBLAS/GraphBLAS/@GrB/amd.m index c07c6fab16..9360459d71 100644 --- a/GraphBLAS/GraphBLAS/@GrB/amd.m +++ b/GraphBLAS/GraphBLAS/@GrB/amd.m @@ -4,7 +4,7 @@ % % See also GrB/colamd, GrB/symrcm. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 p = builtin ('amd', logical (G), varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/and.m b/GraphBLAS/GraphBLAS/@GrB/and.m index 3b16aaaa69..5e7f527849 100644 --- a/GraphBLAS/GraphBLAS/@GrB/and.m +++ b/GraphBLAS/GraphBLAS/@GrB/and.m @@ -5,7 +5,7 @@ % % See also GrB/or, GrB/xor, GrB/not. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/angle.m b/GraphBLAS/GraphBLAS/@GrB/angle.m index 2c709f366e..9af476b94f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/angle.m +++ b/GraphBLAS/GraphBLAS/@GrB/angle.m @@ -4,7 +4,7 @@ % % See also GrB/abs. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/any.m b/GraphBLAS/GraphBLAS/@GrB/any.m index d94d761107..bb1d797d84 100644 --- a/GraphBLAS/GraphBLAS/@GrB/any.m +++ b/GraphBLAS/GraphBLAS/@GrB/any.m @@ -9,7 +9,7 @@ % % See also GrB/all, GrB/sum, GrB/nnz, GrB.entries, GrB.nonz. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/apply.m b/GraphBLAS/GraphBLAS/@GrB/apply.m index 23b25245d3..54eff18ba1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/apply.m +++ b/GraphBLAS/GraphBLAS/@GrB/apply.m @@ -14,15 +14,16 @@ % The op and A arguments are required. % % accum: a binary operator to accumulate the results. +% See 'help GrB.binopinfo' for available binary operators. % % Cin, the mask matrix M, the accum operator, and desc are optional. If % either accum or M is present, then Cin is a required input. If desc.in0 % is 'transpose' then A is transposed before applying the operator, as % C = accum (C, f(A')) where f(...) is the unary operator. % -% See also GrB/apply2, GrB/spfun. +% See also GrB/apply2, GrB/spfun, GrB.unopinfo, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/apply2.m b/GraphBLAS/GraphBLAS/@GrB/apply2.m index f9314e93e1..f776f1c7e2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/apply2.m +++ b/GraphBLAS/GraphBLAS/@GrB/apply2.m @@ -22,9 +22,9 @@ % the operator. If A is the scalar and desc.in1 is 'transpose.', then the % input matrix B is transposed before applying the operator. % -% See also GrB/apply, GrB/spfun. +% See also GrB/apply, GrB/spfun, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/argmax.m b/GraphBLAS/GraphBLAS/@GrB/argmax.m index 19327e1085..337141f0f5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/argmax.m +++ b/GraphBLAS/GraphBLAS/@GrB/argmax.m @@ -50,7 +50,7 @@ % % See also min, max, GrB/min, GrB/max, GrB.argmin, GrB.argsort. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/argmin.m b/GraphBLAS/GraphBLAS/@GrB/argmin.m index 05ebf91eee..609d4a5cb4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/argmin.m +++ b/GraphBLAS/GraphBLAS/@GrB/argmin.m @@ -50,7 +50,7 @@ % % See also min, max, GrB/min, GrB/max, GrB.argmax, GrB.argsort. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/argsort.m b/GraphBLAS/GraphBLAS/@GrB/argsort.m index 1aeab1b994..bef4ea9ad8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/argsort.m +++ b/GraphBLAS/GraphBLAS/@GrB/argsort.m @@ -32,7 +32,7 @@ % % See also sort, GrB.argmin, GrB.argmax. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/asec.m b/GraphBLAS/GraphBLAS/@GrB/asec.m index 89ac4a83e0..3556d0539a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/asec.m +++ b/GraphBLAS/GraphBLAS/@GrB/asec.m @@ -6,7 +6,7 @@ % % See also GrB/sec, GrB/sech, GrB/asech. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/asech.m b/GraphBLAS/GraphBLAS/@GrB/asech.m index c87011418d..60c19899f8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/asech.m +++ b/GraphBLAS/GraphBLAS/@GrB/asech.m @@ -6,7 +6,7 @@ % % See also GrB/sec, GrB/asec, GrB/sech. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/asin.m b/GraphBLAS/GraphBLAS/@GrB/asin.m index 9aafb7a841..79d4cc8bd4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/asin.m +++ b/GraphBLAS/GraphBLAS/@GrB/asin.m @@ -5,7 +5,7 @@ % % See also GrB/sin, GrB/sinh, GrB/asinh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/asinh.m b/GraphBLAS/GraphBLAS/@GrB/asinh.m index 912df44495..0d5bc76025 100644 --- a/GraphBLAS/GraphBLAS/@GrB/asinh.m +++ b/GraphBLAS/GraphBLAS/@GrB/asinh.m @@ -4,7 +4,7 @@ % % See also GrB/sin, GrB/asin, GrB/sinh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/assert.m b/GraphBLAS/GraphBLAS/@GrB/assert.m index 35a0f704b5..cfc195ff1a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/assert.m +++ b/GraphBLAS/GraphBLAS/@GrB/assert.m @@ -3,7 +3,7 @@ function assert (G) % % See also error. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 builtin ('assert', logical (G)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/assign.m b/GraphBLAS/GraphBLAS/@GrB/assign.m index 73aa6073e4..b0f3ae94f6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/assign.m +++ b/GraphBLAS/GraphBLAS/@GrB/assign.m @@ -60,6 +60,7 @@ % accum: an optional binary operator, defined by a string ('+.double') for % example. This allows for C(I,J) = C(I,J) + A to be computed. If % not present, no accumulator is used and C(I,J)=A is computed. +% See 'help GrB.binopinfo' for available binary operators. % % M: an optional mask matrix, the same size as C. % @@ -92,9 +93,9 @@ % C2 (I,J) = B % C2 - sparse (C) % -% See also GrB.subassign, GrB/subsasgn. +% See also GrB.subassign, GrB/subsasgn, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/atan.m b/GraphBLAS/GraphBLAS/@GrB/atan.m index 0941348bc9..21b3142216 100644 --- a/GraphBLAS/GraphBLAS/@GrB/atan.m +++ b/GraphBLAS/GraphBLAS/@GrB/atan.m @@ -4,7 +4,7 @@ % % See also GrB/tan, GrB/tanh, GrB/atanh, GrB/atan2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/atan2.m b/GraphBLAS/GraphBLAS/@GrB/atan2.m index 24f4fb7afa..378739a3b9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/atan2.m +++ b/GraphBLAS/GraphBLAS/@GrB/atan2.m @@ -4,7 +4,7 @@ % % See also GrB/tan, GrB/tanh, GrB/atan, GrB/atanh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/atanh.m b/GraphBLAS/GraphBLAS/@GrB/atanh.m index fa969e45c0..87bff342c7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/atanh.m +++ b/GraphBLAS/GraphBLAS/@GrB/atanh.m @@ -5,7 +5,7 @@ % % See also GrB/tan, GrB/atan, GrB/tanh, GrB/atan2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/bandwidth.m b/GraphBLAS/GraphBLAS/@GrB/bandwidth.m index 27f1486df9..ce8ca0bf15 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bandwidth.m +++ b/GraphBLAS/GraphBLAS/@GrB/bandwidth.m @@ -6,7 +6,7 @@ % % See also GrB/isbanded, GrB/isdiag, GrB/istril, GrB/istriu. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/bfs.m b/GraphBLAS/GraphBLAS/@GrB/bfs.m index 27ba1ec5c6..08a7f4b6e2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bfs.m +++ b/GraphBLAS/GraphBLAS/@GrB/bfs.m @@ -58,7 +58,7 @@ % % See also graph/bfsearch, graph/shortestpathtree, treeplot. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/binopinfo.m b/GraphBLAS/GraphBLAS/@GrB/binopinfo.m index 5d9dcd8830..35f03b2420 100644 --- a/GraphBLAS/GraphBLAS/@GrB/binopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/binopinfo.m @@ -59,9 +59,9 @@ function binopinfo (op, optype) % Most of the logical operators have aliases: ('lor', 'or', '|') are the % same, as are ('lxnor', 'xnor', 'eq', '==') for logical types. % -% Positional operators return int32 or int64, and depend only on the position -% of the entry in the matrix. They do not depend on the values of their -% inputs, but on their position in the matrix instead: +% Index binary operators return int32 or int64, and depend only on the +% indices of the entry in the matrix, not their values. In the function +% names, "first" refers to the first input A, and "second" to B: % % 1-based postional ops: in a semiring: in ewise operators: % operator name(s) f(A(i,k)*B(k,j)) f(A(i,j),B(i,j)) @@ -79,6 +79,10 @@ function binopinfo (op, optype) % secondi0 2ndi0 k-1 i-1 % secondj0 2ndj0 j-1 j-1 % +% For C=GrB.kron(op,A,B), the 1-based operators return ia, ja, ib, or jb +% where C(i,j) = op(A(ia,ja),B(ib,jb)), and the 0-based ops return the +% same result minus one. For example, firsti(A(ia,ja),B(ib,jb)) = ia. +% % Comparators (*lt, *gt, *le, *ge) and min/max are not available for % complex types. % @@ -86,32 +90,40 @@ function binopinfo (op, optype) % real types. z = lor.double (x,y) tests the condition (x~=0) || (y~=0), % and returns the double value 1.0 if true, or 0.0 if false. % -% The following operators are avaiable for single and double (real); their +% The following operators are available for single and double (real); their % definitions are identical to the C11 versions of these functions: % atan2, hypot, fmod, remainder, copysign, ldxep (also called 'pow2'). % All produce the same type as the input, on output. % -% z = cmplx(x,y) can be computed for x and y as single and double; z is -% single complex or double complex, respectively. +% atan2(x,y) arctan(x/y); arc tangent; see 'help atan2' +% hypot(x,y) sqrt(x^2+y^0); see 'help hypot' +% fmod(x,y) floating-point remainder of x/y +% remainder(x,y) remainder of x/y, rounded to nearest integer +% copysign(x,y) abs(x)*sign(y) +% ldexp(x,y) x*2^y, same as pow2(x,y) in MATLAB; see 'help pow2' +% +% z = cmplx(x,y) = x+sqrt(-1)*y can be computed for x and y as single and +% double; z is single complex or double complex, respectively. % % The bitwise ops bitor, bitand, bitxor, bitxnor, bitget, bitset, bitclr, % and bitshift are available for any signed or unsigned integer type. -% -% The following index_unary operators can be applied to a matrix A with -% GrB.apply2 only, where the 2nd input is the thunk scalar. When applied -% to an entry A(i,j): -% -% tril j <= (i + thunk) -% triu j >= (i + thunk) -% diag j == (i + thunk) -% offdiag j != (i + thunk) -% diagindex j - (i + thunk) -% rowindex i + thunk -% rowle i <= thunk -% rowgt i > thunk -% colindex j + thunk -% colle j <= thunk -% colgt j > thunk +% These functions match the MATLAB functions of the same name. +% +% The following index operators can be applied to a matrix A with +% GrB.apply2 only, where the 2nd input is a scalar y. When applied +% to an entry A(i,j) via GrB.apply2 (op, A, y): +% +% tril j <= (i + y) +% triu j >= (i + y) +% diag j == (i + y) +% offdiag j != (i + y) +% diagindex j - (i + y) +% rowindex i + y +% rowle i <= y +% rowgt i > y +% colindex j + y +% colle j <= y +% colgt j > y % % Typecasting: If the optype is omitted from the string (for example, % GrB.eadd (A, '+', B) or simply C = A+B), then the optype is inferred @@ -129,10 +141,10 @@ function binopinfo (op, optype) % % invalid binary operator (an error; this is a unary op): % GrB.binopinfo ('abs.double') ; % -% See also GrB.descriptorinfo, GrB.monoidinfo, GrB.selectopinfo, -% GrB.semiringinfo, GrB.unopinfo, GrB.optype. +% See also GrB.binops, GrB.descriptorinfo, GrB.monoidinfo, +% GrB.selectopinfo, GrB.semiringinfo, GrB.unopinfo, GrB.optype. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/binops.m b/GraphBLAS/GraphBLAS/@GrB/binops.m new file mode 100644 index 0000000000..93455ddb00 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/binops.m @@ -0,0 +1,92 @@ +function result = binops +%GRB.BINOPS list all binary ops +% Redundant binary ops are not listed. For example '+.logical' +% exists, but it is identical to '|.logical'. +% +% Example: +% GrB.binops ; % prints a list, with descriptions +% list = GrB.binops ; % returns the list (nothing printed) +% +% See also GrB.binopinfo. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +types = { + 'logical' + 'double' + 'single' + 'int8' + 'int16' + 'int32' + 'int64' + 'uint8' + 'uint16' + 'uint32' + 'uint64' + 'single complex' + 'double complex' + } ; + +binops = gb_binops ; + +skip_logical = {'min', 'max', '+', '-', 'rminus', '*', '/', '\', 'iseq', ... + 'isne', 'isgt', 'islt', 'isle', 'isge', 'pow', '~=', '==' } ; + +nbinops = 0 ; +nops = size (binops, 1) ; + +if (nargout > 0) + result = { } ; +end + + for k2 = 1:nops + mult = binops {k2,1} ; + mult_description = binops {k2,2} ; + first_mult = true ; + for k3 = 1:length (types) + type = types {k3} ; + ok = false ; + binop = [mult '.' type] ; + + % skip redundant logical binops + if (isequal (type, 'logical') && ... + ismember (mult, skip_logical)) + continue ; + end + + try + ok = gbbinopinfo (binop) ; + nbinops = nbinops + 1 ; + if (nargout > 0) + result = [result ; binop] ; %#ok + end + catch + % this is an error, but it is expected since not all + % combinations operators and types can be used to construct + % a valid binop. + end + if (ok && nargout == 0) + if (first_mult) + fprintf ('binary op: %s.type', mult) ; + if (isempty (mult_description)) + fprintf ('\n') ; + else + fprintf (', where %s\n', mult_description) ; + end + fprintf (' types: %s', type) ; + else + fprintf (', %s', type) ; + end + first_mult = false ; + end + end + if (nargout == 0) + fprintf ('\n\n') ; + end + end + +if (nargout == 0) + fprintf ('Total number of available binary ops: %d\n', nbinops) ; +end + diff --git a/GraphBLAS/GraphBLAS/@GrB/bitand.m b/GraphBLAS/GraphBLAS/@GrB/bitand.m index 5ddd919b99..e42718703a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitand.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitand.m @@ -33,7 +33,7 @@ % See also GrB/bitor, GrB/bitxor, GrB/bitcmp, GrB/bitshift, GrB/bitget, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitcmp.m b/GraphBLAS/GraphBLAS/@GrB/bitcmp.m index e1abe5a234..3d27686daf 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitcmp.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitcmp.m @@ -23,7 +23,7 @@ % See also GrB/bitor, GrB/bitand, GrB/bitxor, GrB/bitshift, GrB/bitget, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 2) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitget.m b/GraphBLAS/GraphBLAS/@GrB/bitget.m index 1851957ad5..bf6406f89e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitget.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitget.m @@ -35,7 +35,7 @@ % See also GrB/bitor, GrB/bitand, GrB/bitxor, GrB/bitcmp, GrB/bitshift, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitor.m b/GraphBLAS/GraphBLAS/@GrB/bitor.m index 427b5016d9..c5e868e9d8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitor.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitor.m @@ -27,7 +27,7 @@ % See also GrB/bitand, GrB/bitxor, GrB/bitcmp, GrB/bitshift, GrB/bitget, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitset.m b/GraphBLAS/GraphBLAS/@GrB/bitset.m index fd2450bec9..9282d19a27 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitset.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitset.m @@ -41,7 +41,7 @@ % See also GrB/bitor, GrB/bitand, GrB/bitxor, GrB/bitcmp, GrB/bitshift, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitshift.m b/GraphBLAS/GraphBLAS/@GrB/bitshift.m index 12ea82805a..4ece8f8cc3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitshift.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitshift.m @@ -22,7 +22,7 @@ % See also GrB/bitor, GrB/bitand, GrB/bitxor, GrB/bitcmp, GrB/bitget, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/bitxor.m b/GraphBLAS/GraphBLAS/@GrB/bitxor.m index 0fb03c0b42..072ad2e224 100644 --- a/GraphBLAS/GraphBLAS/@GrB/bitxor.m +++ b/GraphBLAS/GraphBLAS/@GrB/bitxor.m @@ -27,7 +27,7 @@ % See also GrB/bitor, GrB/bitand, GrB/bitcmp, GrB/bitshift, GrB/bitget, % GrB/bitset, GrB/bitclr. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/build.m b/GraphBLAS/GraphBLAS/@GrB/build.m index da4303bf63..dd7c4e972d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/build.m +++ b/GraphBLAS/GraphBLAS/@GrB/build.m @@ -1,4 +1,4 @@ -function C = build (varargin) +function C = build (I,J,X,varargin) %GRB.BUILD construct a sparse matrix from a list of entries. % % C = GrB.build (I, J, X, m, n, dup, type, desc) @@ -68,10 +68,22 @@ % % See also sparse, GrB/sparse, GrB/find, GrB.extracttuples. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -[C, k] = gbbuild (varargin {:}) ; +if (isobject (I)) + I = I.opaque ; +end + +if (isobject (J)) + J = J.opaque ; +end + +if (isobject (X)) + X = X.opaque ; +end + +[C, k] = gbbuild (I, J, X, varargin {:}) ; if (k == 0) C = GrB (C) ; end diff --git a/GraphBLAS/GraphBLAS/@GrB/burble.m b/GraphBLAS/GraphBLAS/@GrB/burble.m index d61cdb195c..f6badfc362 100644 --- a/GraphBLAS/GraphBLAS/@GrB/burble.m +++ b/GraphBLAS/GraphBLAS/@GrB/burble.m @@ -9,7 +9,7 @@ % % See also spparms. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/cat.m b/GraphBLAS/GraphBLAS/@GrB/cat.m index b974683c4e..9bce701e9a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cat.m +++ b/GraphBLAS/GraphBLAS/@GrB/cat.m @@ -29,7 +29,7 @@ % See also GrB/horzcat, GrB/vertcat, GrB.cell2mat, GrB/mat2cell, % GrB/num2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the input matrices diff --git a/GraphBLAS/GraphBLAS/@GrB/cbrt.m b/GraphBLAS/GraphBLAS/@GrB/cbrt.m index 56ee994cf5..caacecf736 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cbrt.m +++ b/GraphBLAS/GraphBLAS/@GrB/cbrt.m @@ -4,7 +4,7 @@ % % See also GrB/sqrt, nthroot. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/ceil.m b/GraphBLAS/GraphBLAS/@GrB/ceil.m index f0e6b84119..04c2e74b5a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ceil.m +++ b/GraphBLAS/GraphBLAS/@GrB/ceil.m @@ -3,7 +3,7 @@ % % See also GrB/floor, GrB/round, GrB/fix. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/cell2mat.m b/GraphBLAS/GraphBLAS/@GrB/cell2mat.m index 703f2588c8..dbcd3ca171 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cell2mat.m +++ b/GraphBLAS/GraphBLAS/@GrB/cell2mat.m @@ -55,7 +55,7 @@ % % See also GrB/horzcat, GrB/vertcat, GrB/cat, GrB/mat2cell, GrB/num2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (~iscell (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/chunk.m b/GraphBLAS/GraphBLAS/@GrB/chunk.m index 30d726933b..fc8522b04c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/chunk.m +++ b/GraphBLAS/GraphBLAS/@GrB/chunk.m @@ -6,7 +6,7 @@ % % GrB.chunk gets and/or sets the chunk size to use in GraphBLAS, which % controls how many threads GraphBLAS uses for small problems. The -% default is 4096. If w is a measure of the work required (for C=A+B, the +% default is 65536. If w is a measure of the work required (for C=A+B, the % work is w = GrB.entries(A) + GrB.entries(B), for example) then the number % of threads GraphBLAS uses is min (max (1, floor (w/c)), GrB.nthreads). % @@ -15,9 +15,11 @@ % current session, or until 'clear all' or GrB.clear is used, at % which point the setting reverts to the default. % +% GrB.chunk(0) sets the chunk to its default value. +% % See also GrB.threads. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/clear.m b/GraphBLAS/GraphBLAS/@GrB/clear.m index e504f96d66..8f3bc4f54f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/clear.m +++ b/GraphBLAS/GraphBLAS/@GrB/clear.m @@ -6,7 +6,7 @@ % % See also clear, GrB.init, GrB.finalize. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 gbclear ; diff --git a/GraphBLAS/GraphBLAS/@GrB/colamd.m b/GraphBLAS/GraphBLAS/@GrB/colamd.m index 08c3804576..14ac1607bc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/colamd.m +++ b/GraphBLAS/GraphBLAS/@GrB/colamd.m @@ -4,7 +4,7 @@ % % See also GrB/amd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [p, varargout{1:nargout-1}] = colamd (double (G), varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/compact.m b/GraphBLAS/GraphBLAS/@GrB/compact.m index c6e27ae393..566c72597d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/compact.m +++ b/GraphBLAS/GraphBLAS/@GrB/compact.m @@ -34,7 +34,7 @@ % % See also GrB.entries, GrB.nonz, GrB.prune. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/complex.m b/GraphBLAS/GraphBLAS/@GrB/complex.m index ac922091e9..66d0aa3e20 100644 --- a/GraphBLAS/GraphBLAS/@GrB/complex.m +++ b/GraphBLAS/GraphBLAS/@GrB/complex.m @@ -24,7 +24,7 @@ % GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/conj.m b/GraphBLAS/GraphBLAS/@GrB/conj.m index ac67652652..a5f1d4ed18 100644 --- a/GraphBLAS/GraphBLAS/@GrB/conj.m +++ b/GraphBLAS/GraphBLAS/@GrB/conj.m @@ -4,7 +4,7 @@ % % See also GrB/real, GrB/imag. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/cos.m b/GraphBLAS/GraphBLAS/@GrB/cos.m index cfbb7b3079..1217a2d76b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cos.m +++ b/GraphBLAS/GraphBLAS/@GrB/cos.m @@ -5,7 +5,7 @@ % % See also GrB/acos, GrB/cosh, GrB/acosh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/cosh.m b/GraphBLAS/GraphBLAS/@GrB/cosh.m index 89a03f9873..d764a21ced 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cosh.m +++ b/GraphBLAS/GraphBLAS/@GrB/cosh.m @@ -5,7 +5,7 @@ % % See also GrB/cos, GrB/acos, GrB/acosh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/cot.m b/GraphBLAS/GraphBLAS/@GrB/cot.m index be411d0b01..20e85ea3ca 100644 --- a/GraphBLAS/GraphBLAS/@GrB/cot.m +++ b/GraphBLAS/GraphBLAS/@GrB/cot.m @@ -5,7 +5,7 @@ % % See also GrB/coth, GrB/acot, GrB/acoth. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/coth.m b/GraphBLAS/GraphBLAS/@GrB/coth.m index a312d2842b..7faa9ca3f7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/coth.m +++ b/GraphBLAS/GraphBLAS/@GrB/coth.m @@ -5,7 +5,7 @@ % % See also GrB/cot, GrB/acot, GrB/acoth. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/csc.m b/GraphBLAS/GraphBLAS/@GrB/csc.m index 69ccf2eb4c..00e1222496 100644 --- a/GraphBLAS/GraphBLAS/@GrB/csc.m +++ b/GraphBLAS/GraphBLAS/@GrB/csc.m @@ -5,7 +5,7 @@ % % See also GrB/acsc, GrB/csch, GrB/acsch. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/csch.m b/GraphBLAS/GraphBLAS/@GrB/csch.m index 0644df745b..7c285cd1e3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/csch.m +++ b/GraphBLAS/GraphBLAS/@GrB/csch.m @@ -5,7 +5,7 @@ % % See also GrB/csc, GrB/acsc, GrB/acsch. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/ctranspose.m b/GraphBLAS/GraphBLAS/@GrB/ctranspose.m index fdeb3caf21..b509cdc193 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ctranspose.m +++ b/GraphBLAS/GraphBLAS/@GrB/ctranspose.m @@ -4,7 +4,7 @@ % % See also GrB.trans, GrB/transpose, GrB/conj. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/descriptorinfo.m b/GraphBLAS/GraphBLAS/@GrB/descriptorinfo.m index 39568f8606..e706cb2487 100644 --- a/GraphBLAS/GraphBLAS/@GrB/descriptorinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/descriptorinfo.m @@ -73,7 +73,7 @@ function descriptorinfo (d) % See also GrB.binopinfo, GrB.monoidinfo, GrB.selectopinfo, % GrB.semiringinfo, GrB.unopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: add desc.in* = 'conjugate transpose' diff --git a/GraphBLAS/GraphBLAS/@GrB/deserialize.m b/GraphBLAS/GraphBLAS/@GrB/deserialize.m index 4f94ff4126..a9cd74d1bd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/deserialize.m +++ b/GraphBLAS/GraphBLAS/@GrB/deserialize.m @@ -21,7 +21,7 @@ % % See also GrB.serialize, GrB.load, GrB.save, GrB/struct. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % The type may also be specified, as an optional arg3 string: diff --git a/GraphBLAS/GraphBLAS/@GrB/diag.m b/GraphBLAS/GraphBLAS/@GrB/diag.m index d31694708a..82bb616e2a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/diag.m +++ b/GraphBLAS/GraphBLAS/@GrB/diag.m @@ -31,7 +31,7 @@ % % See also GrB/diag, spdiags, GrB/tril, GrB/triu, GrB.select. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/digraph.m b/GraphBLAS/GraphBLAS/@GrB/digraph.m index f340d61773..0e70995bb8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/digraph.m +++ b/GraphBLAS/GraphBLAS/@GrB/digraph.m @@ -24,7 +24,7 @@ % % See also graph, digraph, GrB/graph. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/disp.m b/GraphBLAS/GraphBLAS/@GrB/disp.m index 6f4cb59a0d..555a4b4e99 100644 --- a/GraphBLAS/GraphBLAS/@GrB/disp.m +++ b/GraphBLAS/GraphBLAS/@GrB/disp.m @@ -24,7 +24,7 @@ function disp (A, level) % % See also GrB/display. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 2) diff --git a/GraphBLAS/GraphBLAS/@GrB/display.m b/GraphBLAS/GraphBLAS/@GrB/display.m index 92bf4016fc..ec7195da73 100644 --- a/GraphBLAS/GraphBLAS/@GrB/display.m +++ b/GraphBLAS/GraphBLAS/@GrB/display.m @@ -6,7 +6,7 @@ function display (G) %#ok % % See also GrB/disp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 name = inputname (1) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/dmperm.m b/GraphBLAS/GraphBLAS/@GrB/dmperm.m index 2c714517fb..b90645a257 100644 --- a/GraphBLAS/GraphBLAS/@GrB/dmperm.m +++ b/GraphBLAS/GraphBLAS/@GrB/dmperm.m @@ -4,7 +4,7 @@ % % See also GrB/amd, GrB/colamd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [p, varargout{1:nargout-1}] = builtin ('dmperm', logical (G)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/dnn.m b/GraphBLAS/GraphBLAS/@GrB/dnn.m index dfea241858..1c1f5555a1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/dnn.m +++ b/GraphBLAS/GraphBLAS/@GrB/dnn.m @@ -34,7 +34,7 @@ % % See also dnn_builtin, dnn_builtin2gb. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/double.m b/GraphBLAS/GraphBLAS/@GrB/double.m index 58f475b4f2..c8f772d880 100644 --- a/GraphBLAS/GraphBLAS/@GrB/double.m +++ b/GraphBLAS/GraphBLAS/@GrB/double.m @@ -11,7 +11,7 @@ % GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/eadd.m b/GraphBLAS/GraphBLAS/@GrB/eadd.m index 80050c0019..97a765346b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eadd.m +++ b/GraphBLAS/GraphBLAS/@GrB/eadd.m @@ -25,9 +25,9 @@ % GrB.methods; see GrB.mxm and GrB.descriptorinfo for more details. For % the binary operator, see GrB.binopinfo. % -% See also GrB.emult. +% See also GrB.emult, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/eig.m b/GraphBLAS/GraphBLAS/@GrB/eig.m index ad8d65e9c4..70583dc843 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eig.m +++ b/GraphBLAS/GraphBLAS/@GrB/eig.m @@ -4,7 +4,7 @@ % % See also eigs. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/empty.m b/GraphBLAS/GraphBLAS/@GrB/empty.m index 12dc59de6e..563379524d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/empty.m +++ b/GraphBLAS/GraphBLAS/@GrB/empty.m @@ -10,7 +10,7 @@ % % See also GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/emult.m b/GraphBLAS/GraphBLAS/@GrB/emult.m index e42daa1109..2ccc1e0f77 100644 --- a/GraphBLAS/GraphBLAS/@GrB/emult.m +++ b/GraphBLAS/GraphBLAS/@GrB/emult.m @@ -20,9 +20,9 @@ % GrB.methods; see GrB.mxm and GrB.descriptorinfo for more details. For the % binary operator, see GrB.binopinfo. % -% See also GrB.eadd. +% See also GrB.eadd, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/end.m b/GraphBLAS/GraphBLAS/@GrB/end.m index afc17972e7..e9632ea34b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/end.m +++ b/GraphBLAS/GraphBLAS/@GrB/end.m @@ -3,7 +3,7 @@ % % See also GrB/size, GrB/length. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ndims == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/entries.m b/GraphBLAS/GraphBLAS/@GrB/entries.m index 9abb9c43af..d2b4f07977 100644 --- a/GraphBLAS/GraphBLAS/@GrB/entries.m +++ b/GraphBLAS/GraphBLAS/@GrB/entries.m @@ -52,7 +52,7 @@ % % See also GrB.nonz, nnz, GrB/nnz, nonzeros, GrB/nonzeros. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/eps.m b/GraphBLAS/GraphBLAS/@GrB/eps.m index e5dc318b17..f73d327481 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eps.m +++ b/GraphBLAS/GraphBLAS/@GrB/eps.m @@ -5,7 +5,7 @@ % % See also GrB/isfloat, realmax, realmin. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: GraphBLAS should have a built-in eps unary operator. diff --git a/GraphBLAS/GraphBLAS/@GrB/eq.m b/GraphBLAS/GraphBLAS/@GrB/eq.m index 229463317b..36f1d1e2c7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eq.m +++ b/GraphBLAS/GraphBLAS/@GrB/eq.m @@ -8,7 +8,7 @@ % % See also GrB/lt, GrB/le, GrB/gt, GrB/ge, GrB/ne. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % The pattern of C depends on the type of inputs: diff --git a/GraphBLAS/GraphBLAS/@GrB/erf.m b/GraphBLAS/GraphBLAS/@GrB/erf.m index 0670974180..ec6f08581c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/erf.m +++ b/GraphBLAS/GraphBLAS/@GrB/erf.m @@ -5,7 +5,7 @@ % % See also GrB/erfc, erfcx, erfinv, erfcinv. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/erfc.m b/GraphBLAS/GraphBLAS/@GrB/erfc.m index c895296d8f..1cb799b810 100644 --- a/GraphBLAS/GraphBLAS/@GrB/erfc.m +++ b/GraphBLAS/GraphBLAS/@GrB/erfc.m @@ -5,7 +5,7 @@ % % See also GrB/erf, erfcx, erfinv, erfcinv. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/etree.m b/GraphBLAS/GraphBLAS/@GrB/etree.m index f77a5b5de4..a051742c5d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/etree.m +++ b/GraphBLAS/GraphBLAS/@GrB/etree.m @@ -4,7 +4,7 @@ % % See also GrB/amd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = logical (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/eunion.m b/GraphBLAS/GraphBLAS/@GrB/eunion.m index 5728c8fc03..f65aedef53 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eunion.m +++ b/GraphBLAS/GraphBLAS/@GrB/eunion.m @@ -24,9 +24,9 @@ % GrB.methods; see GrB.mxm and GrB.descriptorinfo for more details. For % the binary operator, see GrB.binopinfo. % -% See also GrB.emult. +% See also GrB.emult, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/exp.m b/GraphBLAS/GraphBLAS/@GrB/exp.m index 99b48540ad..1ad99c5d81 100644 --- a/GraphBLAS/GraphBLAS/@GrB/exp.m +++ b/GraphBLAS/GraphBLAS/@GrB/exp.m @@ -5,7 +5,7 @@ % % See also GrB/exp, GrB/expm1, GrB/pow2, GrB/log, GrB/log10, GrB/log2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/expand.m b/GraphBLAS/GraphBLAS/@GrB/expand.m index 7ca64b89f3..5fcb09701b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/expand.m +++ b/GraphBLAS/GraphBLAS/@GrB/expand.m @@ -14,7 +14,7 @@ % % See also GrB.assign. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (scalar)) diff --git a/GraphBLAS/GraphBLAS/@GrB/expm1.m b/GraphBLAS/GraphBLAS/@GrB/expm1.m index cde8c714d9..311e3af66c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/expm1.m +++ b/GraphBLAS/GraphBLAS/@GrB/expm1.m @@ -4,7 +4,7 @@ % % See also GrB/exp, GrB/expm1, GrB/log, GrB/log10, GrB/log2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/extract.m b/GraphBLAS/GraphBLAS/@GrB/extract.m index 8c123a1812..542cfe1c4f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/extract.m +++ b/GraphBLAS/GraphBLAS/@GrB/extract.m @@ -51,6 +51,7 @@ % example. This allows for C = Cin + A(I,J) to be computed. If % not present, no accumulator is used and C=A(I,J) is computed. % If accum is present then Cin is a required input. +% See 'help GrB.binopinfo' for available binary operators. % % M: an optional mask matrix, the same size as C. % @@ -63,9 +64,9 @@ % C2 = A (I,J) % C2 - C % -% See also GrB/subsref. +% See also GrB/subsref, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/extracttuples.m b/GraphBLAS/GraphBLAS/@GrB/extracttuples.m index 7f8ea4cbcb..b38fe6984d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/extracttuples.m +++ b/GraphBLAS/GraphBLAS/@GrB/extracttuples.m @@ -11,18 +11,20 @@ % zero entries in G, while find (G) excludes them. % % The descriptor is optional. desc.base is a string, either 'default', -% 'zero-based', 'one-based int', or 'one-based'. This parameter -% determines the type of output for I and J. The default is one-based, -% so that I and J are returned as double vectors, with one-based indices. -% If max(size(A)) > flintmax, however, the default is 'one-based int', so -% that I and J are int64 vectors with one-based indices. One-based -% indices in I are in the range 1 to m, and the indices in J are in the -% range 1 to n, if A is m-by-n. This is identical to [I,J,X] = find (A) -% for a built-in sparse or full matrix. +% 'zero-based', 'one-based int', 'one-based', 'double' or 'one-based +% double'. This determines the type of output for I and J. The default +% is 'one-based int', so that I and J are returned as int32 or int64 +% vectors, with one-based indices. For 'double', or 'one-based double', +% then I and J are returned as double, unless the dimensions are > +% flintmax, in which case they are returned as int64. One-based indices +% in I are in the range 1 to m, and the indices in J are in the range 1 to +% n, if A is m-by-n. This is identical to [I,J,X] = find (A) for a +% built-in sparse or full MATLAB matrix, except that the MATLAB find +% returns I and J as double. % -% If 'zero-based', I and J are returned as int64 arrays, with zero-based -% indices. The entries in I and J are in the range 0 to m-1 and 0 to -% n-1, respectively, if [m n] = size (A). This usage is not the +% If 'zero-based', I and J are returned as int32 or int64 arrays, with +% zero-based indices. The entries in I and J are in the range 0 to m-1 +% and 0 to n-1, respectively, if [m n] = size (A). This usage is not the % conventional 1-based indexing, but it is the fastest method. % % The overloaded [I,J,X] = find (A) method for a GraphBLAS matrix A uses @@ -30,7 +32,7 @@ % % See also GrB/find, GrB/build. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/eye.m b/GraphBLAS/GraphBLAS/@GrB/eye.m index 0057943f7e..992b177b25 100644 --- a/GraphBLAS/GraphBLAS/@GrB/eye.m +++ b/GraphBLAS/GraphBLAS/@GrB/eye.m @@ -10,7 +10,7 @@ % % See also GrB/spones, spdiags, GrB.speye, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = GrB (gb_speye ('eye', varargin {:})) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/false.m b/GraphBLAS/GraphBLAS/@GrB/false.m index ccb7835126..0beb1d3f0c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/false.m +++ b/GraphBLAS/GraphBLAS/@GrB/false.m @@ -9,7 +9,7 @@ % % See also GrB.ones, GrB.true, GrB.zeros, GrB.eye, GrB.speye. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n, ~] = gb_parse_args ('false', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/finalize.m b/GraphBLAS/GraphBLAS/@GrB/finalize.m index 7f1ca7d0b9..0a0e29991b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/finalize.m +++ b/GraphBLAS/GraphBLAS/@GrB/finalize.m @@ -8,7 +8,7 @@ % % See also GrB.clear, GrB.init. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % does not call GrB_finalize diff --git a/GraphBLAS/GraphBLAS/@GrB/find.m b/GraphBLAS/GraphBLAS/@GrB/find.m index 705c98f5e9..71593ac00d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/find.m +++ b/GraphBLAS/GraphBLAS/@GrB/find.m @@ -17,20 +17,19 @@ % [...] = find (G, k, 'first') returns the first k nonozeros of G. % [...] = find (G, k, 'last') returns the last k nonozeros of G. % For this usage, the first and last k are in terms of nonzeros in the -% column-major order. +% column-major order. Note that this usage is much slower than when +% using a MATLAB/Octave built-in matrix, because a GraphBLAS matrix must +% have the ability to hold explicit zeros. These must be pruned to match +% the behavior of find(G,k). +% +% The indices I and J are returned as int32 or int64 column vectors, +% depending on the dimenions of the matrix G. % % See also sparse, GrB.build, GrB.extracttuples. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -% FUTURE: find (G,k,'first') and find (G,k,'last') are slow. -% They are currently implemented, all entries are extracted and then the -% first or last k are selected from the extracted tuples. It would be -% faster to use a mexFunction that directly accesses the opaque content -% of G, instead of using GrB_Matrix_extractTuples_*, which always extracts -% the entire matrix. - if (isobject (G)) G = G.opaque ; end @@ -76,7 +75,7 @@ else % extract linear indices from a matrix [I, J] = gbextracttuples (G) ; - % use the built-in sub2ind to convert the 2D indices to linear indices + % use the built-in sub2ind to convert the 2D indices to 1D indices I = sub2ind ([m n], I, J) ; end end diff --git a/GraphBLAS/GraphBLAS/@GrB/fix.m b/GraphBLAS/GraphBLAS/@GrB/fix.m index 3e2d3f7c09..7a65d68c5d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/fix.m +++ b/GraphBLAS/GraphBLAS/@GrB/fix.m @@ -5,7 +5,7 @@ % % See also GrB/ceil, GrB/floor, GrB/round. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/flip.m b/GraphBLAS/GraphBLAS/@GrB/flip.m index d0e838c161..baa16ec068 100644 --- a/GraphBLAS/GraphBLAS/@GrB/flip.m +++ b/GraphBLAS/GraphBLAS/@GrB/flip.m @@ -9,7 +9,7 @@ % % See also GrB/transpose. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 a_is_object = isobject (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/floor.m b/GraphBLAS/GraphBLAS/@GrB/floor.m index 26cd717b95..6252c47cfd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/floor.m +++ b/GraphBLAS/GraphBLAS/@GrB/floor.m @@ -5,7 +5,7 @@ % % See also GrB/ceil, GrB/round, GrB/fix. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/format.m b/GraphBLAS/GraphBLAS/@GrB/format.m index f0efb94d27..7f75c4657b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/format.m +++ b/GraphBLAS/GraphBLAS/@GrB/format.m @@ -116,7 +116,7 @@ % % See also GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/fprintf.m b/GraphBLAS/GraphBLAS/@GrB/fprintf.m index e29b660293..57bebf7857 100644 --- a/GraphBLAS/GraphBLAS/@GrB/fprintf.m +++ b/GraphBLAS/GraphBLAS/@GrB/fprintf.m @@ -6,7 +6,7 @@ % % See also fprintf, sprintf, GrB/sprintf. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 c = gb_printf_helper ('fprintf', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/full.m b/GraphBLAS/GraphBLAS/@GrB/full.m index 0dab0f3ebc..42f0b4e313 100644 --- a/GraphBLAS/GraphBLAS/@GrB/full.m +++ b/GraphBLAS/GraphBLAS/@GrB/full.m @@ -24,7 +24,7 @@ % % See also GrB/issparse, sparse, cast, GrB.type, GrB, GrB.isfull. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A_is_GrB = isobject (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/gamma.m b/GraphBLAS/GraphBLAS/@GrB/gamma.m index bf3ab1edcf..b04f16213c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/gamma.m +++ b/GraphBLAS/GraphBLAS/@GrB/gamma.m @@ -5,7 +5,7 @@ % % See also GrB/gammaln. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/gammaln.m b/GraphBLAS/GraphBLAS/@GrB/gammaln.m index 51ef142bb1..36410193ee 100644 --- a/GraphBLAS/GraphBLAS/@GrB/gammaln.m +++ b/GraphBLAS/GraphBLAS/@GrB/gammaln.m @@ -6,7 +6,7 @@ % % See also GrB/gammaln. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/ge.m b/GraphBLAS/GraphBLAS/@GrB/ge.m index ce2f02afc0..ce8745b397 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ge.m +++ b/GraphBLAS/GraphBLAS/@GrB/ge.m @@ -5,7 +5,7 @@ % % See also GrB/lt, GrB/le, GrB/gt, GrB/ne, GrB/eq. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = le (B, A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/graph.m b/GraphBLAS/GraphBLAS/@GrB/graph.m index 7754acc276..e23231c9d6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/graph.m +++ b/GraphBLAS/GraphBLAS/@GrB/graph.m @@ -23,7 +23,7 @@ % % See also graph, digraph, GrB/digraph. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/gt.m b/GraphBLAS/GraphBLAS/@GrB/gt.m index e43ff0b99b..a6cc4dced0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/gt.m +++ b/GraphBLAS/GraphBLAS/@GrB/gt.m @@ -5,7 +5,7 @@ % % See also GrB/lt, GrB/le, GrB/ge, GrB/ne, GrB/eq. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = lt (B, A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/horzcat.m b/GraphBLAS/GraphBLAS/@GrB/horzcat.m index e92627a2a3..a699c58615 100644 --- a/GraphBLAS/GraphBLAS/@GrB/horzcat.m +++ b/GraphBLAS/GraphBLAS/@GrB/horzcat.m @@ -7,7 +7,7 @@ % % See also GrB/vertcat, GrB/cat, GrB.cell2mat, GrB/mat2cell, GrB/num2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the input matrices diff --git a/GraphBLAS/GraphBLAS/@GrB/hypot.m b/GraphBLAS/GraphBLAS/@GrB/hypot.m index 8d4d0772fd..9d71fd64e8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/hypot.m +++ b/GraphBLAS/GraphBLAS/@GrB/hypot.m @@ -8,7 +8,7 @@ % % See also GrB/abs, GrB/norm, GrB/sqrt, GrB/plus, GrB.eadd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/imag.m b/GraphBLAS/GraphBLAS/@GrB/imag.m index 5474e98a46..bfdfe4122d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/imag.m +++ b/GraphBLAS/GraphBLAS/@GrB/imag.m @@ -4,7 +4,7 @@ % % See also GrB/conj, GrB/real. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/incidence.m b/GraphBLAS/GraphBLAS/@GrB/incidence.m index 782b7a76bb..abe848073c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/incidence.m +++ b/GraphBLAS/GraphBLAS/@GrB/incidence.m @@ -36,7 +36,7 @@ % % See also graph/incidence, digraph/incidence. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) @@ -93,7 +93,13 @@ [I, J] = gbextracttuples (A, desc) ; e = length (I) ; I = [I ; J] ; -J = (int64 (0) : int64 (e-1))' ; +if (e > intmax ('uint32')) + % this line of code is not tested by gbtest since it requires + % a huge test problem: + J = (uint64 (0) : uint64 (e-1))' ; +else + J = (uint32 (0) : uint32 (e-1))' ; +end J = [J ; J] ; X = ones (e, 1, type) ; X = [-X ; X] ; diff --git a/GraphBLAS/GraphBLAS/@GrB/init.m b/GraphBLAS/GraphBLAS/@GrB/init.m index 4831e00484..d583e08572 100644 --- a/GraphBLAS/GraphBLAS/@GrB/init.m +++ b/GraphBLAS/GraphBLAS/@GrB/init.m @@ -8,7 +8,7 @@ % % See also GrB.clear, GrB.finalize, startup. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 gbclear ; diff --git a/GraphBLAS/GraphBLAS/@GrB/int16.m b/GraphBLAS/GraphBLAS/@GrB/int16.m index 1e373bae66..008744ff12 100644 --- a/GraphBLAS/GraphBLAS/@GrB/int16.m +++ b/GraphBLAS/GraphBLAS/@GrB/int16.m @@ -10,7 +10,7 @@ % See also GrB, GrB/double, GrB/complex, GrB/single, GrB/logical, GrB/int8, % GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/int32.m b/GraphBLAS/GraphBLAS/@GrB/int32.m index cfd8bfb8fc..ba4828c559 100644 --- a/GraphBLAS/GraphBLAS/@GrB/int32.m +++ b/GraphBLAS/GraphBLAS/@GrB/int32.m @@ -9,7 +9,7 @@ % See also GrB, GrB/double, GrB/complex, GrB/single, GrB/logical, GrB/int8, % GrB/int16, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/int64.m b/GraphBLAS/GraphBLAS/@GrB/int64.m index 1ac560a5b0..160e787f96 100644 --- a/GraphBLAS/GraphBLAS/@GrB/int64.m +++ b/GraphBLAS/GraphBLAS/@GrB/int64.m @@ -9,7 +9,7 @@ % See also GrB, GrB/double, GrB/complex, GrB/single, GrB/logical, GrB/int8, % GrB/int16, GrB/int32, GrB/uint8, GrB/uint16, GrB/uint32, GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/int8.m b/GraphBLAS/GraphBLAS/@GrB/int8.m index e001507a37..1c2c22eed7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/int8.m +++ b/GraphBLAS/GraphBLAS/@GrB/int8.m @@ -10,7 +10,7 @@ % GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isa.m b/GraphBLAS/GraphBLAS/@GrB/isa.m index 4f0966847e..e3dffbe910 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isa.m +++ b/GraphBLAS/GraphBLAS/@GrB/isa.m @@ -19,7 +19,7 @@ % See also class, GrB.type, GrB/isnumeric, GrB/islogical, GrB/isfloat, % GrB/isinteger, isobject, GrB/issparse, GrB/isreal. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isequal (type, 'GrB') || isequal (type, 'numeric')) diff --git a/GraphBLAS/GraphBLAS/@GrB/isbanded.m b/GraphBLAS/GraphBLAS/@GrB/isbanded.m index 2a38c3adef..20e9b9fec6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isbanded.m +++ b/GraphBLAS/GraphBLAS/@GrB/isbanded.m @@ -4,7 +4,7 @@ % % See also GrB/istril, GrB/istriu, GrB/bandwidth. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/isbycol.m b/GraphBLAS/GraphBLAS/@GrB/isbycol.m index ed53993464..51b7976927 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isbycol.m +++ b/GraphBLAS/GraphBLAS/@GrB/isbycol.m @@ -6,7 +6,7 @@ % % See also GrB.isbyrow, GrB.format. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/isbyrow.m b/GraphBLAS/GraphBLAS/@GrB/isbyrow.m index d6b3a51a26..c82faecb6b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isbyrow.m +++ b/GraphBLAS/GraphBLAS/@GrB/isbyrow.m @@ -6,7 +6,7 @@ % % See also GrB.isbycol, GrB.format. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/isdiag.m b/GraphBLAS/GraphBLAS/@GrB/isdiag.m index a90ced08b3..8094ec565c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isdiag.m +++ b/GraphBLAS/GraphBLAS/@GrB/isdiag.m @@ -4,7 +4,7 @@ % % See also GrB/isbanded. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [lo,hi] = gbbandwidth (G.opaque, 1, 1) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isempty.m b/GraphBLAS/GraphBLAS/@GrB/isempty.m index ded68b8471..d0fa5a86a1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isempty.m +++ b/GraphBLAS/GraphBLAS/@GrB/isempty.m @@ -4,7 +4,7 @@ % % See also GrB/size. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = size (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isequal.m b/GraphBLAS/GraphBLAS/@GrB/isequal.m index 5ffe90dcb1..600c7fec36 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isequal.m +++ b/GraphBLAS/GraphBLAS/@GrB/isequal.m @@ -15,7 +15,7 @@ % % See also isequal, GrB/eq, isequaln. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/isfinite.m b/GraphBLAS/GraphBLAS/@GrB/isfinite.m index 5251cc34fe..95f8e96c19 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isfinite.m +++ b/GraphBLAS/GraphBLAS/@GrB/isfinite.m @@ -5,7 +5,7 @@ % % See also GrB/isnan, GrB/isinf. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isfloat.m b/GraphBLAS/GraphBLAS/@GrB/isfloat.m index a569c7d3ec..d1e9ac5a21 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isfloat.m +++ b/GraphBLAS/GraphBLAS/@GrB/isfloat.m @@ -6,7 +6,7 @@ % See also GrB/isnumeric, GrB/isreal, GrB/isinteger, GrB/islogical, % GrB.type, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isfull.m b/GraphBLAS/GraphBLAS/@GrB/isfull.m index ba3b1c9d0f..b60e813975 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isfull.m +++ b/GraphBLAS/GraphBLAS/@GrB/isfull.m @@ -6,7 +6,7 @@ % % See also GrB/issparse, GrB/full. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/ishermitian.m b/GraphBLAS/GraphBLAS/@GrB/ishermitian.m index 14adb8ce06..a0ca55bf31 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ishermitian.m +++ b/GraphBLAS/GraphBLAS/@GrB/ishermitian.m @@ -6,7 +6,7 @@ % % See also GrB/issymmetric. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isinf.m b/GraphBLAS/GraphBLAS/@GrB/isinf.m index e0f3917201..d4466e6667 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isinf.m +++ b/GraphBLAS/GraphBLAS/@GrB/isinf.m @@ -5,7 +5,7 @@ % % See also GrB/isnan, GrB/isfinite. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isinteger.m b/GraphBLAS/GraphBLAS/@GrB/isinteger.m index 1110ee9316..0cd9886661 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isinteger.m +++ b/GraphBLAS/GraphBLAS/@GrB/isinteger.m @@ -6,7 +6,7 @@ % See also GrB/isnumeric, GrB/isfloat, GrB/isreal, GrB/islogical, % GrB.type, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/islogical.m b/GraphBLAS/GraphBLAS/@GrB/islogical.m index 3843e81b99..2b631d770e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/islogical.m +++ b/GraphBLAS/GraphBLAS/@GrB/islogical.m @@ -5,7 +5,7 @@ % See also GrB/isnumeric, GrB/isfloat, GrB/isreal, GrB/isinteger, % GrB.type, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/ismatrix.m b/GraphBLAS/GraphBLAS/@GrB/ismatrix.m index dfb3ef5e19..1329e8dc85 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ismatrix.m +++ b/GraphBLAS/GraphBLAS/@GrB/ismatrix.m @@ -5,7 +5,7 @@ % See also GrB/issparse, GrB/isvector, GrB/isscalar, GrB/full, GrB/isa, % GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = true ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isnan.m b/GraphBLAS/GraphBLAS/@GrB/isnan.m index beb2cc91f9..5ccfd11d37 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isnan.m +++ b/GraphBLAS/GraphBLAS/@GrB/isnan.m @@ -4,7 +4,7 @@ % % See also GrB/isinf, GrB/isfinite. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isnumeric.m b/GraphBLAS/GraphBLAS/@GrB/isnumeric.m index d8804fcafd..cf4b2c7741 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isnumeric.m +++ b/GraphBLAS/GraphBLAS/@GrB/isnumeric.m @@ -7,7 +7,7 @@ % See also GrB/isfloat, GrB/isreal, GrB/isinteger, GrB/islogical, % GrB.type, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = true ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isreal.m b/GraphBLAS/GraphBLAS/@GrB/isreal.m index d312166db3..0ea1f7f3be 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isreal.m +++ b/GraphBLAS/GraphBLAS/@GrB/isreal.m @@ -6,7 +6,7 @@ % See also GrB/isnumeric, GrB/isfloat, GrB/isinteger, GrB/islogical, % GrB.type, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isscalar.m b/GraphBLAS/GraphBLAS/@GrB/isscalar.m index 33dbafdab1..7d8f2ad819 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isscalar.m +++ b/GraphBLAS/GraphBLAS/@GrB/isscalar.m @@ -5,7 +5,7 @@ % See also GrB/issparse, GrB/ismatrix, GrB/isvector, GrB/issparse, % GrB/isfull, GrB/isa, GrB, GrB/size. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/issigned.m b/GraphBLAS/GraphBLAS/@GrB/issigned.m index 3ee71259f8..60622707be 100644 --- a/GraphBLAS/GraphBLAS/@GrB/issigned.m +++ b/GraphBLAS/GraphBLAS/@GrB/issigned.m @@ -9,7 +9,7 @@ % % See also GrB/isinteger, GrB/isreal, GrB/isnumeric, GrB/isfloat, GrB.type. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ischar (arg)) diff --git a/GraphBLAS/GraphBLAS/@GrB/issparse.m b/GraphBLAS/GraphBLAS/@GrB/issparse.m index 8ec85a245b..1290cd0e7a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/issparse.m +++ b/GraphBLAS/GraphBLAS/@GrB/issparse.m @@ -10,7 +10,7 @@ % % See also GrB/ismatrix, GrB/isvector, GrB/isscalar, GrB/isfull, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = true ; diff --git a/GraphBLAS/GraphBLAS/@GrB/issymmetric.m b/GraphBLAS/GraphBLAS/@GrB/issymmetric.m index 06971c6549..e471773d95 100644 --- a/GraphBLAS/GraphBLAS/@GrB/issymmetric.m +++ b/GraphBLAS/GraphBLAS/@GrB/issymmetric.m @@ -6,7 +6,7 @@ % % See also GrB/ishermitian. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/istril.m b/GraphBLAS/GraphBLAS/@GrB/istril.m index e24885763e..3390765098 100644 --- a/GraphBLAS/GraphBLAS/@GrB/istril.m +++ b/GraphBLAS/GraphBLAS/@GrB/istril.m @@ -7,7 +7,7 @@ % % See also GrB/istriu, GrB/isbanded. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~,hi] = gbbandwidth (G.opaque, 0, 1) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/istriu.m b/GraphBLAS/GraphBLAS/@GrB/istriu.m index 627af1af5c..653d1d7cfd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/istriu.m +++ b/GraphBLAS/GraphBLAS/@GrB/istriu.m @@ -7,7 +7,7 @@ % % See also GrB/istriu, GrB/isbanded. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [lo,~] = gbbandwidth (G.opaque, 1, 0) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/isvector.m b/GraphBLAS/GraphBLAS/@GrB/isvector.m index 2d2526bcaf..34c52fa0db 100644 --- a/GraphBLAS/GraphBLAS/@GrB/isvector.m +++ b/GraphBLAS/GraphBLAS/@GrB/isvector.m @@ -5,7 +5,7 @@ % See also GrB/issparse, GrB/ismatrix, GrB/isscalar, GrB/issparse, % GrB/isfull, GrB/isa, GrB, GrB/size. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/jit.m b/GraphBLAS/GraphBLAS/@GrB/jit.m index 6a4ac48ce6..ad4c0b7280 100644 --- a/GraphBLAS/GraphBLAS/@GrB/jit.m +++ b/GraphBLAS/GraphBLAS/@GrB/jit.m @@ -1,15 +1,15 @@ -function [s,path] = jit (s,path) +function [status] = jit (status) %GRB.JIT controls the GraphBLAS JIT % -% s = GrB.jit ; % get the current status of the JIT -% s = GrB.jit (s) ; % control the JIT and get its status +% status = GrB.jit ; % get the current status of the JIT +% status = GrB.jit (status) ; % control the JIT and get its status % % The GraphBLAS JIT allows GraphBLAS to compile new kernels at run-time % that are specifically tuned for the particular operators, types, and % matrix formats. Without the JIT, only a selected combination of these % options are computed with high-performance kernels. % -% GrB.jit controls the GraphBLAS JIT. Its input/ouput s is a string: +% GrB.jit controls the GraphBLAS JIT. Its input/ouput status is a string: % % '' leave the JIT control unchanged. % 'off' do not use the JIT, and free any loaded JIT kernels. @@ -22,32 +22,19 @@ % % Refer to the GraphBLAS User Guide for details (GxB_JIT_C_CONTROL). % -% A second input/output parameter gives the path to a cache folder where -% GraphBLAS keeps the kernels it compiles for the user. By default, this -% is ~/.SuiteSparse/GrB8.0.0 for GraphBLAS v8.0.0, with a new cache path -% used % for each future @GrB version. -% -% On Apple Silicon, the MATLAB JIT kernels are compiled as x86 binaries, -% but the pure C installation may compile native Arm64 binaries. Do not -% mix the two. In this case, set another cache path for MATLAB using -% this method or using GxB_set in the C interface for your native Arm64 -% binaries. See the User Guide for details. -% % Example: % -% [s,path] = GrB.jit -% [s,path] = GrB.jit ('on', '/home/me/myothercache') +% [status] = GrB.jit +% [status] = GrB.jit ('on') % % See also GrB.threads, GrB.clear. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) - [s, path] = gbjit ; + [status] = gbjit ; elseif (nargin == 1) - [s, path] = gbjit (s) ; -elseif (nargin == 2) - [s, path] = gbjit (s, path) ; + [status] = gbjit (status) ; end diff --git a/GraphBLAS/GraphBLAS/@GrB/kron.m b/GraphBLAS/GraphBLAS/@GrB/kron.m index d26d5b320d..92583ee9dc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/kron.m +++ b/GraphBLAS/GraphBLAS/@GrB/kron.m @@ -4,7 +4,7 @@ % % See also GrB.kronecker. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/kronecker.m b/GraphBLAS/GraphBLAS/@GrB/kronecker.m index 5254df6408..6a627173c6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/kronecker.m +++ b/GraphBLAS/GraphBLAS/@GrB/kronecker.m @@ -13,9 +13,9 @@ % % T is then accumulated into C via C<#M,replace> = accum (C,T). % -% See also kron, GrB/kron. +% See also kron, GrB/kron, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/ktruss.m b/GraphBLAS/GraphBLAS/@GrB/ktruss.m index cd91ff13b9..c0b5e2e73b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ktruss.m +++ b/GraphBLAS/GraphBLAS/@GrB/ktruss.m @@ -35,7 +35,7 @@ % % See also GrB.tricount. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/laplacian.m b/GraphBLAS/GraphBLAS/@GrB/laplacian.m index 8d1b837fc7..ca768fb878 100644 --- a/GraphBLAS/GraphBLAS/@GrB/laplacian.m +++ b/GraphBLAS/GraphBLAS/@GrB/laplacian.m @@ -26,7 +26,7 @@ % % See also graph/laplacian. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/ldivide.m b/GraphBLAS/GraphBLAS/@GrB/ldivide.m index 7d52d667dd..14ae1e0320 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ldivide.m +++ b/GraphBLAS/GraphBLAS/@GrB/ldivide.m @@ -4,7 +4,7 @@ % % See also GrB/rdivide. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = rdivide (B, A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/le.m b/GraphBLAS/GraphBLAS/@GrB/le.m index 14973fa120..3451bbc358 100644 --- a/GraphBLAS/GraphBLAS/@GrB/le.m +++ b/GraphBLAS/GraphBLAS/@GrB/le.m @@ -11,7 +11,7 @@ % B scalar, A matrix: C is full if B>=0, otherwise C is a subset of A. % A matrix, B matrix: C is full. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/length.m b/GraphBLAS/GraphBLAS/@GrB/length.m index fdb94be503..4a7e9c009e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/length.m +++ b/GraphBLAS/GraphBLAS/@GrB/length.m @@ -7,7 +7,7 @@ % % See also GrB/size, GrB/numel. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/load.m b/GraphBLAS/GraphBLAS/@GrB/load.m index a82eae0d2c..31a8fc9531 100644 --- a/GraphBLAS/GraphBLAS/@GrB/load.m +++ b/GraphBLAS/GraphBLAS/@GrB/load.m @@ -17,7 +17,7 @@ % % See also GrB.save, GrB/struct, GrB.serialize, GrB.deserialize. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/log.m b/GraphBLAS/GraphBLAS/@GrB/log.m index d6f07bc694..5cfb0c0df4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/log.m +++ b/GraphBLAS/GraphBLAS/@GrB/log.m @@ -6,7 +6,7 @@ % % See also GrB/log1p, GrB/log2, GrB/log10, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/log10.m b/GraphBLAS/GraphBLAS/@GrB/log10.m index ecc21271a2..e22d46f8f4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/log10.m +++ b/GraphBLAS/GraphBLAS/@GrB/log10.m @@ -6,7 +6,7 @@ % % See also GrB/log, GrB/log1p, GrB/log2, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/log1p.m b/GraphBLAS/GraphBLAS/@GrB/log1p.m index 9b4b61b98d..37eae9a4f8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/log1p.m +++ b/GraphBLAS/GraphBLAS/@GrB/log1p.m @@ -5,7 +5,7 @@ % % See also GrB/log, GrB/log2, GrB/log10, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/log2.m b/GraphBLAS/GraphBLAS/@GrB/log2.m index cb65031282..8deec0023a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/log2.m +++ b/GraphBLAS/GraphBLAS/@GrB/log2.m @@ -11,7 +11,7 @@ % % See also GrB/pow2, GrB/log, GrB/log1p, GrB/log10, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/logical.m b/GraphBLAS/GraphBLAS/@GrB/logical.m index 74dcb11430..8af385288a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/logical.m +++ b/GraphBLAS/GraphBLAS/@GrB/logical.m @@ -11,7 +11,7 @@ % GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/lt.m b/GraphBLAS/GraphBLAS/@GrB/lt.m index 6194197bc0..90184d6dc7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/lt.m +++ b/GraphBLAS/GraphBLAS/@GrB/lt.m @@ -11,7 +11,7 @@ % B scalar, A matrix: C is full if B>0, otherwise C is a subset of A. % A matrix, B matrix: C has the pattern of the set union, A+B. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/mat2cell.m b/GraphBLAS/GraphBLAS/@GrB/mat2cell.m index c9a6267daa..f7e6d20b16 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mat2cell.m +++ b/GraphBLAS/GraphBLAS/@GrB/mat2cell.m @@ -23,7 +23,7 @@ % % See also GrB/horzcat, GrB/vertcat, GrB/cat, GrB.cell2mat, GrB/num2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/max.m b/GraphBLAS/GraphBLAS/@GrB/max.m index c5cf47f056..90eeaf3f16 100644 --- a/GraphBLAS/GraphBLAS/@GrB/max.m +++ b/GraphBLAS/GraphBLAS/@GrB/max.m @@ -18,7 +18,7 @@ % % See also GrB/min, GrB.argmax. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/min.m b/GraphBLAS/GraphBLAS/@GrB/min.m index 4005e83f77..3a5a919b56 100644 --- a/GraphBLAS/GraphBLAS/@GrB/min.m +++ b/GraphBLAS/GraphBLAS/@GrB/min.m @@ -18,7 +18,7 @@ % % See also GrB/max, GrB.argmin. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/minus.m b/GraphBLAS/GraphBLAS/@GrB/minus.m index 3622cab820..844b1a630d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/minus.m +++ b/GraphBLAS/GraphBLAS/@GrB/minus.m @@ -7,7 +7,7 @@ % % See also GrB.eadd, GrB/plus, GrB/uminus. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/mis.m b/GraphBLAS/GraphBLAS/@GrB/mis.m index 95a05437ff..2e5da60df8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mis.m +++ b/GraphBLAS/GraphBLAS/@GrB/mis.m @@ -22,7 +22,7 @@ % % See also GrB.offdiag. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/mldivide.m b/GraphBLAS/GraphBLAS/@GrB/mldivide.m index fed9e79040..b2f81dc892 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mldivide.m +++ b/GraphBLAS/GraphBLAS/@GrB/mldivide.m @@ -6,7 +6,7 @@ % % See also GrB/mrdivide. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isscalar (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/monoidinfo.m b/GraphBLAS/GraphBLAS/@GrB/monoidinfo.m index 946fb52612..94aea4a51c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/monoidinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/monoidinfo.m @@ -43,10 +43,10 @@ function monoidinfo (monoid, type) % GrB.monoidinfo ('abs.double') ; % GrB.monoidinfo ('min.complex') ; % -% See also GrB.binopinfo, GrB.descriptorinfo, GrB.selectopinfo, -% GrB.semiringinfo, GrB.unopinfo. +% See also GrB.monoids, GrB.binopinfo, GrB.descriptorinfo, +% GrB.selectopinfo, GrB.semiringinfo, GrB.unopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/monoids.m b/GraphBLAS/GraphBLAS/@GrB/monoids.m new file mode 100644 index 0000000000..064facae4d --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/monoids.m @@ -0,0 +1,102 @@ +function result = monoids +%GRB.MONOIDS list all monoids +% Redundant monoids are not listed. For example '+.logical' +% exists, but it is identical to '|.logical'. +% +% Example: +% GrB.monoids ; % prints a list, with descriptions +% list = GrB.monoids ; % returns the list (nothing printed) +% +% See also GrB.monoidinfo. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +types = { + 'logical' + 'double' + 'single' + 'int8' + 'int16' + 'int32' + 'int64' + 'uint8' + 'uint16' + 'uint32' + 'uint64' + 'single complex' + 'double complex' + } ; + +binops = gb_binops ; + +useful_monoids = {'any', 'min', 'max', '+', '*', '==', '~=', '|', '&', ... + 'xor', 'xnor', 'bitand', 'bitor', 'bitxor', 'bitxnor' } ; + +skip_logical = {'min', 'max', '+', '-', 'rminus', '*', '/', '\', 'iseq', ... + 'isne', 'isgt', 'islt', 'isle', 'isge', 'pow', '~=', '==' } ; + +nmonoids = 0 ; +nops = size (binops, 1) ; + +if (nargout > 0) + result = { } ; +end + +for k1 = 1:nops + add = binops {k1,1} ; + add_description = binops {k1,2} ; + first_add = true ; + + % skip redundant monoids + if (~ismember (add, useful_monoids)) + continue ; + end + + for k3 = 1:length (types) + type = types {k3} ; + ok = false ; + monoid = [add '.' type] ; + + % skip redundant logical monoids + if (isequal (type, 'logical') && ... + ismember (add, skip_logical)) + continue ; + end + + try + ok = gbmonoidinfo (monoid) ; + nmonoids = nmonoids + 1 ; + if (nargout > 0) + result = [result ; monoid] ; %#ok + end + catch + % this is an error, but it is expected since not all + % combinations operators and types can be used to construct + % a valid monoid. + end + if (ok && nargout == 0) + if (first_add) + fprintf ('\nmonoid: %s', add) ; + if (isempty (add_description)) + fprintf ('\n') ; + else + fprintf (', where %s\n', add_description) ; + end + fprintf (' types: %s', type) ; + else + fprintf (', %s', type) ; + end + first_add = false ; + end + end + if (~first_add && nargout == 0) + fprintf ('\n') ; + end + +end + +if (nargout == 0) + fprintf ('\nTotal number of available monoids: %d\n', nmonoids) ; +end + diff --git a/GraphBLAS/GraphBLAS/@GrB/mpower.m b/GraphBLAS/GraphBLAS/@GrB/mpower.m index 8d29b3258e..a3c039d1cf 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mpower.m +++ b/GraphBLAS/GraphBLAS/@GrB/mpower.m @@ -5,7 +5,7 @@ % % See also GrB/power. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/mrdivide.m b/GraphBLAS/GraphBLAS/@GrB/mrdivide.m index 0d832b5fb7..008e1f3124 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mrdivide.m +++ b/GraphBLAS/GraphBLAS/@GrB/mrdivide.m @@ -6,7 +6,7 @@ % % See also GrB/mldivide. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isscalar (B)) diff --git a/GraphBLAS/GraphBLAS/@GrB/mtimes.m b/GraphBLAS/GraphBLAS/@GrB/mtimes.m index 9fadb94139..c28f62207e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mtimes.m +++ b/GraphBLAS/GraphBLAS/@GrB/mtimes.m @@ -5,7 +5,7 @@ % % See also GrB.mxm, GrB.emult, GrB/times. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/mxm.m b/GraphBLAS/GraphBLAS/@GrB/mxm.m index 48ef35ac04..8f7ad0db4b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/mxm.m +++ b/GraphBLAS/GraphBLAS/@GrB/mxm.m @@ -20,8 +20,8 @@ % Cin is an optional input matrix. If Cin is not present or is an empty % matrix (Cin = [ ]) then it is implicitly a matrix with no entries, of the % right size (which depends on A, B, and the descriptor). Its type is the -% output type of the accum operator, if it is present; otherwise, its type -% is the type of the additive monoid of the semiring. +% output type of the accum binary operator, if it is present; otherwise, its +% type is the type of the additive monoid of the semiring. % % M is the optional mask matrix. If not present, or if empty, then no mask % is used. If present, M must have the same size as C. @@ -55,9 +55,10 @@ % C3 = E ; AB = A*B ; C3 (M) = C3 (M) + AB (M) ; % norm (C2-C3,1) % -% See also GrB.descriptorinfo, GrB.add, GrB/mtimes. +% See also GrB.descriptorinfo, GrB.add, GrB/mtimes, GrB.semiringinfo, +% GrB.moniodinfo, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/ne.m b/GraphBLAS/GraphBLAS/@GrB/ne.m index 66101d56ae..9eca5e3949 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ne.m +++ b/GraphBLAS/GraphBLAS/@GrB/ne.m @@ -12,7 +12,7 @@ % A matrix, B matrix: C is sparse, with the pattern of A+B. % Zeroes are then dropped from C after it is computed. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/nnz.m b/GraphBLAS/GraphBLAS/@GrB/nnz.m index 25ecfe2aae..2cdab6ecf1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/nnz.m +++ b/GraphBLAS/GraphBLAS/@GrB/nnz.m @@ -6,7 +6,7 @@ % % See also GrB.entries, GrB.prune, GrB/nonzeros, GrB/size, GrB/numel. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/nonz.m b/GraphBLAS/GraphBLAS/@GrB/nonz.m index 30aaae6be2..30ccdf9adb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/nonz.m +++ b/GraphBLAS/GraphBLAS/@GrB/nonz.m @@ -52,7 +52,7 @@ % % See also GrB.entries, GrB/nnz, GrB/nonzeros, GrB.prune. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 builtin_sparse = false ; diff --git a/GraphBLAS/GraphBLAS/@GrB/nonzeros.m b/GraphBLAS/GraphBLAS/@GrB/nonzeros.m index 671d4877cc..4a7a273323 100644 --- a/GraphBLAS/GraphBLAS/@GrB/nonzeros.m +++ b/GraphBLAS/GraphBLAS/@GrB/nonzeros.m @@ -8,7 +8,7 @@ % % See also GrB.extracttuples, GrB.entries, GrB.nonz, GrB/find. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/norm.m b/GraphBLAS/GraphBLAS/@GrB/norm.m index 7ea0f230e1..bf338b9594 100644 --- a/GraphBLAS/GraphBLAS/@GrB/norm.m +++ b/GraphBLAS/GraphBLAS/@GrB/norm.m @@ -20,7 +20,7 @@ % % See also GrB.reduce, GrB.normdiff. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: add the p-norm for vectors. diff --git a/GraphBLAS/GraphBLAS/@GrB/normdiff.m b/GraphBLAS/GraphBLAS/@GrB/normdiff.m index b688cd1de7..b5a74cf6aa 100644 --- a/GraphBLAS/GraphBLAS/@GrB/normdiff.m +++ b/GraphBLAS/GraphBLAS/@GrB/normdiff.m @@ -18,7 +18,7 @@ % % See also GrB.reduce, GrB/norm. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/GraphBLAS/@GrB/not.m b/GraphBLAS/GraphBLAS/@GrB/not.m index 1116f4c8a6..23f1bb301f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/not.m +++ b/GraphBLAS/GraphBLAS/@GrB/not.m @@ -6,7 +6,7 @@ % % See also GrB.apply. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/num2cell.m b/GraphBLAS/GraphBLAS/@GrB/num2cell.m index d10645f2f7..adbaed5199 100644 --- a/GraphBLAS/GraphBLAS/@GrB/num2cell.m +++ b/GraphBLAS/GraphBLAS/@GrB/num2cell.m @@ -13,7 +13,7 @@ % % See also GrB/horzcat, GrB/vertcat, GrB/cat, GrB.cell2mat, GrB/mat2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 2 && isequal (dim, [1 2])) diff --git a/GraphBLAS/GraphBLAS/@GrB/numel.m b/GraphBLAS/GraphBLAS/@GrB/numel.m index 4b21e9cf0f..9a0c617006 100644 --- a/GraphBLAS/GraphBLAS/@GrB/numel.m +++ b/GraphBLAS/GraphBLAS/@GrB/numel.m @@ -6,7 +6,7 @@ % % See also GrB/nnz. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/nzmax.m b/GraphBLAS/GraphBLAS/@GrB/nzmax.m index a9a69a2ee3..c8cad8a4c0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/nzmax.m +++ b/GraphBLAS/GraphBLAS/@GrB/nzmax.m @@ -7,7 +7,7 @@ % % See also GrB/nnz, GrB.entries, GrB.nonz. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/offdiag.m b/GraphBLAS/GraphBLAS/@GrB/offdiag.m index 692c81d0f9..d4dae9dad8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/offdiag.m +++ b/GraphBLAS/GraphBLAS/@GrB/offdiag.m @@ -4,7 +4,7 @@ % % See also GrB/tril, GrB/triu, GrB/diag, GrB.select. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/ones.m b/GraphBLAS/GraphBLAS/@GrB/ones.m index c94dac9ebc..abd7a77349 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ones.m +++ b/GraphBLAS/GraphBLAS/@GrB/ones.m @@ -12,7 +12,7 @@ % % See also GrB.zeros, GrB.false, GrB.true, GrB.eye, GrB.speye. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n, type] = gb_parse_args ('ones', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/optype.m b/GraphBLAS/GraphBLAS/@GrB/optype.m index aa054d1887..9e574efddb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/optype.m +++ b/GraphBLAS/GraphBLAS/@GrB/optype.m @@ -46,7 +46,7 @@ % % See also GrB.binopinfo, GrB.semiringinfo, GrB.type. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ischar (a)) diff --git a/GraphBLAS/GraphBLAS/@GrB/or.m b/GraphBLAS/GraphBLAS/@GrB/or.m index 1edbbebe7b..ff49585aee 100644 --- a/GraphBLAS/GraphBLAS/@GrB/or.m +++ b/GraphBLAS/GraphBLAS/@GrB/or.m @@ -5,7 +5,7 @@ % % See also GrB/and, GrB/xor, GrB/not. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/pagerank.m b/GraphBLAS/GraphBLAS/@GrB/pagerank.m index bd98a4c9fe..953aa84f69 100644 --- a/GraphBLAS/GraphBLAS/@GrB/pagerank.m +++ b/GraphBLAS/GraphBLAS/@GrB/pagerank.m @@ -22,7 +22,7 @@ % % See also graph/centrality. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/plus.m b/GraphBLAS/GraphBLAS/@GrB/plus.m index 3370b80b0d..9f7d26de75 100644 --- a/GraphBLAS/GraphBLAS/@GrB/plus.m +++ b/GraphBLAS/GraphBLAS/@GrB/plus.m @@ -7,7 +7,7 @@ % % See also GrB.eadd, GrB/minus, GrB/uminus. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/pow2.m b/GraphBLAS/GraphBLAS/@GrB/pow2.m index bd43564c50..c17885ff85 100644 --- a/GraphBLAS/GraphBLAS/@GrB/pow2.m +++ b/GraphBLAS/GraphBLAS/@GrB/pow2.m @@ -8,7 +8,7 @@ % % See also GrB/log2, GrB/power, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/power.m b/GraphBLAS/GraphBLAS/@GrB/power.m index c4637e0ed3..5412956766 100644 --- a/GraphBLAS/GraphBLAS/@GrB/power.m +++ b/GraphBLAS/GraphBLAS/@GrB/power.m @@ -7,7 +7,7 @@ % % See also GrB/mpower, GrB/pow2, GrB/exp. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/Makefile b/GraphBLAS/GraphBLAS/@GrB/private/Makefile index 8b313a4a7c..520261f42a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/Makefile +++ b/GraphBLAS/GraphBLAS/@GrB/private/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/private/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/GraphBLAS/@GrB/private/complex/mex_complex.c b/GraphBLAS/GraphBLAS/@GrB/private/complex/check_mex_complex.c similarity index 90% rename from GraphBLAS/GraphBLAS/@GrB/private/complex/mex_complex.c rename to GraphBLAS/GraphBLAS/@GrB/private/complex/check_mex_complex.c index d4ad4d9b50..efdedf094a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/complex/mex_complex.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/complex/check_mex_complex.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// mex_complex: test the complex type supported by the compiler +// check_mex_complex: test the complex type supported by the compiler //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_2d_to_1d.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_2d_to_1d.m index 86a23ce6f3..1facbf9bd7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_2d_to_1d.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_2d_to_1d.m @@ -1,7 +1,7 @@ function [k, mn] = gb_2d_to_1d (i, j, m, n) %GB_2D_TO_1D convert 2D indices to 1D; the indices must be zero-based. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % check for overflow diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_abs.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_abs.m index d87f1b9c41..3b7251c34d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_abs.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_abs.m @@ -2,7 +2,7 @@ %GB_ABS Absolute value of a GraphBLAS matrix. % Implements C = abs (G) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (gb_issigned (gbtype (G))) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_binops.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_binops.m new file mode 100644 index 0000000000..baff4f6171 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_binops.m @@ -0,0 +1,58 @@ +function binops = gb_binops +%GB_BINOPS: return a list of all binary ops and their descriptions + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +binops = { + '1st' , '1st(x,y) = x' ; + '2nd' , '2nd(x,y) = y' ; + 'oneb' , 'oneb(x,y) = 1' ; + 'pair' , 'pair(x,y) = 1' ; + 'any' , 'any(x,y) is x or y, chosen arbitrarily' ; + 'min' , '' ; + 'max' , '' ; + '+' , '' ; + '-' , '' ; + 'rminus' , 'rminus(x,y) is y-x' ; + '*' , '' ; + '/' , '' ; + '\' , '\ is reverse division, y/x' ; + 'iseq' , 'iseq(x,y) = (x==y) = 0 or 1 with the given type' ; + 'isne' , 'isne(x,y) = (x~=y) = 0 or 1 with the given type' ; + 'isgt' , 'isgt(x,y) = (x>y) = 0 or 1 with the given type' ; + 'islt' , 'islt(x,y) = (x=y) = 0 or 1 with the given type' ; + 'isle' , 'isle(x,y) = (x<=y) 0 or 1 with the given type' ; + '==' , '' ; + '~=' , '' ; + '>' , '' ; + '<' , '' ; + '>=' , '' ; + '<=' , '' ; + '|' , '' ; + '&' , '' ; + 'xor' , '' ; + 'atan2' , '' ; + 'hypot' , '' ; + 'fmod' , 'fmod(x,y) = x-fix(x/y)*y' ; + 'remainder' , 'remainder(x,y) = x-round(x/y)*y' ; + 'copysign' , 'copysign(x,y) = abs(x)*sign(y)' ; + 'cmplx' , 'cmplx(x,y) = x+i*y' ; + 'pow2' , 'pow2(x,y) = x*2^y' ; + 'xnor' , '' ; + 'pow' , 'pow(x,y) = x^y' ; + 'bitor' , '' ; + 'bitand' , '' ; + 'bitxor' , '' ; + 'bitxnor' , 'bitxnor(x,y) is the bit-wise xnor, ~bitxor(x,y)' + 'firsti0' , 'the row index of x in its matrix/vector, minus 1' ; + 'firsti1' , 'the row index of x in its matrix/vector' ; + 'firstj0' , 'the column index of x in its matrix/vector, minus 1' ; + 'firstj1' , 'the column index of x in its matrix/vector' ; + 'secondi0' , 'the row index of y in its matrix/vector, minus 1' ; + 'secondi1' , 'the row index of y in its matrix/vector' ; + 'secondj0' , 'the column index of y in its matrix/vector, minus 1' ; + 'secondj1' , 'the column index of y in its matrix/vector' ; + } ; + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_bitwise.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_bitwise.m index bed3af5a92..d7b644ae26 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_bitwise.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_bitwise.m @@ -1,7 +1,7 @@ function C = gb_bitwise (op, A, B, assumedtype) %GB_BITWISE bitwise AND, OR, XOR, ... -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_contains.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_contains.m index 84bd18d291..1f6cf6ae8e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_contains.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_contains.m @@ -1,7 +1,7 @@ function s = gb_contains (text, pattern) %GB_CONTAINS same as contains (text, pattern) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = ~isempty (strfind (text, pattern)) ; %#ok diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_eadd.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_eadd.m index cc0ed14520..2019e1c327 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_eadd.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_eadd.m @@ -1,7 +1,7 @@ function C = gb_eadd (A, op, B) %GB_EADD C = A+B, sparse matrix 'addition' using the given op. % The pattern of C is the set union of A and B. This method assumes the -% identity value of the op is zero. That is, x+0 = x+0 = x. The binary +% identity value of the op is zero. That is, x+0 = 0+x = x. The binary % operator op is only applied to entries in the intersection of the % pattern of A and B. % @@ -10,7 +10,7 @@ % % See also GrB/plus, GrB/minus, GrB/bitxor, GrB/bitor, GrB/hypot. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [am, an, atype] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_emult.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_emult.m index ac49019cb7..e2ba136fd6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_emult.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_emult.m @@ -9,7 +9,7 @@ % The input matrices may be either GraphBLAS structs and/or built-in % matrices, in any combination. C is returned as a GraphBLAS struct. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (gb_isscalar (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_entries.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_entries.m index e9c3854cc6..a84e594294 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_entries.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_entries.m @@ -2,7 +2,7 @@ %GB_ENTRIES count or query the entries of a matrix. % Implements GrB.entries (A, ...) and GrB.nonz (A, ...). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the string arguments diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_eunion.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_eunion.m index 798be4d2ac..24b2b46fe1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_eunion.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_eunion.m @@ -9,7 +9,7 @@ % % See also GrB/plus, GrB/minus, GrB/bitxor, GrB/bitor, GrB/hypot. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [am, an, atype] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_expand.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_expand.m index 6eb8f765b9..3ff8f65f54 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_expand.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_expand.m @@ -3,7 +3,7 @@ % Implements C = GrB.expand (scalar, S, type). This function assumes the % first input is a scalar; the caller has checked this already. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % typecast the scalar to the desired type, and make sure it's full diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_fmt.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_fmt.m index 52ac7669f0..6d4d0279be 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_fmt.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_fmt.m @@ -1,7 +1,7 @@ function f = gb_fmt (A) %GB_FMT return the format of A as a single string. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [f, s] = GrB.format (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_get_2scalars.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_get_2scalars.m index 4dcff63288..cdbcd7b61d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_get_2scalars.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_get_2scalars.m @@ -1,7 +1,7 @@ function [x, y] = gb_get_2scalars (A) %GB_GET_PAIR get a two scalars from a parameter of length 2 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_get_scalar.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_get_scalar.m index 60358e4492..be52913158 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_get_scalar.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_get_scalar.m @@ -1,7 +1,7 @@ function x = gb_get_scalar (A) %GB_GET_SCALAR get a scalar from a matrix -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_index.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_index.m index dc7f71f930..7e61cae13f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_index.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_index.m @@ -15,12 +15,11 @@ % the explicit list start:inc:fini. % % The input I can be a GraphBLAS matrix (as an object or its opaque -% struct). In this case, it is wrapped in a cell, I = {gb_index1(I)}, +% struct). In this case, it is wrapped in a cell, I = { I }, % but kept as 1-based indices (they are later translated to 0-based). % % If the input is already a cell array, then it is already in one of the -% above forms. Any member of the cell array that is a GraphBLAS matrix or -% struct is converted into an index list, with gb_index1(I{k}). +% above forms. % % The subsref and subsasgn methods are passed the string I = ':'. This is % converted into I = { }. @@ -28,7 +27,7 @@ % If I is a built-in matrix or vector (not a cell array), then it is % wrapped in a cell array, { I }, to denote A(I). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 whole = false ; @@ -37,12 +36,12 @@ % C (I) where I is a GraphBLAS matrix/vector of integer indices I = I.opaque ; - I = { (gb_index1 (I)) } ; + I = { I } ; elseif (isstruct (I)) % C (I) where I is the opaque struct of a GrB matrix/vector - I = { (gb_index1 (I)) } ; + I = { I } ; elseif (iscell (I)) @@ -64,7 +63,7 @@ end if (isstruct (K)) % C ({ ..., K, ... }) where I is a GraphBLAS struct - I {k} = gb_index1 (K) ; + I {k} = K ; end end end diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_index1.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_index1.m deleted file mode 100644 index d0c2fd5a53..0000000000 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_index1.m +++ /dev/null @@ -1,31 +0,0 @@ -function I = gb_index1 (G) -%GB_INDEX1 get one GraphBLAS index for gb_index -% For C=A(I,J), or C(I,J)=A, the indices I and J must be integer lists. -% They can be passed in as GraphBLAS matrices, to subsref and subsasgn. -% This function converts them into into integer lists so that they can be -% handled by the mexFunctions. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -type = gbtype (G) ; -I = gbextractvalues (G) ; - -switch (type) - - case { 'double', 'int64', 'uint64' } - % the mexFunctions handle these three cases themselves - - case { 'single' } - % the mexFunctions check the indices later, for non-integers - I = double (I) ; - - case { 'single complex', 'double complex' } - error ('GrB:error', 'array indices must be integers') ; - - otherwise - % any other integer must be typecast to double, int64, or uint64. - % int64 is fine since any errors will be checked later. - I = int64 (I) ; -end - diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_isfloat.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_isfloat.m index b20a62d932..73e9f5748e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_isfloat.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_isfloat.m @@ -2,7 +2,7 @@ %GB_ISFLOAT true for floating-point GraphBLAS types. % Implements s = isfloat (type (G)) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = gb_contains (type, 'double') || gb_contains (type, 'single') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_isfull.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_isfull.m index 5af09c01ff..fac52d2a18 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_isfull.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_isfull.m @@ -1,7 +1,7 @@ function s = gb_isfull (A) %GB_ISFULL determine if all entries are present in a GraphBLAS struct. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_isscalar.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_isscalar.m index be21092f3b..537379c9b8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_isscalar.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_isscalar.m @@ -3,7 +3,7 @@ % isscalar (G) is true for an m-by-n GraphBLAS matrix if m and n are 1. % G is an opaque GraphBLAS struct or a built-in matrix. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_issigned.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_issigned.m index 12ceb11e20..f83318c3a0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_issigned.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_issigned.m @@ -4,7 +4,7 @@ % 'single', 'single complex', 'double complex', 'int8', 'int16', 'int32', % or 'int64'. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = ~ (isequal (type, 'logical') || gb_contains (type, 'uint')) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_issymmetric.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_issymmetric.m index 94ffa2bbe7..b39aba49af 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_issymmetric.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_issymmetric.m @@ -2,7 +2,7 @@ %GB_ISSYMMETRIC check if symmetric or Hermitian % Implements issymmetric (G,option) and ishermitian (G,option). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: this can be much faster; see spsym in CHOLMOD. diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_isvector.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_isvector.m index 0a6eec3426..242722ab1d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_isvector.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_isvector.m @@ -3,7 +3,7 @@ % where G is the opaque struct of the GraphBLAS matrix. % gb_isvector (G) is true for an m-by-n GraphBLAS matrix if m or n is 1. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_make_real.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_make_real.m index c290375619..87e83559e5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_make_real.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_make_real.m @@ -1,7 +1,7 @@ function C = gb_make_real (G) %GB_MAKE_REAL convert complex matrix to real if imag(G) is zero -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (gb_contains (gbtype (G), 'complex') && ... diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_max1.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_max1.m index 79bf4c03da..7cc524eebd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_max1.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_max1.m @@ -2,7 +2,7 @@ %GB_MAX1 single-input max % Implements C = max (A) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_max2.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_max2.m index 4735bc142e..4d32d7212a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_max2.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_max2.m @@ -2,7 +2,7 @@ %GB_MAX2 2-input max % Implements C = max (A,B) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [am, an, atype] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_max3.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_max3.m index f198426b73..9bf6b04a5e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_max3.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_max3.m @@ -2,7 +2,7 @@ %GB_MAX3 3-input max % Implements C = max (A, [ ], option) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isequal (option, 'all')) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxall.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxall.m index 2eb4c74d28..e8727b7b26 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxall.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxall.m @@ -2,7 +2,7 @@ %GB_MAXALL reduce a matrix to a scalar % Implements C = max (A, [ ], 'all') ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = gbreduce (op, A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbycol.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbycol.m index 06cb94bae0..0ac07b9b63 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbycol.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbycol.m @@ -2,7 +2,7 @@ %GB_MAXBYCOL max, by column % Implements C = max (A, [ ], 1) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % C = max (A, [ ], 1) reduces each col to a scalar; C is 1-by-n diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbyrow.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbyrow.m index fd67bd7b43..9bcdc898f0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbyrow.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_maxbyrow.m @@ -2,7 +2,7 @@ %GB_MAXBYROW max, by row % Implements C = max (A, [ ], 2) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % C = max (A, [ ], 2) reduces each row to a scalar; C is m-by-1 diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_min1.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_min1.m index d73087339d..041cca69c3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_min1.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_min1.m @@ -2,7 +2,7 @@ %GB_MIN1 single-input min % Implements C = min (A) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_min2.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_min2.m index 723dfba3a0..517f205660 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_min2.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_min2.m @@ -2,7 +2,7 @@ %GB_MIN2 2-input min % Implements C = min (A,B) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [am, an, atype] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_min3.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_min3.m index 6e88a24154..5e28800e93 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_min3.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_min3.m @@ -2,7 +2,7 @@ %GB_MIN3 3-input min % Implements C = min (A, [ ], option) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isequal (option, 'all')) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_minall.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_minall.m index 60ceb5c53b..5fb31cc9bd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_minall.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_minall.m @@ -2,7 +2,7 @@ %GB_MINALL reduce a matrix to a scalar % Implements C = min (A, [ ], 'all') ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = gbreduce (op, A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_minbycol.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_minbycol.m index 880d52318c..cd566a4ebc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_minbycol.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_minbycol.m @@ -2,7 +2,7 @@ %GB_MINBYCOL min, by column % Implements C = min (A, [ ], 1) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % C = min (A, [ ], 1) reduces each col to a scalar; C is 1-by-n diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_minbyrow.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_minbyrow.m index 6f75243588..dc854d95fe 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_minbyrow.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_minbyrow.m @@ -2,7 +2,7 @@ %GB_MINBYROW min, by row % Implements C = min (A, [ ], 2) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % C = min (A, [ ], 2) reduces each row to a scalar; C is m-by-1 diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_mpower.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_mpower.m index 134158eeac..8c8e68cb4f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_mpower.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_mpower.m @@ -1,7 +1,7 @@ function C = gb_mpower (A, b) %GB_MPOWER C = A^b where b > 0 is an integer -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (b == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_nnz.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_nnz.m index e95f99bcdc..441bf6f290 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_nnz.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_nnz.m @@ -2,9 +2,8 @@ %GB_NNZ the number of nonzeros in a GraphBLAS matrix. % Implements e = nnz (G) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % count entries in G and then subtract the number explicit zero entries e = gbnvals (G) - gbnvals (gbselect (G, '==0')) ; - diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_numel.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_numel.m index a72863ed12..02f1dc952c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_numel.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_numel.m @@ -2,7 +2,7 @@ %GB_NUMEL the maximum number of entries a GraphBLAS matrix can hold. % Implements s = numel (G) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_args.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_args.m index c2cec141bc..f04f1df55a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_args.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_args.m @@ -9,7 +9,7 @@ % C = GrB.ones (... , 'like', G) ; % C = GrB.ones (... , 'int8') ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % parse the type diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_dimensions.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_dimensions.m index 4204b8df8c..235a7e9690 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_dimensions.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_parse_dimensions.m @@ -1,7 +1,7 @@ function [m, n] = gb_parse_dimensions (arg1, arg2) %GB_GET_DIMENSIONS parse arguments for dimensions -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 switch (nargin) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_power.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_power.m index 203a75fb94..0b18dfc435 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_power.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_power.m @@ -2,7 +2,7 @@ %GB_POWER .^ Array power. % C = A.^B computes element-wise powers. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [am, an, atype] = gbsize (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_printf_helper.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_printf_helper.m index 261dc08ccd..72ff819a81 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_printf_helper.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_printf_helper.m @@ -1,7 +1,7 @@ function result = gb_printf_helper (printf_function, varargin) %GB_PRINTF_HELPER wrapper for fprintf and sprintf -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % convert all GraphBLAS matrices to full built-in matrices diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_prod.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_prod.m index 670843f3a4..791fba869d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_prod.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_prod.m @@ -2,7 +2,7 @@ %GB_PROD C = prod (G), using the given operator and type % Implements C = prod (G) and C = all (G). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = gbsize (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_random.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_random.m index 1de2ec72e5..64250991ee 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_random.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_random.m @@ -2,10 +2,10 @@ %GB_RANDOM uniformly distributed random GraphBLAS matrix. % Implements C = GrB.random (...), C = sprand (...), C = sprand (...), -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -%--------------------------------------------------------------------------- +%-------------------------------------------------------------------------- % parse inputs %--------------------------------------------------------------------------- @@ -86,8 +86,8 @@ else % construct a sparse random matrix with about e entries e = round (m * n * d) ; - I = int64 (floor (rand (e, 1) * m)) ; - J = int64 (floor (rand (e, 1) * n)) ; + I = int64 (floor (rand (e, 1) * double (m))) ; + J = int64 (floor (rand (e, 1) * double (n))) ; end else diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar.m index ea031448fb..ced1930c2d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar.m @@ -5,7 +5,7 @@ % as a built-in non-sparse scalar. If the scalar has no entry % (the built-in sparse(0)), then x is returned as zero. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, x] = gbextracttuples (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar_to_full.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar_to_full.m index 0e37c8be28..d3323cfc91 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar_to_full.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_scalar_to_full.m @@ -1,7 +1,7 @@ function C = gb_scalar_to_full (m, n, type, fmt, scalar) %GB_SCALAR_TO_FULL expand a scalar into a full matrix -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (~isempty (strfind (fmt, 'by row'))) %#ok diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_speye.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_speye.m index 851933eabf..65309fc8a2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_speye.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_speye.m @@ -2,7 +2,7 @@ %GB_SPEYE Sparse identity matrix, of any type supported by GraphBLAS. % Implements C = GrB.eye (...) and GrB.speye (...). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the size and type diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_spones.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_spones.m index 87b8173cf3..def98580d9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_spones.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_spones.m @@ -2,7 +2,7 @@ %GB_SPONES return pattern of GraphBLAS matrix. % Implements C = spones (G). -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_sum.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_sum.m index 3cb5ee1b0e..160b1a5007 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_sum.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_sum.m @@ -1,7 +1,7 @@ function C = gb_sum (op, G, option) %GB_SUM C = sum (G) or C = any (G) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 2) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gb_trig.m b/GraphBLAS/GraphBLAS/@GrB/private/gb_trig.m index d4c5042595..8c3ddd15f0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gb_trig.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gb_trig.m @@ -2,7 +2,7 @@ %GB_TRIG inverse sine, cosine, log, sqrt, ... etc % Implements C = asin (G), C = acos (G), C = atanh (G), ... etc -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 type = gbtype (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbapply.m b/GraphBLAS/GraphBLAS/@GrB/private/gbapply.m index d5c7f41896..8f15031ecc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbapply.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbapply.m @@ -1,6 +1,6 @@ function [C,k] = gbapply (Cin, M, accum, op, A, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbapply2.m b/GraphBLAS/GraphBLAS/@GrB/private/gbapply2.m index 466ec7e416..7b8e476628 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbapply2.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbapply2.m @@ -1,6 +1,6 @@ function [C,k] = gbapply2 (Cin, M, accum, op, A, B, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbargminmax.m b/GraphBLAS/GraphBLAS/@GrB/private/gbargminmax.m index 873aa5fb16..00ecc2aa3e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbargminmax.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbargminmax.m @@ -1,6 +1,6 @@ function [x,p] = gbargminmax (A, minmax, dim) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbargsort.m b/GraphBLAS/GraphBLAS/@GrB/private/gbargsort.m index a186890c2d..75b092e78f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbargsort.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbargsort.m @@ -1,6 +1,6 @@ function [C,P] = gbargsort (A, dim, direction) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbassign.m b/GraphBLAS/GraphBLAS/@GrB/private/gbassign.m index 83e7af9c4b..1dcf1ee882 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbassign.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbassign.m @@ -1,6 +1,6 @@ function [C,k] = gbassign (Cin, M, accum, A, I, J, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbbandwidth.m b/GraphBLAS/GraphBLAS/@GrB/private/gbbandwidth.m index d2230b8fa7..34f753ff31 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbbandwidth.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbbandwidth.m @@ -1,6 +1,6 @@ function [lo, hi] = gbbandwidth (G, compute_hi, compute_lo) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbbinopinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbbinopinfo.m index 2cfdf0be04..4aa5dcb12c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbbinopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbbinopinfo.m @@ -1,6 +1,6 @@ function gbbinopinfo (op, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbbuild.m b/GraphBLAS/GraphBLAS/@GrB/private/gbbuild.m index 231b15b16e..4d885280f4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbbuild.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbbuild.m @@ -1,6 +1,6 @@ function [C,k] = gbbuild (I, J, X, m, n, dup, type, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbbuiltin.m b/GraphBLAS/GraphBLAS/@GrB/private/gbbuiltin.m index 369e191210..c5b070929c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbbuiltin.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbbuiltin.m @@ -1,6 +1,6 @@ function A = gbbuiltin (X, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbburble.m b/GraphBLAS/GraphBLAS/@GrB/private/gbburble.m index fcc25e1700..299d5149d9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbburble.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbburble.m @@ -1,6 +1,6 @@ function c = gbburble (c) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbchunk.m b/GraphBLAS/GraphBLAS/@GrB/private/gbchunk.m index 986e4d5c2e..6227ed012f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbchunk.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbchunk.m @@ -1,6 +1,6 @@ function c = gbchunk (c) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbdescriptorinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbdescriptorinfo.m index ca545a1202..309f1fab77 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbdescriptorinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbdescriptorinfo.m @@ -1,6 +1,6 @@ function gbdescriptorinfo (d) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbdisp.m b/GraphBLAS/GraphBLAS/@GrB/private/gbdisp.m index 99c9842f9d..5fa4f8caed 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbdisp.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbdisp.m @@ -1,6 +1,6 @@ function gbdisp (C, cnz, level) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbeadd.m b/GraphBLAS/GraphBLAS/@GrB/private/gbeadd.m index 54518d972e..729c59c5a2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbeadd.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbeadd.m @@ -1,6 +1,6 @@ function [C,k] = gbeadd (Cin, M, accum, semiring, A, B, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbemult.m b/GraphBLAS/GraphBLAS/@GrB/private/gbemult.m index 077a61daf4..d7b0a29376 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbemult.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbemult.m @@ -1,6 +1,6 @@ function [C,k] = gbemult (Cin, M, accum, semiring, A, B, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbeunion.m b/GraphBLAS/GraphBLAS/@GrB/private/gbeunion.m index b775a9df9c..a982ae26a7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbeunion.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbeunion.m @@ -1,6 +1,6 @@ function [C,k] = gbeunion (Cin, M, accum, semiring, A, alpha, B, beta, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbextract.m b/GraphBLAS/GraphBLAS/@GrB/private/gbextract.m index f2b669c658..0260555887 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbextract.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbextract.m @@ -1,6 +1,6 @@ function [C,k] = gbextract (Cin, M, accum, A, I, J, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbextracttuples.m b/GraphBLAS/GraphBLAS/@GrB/private/gbextracttuples.m index 0cb708100c..2a1f191093 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbextracttuples.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbextracttuples.m @@ -1,6 +1,6 @@ function [I,J,X] = gbextracttuples (A, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbextractvalues.m b/GraphBLAS/GraphBLAS/@GrB/private/gbextractvalues.m index b2f1665695..98ea749857 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbextractvalues.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbextractvalues.m @@ -1,6 +1,6 @@ function X = gbextractvalues (A) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbformat.m b/GraphBLAS/GraphBLAS/@GrB/private/gbformat.m index dc7f858b50..04d89ca660 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbformat.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbformat.m @@ -1,6 +1,6 @@ function [f,s,iso] = gbformat (arg) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbfull.m b/GraphBLAS/GraphBLAS/@GrB/private/gbfull.m index aef5d849c9..31cb13b151 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbfull.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbfull.m @@ -1,6 +1,6 @@ function F = gbfull (G, type, identity, descriptor) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbisequal.m b/GraphBLAS/GraphBLAS/@GrB/private/gbisequal.m index 44853f8ca8..3f0bf423fd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbisequal.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbisequal.m @@ -1,6 +1,6 @@ function s = gbisequal (A, B) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbkronecker.m b/GraphBLAS/GraphBLAS/@GrB/private/gbkronecker.m index cfdf5bc0b2..def5e7c362 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbkronecker.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbkronecker.m @@ -1,6 +1,6 @@ function [C,k] = gbkronecker (Cin, M, accum, op, A, B, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gblogassign.m b/GraphBLAS/GraphBLAS/@GrB/private/gblogassign.m index cfc9475204..5ed5cdd324 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gblogassign.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gblogassign.m @@ -1,6 +1,6 @@ function C = gblogassign (Cin, M, A) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gblogextract.m b/GraphBLAS/GraphBLAS/@GrB/private/gblogextract.m index 0704fe09e7..029668aaa9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gblogextract.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gblogextract.m @@ -1,6 +1,6 @@ function C = gblogextract (A, M) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbmake.m b/GraphBLAS/GraphBLAS/@GrB/private/gbmake.m index 432c2e5318..ec0895941c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbmake.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbmake.m @@ -16,7 +16,7 @@ function gbmake (what) % % See also mex, version, GrB.clear. % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('Note: the libgraphblas_matlab dynamic library must already be\n') ; @@ -92,44 +92,23 @@ function gbmake (what) % Octave does not have the new MEX classdef object and as of version 7, the % mex command doesn't handle compiler options the same way. flags = [flags ' -std=c11 -fopenmp -fPIC -Wno-pragmas' ] ; -else - % remove -ansi from CFLAGS and replace it with -std=c11 - try - if (strncmp (computer, 'GLNX', 4)) - cc = mex.getCompilerConfigurations ('C', 'Selected') ; - env = cc.Details.SetEnv ; - c1 = strfind (env, 'CFLAGS=') ; - q = strfind (env, '"') ; - q = q (q > c1) ; - if (~isempty (c1) && length (q) > 1) - c2 = q (2) ; - cflags = env (c1:c2) ; % the CFLAGS="..." string - ansi = strfind (cflags, '-ansi') ; - if (~isempty (ansi)) - cflags = [cflags(1:ansi-1) '-std=c11' cflags(ansi+5:end)] ; - flags = [flags ' ' cflags] ; - fprintf ('using -std=c11 instead of default -ansi\n') ; - end - end - end - catch - end - % revise compiler flags for MATLAB - if (ismac) - cflags = '' ; - ldflags = '-fPIC' ; - rpath = '-rpath ' ; - elseif (isunix) - cflags = '-fopenmp' ; - ldflags = '-fopenmp -fPIC' ; - rpath = '-rpath=' ; - end - if (ismac || isunix) - rpath = sprintf (' -Wl,%s''''%s'''' ', rpath, library_path) ; - flags = [ flags ' CFLAGS=''$CFLAGS ' cflags ' -Wno-pragmas'' '] ; - flags = [ flags ' CXXFLAGS=''$CXXFLAGS ' cflags ' -Wno-pragmas'' '] ; - flags = [ flags ' LDFLAGS=''$LDFLAGS ' ldflags rpath ' '' '] ; - end +end + +% revise compiler flags for MATLAB +if (ismac) + cflags = '' ; + ldflags = '-fPIC' ; + rpath = '-rpath ' ; +elseif (isunix) + cflags = '-fopenmp' ; + ldflags = '-fopenmp -fPIC' ; + rpath = '-rpath=' ; +end +if (ismac || isunix) + rpath = sprintf (' -Wl,%s''''%s'''' ', rpath, library_path) ; + flags = [ flags ' CFLAGS=''$CFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' CXXFLAGS=''$CXXFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' LDFLAGS=''$LDFLAGS ' ldflags rpath ' '' '] ; end if ispc @@ -150,6 +129,7 @@ function gbmake (what) inc = [inc '-I../../../Source/transpose ' ] ; inc = [inc '-I../../../Source/helper ' ] ; inc = [inc '-I../../../Source/builtin ' ] ; + inc = [inc '-I../../../Source/hyper ' ] ; if (need_rename) % use the renamed library for MATLAB @@ -165,14 +145,14 @@ function gbmake (what) try % try C99 complex types cflag = ' -DGxB_HAVE_COMPLEX_C99=1' ; - mexcmd = sprintf ('mex -silent %s %s complex/mex_complex.c', ... + mexcmd = sprintf ('mex -silent %s %s complex/check_mex_complex.c', ... flags, cflag) ; eval (mexcmd) ; -catch me +catch % try MSVC complex types try cflag = ' -DGxB_HAVE_COMPLEX_MSVC=1' ; - mexcmd = sprintf ('mex -silent %s %s complex/mex_complex.c', ... + mexcmd = sprintf ('mex -silent %s %s complex/check_mex_complex.c', ... flags, cflag) ; eval (mexcmd) ; catch me @@ -180,7 +160,7 @@ function gbmake (what) end end flags = [flags cflag] ; -mex_complex +check_mex_complex Lflags = sprintf ('-L''%s''', library_path) ; @@ -197,7 +177,7 @@ function gbmake (what) % These are #include'd into source files. htime = 0 ; for k = 1:length (hfiles) - t = datenum (hfiles (k).date) ; + t = datenum (hfiles (k).date) ; %#ok<*DATNM> htime = max (htime, t) ; end diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbmonoidinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbmonoidinfo.m index cb862eb509..8b99b35236 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbmonoidinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbmonoidinfo.m @@ -1,6 +1,6 @@ function gbmonoidinfo (monoid, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbmxm.m b/GraphBLAS/GraphBLAS/@GrB/private/gbmxm.m index 8e2a07026e..9e147867d6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbmxm.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbmxm.m @@ -1,6 +1,6 @@ function [C,k] = gbmxm (Cin, M, accum, semiring, A, B, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbnew.m b/GraphBLAS/GraphBLAS/@GrB/private/gbnew.m index 4ca619d505..aa43b078e0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbnew.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbnew.m @@ -1,6 +1,6 @@ function G = gbnew (arg1, arg2, arg3, arg4) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbnvals.m b/GraphBLAS/GraphBLAS/@GrB/private/gbnvals.m index 1d883b6402..86fa9aa52d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbnvals.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbnvals.m @@ -1,6 +1,6 @@ function nvals = gbnvals (G) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbreduce.m b/GraphBLAS/GraphBLAS/@GrB/private/gbreduce.m index 0e89623d53..269e7baa32 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbreduce.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbreduce.m @@ -1,6 +1,6 @@ function [c,k] = gbreduce (cin, accum, op, A, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbselect.m b/GraphBLAS/GraphBLAS/@GrB/private/gbselect.m index d55f7b3d32..cc51dd00c1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbselect.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbselect.m @@ -1,6 +1,6 @@ function [C,k] = gbselect (Cin, M, accum, op, A, b, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbselectopinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbselectopinfo.m index dc1c5994d3..f8f82f9c88 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbselectopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbselectopinfo.m @@ -1,6 +1,6 @@ function gbselectopinfo (selectop, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbsemiringinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbsemiringinfo.m index e6c72cb23e..ae83878683 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbsemiringinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbsemiringinfo.m @@ -1,6 +1,6 @@ function gbsemiringinfo (semiring, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbsetup.m b/GraphBLAS/GraphBLAS/@GrB/private/gbsetup.m index 83a7f26c14..4af98c50e8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbsetup.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbsetup.m @@ -1,6 +1,6 @@ -function gbclear +function gbsetup -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbsize.m b/GraphBLAS/GraphBLAS/@GrB/private/gbsize.m index 566d44ae66..79a579140f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbsize.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbsize.m @@ -1,6 +1,6 @@ function [m, n, type] = gbsize (G, dim) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbsubassign.m b/GraphBLAS/GraphBLAS/@GrB/private/gbsubassign.m index 7d8b3eaf6b..c26c04d443 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbsubassign.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbsubassign.m @@ -1,6 +1,6 @@ function [C,k] = gbsubassign (Cin, M, accum, A, I, j, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbthreads.m b/GraphBLAS/GraphBLAS/@GrB/private/gbthreads.m index 667e4a67d6..91ec5c06e8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbthreads.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbthreads.m @@ -1,6 +1,6 @@ function nthreads = gbthreads (nthreads) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbtrans.m b/GraphBLAS/GraphBLAS/@GrB/private/gbtrans.m index 0cc36c034c..f80030d508 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbtrans.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbtrans.m @@ -1,6 +1,6 @@ function [C,k] = gbtrans (Cin, M, accum, A, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbtype.m b/GraphBLAS/GraphBLAS/@GrB/private/gbtype.m index ab243e6ebf..073fb59d4e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbtype.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbtype.m @@ -1,6 +1,6 @@ function type = gbtype (X) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbunopinfo.m b/GraphBLAS/GraphBLAS/@GrB/private/gbunopinfo.m index 3f41218ea4..b91de00035 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbunopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbunopinfo.m @@ -1,6 +1,6 @@ function gbunopinfo (op, type) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/gbvreduce.m b/GraphBLAS/GraphBLAS/@GrB/private/gbvreduce.m index b1e68bd005..a3aed91a71 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/gbvreduce.m +++ b/GraphBLAS/GraphBLAS/@GrB/private/gbvreduce.m @@ -1,6 +1,6 @@ function [C,k] = gbvreduce (Cin, M, accum, op, A, desc) %#ok -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 error ('GrB:mex', 'mexFunction not found; use gbmake to compile GraphBLAS') ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply.c index 9f7c8fe023..732b3842cd 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply.c @@ -2,7 +2,7 @@ // gbapply: apply a unary operator to a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -46,7 +46,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -114,21 +114,23 @@ void mexFunction { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (A_transpose) ? anrows : ancols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (A_transpose) ? anrows : ancols ; // use the ztype of the op as the type of C - OK (GxB_UnaryOp_ztype (&ctype, op)) ; + int code ; + OK (GrB_UnaryOp_get_INT32 (op, &code, GrB_OUTP_TYPE_CODE)) ; + ctype = gb_code_to_type (code) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, NULL, fmt) ; @@ -156,6 +158,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply2.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply2.c index d48b9fa56c..691bbf161e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply2.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbapply2.c @@ -2,7 +2,7 @@ // gbapply2: apply idxunop or binary operator to a matrix, with scalar binding //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,7 +51,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -97,7 +97,7 @@ void mexFunction // determine which input is the scalar and which is the matrix //-------------------------------------------------------------------------- - GrB_Index anrows, ancols, bnrows, bncols, anvals, bnvals ; + uint64_t anrows, ancols, bnrows, bncols, anvals, bnvals ; // get the size of A and B OK (GrB_Matrix_nrows (&anrows, A)) ; @@ -173,12 +173,12 @@ void mexFunction if (C == NULL) { // get the descriptor to determine if the input matrix is transposed - GrB_Index cnrows, cncols ; + uint64_t cnrows, cncols ; if (binop_bind1st) { // A is the scalar and B is the matrix - GrB_Desc_Value in1 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in1)) ; + int in1 ; + OK (GrB_Descriptor_get_INT32 (desc, &in1, GrB_INP1)) ; bool B_transpose = (in1 == GrB_TRAN) ; // determine the size of C cnrows = (B_transpose) ? bncols : bnrows ; @@ -187,8 +187,8 @@ void mexFunction else { // A is the matrix and B is the scalar - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // determine the size of C cnrows = (A_transpose) ? ancols : anrows ; @@ -198,12 +198,14 @@ void mexFunction // use the ztype of the op as the type of C if (op2 != NULL) { - OK (GxB_BinaryOp_ztype (&ctype, op2)) ; + ctype = gb_binaryop_ztype (op2) ; } else { - // OK (GxB_IndexUnaryOp_ztype (&ctype, idxunop)) ; - ctype = idxunop->ztype ; + int code = 0 ; + OK (GrB_IndexUnaryOp_get_INT32 (idxunop, &code, + GrB_OUTP_TYPE_CODE)) ; + ctype = gb_code_to_type (code) ; } // create the matrix C and set its format and sparsity @@ -248,6 +250,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c index a23161530b..afb6e31e94 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c @@ -2,7 +2,7 @@ // gbargminmax: argmin or argmax of a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -85,12 +85,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; // index k to make a tuple (k,v). void make_bool (tuple_bool *z, - const bool *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const bool *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_bool (tuple_bool *z, - const bool *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const bool *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -99,8 +99,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_BOOL \ "void make_bool (tuple_bool *z, \n" \ - " const bool *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const bool *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -108,12 +108,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_int8 (tuple_int8 *z, - const int8_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int8_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_int8 (tuple_int8 *z, - const int8_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int8_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -122,8 +122,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_INT8 \ "void make_int8 (tuple_int8 *z, \n" \ - " const int8_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const int8_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -131,12 +131,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_int16 (tuple_int16 *z, - const int16_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int16_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_int16 (tuple_int16 *z, - const int16_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int16_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -145,8 +145,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_INT16 \ "void make_int16 (tuple_int16 *z, \n" \ - " const int16_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const int16_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -154,12 +154,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_int32 (tuple_int32 *z, - const int32_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int32_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_int32 (tuple_int32 *z, - const int32_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int32_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -168,8 +168,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_INT32 \ "void make_int32 (tuple_int32 *z, \n" \ - " const int32_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const int32_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -177,12 +177,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_int64 (tuple_int64 *z, - const int64_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_int64 (tuple_int64 *z, - const int64_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -191,8 +191,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_INT64 \ "void make_int64 (tuple_int64 *z, \n" \ - " const int64_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const int64_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -200,12 +200,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_uint8 (tuple_uint8 *z, - const uint8_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint8_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_uint8 (tuple_uint8 *z, - const uint8_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint8_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -214,8 +214,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_UINT8 \ "void make_uint8 (tuple_uint8 *z, \n" \ - " const uint8_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const uint8_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -223,12 +223,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_uint16 (tuple_uint16 *z, - const uint16_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint16_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_uint16 (tuple_uint16 *z, - const uint16_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint16_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -237,8 +237,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_UINT16 \ "void make_uint16 (tuple_uint16 *z, \n" \ - " const uint16_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const uint16_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -246,12 +246,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_uint32 (tuple_uint32 *z, - const uint32_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint32_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_uint32 (tuple_uint32 *z, - const uint32_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint32_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -260,8 +260,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_UINT32 \ "void make_uint32 (tuple_uint32 *z, \n" \ - " const uint32_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const uint32_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -269,12 +269,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_uint64 (tuple_uint64 *z, - const uint64_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint64_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_uint64 (tuple_uint64 *z, - const uint64_t *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const uint64_t *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -283,8 +283,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_UINT64 \ "void make_uint64 (tuple_uint64 *z, \n" \ - " const uint64_t *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const uint64_t *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -292,12 +292,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_fp32 (tuple_fp32 *z, - const float *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const float *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_fp32 (tuple_fp32 *z, - const float *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const float *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -306,8 +306,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_FP32 \ "void make_fp32 (tuple_fp32 *z, \n" \ - " const float *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const float *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -315,12 +315,12 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" void make_fp64 (tuple_fp64 *z, - const double *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_fp64 (tuple_fp64 *z, - const double *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; @@ -329,8 +329,8 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE_FP64 \ "void make_fp64 (tuple_fp64 *z, \n" \ - " const double *x, GrB_Index ix, GrB_Index jx, \n" \ - " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const double *x, uint64_t ix, uint64_t jx, \n" \ + " const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -346,10 +346,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; // matrices, so jx is always zero. void make3a_bool (tuple3_bool *z, - const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const tuple_bool *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_bool (tuple3_bool *z, - const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const tuple_bool *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -359,10 +359,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_BOOL \ "void make3a_bool (tuple3_bool *z, \n" \ - " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_bool *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_bool (tuple3_bool *z, \n" \ - " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_bool *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -371,10 +371,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_int8 (tuple3_int8 *z, - const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const tuple_int8 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_int8 (tuple3_int8 *z, - const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const tuple_int8 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -384,10 +384,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_INT8 \ "void make3a_int8 (tuple3_int8 *z, \n" \ - " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_int8 (tuple3_int8 *z, \n" \ - " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -396,10 +396,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_int16 (tuple3_int16 *z, - const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const tuple_int16 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_int16 (tuple3_int16 *z, - const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const tuple_int16 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -409,10 +409,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_INT16 \ "void make3a_int16 (tuple3_int16 *z, \n" \ - " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_int16 (tuple3_int16 *z, \n" \ - " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -421,10 +421,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_int32 (tuple3_int32 *z, - const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const tuple_int32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_int32 (tuple3_int32 *z, - const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const tuple_int32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -434,10 +434,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_INT32 \ "void make3a_int32 (tuple3_int32 *z, \n" \ - " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_int32 (tuple3_int32 *z, \n" \ - " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -446,10 +446,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_int64 (tuple3_int64 *z, - const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const tuple_int64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_int64 (tuple3_int64 *z, - const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const tuple_int64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -459,10 +459,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_INT64 \ "void make3a_int64 (tuple3_int64 *z, \n" \ - " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_int64 (tuple3_int64 *z, \n" \ - " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -471,10 +471,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_uint8 (tuple3_uint8 *z, - const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint8 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_uint8 (tuple3_uint8 *z, - const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint8 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -484,10 +484,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_UINT8 \ "void make3a_uint8 (tuple3_uint8 *z, \n" \ - " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_uint8 (tuple3_uint8 *z, \n" \ - " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -496,10 +496,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_uint16 (tuple3_uint16 *z, - const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint16 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_uint16 (tuple3_uint16 *z, - const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint16 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -509,10 +509,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_UINT16 \ "void make3a_uint16 (tuple3_uint16 *z, \n" \ - " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_uint16 (tuple3_uint16 *z, \n" \ - " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -521,10 +521,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_uint32 (tuple3_uint32 *z, - const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_uint32 (tuple3_uint32 *z, - const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -534,10 +534,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_UINT32 \ "void make3a_uint32 (tuple3_uint32 *z, \n" \ - " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_uint32 (tuple3_uint32 *z, \n" \ - " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -546,10 +546,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_uint64 (tuple3_uint64 *z, - const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_uint64 (tuple3_uint64 *z, - const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -559,10 +559,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_UINT64 \ "void make3a_uint64 (tuple3_uint64 *z, \n" \ - " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_uint64 (tuple3_uint64 *z, \n" \ - " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -571,10 +571,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_fp32 (tuple3_fp32 *z, - const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_fp32 (tuple3_fp32 *z, - const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -584,10 +584,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_FP32 \ "void make3a_fp32 (tuple3_fp32 *z, \n" \ - " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_fp32 (tuple3_fp32 *z, \n" \ - " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -596,10 +596,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3a_fp64 (tuple3_fp64 *z, - const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3a_fp64 (tuple3_fp64 *z, - const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = (int64_t) ix + 1 ; @@ -609,10 +609,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3a_FP64 \ "void make3a_fp64 (tuple3_fp64 *z, \n" \ - " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3a_fp64 (tuple3_fp64 *z, \n" \ - " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = (int64_t) ix + 1 ; \n" \ @@ -629,10 +629,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; // matrices, so jx is always zero. void make3b_bool (tuple3_bool *z, - const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const tuple_bool *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_bool (tuple3_bool *z, - const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const tuple_bool *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -642,10 +642,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_BOOL \ "void make3b_bool (tuple3_bool *z, \n" \ - " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_bool *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_bool (tuple3_bool *z, \n" \ - " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_bool *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -654,10 +654,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_int8 (tuple3_int8 *z, - const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const tuple_int8 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_int8 (tuple3_int8 *z, - const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const tuple_int8 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -667,10 +667,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_INT8 \ "void make3b_int8 (tuple3_int8 *z, \n" \ - " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_int8 (tuple3_int8 *z, \n" \ - " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -679,10 +679,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_int16 (tuple3_int16 *z, - const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const tuple_int16 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_int16 (tuple3_int16 *z, - const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const tuple_int16 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -692,10 +692,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_INT16 \ "void make3b_int16 (tuple3_int16 *z, \n" \ - " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_int16 (tuple3_int16 *z, \n" \ - " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -704,10 +704,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_int32 (tuple3_int32 *z, - const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const tuple_int32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_int32 (tuple3_int32 *z, - const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const tuple_int32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -717,10 +717,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_INT32 \ "void make3b_int32 (tuple3_int32 *z, \n" \ - " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_int32 (tuple3_int32 *z, \n" \ - " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -729,10 +729,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_int64 (tuple3_int64 *z, - const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const tuple_int64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_int64 (tuple3_int64 *z, - const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const tuple_int64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -742,10 +742,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_INT64 \ "void make3b_int64 (tuple3_int64 *z, \n" \ - " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_int64 (tuple3_int64 *z, \n" \ - " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_int64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -754,10 +754,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_uint8 (tuple3_uint8 *z, - const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint8 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_uint8 (tuple3_uint8 *z, - const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint8 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -767,10 +767,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_UINT8 \ "void make3b_uint8 (tuple3_uint8 *z, \n" \ - " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_uint8 (tuple3_uint8 *z, \n" \ - " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint8 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -779,10 +779,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_uint16 (tuple3_uint16 *z, - const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint16 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_uint16 (tuple3_uint16 *z, - const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint16 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -792,10 +792,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_UINT16 \ "void make3b_uint16 (tuple3_uint16 *z, \n" \ - " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_uint16 (tuple3_uint16 *z, \n" \ - " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint16 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -804,10 +804,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_uint32 (tuple3_uint32 *z, - const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_uint32 (tuple3_uint32 *z, - const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -817,10 +817,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_UINT32 \ "void make3b_uint32 (tuple3_uint32 *z, \n" \ - " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_uint32 (tuple3_uint32 *z, \n" \ - " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -829,10 +829,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_uint64 (tuple3_uint64 *z, - const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_uint64 (tuple3_uint64 *z, - const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const tuple_uint64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -842,10 +842,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_UINT64 \ "void make3b_uint64 (tuple3_uint64 *z, \n" \ - " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_uint64 (tuple3_uint64 *z, \n" \ - " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_uint64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -854,10 +854,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_fp32 (tuple3_fp32 *z, - const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp32 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_fp32 (tuple3_fp32 *z, - const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp32 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -867,10 +867,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_FP32 \ "void make3b_fp32 (tuple3_fp32 *z, \n" \ - " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_fp32 (tuple3_fp32 *z, \n" \ - " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp32 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -879,10 +879,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; "} \n" \ void make3b_fp64 (tuple3_fp64 *z, - const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp64 *x, uint64_t ix, uint64_t jx, const void *y) ; void make3b_fp64 (tuple3_fp64 *z, - const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const tuple_fp64 *x, uint64_t ix, uint64_t jx, const void *y) { z->i = x->k ; @@ -892,10 +892,10 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAKE3b_FP64 \ "void make3b_fp64 (tuple3_fp64 *z, \n" \ - " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) ; \n" \ "void make3b_fp64 (tuple3_fp64 *z, \n" \ - " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const tuple_fp64 *x, uint64_t ix, uint64_t jx, \n" \ " const void *y) \n" \ "{ \n" \ " z->i = x->k ; \n" \ @@ -928,18 +928,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_BOOL \ "void max_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) ; void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) @@ -958,18 +958,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_INT8 \ "void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y); void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) @@ -988,18 +988,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_INT16 \ "void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y); void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) @@ -1018,18 +1018,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_INT32 \ "void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y); void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) @@ -1048,18 +1048,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_INT64 \ "void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y); void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) @@ -1078,18 +1078,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_UINT8 \ "void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) ; void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) @@ -1108,18 +1108,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_UINT16 \ "void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) \n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k))\n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) ; void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) @@ -1138,18 +1138,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_UINT32 \ "void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) \n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) ; void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) @@ -1168,18 +1168,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_UINT64 \ "void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) \n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) ; void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) @@ -1198,18 +1198,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_FP32 \ "void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) ; void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) @@ -1228,18 +1228,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MAX_FP64 \ "void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y)\n" \ - "{ \n" \ - " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" //------------------------------------------------------------------------------ // min_* functions: @@ -1266,18 +1266,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_BOOL \ "void min_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) ; void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) @@ -1296,18 +1296,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_INT8 \ "void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) ; void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) @@ -1326,18 +1326,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_INT16 \ "void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) ; void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) @@ -1356,18 +1356,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_INT32 \ "void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) ; void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) @@ -1386,18 +1386,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_INT64 \ "void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) ; void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) @@ -1416,18 +1416,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_UINT8 \ "void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) ; void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) @@ -1446,18 +1446,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_UINT16 \ "void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) \n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) ; void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) @@ -1476,18 +1476,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_UINT32 \ "void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) \n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) ; void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) @@ -1506,18 +1506,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_UINT64 \ "void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) \n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) ; void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) @@ -1536,18 +1536,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_FP32 \ "void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) ; void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) @@ -1566,18 +1566,18 @@ typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; #define MIN_FP64 \ "void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y)\n" \ - "{ \n" \ - " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ - " { \n" \ - " z->k = x->k ; \n" \ - " z->v = x->v ; \n" \ - " } \n" \ - " else \n" \ - " { \n" \ - " z->k = y->k ; \n" \ - " z->v = y->v ; \n" \ - " } \n" \ - "} \n" + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" //------------------------------------------------------------------------------ // max3_* functions: @@ -2520,13 +2520,13 @@ void mexFunction // get the matrix properties //-------------------------------------------------------------------------- - GrB_Index nrows, ncols, nvals ; + uint64_t nrows, ncols, nvals ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; GrB_Type A_type ; OK (GxB_Matrix_type (&A_type, A)) ; - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; //-------------------------------------------------------------------------- // types, ops, and semirings for argmin and argmax @@ -3569,11 +3569,12 @@ void mexFunction OK (GrB_Matrix_free (&y)) ; OK (GrB_Matrix_free (&c)) ; OK (GrB_Matrix_free (&A)) ; + OK (GrB_Matrix_free (&z)) ; OK (GrB_Scalar_free (&Theta)) ; OK (GrB_Scalar_free (&s)) ; pargout [0] = gb_export (&x, KIND_GRB) ; pargout [1] = gb_export (&p, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargsort.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargsort.c index fabf74095c..8ff7116e13 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargsort.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbargsort.c @@ -2,7 +2,7 @@ // gbargsort: sort a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -103,7 +103,7 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix C = NULL, P = NULL ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; OK (GrB_Matrix_new (&C, type, nrows, ncols)) ; @@ -138,6 +138,6 @@ void mexFunction { pargout [1] = gb_export (&P, KIND_GRB) ; } - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbassign.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbassign.c index f342fa5f90..aeed14eac1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbassign.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbassign.c @@ -2,7 +2,7 @@ // gbassign: assign entries into a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbandwidth.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbandwidth.c index 7bdd9cae17..ee0e40952b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbandwidth.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbandwidth.c @@ -2,7 +2,7 @@ // gbbandwidth: compute the lower and/or upper bandwidth of a GrB matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ void mexFunction GrB_Matrix A = gb_get_shallow (pargin [0]) ; bool compute_lo = (bool) mxGetScalar (pargin [1]) ; bool compute_hi = (bool) mxGetScalar (pargin [2]) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; @@ -43,8 +43,8 @@ void mexFunction int64_t hi = 0, lo = 0 ; GrB_Matrix x = NULL, imin = NULL, imax = NULL, idiag = NULL ; - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; bool by_col = (fmt == GxB_BY_COL) ; if (by_col) @@ -182,6 +182,6 @@ void mexFunction pargout [1] = mxCreateDoubleScalar ((double) hi) ; } - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbinopinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbinopinfo.c index 2630006eed..05bed96091 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbinopinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbinopinfo.c @@ -2,7 +2,7 @@ // gbbinopinfo : print a GraphBLAS binary op (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ // gbbinopinfo (binop) // gbbinopinfo (binop, type) +// ok = gbbinopinfo (binop) #include "gb_interface.h" @@ -29,7 +30,7 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin >= 1 && nargin <= 2 && nargout == 0, USAGE) ; + gb_usage (nargin >= 1 && nargin <= 2 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // construct the GraphBLAS binary operator and print it @@ -53,14 +54,19 @@ void mexFunction gb_mxstring_to_binop_or_idxunop (pargin [0], type, type, &op2, &idxunop, &ithunk) ; + int pr = (nargout < 1) ? GxB_COMPLETE : GxB_SILENT ; if (idxunop != NULL) { - OK (GxB_IndexUnaryOp_fprint (idxunop, opstring, GxB_COMPLETE, NULL)) ; + OK (GxB_IndexUnaryOp_fprint (idxunop, opstring, pr, NULL)) ; } else { - OK (GxB_BinaryOp_fprint (op2, opstring, GxB_COMPLETE, NULL)) ; + OK (GxB_BinaryOp_fprint (op2, opstring, pr, NULL)) ; } - GB_WRAPUP ; + if (nargout == 1) + { + pargout [0] = mxCreateLogicalScalar (true) ; + } + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuild.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuild.c index c842c60d58..4e2b56a8e4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuild.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuild.c @@ -2,7 +2,7 @@ // gbbuild: build a GraphBLAS matrix or a built-in sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,6 +43,42 @@ #include "gb_interface.h" +//------------------------------------------------------------------------------ +// gb_get_scalar: x = find (V, 'first') +//------------------------------------------------------------------------------ + +static GrB_Scalar gb_get_scalar (GrB_Vector V, GrB_Type type) +{ + // get the first entry from a vector V + GrB_Scalar x ; + GrB_Vector T ; + OK (GrB_Scalar_new (&x, type)) ; + OK (GrB_Vector_new (&T, type, 0)) ; + OK (GxB_Vector_extractTuples_Vector (NULL, T, V, NULL)) ; + OK (GrB_Vector_extractElement_Scalar (x, T, 0)) ; + OK (GrB_Vector_free (&T)) ; + return (x) ; +} + +//------------------------------------------------------------------------------ +// gb_expand: V (1:nvals) = V (1) +//------------------------------------------------------------------------------ + +static void gb_expand (GrB_Vector *V, GrB_Type type, uint64_t nvals) +{ + // get the single entry from the input vector V, and then free it + GrB_Scalar x = gb_get_scalar (*V, type) ; + OK (GrB_Vector_free (V)) ; + // expand the scalar back into V, expanding V to length nvals + OK (GrB_Vector_new (V, type, nvals)) ; + OK (GxB_Vector_assign_Scalar_Vector (*V, NULL, NULL, x, NULL, NULL)) ; + OK (GrB_Scalar_free (&x)) ; +} + +//------------------------------------------------------------------------------ +// gbbuild mexFunction +//------------------------------------------------------------------------------ + #define USAGE "usage: A = GrB.build (I, J, X, m, n, dup, type, desc)" void mexFunction @@ -66,7 +102,7 @@ void mexFunction base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int sparsity ; GrB_Descriptor desc = NULL ; desc = gb_mxarray_to_descriptor (pargin [nargin-1], &kind, &fmt, @@ -77,88 +113,78 @@ void mexFunction OK (GrB_Descriptor_free (&desc)) ; + int base_offset = (base == BASE_0_INT) ? 0 : 1 ; + //-------------------------------------------------------------------------- - // get I and J + // get I, J, and X and their properties //-------------------------------------------------------------------------- - GrB_Index ni, nj ; - bool I_allocated, J_allocated ; - int64_t Imax = -1, Jmax = -1 ; - - GrB_Index *I = (GrB_Index *) gb_mxarray_to_list (pargin [0], base, - &I_allocated, (int64_t *) &ni, &Imax) ; + GrB_Vector I = gb_mxarray_to_list (pargin [0], base_offset) ; + GrB_Vector J = gb_mxarray_to_list (pargin [1], base_offset) ; + GrB_Vector X = gb_mxarray_to_list (pargin [2], 0) ; - GrB_Index *J = (GrB_Index *) gb_mxarray_to_list (pargin [1], base, - &J_allocated, (int64_t *) &nj, &Jmax) ; + uint64_t ni, nj, nx ; + OK (GrB_Vector_nvals (&ni, I)) ; + OK (GrB_Vector_nvals (&nj, J)) ; + OK (GrB_Vector_nvals (&nx, X)) ; - //-------------------------------------------------------------------------- - // get X - //-------------------------------------------------------------------------- + GrB_Type xtype ; + OK (GxB_Vector_type (&xtype, X)) ; - const mxArray *Xm = pargin [2] ; - GrB_Type xtype = gb_mxarray_type (Xm) ; - GrB_Index nx = mxGetNumberOfElements (Xm) ; + uint64_t Imax = UINT64_MAX, Jmax = UINT64_MAX ; //-------------------------------------------------------------------------- // check the sizes of I, J, and X, and the type of X //-------------------------------------------------------------------------- - GrB_Index nvals = MAX (ni, nj) ; + uint64_t nvals = MAX (ni, nj) ; nvals = MAX (nvals, nx) ; if (!(ni == 1 || ni == nvals) || !(nj == 1 || nj == nvals) || !(nx == 1 || nx == nvals)) { - ERROR ("I, J, and X must have the same length") ; + ERROR ("I, J, and X must have the same # of entries") ; } - CHECK_ERROR (!(mxIsNumeric (Xm) || mxIsLogical (Xm)), - "X must be a numeric or logical array") ; - CHECK_ERROR (mxIsSparse (Xm), "X cannot be sparse") ; - //-------------------------------------------------------------------------- - // expand any scalars in I and J (but not X) + // expand any scalars in I and J (but not yet X) //-------------------------------------------------------------------------- + GrB_Monoid max = GrB_MAX_MONOID_UINT64 ; + if (ni == 1 && ni < nvals) { - GrB_Index *I2 = (GrB_Index *) mxMalloc (nvals * sizeof (GrB_Index)) ; - GB_helper8 ((GB_void *) I2, (GB_void *) I, nvals, sizeof (GrB_Index)) ; - if (I_allocated) gb_mxfree ((void **) (&I)) ; - I_allocated = true ; - I = I2 ; + if (Imax == UINT64_MAX) + { + OK (GrB_Vector_reduce_UINT64 (&Imax, NULL, max, I, NULL)) ; + } + gb_expand (&I, (Imax < UINT32_MAX) ? GrB_UINT32 : GrB_UINT64, nvals) ; } if (nj == 1 && nj < nvals) { - GrB_Index *J2 = (GrB_Index *) mxMalloc (nvals * sizeof (GrB_Index)) ; - GB_helper8 ((GB_void *) J2, (GB_void *) J, nvals, sizeof (GrB_Index)) ; - if (J_allocated) gb_mxfree ((void **) (&J)) ; - J_allocated = true ; - J = J2 ; + if (Jmax == UINT64_MAX) + { + OK (GrB_Vector_reduce_UINT64 (&Jmax, NULL, max, J, NULL)) ; + } + gb_expand (&J, (Jmax < UINT32_MAX) ? GrB_UINT32 : GrB_UINT64, nvals) ; } //-------------------------------------------------------------------------- // get m and n if present //-------------------------------------------------------------------------- - GrB_Index nrows = 0, ncols = 0 ; + uint64_t nrows = 0, ncols = 0 ; if (nargin < 4) { // nrows = max entry in I + 1 - if (Imax > -1) - { - // Imax already computed - nrows = Imax ; - } - else - { - // nrows = max entry in I+1 - bool ok = GB_helper4 (I, ni, &nrows) ; - CHECK_ERROR (!ok, "out of memory") ; + if (Imax == UINT64_MAX) + { + OK (GrB_Vector_reduce_UINT64 (&Imax, NULL, max, I, NULL)) ; } + nrows = Imax + 1 ; } else { @@ -168,17 +194,12 @@ void mexFunction if (nargin < 5) { - if (Jmax > -1) - { - // Jmax already computed - ncols = Jmax ; - } - else - { - // ncols = max entry in J+1 - bool ok = GB_helper4 (J, nj, &ncols) ; - CHECK_ERROR (!ok, "out of memory") ; + // ncols = max entry in J + 1 + if (Jmax == UINT64_MAX) + { + OK (GrB_Vector_reduce_UINT64 (&Jmax, NULL, max, J, NULL)) ; } + ncols = Jmax + 1 ; } else { @@ -198,14 +219,69 @@ void mexFunction dup = gb_mxstring_to_binop (pargin [5], xtype, xtype) ; } - // if dup defaults to plus.xtype, below, or GrB_LOR for boolean - - bool nice_iso_dup ; + bool nice_iso_dup = false ; if (default_dup) { - // dup will be GrB_LOR which is nice for an iso build. For all other - // types, the dup is plus, which is not nice. - nice_iso_dup = (xtype == GrB_BOOL) ; + // dup defaults to plus.xtype or GrB_LOR for boolean + if (xtype == GrB_BOOL) + { + // dup is GrB_LOR which is nice for an iso build. For all other + // types, the dup is plus, which is not nice. + dup = GrB_LOR ; + nice_iso_dup = true ; + } + else if (xtype == GrB_INT8) + { + dup = GrB_PLUS_INT8 ; + } + else if (xtype == GrB_INT16) + { + dup = GrB_PLUS_INT16 ; + } + else if (xtype == GrB_INT32) + { + dup = GrB_PLUS_INT32 ; + } + else if (xtype == GrB_INT64) + { + dup = GrB_PLUS_INT64 ; + } + else if (xtype == GrB_UINT8) + { + dup = GrB_PLUS_UINT8 ; + } + else if (xtype == GrB_UINT16) + { + dup = GrB_PLUS_UINT16 ; + } + else if (xtype == GrB_UINT32) + { + dup = GrB_PLUS_UINT32 ; + } + else if (xtype == GrB_UINT64) + { + dup = GrB_PLUS_UINT64 ; + } + else if (xtype == GrB_FP32) + { + dup = GrB_PLUS_FP32 ; + } + else if (xtype == GrB_FP64) + { + dup = GrB_PLUS_FP64 ; + } + else if (xtype == GxB_FC32) + { + dup = GxB_PLUS_FC32 ; + } + else if (xtype == GxB_FC64) + { + dup = GxB_PLUS_FC64 ; + } + else + { + ERROR ("unsupported type") ; + } } else if (dup == NULL || dup == GxB_IGNORE_DUP) { @@ -257,206 +333,36 @@ void mexFunction sparsity = gb_get_sparsity (NULL, NULL, sparsity) ; GrB_Matrix A = gb_new (type, nrows, ncols, fmt, sparsity) ; - void *X2 = NULL ; - bool X_is_scalar = (nx == 1 && nx < nvals) ; - bool iso_build = X_is_scalar && nice_iso_dup ; - - // mxGetData is used instead of the MATLAB-recommended mxGetDoubles, etc, - // because mxGetData works best for Octave, and it works fine for MATLAB - // since GraphBLAS requires R2018a with the interleaved complex data type. - - if (iso_build) + if (nvals > 0) { - // build an iso matrix, with no dup operator (dup is GxB_IGNORE_DUP) - GrB_Scalar x_scalar = (GrB_Scalar) gb_get_shallow (Xm) ; - OK1 (A, GxB_Matrix_build_Scalar (A, I, J, x_scalar, nvals)) ; - OK (GrB_Scalar_free (&x_scalar)) ; - } - else if (xtype == GrB_BOOL) - { - bool empty = 0 ; - bool *X = (nvals == 0) ? &empty : ((bool *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_LOR ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (bool)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (bool)) ; - X = (bool *) X2 ; - } - OK1 (A, GrB_Matrix_build_BOOL (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_INT8) - { - int8_t empty = 0 ; - int8_t *X = (nvals == 0) ? &empty : ((int8_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_INT8 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (int8_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (int8_t)) ; - X = (int8_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_INT8 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_INT16) - { - int16_t empty = 0 ; - int16_t *X = (nvals == 0) ? &empty : ((int16_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_INT16 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (int16_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (int16_t)); - X = (int16_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_INT16 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_INT32) - { - int32_t empty = 0 ; - int32_t *X = (nvals == 0) ? &empty : ((int32_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_INT32 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (int32_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (int32_t)); - X = (int32_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_INT32 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_INT64) - { - int64_t empty = 0 ; - int64_t *X = (nvals == 0) ? &empty : ((int64_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_INT64 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (int64_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (int64_t)); - X = (int64_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_INT64 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_UINT8) - { - uint8_t empty = 0 ; - uint8_t *X = (nvals == 0) ? &empty : ((uint8_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_UINT8 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (uint8_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (uint8_t)); - X = (uint8_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_UINT8 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_UINT16) - { - uint16_t empty = 0 ; - uint16_t *X = (nvals == 0) ? &empty : ((uint16_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_UINT16 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (uint16_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof(uint16_t)); - X = (uint16_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_UINT16 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_UINT32) - { - uint32_t empty = 0 ; - uint32_t *X = (nvals == 0) ? &empty : ((uint32_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_UINT32 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (uint32_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof(uint32_t)); - X = (uint32_t *) X2 ; + bool X_is_scalar = (nx == 1 && nx < nvals) ; + bool iso_build = X_is_scalar && nice_iso_dup ; + if (iso_build) + { + // build an iso matrix, with no dup operator + GrB_Scalar x = gb_get_scalar (X, xtype) ; + OK1 (A, GxB_Matrix_build_Scalar_Vector (A, I, J, x, NULL)) ; + OK (GrB_Scalar_free (&x)) ; } - OK1 (A, GrB_Matrix_build_UINT32 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_UINT64) - { - uint64_t empty = 0 ; - uint64_t *X = (nvals == 0) ? &empty : ((uint64_t *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_UINT64 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (uint64_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof(uint64_t)); - X = (uint64_t *) X2 ; - } - OK1 (A, GrB_Matrix_build_UINT64 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_FP32) - { - float empty = 0 ; - float *X = (nvals == 0) ? &empty : ((float *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_FP32 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (float)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (float)) ; - X = (float *) X2 ; - } - OK1 (A, GrB_Matrix_build_FP32 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GrB_FP64) - { - double empty = 0 ; - double *X = (nvals == 0) ? &empty : ((double *) mxGetData (Xm)) ; - if (default_dup) dup = GrB_PLUS_FP64 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (double)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, sizeof (double)) ; - X = (double *) X2 ; - } - OK1 (A, GrB_Matrix_build_FP64 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GxB_FC32) - { - GxB_FC32_t empty = GxB_CMPLXF (0,0) ; - GxB_FC32_t *X = &empty ; - if (nvals > 0) X = (GxB_FC32_t *) mxGetData (Xm) ; - if (default_dup) dup = GxB_PLUS_FC32 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (GxB_FC32_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, - sizeof (GxB_FC32_t)) ; - X = (GxB_FC32_t *) X2 ; - } - OK1 (A, GxB_Matrix_build_FC32 (A, I, J, X, nvals, dup)) ; - } - else if (xtype == GxB_FC64) - { - GxB_FC64_t empty = GxB_CMPLX (0,0) ; - GxB_FC64_t *X = &empty ; - if (nvals > 0) X = (GxB_FC64_t *) mxGetData (Xm) ; - if (default_dup) dup = GxB_PLUS_FC64 ; - if (X_is_scalar) - { - X2 = mxMalloc (nvals * sizeof (GxB_FC64_t)) ; - GB_helper8 ((GB_void *) X2, (GB_void *) X, nvals, - sizeof (GxB_FC64_t)) ; - X = (GxB_FC64_t *) X2 ; + else + { + // build a standard matrix from the three vectors I,J,X + if (X_is_scalar) + { + // expand X from a scalar to a vector of length nvals + gb_expand (&X, xtype, nvals) ; + } + OK1 (A, GxB_Matrix_build_Vector (A, I, J, X, dup, NULL)) ; } - OK1 (A, GxB_Matrix_build_FC64 (A, I, J, X, nvals, dup)) ; - } - else - { - ERROR ("unsupported type") ; } //-------------------------------------------------------------------------- // free workspace //-------------------------------------------------------------------------- - if (X2 != NULL ) gb_mxfree ((void **) (&X2)) ; - if (I_allocated) gb_mxfree ((void **) (&I)) ; - if (J_allocated) gb_mxfree ((void **) (&J)) ; + OK (GrB_Vector_free (&I)) ; + OK (GrB_Vector_free (&J)) ; + OK (GrB_Vector_free (&X)) ; //-------------------------------------------------------------------------- // export the output matrix A @@ -464,6 +370,6 @@ void mexFunction pargout [0] = gb_export (&A, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuiltin.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuiltin.c index 1136aaf2fa..ed4e673cdc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuiltin.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbbuiltin.c @@ -1,15 +1,15 @@ //------------------------------------------------------------------------------ -// gbbuiltin: convert to a sparse or full built-in matrix +// gbbuiltin: convert to a sparse or full built-in MATLAB matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // The input may be either a GraphBLAS matrix struct or a standard built-in -// sparse or full matrix. The output is a standard built-in sparse or full -// matrix: full if all entries are present, and sparse otherwise. +// MATLAB sparse or full matrix. The output is a standard built-in sparse or +// full matrix: full if all entries are present, and sparse otherwise. // Usage: @@ -60,6 +60,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_export (&X, KIND_BUILTIN) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbburble.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbburble.c index e21297bf6b..6bad8e7994 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbburble.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbburble.c @@ -2,19 +2,19 @@ // gbburble: get/set the burble setting for diagnostic output //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // Usage -// b = gbburble ; -// b = gbburble (b) ; +// burble = gbburble ; +// burble = gbburble (burble) ; #include "gb_interface.h" -#define USAGE "usage: b = GrB.burble ; or GrB.burble (b)" +#define USAGE "usage: burble = GrB.burble ; or GrB.burble (burble)" void mexFunction ( @@ -35,7 +35,7 @@ void mexFunction // set the burble, if requested //-------------------------------------------------------------------------- - bool b ; + int32_t burble = false ; if (nargin > 0) { @@ -43,26 +43,26 @@ void mexFunction if (gb_mxarray_is_scalar (pargin [0])) { // argument is a numeric scalar - b = (bool) mxGetScalar (pargin [0]) ; + burble = (int32_t) mxGetScalar (pargin [0]) ; } else if (mxIsLogicalScalar (pargin [0])) { // argument is a logical scalar - b = (bool) mxIsLogicalScalarTrue (pargin [0]) ; + burble = (int32_t) mxIsLogicalScalarTrue (pargin [0]) ; } else { ERROR ("input must be a scalar") ; } - OK (GxB_Global_Option_set (GxB_BURBLE, b)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, burble, GxB_BURBLE)) ; } //-------------------------------------------------------------------------- // return the burble //-------------------------------------------------------------------------- - OK (GxB_Global_Option_get (GxB_BURBLE, &b)) ; - pargout [0] = mxCreateDoubleScalar (b) ; - GB_WRAPUP ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &burble, GxB_BURBLE)) ; + pargout [0] = mxCreateDoubleScalar (burble) ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbcat.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbcat.c index 9160637016..a0545e0795 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbcat.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbcat.c @@ -2,7 +2,7 @@ // gbcat: matrix concatenation //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,7 +41,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -71,10 +71,10 @@ void mexFunction // determine the # of rows of C from Tiles {:,0} //-------------------------------------------------------------------------- - GrB_Index cnrows = 0 ; + uint64_t cnrows = 0 ; for (int64_t i = 0 ; i < m ; i++) { - GrB_Index anrows ; + uint64_t anrows ; OK (GrB_Matrix_nrows (&anrows, Tiles [i*n])) ; cnrows += anrows ; } @@ -83,10 +83,10 @@ void mexFunction // determine the # of columms of C from Tiles {0,:} //-------------------------------------------------------------------------- - GrB_Index cncols = 0 ; + uint64_t cncols = 0 ; for (int64_t j = 0 ; j < n ; j++) { - GrB_Index ancols ; + uint64_t ancols ; OK (GrB_Matrix_ncols (&ancols, Tiles [j])) ; cncols += ancols ; } @@ -134,6 +134,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbchunk.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbchunk.c index e3f6027214..ef198192a7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbchunk.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbchunk.c @@ -2,7 +2,7 @@ // gbchunk: get/set the chunk size to use in GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,23 +35,30 @@ void mexFunction // set the chunk, if requested //-------------------------------------------------------------------------- - double c ; + GrB_Scalar chunk = NULL ; if (nargin > 0) { // set the chunk CHECK_ERROR (!gb_mxarray_is_scalar (pargin [0]), "input must be a scalar") ; - c = (double) mxGetScalar (pargin [0]) ; - OK (GxB_Global_Option_set (GxB_CHUNK, c)) ; + chunk = (GrB_Scalar) gb_get_shallow (pargin [0]) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, chunk, GxB_CHUNK)) ; + OK (GrB_Scalar_free (&chunk)) ; } + //-------------------------------------------------------------------------- + // get the chunk and return it + //-------------------------------------------------------------------------- + + OK (GrB_Scalar_new (&chunk, GrB_FP64)) ; + OK (GrB_Global_get_Scalar (GrB_GLOBAL, chunk, GxB_CHUNK)) ; + //-------------------------------------------------------------------------- // return the chunk //-------------------------------------------------------------------------- - OK (GxB_Global_Option_get (GxB_CHUNK, &c)) ; - pargout [0] = mxCreateDoubleScalar (c) ; - GB_WRAPUP ; + pargout [0] = gb_export ((GrB_Matrix *) &chunk, KIND_FULL) ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbclear.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbclear.c index 1a4b941f6f..ed192809e7 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbclear.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbclear.c @@ -2,14 +2,14 @@ // gbclear: set all global GraphBLAS settings to their defaults for MATLAB //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // This method does not clear the JIT hash table. To do that, use: // -// GrB.jit ('off') ; GrB.jit ('on') ; +// GrB.jit ('flush') ; #include "gb_interface.h" @@ -46,6 +46,6 @@ void mexFunction // save test coverage //-------------------------------------------------------------------------- - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdegree.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdegree.c index a961304c3d..0f80de993c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdegree.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdegree.c @@ -2,7 +2,7 @@ // gbdegree: number of entries in each vector of a GraphBLAS matrix struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,7 @@ void mexFunction GrB_Matrix d = NULL, x = NULL ; GrB_Matrix A = gb_get_shallow (pargin [0]) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; @@ -85,6 +85,6 @@ void mexFunction OK (GrB_Matrix_free (&x)) ; OK (GrB_Matrix_free (&A)) ; pargout [0] = gb_export ((GrB_Matrix *) &d, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdescriptorinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdescriptorinfo.c index 4ec31c8cef..d2806fdd11 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdescriptorinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdescriptorinfo.c @@ -2,7 +2,7 @@ // gbdescriptorinfo: print a GraphBLAS descriptor (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,7 +37,7 @@ void mexFunction base_enum_t base = BASE_DEFAULT ; kind_enum_t kind = KIND_GRB ; - GxB_Format_Value fmt = GxB_NO_FORMAT ; + int fmt = GxB_NO_FORMAT ; int sparsity = 0 ; GrB_Descriptor desc = NULL ; if (nargin > 0) @@ -75,11 +75,11 @@ void mexFunction printf (" d.base = ") ; switch (base) { - case BASE_0_INT64 : printf ("zero-based\n") ; break ; - case BASE_1_INT64 : printf ("one-based int\n") ; break ; + case BASE_0_INT : printf ("zero-based\n") ; break ; + case BASE_1_INT : printf ("one-based int\n") ; break ; case BASE_1_DOUBLE : printf ("one-based\n") ; break ; case BASE_DEFAULT : - default : printf ("default\n") ; break ; + default : printf ("default (one-based int)\n") ; break ; } printf (" d.format = ") ; @@ -147,6 +147,6 @@ void mexFunction //-------------------------------------------------------------------------- OK (GrB_Descriptor_free (&desc)) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdeserialize.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdeserialize.c index a99c31e18e..a1dee37a41 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdeserialize.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdeserialize.c @@ -2,7 +2,7 @@ // gbdeserialize: deserialize a blob into a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,9 +39,9 @@ void mexFunction //-------------------------------------------------------------------------- void *blob = mxGetData (pargin [0]) ; - GrB_Index m = (GrB_Index) mxGetM (pargin [0]) ; - GrB_Index n = (GrB_Index) mxGetN (pargin [0]) ; - GrB_Index blob_size = m*n ; + uint64_t m = (uint64_t) mxGetM (pargin [0]) ; + uint64_t n = (uint64_t) mxGetN (pargin [0]) ; + uint64_t blob_size = m*n ; //-------------------------------------------------------------------------- // deserialize the blob into a matrix @@ -55,6 +55,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_export (&C, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdisp.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdisp.c index 5669b03351..ce84e71ab5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdisp.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbdisp.c @@ -2,7 +2,7 @@ // gbdisp: display a GraphBLAS matrix struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -63,14 +63,15 @@ void mexFunction //-------------------------------------------------------------------------- // print 1-based indices - OK (GxB_Global_Option_set (GxB_PRINT_1BASED, true)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_PRINT_1BASED)) ; // print sizes of shallow components - GB_Global_print_mem_shallow_set (true) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, + GxB_INCLUDE_READONLY_STATISTICS)) ; GrB_Matrix C = gb_get_shallow (pargin [0]) ; OK (GxB_Matrix_fprint (C, s, level, NULL)) ; OK (GrB_Matrix_free (&C)) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeadd.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeadd.c index 9cf9f9f894..e308011817 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeadd.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeadd.c @@ -2,7 +2,7 @@ // gbeadd: sparse matrix addition //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -117,21 +117,21 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (A_transpose) ? anrows : ancols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (A_transpose) ? anrows : ancols ; // use the ztype of the op as the type of C - OK (GxB_BinaryOp_ztype (&ctype, op)) ; + ctype = gb_binaryop_ztype (op) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, B, fmt) ; @@ -160,6 +160,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbemult.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbemult.c index e9f68915ad..947a09fdd8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbemult.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbemult.c @@ -2,7 +2,7 @@ // gbemult: sparse matrix element-wise multiplication //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -117,21 +117,21 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (A_transpose) ? anrows : ancols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (A_transpose) ? anrows : ancols ; // use the ztype of the op as the type of C - OK (GxB_BinaryOp_ztype (&ctype, op)) ; + ctype = gb_binaryop_ztype (op) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, B, fmt) ; @@ -160,6 +160,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeunion.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeunion.c index bead03c0dc..6078773750 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeunion.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbeunion.c @@ -2,7 +2,7 @@ // gbeunion: sparse matrix union //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -87,7 +87,7 @@ void mexFunction beta = gb_get_shallow (Matrix [5]) ; } - GrB_Index n ; + uint64_t n ; OK (GrB_Matrix_nrows (&n, alpha)) ; CHECK_ERROR (n != 1, "alpha must be a scalar") ; OK (GrB_Matrix_ncols (&n, alpha)) ; @@ -132,21 +132,21 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (A_transpose) ? anrows : ancols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (A_transpose) ? anrows : ancols ; // use the ztype of the op as the type of C - OK (GxB_BinaryOp_ztype (&ctype, op)) ; + ctype = gb_binaryop_ztype (op) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, B, fmt) ; @@ -178,6 +178,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextract.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextract.c index b6697ed6ed..0f77031d31 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextract.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextract.c @@ -2,7 +2,7 @@ // gbextract: extract entries into a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,6 @@ // If accum or M is used, then Cin must appear. #include "gb_interface.h" -#include "GB_ij.h" #define USAGE "usage: C = GrB.extract (Cin, M, accum, A, I, J, desc)" @@ -47,7 +46,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -55,6 +54,15 @@ void mexFunction CHECK_ERROR (nmatrices < 1 || nmatrices > 3 || nstrings > 1, USAGE) ; + //-------------------------------------------------------------------------- + // create the descriptor, if not present + //-------------------------------------------------------------------------- + + if (desc == NULL) + { + OK (GrB_Descriptor_new (&desc)) ; + } + //-------------------------------------------------------------------------- // get the matrices //-------------------------------------------------------------------------- @@ -94,16 +102,16 @@ void mexFunction { // if accum appears, then Cin must also appear CHECK_ERROR (C == NULL, USAGE) ; - accum = gb_mxstring_to_binop (String [0], ctype, ctype) ; + accum = gb_mxstring_to_binop (String [0], ctype, ctype) ; } //-------------------------------------------------------------------------- // get the size of A //-------------------------------------------------------------------------- - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; - GrB_Index anrows, ancols ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; + uint64_t anrows, ancols ; bool A_transpose = (in0 == GrB_TRAN) ; if (A_transpose) { @@ -122,30 +130,42 @@ void mexFunction // get I and J //-------------------------------------------------------------------------- - GrB_Index *I = (GrB_Index *) GrB_ALL ; - GrB_Index *J = (GrB_Index *) GrB_ALL ; - GrB_Index ni = anrows, nj = ancols ; - bool I_allocated = false, J_allocated = false ; + GrB_Vector I = NULL, J = NULL ; + uint64_t cnrows = anrows, cncols = ancols ; + int icells = 0, jcells = 0 ; + int base_offset = (base == BASE_0_INT) ? 0 : 1 ; if (anrows == 1 && ncells == 1) { // only J is present - J = gb_mxcell_to_index (Cell [0], base, ancols, &J_allocated, &nj, - NULL) ; + J = gb_mxcell_to_list (Cell [0], base_offset, ancols, &cncols, NULL) ; + jcells = mxGetNumberOfElements (Cell [0]) ; } else if (ncells == 1) { // only I is present - I = gb_mxcell_to_index (Cell [0], base, anrows, &I_allocated, &ni, - NULL) ; + I = gb_mxcell_to_list (Cell [0], base_offset, anrows, &cnrows, NULL) ; + icells = mxGetNumberOfElements (Cell [0]) ; } else if (ncells == 2) { // both I and J are present - I = gb_mxcell_to_index (Cell [0], base, anrows, &I_allocated, &ni, - NULL) ; - J = gb_mxcell_to_index (Cell [1], base, ancols, &J_allocated, &nj, - NULL) ; + I = gb_mxcell_to_list (Cell [0], base_offset, anrows, &cnrows, NULL) ; + J = gb_mxcell_to_list (Cell [1], base_offset, ancols, &cncols, NULL) ; + icells = mxGetNumberOfElements (Cell [0]) ; + jcells = mxGetNumberOfElements (Cell [1]) ; + } + + if (icells > 1) + { + // I is a 3-element vector containing a stride + OK (GrB_Descriptor_set_INT32 (desc, GxB_IS_STRIDE, GxB_ROWINDEX_LIST)) ; + } + + if (jcells > 1) + { + // J is a 3-element vector containing a stride + OK (GrB_Descriptor_set_INT32 (desc, GxB_IS_STRIDE, GxB_COLINDEX_LIST)) ; } //-------------------------------------------------------------------------- @@ -155,36 +175,29 @@ void mexFunction if (C == NULL) { // Cin is not present: determine its size, same type as A. - // T = A(I,J) or AT(I,J) will be extracted. - // accum must be null - int I_kind, J_kind ; - int64_t I_colon [3], J_colon [3] ; - GrB_Index cnrows, cncols ; - GB_ijlength (I, ni, anrows, (int64_t *) &cnrows, &I_kind, I_colon) ; - GB_ijlength (J, nj, ancols, (int64_t *) &cncols, &J_kind, J_colon) ; - ctype = atype ; - + // T = A(I,J) or AT(I,J) will be extracted; accum must be null. // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, NULL, fmt) ; sparsity = gb_get_sparsity (A, NULL, sparsity) ; + ctype = atype ; C = gb_new (ctype, cnrows, cncols, fmt, sparsity) ; } //-------------------------------------------------------------------------- - // compute C += A(I,J) or AT(I,J) + // C += A(I,J) or AT(I,J) //-------------------------------------------------------------------------- - OK1 (C, GrB_Matrix_extract (C, M, accum, A, I, ni, J, nj, desc)) ; + OK1 (C, GxB_Matrix_extract_Vector (C, M, accum, A, I, J, desc)) ; //-------------------------------------------------------------------------- - // free shallow copies + // free shallow copies and workspace //-------------------------------------------------------------------------- OK (GrB_Matrix_free (&M)) ; OK (GrB_Matrix_free (&A)) ; + OK (GrB_Vector_free (&I)) ; + OK (GrB_Vector_free (&J)) ; OK (GrB_Descriptor_free (&desc)) ; - if (I_allocated) gb_mxfree ((void **) (&I)) ; - if (J_allocated) gb_mxfree ((void **) (&J)) ; //-------------------------------------------------------------------------- // export the output matrix C @@ -192,6 +205,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextracttuples.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextracttuples.c index 0bfd185df5..cb85dfa355 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextracttuples.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextracttuples.c @@ -2,7 +2,7 @@ // gbextracttuples: extract all entries from a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,11 +14,12 @@ // The desciptor is optional. If present, it must be a struct. -// desc.base = 'zero-based': I and J are returned as 0-based int64 indices -// desc.base = 'one-based int': I and J are returned as 1-based int64 indices +// desc.base = 'zero-based': I and J are returned as 0-based integer indices +// desc.base = 'one-based int': I and J are returned as 1-based integer indices // desc.base = 'one-based': I and J are returned as 1-based double indices -// desc.base = 'default': 'one-based', unless max(size(A)) > flintmax, -// in which case 'one-based int' is used. +// desc.base = 'one-based double' one-based double unless max(size(A)) > +// flintmax, in which case 'one-based int' is used. +// desc.base = 'default': 'one-based int' #include "gb_interface.h" @@ -45,7 +46,7 @@ void mexFunction base_enum_t base = BASE_DEFAULT ; kind_enum_t kind = KIND_FULL ; // ignored - GxB_Format_Value fmt = GxB_NO_FORMAT ; // ignored + int fmt = GxB_NO_FORMAT ; // ignored int sparsity = 0 ; // ignored GrB_Descriptor desc = NULL ; if (nargin > 1) @@ -56,11 +57,20 @@ void mexFunction OK (GrB_Descriptor_free (&desc)) ; //-------------------------------------------------------------------------- - // get the matrix + // get the matrix; disable burble for scalars //-------------------------------------------------------------------------- GrB_Matrix A = gb_get_shallow (pargin [0]) ; - GrB_Index nvals ; + uint64_t nrows, ncols, nvals ; + OK (GrB_Matrix_nrows (&nrows, A)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + int burble ; + bool disable_burble = (nrows <= 1 && ncols <= 1) ; + if (disable_burble) + { + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &burble, GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; + } OK (GrB_Matrix_nvals (&nvals, A)) ; GrB_Type xtype ; OK (GxB_Matrix_type (&xtype, A)) ; @@ -74,251 +84,108 @@ void mexFunction bool extract_X = (nargout > 2) ; //-------------------------------------------------------------------------- - // allocate I and J + // create empty GrB_Vectors for I, J, and X //-------------------------------------------------------------------------- - GrB_Index s = MAX (nvals, 1) ; - GrB_Index *I = extract_I ? mxMalloc (s * sizeof (GrB_Index)) : NULL ; - GrB_Index *J = extract_J ? mxMalloc (s * sizeof (GrB_Index)) : NULL ; + GrB_Vector I = NULL, J = NULL, X = NULL ; + if (extract_I) OK (GrB_Vector_new (&I, GrB_UINT64, 0)) ; + if (extract_J) OK (GrB_Vector_new (&J, GrB_UINT64, 0)) ; + if (extract_X) OK (GrB_Vector_new (&X, xtype, 0)) ; //-------------------------------------------------------------------------- - // extract the tuples and export X + // extract the tuples from A into I, J, and X //-------------------------------------------------------------------------- - if (xtype == GrB_BOOL) - { - bool *X = extract_X ? mxMalloc (s * sizeof (bool)) : NULL ; - OK (GrB_Matrix_extractTuples_BOOL (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_BOOL) ; - } - } - else if (xtype == GrB_INT8) - { - int8_t *X = extract_X ? mxMalloc (s * sizeof (int8_t)) : NULL ; - OK (GrB_Matrix_extractTuples_INT8 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_INT8) ; - } - } - else if (xtype == GrB_INT16) - { - int16_t *X = extract_X ? mxMalloc (s * sizeof (int16_t)) : NULL ; - OK (GrB_Matrix_extractTuples_INT16 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_INT16) ; - } - } - else if (xtype == GrB_INT32) - { - int32_t *X = extract_X ? mxMalloc (s * sizeof (int32_t)) : NULL ; - OK (GrB_Matrix_extractTuples_INT32 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_INT32) ; - } - } - else if (xtype == GrB_INT64) - { - int64_t *X = extract_X ? mxMalloc (s * sizeof (int64_t)) : NULL ; - OK (GrB_Matrix_extractTuples_INT64 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_INT64) ; - } - } - else if (xtype == GrB_UINT8) - { - uint8_t *X = extract_X ? mxMalloc (s * sizeof (uint8_t)) : NULL ; - OK (GrB_Matrix_extractTuples_UINT8 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_UINT8) ; - } - } - else if (xtype == GrB_UINT16) - { - uint16_t *X = extract_X ? mxMalloc (s * sizeof (uint16_t)) : NULL ; - OK (GrB_Matrix_extractTuples_UINT16 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_UINT16) ; - } - } - else if (xtype == GrB_UINT32) - { - uint32_t *X = extract_X ? mxMalloc (s * sizeof (uint32_t)) : NULL ; - OK (GrB_Matrix_extractTuples_UINT32 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_UINT32) ; - } - } - else if (xtype == GrB_UINT64) - { - uint64_t *X = extract_X ? mxMalloc (s * sizeof (uint64_t)) : NULL ; - OK (GrB_Matrix_extractTuples_UINT64 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_UINT64) ; - } - } - else if (xtype == GrB_FP32) - { - float *X = extract_X ? mxMalloc (s * sizeof (float)) : NULL ; - OK (GrB_Matrix_extractTuples_FP32 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_FP32) ; - } - } - else if (xtype == GrB_FP64) - { - double *X = extract_X ? mxMalloc (s * sizeof (double)) : NULL ; - OK (GrB_Matrix_extractTuples_FP64 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GrB_FP64) ; - } - } - else if (xtype == GxB_FC32) - { - GxB_FC32_t *X = extract_X ? mxMalloc (s * sizeof (GxB_FC32_t)) : NULL ; - OK (GxB_Matrix_extractTuples_FC32 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GxB_FC32) ; - } - } - else if (xtype == GxB_FC64) - { - GxB_FC64_t *X = extract_X ? mxMalloc (s * sizeof (GxB_FC64_t)) : NULL ; - OK (GxB_Matrix_extractTuples_FC64 (I, J, X, &nvals, A)) ; - if (extract_X) - { - pargout [2] = gb_export_to_mxfull ((void **) (&X), nvals, 1, - GxB_FC64) ; - } - } - else - { - ERROR ("unsupported type") ; - } + OK (GxB_Matrix_extractTuples_Vector (I, J, X, A, NULL)) ; //-------------------------------------------------------------------------- - // determine if zero-based or one-based + // determine if 1 must be added to the indices //-------------------------------------------------------------------------- - if (base == BASE_DEFAULT) - { - GrB_Index nrows, ncols ; - OK (GrB_Matrix_nrows (&nrows, A)) ; - OK (GrB_Matrix_ncols (&ncols, A)) ; - if (MAX (nrows, ncols) > FLINTMAX) - { - // the matrix is too large for I and J to be returned as double - base = BASE_1_INT64 ; - } - else - { - // this is the typical case - base = BASE_1_DOUBLE ; - } - } + int base_offset = (base == BASE_0_INT) ? 0 : 1 ; //-------------------------------------------------------------------------- - // free workspace + // return I to MATLAB //-------------------------------------------------------------------------- - OK (GrB_Matrix_free (&A)) ; + void *x = NULL ; + uint64_t size = 0 ; + int ignore = 0 ; + GrB_Type type = NULL ; + GrB_Vector T = NULL ; - //-------------------------------------------------------------------------- - // export I and J - //-------------------------------------------------------------------------- - - if (base == BASE_0_INT64) + if (extract_I) { - - //---------------------------------------------------------------------- - // export I and J in their native zero-based integer format - //---------------------------------------------------------------------- - - if (extract_I) + if (base == BASE_1_DOUBLE && nrows <= FLINTMAX) { - pargout [0] = gb_export_to_mxfull ((void **) (&I), nvals, 1, - GrB_INT64) ; + // I = (double) (I + 1) + OK (GrB_Vector_new (&T, GrB_FP64, nvals)) ; + OK (GrB_Vector_apply_BinaryOp2nd_FP64 (T, NULL, NULL, + GrB_PLUS_FP64, I, base_offset, NULL)) ; + OK (GrB_Vector_free (&I)) ; + I = T ; } - - if (extract_J) + else if (base_offset != 0) { - pargout [1] = gb_export_to_mxfull ((void **) (&J), nvals, 1, - GrB_INT64) ; + // I = I+1, as a int64 or int32 vector + OK (GrB_Vector_apply_BinaryOp2nd_UINT64 (I, NULL, NULL, + GrB_PLUS_UINT64, I, 1, NULL)) ; } - + OK (GxB_Vector_unload (I, &x, &type, &nvals, &size, &ignore, NULL)) ; + if (type == GrB_UINT32) type = GrB_INT32 ; + if (type == GrB_UINT64) type = GrB_INT64 ; + pargout [0] = gb_export_to_mxfull (&x, nvals, 1, type) ; + OK (GrB_Vector_free (&I)) ; } - else if (base == BASE_1_DOUBLE) - { - //---------------------------------------------------------------------- - // export I and J as double one-based integers - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // return J to MATLAB + //-------------------------------------------------------------------------- - if (extract_I) + if (extract_J) + { + if (base == BASE_1_DOUBLE && ncols <= FLINTMAX) { - double *I_double = mxMalloc (s * sizeof (double)) ; - GB_helper1 (I_double, I, (int64_t) nvals) ; - gb_mxfree ((void **) (&I)) ; - pargout [0] = gb_export_to_mxfull ((void **) (&I_double), nvals, 1, - GrB_FP64) ; + // J = (double) (J + 1) + OK (GrB_Vector_new (&T, GrB_FP64, nvals)) ; + OK (GrB_Vector_apply_BinaryOp2nd_FP64 (T, NULL, NULL, + GrB_PLUS_FP64, J, base_offset, NULL)) ; + OK (GrB_Vector_free (&J)) ; + J = T ; } - - if (extract_J) + else if (base_offset != 0) { - double *J_double = mxMalloc (s * sizeof (double)) ; - GB_helper1 (J_double, J, (int64_t) nvals) ; - gb_mxfree ((void **) (&J)) ; - pargout [1] = gb_export_to_mxfull ((void **) (&J_double), nvals, 1, - GrB_FP64) ; + // J = J+1, as a int64 or int32 vector + OK (GrB_Vector_apply_BinaryOp2nd_UINT64 (J, NULL, NULL, + GrB_PLUS_UINT64, J, 1, NULL)) ; } - + OK (GxB_Vector_unload (J, &x, &type, &nvals, &size, &ignore, NULL)) ; + if (type == GrB_UINT32) type = GrB_INT32 ; + if (type == GrB_UINT64) type = GrB_INT64 ; + pargout [1] = gb_export_to_mxfull (&x, nvals, 1, type) ; + OK (GrB_Vector_free (&J)) ; } - else if (base == BASE_1_INT64) - { - //---------------------------------------------------------------------- - // export I and J as int64 one-based integers - //---------------------------------------------------------------------- - - if (extract_I) - { - GB_helper1i ((int64_t *) I, (int64_t) nvals) ; - pargout [0] = gb_export_to_mxfull ((void **) (&I), nvals, 1, - GrB_INT64) ; - } + //-------------------------------------------------------------------------- + // return X to MATLAB + //-------------------------------------------------------------------------- - if (extract_J) - { - GB_helper1i ((int64_t *) J, (int64_t) nvals) ; - pargout [1] = gb_export_to_mxfull ((void **) (&J), nvals, 1, - GrB_INT64) ; - } + if (extract_X) + { + OK (GxB_Vector_unload (X, &x, &xtype, &nvals, &size, &ignore, NULL)) ; + pargout [2] = gb_export_to_mxfull (&x, nvals, 1, xtype) ; + OK (GrB_Vector_free (&X)) ; } - GB_WRAPUP ; + //-------------------------------------------------------------------------- + // restore burble and return result + //-------------------------------------------------------------------------- + + if (disable_burble) + { + OK (GrB_Global_set_INT32 (GrB_GLOBAL, burble, GxB_BURBLE)) ; + } + GrB_Matrix_free (&A) ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextractvalues.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextractvalues.c index 452feb0aba..00b143e024 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextractvalues.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbextractvalues.c @@ -2,7 +2,7 @@ // gbextractvalues: extract all entries from a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,105 +35,42 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix A = gb_get_shallow (pargin [0]) ; - GrB_Index nvals ; - OK (GrB_Matrix_nvals (&nvals, A)) ; - GrB_Type xtype ; - OK (GxB_Matrix_type (&xtype, A)) ; - GrB_Index s = MAX (nvals, 1) ; + uint64_t nrows, ncols, nvals ; + OK (GrB_Matrix_nrows (&nrows, A)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + int burble ; + bool disable_burble = (nrows <= 1 && ncols <= 1) ; + if (disable_burble) + { + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &burble, GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; + } //-------------------------------------------------------------------------- // extract the tuples //-------------------------------------------------------------------------- - if (xtype == GrB_BOOL) - { - bool *X = mxMalloc (s * sizeof (bool)) ; - OK (GrB_Matrix_extractTuples_BOOL (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_BOOL) ; - } - else if (xtype == GrB_INT8) - { - int8_t *X = mxMalloc (s * sizeof (int8_t)) ; - OK (GrB_Matrix_extractTuples_INT8 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_INT8) ; - } - else if (xtype == GrB_INT16) - { - int16_t *X = mxMalloc (s * sizeof (int16_t)) ; - OK (GrB_Matrix_extractTuples_INT16 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_INT16) ; - } - else if (xtype == GrB_INT32) - { - int32_t *X = mxMalloc (s * sizeof (int32_t)) ; - OK (GrB_Matrix_extractTuples_INT32 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_INT32) ; - } - else if (xtype == GrB_INT64) - { - int64_t *X = mxMalloc (s * sizeof (int64_t)) ; - OK (GrB_Matrix_extractTuples_INT64 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_INT64) ; - } - else if (xtype == GrB_UINT8) - { - uint8_t *X = mxMalloc (s * sizeof (uint8_t)) ; - OK (GrB_Matrix_extractTuples_UINT8 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_UINT8) ; - } - else if (xtype == GrB_UINT16) - { - uint16_t *X = mxMalloc (s * sizeof (uint16_t)) ; - OK (GrB_Matrix_extractTuples_UINT16 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_UINT16) ; - } - else if (xtype == GrB_UINT32) - { - uint32_t *X = mxMalloc (s * sizeof (uint32_t)) ; - OK (GrB_Matrix_extractTuples_UINT32 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_UINT32) ; - } - else if (xtype == GrB_UINT64) - { - uint64_t *X = mxMalloc (s * sizeof (uint64_t)) ; - OK (GrB_Matrix_extractTuples_UINT64 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_UINT64) ; - } - - else if (xtype == GrB_FP32) - { - float *X = mxMalloc (s * sizeof (float)) ; - OK (GrB_Matrix_extractTuples_FP32 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_FP32) ; - } - else if (xtype == GrB_FP64) - { - double *X = mxMalloc (s * sizeof (double)) ; - OK (GrB_Matrix_extractTuples_FP64 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GrB_FP64) ; - } - else if (xtype == GxB_FC32) - { - GxB_FC32_t *X = mxMalloc (s * sizeof (GxB_FC32_t)) ; - OK (GxB_Matrix_extractTuples_FC32 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GxB_FC32) ; - } - else if (xtype == GxB_FC64) - { - GxB_FC64_t *X = mxMalloc (s * sizeof (GxB_FC64_t)) ; - OK (GxB_Matrix_extractTuples_FC64 (NULL, NULL, X, &nvals, A)) ; - pargout [0] = gb_export_to_mxfull ((void **) &X, nvals, 1, GxB_FC64) ; - } - else - { - ERROR ("unsupported type") ; - } + void *X = NULL ; + GrB_Type xtype = NULL ; + int ignore = 0 ; + uint64_t X_size = 0 ; + GrB_Vector X_vector = NULL ; + OK (GrB_Vector_new (&X_vector, GrB_FP64, 0)) ; + OK (GxB_Matrix_extractTuples_Vector (NULL, NULL, X_vector, A, NULL)) ; + OK (GxB_Vector_unload (X_vector, &X, &xtype, &nvals, &X_size, &ignore, + NULL)) ; + pargout [0] = gb_export_to_mxfull (&X, nvals, 1, xtype) ; //-------------------------------------------------------------------------- // free workspace //-------------------------------------------------------------------------- OK (GrB_Matrix_free (&A)) ; - GB_WRAPUP ; + OK (GrB_Vector_free (&X_vector)) ; + if (disable_burble) + { + OK (GrB_Global_set_INT32 (GrB_GLOBAL, burble, GxB_BURBLE)) ; + } + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbformat.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbformat.c index 2a874e3aa7..fd6364ce69 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbformat.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbformat.c @@ -2,7 +2,7 @@ // gbformat: get/set the matrix format to use in GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,7 +37,7 @@ void mexFunction // get/set the format //-------------------------------------------------------------------------- - GxB_Format_Value fmt = GxB_BY_COL ; + int fmt = GxB_BY_COL ; int sparsity = GxB_AUTO_SPARSITY ; bool iso = false ; bool v5_1_or_later = false ; @@ -50,7 +50,7 @@ void mexFunction //---------------------------------------------------------------------- // get the global format - OK (GxB_Global_Option_get (GxB_FORMAT, &fmt)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &fmt, GxB_FORMAT)) ; } else // if (nargin == 1) @@ -69,7 +69,7 @@ void mexFunction bool ok = gb_mxstring_to_format (pargin [0], &fmt, &ignore) ; CHECK_ERROR (!ok, "invalid format") ; // set the global format - OK (GxB_Global_Option_set (GxB_FORMAT, fmt)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, fmt, GxB_FORMAT)) ; } else if (mxIsStruct (pargin [0])) @@ -80,7 +80,12 @@ void mexFunction //------------------------------------------------------------------ // get the type - mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv10") ; + if (mx_type == NULL) + { + // check if it is a GraphBLASv7_3 struct + mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + } if (mx_type == NULL) { // check if it is a GraphBLASv5_1 struct @@ -167,6 +172,6 @@ void mexFunction pargout [2] = mxCreateString (iso ? "iso-valued" : "non-iso-valued") ; } - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbfull.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbfull.c index 5c8c78375d..4c96e9143f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbfull.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbfull.c @@ -2,7 +2,7 @@ // gbfull: add identity values to a matrix so all entries are present //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix A = gb_get_shallow (pargin [0]) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; @@ -82,7 +82,7 @@ void mexFunction base_enum_t base = BASE_DEFAULT ; kind_enum_t kind = KIND_GRB ; - GxB_Format_Value fmt = GxB_NO_FORMAT ; + int fmt = GxB_NO_FORMAT ; int sparsity = 0 ; GrB_Descriptor desc = NULL ; if (nargin > 3) @@ -124,6 +124,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbisequal.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbisequal.c index 8df9f961fc..192451467b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbisequal.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbisequal.c @@ -2,7 +2,7 @@ // gbisequal: isequal (A,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,6 +51,6 @@ void mexFunction OK (GrB_Matrix_free (&A)) ; OK (GrB_Matrix_free (&B)) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbjit.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbjit.c index be5127cb23..33a08fc55b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbjit.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbjit.c @@ -2,19 +2,19 @@ // gbjit: control the GraphBLAS JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // Usage: -// [s,path] = gbjit -// [s,path] = gbjit (jit) +// [status] = gbjit +// [status] = gbjit (status) #include "gb_interface.h" -#define USAGE "usage: [s,path] = GrB.jit (s,path) ;" +#define USAGE "usage: [status] = GrB.jit (status) ;" void mexFunction ( @@ -29,39 +29,53 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin <= 2 && nargout <= 2, USAGE) ; + gb_usage (nargin <= 1 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // set the JIT control, if requested //-------------------------------------------------------------------------- - #define LEN 2048 - char s [LEN] ; - if (nargin > 0) { // set the JIT control - #define JIT(c) { OK (GxB_Global_Option_set (GxB_JIT_C_CONTROL, c)) ; } - gb_mxstring_to_string (s, LEN, pargin [0], "s") ; - if (MATCH (s, "" )) { /* do nothing */ ; } - else if (MATCH (s, "off" )) JIT (GxB_JIT_OFF) - else if (MATCH (s, "pause")) JIT (GxB_JIT_PAUSE) - else if (MATCH (s, "run" )) JIT (GxB_JIT_RUN) - else if (MATCH (s, "load" )) JIT (GxB_JIT_LOAD) - else if (MATCH (s, "on" )) JIT (GxB_JIT_ON) - else if (MATCH (s, "flush")) { JIT (GxB_JIT_OFF) ; JIT (GxB_JIT_ON) ; } - else ERROR2 ("unknown option: %s", s) ; - } - - //-------------------------------------------------------------------------- - // set the cache path, if requested - //-------------------------------------------------------------------------- - - if (nargin > 1) - { - // set the JIT cache path - gb_mxstring_to_string (s, LEN, pargin [1], "path") ; - OK (GxB_Global_Option_set (GxB_JIT_CACHE_PATH, s)) ; + #define JIT(c) \ + OK (GrB_Global_set_INT32 (GrB_GLOBAL, c, GxB_JIT_C_CONTROL)) ; + #define LEN 256 + char status [LEN+2] ; + gb_mxstring_to_string (status, LEN, pargin [0], "status") ; + if (MATCH (status, "" )) + { + /* do nothing */ ; + } + else if (MATCH (status, "off" )) + { + JIT (GxB_JIT_OFF) ; + } + else if (MATCH (status, "pause")) + { + JIT (GxB_JIT_PAUSE) ; + } + else if (MATCH (status, "run" )) + { + JIT (GxB_JIT_RUN) ; + } + else if (MATCH (status, "load" )) + { + JIT (GxB_JIT_LOAD) ; + } + else if (MATCH (status, "on" )) + { + JIT (GxB_JIT_ON) ; + } + else if (MATCH (status, "flush")) + { + JIT (GxB_JIT_OFF) ; + JIT (GxB_JIT_ON) ; + } + else + { + ERROR2 ("unknown option: %s", status) ; + } } //-------------------------------------------------------------------------- @@ -70,8 +84,8 @@ void mexFunction if (nargout > 0) { - GxB_JIT_Control c ; - OK (GxB_Global_Option_get (GxB_JIT_C_CONTROL, &c)) ; + int c ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &c, GxB_JIT_C_CONTROL)) ; switch (c) { case GxB_JIT_OFF : pargout [0] = mxCreateString ("off" ) ; break ; @@ -84,21 +98,10 @@ void mexFunction } } - //-------------------------------------------------------------------------- - // get the JIT cache path, if requested - //-------------------------------------------------------------------------- - - if (nargout > 1) - { - char *path = NULL ; - OK (GxB_Global_Option_get (GxB_JIT_CACHE_PATH, &path)) ; - pargout [1] = mxCreateString (path) ; - } - //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbkronecker.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbkronecker.c index 0d47d4130b..558141b390 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbkronecker.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbkronecker.c @@ -2,7 +2,7 @@ // gbkronecker: sparse matrix Kronecker product //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -46,7 +46,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -116,14 +116,14 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A and B are transposed - GrB_Desc_Value in0, in1 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; - OK (GxB_Desc_get (desc, GrB_INP1, &in1)) ; + int in0, in1 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; + OK (GrB_Descriptor_get_INT32 (desc, &in1, GrB_INP1)) ; bool A_transpose = (in0 == GrB_TRAN) ; bool B_transpose = (in1 == GrB_TRAN) ; // get the size of A and B - GrB_Index anrows, ancols, bnrows, bncols ; + uint64_t anrows, ancols, bnrows, bncols ; if (A_transpose) { OK (GrB_Matrix_nrows (&ancols, A)) ; @@ -146,11 +146,11 @@ void mexFunction } // determine the size of C - GrB_Index cnrows = anrows * bnrows ; - GrB_Index cncols = ancols * bncols ; + uint64_t cnrows = anrows * bnrows ; + uint64_t cncols = ancols * bncols ; // use the ztype of the op as the type of C - OK (GxB_BinaryOp_ztype (&ctype, op)) ; + ctype = gb_binaryop_ztype (op) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, B, fmt) ; @@ -179,6 +179,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogassign.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogassign.c index d7d9b43ced..304a98ecc0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogassign.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogassign.c @@ -2,7 +2,7 @@ // gblogassign: logical assignment: C(M) = A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,8 @@ // is a sparse vector of size nnz(M)-by-1. Scalar expansion is not handled. // Use GrB.subassign (C, M, scalar) for that case. +// This function accesses opaque content and GB_methods inside GraphBLAS. + // Usage: // C = gblogassign (C, M, A) @@ -90,7 +92,7 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix C = gb_get_deep (pargin [0]) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, C)) ; OK (GrB_Matrix_ncols (&ncols, C)) ; @@ -102,13 +104,11 @@ void mexFunction GrB_Matrix M_input = gb_get_shallow (pargin [1]) ; GrB_Matrix M = gb_new (GrB_BOOL, nrows, ncols, GxB_BY_COL, GxB_SPARSE + GxB_HYPERSPARSE) ; -// OK1 (M, GxB_Matrix_select (M, NULL, NULL, GxB_NONZERO, M_input, -// NULL, NULL)) ; OK1 (M, GrB_Matrix_select_BOOL (M, NULL, NULL, GrB_VALUENE_BOOL, M_input, 0, NULL)) ; OK (GrB_Matrix_free (&M_input)) ; - GrB_Index mnz ; + uint64_t mnz ; OK (GrB_Matrix_nvals (&mnz, M)) ; //-------------------------------------------------------------------------- @@ -118,15 +118,15 @@ void mexFunction GrB_Matrix A_input = gb_get_shallow (pargin [2]) ; GrB_Matrix A = A_input ; GrB_Type atype ; - GrB_Index anrows, ancols, anz ; - GxB_Format_Value fmt ; + uint64_t anrows, ancols, anz ; + int fmt ; int A_sparsity ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GxB_Matrix_type (&atype, A)) ; OK (GrB_Matrix_nvals (&anz, A)) ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &A_sparsity)) ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32 (A, &A_sparsity, GxB_SPARSITY_STATUS)) ; GrB_Matrix A_copy = NULL ; GrB_Matrix A_copy2 = NULL ; @@ -135,8 +135,8 @@ void mexFunction if (A_sparsity == GxB_BITMAP) { OK (GrB_Matrix_dup (&A_copy2, A)) ; - OK1 (A_copy2, GxB_Matrix_Option_set (A_copy2, GxB_SPARSITY_CONTROL, - GxB_SPARSE + GxB_HYPERSPARSE + GxB_FULL)) ; + OK1 (A_copy2, GrB_Matrix_set_INT32 (A_copy2, + GxB_SPARSE + GxB_HYPERSPARSE + GxB_FULL, GxB_SPARSITY_CONTROL)) ; A = A_copy2 ; } @@ -155,7 +155,7 @@ void mexFunction if (fmt == GxB_BY_COL) { // A is 1-by-ancols and held by column: transpose it - A_copy = gb_new (atype, mnz, 1, GxB_BY_COL, + A_copy = gb_new (atype, mnz, 1, GxB_BY_COL, GxB_SPARSE + GxB_HYPERSPARSE + GxB_FULL) ; OK1 (A_copy, GrB_transpose (A_copy, NULL, NULL, A, NULL)) ; OK1 (A_copy, GrB_Matrix_wait (A_copy, GrB_MATERIALIZE)) ; @@ -186,29 +186,25 @@ void mexFunction // extract the values and pattern of A; handle iso case //-------------------------------------------------------------------------- - // Tim: use a shallow variant of GxB*export to access content of M and A - GrB_Index *Ai = - (GrB_Index *) A->i ; - void *Ax = A->x ; - char nil [16] = - "iso logassign " ; - if (Ax == NULL) Ax = &nil ; + void *Ax = A->x ; + char nil [16] = "iso logassign " ; + if (Ax == NULL) Ax = &nil ; //-------------------------------------------------------------------------- // extract the pattern of M //-------------------------------------------------------------------------- - GrB_Index *Mi = (GrB_Index *) (M->i) ; - GrB_Index *Mj = mxMalloc (MAX (mnz, 1) * sizeof (GrB_Index)) ; + uint64_t *Mj = mxMalloc (MAX (mnz, 1) * sizeof (uint64_t)) ; OK (GrB_Matrix_extractTuples_BOOL (NULL, Mj, NULL, &mnz, M)) ; //-------------------------------------------------------------------------- // construct a subset of the pattern of M corresponding to the entries of A //-------------------------------------------------------------------------- - GrB_Index *Si = mxMalloc (MAX (anz, 1) * sizeof (GrB_Index)) ; - GrB_Index *Sj = mxMalloc (MAX (anz, 1) * sizeof (GrB_Index)) ; - GB_helper5 (Si, Sj, Mi, Mj, M->vlen, Ai, A->vlen, anz) ; + uint64_t *Si = mxMalloc (MAX (anz, 1) * sizeof (uint64_t)) ; + uint64_t *Sj = mxMalloc (MAX (anz, 1) * sizeof (uint64_t)) ; + GB_helper5 (Si, Sj, M->i, M->i_is_32, Mj, M->vlen, A->i, A->i_is_32, + A->vlen, anz) ; GrB_Matrix S = gb_new (atype, nrows, ncols, GxB_BY_COL, 0) ; if (A->iso) @@ -360,6 +356,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_export (&C, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogextract.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogextract.c index c90be1850e..913a19ac88 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogextract.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gblogextract.c @@ -2,7 +2,7 @@ // gblogextract: logical extraction: C = A(M) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,8 @@ // of any type in this mexFunction. M should not have any explicit zeros. C // has the same type as A, and is a sparse vector of size nnz(M)-by-1. +// This function accesses opaque content and GB_methods inside GraphBLAS. + // Usage: // C = gblogextract (A, M) @@ -121,8 +123,6 @@ void mexFunction // make M boolean, stored by column, and drop explicit zeros GrB_Matrix M_input = gb_get_shallow (pargin [1]) ; GrB_Matrix M = gb_new (GrB_BOOL, nrows, ncols, GxB_BY_COL, not_bitmap) ; -// OK1 (M, GxB_Matrix_select (M, NULL, NULL, GxB_NONZERO, M_input, -// NULL, NULL)) ; OK1 (M, GrB_Matrix_select_BOOL (M, NULL, NULL, GrB_VALUENE_BOOL, M_input, 0, NULL)) ; OK (GrB_Matrix_free (&M_input)) ; @@ -130,7 +130,7 @@ void mexFunction GrB_Index mnz ; OK (GrB_Matrix_nvals (&mnz, M)) ; int sparsity ; - OK (GxB_Matrix_Option_get (M, GxB_SPARSITY_STATUS, &sparsity)) ; + OK (GrB_Matrix_get_INT32 (M, &sparsity, GxB_SPARSITY_STATUS)) ; CHECK_ERROR (sparsity == GxB_BITMAP, "internal error 5") ; CHECK_ERROR (!M->iso, "internal error 42") ; @@ -155,15 +155,13 @@ void mexFunction GrB_Index gnvals ; OK1 (G, GrB_Matrix_wait (G, GrB_MATERIALIZE)) ; OK (GrB_Matrix_nvals (&gnvals, G)) ; - OK (GxB_Matrix_Option_get (G, GxB_SPARSITY_STATUS, &sparsity)) ; + OK (GrB_Matrix_get_INT32 (G, &sparsity, GxB_SPARSITY_STATUS)) ; CHECK_ERROR (sparsity == GxB_BITMAP, "internal error 0") ; // Remove G->x from G void *Gx = G->x ; size_t Gx_size = G->x_size ; - #ifdef GB_MEMDUMP - printf ("remove G->x from memtable: %p\n", G->x) ; - #endif + GBMDUMP ("remove G->x from memtable: %p\n", G->x) ; GB_Global_memtable_remove (G->x) ; G->x = NULL ; G->x_size = 0 ; bool G_iso = G->iso ; @@ -172,7 +170,6 @@ void mexFunction // change G to boolean (all true and iso) //-------------------------------------------------------------------------- - // Tim: use G as structural instead bool Gbool = true ; G->type = GrB_BOOL ; G->x = &Gbool ; @@ -186,10 +183,10 @@ void mexFunction // K is a shallow copy of M, except for its numerical values struct GB_Matrix_opaque K_header ; - GrB_Matrix K = GB_clear_static_header (&K_header) ; + GrB_Matrix K = GB_clear_matrix_header (&K_header) ; OK (GB_shallow_copy (K, GxB_BY_COL, M, NULL)) ; - OK (GxB_Matrix_Option_get (K, GxB_SPARSITY_STATUS, &sparsity)) ; + OK (GrB_Matrix_get_INT32 (K, &sparsity, GxB_SPARSITY_STATUS)) ; CHECK_ERROR (sparsity == GxB_BITMAP, "internal error 10") ; // Kx = uint64 (0:mnz-1) @@ -202,9 +199,7 @@ void mexFunction K->x_shallow = false ; K->type = GrB_UINT64 ; K->x_size = Kx_size ; - #ifdef GB_MEMDUMP - printf ("add K->x to memtable: %p\n", K->x) ; - #endif + GBMDUMP ("add K->x to memtable: %p\n", K->x) ; GB_Global_memtable_add (K->x, K->x_size) ; K->iso = false ; @@ -225,9 +220,7 @@ void mexFunction OK (GrB_Matrix_nvals (&tnvals, T)) ; uint64_t *Tx = T->x ; size_t Tx_size = T->x_size ; - #ifdef GB_MEMDUMP - printf ("remove T->x from memtable: %p\n", T->x) ; - #endif + GBMDUMP ("remove T->x from memtable: %p\n", T->x) ; GB_Global_memtable_remove (T->x) ; T->x = NULL ; T->x_size = 0 ; @@ -244,24 +237,21 @@ void mexFunction GrB_Vector V ; OK (GrB_Vector_new (&V, type, mnz)) ; - OK (GxB_Vector_Option_set (V, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GrB_Vector_set_INT32 (V, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; - #ifdef GB_MEMDUMP - printf ("remove V->i from memtable: %p\n", V->i) ; - printf ("remove V->x from memtable: %p\n", V->x) ; - #endif + GBMDUMP ("remove V->i from memtable: %p\n", V->i) ; + GBMDUMP ("remove V->x from memtable: %p\n", V->x) ; GB_Global_memtable_remove (V->i) ; gb_mxfree ((void **) (&V->i)) ; GB_Global_memtable_remove (V->x) ; gb_mxfree ((void **) (&V->x)) ; // transplant values of T as the row indices of V - V->i = (int64_t *) Tx ; + V->i = (void *) Tx ; V->i_size = Tx_size ; V->i_shallow = false ; - #ifdef GB_MEMDUMP - printf ("add V->i to memtable: %p\n", V->i) ; - #endif + V->i_is_32 = false ; + GBMDUMP ("add V->i to memtable: %p\n", V->i) ; GB_Global_memtable_add (V->i, V->i_size) ; // this was the old T->x // transplant the values of G as the values of V @@ -269,17 +259,17 @@ void mexFunction V->x_size = Gx_size ; V->x_shallow = false ; V->iso = G_iso ; - #ifdef GB_MEMDUMP - printf ("add V->x to memtable: %p\n", V->x) ; - #endif + GBMDUMP ("add V->x to memtable: %p\n", V->x) ; GB_Global_memtable_add (V->x, V->x_size) ; // this was the old G->x - int64_t *Vp = V->p ; - Vp [0] = 0 ; - Vp [1] = tnvals ; + GB_Ap_DECLARE (Vp, ) ; GB_Ap_PTR (Vp, V) ; + GB_ISET (Vp, 0, 0) ; // Vp [0] = 0 ; + GB_ISET (Vp, 1, tnvals) ; // Vp [1] = tnvals ; + V->nvals = tnvals ; V->magic = GB_MAGIC ; - V->nvec_nonempty = (tnvals > 0) ? 1 : 0 ; +// V->nvec_nonempty = (tnvals > 0) ? 1 : 0 ; + GB_nvec_nonempty_set ((GrB_Matrix) V, (tnvals > 0) ? 1 : 0) ; // typecast V to a matrix C, for export GrB_Matrix C = (GrB_Matrix) V ; @@ -299,6 +289,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_export (&C, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmdiag.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmdiag.c index e08dd7c737..6ab9b9ca91 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmdiag.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmdiag.c @@ -2,7 +2,7 @@ // gbmdiag: construct a diaogonal matrix from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ void mexFunction base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int sparsity ; GrB_Descriptor desc = NULL ; desc = gb_mxarray_to_descriptor (pargin [nargin-1], &kind, &fmt, @@ -52,12 +52,12 @@ void mexFunction GrB_Matrix V = gb_get_shallow (pargin [0]) ; int64_t k = 0 ; - int64_t ncols ; + uint64_t ncols ; OK (GrB_Matrix_ncols (&ncols, V)) ; CHECK_ERROR (ncols != 1, "v must be a column vector") ; int s ; - OK (GxB_Matrix_Option_get (V, GxB_SPARSITY_STATUS, &s)) ; + OK (GrB_Matrix_get_INT32 (V, &s, GxB_SPARSITY_STATUS)) ; CHECK_ERROR (s == GxB_HYPERSPARSE, "v cannot be hypersparse") ; if (nargin > 1) @@ -73,10 +73,10 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Type ctype = NULL ; - int64_t n ; + uint64_t n ; OK (GxB_Matrix_type (&ctype, V)) ; OK (GrB_Matrix_nrows (&n, V)) ; - n += GB_IABS (k) ; + n += ABS (k) ; fmt = gb_get_format (n, n, NULL, NULL, fmt) ; C = gb_new (ctype, n, n, fmt, 0) ; @@ -99,6 +99,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmonoidinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmonoidinfo.c index 9a3f334fc3..bd02baf5f9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmonoidinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmonoidinfo.c @@ -2,7 +2,7 @@ // gbmonoidinfo : print a GraphBLAS monoid (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ // gbmonoidinfo (monoid) // gbmonoidinfo (monoid, type) +// ok = gbmonoidinfo (monoid) #include "gb_interface.h" @@ -29,7 +30,7 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin >= 1 && nargin <= 2 && nargout == 0, USAGE) ; + gb_usage (nargin >= 1 && nargin <= 2 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // construct the GraphBLAS monoid and print it @@ -47,7 +48,12 @@ void mexFunction } GrB_Monoid op = gb_mxstring_to_monoid (pargin [0], type) ; - OK (GxB_Monoid_fprint (op, opstring, GxB_COMPLETE, NULL)) ; - GB_WRAPUP ; + int pr = (nargout < 1) ? GxB_COMPLETE : GxB_SILENT ; + OK (GxB_Monoid_fprint (op, opstring, pr, NULL)) ; + if (nargout == 1) + { + pargout [0] = mxCreateLogicalScalar (true) ; + } + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmtimes.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmtimes.c index 8c85ce21e0..b800052946 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmtimes.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmtimes.c @@ -2,7 +2,7 @@ // gbmtimes: sparse matrix-matrix multiplication over the standard semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,7 +51,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -64,7 +64,7 @@ void mexFunction { OK (GrB_Descriptor_new (&desc)) ; } - OK (GxB_Desc_set (desc, GxB_SORT, true)) ; + OK (GrB_Descriptor_set_INT32 (desc, true, GxB_SORT)) ; //-------------------------------------------------------------------------- // get the matrices @@ -87,26 +87,28 @@ void mexFunction char semiring_string [8] ; strcpy (semiring_string, "+.*") ; plus_times = gb_string_to_semiring (semiring_string, atype, btype) ; - OK (GxB_Semiring_add (&plus_monoid, plus_times)) ; - OK (GxB_Semiring_multiply (×, plus_times)) ; - OK (GxB_Monoid_operator (&plus, plus_monoid)) ; - OK (GxB_BinaryOp_ztype (&ctype, plus)) ; + OK (GrB_Semiring_get_VOID (plus_times, (void *) &plus_monoid, + GxB_SEMIRING_MONOID)) ; + OK (GrB_Semiring_get_VOID (plus_times, (void *) ×, + GxB_SEMIRING_MULTIPLY)) ; + OK (GrB_Monoid_get_VOID (plus_monoid, (void *) &plus, GxB_MONOID_OPERATOR)); + ctype = gb_binaryop_ztype (plus) ; //-------------------------------------------------------------------------- // construct C //-------------------------------------------------------------------------- // get the size of A and B - GrB_Index anrows, ancols, bnrows, bncols, cnrows, cncols ; + uint64_t anrows, ancols, bnrows, bncols, cnrows, cncols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_nrows (&bnrows, B)) ; OK (GrB_Matrix_ncols (&bncols, B)) ; // get the descriptor contents to determine if A and B are transposed - GrB_Desc_Value in0, in1 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; - OK (GxB_Desc_get (desc, GrB_INP1, &in1)) ; + int in0, in1 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; + OK (GrB_Descriptor_get_INT32 (desc, &in1, GrB_INP1)) ; bool A_transpose = (in0 == GrB_TRAN) ; bool B_transpose = (in1 == GrB_TRAN) ; @@ -152,7 +154,7 @@ void mexFunction // C = alpha * B or C = A * beta //---------------------------------------------------------------------- - GrB_Index nvals ; + uint64_t nvals ; OK (GrB_Scalar_nvals (&nvals, scalar)) ; if (nvals == 0) { @@ -183,8 +185,8 @@ void mexFunction //---------------------------------------------------------------------- int A_sparsity, B_sparsity ; - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &A_sparsity)) ; - OK (GxB_Matrix_Option_get (B, GxB_SPARSITY_STATUS, &B_sparsity)) ; + OK (GrB_Matrix_get_INT32 (A, &A_sparsity, GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_get_INT32 (B, &B_sparsity, GxB_SPARSITY_STATUS)) ; bool A_full = (A_sparsity == GxB_FULL) ; bool A_sparse = (A_sparsity == GxB_BITMAP || A_sparsity == GxB_SPARSE) ; @@ -200,7 +202,7 @@ void mexFunction // ensure C can be held as a full matrix sparsity = sparsity | GxB_FULL ; - OK (GxB_Matrix_Option_set (C, GxB_SPARSITY_CONTROL, sparsity)) ; + OK (GrB_Matrix_set_INT32 (C, sparsity, GxB_SPARSITY_CONTROL)) ; // C = 0 // zero = (ctype) 0 OK (GrB_Scalar_new (&zero, ctype)) ; @@ -241,6 +243,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmxm.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmxm.c index 8477568506..4a2fbb3344 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmxm.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbmxm.c @@ -2,7 +2,7 @@ // gbmxm: sparse matrix-matrix multiplication //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -46,7 +46,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -60,7 +60,7 @@ void mexFunction { OK (GrB_Descriptor_new (&desc)) ; } - OK (GxB_Desc_set (desc, GxB_SORT, true)) ; + OK (GrB_Descriptor_set_INT32 (desc, true, GxB_SORT)) ; //-------------------------------------------------------------------------- // get the matrices @@ -124,29 +124,27 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A and B are transposed - GrB_Desc_Value in0, in1 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; - OK (GxB_Desc_get (desc, GrB_INP1, &in1)) ; + int in0, in1 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; + OK (GrB_Descriptor_get_INT32 (desc, &in1, GrB_INP1)) ; bool A_transpose = (in0 == GrB_TRAN) ; bool B_transpose = (in1 == GrB_TRAN) ; // get the size of A and B - GrB_Index anrows, ancols, bnrows, bncols ; + uint64_t anrows, ancols, bnrows, bncols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_nrows (&bnrows, B)) ; OK (GrB_Matrix_ncols (&bncols, B)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (B_transpose) ? bnrows : bncols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (B_transpose) ? bnrows : bncols ; - // use the semiring's additive monoid as the type of C - GrB_Monoid add_monoid ; - GrB_BinaryOp add ; - OK (GxB_Semiring_add (&add_monoid, semiring)) ; - OK (GxB_Monoid_operator (&add, add_monoid)) ; - OK (GxB_BinaryOp_ztype (&ctype, add)) ; + // use the semiring's ztype as the type of C + int code ; + OK (GrB_Semiring_get_INT32 (semiring, &code, GrB_OUTP_TYPE_CODE)) ; + ctype = gb_code_to_type (code) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, cncols, A, B, fmt) ; @@ -175,6 +173,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnew.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnew.c index 7a9b7c6efa..afce46ebb3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnew.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnew.c @@ -2,7 +2,7 @@ // gbnew: create a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix C ; - GxB_Format_Value fmt ; + int fmt ; int sparsity = 0 ; if (nargin == 1) @@ -101,7 +101,7 @@ void mexFunction // get a shallow copy and then typecast it to type. // use the same format as A GrB_Matrix A = gb_get_shallow (pargin [0]) ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; C = gb_typecast (A, type, fmt, 0) ; OK (GrB_Matrix_free (&A)) ; } @@ -136,8 +136,8 @@ void mexFunction //------------------------------------------------------------------ // m-by-n GraphBLAS double matrix, no entries, default format - GrB_Index nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; - GrB_Index ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; + uint64_t nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; + uint64_t ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; C = gb_new (GrB_FP64, nrows, ncols, -1, 0) ; } @@ -167,8 +167,8 @@ void mexFunction //------------------------------------------------------------------ // create an m-by-n matrix with no entries - GrB_Index nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; - GrB_Index ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; + uint64_t nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; + uint64_t ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; GrB_Type type = gb_mxstring_to_type (pargin [2]) ; bool ok = gb_mxstring_to_format (pargin [2], &fmt, &sparsity) ; @@ -249,8 +249,8 @@ void mexFunction // create an m-by-n matrix with no entries, of the requested // type and format - GrB_Index nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; - GrB_Index ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; + uint64_t nrows = gb_mxget_uint64_scalar (pargin [0], "m") ; + uint64_t ncols = gb_mxget_uint64_scalar (pargin [1], "n") ; GrB_Type type = gb_mxstring_to_type (pargin [2]) ; bool ok = gb_mxstring_to_format (pargin [3], &fmt, &sparsity) ; @@ -284,6 +284,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_export (&C, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnorm.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnorm.c index 03ed55e155..b1c5c2870f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnorm.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnorm.c @@ -2,11 +2,13 @@ // gbnorm: norm (A,kind) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// This function accesses opaque content and GB_methods inside GraphBLAS. + #include "gb_interface.h" #define USAGE "usage: s = gbnorm (A, kind)" @@ -36,12 +38,12 @@ void mexFunction GrB_Type atype ; OK (GxB_Matrix_type (&atype, A)) ; - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; int sparsity ; - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &sparsity)) ; + OK (GrB_Matrix_get_INT32 (A, &sparsity, GxB_SPARSITY_STATUS)) ; //-------------------------------------------------------------------------- // s = norm (A,kind) @@ -49,7 +51,7 @@ void mexFunction double s ; - if (norm_kind == INT64_MIN && !GB_is_dense (A)) + if (norm_kind == INT64_MIN && !gb_is_dense (A)) { // norm (A,-inf) is zero if A is not full s = 0 ; @@ -60,7 +62,7 @@ void mexFunction { // s = norm (A,p) where A is an FP32 or FP64 vector, // or when p = 0 (for Frobenius norm). A cannot be bitmap. - GrB_Index anz ; + uint64_t anz ; OK (GrB_Matrix_nvals (&anz, A)) ; s = GB_helper10 (A->x, A->iso, NULL, false, atype, norm_kind, anz) ; if (s < 0) ERROR ("unknown norm") ; @@ -77,6 +79,6 @@ void mexFunction OK (GrB_Matrix_free (&A)) ; pargout [0] = mxCreateDoubleScalar (s) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnormdiff.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnormdiff.c index c5b9f7a042..973cb48c4e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnormdiff.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnormdiff.c @@ -2,11 +2,13 @@ // gbnormdiff: norm (A-B,kind) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// This function accesses opaque content and GB_methods inside GraphBLAS. + #include "gb_interface.h" #define USAGE "usage: s = gbnormdiff (A, B, kind)" @@ -38,7 +40,7 @@ void mexFunction OK (GxB_Matrix_type (&atype, A)) ; OK (GxB_Matrix_type (&btype, B)) ; - GrB_Index anrows, ancols, bnrows, bncols ; + uint64_t anrows, ancols, bnrows, bncols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_nrows (&bnrows, B)) ; @@ -54,13 +56,13 @@ void mexFunction double s ; - if (GB_is_dense (A) && GB_is_dense (B) && + if (gb_is_dense (A) && gb_is_dense (B) && (atype == GrB_FP32 || atype == GrB_FP64) && (atype == btype) && (anrows == 1 || ancols == 1 || norm_kind == 0)) { // s = norm (A-B,p) where A and B are full FP32 or FP64 vectors, // or when p = 0 (for Frobenius norm) - GrB_Index anz ; + uint64_t anz ; OK (GrB_Matrix_nvals (&anz, A)) ; s = GB_helper10 (A->x, A->iso, B->x, B->iso, atype, norm_kind, anz) ; @@ -113,6 +115,6 @@ void mexFunction OK (GrB_Matrix_free (&A)) ; OK (GrB_Matrix_free (&B)) ; pargout [0] = mxCreateDoubleScalar (s) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnvals.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnvals.c index b3dd2466d9..033639ade0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnvals.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbnvals.c @@ -2,7 +2,7 @@ // gbnvals: number of entries in a GraphBLAS matrix struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ void mexFunction // get the # of entries in the matrix //-------------------------------------------------------------------------- - GrB_Index nvals ; + uint64_t nvals ; OK (GrB_Matrix_nvals (&nvals, X)) ; //-------------------------------------------------------------------------- @@ -53,7 +53,7 @@ void mexFunction double anvals ; if (nvals == INT64_MAX) { - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, X)) ; OK (GrB_Matrix_ncols (&ncols, X)) ; anvals = ((double) nrows) * ((double) ncols) ; @@ -64,6 +64,6 @@ void mexFunction } pargout [0] = mxCreateDoubleScalar (anvals) ; OK (GrB_Matrix_free (&X)) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gboptype.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gboptype.c index f7ee9499bd..148669249c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gboptype.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gboptype.c @@ -2,7 +2,7 @@ // gboptype : determine the type of a binary operator from the input types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -49,6 +49,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = gb_type_to_mxstring (optype) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreduce.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreduce.c index 0bd4a2dfe3..54dca33ca8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreduce.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreduce.c @@ -2,7 +2,7 @@ // gbreduce: reduce a sparse matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -104,10 +104,7 @@ void mexFunction if (C == NULL) { // use the ztype of the monoid as the type of C - GrB_BinaryOp binop ; - OK (GxB_Monoid_operator (&binop, monoid)) ; - OK (GxB_BinaryOp_ztype (&ctype, binop)) ; - + ctype = gb_monoid_type (monoid) ; fmt = gb_get_format (1, 1, A, NULL, fmt) ; sparsity = gb_get_sparsity (A, NULL, sparsity) ; C = gb_new (ctype, 1, 1, fmt, sparsity) ; @@ -117,7 +114,7 @@ void mexFunction // ensure C is 1-by-1 //-------------------------------------------------------------------------- - GrB_Index cnrows, cncols ; + uint64_t cnrows, cncols ; OK (GrB_Matrix_nrows (&cnrows, C)) ; OK (GrB_Matrix_ncols (&cncols, C)) ; if (cnrows != 1 || cncols != 1) @@ -144,6 +141,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreshape.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreshape.c index 191896c61d..23b29dddf0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreshape.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbreshape.c @@ -2,7 +2,7 @@ // gbreshape: reshape a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,8 @@ void mexFunction gb_usage ((nargin == 3 || nargin == 4) && nargout == 1, USAGE) ; GrB_Matrix A = gb_get_shallow (pargin [0]) ; - GrB_Index nrows_new = gb_mxget_uint64_scalar (pargin [1], "nrows_new") ; - GrB_Index ncols_new = gb_mxget_uint64_scalar (pargin [2], "ncols_new") ; + uint64_t nrows_new = gb_mxget_uint64_scalar (pargin [1], "nrows_new") ; + uint64_t ncols_new = gb_mxget_uint64_scalar (pargin [2], "ncols_new") ; bool by_col = (nargin == 3) ? true : ((bool) mxGetScalar (pargin [3])) ; //-------------------------------------------------------------------------- @@ -47,6 +47,6 @@ void mexFunction GrB_Matrix_free (&A) ; pargout [0] = gb_export (&C, KIND_GRB) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselect.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselect.c index 4e06f2ce6a..b38d1919eb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselect.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselect.c @@ -2,7 +2,7 @@ // gbselect: select entries from a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -50,7 +50,7 @@ void gb_isnan32 (bool *z, const float *aij, (*z) = isnan (*aij) ; } -#define GB_ISNAN32_DEFN \ +#define ISNAN32_DEFN \ "void gb_isnan32 (bool *z, const float *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ @@ -63,7 +63,7 @@ void gb_isnan64 (bool *z, const double *aij, (*z) = isnan (*aij) ; } -#define GB_ISNAN64_DEFN \ +#define ISNAN64_DEFN \ "void gb_isnan64 (bool *z, const double *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ @@ -76,7 +76,7 @@ void gb_isnotnan32 (bool *z, const float *aij, (*z) = !isnan (*aij) ; } -#define GB_ISNOTNAN32_DEFN \ +#define ISNOTNAN32_DEFN \ "void gb_isnotnan32 (bool *z, const float *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ @@ -89,7 +89,7 @@ void gb_isnotnan64 (bool *z, const double *aij, (*z) = !isnan (*aij) ; } -#define GB_ISNOTNAN64_DEFN \ +#define ISNOTNAN64_DEFN \ "void gb_isnotnan64 (bool *z, const double *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ @@ -99,54 +99,54 @@ void gb_isnotnan64 (bool *z, const double *aij, void gb_isnanfc32 (bool *z, const GxB_FC32_t *aij, int64_t i, int64_t j, const void *thunk) { - (*z) = isnan (GB_crealf (*aij)) || isnan (GB_cimagf (*aij)) ; + (*z) = isnan (crealf (*aij)) || isnan (cimagf (*aij)) ; } -#define GB_ISNANFC32_DEFN \ +#define ISNANFC32_DEFN \ "void gb_isnanfc32 (bool *z, const GxB_FC32_t *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ -" (*z) = isnan (GB_crealf (*aij)) || isnan (GB_cimagf (*aij)) ; \n" \ +" (*z) = isnan (crealf (*aij)) || isnan (cimagf (*aij)) ; \n" \ "}" void gb_isnanfc64 (bool *z, const GxB_FC64_t *aij, int64_t i, int64_t j, const void *thunk) { - (*z) = isnan (GB_creal (*aij)) || isnan (GB_cimag (*aij)) ; + (*z) = isnan (creal (*aij)) || isnan (cimag (*aij)) ; } -#define GB_ISNANFC64_DEFN \ +#define ISNANFC64_DEFN \ "void gb_isnanfc64 (bool *z, const GxB_FC64_t *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ -" (*z) = isnan (GB_creal (*aij)) || isnan (GB_cimag (*aij)) ;\n" \ +" (*z) = isnan (creal (*aij)) || isnan (cimag (*aij)) ; \n" \ "}" void gb_isnotnanfc32 (bool *z, const GxB_FC32_t *aij, int64_t i, int64_t j, const void *thunk) { - (*z) = !isnan (GB_crealf (*aij)) && !isnan (GB_cimagf (*aij)) ; + (*z) = !isnan (crealf (*aij)) && !isnan (cimagf (*aij)) ; } -#define GB_ISNOTNANFC32_DEFN \ +#define ISNOTNANFC32_DEFN \ "void gb_isnotnanfc32 (bool *z, const GxB_FC32_t *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ -" (*z) = !isnan (GB_crealf (*aij)) && !isnan (GB_cimagf (*aij)) ; \n" \ +" (*z) = !isnan (crealf (*aij)) && !isnan (cimagf (*aij)) ; \n" \ "}" void gb_isnotnanfc64 (bool *z, const GxB_FC64_t *aij, int64_t i, int64_t j, const void *thunk) { - (*z) = !isnan (GB_creal (*aij)) && !isnan (GB_cimag (*aij)) ; + (*z) = !isnan (creal (*aij)) && !isnan (cimag (*aij)) ; } -#define GB_ISNOTNANFC64_DEFN \ +#define ISNOTNANFC64_DEFN \ "void gb_isnotnanfc64 (bool *z, const GxB_FC64_t *aij, \n" \ " int64_t i, int64_t j, const void *thunk) \n" \ "{ \n" \ -" (*z) = !isnan (GB_creal (*aij)) && !isnan (GB_cimag (*aij)) ; \n" \ +" (*z) = !isnan (creal (*aij)) && !isnan (cimag (*aij)) ; \n" \ "}" //------------------------------------------------------------------------------ @@ -175,7 +175,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -310,18 +310,18 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; - GrB_Index cncols = (A_transpose) ? anrows : ancols ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cncols = (A_transpose) ? anrows : ancols ; // C has the same type as A OK (GxB_Matrix_type (&ctype, A)) ; @@ -367,13 +367,13 @@ void mexFunction { GxB_FC32_t b_value = GxB_CMPLXF (0, 0) ; OK0 (GxB_Matrix_extractElement_FC32 (&b_value, b, 0, 0)) ; - b_is_nan = GB_cisnanf (b_value) ; + b_is_nan = isnan (crealf (b_value)) || isnan (cimagf (b_value)) ; } else if (btype == GxB_FC64) { GxB_FC64_t b_value = GxB_CMPLX (0, 0) ; OK0 (GxB_Matrix_extractElement_FC64 (&b_value, b, 0, 0)) ; - b_is_nan = GB_cisnan (b_value) ; + b_is_nan = isnan (creal (b_value)) || isnan (cimag (b_value)) ; } if (b_is_nan) @@ -387,56 +387,56 @@ void mexFunction OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnan32, GrB_BOOL, GrB_FP32, GrB_FP32, - "gb_isnan32", GB_ISNAN32_DEFN)) ; + "gb_isnan32", ISNAN32_DEFN)) ; } else if (idxunop == GrB_VALUEEQ_FP64) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnan64, GrB_BOOL, GrB_FP64, GrB_FP64, - "gb_isnan64", GB_ISNAN64_DEFN)) ; + "gb_isnan64", ISNAN64_DEFN)) ; } else if (idxunop == GxB_VALUEEQ_FC32) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnanfc32, GrB_BOOL, GxB_FC32, GxB_FC32, - "gb_isnanfc32", GB_ISNANFC32_DEFN)) ; + "gb_isnanfc32", ISNANFC32_DEFN)) ; } else if (idxunop == GxB_VALUEEQ_FC64) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnanfc64, GrB_BOOL, GxB_FC64, GxB_FC64, - "gb_isnanfc64", GB_ISNANFC64_DEFN)) ; + "gb_isnanfc64", ISNANFC64_DEFN)) ; } else if (idxunop == GrB_VALUENE_FP32) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnotnan32, GrB_BOOL, GrB_FP32, GrB_FP32, - "gb_isnotnan32", GB_ISNOTNAN32_DEFN)) ; + "gb_isnotnan32", ISNOTNAN32_DEFN)) ; } else if (idxunop == GrB_VALUENE_FP64) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnotnan64, GrB_BOOL, GrB_FP64, GrB_FP64, - "gb_isnotnan64", GB_ISNOTNAN64_DEFN)) ; + "gb_isnotnan64", ISNOTNAN64_DEFN)) ; } else if (idxunop == GxB_VALUENE_FC32) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnotnanfc32, GrB_BOOL, GxB_FC32, GxB_FC32, - "gb_isnotnanfc32", GB_ISNOTNANFC32_DEFN)) ; + "gb_isnotnanfc32", ISNOTNANFC32_DEFN)) ; } else if (idxunop == GxB_VALUENE_FC64) { OK (GxB_IndexUnaryOp_new (&nan_test, (GxB_index_unary_function) gb_isnotnanfc64, GrB_BOOL, GxB_FC64, GxB_FC64, - "gb_isnotnanfc64", GB_ISNOTNANFC64_DEFN)) ; + "gb_isnotnanfc64", ISNOTNANFC64_DEFN)) ; } } @@ -452,10 +452,9 @@ void mexFunction //-------------------------------------------------------------------------- // typecast the b2 scalar to the idxunop->ytype - GrB_Type ytype ; - char ytype_name [GxB_MAX_NAME_LEN] ; - OK (GxB_IndexUnaryOp_ytype_name (ytype_name, idxunop)) ; - OK (GxB_Type_from_name (&ytype, ytype_name)) ; + int code ; + OK (GrB_IndexUnaryOp_get_INT32 (idxunop, &code, GrB_INP1_TYPE_CODE)) ; + GrB_Type ytype = gb_code_to_type (code) ; OK (GrB_Matrix_new (&b4, ytype, 1, 1)) ; OK (GrB_Matrix_assign (b4, NULL, NULL, b2, GrB_ALL, 1, GrB_ALL, 1, NULL)) ; OK1 (C, GrB_Matrix_select_Scalar (C, M, accum, idxunop, A, @@ -480,6 +479,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselectopinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselectopinfo.c index 0dc3cfd02b..5adcc0f2ba 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselectopinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbselectopinfo.c @@ -2,7 +2,7 @@ // gbidxunopinfo : print a GraphBLAS GrB_IndexUnaryOp (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,8 @@ // Usage: // gbidxunopinfo (idxunop) +// gbidxunopinfo (idxunop, type) +// ok = gbidxunopinfo (idxunop) #include "gb_interface.h" @@ -28,7 +30,7 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin >= 1 && nargin <= 2 && nargout == 0, USAGE) ; + gb_usage (nargin >= 1 && nargin <= 2 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // construct the GraphBLAS GrB_IndexUnaryOp and print it @@ -52,8 +54,13 @@ void mexFunction gb_mxstring_to_idxunop (&idxunop, &ignore1, &ignore2, &ignore3, pargin [0], type) ; - OK (GxB_IndexUnaryOp_fprint (idxunop, opstring, GxB_COMPLETE, NULL)) ; + int pr = (nargout < 1) ? GxB_COMPLETE : GxB_SILENT ; + OK (GxB_IndexUnaryOp_fprint (idxunop, opstring, pr, NULL)) ; + if (nargout == 1) + { + pargout [0] = mxCreateLogicalScalar (true) ; + } - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsemiringinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsemiringinfo.c index ddb0d4a11e..9b31cf7ff5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsemiringinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsemiringinfo.c @@ -2,7 +2,7 @@ // gbsemiringinfo: print a GraphBLAS semiring (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ // gbsemiringinfo (semiring_string) // gbsemiringinfo (semiring_string, type) +// ok = gbsemiringinfo (semiring_string) #include "gb_interface.h" @@ -29,7 +30,7 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin >= 1 && nargin <= 2 && nargout == 0, USAGE) ; + gb_usage (nargin >= 1 && nargin <= 2 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // construct the GraphBLAS semiring and print it @@ -47,7 +48,12 @@ void mexFunction } GrB_Semiring semiring = gb_mxstring_to_semiring (pargin [0], type, type) ; - OK (GxB_Semiring_fprint (semiring, opstring, GxB_COMPLETE, NULL)) ; - GB_WRAPUP ; + int pr = (nargout < 1) ? GxB_COMPLETE : GxB_SILENT ; + OK (GxB_Semiring_fprint (semiring, opstring, pr, NULL)) ; + if (nargout == 1) + { + pargout [0] = mxCreateLogicalScalar (true) ; + } + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbserialize.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbserialize.c index e5e8be61b1..22369d6bd3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbserialize.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbserialize.c @@ -2,7 +2,7 @@ // gbserialize: serialize a matrix into a blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,7 @@ void mexFunction } if (level < 0 || level > 999) level = 0 ; // set the descriptor - OK (GxB_Desc_set (desc, GxB_COMPRESSION, method + level)) ; + OK (GrB_Descriptor_set_INT32 (desc, method + level, GxB_COMPRESSION)) ; } //-------------------------------------------------------------------------- @@ -87,7 +87,7 @@ void mexFunction //-------------------------------------------------------------------------- void *blob = NULL ; - GrB_Index blob_size ; + uint64_t blob_size ; if (debug) { @@ -120,6 +120,6 @@ void mexFunction mxFree (mxGetData (pargout [0])) ; mxSetData (pargout [0], blob) ; mxSetM (pargout [0], blob_size) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsize.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsize.c index 74db65464e..abef5b4d6a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsize.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsize.c @@ -2,7 +2,7 @@ // gbsize: dimension and type of a GraphBLAS or built-in matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,7 @@ void mexFunction // get the # of rows and columns of a GraphBLAS or built-in matrix //-------------------------------------------------------------------------- - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; int typecode = -1 ; if (mxIsStruct (pargin [0])) @@ -49,7 +49,12 @@ void mexFunction //---------------------------------------------------------------------- // get the type - mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv10") ; + if (mx_type == NULL) + { + // check if it is a GraphBLASv7_3 struct + mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + } if (mx_type == NULL) { // check if it is a GraphBLASv5_1 struct @@ -102,8 +107,8 @@ void mexFunction // get the size of a built-in matrix //---------------------------------------------------------------------- - nrows = (GrB_Index) mxGetM (pargin [0]) ; - ncols = (GrB_Index) mxGetN (pargin [0]) ; + nrows = (uint64_t) mxGetM (pargin [0]) ; + ncols = (uint64_t) mxGetN (pargin [0]) ; //---------------------------------------------------------------------- // get the type of a built-in matrix, if requested @@ -140,6 +145,6 @@ void mexFunction pargout [1] = mxCreateDoubleScalar ((double) ncols) ; } - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsplit.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsplit.c index 4ae956aa33..fefaeaac24 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsplit.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsplit.c @@ -2,7 +2,7 @@ // gbsplit: matrix split //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,12 +23,12 @@ // gb_get_tilesizes: get a list of integers //------------------------------------------------------------------------------ -static inline GrB_Index *gb_get_tilesizes (mxArray *mxList, GrB_Index *len) +static inline uint64_t *gb_get_tilesizes (mxArray *mxList, uint64_t *len) { int64_t n = mxGetNumberOfElements (mxList) ; - (*len) = (GrB_Index) n ; + (*len) = (uint64_t) n ; mxClassID class = mxGetClassID (mxList) ; - GrB_Index *List = mxMalloc (n * sizeof (GrB_Index)) ; + uint64_t *List = mxMalloc (n * sizeof (uint64_t)) ; // use mxGetData (best for Octave, fine for MATLAB) if (class == mxINT64_CLASS) { @@ -45,7 +45,7 @@ static inline GrB_Index *gb_get_tilesizes (mxArray *mxList, GrB_Index *len) double *p = (double *) mxGetData (mxList) ; for (int64_t k = 0 ; k < n ; k++) { - List [k] = (GrB_Index) p [k] ; + List [k] = (uint64_t) p [k] ; CHECK_ERROR ((double) List [k] != p [k], "dimensions must be integer") ; } @@ -83,7 +83,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -96,9 +96,9 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Matrix A = gb_get_shallow (Matrix [0]) ; - GrB_Index m, n ; - GrB_Index *Tile_nrows = gb_get_tilesizes (Matrix [1], &m) ; - GrB_Index *Tile_ncols = gb_get_tilesizes (Matrix [2], &n) ; + uint64_t m, n ; + uint64_t *Tile_nrows = gb_get_tilesizes (Matrix [1], &m) ; + uint64_t *Tile_ncols = gb_get_tilesizes (Matrix [2], &n) ; GrB_Matrix *Tiles = mxMalloc (m * n * sizeof (GrB_Matrix)) ; //-------------------------------------------------------------------------- @@ -137,6 +137,6 @@ void mexFunction pargout [0] = C ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsubassign.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsubassign.c index 7fb64be198..d809cbb5aa 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsubassign.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbsubassign.c @@ -2,7 +2,7 @@ // gbsubassign: assign entries into a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbthreads.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbthreads.c index c800150e4e..baf43e70df 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbthreads.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbthreads.c @@ -2,7 +2,7 @@ // gbthreads: get/set the maximum # of threads to use in GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,15 +43,16 @@ void mexFunction CHECK_ERROR (!gb_mxarray_is_scalar (pargin [0]), "input must be a scalar") ; nthreads_max = (int) mxGetScalar (pargin [0]) ; - OK (GxB_Global_Option_set (GxB_NTHREADS, nthreads_max)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, nthreads_max, GxB_NTHREADS)) ; + } //-------------------------------------------------------------------------- // return # of threads //-------------------------------------------------------------------------- - OK (GxB_Global_Option_get (GxB_NTHREADS, &nthreads_max)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &nthreads_max, GxB_NTHREADS)) ; pargout [0] = mxCreateDoubleScalar (nthreads_max) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtiming.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtiming.c deleted file mode 100644 index 597e3c6f03..0000000000 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtiming.c +++ /dev/null @@ -1,55 +0,0 @@ -//------------------------------------------------------------------------------ -// gbtiming: get/set the diagnostic timings -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Usage - -// t = gbtiming ; // get the current timing -// gbtiming (0) ; // clear the timing - -#include "gb_interface.h" - -#define USAGE "usage: t = GrB.timing (clear) ;" - -void mexFunction -( - int nargout, - mxArray *pargout [ ], - int nargin, - const mxArray *pargin [ ] -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - gb_usage (nargin <= 1 && nargout <= 1, USAGE) ; - - //-------------------------------------------------------------------------- - // get the current timing - //-------------------------------------------------------------------------- - - pargout [0] = mxCreateDoubleMatrix (40, 1, mxREAL) ; - double *T = mxGetData (pargout [0]) ; - for (int k = 0 ; k < 40 ; k++) - { - T [k] = GB_Global_timing_get (k) ; - } - - //-------------------------------------------------------------------------- - // clear the current timing, if requested - //-------------------------------------------------------------------------- - - if (nargin > 0 && mxGetScalar (pargin [0]) == 0) - { - GB_Global_timing_clear_all ( ) ; - } - GB_WRAPUP ; -} - diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtrans.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtrans.c index 57addb108a..041934e044 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtrans.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtrans.c @@ -2,7 +2,7 @@ // gbtrans: sparse matrix transpose //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -109,18 +109,18 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of C - GrB_Index cnrows = (A_transpose) ? anrows : ancols ; - GrB_Index cncols = (A_transpose) ? ancols : anrows ; + uint64_t cnrows = (A_transpose) ? anrows : ancols ; + uint64_t cncols = (A_transpose) ? ancols : anrows ; // use the type of A OK (GxB_Matrix_type (&ctype, A)) ; @@ -151,6 +151,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtype.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtype.c index 92177a543c..37f70b8f88 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtype.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbtype.c @@ -2,7 +2,7 @@ // gbtype: type of a GraphBLAS matrix struct, or any built-in variable //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,7 +44,12 @@ void mexFunction if (class == mxSTRUCT_CLASS) { // get the content of a GraphBLASv7_3 struct - mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + mxArray *mx_type = mxGetField (pargin [0], 0, "GraphBLASv10") ; + if (mx_type == NULL) + { + // check if it is a GraphBLASv5_1 struct + mx_type = mxGetField (pargin [0], 0, "GraphBLASv7_3") ; + } if (mx_type == NULL) { // check if it is a GraphBLASv5_1 struct @@ -85,6 +90,6 @@ void mexFunction //-------------------------------------------------------------------------- pargout [0] = c ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbunopinfo.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbunopinfo.c index 6549f4a418..f378521661 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbunopinfo.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbunopinfo.c @@ -2,7 +2,7 @@ // gbunopinfo : print a GraphBLAS unary op (for illustration only) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ // gbunopinfo (unop) // gbunopinfo (unop, type) +// ok = gbunopinfo (unop) #include "gb_interface.h" @@ -29,7 +30,7 @@ void mexFunction // check inputs //-------------------------------------------------------------------------- - gb_usage (nargin >= 1 && nargin <= 2 && nargout == 0, USAGE) ; + gb_usage (nargin >= 1 && nargin <= 2 && nargout <= 1, USAGE) ; //-------------------------------------------------------------------------- // construct the GraphBLAS unary operator and print it @@ -47,7 +48,12 @@ void mexFunction } GrB_UnaryOp op = gb_mxstring_to_unop (pargin [0], type) ; - OK (GxB_UnaryOp_fprint (op, opstring, GxB_COMPLETE, NULL)) ; - GB_WRAPUP ; + int pr = (nargout < 1) ? GxB_COMPLETE : GxB_SILENT ; + OK (GxB_UnaryOp_fprint (op, opstring, pr, NULL)) ; + if (nargout == 1) + { + pargout [0] = mxCreateLogicalScalar (true) ; + } + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvdiag.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvdiag.c index ae7788c95b..5a09ff3775 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvdiag.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvdiag.c @@ -2,7 +2,7 @@ // gbvdiag: extract a diaogonal of a matrix, as a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ void mexFunction base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int sparsity ; GrB_Descriptor desc = NULL ; desc = gb_mxarray_to_descriptor (pargin [nargin-1], &kind, &fmt, @@ -67,8 +67,8 @@ void mexFunction GrB_Type vtype = NULL ; int64_t n, nrows, ncols ; OK (GxB_Matrix_type (&vtype, A)) ; - OK (GrB_Matrix_nrows (&nrows, A)) ; - OK (GrB_Matrix_ncols (&ncols, A)) ; + OK (GrB_Matrix_nrows ((uint64_t *) &nrows, A)) ; + OK (GrB_Matrix_ncols ((uint64_t *) &ncols, A)) ; if (k >= ncols || k <= -nrows) { @@ -78,12 +78,12 @@ void mexFunction else if (k >= 0) { // if k is in range 0 to n-1, V must have length min (m,n-k) - n = GB_IMIN (nrows, ncols - k) ; + n = MIN (nrows, ncols - k) ; } else { // if k is in range -1 to -m+1, V must have length min (m+k,n) - n = GB_IMIN (nrows + k, ncols) ; + n = MIN (nrows + k, ncols) ; } V = gb_new (vtype, n, 1, GxB_BY_COL, 0) ; @@ -107,6 +107,6 @@ void mexFunction pargout [0] = gb_export (&V, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbver.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbver.c index c250f82c98..08b2a12dae 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbver.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbver.c @@ -2,7 +2,7 @@ // gbver: struct with SuiteSparse:GraphBLAS version //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,39 +34,65 @@ void mexFunction // get the version and date information and return it as a struct //-------------------------------------------------------------------------- - int version [3] ; - OK (GxB_Global_Option_get (GxB_LIBRARY_VERSION, version)) ; + // get the GraphBLAS version + int major, minor, patch ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &major, GrB_LIBRARY_VER_MAJOR)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &minor, GrB_LIBRARY_VER_MINOR)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &patch, GrB_LIBRARY_VER_PATCH)) ; - char *date ; - OK (GxB_Global_Option_get (GxB_LIBRARY_DATE, &date)) ; + // get the date + size_t len = 0 ; + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_LIBRARY_DATE)) ; + char *date = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, date, GxB_LIBRARY_DATE)) ; if (nargout == 0) { - char *license, *about, *spec, *url ; printf ("----------------------------------------" "-----------------------------------\n") ; - OK (GxB_Global_Option_get (GxB_LIBRARY_ABOUT, &about)) ; + + // about: + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_LIBRARY_ABOUT)) ; + char *about = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, about, GxB_LIBRARY_ABOUT)) ; printf ("%s\n", about) ; - printf ("Version: %d.%d.%d (%s)\n", - version [0], version [1], version [2], date) ; - char compiler [2048] ; + mxFree (about) ; + + // version and date: + printf ("Version: %d.%d.%d (%s)\n", major, minor, patch, date) ; + + // compiler: int32_t cver [3] ; int32_t have_openmp ; -// OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_COMPILER_NAME)) ; - OK (GrB_Global_get_String (GrB_GLOBAL, compiler, - (GrB_Field) GxB_COMPILER_NAME)) ; + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_COMPILER_NAME)) ; + char *compiler = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, compiler, GxB_COMPILER_NAME)) ; OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) cver, - (GrB_Field) GxB_COMPILER_VERSION)) ; + GxB_COMPILER_VERSION)) ; OK (GrB_Global_get_INT32 (GrB_GLOBAL, &have_openmp, - (GrB_Field) GxB_LIBRARY_OPENMP)) ; + GxB_LIBRARY_OPENMP)) ; printf ("GraphBLAS compiled with %s (v%d.%d.%d), %s OpenMP\n", compiler, cver [0], cver [1], cver [2], have_openmp ? "with" : "without") ; + mxFree (compiler) ; + + // license: printf ("@GrB License: Apache-2.0\n\n") ; - OK (GxB_Global_Option_get (GxB_API_ABOUT, &spec)) ; + + // spec: + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_API_ABOUT)) ; + char *spec = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, spec, GxB_API_ABOUT)) ; printf ("Spec:\n%s\n", spec) ; - OK (GxB_Global_Option_get (GxB_API_URL, &url)) ; + mxFree (spec) ; + + // url: + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_API_URL)) ; + char *url = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, url, GxB_API_URL)) ; printf ("URL: %s\n", url) ; + mxFree (url) ; + printf ("----------------------------------------" "-----------------------------------\n") ; } @@ -74,7 +100,7 @@ void mexFunction { #define LEN 256 char s [LEN+1] ; - snprintf (s, LEN, "%d.%d.%d", version [0], version [1], version [2]) ; + snprintf (s, LEN, "%d.%d.%d", major, minor, patch) ; pargout [0] = mxCreateStructMatrix (1, 1, 3, vfields) ; mxSetFieldByNumber (pargout [0], 0, 0, mxCreateString ("SuiteSparse:GraphBLAS")) ; @@ -82,6 +108,8 @@ void mexFunction mxSetFieldByNumber (pargout [0], 0, 2, mxCreateString (date)) ; } - GB_WRAPUP ; + mxFree (date) ; + + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbversion.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbversion.c index 00dd59cbe4..4edb2fcac8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbversion.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbversion.c @@ -2,7 +2,7 @@ // gbversion: string with SuiteSparse:GraphBLAS version //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,18 +32,23 @@ void mexFunction // get the version and date information and return it as a built-in string //-------------------------------------------------------------------------- - int version [3] ; - OK (GxB_Global_Option_get (GxB_LIBRARY_VERSION, version)) ; + int major, minor, patch ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &major, GrB_LIBRARY_VER_MAJOR)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &minor, GrB_LIBRARY_VER_MINOR)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &patch, GrB_LIBRARY_VER_PATCH)) ; - char *date = NULL ; - OK (GxB_Global_Option_get (GxB_LIBRARY_DATE, &date)) ; + // get the date + size_t len = 0 ; + OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_LIBRARY_DATE)) ; + char *date = mxMalloc (len+1) ; + OK (GrB_Global_get_String (GrB_GLOBAL, date, GxB_LIBRARY_DATE)) ; #define LEN 256 char s [LEN+1] ; - snprintf (s, LEN, "%d.%d.%d (%s)", - version [0], version [1], version [2], date) ; + snprintf (s, LEN, "%d.%d.%d (%s)", major, minor, patch, date) ; + mxFree (date) ; pargout [0] = mxCreateString (s) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvreduce.c b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvreduce.c index 67fc70466d..a4132ea631 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvreduce.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/mexfunctions/gbvreduce.c @@ -2,7 +2,7 @@ // gbvreduce: reduce a matrix to a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -46,7 +46,7 @@ void mexFunction mxArray *Matrix [6], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, USAGE, Matrix, &nmatrices, String, &nstrings, @@ -60,7 +60,7 @@ void mexFunction { OK (GrB_Descriptor_new (&desc)) ; } - OK (GxB_Desc_set (desc, GxB_SORT, true)) ; + OK (GrB_Descriptor_set_INT32 (desc, true, GxB_SORT)) ; //-------------------------------------------------------------------------- // get the matrices @@ -88,9 +88,7 @@ void mexFunction OK (GxB_Matrix_type (&atype, A)) ; if (C != NULL) { - CHECK_ERROR (C->h != NULL, "Cin cannot be hypersparse") ; - CHECK_ERROR (!(C->is_csc), "Cin must be stored by column") ; - CHECK_ERROR (!GB_VECTOR_OK (C), "Cin must be a column vector") ; + CHECK_ERROR (!gb_is_column_vector (C), "Cin must be a column vector") ; OK (GxB_Matrix_type (&ctype, C)) ; } @@ -123,22 +121,20 @@ void mexFunction if (C == NULL) { // get the descriptor contents to determine if A is transposed - GrB_Desc_Value in0 ; - OK (GxB_Desc_get (desc, GrB_INP0, &in0)) ; + int in0 ; + OK (GrB_Descriptor_get_INT32 (desc, &in0, GrB_INP0)) ; bool A_transpose = (in0 == GrB_TRAN) ; // get the size of A - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; // determine the size of the vector C - GrB_Index cnrows = (A_transpose) ? ancols : anrows ; + uint64_t cnrows = (A_transpose) ? ancols : anrows ; // use the ztype of the monoid as the type of C - GrB_BinaryOp binop ; - OK (GxB_Monoid_operator (&binop, monoid)) ; - OK (GxB_BinaryOp_ztype (&ctype, binop)) ; + ctype = gb_monoid_type (monoid) ; // create the matrix C and set its format and sparsity fmt = gb_get_format (cnrows, 1, A, NULL, fmt) ; @@ -167,6 +163,6 @@ void mexFunction pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_abort.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_abort.c index 69b18c4bfc..c737bce7f5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_abort.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_abort.c @@ -2,7 +2,7 @@ // gb_abort: terminate a GraphBLAS function //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_assign.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_assign.c index f9acd88cfb..5dcfd936bf 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_assign.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_assign.c @@ -2,7 +2,7 @@ // gb_assign: assign entries into a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,6 @@ // Cin and A are required. See GrB.m for more details. #include "gb_interface.h" -#include "GB_ij.h" void gb_assign // gbassign or gbsubassign mexFunctions ( @@ -55,7 +54,7 @@ void gb_assign // gbassign or gbsubassign mexFunctions mxArray *Matrix [4], *String [2], *Cell [2] ; base_enum_t base ; kind_enum_t kind ; - GxB_Format_Value fmt ; + int fmt ; int nmatrices, nstrings, ncells, sparsity ; GrB_Descriptor desc ; gb_get_mxargs (nargin, pargin, usage, Matrix, &nmatrices, String, &nstrings, @@ -63,11 +62,20 @@ void gb_assign // gbassign or gbsubassign mexFunctions CHECK_ERROR (nmatrices < 2 || nmatrices > 3 || nstrings > 1, usage) ; + //-------------------------------------------------------------------------- + // create the descriptor, if not present + //-------------------------------------------------------------------------- + + if (desc == NULL) + { + OK (GrB_Descriptor_new (&desc)) ; + } + //-------------------------------------------------------------------------- // get the matrices //-------------------------------------------------------------------------- - GrB_Type atype, ctype ; + GrB_Type ctype ; GrB_Matrix C, M = NULL, A ; if (nmatrices == 2) @@ -82,7 +90,6 @@ void gb_assign // gbassign or gbsubassign mexFunctions A = gb_get_shallow (Matrix [2]) ; } - OK (GxB_Matrix_type (&atype, A)) ; OK (GxB_Matrix_type (&ctype, C)) ; //-------------------------------------------------------------------------- @@ -100,7 +107,7 @@ void gb_assign // gbassign or gbsubassign mexFunctions // get the size of Cin //-------------------------------------------------------------------------- - GrB_Index cnrows, cncols ; + uint64_t cnrows, cncols ; OK (GrB_Matrix_nrows (&cnrows, C)) ; OK (GrB_Matrix_ncols (&cncols, C)) ; @@ -108,11 +115,11 @@ void gb_assign // gbassign or gbsubassign mexFunctions // get I and J //-------------------------------------------------------------------------- - GrB_Index *I = (GrB_Index *) GrB_ALL ; - GrB_Index *J = (GrB_Index *) GrB_ALL ; - GrB_Index ni = cnrows, nj = cncols ; - bool I_allocated = false, J_allocated = false ; + GrB_Vector I = NULL, J = NULL ; + int icells = 0, jcells = 0 ; + int base_offset = (base == BASE_0_INT) ? 0 : 1 ; int64_t I_max = -1, J_max = -1 ; + uint64_t nI, nJ ; if (cnrows > 1 && cncols > 1 && ncells == 1) { @@ -122,34 +129,46 @@ void gb_assign // gbassign or gbsubassign mexFunctions if (cnrows == 1 && ncells == 1) { // only J is present - J = gb_mxcell_to_index (Cell [0], base, cncols, &J_allocated, &nj, - &J_max) ; + J = gb_mxcell_to_list (Cell [0], base_offset, cncols, &nJ, &J_max) ; + jcells = mxGetNumberOfElements (Cell [0]) ; } else if (ncells == 1) { // only I is present - I = gb_mxcell_to_index (Cell [0], base, cnrows, &I_allocated, &ni, - &I_max) ; + I = gb_mxcell_to_list (Cell [0], base_offset, cnrows, &nI, &I_max) ; + icells = mxGetNumberOfElements (Cell [0]) ; } else if (ncells == 2) { // both I and J are present - I = gb_mxcell_to_index (Cell [0], base, cnrows, &I_allocated, &ni, - &I_max) ; - J = gb_mxcell_to_index (Cell [1], base, cncols, &J_allocated, &nj, - &J_max) ; + I = gb_mxcell_to_list (Cell [0], base_offset, cnrows, &nI, &I_max) ; + J = gb_mxcell_to_list (Cell [1], base_offset, cncols, &nJ, &J_max) ; + icells = mxGetNumberOfElements (Cell [0]) ; + jcells = mxGetNumberOfElements (Cell [1]) ; + } + + if (icells > 1) + { + // I is a 3-element vector containing a stride + OK (GrB_Descriptor_set_INT32 (desc, GxB_IS_STRIDE, GxB_ROWINDEX_LIST)) ; + } + + if (jcells > 1) + { + // J is a 3-element vector containing a stride + OK (GrB_Descriptor_set_INT32 (desc, GxB_IS_STRIDE, GxB_COLINDEX_LIST)) ; } //-------------------------------------------------------------------------- // expand C if needed //-------------------------------------------------------------------------- - GrB_Index cnrows_required = I_max + 1 ; - GrB_Index cncols_required = J_max + 1 ; + uint64_t cnrows_required = I_max + 1 ; + uint64_t cncols_required = J_max + 1 ; if (cnrows_required > cnrows || cncols_required > cncols) { - GrB_Index cnrows_new = GB_IMAX (cnrows, cnrows_required) ; - GrB_Index cncols_new = GB_IMAX (cncols, cncols_required) ; + uint64_t cnrows_new = MAX (cnrows, cnrows_required) ; + uint64_t cncols_new = MAX (cncols, cncols_required) ; OK (GrB_Matrix_resize (C, cnrows_new, cncols_new)) ; } @@ -157,7 +176,7 @@ void gb_assign // gbassign or gbsubassign mexFunctions // determine if A is a scalar (ignore the transpose descriptor) //-------------------------------------------------------------------------- - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; bool scalar_assignment = (anrows == 1) && (ancols == 1) ; @@ -171,14 +190,14 @@ void gb_assign // gbassign or gbsubassign mexFunctions if (do_subassign) { // C(I,J) += scalar - OK1 (C, GxB_Matrix_subassign_Scalar (C, M, accum, (GrB_Scalar) A, - I, ni, J, nj, desc)) ; + OK1 (C, GxB_Matrix_subassign_Scalar_Vector (C, M, accum, + (GrB_Scalar) A, I, J, desc)) ; } else { // C(I,J) += scalar - OK1 (C, GrB_Matrix_assign_Scalar (C, M, accum, (GrB_Scalar) A, - I, ni, J, nj, desc)) ; + OK1 (C, GxB_Matrix_assign_Scalar_Vector (C, M, accum, + (GrB_Scalar) A, I, J, desc)) ; } } else @@ -186,24 +205,24 @@ void gb_assign // gbassign or gbsubassign mexFunctions if (do_subassign) { // C(I,J) += A - OK1 (C, GxB_Matrix_subassign (C, M, accum, A, I, ni, J, nj, desc)) ; + OK1 (C, GxB_Matrix_subassign_Vector (C, M, accum, A, I, J, desc)) ; } else { // C(I,J) += A - OK1 (C, GrB_Matrix_assign (C, M, accum, A, I, ni, J, nj, desc)) ; + OK1 (C, GxB_Matrix_assign_Vector (C, M, accum, A, I, J, desc)) ; } } //-------------------------------------------------------------------------- - // free shallow copies + // free shallow copies and workspace //-------------------------------------------------------------------------- OK (GrB_Matrix_free (&M)) ; OK (GrB_Matrix_free (&A)) ; + OK (GrB_Vector_free (&I)) ; + OK (GrB_Vector_free (&J)) ; OK (GrB_Descriptor_free (&desc)) ; - if (I_allocated) gb_mxfree ((void **) (&I)) ; - if (J_allocated) gb_mxfree ((void **) (&J)) ; //-------------------------------------------------------------------------- // export the output matrix C @@ -211,6 +230,6 @@ void gb_assign // gbassign or gbsubassign mexFunctions pargout [0] = gb_export (&C, kind) ; pargout [1] = mxCreateDoubleScalar (kind) ; - GB_WRAPUP ; + gb_wrapup ( ) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_at_exit.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_at_exit.c index f232344e22..bdf08ebb6a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_at_exit.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_at_exit.c @@ -2,7 +2,7 @@ // gb_at_exit: terminate GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,10 +10,16 @@ // This method is called by MATLAB when the mexFunction that called GrB_init // (or GxB_init) is cleared. +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" void gb_at_exit ( void ) { + + // free the global Container used by this @GrB interface + GB_helper_container_free ( ) ; + // Finalize GraphBLAS, clearing all JIT kernels and freeing the hash table. // MATLAB can only use GraphBLAS if GrB_init / GxB_init is called again. diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binaryop_ztype.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binaryop_ztype.c new file mode 100644 index 0000000000..eeb8b2d2b7 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binaryop_ztype.c @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// gb_binaryop_ztype: get the GrB_Type of the z output of a binary operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "gb_interface.h" + +GrB_Type gb_binaryop_ztype +( + GrB_BinaryOp op +) +{ + int code = 0 ; + OK (GrB_BinaryOp_get_INT32 (op, &code, GrB_OUTP_TYPE_CODE)) ; + return (gb_code_to_type (code)) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binop_to_monoid.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binop_to_monoid.c index b95d66634f..69338436cf 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binop_to_monoid.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_binop_to_monoid.c @@ -2,7 +2,7 @@ // gb_binop_to_monoid: convert a binary operator to the corresponding monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_by_col.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_by_col.c index ecc9df4821..2784499fcc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_by_col.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_by_col.c @@ -2,7 +2,7 @@ // gb_by_col: ensure a matrix is stored by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,8 +20,8 @@ GrB_Matrix gb_by_col // return the matrix by column { // get the format of A_input - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (A_input, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (A_input, &fmt, GxB_FORMAT)) ; GrB_Matrix A_copy = NULL, A ; @@ -29,7 +29,7 @@ GrB_Matrix gb_by_col // return the matrix by column { // make a deep copy of A_input and change it to be stored by column OK (GrB_Matrix_dup (&A_copy, A_input)) ; - OK1 (A_copy, GxB_Matrix_Option_set (A_copy, GxB_FORMAT, GxB_BY_COL)) ; + OK1 (A_copy, GrB_Matrix_set_INT32 (A_copy, GxB_BY_COL, GxB_FORMAT)) ; OK1 (A_copy, GrB_Matrix_wait (A_copy, GrB_MATERIALIZE)) ; A = A_copy ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_code_to_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_code_to_type.c new file mode 100644 index 0000000000..8a487ffb55 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_code_to_type.c @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// gb_code_to_type: get the GrB_Type from the GrB_Type_Code +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Returns NULL if the type is user-defined. + +#include "gb_interface.h" + +GrB_Type gb_code_to_type +( + GrB_Type_Code code +) +{ + switch (code) + { + case GrB_BOOL_CODE : return (GrB_BOOL) ; + case GrB_INT8_CODE : return (GrB_INT8) ; + case GrB_INT16_CODE : return (GrB_INT16) ; + case GrB_INT32_CODE : return (GrB_INT32) ; + case GrB_INT64_CODE : return (GrB_INT64) ; + case GrB_UINT8_CODE : return (GrB_UINT8) ; + case GrB_UINT16_CODE : return (GrB_UINT16) ; + case GrB_UINT32_CODE : return (GrB_UINT32) ; + case GrB_UINT64_CODE : return (GrB_UINT64) ; + case GrB_FP32_CODE : return (GrB_FP32) ; + case GrB_FP64_CODE : return (GrB_FP64) ; + case GxB_FC32_CODE : return (GxB_FC32) ; + case GxB_FC64_CODE : return (GxB_FC64) ; + default : return (NULL) ; + } +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_format.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_format.c index 5848354aa2..6a0f259dac 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_format.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_format.c @@ -2,21 +2,21 @@ // gb_default_format: determine the default format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "gb_interface.h" -GxB_Format_Value gb_default_format // GxB_BY_ROW or GxB_BY_COL +int gb_default_format // GxB_BY_ROW or GxB_BY_COL ( - GrB_Index nrows, // row vectors are stored by row - GrB_Index ncols // column vectors are stored by column + uint64_t nrows, // row vectors are stored by row + uint64_t ncols // column vectors are stored by column ) { - GxB_Format_Value fmt ; + int fmt ; if (ncols == 1) { // column vectors are stored by column, by default @@ -30,7 +30,7 @@ GxB_Format_Value gb_default_format // GxB_BY_ROW or GxB_BY_COL else { // get the default format - OK (GxB_Global_Option_get (GxB_FORMAT, &fmt)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &fmt, GxB_FORMAT)) ; } return (fmt) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_type.c index abd688b60c..169b7538c4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_type.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_default_type.c @@ -2,7 +2,7 @@ // gb_default_type: determine the default type for a binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_defaults.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_defaults.c index 30d71656e5..96921d7815 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_defaults.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_defaults.c @@ -2,50 +2,57 @@ // gb_defaults: set global GraphBLAS defaults for MATLAB //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" +typedef void (*function_pointer) (void) ; + void gb_defaults (void) // set global GraphBLAS defaults for MATLAB { + // for debug only + GB_Global_abort_set (gb_abort) ; + // mxMalloc, mxCalloc, mxRealloc, and mxFree are not thread safe GB_Global_malloc_is_thread_safe_set (false) ; // must use mexPrintf to print to Command Window - OK (GxB_Global_Option_set (GxB_PRINTF, mexPrintf)) ; - OK (GxB_Global_Option_set (GxB_FLUSH, gb_flush)) ; + OK (GrB_Global_set_VOID (GrB_GLOBAL, (void *) mexPrintf, GxB_PRINTF, + sizeof (function_pointer))) ; + OK (GrB_Global_set_VOID (GrB_GLOBAL, (void *) gb_flush, GxB_FLUSH, + sizeof (function_pointer))) ; // enable the JIT - OK (GxB_Global_Option_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; // built-in matrices are stored by column - OK (GxB_Global_Option_set (GxB_FORMAT, GxB_BY_COL)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, + GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; // print 1-based indices - OK (GxB_Global_Option_set (GxB_PRINT_1BASED, true)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_PRINT_1BASED)) ; // burble is off - OK (GxB_Global_Option_set (GxB_BURBLE, false)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; // default # of threads from omp_get_max_threads - OK (GxB_Global_Option_set (GxB_NTHREADS, GB_omp_get_max_threads ( ))) ; + int nthreads = GB_omp_get_max_threads ( ) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, nthreads, GxB_NTHREADS)) ; // default chunk -// OK (GxB_Global_Option_set (GxB_CHUNK, (double) GB_CHUNK_DEFAULT)) ; GrB_Scalar chunk_default = NULL ; OK (GrB_Scalar_new (&chunk_default, GrB_FP64)) ; - OK (GrB_Scalar_setElement_FP64 (chunk_default, GB_CHUNK_DEFAULT)) ; - OK (GrB_Global_set_Scalar (GrB_GLOBAL, chunk_default, - (GrB_Field) GxB_CHUNK)) ; + OK (GrB_Scalar_setElement_FP64 (chunk_default, (double) (64 * 1024))) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, chunk_default, GxB_CHUNK)) ; OK (GrB_Scalar_free (&chunk_default)) ; - // for debug only - GB_Global_abort_set (gb_abort) ; - // for printing memory sizes of matrices - GB_Global_print_mem_shallow_set (true) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, + GxB_INCLUDE_READONLY_STATISTICS)) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error_string.c similarity index 84% rename from GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c rename to GraphBLAS/GraphBLAS/@GrB/private/util/gb_error_string.c index 0f5e1b1106..c5bf6c85bc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_error_string.c @@ -1,15 +1,15 @@ //------------------------------------------------------------------------------ -// gb_error: return a string from a GraphBLAS GrB_info +// gb_error_string: return a string from a GraphBLAS GrB_info //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "gb_interface.h" -const char *gb_error // return an error message from a GrB_Info value +const char *gb_error_string // return an error message from a GrB_Info value ( GrB_Info info ) @@ -44,6 +44,9 @@ const char *gb_error // return an error message from a GrB_Info value case GrB_INVALID_OBJECT : return ("object is corrupted") ; case GrB_INDEX_OUT_OF_BOUNDS : return ("row or column index out of bounds") ; case GrB_EMPTY_OBJECT : return ("an object does not contain a value") ; + case GxB_JIT_ERROR : return ("jit error") ; +// case GxB_GPU_ERROR: return ("GPU error") ; // in progress + case GxB_OUTPUT_IS_READONLY : return ("output is readonly") ; default : case GrB_PANIC : break ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_expand_to_full.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_expand_to_full.c index 1dbb6d4822..1b2ec8c0ea 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_expand_to_full.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_expand_to_full.c @@ -2,7 +2,7 @@ // gb_expand_to_full: add identity values to a matrix so all entries are present //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Matrix gb_expand_to_full // C = full (A), and typecast ( const GrB_Matrix A, // input matrix to expand to full GrB_Type type, // type of C, if NULL use the type of A - GxB_Format_Value fmt, // format of C + int fmt, // format of C GrB_Matrix id // identity value, use zero if NULL ) { @@ -23,7 +23,7 @@ GrB_Matrix gb_expand_to_full // C = full (A), and typecast //-------------------------------------------------------------------------- GrB_Type atype ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; OK (GxB_Matrix_type (&atype, A)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export.c index 48ae235ca1..be87980850 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export.c @@ -1,18 +1,20 @@ //------------------------------------------------------------------------------ -// gb_export: export a GrB_Matrix as a built-in matrix or GraphBLAS struct +// gb_export: export a GrB_Matrix as a MATLAB matrix or GraphBLAS struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// mxArray pargout [0] = gb_export (&C, kind) ; exports C as a built-in matrix +// mxArray pargout [0] = gb_export (&C, kind) ; exports C as a MATLAB matrix // and frees the remaining content of C. +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" -mxArray *gb_export // return the exported built-in matrix or struct +mxArray *gb_export // return the exported MATLAB matrix or struct ( GrB_Matrix *C_handle, // GrB_Matrix to export and free kind_enum_t kind // GrB, sparse, full, or built-in @@ -23,11 +25,11 @@ mxArray *gb_export // return the exported built-in matrix or struct // determine if all entries in C are present //-------------------------------------------------------------------------- - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; bool is_full = false ; if (kind == KIND_BUILTIN || kind == KIND_FULL) { - GrB_Index nvals ; + uint64_t nvals ; OK (GrB_Matrix_nvals (&nvals, *C_handle)) ; OK (GrB_Matrix_nrows (&nrows, *C_handle)) ; OK (GrB_Matrix_ncols (&ncols, *C_handle)) ; @@ -48,7 +50,7 @@ mxArray *gb_export // return the exported built-in matrix or struct { //---------------------------------------------------------------------- - // export C as a built-in sparse matrix + // export C as a MATLAB sparse matrix //---------------------------------------------------------------------- // Typecast to double, if C is integer (int8, ..., uint64) @@ -59,12 +61,13 @@ mxArray *gb_export // return the exported built-in matrix or struct { //---------------------------------------------------------------------- - // export C as a built-in full matrix, adding explicit zeros if needed + // export C as a MATLAB full matrix, adding explicit zeros if needed //---------------------------------------------------------------------- - // No typecasting is needed since built-in full matrices support all + // No typecasting is needed since MATLAB full matrices support all // the same types. + // ensure C is full GrB_Matrix C = NULL ; if (!is_full) { @@ -72,26 +75,50 @@ mxArray *gb_export // return the exported built-in matrix or struct C = gb_expand_to_full (*C_handle, NULL, GxB_BY_COL, NULL) ; OK (GrB_Matrix_free (C_handle)) ; (*C_handle) = C ; - CHECK_ERROR (GB_is_shallow (*C_handle), "internal error 707") + CHECK_ERROR (gb_is_readonly (*C_handle), "internal error 707") } - if (GB_is_shallow (*C_handle)) + // ensure the matrix is not readonly + if (gb_is_readonly (*C_handle)) { // C is shallow so make a deep copy OK (GrB_Matrix_dup (&C, *C_handle)) ; OK (GrB_Matrix_free (C_handle)) ; (*C_handle) = C ; } - - CHECK_ERROR (GB_is_shallow (*C_handle), "internal error 717") - - // export as a full matrix, held by column, not uniform-valued + CHECK_ERROR (gb_is_readonly (*C_handle), "internal error 717") + + // ensure C is in full format, held by column + C = (*C_handle) ; + OK (GrB_Matrix_set_INT32 (C, GxB_FULL, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_BY_COL, GxB_FORMAT)) ; + + // ensure the matrix is not iso-valued + OK (GrB_Matrix_set_INT32 (C, 0, GxB_ISO)) ; + + // unload C into the Container and free C + GxB_Container Container = GB_helper_container ( ) ; + CHECK_ERROR (Container == NULL, "internal error 911") ; + OK (GxB_unload_Matrix_into_Container (C, Container, NULL)) ; + OK (GrB_Matrix_free (C_handle)) ; + + // ensure the container holds the right content: not iso, full, and in + // column major format. This is just a sanity check; it should always + // succeed. + CHECK_ERROR (Container->iso, "internal error 718") ; + CHECK_ERROR (Container->format != GxB_FULL, "internal error 719") ; + CHECK_ERROR (Container->orientation != GrB_COLMAJOR, + "internal error 720") ; + + // unload the Container->x vector into the raw C array Cx void *Cx = NULL ; GrB_Type ctype = NULL ; - GrB_Index Cx_size ; - OK (GxB_Matrix_export_FullC (C_handle, &ctype, &nrows, &ncols, - &Cx, &Cx_size, NULL, NULL)) ; + uint64_t Cx_size, xlen ; + int ignore = 0 ; + OK (GxB_Vector_unload (Container->x, &Cx, &ctype, &xlen, &Cx_size, + &ignore, NULL)) ; + // export Cx as a dense nrows-by-ncols MATLAB matrix return (gb_export_to_mxfull (&Cx, nrows, ncols, ctype)) ; } @@ -99,10 +126,10 @@ mxArray *gb_export // return the exported built-in matrix or struct { //---------------------------------------------------------------------- - // export C as a built-in struct containing a verbatim GrB_Matrix + // export C as a MATLAB struct containing a verbatim GrB_Matrix //---------------------------------------------------------------------- - // No typecasting is needed since the built-in struct can hold all of + // No typecasting is needed since the MATLAB struct can hold all of // the opaque content of the GrB_Matrix. return (gb_export_to_mxstruct (C_handle)) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxfull.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxfull.c index 193f677c21..ee0475fe3c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxfull.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxfull.c @@ -1,16 +1,16 @@ //------------------------------------------------------------------------------ -// gb_export_to_mxfull: export a full array to a built-in full matrix +// gb_export_to_mxfull: export a full array to a MATLAB full matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// The input (void *) X is exported to a built-in full mxArray S. +// The input (void *) X is exported to a MATLAB full mxArray S. // The input array must be deep, but this cannot be checked here. The caller -// must ensure that the input X is deep. The output is a standard built-in full +// must ensure that the input X is deep. The output is a standard MATLAB full // matrix as an mxArray. No typecasting is done. // mxSetData is used instead of the MATLAB-recommended mxSetDoubles, etc, @@ -19,7 +19,7 @@ #include "gb_interface.h" -mxArray *gb_export_to_mxfull // return exported built-in full matrix F +mxArray *gb_export_to_mxfull // return exported MATLAB full matrix F ( void **X_handle, // pointer to array to export const GrB_Index nrows, // dimensions of F @@ -43,8 +43,8 @@ mxArray *gb_export_to_mxfull // return exported built-in full matrix F void *X = (*X_handle) ; if (X == NULL) { - // A GrB_Matrix C has a null C->x array, if C has no entries. Since - // C has already been expanded to a full matrix, C->x can be NULL + // A GrB_Matrix C has a null Cx array, if C has no entries. Since + // C has already been expanded to a full matrix, Cx can be NULL // only if nrows or ncols is zero. CHECK_ERROR (nrows > 0 && ncols > 0, "internal error 12") ; X = mxMalloc (2 * sizeof (double)) ; @@ -118,7 +118,7 @@ mxArray *gb_export_to_mxfull // return exported built-in full matrix F (*X_handle) = NULL ; //-------------------------------------------------------------------------- - // return the new built-in full matrix + // return the new MATLAB full matrix //-------------------------------------------------------------------------- return (F) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxsparse.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxsparse.c index 4e9eb17ba1..332d526cb0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxsparse.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxsparse.c @@ -1,20 +1,22 @@ //------------------------------------------------------------------------------ -// gb_export_to_mxsparse: export a GrB_Matrix to a built-in sparse matrix +// gb_export_to_mxsparse: export a GrB_Matrix to a MATLAB sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// The input GrB_Matrix A is exported to a built-in sparse mxArray S, and freed. +// The input GrB_Matrix A is exported to a MATLAB sparse mxArray S, and freed. // The input GrB_Matrix A may be shallow or deep. The output is a standard -// built-in sparse matrix as an mxArray. +// MATLAB sparse matrix as an mxArray. + +// This function accesses GB_methods inside GraphBLAS. #include "gb_interface.h" -mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S +mxArray *gb_export_to_mxsparse // return exported MATLAB sparse matrix S ( GrB_Matrix *A_handle // matrix to export; freed on output ) @@ -27,14 +29,14 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S CHECK_ERROR (A_handle == NULL || (*A_handle) == NULL, "internal error 2") ; //-------------------------------------------------------------------------- - // typecast to a native built-in sparse type and free A + // typecast to a native MATLAB sparse type and free A //-------------------------------------------------------------------------- GrB_Matrix T ; // T will always be deep GrB_Type type ; OK (GxB_Matrix_type (&type, *A_handle)) ; - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (*A_handle, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (*A_handle, &fmt, GxB_FORMAT)) ; if (fmt == GxB_BY_COL && (type == GrB_BOOL || type == GrB_FP64 || type == GxB_FC64)) @@ -44,7 +46,7 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S // A is already in a native built-in sparse matrix type, by column //---------------------------------------------------------------------- - if (GB_is_shallow (*A_handle)) + if (gb_is_readonly (*A_handle)) { // A is shallow so make a deep copy OK (GrB_Matrix_dup (&T, *A_handle)) ; @@ -92,19 +94,36 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S } // ensure T is deep - CHECK_ERROR (GB_is_shallow (T), "internal error 7") ; + CHECK_ERROR (gb_is_readonly (T), "internal error 7") ; //-------------------------------------------------------------------------- // drop zeros from T //-------------------------------------------------------------------------- - OK1 (T, GxB_Matrix_select (T, NULL, NULL, GxB_NONZERO, T, NULL, NULL)) ; + GrB_IndexUnaryOp op ; + if (type == GrB_BOOL) + { + op = GrB_VALUENE_BOOL ; + } + else if (type == GrB_FP64) + { + op = GrB_VALUENE_FP64 ; + } + else if (type == GxB_FC64) + { + op = GxB_VALUENE_FC64 ; + } + GrB_Scalar zero ; + OK (GrB_Scalar_new (&zero, type)) ; + OK (GrB_Scalar_setElement_FP64 (zero, 0)) ; + OK1 (T, GrB_Matrix_select_Scalar (T, NULL, NULL, op, T, zero, NULL)) ; + OK (GrB_Scalar_free (&zero)) ; //-------------------------------------------------------------------------- // create the new built-in sparse matrix //-------------------------------------------------------------------------- - GrB_Index nrows, ncols, nvals ; + uint64_t nrows, ncols, nvals ; OK (GrB_Matrix_nvals (&nvals, T)) ; OK (GrB_Matrix_nrows (&nrows, T)) ; OK (GrB_Matrix_ncols (&ncols, T)) ; @@ -137,21 +156,54 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S { //---------------------------------------------------------------------- - // export the content of T as a sparse CSC matrix + // export the content of T as a sparse CSC matrix (all-64-bit) //---------------------------------------------------------------------- - GrB_Index Tp_size, Ti_size, Tx_size, type_size ; + uint64_t Tp_size, Ti_size, Tx_size, type_size, plen, ilen, xlen ; uint64_t *Tp, *Ti ; void *Tx ; - // pass jumbled as NULL to indicate the matrix must be sorted - // pass iso as NULL to indicate it cannot be uniform valued - OK (GxB_Matrix_export_CSC (&T, &type, &nrows, &ncols, - &Tp, &Ti, &Tx, &Tp_size, &Ti_size, &Tx_size, NULL, NULL, NULL)) ; + // ensure the matrix is in sparse CSC format + OK (GrB_Matrix_set_INT32 (T, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (T, GxB_BY_COL, GxB_FORMAT)) ; + + // ensure the matrix uses all 64-bit integers + OK (GrB_Matrix_set_INT32 (T, 64, GxB_ROWINDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_set_INT32 (T, 64, GxB_COLINDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_set_INT32 (T, 64, GxB_OFFSET_INTEGER_HINT)) ; + + // ensure the matrix is not iso-valued + OK (GrB_Matrix_set_INT32 (T, 0, GxB_ISO)) ; + + // unload T into a Container and free T + GxB_Container Container = GB_helper_container ( ) ; + CHECK_ERROR (Container == NULL, "internal error 911") ; + OK (GxB_unload_Matrix_into_Container (T, Container, NULL)) ; + OK (GrB_Matrix_free (&T)) ; - CHECK_ERROR (Ti_size == 0, "internal error 8") ; - CHECK_ERROR (Tp == NULL || Ti == NULL || Tx == NULL, - "internal error 9") ; + // ensure the container holds content that is not jumbled or iso, + // and is in sparse CSC format; this 'cannot' fail but check just + // in case. + CHECK_ERROR (Container->iso, "internal error 904") ; + CHECK_ERROR (Container->jumbled, "internal error 905") ; + CHECK_ERROR (Container->format != GxB_SPARSE, "internal error 906") ; + CHECK_ERROR (Container->orientation != GrB_COLMAJOR, + "internal error 907") ; + + // unload the Container GrB_Vectors into raw C arrays Tp, Ti, and Tx + GrB_Type Tp_type, Ti_type, Tx_type ; + int ignore = 0 ; + OK (GxB_Vector_unload (Container->p, (void **) &Tp, &Tp_type, &plen, + &Tp_size, &ignore, NULL)) ; + OK (GxB_Vector_unload (Container->i, (void **) &Ti, &Ti_type, &ilen, + &Ti_size, &ignore, NULL)) ; + OK (GxB_Vector_unload (Container->x, (void **) &Tx, &Tx_type, &xlen, + &Tx_size, &ignore, NULL)) ; + + // ensure the types are correct; this 'cannot' fail but check anyway + CHECK_ERROR (Tp_type != GrB_UINT64, "internal error 901") ; + CHECK_ERROR (Ti_type != GrB_INT64, "internal error 902") ; + CHECK_ERROR (Tx_type != type, "internal error 903") ; //---------------------------------------------------------------------- // allocate an empty sparse matrix of the right type, then set content @@ -176,8 +228,7 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S // set the size mxSetM (S, nrows) ; mxSetN (S, ncols) ; - int64_t nzmax = GB_IMIN (Ti_size / sizeof (int64_t), - Tx_size / type_size) ; + int64_t nzmax = MIN (Ti_size / sizeof (int64_t), Tx_size / type_size) ; mxSetNzmax (S, nzmax) ; // set the column pointers @@ -195,7 +246,7 @@ mxArray *gb_export_to_mxsparse // return exported built-in sparse matrix S } //-------------------------------------------------------------------------- - // return the new built-in sparse matrix + // return the new built-in MATLAB sparse matrix //-------------------------------------------------------------------------- return (S) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c index 24dce5ac04..ef0fcf1544 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_export_to_mxstruct.c @@ -1,15 +1,15 @@ //------------------------------------------------------------------------------ -// gb_export_to_mxstruct: export a GrB_Matrix to a built-in struct +// gb_export_to_mxstruct: export a GrB_Matrix to a MATLAB struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // The input GrB_Matrix A is exported to a GraphBLAS matrix struct G, and freed. -// The input GrB_Matrix A must be deep. The output is a built-in struct +// The input GrB_Matrix A must be deep. The output is a MATLAB struct // holding the content of the GrB_Matrix. // The GraphBLASv4 and v5 structs are identical, except that s has size 9 @@ -23,11 +23,16 @@ // GraphBLASv7_3 is identical to GraphBLASv5_1, except that it adds the Y // hyper_hash with 3 components: Yp, Yi, and Yx. +// GraphBLASv10 is identical to GraphBLASv7_3, except that Ap, Ah, Ai, Yp, Yi, +// and Yx can be uint32_t. The fields are the same as GraphBLASv7_3. + // mxGetData and mxSetData are used instead of the MATLAB-recommended // mxGetDoubles, etc, because mxGetData and mxSetData work best for Octave, and // they work fine for MATLAB since GraphBLAS requires R2018a with the // interleaved complex data type. +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" // for hypersparse, sparse, or full matrices @@ -35,24 +40,24 @@ static const char *MatrixFields [9] = { // these fields are identical to GraphBLASv5_1, except for the name // of the first field - "GraphBLASv7_3", // 0: "logical", "int8", ... "double", + "GraphBLASv10", // 0: "logical", "int8", ... "double", // "single complex", or "double complex" "s", // 1: all scalar info goes here "x", // 2: array of uint8, size (sizeof(type)*nzmax), or // just sizeof(type) if the matrix is uniform-valued - "p", // 3: array of int64_t, size plen+1 - "i", // 4: array of int64_t, size nzmax - "h", // 5: array of int64_t, size plen if hypersparse + "p", // 3: array of uint32_t or uint64_t, size plen+1 + "i", // 4: array of uint32_t or uint64_t, size nzmax + "h", // 5: array of uint32_t or uint64_t, size plen if hyper // added for v7.2: for hypersparse matrices only: - "Yp", // 6: Y->p, a uint64_t array of size Y->vdim+1 - "Yi", // 7: Y->i, a uint64_t array of size nvec (s[3]) - "Yx" // 8: Y->x, an int64_t array of size nvec + "Yp", // 6: Yp, uint32_t or uint64_t array, size yvdim+1 + "Yi", // 7: Yi, uint32_t or uint64_t array, size nvec (s[3]) + "Yx" // 8: Yx, uint32_t or uint64_t array, size nvec } ; // for bitmap matrices only static const char *Bitmap_MatrixFields [4] = { - "GraphBLASv7_3", // 0: "logical", "int8", ... "double", + "GraphBLASv10", // 0: "logical", "int8", ... "double", // "single complex", or "double complex" "s", // 1: all scalar info goes here "x", // 2: array of uint8, size (sizeof(type)*nzmax), or @@ -62,7 +67,7 @@ static const char *Bitmap_MatrixFields [4] = //------------------------------------------------------------------------------ -mxArray *gb_export_to_mxstruct // return exported built-in struct G +mxArray *gb_export_to_mxstruct // return exported MATLAB struct G ( GrB_Matrix *A_handle // matrix to export; freed on output ) @@ -75,7 +80,7 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G CHECK_ERROR (A_handle == NULL, "matrix missing") ; GrB_Matrix T = NULL ; - if (GB_is_shallow (*A_handle)) + if (gb_is_readonly (*A_handle)) { // A is shallow so make a deep copy OK (GrB_Matrix_dup (&T, *A_handle)) ; @@ -87,129 +92,76 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G GrB_Matrix Y = NULL ; //-------------------------------------------------------------------------- - // make sure the matrix is finished, including the creation of A->Y + // make sure the matrix is finished, including the creation of Y //-------------------------------------------------------------------------- OK1 (A, GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; - - //-------------------------------------------------------------------------- - // get the sparsity_status and CSR/CSC format - //-------------------------------------------------------------------------- - - GxB_Format_Value fmt ; - int sparsity_status, sparsity_control ; - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_STATUS, &sparsity_status)) ; - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_CONTROL, &sparsity_control)) ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; - - //-------------------------------------------------------------------------- - // extract the opaque content not provided by GxB*export - //-------------------------------------------------------------------------- - - int64_t nzmax = GB_nnz_max (A) ; - int64_t plen = A->plen ; - int64_t nvec_nonempty = A->nvec_nonempty ; + // OK (GxB_Matrix_fprint (A, "A to export", 0, NULL)) ; //-------------------------------------------------------------------------- // extract the content of the GrB_Matrix and free it //-------------------------------------------------------------------------- - size_t type_size = 0 ; - GrB_Type type = NULL ; - GrB_Index nrows = 0, ncols = 0 ; - int8_t *Ab = NULL ; - uint64_t *Ap = NULL, *Ah = NULL, *Ai = NULL ; - void *Ax = NULL ; - GrB_Index Ap_size = 0, Ah_size = 0, Ab_size = 0, Ai_size = 0, Ax_size = 0 ; - int64_t nvals = 0, nvec = 0 ; - bool by_col = (fmt == GxB_BY_COL) ; - bool iso = false ; - - GrB_Type ytype = NULL ; - uint64_t *Yp = NULL ; GrB_Index Yp_size = 0 ; - uint64_t *Yi = NULL ; GrB_Index Yi_size = 0 ; - void *Yx = NULL ; GrB_Index Yx_size = 0 ; - uint64_t yvdim, ynrows ; - - switch (sparsity_status) + int sparsity_control ; + OK (GrB_Matrix_get_INT32 (A, &sparsity_control, GxB_SPARSITY_CONTROL)) ; + + GxB_Container Container = GB_helper_container ( ) ; + OK (GxB_unload_Matrix_into_Container (A, Container, NULL)) ; + GrB_Matrix_free (&A) ; + + // get the scalars from the Container + int sparsity_status = Container->format ; + bool by_col = (Container->orientation == GrB_COLMAJOR) ; + uint64_t nrows = Container->nrows ; + uint64_t ncols = Container->ncols ; + uint64_t nvals = Container->nvals ; + uint64_t nrows_nonempty = Container->nrows_nonempty ; + uint64_t ncols_nonempty = Container->ncols_nonempty ; + bool iso = Container->iso ; + int ro = 0 ; // ignored; no content is readonly +// bool jumbled = Container->jumbled ; // not needed; matrix is not jumbled + + // get the vectors from the Container + void *Ap = NULL ; uint64_t Ap_size, Ap_len ; GrB_Type Ap_type = NULL ; + void *Ah = NULL ; uint64_t Ah_size, Ah_len ; GrB_Type Ah_type = NULL ; + void *Ab = NULL ; uint64_t Ab_size, Ab_len ; GrB_Type Ab_type = NULL ; + void *Ai = NULL ; uint64_t Ai_size, Ai_len ; GrB_Type Ai_type = NULL ; + void *Ax = NULL ; uint64_t Ax_size, Ax_len ; GrB_Type Ax_type = NULL ; + + OK (GxB_Vector_unload (Container->p, &Ap, &Ap_type, &Ap_len, &Ap_size, &ro, + NULL)) ; + OK (GxB_Vector_unload (Container->h, &Ah, &Ah_type, &Ah_len, &Ah_size, &ro, + NULL)) ; + OK (GxB_Vector_unload (Container->b, &Ab, &Ab_type, &Ab_len, &Ab_size, &ro, + NULL)) ; + OK (GxB_Vector_unload (Container->i, &Ai, &Ai_type, &Ai_len, &Ai_size, &ro, + NULL)) ; + OK (GxB_Vector_unload (Container->x, &Ax, &Ax_type, &Ax_len, &Ax_size, &ro, + NULL)) ; + + // get the Y matrix from the Container + void *Yp = NULL ; uint64_t Yp_size, Yp_len ; GrB_Type Yp_type = NULL ; + void *Yi = NULL ; uint64_t Yi_size, Yi_len ; GrB_Type Yi_type = NULL ; + void *Yx = NULL ; uint64_t Yx_size, Yx_len ; GrB_Type Yx_type = NULL ; + uint64_t yncols = 0 ; + if (Container->Y != NULL) { - case GxB_FULL : - if (by_col) - { - OK (GxB_Matrix_export_FullC (&A, &type, &nrows, &ncols, - &Ax, &Ax_size, &iso, NULL)) ; - } - else - { - OK (GxB_Matrix_export_FullR (&A, &type, &nrows, &ncols, - &Ax, &Ax_size, &iso, NULL)) ; - } - break ; - - case GxB_SPARSE : - if (by_col) - { - OK (GxB_Matrix_export_CSC (&A, &type, &nrows, &ncols, - &Ap, &Ai, &Ax, - &Ap_size, &Ai_size, &Ax_size, &iso, NULL, NULL)) ; - } - else - { - OK (GxB_Matrix_export_CSR (&A, &type, &nrows, &ncols, - &Ap, &Ai, &Ax, - &Ap_size, &Ai_size, &Ax_size, &iso, NULL, NULL)) ; - } - break ; - - case GxB_HYPERSPARSE : - - // export and free the A->Y hyper_hash. It is always sparse, - // GrB_UINT64, held by column, and non-iso - OK (GxB_unpack_HyperHash (A, &Y, NULL)) ; - if (Y != NULL) - { - OK (GxB_Matrix_export_CSC (&Y, &ytype, &ynrows, &yvdim, - &Yp, &Yi, &Yx, &Yp_size, &Yi_size, &Yx_size, - NULL, NULL, NULL)) ; - } - - // export and free the rest of the hypersparse matrix - if (by_col) - { - OK (GxB_Matrix_export_HyperCSC (&A, &type, &nrows, &ncols, - &Ap, &Ah, &Ai, &Ax, - &Ap_size, &Ah_size, &Ai_size, &Ax_size, &iso, - &nvec, NULL, NULL)) ; - } - else - { - OK (GxB_Matrix_export_HyperCSR (&A, &type, &nrows, &ncols, - &Ap, &Ah, &Ai, &Ax, - &Ap_size, &Ah_size, &Ai_size, &Ax_size, &iso, - &nvec, NULL, NULL)) ; - } - break ; - - case GxB_BITMAP : - if (by_col) - { - OK (GxB_Matrix_export_BitmapC (&A, &type, &nrows, &ncols, - &Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, NULL)) ; - } - else - { - OK (GxB_Matrix_export_BitmapR (&A, &type, &nrows, &ncols, - &Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, NULL)) ; - } - break ; - - default: ; + // remove Y from the Container and unload it; reusing the Container + Y = Container->Y ; + Container->Y = NULL ; + OK (GxB_unload_Matrix_into_Container (Y, Container, NULL)) ; + GrB_Matrix_free (&Y) ; + OK (GxB_Vector_unload (Container->p, &Yp, &Yp_type, &Yp_len, &Yp_size, + &ro, NULL)) ; + OK (GxB_Vector_unload (Container->i, &Yi, &Yi_type, &Yi_len, &Yi_size, + &ro, NULL)) ; + OK (GxB_Vector_unload (Container->x, &Yx, &Yx_type, &Yx_len, &Yx_size, + &ro, NULL)) ; + yncols = Container->ncols ; } - OK (GxB_Type_size (&type_size, type)) ; - //-------------------------------------------------------------------------- - // construct the output struct + // construct the output struct for MATLAB //-------------------------------------------------------------------------- mxArray *G ; @@ -244,20 +196,20 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G // export content into the output struct //-------------------------------------------------------------------------- - // export the GraphBLAS type as a string - mxSetFieldByNumber (G, 0, 0, gb_type_to_mxstring (type)) ; + // export the GraphBLAS Ax_type as a string + mxSetFieldByNumber (G, 0, 0, gb_type_to_mxstring (Ax_type)) ; // export the scalar content mxArray *opaque = mxCreateNumericMatrix (1, 10, mxINT64_CLASS, mxREAL) ; int64_t *s = (int64_t *) mxGetData (opaque) ; - s [0] = plen ; - s [1] = (by_col) ? nrows : ncols ; // was A->vlen ; - s [2] = (by_col) ? ncols : nrows ; // was A->vdim ; - s [3] = (sparsity_status == GxB_HYPERSPARSE) ? nvec : (s [2]) ; - s [4] = nvec_nonempty ; + s [0] = Ap_len - 1 ; // plen + s [1] = (by_col) ? nrows : ncols ; // vlen + s [2] = (by_col) ? ncols : nrows ; // vdim + s [3] = (sparsity_status == GxB_HYPERSPARSE) ? Ah_len : (s [2]) ; + s [4] = (by_col) ? ncols_nonempty : nrows_nonempty ; // nvec_nonempty s [5] = sparsity_control ; s [6] = (int64_t) by_col ; - s [7] = nzmax ; + s [7] = Ax_len ; s [8] = nvals ; s [9] = (int64_t) iso ; // new in GraphBLASv5 mxSetFieldByNumber (G, 0, 1, opaque) ; @@ -269,17 +221,21 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G if (sparsity_status == GxB_SPARSE || sparsity_status == GxB_HYPERSPARSE) { // export the pointers - mxArray *Ap_mx = mxCreateNumericMatrix (1, 0, mxINT64_CLASS, mxREAL) ; - mxSetN (Ap_mx, Ap_size / sizeof (int64_t)) ; + mxClassID Ap_class = (Ap_type == GrB_UINT32) ? + mxUINT32_CLASS : mxUINT64_CLASS ; + mxArray *Ap_mx = mxCreateNumericMatrix (1, 0, Ap_class, mxREAL) ; + mxSetN (Ap_mx, Ap_len) ; void *p = (void *) mxGetData (Ap_mx) ; gb_mxfree (&p) ; mxSetData (Ap_mx, Ap) ; mxSetFieldByNumber (G, 0, 3, Ap_mx) ; // export the indices - mxArray *Ai_mx = mxCreateNumericMatrix (1, 0, mxINT64_CLASS, mxREAL) ; + mxClassID Ai_class = (Ai_type == GrB_INT32 || Ai_type == GrB_UINT32) ? + mxUINT32_CLASS : mxUINT64_CLASS ; + mxArray *Ai_mx = mxCreateNumericMatrix (1, 0, Ai_class, mxREAL) ; if (Ai_size > 0) { - mxSetN (Ai_mx, Ai_size / sizeof (int64_t)) ; + mxSetN (Ai_mx, Ai_len) ; p = (void *) mxGetData (Ai_mx) ; gb_mxfree (&p) ; mxSetData (Ai_mx, Ai) ; } @@ -296,17 +252,16 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G } mxSetFieldByNumber (G, 0, 2, Ax_mx) ; + mxClassID Ah_class = (Ah_type == GrB_INT32 || Ah_type == GrB_UINT32) ? + mxUINT32_CLASS : mxUINT64_CLASS ; + if (sparsity_status == GxB_HYPERSPARSE) { // export the hyperlist - mxArray *Ah_mx = mxCreateNumericMatrix (1, 0, mxINT64_CLASS, mxREAL) ; - if (Ah_size > nvec * sizeof (int64_t)) - { - memset (Ah + nvec, 0, Ah_size - nvec * sizeof (int64_t)) ; - } + mxArray *Ah_mx = mxCreateNumericMatrix (1, 0, Ah_class, mxREAL) ; if (Ah_size > 0) { - mxSetN (Ah_mx, Ah_size / sizeof (int64_t)) ; + mxSetN (Ah_mx, Ah_len) ; void *p = (void *) mxGetData (Ah_mx) ; gb_mxfree (&p) ; mxSetData (Ah_mx, Ah) ; } @@ -315,26 +270,23 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G if (Yp != NULL) { - // export Yp, of size yvdim+1 - mxArray *Yp_mx = mxCreateNumericMatrix (1, 0, mxUINT64_CLASS, - mxREAL) ; - mxSetN (Yp_mx, yvdim+1) ; + // export Yp, of size yncols+1 + mxArray *Yp_mx = mxCreateNumericMatrix (1, 0, Ah_class, mxREAL) ; + mxSetN (Yp_mx, yncols+1) ; void *p = (void *) mxGetData (Yp_mx) ; gb_mxfree (&p) ; mxSetData (Yp_mx, Yp) ; mxSetFieldByNumber (G, 0, 6, Yp_mx) ; - // export Yi, of size nvec - mxArray *Yi_mx = mxCreateNumericMatrix (1, 0, mxUINT64_CLASS, - mxREAL) ; - mxSetN (Yi_mx, nvec) ; + // export Yi, of size Ah_len + mxArray *Yi_mx = mxCreateNumericMatrix (1, 0, Ah_class, mxREAL) ; + mxSetN (Yi_mx, Ah_len) ; p = (void *) mxGetData (Yi_mx) ; gb_mxfree (&p) ; mxSetData (Yi_mx, Yi) ; mxSetFieldByNumber (G, 0, 7, Yi_mx) ; - // export Yx, of size nvec - mxArray *Yx_mx = mxCreateNumericMatrix (1, 0, mxUINT64_CLASS, - mxREAL) ; - mxSetN (Yx_mx, nvec) ; + // export Yx, of size Ah_len + mxArray *Yx_mx = mxCreateNumericMatrix (1, 0, Ah_class, mxREAL) ; + mxSetN (Yx_mx, Ah_len) ; p = (void *) mxGetData (Yx_mx) ; gb_mxfree (&p) ; mxSetData (Yx_mx, Yx) ; mxSetFieldByNumber (G, 0, 8, Yx_mx) ; @@ -347,7 +299,7 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G mxArray *Ab_mx = mxCreateNumericMatrix (1, 0, mxINT8_CLASS, mxREAL) ; if (Ab_size > 0) { - mxSetN (Ab_mx, Ab_size) ; + mxSetN (Ab_mx, Ab_len) ; void *p = (void *) mxGetData (Ab_mx) ; gb_mxfree (&p) ; mxSetData (Ab_mx, Ab) ; } @@ -355,7 +307,7 @@ mxArray *gb_export_to_mxstruct // return exported built-in struct G } //-------------------------------------------------------------------------- - // return the built-in struct + // return the built-in MATLAB struct containing the GrB_Matrix components //-------------------------------------------------------------------------- return (G) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_find_dot.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_find_dot.c index 6bf2dfead7..19117b55cb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_find_dot.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_find_dot.c @@ -2,7 +2,7 @@ // gb_find_dot: find the first two occurences of '.' in a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_first_binop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_first_binop.c index cf3536a2bb..fe853087cb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_first_binop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_first_binop.c @@ -2,7 +2,7 @@ // gb_first_binop: return the GrB_FIRST operator for a given type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_flush.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_flush.c index f6db1be43e..fb68262edb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_flush.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_flush.c @@ -2,7 +2,7 @@ // gb_flush: flush mexPrintf output to Command Window //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_deep.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_deep.c index c80e991aac..2a2e5259a3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_deep.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_deep.c @@ -2,7 +2,7 @@ // gb_get_deep: create a deep GrB_Matrix copy of a built-in X //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Matrix gb_get_deep // return a deep GrB_Matrix copy of a built-in X { GrB_Matrix S = gb_get_shallow (X) ; - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (S, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (S, &fmt, GxB_FORMAT)) ; GrB_Matrix A = gb_typecast (S, NULL, fmt, 0) ; OK (GrB_Matrix_free (&S)) ; return (A) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_format.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_format.c index 24e57c22e1..b7c874fed9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_format.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_format.c @@ -2,7 +2,7 @@ // gb_get_format: determine the format of a matrix result //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,17 +31,17 @@ #include "gb_interface.h" -GxB_Format_Value gb_get_format // GxB_BY_ROW or GxB_BY_COL +int gb_get_format // GxB_BY_ROW or GxB_BY_COL ( - GrB_Index cnrows, // C is cnrows-by-cncols + GrB_Index cnrows, // C is cnrows-by-cncols GrB_Index cncols, - GrB_Matrix A, // may be NULL - GrB_Matrix B, // may be NULL - GxB_Format_Value fmt_descriptor // may be GxB_NO_FORMAT + GrB_Matrix A, // may be NULL + GrB_Matrix B, // may be NULL + int fmt_descriptor // may be GxB_NO_FORMAT ) { - GxB_Format_Value fmt ; + int fmt ; if (fmt_descriptor != GxB_NO_FORMAT) { @@ -61,17 +61,17 @@ GxB_Format_Value gb_get_format // GxB_BY_ROW or GxB_BY_COL else if (A != NULL && !gb_is_vector (A)) { // (4) get the format of A - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; } else if (B != NULL && !gb_is_vector (B)) { // (5) get the format of B - OK (GxB_Matrix_Option_get (B, GxB_FORMAT, &fmt)) ; + OK (GrB_Matrix_get_INT32 (B, &fmt, GxB_FORMAT)) ; } else { // (6) get the global default format - OK (GxB_Global_Option_get (GxB_FORMAT, &fmt)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &fmt, GxB_FORMAT)) ; } return (fmt) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_mxargs.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_mxargs.c index 12c672c8ed..b6f95d9a17 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_mxargs.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_mxargs.c @@ -2,7 +2,7 @@ // gb_get_mxargs: get input arguments to a GraphBLAS mexFunction //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,7 +33,7 @@ void gb_get_mxargs GrB_Descriptor *desc, // last argument is always the descriptor base_enum_t *base, // desc.base kind_enum_t *kind, // desc.kind - GxB_Format_Value *fmt, // desc.format : by row or by col + int *fmt, // desc.format : by row or by col int *sparsity // desc.format : hypersparse/sparse/bitmap/full // or 0 if not in the descriptor ) diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c index 96d8ca6c60..4a1486ae9d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_shallow.c @@ -1,15 +1,15 @@ //------------------------------------------------------------------------------ -// gb_get_shallow: create a shallow copy of a built-in sparse matrix +// gb_get_shallow: create a shallow copy of a MATLAB sparse matrix or struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// A = gb_get_shallow (X) constructs a shallow GrB_Matrix from a built-in -// mxArray, which can either be a built-in sparse matrix (double, complex, or -// logical) or a built-in struct that contains a GraphBLAS matrix. +// A = gb_get_shallow (X) constructs a shallow GrB_Matrix from a MATLAB +// mxArray, which can either be a MATLAB sparse matrix (double, complex, or +// logical) or a MATLAB struct that contains a GraphBLAS matrix. // X must not be NULL, but it can be an empty matrix, as X = [ ] or even X = '' // (the empty string). In this case, A is returned as NULL. This is not an @@ -20,17 +20,20 @@ // For v5, iso is present but false, and the s component has length 10. // For v5_1, iso is true/false, and the s component has length 10. // For v7_3: the same content as v5_1, except that Yp, Yi, and Yx are added. +// For v10: Ap, Ah, Ai, Yp, Yi, and Yx can be 32-bit or 64-bit // mxGetData is used instead of the MATLAB-recommended mxGetDoubles, etc, // because mxGetData works best for Octave, and it works fine for MATLAB // since GraphBLAS requires R2018a with the interleaved complex data type. +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" #define IF(error,message) \ CHECK_ERROR (error, "invalid GraphBLAS struct (" message ")" ) ; -GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix +GrB_Matrix gb_get_shallow // shallow copy of MATLAB sparse matrix or struct ( const mxArray *X ) @@ -42,6 +45,14 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix CHECK_ERROR (X == NULL, "matrix missing") ; + //-------------------------------------------------------------------------- + // turn off the burble + //-------------------------------------------------------------------------- + + int burble ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &burble, GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; + //-------------------------------------------------------------------------- // construct the shallow GrB_Matrix //-------------------------------------------------------------------------- @@ -55,7 +66,7 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix // matrix is empty //---------------------------------------------------------------------- - // X is a 0-by-0 built-in matrix. Create a new 0-by-0 matrix of the + // X is a 0-by-0 MATLAB-in matrix. Create a new 0-by-0 matrix of the // same type as X, with the default format. OK (GrB_Matrix_new (&A, gb_mxarray_type (X), 0, 0)) ; @@ -64,19 +75,25 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix { //---------------------------------------------------------------------- - // construct a shallow GrB_Matrix copy from a built-in struct + // construct a shallow GrB_Matrix copy from a MATLAB struct //---------------------------------------------------------------------- bool GraphBLASv4 = false ; bool GraphBLASv3 = false ; // get the type - mxArray *mx_type = mxGetField (X, 0, "GraphBLASv7_3") ; + mxArray *mx_type = mxGetField (X, 0, "GraphBLASv10") ; + if (mx_type == NULL) + { + // check if it is a GraphBLASv7_3 struct + mx_type = mxGetField (X, 0, "GraphBLASv7_3") ; + } if (mx_type == NULL) { // check if it is a GraphBLASv5_1 struct mx_type = mxGetField (X, 0, "GraphBLASv5_1") ; } + if (mx_type == NULL) { // check if it is a GraphBLASv5 struct @@ -96,9 +113,9 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix } CHECK_ERROR (mx_type == NULL, "not a GraphBLAS struct") ; - GrB_Type type = gb_mxstring_to_type (mx_type) ; + GrB_Type Ax_type = gb_mxstring_to_type (mx_type) ; size_t type_size ; - OK (GxB_Type_size (&type_size, type)) ; + OK (GrB_Type_get_SIZE (Ax_type, &type_size, GrB_SIZE)) ; // get the scalar info mxArray *opaque = mxGetField (X, 0, "s") ; @@ -129,6 +146,7 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix int sparsity_status, sparsity_control ; int64_t nvals ; bool iso ; + if (GraphBLASv3) { // GraphBLASv3 struct: sparse or hypersparse only @@ -138,7 +156,7 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix } else { - // GraphBLASv4 or v5 struct: sparse, hypersparse, bitmap, or full + // GraphBLASv4 or later struct: sparse, hypersparse, bitmap, or full sparsity_control = (int) (s [5]) ; nvals = s [8] ; if (GraphBLASv4) @@ -172,6 +190,10 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix // A is hypersparse, with 6 fields: GraphBLAS*, s, x, p, i, h // or with 9 fields: Yp, Yi, and Yx added. sparsity_status = GxB_HYPERSPARSE ; + // GraphBLAS v9 and earlier can export a matrix to the MATLAB + // struct with plen of 1 but nvec of 0. Fix it here for v9 and + // earlier structs, and also in gb_export_to_mxstruct for v10: + plen = nvec ; break ; case 4 : @@ -183,15 +205,26 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix } // each component - uint64_t *Ap = NULL ; size_t Ap_size = 0 ; - uint64_t *Ah = NULL ; size_t Ah_size = 0 ; - int8_t *Ab = NULL ; size_t Ab_size = 0 ; - uint64_t *Ai = NULL ; size_t Ai_size = 0 ; - void *Ax = NULL ; size_t Ax_size = 0 ; - uint64_t *Yp = NULL ; size_t Yp_size = 0 ; - uint64_t *Yi = NULL ; size_t Yi_size = 0 ; - void *Yx = NULL ; size_t Yx_size = 0 ; - int64_t yvdim = 0 ; + void *Ap = NULL ; uint64_t Ap_size = 0 ; + void *Ah = NULL ; uint64_t Ah_size = 0 ; + void *Ai = NULL ; uint64_t Ai_size = 0 ; + int8_t *Ab = NULL ; uint64_t Ab_size = 0, Ab_len = 0 ; + void *Ax = NULL ; uint64_t Ax_size = 0, Ax_len = 0 ; + void *Yp = NULL ; uint64_t Yp_size = 0, Yp_len = 0 ; + void *Yi = NULL ; uint64_t Yi_size = 0, Yi_len = 0 ; + void *Yx = NULL ; uint64_t Yx_size = 0, Yx_len = 0 ; + int64_t yvdim = 0 ; + + // these are revised below: + bool Ap_is_32 = false ; // controls Ap + bool Aj_is_32 = false ; // controls Ah, Yp, Yi, Yx + bool Ai_is_32 = false ; // controls Ai + size_t psize = Ap_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = Aj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = Ai_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + GrB_Type Ap_type = Ap_is_32 ? GrB_UINT32 : GrB_UINT64 ; + GrB_Type Aj_type = Aj_is_32 ? GrB_UINT32 : GrB_UINT64 ; + GrB_Type Ai_type = Ai_is_32 ? GrB_UINT32 : GrB_UINT64 ; if (sparsity_status == GxB_HYPERSPARSE || sparsity_status == GxB_SPARSE) { @@ -201,15 +234,34 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix mxArray *Ap_mx = mxGetField (X, 0, "p") ; IF (Ap_mx == NULL, ".p missing") ; IF (mxGetM (Ap_mx) != 1, ".p wrong size") ; - Ap = (int64_t *) mxGetData (Ap_mx) ; - Ap_size = mxGetN (Ap_mx) * sizeof (int64_t) ; + mxClassID class = mxGetClassID (Ap_mx) ; + IF (!(class == mxUINT64_CLASS || class == mxUINT32_CLASS || + class == mxINT64_CLASS), ".p wrong class") + Ap_is_32 = (class == mxUINT32_CLASS) ; + psize = Ap_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + Ap_type = Ap_is_32 ? GrB_UINT32 : GrB_UINT64 ; + Ap = (void *) mxGetData (Ap_mx) ; + Ap_size = mxGetN (Ap_mx) * psize ; + IF (mxGetN (Ap_mx) < plen+1, ".p wrong size") + if (GraphBLASv3) + { + uint64_t *Ap64 = (uint64_t *) Ap ; + nvals = Ap64 [plen] ; + } // get Ai mxArray *Ai_mx = mxGetField (X, 0, "i") ; IF (Ai_mx == NULL, ".i missing") ; IF (mxGetM (Ai_mx) != 1, ".i wrong size") ; - Ai_size = mxGetN (Ai_mx) * sizeof (int64_t) ; - Ai = (Ai_size == 0) ? NULL : ((int64_t *) mxGetData (Ai_mx)) ; + class = mxGetClassID (Ai_mx) ; + IF (!(class == mxUINT64_CLASS || class == mxUINT32_CLASS || + class == mxINT64_CLASS), ".i wrong class") + Ai_is_32 = (class == mxUINT32_CLASS) ; + isize = Ai_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + Ai_type = Ai_is_32 ? GrB_UINT32 : GrB_UINT64 ; + Ai_size = mxGetN (Ai_mx) * isize ; + IF (mxGetN (Ai_mx) < nvals, ".i wrong size") ; + Ai = (Ai_size == 0) ? NULL : ((void *) mxGetData (Ai_mx)) ; } // get the values @@ -217,46 +269,67 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix IF (Ax_mx == NULL, ".x missing") ; IF (mxGetM (Ax_mx) != 1, ".x wrong size") ; Ax_size = mxGetN (Ax_mx) ; + Ax_len = Ax_size / type_size ; Ax = (Ax_size == 0) ? NULL : ((void *) mxGetData (Ax_mx)) ; - if (sparsity_status == GxB_HYPERSPARSE) + if (sparsity_status == GxB_SPARSE) + { + // A is sparse; determine Aj_is_32 + Aj_is_32 = (vdim <= ((int64_t) (1ULL << 31))) ; + Aj_type = Aj_is_32 ? GrB_UINT32 : GrB_UINT64 ; + jsize = Aj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + } + else if (sparsity_status == GxB_HYPERSPARSE) { // A is hypersparse // get the hyperlist mxArray *Ah_mx = mxGetField (X, 0, "h") ; IF (Ah_mx == NULL, ".h missing") ; IF (mxGetM (Ah_mx) != 1, ".h wrong size") ; - Ah_size = mxGetN (Ah_mx) * sizeof (uint64_t) ; - Ah = (Ah_size == 0) ? NULL : ((uint64_t *) mxGetData (Ah_mx)) ; + mxClassID Ah_class = mxGetClassID (Ah_mx) ; + IF (!(Ah_class == mxUINT64_CLASS || Ah_class == mxUINT32_CLASS || + Ah_class == mxINT64_CLASS), ".h wrong class") + Aj_is_32 = (Ah_class == mxUINT32_CLASS) ; + Aj_type = Aj_is_32 ? GrB_UINT32 : GrB_UINT64 ; + jsize = Aj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + Ah_size = mxGetN (Ah_mx) * jsize ; + Ah = (Ah_size == 0) ? NULL : ((void *) mxGetData (Ah_mx)) ; - // get the A->Y hyper_hash, if it exists + // get the hyper_hash, if it exists if (nfields == 9) - { + { // get Yp, Yi, and Yx - // Yp must be 1-by-(yvdim+1) + // Yp must be 1-by-(yvdim+1), with the same class as Ah mxArray *Yp_mx = mxGetField (X, 0, "Yp") ; IF (Yp_mx == NULL, ".Yp missing") ; IF (mxGetM (Yp_mx) != 1, ".Yp wrong size") ; yvdim = mxGetN (Yp_mx) - 1 ; - Yp_size = mxGetN (Yp_mx) * sizeof (uint64_t) ; - Yp = (Yp_size == 0) ? NULL : ((uint64_t *) mxGetData (Yp_mx)) ; + IF (mxGetClassID (Yp_mx) != Ah_class, ".Yp wrong class") ; + Yp_len = mxGetN (Yp_mx) ; + Yp_size = Yp_len * jsize ; + Yp = (Yp_size == 0) ? NULL : ((void *) mxGetData (Yp_mx)) ; - // Yi must be 1-by-nvec + // Yi must be 1-by-nvec, with the same class as Ah mxArray *Yi_mx = mxGetField (X, 0, "Yi") ; IF (Yi_mx == NULL, ".Yi missing") ; IF (mxGetM (Yi_mx) != 1, ".Yi wrong size") ; IF (mxGetN (Yi_mx) != nvec, ".Yi wrong size") ; - Yi_size = mxGetN (Yi_mx) * sizeof (uint64_t) ; - Yi = (Yi_size == 0) ? NULL : ((uint64_t *) mxGetData (Yi_mx)) ; + IF (mxGetClassID (Yi_mx) != Ah_class, ".Yi wrong class") ; + Yi_len = mxGetN (Yi_mx) ; + Yi_size = Yi_len * jsize ; + Yi = (Yi_size == 0) ? NULL : ((void *) mxGetData (Yi_mx)) ; // Yx must be 1-by-nvec mxArray *Yx_mx = mxGetField (X, 0, "Yx") ; IF (Yx_mx == NULL, ".Yx missing") ; IF (mxGetM (Yx_mx) != 1, ".Yx wrong size") ; IF (mxGetN (Yx_mx) != nvec, ".Yx wrong size") ; - Yx_size = mxGetN (Yx_mx) * sizeof (int64_t) ; + IF (mxGetClassID (Yx_mx) != Ah_class, ".Yx wrong class") ; + Yx_len = mxGetN (Yx_mx) ; + Yx_size = Yi_len * jsize ; Yx = (Yx_size == 0) ? NULL : ((void *) mxGetData (Yx_mx)) ; } } @@ -268,7 +341,9 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix mxArray *Ab_mx = mxGetField (X, 0, "b") ; IF (Ab_mx == NULL, ".b missing") ; IF (mxGetM (Ab_mx) != 1, ".b wrong size") ; - Ab_size = mxGetN (Ab_mx) ; + IF (mxGetClassID (Ab_mx) != mxINT8_CLASS, ".Ab wrong class") ; + Ab_len = mxGetN (Ab_mx) ; + Ab_size = Ab_len ; Ab = (Ab_size == 0) ? NULL : ((int8_t *) mxGetData (Ab_mx)) ; } @@ -276,141 +351,122 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix // import the matrix //---------------------------------------------------------------------- - int64_t nrows = (by_col) ? vlen : vdim ; - int64_t ncols = (by_col) ? vdim : vlen ; - OK (GrB_Matrix_new (&A, type, nrows, ncols)) ; + OK (GrB_Matrix_new (&A, GrB_BOOL, 0, 0)) ; + + GxB_Container Container = GB_helper_container ( ) ; + + if (Yp != NULL) + { + // import the Y matrix using the Container + OK (GrB_Matrix_new (&Y, GrB_UINT64, 0, 0)) ; + Container->nrows = vdim ; + Container->ncols = yvdim ; + Container->nrows_nonempty = -1 ; + Container->ncols_nonempty = -1 ; + Container->nvals = nvec ; + Container->format = GxB_SPARSE ; + Container->orientation = GrB_COLMAJOR ; + Container->iso = false ; + Container->jumbled = false ; + OK (GxB_Vector_load (Container->p, (void **) &Yp, Aj_type, Yp_len, + Yp_size, GxB_IS_READONLY, NULL)) ; + OK (GxB_Vector_load (Container->i, (void **) &Yi, Aj_type, Yi_len, + Yi_size, GxB_IS_READONLY, NULL)) ; + OK (GxB_Vector_load (Container->x, (void **) &Yx, Aj_type, nvec, + Yx_size, GxB_IS_READONLY, NULL)) ; + OK (GxB_load_Matrix_from_Container (Y, Container, NULL)) ; + } + + // import the A matrix using the Container + Container->nrows = (by_col) ? vlen : vdim ; + Container->ncols = (by_col) ? vdim : vlen ; + Container->nrows_nonempty = (by_col) ? -1 : nvec_nonempty ; + Container->ncols_nonempty = (by_col) ? nvec_nonempty : -1 ; + Container->nvals = nvals ; + Container->format = sparsity_status ; + Container->orientation = (by_col) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + Container->iso = iso ; + Container->jumbled = false ; switch (sparsity_status) { - case GxB_FULL : - if (by_col) - { - OK (GxB_Matrix_pack_FullC (A, - &Ax, Ax_size, iso, NULL)) ; - } - else - { - OK (GxB_Matrix_pack_FullR (A, - &Ax, Ax_size, iso, NULL)) ; - } - break ; - - case GxB_SPARSE : - if (by_col) - { - OK (GxB_Matrix_pack_CSC (A, - &Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, iso, - false, NULL)) ; - } - else - { - OK (GxB_Matrix_pack_CSR (A, - &Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, iso, - false, NULL)) ; - } + case GxB_HYPERSPARSE : + Container->Y = Y ; + Y = NULL ; + OK (GxB_Vector_load (Container->h, (void **) &Ah, Aj_type, + plen, Ah_size, GxB_IS_READONLY, NULL)) ; + // fall through to sparse case + + case GxB_SPARSE : + OK (GxB_Vector_load (Container->p, (void **) &Ap, Ap_type, + plen+1, Ap_size, GxB_IS_READONLY, NULL)) ; + OK (GxB_Vector_load (Container->i, (void **) &Ai, Ai_type, + nvals, Ai_size, GxB_IS_READONLY, NULL)) ; break ; - case GxB_HYPERSPARSE : - if (by_col) - { - OK (GxB_Matrix_pack_HyperCSC (A, - &Ap, &Ah, &Ai, &Ax, - Ap_size, Ah_size, Ai_size, Ax_size, iso, - nvec, false, NULL)) ; - } - else - { - OK (GxB_Matrix_pack_HyperCSR (A, - &Ap, &Ah, &Ai, &Ax, - Ap_size, Ah_size, Ai_size, Ax_size, iso, - nvec, false, NULL)) ; - } + case GxB_BITMAP : + OK (GxB_Vector_load (Container->b, (void **) &Ab, GrB_INT8, + Ab_len, Ab_size, GxB_IS_READONLY, NULL)) ; break ; - case GxB_BITMAP : - if (by_col) - { - OK (GxB_Matrix_pack_BitmapC (A, - &Ab, &Ax, Ab_size, Ax_size, iso, nvals, NULL)) ; - } - else - { - OK (GxB_Matrix_pack_BitmapR (A, - &Ab, &Ax, Ab_size, Ax_size, iso, nvals, NULL)) ; - } + case GxB_FULL : break ; default: ; } - //---------------------------------------------------------------------- - // import the A->Y hyper_hash, if it exists - //---------------------------------------------------------------------- + OK (GxB_Vector_load (Container->x, (void **) &Ax, Ax_type, Ax_len, + Ax_size, GxB_IS_READONLY, NULL)) ; - if (nfields == 9) - { - // A->Y is sparse, uint64, (A->vdim)-by-yvdim, held by column - OK (GrB_Matrix_new (&Y, GrB_UINT64, vdim, yvdim)) ; - OK (GxB_Matrix_Option_set (Y, GxB_FORMAT, GxB_BY_COL)) ; - OK (GxB_Matrix_pack_CSC (Y, - &Yp, &Yi, &Yx, Yp_size, Yi_size, Yx_size, false, - false, NULL)) ; - OK (GxB_Matrix_Option_set (Y, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - OK (GxB_pack_HyperHash (A, &Y, NULL)) ; - } - - // tell GraphBLAS the matrix is shallow - GB_make_shallow (A) ; + OK (GxB_load_Matrix_from_Container (A, Container, NULL)) ; } else { //---------------------------------------------------------------------- - // construct a shallow GrB_Matrix copy of a built-in matrix + // construct a shallow GrB_Matrix copy of a built-in MATLAB matrix //---------------------------------------------------------------------- // get the type and dimensions bool X_is_sparse = mxIsSparse (X) ; - - GrB_Type type = gb_mxarray_type (X) ; - GrB_Index nrows = (GrB_Index) mxGetM (X) ; - GrB_Index ncols = (GrB_Index) mxGetN (X) ; - OK (GrB_Matrix_new (&A, type, nrows, ncols)) ; - - // get Xp, Xi, nzmax, or create them - GrB_Index *Xp, *Xi, nzmax ; + GrB_Type Ax_type = gb_mxarray_type (X) ; + uint64_t nrows = (uint64_t) mxGetM (X) ; + uint64_t ncols = (uint64_t) mxGetN (X) ; + uint64_t nvals ; + OK (GrB_Matrix_new (&A, Ax_type, nrows, ncols)) ; + + // get Xp, Xi, and nvals + uint64_t *Xp, *Xi ; if (X_is_sparse) { - // get the nzmax, Xp, and Xi from the built-in sparse matrix X - nzmax = (GrB_Index) mxGetNzmax (X) ; - Xp = (GrB_Index *) mxGetJc (X) ; - Xi = (GrB_Index *) mxGetIr (X) ; + Xp = (uint64_t *) mxGetJc (X) ; + Xi = (uint64_t *) mxGetIr (X) ; + nvals = Xp [ncols] ; } else { - // X is a built-in full matrix; so is the GrB_Matrix - nzmax = nrows * ncols ; Xp = NULL ; Xi = NULL ; + nvals = nrows * ncols ; } // get the numeric data void *Xx = NULL ; size_t type_size = 0 ; - if (type == GrB_FP64) + if (Ax_type == GrB_FP64) { // built-in sparse or full double matrix Xx = mxGetData (X) ; type_size = sizeof (double) ; } - else if (type == GxB_FC64) + else if (Ax_type == GxB_FC64) { // built-in sparse or full double complex matrix Xx = mxGetData (X) ; type_size = 2 * sizeof (double) ; } - else if (type == GrB_BOOL) + else if (Ax_type == GrB_BOOL) { // built-in sparse or full logical matrix Xx = mxGetData (X) ; @@ -421,61 +477,61 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix // Built-in sparse matrices do not support any other kinds ERROR ("unsupported type") ; } - else if (type == GrB_INT8) + else if (Ax_type == GrB_INT8) { // full int8 matrix Xx = mxGetData (X) ; type_size = sizeof (int8_t) ; } - else if (type == GrB_INT16) + else if (Ax_type == GrB_INT16) { // full int16 matrix Xx = mxGetData (X) ; type_size = sizeof (int16_t) ; } - else if (type == GrB_INT32) + else if (Ax_type == GrB_INT32) { // full int32 matrix Xx = mxGetData (X) ; type_size = sizeof (int32_t) ; } - else if (type == GrB_INT64) + else if (Ax_type == GrB_INT64) { // full int64 matrix Xx = mxGetData (X) ; type_size = sizeof (int64_t) ; } - else if (type == GrB_UINT8) + else if (Ax_type == GrB_UINT8) { // full uint8 matrix Xx = mxGetData (X) ; type_size = sizeof (uint8_t) ; } - else if (type == GrB_UINT16) + else if (Ax_type == GrB_UINT16) { // full uint16 matrix Xx = mxGetData (X) ; type_size = sizeof (uint16_t) ; } - else if (type == GrB_UINT32) + else if (Ax_type == GrB_UINT32) { // full uint32 matrix Xx = mxGetData (X) ; type_size = sizeof (uint32_t) ; } - else if (type == GrB_UINT64) + else if (Ax_type == GrB_UINT64) { // full uint64 matrix Xx = mxGetData (X) ; type_size = sizeof (uint64_t) ; } - else if (type == GrB_FP32) + else if (Ax_type == GrB_FP32) { // full single matrix Xx = mxGetData (X) ; type_size = sizeof (float) ; } - else if (type == GxB_FC32) + else if (Ax_type == GxB_FC32) { // full single complex matrix Xx = mxGetData (X) ; @@ -486,31 +542,46 @@ GrB_Matrix gb_get_shallow // return a shallow copy of built-in sparse matrix ERROR ("unsupported type") ; } + uint64_t Xx_size = (nvals) * type_size ; + + GxB_Container Container = GB_helper_container ( ) ; + Container->nrows = nrows ; + Container->ncols = ncols ; + Container->nvals = nvals ; + Container->nrows_nonempty = -1 ; + Container->ncols_nonempty = -1 ; + Container->orientation = GrB_COLMAJOR ; + Container->iso = false ; + Container->jumbled = false ; + if (X_is_sparse) { - // import the matrix in CSC format. This sets Xp, Xi, and Xx to - // NULL, but it does not change the built-in matrix they came from. - OK (GxB_Matrix_pack_CSC (A, - &Xp, &Xi, &Xx, - (ncols+1) * sizeof (int64_t), - nzmax * sizeof (int64_t), - nzmax * type_size, false, false, NULL)) ; + // import the matrix in CSC format (all-64-bit) + uint64_t Xp_size = (ncols + 1) * sizeof (uint64_t) ; + uint64_t Xi_size = (nvals) * sizeof (uint64_t) ; + OK (GxB_Vector_load (Container->p, (void **) &Xp, GrB_UINT64, + ncols+1, Xp_size, GxB_IS_READONLY, NULL)) ; + OK (GxB_Vector_load (Container->i, (void **) &Xi, GrB_UINT64, + nvals, Xi_size, GxB_IS_READONLY, NULL)) ; + Container->format = GxB_SPARSE ; } else { // import a full matrix - OK (GxB_Matrix_pack_FullC (A, - &Xx, nzmax * type_size, false, NULL)) ; + Container->format = GxB_FULL ; } - // tell GraphBLAS the matrix is shallow - GB_make_shallow (A) ; + OK (GxB_Vector_load (Container->x, (void **) &Xx, Ax_type, nvals, + Xx_size, GxB_IS_READONLY, NULL)) ; + + OK (GxB_load_Matrix_from_Container (A, Container, NULL)) ; } //-------------------------------------------------------------------------- - // return the result + // restore the burble and return result //-------------------------------------------------------------------------- + OK (GrB_Global_set_INT32 (GrB_GLOBAL, burble, GxB_BURBLE)) ; return (A) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_sparsity.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_sparsity.c index c8fc4d69f2..acb0b1de3a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_sparsity.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_get_sparsity.c @@ -2,7 +2,7 @@ // gb_get_sparsity: determine the sparsity of a matrix result //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,18 +28,18 @@ #include "gb_interface.h" -GxB_Format_Value gb_get_sparsity // 0 to 15 +int gb_get_sparsity // 0 to 15 ( - GrB_Matrix A, // may be NULL - GrB_Matrix B, // may be NULL - int sparsity_default // may be 0 + GrB_Matrix A, // may be NULL + GrB_Matrix B, // may be NULL + int sparsity_default // may be 0 ) { int sparsity ; int A_sparsity = 0 ; int B_sparsity = 0 ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; //-------------------------------------------------------------------------- // get the sparsity of the matrices A and B @@ -52,7 +52,7 @@ GxB_Format_Value gb_get_sparsity // 0 to 15 if (nrows > 1 || ncols > 1) { // A is a vector or matrix, not a scalar - OK (GxB_Matrix_Option_get (A, GxB_SPARSITY_CONTROL, &A_sparsity)) ; + OK (GrB_Matrix_get_INT32 (A, &A_sparsity, GxB_SPARSITY_CONTROL)) ; } } @@ -63,7 +63,7 @@ GxB_Format_Value gb_get_sparsity // 0 to 15 if (nrows > 1 || ncols > 1) { // B is a vector or matrix, not a scalar - OK (GxB_Matrix_Option_get (B, GxB_SPARSITY_CONTROL, &B_sparsity)) ; + OK (GrB_Matrix_get_INT32 (B, &B_sparsity, GxB_SPARSITY_CONTROL)) ; } } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_interface.h b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_interface.h index b51219bdd2..385071b7bb 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_interface.h +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_interface.h @@ -1,19 +1,23 @@ //------------------------------------------------------------------------------ -// gb_interface.h: definitions the SuiteSparse:GraphBLAS interface +// gb_interface.h: the SuiteSparse:GraphBLAS MATLAB/Octave interface //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // This interface depends heavily on internal details of the -// SuiteSparse:GraphBLAS library. Thus, GB.h is #include'd, not just -// GraphBLAS.h. +// SuiteSparse:GraphBLAS library. Thus, GB.h is #include'd (via GB_helper.h), +// not just GraphBLAS.h. + +// The gb_wrapup function accesses GB_methods inside GraphBLAS. #ifndef GB_INTERFACE_H #define GB_INTERFACE_H +#define NHISTORICAL +#include "GraphBLAS.h" #include "GB_helper.h" #include "mex.h" #include @@ -28,31 +32,31 @@ extern int64_t gbcov [GBCOV_MAX] ; extern int gbcov_max ; void gbcov_get (void) ; void gbcov_put (void) ; -#define GB_COV_PUT gbcov_put ( ) +#define GBCOV_PUT gbcov_put ( ) #else -#define GB_COV_PUT +#define GBCOV_PUT #endif -#define GB_WRAPUP \ -{ \ - GB_COV_PUT ; \ - if (GB_Global_memtable_n ( ) != 0) \ - { \ - printf ("GrB memory leak!\n") ; \ - GB_Global_memtable_dump ( ) ; \ - mexErrMsgIdAndTxt ("GrB:error", "memory leak") ; \ - } \ +static inline void gb_wrapup (void) +{ + GBCOV_PUT ; + if (GB_Global_memtable_n ( ) != 0) + { + printf ("GrB memory leak!\n") ; + GB_Global_memtable_dump ( ) ; + mexErrMsgIdAndTxt ("GrB:error", "memory leak") ; + } } #define ERROR2(message, arg) \ { \ - GB_COV_PUT ; \ + GBCOV_PUT ; \ mexErrMsgIdAndTxt ("GrB:error", message, arg) ; \ } #define ERROR(message) \ { \ - GB_COV_PUT ; \ + GBCOV_PUT ; \ mexErrMsgIdAndTxt ("GrB:error", message) ; \ } @@ -60,25 +64,26 @@ void gbcov_put (void) ; #define OK(method) \ { \ - GrB_Info info = method ; \ - if (info != GrB_SUCCESS) \ + GrB_Info this_info = method ; \ + if (this_info != GrB_SUCCESS) \ { \ - ERROR (gb_error (info)) ; \ + ERROR (gb_error_string (this_info)) ; \ } \ } -#define OK0(method) \ -{ \ - GrB_Info info = method ; \ - if (!(info == GrB_SUCCESS || info == GrB_NO_VALUE)) \ - { \ - ERROR (gb_error (info)) ; \ - } \ +#define OK0(method) \ +{ \ + GrB_Info this_info = method ; \ + if (!(this_info == GrB_SUCCESS || this_info == GrB_NO_VALUE)) \ + { \ + ERROR (gb_error_string (this_info)) ; \ + } \ } #define OK1(C,method) \ { \ - if ((method) != GrB_SUCCESS) \ + GrB_Info this_info = method ; \ + if (this_info != GrB_SUCCESS) \ { \ const char *message ; \ GrB_Matrix_error (&message, C) ; \ @@ -94,6 +99,8 @@ void gbcov_put (void) ; #define MATCH(s,t) (strcmp(s,t) == 0) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define ABS(x) (((x) >= 0) ? (x) : (-(x))) // largest integer representable as a double #define FLINTMAX (((int64_t) 1) << 53) @@ -126,23 +133,24 @@ kind_enum_t ; // // desc.base can be one of several strings: // -// 'default' the default is used -// 'zero-based' the type is always int64 -// 'one-based' the type is inferred from the inputs I and J -// 'one-based int' the type is int64, and one-based +// 'default' the default is used (one-based int) +// 'zero-based' zero-based uint32/uint64 +// 'zero-based int' zero-based uint32/uint64 +// 'one-based' one-based uint32/uint64 +// 'one-based int' one-based uint32/uint64 // 'one-based double' the type is double, and one-based +// 'double' the type is double, and one-based // // Note that there is no option for zero-based double. typedef enum // type of indices { - BASE_DEFAULT = 0, // The type is determined automatically. It is - // BASE_1_DOUBLE, unless the dimensions are - // too big for a flint (max(size(A)) > flintmax). In - // that case, BASE_1_INT64 is used. - BASE_0_INT64 = 1, // indices are returned as zero-based int64 values - BASE_1_INT64 = 2, // indices are returned as one-based int64 - BASE_1_DOUBLE = 3 // this is the typical default: one-based double + BASE_DEFAULT = 0, // one-based integers (int32/int64) + BASE_0_INT = 1, // indices are returned as zero-based int32/int64 + BASE_1_INT = 2, // indices are returned as one-based int32/int64 + BASE_1_DOUBLE = 3 // one-based double, unless the dimensions are too big + // for a flint (max(size(A)) > flintmax). In that + // case, BASE_1_INT is used. } base_enum_t ; @@ -171,6 +179,21 @@ GrB_Type gb_mxstring_to_type // return the GrB_Type from a built-in string const mxArray *S // built-in mxArray containing a string ) ; +GrB_Type gb_code_to_type // return the GrB_Type from a GrB_Type_Code +( + GrB_Type_Code code +) ; + +GrB_Type gb_binaryop_ztype // return the GrB_Type of the output of a binary op +( + GrB_BinaryOp op +) ; + +GrB_Type gb_monoid_type // return the GrB_Type of a monoid +( + GrB_Monoid op +) ; + void gb_mxstring_to_string // copy a built-in string into a C string ( char *string, // size at least maxlen+1 @@ -194,21 +217,21 @@ mxArray * gb_type_to_mxstring // return the built-in string from a GrB_Type const GrB_Type type ) ; -GrB_Matrix gb_typecast // C = (type) A, where C is deep +GrB_Matrix gb_typecast // C = (type) A, where C is deep ( - GrB_Matrix A, // may be shallow - GrB_Type type, // if NULL, copy but do not typecast - GxB_Format_Value fmt, // format of C - int sparsity // sparsity control for C, if 0 use A + GrB_Matrix A, // may be shallow + GrB_Type type, // if NULL, copy but do not typecast + int fmt, // format of C + int sparsity // sparsity control for C, if 0 use A ) ; -GrB_Matrix gb_new // create and empty matrix C +GrB_Matrix gb_new // create and empty matrix C ( - GrB_Type type, // type of C - GrB_Index nrows, // # of rows - GrB_Index ncols, // # of rows - GxB_Format_Value fmt, // requested format - int sparsity // sparsity control for C, 0 for default + GrB_Type type, // type of C + GrB_Index nrows, // # of rows + GrB_Index ncols, // # of rows + int fmt, // requested format + int sparsity // sparsity control for C, 0 for default ) ; void gb_abort ( void ) ; // failure @@ -221,7 +244,7 @@ void gb_usage // check usage and make sure GxB_init has been called const char *message // error message if usage is not correct ) ; -const char *gb_error // return an error string from a GrB_Info value +const char *gb_error_string // return an error string from a GrB_Info value ( GrB_Info info ) ; @@ -316,7 +339,7 @@ GrB_Descriptor gb_mxarray_to_descriptor // new descriptor, or NULL if none ( const mxArray *desc_builtin,// built-in struct with possible descriptor kind_enum_t *kind, // GrB, sparse, or full - GxB_Format_Value *fmt, // by row or by col + int *fmt, // by row or by col int *sparsity, // hypersparse/sparse/bitmap/full base_enum_t *base // 0-based int, 1-based int, or 1-based double ) ; @@ -325,7 +348,7 @@ GrB_Matrix gb_expand_to_full // C = full (A), and typecast ( const GrB_Matrix A, // input matrix to expand to full GrB_Type type, // type of C, if NULL use the type of A - GxB_Format_Value fmt, // format of C + int fmt, // format of C GrB_Matrix id // identity value, use zero if NULL ) ; @@ -400,23 +423,21 @@ void gb_mxfree // mxFree wrapper void **p_handle // handle to pointer to be freed ) ; -int64_t *gb_mxarray_to_list // return List of integers +GrB_Vector gb_mxarray_to_list // list of indices or values ( - const mxArray *mxList, // list to extract - base_enum_t base, // input is zero-based or one-based - bool *allocated, // true if output list was allocated - int64_t *len, // length of list - int64_t *List_max // max entry in the list, if computed + const mxArray *X, // MATLAB input matrix or struct with GrB content + const int base_offset // 1 or 0 ) ; -GrB_Index *gb_mxcell_to_index // return index list I +GrB_Vector gb_mxcell_to_list // return index list I ( - const mxArray *I_cell, // built-in cell array - base_enum_t base, // I is one-based or zero-based - const GrB_Index n, // dimension of matrix being indexed - bool *I_allocated, // true if output array I is allocated - GrB_Index *ni, // length (I) - int64_t *I_max // max (I) is computed if I_max is not NULL + // input + const mxArray *Cell, // built-in MATLAB cell array + const int base_offset, // 1 or 0 + const uint64_t n, // dimension of the matrix + // output + uint64_t *nI, // # of items in the list + int64_t *I_max // largest item in the list ) ; GrB_BinaryOp gb_first_binop // return GrB_FIRST_[type] operator @@ -446,7 +467,7 @@ bool gb_mxstring_to_format // true if a valid format is found // input const mxArray *mxformat, // built-in string, 'by row' or 'by col' // output - GxB_Format_Value *fmt, + int *fmt, int *sparsity ) ; @@ -466,7 +487,7 @@ GrB_Matrix gb_by_col // return the matrix by column GrB_Matrix A_input // input matrix, by row or column ) ; -GxB_Format_Value gb_default_format // GxB_BY_ROW or GxB_BY_COL +int gb_default_format // GxB_BY_ROW or GxB_BY_COL ( GrB_Index nrows, // row vectors are stored by row GrB_Index ncols // column vectors are stored by column @@ -477,16 +498,21 @@ bool gb_is_vector // true if A is a row or column vector GrB_Matrix A // GrB_Matrix to query ) ; -GxB_Format_Value gb_get_format // GxB_BY_ROW or GxB_BY_COL +bool gb_is_column_vector // true if A is a column vector +( + GrB_Matrix A // GrB_matrix to query +) ; + +int gb_get_format // GxB_BY_ROW or GxB_BY_COL ( - GrB_Index cnrows, // C is cnrows-by-cncols + GrB_Index cnrows, // C is cnrows-by-cncols GrB_Index cncols, - GrB_Matrix A, // may be NULL - GrB_Matrix B, // may be NULL - GxB_Format_Value fmt_descriptor // may be GxB_NO_FORMAT + GrB_Matrix A, // may be NULL + GrB_Matrix B, // may be NULL + int fmt_descriptor // may be GxB_NO_FORMAT ) ; -GxB_Format_Value gb_get_sparsity // 1 to 15 +int gb_get_sparsity // 1 to 15 ( GrB_Matrix A, // may be NULL GrB_Matrix B, // may be NULL @@ -539,7 +565,7 @@ void gb_get_mxargs GrB_Descriptor *desc, // last argument is always the descriptor base_enum_t *base, // desc.base kind_enum_t *kind, // desc.kind - GxB_Format_Value *fmt, // desc.format : by row or by col + int *fmt, // desc.format : by row or by col int *sparsity // desc.format : hypersparse/sparse/bitmap/full ) ; @@ -561,6 +587,16 @@ bool gb_is_integer (const GrB_Type type) ; bool gb_is_float (const GrB_Type type) ; +bool gb_is_dense // true if A is dense +( + GrB_Matrix A // GrB_Matrix to query +) ; + +bool gb_is_readonly // true if A has any readonly components +( + GrB_Matrix A // GrB_matrix to query +) ; + GrB_UnaryOp gb_round_op (const GrB_Type type) ; mxArray *gb_mxclass_to_mxstring (mxClassID class, bool is_complex) ; @@ -569,5 +605,51 @@ void gb_defaults (void) ; // set global GraphBLAS defaults for MATLAB void gb_at_exit ( void ) ; // call GrB_finalize +//------------------------------------------------------------------------------ +// GraphBLAS polymorphic methods +//------------------------------------------------------------------------------ + +// The @GrB MATLAB interface does not use these macros since they require a +// C11, and thus they cannot be used for MATLAB on Windows. + +#undef GrB_Monoid_new +#undef GxB_Monoid_terminal_new +#undef GrB_Scalar_setElement +#undef GrB_Scalar_extractElement +#undef GrB_Vector_build +#undef GrB_Vector_setElement +#undef GrB_Vector_extractElement +#undef GrB_Vector_extractTuples +#undef GrB_Matrix_build +#undef GrB_Matrix_setElement +#undef GrB_Matrix_extractElement +#undef GrB_Matrix_extractTuples +#undef GrB_get +#undef GrB_set +#undef GrB_wait +#undef GrB_error +#undef GrB_eWiseMult +#undef GrB_eWiseAdd +#undef GxB_eWiseUnion +#undef GrB_extract +#undef GxB_subassign +#undef GrB_assign +#undef GrB_apply +#undef GrB_select +#undef GrB_reduce +#undef GrB_kronecker +#undef GxB_resize +#undef GxB_fprint +#undef GxB_print +#undef GrB_Matrix_import +#undef GrB_Matrix_export +#undef GxB_sort +#undef GrB_free +#undef GxB_Scalar_setElement +#undef GxB_Scalar_extractElement +#undef GxB_set +#undef GxB_get +#undef GxB_select + #endif diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_all.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_all.c index 8cdee87bf4..9ec7054369 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_all.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_all.c @@ -2,7 +2,7 @@ // gb_is_all: check two matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ bool gb_is_all // true if op (A,B) is all true, false otherwise ) { - GrB_Index nrows1, ncols1, nrows2, ncols2, nvals, nvals1, nvals2 ; + uint64_t nrows1, ncols1, nrows2, ncols2, nvals, nvals1, nvals2 ; //-------------------------------------------------------------------------- // check the size of A and B @@ -66,8 +66,8 @@ bool gb_is_all // true if op (A,B) is all true, false otherwise // C = A .* B, where the pattern of C is the intersection of A and B //-------------------------------------------------------------------------- - GxB_Format_Value fmt ; - OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + int fmt ; + OK (GrB_Matrix_get_INT32 (A, &fmt, GxB_FORMAT)) ; int sparsity = gb_get_sparsity (A, B, 0) ; GrB_Matrix C = gb_new (GrB_BOOL, nrows1, ncols1, fmt, sparsity) ; OK1 (C, GrB_Matrix_eWiseMult_BinaryOp (C, NULL, NULL, op, A, B, NULL)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_column_vector.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_column_vector.c new file mode 100644 index 0000000000..84f1a2290f --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_column_vector.c @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// gb_is_column_vector: determine if A is a column vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "gb_interface.h" + +bool gb_is_column_vector // true if A is a column vector +( + GrB_Matrix A // GrB_matrix to query +) +{ + if (A == NULL) return (false) ; + uint64_t ncols ; + int sparsity, orientation ; + OK (GrB_Matrix_get_INT32 (A, &sparsity, GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_get_INT32 (A, &orientation, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + return (sparsity != GxB_HYPERSPARSE && orientation == GrB_COLMAJOR && + ncols == 1) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_dense.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_dense.c new file mode 100644 index 0000000000..86e67a80fb --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_dense.c @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// gb_is_dense: determine if a GrB_matrix is dense +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "gb_interface.h" + +// A is dense if it is in the full format, or if all entries are present. +// If A is NULL, it is not dense; this is not an error condition. + +bool gb_is_dense // true if A is dense +( + GrB_Matrix A // GrB_Matrix to query +) +{ + if (A == NULL) return (false) ; + int sparsity ; + OK (GrB_Matrix_get_INT32 (A, &sparsity, GxB_SPARSITY_STATUS)) ; + if (sparsity == GxB_FULL) + { + return (true) ; + } + uint64_t nrows, ncols, nvals ; + OK (GrB_Matrix_nrows (&nrows, A)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + OK (GrB_Matrix_nvals (&nvals, A)) ; + return ((((double) nrows) * ((double) ncols) < ((double) INT64_MAX)) + && (nvals == nrows * ncols)) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_equal.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_equal.c index 82671ff080..9d3cae0b1c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_equal.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_equal.c @@ -2,7 +2,7 @@ // gb_is_equal: check two matrices for exact equality //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_float.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_float.c index ad836192ef..a4e4cdd0dc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_float.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_float.c @@ -2,7 +2,7 @@ // gb_is_float: check if a GrB_Type is floating-point //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_integer.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_integer.c index 78b4e69db9..3370c43102 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_integer.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_integer.c @@ -2,7 +2,7 @@ // gb_is_integer: check if a GrB_Type is integer //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_readonly.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_readonly.c new file mode 100644 index 0000000000..6849709146 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_readonly.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// gb_is_readonly: determine if A has any readonly components +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "gb_interface.h" + +bool gb_is_readonly // true if A has any readonly components +( + GrB_Matrix A // GrB_matrix to query +) +{ + if (A == NULL) return (false) ; + int readonly ; + OK (GrB_Matrix_get_INT32 (A, &readonly, GxB_IS_READONLY)) ; + return ((bool) readonly) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_vector.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_vector.c index 43c0e53bd0..bd04272a5a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_vector.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_is_vector.c @@ -2,7 +2,7 @@ // gb_is_vector: determine if a GrB_matrix is a row or column vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ bool gb_is_vector // true if A is a row or column vector { // check if A is m-by-1 or 1-by-n - GrB_Index nrows = 0, ncols = 0 ; + uint64_t nrows = 0, ncols = 0 ; if (A != NULL) { OK (GrB_Matrix_nrows (&nrows, A)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_monoid_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_monoid_type.c new file mode 100644 index 0000000000..bb89b928ff --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_monoid_type.c @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// gb_monoid_type: get the GrB_Type of a monoid +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "gb_interface.h" + +GrB_Type gb_monoid_type +( + GrB_Monoid op +) +{ + int code = 0 ; + OK (GrB_Monoid_get_INT32 (op, &code, GrB_OUTP_TYPE_CODE)) ; + return (gb_code_to_type (code)) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_empty.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_empty.c index 3c60144a4a..a804819593 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_empty.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_empty.c @@ -2,7 +2,7 @@ // gb_mxarray_is_empty: check if a built-in mxArray is empty //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_scalar.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_scalar.c index 9636108764..eb1ac310a2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_scalar.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_is_scalar.c @@ -2,7 +2,7 @@ // gb_mxarray_is_scalar: check if built-in mxArray is non-sparse numeric scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_descriptor.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_descriptor.c index 28b745db42..85bf8b0105 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_descriptor.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_descriptor.c @@ -2,7 +2,7 @@ // gb_mxarray_to_descriptor: get the contents of a GraphBLAS Descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ static void get_descriptor GrB_Descriptor desc, // GraphBLAS descriptor to modify const mxArray *desc_builtin, // built-in struct with d.out, etc const char *fieldname, // fieldname to extract from desc_builtin - const GrB_Desc_Field field // field to set in desc + const int field // field to set in desc ) { @@ -30,67 +30,56 @@ static void get_descriptor // the field is present mxArray *value = mxGetFieldByNumber (desc_builtin, 0, fieldnumber) ; - if (MATCH (fieldname, "nthreads")) + // get the string from the built-in field + char s [LEN+2] ; + gb_mxstring_to_string (s, LEN, value, "field") ; + + // convert the string to a Descriptor value, and set the value + if (MATCH (s, "default")) + { + OK (GrB_Descriptor_set_INT32 (desc, GxB_DEFAULT, field)) ; + } + else if (MATCH (s, "transpose")) + { + OK (GrB_Descriptor_set_INT32 (desc, GrB_TRAN, field)) ; + } + else if (MATCH (s, "complement")) + { + OK (GrB_Descriptor_set_INT32 (desc, GrB_COMP, field)) ; + } + else if (MATCH (s, "structure") || MATCH (s, "structural")) + { + OK (GrB_Descriptor_set_INT32 (desc, GrB_STRUCTURE, field)) ; + } + else if (MATCH (s, "structural complement")) { - // ignored + OK (GrB_Descriptor_set_INT32 (desc, GrB_COMP+GrB_STRUCTURE, + field)) ; } - else if (MATCH (fieldname, "chunk")) + else if (MATCH (s, "replace")) { - // ignored + OK (GrB_Descriptor_set_INT32 (desc, GrB_REPLACE, field)) ; + } + else if (MATCH (s, "gustavson")) + { + OK (GrB_Descriptor_set_INT32 (desc, GxB_AxB_GUSTAVSON, field)) ; + } + else if (MATCH (s, "dot")) + { + OK (GrB_Descriptor_set_INT32 (desc, GxB_AxB_DOT, field)) ; + } + else if (MATCH (s, "saxpy")) + { + OK (GrB_Descriptor_set_INT32 (desc, GxB_AxB_SAXPY, field)) ; + } + else if (MATCH (s, "hash")) + { + OK (GrB_Descriptor_set_INT32 (desc, GxB_AxB_HASH, field)) ; } else - { - - // get the string from the built-in field - char s [LEN+2] ; - gb_mxstring_to_string (s, LEN, value, "field") ; - - // convert the string to a Descriptor value, and set the value - if (MATCH (s, "default")) - { - OK (GxB_Desc_set (desc, field, GxB_DEFAULT)) ; - } - else if (MATCH (s, "transpose")) - { - OK (GxB_Desc_set (desc, field, GrB_TRAN)) ; - } - else if (MATCH (s, "complement")) - { - OK (GxB_Desc_set (desc, field, GrB_COMP)) ; - } - else if (MATCH (s, "structure") || MATCH (s, "structural")) - { - OK (GxB_Desc_set (desc, field, GrB_STRUCTURE)) ; - } - else if (MATCH (s, "structural complement")) - { - OK (GxB_Desc_set (desc, field, GrB_COMP+GrB_STRUCTURE)) ; - } - else if (MATCH (s, "replace")) - { - OK (GxB_Desc_set (desc, field, GrB_REPLACE)) ; - } - else if (MATCH (s, "gustavson")) - { - OK (GxB_Desc_set (desc, field, GxB_AxB_GUSTAVSON)) ; - } - else if (MATCH (s, "dot")) - { - OK (GxB_Desc_set (desc, field, GxB_AxB_DOT)) ; - } - else if (MATCH (s, "saxpy")) - { - OK (GxB_Desc_set (desc, field, GxB_AxB_SAXPY)) ; - } - else if (MATCH (s, "hash")) - { - OK (GxB_Desc_set (desc, field, GxB_AxB_HASH)) ; - } - else - { - // the string must be one of the strings listed above - ERROR ("unrecognized descriptor value") ; - } + { + // the string must be one of the strings listed above + ERROR ("unrecognized descriptor value") ; } } } @@ -103,7 +92,7 @@ GrB_Descriptor gb_mxarray_to_descriptor // new descriptor, or NULL if none ( const mxArray *desc_builtin, // built-in struct with possible descriptor kind_enum_t *kind, // GrB, sparse, or full - GxB_Format_Value *fmt, // by row or by col + int *fmt, // by row or by col int *sparsity, // hypersparse/sparse/bitmap/full base_enum_t *base // 0-based int, 1-based int, or 1-based double ) @@ -120,6 +109,7 @@ GrB_Descriptor gb_mxarray_to_descriptor // new descriptor, or NULL if none (*sparsity) = 0 ; if (desc_builtin == NULL || !mxIsStruct (desc_builtin) + || (mxGetField (desc_builtin, 0, "GraphBLASv10") != NULL) || (mxGetField (desc_builtin, 0, "GraphBLASv7_3") != NULL) || (mxGetField (desc_builtin, 0, "GraphBLASv5_1") != NULL) || (mxGetField (desc_builtin, 0, "GraphBLASv5") != NULL) @@ -139,12 +129,12 @@ GrB_Descriptor gb_mxarray_to_descriptor // new descriptor, or NULL if none GrB_Descriptor desc ; OK (GrB_Descriptor_new (&desc)) ; - // get each component of the descriptor struct - get_descriptor (desc, desc_builtin, "out" , GrB_OUTP) ; - get_descriptor (desc, desc_builtin, "in0" , GrB_INP0) ; - get_descriptor (desc, desc_builtin, "in1" , GrB_INP1) ; - get_descriptor (desc, desc_builtin, "mask" , GrB_MASK) ; - get_descriptor (desc, desc_builtin, "axb" , GxB_AxB_METHOD) ; + // get each component for the GraphBLAS GrB_Descriptor + get_descriptor (desc, desc_builtin, "out" , GrB_OUTP) ; + get_descriptor (desc, desc_builtin, "in0" , GrB_INP0) ; + get_descriptor (desc, desc_builtin, "in1" , GrB_INP1) ; + get_descriptor (desc, desc_builtin, "mask", GrB_MASK) ; + get_descriptor (desc, desc_builtin, "axb" , GxB_AxB_METHOD) ; //-------------------------------------------------------------------------- // get the desired kind of output @@ -206,34 +196,25 @@ GrB_Descriptor gb_mxarray_to_descriptor // new descriptor, or NULL if none gb_mxstring_to_string (s, LEN, mxbase, "base") ; if (MATCH (s, "default")) { - // The indices are one-based by default. The type is determined - // automatically: if I and J are outputs, then the type is double - // (BASE_1_DOUBLE) unless the indices can exceed flintmax (in which - // case BASE_1_INT64 is used) + // The indices are one-based integer by default. (*base) = BASE_DEFAULT ; } - else if (MATCH (s, "zero-based")) + else if (MATCH (s, "zero-based") || MATCH (s, "zero-based int")) { - // zero-based indices are always int64. This is performance - // purposes, internal to GrB methods. The user may also use this - // to speed up GrB.build, GrB.extract, GrB.assign. and - // GrB.subassign. - (*base) = BASE_0_INT64 ; + // zero-based indices are always uint64/uint32. This is the + // fastest option since GraphBLAS uses zero-based indices. + (*base) = BASE_0_INT ; } - else if (MATCH (s, "one-based int")) + else if (MATCH (s, "one-based") || MATCH (s, "one-based int")) { - // one-based indices, but in int64. These are important for - // indexing into matrices with dimension larger than flintmax. - (*base) = BASE_1_INT64 ; + // one-based indices, but in uint64/uint32 (the default) + (*base) = BASE_1_INT ; } - else if (MATCH (s, "one-based") || MATCH (s, "one-based double")) + else if (MATCH (s, "double") || MATCH (s, "one-based double")) { - // for 'one-based', the caller may change this to BASE_1_INT64, - // if I and J are inputs to the function are int64. This is - // the typical default. + // one-based double indices (*base) = BASE_1_DOUBLE ; } - else { ERROR ("invalid descriptor.base") ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_list.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_list.c index 6c38b784fb..b9744cd569 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_list.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_to_list.c @@ -1,99 +1,158 @@ //------------------------------------------------------------------------------ -// gb_mxarray_to_list: convert a built-in array to a list of integers +// gb_mxarray_to_list: return GrB_Vector for assign, subassign, extract, build //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// The built-in list may be double, int64, or uint64. If double or 1-based -// int64, a new integer list is created, and the 1-based input list is -// converted to the 0-based integer list. - -// mxGetData is used instead of the MATLAB-recommended mxGetDoubles, etc, -// because mxGetData works best for Octave, and it works fine for MATLAB -// since GraphBLAS requires R2018a with the interleaved complex data type. - #include "gb_interface.h" -int64_t *gb_mxarray_to_list // return List of integers +//------------------------------------------------------------------------------ +// gb_subtract_base: V = S, or V = S-1 +//------------------------------------------------------------------------------ + +static GrB_Vector gb_subtract_base ( - const mxArray *mxList, // list to extract - base_enum_t base, // input is zero-based or one-based - bool *allocated, // true if output list was allocated - int64_t *len, // length of list - int64_t *List_max // max entry in the list, if computed + GrB_Vector *S, // input, returned as V or freed for V=S-1 + const int base_offset // 1 or 0 ) { + GrB_Vector V = NULL ; + if (base_offset == 0) + { + // V = S, with no change of type + V = (GrB_Vector) (*S) ; + (*S) = NULL ; + } + else + { + // V = S-1, but typecast to uint32 or uint64 to avoid roundoff errors + GrB_Type type ; + OK (GxB_Vector_type (&type, *S)) ; + GrB_BinaryOp minus ; + if (type == GrB_BOOL || type == GrB_INT8 || type == GrB_INT16 || + type == GrB_INT32 || type == GrB_UINT8 || type == GrB_UINT16 || + type == GrB_UINT32 || type == GrB_FP32 || type == GxB_FC32) + { + type = GrB_UINT32 ; + minus = GrB_MINUS_UINT32 ; + } + else + { + type = GrB_UINT64 ; + minus = GrB_MINUS_UINT64 ; + } + uint64_t n ; + OK (GrB_Vector_size (&n, *S)) ; + OK (GrB_Vector_new (&V, type, n)) ; + ASSERT_VECTOR_OK (V, "V result, before apply", GB0) ; + ASSERT_VECTOR_OK (*S, "S before apply", GB0) ; + OK (GrB_Vector_apply_BinaryOp2nd_UINT64 (V, NULL, NULL, minus, *S, 1, + NULL)) ; + ASSERT_VECTOR_OK (V, "V result, after apply", GB0) ; + GrB_Vector_free (S) ; + } + return (V) ; +} + +//------------------------------------------------------------------------------ +// gb_mxarray_to_list +//------------------------------------------------------------------------------ + +GrB_Vector gb_mxarray_to_list // list of indices or values +( + const mxArray *X, // MATLAB input matrix or struct with GrB content + const int base_offset // 1 or 0 +) +{ //-------------------------------------------------------------------------- - // check inputs + // get a shallow GrB_Matrix S of the input MATLAB matrix or struct //-------------------------------------------------------------------------- - CHECK_ERROR (!mxIsNumeric (mxList), "index list must be numeric") ; - CHECK_ERROR (mxIsSparse (mxList), "index list cannot be sparse") ; - CHECK_ERROR (mxIsComplex (mxList), "index list cannot be complex") ; + GrB_Matrix C = NULL ; + GrB_Vector V = NULL ; + GrB_Matrix S = gb_get_shallow (X) ; //-------------------------------------------------------------------------- - // get the length and class of the built-in list + // get the properties of S //-------------------------------------------------------------------------- - (*len) = mxGetNumberOfElements (mxList) ; - mxClassID class = mxGetClassID (mxList) ; + uint64_t ncols, nrows ; + OK (GrB_Matrix_nrows (&nrows, S)) ; + OK (GrB_Matrix_ncols (&ncols, S)) ; //-------------------------------------------------------------------------- - // extract the contents and convert to int64_t + // check for quick return //-------------------------------------------------------------------------- - (*List_max) = -1 ; - bool zerobased = (base == BASE_0_INT64) ; - - if (*len == 0) + if (ncols == 0 || nrows == 0) { - (*allocated) = true ; - int64_t *List = (int64_t *) mxMalloc (1 * sizeof (int64_t)) ; - List [0] = 0 ; - return (List) ; + // return a zero-length vector + GrB_Type type ; + OK (GxB_Matrix_type (&type, S)) ; + OK (GrB_Vector_new (&V, type, 0)) ; + ASSERT_VECTOR_OK (V, "V result, empty", GB0) ; + GrB_Matrix_free (&S) ; + return (V) ; } - else if (class == mxINT64_CLASS && zerobased) + + int sparsity, fmt ; + OK (GrB_Matrix_get_INT32 (S, &fmt, GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32 (S, &sparsity, GxB_SPARSITY_STATUS)) ; + bool quick = false ; + + if (ncols == 1 && sparsity != GxB_HYPERSPARSE && fmt == GxB_BY_COL) { - // input list is int64; just return a shallow pointer - (*allocated) = false ; - return ((int64_t *) mxGetData (mxList)) ; + // return S as a shallow GrB_Vector + quick = true ; } - else if (class == mxUINT64_CLASS && zerobased) + + if (nrows == 1 && sparsity != GxB_HYPERSPARSE && fmt == GxB_BY_ROW) { - // input list is uint64; just return a shallow pointer - (*allocated) = false ; - return ((int64_t *) mxGetData (mxList)) ; + // quick in-place transpose, by converting it to by-column + quick = true ; + S->is_csc = true ; } - else if (class == mxINT64_CLASS || class == mxUINT64_CLASS || - class == mxDOUBLE_CLASS) - { - // input list 1-based: decrement to convert to 0-based - (*allocated) = true ; - int64_t *List = mxMalloc ((*len) * sizeof (int64_t)) ; - if (class == mxDOUBLE_CLASS) - { - // input list is 1-based double - double *List_double = (double *) mxGetData (mxList) ; - CHECK_ERROR (List_double == NULL, "index list must be integer") ; - bool ok = GB_helper3 (List, List_double, (*len), List_max) ; - CHECK_ERROR (!ok, "index must be integer") ; - } - else - { - // input list is 1-based int64 or uint64 - int64_t *List_int64 = (int64_t *) mxGetData (mxList) ; - GB_helper3i (List, List_int64, (*len), List_max) ; - } - return (List) ; + + if (quick) + { + // return S as a shallow GrB_Vector, but subtract the base if needed + ASSERT (gb_is_column_vector (S)) ; + ASSERT_VECTOR_OK ((GrB_Vector) S, "S as vector", GB0) ; + // V = S - base_offset + V = gb_subtract_base ((GrB_Vector *) &S, base_offset) ; + ASSERT_VECTOR_OK (V, "V result, quick", GB0) ; + return (V) ; } - else + + //-------------------------------------------------------------------------- + // reshape S into (nrows*ncols)-by-1 and return it as a GrB_Vector + //-------------------------------------------------------------------------- + + // C = S (:) + if (((double) nrows) * ((double) ncols) > INT64_MAX / 8) { - ERROR ("integer array must be double, int64, or uint64") ; - return (NULL) ; + ERROR ("input matrix dimensions are too large") ; } + OK (GxB_Matrix_reshapeDup (&C, S, true, nrows * ncols, 1, NULL)) ; + GrB_Matrix_free (&S) ; + + // ensure C is not hypersparse, and is stored by column + OK (GrB_Matrix_set_INT32 (C, GxB_SPARSE + GxB_BITMAP + GxB_FULL, + GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_BY_COL, GxB_FORMAT)) ; + + // C is now a valid column vector + ASSERT (gb_is_column_vector (C)) ; + + // V = C - base_offset + V = gb_subtract_base ((GrB_Vector *) &C, base_offset) ; + + // V is now a valid GrB_Vector (no longer shallow) + ASSERT_VECTOR_OK (V, "V result, slow", GB0) ; + return (V) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_type.c index 61fa8aa3de..e072855474 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_type.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxarray_type.c @@ -2,7 +2,7 @@ // gb_mxarray_type: return the GraphBLAS type of a built-in matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_index.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_index.c deleted file mode 100644 index 95849f8dfa..0000000000 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_index.c +++ /dev/null @@ -1,218 +0,0 @@ -//------------------------------------------------------------------------------ -// gb_mxcell_to_index: convert cell array to index list I or colon expression -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Get a list of indices from a built-in cell array. - -// I is a cell array. I contains 0, 1, 2, or 3 items: -// -// 0: { } This is the built-in ':', like C(:,J), refering to all m -// rows, if C is m-by-n. -// 1: { list } A 1D list of row indices, like C(I,J). -// 2: { start,fini } start and fini are scalars (either double, int64, -// or uint64). This defines I = start:fini in colon -// notation. -// 3: { start,inc,fini } start, inc, and fini are scalars (double, int64, -// or uint64). This defines I = start:inc:fini in colon -// notation. - -#include "gb_interface.h" - -GrB_Index *gb_mxcell_to_index // return index list I -( - const mxArray *I_cell, // built-in cell array - base_enum_t base, // I is one-based or zero-based - const GrB_Index n, // dimension of matrix being indexed - bool *I_allocated, // true if output array I is allocated - GrB_Index *ni, // length (I) - int64_t *I_max // max (I) is computed if I_max is not NULL. - // I_max is 0-based. -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - CHECK_ERROR (I_cell == NULL || !mxIsCell (I_cell), "internal error 6") ; - - //-------------------------------------------------------------------------- - // get the contents of I_cell - //-------------------------------------------------------------------------- - - int len = mxGetNumberOfElements (I_cell) ; - CHECK_ERROR (len > 3, "index must be a cell array of length 0 to 3") ; - - bool Item_allocated [3] = { false, false, false } ; - int64_t Item_len [3] = { 0, 0, 0 } ; - int64_t Item_max [3] = { -1, -1, -1 } ; - GrB_Index *Item [3] = { NULL, NULL, NULL } ; - - for (int k = 0 ; k < len ; k++) - { - // convert I_cell {k} content to an integer list - Item [k] = (GrB_Index *) gb_mxarray_to_list (mxGetCell (I_cell, k), - base, &Item_allocated [k], &Item_len [k], &Item_max [k]) ; - } - - //-------------------------------------------------------------------------- - // parse the lists in the cell array - //-------------------------------------------------------------------------- - - GrB_Index *I ; - - if (len == 0) - { - - //---------------------------------------------------------------------- - // I = { } - //---------------------------------------------------------------------- - - (*ni) = n ; - (*I_allocated) = false ; - I = (GrB_Index *) GrB_ALL ; - if (I_max != NULL) - { - // I_max is the last index in the matrix, based on its dimension. - (*I_max) = ((int64_t) n) - 1 ; - } - - } - else if (len == 1) - { - - //---------------------------------------------------------------------- - // I = { list } - //---------------------------------------------------------------------- - - (*ni) = Item_len [0] ; - (*I_allocated) = Item_allocated [0] ; - I = (GrB_Index *) (Item [0]) ; - if (I_max != NULL) - { - // find the max entry in the list - if (Item_max [0] >= 0) - { - // the max entry has already been computed (1-based) - // convert from 1-based to 0-based - (*I_max) = Item_max [0] - 1 ; - } - else - { - // find the max entry (0-based) - GrB_Index List_max = 0 ; - GB_helper4 (I, (*ni), &List_max) ; - (*I_max) = ((int64_t) List_max) - 1 ; - } - } - - } - else if (len == 2) - { - - //---------------------------------------------------------------------- - // I = { start, fini }, defining start:fini - //---------------------------------------------------------------------- - - CHECK_ERROR (Item_len [0] != 1 || Item_len [1] != 1, - "start and fini must be scalars for start:fini") ; - - I = mxMalloc (3 * sizeof (GrB_Index)) ; - (*I_allocated) = true ; - - I [GxB_BEGIN] = Item [0][0] ; - I [GxB_END ] = Item [1][0] ; - I [GxB_INC ] = 0 ; // unused - - if (Item_allocated [0]) gb_mxfree ((void **) (& (Item [0]))) ; - if (Item_allocated [1]) gb_mxfree ((void **) (& (Item [1]))) ; - - (*ni) = GxB_RANGE ; - if (I_max != NULL) - { - // find the last index in the start:fini list - (*I_max) = (int64_t) I [GxB_END] ; - } - - } - else // if (len == 3) - { - - //---------------------------------------------------------------------- - // I = { start, inc, fini }, defining start:inc:fini - //---------------------------------------------------------------------- - - CHECK_ERROR (Item_len [0] != 1 || Item_len [1] != 1 || - Item_len [2] != 1, - "start, inc, and fini must be scalars for start:inc:fini") ; - - I = mxMalloc (3 * sizeof (GrB_Index)) ; - (*I_allocated) = true ; - - I [GxB_BEGIN] = Item [0][0] ; - I [GxB_END ] = Item [2][0] ; - I [GxB_INC ] = 0 ; - int64_t iinc = Item [1][0] ; - - if (Item_allocated [1]) - { - // the 2nd item in the list is iinc, and if it was passed in as - // 1-based, it has been decremented. So increment it to get back - // to the correct value. - iinc++ ; - } - - if (Item_allocated [0]) gb_mxfree ((void **) (& (Item [0]))) ; - if (Item_allocated [1]) gb_mxfree ((void **) (& (Item [1]))) ; - if (Item_allocated [2]) gb_mxfree ((void **) (& (Item [2]))) ; - - if (iinc < 0) - { - I [GxB_INC] = (GrB_Index) (-iinc) ; - (*ni) = GxB_BACKWARDS ; - if (I_max != NULL) - { - // find the first entry in the list ibegin:iinc:iend. - (*I_max) = -1 ; - int64_t ibegin = (int64_t) I [GxB_BEGIN] ; - int64_t iend = (int64_t) I [GxB_END] ; - if (iinc != 0 && ibegin >= iend) - { - // the list is non-empty, for example, 7:-2:4 = [7 5] - // I_max = GB_ijlist (NULL, 0, GB_STRIDE, I) - (*I_max) = ibegin ; - } - } - } - else - { - I [GxB_INC] = (GrB_Index) (iinc) ; - (*ni) = GxB_STRIDE ; - if (I_max != NULL) - { - // find the last entry in the list ibegin:iinc:iend. - (*I_max) = -1 ; - int64_t ibegin = (int64_t) I [GxB_BEGIN] ; - int64_t iend = (int64_t) I [GxB_END] ; - if (iinc != 0 && ibegin <= iend) - { - // the list is non-empty, for example, 4:2:9 = [4 6 8] - // nI = length of the expanded list (see GB_ijproperties), - // which is 3 for the list 4:2:9. - int64_t nI = ((iend - ibegin) / iinc) + 1 ; - // I_max = GB_ijlist (NULL, nI-1, GB_STRIDE, I), - // which is 8 for the list 4:2:9 - (*I_max) = ibegin + (nI-1) * iinc ; - } - } - } - } - - return (I) ; -} - diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_list.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_list.c new file mode 100644 index 0000000000..bb6ff451cc --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxcell_to_list.c @@ -0,0 +1,188 @@ +//------------------------------------------------------------------------------ +// gb_mxcell_to_list: convert cell array to index list I or colon expression +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Get a list of indices from a built-in MATLAB/Octave cell array. + +// I is a cell array. I contains 0, 1, 2, or 3 items: +// +// 0: { } This is the built-in ':', like C(:,J). +// 1: { list } A 1D list of row indices, like C(I,J). +// 2: { start,fini } start and fini are scalars. +// This defines I = start:1:fini in colon notation. +// 3: { start,inc,fini } start, inc, and fini are scalars. +// This defines I = start:inc:fini in colon notation. +// +// If the cell contains 2 or 3 items, I is returned as an int64_t GrB_Vector of +// length 3, and the descriptor must use GxB_IS_STRIDE for the call to +// GrB_assign, GxB_subassign, or GrB_extract. + +#include "gb_interface.h" + +GrB_Vector gb_mxcell_to_list // return index list I +( + // input + const mxArray *Cell, // built-in MATLAB cell array + const int base_offset, // 1 or 0 + const uint64_t n, // dimension of the matrix + // output + uint64_t *nI, // # of items in the list + int64_t *I_max // largest item in the list (NULL if not needed) +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + CHECK_ERROR (Cell == NULL || !mxIsCell (Cell), "internal error 6") ; + + //-------------------------------------------------------------------------- + // get the contents of Cell + //-------------------------------------------------------------------------- + + int len = mxGetNumberOfElements (Cell) ; + CHECK_ERROR (len > 3, "index must be a cell array of length 0 to 3") ; + + //-------------------------------------------------------------------------- + // parse the lists in the cell array + //-------------------------------------------------------------------------- + + GrB_Vector I = NULL ; + + if (len == 0) + { + + //---------------------------------------------------------------------- + // I = { }, a NULL vector I, representing I = 0:n-1 = GrB_ALL + //---------------------------------------------------------------------- + + (*nI) = n ; + if (I_max != NULL) + { + (*I_max) = n-1 ; + } + return (NULL) ; + + } + else if (len == 1) + { + + //---------------------------------------------------------------------- + // I = { list } + //---------------------------------------------------------------------- + + I = gb_mxarray_to_list (mxGetCell (Cell, 0), base_offset) ; + if (I_max != NULL) + { + // I_max = max (list) + OK (GrB_Vector_reduce_INT64 (I_max, NULL, GrB_MAX_MONOID_INT64, I, + NULL)) ; + } + OK (GrB_Vector_size (nI, I)) ; + + } + else // if (len == 2 || len == 3) + { + + //---------------------------------------------------------------------- + // I = { start, fini } or I = { start, inc, fini } + //---------------------------------------------------------------------- + + // Start = Cell {0}, Fini = Cell {1}, and Inc = Cell {2} if present + int64_t ibegin = 0, iinc = 1, iend = 0 ; + GrB_Vector Start = NULL, Inc = NULL, Fini = NULL ; + if (len == 2) + { + mxArray *cell0 = mxGetCell (Cell, 0) ; + mxArray *cell1 = mxGetCell (Cell, 1) ; + CHECK_ERROR (!gb_mxarray_is_scalar (cell0) + || !gb_mxarray_is_scalar (cell1), + "cell entries must be scalars for start:fini") ; + Start = gb_mxarray_to_list (cell0, 0) ; + Fini = gb_mxarray_to_list (cell1, 0) ; + } + else // if (len == 3) + { + mxArray *cell0 = mxGetCell (Cell, 0) ; + mxArray *cell1 = mxGetCell (Cell, 1) ; + mxArray *cell2 = mxGetCell (Cell, 2) ; + CHECK_ERROR (!gb_mxarray_is_scalar (cell0) + || !gb_mxarray_is_scalar (cell1) + || !gb_mxarray_is_scalar (cell2), + "cell entries must be scalars for start:inc:fini") ; + Start = gb_mxarray_to_list (cell0, 0) ; + Inc = gb_mxarray_to_list (cell1, 0) ; + Fini = gb_mxarray_to_list (cell2, 0) ; + } + + // get ibegin, iend, and iinc + OK (GrB_Vector_extractElement_INT64 (&ibegin, Start, 0)) ; + OK (GrB_Vector_extractElement_INT64 (&iend, Fini, 0)) ; + if (len == 3) + { + OK (GrB_Vector_extractElement_INT64 (&iinc, Inc, 0)) ; + } + + GrB_Vector_free (&Start) ; + GrB_Vector_free (&Fini) ; + GrB_Vector_free (&Inc) ; + + // handle the base_offset + if (base_offset == 1) + { + ibegin-- ; + iend-- ; + } + + // I = [ibegin, iend, iinc] + OK (GrB_Vector_new (&I, GrB_INT64, 3)) ; + OK (GrB_Vector_setElement_INT64 (I, ibegin, GxB_BEGIN)) ; + OK (GrB_Vector_setElement_INT64 (I, iend , GxB_END)) ; + OK (GrB_Vector_setElement_INT64 (I, iinc , GxB_INC)) ; + + //---------------------------------------------------------------------- + // determine the properties of ibegin:iinc:iend + //---------------------------------------------------------------------- + + int64_t imax = -1 ; + (*nI) = 0 ; + if (iinc < 0) + { + if (ibegin >= iend) + { + // the list is non-empty, for example, 7:-2:4 = [7 5] + (*nI) = ((ibegin - iend) / (-iinc)) + 1 ; + imax = ibegin ; + } + } + else if (iinc > 0) + { + if (ibegin <= iend) + { + // the list is non-empty, for example, 4:2:9 = [4 6 8] + // nI = length of the expanded list, + // which is 3 for the list 4:2:9. + (*nI) = ((iend - ibegin) / iinc) + 1 ; + // imax is 8 for the list 4:2:9 + imax = ibegin + ((*nI)-1) * iinc ; + } + } + if (I_max != NULL) + { + (*I_max) = imax ; + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + return (I) ; +} + diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxclass_to_mxstring.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxclass_to_mxstring.c index cb6f55c6d6..e8c639a7f9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxclass_to_mxstring.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxclass_to_mxstring.c @@ -2,7 +2,7 @@ // gb_mxclass_to_mxstring: type of a built-in matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxfree.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxfree.c index 0bd4c673e9..5bfce95891 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxfree.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxfree.c @@ -2,7 +2,7 @@ // gb_mxfree: mxFree wrapper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxget_uint64_scalar.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxget_uint64_scalar.c index 6ffe5e9966..19b6e531a4 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxget_uint64_scalar.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxget_uint64_scalar.c @@ -2,7 +2,7 @@ // gb_mxget_int64_scalar: return an int64 scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ uint64_t gb_mxget_uint64_scalar // return uint64 value of a MATLAB scalar if (!gb_mxarray_is_scalar (mxscalar)) { - GB_COV_PUT ; + GBCOV_PUT ; mexErrMsgIdAndTxt ("GrB:error", "%s must be a scalar", name) ; } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop.c index 6106eeee62..6cffacf6b0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop.c @@ -2,7 +2,7 @@ // gb_mxstring_to_binop: get a GraphBLAS operator from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop_or_idxunop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop_or_idxunop.c index 180f6edab5..a6f6a8fad3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop_or_idxunop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_binop_or_idxunop.c @@ -2,7 +2,7 @@ // gb_mxstring_to_binop_or_idxunop: get a GraphBLAS op from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_format.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_format.c index 0d6dae025d..98d89f96ec 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_format.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_format.c @@ -2,7 +2,7 @@ // gb_mxstring_to_format: get the format from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ bool gb_mxstring_to_format // true if a valid format is found // input const mxArray *mxformat, // built-in string, 'by row' or 'by col' // output - GxB_Format_Value *fmt, + int *fmt, int *sparsity ) { @@ -63,14 +63,14 @@ bool gb_mxstring_to_format // true if a valid format is found valid = true ; (*fmt) = GxB_BY_ROW ; len = len - 6 ; - format_string [GB_IMAX (0, len-1)] = '\0' ; + format_string [MAX (0, len-1)] = '\0' ; } else if (MATCH (format_string + len - 6, "by col")) { valid = true ; (*fmt) = GxB_BY_COL ; len = len - 6 ; - format_string [GB_IMAX (0, len-1)] = '\0' ; + format_string [MAX (0, len-1)] = '\0' ; } } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_idxunop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_idxunop.c index 2e32d8b484..82d8593528 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_idxunop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_idxunop.c @@ -2,7 +2,7 @@ // gb_mxstring_to_selectop: get GraphBLAS select operator from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_monoid.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_monoid.c index 9bf2ba475f..3a719b48ed 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_monoid.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_monoid.c @@ -2,7 +2,7 @@ // gb_mxstring_to_monoid: get a GraphBLAS monoid from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_semiring.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_semiring.c index af4b926d90..6490ec9ebe 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_semiring.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_semiring.c @@ -2,7 +2,7 @@ // gb_mxstring_to_semiring: get a GraphBLAS semiring from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_string.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_string.c index aef8354d05..aca31caf49 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_string.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_string.c @@ -2,7 +2,7 @@ // gb_mxstring_to_string: copy a built-in string into a C string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_type.c index 00c25b7d29..ff22eb6a2c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_type.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_type.c @@ -2,7 +2,7 @@ // gb_mxstring_to_type: return the GraphBLAS type from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_unop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_unop.c index fb994738cc..e2e45bb526 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_unop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_mxstring_to_unop.c @@ -2,7 +2,7 @@ // gb_mxstring_to_unop: get a GraphBLAS unary operator from a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_new.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_new.c index aba83b5fb3..e89095d81d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_new.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_new.c @@ -2,20 +2,20 @@ // gb_new: create a GraphBLAS matrix with desired format and sparsity control //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "gb_interface.h" -GrB_Matrix gb_new // create and empty matrix C +GrB_Matrix gb_new // create and empty matrix C ( - GrB_Type type, // type of C - GrB_Index nrows, // # of rows - GrB_Index ncols, // # of rows - GxB_Format_Value fmt, // requested format, if < 0 use default - int sparsity // sparsity control for C, 0 for default + GrB_Type type, // type of C + uint64_t nrows, // # of rows + uint64_t ncols, // # of rows + int fmt, // requested format, if < 0 use default + int sparsity // sparsity control for C, 0 for default ) { @@ -30,21 +30,21 @@ GrB_Matrix gb_new // create and empty matrix C } // set the desired format - GxB_Format_Value fmt_current ; - OK (GxB_Matrix_Option_get (C, GxB_FORMAT, &fmt_current)) ; + int fmt_current ; + OK (GrB_Matrix_get_INT32 (C, &fmt_current, GxB_FORMAT)) ; if (fmt != fmt_current) { - OK (GxB_Matrix_Option_set (C, GxB_FORMAT, fmt)) ; + OK (GrB_Matrix_set_INT32 (C, fmt, GxB_FORMAT)) ; } // set the desired sparsity structure if (sparsity != 0) { int current ; - OK (GxB_Matrix_Option_get (C, GxB_SPARSITY_CONTROL, ¤t)) ; + OK (GrB_Matrix_get_INT32 (C, ¤t, GxB_SPARSITY_CONTROL)) ; if (current != sparsity) { - OK (GxB_Matrix_Option_set (C, GxB_SPARSITY_CONTROL, sparsity)) ; + OK (GrB_Matrix_set_INT32 (C, sparsity, GxB_SPARSITY_CONTROL)) ; } } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm.c index 6964c164aa..0a6b7397ff 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm.c @@ -2,7 +2,7 @@ // gb_norm: compute the norm of a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ double gb_norm // compute norm (A,kind) // get input matrix, select types and operators, and allocate X //-------------------------------------------------------------------------- - GrB_Index nrows, ncols, nvals ; + uint64_t nrows, ncols, nvals ; OK (GrB_Matrix_nvals (&nvals, A)) ; if (nvals == 0) return ((double) 0) ; @@ -141,7 +141,7 @@ double gb_norm // compute norm (A,kind) case INT64_MIN : // (-inf)-norm - if (GB_is_dense (A)) + if (gb_is_dense (A)) { // X = abs (A) OK1 (X, GrB_Matrix_apply (X, NULL, NULL, absop, A, NULL)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm_kind.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm_kind.c index 039f4a8a65..62d0fe91ea 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm_kind.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_norm_kind.c @@ -2,7 +2,7 @@ // gb_norm_kind: determine the kind of norm to compute //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_round_op.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_round_op.c index 3fe2b3bcf4..595274c1b2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_round_op.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_round_op.c @@ -2,7 +2,7 @@ // gb_round_op: get a rounding operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_semiring.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_semiring.c index 9f9743b8be..1cdd5aed2a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_semiring.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_semiring.c @@ -2,11 +2,13 @@ // gb_semiring: get a built-in semiring from an add and multiply operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// This function accesses opaque content and GB_methods inside GraphBLAS. + #include "gb_interface.h" #include "GB_binop.h" @@ -103,7 +105,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error "invalid semiring (add operator not a monoid)") ; // the type of add must match the mult->ztype - CHECK_ERROR (add->ztype != mult->ztype, + CHECK_ERROR (add->ztype != mult->ztype, "invalid semiring (add opeartor not a monoid)") ; // The conditions above are true for any semiring and any A and B, whether @@ -120,31 +122,22 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error // rename redundant Boolean multiply operators //-------------------------------------------------------------------------- - GB_Type_code xcode = mult->xtype->code ; - GB_Type_code zcode = mult->ztype->code ; + int xcode, zcode ; + OK (GrB_BinaryOp_get_INT32 (mult, &xcode, GrB_INP0_TYPE_CODE)) ; + OK (GrB_BinaryOp_get_INT32 (mult, &zcode, GrB_OUTP_TYPE_CODE)) ; - CHECK_ERROR (xcode >= GB_UDT_code, + CHECK_ERROR (xcode == GrB_UDT_CODE, "invalid semiring (x and y type not built-in)") ; - CHECK_ERROR (zcode >= GB_UDT_code, + CHECK_ERROR (zcode == GrB_UDT_CODE, "invalid semiring (z type not built-in)") ; - if (xcode == GB_BOOL_code) + if (xcode == GrB_BOOL_CODE) { // z = mult(x,y) where both x and y are Boolean. - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, MINUS, and RMINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE mult_binop_code = GB_boolean_rename (mult_binop_code) ; } - if (zcode == GB_BOOL_code) + if (zcode == GrB_BOOL_CODE) { // Only the LAND, LOR, LXOR, and EQ monoids remain if z is // Boolean. MIN, MAX, PLUS, and TIMES are renamed. @@ -155,7 +148,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error // launch the switch factory //-------------------------------------------------------------------------- - if (zcode == GB_FC32_code) + if (zcode == GxB_FC32_CODE) { //---------------------------------------------------------------------- @@ -267,7 +260,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error } } - else if (zcode == GB_FC64_code) + else if (zcode == GxB_FC64_CODE) { //---------------------------------------------------------------------- @@ -379,11 +372,11 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error } } - else if (zcode != GB_BOOL_code) + else if (zcode != GrB_BOOL_CODE) { //---------------------------------------------------------------------- - // 1000 semirings with TxT->T multiply operators + // 1000 semirings with TxT -> T multiply operators //---------------------------------------------------------------------- // x,y,z are all the same non-Boolean type @@ -400,16 +393,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MIN_FIRST_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MIN_FIRST_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MIN_FIRST_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MIN_FIRST_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MIN_FIRST_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MIN_FIRST_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MIN_FIRST_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MIN_FIRST_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MIN_FIRST_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MIN_FIRST_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MIN_FIRST_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MIN_FIRST_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MIN_FIRST_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MIN_FIRST_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MIN_FIRST_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MIN_FIRST_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MIN_FIRST_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MIN_FIRST_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MIN_FIRST_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MIN_FIRST_SEMIRING_FP64 ) ; default : ; } break ; @@ -418,16 +411,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MAX_FIRST_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MAX_FIRST_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MAX_FIRST_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MAX_FIRST_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MAX_FIRST_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MAX_FIRST_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MAX_FIRST_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MAX_FIRST_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MAX_FIRST_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MAX_FIRST_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MAX_FIRST_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MAX_FIRST_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MAX_FIRST_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MAX_FIRST_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MAX_FIRST_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MAX_FIRST_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MAX_FIRST_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MAX_FIRST_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MAX_FIRST_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MAX_FIRST_SEMIRING_FP64 ) ; default : ; } break ; @@ -436,16 +429,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_FIRST_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_FIRST_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_FIRST_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_FIRST_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_FIRST_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_FIRST_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_FIRST_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_FIRST_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_FIRST_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_FIRST_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_FIRST_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_FIRST_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_FIRST_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_FIRST_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_FIRST_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_FIRST_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_FIRST_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_FIRST_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_FIRST_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_FIRST_FP64 ) ; default : ; } break ; @@ -454,16 +447,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_FIRST_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_FIRST_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_FIRST_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_FIRST_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_FIRST_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_FIRST_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_FIRST_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_FIRST_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_FIRST_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_FIRST_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_FIRST_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_FIRST_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_FIRST_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_FIRST_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_FIRST_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_FIRST_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_FIRST_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_FIRST_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_FIRST_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_FIRST_FP64 ) ; default : ; } break ; @@ -472,16 +465,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_FIRST_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_FIRST_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_FIRST_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_FIRST_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_FIRST_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_FIRST_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_FIRST_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_FIRST_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_FIRST_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_FIRST_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_FIRST_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_FIRST_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_FIRST_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_FIRST_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_FIRST_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_FIRST_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_FIRST_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_FIRST_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_FIRST_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_FIRST_FP64 ) ; default : ; } break ; @@ -499,16 +492,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MIN_SECOND_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MIN_SECOND_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MIN_SECOND_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MIN_SECOND_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MIN_SECOND_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MIN_SECOND_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MIN_SECOND_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MIN_SECOND_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MIN_SECOND_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MIN_SECOND_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MIN_SECOND_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MIN_SECOND_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MIN_SECOND_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MIN_SECOND_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MIN_SECOND_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MIN_SECOND_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MIN_SECOND_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MIN_SECOND_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MIN_SECOND_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MIN_SECOND_SEMIRING_FP64 ) ; default : ; } break ; @@ -517,16 +510,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MAX_SECOND_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MAX_SECOND_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MAX_SECOND_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MAX_SECOND_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MAX_SECOND_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MAX_SECOND_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MAX_SECOND_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MAX_SECOND_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MAX_SECOND_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MAX_SECOND_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MAX_SECOND_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MAX_SECOND_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MAX_SECOND_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MAX_SECOND_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MAX_SECOND_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MAX_SECOND_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MAX_SECOND_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MAX_SECOND_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MAX_SECOND_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MAX_SECOND_SEMIRING_FP64 ) ; default : ; } break ; @@ -535,16 +528,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_SECOND_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_SECOND_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_SECOND_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_SECOND_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_SECOND_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_SECOND_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_SECOND_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_SECOND_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_SECOND_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_SECOND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_SECOND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_SECOND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_SECOND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_SECOND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_SECOND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_SECOND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_SECOND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_SECOND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_SECOND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_SECOND_FP64 ) ; default : ; } break ; @@ -553,16 +546,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_SECOND_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_SECOND_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_SECOND_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_SECOND_UINT16) ; - case GB_INT32_code : return (GxB_TIMES_SECOND_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_SECOND_UINT32) ; - case GB_INT64_code : return (GxB_TIMES_SECOND_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_SECOND_UINT64) ; - case GB_FP32_code : return (GxB_TIMES_SECOND_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_SECOND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_SECOND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_SECOND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_SECOND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_SECOND_UINT16) ; + case GrB_INT32_CODE : return (GxB_TIMES_SECOND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_SECOND_UINT32) ; + case GrB_INT64_CODE : return (GxB_TIMES_SECOND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_SECOND_UINT64) ; + case GrB_FP32_CODE : return (GxB_TIMES_SECOND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_SECOND_FP64 ) ; default : ; } break ; @@ -571,16 +564,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_SECOND_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_SECOND_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_SECOND_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_SECOND_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_SECOND_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_SECOND_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_SECOND_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_SECOND_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_SECOND_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_SECOND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_SECOND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_SECOND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_SECOND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_SECOND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_SECOND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_SECOND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_SECOND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_SECOND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_SECOND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_SECOND_FP64 ) ; default : ; } break ; @@ -598,16 +591,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_PAIR_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_PAIR_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_PAIR_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_PAIR_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_PAIR_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_PAIR_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_PAIR_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_PAIR_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_PAIR_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_PAIR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_PAIR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_PAIR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_PAIR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_PAIR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_PAIR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_PAIR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_PAIR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_PAIR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_PAIR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_PAIR_FP64 ) ; default : ; } break ; @@ -616,16 +609,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_PAIR_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_PAIR_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_PAIR_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_PAIR_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_PAIR_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_PAIR_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_PAIR_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_PAIR_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_PAIR_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_PAIR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_PAIR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_PAIR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_PAIR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_PAIR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_PAIR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_PAIR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_PAIR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_PAIR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_PAIR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_PAIR_FP64 ) ; default : ; } break ; @@ -634,16 +627,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_PAIR_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_PAIR_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_PAIR_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_PAIR_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_PAIR_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_PAIR_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_PAIR_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_PAIR_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_PAIR_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_PAIR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_PAIR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_PAIR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_PAIR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_PAIR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_PAIR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_PAIR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_PAIR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_PAIR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_PAIR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_PAIR_FP64 ) ; default : ; } break ; @@ -652,16 +645,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_PAIR_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_PAIR_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_PAIR_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_PAIR_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_PAIR_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_PAIR_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_PAIR_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_PAIR_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_PAIR_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_PAIR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_PAIR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_PAIR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_PAIR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_PAIR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_PAIR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_PAIR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_PAIR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_PAIR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_PAIR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_PAIR_FP64 ) ; default : ; } break ; @@ -670,16 +663,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_PAIR_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_PAIR_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_PAIR_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_PAIR_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_PAIR_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_PAIR_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_PAIR_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_PAIR_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_PAIR_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_PAIR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_PAIR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_PAIR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_PAIR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_PAIR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_PAIR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_PAIR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_PAIR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_PAIR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_PAIR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_PAIR_FP64 ) ; default : ; } break ; @@ -697,16 +690,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_MIN_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_MIN_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_MIN_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_MIN_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_MIN_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_MIN_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_MIN_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_MIN_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_MIN_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_MIN_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_MIN_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_MIN_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_MIN_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_MIN_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_MIN_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_MIN_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_MIN_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_MIN_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_MIN_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_MIN_FP64 ) ; default : ; } break ; @@ -715,16 +708,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MAX_MIN_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MAX_MIN_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MAX_MIN_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MAX_MIN_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MAX_MIN_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MAX_MIN_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MAX_MIN_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MAX_MIN_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MAX_MIN_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MAX_MIN_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MAX_MIN_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MAX_MIN_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MAX_MIN_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MAX_MIN_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MAX_MIN_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MAX_MIN_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MAX_MIN_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MAX_MIN_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MAX_MIN_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MAX_MIN_SEMIRING_FP64 ) ; default : ; } break ; @@ -733,16 +726,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_PLUS_MIN_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_PLUS_MIN_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_PLUS_MIN_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_PLUS_MIN_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_PLUS_MIN_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_PLUS_MIN_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_PLUS_MIN_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_PLUS_MIN_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_PLUS_MIN_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_PLUS_MIN_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_PLUS_MIN_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_PLUS_MIN_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_PLUS_MIN_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_PLUS_MIN_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_PLUS_MIN_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_PLUS_MIN_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_PLUS_MIN_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_PLUS_MIN_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_PLUS_MIN_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_PLUS_MIN_SEMIRING_FP64 ) ; default : ; } break ; @@ -751,16 +744,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_MIN_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_MIN_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_MIN_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_MIN_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_MIN_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_MIN_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_MIN_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_MIN_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_MIN_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_MIN_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_MIN_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_MIN_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_MIN_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_MIN_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_MIN_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_MIN_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_MIN_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_MIN_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_MIN_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_MIN_FP64 ) ; default : ; } break ; @@ -769,16 +762,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_MIN_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_MIN_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_MIN_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_MIN_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_MIN_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_MIN_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_MIN_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_MIN_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_MIN_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_MIN_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_MIN_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_MIN_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_MIN_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_MIN_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_MIN_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_MIN_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_MIN_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_MIN_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_MIN_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_MIN_FP64 ) ; default : ; } break ; @@ -796,16 +789,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MIN_MAX_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MIN_MAX_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MIN_MAX_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MIN_MAX_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MIN_MAX_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MIN_MAX_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MIN_MAX_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MIN_MAX_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MIN_MAX_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MIN_MAX_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MIN_MAX_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MIN_MAX_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MIN_MAX_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MIN_MAX_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MIN_MAX_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MIN_MAX_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MIN_MAX_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MIN_MAX_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MIN_MAX_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MIN_MAX_SEMIRING_FP64 ) ; default : ; } break ; @@ -814,16 +807,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_MAX_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_MAX_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_MAX_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_MAX_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_MAX_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_MAX_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_MAX_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_MAX_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_MAX_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_MAX_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_MAX_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_MAX_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_MAX_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_MAX_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_MAX_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_MAX_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_MAX_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_MAX_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_MAX_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_MAX_FP64 ) ; default : ; } break ; @@ -832,16 +825,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_MAX_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_MAX_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_MAX_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_MAX_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_MAX_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_MAX_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_MAX_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_MAX_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_MAX_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_MAX_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_MAX_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_MAX_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_MAX_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_MAX_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_MAX_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_MAX_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_MAX_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_MAX_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_MAX_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_MAX_FP64 ) ; default : ; } break ; @@ -850,16 +843,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_MAX_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_MAX_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_MAX_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_MAX_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_MAX_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_MAX_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_MAX_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_MAX_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_MAX_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_MAX_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_MAX_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_MAX_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_MAX_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_MAX_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_MAX_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_MAX_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_MAX_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_MAX_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_MAX_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_MAX_FP64 ) ; default : ; } break ; @@ -868,16 +861,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_MAX_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_MAX_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_MAX_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_MAX_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_MAX_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_MAX_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_MAX_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_MAX_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_MAX_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_MAX_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_MAX_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_MAX_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_MAX_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_MAX_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_MAX_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_MAX_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_MAX_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_MAX_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_MAX_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_MAX_FP64 ) ; default : ; } break ; @@ -895,16 +888,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MIN_PLUS_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MIN_PLUS_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MIN_PLUS_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MIN_PLUS_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MIN_PLUS_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MIN_PLUS_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MIN_PLUS_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MIN_PLUS_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MIN_PLUS_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MIN_PLUS_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MIN_PLUS_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MIN_PLUS_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MIN_PLUS_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MIN_PLUS_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MIN_PLUS_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MIN_PLUS_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MIN_PLUS_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MIN_PLUS_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MIN_PLUS_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MIN_PLUS_SEMIRING_FP64 ) ; default : ; } break ; @@ -913,16 +906,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MAX_PLUS_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MAX_PLUS_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MAX_PLUS_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MAX_PLUS_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MAX_PLUS_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MAX_PLUS_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MAX_PLUS_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MAX_PLUS_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MAX_PLUS_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MAX_PLUS_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MAX_PLUS_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MAX_PLUS_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MAX_PLUS_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MAX_PLUS_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MAX_PLUS_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MAX_PLUS_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MAX_PLUS_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MAX_PLUS_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MAX_PLUS_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MAX_PLUS_SEMIRING_FP64 ) ; default : ; } break ; @@ -931,16 +924,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_PLUS_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_PLUS_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_PLUS_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_PLUS_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_PLUS_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_PLUS_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_PLUS_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_PLUS_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_PLUS_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_PLUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_PLUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_PLUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_PLUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_PLUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_PLUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_PLUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_PLUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_PLUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_PLUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_PLUS_FP64 ) ; default : ; } break ; @@ -949,16 +942,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_PLUS_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_PLUS_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_PLUS_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_PLUS_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_PLUS_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_PLUS_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_PLUS_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_PLUS_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_PLUS_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_PLUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_PLUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_PLUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_PLUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_PLUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_PLUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_PLUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_PLUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_PLUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_PLUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_PLUS_FP64 ) ; default : ; } break ; @@ -967,16 +960,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_PLUS_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_PLUS_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_PLUS_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_PLUS_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_PLUS_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_PLUS_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_PLUS_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_PLUS_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_PLUS_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_PLUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_PLUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_PLUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_PLUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_PLUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_PLUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_PLUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_PLUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_PLUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_PLUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_PLUS_FP64 ) ; default : ; } break ; @@ -994,16 +987,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_MINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_MINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_MINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_MINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_MINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_MINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_MINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_MINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_MINUS_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_MINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_MINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_MINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_MINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_MINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_MINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_MINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_MINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_MINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_MINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_MINUS_FP64 ) ; default : ; } break ; @@ -1012,16 +1005,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_MINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_MINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_MINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_MINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_MINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_MINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_MINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_MINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_MINUS_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_MINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_MINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_MINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_MINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_MINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_MINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_MINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_MINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_MINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_MINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_MINUS_FP64 ) ; default : ; } break ; @@ -1030,16 +1023,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_MINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_MINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_MINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_MINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_MINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_MINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_MINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_MINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_MINUS_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_MINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_MINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_MINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_MINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_MINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_MINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_MINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_MINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_MINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_MINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_MINUS_FP64 ) ; default : ; } break ; @@ -1048,16 +1041,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_MINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_MINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_MINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_MINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_MINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_MINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_MINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_MINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_MINUS_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_MINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_MINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_MINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_MINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_MINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_MINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_MINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_MINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_MINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_MINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_MINUS_FP64 ) ; default : ; } break ; @@ -1066,16 +1059,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_MINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_MINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_MINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_MINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_MINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_MINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_MINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_MINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_MINUS_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_MINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_MINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_MINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_MINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_MINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_MINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_MINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_MINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_MINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_MINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_MINUS_FP64 ) ; default : ; } break ; @@ -1093,16 +1086,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_RMINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_RMINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_RMINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_RMINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_RMINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_RMINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_RMINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_RMINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_RMINUS_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_RMINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_RMINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_RMINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_RMINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_RMINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_RMINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_RMINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_RMINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_RMINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_RMINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_RMINUS_FP64 ) ; default : ; } break ; @@ -1111,16 +1104,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_RMINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_RMINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_RMINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_RMINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_RMINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_RMINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_RMINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_RMINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_RMINUS_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_RMINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_RMINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_RMINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_RMINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_RMINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_RMINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_RMINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_RMINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_RMINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_RMINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_RMINUS_FP64 ) ; default : ; } break ; @@ -1129,16 +1122,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_RMINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_RMINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_RMINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_RMINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_RMINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_RMINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_RMINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_RMINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_RMINUS_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_RMINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_RMINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_RMINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_RMINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_RMINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_RMINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_RMINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_RMINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_RMINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_RMINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_RMINUS_FP64 ) ; default : ; } break ; @@ -1147,16 +1140,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_RMINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_RMINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_RMINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_RMINUS_UINT16) ; - case GB_INT32_code : return (GxB_TIMES_RMINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_RMINUS_UINT32) ; - case GB_INT64_code : return (GxB_TIMES_RMINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_RMINUS_UINT64) ; - case GB_FP32_code : return (GxB_TIMES_RMINUS_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_RMINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_RMINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_RMINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_RMINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_RMINUS_UINT16) ; + case GrB_INT32_CODE : return (GxB_TIMES_RMINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_RMINUS_UINT32) ; + case GrB_INT64_CODE : return (GxB_TIMES_RMINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_RMINUS_UINT64) ; + case GrB_FP32_CODE : return (GxB_TIMES_RMINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_RMINUS_FP64 ) ; default : ; } break ; @@ -1165,16 +1158,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_RMINUS_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_RMINUS_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_RMINUS_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_RMINUS_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_RMINUS_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_RMINUS_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_RMINUS_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_RMINUS_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_RMINUS_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_RMINUS_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_RMINUS_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_RMINUS_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_RMINUS_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_RMINUS_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_RMINUS_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_RMINUS_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_RMINUS_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_RMINUS_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_RMINUS_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_RMINUS_FP64 ) ; default : ; } break ; @@ -1192,16 +1185,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MIN_TIMES_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MIN_TIMES_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MIN_TIMES_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MIN_TIMES_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MIN_TIMES_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MIN_TIMES_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MIN_TIMES_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MIN_TIMES_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MIN_TIMES_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MIN_TIMES_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MIN_TIMES_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MIN_TIMES_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MIN_TIMES_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MIN_TIMES_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MIN_TIMES_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MIN_TIMES_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MIN_TIMES_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MIN_TIMES_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MIN_TIMES_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MIN_TIMES_SEMIRING_FP64 ) ; default : ; } break ; @@ -1210,16 +1203,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_MAX_TIMES_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_MAX_TIMES_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_MAX_TIMES_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_MAX_TIMES_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_MAX_TIMES_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_MAX_TIMES_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_MAX_TIMES_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_MAX_TIMES_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_MAX_TIMES_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_MAX_TIMES_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_MAX_TIMES_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_MAX_TIMES_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_MAX_TIMES_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_MAX_TIMES_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_MAX_TIMES_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_MAX_TIMES_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_MAX_TIMES_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_MAX_TIMES_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_MAX_TIMES_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_MAX_TIMES_SEMIRING_FP64 ) ; default : ; } break ; @@ -1228,16 +1221,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GrB_PLUS_TIMES_SEMIRING_INT8 ) ; - case GB_INT16_code : return (GrB_PLUS_TIMES_SEMIRING_INT16 ) ; - case GB_INT32_code : return (GrB_PLUS_TIMES_SEMIRING_INT32 ) ; - case GB_INT64_code : return (GrB_PLUS_TIMES_SEMIRING_INT64 ) ; - case GB_UINT8_code : return (GrB_PLUS_TIMES_SEMIRING_UINT8 ) ; - case GB_UINT16_code : return (GrB_PLUS_TIMES_SEMIRING_UINT16) ; - case GB_UINT32_code : return (GrB_PLUS_TIMES_SEMIRING_UINT32) ; - case GB_UINT64_code : return (GrB_PLUS_TIMES_SEMIRING_UINT64) ; - case GB_FP32_code : return (GrB_PLUS_TIMES_SEMIRING_FP32 ) ; - case GB_FP64_code : return (GrB_PLUS_TIMES_SEMIRING_FP64 ) ; + case GrB_INT8_CODE : return (GrB_PLUS_TIMES_SEMIRING_INT8 ) ; + case GrB_INT16_CODE : return (GrB_PLUS_TIMES_SEMIRING_INT16 ) ; + case GrB_INT32_CODE : return (GrB_PLUS_TIMES_SEMIRING_INT32 ) ; + case GrB_INT64_CODE : return (GrB_PLUS_TIMES_SEMIRING_INT64 ) ; + case GrB_UINT8_CODE : return (GrB_PLUS_TIMES_SEMIRING_UINT8 ) ; + case GrB_UINT16_CODE : return (GrB_PLUS_TIMES_SEMIRING_UINT16) ; + case GrB_UINT32_CODE : return (GrB_PLUS_TIMES_SEMIRING_UINT32) ; + case GrB_UINT64_CODE : return (GrB_PLUS_TIMES_SEMIRING_UINT64) ; + case GrB_FP32_CODE : return (GrB_PLUS_TIMES_SEMIRING_FP32 ) ; + case GrB_FP64_CODE : return (GrB_PLUS_TIMES_SEMIRING_FP64 ) ; default : ; } break ; @@ -1246,16 +1239,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_TIMES_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_TIMES_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_TIMES_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_TIMES_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_TIMES_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_TIMES_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_TIMES_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_TIMES_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_TIMES_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_TIMES_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_TIMES_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_TIMES_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_TIMES_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_TIMES_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_TIMES_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_TIMES_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_TIMES_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_TIMES_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_TIMES_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_TIMES_FP64 ) ; default : ; } break ; @@ -1264,16 +1257,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_TIMES_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_TIMES_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_TIMES_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_TIMES_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_TIMES_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_TIMES_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_TIMES_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_TIMES_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_TIMES_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_TIMES_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_TIMES_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_TIMES_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_TIMES_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_TIMES_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_TIMES_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_TIMES_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_TIMES_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_TIMES_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_TIMES_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_TIMES_FP64 ) ; default : ; } break ; @@ -1291,16 +1284,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_DIV_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_DIV_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_DIV_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_DIV_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_DIV_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_DIV_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_DIV_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_DIV_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_DIV_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_DIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_DIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_DIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_DIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_DIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_DIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_DIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_DIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_DIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_DIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_DIV_FP64 ) ; default : ; } break ; @@ -1309,16 +1302,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_DIV_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_DIV_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_DIV_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_DIV_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_DIV_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_DIV_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_DIV_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_DIV_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_DIV_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_DIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_DIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_DIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_DIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_DIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_DIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_DIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_DIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_DIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_DIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_DIV_FP64 ) ; default : ; } break ; @@ -1327,16 +1320,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_DIV_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_DIV_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_DIV_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_DIV_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_DIV_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_DIV_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_DIV_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_DIV_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_DIV_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_DIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_DIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_DIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_DIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_DIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_DIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_DIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_DIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_DIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_DIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_DIV_FP64 ) ; default : ; } break ; @@ -1345,16 +1338,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_DIV_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_DIV_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_DIV_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_DIV_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_DIV_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_DIV_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_DIV_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_DIV_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_DIV_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_DIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_DIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_DIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_DIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_DIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_DIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_DIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_DIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_DIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_DIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_DIV_FP64 ) ; default : ; } break ; @@ -1363,16 +1356,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_DIV_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_DIV_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_DIV_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_DIV_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_DIV_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_DIV_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_DIV_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_DIV_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_DIV_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_DIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_DIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_DIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_DIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_DIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_DIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_DIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_DIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_DIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_DIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_DIV_FP64 ) ; default : ; } break ; @@ -1390,16 +1383,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_RDIV_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_RDIV_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_RDIV_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_RDIV_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_RDIV_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_RDIV_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_RDIV_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_RDIV_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_RDIV_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_RDIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_RDIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_RDIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_RDIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_RDIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_RDIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_RDIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_RDIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_RDIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_RDIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_RDIV_FP64 ) ; default : ; } break ; @@ -1408,16 +1401,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_RDIV_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_RDIV_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_RDIV_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_RDIV_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_RDIV_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_RDIV_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_RDIV_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_RDIV_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_RDIV_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_RDIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_RDIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_RDIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_RDIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_RDIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_RDIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_RDIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_RDIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_RDIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_RDIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_RDIV_FP64 ) ; default : ; } break ; @@ -1426,16 +1419,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_RDIV_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_RDIV_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_RDIV_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_RDIV_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_RDIV_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_RDIV_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_RDIV_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_RDIV_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_RDIV_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_RDIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_RDIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_RDIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_RDIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_RDIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_RDIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_RDIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_RDIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_RDIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_RDIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_RDIV_FP64 ) ; default : ; } break ; @@ -1444,16 +1437,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_RDIV_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_RDIV_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_RDIV_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_RDIV_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_RDIV_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_RDIV_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_RDIV_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_RDIV_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_RDIV_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_RDIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_RDIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_RDIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_RDIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_RDIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_RDIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_RDIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_RDIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_RDIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_RDIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_RDIV_FP64 ) ; default : ; } break ; @@ -1462,16 +1455,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_RDIV_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_RDIV_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_RDIV_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_RDIV_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_RDIV_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_RDIV_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_RDIV_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_RDIV_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_RDIV_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_RDIV_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_RDIV_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_RDIV_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_RDIV_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_RDIV_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_RDIV_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_RDIV_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_RDIV_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_RDIV_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_RDIV_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_RDIV_FP64 ) ; default : ; } break ; @@ -1489,16 +1482,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISEQ_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISEQ_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISEQ_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISEQ_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISEQ_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISEQ_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISEQ_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISEQ_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISEQ_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISEQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISEQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISEQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISEQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISEQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISEQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISEQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISEQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISEQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISEQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISEQ_FP64 ) ; default : ; } break ; @@ -1507,16 +1500,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISEQ_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISEQ_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISEQ_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISEQ_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISEQ_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISEQ_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISEQ_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISEQ_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISEQ_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISEQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISEQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISEQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISEQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISEQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISEQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISEQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISEQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISEQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISEQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISEQ_FP64 ) ; default : ; } break ; @@ -1525,16 +1518,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISEQ_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISEQ_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISEQ_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISEQ_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISEQ_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISEQ_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISEQ_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISEQ_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISEQ_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISEQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISEQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISEQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISEQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISEQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISEQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISEQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISEQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISEQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISEQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISEQ_FP64 ) ; default : ; } break ; @@ -1543,16 +1536,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISEQ_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISEQ_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISEQ_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISEQ_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISEQ_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISEQ_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISEQ_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISEQ_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISEQ_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISEQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISEQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISEQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISEQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISEQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISEQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISEQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISEQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISEQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISEQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISEQ_FP64 ) ; default : ; } break ; @@ -1561,16 +1554,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISEQ_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISEQ_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISEQ_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISEQ_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISEQ_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISEQ_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISEQ_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISEQ_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISEQ_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISEQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISEQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISEQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISEQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISEQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISEQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISEQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISEQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISEQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISEQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISEQ_FP64 ) ; default : ; } break ; @@ -1588,16 +1581,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISNE_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISNE_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISNE_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISNE_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISNE_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISNE_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISNE_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISNE_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISNE_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISNE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISNE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISNE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISNE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISNE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISNE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISNE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISNE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISNE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISNE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISNE_FP64 ) ; default : ; } break ; @@ -1606,16 +1599,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISNE_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISNE_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISNE_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISNE_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISNE_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISNE_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISNE_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISNE_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISNE_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISNE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISNE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISNE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISNE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISNE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISNE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISNE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISNE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISNE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISNE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISNE_FP64 ) ; default : ; } break ; @@ -1624,16 +1617,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISNE_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISNE_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISNE_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISNE_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISNE_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISNE_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISNE_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISNE_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISNE_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISNE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISNE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISNE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISNE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISNE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISNE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISNE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISNE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISNE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISNE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISNE_FP64 ) ; default : ; } break ; @@ -1642,16 +1635,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISNE_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISNE_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISNE_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISNE_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISNE_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISNE_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISNE_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISNE_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISNE_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISNE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISNE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISNE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISNE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISNE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISNE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISNE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISNE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISNE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISNE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISNE_FP64 ) ; default : ; } break ; @@ -1660,16 +1653,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISNE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISNE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISNE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISNE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISNE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISNE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISNE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISNE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISNE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISNE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISNE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISNE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISNE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISNE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISNE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISNE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISNE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISNE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISNE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISNE_FP64 ) ; default : ; } break ; @@ -1687,16 +1680,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISGT_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISGT_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISGT_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISGT_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISGT_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISGT_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISGT_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISGT_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISGT_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISGT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISGT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISGT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISGT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISGT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISGT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISGT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISGT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISGT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISGT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISGT_FP64 ) ; default : ; } break ; @@ -1705,16 +1698,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISGT_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISGT_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISGT_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISGT_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISGT_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISGT_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISGT_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISGT_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISGT_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISGT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISGT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISGT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISGT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISGT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISGT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISGT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISGT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISGT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISGT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISGT_FP64 ) ; default : ; } break ; @@ -1723,16 +1716,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISGT_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISGT_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISGT_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISGT_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISGT_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISGT_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISGT_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISGT_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISGT_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISGT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISGT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISGT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISGT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISGT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISGT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISGT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISGT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISGT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISGT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISGT_FP64 ) ; default : ; } break ; @@ -1741,16 +1734,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISGT_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISGT_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISGT_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISGT_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISGT_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISGT_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISGT_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISGT_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISGT_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISGT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISGT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISGT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISGT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISGT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISGT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISGT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISGT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISGT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISGT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISGT_FP64 ) ; default : ; } break ; @@ -1759,16 +1752,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISGT_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISGT_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISGT_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISGT_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISGT_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISGT_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISGT_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISGT_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISGT_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISGT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISGT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISGT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISGT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISGT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISGT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISGT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISGT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISGT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISGT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISGT_FP64 ) ; default : ; } break ; @@ -1786,16 +1779,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISLT_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISLT_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISLT_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISLT_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISLT_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISLT_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISLT_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISLT_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISLT_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISLT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISLT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISLT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISLT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISLT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISLT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISLT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISLT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISLT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISLT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISLT_FP64 ) ; default : ; } break ; @@ -1804,16 +1797,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISLT_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISLT_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISLT_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISLT_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISLT_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISLT_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISLT_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISLT_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISLT_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISLT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISLT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISLT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISLT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISLT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISLT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISLT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISLT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISLT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISLT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISLT_FP64 ) ; default : ; } break ; @@ -1822,16 +1815,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISLT_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISLT_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISLT_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISLT_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISLT_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISLT_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISLT_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISLT_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISLT_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISLT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISLT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISLT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISLT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISLT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISLT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISLT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISLT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISLT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISLT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISLT_FP64 ) ; default : ; } break ; @@ -1840,16 +1833,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISLT_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISLT_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISLT_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISLT_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISLT_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISLT_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISLT_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISLT_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISLT_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISLT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISLT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISLT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISLT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISLT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISLT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISLT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISLT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISLT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISLT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISLT_FP64 ) ; default : ; } break ; @@ -1858,16 +1851,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISLT_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISLT_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISLT_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISLT_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISLT_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISLT_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISLT_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISLT_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISLT_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISLT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISLT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISLT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISLT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISLT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISLT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISLT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISLT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISLT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISLT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISLT_FP64 ) ; default : ; } break ; @@ -1885,16 +1878,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISGE_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISGE_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISGE_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISGE_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISGE_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISGE_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISGE_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISGE_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISGE_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISGE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISGE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISGE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISGE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISGE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISGE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISGE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISGE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISGE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISGE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISGE_FP64 ) ; default : ; } break ; @@ -1903,16 +1896,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISGE_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISGE_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISGE_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISGE_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISGE_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISGE_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISGE_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISGE_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISGE_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISGE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISGE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISGE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISGE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISGE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISGE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISGE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISGE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISGE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISGE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISGE_FP64 ) ; default : ; } break ; @@ -1921,16 +1914,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISGE_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISGE_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISGE_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISGE_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISGE_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISGE_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISGE_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISGE_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISGE_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISGE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISGE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISGE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISGE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISGE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISGE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISGE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISGE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISGE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISGE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISGE_FP64 ) ; default : ; } break ; @@ -1939,16 +1932,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISGE_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISGE_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISGE_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISGE_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISGE_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISGE_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISGE_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISGE_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISGE_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISGE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISGE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISGE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISGE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISGE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISGE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISGE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISGE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISGE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISGE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISGE_FP64 ) ; default : ; } break ; @@ -1957,16 +1950,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISGE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISGE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISGE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISGE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISGE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISGE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISGE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISGE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISGE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISGE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISGE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISGE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISGE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISGE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISGE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISGE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISGE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISGE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISGE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISGE_FP64 ) ; default : ; } break ; @@ -1984,16 +1977,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_ISLE_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_ISLE_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_ISLE_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_ISLE_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_ISLE_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_ISLE_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_ISLE_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_ISLE_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_ISLE_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_ISLE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_ISLE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_ISLE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_ISLE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_ISLE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_ISLE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_ISLE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_ISLE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_ISLE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_ISLE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_ISLE_FP64 ) ; default : ; } break ; @@ -2002,16 +1995,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_ISLE_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_ISLE_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_ISLE_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_ISLE_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_ISLE_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_ISLE_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_ISLE_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_ISLE_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_ISLE_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_ISLE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_ISLE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_ISLE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_ISLE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_ISLE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_ISLE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_ISLE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_ISLE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_ISLE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_ISLE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_ISLE_FP64 ) ; default : ; } break ; @@ -2020,16 +2013,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_ISLE_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_ISLE_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_ISLE_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_ISLE_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_ISLE_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_ISLE_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_ISLE_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_ISLE_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_ISLE_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_ISLE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_ISLE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_ISLE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_ISLE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_ISLE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_ISLE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_ISLE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_ISLE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_ISLE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_ISLE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_ISLE_FP64 ) ; default : ; } break ; @@ -2038,16 +2031,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_ISLE_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_ISLE_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_ISLE_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_ISLE_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_ISLE_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_ISLE_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_ISLE_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_ISLE_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_ISLE_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_ISLE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_ISLE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_ISLE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_ISLE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_ISLE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_ISLE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_ISLE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_ISLE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_ISLE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_ISLE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_ISLE_FP64 ) ; default : ; } break ; @@ -2056,16 +2049,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_ISLE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_ISLE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_ISLE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_ISLE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_ISLE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_ISLE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_ISLE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_ISLE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_ISLE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_ISLE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_ISLE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_ISLE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_ISLE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_ISLE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_ISLE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_ISLE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_ISLE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_ISLE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_ISLE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_ISLE_FP64 ) ; default : ; } break ; @@ -2083,16 +2076,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_LOR_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_LOR_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_LOR_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_LOR_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_LOR_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_LOR_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_LOR_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_LOR_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_LOR_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_LOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_LOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_LOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_LOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_LOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_LOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_LOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_LOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_LOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_LOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_LOR_FP64 ) ; default : ; } break ; @@ -2101,16 +2094,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_LOR_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_LOR_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_LOR_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_LOR_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_LOR_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_LOR_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_LOR_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_LOR_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_LOR_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_LOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_LOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_LOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_LOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_LOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_LOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_LOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_LOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_LOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_LOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_LOR_FP64 ) ; default : ; } break ; @@ -2119,16 +2112,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_LOR_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_LOR_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_LOR_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_LOR_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_LOR_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_LOR_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_LOR_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_LOR_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_LOR_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_LOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_LOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_LOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_LOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_LOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_LOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_LOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_LOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_LOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_LOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_LOR_FP64 ) ; default : ; } break ; @@ -2137,16 +2130,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_LOR_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_LOR_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_LOR_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_LOR_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_LOR_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_LOR_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_LOR_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_LOR_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_LOR_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_LOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_LOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_LOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_LOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_LOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_LOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_LOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_LOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_LOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_LOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_LOR_FP64 ) ; default : ; } break ; @@ -2155,16 +2148,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_LOR_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_LOR_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_LOR_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_LOR_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_LOR_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_LOR_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_LOR_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_LOR_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_LOR_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_LOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_LOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_LOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_LOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_LOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_LOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_LOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_LOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_LOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_LOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_LOR_FP64 ) ; default : ; } break ; @@ -2182,16 +2175,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_LAND_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_LAND_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_LAND_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_LAND_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_LAND_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_LAND_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_LAND_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_LAND_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_LAND_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_LAND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_LAND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_LAND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_LAND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_LAND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_LAND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_LAND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_LAND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_LAND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_LAND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_LAND_FP64 ) ; default : ; } break ; @@ -2200,16 +2193,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_LAND_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_LAND_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_LAND_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_LAND_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_LAND_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_LAND_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_LAND_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_LAND_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_LAND_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_LAND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_LAND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_LAND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_LAND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_LAND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_LAND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_LAND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_LAND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_LAND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_LAND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_LAND_FP64 ) ; default : ; } break ; @@ -2218,16 +2211,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_LAND_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_LAND_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_LAND_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_LAND_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_LAND_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_LAND_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_LAND_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_LAND_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_LAND_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_LAND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_LAND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_LAND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_LAND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_LAND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_LAND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_LAND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_LAND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_LAND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_LAND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_LAND_FP64 ) ; default : ; } break ; @@ -2236,16 +2229,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_LAND_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_LAND_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_LAND_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_LAND_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_LAND_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_LAND_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_LAND_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_LAND_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_LAND_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_LAND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_LAND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_LAND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_LAND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_LAND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_LAND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_LAND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_LAND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_LAND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_LAND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_LAND_FP64 ) ; default : ; } break ; @@ -2254,16 +2247,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_LAND_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_LAND_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_LAND_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_LAND_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_LAND_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_LAND_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_LAND_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_LAND_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_LAND_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_LAND_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_LAND_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_LAND_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_LAND_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_LAND_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_LAND_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_LAND_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_LAND_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_LAND_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_LAND_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_LAND_FP64 ) ; default : ; } break ; @@ -2281,16 +2274,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MIN_LXOR_INT8 ) ; - case GB_UINT8_code : return (GxB_MIN_LXOR_UINT8 ) ; - case GB_INT16_code : return (GxB_MIN_LXOR_INT16 ) ; - case GB_UINT16_code : return (GxB_MIN_LXOR_UINT16 ) ; - case GB_INT32_code : return (GxB_MIN_LXOR_INT32 ) ; - case GB_UINT32_code : return (GxB_MIN_LXOR_UINT32 ) ; - case GB_INT64_code : return (GxB_MIN_LXOR_INT64 ) ; - case GB_UINT64_code : return (GxB_MIN_LXOR_UINT64 ) ; - case GB_FP32_code : return (GxB_MIN_LXOR_FP32 ) ; - case GB_FP64_code : return (GxB_MIN_LXOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MIN_LXOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MIN_LXOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MIN_LXOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MIN_LXOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MIN_LXOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MIN_LXOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MIN_LXOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MIN_LXOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MIN_LXOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MIN_LXOR_FP64 ) ; default : ; } break ; @@ -2299,16 +2292,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_MAX_LXOR_INT8 ) ; - case GB_UINT8_code : return (GxB_MAX_LXOR_UINT8 ) ; - case GB_INT16_code : return (GxB_MAX_LXOR_INT16 ) ; - case GB_UINT16_code : return (GxB_MAX_LXOR_UINT16 ) ; - case GB_INT32_code : return (GxB_MAX_LXOR_INT32 ) ; - case GB_UINT32_code : return (GxB_MAX_LXOR_UINT32 ) ; - case GB_INT64_code : return (GxB_MAX_LXOR_INT64 ) ; - case GB_UINT64_code : return (GxB_MAX_LXOR_UINT64 ) ; - case GB_FP32_code : return (GxB_MAX_LXOR_FP32 ) ; - case GB_FP64_code : return (GxB_MAX_LXOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_MAX_LXOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_MAX_LXOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_MAX_LXOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_MAX_LXOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_MAX_LXOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_MAX_LXOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_MAX_LXOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_MAX_LXOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_MAX_LXOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_MAX_LXOR_FP64 ) ; default : ; } break ; @@ -2317,16 +2310,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_PLUS_LXOR_INT8 ) ; - case GB_UINT8_code : return (GxB_PLUS_LXOR_UINT8 ) ; - case GB_INT16_code : return (GxB_PLUS_LXOR_INT16 ) ; - case GB_UINT16_code : return (GxB_PLUS_LXOR_UINT16 ) ; - case GB_INT32_code : return (GxB_PLUS_LXOR_INT32 ) ; - case GB_UINT32_code : return (GxB_PLUS_LXOR_UINT32 ) ; - case GB_INT64_code : return (GxB_PLUS_LXOR_INT64 ) ; - case GB_UINT64_code : return (GxB_PLUS_LXOR_UINT64 ) ; - case GB_FP32_code : return (GxB_PLUS_LXOR_FP32 ) ; - case GB_FP64_code : return (GxB_PLUS_LXOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_PLUS_LXOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_PLUS_LXOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_PLUS_LXOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_PLUS_LXOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_PLUS_LXOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_PLUS_LXOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_PLUS_LXOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_PLUS_LXOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_PLUS_LXOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_PLUS_LXOR_FP64 ) ; default : ; } break ; @@ -2335,16 +2328,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_TIMES_LXOR_INT8 ) ; - case GB_UINT8_code : return (GxB_TIMES_LXOR_UINT8 ) ; - case GB_INT16_code : return (GxB_TIMES_LXOR_INT16 ) ; - case GB_UINT16_code : return (GxB_TIMES_LXOR_UINT16 ) ; - case GB_INT32_code : return (GxB_TIMES_LXOR_INT32 ) ; - case GB_UINT32_code : return (GxB_TIMES_LXOR_UINT32 ) ; - case GB_INT64_code : return (GxB_TIMES_LXOR_INT64 ) ; - case GB_UINT64_code : return (GxB_TIMES_LXOR_UINT64 ) ; - case GB_FP32_code : return (GxB_TIMES_LXOR_FP32 ) ; - case GB_FP64_code : return (GxB_TIMES_LXOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_TIMES_LXOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_TIMES_LXOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_TIMES_LXOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_TIMES_LXOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_TIMES_LXOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_TIMES_LXOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_TIMES_LXOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_TIMES_LXOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_TIMES_LXOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_TIMES_LXOR_FP64 ) ; default : ; } break ; @@ -2353,16 +2346,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_INT8_code : return (GxB_ANY_LXOR_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_LXOR_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_LXOR_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_LXOR_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_LXOR_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_LXOR_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_LXOR_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_LXOR_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_LXOR_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_LXOR_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_LXOR_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_LXOR_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_LXOR_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_LXOR_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_LXOR_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_LXOR_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_LXOR_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_LXOR_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_LXOR_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_LXOR_FP64 ) ; default : ; } break ; @@ -2389,10 +2382,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BOR_BOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BOR_BOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BOR_BOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BOR_BOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BOR_BOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BOR_BOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BOR_BOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BOR_BOR_UINT64 ) ; default : ; } break ; @@ -2401,10 +2394,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BAND_BOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BAND_BOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BAND_BOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BAND_BOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BAND_BOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BAND_BOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BAND_BOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BAND_BOR_UINT64 ) ; default : ; } break ; @@ -2413,10 +2406,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXOR_BOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXOR_BOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXOR_BOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXOR_BOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXOR_BOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXOR_BOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXOR_BOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXOR_BOR_UINT64 ) ; default : ; } break ; @@ -2425,10 +2418,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXNOR_BOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXNOR_BOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXNOR_BOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXNOR_BOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXNOR_BOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXNOR_BOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXNOR_BOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXNOR_BOR_UINT64 ) ; default : ; } break ; @@ -2445,10 +2438,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BOR_BAND_UINT8 ) ; - case GB_UINT16_code : return (GxB_BOR_BAND_UINT16 ) ; - case GB_UINT32_code : return (GxB_BOR_BAND_UINT32 ) ; - case GB_UINT64_code : return (GxB_BOR_BAND_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BOR_BAND_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BOR_BAND_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BOR_BAND_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BOR_BAND_UINT64 ) ; default : ; } break ; @@ -2457,10 +2450,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BAND_BAND_UINT8 ) ; - case GB_UINT16_code : return (GxB_BAND_BAND_UINT16 ) ; - case GB_UINT32_code : return (GxB_BAND_BAND_UINT32 ) ; - case GB_UINT64_code : return (GxB_BAND_BAND_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BAND_BAND_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BAND_BAND_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BAND_BAND_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BAND_BAND_UINT64 ) ; default : ; } break ; @@ -2469,10 +2462,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXOR_BAND_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXOR_BAND_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXOR_BAND_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXOR_BAND_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXOR_BAND_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXOR_BAND_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXOR_BAND_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXOR_BAND_UINT64 ) ; default : ; } break ; @@ -2481,10 +2474,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXNOR_BAND_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXNOR_BAND_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXNOR_BAND_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXNOR_BAND_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXNOR_BAND_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXNOR_BAND_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXNOR_BAND_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXNOR_BAND_UINT64 ) ; default : ; } break ; @@ -2501,10 +2494,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BOR_BXOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BOR_BXOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BOR_BXOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BOR_BXOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BOR_BXOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BOR_BXOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BOR_BXOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BOR_BXOR_UINT64 ) ; default : ; } break ; @@ -2513,10 +2506,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BAND_BXOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BAND_BXOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BAND_BXOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BAND_BXOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BAND_BXOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BAND_BXOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BAND_BXOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BAND_BXOR_UINT64 ) ; default : ; } break ; @@ -2525,10 +2518,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXOR_BXOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXOR_BXOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXOR_BXOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXOR_BXOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXOR_BXOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXOR_BXOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXOR_BXOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXOR_BXOR_UINT64 ) ; default : ; } break ; @@ -2537,10 +2530,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXNOR_BXOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXNOR_BXOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXNOR_BXOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXNOR_BXOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXNOR_BXOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXNOR_BXOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXNOR_BXOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXNOR_BXOR_UINT64 ) ; default : ; } break ; @@ -2557,10 +2550,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BOR_BXNOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BOR_BXNOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BOR_BXNOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BOR_BXNOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BOR_BXNOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BOR_BXNOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BOR_BXNOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BOR_BXNOR_UINT64 ) ; default : ; } break ; @@ -2569,10 +2562,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BAND_BXNOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BAND_BXNOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BAND_BXNOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BAND_BXNOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BAND_BXNOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BAND_BXNOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BAND_BXNOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BAND_BXNOR_UINT64 ) ; default : ; } break ; @@ -2581,10 +2574,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXOR_BXNOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXOR_BXNOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXOR_BXNOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXOR_BXNOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXOR_BXNOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXOR_BXNOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXOR_BXNOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXOR_BXNOR_UINT64 ) ; default : ; } break ; @@ -2593,10 +2586,10 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (zcode) { - case GB_UINT8_code : return (GxB_BXNOR_BXNOR_UINT8 ) ; - case GB_UINT16_code : return (GxB_BXNOR_BXNOR_UINT16 ) ; - case GB_UINT32_code : return (GxB_BXNOR_BXNOR_UINT32 ) ; - case GB_UINT64_code : return (GxB_BXNOR_BXNOR_UINT64 ) ; + case GrB_UINT8_CODE : return (GxB_BXNOR_BXNOR_UINT8 ) ; + case GrB_UINT16_CODE : return (GxB_BXNOR_BXNOR_UINT16 ) ; + case GrB_UINT32_CODE : return (GxB_BXNOR_BXNOR_UINT32 ) ; + case GrB_UINT64_CODE : return (GxB_BXNOR_BXNOR_UINT64 ) ; default : ; } break ; @@ -2617,7 +2610,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2645,7 +2638,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2673,7 +2666,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2701,7 +2694,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2729,7 +2722,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2757,7 +2750,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j)) == k+1 - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2785,7 +2778,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_SECONDJ_binop_code : // z = second_j(x,B(i,j)) == j - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2813,7 +2806,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error case GB_SECONDJ1_binop_code : // z = second_j1(x,B(i,j)) == j+1 - if (zcode == GB_INT64_code) + if (zcode == GrB_INT64_CODE) { switch (add_binop_code) { @@ -2843,7 +2836,7 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error } } - else if (xcode != GB_BOOL_code) + else if (xcode != GrB_BOOL_CODE) { //---------------------------------------------------------------------- @@ -2864,16 +2857,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_EQ_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_EQ_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_EQ_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_EQ_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_EQ_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_EQ_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_EQ_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_EQ_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_EQ_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_EQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_EQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_EQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_EQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_EQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_EQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_EQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_EQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_EQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_EQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_EQ_FP64 ) ; default : ; } break ; @@ -2882,16 +2875,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_EQ_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_EQ_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_EQ_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_EQ_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_EQ_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_EQ_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_EQ_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_EQ_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_EQ_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_EQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_EQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_EQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_EQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_EQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_EQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_EQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_EQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_EQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_EQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_EQ_FP64 ) ; default : ; } break ; @@ -2900,16 +2893,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_EQ_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_EQ_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_EQ_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_EQ_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_EQ_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_EQ_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_EQ_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_EQ_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_EQ_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_EQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_EQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_EQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_EQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_EQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_EQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_EQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_EQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_EQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_EQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_EQ_FP64 ) ; default : ; } break ; @@ -2918,16 +2911,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_EQ_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_EQ_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_EQ_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_EQ_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_EQ_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_EQ_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_EQ_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_EQ_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_EQ_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_EQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_EQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_EQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_EQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_EQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_EQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_EQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_EQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_EQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_EQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_EQ_FP64 ) ; default : ; } break ; @@ -2936,16 +2929,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_EQ_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_EQ_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_EQ_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_EQ_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_EQ_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_EQ_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_EQ_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_EQ_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_EQ_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_EQ_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_EQ_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_EQ_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_EQ_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_EQ_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_EQ_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_EQ_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_EQ_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_EQ_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_EQ_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_EQ_FP64 ) ; default : ; } break ; @@ -2963,16 +2956,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_NE_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_NE_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_NE_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_NE_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_NE_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_NE_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_NE_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_NE_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_NE_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_NE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_NE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_NE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_NE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_NE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_NE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_NE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_NE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_NE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_NE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_NE_FP64 ) ; default : ; } break ; @@ -2981,16 +2974,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_NE_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_NE_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_NE_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_NE_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_NE_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_NE_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_NE_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_NE_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_NE_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_NE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_NE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_NE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_NE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_NE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_NE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_NE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_NE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_NE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_NE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_NE_FP64 ) ; default : ; } break ; @@ -2999,16 +2992,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_NE_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_NE_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_NE_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_NE_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_NE_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_NE_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_NE_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_NE_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_NE_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_NE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_NE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_NE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_NE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_NE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_NE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_NE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_NE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_NE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_NE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_NE_FP64 ) ; default : ; } break ; @@ -3017,16 +3010,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_NE_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_NE_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_NE_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_NE_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_NE_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_NE_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_NE_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_NE_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_NE_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_NE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_NE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_NE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_NE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_NE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_NE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_NE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_NE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_NE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_NE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_NE_FP64 ) ; default : ; } break ; @@ -3035,16 +3028,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_NE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_NE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_NE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_NE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_NE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_NE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_NE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_NE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_NE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_NE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_NE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_NE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_NE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_NE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_NE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_NE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_NE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_NE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_NE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_NE_FP64 ) ; default : ; } break ; @@ -3062,16 +3055,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_GT_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_GT_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_GT_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_GT_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_GT_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_GT_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_GT_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_GT_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_GT_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_GT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_GT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_GT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_GT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_GT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_GT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_GT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_GT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_GT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_GT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_GT_FP64 ) ; default : ; } break ; @@ -3080,16 +3073,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_GT_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_GT_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_GT_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_GT_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_GT_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_GT_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_GT_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_GT_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_GT_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_GT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_GT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_GT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_GT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_GT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_GT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_GT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_GT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_GT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_GT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_GT_FP64 ) ; default : ; } break ; @@ -3098,16 +3091,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_GT_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_GT_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_GT_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_GT_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_GT_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_GT_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_GT_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_GT_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_GT_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_GT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_GT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_GT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_GT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_GT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_GT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_GT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_GT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_GT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_GT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_GT_FP64 ) ; default : ; } break ; @@ -3116,16 +3109,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_GT_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_GT_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_GT_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_GT_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_GT_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_GT_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_GT_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_GT_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_GT_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_GT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_GT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_GT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_GT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_GT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_GT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_GT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_GT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_GT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_GT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_GT_FP64 ) ; default : ; } break ; @@ -3134,16 +3127,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_GT_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_GT_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_GT_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_GT_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_GT_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_GT_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_GT_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_GT_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_GT_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_GT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_GT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_GT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_GT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_GT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_GT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_GT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_GT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_GT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_GT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_GT_FP64 ) ; default : ; } break ; @@ -3161,16 +3154,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_LT_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_LT_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_LT_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_LT_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_LT_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_LT_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_LT_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_LT_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_LT_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_LT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_LT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_LT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_LT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_LT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_LT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_LT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_LT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_LT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_LT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_LT_FP64 ) ; default : ; } break ; @@ -3179,16 +3172,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_LT_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_LT_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_LT_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_LT_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_LT_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_LT_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_LT_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_LT_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_LT_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_LT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_LT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_LT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_LT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_LT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_LT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_LT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_LT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_LT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_LT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_LT_FP64 ) ; default : ; } break ; @@ -3197,16 +3190,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_LT_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_LT_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_LT_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_LT_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_LT_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_LT_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_LT_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_LT_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_LT_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_LT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_LT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_LT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_LT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_LT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_LT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_LT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_LT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_LT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_LT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_LT_FP64 ) ; default : ; } break ; @@ -3215,16 +3208,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_LT_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_LT_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_LT_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_LT_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_LT_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_LT_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_LT_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_LT_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_LT_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_LT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_LT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_LT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_LT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_LT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_LT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_LT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_LT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_LT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_LT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_LT_FP64 ) ; default : ; } break ; @@ -3233,16 +3226,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_LT_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_LT_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_LT_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_LT_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_LT_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_LT_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_LT_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_LT_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_LT_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_LT_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_LT_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_LT_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_LT_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_LT_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_LT_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_LT_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_LT_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_LT_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_LT_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_LT_FP64 ) ; default : ; } break ; @@ -3260,16 +3253,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_GE_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_GE_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_GE_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_GE_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_GE_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_GE_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_GE_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_GE_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_GE_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_GE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_GE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_GE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_GE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_GE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_GE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_GE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_GE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_GE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_GE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_GE_FP64 ) ; default : ; } break ; @@ -3278,16 +3271,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_GE_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_GE_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_GE_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_GE_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_GE_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_GE_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_GE_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_GE_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_GE_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_GE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_GE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_GE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_GE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_GE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_GE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_GE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_GE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_GE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_GE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_GE_FP64 ) ; default : ; } break ; @@ -3296,16 +3289,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_GE_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_GE_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_GE_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_GE_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_GE_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_GE_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_GE_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_GE_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_GE_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_GE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_GE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_GE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_GE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_GE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_GE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_GE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_GE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_GE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_GE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_GE_FP64 ) ; default : ; } break ; @@ -3314,16 +3307,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_GE_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_GE_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_GE_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_GE_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_GE_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_GE_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_GE_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_GE_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_GE_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_GE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_GE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_GE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_GE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_GE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_GE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_GE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_GE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_GE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_GE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_GE_FP64 ) ; default : ; } break ; @@ -3332,16 +3325,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_GE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_GE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_GE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_GE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_GE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_GE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_GE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_GE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_GE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_GE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_GE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_GE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_GE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_GE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_GE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_GE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_GE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_GE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_GE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_GE_FP64 ) ; default : ; } break ; @@ -3359,16 +3352,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LOR_LE_INT8 ) ; - case GB_UINT8_code : return (GxB_LOR_LE_UINT8 ) ; - case GB_INT16_code : return (GxB_LOR_LE_INT16 ) ; - case GB_UINT16_code : return (GxB_LOR_LE_UINT16 ) ; - case GB_INT32_code : return (GxB_LOR_LE_INT32 ) ; - case GB_UINT32_code : return (GxB_LOR_LE_UINT32 ) ; - case GB_INT64_code : return (GxB_LOR_LE_INT64 ) ; - case GB_UINT64_code : return (GxB_LOR_LE_UINT64 ) ; - case GB_FP32_code : return (GxB_LOR_LE_FP32 ) ; - case GB_FP64_code : return (GxB_LOR_LE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LOR_LE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LOR_LE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LOR_LE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LOR_LE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LOR_LE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LOR_LE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LOR_LE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LOR_LE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LOR_LE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LOR_LE_FP64 ) ; default : ; } break ; @@ -3377,16 +3370,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LAND_LE_INT8 ) ; - case GB_UINT8_code : return (GxB_LAND_LE_UINT8 ) ; - case GB_INT16_code : return (GxB_LAND_LE_INT16 ) ; - case GB_UINT16_code : return (GxB_LAND_LE_UINT16 ) ; - case GB_INT32_code : return (GxB_LAND_LE_INT32 ) ; - case GB_UINT32_code : return (GxB_LAND_LE_UINT32 ) ; - case GB_INT64_code : return (GxB_LAND_LE_INT64 ) ; - case GB_UINT64_code : return (GxB_LAND_LE_UINT64 ) ; - case GB_FP32_code : return (GxB_LAND_LE_FP32 ) ; - case GB_FP64_code : return (GxB_LAND_LE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LAND_LE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LAND_LE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LAND_LE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LAND_LE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LAND_LE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LAND_LE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LAND_LE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LAND_LE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LAND_LE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LAND_LE_FP64 ) ; default : ; } break ; @@ -3395,16 +3388,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_LXOR_LE_INT8 ) ; - case GB_UINT8_code : return (GxB_LXOR_LE_UINT8 ) ; - case GB_INT16_code : return (GxB_LXOR_LE_INT16 ) ; - case GB_UINT16_code : return (GxB_LXOR_LE_UINT16 ) ; - case GB_INT32_code : return (GxB_LXOR_LE_INT32 ) ; - case GB_UINT32_code : return (GxB_LXOR_LE_UINT32 ) ; - case GB_INT64_code : return (GxB_LXOR_LE_INT64 ) ; - case GB_UINT64_code : return (GxB_LXOR_LE_UINT64 ) ; - case GB_FP32_code : return (GxB_LXOR_LE_FP32 ) ; - case GB_FP64_code : return (GxB_LXOR_LE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_LXOR_LE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_LXOR_LE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_LXOR_LE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_LXOR_LE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_LXOR_LE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_LXOR_LE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_LXOR_LE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_LXOR_LE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_LXOR_LE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_LXOR_LE_FP64 ) ; default : ; } break ; @@ -3413,16 +3406,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_EQ_LE_INT8 ) ; - case GB_UINT8_code : return (GxB_EQ_LE_UINT8 ) ; - case GB_INT16_code : return (GxB_EQ_LE_INT16 ) ; - case GB_UINT16_code : return (GxB_EQ_LE_UINT16 ) ; - case GB_INT32_code : return (GxB_EQ_LE_INT32 ) ; - case GB_UINT32_code : return (GxB_EQ_LE_UINT32 ) ; - case GB_INT64_code : return (GxB_EQ_LE_INT64 ) ; - case GB_UINT64_code : return (GxB_EQ_LE_UINT64 ) ; - case GB_FP32_code : return (GxB_EQ_LE_FP32 ) ; - case GB_FP64_code : return (GxB_EQ_LE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_EQ_LE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_EQ_LE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_EQ_LE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_EQ_LE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_EQ_LE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_EQ_LE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_EQ_LE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_EQ_LE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_EQ_LE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_EQ_LE_FP64 ) ; default : ; } break ; @@ -3431,16 +3424,16 @@ GrB_Semiring gb_semiring // built-in semiring, or NULL if error switch (xcode) { - case GB_INT8_code : return (GxB_ANY_LE_INT8 ) ; - case GB_UINT8_code : return (GxB_ANY_LE_UINT8 ) ; - case GB_INT16_code : return (GxB_ANY_LE_INT16 ) ; - case GB_UINT16_code : return (GxB_ANY_LE_UINT16 ) ; - case GB_INT32_code : return (GxB_ANY_LE_INT32 ) ; - case GB_UINT32_code : return (GxB_ANY_LE_UINT32 ) ; - case GB_INT64_code : return (GxB_ANY_LE_INT64 ) ; - case GB_UINT64_code : return (GxB_ANY_LE_UINT64 ) ; - case GB_FP32_code : return (GxB_ANY_LE_FP32 ) ; - case GB_FP64_code : return (GxB_ANY_LE_FP64 ) ; + case GrB_INT8_CODE : return (GxB_ANY_LE_INT8 ) ; + case GrB_UINT8_CODE : return (GxB_ANY_LE_UINT8 ) ; + case GrB_INT16_CODE : return (GxB_ANY_LE_INT16 ) ; + case GrB_UINT16_CODE : return (GxB_ANY_LE_UINT16 ) ; + case GrB_INT32_CODE : return (GxB_ANY_LE_INT32 ) ; + case GrB_UINT32_CODE : return (GxB_ANY_LE_UINT32 ) ; + case GrB_INT64_CODE : return (GxB_ANY_LE_INT64 ) ; + case GrB_UINT64_CODE : return (GxB_ANY_LE_UINT64 ) ; + case GrB_FP32_CODE : return (GxB_ANY_LE_FP32 ) ; + case GrB_FP64_CODE : return (GxB_ANY_LE_FP64 ) ; default : ; } break ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_binop_or_idxunop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_binop_or_idxunop.c index 3ead292bda..95b1e51f06 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_binop_or_idxunop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_binop_or_idxunop.c @@ -2,7 +2,7 @@ // gb_string_and_type_to_binop_or_idxunop: get operator from a string and type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_unop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_unop.c index ef56a392a8..cc67677d39 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_unop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_and_type_to_unop.c @@ -2,7 +2,7 @@ // gb_string_and_type_to_unop: get a GraphBLAS operator from a string and type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_binop_or_idxunop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_binop_or_idxunop.c index c143a20932..a0058dc5e1 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_binop_or_idxunop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_binop_or_idxunop.c @@ -2,7 +2,7 @@ // gb_string_to_binop_or_idxunop: get a GraphBLAS operator from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_idxunop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_idxunop.c index 8677d9d5c9..e2a8ff9c14 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_idxunop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_idxunop.c @@ -2,7 +2,7 @@ // gb_string_to_idxunop: get a GrB_IndexUnaryOp from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -68,7 +68,9 @@ void gb_string_to_idxunop // ignore the type. But a placeholder type is needed for VALUE ops. type = GrB_FP64 ; } - GB_Type_code typecode = type->code ; + + int typecode ; + OK (GrB_Type_get_INT32 (type, &typecode, GrB_EL_TYPE_CODE)) ; //-------------------------------------------------------------------------- // convert the string to a GrB_IndexUnaryOp @@ -146,112 +148,112 @@ void gb_string_to_idxunop { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUENE_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUENE_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUENE_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUENE_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUENE_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUENE_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUENE_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUENE_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUENE_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUENE_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUENE_FP64 ; break ; - case GB_FC32_code : (*op) = GxB_VALUENE_FC32 ; break ; - case GB_FC64_code : (*op) = GxB_VALUENE_FC64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUENE_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUENE_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUENE_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUENE_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUENE_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUENE_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUENE_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUENE_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUENE_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUENE_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUENE_FP64 ; break ; + case GxB_FC32_CODE : (*op) = GxB_VALUENE_FC32 ; break ; + case GxB_FC64_CODE : (*op) = GxB_VALUENE_FC64 ; break ; + default : ; } } else if (MATCH (opstring, "==") || is_zero) { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUEEQ_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUEEQ_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUEEQ_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUEEQ_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUEEQ_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUEEQ_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUEEQ_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUEEQ_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUEEQ_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUEEQ_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUEEQ_FP64 ; break ; - case GB_FC32_code : (*op) = GxB_VALUEEQ_FC32 ; break ; - case GB_FC64_code : (*op) = GxB_VALUEEQ_FC64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUEEQ_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUEEQ_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUEEQ_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUEEQ_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUEEQ_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUEEQ_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUEEQ_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUEEQ_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUEEQ_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUEEQ_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUEEQ_FP64 ; break ; + case GxB_FC32_CODE : (*op) = GxB_VALUEEQ_FC32 ; break ; + case GxB_FC64_CODE : (*op) = GxB_VALUEEQ_FC64 ; break ; + default : ; } } else if (MATCH (opstring, ">") || is_positive) { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUEGT_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUEGT_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUEGT_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUEGT_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUEGT_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUEGT_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUEGT_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUEGT_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUEGT_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUEGT_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUEGT_FP64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUEGT_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUEGT_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUEGT_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUEGT_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUEGT_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUEGT_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUEGT_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUEGT_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUEGT_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUEGT_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUEGT_FP64 ; break ; + default : ; } } else if (MATCH (opstring, ">=") || is_nonneg) { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUEGE_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUEGE_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUEGE_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUEGE_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUEGE_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUEGE_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUEGE_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUEGE_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUEGE_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUEGE_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUEGE_FP64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUEGE_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUEGE_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUEGE_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUEGE_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUEGE_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUEGE_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUEGE_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUEGE_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUEGE_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUEGE_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUEGE_FP64 ; break ; + default : ; } } else if (MATCH (opstring, "<") || is_negative) { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUELT_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUELT_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUELT_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUELT_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUELT_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUELT_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUELT_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUELT_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUELT_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUELT_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUELT_FP64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUELT_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUELT_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUELT_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUELT_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUELT_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUELT_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUELT_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUELT_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUELT_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUELT_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUELT_FP64 ; break ; + default : ; } } else if (MATCH (opstring, "<=") || is_nonpos) { switch (typecode) { - case GB_BOOL_code : (*op) = GrB_VALUELE_BOOL ; break ; - case GB_INT8_code : (*op) = GrB_VALUELE_INT8 ; break ; - case GB_INT16_code : (*op) = GrB_VALUELE_INT16 ; break ; - case GB_INT32_code : (*op) = GrB_VALUELE_INT32 ; break ; - case GB_INT64_code : (*op) = GrB_VALUELE_INT64 ; break ; - case GB_UINT8_code : (*op) = GrB_VALUELE_UINT8 ; break ; - case GB_UINT16_code : (*op) = GrB_VALUELE_UINT16 ; break ; - case GB_UINT32_code : (*op) = GrB_VALUELE_UINT32 ; break ; - case GB_UINT64_code : (*op) = GrB_VALUELE_UINT64 ; break ; - case GB_FP32_code : (*op) = GrB_VALUELE_FP32 ; break ; - case GB_FP64_code : (*op) = GrB_VALUELE_FP64 ; break ; - default : ; + case GrB_BOOL_CODE : (*op) = GrB_VALUELE_BOOL ; break ; + case GrB_INT8_CODE : (*op) = GrB_VALUELE_INT8 ; break ; + case GrB_INT16_CODE : (*op) = GrB_VALUELE_INT16 ; break ; + case GrB_INT32_CODE : (*op) = GrB_VALUELE_INT32 ; break ; + case GrB_INT64_CODE : (*op) = GrB_VALUELE_INT64 ; break ; + case GrB_UINT8_CODE : (*op) = GrB_VALUELE_UINT8 ; break ; + case GrB_UINT16_CODE : (*op) = GrB_VALUELE_UINT16 ; break ; + case GrB_UINT32_CODE : (*op) = GrB_VALUELE_UINT32 ; break ; + case GrB_UINT64_CODE : (*op) = GrB_VALUELE_UINT64 ; break ; + case GrB_FP32_CODE : (*op) = GrB_VALUELE_FP32 ; break ; + case GrB_FP64_CODE : (*op) = GrB_VALUELE_FP64 ; break ; + default : ; } } diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_monoid.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_monoid.c index 46f65454bd..148dc22813 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_monoid.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_monoid.c @@ -2,7 +2,7 @@ // gb_string_to_monoid: get a GraphBLAS monoid from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_semiring.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_semiring.c index 7c6802a2f0..0f79c884cc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_semiring.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_semiring.c @@ -2,7 +2,7 @@ // gb_string_to_semiring: convert a string to a GraphBLAS semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -66,8 +66,7 @@ GrB_Semiring gb_string_to_semiring // return a semiring from a string // get the add operator //-------------------------------------------------------------------------- - GrB_Type add_type ; - OK (GxB_BinaryOp_ztype (&add_type, mult)) ; + GrB_Type add_type = gb_binaryop_ztype (mult) ; GrB_BinaryOp add = gb_string_and_type_to_binop_or_idxunop (add_name, add_type, false, NULL, NULL) ; CHECK_ERROR (add == NULL, "invalid semiring (unknown add operator)") ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_type.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_type.c index 719b66a142..b29cec3672 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_type.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_type.c @@ -2,7 +2,7 @@ // gb_string_to_type: return the GraphBLAS type from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_unop.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_unop.c index dbf1e68570..42f130a2b2 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_unop.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_string_to_unop.c @@ -2,7 +2,7 @@ // gb_string_to_unop: get a GraphBLAS unary operator from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_type_to_mxstring.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_type_to_mxstring.c index a32c28c3e4..bfce93da7d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_type_to_mxstring.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_type_to_mxstring.c @@ -2,7 +2,7 @@ // gb_type_to_mxstring: create a built-in string from a GraphBLAS type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_typecast.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_typecast.c index 750b19775f..3be66abb52 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_typecast.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_typecast.c @@ -2,19 +2,19 @@ // gb_typecast: typecast a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "gb_interface.h" -GrB_Matrix gb_typecast // C = (type) A, where C is deep +GrB_Matrix gb_typecast // C = (type) A, where C is deep ( - GrB_Matrix A, // may be shallow - GrB_Type type, // if NULL, use the type of A - GxB_Format_Value fmt, // format of C - int sparsity // sparsity control for C, if 0 use A + GrB_Matrix A, // may be shallow + GrB_Type type, // if NULL, use the type of A + int fmt, // format of C + int sparsity // sparsity control for C, if 0 use A ) { @@ -40,7 +40,7 @@ GrB_Matrix gb_typecast // C = (type) A, where C is deep // create the empty C matrix and set its format and sparsity //-------------------------------------------------------------------------- - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; GrB_Matrix C = gb_new (type, nrows, ncols, fmt, sparsity) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_usage.c b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_usage.c index 15eafcbe40..09a52ceeac 100644 --- a/GraphBLAS/GraphBLAS/@GrB/private/util/gb_usage.c +++ b/GraphBLAS/GraphBLAS/@GrB/private/util/gb_usage.c @@ -2,11 +2,13 @@ // gb_usage: check usage and make sure GrB.init has been called //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// This function accesses GB_methods inside GraphBLAS. + #include "gb_interface.h" void gb_usage // check usage and make sure GrB.init has been called @@ -47,6 +49,12 @@ void gb_usage // check usage and make sure GrB.init has been called OK (GxB_init (GrB_NONBLOCKING, mxMalloc, mxCalloc, mxRealloc, mxFree)) ; gb_defaults ( ) ; + + //---------------------------------------------------------------------- + // allocate a Container for loading/unloading matrices to/from MATLAB + //---------------------------------------------------------------------- + + GB_helper_container_new ( ) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/GraphBLAS/@GrB/prod.m b/GraphBLAS/GraphBLAS/@GrB/prod.m index 6e16467fc8..a8a1beb930 100644 --- a/GraphBLAS/GraphBLAS/@GrB/prod.m +++ b/GraphBLAS/GraphBLAS/@GrB/prod.m @@ -22,7 +22,7 @@ % % See also GrB/all, GrB/max, GrB/min, GrB/sum. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/prune.m b/GraphBLAS/GraphBLAS/@GrB/prune.m index 443323533f..2398cccdf0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/prune.m +++ b/GraphBLAS/GraphBLAS/@GrB/prune.m @@ -5,7 +5,7 @@ % % See also GrB/full, GrB.select, GrB.prune. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/random.m b/GraphBLAS/GraphBLAS/@GrB/random.m index 803ff8244e..75e339f4ff 100644 --- a/GraphBLAS/GraphBLAS/@GrB/random.m +++ b/GraphBLAS/GraphBLAS/@GrB/random.m @@ -93,7 +93,7 @@ % % See also GrB/sprand, GrB/sprandn, GrB/sprandsym. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = GrB (gb_random (varargin {:})) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/rdivide.m b/GraphBLAS/GraphBLAS/@GrB/rdivide.m index 1257c18b00..6ba31b239c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/rdivide.m +++ b/GraphBLAS/GraphBLAS/@GrB/rdivide.m @@ -7,7 +7,7 @@ % % See also GrB/ldivide, GrB.emult, GrB.eadd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/real.m b/GraphBLAS/GraphBLAS/@GrB/real.m index 13ce8f4e2d..353bf0a480 100644 --- a/GraphBLAS/GraphBLAS/@GrB/real.m +++ b/GraphBLAS/GraphBLAS/@GrB/real.m @@ -4,7 +4,7 @@ % % See also GrB/conj, GrB/imag. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/reduce.m b/GraphBLAS/GraphBLAS/@GrB/reduce.m index a8d47f96df..014c9a7046 100644 --- a/GraphBLAS/GraphBLAS/@GrB/reduce.m +++ b/GraphBLAS/GraphBLAS/@GrB/reduce.m @@ -19,14 +19,16 @@ % op is applied to all entries of the matrix A to reduce them to a single % scalar result. % -% accum: an optional binary operator (see 'help GrB.binopinfo'). +% accum: an optional binary operator. +% See 'help GrB.binopinfo' for available binary operators. % % cin: an optional input scalar into which the result can be accumulated % with c = accum (cin, result). % -% See also GrB.vreduce, GrB/sum, GrB/prod, GrB/max, GrB/min. +% See also GrB.vreduce, GrB/sum, GrB/prod, GrB/max, GrB/min, GrB.monoidinfo, +% GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/repmat.m b/GraphBLAS/GraphBLAS/@GrB/repmat.m index 08b9623914..af0bbe3e89 100644 --- a/GraphBLAS/GraphBLAS/@GrB/repmat.m +++ b/GraphBLAS/GraphBLAS/@GrB/repmat.m @@ -6,7 +6,7 @@ % % See also GrB/kron, GrB.kronecker. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/reshape.m b/GraphBLAS/GraphBLAS/@GrB/reshape.m index 306b740cc8..2103aa88fc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/reshape.m +++ b/GraphBLAS/GraphBLAS/@GrB/reshape.m @@ -10,7 +10,7 @@ % % See also GrB/numel, squeeze. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (G)) diff --git a/GraphBLAS/GraphBLAS/@GrB/round.m b/GraphBLAS/GraphBLAS/@GrB/round.m index 658719c448..e606b1a317 100644 --- a/GraphBLAS/GraphBLAS/@GrB/round.m +++ b/GraphBLAS/GraphBLAS/@GrB/round.m @@ -7,7 +7,7 @@ % % See also GrB/ceil, GrB/floor, GrB/fix. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: round (x,n) and round (x,n,type) diff --git a/GraphBLAS/GraphBLAS/@GrB/save.m b/GraphBLAS/GraphBLAS/@GrB/save.m index ea6666ad64..ca5c82a2f6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/save.m +++ b/GraphBLAS/GraphBLAS/@GrB/save.m @@ -21,7 +21,7 @@ % % See also GrB.load, GrB/struct, GrB.serialize, GrB.deserialize. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % make sure C is a @GrB object diff --git a/GraphBLAS/GraphBLAS/@GrB/sec.m b/GraphBLAS/GraphBLAS/@GrB/sec.m index f3c5f15f9c..b4fa346ff3 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sec.m +++ b/GraphBLAS/GraphBLAS/@GrB/sec.m @@ -5,7 +5,7 @@ % % See also GrB/asec, GrB/sech, GrB/asech. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sech.m b/GraphBLAS/GraphBLAS/@GrB/sech.m index 5f34ceeb4d..e01aadb30c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sech.m +++ b/GraphBLAS/GraphBLAS/@GrB/sech.m @@ -5,7 +5,7 @@ % % See also GrB/sec, GrB/asec, GrB/asech. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/select.m b/GraphBLAS/GraphBLAS/@GrB/select.m index 2f7cf03dc4..a2d1ef0a15 100644 --- a/GraphBLAS/GraphBLAS/@GrB/select.m +++ b/GraphBLAS/GraphBLAS/@GrB/select.m @@ -57,8 +57,9 @@ % Cin is an optional input matrix. If Cin is not present or is an empty % matrix (Cin = [ ]) then it is implicitly a matrix with no entries, of % the right size (which depends on A, and the descriptor). Its type is -% the output type of the accum operator, if it is present; otherwise, its -% type is the type of the matrix A. +% the output type of the accum binary operator, if it is present; otherwise, +% its type is the type of the matrix A. See 'help GrB.binopinfo' for a +% list of available binary operators. % % M is the optional mask matrix. If not present, or if empty, then no % mask is used. If present, M must have the same size as C. @@ -76,9 +77,9 @@ % % desc is optional. See 'help GrB.descriptorinfo' for more details. % -% See also GrB/tril, GrB/triu, GrB/diag. +% See also GrB/tril, GrB/triu, GrB/diag, GrB.selectopinfo, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/selectopinfo.m b/GraphBLAS/GraphBLAS/@GrB/selectopinfo.m index 5e5d679e0b..28007ef862 100644 --- a/GraphBLAS/GraphBLAS/@GrB/selectopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/selectopinfo.m @@ -38,10 +38,10 @@ function selectopinfo (op,optype) % GrB.selectopinfo ; % GrB.selectopinfo ('tril') ; % -% See also GrB.binopinfo, GrB.descriptorinfo, GrB.monoidinfo, -% GrB.semiringinfo, GrB.unopinfo. +% See also GrB.selectops, GrB.binopinfo, GrB.descriptorinfo, +% GrB.monoidinfo, GrB.semiringinfo, GrB.unopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/selectops.m b/GraphBLAS/GraphBLAS/@GrB/selectops.m new file mode 100644 index 0000000000..0810867252 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/selectops.m @@ -0,0 +1,117 @@ +function result = selectops +%GRB.SELECTOPS list all select ops +% Redundant select ops are not listed. For example 'tril.double' +% exists, but it is identical to just 'tril'. +% +% Example: +% GrB.selectops ; % prints a list, with descriptions +% list = GrB.selectops ; % returns the list (nothing printed) +% +% See also GrB.selectopinfo. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +types = { + 'logical' + 'double' + 'single' + 'int8' + 'int16' + 'int32' + 'int64' + 'uint8' + 'uint16' + 'uint32' + 'uint64' + 'single complex' + 'double complex' + } ; + +selectops = { +'nonzero' , 'keeps nonzero entries, removes zeros' ; +'zero' , 'keeps zeros, removes nonzeros' ; +'positive' , 'keeps entries > 0, removes entries <= 0' ; +'nonnegative' , 'keeps entries >= 0, removes entries < 0' ; +'negative' , 'keeps entries < 0, removes entries >= 0' ; +'nonpositive' , 'keeps entries <= 0, removes entries > 0' ; +'tril' , 'keeps entries in tril(A,b)' ; +'triu' , 'keeps entries in triu(A,b)' ; +'diag' , 'keeps entries in diag(A,b)' ; +'offdiag' , 'keeps entries not in diag(A,b)' ; +'rowne' , 'keeps entries not in A(b,:), removes entries in A(b,:)' ; +'rowle' , 'keeps entries in A(1:b,:), removes entries in A(b+1:end,:)' ; +'rowgt' , 'keeps entries in A(b+1:end,:), removes entries in A(1:b,:)' ; +'colne' , 'keeps entries not in A(:,b), removes entries in A(:,b)' ; +'colle' , 'keeps entries in A(:,1:b), removes entries in A(:,b+1:end)' ; +'colgt' , 'keeps entries in A(:,b+1:end), removes entries in A(:,1:b)' ; +'~=' , 'keeps entries not equal to b, removes entries equal to b' ; +'==' , 'keeps entries equal to b, removes entries not equal to b' ; +'>' , 'keeps entries entries > b, removes entries <= b' ; +'>=' , 'keeps entries entries >= b, removes entries < b' ; +'<' , 'keeps entries entries < b, removes entries >= b' ; +'<=' , 'keeps entries entries <= b, removes entries > b' } ; + +nselectops = 0 ; +nops = size (selectops, 1) ; + +if (nargout > 0) + result = { } ; +end + + for k2 = 1:nops + op = selectops {k2,1} ; + op_description = selectops {k2,2} ; + first_op= true ; + + ignore_type = gb_contains (op, 'tri') || gb_contains (op, 'diag') || ... + gb_contains (op, 'col') || gb_contains (op, 'row') ; + if (ignore_type) + ntypes = 1 ; + else + ntypes = length (types) ; + end + + for k3 = 1:ntypes + ok = false ; + if (ignore_type) + selectop = op ; + else + type = types {k3} ; + selectop = [op '.' type] ; + end + + try + ok = gbselectopinfo (selectop) ; + nselectops = nselectops + 1 ; + if (nargout > 0) + result = [result ; selectop] ; %#ok + end + catch + % this is an error, but it is expected since not all + % combinations operators and types can be used to construct + % a valid selectop. + end + if (ok && nargout == 0) + if (ignore_type) + fprintf ('select op: %s', op) ; + fprintf (', %s', op_description) ; + elseif (first_op) + fprintf ('select op: %s.type', op) ; + fprintf (', %s\n', op_description) ; + fprintf (' types: %s', type) ; + else + fprintf (', %s', type) ; + end + first_op = false ; + end + end + if (nargout == 0) + fprintf ('\n\n') ; + end + end + +if (nargout == 0) + fprintf ('Total number of available select ops: %d\n', nselectops) ; +end + diff --git a/GraphBLAS/GraphBLAS/@GrB/semiringinfo.m b/GraphBLAS/GraphBLAS/@GrB/semiringinfo.m index 8b8ebad6ec..a8d5690cc5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/semiringinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/semiringinfo.m @@ -30,10 +30,10 @@ function semiringinfo (s, type) % % invalid semiring (generates an error; since '<' is not a monoid) % GrB.semiringinfo ('<.*.double') ; % -% See also GrB.binopinfo, GrB.descriptorinfo, GrB.monoidinfo, -% GrB.selectopinfo, GrB.unopinfo. +% See also GrB.semirings, GrB.binopinfo, GrB.descriptorinfo, +% GrB.monoidinfo, GrB.selectopinfo, GrB.unopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/semirings.m b/GraphBLAS/GraphBLAS/@GrB/semirings.m new file mode 100644 index 0000000000..5a3c63326b --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/semirings.m @@ -0,0 +1,117 @@ +function result = semirings +%GRB.SEMIRINGS list all semirings +% Redundant semirings are not listed. For example '+.*.logical' +% exists, but it is identical to '|.&.logical'. +% +% Example: +% GrB.semirings ; % prints a list, with descriptions +% list = GrB.semirings ; % returns the list (nothing printed) +% +% See also GrB.semiringinfo. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +types = { + 'logical' + 'double' + 'single' + 'int8' + 'int16' + 'int32' + 'int64' + 'uint8' + 'uint16' + 'uint32' + 'uint64' + 'single complex' + 'double complex' + } ; + +binops = gb_binops ; + +useful_monoids = {'any', 'min', 'max', '+', '*', '==', '~=', '|', '&', ... + 'xor', 'xnor', 'bitand', 'bitor', 'bitxor', 'bitxnor' } ; + +skip_logical = {'min', 'max', '+', '-', 'rminus', '*', '/', '\', 'iseq', ... + 'isne', 'isgt', 'islt', 'isle', 'isge', 'pow', '~=', '==' } ; + +nsemirings = 0 ; +nops = size (binops, 1) ; + +if (nargout > 0) + result = { } ; +end + +for k1 = 1:nops + add = binops {k1,1} ; + add_description = binops {k1,2} ; + first_add = true ; + + % skip redundant monoids + if (~ismember (add, useful_monoids)) + continue ; + end + + for k2 = 1:nops + mult = binops {k2,1} ; + mult_description = binops {k2,2} ; + first_mult = true ; + for k3 = 1:length (types) + type = types {k3} ; + ok = false ; + semiring = [add '.' mult '.' type] ; + + % skip redundant logical semirings + if (isequal (type, 'logical') && ... + (ismember (mult, skip_logical) || ... + ismember (add, skip_logical))) + continue ; + end + + try + ok = gbsemiringinfo (semiring) ; + nsemirings = nsemirings + 1 ; + if (nargout > 0) + result = [result ; semiring] ; %#ok + end + catch + % this is an error, but it is expected since not all + % combinations operators and types can be used to construct + % a valid semiring. + end + + if (ok && nargout == 0) + if (first_add) + fprintf ('\nmonoid: %s', add) ; + if (isempty (add_description)) + fprintf ('\n\n') ; + else + fprintf (', where %s\n\n', add_description) ; + end + end + if (first_mult) + fprintf (' %s.%s.type', add, mult) ; + if (isempty (mult_description)) + fprintf ('\n') ; + else + fprintf (', where %s\n', mult_description) ; + end + fprintf (' types: %s', type) ; + else + fprintf (', %s', type) ; + end + first_add = false ; + first_mult = false ; + end + end + if (~first_mult && nargout == 0) + fprintf ('\n') ; + end + end +end + +if (nargout == 0) + fprintf ('\nTotal number of available semirings: %d\n', nsemirings) ; +end + diff --git a/GraphBLAS/GraphBLAS/@GrB/serialize.m b/GraphBLAS/GraphBLAS/@GrB/serialize.m index 7c994b38a1..7e02792e8a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/serialize.m +++ b/GraphBLAS/GraphBLAS/@GrB/serialize.m @@ -39,7 +39,7 @@ % % See also GrB.deserialize, GrB.load, GrB.save, GrB/struct. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (G)) diff --git a/GraphBLAS/GraphBLAS/@GrB/sign.m b/GraphBLAS/GraphBLAS/@GrB/sign.m index c774c418fb..cf1ad66f48 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sign.m +++ b/GraphBLAS/GraphBLAS/@GrB/sign.m @@ -6,7 +6,7 @@ % % See also GrB/abs. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Q = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sin.m b/GraphBLAS/GraphBLAS/@GrB/sin.m index 13016d9ca3..67939ffca9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sin.m +++ b/GraphBLAS/GraphBLAS/@GrB/sin.m @@ -4,7 +4,7 @@ % % See also GrB/asin, GrB/sinh, GrB/asinh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/single.m b/GraphBLAS/GraphBLAS/@GrB/single.m index bae4927df9..724545a2bf 100644 --- a/GraphBLAS/GraphBLAS/@GrB/single.m +++ b/GraphBLAS/GraphBLAS/@GrB/single.m @@ -11,7 +11,7 @@ % See also GrB, GrB/double, GrB/complex, GrB/logical, GrB/int8, GrB/int16, % GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, GrB/uint32, GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sinh.m b/GraphBLAS/GraphBLAS/@GrB/sinh.m index 7169dd54e3..5a5cfbe734 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sinh.m +++ b/GraphBLAS/GraphBLAS/@GrB/sinh.m @@ -4,7 +4,7 @@ % % See also GrB/sin, GrB/asin, GrB/asinh. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/size.m b/GraphBLAS/GraphBLAS/@GrB/size.m index 4c1a386edd..083374c838 100644 --- a/GraphBLAS/GraphBLAS/@GrB/size.m +++ b/GraphBLAS/GraphBLAS/@GrB/size.m @@ -5,7 +5,7 @@ % % See also GrB/length, GrB/numel. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sparse.m b/GraphBLAS/GraphBLAS/@GrB/sparse.m index 2281e74f6b..b7d63a074f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sparse.m +++ b/GraphBLAS/GraphBLAS/@GrB/sparse.m @@ -6,7 +6,7 @@ % % See also GrB/issparse, GrB/full, GrB.type, GrB/prune, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, sparsity] = gbformat (G.opaque) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/speye.m b/GraphBLAS/GraphBLAS/@GrB/speye.m index afd78d0ae9..20784c38f6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/speye.m +++ b/GraphBLAS/GraphBLAS/@GrB/speye.m @@ -5,7 +5,7 @@ % % See also GrB.eye. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = GrB (gb_speye ('speye', varargin {:})) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/spfun.m b/GraphBLAS/GraphBLAS/@GrB/spfun.m index 448e9a0cd5..7ab48fbc4c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/spfun.m +++ b/GraphBLAS/GraphBLAS/@GrB/spfun.m @@ -38,7 +38,7 @@ % % See also GrB.apply, GrB.unopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (G)) @@ -57,7 +57,7 @@ % 'fun' is not a string, or not a built-in GraphBLAS operator [m, n] = gbsize (G) ; desc.base = 'zero-based' ; -[i, j, x] = gbextracttuples (G, desc) ; +[i, j, x] = gbextracttuples (G, desc) ; % OK: zero-based integers x = feval (fun, x) ; C = GrB.build (i, j, x, m, n, '1st', desc) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/spones.m b/GraphBLAS/GraphBLAS/@GrB/spones.m index 1732a14090..eb0241b646 100644 --- a/GraphBLAS/GraphBLAS/@GrB/spones.m +++ b/GraphBLAS/GraphBLAS/@GrB/spones.m @@ -17,7 +17,7 @@ % % See also GrB/spfun, GrB.apply. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sprand.m b/GraphBLAS/GraphBLAS/@GrB/sprand.m index 4a458385f4..f7d014a023 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sprand.m +++ b/GraphBLAS/GraphBLAS/@GrB/sprand.m @@ -16,7 +16,7 @@ % % See also GrB/sprandn, GrB/sprandsym, GrB.random. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/sprandn.m b/GraphBLAS/GraphBLAS/@GrB/sprandn.m index 195522a8ac..9cd9f3684f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sprandn.m +++ b/GraphBLAS/GraphBLAS/@GrB/sprandn.m @@ -14,7 +14,7 @@ % % See also GrB/sprandn, GrB/sprandsym, GrB.random. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/sprandsym.m b/GraphBLAS/GraphBLAS/@GrB/sprandsym.m index 50b4151ae5..983764ad3d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sprandsym.m +++ b/GraphBLAS/GraphBLAS/@GrB/sprandsym.m @@ -23,7 +23,7 @@ % % See also GrB/sprand, GrB/sprandn, GrB.random. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/GraphBLAS/@GrB/sprintf.m b/GraphBLAS/GraphBLAS/@GrB/sprintf.m index f0512ed8bc..554f490ca9 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sprintf.m +++ b/GraphBLAS/GraphBLAS/@GrB/sprintf.m @@ -6,7 +6,7 @@ % % See also fprintf, sprintf, GrB/fprintf. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = gb_printf_helper ('sprintf', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/sqrt.m b/GraphBLAS/GraphBLAS/@GrB/sqrt.m index c0490161f3..0493f2ce23 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sqrt.m +++ b/GraphBLAS/GraphBLAS/@GrB/sqrt.m @@ -4,7 +4,7 @@ % % See also GrB.apply, GrB/hypot. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/struct.m b/GraphBLAS/GraphBLAS/@GrB/struct.m index 365a5d030e..b4f49dcead 100644 --- a/GraphBLAS/GraphBLAS/@GrB/struct.m +++ b/GraphBLAS/GraphBLAS/@GrB/struct.m @@ -10,7 +10,7 @@ % % See also load, save, properties, GrB.version, GrB.ver, GrB.load, GrB.save. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 S = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/subassign.m b/GraphBLAS/GraphBLAS/@GrB/subassign.m index e2634865a4..4cc7541d5b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/subassign.m +++ b/GraphBLAS/GraphBLAS/@GrB/subassign.m @@ -42,9 +42,9 @@ % % Refer to GrB.assign for a description of the other input/outputs. % -% See also GrB.assign, GrB/subsasgn. +% See also GrB.assign, GrB/subsasgn, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/subsasgn.m b/GraphBLAS/GraphBLAS/@GrB/subsasgn.m index 88d63999ee..538d72b487 100644 --- a/GraphBLAS/GraphBLAS/@GrB/subsasgn.m +++ b/GraphBLAS/GraphBLAS/@GrB/subsasgn.m @@ -35,7 +35,7 @@ % % See also GrB/subsref, GrB/subsindex, GrB.assign, GrB.subassign. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: add all forms of linear indexing. diff --git a/GraphBLAS/GraphBLAS/@GrB/subsindex.m b/GraphBLAS/GraphBLAS/@GrB/subsindex.m index 6cc1c4eaef..1682ea29f8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/subsindex.m +++ b/GraphBLAS/GraphBLAS/@GrB/subsindex.m @@ -5,7 +5,7 @@ % % See also GrB/subsref, GrB/subsasgn. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % On input, G must contain integers in the range 1 to prod (size (A))-1. diff --git a/GraphBLAS/GraphBLAS/@GrB/subsref.m b/GraphBLAS/GraphBLAS/@GrB/subsref.m index aa4fb016c6..4a5f37a520 100644 --- a/GraphBLAS/GraphBLAS/@GrB/subsref.m +++ b/GraphBLAS/GraphBLAS/@GrB/subsref.m @@ -31,7 +31,7 @@ % See also GrB/subsasgn, GrB/subsindex, GrB.subassign, GrB.assign, % GrB.extract. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % FUTURE: add all forms of linear indexing. diff --git a/GraphBLAS/GraphBLAS/@GrB/sum.m b/GraphBLAS/GraphBLAS/@GrB/sum.m index 2568a76129..a255503b09 100644 --- a/GraphBLAS/GraphBLAS/@GrB/sum.m +++ b/GraphBLAS/GraphBLAS/@GrB/sum.m @@ -20,7 +20,7 @@ % % See also GrB/any, GrB/prod, GrB/max, GrB/min. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/symamd.m b/GraphBLAS/GraphBLAS/@GrB/symamd.m index d5f5db2b6b..826e6630bc 100644 --- a/GraphBLAS/GraphBLAS/@GrB/symamd.m +++ b/GraphBLAS/GraphBLAS/@GrB/symamd.m @@ -4,7 +4,7 @@ % % See also GrB/amd, GrB/colamd, GrB/symrcm. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [p, varargout{1:nargout-1}] = symamd (double (G), varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/symrcm.m b/GraphBLAS/GraphBLAS/@GrB/symrcm.m index 666ba5e570..787b1feea5 100644 --- a/GraphBLAS/GraphBLAS/@GrB/symrcm.m +++ b/GraphBLAS/GraphBLAS/@GrB/symrcm.m @@ -4,7 +4,7 @@ % % See also GrB/amd, GrB/colamd, GrB/symamd. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 p = builtin ('symrcm', logical (G)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/tan.m b/GraphBLAS/GraphBLAS/@GrB/tan.m index fd3da2ed86..78fd90355a 100644 --- a/GraphBLAS/GraphBLAS/@GrB/tan.m +++ b/GraphBLAS/GraphBLAS/@GrB/tan.m @@ -4,7 +4,7 @@ % % See also GrB/tanh, GrB/atan, GrB/atanh, GrB/atan2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/tanh.m b/GraphBLAS/GraphBLAS/@GrB/tanh.m index f5475450d7..e9aace047b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/tanh.m +++ b/GraphBLAS/GraphBLAS/@GrB/tanh.m @@ -4,7 +4,7 @@ % % See also GrB/tan, GrB/atan, GrB/atanh, GrB/atan2. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/threads.m b/GraphBLAS/GraphBLAS/@GrB/threads.m index bbc752aee1..a0df5be566 100644 --- a/GraphBLAS/GraphBLAS/@GrB/threads.m +++ b/GraphBLAS/GraphBLAS/@GrB/threads.m @@ -22,7 +22,7 @@ % % See also GrB.chunk. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/times.m b/GraphBLAS/GraphBLAS/@GrB/times.m index 21a20d5ef0..65706cc50e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/times.m +++ b/GraphBLAS/GraphBLAS/@GrB/times.m @@ -7,7 +7,7 @@ % % See also GrB/mtimes, GrB.emult, GrB.mxm. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/timing.m b/GraphBLAS/GraphBLAS/@GrB/timing.m deleted file mode 100644 index 8d2524326f..0000000000 --- a/GraphBLAS/GraphBLAS/@GrB/timing.m +++ /dev/null @@ -1,21 +0,0 @@ -function t = timing (c) -%GRB.TIMING get/set the GraphBLAS diagnostic timings -% -% t = GrB.timing ; % get the current timings, do not clear them. -% t = GrB.timing (0) ; % get the current timings, and clear them. -% -% This method is for development only, and returns t as all zero when -% GraphBLAS is compiled for production use. GraphBLAS must be compiled -% with -DGB_TIMING for timers to be enabled. -% -% See also spparms. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin == 0) - t = gbtiming ; -else - t = gbtiming (c) ; -end - diff --git a/GraphBLAS/GraphBLAS/@GrB/trans.m b/GraphBLAS/GraphBLAS/@GrB/trans.m index 66bbd41901..512365af9d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/trans.m +++ b/GraphBLAS/GraphBLAS/@GrB/trans.m @@ -14,9 +14,12 @@ % For complex matrices, GrB.trans computes the array transpose, not the % matrix (complex conjugate) transpose. % -% See also GrB/transpose, GrB/ctranspose, GrB/conj. +% accum: an optional binary operator. +% See 'help GrB.binopinfo' for available binary operators. +% +% See also GrB/transpose, GrB/ctranspose, GrB/conj, GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/transpose.m b/GraphBLAS/GraphBLAS/@GrB/transpose.m index a1d0800af5..86d8604f6c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/transpose.m +++ b/GraphBLAS/GraphBLAS/@GrB/transpose.m @@ -4,9 +4,8 @@ % % See also GrB.trans, GrB/ctranspose. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -G = G.opaque ; -C = GrB (gbtrans (G)) ; +C = GrB (gbtrans (G.opaque)) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/tricount.m b/GraphBLAS/GraphBLAS/@GrB/tricount.m index 35df71ad50..c75c847e98 100644 --- a/GraphBLAS/GraphBLAS/@GrB/tricount.m +++ b/GraphBLAS/GraphBLAS/@GrB/tricount.m @@ -13,7 +13,7 @@ % % See also GrB.ktruss, GrB.entries. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: this is a high-level algorithm that uses GrB objects. diff --git a/GraphBLAS/GraphBLAS/@GrB/tril.m b/GraphBLAS/GraphBLAS/@GrB/tril.m index 23775116fb..183ad9ffce 100644 --- a/GraphBLAS/GraphBLAS/@GrB/tril.m +++ b/GraphBLAS/GraphBLAS/@GrB/tril.m @@ -7,7 +7,7 @@ % % See also GrB/triu. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (G)) diff --git a/GraphBLAS/GraphBLAS/@GrB/triu.m b/GraphBLAS/GraphBLAS/@GrB/triu.m index ab5a0c2536..a4801c8888 100644 --- a/GraphBLAS/GraphBLAS/@GrB/triu.m +++ b/GraphBLAS/GraphBLAS/@GrB/triu.m @@ -7,7 +7,7 @@ % % See also GrB/tril. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (G)) diff --git a/GraphBLAS/GraphBLAS/@GrB/true.m b/GraphBLAS/GraphBLAS/@GrB/true.m index 3f68412aea..16f170c2d0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/true.m +++ b/GraphBLAS/GraphBLAS/@GrB/true.m @@ -12,7 +12,7 @@ % % See also GrB.zeros, GrB.ones, GrB.false, GrB.eye, GrB.speye. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n, ~] = gb_parse_args ('true', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/@GrB/type.m b/GraphBLAS/GraphBLAS/@GrB/type.m index 2cdcad5a41..b408cdf56e 100644 --- a/GraphBLAS/GraphBLAS/@GrB/type.m +++ b/GraphBLAS/GraphBLAS/@GrB/type.m @@ -39,7 +39,7 @@ % % See also class, isa, GrB/isa, GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (X)) diff --git a/GraphBLAS/GraphBLAS/@GrB/uint16.m b/GraphBLAS/GraphBLAS/@GrB/uint16.m index ce4704c244..27802c4433 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uint16.m +++ b/GraphBLAS/GraphBLAS/@GrB/uint16.m @@ -11,7 +11,7 @@ % GrB/int8, GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/uint32.m b/GraphBLAS/GraphBLAS/@GrB/uint32.m index 9481ff604f..e5afa958d0 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uint32.m +++ b/GraphBLAS/GraphBLAS/@GrB/uint32.m @@ -11,7 +11,7 @@ % GrB/int8, GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/uint64.m b/GraphBLAS/GraphBLAS/@GrB/uint64.m index bcb3c0b88e..b9d10fbb22 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uint64.m +++ b/GraphBLAS/GraphBLAS/@GrB/uint64.m @@ -11,7 +11,7 @@ % GrB/int8, GrB/int16, GrB/int32, GrB/int64, GrB/uint8, GrB/uint16, % GrB/uint32. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/uint8.m b/GraphBLAS/GraphBLAS/@GrB/uint8.m index e51a8eb6f7..48f156324c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uint8.m +++ b/GraphBLAS/GraphBLAS/@GrB/uint8.m @@ -11,7 +11,7 @@ % GrB/int8, GrB/int16, GrB/int32, GrB/int64, GrB/uint16, GrB/uint32, % GrB/uint64. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/uminus.m b/GraphBLAS/GraphBLAS/@GrB/uminus.m index 7f7788ec90..994da7197f 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uminus.m +++ b/GraphBLAS/GraphBLAS/@GrB/uminus.m @@ -4,7 +4,7 @@ % % See also GrB.apply, GrB/minus, GrB/uplus. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 G = G.opaque ; diff --git a/GraphBLAS/GraphBLAS/@GrB/unopinfo.m b/GraphBLAS/GraphBLAS/@GrB/unopinfo.m index 05e9a2c9af..76c63b8bde 100644 --- a/GraphBLAS/GraphBLAS/@GrB/unopinfo.m +++ b/GraphBLAS/GraphBLAS/@GrB/unopinfo.m @@ -97,10 +97,10 @@ function unopinfo (op, type) % % invalid unary operator (generates an error; this is a binary op): % GrB.unopinfo ('*.double') ; % -% See also GrB.binopinfo, GrB.descriptorinfo, GrB.monoidinfo, -% GrB.selectopinfo, GrB.semiringinfo. +% See also GrB.unops, GrB.binopinfo, GrB.descriptorinfo, +% GrB.monoidinfo, GrB.selectopinfo, GrB.semiringinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/unops.m b/GraphBLAS/GraphBLAS/@GrB/unops.m new file mode 100644 index 0000000000..eed7cf05d4 --- /dev/null +++ b/GraphBLAS/GraphBLAS/@GrB/unops.m @@ -0,0 +1,127 @@ +function result = unops +%GRB.BINOPS list all unary ops +% +% Example: +% GrB.unops ; % prints a list, with descriptions +% list = GrB.unops ; % returns the list (nothing printed) +% +% See also GrB.unopinfo. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +types = { + 'logical' + 'double' + 'single' + 'int8' + 'int16' + 'int32' + 'int64' + 'uint8' + 'uint16' + 'uint32' + 'uint64' + 'single complex' + 'double complex' + } ; + +ops = { + 'identity' , 'f(x) = x' ; + '~' , 'f(x) = ~x, where z has the same type as x' ; + '-' , 'f(x) = -x' ; + '1' , 'f(x) = 1' ; + 'minv' , 'f(x) = 1/x' ; + 'abs' , 'absolute value' ; + 'sqrt' , 'square root' ; + 'log' , 'base-e logarithm' ; + 'exp' , 'base-e exponential, e^x' ; + 'sin' , 'sine' ; + 'cos' , 'cosine' ; + 'tan' , 'tangent' ; + 'asin' , 'arc sine' ; + 'acos' , 'arc cosine' ; + 'atan' , 'arc tangent' ; + 'sinh' , 'hyperbolic sine' ; + 'cosh' , 'hyperbolic cosine' ; + 'tanh' , 'hyperbolic tangent' ; + 'asinh' , 'hyperbolic arc sine' ; + 'acosh' , 'hyperbolic arc cosine' ; + 'atanh' , 'hyperbolic arc tangent' ; + 'sign' , 'signum function' ; + 'ceil' , 'round to +inf' ; + 'floor' , 'round to -inf' ; + 'round' , 'round to nearest integer' ; + 'fix' , 'round to zero' ; + 'pow2' , '2^x' ; + 'expm1' , '(e^x)-1' ; + 'log10' , 'base-10 logarithm' ; + 'log1p' , 'log(1+x)' ; + 'log2' , 'base-2 logarithm' ; + 'gammaln' , 'log of gamma' ; + 'gamma' , 'gamma function' ; + 'erf' , 'error function' ; + 'cbrt' , 'cube root' ; + 'erfc' , 'complementary error function' ; + 'conj' , 'complex conjugate' ; + 'creal' , 'real part of a complex number' ; + 'cimag' , 'imaginary part of a complex number' ; + 'angle' , 'complex phase angle' ; + 'isinf' , 'true if +inf or -inf' ; + 'isnan' , 'true if nan' ; + 'isfinite' , 'true if finite (not inf, -inf, or nan)' ; + 'frexpx' , 'normalized fractional part, in range [.5,1)' ; + 'frexpe' , 'integral exponent; x = frexpx(x)*2^frexpe(x)' ; + 'bitcmp' , 'bitwise complement' ; + 'i0' , 'row index of the entry in its matrix, minus 1' ; + 'i1' , 'row index of the entry in its matrix' ; + 'j0' , 'column index of the entry in its matrix, minus 1' ; + 'j1' , 'column index of the entry in its matrix' ; + } ; + +nunops = 0 ; +nops = size (ops, 1) ; + +if (nargout > 0) + result = { } ; +end + +for k1 = 1:nops + op = ops {k1,1} ; + op_description = ops {k1,2} ; + first_op = true ; + for k2 = 1:length (types) + ok = false ; + type = types {k2} ; + unop = [op '.' type] ; + try + ok = gbunopinfo (unop) ; + nunops = nunops + 1 ; + if (nargout > 0) + result = [result ; unop] ; %#ok + end + catch + end + + if (ok && nargout == 0) + if (first_op) + fprintf ('unary op: %s.type', op) ; + fprintf (', %s\n', op_description) ; + fprintf (' types: %s', type) ; + else + fprintf (', %s', type) ; + end + first_op = false ; + end + end + if (nargout == 0) + fprintf ('\n\n') ; + end + +end + +if (nargout == 0) + fprintf ('Total number of available unary ops: %d\n', nunops) ; +end + + diff --git a/GraphBLAS/GraphBLAS/@GrB/uplus.m b/GraphBLAS/GraphBLAS/@GrB/uplus.m index 548e87e84d..a6be226a2b 100644 --- a/GraphBLAS/GraphBLAS/@GrB/uplus.m +++ b/GraphBLAS/GraphBLAS/@GrB/uplus.m @@ -5,7 +5,7 @@ % % See also GrB/uminus. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C = G ; diff --git a/GraphBLAS/GraphBLAS/@GrB/ver.m b/GraphBLAS/GraphBLAS/@GrB/ver.m index 641aaeb27c..2924db48d6 100644 --- a/GraphBLAS/GraphBLAS/@GrB/ver.m +++ b/GraphBLAS/GraphBLAS/@GrB/ver.m @@ -5,7 +5,7 @@ % % See also ver, version, GrB.version. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargout == 0) diff --git a/GraphBLAS/GraphBLAS/@GrB/version.m b/GraphBLAS/GraphBLAS/@GrB/version.m index 4888e1c928..ad1fb93670 100644 --- a/GraphBLAS/GraphBLAS/@GrB/version.m +++ b/GraphBLAS/GraphBLAS/@GrB/version.m @@ -4,7 +4,7 @@ % % See also ver, version, GrB.ver. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 v = gbversion ; diff --git a/GraphBLAS/GraphBLAS/@GrB/vertcat.m b/GraphBLAS/GraphBLAS/@GrB/vertcat.m index 38d4d89ba8..104513200d 100644 --- a/GraphBLAS/GraphBLAS/@GrB/vertcat.m +++ b/GraphBLAS/GraphBLAS/@GrB/vertcat.m @@ -7,7 +7,7 @@ % % See also GrB/horzcat, GrB/cat, GrB.cell2mat, GrB/mat2cell, GrB/num2cell. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the input matrices diff --git a/GraphBLAS/GraphBLAS/@GrB/vreduce.m b/GraphBLAS/GraphBLAS/@GrB/vreduce.m index 005c1fb1a9..811183112c 100644 --- a/GraphBLAS/GraphBLAS/@GrB/vreduce.m +++ b/GraphBLAS/GraphBLAS/@GrB/vreduce.m @@ -25,9 +25,13 @@ % reduced to a column vector; C (j) = reduce (A (:,j)). In this case, Cin % and C are column vectors of size n-by-1, if A is m-by-n. % -% See also GrB.reduce, GrB/sum, GrB/prod, GrB/max, GrB/min. +% accum: an optional binary operator. +% See 'help GrB.binopinfo' for available binary operators. +% +% See also GrB.reduce, GrB/sum, GrB/prod, GrB/max, GrB/min, GrB.monoidinfo, +% GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (arg1)) diff --git a/GraphBLAS/GraphBLAS/@GrB/xor.m b/GraphBLAS/GraphBLAS/@GrB/xor.m index 3dbea14d61..6f3c4ef2a8 100644 --- a/GraphBLAS/GraphBLAS/@GrB/xor.m +++ b/GraphBLAS/GraphBLAS/@GrB/xor.m @@ -5,7 +5,7 @@ % % See also GrB/and, GrB/or, GrB/not. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isobject (A)) diff --git a/GraphBLAS/GraphBLAS/@GrB/zeros.m b/GraphBLAS/GraphBLAS/@GrB/zeros.m index 806ca4aba0..0ceed01382 100644 --- a/GraphBLAS/GraphBLAS/@GrB/zeros.m +++ b/GraphBLAS/GraphBLAS/@GrB/zeros.m @@ -9,7 +9,7 @@ % % See also GrB.ones, GrB.false, GrB.true, GrB.eye, GrB.speye. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n, type] = gb_parse_args ('zeros', varargin {:}) ; diff --git a/GraphBLAS/GraphBLAS/CMakeLists.txt b/GraphBLAS/GraphBLAS/CMakeLists.txt index 14f9eaeb8a..c3ee54779b 100644 --- a/GraphBLAS/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/GraphBLAS/CMakeLists.txt @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/CMakeLists.txt: build GraphBLAS for use in MATLAB #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. # CMakeLists.txt: instructions for cmake to build GraphBLAS for use in MATLAB. diff --git a/GraphBLAS/GraphBLAS/Contents.m b/GraphBLAS/GraphBLAS/Contents.m index f07afa664e..635df0d956 100644 --- a/GraphBLAS/GraphBLAS/Contents.m +++ b/GraphBLAS/GraphBLAS/Contents.m @@ -29,6 +29,6 @@ % Tim Davis, Texas A&M University, % http://faculty.cse.tamu.edu/davis/GraphBLAS % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/GraphBLAS/Makefile b/GraphBLAS/GraphBLAS/Makefile index e881460b23..0fa4130fa4 100644 --- a/GraphBLAS/GraphBLAS/Makefile +++ b/GraphBLAS/GraphBLAS/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/Makefile: compile libgraphblas_matlab for use in MATLAB #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/GraphBLAS/README.md b/GraphBLAS/GraphBLAS/README.md index e44ecb8406..72630d25d3 100644 --- a/GraphBLAS/GraphBLAS/README.md +++ b/GraphBLAS/GraphBLAS/README.md @@ -1,6 +1,6 @@ # GraphBLAS/GraphBLAS: MATLAB/Octave interface for SuiteSparse:GraphBLAS -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 The @GrB class provides an easy-to-use interface to SuiteSparse:GraphBLAS. diff --git a/GraphBLAS/GraphBLAS/demo/Contents.m b/GraphBLAS/GraphBLAS/demo/Contents.m index 7493ead047..29e6495b66 100644 --- a/GraphBLAS/GraphBLAS/demo/Contents.m +++ b/GraphBLAS/GraphBLAS/demo/Contents.m @@ -20,6 +20,6 @@ % % The html folder contains the output of graphblas_demo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/GraphBLAS/demo/benchmark/dobench2.m b/GraphBLAS/GraphBLAS/demo/benchmark/dobench2.m index e78f2b61f3..67f1490b2d 100644 --- a/GraphBLAS/GraphBLAS/demo/benchmark/dobench2.m +++ b/GraphBLAS/GraphBLAS/demo/benchmark/dobench2.m @@ -1,6 +1,6 @@ % benchmark @GrB vs built-in methods -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 dolegend diff --git a/GraphBLAS/GraphBLAS/demo/benchmark/dobench_methods.m b/GraphBLAS/GraphBLAS/demo/benchmark/dobench_methods.m index 1efff287c0..f4ce2709ba 100644 --- a/GraphBLAS/GraphBLAS/demo/benchmark/dobench_methods.m +++ b/GraphBLAS/GraphBLAS/demo/benchmark/dobench_methods.m @@ -1,7 +1,7 @@ function dobench_methods (matrix, what) % dobench_methods (matrix, what) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Prob = ssget (matrix) ; diff --git a/GraphBLAS/GraphBLAS/demo/benchmark/dolegend.m b/GraphBLAS/GraphBLAS/demo/benchmark/dolegend.m index da8f6f8b6d..b2197816ff 100644 --- a/GraphBLAS/GraphBLAS/demo/benchmark/dolegend.m +++ b/GraphBLAS/GraphBLAS/demo/benchmark/dolegend.m @@ -1,6 +1,6 @@ function dolegend -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('S: large input sparse matrix (m-by-n)\n') ; diff --git a/GraphBLAS/GraphBLAS/demo/benchmark/long_enough.m b/GraphBLAS/GraphBLAS/demo/benchmark/long_enough.m index 659a11e6e3..17cca78deb 100644 --- a/GraphBLAS/GraphBLAS/demo/benchmark/long_enough.m +++ b/GraphBLAS/GraphBLAS/demo/benchmark/long_enough.m @@ -1,6 +1,6 @@ function done = long_enough (tm, tg, k) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (k < 3) diff --git a/GraphBLAS/GraphBLAS/demo/benchmark/summary.m b/GraphBLAS/GraphBLAS/demo/benchmark/summary.m index 190858a870..a221e0b42d 100644 --- a/GraphBLAS/GraphBLAS/demo/benchmark/summary.m +++ b/GraphBLAS/GraphBLAS/demo/benchmark/summary.m @@ -1,6 +1,6 @@ function [tM tG] = summary (tm, tg, ktrials) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 tM = median (tm (1:ktrials)) ; diff --git a/GraphBLAS/GraphBLAS/demo/bfs_builtin.m b/GraphBLAS/GraphBLAS/demo/bfs_builtin.m index 850ec1794b..06af8747dc 100644 --- a/GraphBLAS/GraphBLAS/demo/bfs_builtin.m +++ b/GraphBLAS/GraphBLAS/demo/bfs_builtin.m @@ -11,7 +11,7 @@ % kth level, where the shortest path (in terms of # of edges) from s to j has % length k+1. The source node s defaults to 1. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [m, n] = size (A) ; diff --git a/GraphBLAS/GraphBLAS/demo/cats_demo.m b/GraphBLAS/GraphBLAS/demo/cats_demo.m index 011b0afbbf..9a9525fb42 100644 --- a/GraphBLAS/GraphBLAS/demo/cats_demo.m +++ b/GraphBLAS/GraphBLAS/demo/cats_demo.m @@ -1,6 +1,6 @@ % cats_demo.m -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 clear diff --git a/GraphBLAS/GraphBLAS/demo/demo_nproc.m b/GraphBLAS/GraphBLAS/demo/demo_nproc.m index 297b9002f9..1483cd2afc 100644 --- a/GraphBLAS/GraphBLAS/demo/demo_nproc.m +++ b/GraphBLAS/GraphBLAS/demo/demo_nproc.m @@ -7,7 +7,7 @@ % % See also nproc (Octave), maxNumCompThreads (MATLAB) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (demo_octave) diff --git a/GraphBLAS/GraphBLAS/demo/demo_octave.m b/GraphBLAS/GraphBLAS/demo/demo_octave.m index 5241c49482..435f58f2b9 100644 --- a/GraphBLAS/GraphBLAS/demo/demo_octave.m +++ b/GraphBLAS/GraphBLAS/demo/demo_octave.m @@ -1,7 +1,7 @@ function result = demo_octave %DEMO_OCTAVE return true if Octave is in use, false for MATLAB -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 result = (exist ('OCTAVE_VERSION', 'builtin') == 5) ; diff --git a/GraphBLAS/GraphBLAS/demo/demo_whoami.m b/GraphBLAS/GraphBLAS/demo/demo_whoami.m index 9808be68c5..03c065e88d 100644 --- a/GraphBLAS/GraphBLAS/demo/demo_whoami.m +++ b/GraphBLAS/GraphBLAS/demo/demo_whoami.m @@ -1,7 +1,7 @@ function result = demo_whoami %DEMO_WHOAMI return 'Octave' or 'MATLAB' -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (demo_octave) diff --git a/GraphBLAS/GraphBLAS/demo/dnn_builtin.m b/GraphBLAS/GraphBLAS/demo/dnn_builtin.m index c50361203f..7aa3db6553 100644 --- a/GraphBLAS/GraphBLAS/demo/dnn_builtin.m +++ b/GraphBLAS/GraphBLAS/demo/dnn_builtin.m @@ -14,7 +14,7 @@ % note: this is now ported to Octave, by avoiding the use of singleton % expansion. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 Y = Y0 ; diff --git a/GraphBLAS/GraphBLAS/demo/dnn_builtin2gb.m b/GraphBLAS/GraphBLAS/demo/dnn_builtin2gb.m index 480c536633..b558c662fe 100644 --- a/GraphBLAS/GraphBLAS/demo/dnn_builtin2gb.m +++ b/GraphBLAS/GraphBLAS/demo/dnn_builtin2gb.m @@ -23,7 +23,7 @@ % % See also GrB.dnn, dnn_builtin. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fmt = 'by row' ; diff --git a/GraphBLAS/GraphBLAS/demo/dnn_run.m b/GraphBLAS/GraphBLAS/demo/dnn_run.m index d1b63ce323..566f556878 100644 --- a/GraphBLAS/GraphBLAS/demo/dnn_run.m +++ b/GraphBLAS/GraphBLAS/demo/dnn_run.m @@ -1,6 +1,6 @@ % Run the DNN benchmarks -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % reset to the default number of threads diff --git a/GraphBLAS/GraphBLAS/demo/gbdemo.m b/GraphBLAS/GraphBLAS/demo/gbdemo.m index bdb8f18059..b5ddc5efa8 100644 --- a/GraphBLAS/GraphBLAS/demo/gbdemo.m +++ b/GraphBLAS/GraphBLAS/demo/gbdemo.m @@ -1,6 +1,6 @@ %GBDEMO run the graphblas_demo.m -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (exist ('echodemo')) diff --git a/GraphBLAS/GraphBLAS/demo/gbdemo2.m b/GraphBLAS/GraphBLAS/demo/gbdemo2.m index 1adfcde216..7577330c6e 100644 --- a/GraphBLAS/GraphBLAS/demo/gbdemo2.m +++ b/GraphBLAS/GraphBLAS/demo/gbdemo2.m @@ -35,7 +35,7 @@ function gbdemo2 (bnz) % % See also GrB.assign, subsasgn. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % reset to the default number of threads diff --git a/GraphBLAS/GraphBLAS/demo/graphblas_demo.m b/GraphBLAS/GraphBLAS/demo/graphblas_demo.m index 895bffe3a0..0e24a22f89 100644 --- a/GraphBLAS/GraphBLAS/demo/graphblas_demo.m +++ b/GraphBLAS/GraphBLAS/demo/graphblas_demo.m @@ -6,7 +6,7 @@ % % http://faculty.cse.tamu.edu/davis % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %% GraphBLAS: faster and more general sparse matrices for MATLAB diff --git a/GraphBLAS/GraphBLAS/demo/graphblas_demo2.m b/GraphBLAS/GraphBLAS/demo/graphblas_demo2.m index 8650a4b6d0..b1a58079d0 100644 --- a/GraphBLAS/GraphBLAS/demo/graphblas_demo2.m +++ b/GraphBLAS/GraphBLAS/demo/graphblas_demo2.m @@ -1,6 +1,6 @@ % Run the GraphBLAS demo2 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % reset to the default number of threads diff --git a/GraphBLAS/GraphBLAS/demo/mxm_demo.m b/GraphBLAS/GraphBLAS/demo/mxm_demo.m index e0e9f90376..dc1d879380 100644 --- a/GraphBLAS/GraphBLAS/demo/mxm_demo.m +++ b/GraphBLAS/GraphBLAS/demo/mxm_demo.m @@ -3,7 +3,7 @@ % Requires the ssget interface to the SuiteSparse Matrix Collection. % See https://sparse.tamu.edu. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % reset to the default number of threads diff --git a/GraphBLAS/GraphBLAS/demo/tmask.m b/GraphBLAS/GraphBLAS/demo/tmask.m index f4fde375f5..7f90f19be6 100644 --- a/GraphBLAS/GraphBLAS/demo/tmask.m +++ b/GraphBLAS/GraphBLAS/demo/tmask.m @@ -1,6 +1,6 @@ % TMASK performance tests for logical indexing -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 clear all diff --git a/GraphBLAS/GraphBLAS/graphblas_install.m b/GraphBLAS/GraphBLAS/graphblas_install.m index d345f3c523..fbef36323c 100644 --- a/GraphBLAS/GraphBLAS/graphblas_install.m +++ b/GraphBLAS/GraphBLAS/graphblas_install.m @@ -10,7 +10,7 @@ function graphblas_install (cmake_options) % % See also mex. % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % make sure we diff --git a/GraphBLAS/GraphBLAS/rename/GB_rename.h b/GraphBLAS/GraphBLAS/rename/GB_rename.h index 92006af0fd..cbfab16bf0 100644 --- a/GraphBLAS/GraphBLAS/rename/GB_rename.h +++ b/GraphBLAS/GraphBLAS/rename/GB_rename.h @@ -1,3 +1,4 @@ +#define GB_abort GM_abort #define GB_accum_mask GM_accum_mask #define GB_add GM_add #define GB_add_iso GM_add_iso @@ -182,6 +183,7 @@ #define GB_calloc_memory GM_calloc_memory #define GB_cast_array GM_cast_array #define GB_cast_factory GM_cast_factory +#define GB_cast_int GM_cast_int #define GB_cast_matrix GM_cast_matrix #define GB_cast_to_int16_t GM_cast_to_int16_t #define GB_cast_to_int32_t GM_cast_to_int32_t @@ -232,6 +234,7 @@ #define GB_concat_sparse_jit GM_concat_sparse_jit #define GB_conform GM_conform #define GB_conform_hyper GM_conform_hyper +#define GB_container_component_new GM_container_component_new #define GB_Context_check GM_Context_check #define GB_Context_chunk_get GM_Context_chunk_get #define GB_Context_chunk GM_Context_chunk @@ -259,6 +262,7 @@ #define GB_convert_full_to_sparse GM_convert_full_to_sparse #define GB_convert_hyper_to_sparse GM_convert_hyper_to_sparse #define GB_convert_hyper_to_sparse_test GM_convert_hyper_to_sparse_test +#define GB_convert_int GM_convert_int #define GB_convert_s2b GM_convert_s2b #define GB_convert_s2b_jit GM_convert_s2b_jit #define GB_convert_sparse_to_bitmap_test GM_convert_sparse_to_bitmap_test @@ -272,6 +276,7 @@ #define GB_csignum GM_csignum #define GB_ctruncf GM_ctruncf #define GB_ctrunc GM_ctrunc +#define GB_cumsum_float GM_cumsum_float #define GB_cumsum GM_cumsum #define GB_demacrofy_name GM_demacrofy_name #define GB_desc_name_get GM_desc_name_get @@ -282,8 +287,6 @@ #define GB_dup GM_dup #define GB_dup_worker GM_dup_worker #define GB_ek_slice GM_ek_slice -#define GB_ek_slice_merge1 GM_ek_slice_merge1 -#define GB_ek_slice_merge2 GM_ek_slice_merge2 #define GB_emult_02 GM_emult_02 #define GB_emult_02_jit GM_emult_02_jit #define GB_emult_02_phase1 GM_emult_02_phase1 @@ -341,6 +344,7 @@ #define GB_export GM_export #define GB_extract GM_extract #define GB_extractTuples GM_extractTuples +#define GB_extractTuples_prep GM_extractTuples_prep #define GB_extract_vector_list GM_extract_vector_list #define GB_factory_kernels_enabled GM_factory_kernels_enabled #define GB_FC32_div GM_FC32_div @@ -392,7 +396,6 @@ #define GB_Global_free_function_get GM_Global_free_function_get #define GB_Global_free_function GM_Global_free_function #define GB_Global_free_function_set GM_Global_free_function_set -#define GB_Global_get_wtime GM_Global_get_wtime #define GB_Global_gpu_count_get GM_Global_gpu_count_get #define GB_Global_gpu_count_set GM_Global_gpu_count_set #define GB_Global_gpu_device_max_pool_size_set GM_Global_gpu_device_max_pool_size_set @@ -411,8 +414,13 @@ #define GB_Global_hyper_hash_set GM_Global_hyper_hash_set #define GB_Global_hyper_switch_get GM_Global_hyper_switch_get #define GB_Global_hyper_switch_set GM_Global_hyper_switch_set +#define GB_Global_i_control_get GM_Global_i_control_get +#define GB_Global_i_control_set GM_Global_i_control_set #define GB_Global_is_csc_get GM_Global_is_csc_get #define GB_Global_is_csc_set GM_Global_is_csc_set +#define GB_Global_j_control_get GM_Global_j_control_get +#define GB_Global_j_control_set GM_Global_j_control_set +#define GB_Global_make_persistent GM_Global_make_persistent #define GB_Global_malloc_debug_count_decrement GM_Global_malloc_debug_count_decrement #define GB_Global_malloc_debug_count_set GM_Global_malloc_debug_count_set #define GB_Global_malloc_debug_get GM_Global_malloc_debug_get @@ -435,33 +443,31 @@ #define GB_Global_mode_set GM_Global_mode_set #define GB_Global_nmalloc_clear GM_Global_nmalloc_clear #define GB_Global_nmalloc_get GM_Global_nmalloc_get +#define GB_Global_p_control_get GM_Global_p_control_get +#define GB_Global_p_control_set GM_Global_p_control_set #define GB_Global_persistent_free GM_Global_persistent_free #define GB_Global_persistent_malloc GM_Global_persistent_malloc #define GB_Global_persistent_set GM_Global_persistent_set #define GB_Global_printf_get GM_Global_printf_get #define GB_Global_printf_set GM_Global_printf_set -#define GB_Global_print_mem_shallow_get GM_Global_print_mem_shallow_get -#define GB_Global_print_mem_shallow_set GM_Global_print_mem_shallow_set #define GB_Global_print_one_based_get GM_Global_print_one_based_get #define GB_Global_print_one_based_set GM_Global_print_one_based_set #define GB_Global_realloc_function_get GM_Global_realloc_function_get #define GB_Global_realloc_function GM_Global_realloc_function #define GB_Global_realloc_function_set GM_Global_realloc_function_set +#define GB_Global_stats_mem_shallow_get GM_Global_stats_mem_shallow_get +#define GB_Global_stats_mem_shallow_set GM_Global_stats_mem_shallow_set #define GB_Global_timing_add GM_Global_timing_add #define GB_Global_timing_clear_all GM_Global_timing_clear_all #define GB_Global_timing_clear GM_Global_timing_clear #define GB_Global_timing_get GM_Global_timing_get #define GB_Global_timing_set GM_Global_timing_set -#define GB_helper0 GM_helper0 #define GB_helper10 GM_helper10 -#define GB_helper1 GM_helper1 -#define GB_helper1i GM_helper1i -#define GB_helper3 GM_helper3 -#define GB_helper3i GM_helper3i -#define GB_helper4 GM_helper4 #define GB_helper5 GM_helper5 #define GB_helper7 GM_helper7 -#define GB_helper8 GM_helper8 +#define GB_helper_container_free GM_helper_container_free +#define GB_helper_container GM_helper_container +#define GB_helper_container_new GM_helper_container_new #define GB_HIST_countFast GM_HIST_countFast #define GB_HIST_countFast_wksp GM_HIST_countFast_wksp #define GB_HIST_count GM_HIST_count @@ -492,10 +498,10 @@ #define GB_HUF_selectDecoder GM_HUF_selectDecoder #define GB_HUF_validateCTable GM_HUF_validateCTable #define GB_HUF_writeCTable_wksp GM_HUF_writeCTable_wksp +#define GB_hy_free GM_hy_free #define GB_hyper_hash_build GM_hyper_hash_build #define GB_hyper_hash_free GM_hyper_hash_free #define GB_hyper_hash_need GM_hyper_hash_need -#define GB_hypermatrix_prune GM_hypermatrix_prune #define GB_hyper_prune GM_hyper_prune #define GB_hyper_realloc GM_hyper_realloc #define GB_hyper_shallow GM_hyper_shallow @@ -511,6 +517,7 @@ #define GB_ijlength GM_ijlength #define GB_ijproperties GM_ijproperties #define GB_ijsort GM_ijsort +#define GB_ijxvector GM_ijxvector #define GB_import GM_import #define GB_IndexBinaryOp_check GM_IndexBinaryOp_check #define GB_IndexUnaryOp_check GM_IndexUnaryOp_check @@ -537,7 +544,10 @@ #define GB_jitifyer_get_C_preface GM_jitifyer_get_C_preface #define GB_jitifyer_get_CUDA_preface GM_jitifyer_get_CUDA_preface #define GB_jitifyer_get_error_log GM_jitifyer_get_error_log +#define GB_jitifyer_get_query GM_jitifyer_get_query #define GB_jitifyer_get_use_cmake GM_jitifyer_get_use_cmake +#define GB_jitifyer_get_user_op GM_jitifyer_get_user_op +#define GB_jitifyer_get_user_type GM_jitifyer_get_user_type #define GB_jitifyer_hash_encoding GM_jitifyer_hash_encoding #define GB_jitifyer_hash GM_jitifyer_hash #define GB_jitifyer_init GM_jitifyer_init @@ -852,6 +862,8 @@ #define GB_JITpackage_350 GM_JITpackage_350 #define GB_JITpackage_351 GM_JITpackage_351 #define GB_JITpackage_352 GM_JITpackage_352 +#define GB_JITpackage_353 GM_JITpackage_353 +#define GB_JITpackage_354 GM_JITpackage_354 #define GB_JITpackage_35 GM_JITpackage_35 #define GB_JITpackage_36 GM_JITpackage_36 #define GB_JITpackage_37 GM_JITpackage_37 @@ -929,6 +941,7 @@ #define GB_kroner GM_kroner #define GB_kroner_jit GM_kroner_jit #define GB_kron GM_kron +#define GB_load_from_container GM_load_from_container #define GB_LZ4_attach_dictionary GM_LZ4_attach_dictionary #define GB_LZ4_attach_HC_dictionary GM_LZ4_attach_HC_dictionary #define GB_LZ4_calloc GM_LZ4_calloc @@ -1014,6 +1027,7 @@ #define GB_macrofy_apply GM_macrofy_apply #define GB_macrofy_assign GM_macrofy_assign #define GB_macrofy_binop GM_macrofy_binop +#define GB_macrofy_bits GM_macrofy_bits #define GB_macrofy_build GM_macrofy_build #define GB_macrofy_bytes GM_macrofy_bytes #define GB_macrofy_cast_copy GM_macrofy_cast_copy @@ -1046,7 +1060,6 @@ #define GB_macrofy_unop GM_macrofy_unop #define GB_macrofy_user_op GM_macrofy_user_op #define GB_macrofy_user_type GM_macrofy_user_type -#define GB_make_shallow GM_make_shallow #define GB_malloc_memory GM_malloc_memory #define GB_Mask_compatible GM_Mask_compatible #define GB_masker GM_masker @@ -1056,11 +1069,13 @@ #define GB_masker_phase2_jit GM_masker_phase2_jit #define GB_masker_sparsity GM_masker_sparsity #define GB_mask GM_mask +#define GB_Matrix_assign_scalar GM_Matrix_assign_scalar #define GB_Matrix_check GM_Matrix_check #define GB_Matrix_diag GM_Matrix_diag #define GB_Matrix_free GM_Matrix_free #define GB_Matrix_new GM_Matrix_new #define GB_Matrix_removeElement GM_Matrix_removeElement +#define GB_Matrix_subassign_scalar GM_Matrix_subassign_scalar #define GB_matvec_check GM_matvec_check #define GB_matvec_enum_get GM_matvec_enum_get #define GB_matvec_name_get GM_matvec_name_get @@ -1076,11 +1091,8 @@ #define GB_monoid_get GM_monoid_get #define GB_monoid_name_get GM_monoid_name_get #define GB_Monoid_new GM_Monoid_new -#define GB_msort_1_create_merge_tasks GM_msort_1_create_merge_tasks #define GB_msort_1 GM_msort_1 -#define GB_msort_2_create_merge_tasks GM_msort_2_create_merge_tasks #define GB_msort_2 GM_msort_2 -#define GB_msort_3_create_merge_tasks GM_msort_3_create_merge_tasks #define GB_msort_3 GM_msort_3 #define GB_mxm GM_mxm #define GB_new_bix GM_new_bix @@ -1135,15 +1147,38 @@ #define GB_pow_uint64 GM_pow_uint64 #define GB_pow_uint8 GM_pow_uint8 #define GB_prejit GM_prejit +#define GB_p_slice_32 GM_p_slice_32 +#define GB_p_slice_64 GM_p_slice_64 +#define GB_p_slice_float GM_p_slice_float #define GB_p_slice GM_p_slice -#define GB_qsort_1b GM_qsort_1b -#define GB_qsort_1b_size16 GM_qsort_1b_size16 -#define GB_qsort_1b_size1 GM_qsort_1b_size1 -#define GB_qsort_1b_size2 GM_qsort_1b_size2 -#define GB_qsort_1b_size4 GM_qsort_1b_size4 -#define GB_qsort_1b_size8 GM_qsort_1b_size8 +#define GB_qsort_1_32 GM_qsort_1_32 +#define GB_qsort_1_64 GM_qsort_1_64 +#define GB_qsort_1b_32_generic GM_qsort_1b_32_generic +#define GB_qsort_1b_32_size16 GM_qsort_1b_32_size16 +#define GB_qsort_1b_32_size1 GM_qsort_1b_32_size1 +#define GB_qsort_1b_32_size2 GM_qsort_1b_32_size2 +#define GB_qsort_1b_32_size4 GM_qsort_1b_32_size4 +#define GB_qsort_1b_32_size8 GM_qsort_1b_32_size8 +#define GB_qsort_1b_64_generic GM_qsort_1b_64_generic +#define GB_qsort_1b_64_size16 GM_qsort_1b_64_size16 +#define GB_qsort_1b_64_size1 GM_qsort_1b_64_size1 +#define GB_qsort_1b_64_size2 GM_qsort_1b_64_size2 +#define GB_qsort_1b_64_size4 GM_qsort_1b_64_size4 +#define GB_qsort_1b_64_size8 GM_qsort_1b_64_size8 #define GB_qsort_1 GM_qsort_1 +#define GB_qsort_2_32_32 GM_qsort_2_32_32 +#define GB_qsort_2_32_64 GM_qsort_2_32_64 +#define GB_qsort_2_64_32 GM_qsort_2_64_32 +#define GB_qsort_2_64_64 GM_qsort_2_64_64 #define GB_qsort_2 GM_qsort_2 +#define GB_qsort_3_32_32_32 GM_qsort_3_32_32_32 +#define GB_qsort_3_32_32_64 GM_qsort_3_32_32_64 +#define GB_qsort_3_32_64_32 GM_qsort_3_32_64_32 +#define GB_qsort_3_32_64_64 GM_qsort_3_32_64_64 +#define GB_qsort_3_64_32_32 GM_qsort_3_64_32_32 +#define GB_qsort_3_64_32_64 GM_qsort_3_64_32_64 +#define GB_qsort_3_64_64_32 GM_qsort_3_64_64_32 +#define GB_qsort_3_64_64_64 GM_qsort_3_64_64_64 #define GB_qsort_3 GM_qsort_3 #define GB_realloc_memory GM_realloc_memory #define GB_reduce_to_scalar GM_reduce_to_scalar @@ -1264,6 +1299,7 @@ #define GB_union_jit GM_union_jit #define GB_unjumble GM_unjumble #define GB_unjumble_jit GM_unjumble_jit +#define GB_unload_into_container GM_unload_into_container #define GB_unop_code_iso GM_unop_code_iso #define GB_unop_identity GM_unop_identity #define GB_unop_iso GM_unop_iso @@ -1272,9 +1308,14 @@ #define GB_user_name_set GM_user_name_set #define GB_user_op_jit GM_user_op_jit #define GB_user_type_jit GM_user_type_jit +#define GB_Vector_assign_scalar GM_Vector_assign_scalar #define GB_Vector_check GM_Vector_check #define GB_Vector_diag GM_Vector_diag +#define GB_vector_load GM_vector_load #define GB_Vector_removeElement GM_Vector_removeElement +#define GB_vector_reset GM_vector_reset +#define GB_Vector_subassign_scalar GM_Vector_subassign_scalar +#define GB_vector_unload GM_vector_unload #define GB_wait GM_wait #define GB_werk_pop GM_werk_pop #define GB_werk_push GM_werk_push @@ -3128,9 +3169,14 @@ #define GxB_CIMAG_FC64 GxM_CIMAG_FC64 #define GxB_CMPLX_FP32 GxM_CMPLX_FP32 #define GxB_CMPLX_FP64 GxM_CMPLX_FP64 +#define GxB_Col_assign_Vector GxM_Col_assign_Vector +#define GxB_Col_extract_Vector GxM_Col_extract_Vector #define GxB_Col_subassign GxM_Col_subassign +#define GxB_Col_subassign_Vector GxM_Col_subassign_Vector #define GxB_CONJ_FC32 GxM_CONJ_FC32 #define GxB_CONJ_FC64 GxM_CONJ_FC64 +#define GxB_Container_free GxM_Container_free +#define GxB_Container_new GxM_Container_new #define GxB_Context_disengage GxM_Context_disengage #define GxB_Context_engage GxM_Context_engage #define GxB_Context_error GxM_Context_error @@ -3521,6 +3567,8 @@ #define GxB_LNOT_UINT32 GxM_LNOT_UINT32 #define GxB_LNOT_UINT64 GxM_LNOT_UINT64 #define GxB_LNOT_UINT8 GxM_LNOT_UINT8 +#define GxB_load_Matrix_from_Container GxM_load_Matrix_from_Container +#define GxB_load_Vector_from_Container GxM_load_Vector_from_Container #define GxB_LOG10_FC32 GxM_LOG10_FC32 #define GxB_LOG10_FC64 GxM_LOG10_FC64 #define GxB_LOG10_FP32 GxM_LOG10_FP32 @@ -3716,9 +3764,13 @@ #define GxB_Matrix_apply_IndexOp_FC64 GxM_Matrix_apply_IndexOp_FC64 #define GxB_Matrix_assign_FC32 GxM_Matrix_assign_FC32 #define GxB_Matrix_assign_FC64 GxM_Matrix_assign_FC64 +#define GxB_Matrix_assign_Scalar_Vector GxM_Matrix_assign_Scalar_Vector +#define GxB_Matrix_assign_Vector GxM_Matrix_assign_Vector #define GxB_Matrix_build_FC32 GxM_Matrix_build_FC32 #define GxB_Matrix_build_FC64 GxM_Matrix_build_FC64 #define GxB_Matrix_build_Scalar GxM_Matrix_build_Scalar +#define GxB_Matrix_build_Scalar_Vector GxM_Matrix_build_Scalar_Vector +#define GxB_Matrix_build_Vector GxM_Matrix_build_Vector #define GxB_Matrix_concat GxM_Matrix_concat #define GxB_Matrix_deserialize GxM_Matrix_deserialize #define GxB_Matrix_diag GxM_Matrix_diag @@ -3737,6 +3789,8 @@ #define GxB_Matrix_extractElement_FC64 GxM_Matrix_extractElement_FC64 #define GxB_Matrix_extractTuples_FC32 GxM_Matrix_extractTuples_FC32 #define GxB_Matrix_extractTuples_FC64 GxM_Matrix_extractTuples_FC64 +#define GxB_Matrix_extractTuples_Vector GxM_Matrix_extractTuples_Vector +#define GxB_Matrix_extract_Vector GxM_Matrix_extract_Vector #define GxB_Matrix_fprint GxM_Matrix_fprint #define GxB_Matrix_import_BitmapC GxM_Matrix_import_BitmapC #define GxB_Matrix_import_BitmapR GxM_Matrix_import_BitmapR @@ -3789,11 +3843,13 @@ #define GxB_Matrix_subassign_INT64 GxM_Matrix_subassign_INT64 #define GxB_Matrix_subassign_INT8 GxM_Matrix_subassign_INT8 #define GxB_Matrix_subassign_Scalar GxM_Matrix_subassign_Scalar +#define GxB_Matrix_subassign_Scalar_Vector GxM_Matrix_subassign_Scalar_Vector #define GxB_Matrix_subassign_UDT GxM_Matrix_subassign_UDT #define GxB_Matrix_subassign_UINT16 GxM_Matrix_subassign_UINT16 #define GxB_Matrix_subassign_UINT32 GxM_Matrix_subassign_UINT32 #define GxB_Matrix_subassign_UINT64 GxM_Matrix_subassign_UINT64 #define GxB_Matrix_subassign_UINT8 GxM_Matrix_subassign_UINT8 +#define GxB_Matrix_subassign_Vector GxM_Matrix_subassign_Vector #define GxB_Matrix_type GxM_Matrix_type #define GxB_Matrix_type_name GxM_Matrix_type_name #define GxB_Matrix_unpack_BitmapC GxM_Matrix_unpack_BitmapC @@ -4617,7 +4673,9 @@ #define GxB_ROUND_FC64 GxM_ROUND_FC64 #define GxB_ROUND_FP32 GxM_ROUND_FP32 #define GxB_ROUND_FP64 GxM_ROUND_FP64 +#define GxB_Row_assign_Vector GxM_Row_assign_Vector #define GxB_Row_subassign GxM_Row_subassign +#define GxB_Row_subassign_Vector GxM_Row_subassign_Vector #define GxB_Scalar_clear GxM_Scalar_clear #define GxB_Scalar_dup GxM_Scalar_dup #define GxB_Scalar_error GxM_Scalar_error @@ -4969,6 +5027,8 @@ #define GxB_UnaryOp_xtype_name GxM_UnaryOp_xtype_name #define GxB_UnaryOp_ztype GxM_UnaryOp_ztype #define GxB_UnaryOp_ztype_name GxM_UnaryOp_ztype_name +#define GxB_unload_Matrix_into_Container GxM_unload_Matrix_into_Container +#define GxB_unload_Vector_into_Container GxM_unload_Vector_into_Container #define GxB_unpack_HyperHash GxM_unpack_HyperHash #define GxB_VALUEEQ_FC32 GxM_VALUEEQ_FC32 #define GxB_VALUEEQ_FC64 GxM_VALUEEQ_FC64 @@ -4984,9 +5044,13 @@ #define GxB_Vector_apply_IndexOp_FC64 GxM_Vector_apply_IndexOp_FC64 #define GxB_Vector_assign_FC32 GxM_Vector_assign_FC32 #define GxB_Vector_assign_FC64 GxM_Vector_assign_FC64 +#define GxB_Vector_assign_Scalar_Vector GxM_Vector_assign_Scalar_Vector +#define GxB_Vector_assign_Vector GxM_Vector_assign_Vector #define GxB_Vector_build_FC32 GxM_Vector_build_FC32 #define GxB_Vector_build_FC64 GxM_Vector_build_FC64 #define GxB_Vector_build_Scalar GxM_Vector_build_Scalar +#define GxB_Vector_build_Scalar_Vector GxM_Vector_build_Scalar_Vector +#define GxB_Vector_build_Vector GxM_Vector_build_Vector #define GxB_Vector_deserialize GxM_Vector_deserialize #define GxB_Vector_diag GxM_Vector_diag #define GxB_Vector_eWiseUnion GxM_Vector_eWiseUnion @@ -4997,12 +5061,15 @@ #define GxB_Vector_extractElement_FC64 GxM_Vector_extractElement_FC64 #define GxB_Vector_extractTuples_FC32 GxM_Vector_extractTuples_FC32 #define GxB_Vector_extractTuples_FC64 GxM_Vector_extractTuples_FC64 +#define GxB_Vector_extractTuples_Vector GxM_Vector_extractTuples_Vector +#define GxB_Vector_extract_Vector GxM_Vector_extract_Vector #define GxB_Vector_fprint GxM_Vector_fprint #define GxB_Vector_import_Bitmap GxM_Vector_import_Bitmap #define GxB_Vector_import_CSC GxM_Vector_import_CSC #define GxB_Vector_import_Full GxM_Vector_import_Full #define GxB_Vector_iso GxM_Vector_iso #define GxB_Vector_isStoredElement GxM_Vector_isStoredElement +#define GxB_Vector_load GxM_Vector_load #define GxB_Vector_memoryUsage GxM_Vector_memoryUsage #define GxB_Vector_Option_get_FP64 GxM_Vector_Option_get_FP64 #define GxB_Vector_Option_get GxM_Vector_Option_get @@ -5034,13 +5101,16 @@ #define GxB_Vector_subassign_INT64 GxM_Vector_subassign_INT64 #define GxB_Vector_subassign_INT8 GxM_Vector_subassign_INT8 #define GxB_Vector_subassign_Scalar GxM_Vector_subassign_Scalar +#define GxB_Vector_subassign_Scalar_Vector GxM_Vector_subassign_Scalar_Vector #define GxB_Vector_subassign_UDT GxM_Vector_subassign_UDT #define GxB_Vector_subassign_UINT16 GxM_Vector_subassign_UINT16 #define GxB_Vector_subassign_UINT32 GxM_Vector_subassign_UINT32 #define GxB_Vector_subassign_UINT64 GxM_Vector_subassign_UINT64 #define GxB_Vector_subassign_UINT8 GxM_Vector_subassign_UINT8 +#define GxB_Vector_subassign_Vector GxM_Vector_subassign_Vector #define GxB_Vector_type GxM_Vector_type #define GxB_Vector_type_name GxM_Vector_type_name +#define GxB_Vector_unload GxM_Vector_unload #define GxB_Vector_unpack_Bitmap GxM_Vector_unpack_Bitmap #define GxB_Vector_unpack_CSC GxM_Vector_unpack_CSC #define GxB_Vector_unpack_Full GxM_Vector_unpack_Full diff --git a/GraphBLAS/GraphBLAS/rename/Makefile b/GraphBLAS/GraphBLAS/rename/Makefile index 3d470a375d..83b4ab4f9e 100644 --- a/GraphBLAS/GraphBLAS/rename/Makefile +++ b/GraphBLAS/GraphBLAS/rename/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/rename/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/GraphBLAS/test/Contents.m b/GraphBLAS/GraphBLAS/test/Contents.m index 6b15cc5884..c8625bd2e9 100644 --- a/GraphBLAS/GraphBLAS/test/Contents.m +++ b/GraphBLAS/GraphBLAS/test/Contents.m @@ -1,145 +1,151 @@ % SuiteSparse/GraphBLAS/GraphBLAS/test: testing GraphBLAS interface % -% gbtest - test GraphBLAS interface +% gbtest - test GraphBLAS interface % -% gbtest0 - test GrB.clear -% gbtest1 - test GrB -% gbtest2 - list all binary operators -% gbtest3 - test dnn -% gbtest4 - list all semirings -% gbtest5 - test GrB.descriptorinfo -% gbtest6 - test GrB.mxm -% gbtest7 - test GrB.build -% gbtest8 - test GrB.select -% gbtest9 - test eye and speye -% gbtest10 - test GrB.assign -% gbtest11 - test GrB, sparse -% gbtest12 - test GrB.eadd, GrB.emult, GrB.eunion -% gbtest13 - test find and GrB.extracttuples -% gbtest14 - test kron and GrB.kronecker -% gbtest15 - list all unary operators -% gbtest16 - test GrB.extract -% gbtest17 - test GrB.trans -% gbtest18 - test comparators (and, or, >, ...) -% gbtest19 - test mpower -% gbtest20 - test bandwidth, isdiag, ceil, floor, round, fix -% gbtest21 - test isfinite, isinf, isnan -% gbtest22 - test reduce to scalar -% gbtest23 - test min and max -% gbtest24 - test any, all -% gbtest25 - test diag, tril, triu -% gbtest26 - test typecasting -% gbtest27 - test conversion to full -% gbtest28 - test GrB.build -% gbtest29 - test subsref and subsasgn with logical indexing -% gbtest30 - test colon notation -% gbtest31 - test GrB and casting -% gbtest32 - test nonzeros -% gbtest33 - test spones, numel, nzmax, size, length, is*, ... -% gbtest34 - test repmat -% gbtest35 - test reshape (built-in variant) -% gbtest36 - test abs, sign -% gbtest37 - test istril, istriu, isbanded, isdiag, ishermitian, ... -% gbtest38 - test sqrt, eps, ceil, floor, round, fix, real, conj, ... -% gbtest39 - test amd, colamd, symamd, symrcm, dmperm, etree -% gbtest40 - test sum, prod, max, min, any, all, norm -% gbtest41 - test ones, zeros, false -% gbtest42 - test for nan -% gbtest43 - test error handling -% gbtest44 - test subsasgn, mtimes, plus, false, ... -% gbtest45 - test GrB.vreduce -% gbtest46 - test GrB.subassign and GrB.assign -% gbtest47 - test GrB.entries, GrB.nonz, numel -% gbtest48 - test GrB.apply -% gbtest49 - test GrB.prune -% gbtest50 - test GrB.ktruss and GrB.tricount -% gbtest51 - test GrB.tricount and concatenate -% gbtest52 - test GrB.format -% gbtest53 - test GrB.monoidinfo -% gbtest54 - test GrB.compact -% gbtest55 - test disp -% gbtest56 - test GrB.empty -% gbtest57 - test fprintf and sprintf -% gbtest58 - test uplus -% gbtest59 - test end -% gbtest60 - test GrB.issigned -% gbtest61 - test GrB.laplacian -% gbtest62 - test ldivide, rdivide, mldivide, mrdivide -% gbtest63 - test GrB.incidence -% gbtest64 - test GrB.pagerank -% gbtest65 - test GrB.mis -% gbtest66 - test graph -% gbtest67 - test digraph -% gbtest68 - test isequal -% gbtest69 - test flip -% gbtest70 - test GrB.random -% gbtest71 - test GrB.selectopinfo -% gbtest72 - test any-pair semiring -% gbtest73 - test GrB.normdiff -% gbtest74 - test bitwise operators -% gbtest75 - test bitshift -% gbtest76 - test trig and other functions -% gbtest77 - test error handling -% gbtest78 - test integer operators -% gbtest79 - test real power -% gbtest80 - test complex division and power -% gbtest81 - test complex operators -% gbtest82 - test complex A*B, A'*B, A*B', A'*B', A+B -% gbtest83 - test GrB.apply -% gbtest84 - test GrB.assign -% gbtest85 - test GrB.subassign -% gbtest86 - test GrB.mxm -% gbtest87 - test GrB.eadd -% gbtest88 - test GrB.emult -% gbtest89 - test GrB.extract -% gbtest90 - test GrB.reduce -% gbtest91 - test GrB.trans -% gbtest92 - test GrB.kronecker -% gbtest93 - test GrB.select -% gbtest94 - test GrB.vreduce -% gbtest95 - test indexing -% gbtest96 - test GrB.optype -% gbtest97 - test GrB.apply2 -% gbtest98 - test row/col degree for hypersparse matrices -% gbtest99 - test performance of C=A'*B and C=A' -% gbtest00 - test GrB.bfs and plot (graph (G)) -% gbtest100 - test GrB.ver and GrB.version -% gbtest101 - test loading of v3 GraphBLAS objects -% gbtest102 - test horzcat, vertcat, cat, cell2mat, mat2cell, num2cell -% gbtest103 - test iso matrices -% gbtest104 - test formats -% gbtest105 - test logical assignment with iso matrices -% gbtest106 - test build -% gbtest107 - test cell2mat error handling -% gbtest108 - test mat2cell -% gbtest109 - test num2cell -% gbtest110 - test argmax -% gbtest111 - test argmin -% gbtest112 - test load and save -% gbtest113 - test ones and eq -% gbtest114 - test kron with iso matrices -% gbtest115 - test serialize/deserialize -% gbtest116 - list all idxunop operators for GrB.apply2 -% gbtest117 - test idxunop in GrB.apply2 -% gbtest118 - test GrB.argsort -% gbtest119 - test GrB.eunion -% gbtest120 - test subsref -% gbtest121 - test times with scalars -% gbtest122 - test reshape (extended methods in GrB) +% gbtest0 - test GrB.clear +% gbtest1 - test GrB +% gbtest2 - list all binary operators +% gbtest3 - test dnn +% gbtest4 - list all semirings +% gbtest5 - test GrB.descriptorinfo +% gbtest6 - test GrB.mxm +% gbtest7 - test GrB.build +% gbtest8 - test GrB.select +% gbtest9 - test eye and speye +% gbtest10 - test GrB.assign +% gbtest11 - test GrB, sparse +% gbtest12 - test GrB.eadd, GrB.emult, GrB.eunion +% gbtest13 - test find and GrB.extracttuples +% gbtest14 - test kron and GrB.kronecker +% gbtest15 - list all unary operators +% gbtest16 - test GrB.extract +% gbtest17 - test GrB.trans +% gbtest18 - test comparators (and, or, >, ...) +% gbtest19 - test mpower +% gbtest20 - test bandwidth, isdiag, ceil, floor, round, fix +% gbtest21 - test isfinite, isinf, isnan +% gbtest22 - test reduce to scalar +% gbtest23 - test min and max +% gbtest24 - test any, all +% gbtest25 - test diag, tril, triu +% gbtest26 - test typecasting +% gbtest27 - test conversion to full +% gbtest28 - test GrB.build +% gbtest29 - test subsref and subsasgn with logical indexing +% gbtest30 - test colon notation +% gbtest31 - test GrB and casting +% gbtest32 - test nonzeros +% gbtest33 - test spones, numel, nzmax, size, length, is*, ... +% gbtest34 - test repmat +% gbtest35 - test reshape (built-in variant) +% gbtest36 - test abs, sign +% gbtest37 - test istril, istriu, isbanded, isdiag, ishermitian, ... +% gbtest38 - test sqrt, eps, ceil, floor, round, fix, real, conj, ... +% gbtest39 - test amd, colamd, symamd, symrcm, dmperm, etree +% gbtest40 - test sum, prod, max, min, any, all, norm +% gbtest41 - test ones, zeros, false +% gbtest42 - test for nan +% gbtest43 - test error handling +% gbtest44 - test subsasgn, mtimes, plus, false, ... +% gbtest45 - test GrB.vreduce +% gbtest46 - test GrB.subassign and GrB.assign +% gbtest47 - test GrB.entries, GrB.nonz, numel +% gbtest48 - test GrB.apply +% gbtest49 - test GrB.prune +% gbtest50 - test GrB.ktruss and GrB.tricount +% gbtest51 - test GrB.tricount and concatenate +% gbtest52 - test GrB.format +% gbtest53 - test GrB.monoidinfo +% gbtest54 - test GrB.compact +% gbtest55 - test disp +% gbtest56 - test GrB.empty +% gbtest57 - test fprintf and sprintf +% gbtest58 - test uplus +% gbtest59 - test end +% gbtest60 - test GrB.issigned +% gbtest61 - test GrB.laplacian +% gbtest62 - test ldivide, rdivide, mldivide, mrdivide +% gbtest63 - test GrB.incidence +% gbtest64 - test GrB.pagerank +% gbtest65 - test GrB.mis +% gbtest66 - test graph +% gbtest67 - test digraph +% gbtest68 - test isequal +% gbtest69 - test flip +% gbtest70 - test GrB.random +% gbtest71 - test GrB.selectopinfo +% gbtest72 - test any-pair semiring +% gbtest73 - test GrB.normdiff +% gbtest74 - test bitwise operators +% gbtest75 - test bitshift +% gbtest76 - test trig and other functions +% gbtest77 - test error handling +% gbtest78 - test integer operators +% gbtest79 - test real power +% gbtest80 - test complex division and power +% gbtest81 - test complex operators +% gbtest82 - test complex A*B, A'*B, A*B', A'*B', A+B +% gbtest83 - test GrB.apply +% gbtest84 - test GrB.assign +% gbtest85 - test GrB.subassign +% gbtest86 - test GrB.mxm +% gbtest87 - test GrB.eadd +% gbtest88 - test GrB.emult +% gbtest89 - test GrB.extract +% gbtest90 - test GrB.reduce +% gbtest91 - test GrB.trans +% gbtest92 - test GrB.kronecker +% gbtest93 - test GrB.select +% gbtest94 - test GrB.vreduce +% gbtest95 - test indexing +% gbtest96 - test GrB.optype +% gbtest97 - test GrB.apply2 +% gbtest98 - test row/col degree for hypersparse matrices +% gbtest99 - test performance of C=A'*B and C=A' +% gbtest00 - test GrB.bfs and plot (graph (G)) +% gbtest100 - test GrB.ver and GrB.version +% gbtest101 - test loading of v3 GraphBLAS objects +% gbtest102 - test horzcat, vertcat, cat, cell2mat, mat2cell, num2cell +% gbtest103 - test iso matrices +% gbtest104 - test formats +% gbtest105 - test logical assignment with iso matrices +% gbtest106 - test build +% gbtest107 - test cell2mat error handling +% gbtest108 - test mat2cell +% gbtest109 - test num2cell +% gbtest110 - test argmax +% gbtest111 - test argmin +% gbtest112 - test load and save +% gbtest113 - test ones and eq +% gbtest114 - test kron with iso matrices +% gbtest115 - test serialize/deserialize +% gbtest116 - list all idxunop operators for GrB.apply2 +% gbtest117 - test idxunop in GrB.apply2 +% gbtest118 - test GrB.argsort +% gbtest119 - test GrB.eunion +% gbtest120 - test subsref +% gbtest121 - test times with scalars +% gbtest122 - test reshape (extended methods in GrB) +% gbtest123 - test build +% gbtest124 - test GrB.binops +% gbtest125 - test GrB.monoids +% gbtest126 - test GrB.selectops +% gbtest127 - test GrB.semirings +% gbtest128 - test GrB.unops % % Utilities and other tests: % -% gbtest_binops - list of all binary operators -% gbtest_types - return a cell array of strings, listing all types -% gbtest_eq - tests if A and B are equal, after dropping zeros. -% gbtest_perf1 - test A*x performance -% gbtest_perf2 - test A'*x performance -% gbtest_cast - cast a built-in matrix to another type. -% gbtest_complex - return list of complex operators -% gbtest_err - compare two matrices -% gb_contains - same as contains (text, pattern) -% gb_octave - return true if Octave is in use, false for MATLAB +% gbtest_binops - list of all binary operators +% gbtest_types - return a cell array of strings, listing all types +% gbtest_eq - tests if A and B are equal, after dropping zeros. +% gbtest_perf1 - test A*x performance +% gbtest_perf2 - test A'*x performance +% gbtest_cast - cast a built-in matrix to another type. +% gbtest_complex - return list of complex operators +% gbtest_err - compare two matrices +% gb_contains - same as contains (text, pattern) +% gb_octave - return true if Octave is in use, false for MATLAB -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/GraphBLAS/test/README.md b/GraphBLAS/GraphBLAS/test/README.md index 30a061a8a6..6ff071b43a 100644 --- a/GraphBLAS/GraphBLAS/test/README.md +++ b/GraphBLAS/GraphBLAS/test/README.md @@ -32,6 +32,6 @@ GraphBLAS resides in your file system. See the tcov subfolder to run the test with statement coverage of the C mexFunctions and utility routines. -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/GraphBLAS/test/gb_contains.m b/GraphBLAS/GraphBLAS/test/gb_contains.m index 84bd18d291..1f6cf6ae8e 100644 --- a/GraphBLAS/GraphBLAS/test/gb_contains.m +++ b/GraphBLAS/GraphBLAS/test/gb_contains.m @@ -1,7 +1,7 @@ function s = gb_contains (text, pattern) %GB_CONTAINS same as contains (text, pattern) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = ~isempty (strfind (text, pattern)) ; %#ok diff --git a/GraphBLAS/GraphBLAS/test/gb_octave.m b/GraphBLAS/GraphBLAS/test/gb_octave.m index cf8c8793a9..60a822b682 100644 --- a/GraphBLAS/GraphBLAS/test/gb_octave.m +++ b/GraphBLAS/GraphBLAS/test/gb_octave.m @@ -1,7 +1,7 @@ function result = gb_octave %GB_OCTAVE return true if Octave is in use, false for MATLAB -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 result = (exist ('OCTAVE_VERSION', 'builtin') == 5) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest.m b/GraphBLAS/GraphBLAS/test/gbtest.m index 5f0fec98f8..e100af6141 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest.m +++ b/GraphBLAS/GraphBLAS/test/gbtest.m @@ -21,7 +21,7 @@ % % See also GrB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % gbtest3 requires ../demo/dnn_builtin.m and ../demo/dnn_builtin2gb.m. @@ -174,6 +174,12 @@ gbtest120 % test subsref gbtest121 % test times with scalars gbtest122 % test reshape +gbtest123 % test reshape +gbtest124 % test binops +gbtest125 % test monoids +gbtest126 % test selectops +gbtest127 % test semirings +gbtest128 % test unops gbtest96 % test GrB.optype if (~have_octave) diff --git a/GraphBLAS/GraphBLAS/test/gbtest0.m b/GraphBLAS/GraphBLAS/test/gbtest0.m index 36297eddf8..322e90f67b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest0.m +++ b/GraphBLAS/GraphBLAS/test/gbtest0.m @@ -1,7 +1,7 @@ function gbtest0 %GBTEST0 test GrB.clear -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GrB.clear diff --git a/GraphBLAS/GraphBLAS/test/gbtest00.m b/GraphBLAS/GraphBLAS/test/gbtest00.m index b0006bb9ed..81217d1a03 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest00.m +++ b/GraphBLAS/GraphBLAS/test/gbtest00.m @@ -1,7 +1,7 @@ function gbtest00 (doplots) %GBTEST00 test GrB.bfs and plot (graph (G)) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/GraphBLAS/test/gbtest1.m b/GraphBLAS/GraphBLAS/test/gbtest1.m index faafbbbb24..a2dfc360d2 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest1.m +++ b/GraphBLAS/GraphBLAS/test/gbtest1.m @@ -1,7 +1,7 @@ function gbtest1 %GBTEST1 test GrB -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -35,6 +35,8 @@ Z = sparse (m, n) assert (isequal (A, Z)) ; A = GrB (m, n, 'by row') ; + Z + A assert (isequal (A, Z)) ; fprintf ('\n---- A = GrB (%d, %d, ''%s'') :\n', m, n, type) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest10.m b/GraphBLAS/GraphBLAS/test/gbtest10.m index e8b3acb937..6bfab13a0f 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest10.m +++ b/GraphBLAS/GraphBLAS/test/gbtest10.m @@ -1,7 +1,7 @@ function gbtest10 %GBTEST10 test GrB.assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest100.m b/GraphBLAS/GraphBLAS/test/gbtest100.m index cc9e36bec1..e107d17f09 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest100.m +++ b/GraphBLAS/GraphBLAS/test/gbtest100.m @@ -1,7 +1,7 @@ function gbtest100 %GBTEST100 test GrB.ver and GrB.version -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GrB.MATLAB_vs_GrB ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest101.m b/GraphBLAS/GraphBLAS/test/gbtest101.m index 2bc4395f4f..fb70e00135 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest101.m +++ b/GraphBLAS/GraphBLAS/test/gbtest101.m @@ -1,7 +1,7 @@ function gbtest101 %GBTEST101 test loading of v3 GraphBLAS objects -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 load gbtestv3 %#ok @@ -11,16 +11,16 @@ fprintf ('================== v3 sparse struct:\n') ; G_struct = struct (G) %#ok<*NOPRT> G2 = GrB (G, 'sparse') ; -fprintf ('================== v7_3 sparse struct:\n') ; +fprintf ('================== v10 sparse struct:\n') ; G2_struct = struct (G2) assert (isequal (G, A)) ; assert (isequal (G2, A)) ; assert (isfield (G_struct, 'GraphBLAS')) ; -assert (isfield (G2_struct, 'GraphBLASv7_3')) ; +assert (isfield (G2_struct, 'GraphBLASv10')) ; G3 = GrB (G) ; G3_struct = struct (G3) ; -assert (isfield (G3_struct, 'GraphBLASv7_3')) ; +assert (isfield (G3_struct, 'GraphBLASv10')) ; assert (isequal (G3, A)) ; [m1, n1] = size (G) ; @@ -41,14 +41,14 @@ H2 = GrB (H, 'hyper') ; fprintf ('================== v3 hypersparse struct:\n') ; H_struct = struct (H) -fprintf ('================== v7_3 hypersparse struct:\n') ; +fprintf ('================== v10 hypersparse struct:\n') ; H2_struct = struct (H2) assert (isfield (H_struct, 'GraphBLAS')) ; -assert (isfield (H2_struct, 'GraphBLASv7_3')) ; +assert (isfield (H2_struct, 'GraphBLASv10')) ; H3 = GrB (H) ; H3_struct = struct (H3) ; -assert (isfield (H3_struct, 'GraphBLASv7_3')) ; +assert (isfield (H3_struct, 'GraphBLASv10')) ; assert (isequal (H3, H)) ; H3 = GrB (n,n) ; @@ -63,6 +63,8 @@ t1 = GrB.type (H2) ; t2 = GrB.type (H) ; +t1 +t2 assert (isequal (t1, t2)) ; R2 = GrB (R) ; @@ -70,18 +72,18 @@ assert (isequal (R2, A')) ; assert (isfield (struct (R), 'GraphBLAS')) ; -assert (isfield (struct (R2), 'GraphBLASv7_3')) ; +assert (isfield (struct (R2), 'GraphBLASv10')) ; X2 = GrB (X) ; assert (isequal (magic (4), X)) ; assert (isequal (magic (4), X2)) ; assert (isfield (struct (X), 'GraphBLAS')) ; -assert (isfield (struct (X2), 'GraphBLASv7_3')) ; +assert (isfield (struct (X2), 'GraphBLASv10')) ; fprintf ('================== v3 dense struct (held in sparse format):\n') ; X_struct = struct (X) %#ok<*NASGU> -fprintf ('================== v7_3 dense struct (no integers in struct):\n') ; +fprintf ('================== v10 dense struct (no integers in struct):\n') ; X2_struct = struct (X2) fprintf ('gbtest101: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest102.m b/GraphBLAS/GraphBLAS/test/gbtest102.m index 3dfe415e05..85ca48ba9e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest102.m +++ b/GraphBLAS/GraphBLAS/test/gbtest102.m @@ -1,7 +1,7 @@ function gbtest102 %GBTEST102 test horzcat, vertcat, cat, cell2mat, mat2cell, num2cell -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 have_octave = gb_octave ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest103.m b/GraphBLAS/GraphBLAS/test/gbtest103.m index 140c9b1c56..c870925c0b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest103.m +++ b/GraphBLAS/GraphBLAS/test/gbtest103.m @@ -1,7 +1,7 @@ function gbtest103 %GBTEST103 test iso matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest104.m b/GraphBLAS/GraphBLAS/test/gbtest104.m index 68d25cea0a..01af1f531c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest104.m +++ b/GraphBLAS/GraphBLAS/test/gbtest104.m @@ -1,7 +1,7 @@ function gbtest104 %GBTEST104 test formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest105.m b/GraphBLAS/GraphBLAS/test/gbtest105.m index ca21a83a19..974a787e8f 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest105.m +++ b/GraphBLAS/GraphBLAS/test/gbtest105.m @@ -1,7 +1,7 @@ function gbtest105 %GBTEST105 test logical assignment with iso matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest106.m b/GraphBLAS/GraphBLAS/test/gbtest106.m index 002a2e0564..fb048f253e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest106.m +++ b/GraphBLAS/GraphBLAS/test/gbtest106.m @@ -1,7 +1,7 @@ function gbtest106 %GBTEST106 test build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest107.m b/GraphBLAS/GraphBLAS/test/gbtest107.m index 6684e90cf8..41d5fa6593 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest107.m +++ b/GraphBLAS/GraphBLAS/test/gbtest107.m @@ -1,7 +1,7 @@ function gbtest107 %GBTEST107 test cell2mat error handling -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest108.m b/GraphBLAS/GraphBLAS/test/gbtest108.m index c32a63b0a8..f801cbb806 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest108.m +++ b/GraphBLAS/GraphBLAS/test/gbtest108.m @@ -1,7 +1,7 @@ function gbtest108 %GBTEST108 test mat2cell -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest109.m b/GraphBLAS/GraphBLAS/test/gbtest109.m index 6ef8e12761..92c2eb23d6 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest109.m +++ b/GraphBLAS/GraphBLAS/test/gbtest109.m @@ -1,7 +1,7 @@ function gbtest109 %GBTEST109 test num2cell -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest11.m b/GraphBLAS/GraphBLAS/test/gbtest11.m index f2cdba70a8..4f3cea043e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest11.m +++ b/GraphBLAS/GraphBLAS/test/gbtest11.m @@ -1,7 +1,7 @@ function gbtest11 %GBTEST11 test GrB, sparse -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest110.m b/GraphBLAS/GraphBLAS/test/gbtest110.m index 1237e907dd..ae597241e6 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest110.m +++ b/GraphBLAS/GraphBLAS/test/gbtest110.m @@ -1,7 +1,7 @@ function gbtest110 %GBTEST110 test argmax -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest111.m b/GraphBLAS/GraphBLAS/test/gbtest111.m index ac54875a72..dc76424ac8 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest111.m +++ b/GraphBLAS/GraphBLAS/test/gbtest111.m @@ -1,7 +1,7 @@ function gbtest111 %GBTEST111 test argmin -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest112.m b/GraphBLAS/GraphBLAS/test/gbtest112.m index 793210e28d..d1255fdc21 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest112.m +++ b/GraphBLAS/GraphBLAS/test/gbtest112.m @@ -1,7 +1,7 @@ function gbtest112 %GBTEST112 test load and save -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest113.m b/GraphBLAS/GraphBLAS/test/gbtest113.m index b84edc117b..91c20a6dec 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest113.m +++ b/GraphBLAS/GraphBLAS/test/gbtest113.m @@ -1,7 +1,7 @@ function gbtest113 %GBTEST113 test ones and eq -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest114.m b/GraphBLAS/GraphBLAS/test/gbtest114.m index 6b0fc2fdd6..34ca39f39c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest114.m +++ b/GraphBLAS/GraphBLAS/test/gbtest114.m @@ -1,7 +1,7 @@ function gbtest114 %GBTEST114 test kron with iso matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest115.m b/GraphBLAS/GraphBLAS/test/gbtest115.m index 25c45377b0..13ed683de1 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest115.m +++ b/GraphBLAS/GraphBLAS/test/gbtest115.m @@ -1,7 +1,7 @@ function gbtest115 %GBTEST115 test serialize/deserialize -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest116.m b/GraphBLAS/GraphBLAS/test/gbtest116.m index 69e3ba8f8e..e054e2a6e4 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest116.m +++ b/GraphBLAS/GraphBLAS/test/gbtest116.m @@ -1,7 +1,7 @@ function gbtest116 %GBTEST116 list all idxunop operators for GrB.apply2 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 opnames = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest117.m b/GraphBLAS/GraphBLAS/test/gbtest117.m index 77e97dffbd..32fd532140 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest117.m +++ b/GraphBLAS/GraphBLAS/test/gbtest117.m @@ -1,7 +1,7 @@ function gbtest117 %GBTEST117 test idxunop in GrB.apply2 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest118.m b/GraphBLAS/GraphBLAS/test/gbtest118.m index 34e9aca158..18dca104ed 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest118.m +++ b/GraphBLAS/GraphBLAS/test/gbtest118.m @@ -1,7 +1,7 @@ function gbtest118 %GBTEST118 test GrB.argsort -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest119.m b/GraphBLAS/GraphBLAS/test/gbtest119.m index 1aa2d43651..b551c793a7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest119.m +++ b/GraphBLAS/GraphBLAS/test/gbtest119.m @@ -7,7 +7,7 @@ % C = GrB.eunion (C, M, op, A, alpha, B, beta, desc) % C = GrB.eunion (C, M, accum, op, A, alpha, B, beta, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest12.m b/GraphBLAS/GraphBLAS/test/gbtest12.m index b0a48ed8e7..25b64a7a5c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest12.m +++ b/GraphBLAS/GraphBLAS/test/gbtest12.m @@ -1,7 +1,7 @@ function gbtest12 %GBTEST12 test GrB.eadd, GrB.emult, GrB.eunion -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest120.m b/GraphBLAS/GraphBLAS/test/gbtest120.m index d6ac86a2a2..95bd9280c2 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest120.m +++ b/GraphBLAS/GraphBLAS/test/gbtest120.m @@ -1,7 +1,7 @@ function gbtest120 %GBTEST120 test subsref -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 x = sparse (1:5) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest121.m b/GraphBLAS/GraphBLAS/test/gbtest121.m index 76e020ef8d..6d376b2493 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest121.m +++ b/GraphBLAS/GraphBLAS/test/gbtest121.m @@ -1,7 +1,7 @@ function gbtest121 %GBTEST121 test times with scalars -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 a = pi ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest122.m b/GraphBLAS/GraphBLAS/test/gbtest122.m index d2733e2761..87c98d2225 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest122.m +++ b/GraphBLAS/GraphBLAS/test/gbtest122.m @@ -1,7 +1,7 @@ function gbtest122 %GBTEST122 test reshape (extended methods in GrB) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest123.m b/GraphBLAS/GraphBLAS/test/gbtest123.m new file mode 100644 index 0000000000..fe540c109b --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest123.m @@ -0,0 +1,28 @@ +function gbtest123 +%GBTEST123 test build + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') + +n = 1000 ; +H = GrB (n, n) ; +H (1,1) = 1 ; +S = GrB.build (H,H,pi) ; +P = sparse (pi) ; +assert (isequal (S, P)) ; + +n = flintmax ; +H = GrB (n, n) ; +H (1,1) = 1 ; +try + S = GrB.build (H,H,H) ; + ok = false ; +catch me + assert (isequal (me.message, 'input matrix dimensions are too large')) ; + ok = true ; +end +assert (ok) ; + +fprintf ('\ngbtest123: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest124.m b/GraphBLAS/GraphBLAS/test/gbtest124.m new file mode 100644 index 0000000000..89e2f25a27 --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest124.m @@ -0,0 +1,11 @@ +function gbtest124 +%GBTEST124 test GrB.binops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +help GrB.binops ; +list = GrB.binops +GrB.binops ; + +fprintf ('\ngbtest124: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest125.m b/GraphBLAS/GraphBLAS/test/gbtest125.m new file mode 100644 index 0000000000..7f30bc7a93 --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest125.m @@ -0,0 +1,11 @@ +function gbtest125 +%GBTEST125 test GrB.monoids + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +help GrB.monoids ; +list = GrB.monoids +GrB.monoids ; + +fprintf ('\ngbtest125: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest126.m b/GraphBLAS/GraphBLAS/test/gbtest126.m new file mode 100644 index 0000000000..9444e2f216 --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest126.m @@ -0,0 +1,11 @@ +function gbtest126 +%GBTEST126 test GrB.selectops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +help GrB.selectops ; +list = GrB.selectops +GrB.selectops ; + +fprintf ('\ngbtest126: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest127.m b/GraphBLAS/GraphBLAS/test/gbtest127.m new file mode 100644 index 0000000000..e1f1dd66d6 --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest127.m @@ -0,0 +1,11 @@ +function gbtest127 +%GBTEST127 test GrB.semirings + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +help GrB.semirings ; +list = GrB.semirings +GrB.semirings ; + +fprintf ('\ngbtest127: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest128.m b/GraphBLAS/GraphBLAS/test/gbtest128.m new file mode 100644 index 0000000000..3dd31d659d --- /dev/null +++ b/GraphBLAS/GraphBLAS/test/gbtest128.m @@ -0,0 +1,11 @@ +function gbtest128 +%GBTEST128 test GrB.unops + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +help GrB.unops ; +list = GrB.unops +GrB.unops ; + +fprintf ('\ngbtest128: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest13.m b/GraphBLAS/GraphBLAS/test/gbtest13.m index 6a8d9c311f..667976b9d8 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest13.m +++ b/GraphBLAS/GraphBLAS/test/gbtest13.m @@ -1,7 +1,7 @@ function gbtest13 %GBTEST13 test find and GrB.extracttuples -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 list = gbtest_types ; @@ -16,6 +16,8 @@ desc0.base = 'zero-based' ; desc1.base = 'one-based' ; desc1_int.base = 'one-based int' ; +desc1_double.base = 'double' ; +desc1_double2.base = 'one-based double' ; % same as 'double' for k = 1:length(list) xtype = list {k} ; @@ -56,6 +58,22 @@ assert (isequal (C (:), X0)) ; assert (isequal (double (I_0+1), I1)) ; assert (isequal (double (J_0+1), J1)) ; + assert (isequal (class (I1), 'int32')) ; + assert (isequal (class (J1), 'int32')) ; + + [I1, J1, X0] = GrB.extracttuples (G, desc1_double) ; + assert (isequal (C (:), X0)) ; + assert (isequal (I_0+1, I1)) ; + assert (isequal (J_0+1, J1)) ; + assert (isequal (class (I1), 'double')) ; + assert (isequal (class (J1), 'double')) ; + + [I1, J1, X0] = GrB.extracttuples (G, desc1_double2) ; + assert (isequal (C (:), X0)) ; + assert (isequal (I_0+1, I1)) ; + assert (isequal (J_0+1, J1)) ; + assert (isequal (class (I1), 'double')) ; + assert (isequal (class (J1), 'double')) ; [I1, J1, X0] = GrB.extracttuples (G) ; assert (isequal (C (:), X0)) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest14.m b/GraphBLAS/GraphBLAS/test/gbtest14.m index 98dc9f16d0..b3baf6e2e7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest14.m +++ b/GraphBLAS/GraphBLAS/test/gbtest14.m @@ -1,7 +1,7 @@ function gbtest14 %GBTEST14 test kron and GrB.kronecker -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest15.m b/GraphBLAS/GraphBLAS/test/gbtest15.m index 578d37b5f3..960407b387 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest15.m +++ b/GraphBLAS/GraphBLAS/test/gbtest15.m @@ -1,7 +1,7 @@ function gbtest15 %GBTEST15 list all unary operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; @@ -12,7 +12,7 @@ 'expm1', 'log10', 'log1p', 'log2', 'lgamma', 'tgamma', 'erf', ... 'cbrt', ... 'erfc', 'conj', 'creal', 'cimag', 'carg', 'isinf', 'isnan', ... - 'isinfinite', 'frexpx', 'frexpe', 'i0', 'i1', 'j0', 'j1' } ; + 'isfinite', 'frexpx', 'frexpe', 'bitnot', 'i0', 'i1', 'j0', 'j1' } ; nops = 0 ; for k1 = 1:length (ops) @@ -32,7 +32,7 @@ GrB.unopinfo ; fprintf ('number of unary ops: %d\n', nops) ; -assert (nops == 214) ; +assert (nops == 226) ; fprintf ('gbtest15: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest16.m b/GraphBLAS/GraphBLAS/test/gbtest16.m index ed6919d942..abfd16dc73 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest16.m +++ b/GraphBLAS/GraphBLAS/test/gbtest16.m @@ -1,7 +1,7 @@ function gbtest16 %GBTEST16 test GrB.extract -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest17.m b/GraphBLAS/GraphBLAS/test/gbtest17.m index f30a3795d9..b27867db58 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest17.m +++ b/GraphBLAS/GraphBLAS/test/gbtest17.m @@ -1,7 +1,7 @@ function gbtest17 %GBTEST17 test GrB.trans -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest18.m b/GraphBLAS/GraphBLAS/test/gbtest18.m index a506eb3a1b..68051b07e0 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest18.m +++ b/GraphBLAS/GraphBLAS/test/gbtest18.m @@ -1,7 +1,7 @@ function gbtest18 %GBTEST18 test comparators (and, or, >, ...) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 have_octave = gb_octave ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest19.m b/GraphBLAS/GraphBLAS/test/gbtest19.m index 3d10947a51..cd714e007e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest19.m +++ b/GraphBLAS/GraphBLAS/test/gbtest19.m @@ -1,7 +1,7 @@ function gbtest19 %GBTEST19 test mpower -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest2.m b/GraphBLAS/GraphBLAS/test/gbtest2.m index 8a23d17a69..cbd79b9801 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest2.m +++ b/GraphBLAS/GraphBLAS/test/gbtest2.m @@ -1,7 +1,7 @@ function gbtest2 %GBTEST2 list all binary operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 optype = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest20.m b/GraphBLAS/GraphBLAS/test/gbtest20.m index 0eb5cffe4f..731911593a 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest20.m +++ b/GraphBLAS/GraphBLAS/test/gbtest20.m @@ -1,7 +1,7 @@ function gbtest20 %GBTEST20 test bandwidth, isdiag, ceil, floor, round, fix -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest21.m b/GraphBLAS/GraphBLAS/test/gbtest21.m index 0402e0672f..afad29aadb 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest21.m +++ b/GraphBLAS/GraphBLAS/test/gbtest21.m @@ -1,7 +1,7 @@ function gbtest21 %GBTEST21 test isfinite, isinf, isnan -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest22.m b/GraphBLAS/GraphBLAS/test/gbtest22.m index 0dc0d59bed..e661ecffb5 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest22.m +++ b/GraphBLAS/GraphBLAS/test/gbtest22.m @@ -1,7 +1,7 @@ function gbtest22 %GBTEST22 test reduce to scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest23.m b/GraphBLAS/GraphBLAS/test/gbtest23.m index bf6758ccd8..4c8fea3ab8 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest23.m +++ b/GraphBLAS/GraphBLAS/test/gbtest23.m @@ -1,7 +1,7 @@ function gbtest23 %GBTEST23 test min and max -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest24.m b/GraphBLAS/GraphBLAS/test/gbtest24.m index 8bc9f50a3c..00d939bafc 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest24.m +++ b/GraphBLAS/GraphBLAS/test/gbtest24.m @@ -1,7 +1,7 @@ function gbtest24 %GBTEST24 test any, all -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest25.m b/GraphBLAS/GraphBLAS/test/gbtest25.m index 6a79128171..50554786b8 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest25.m +++ b/GraphBLAS/GraphBLAS/test/gbtest25.m @@ -1,7 +1,7 @@ function gbtest25 %GBTEST25 test diag, tril, triu -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest26.m b/GraphBLAS/GraphBLAS/test/gbtest26.m index ff48687b65..1052f61b18 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest26.m +++ b/GraphBLAS/GraphBLAS/test/gbtest26.m @@ -1,7 +1,7 @@ function gbtest26 %GBTEST26 test typecasting -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest27.m b/GraphBLAS/GraphBLAS/test/gbtest27.m index be411d5de6..c6b9357900 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest27.m +++ b/GraphBLAS/GraphBLAS/test/gbtest27.m @@ -4,7 +4,7 @@ % of them if all default FactoryKernels are enabled) or uses many generic % methods if the JIT is disabled. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest28.m b/GraphBLAS/GraphBLAS/test/gbtest28.m index 4a6ab32498..5b2c7099c6 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest28.m +++ b/GraphBLAS/GraphBLAS/test/gbtest28.m @@ -1,7 +1,7 @@ function gbtest28 %GBTEST28 test GrB.build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ngbtest28: testing GrB.build and compare with A=sparse(i,j,x)\n') ; @@ -63,9 +63,18 @@ tic A2 = GrB.build (i0, j0, x, m, n, desc0) ; t = toc ; -fprintf ('%12.4f sec : A = GrB.build (i0, j0, ...), with i0 and j0 uint64\n',t); +fprintf ('%12.4f sec : A = GrB.build (i0,j0, ...), with i0 and j0 uint64\n',t); assert (gbtest_eq (A1, A2)) ; +i32 = uint32 (i0) ; +j32 = uint32 (j0) ; +tic +A5 = GrB.build (i32, j32, x, m, n, desc0) ; +t = toc ; +fprintf ('%12.4f sec : A = GrB.build (i0,j0, ...), with i0 and j0 uint32\n',t); +assert (gbtest_eq (A1, A5)) ; +clear A5 + fprintf ('\nwith [I J] reversed/jumbled so that a sort is required:\n') ; i = i (end:-1:1) ; j = j (end:-1:1) ; @@ -94,8 +103,17 @@ tic A2 = GrB.build (i0, j0, x, m, n, desc0) ; t = toc ; -fprintf ('%12.4f sec : A = GrB.build (i0,j0,...), with i0 and j0 uint64\n', t) ; +fprintf ('%12.4f sec : A = GrB.build (i0,j0, ...), with i0 and j0 uint64\n', t); assert (gbtest_eq (A1, A2)) ; +i32 = uint32 (i0) ; +j32 = uint32 (j0) ; +tic +A5 = GrB.build (i32, j32, x, m, n, desc0) ; +t = toc ; +fprintf ('%12.4f sec : A = GrB.build (i0,j0, ...), with i0 and j0 uint32\n',t); +assert (gbtest_eq (A1, A5)) ; +clear A5 + fprintf ('\ngbtest28: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest29.m b/GraphBLAS/GraphBLAS/test/gbtest29.m index 4bd5f679ae..6f2246399d 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest29.m +++ b/GraphBLAS/GraphBLAS/test/gbtest29.m @@ -1,7 +1,7 @@ function gbtest29 %GBTEST29 test subsref and subsasgn with logical indexing -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest3.m b/GraphBLAS/GraphBLAS/test/gbtest3.m index 5e1e49e5fd..0329dcd33b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest3.m +++ b/GraphBLAS/GraphBLAS/test/gbtest3.m @@ -1,7 +1,7 @@ function gbtest3 %GBTEST3 test dnn -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 help GrB.dnn diff --git a/GraphBLAS/GraphBLAS/test/gbtest30.m b/GraphBLAS/GraphBLAS/test/gbtest30.m index c3036a9ffe..2c601955ff 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest30.m +++ b/GraphBLAS/GraphBLAS/test/gbtest30.m @@ -1,7 +1,7 @@ function gbtest30 %GBTEST30 test colon notation -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest31.m b/GraphBLAS/GraphBLAS/test/gbtest31.m index e1b8e92b6b..ef6c92b7bf 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest31.m +++ b/GraphBLAS/GraphBLAS/test/gbtest31.m @@ -1,7 +1,7 @@ function gbtest31 %GBTEST31 test GrB and casting -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest32.m b/GraphBLAS/GraphBLAS/test/gbtest32.m index 5fee1c7aec..ab10dcea09 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest32.m +++ b/GraphBLAS/GraphBLAS/test/gbtest32.m @@ -1,20 +1,26 @@ function gbtest32 %GBTEST32 test nonzeros -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +assert (~GrB.burble) ; rng ('default') ; for d = 0:.1:1 for n = 0:10 A = sprandn (n, n, d) ; X = nonzeros (A) ; +assert (~GrB.burble) ; G = GrB (A) ; +assert (~GrB.burble) ; Y = nonzeros (G) ; +assert (~GrB.burble) ; assert (isequal (X, Y)) ; +assert (~GrB.burble) ; end end fprintf ('gbtest32: all tests passed\n') ; +assert (~GrB.burble) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest33.m b/GraphBLAS/GraphBLAS/test/gbtest33.m index 6fdc479592..32f2a13bc5 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest33.m +++ b/GraphBLAS/GraphBLAS/test/gbtest33.m @@ -3,7 +3,7 @@ % isempty, issparse, ... ismatrix, isvector, isscalar, isnumeric, % isfloat, isreal, isinteger, islogical, isa. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest34.m b/GraphBLAS/GraphBLAS/test/gbtest34.m index 31acf5dc35..91c598998a 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest34.m +++ b/GraphBLAS/GraphBLAS/test/gbtest34.m @@ -1,7 +1,7 @@ function gbtest34 %GBTEST34 test repmat -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest35.m b/GraphBLAS/GraphBLAS/test/gbtest35.m index c0e0d8e3bb..fb032b4a0a 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest35.m +++ b/GraphBLAS/GraphBLAS/test/gbtest35.m @@ -1,7 +1,7 @@ function gbtest35 %GBTEST35 test reshape (built-in variant) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest36.m b/GraphBLAS/GraphBLAS/test/gbtest36.m index 6a5729e1ae..3c44fdbafb 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest36.m +++ b/GraphBLAS/GraphBLAS/test/gbtest36.m @@ -1,7 +1,7 @@ function gbtest36 %GBTEST36 test abs, sign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest37.m b/GraphBLAS/GraphBLAS/test/gbtest37.m index 16b2e43db7..d2ac645fc3 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest37.m +++ b/GraphBLAS/GraphBLAS/test/gbtest37.m @@ -2,7 +2,7 @@ %GBTEST37 test istril, istriu, isbanded, isdiag, ishermitian, ... % issymmetric, bandwith -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest38.m b/GraphBLAS/GraphBLAS/test/gbtest38.m index 7a13a6d559..44f4050674 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest38.m +++ b/GraphBLAS/GraphBLAS/test/gbtest38.m @@ -2,7 +2,7 @@ %GBTEST38 test sqrt, eps, ceil, floor, round, fix, real, conj, ... % isfinite, isinf, isnan, spfun, eig -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest39.m b/GraphBLAS/GraphBLAS/test/gbtest39.m index 2703441f5f..e2d6c10f8b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest39.m +++ b/GraphBLAS/GraphBLAS/test/gbtest39.m @@ -1,7 +1,7 @@ function gbtest39 %GBTEST39 test amd, colamd, symamd, symrcm, dmperm, etree -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 for trial = 1:40 diff --git a/GraphBLAS/GraphBLAS/test/gbtest4.m b/GraphBLAS/GraphBLAS/test/gbtest4.m index 9503afd5d9..d7c8b325db 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest4.m +++ b/GraphBLAS/GraphBLAS/test/gbtest4.m @@ -5,7 +5,7 @@ % names. For example, the spec has many boolean operators with different % names but they compute the same thing. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; @@ -29,10 +29,15 @@ GrB.semiringinfo (semiring) ; GrB.semiringinfo (s, type) ; nsemirings = nsemirings + 1 ; + ok = true ; catch % this is an error, but it is expected since not all % combinations operators and types can be used to construct % a valid semiring. + ok = false ; + end + if (ok) + fprintf ('\nOK %s.%s\n', s, type) ; end end end diff --git a/GraphBLAS/GraphBLAS/test/gbtest40.m b/GraphBLAS/GraphBLAS/test/gbtest40.m index 3051875663..8a90d0b3d4 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest40.m +++ b/GraphBLAS/GraphBLAS/test/gbtest40.m @@ -1,7 +1,7 @@ function gbtest40 %GBTEST40 test sum, prod, max, min, any, all, norm -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest41.m b/GraphBLAS/GraphBLAS/test/gbtest41.m index 24585aec87..490a8f8e8b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest41.m +++ b/GraphBLAS/GraphBLAS/test/gbtest41.m @@ -1,7 +1,7 @@ function gbtest41 %GBTEST41 test ones, zeros, false -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest42.m b/GraphBLAS/GraphBLAS/test/gbtest42.m index 1ce6764673..27b6be07aa 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest42.m +++ b/GraphBLAS/GraphBLAS/test/gbtest42.m @@ -1,52 +1,70 @@ function gbtest42 %GBTEST42 test for nan +% +% Also tests the JIT -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; types = { 'single', 'double', 'single complex', 'double complex' } ; -for k1 = 1:length(types) - atype = types {k1} ; - fprintf ('\n%s ', atype) ; +save_status = GrB.jit ; +states = { '', 'on', 'run', 'off', 'load', 'pause', 'flush', '', 'run' } ; - for trial = 1:40 - fprintf ('.') ; +for nstate = 1:length(states) - A = gbtest_cast (full (sprand (4,4,0.5)), atype) ; - A (A > 0.5) = nan ; + state = states {nstate} ; + fprintf ('\nJIT: %s', state) ; + new_state = GrB.jit (state) ; + if (isequal (state, 'flush')) + assert (isequal (new_state, 'on')) ; + elseif (~isempty (state)) + assert (isequal (new_state, state)) ; + end + + for k1 = 1:length(types) + atype = types {k1} ; + fprintf ('\n%s ', atype) ; + + for trial = 1:40 + fprintf ('.') ; - A_nan = zeros (4, 4) ; - A_nan (isnan (A)) = nan ; - A_notnan = zeros (4, 4) ; - A_notnan (~isnan (A)) = A (~isnan (A)) ; + A = gbtest_cast (full (sprand (4,4,0.5)), atype) ; + A (A > 0.5) = nan ; - A = gbtest_cast (A, atype) ; + A_nan = zeros (4, 4) ; + A_nan (isnan (A)) = nan ; + A_notnan = zeros (4, 4) ; + A_notnan (~isnan (A)) = A (~isnan (A)) ; - for k2 = 1:length(types) - xtype = types {k2} ; - xnan = gbtest_cast (nan, xtype) ; + A = gbtest_cast (A, atype) ; - G = GrB.select (A, '==', xnan) ; - X1 = full (double (G)) ; - X2 = double (A_nan) ; - assert (isequaln (X1, X2)) ; + for k2 = 1:length(types) + xtype = types {k2} ; + xnan = gbtest_cast (nan, xtype) ; - G = GrB.select (A, '~=', xnan) ; - X1 = full (double (G)) ; - X2 = double (A_notnan) ; - assert (isequaln (X1, X2)) ; + G = GrB.select (A, '==', xnan) ; + X1 = full (double (G)) ; + X2 = double (A_nan) ; + assert (isequaln (X1, X2)) ; - G = GrB.prune (A, xnan) ; - X1 = full (double (G)) ; - X2 = double (A_notnan) ; - assert (isequaln (X1, X2)) ; + G = GrB.select (A, '~=', xnan) ; + X1 = full (double (G)) ; + X2 = double (A_notnan) ; + assert (isequaln (X1, X2)) ; + G = GrB.prune (A, xnan) ; + X1 = full (double (G)) ; + X2 = double (A_notnan) ; + assert (isequaln (X1, X2)) ; + + end end end - end +GrB.jit (save_status) ; + fprintf ('\ngbtest42: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest43.m b/GraphBLAS/GraphBLAS/test/gbtest43.m index d5ed28a1af..25d09780ec 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest43.m +++ b/GraphBLAS/GraphBLAS/test/gbtest43.m @@ -2,7 +2,7 @@ %GBTEST43 test error handling % All errors generated by this test are expected. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -1129,18 +1129,6 @@ end assert (ok) ; -try - GrB.build (int8(1), int8(1), pi) - ok = false ; -catch expected_error - expected_error - fprintf (' message: %s\n', expected_error.message) ; - for k = 1:length (expected_error.stack) - disp (expected_error.stack (k)) - end -end -assert (ok) ; - try GrB.extract ('+', pi) ; ok = false ; @@ -1357,5 +1345,17 @@ end assert (ok) ; +try + GrB.jit ('crud') ; + ok = false ; +catch expected_error + expected_error + fprintf (' message: %s\n', expected_error.message) ; + for k = 1:length (expected_error.stack) + disp (expected_error.stack (k)) + end +end +assert (ok) ; + fprintf ('gbtest43: all tests passed\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest44.m b/GraphBLAS/GraphBLAS/test/gbtest44.m index 215075fd96..dca49f6be9 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest44.m +++ b/GraphBLAS/GraphBLAS/test/gbtest44.m @@ -1,7 +1,7 @@ function gbtest44 %GBTEST44 test subsasgn, mtimes, plus, false, ... -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest45.m b/GraphBLAS/GraphBLAS/test/gbtest45.m index 38f0201ca2..ee0a6164ed 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest45.m +++ b/GraphBLAS/GraphBLAS/test/gbtest45.m @@ -1,7 +1,7 @@ function gbtest45 %GBTEST45 test GrB.vreduce -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest46.m b/GraphBLAS/GraphBLAS/test/gbtest46.m index b1d533b9c0..537df46e88 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest46.m +++ b/GraphBLAS/GraphBLAS/test/gbtest46.m @@ -1,7 +1,7 @@ function gbtest46 %GBTEST46 test GrB.subassign and GrB.assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -25,26 +25,26 @@ pg = GrB (pi) ; C1 = A ; - C1 (1:3,1) = pi ; + C1 (1:3,1:2) = pi ; - C2 = GrB.subassign (A, pi, { 1:3}, { 1 }) ; - C3 = GrB.subassign (G, pi, { 1:3}, { 1 }) ; - C4 = GrB.subassign (G, pg, { 1:3}, { 1 }) ; - C5 = GrB.subassign (G, pg, { 1:3}, { 1 }, d) ; + C2 = GrB.subassign (A, pi, { 1:3}, { 1:2 }) ; + C3 = GrB.subassign (G, pi, { 1:3}, { 1:2 }) ; + C4 = GrB.subassign (G, pg, { 1:3}, { 1:2 }) ; + C5 = GrB.subassign (G, pg, { 1:3}, { 1:2 }, d) ; assert (isequal (C1, C2)) ; assert (isequal (C1, C3)) ; assert (isequal (C1, C4)) ; assert (isequal (C1, C5)) ; assert (isequal (class (C5), 'double')) ; - C2 = GrB.assign (A, pi, { 1:3}, { 1 }) ; - C3 = GrB.assign (G, pi, { 1:3}, { 1 }) ; - C4 = GrB.assign (G, pg, { 1:3}, { 1 }) ; - C5 = GrB.assign (G, pg, { 1:3}, { 1 }, d) ; - C6 = GrB.assign (G, pg, { int64(1:3)-1 }, { int64(0) }, d0) ; - C7 = GrB.assign (G, pg, { int64(0), int64(2) }, { int64(0) }, d0) ; - C8 = GrB.assign (G, pg, { int64(0), int64(1), int64(2) }, { int64(0) }, ... - d0) ; + C2 = GrB.assign (A, pi, { 1:3}, { 1:2 }) ; + C3 = GrB.assign (G, pi, { 1:3}, { 1:2 }) ; + C4 = GrB.assign (G, pg, { 1:3}, { 1:2 }) ; + C5 = GrB.assign (G, pg, { 1:3}, { 1:2 }, d) ; + C6 = GrB.assign (G, pg, { int64(1:3)-1 }, { int64(0), int64(1) }, d0) ; + C7 = GrB.assign (G, pg, { int64(0), int64(2) }, { int64(1:2)-1 }, d0) ; + C8 = GrB.assign (G, pg, { int64(0), int64(1), int64(2) }, ... + { int64(1:2)-1 }, d0) ; assert (isequal (C1, C2)) ; assert (isequal (C1, C3)) ; assert (isequal (C1, C4)) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest47.m b/GraphBLAS/GraphBLAS/test/gbtest47.m index d44f51d7f9..c170759068 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest47.m +++ b/GraphBLAS/GraphBLAS/test/gbtest47.m @@ -1,7 +1,7 @@ function gbtest47 %GBTEST47 test GrB.entries, GrB.nonz, numel -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest48.m b/GraphBLAS/GraphBLAS/test/gbtest48.m index c8ef5e7df9..12824603ce 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest48.m +++ b/GraphBLAS/GraphBLAS/test/gbtest48.m @@ -1,7 +1,7 @@ function gbtest48 %GBTEST48 test GrB.apply -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest49.m b/GraphBLAS/GraphBLAS/test/gbtest49.m index c5ebfee758..3133b497e9 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest49.m +++ b/GraphBLAS/GraphBLAS/test/gbtest49.m @@ -1,7 +1,7 @@ function gbtest49 %GBTEST49 test GrB.prune -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest5.m b/GraphBLAS/GraphBLAS/test/gbtest5.m index 21e778efba..e2f10c0b94 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest5.m +++ b/GraphBLAS/GraphBLAS/test/gbtest5.m @@ -1,7 +1,7 @@ function gbtest5 %GBTEST5 test GrB.descriptorinfo -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 list_out = { [ ], 'default', 'replace' } ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest50.m b/GraphBLAS/GraphBLAS/test/gbtest50.m index 277c6d5f84..b581bdb05b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest50.m +++ b/GraphBLAS/GraphBLAS/test/gbtest50.m @@ -1,7 +1,7 @@ function gbtest50 %GBTEST50 test GrB.ktruss and GrB.tricount -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest51.m b/GraphBLAS/GraphBLAS/test/gbtest51.m index f47c42988c..2f5dd28d09 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest51.m +++ b/GraphBLAS/GraphBLAS/test/gbtest51.m @@ -1,7 +1,7 @@ function gbtest51 %GBTEST51 test GrB.tricount and concatenate -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 files = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest52.m b/GraphBLAS/GraphBLAS/test/gbtest52.m index d508d633ce..59fe6dc6c7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest52.m +++ b/GraphBLAS/GraphBLAS/test/gbtest52.m @@ -1,7 +1,7 @@ function gbtest52 %GBTEST52 test GrB.format -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GrB.format diff --git a/GraphBLAS/GraphBLAS/test/gbtest53.m b/GraphBLAS/GraphBLAS/test/gbtest53.m index 49a7abd07e..7b49e9d48a 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest53.m +++ b/GraphBLAS/GraphBLAS/test/gbtest53.m @@ -1,7 +1,7 @@ function gbtest53 %GBTEST53 test GrB.monoidinfo -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types10 = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest54.m b/GraphBLAS/GraphBLAS/test/gbtest54.m index ed71f48d30..df12bfbf3f 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest54.m +++ b/GraphBLAS/GraphBLAS/test/gbtest54.m @@ -1,7 +1,7 @@ function gbtest54 %GBTEST54 test GrB.compact -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest55.m b/GraphBLAS/GraphBLAS/test/gbtest55.m index b7783fa8c0..9978c6237e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest55.m +++ b/GraphBLAS/GraphBLAS/test/gbtest55.m @@ -1,7 +1,7 @@ function gbtest55 %GBTEST55 test disp -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest56.m b/GraphBLAS/GraphBLAS/test/gbtest56.m index 7d5badf53e..435752a981 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest56.m +++ b/GraphBLAS/GraphBLAS/test/gbtest56.m @@ -1,7 +1,7 @@ function gbtest56 %GBTEST56 test GrB.empty -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 for m1 = -1:5 diff --git a/GraphBLAS/GraphBLAS/test/gbtest57.m b/GraphBLAS/GraphBLAS/test/gbtest57.m index 3960a0e84b..29476142c7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest57.m +++ b/GraphBLAS/GraphBLAS/test/gbtest57.m @@ -1,7 +1,7 @@ function gbtest57 %GBTEST57 test fprintf and sprintf -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 c1 = fprintf ('pi: %g\n', pi) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest58.m b/GraphBLAS/GraphBLAS/test/gbtest58.m index d03b13918a..986177c0d7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest58.m +++ b/GraphBLAS/GraphBLAS/test/gbtest58.m @@ -1,7 +1,7 @@ function gbtest58 %GBTEST58 test uplus -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A = 1 - 2 * rand (3) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest59.m b/GraphBLAS/GraphBLAS/test/gbtest59.m index 71cd93c76e..ffa1bc23e0 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest59.m +++ b/GraphBLAS/GraphBLAS/test/gbtest59.m @@ -1,7 +1,7 @@ function gbtest59 %GBTEST59 test end -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A = rand (4,7) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest6.m b/GraphBLAS/GraphBLAS/test/gbtest6.m index 294aa78336..583ce7b42c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest6.m +++ b/GraphBLAS/GraphBLAS/test/gbtest6.m @@ -1,7 +1,7 @@ function gbtest6 %GBTEST6 test GrB.mxm -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest60.m b/GraphBLAS/GraphBLAS/test/gbtest60.m index 60bdcc2dd9..b6e0a0bedf 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest60.m +++ b/GraphBLAS/GraphBLAS/test/gbtest60.m @@ -1,7 +1,7 @@ function gbtest60 %GBTEST60 test GrB.issigned -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % 8 signed types: diff --git a/GraphBLAS/GraphBLAS/test/gbtest61.m b/GraphBLAS/GraphBLAS/test/gbtest61.m index 10604a8b6d..3dba0a6498 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest61.m +++ b/GraphBLAS/GraphBLAS/test/gbtest61.m @@ -1,7 +1,7 @@ function gbtest61 %GBTEST61 test GrB.laplacian -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest62.m b/GraphBLAS/GraphBLAS/test/gbtest62.m index 2577858fe4..ac0775e7c0 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest62.m +++ b/GraphBLAS/GraphBLAS/test/gbtest62.m @@ -1,7 +1,7 @@ function gbtest62 %GBTEST62 test ldivide, rdivide, mldivide, mrdivide -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest63.m b/GraphBLAS/GraphBLAS/test/gbtest63.m index ccba42f933..c25c20f4b1 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest63.m +++ b/GraphBLAS/GraphBLAS/test/gbtest63.m @@ -1,7 +1,7 @@ function gbtest63 %GBTEST63 test GrB.incidence -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest64.m b/GraphBLAS/GraphBLAS/test/gbtest64.m index 3af8fa11f4..0404422c0e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest64.m +++ b/GraphBLAS/GraphBLAS/test/gbtest64.m @@ -1,7 +1,7 @@ function gbtest64 %GBTEST64 test GrB.pagerank -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % load west0479 ; %#ok<*LOAD> diff --git a/GraphBLAS/GraphBLAS/test/gbtest65.m b/GraphBLAS/GraphBLAS/test/gbtest65.m index 5ea6e7e6d2..7f69941480 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest65.m +++ b/GraphBLAS/GraphBLAS/test/gbtest65.m @@ -1,7 +1,7 @@ function gbtest65 %GBTEST65 test GrB.mis -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest66.m b/GraphBLAS/GraphBLAS/test/gbtest66.m index ac00b77147..5d0eb1cffe 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest66.m +++ b/GraphBLAS/GraphBLAS/test/gbtest66.m @@ -1,7 +1,7 @@ function gbtest66 %GBTEST66 test graph -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest67.m b/GraphBLAS/GraphBLAS/test/gbtest67.m index 6689ee2bf3..c33f26cba2 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest67.m +++ b/GraphBLAS/GraphBLAS/test/gbtest67.m @@ -1,7 +1,7 @@ function gbtest67 %GBTEST67 test digraph -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest68.m b/GraphBLAS/GraphBLAS/test/gbtest68.m index 459bf271b7..3a02e2a6de 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest68.m +++ b/GraphBLAS/GraphBLAS/test/gbtest68.m @@ -1,7 +1,7 @@ function gbtest68 %GBTEST68 test isequal -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest69.m b/GraphBLAS/GraphBLAS/test/gbtest69.m index 9ffcc9c1a9..08d548bf33 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest69.m +++ b/GraphBLAS/GraphBLAS/test/gbtest69.m @@ -1,7 +1,7 @@ function gbtest69 %GBTEST69 test flip -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest7.m b/GraphBLAS/GraphBLAS/test/gbtest7.m index 323f150bf6..83e4ffb2f5 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest7.m +++ b/GraphBLAS/GraphBLAS/test/gbtest7.m @@ -1,7 +1,7 @@ function gbtest7 %GBTEST7 test GrB.build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -52,6 +52,12 @@ G = GrB.build (i, j, x, m, n, d) ; assert (gbtest_eq (S, G)) +I = GrB (i', 'by row') ; +J = GrB (j', 'by row') ; +X = GrB (x) ; +G = GrB.build (I, J, X, m, n, d) ; +assert (gbtest_eq (S, G)) + i0 = int64 (i) - 1 ; j0 = int64 (j) - 1 ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest70.m b/GraphBLAS/GraphBLAS/test/gbtest70.m index a7d1ba55c5..2eb18cd27d 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest70.m +++ b/GraphBLAS/GraphBLAS/test/gbtest70.m @@ -1,7 +1,7 @@ function gbtest70 %GBTEST70 test GrB.random -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; A = sprand (4, 5, 0.5) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest71.m b/GraphBLAS/GraphBLAS/test/gbtest71.m index 2db6fc0d05..c28ae837f5 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest71.m +++ b/GraphBLAS/GraphBLAS/test/gbtest71.m @@ -1,7 +1,7 @@ function gbtest71 %GBTEST71 test GrB.selectopinfo -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 ops = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest72.m b/GraphBLAS/GraphBLAS/test/gbtest72.m index 3831477ad1..cb83f9fd3d 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest72.m +++ b/GraphBLAS/GraphBLAS/test/gbtest72.m @@ -1,7 +1,7 @@ function gbtest72 %GBTEST72 test any-pair semiring -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest73.m b/GraphBLAS/GraphBLAS/test/gbtest73.m index 405ef50aa1..1e4b0202bd 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest73.m +++ b/GraphBLAS/GraphBLAS/test/gbtest73.m @@ -1,7 +1,7 @@ function gbtest73 %GBTEST73 test GrB.normdiff -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest74.m b/GraphBLAS/GraphBLAS/test/gbtest74.m index c83460aaa0..63fe66ec19 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest74.m +++ b/GraphBLAS/GraphBLAS/test/gbtest74.m @@ -1,7 +1,7 @@ function gbtest74 %GBTEST74 test bitwise operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 int_types = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest75.m b/GraphBLAS/GraphBLAS/test/gbtest75.m index 162752eeb0..2022efaea6 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest75.m +++ b/GraphBLAS/GraphBLAS/test/gbtest75.m @@ -1,7 +1,7 @@ function gbtest75 %GBTEST75 test bitshift -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ngbtest75: bitshift\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest76.m b/GraphBLAS/GraphBLAS/test/gbtest76.m index 754dc36ab1..cf4ffb1027 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest76.m +++ b/GraphBLAS/GraphBLAS/test/gbtest76.m @@ -1,7 +1,7 @@ function gbtest76 %GBTEST76 test trig and other functions -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ngbtest76: testing trig and special functions\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest77.m b/GraphBLAS/GraphBLAS/test/gbtest77.m index 7fffca76f6..3ff9431667 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest77.m +++ b/GraphBLAS/GraphBLAS/test/gbtest77.m @@ -2,7 +2,7 @@ %GBTEST77 test error handling % All errors generated by this test are expected. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -206,32 +206,6 @@ end assert (ok) ; -try - I = GrB (1.5) ; - C = G (I,I) - ok = false ; -catch expected_error - expected_error - s = expected_error.stack ; - for k = 1:length (s) - disp (s (k)) ; - end -end -assert (ok) ; - -try - I = GrB (1.5, 'double complex') ; - C = G (I,I) - ok = false ; -catch expected_error - expected_error - s = expected_error.stack ; - for k = 1:length (s) - disp (s (k)) ; - end -end -assert (ok) ; - try C = GrB.empty ([1 2 3 0]) ; ok = false ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest78.m b/GraphBLAS/GraphBLAS/test/gbtest78.m index 8f352d6db5..c08f8b6aeb 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest78.m +++ b/GraphBLAS/GraphBLAS/test/gbtest78.m @@ -1,7 +1,7 @@ function gbtest78 %GBTEST78 test integer operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A = uint8 (magic (4)) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest79.m b/GraphBLAS/GraphBLAS/test/gbtest79.m index a085bb9c23..f5e05aa9de 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest79.m +++ b/GraphBLAS/GraphBLAS/test/gbtest79.m @@ -2,7 +2,7 @@ %GBTEST79 test real power % Tests all real, inf, and nan cases. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 list = [-2:0.5:2 inf -inf nan] ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest8.m b/GraphBLAS/GraphBLAS/test/gbtest8.m index ea2bfed4f9..029509db05 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest8.m +++ b/GraphBLAS/GraphBLAS/test/gbtest8.m @@ -1,7 +1,7 @@ function gbtest8 %GBTEST8 test GrB.select -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % tril diff --git a/GraphBLAS/GraphBLAS/test/gbtest80.m b/GraphBLAS/GraphBLAS/test/gbtest80.m index ca3d17c232..6b9c2a40b0 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest80.m +++ b/GraphBLAS/GraphBLAS/test/gbtest80.m @@ -2,7 +2,7 @@ %GBTEST80 test complex division and power % Tests all real, inf, and nan cases. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 list = [-2:0.5:2 inf -inf nan] ; @@ -16,10 +16,8 @@ for xr = list fprintf ('\n%g ', xr) ; - % fprintf ('\n------------------------------------------\n') ; for xi = list fprintf ('.') - % fprintf ('\n') ; X = complex (xr, xi) ; GX = GrB (X) ; Xs = single (X) ; @@ -50,7 +48,6 @@ fprintf (' err: %g', err) ; fprintf (' DOUBLE DIFFERS') ; fprintf ('\n') ; - % pause end Z = Xs / Ys ; @@ -70,7 +67,6 @@ fprintf (' err: %g', err) ; fprintf (' SINGLE DIFFERS') ; fprintf ('\n') ; - % pause end Z = X .^ Y ; @@ -90,7 +86,6 @@ fprintf (' err: %g', err) ; fprintf (' DOUBLE DIFFERS') ; fprintf ('\n') ; - % pause end Z = Xs .^ Ys ; @@ -110,9 +105,7 @@ fprintf (' err: %g', err) ; fprintf (' SINGLE DIFFERS') ; fprintf ('\n') ; - % pause end - end end end diff --git a/GraphBLAS/GraphBLAS/test/gbtest81.m b/GraphBLAS/GraphBLAS/test/gbtest81.m index eaabb05e03..356daf89c9 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest81.m +++ b/GraphBLAS/GraphBLAS/test/gbtest81.m @@ -1,7 +1,7 @@ function gbtest81 %GBTEST81 test complex operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('gbtest81: test complex operators\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest82.m b/GraphBLAS/GraphBLAS/test/gbtest82.m index 5796420a1b..61c6faaaf4 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest82.m +++ b/GraphBLAS/GraphBLAS/test/gbtest82.m @@ -1,7 +1,7 @@ function gbtest82 %GBTEST82 test complex A*B, A'*B, A*B', A'*B', A+B -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest83.m b/GraphBLAS/GraphBLAS/test/gbtest83.m index bcd8872c62..e8d7212a67 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest83.m +++ b/GraphBLAS/GraphBLAS/test/gbtest83.m @@ -6,7 +6,7 @@ % C = GrB.apply (C, M, op, A) % C = GrB.apply (C, M, accum, op, A) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest84.m b/GraphBLAS/GraphBLAS/test/gbtest84.m index e3c9d4dc0f..62463d0b7c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest84.m +++ b/GraphBLAS/GraphBLAS/test/gbtest84.m @@ -16,7 +16,7 @@ % C = GrB.assign (C, accum, A, I, J) ; % C = GrB.assign (C, M, accum, A, I, J) ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest85.m b/GraphBLAS/GraphBLAS/test/gbtest85.m index d7ad232416..0ad314ed4c 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest85.m +++ b/GraphBLAS/GraphBLAS/test/gbtest85.m @@ -16,7 +16,7 @@ % C = GrB.subassign (C, accum, A, I, J) ; % C = GrB.subassign (C, M, accum, A, I, J) ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest86.m b/GraphBLAS/GraphBLAS/test/gbtest86.m index e7f73e8152..44d902d1d3 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest86.m +++ b/GraphBLAS/GraphBLAS/test/gbtest86.m @@ -7,7 +7,7 @@ % C = GrB.mxm (C, M, semiring, A, B, desc) % C = GrB.mxm (C, M, accum, semiring, A, B, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest87.m b/GraphBLAS/GraphBLAS/test/gbtest87.m index ad7fe9cff2..a76e7953d2 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest87.m +++ b/GraphBLAS/GraphBLAS/test/gbtest87.m @@ -7,7 +7,7 @@ % C = GrB.eadd (C, M, op, A, B, desc) % C = GrB.eadd (C, M, accum, op, A, B, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest88.m b/GraphBLAS/GraphBLAS/test/gbtest88.m index 9d5750b9e2..1533bdd866 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest88.m +++ b/GraphBLAS/GraphBLAS/test/gbtest88.m @@ -7,7 +7,7 @@ % C = GrB.emult (C, M, op, A, B, desc) % C = GrB.emult (C, M, accum, op, A, B, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest89.m b/GraphBLAS/GraphBLAS/test/gbtest89.m index 03b023ab29..d247f15435 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest89.m +++ b/GraphBLAS/GraphBLAS/test/gbtest89.m @@ -15,7 +15,7 @@ % V = GrB.extract (V, accum, U, I, desc) % V = GrB.extract (V, W, accum, U, I, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest9.m b/GraphBLAS/GraphBLAS/test/gbtest9.m index aaee4ff1ec..ff6bdb48cf 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest9.m +++ b/GraphBLAS/GraphBLAS/test/gbtest9.m @@ -1,7 +1,7 @@ function gbtest9 %GBTEST9 test eye and speye -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = gbtest_types ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest90.m b/GraphBLAS/GraphBLAS/test/gbtest90.m index a13e3f63a7..cf4402df99 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest90.m +++ b/GraphBLAS/GraphBLAS/test/gbtest90.m @@ -6,7 +6,7 @@ % c = GrB.reduce (c, accum, monoid, A) % c = GrB.reduce (c, accum, monoid, A, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest91.m b/GraphBLAS/GraphBLAS/test/gbtest91.m index b6a71cbf0e..b42c839723 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest91.m +++ b/GraphBLAS/GraphBLAS/test/gbtest91.m @@ -7,7 +7,7 @@ % C = GrB.trans (C, M, A, desc) % C = GrB.trans (C, M, accum, A, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest92.m b/GraphBLAS/GraphBLAS/test/gbtest92.m index d403f0236b..372636c45a 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest92.m +++ b/GraphBLAS/GraphBLAS/test/gbtest92.m @@ -7,7 +7,7 @@ % C = GrB.kronecker (C, M, op, A, B, desc) % C = GrB.kronecker (C, M, accum, op, A, B, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest93.m b/GraphBLAS/GraphBLAS/test/gbtest93.m index 6c1869e8a8..536762a929 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest93.m +++ b/GraphBLAS/GraphBLAS/test/gbtest93.m @@ -17,7 +17,7 @@ % C = GrB.select (C, M, accum, op, A, b) % C = GrB.select (C, M, accum, op, A, b, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest94.m b/GraphBLAS/GraphBLAS/test/gbtest94.m index 27c32a130d..d495273218 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest94.m +++ b/GraphBLAS/GraphBLAS/test/gbtest94.m @@ -17,7 +17,7 @@ % C = GrB.vreduce (C, M, accum, monoid, A, b) % C = GrB.vreduce (C, M, accum, monoid, A, b, desc) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest95.m b/GraphBLAS/GraphBLAS/test/gbtest95.m index 32bbe279c3..5b7b56255b 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest95.m +++ b/GraphBLAS/GraphBLAS/test/gbtest95.m @@ -1,7 +1,7 @@ function gbtest95 %GBTEST95 test indexing -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 have_octave = gb_octave ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest96.m b/GraphBLAS/GraphBLAS/test/gbtest96.m index 4b2b7313f6..44f1959db7 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest96.m +++ b/GraphBLAS/GraphBLAS/test/gbtest96.m @@ -1,7 +1,7 @@ function gbtest96 %GBTEST96 test GrB.optype -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('Table of types of binary operators when inputs types are\n') ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest97.m b/GraphBLAS/GraphBLAS/test/gbtest97.m index c5910b7779..c9725428e6 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest97.m +++ b/GraphBLAS/GraphBLAS/test/gbtest97.m @@ -11,7 +11,7 @@ % C = GrB.apply2 (C, M, op, x, A) % C = GrB.apply2 (C, M, accum, op, x, A) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/GraphBLAS/test/gbtest98.m b/GraphBLAS/GraphBLAS/test/gbtest98.m index 28c9f4a782..c95940b809 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest98.m +++ b/GraphBLAS/GraphBLAS/test/gbtest98.m @@ -1,7 +1,7 @@ function gbtest98 %GBTEST98 test row/col degree for hypersparse matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -40,8 +40,8 @@ [~ ,~ ,x2] = GrB.extracttuples (A) ; assert (isequal (x1, x2)) ; -assert (isequal (class (i1), 'int64')) ; -assert (isequal (class (j1), 'int64')) ; +assert (isequal (class (i1), 'int32') || isequal (class (i1), 'int64')) ; +assert (isequal (class (j1), 'int32') || isequal (class (j1), 'int64')) ; G = GrB.random (8, 8, 0.5) ; A = double (G) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest99.m b/GraphBLAS/GraphBLAS/test/gbtest99.m index 01d6afe1a0..828b01d1c8 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest99.m +++ b/GraphBLAS/GraphBLAS/test/gbtest99.m @@ -1,7 +1,7 @@ function gbtest99 %GBTEST99 test performance of C=A'*B and C=A' -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('# of threads in @GrB: %d\n', GrB.threads) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest_binops.m b/GraphBLAS/GraphBLAS/test/gbtest_binops.m index f41d088a0a..e0901be092 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_binops.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_binops.m @@ -9,7 +9,7 @@ % % See also GrB.binopinfo. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 binops = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest_cast.m b/GraphBLAS/GraphBLAS/test/gbtest_cast.m index f403936c45..487e3b6736 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_cast.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_cast.m @@ -10,7 +10,7 @@ % % See also cast. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (issparse (A)) diff --git a/GraphBLAS/GraphBLAS/test/gbtest_complex.m b/GraphBLAS/GraphBLAS/test/gbtest_complex.m index c2a2b25901..16bd9cf2bb 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_complex.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_complex.m @@ -1,7 +1,7 @@ function [complex_binaryops, complex_unaryops] = gbtest_complex %GBTEST_COMPLEX return list of complex operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 complex_binaryops = { diff --git a/GraphBLAS/GraphBLAS/test/gbtest_eq.m b/GraphBLAS/GraphBLAS/test/gbtest_eq.m index b115f61e2f..d5d83fc186 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_eq.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_eq.m @@ -1,7 +1,7 @@ function s = gbtest_eq (A, B) %GBTEST_EQ tests if A and B are equal, after dropping zeros. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = isequal (GrB.prune (A), GrB.prune (B)) ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest_err.m b/GraphBLAS/GraphBLAS/test/gbtest_err.m index 5585de8e93..6492dda2a0 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_err.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_err.m @@ -6,7 +6,7 @@ % Returns the norm (A-B,1), ignoring inf's and nan's. % Also tests the result of isinf and isnan for A and B. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 err = 0 ; %#ok<*NASGU> diff --git a/GraphBLAS/GraphBLAS/test/gbtest_perf1.m b/GraphBLAS/GraphBLAS/test/gbtest_perf1.m index 2dc860d012..ec34aed6e4 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_perf1.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_perf1.m @@ -1,7 +1,7 @@ function gbtest_perf1 %GBTEST_PERF1 test A*x performance -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 max_nthreads = GrB.threads ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest_perf2.m b/GraphBLAS/GraphBLAS/test/gbtest_perf2.m index 5a6ce59081..c9deaf746e 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_perf2.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_perf2.m @@ -1,7 +1,7 @@ function gbtest_perf2 %GBTEST_PERF2 test A'*x performance -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 max_nthreads = GrB.threads ; diff --git a/GraphBLAS/GraphBLAS/test/gbtest_types.m b/GraphBLAS/GraphBLAS/test/gbtest_types.m index 8f613901f6..800944004d 100644 --- a/GraphBLAS/GraphBLAS/test/gbtest_types.m +++ b/GraphBLAS/GraphBLAS/test/gbtest_types.m @@ -3,7 +3,7 @@ % % See also gbtest_binops. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = { diff --git a/GraphBLAS/GraphBLAS/test/tcov/Contents.m b/GraphBLAS/GraphBLAS/test/tcov/Contents.m index bb6fa9261b..1daa8f29f0 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/Contents.m +++ b/GraphBLAS/GraphBLAS/test/tcov/Contents.m @@ -14,6 +14,6 @@ % gbcovshow - report GraphBLAS statement coverage % gbcov_edit - create a version of GraphBLAS for statement coverage tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/GraphBLAS/test/tcov/Makefile b/GraphBLAS/GraphBLAS/test/tcov/Makefile index 28dd8aac52..83efedac1d 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/Makefile +++ b/GraphBLAS/GraphBLAS/test/tcov/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/test/tcov/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/GraphBLAS/test/tcov/gbcov.m b/GraphBLAS/GraphBLAS/test/tcov/gbcov.m index 267b7a64b3..851d89f374 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/gbcov.m +++ b/GraphBLAS/GraphBLAS/test/tcov/gbcov.m @@ -1,11 +1,12 @@ function gbcov %GBCOV run all GraphBLAS tests, with statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % compile the coverage-test version of the @GrB mexFunctions -global gbcov_global %#ok<*NUSED> +global gbcov_global +gbcov_global = [ ] ; try % clear the default GrB library @@ -15,8 +16,17 @@ gbcovmake addpath ('..') ; % add the test folder to the path -rmpath ('../..') ; % remove the regular @GrB class -addpath ('tmp') ; % add the modified @GrB class +try + rmpath ('../..') ; % remove the regular @GrB class +catch me +end + +rmpath ('tmp') ; % remove the modified @GrB class +which ('GrB') +assert (isempty (which ('GrB'))) + +addpath ('tmp') ; % add back the modified @GrB class +s = which ('GrB') ; % run the tests gbtest ; @@ -31,7 +41,9 @@ rmpath ('tmp') ; % remove the modified @GrB class % report the coverage +fprintf ('Revised @GrB tested: %s\n', s) ; gbcovshow ; +fprintf ('Now with usual @GrB: %s\n', which ('GrB')) ; try % reload the default GrB library diff --git a/GraphBLAS/GraphBLAS/test/tcov/gbcov_edit.m b/GraphBLAS/GraphBLAS/test/tcov/gbcov_edit.m index 4768e14484..4e9f5c828e 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/gbcov_edit.m +++ b/GraphBLAS/GraphBLAS/test/tcov/gbcov_edit.m @@ -13,7 +13,7 @@ % % { gbcov [count]++ ; -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % infiles can be a struct from dir, or a single string with one filename diff --git a/GraphBLAS/GraphBLAS/test/tcov/gbcov_util.c b/GraphBLAS/GraphBLAS/test/tcov/gbcov_util.c index f5bb5b8caf..990395fb70 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/gbcov_util.c +++ b/GraphBLAS/GraphBLAS/test/tcov/gbcov_util.c @@ -2,7 +2,7 @@ // gbcov_util.c: utilities for test coverage //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/GraphBLAS/test/tcov/gbcovmake.m b/GraphBLAS/GraphBLAS/test/tcov/gbcovmake.m index b746ff598d..a8663185fc 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/gbcovmake.m +++ b/GraphBLAS/GraphBLAS/test/tcov/gbcovmake.m @@ -3,7 +3,7 @@ % % See also: gbcover, gbcov_edit -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('Compiling @GrB interface for mexFunction statement coverage...\n') ; @@ -49,50 +49,56 @@ % use -R2018a for the new interleaved complex API flags = '-g -R2018a -DGBCOV' ; -need_rename = true ; % was: ~verLessThan ('matlab', '9.10') ; - -try - if (strncmp (computer, 'GLNX', 4)) - % remove -ansi from CFLAGS and replace it with -std=c11 - cc = mex.getCompilerConfigurations ('C', 'Selected') ; - env = cc.Details.SetEnv ; - c1 = strfind (env, 'CFLAGS=') ; - q = strfind (env, '"') ; - q = q (q > c1) ; - if (~isempty (c1) && length (q) > 1) - c2 = q (2) ; - cflags = env (c1:c2) ; % the CFLAGS="..." string - ansi = strfind (cflags, '-ansi') ; - if (~isempty (ansi)) - cflags = [cflags(1:ansi-1) '-std=c11' cflags(ansi+5:end)] ; - flags = [flags ' ' cflags] ; - fprintf ('compiling with -std=c11 instead of default -ansi\n') ; - end - end - end -catch +if ispc + library_path = sprintf ('%s/../../build/Release', pwd) ; +else + library_path = sprintf ('%s/../../build', pwd) ; end here = pwd ; -if (need_rename) - % use renamed version for all MATLAB versions: - flags = [flags ' -DGBMATLAB=1 ' ] ; - inc = sprintf ('-I%s/../../rename ', here) ; - libraries = '-L../../../../../build -L. -L/usr/local/lib -lgraphblas_matlab' ; -else - % no longer used: - inc = [' '] ; - libraries = '-L../../../../../../build -L. -L/usr/local/lib -lgraphblas' ; +% use renamed version for all MATLAB versions: +flags = [flags ' -DGBMATLAB=1 ' ] ; +inc = sprintf ('-I%s/../../rename ', here) ; +libraries = '-L../../../../../build -L. -L/usr/local/lib -lgraphblas_matlab' ; + +% revise compiler flags for MATLAB +if (ismac) + cflags = '' ; + ldflags = '-fPIC' ; + rpath = '-rpath ' ; +elseif (isunix) + cflags = '-fopenmp' ; + ldflags = '-fopenmp -fPIC' ; + rpath = '-rpath=' ; end - -if (~ismac && isunix) - flags = [ flags ' CFLAGS="$CXXFLAGS -fopenmp -fPIC -Wno-pragmas" '] ; - flags = [ flags ' CXXFLAGS="$CXXFLAGS -fopenmp -fPIC -Wno-pragmas" '] ; - flags = [ flags ' LDFLAGS="$LDFLAGS -fopenmp -fPIC" '] ; +if (ismac || isunix) + rpath = sprintf (' -Wl,%s''''%s'''' ', rpath, library_path) ; + flags = [ flags ' CFLAGS=''$CFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' CXXFLAGS=''$CXXFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' LDFLAGS=''$LDFLAGS ' ldflags rpath ' '' '] ; end -inc = [ inc '-I. -I../util -I../../../../../../Include -I../../../../../../Source -I../../../../../../Source/include -I../../../../../../cpu_features/include ' ] ; +inc = [inc '-I. -I../util '] ; + inc = [inc '-I../../../../../.. ' ] ; + inc = [inc '-I../../../../../../Include '] ; + inc = [inc '-I../../../../../../Source ' ] ; + inc = [inc '-I../../../../../../Source/include '] ; + inc = [inc '-I../../../../../../Source/ij ' ] ; + inc = [inc '-I../../../../../../Source/math ' ] ; + inc = [inc '-I../../../../../../Source/cast ' ] ; + inc = [inc '-I../../../../../../Source/binaryop ' ] ; + inc = [inc '-I../../../../../../Source/transpose ' ] ; + inc = [inc '-I../../../../../../Source/helper ' ] ; + inc = [inc '-I../../../../../../Source/builtin ' ] ; + inc = [inc '-I../../../../../../Source/hyper ' ] ; + +Lflags = sprintf ('-L''%s''', library_path) ; + +fprintf ('compiler flags: %s\n', flags) ; +fprintf ('compiler incs: %s\n', inc) ; +fprintf ('linking flags: %s\n', Lflags) ; +fprintf ('libraries: %s\n', libraries) ; cd tmp/@GrB/private try @@ -126,8 +132,8 @@ mexfunction = [(mexfunctions (k).folder) '/' mexfunc] ; % compile the mexFunction - mexcmd = sprintf ('mex -silent %s %s %s %s %s', ... - flags, inc, mexfunction, objlist, libraries) ; + mexcmd = sprintf ('mex %s -silent %s %s ''%s'' %s %s', ... + Lflags, flags, inc, mexfunction, objlist, libraries) ; fprintf (':') ; % fprintf ('%s\n', mexfunction) ; % fprintf ('%s\n', mexcmd) ; diff --git a/GraphBLAS/GraphBLAS/test/tcov/gbcovshow.m b/GraphBLAS/GraphBLAS/test/tcov/gbcovshow.m index 12f9cc4f6a..4a1b5f118f 100644 --- a/GraphBLAS/GraphBLAS/test/tcov/gbcovshow.m +++ b/GraphBLAS/GraphBLAS/test/tcov/gbcovshow.m @@ -1,7 +1,7 @@ function gbcovshow %GBCOVSHOW report GraphBLAS statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % report the coverage summary @@ -16,7 +16,7 @@ not_covered = find (gbcov_global == 0) - 1 ; n = length (gbcov_global) ; -fprintf ('test coverage: %d of %d (%0.4f%%), not covered %d\n', ... +fprintf ('test coverage: %d of %d (%0.1f%%), not covered: %d\n', ... covered, n, 100 * (covered / n), length (not_covered)) ; % create the coverage reports in tmp/cover diff --git a/GraphBLAS/Include/GraphBLAS.h b/GraphBLAS/Include/GraphBLAS.h index 6c6c05e316..7054d33644 100644 --- a/GraphBLAS/Include/GraphBLAS.h +++ b/GraphBLAS/Include/GraphBLAS.h @@ -1,4 +1,4 @@ -// SuiteSparse:GraphBLAS 9.4.5 +// SuiteSparse:GraphBLAS 10.0.0 //------------------------------------------------------------------------------ // GraphBLAS.h: definitions for the GraphBLAS package //------------------------------------------------------------------------------ @@ -268,10 +268,10 @@ // The version of this implementation, and the GraphBLAS API version: #define GxB_IMPLEMENTATION_NAME "SuiteSparse:GraphBLAS" -#define GxB_IMPLEMENTATION_DATE "Feb 20, 2025" -#define GxB_IMPLEMENTATION_MAJOR 9 -#define GxB_IMPLEMENTATION_MINOR 4 -#define GxB_IMPLEMENTATION_SUB 5 +#define GxB_IMPLEMENTATION_DATE "Mar 3, 2025" +#define GxB_IMPLEMENTATION_MAJOR 10 +#define GxB_IMPLEMENTATION_MINOR 0 +#define GxB_IMPLEMENTATION_SUB 0 #define GxB_SPEC_DATE "Dec 22, 2023" #define GxB_SPEC_MAJOR 2 #define GxB_SPEC_MINOR 1 @@ -318,6 +318,15 @@ "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" +//------------------------------------------------------------------------------ +// simplify the use of GraphBLAS.h in C++ programs +//------------------------------------------------------------------------------ + +#if defined ( __cplusplus ) +extern "C" +{ +#endif + //============================================================================== // GrB_Index: the GraphBLAS integer //============================================================================== @@ -329,7 +338,7 @@ typedef uint64_t GrB_Index ; // GrB_INDEX_MAX is the largest permissible index value. The largest valid // matrix or vector dimension is GrB_INDEX_MAX+1, or 2^60 in SuiteSparse:GrB. -#define GrB_INDEX_MAX ((GrB_Index) (1ULL << 60) - 1) +#define GrB_INDEX_MAX ((uint64_t) (1ULL << 60) - 1) //============================================================================== // GraphBLAS error and informational codes @@ -340,7 +349,7 @@ typedef uint64_t GrB_Index ; // called, which returns a string that provides more information on the last // return value from GraphBLAS. -typedef enum +typedef enum // GrB_Info { GrB_SUCCESS = 0, // all is well @@ -358,7 +367,7 @@ typedef enum GrB_UNINITIALIZED_OBJECT = -1, // object has not been initialized GrB_NULL_POINTER = -2, // input pointer is NULL - GrB_INVALID_VALUE = -3, // generic error; some value is bad + GrB_INVALID_VALUE = -3, // general error; some value is bad GrB_INVALID_INDEX = -4, // row or column index is out of bounds GrB_DOMAIN_MISMATCH = -5, // object domains are not compatible GrB_DIMENSION_MISMATCH = -6, // matrix dimensions do not match @@ -371,7 +380,9 @@ typedef enum GrB_INVALID_OBJECT = -104, // object is corrupted GrB_INDEX_OUT_OF_BOUNDS = -105, // row or col index out of bounds GrB_EMPTY_OBJECT = -106, // an object does not contain a value - GxB_JIT_ERROR = -1001, // JIT compiler/loader error + GxB_JIT_ERROR = -7001, // JIT compiler/loader error + GxB_GPU_ERROR = -7002, // GPU error (future; not yet in production) + GxB_OUTPUT_IS_READONLY = -7003, // output matrix has readonly components } GrB_Info ; @@ -395,7 +406,7 @@ GrB_Info ; // 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 +typedef enum // GrB_Mode { GrB_NONBLOCKING = 0, // methods may return with pending computations GrB_BLOCKING = 1, // no computations are ever left pending @@ -405,6 +416,35 @@ typedef enum } GrB_Mode ; +//============================================================================== +// GraphBLAS opaque objects +//============================================================================== + +// GraphBLAS relies on opaque objects for most of its data structures. The +// content of these objects are not accessible to the user application. + +// 11 objects in the GraphBLAS C API: +typedef struct GB_Descriptor_opaque *GrB_Descriptor ; +typedef struct GB_Type_opaque *GrB_Type ; +typedef struct GB_UnaryOp_opaque *GrB_UnaryOp ; +typedef struct GB_BinaryOp_opaque *GrB_BinaryOp ; +typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp ; +typedef struct GB_Monoid_opaque *GrB_Monoid ; +typedef struct GB_Semiring_opaque *GrB_Semiring ; +typedef struct GB_Scalar_opaque *GrB_Scalar ; +typedef struct GB_Vector_opaque *GrB_Vector ; +typedef struct GB_Matrix_opaque *GrB_Matrix ; +typedef struct GB_Global_opaque *GrB_Global ; + +// 3 objects in the SuiteSparse extensions: +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; +typedef struct GB_Context_opaque *GxB_Context ; +typedef struct GB_Iterator_opaque *GxB_Iterator ; + +// 2 historical objects +typedef struct GB_SelectOp_opaque *GxB_SelectOp ; // use GrB_IndexUnaryOp +typedef struct GB_Scalar_opaque *GxB_Scalar ; // use GrB_Scalar + //============================================================================== // GrB_Descriptor: the GraphBLAS descriptor //============================================================================== @@ -487,7 +527,7 @@ GrB_Mode ; // GPU control (DRAFT: in progress, do not use) #define GxB_GPU_ID 7088 -typedef enum +typedef enum // GrB_Desc_Field ; { GrB_OUTP = 0, // descriptor for output of a method GrB_MASK = 1, // descriptor for the mask input of a method @@ -496,11 +536,14 @@ typedef enum GxB_AxB_METHOD = 7090, // descriptor for selecting C=A*B algorithm GxB_SORT = 7091, // control sort in GrB_mxm GxB_COMPRESSION = 7092, // select compression for serialize - GxB_IMPORT = 7093, // secure vs fast GxB_pack + GxB_IMPORT = 7093, // secure vs fast GxB_pack (historical) + GxB_ROWINDEX_LIST = 7094, // how GrB_Vector I is intrepretted + GxB_COLINDEX_LIST = 7095, // how GrB_Vector J is intrepretted + GxB_VALUE_LIST = 7096, // how GrB_Vector X is intrepretted } GrB_Desc_Field ; -typedef enum +typedef enum // GrB_Desc_Value ; { // for all GrB_Descriptor fields: GrB_DEFAULT = 0, // default behavior of the method @@ -523,15 +566,21 @@ typedef enum GxB_AxB_HASH = 7084, // hash-based saxpy method GxB_AxB_SAXPY = 7085, // saxpy method (any kind) - // for GxB_IMPORT only: - GxB_SECURE_IMPORT = 7080 // GxB*_pack* methods trust their input data + // for GxB_IMPORT only: (historical) + GxB_SECURE_IMPORT = 7080, // GxB*_pack* methods trust their input data + + // for GxB_ROWINDEX_LIST, GxB_COLINDEX_LIST, and GxB_VALUE_LIST: + // GxB_USE_VALUES = ((int) GrB_DEFAULT) // use the values of the vector + GxB_USE_INDICES = 7060, // use the indices of the vector + GxB_IS_STRIDE = 7061, // use the values, of size 3, for lo:hi:inc } GrB_Desc_Value ; // default for GxB pack is to trust the input data -#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) +#define GxB_FAST_IMPORT ((int) GrB_DEFAULT) /* historical */ -typedef struct GB_Descriptor_opaque *GrB_Descriptor ; +// settings for GxB_ROWINDEX_LIST, GxB_COLINDEX_LIST, and GxB_VALUE_LIST: +#define GxB_USE_VALUES ((int) GrB_DEFAULT) /* use the values of the vector */ // Predefined descriptors and their values: @@ -595,8 +644,6 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN // GrB_Type: data types //============================================================================== -typedef struct GB_Type_opaque *GrB_Type ; - // GraphBLAS predefined types and their counterparts in pure C: GB_GLOBAL GrB_Type GrB_BOOL , // in C: bool @@ -627,7 +674,7 @@ GB_GLOBAL GrB_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 ; +typedef void (*GxB_unary_function) (void *, const void *) ; //------------------------------------------------------------------------------ // built-in unary operators, z = f(x) @@ -789,8 +836,6 @@ GB_GLOBAL GrB_UnaryOp GxB_ISFINITE_FC32, // isfinite (real (x)) && isfinite (cimag (x)) GxB_ISFINITE_FC64 ; // isfinite (real (x)) && isfinite (cimag (x)) -typedef void (*GxB_unary_function) (void *, const void *) ; - //============================================================================== // GrB_BinaryOp: binary operators //============================================================================== @@ -802,7 +847,7 @@ typedef void (*GxB_unary_function) (void *, const void *) ; // 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 ; +typedef void (*GxB_binary_function) (void *, const void *, const void *) ; //------------------------------------------------------------------------------ // built-in binary operators, z = f(x,y), where x,y,z all have the same type @@ -1190,8 +1235,6 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; // BXOR, and BXNOR. This assumes that the computations for each bit are // entirely independent (so BSHIFT would not fit in the table above). -typedef void (*GxB_binary_function) (void *, const void *, const void *) ; - //============================================================================== // GxB_IndexBinaryOp: index binary operators //============================================================================== @@ -1207,8 +1250,6 @@ typedef void (*GxB_binary_function) (void *, const void *, const void *) ; // ztype, xtype, ytype, and theta_type, respectively. // for examples. -typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; - typedef void (*GxB_index_binary_function) (void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, @@ -1222,8 +1263,6 @@ typedef void (*GxB_index_binary_function) (void *, // value of the A(i,j) entry, i and j are its row and column index, and y // is a scalar. For vectors, it has the form z = f(vi, i, 0, y). -typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp ; - typedef void (*GxB_index_unary_function) ( void *z, // output value z, of type ztype @@ -1233,9 +1272,6 @@ typedef void (*GxB_index_unary_function) const void *y // input scalar y ) ; -// GxB_SelectOp: use GrB_IndexUnaryOp instead -typedef struct GB_SelectOp_opaque *GxB_SelectOp ; // Historical; do not use - //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices //============================================================================== @@ -1321,60 +1357,91 @@ GB_GLOBAL GrB_IndexUnaryOp GrB_VALUEGE_INT64, GrB_VALUEGE_UINT64 ; //============================================================================== -// GrB_Monoid +// SuiteSparse:GraphBLAS options //============================================================================== -// A monoid is an associative operator z=op(x,y) where all three types of z, x, -// and y are identical. The monoid also has an identity element, such that -// op(x,identity) = op(identity,x) = x. +// The following options modify how SuiteSparse:GraphBLAS stores and operates +// on its matrices. The GrB_get/set methods allow the user to suggest how the +// internal representation of a matrix, or all matrices, should be held. These +// options have no effect on the result (except for minor roundoff differences +// for floating-point types). They only affect the time and memory usage of the +// computations. -typedef struct GB_Monoid_opaque *GrB_Monoid ; +typedef enum // GxB_Option_Field ; +{ -//============================================================================== -// GrB_Semiring -//============================================================================== + //-------------------------------------------------------------------------- + // GrB enums in the C API + //-------------------------------------------------------------------------- -typedef struct GB_Semiring_opaque *GrB_Semiring ; + // GrB_Descriptor only, get/set: + GrB_OUTP_FIELD = 0, // descriptor for output of a method + GrB_MASK_FIELD = 1, // descriptor for the mask input of a method + GrB_INP0_FIELD = 2, // descriptor for the first input of a method + GrB_INP1_FIELD = 3, // descriptor for the second input of a method -//============================================================================== -// GrB_Scalar: a GraphBLAS scalar -//============================================================================== + // all objects, including GrB_GLOBAL, get/set (but only get for global): + GrB_NAME = 10, // name of the object, as a string -typedef struct GB_Scalar_opaque *GrB_Scalar ; + // GrB_GLOBAL, get only: + GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, // C API version + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, // GrB_Mode -// GxB_Scalar: use GrB_Scalar instead (as-is) -typedef struct GB_Scalar_opaque *GxB_Scalar ; // Historical, do not use. + // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar, get/set: + GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation -//============================================================================== -// GrB_Vector: a GraphBLAS vector -//============================================================================== + // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize), get only: + GrB_EL_TYPE_CODE = 102, // a GrB_Type_Code (see below) + GrB_EL_TYPE_STRING = 106, // name of the type -typedef struct GB_Vector_opaque *GrB_Vector ; + // GrB_*Op, GrB_Monoid, and GrB_Semiring, get only: + GrB_INP0_TYPE_CODE = 103, // GrB_Type_Code + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, // name of the type, as a string + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, -//============================================================================== -// GrB_Matrix: a GraphBLAS matrix -//============================================================================== + // GrB_Type, get only: + GrB_SIZE = 110, // size of the type -typedef struct GB_Matrix_opaque *GrB_Matrix ; + //-------------------------------------------------------------------------- + // SuiteSparse extensions: + //-------------------------------------------------------------------------- -//============================================================================== -// SuiteSparse:GraphBLAS options -//============================================================================== + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp, get/set: + GxB_JIT_C_NAME = 7041, // C type or function name + GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition -// The following options modify how SuiteSparse:GraphBLAS stores and operates -// on its matrices. The GrB_get/set methods allow the user to suggest how the -// internal representation of a matrix, or all matrices, should be held. These -// options have no effect on the result (except for minor roundoff differences -// for floating-point types). They only affect the time and memory usage of the -// computations. + // GrB_Monoid and GrB_Semiring, get only: + GxB_MONOID_IDENTITY = 7043, // monoid identity value + GxB_MONOID_TERMINAL = 7044, // monoid terminal value + GxB_MONOID_OPERATOR = 7045, // monoid binary operator -typedef enum // for global options or matrix options -{ + // GrB_Semiring, get only: + GxB_SEMIRING_MONOID = 7046, // semiring monoid + GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp, get only:: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring, get only: + GxB_THETA = 7052, // to get the value of theta //------------------------------------------------------------ - // GrB_get / GrB_set for GrB_Matrix and GrB_GLOBAL: + // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar: get/set //------------------------------------------------------------ + GxB_ROWINDEX_INTEGER_HINT = 7053, // hint for row indices + GxB_COLINDEX_INTEGER_HINT = 7054, // hint for column indices + GxB_OFFSET_INTEGER_HINT = 7056, // hint for offsets GxB_HYPER_SWITCH = 7000, // switch to hypersparse (double value) GxB_HYPER_HASH = 7048, // hyper_hash control (global int64 value, // or bool per matrix) @@ -1382,7 +1449,28 @@ typedef enum // for global options or matrix options GxB_FORMAT = 7002, // Historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ - // GrB_get for GrB_GLOBAL: + // GrB_Matrix, GrB_Vector, GrB_Scalar: get/set + //------------------------------------------------------------ + + GxB_ISO = 7079, // get: returns the current iso status + // set true: make the matrix iso-valued, if possible. + // set false: make the matrix non-iso-valued. + GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below + + //------------------------------------------------------------ + // GrB_Matrix, GrB_Vector, GrB_Scalar: get only + //------------------------------------------------------------ + + GxB_ROWINDEX_INTEGER_BITS = 7057, // # bits for row indices + GxB_COLINDEX_INTEGER_BITS = 7058, // # bits for column indices + GxB_OFFSET_INTEGER_BITS = 7059, // # bits for offsets + GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) + GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS + GxB_IS_READONLY = 7078, // true if it has any readonly components + GxB_WILL_WAIT = 7076, // true if GrB_wait(A) will do anything + + //------------------------------------------------------------ + // GrB_GLOBAL, get only: //------------------------------------------------------------ GxB_MODE = 7003, // Historical; use GrB_BLOCKING_MODE @@ -1419,6 +1507,8 @@ typedef enum // for global options or matrix options GxB_FLUSH = 7021, // flush function diagnostic output GxB_MEMORY_POOL = 7022, // no longer used GxB_PRINT_1BASED = 7023, // print matrices as 0-based or 1-based + GxB_INCLUDE_READONLY_STATISTICS = 7077, // include readonly memory in + // memory usage statistics GxB_JIT_C_COMPILER_NAME = 7024, // CPU JIT C compiler name GxB_JIT_C_COMPILER_FLAGS = 7025, // CPU JIT C compiler flags @@ -1433,23 +1523,10 @@ typedef enum // for global options or matrix options GxB_JIT_CUDA_PREFACE = 7100, // CUDA JIT C++ preface - //------------------------------------------------------------ - // GrB_get for GrB_Matrix: - //------------------------------------------------------------ - - GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) - GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS - - //------------------------------------------------------------ - // GrB_get/GrB_set for GrB_Matrix: - //------------------------------------------------------------ - - GxB_SPARSITY_CONTROL = 7036, // sparsity control: 0 to 15; see below - } GxB_Option_Field ; // for GxB_JIT_C_CONTROL: -typedef enum +typedef enum // GxB_JIT_Control ; { GxB_JIT_OFF = 0, // do not use the JIT: free all JIT kernels if loaded GxB_JIT_PAUSE = 1, // do not run JIT kernels but keep any loaded @@ -1539,12 +1616,10 @@ GB_GLOBAL const double GxB_ALWAYS_HYPER, GxB_NEVER_HYPER ; // GxB_Context: for managing computational resources //============================================================================== -typedef struct GB_Context_opaque *GxB_Context ; - // GxB_CONTEXT_WORLD is the default Context for all user threads. GB_GLOBAL GxB_Context GxB_CONTEXT_WORLD ; -typedef enum +typedef enum // GxB_Context_Field { GxB_CONTEXT_NTHREADS = GxB_NTHREADS, // max number of threads to use. // If <= 0, then one thread is used. @@ -1561,80 +1636,9 @@ GxB_Context_Field ; // GrB_set and GrB_get //============================================================================== -typedef struct GB_Global_opaque *GrB_Global ; GB_GLOBAL const GrB_Global GrB_GLOBAL ; -typedef enum -{ - - //-------------------------------------------------------------------------- - // GrB enums in the C API - //-------------------------------------------------------------------------- - - // GrB_Descriptor only: - GrB_OUTP_FIELD = 0, // descriptor for output of a method - GrB_MASK_FIELD = 1, // descriptor for the mask input of a method - GrB_INP0_FIELD = 2, // descriptor for the first input of a method - GrB_INP1_FIELD = 3, // descriptor for the second input of a method - - // all objects, including GrB_GLOBAL: - GrB_NAME = 10, // name of the object, as a string - - // GrB_GLOBAL only: - GrB_LIBRARY_VER_MAJOR = 11, // SuiteSparse:GraphBLAS version - GrB_LIBRARY_VER_MINOR = 12, - GrB_LIBRARY_VER_PATCH = 13, - GrB_API_VER_MAJOR = 14, // C API version - GrB_API_VER_MINOR = 15, - GrB_API_VER_PATCH = 16, - GrB_BLOCKING_MODE = 17, // GrB_Mode - - // GrB_GLOBAL, GrB_Matrix, GrB_Vector, GrB_Scalar: - GrB_STORAGE_ORIENTATION_HINT = 100, // GrB_Orientation - - // GrB_Matrix, GrB_Vector, GrB_Scalar (and void * serialize): - GrB_EL_TYPE_CODE = 102, // a GrB_Type_Code (see below) - GrB_EL_TYPE_STRING = 106, // name of the type - - // GrB_*Op, GrB_Monoid, and GrB_Semiring: - GrB_INP0_TYPE_CODE = 103, // GrB_Type_Code - GrB_INP1_TYPE_CODE = 104, - GrB_OUTP_TYPE_CODE = 105, - GrB_INP0_TYPE_STRING = 107, // name of the type, as a string - GrB_INP1_TYPE_STRING = 108, - GrB_OUTP_TYPE_STRING = 109, - - // GrB_Type (readable only): - GrB_SIZE = 110, // size of the type - - //-------------------------------------------------------------------------- - // SuiteSparse extensions: - //-------------------------------------------------------------------------- - - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, - // and GxB_IndexBinaryOp - GxB_JIT_C_NAME = 7041, // C type or function name - GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition - - // GrB_Monoid and GrB_Semiring: - GxB_MONOID_IDENTITY = 7043, // monoid identity value - GxB_MONOID_TERMINAL = 7044, // monoid terminal value - GxB_MONOID_OPERATOR = 7045, // monoid binary operator - - // GrB_Semiring only: - GxB_SEMIRING_MONOID = 7046, // semiring monoid - GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op - - // GrB_BinaryOp and GxB_IndexBinaryOp: - GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops - GxB_THETA_TYPE_STRING = 7051, - - // GrB_BinaryOp or GrB_Semiring: - GxB_THETA = 7052, // to get the value of theta -} -GrB_Field ; - -typedef enum +typedef enum // GrB_Orientation { GrB_ROWMAJOR = 0, GrB_COLMAJOR = 1, @@ -1643,7 +1647,7 @@ typedef enum } GrB_Orientation ; -typedef enum +typedef enum // GrB_Type_Code { GrB_UDT_CODE = 0, // user-defined type GrB_BOOL_CODE = 1, // GraphBLAS: GrB_BOOL C: bool @@ -1666,20 +1670,17 @@ GrB_Type_Code ; // GrB_wait: finish computations //============================================================================== -typedef enum +typedef enum // GrB_WaitMode { - GrB_COMPLETE = 0, // establishes a happens-before relation; work may - // remain to compute the object but this can now - // be done safely by any user thread. - GrB_MATERIALIZE = 1 // all work on the object is finished (also - // establishes a happens-before relation). The - // object can be safely be used as an input to a - // GraphBLAS method by multiple user threads at - // the same time. For example, the A or B matrices - // of GrB_mxm can be shared by 2 user threads, but - // their output matrices C must be different. -} -GrB_WaitMode ; + GrB_COMPLETE = 0, // Establishes a happens-before relation; work may + // remain but this can now be done safely by any user thread. + GrB_MATERIALIZE = 1 // All work on the object is finished (also + // establishes a happens-before relation). The object can be safely be + // used as an input to a GraphBLAS method by multiple user threads at + // the same time. For example, the A or B matrices of GrB_mxm can be + // shared by 2 user threads, but their output matrices C must be + // different. +} GrB_WaitMode ; //============================================================================== // GrB_extract: extract a submatrix or subvector @@ -1688,7 +1689,9 @@ GrB_WaitMode ; GB_GLOBAL const uint64_t *GrB_ALL ; // These special values of ni and nj can be used for GrB_assign, -// GrB_extract, and GxB_subassign. +// GrB_extract, and GxB_subassign, when I and J are uint64_t * arrays. +// For GrB_Vector inputs, use the GxB_ROWINDEX_LIST and GxB_COLINDEX_LIST +// descriptor settings instead. #define GxB_RANGE (INT64_MAX) #define GxB_STRIDE (INT64_MAX-1) #define GxB_BACKWARDS (INT64_MAX-2) @@ -1704,6 +1707,10 @@ GB_GLOBAL const uint64_t *GrB_ALL ; // GrB_Monoid: built-in monoids //============================================================================== +// A monoid is an associative operator z=op(x,y) where all three types of z, x, +// and y are identical. The monoid also has an identity element, such that +// op(x,identity) = op(identity,x) = x. + GB_GLOBAL GrB_Monoid //-------------------------------------------------------------------------- @@ -2583,7 +2590,7 @@ GB_GLOBAL GrB_Semiring // GxB_fprint and GxB_print: print the contents of a GraphBLAS object //============================================================================== -typedef enum +typedef enum // GxB_Print_Level { GxB_SILENT = 0, // nothing is printed, just check the object GxB_SUMMARY = 1, // print a terse summary @@ -2599,7 +2606,7 @@ GxB_Print_Level ; //============================================================================== // The GrB C API specification supports 3 formats: -typedef enum +typedef enum // GrB_Format { GrB_CSR_FORMAT = 0, // CSR format (equiv to GxB_SPARSE with GxB_BY_ROW) GrB_CSC_FORMAT = 1, // CSC format (equiv to GxB_SPARSE with GxB_BY_COL) @@ -2607,7 +2614,7 @@ typedef enum } GrB_Format ; -typedef enum +typedef enum // GxB_Format_Value { GxB_BY_ROW = 0, // matrix is held by row GxB_BY_COL = 1, // matrix is held by column @@ -2619,7 +2626,7 @@ GxB_Format_Value ; // const, so that if SuiteSparse:GraphBLAS is recompiled with a different // default format, and the application is relinked but not recompiled, it will // acquire the new default values. -GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; +GB_GLOBAL const int GxB_FORMAT_DEFAULT ; //============================================================================== // serialize/deserialize compression levels @@ -2641,11 +2648,6 @@ GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; // GraphBLAS/CUDA, since they do not need access these definitions. User // applications have access to these methods. -#if defined ( __cplusplus ) -extern "C" -{ -#endif - #ifndef GB_CUDA_FOLDER //============================================================================== @@ -2654,13 +2656,12 @@ extern "C" GrB_Info GrB_init // start up GraphBLAS ( - GrB_Mode mode // blocking or non-blocking mode, no GPU + int mode // blocking or non-blocking mode, no GPU (GrB_Mode) ) ; GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc ( - GrB_Mode mode, // blocking or non-blocking mode, - // with or without GPU + int mode, // blocking or non-blocking mode (GrB_Mode) // pointers to memory management functions void * (* user_malloc_function ) (size_t), void * (* user_calloc_function ) (size_t, size_t), @@ -2679,11 +2680,6 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -GrB_Info GrB_Descriptor_free // free a descriptor -( - GrB_Descriptor *descriptor // handle of descriptor to free -) ; - //============================================================================== // helper macros for polymorphic functions //============================================================================== @@ -2740,6 +2736,23 @@ GrB_Info GrB_Descriptor_free // free a descriptor const void * : GB_CONCAT ( prefix, _, func, _UDT ), \ void * : GB_CONCAT ( prefix, _, func, _UDT ) +// declare 14 methods, one for each C type and the user type (void *) +#define GB_DECLARE_14(prefix,user_type) \ +GB_DECLARE (prefix, _BOOL , bool ) \ +GB_DECLARE (prefix, _INT8 , int8_t ) \ +GB_DECLARE (prefix, _INT16 , int16_t ) \ +GB_DECLARE (prefix, _INT32 , int32_t ) \ +GB_DECLARE (prefix, _INT64 , int64_t ) \ +GB_DECLARE (prefix, _UINT8 , uint8_t ) \ +GB_DECLARE (prefix, _UINT16, uint16_t ) \ +GB_DECLARE (prefix, _UINT32, uint32_t ) \ +GB_DECLARE (prefix, _UINT64, uint64_t ) \ +GB_DECLARE (prefix, _FP32 , float ) \ +GB_DECLARE (prefix, _FP64 , double ) \ +GB_DECLARE (GxB_ , _FC32 , GxB_FC32_t) \ +GB_DECLARE (GxB_ , _FC64 , GxB_FC64_t) \ +GB_DECLARE (prefix, _UDT , user_type ) + //============================================================================== // GrB_Type: data types //============================================================================== @@ -2790,11 +2803,6 @@ GrB_Info GxB_Type_from_name // return the built-in GrB_Type from a name const char *type_name // array of size at least GxB_MAX_NAME_LEN ) ; -GrB_Info GrB_Type_free // free a user-defined type -( - GrB_Type *type // handle of user-defined type to free -) ; - //============================================================================== // GrB_UnaryOp: unary operators //============================================================================== @@ -2819,11 +2827,6 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -GrB_Info GrB_UnaryOp_free // free a user-created unary operator -( - GrB_UnaryOp *unaryop // handle of unary operator to free -) ; - //============================================================================== // GrB_BinaryOp: binary operators //============================================================================== @@ -2850,11 +2853,6 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -GrB_Info GrB_BinaryOp_free // free a user-created binary operator -( - GrB_BinaryOp *binaryop // handle of binary operator to free -) ; - //============================================================================== // GxB_IndexBinaryOp: index binary operators //============================================================================== @@ -2872,11 +2870,6 @@ GrB_Info GxB_IndexBinaryOp_new const char *idxbinop_defn // definition of the user function ) ; -GrB_Info GxB_IndexBinaryOp_free // free a user-created index binary operator -( - GxB_IndexBinaryOp *op // handle of index binary operator to free -) ; - // GxB_BinaryOp_new_IndexOp: create a new binary op from an index binary op GrB_Info GxB_BinaryOp_new_IndexOp ( @@ -2911,7251 +2904,3125 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp -( - GrB_IndexUnaryOp *op // handle of IndexUnary to free -) ; +//============================================================================== +// GrB_Monoid: an associate & commutative binary op +//============================================================================== + +// A GrB_Monoid consists of a GrB_BinaryOp and an identity value. The op must +// be associative and commutative (but this cannot be checked). It cannot be +// based on a GxB_IndexBinaryOp. +// +// GrB_Info GrB_Monoid_new_TYPE // create a monoid +// ( +// GrB_Monoid *monoid, // handle of monoid to create +// GrB_BinaryOp op, // binary operator of the monoid +// identity // identity value of the monoid +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Monoid_new ## suffix /* create a new monoid */ \ +( \ + GrB_Monoid *monoid, /* handle of monoid to create */ \ + GrB_BinaryOp op, /* binary operator of the monoid */ \ + type identity /* identity value of the monoid */ \ +) ; +GB_DECLARE_14 (GrB_, void *) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_Monoid_new(monoid,op,identity) \ + _Generic ((identity), GB_CASES (GrB, Monoid_new)) (monoid, op, identity) +#endif + +// GxB_Monoid_terminal_new is identical to GrB_Monoid_new, except that a +// terminal value can be specified. The terminal may be NULL, which indicates +// no terminal value (and in this case, it is identical to GrB_Monoid_new). +// The terminal value, if not NULL, must have the same type as the identity. +// +// GrB_Info GxB_Monoid_terminal_new_TYPE // create a terminal monoid +// ( +// GrB_Monoid *monoid, // handle of monoid to create +// GrB_BinaryOp op, // binary operator of the monoid +// identity, // identity value of the monoid +// terminal // terminal value of the monoid +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Monoid_terminal_new ## suffix /* create a new termainal monoid */\ +( \ + GrB_Monoid *monoid, /* handle of monoid to create */ \ + GrB_BinaryOp op, /* binary operator of the monoid */ \ + type identity, /* identity value of the monoid */ \ + type terminal /* terminal value of the monoid */ \ +) ; +GB_DECLARE_14 (GxB_, void *) + +#if GxB_STDC_VERSION >= 201112L +#define GxB_Monoid_terminal_new(monoid,op,identity,terminal) \ + _Generic ((identity), GB_CASES (GxB, Monoid_terminal_new)) \ + (monoid, op, identity, terminal) +#endif //============================================================================== -// GrB_Monoid +// GrB_Semiring //============================================================================== -// The GrB_BinaryOp must be associative and commutative (but this cannot be -// checked). It cannot be based on a GxB_IndexBinaryOp. +// The multiply op can be any GrB_BinaryOp, including those based on a +// GxB_IndexBinaryOp. -GrB_Info GrB_Monoid_new_BOOL // create a new boolean monoid +GrB_Info GrB_Semiring_new // create a semiring ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - bool identity // identity value of the monoid + GrB_Semiring *semiring, // handle of semiring to create + GrB_Monoid add, // add monoid of the semiring + GrB_BinaryOp multiply // multiply operator of the semiring ) ; -GrB_Info GrB_Monoid_new_INT8 // create a new int8 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int8_t identity // identity value of the monoid -) ; +//============================================================================== +// GrB_Scalar: a GraphBLAS scalar +//============================================================================== -GrB_Info GrB_Monoid_new_UINT8 // create a new uint8 monoid +// These methods create, free, copy, and clear a GrB_Scalar. The nvals, +// and type methods return basic information about a GrB_Scalar. + +GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint8_t identity // identity value of the monoid + GrB_Scalar *s, // handle of GrB_Scalar to create + GrB_Type type // type of GrB_Scalar to create ) ; -GrB_Info GrB_Monoid_new_INT16 // create a new int16 monoid +GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int16_t identity // identity value of the monoid + GrB_Scalar *s, // handle of output GrB_Scalar to create + const GrB_Scalar t // input GrB_Scalar to copy ) ; -GrB_Info GrB_Monoid_new_UINT16 // create a new uint16 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint16_t identity // identity value of the monoid +GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry +( // type remains unchanged. + GrB_Scalar s // GrB_Scalar to clear ) ; -GrB_Info GrB_Monoid_new_INT32 // create a new int32 monoid +GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int32_t identity // identity value of the monoid + GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_UINT32 // create a new uint32 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint32_t identity // identity value of the monoid -) ; - -GrB_Info GrB_Monoid_new_INT64 // create a new int64 monoid +GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int64_t identity // identity value of the monoid + size_t *size, // # of bytes used by the scalar s + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_UINT64 // create a new uint64 monoid +GrB_Info GxB_Scalar_type // get the type of a GrB_Scalar ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint64_t identity // identity value of the monoid + GrB_Type *type, // returns the type of the GrB_Scalar + const GrB_Scalar s // GrB_Scalar to query ) ; -GrB_Info GrB_Monoid_new_FP32 // create a new float monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - float identity // identity value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Scalar_setElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Monoid_new_FP64 // create a new double monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - double identity // identity value of the monoid -) ; +// Set a single GrB_Scalar s, from a user scalar x: s = x, typecasting from the +// type of x to the type of w as needed. +// +// GrB_Info GrB_Scalar_setElement_TYPE // s = x +// ( +// GrB_Scalar s, // GrB_Scalar to modify +// x // user scalar to assign to s +// ) ; -GrB_Info GxB_Monoid_new_FC32 // create a new float complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC32_t identity // identity value of the monoid +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Scalar_setElement ## suffix /* s = x */ \ +( \ + GrB_Scalar s, /* GrB_Scalar to modify */ \ + type x /* user scalar to assign to s */ \ ) ; +GB_DECLARE_14 (GrB_, void *) -GrB_Info GxB_Monoid_new_FC64 // create a new double complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC64_t identity // identity value of the monoid -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Scalar_setElement(s,x) \ + _Generic ((x), GB_CASES (GrB, Scalar_setElement)) (s, x) +#endif -GrB_Info GrB_Monoid_new_UDT // create a monoid with a user-defined type -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - void *identity // identity value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Scalar_extractElement +//------------------------------------------------------------------------------ -// Type-generic method for creating a new monoid: +// Extract a single entry from a GrB_Scalar, x = s, typecasting from the type +// of s to the type of x as needed. +// +// GrB_Info GrB_Scalar_extractElement_TYPE // x = s +// ( +// *x, // user scalar extracted +// const GrB_Scalar s // GrB_Scalar to extract an entry from +// ) ; -/* -GrB_Info GrB_Monoid_new // create a monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity // identity value of the monoid +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Scalar_extractElement ## suffix /* x = s */ \ +( \ + type *x, /* user scalar extracted */ \ + const GrB_Scalar s /* GrB_Scalar to extract an entry from */ \ ) ; -*/ +GB_DECLARE_14 (GrB_, void) #if GxB_STDC_VERSION >= 201112L -#define GrB_Monoid_new(monoid,op,identity) \ - _Generic \ - ( \ - (identity), \ - GB_CASES (GrB, Monoid_new) \ - ) \ - (monoid, op, identity) +#define GrB_Scalar_extractElement(x,s) \ + _Generic ((x), GB_PCASES (GrB, Scalar_extractElement)) (x, s) #endif -// GxB_Monoid_terminal_new is identical to GrB_Monoid_new, except that a -// terminal value can be specified. The terminal may be NULL, which indicates -// no terminal value (and in this case, it is identical to GrB_Monoid_new). -// The terminal value, if not NULL, must have the same type as the identity. +//============================================================================== +// GrB_Vector: a GraphBLAS vector +//============================================================================== -GrB_Info GxB_Monoid_terminal_new_BOOL // create a new boolean monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - bool identity, // identity value of the monoid - bool terminal // terminal value of the monoid -) ; +// These methods create, free, copy, and clear a vector. The size, nvals, +// and type methods return basic information about a vector. -GrB_Info GxB_Monoid_terminal_new_INT8 // create a new int8 monoid +GrB_Info GrB_Vector_new // create a new vector with no entries ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int8_t identity, // identity value of the monoid - int8_t terminal // terminal value of the monoid + GrB_Vector *v, // handle of vector to create + GrB_Type type, // type of vector to create + GrB_Index n // vector dimension is n-by-1 + // (n must be <= GrB_INDEX_MAX+1) ) ; -GrB_Info GxB_Monoid_terminal_new_UINT8 // create a new uint8 monoid +GrB_Info GrB_Vector_dup // make an exact copy of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint8_t identity, // identity value of the monoid - uint8_t terminal // terminal value of the monoid + GrB_Vector *w, // handle of output vector to create + const GrB_Vector u // input vector to copy ) ; -GrB_Info GxB_Monoid_terminal_new_INT16 // create a new int16 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int16_t identity, // identity value of the monoid - int16_t terminal // terminal value of the monoid +GrB_Info GrB_Vector_clear // clear a vector of all entries; +( // type and dimension remain unchanged. + GrB_Vector v // vector to clear ) ; -GrB_Info GxB_Monoid_terminal_new_UINT16 // create a new uint16 monoid +GrB_Info GrB_Vector_size // get the dimension of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint16_t identity, // identity value of the monoid - uint16_t terminal // terminal value of the monoid + GrB_Index *n, // vector dimension is n-by-1 + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_INT32 // create a new int32 monoid +GrB_Info GrB_Vector_nvals // get the number of entries in a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int32_t identity, // identity value of the monoid - int32_t terminal // terminal value of the monoid + GrB_Index *nvals, // vector has nvals entries + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_UINT32 // create a new uint32 monoid +GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint32_t identity, // identity value of the monoid - uint32_t terminal // terminal value of the monoid + size_t *size, // # of bytes used by the vector v + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_INT64 // create a new int64 monoid +GrB_Info GxB_Vector_type // get the type of a vector ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - int64_t identity, // identity value of the monoid - int64_t terminal // terminal value of the monoid + GrB_Type *type, // returns the type of the vector + const GrB_Vector v // vector to query ) ; -GrB_Info GxB_Monoid_terminal_new_UINT64 // create a new uint64 monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - uint64_t identity, // identity value of the monoid - uint64_t terminal // terminal value of the monoid -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_build +//------------------------------------------------------------------------------ -GrB_Info GxB_Monoid_terminal_new_FP32 // create a new float monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - float identity, // identity value of the monoid - float terminal // terminal value of the monoid +// GrB_Vector_build: w = sparse (I,1,X) in MATLAB notation, but using any +// associative operator to assemble duplicate entries. The dup operator cannot +// be based on a GxB_IndexBinaryOp. + +// GrB_Info GrB_Vector_build_TYPE // build a vector from (I,X) tuples +// ( +// GrB_Vector w, // vector to build +// const GrB_Index *I, // array of row indices of tuples +// const *X, // array of values of tuples +// GrB_Index nvals, // number of tuples +// const GrB_BinaryOp dup // binary function to assemble duplicates +// ) ; +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_build ## suffix /* build a vector from tuples */ \ +( \ + GrB_Vector w, /* vector to build */ \ + const GrB_Index *I_, /* array of row indices of tuples */ \ + const type *X, /* array of values of tuples */ \ + GrB_Index nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary function to assemble duplicates */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Vector_build_Vector // build a vector from (I,X) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc ) ; -GrB_Info GxB_Monoid_terminal_new_FP64 // create a new double monoid +GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - double identity, // identity value of the monoid - double terminal // terminal value of the monoid + GrB_Vector w, // vector to build + const GrB_Index *I_, // array of row indices of tuples + const GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples ) ; -GrB_Info GxB_Monoid_terminal_new_FC32 // create a new float complex monoid +GrB_Info GxB_Vector_build_Scalar_Vector // build a vector from (I,s) tuples ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC32_t identity, // identity value of the monoid - GxB_FC32_t terminal // terminal value of the monoid + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc ) ; -GrB_Info GxB_Monoid_terminal_new_FC64 // create a new double complex monoid -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - GxB_FC64_t identity, // identity value of the monoid - GxB_FC64_t terminal // terminal value of the monoid -) ; +// GrB_Vector_build is a polymorphic method that allows access to all +// 17 Vector_build methods. -GrB_Info GxB_Monoid_terminal_new_UDT // create a monoid with a user type -( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - void *identity, // identity value of the monoid - void *terminal // terminal value of the monoid -) ; +// GrB_Vector_build_TYPE (w, I, X, nvals, dup) +// GxB_Vector_build_Scalar (w, I, s, nvals, dup) +// GxB_Vector_build_Vector (w, I, X, dup, desc), where I,X are GrB_Vector +// GxB_Vector_build_Scalar_Vector (w, I, s, desc ), where I is GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GB_VECTOR_BUILD_T(X) \ + _Generic ((X), \ + GB_PCASES (GrB, Vector_build), \ + default: GxB_Vector_build_Scalar) +#define GB_VECTOR_BUILD(w,I_,X,...) \ + _Generic ((I_), \ + GrB_Index * : GB_VECTOR_BUILD_T (X), \ + const GrB_Index * : GB_VECTOR_BUILD_T (X), \ + default: \ + _Generic ((X), \ + GrB_Vector : GxB_Vector_build_Vector, \ + default: GxB_Vector_build_Scalar_Vector)) +#define GrB_Vector_build(w,...) \ + GB_VECTOR_BUILD (w, __VA_ARGS__) \ + (w, __VA_ARGS__) +#endif -// Type-generic method for creating a new monoid with a terminal value: +//------------------------------------------------------------------------------ +// GrB_Vector_setElement +//------------------------------------------------------------------------------ -/* -GrB_Info GxB_Monoid_terminal_new // create a monoid +// Set a single scalar in a vector, w(i) = x, typecasting from the type of x to +// the type of w as needed. +// +// GrB_Info GrB_Vector_setElement_TYPE // w(i) = x +// ( +// GrB_Vector w, // vector to modify +// x, // scalar to assign to w(i) +// GrB_Index i // row index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_setElement ## suffix /* w(i) = x */ \ +( \ + GrB_Vector w, /* vector to modify */ \ + type x, /* scalar to assign to w(i) */ \ + GrB_Index i /* row index */ \ +) ; +GB_DECLARE_14 (GrB_, void *) + +GrB_Info GrB_Vector_setElement_Scalar // w(i) = x ( - GrB_Monoid *monoid, // handle of monoid to create - GrB_BinaryOp op, // binary operator of the monoid - identity, // identity value of the monoid - terminal // terminal value of the monoid + GrB_Vector w, // vector to modify + GrB_Scalar x, // scalar to assign to w(i) + GrB_Index i // row index ) ; -*/ #if GxB_STDC_VERSION >= 201112L -#define GxB_Monoid_terminal_new(monoid,op,identity,terminal) \ - _Generic \ - ( \ - (identity), \ - GB_CASES (GxB, Monoid_terminal_new) \ - ) \ - (monoid, op, identity, terminal) +#define GrB_Vector_setElement(w,x,i) \ + _Generic ((x), \ + GB_CASES (GrB, Vector_setElement), \ + default: GrB_Vector_setElement_Scalar) \ + (w, x, i) #endif -GrB_Info GrB_Monoid_free // free a user-created monoid -( - GrB_Monoid *monoid // handle of monoid to free -) ; - -//============================================================================== -// GrB_Semiring -//============================================================================== - -// The multiply op can be any GrB_BinaryOp, including those based on a -// GxB_IndexBinaryOp. +//------------------------------------------------------------------------------ +// GrB_Vector_extractElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Semiring_new // create a semiring -( - GrB_Semiring *semiring, // handle of semiring to create - GrB_Monoid add, // add monoid of the semiring - GrB_BinaryOp multiply // multiply operator of the semiring -) ; +// Extract a single entry from a vector, x = v(i), typecasting from the type of +// v to the type of x as needed. +// +// GrB_Info GrB_Vector_extractElement_TYPE // x = v(i) +// ( +// *x, // scalar extracted +// const GrB_Vector v, // vector to extract an entry from +// GrB_Index i // row index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_extractElement ## suffix /* x = v(i) */ \ +( \ + type *x, /* scalar extracted */ \ + const GrB_Vector v, /* vector to extract an entry from */ \ + GrB_Index i /* row index */ \ +) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Semiring_free // free a user-created semiring +GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) ( - GrB_Semiring *semiring // handle of semiring to free + GrB_Scalar x, // scalar extracted + const GrB_Vector v, // vector to extract an entry from + GrB_Index i // row index ) ; -//============================================================================== -// GrB_Scalar: a GraphBLAS scalar -//============================================================================== +#if GxB_STDC_VERSION >= 201112L +#define GrB_Vector_extractElement(x,v,i) \ + _Generic ((x), \ + GB_PCASES (GrB, Vector_extractElement), \ + default: GrB_Vector_extractElement_Scalar) \ + (x, v, i) +#endif -// These methods create, free, copy, and clear a GrB_Scalar. The nvals, -// and type methods return basic information about a GrB_Scalar. +//------------------------------------------------------------------------------ +// GxB_Vector_isStoredElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entry -( - GrB_Scalar *s, // handle of GrB_Scalar to create - GrB_Type type // type of GrB_Scalar to create -) ; +// GxB_Vector_isStoredElement determines if v(i) is present in the structure +// of the vector v, as a stored element. It does not return the value. It +// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. -GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar +GrB_Info GxB_Vector_isStoredElement // determine if v(i) is a stored element ( - GrB_Scalar *s, // handle of output GrB_Scalar to create - const GrB_Scalar t // input GrB_Scalar to copy -) ; - -GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry -( // type remains unchanged. - GrB_Scalar s // GrB_Scalar to clear + const GrB_Vector v, // vector to check + GrB_Index i // row index ) ; -GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar -( - GrB_Index *nvals, // GrB_Scalar has nvals entries (0 or 1) - const GrB_Scalar s // GrB_Scalar to query -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_removeElement +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar -( - size_t *size, // # of bytes used by the scalar s - const GrB_Scalar s // GrB_Scalar to query -) ; +// GrB_Vector_removeElement (v,i) removes the element v(i) from the vector v. -GrB_Info GrB_Scalar_free // free a GrB_Scalar +GrB_Info GrB_Vector_removeElement ( - GrB_Scalar *s // handle of GrB_Scalar to free + GrB_Vector v, // vector to remove an element from + GrB_Index i // index ) ; //------------------------------------------------------------------------------ -// GrB_Scalar_setElement +// GrB_Vector_extractTuples //------------------------------------------------------------------------------ -// Set a single GrB_Scalar s, from a user scalar x: s = x, typecasting from the -// type of x to the type of w as needed. +// Extracts all tuples from a vector, like [I,~,X] = find (V) in MATLAB. If +// any parameter I and/or X is NULL, then that component is not extracted. For +// example, to extract just the row indices, pass I as non-NULL, and X as NULL. +// This is like [I,~,~] = find (V) in MATLAB notation. +// +// GrB_Info GrB_Vector_extractTuples_TYPE // [I,~,X] = find (V) +// ( +// GrB_Index *I, // array for returning row indices of tuples +// *X, // array for returning values of tuples +// GrB_Index *nvals, // I, X size on input; # tuples on output +// const GrB_Vector V // vector to extract tuples from +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_extractTuples ## suffix /* [I,~,X = find (V) */ \ +( \ + GrB_Index *I_, /* array for returning row indices of tuples */ \ + type *X, /* array for returning values of tuples */ \ + GrB_Index *nvals, /* I, X size on input; # tuples on output */ \ + const GrB_Vector V /* vector to extract tuples from */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Vector_extractTuples_Vector // [I,~,X] = find (V) +( + GrB_Vector I_vector, // row indices + GrB_Vector X_vector, // values + const GrB_Vector V, // vectors to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) ; + +// GrB_Vector_extractTuples is a polymorphic method that allow access to +// all of the *Vector_extractTuples* methods: +// GrB_Vector_extractTuples_TYPE (I, X, nvals, V) +// GxB_Vector_extractTuples_Vector (I, X, V, desc) where I,X are GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GrB_Vector_extractTuples(I_,X,arg3,arg4) \ + _Generic ((arg3), \ + GrB_Vector: GxB_Vector_extractTuples_Vector, \ + default: _Generic ((X), \ + GB_PCASES (GrB, Vector_extractTuples), \ + default: GxB_Vector_extractTuples_Vector)) \ + (I_, X, arg3, arg4) +#endif -GrB_Info GrB_Scalar_setElement_BOOL // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - bool x // user scalar to assign to s -) ; +//============================================================================== +// GrB_Matrix: a GraphBLAS matrix +//============================================================================== -GrB_Info GrB_Scalar_setElement_INT8 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - int8_t x // user scalar to assign to s -) ; +// These methods create, free, copy, and clear a matrix. The nrows, ncols, +// nvals, and type methods return basic information about a matrix. -GrB_Info GrB_Scalar_setElement_UINT8 // s = x +GrB_Info GrB_Matrix_new // create a new matrix with no entries ( - GrB_Scalar s, // GrB_Scalar to modify - uint8_t x // user scalar to assign to s + GrB_Matrix *A, // handle of matrix to create + GrB_Type type, // type of matrix to create + GrB_Index nrows, // matrix dimension is nrows-by-ncols + GrB_Index ncols // (nrows and ncols must be <= GrB_INDEX_MAX+1) ) ; -GrB_Info GrB_Scalar_setElement_INT16 // s = x +GrB_Info GrB_Matrix_dup // make an exact copy of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int16_t x // user scalar to assign to s + GrB_Matrix *C, // handle of output matrix to create + const GrB_Matrix A // input matrix to copy ) ; -GrB_Info GrB_Scalar_setElement_UINT16 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - uint16_t x // user scalar to assign to s +GrB_Info GrB_Matrix_clear // clear a matrix of all entries; +( // type and dimensions remain unchanged + GrB_Matrix A // matrix to clear ) ; -GrB_Info GrB_Scalar_setElement_INT32 // s = x +GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int32_t x // user scalar to assign to s + GrB_Index *nrows, // matrix has nrows rows + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_UINT32 // s = x +GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - uint32_t x // user scalar to assign to s + GrB_Index *ncols, // matrix has ncols columns + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_INT64 // s = x +GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - int64_t x // user scalar to assign to s + GrB_Index *nvals, // matrix has nvals entries + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_UINT64 // s = x +GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - uint64_t x // user scalar to assign to s + size_t *size, // # of bytes used by the matrix A + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_FP32 // s = x +GrB_Info GxB_Matrix_type // get the type of a matrix ( - GrB_Scalar s, // GrB_Scalar to modify - float x // user scalar to assign to s + GrB_Type *type, // returns the type of the matrix + const GrB_Matrix A // matrix to query ) ; -GrB_Info GrB_Scalar_setElement_FP64 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - double x // user scalar to assign to s -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_build +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_setElement_FC32 // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - GxB_FC32_t x // user scalar to assign to s +// GrB_Matrix_build: C = sparse (I,J,X) in MATLAB notation, but using any +// associative operator to assemble duplicate entries. The dup operator cannot +// be based on a GxB_IndexBinaryOp. + +// GrB_Info GrB_Matrix_build_TYPE // build a matrix from (I,J,X) tuples +// ( +// GrB_Matrix C, // matrix to build +// const GrB_Index *I, // array of row indices of tuples +// const GrB_Index *J, // array of column indices of tuples +// const *X, // array of values of tuples +// GrB_Index nvals, // number of tuples +// const GrB_BinaryOp dup // binary function to assemble duplicates +// ) ; +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_build ## suffix /* build a matrix from tuples */ \ +( \ + GrB_Matrix C, /* matrix to build */ \ + const GrB_Index *I_, /* array of row indices of tuples */ \ + const GrB_Index *J, /* array of column indices of tuples */ \ + const type *X, /* array of values of tuples */ \ + GrB_Index nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary function to assemble duplicates */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +GrB_Info GxB_Matrix_build_Vector // build a matrix from (I,J,X) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc ) ; -GrB_Info GxB_Scalar_setElement_FC64 // s = x +GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples ( - GrB_Scalar s, // GrB_Scalar to modify - GxB_FC64_t x // user scalar to assign to s + GrB_Matrix C, // matrix to build + const GrB_Index *I_, // array of row indices of tuples + const GrB_Index *J, // array of column indices of tuples + GrB_Scalar scalar, // value for all tuples + GrB_Index nvals // number of tuples ) ; -GrB_Info GrB_Scalar_setElement_UDT // s = x +GrB_Info GxB_Matrix_build_Scalar_Vector // build a matrix from (I,J,s) tuples ( - GrB_Scalar s, // GrB_Scalar to modify - void *x // user scalar to assign to s + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc ) ; -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Scalar_setElement // s = x -( - GrB_Scalar s, // GrB_Scalar to modify - x // user scalar to assign to s -) ; -*/ +// GrB_Matrix_build is a polymorphic method that allows access to all +// 17 Matrix_build methods. +// GrB_Matrix_build_TYPE (C, I, J, X, nvals, dup) +// GxB_Matrix_build_Scalar (C, I, J, s, nvals, dup) +// GxB_Matrix_build_Vector (C, I, J, X, dup, desc); I,J,X are GrB_Vector +// GxB_Matrix_build_Scalar_Vector (C, I, J, s, desc ), where I,J are GrB_Vector #if GxB_STDC_VERSION >= 201112L -#define GrB_Scalar_setElement(s,x) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Scalar_setElement) \ - ) \ - (s, x) +#define GB_MATRIX_BUILD_T(X) \ + _Generic ((X), \ + GB_PCASES (GrB, Matrix_build), \ + default: GxB_Matrix_build_Scalar) +#define GB_MATRIX_BUILD(C,I_,J,X,...) \ + _Generic ((I_), \ + GrB_Index * : GB_MATRIX_BUILD_T (X), \ + const GrB_Index * : GB_MATRIX_BUILD_T (X), \ + default: \ + _Generic ((X), \ + GrB_Vector : GxB_Matrix_build_Vector, \ + default: GxB_Matrix_build_Scalar_Vector)) +#define GrB_Matrix_build(C,...) \ + GB_MATRIX_BUILD (C, __VA_ARGS__) \ + (C, __VA_ARGS__) #endif //------------------------------------------------------------------------------ -// GrB_Scalar_extractElement +// GrB_Matrix_setElement //------------------------------------------------------------------------------ -// Extract a single entry from a GrB_Scalar, x = s, typecasting from the type -// of s to the type of x as needed. +// Set a single entry in a matrix, C(i,j) = x, typecasting from the type of x +// to the type of C, as needed. +// +// GrB_Info GrB_Matrix_setElement_TYPE // C (i,j) = x +// ( +// GrB_Matrix C, // matrix to modify +// x, // scalar to assign to C(i,j) +// GrB_Index i, // row index +// GrB_Index j // column index +// ) ; -GrB_Info GrB_Scalar_extractElement_BOOL // x = s +GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x ( - bool *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Matrix C, // matrix to modify + GrB_Scalar x, // scalar to assign to C(i,j) + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GrB_Scalar_extractElement_INT8 // x = s -( - int8_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_setElement ## suffix /* C(i,j) = x */ \ +( \ + GrB_Matrix C, /* matrix to modify */ \ + type x, /* scalar to assign to C(i,j) */ \ + GrB_Index i, /* row index */ \ + GrB_Index j /* column index */ \ ) ; +GB_DECLARE_14 (GrB_, void *) -GrB_Info GrB_Scalar_extractElement_UINT8 // x = s -( - uint8_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_setElement(C,x,i,j) \ + _Generic ((x), \ + GB_CASES (GrB, Matrix_setElement), \ + default: GrB_Matrix_setElement_Scalar) \ + (C, x, i, j) +#endif -GrB_Info GrB_Scalar_extractElement_INT16 // x = s -( - int16_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_extractElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_extractElement_UINT16 // x = s -( - uint16_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from +// Extract a single entry from a matrix, x = A(i,j), typecasting from the type +// of A to the type of x, as needed. +// +// GrB_Info GrB_Matrix_extractElement_TYPE // x = A(i,j) +// ( +// *x, // extracted scalar +// const GrB_Matrix A, // matrix to extract a scalar from +// GrB_Index i, // row index +// GrB_Index j // column index +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_extractElement ## suffix /* x = A(i,j) */ \ +( \ + type *x, /* extracted scalar */ \ + const GrB_Matrix A, /* matrix to extract a scalar from */ \ + GrB_Index i, /* row index */ \ + GrB_Index j /* column index */ \ ) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Scalar_extractElement_INT32 // x = s +GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) ( - int32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; - -GrB_Info GrB_Scalar_extractElement_UINT32 // x = s -( - uint32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Scalar x, // extracted scalar + const GrB_Matrix A, // matrix to extract a scalar from + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GrB_Scalar_extractElement_INT64 // x = s -( - int64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_extractElement(x,A,i,j) \ + _Generic ((x), \ + GB_PCASES (GrB, Matrix_extractElement), \ + default: GrB_Matrix_extractElement_Scalar) \ + (x, A, i, j) +#endif -GrB_Info GrB_Scalar_extractElement_UINT64 // x = s -( - uint64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GxB_Matrix_isStoredElement +//------------------------------------------------------------------------------ -GrB_Info GrB_Scalar_extractElement_FP32 // x = s -( - float *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +// GxB_Matrix_isStoredElement determines if A(i,j) is present in the structure +// of the matrix A, as a stored element. It does not return the value. It +// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. -GrB_Info GrB_Scalar_extractElement_FP64 // x = s +GrB_Info GxB_Matrix_isStoredElement // determine if A(i,j) is a stored element ( - double *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + const GrB_Matrix A, // matrix to check + GrB_Index i, // row index + GrB_Index j // column index ) ; -GrB_Info GxB_Scalar_extractElement_FC32 // x = s -( - GxB_FC32_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +//------------------------------------------------------------------------------ +// GrB_Matrix_removeElement +//------------------------------------------------------------------------------ -GrB_Info GxB_Scalar_extractElement_FC64 // x = s -( - GxB_FC64_t *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from -) ; +// GrB_Matrix_removeElement (A,i,j) removes the entry A(i,j) from the matrix A. -GrB_Info GrB_Scalar_extractElement_UDT // x = s +GrB_Info GrB_Matrix_removeElement ( - void *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Matrix C, // matrix to remove entry from + GrB_Index i, // row index + GrB_Index j // column index ) ; -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. +//------------------------------------------------------------------------------ +// GrB_Matrix_extractTuples +//------------------------------------------------------------------------------ -/* +// Extracts all tuples from a matrix, like [I,J,X] = find (A) in MATLAB. If +// any parameter I, J and/or X is NULL, then that component is not extracted. +// For example, to extract just the row and col indices, pass I and J as +// non-NULL, and X as NULL. This is like [I,J,~] = find (A). +// +// GrB_Info GrB_Matrix_extractTuples_TYPE // [I,J,X] = find (A) +// ( +// uint64_t *I, // array for returning row indices of tuples +// uint64_t *J, // array for returning col indices of tuples +// *X, // array for returning values of tuples +// GrB_Index *nvals, // I,J,X size on input; # tuples on output +// const GrB_Matrix A // matrix to extract tuples from +// ) ; + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_extractTuples ## suffix /* [I,J,X = find (A) */ \ +( \ + GrB_Index *I_, /* array for returning row indices of tuples */ \ + GrB_Index *J, /* array for returning col indices of tuples */ \ + type *X, /* array for returning values of tuples */ \ + GrB_Index *nvals, /* I,J,X size on input; # tuples on output */ \ + const GrB_Matrix A /* matrix to extract tuples from */ \ +) ; +GB_DECLARE_14 (GrB_, void) -GrB_Info GrB_Scalar_extractElement // x = s +GrB_Info GxB_Matrix_extractTuples_Vector // [I,J,X] = find (A) ( - *x, // user scalar extracted - const GrB_Scalar s // GrB_Scalar to extract an entry from + GrB_Vector I_vector, // row indices + GrB_Vector J_vector, // col indices + GrB_Vector X_vector, // values + const GrB_Matrix A, // matrix to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion ) ; -*/ - +// GrB_Matrix_extractTuples is a polymorphic method that allow access to +// all of the *Matrix_extractTuples* methods: +// GrB_Matrix_extractTuples_TYPE (I, J, X, nvals, A) +// GxB_Matrix_extractTuples_Vector (I, J, X, A, desc) where I,J,X are GrB_Vector #if GxB_STDC_VERSION >= 201112L -#define GrB_Scalar_extractElement(x,s) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Scalar_extractElement) \ - ) \ - (x, s) +#define GrB_Matrix_extractTuples(I_,J,X,arg4,arg5) \ + _Generic ((arg4), \ + GrB_Matrix: GxB_Matrix_extractTuples_Vector, \ + default: _Generic ((X), \ + GB_PCASES (GrB, Matrix_extractTuples), \ + default: GxB_Matrix_extractTuples_Vector)) \ + (I_, J, X, arg4, arg5) #endif -//============================================================================== -// GrB_Vector: a GraphBLAS vector -//============================================================================== - -// These methods create, free, copy, and clear a vector. The size, nvals, -// and type methods return basic information about a vector. +//------------------------------------------------------------------------------ +// GxB_Matrix_concat and GxB_Matrix_split +//------------------------------------------------------------------------------ -GrB_Info GrB_Vector_new // create a new vector with no entries -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n // vector dimension is n-by-1 - // (n must be <= GrB_INDEX_MAX+1) -) ; +// GxB_Matrix_concat concatenates an array of matrices (Tiles) into a single +// GrB_Matrix C. -GrB_Info GrB_Vector_dup // make an exact copy of a vector -( - GrB_Vector *w, // handle of output vector to create - const GrB_Vector u // input vector to copy -) ; +// Tiles is an m-by-n dense array of matrices held in row-major format, where +// Tiles [i*n+j] is the (i,j)th tile, and where m > 0 and n > 0 must hold. Let +// A{i,j} denote the (i,j)th tile. The matrix C is constructed by +// concatenating these tiles together, as: -GrB_Info GrB_Vector_clear // clear a vector of all entries; -( // type and dimension remain unchanged. - GrB_Vector v // vector to clear -) ; +// C = [ A{0,0} A{0,1} A{0,2} ... A{0,n-1} +// A{1,0} A{1,1} A{1,2} ... A{1,n-1} +// ... +// A{m-1,0} A{m-1,1} A{m-1,2} ... A{m-1,n-1} ] -GrB_Info GrB_Vector_size // get the dimension of a vector -( - GrB_Index *n, // vector dimension is n-by-1 - const GrB_Vector v // vector to query -) ; +// On input, the matrix C must already exist. Any existing entries in C are +// discarded. C must have dimensions nrows by ncols where nrows is the sum of +// # of rows in the matrices A{i,0} for all i, and ncols is the sum of the # of +// columns in the matrices A{0,j} for all j. All matrices in any given tile +// row i must have the same number of rows (that is, nrows(A{i,0}) must equal +// nrows(A{i,j}) for all j), and all matrices in any given tile column j must +// have the same number of columns (that is, ncols(A{0,j}) must equal +// ncols(A{i,j}) for all i). -GrB_Info GrB_Vector_nvals // get the number of entries in a vector -( - GrB_Index *nvals, // vector has nvals entries - const GrB_Vector v // vector to query -) ; +// The type of C is unchanged, and all matrices A{i,j} are typecasted into the +// type of C. Any settings made to C by GrB_set (format by row +// or by column, bitmap switch, hyper switch, and sparsity control) are +// unchanged. -GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector +GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices ( - size_t *size, // # of bytes used by the vector v - const GrB_Vector v // vector to query + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Descriptor desc // unused, except threading control ) ; -GrB_Info GxB_Vector_iso // return iso status of a vector -( - bool *iso, // true if the vector is iso-valued - const GrB_Vector v // vector to query -) ; +// GxB_Matrix_split does the opposite of GxB_Matrix_concat. It splits a single +// input matrix A into a 2D array of tiles. On input, the Tiles array must be +// a non-NULL pointer to a previously allocated array of size at least m*n +// where both m and n must be > 0. The Tiles_nrows array has size m, and +// Tiles_ncols has size n. The (i,j)th tile has dimension +// Tiles_nrows[i]-by-Tiles_ncols[j]. The sum of Tiles_nrows [0:m-1] must equal +// the number of rows of A, and the sum of Tiles_ncols [0:n-1] must equal the +// number of columns of A. The type of each tile is the same as the type of A; +// no typecasting is done. -GrB_Info GrB_Vector_free // free a vector +GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices ( - GrB_Vector *v // handle of vector to free + GrB_Matrix *Tiles, // 2D row-major array of size m-by-n + const GrB_Index m, + const GrB_Index n, + const GrB_Index *Tile_nrows, // array of size m + const GrB_Index *Tile_ncols, // array of size n + const GrB_Matrix A, // input matrix to split + const GrB_Descriptor desc // unused, except threading control ) ; //------------------------------------------------------------------------------ -// GrB_Vector_build +// GxB_Matrix_diag, GxB_Vector_diag, GrB_Matrix_diag //------------------------------------------------------------------------------ -// GrB_Vector_build: w = sparse (I,1,X), but using any -// associative operator to assemble duplicate entries. - -// The dup operator cannot be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Vector_build_BOOL // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const bool *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Matrix_diag constructs a new matrix from a vector. Let n be the length +// of the v vector, from GrB_Vector_size (&n, v). If k = 0, then C is an +// n-by-n diagonal matrix with the entries from v along the main diagonal of C, +// with C(i,i) = v(i). If k is nonzero, C is square with dimension n+abs(k). +// If k is positive, it denotes diagonals above the main diagonal, with +// C(i,i+k) = v(i). If k is negative, it denotes diagonals below the main +// diagonal of C, with C(i-k,i) = v(i). C is constructed with the same type +// as v. -GrB_Info GrB_Vector_build_INT8 // build a vector from (I,X) tuples +GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix *C, // output matrix + const GrB_Vector v, // input vector + int64_t k ) ; -GrB_Info GrB_Vector_build_UINT8 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Matrix_diag is like GxB_Matrix_diag (&C, v, k, NULL), except that C must +// already exist on input, of the correct size. Any existing entries in C are +// discarded. The type of C is preserved, so that if the type of C and v +// differ, the entries are typecasted into the type of C. Any settings made to +// C by GrB_set (format by row or by column, bitmap switch, hyper +// switch, and sparsity control) are unchanged. -GrB_Info GrB_Vector_build_INT16 // build a vector from (I,X) tuples +GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // output matrix + const GrB_Vector v, // input vector + int64_t k, + const GrB_Descriptor desc // to specify # of threads ) ; -GrB_Info GrB_Vector_build_UINT16 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GxB_Vector_diag extracts a vector v from an input matrix A, which may be +// rectangular. If k = 0, the main diagonal of A is extracted; k > 0 denotes +// diagonals above the main diagonal of A, and k < 0 denotes diagonals below +// the main diagonal of A. Let A have dimension m-by-n. If k is in the range +// 0 to n-1, then v has length min(m,n-k). If k is negative and in the range +// -1 to -m+1, then v has length min(m+k,n). If k is outside these ranges, +// v has length 0 (this is not an error). -GrB_Info GrB_Vector_build_INT32 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// v must already exist on input, of the correct length; that is +// GrB_Vector_size (&len,v) must return len = 0 if k >= n or k <= -m, len = +// min(m,n-k) if k is in the range 0 to n-1, and len = min(m+k,n) if k is in +// the range -1 to -m+1. Any existing entries in v are discarded. The type of +// v is preserved, so that if the type of A and v differ, the entries are +// typecasted into the type of v. Any settings made to v by +// GrB_set (bitmap switch and sparsity control) are unchanged. -GrB_Info GrB_Vector_build_UINT32 // build a vector from (I,X) tuples +GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector v, // output vector + const GrB_Matrix A, // input matrix + int64_t k, + const GrB_Descriptor desc // unused, except threading control ) ; -GrB_Info GrB_Vector_build_INT64 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const int64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//============================================================================== +// GxB_Context: for managing computational resources +//============================================================================== -GrB_Info GrB_Vector_build_UINT64 // build a vector from (I,X) tuples +GrB_Info GxB_Context_new // create a new Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const uint64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context *Context // handle of Context to create ) ; -GrB_Info GrB_Vector_build_FP32 // build a vector from (I,X) tuples +GrB_Info GxB_Context_engage // engage a Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const float *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context Context // Context to engage ) ; -GrB_Info GrB_Vector_build_FP64 // build a vector from (I,X) tuples +GrB_Info GxB_Context_disengage // disengage a Context ( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const double *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GxB_Context Context // Context to disengage ) ; -GrB_Info GxB_Vector_build_FC32 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const GxB_FC32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//============================================================================== +// GrB_get: get a scalar, string, enum, size, or void * from an object. +//============================================================================== -GrB_Info GxB_Vector_build_FC64 // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const GxB_FC64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// GrB_Info GrB_get +// ( +// Object object, // GraphBLAS object to query +// result, // GrB_Scalar, char *, int32_t *, size_t *, void * +// int field // what to query +// ) ; +// +// GrB_Info GrB_get // a SuiteSparse:GraphBLAS extension +// ( +// void *blob, // GraphBLAS serialized blob +// result, // GrB_Scalar, char *, int32_t *, size_t *, void * +// int field, // what to query +// size_t blobsize // size of the blob +// ) ; -GrB_Info GrB_Vector_build_UDT // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const void *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_get(object,value,...) \ + _Generic ((object), \ + GrB_Scalar : \ + _Generic ((value), \ + GrB_Scalar : GrB_Scalar_get_Scalar , \ + char * : GrB_Scalar_get_String , \ + int32_t * : GrB_Scalar_get_INT32 , \ + size_t * : GrB_Scalar_get_SIZE , \ + void * : GrB_Scalar_get_VOID ) , \ + GrB_Vector : \ + _Generic ((value), \ + GrB_Scalar : GrB_Vector_get_Scalar , \ + char * : GrB_Vector_get_String , \ + int32_t * : GrB_Vector_get_INT32 , \ + size_t * : GrB_Vector_get_SIZE , \ + void * : GrB_Vector_get_VOID ) , \ + GrB_Matrix : \ + _Generic ((value), \ + GrB_Scalar : GrB_Matrix_get_Scalar , \ + char * : GrB_Matrix_get_String , \ + int32_t * : GrB_Matrix_get_INT32 , \ + size_t * : GrB_Matrix_get_SIZE , \ + void * : GrB_Matrix_get_VOID ) , \ + GrB_UnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_UnaryOp_get_Scalar , \ + char * : GrB_UnaryOp_get_String , \ + int32_t * : GrB_UnaryOp_get_INT32 , \ + size_t * : GrB_UnaryOp_get_SIZE , \ + void * : GrB_UnaryOp_get_VOID ) , \ + GrB_IndexUnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_IndexUnaryOp_get_Scalar , \ + char * : GrB_IndexUnaryOp_get_String , \ + int32_t * : GrB_IndexUnaryOp_get_INT32 , \ + size_t * : GrB_IndexUnaryOp_get_SIZE , \ + void * : GrB_IndexUnaryOp_get_VOID ) , \ + GrB_BinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_BinaryOp_get_Scalar , \ + char * : GrB_BinaryOp_get_String , \ + int32_t * : GrB_BinaryOp_get_INT32 , \ + size_t * : GrB_BinaryOp_get_SIZE , \ + void * : GrB_BinaryOp_get_VOID ) , \ + GxB_IndexBinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ + char * : GxB_IndexBinaryOp_get_String , \ + int32_t * : GxB_IndexBinaryOp_get_INT32 , \ + size_t * : GxB_IndexBinaryOp_get_SIZE , \ + void * : GxB_IndexBinaryOp_get_VOID ) , \ + GrB_Monoid : \ + _Generic ((value), \ + GrB_Scalar : GrB_Monoid_get_Scalar , \ + char * : GrB_Monoid_get_String , \ + int32_t * : GrB_Monoid_get_INT32 , \ + size_t * : GrB_Monoid_get_SIZE , \ + void * : GrB_Monoid_get_VOID ) , \ + GrB_Semiring : \ + _Generic ((value), \ + GrB_Scalar : GrB_Semiring_get_Scalar , \ + char * : GrB_Semiring_get_String , \ + int32_t * : GrB_Semiring_get_INT32 , \ + size_t * : GrB_Semiring_get_SIZE , \ + void * : GrB_Semiring_get_VOID ) , \ + GrB_Type : \ + _Generic ((value), \ + GrB_Scalar : GrB_Type_get_Scalar , \ + char * : GrB_Type_get_String , \ + int32_t * : GrB_Type_get_INT32 , \ + size_t * : GrB_Type_get_SIZE , \ + void * : GrB_Type_get_VOID ) , \ + GrB_Descriptor : \ + _Generic ((value), \ + GrB_Scalar : GrB_Descriptor_get_Scalar , \ + char * : GrB_Descriptor_get_String , \ + int32_t * : GrB_Descriptor_get_INT32 , \ + size_t * : GrB_Descriptor_get_SIZE , \ + void * : GrB_Descriptor_get_VOID ) , \ + GrB_Global : \ + _Generic ((value), \ + GrB_Scalar : GrB_Global_get_Scalar , \ + char * : GrB_Global_get_String , \ + int32_t * : GrB_Global_get_INT32 , \ + size_t * : GrB_Global_get_SIZE , \ + void * : GrB_Global_get_VOID ) , \ + GxB_Context : \ + _Generic ((value), \ + GrB_Scalar : GxB_Context_get_Scalar , \ + char * : GxB_Context_get_String , \ + int32_t * : GxB_Context_get_INT , \ + size_t * : GxB_Context_get_SIZE , \ + void * : GxB_Context_get_VOID ) , \ + const void *: \ + _Generic ((value), \ + GrB_Scalar : GxB_Serialized_get_Scalar , \ + char * : GxB_Serialized_get_String , \ + int32_t * : GxB_Serialized_get_INT32 , \ + size_t * : GxB_Serialized_get_SIZE , \ + void * : GxB_Serialized_get_VOID ) , \ + void *: \ + _Generic ((value), \ + GrB_Scalar : GxB_Serialized_get_Scalar , \ + char * : GxB_Serialized_get_String , \ + int32_t * : GxB_Serialized_get_INT32 , \ + size_t * : GxB_Serialized_get_SIZE , \ + void * : GxB_Serialized_get_VOID )) \ + (object, value, __VA_ARGS__) +#endif -GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _get_Scalar (Object object, GrB_Scalar, int) ; \ +GrB_Info Object ## _get_String (Object object, char * , int) ; \ +GrB_Info Object ## _get_INT32 (Object object, int32_t * , int) ; \ +GrB_Info Object ## _get_SIZE (Object object, size_t * , int) ; \ +GrB_Info Object ## _get_VOID (Object object, void * , int) ; +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_Global ) + +GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, int, size_t) ; +GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, int, size_t) ; +GrB_Info GxB_Serialized_get_String (const void *, char * , int, size_t) ; +GrB_Info GxB_Serialized_get_INT32 (const void *, int32_t * , int, size_t) ; +GrB_Info GxB_Serialized_get_SIZE (const void *, size_t * , int, size_t) ; +GrB_Info GxB_Serialized_get_VOID (const void *, void * , int, size_t) ; + +// Note that GxB_Context_get_INT has an irregular name. This is because it +// conflicts with the signature of the prior GxB_Context_get_INT32 method, +// which is now historical. +GrB_Info GxB_Context_get_Scalar (GxB_Context, GrB_Scalar, int) ; +GrB_Info GxB_Context_get_String (GxB_Context, char * , int) ; +GrB_Info GxB_Context_get_INT (GxB_Context, int32_t * , int) ; +GrB_Info GxB_Context_get_SIZE (GxB_Context, size_t * , int) ; +GrB_Info GxB_Context_get_VOID (GxB_Context, void * , int) ; -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. +//============================================================================== +// GrB_set: set a scalar, string, enum, size, or void * of an object +//============================================================================== -/* -GrB_Info GrB_Vector_build // build a vector from (I,X) tuples -( - GrB_Vector w, // vector to build - const GrB_Index *Ilist, // array of row indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -*/ +// GrB_Info GrB_set +// ( +// Object object, // GraphBLAS object to modify +// input, // GrB_Scalar, char *, int32_t: new value of field +// int field // what to modify +// ) ; +// +// GrB_Info GrB_set +// ( +// Object object, // GraphBLAS object to modify +// void *input, // new value of the field +// int field, // what to field modify +// size_t inputsize // size of the input +// ) ; #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_build(w,Ilist,X,nvals,dup) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Vector_build) \ - ) \ - (w, Ilist, ((const void *) (X)), nvals, dup) +#define GrB_set(object,value,...) \ + _Generic ((object), \ + GrB_Scalar : \ + _Generic ((value), \ + GrB_Scalar : GrB_Scalar_set_Scalar , \ + char * : GrB_Scalar_set_String , \ + int32_t : GrB_Scalar_set_INT32 , \ + void * : GrB_Scalar_set_VOID ) , \ + GrB_Vector : \ + _Generic ((value), \ + GrB_Scalar : GrB_Vector_set_Scalar , \ + char * : GrB_Vector_set_String , \ + int32_t : GrB_Vector_set_INT32 , \ + void * : GrB_Vector_set_VOID ) , \ + GrB_Matrix : \ + _Generic ((value), \ + GrB_Scalar : GrB_Matrix_set_Scalar , \ + char * : GrB_Matrix_set_String , \ + int32_t : GrB_Matrix_set_INT32 , \ + void * : GrB_Matrix_set_VOID ) , \ + GrB_UnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_UnaryOp_set_Scalar , \ + char * : GrB_UnaryOp_set_String , \ + int32_t : GrB_UnaryOp_set_INT32 , \ + void * : GrB_UnaryOp_set_VOID ) , \ + GrB_IndexUnaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_IndexUnaryOp_set_Scalar , \ + char * : GrB_IndexUnaryOp_set_String , \ + int32_t : GrB_IndexUnaryOp_set_INT32 , \ + void * : GrB_IndexUnaryOp_set_VOID ) , \ + GrB_BinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GrB_BinaryOp_set_Scalar , \ + char * : GrB_BinaryOp_set_String , \ + int32_t : GrB_BinaryOp_set_INT32 , \ + void * : GrB_BinaryOp_set_VOID ) , \ + GxB_IndexBinaryOp : \ + _Generic ((value), \ + GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ + char * : GxB_IndexBinaryOp_set_String , \ + int32_t : GxB_IndexBinaryOp_set_INT32 , \ + void * : GxB_IndexBinaryOp_set_VOID ) , \ + GrB_Monoid : \ + _Generic ((value), \ + GrB_Scalar : GrB_Monoid_set_Scalar , \ + char * : GrB_Monoid_set_String , \ + int32_t : GrB_Monoid_set_INT32 , \ + void * : GrB_Monoid_set_VOID ) , \ + GrB_Semiring : \ + _Generic ((value), \ + GrB_Scalar : GrB_Semiring_set_Scalar , \ + char * : GrB_Semiring_set_String , \ + int32_t : GrB_Semiring_set_INT32 , \ + void * : GrB_Semiring_set_VOID ) , \ + GrB_Type : \ + _Generic ((value), \ + GrB_Scalar : GrB_Type_set_Scalar , \ + char * : GrB_Type_set_String , \ + int32_t : GrB_Type_set_INT32 , \ + void * : GrB_Type_set_VOID ) , \ + GrB_Descriptor : \ + _Generic ((value), \ + GrB_Scalar : GrB_Descriptor_set_Scalar , \ + char * : GrB_Descriptor_set_String , \ + int32_t : GrB_Descriptor_set_INT32 , \ + void * : GrB_Descriptor_set_VOID ) , \ + GrB_Global : \ + _Generic ((value), \ + GrB_Scalar : GrB_Global_set_Scalar , \ + char * : GrB_Global_set_String , \ + int32_t : GrB_Global_set_INT32 , \ + void * : GrB_Global_set_VOID ) , \ + GxB_Context : \ + _Generic ((value), \ + GrB_Scalar : GxB_Context_set_Scalar , \ + char * : GxB_Context_set_String , \ + int32_t : GxB_Context_set_INT , \ + void * : GxB_Context_set_VOID )) \ + (object, value, __VA_ARGS__) #endif -//------------------------------------------------------------------------------ -// GrB_Vector_setElement -//------------------------------------------------------------------------------ +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _set_Scalar (Object object, GrB_Scalar, int) ; \ +GrB_Info Object ## _set_String (Object object, char * , int) ; \ +GrB_Info Object ## _set_INT32 (Object object, int32_t , int) ; \ +GrB_Info Object ## _set_VOID (Object object, void * , int, size_t) ; +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_Global ) + +// GxB_Context_set_INT is slightly misnamed, because of the prior +// GxB_Context_set_INT32. +GrB_Info GxB_Context_set_Scalar (GxB_Context, GrB_Scalar, int) ; +GrB_Info GxB_Context_set_String (GxB_Context, char * , int) ; +GrB_Info GxB_Context_set_INT (GxB_Context, int32_t , int) ; +GrB_Info GxB_Context_set_VOID (GxB_Context, void * , int, size_t) ; -// Set a single scalar in a vector, w(i) = x, typecasting from the type of x to -// the type of w as needed. +//============================================================================== +// GrB_wait: finish computations +//============================================================================== -GrB_Info GrB_Vector_setElement_BOOL // w(i) = x -( - GrB_Vector w, // vector to modify - bool x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +// Finish all pending work in a specific object. +// +// GrB_Info GrB_wait +// ( +// Object object, // GraphBLAS object to wait on +// int waitmode // (GrB_WaitMode) +// ) ; -GrB_Info GrB_Vector_setElement_INT8 // w(i) = x -( - GrB_Vector w, // vector to modify - int8_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_wait(object,waitmode) \ + _Generic ((object), \ + GrB_Type : GrB_Type_wait , \ + GrB_UnaryOp : GrB_UnaryOp_wait , \ + GrB_BinaryOp : GrB_BinaryOp_wait , \ + GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ + GrB_Monoid : GrB_Monoid_wait , \ + GrB_Semiring : GrB_Semiring_wait , \ + GrB_Scalar : GrB_Scalar_wait , \ + GrB_Vector : GrB_Vector_wait , \ + GrB_Matrix : GrB_Matrix_wait , \ + GxB_Context : GxB_Context_wait , \ + GrB_Descriptor : GrB_Descriptor_wait) \ + (object, waitmode) +#endif -GrB_Info GrB_Vector_setElement_UINT8 // w(i) = x -( - GrB_Vector w, // vector to modify - uint8_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) \ +GrB_Info Object ## _wait (Object object, int waitmode) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) -GrB_Info GrB_Vector_setElement_INT16 // w(i) = x -( - GrB_Vector w, // vector to modify - int16_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +//============================================================================== +// GrB_error: error handling +//============================================================================== -GrB_Info GrB_Vector_setElement_UINT16 // w(i) = x -( - GrB_Vector w, // vector to modify - uint16_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +// Each GraphBLAS method and operation returns a GrB_Info error code. +// GrB_error returns additional information on the error in a thread-safe +// null-terminated string. The string returned by GrB_error is owned by +// the GraphBLAS library and must not be free'd. +// +// GrB_Info GrB_error +// ( +// const char **error, // output error string +// const Object object // GraphBLAS object to query +// ) ; -GrB_Info GrB_Vector_setElement_INT32 // w(i) = x -( - GrB_Vector w, // vector to modify - int32_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_error(error,object) \ + _Generic ((object), \ + GrB_Type : GrB_Type_error , \ + GrB_UnaryOp : GrB_UnaryOp_error , \ + GrB_BinaryOp : GrB_BinaryOp_error , \ + GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ + GrB_Monoid : GrB_Monoid_error , \ + GrB_Semiring : GrB_Semiring_error , \ + GrB_Scalar : GrB_Scalar_error , \ + GrB_Vector : GrB_Vector_error , \ + GrB_Matrix : GrB_Matrix_error , \ + GxB_Context : GxB_Context_error , \ + GrB_Descriptor : GrB_Descriptor_error) \ + (error, object) +#endif -GrB_Info GrB_Vector_setElement_UINT32 // w(i) = x -( - GrB_Vector w, // vector to modify - uint32_t x, // scalar to assign to w(i) - GrB_Index i // row index -) ; +#undef GB_DECLARE +#define GB_DECLARE(Object) GrB_Info Object ## _error \ +( \ + const char **error, /* output error string */ \ + const Object object /* GraphBLAS object to query */ \ +) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) + +//============================================================================== +// GrB_mxm, vxm, mxv: matrix multiplication over a semiring +//============================================================================== + +// No accum operator in any method can be based on a GxB_IndexBinaryOp. -GrB_Info GrB_Vector_setElement_INT64 // w(i) = x +GrB_Info GrB_mxm // C = accum (C, A*B) ( - GrB_Vector w, // vector to modify - int64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_setElement_UINT64 // w(i) = x +GrB_Info GrB_vxm // w' = accum (w, u'*A) ( - GrB_Vector w, // vector to modify - uint64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for u'*A + const GrB_Vector u, // first input: vector u + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_setElement_FP32 // w(i) = x +GrB_Info GrB_mxv // w = accum (w, A*u) ( - GrB_Vector w, // vector to modify - float x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' and '*' for A*B + const GrB_Matrix A, // first input: matrix A + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_setElement_FP64 // w(i) = x +//============================================================================== +// GrB_eWiseMult: element-wise matrix and vector operations, set intersection +//============================================================================== + +// GrB_eWiseMult computes C = accum (C, A.*B), where ".*" is the Hadamard +// product, and where pairs of elements in two matrices (or vectors) are +// pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). The mult operator +// can be based on a GxB_IndexBinaryOp. + +GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - double x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Vector_setElement_FC32 // w(i) = x +GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - GxB_FC32_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Vector_setElement_FC64 // w(i) = x +GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) ( - GrB_Vector w, // vector to modify - GxB_FC64_t x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp mult, // defines '.*' for t=u.*v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_setElement_UDT // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - void *x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_setElement_Scalar // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - GrB_Scalar x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Vector_setElement // w(i) = x +GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) ( - GrB_Vector w, // vector to modify - x, // scalar to assign to w(i) - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp mult, // defines '.*' for T=A.*B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -*/ + +// All 6 of the above type-specific functions are captured in a single +// type-polymorphic function, GrB_eWiseMult: #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_setElement(w,x,i) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Vector_setElement), \ - default: GrB_Vector_setElement_Scalar \ - ) \ - (w, x, i) +#define GrB_eWiseMult(C,Mask,accum,op,A,B,desc) \ + _Generic ((C), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_eWiseMult_Semiring , \ + GrB_Monoid : GrB_Matrix_eWiseMult_Monoid , \ + GrB_BinaryOp : GrB_Matrix_eWiseMult_BinaryOp \ + ), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_Semiring : GrB_Vector_eWiseMult_Semiring , \ + GrB_Monoid : GrB_Vector_eWiseMult_Monoid , \ + GrB_BinaryOp : GrB_Vector_eWiseMult_BinaryOp)) \ + (C, Mask, accum, op, A, B, desc) #endif -//------------------------------------------------------------------------------ -// GrB_Vector_extractElement -//------------------------------------------------------------------------------ +//============================================================================== +// GrB_eWiseAdd: element-wise matrix and vector operations, set union +//============================================================================== -// Extract a single entry from a vector, x = v(i), typecasting from the type of -// v to the type of x as needed. +// GrB_eWiseAdd computes C = accum (C, A+B), where pairs of elements in +// two matrices (or two vectors) are pairwise "added". -GrB_Info GrB_Vector_extractElement_BOOL // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) ( - bool *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Semiring semiring, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_INT8 // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) ( - int8_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_UINT8 // x = v(i) +GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) ( - uint8_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Vector v, // second input: vector v + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Vector_extractElement_INT16 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) ( - int16_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_UINT16 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) ( - uint16_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_INT32 // x = v(i) +GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) ( - int32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, Mask, A, and B ) ; -GrB_Info GrB_Vector_extractElement_UINT32 // x = v(i) -( - uint32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +#if GxB_STDC_VERSION >= 201112L +#define GrB_eWiseAdd(C,Mask,accum,op,A,B,desc) \ + _Generic ((C), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_eWiseAdd_Semiring , \ + GrB_Monoid : GrB_Matrix_eWiseAdd_Monoid , \ + GrB_BinaryOp : GrB_Matrix_eWiseAdd_BinaryOp \ + ), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_Semiring : GrB_Vector_eWiseAdd_Semiring , \ + GrB_Monoid : GrB_Vector_eWiseAdd_Monoid , \ + GrB_BinaryOp : GrB_Vector_eWiseAdd_BinaryOp)) \ + (C, Mask, accum, op, A, B, desc) +#endif -GrB_Info GrB_Vector_extractElement_INT64 // x = v(i) -( - int64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +//============================================================================== +// GxB_eWiseUnion: a variant of GrB_eWiseAdd +//============================================================================== -GrB_Info GrB_Vector_extractElement_UINT64 // x = v(i) -( - uint64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// GxB_eWiseUnion is a variant of eWiseAdd. The methods create a result with +// the same sparsity structure. They differ when an entry is present in A but +// not B, or in B but not A. -GrB_Info GrB_Vector_extractElement_FP32 // x = v(i) -( - float *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// eWiseAdd does the following, for a matrix, where "+" is the add binary op: -GrB_Info GrB_Vector_extractElement_FP64 // x = v(i) -( - double *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// if A(i,j) and B(i,j) are both present: +// C(i,j) = A(i,j) + B(i,j) +// else if A(i,j) is present but not B(i,j) +// C(i,j) = A(i,j) +// else if B(i,j) is present but not A(i,j) +// C(i,j) = B(i,j) -GrB_Info GxB_Vector_extractElement_FC32 // x = v(i) -( - GxB_FC32_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// by contrast, eWiseUnion always applies the operator: -GrB_Info GxB_Vector_extractElement_FC64 // x = v(i) -( - GxB_FC64_t *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; +// if A(i,j) and B(i,j) are both present: +// C(i,j) = A(i,j) + B(i,j) +// else if A(i,j) is present but not B(i,j) +// C(i,j) = A(i,j) + beta +// else if B(i,j) is present but not A(i,j) +// C(i,j) = alpha + B(i,j) -GrB_Info GrB_Vector_extractElement_UDT // x = v(i) +GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) ( - void *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index -) ; - -GrB_Info GrB_Vector_extractElement_Scalar // x = v(i) -( - GrB_Scalar x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_Vector u, // first input: vector u + const GrB_Scalar alpha, + const GrB_Vector v, // second input: vector v + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for w and mask ) ; -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Vector_extractElement // x = v(i) +GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) ( - *x, // scalar extracted - const GrB_Vector v, // vector to extract an entry from - GrB_Index i // row index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar alpha, + const GrB_Matrix B, // second input: matrix B + const GrB_Scalar beta, + const GrB_Descriptor desc // descriptor for C, M, A, and B ) ; -*/ #if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractElement(x,v,i) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Vector_extractElement), \ - default: GrB_Vector_extractElement_Scalar \ - ) \ - (x, v, i) +#define GxB_eWiseUnion(C,Mask,accum,op,A,alpha,B,beta,desc) \ + _Generic ((C), \ + GrB_Matrix : GxB_Matrix_eWiseUnion , \ + GrB_Vector : GxB_Vector_eWiseUnion) \ + (C, Mask, accum, op, A, alpha, B, beta, desc) #endif -// GxB_Vector_isStoredElement determines if v(i) is present in the structure -// of the vector v, as a stored element. It does not return the value. It -// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. +//============================================================================== +// GrB_extract: extract a submatrix or subvector +//============================================================================== -GrB_Info GxB_Vector_isStoredElement // determine if v(i) is a stored element +GrB_Info GrB_Vector_extract // w = accum (w, u(I)) ( - const GrB_Vector v, // vector to check - GrB_Index i // row index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask ) ; -//------------------------------------------------------------------------------ -// GrB_Vector_removeElement -//------------------------------------------------------------------------------ - -// GrB_Vector_removeElement (v,i) removes the element v(i) from the vector v. - -GrB_Info GrB_Vector_removeElement +GrB_Info GxB_Vector_extract_Vector // w = accum (w, u(I)) ( - GrB_Vector v, // vector to remove an element from - GrB_Index i // index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask ) ; -//------------------------------------------------------------------------------ -// GrB_Vector_extractTuples -//------------------------------------------------------------------------------ - -// Extracts all tuples from a vector, like [I,~,X] = find (v). If any -// parameter I and/or X is NULL, then that component is not extracted. For -// example, to extract just the row indices, pass I as non-NULL, and X as NULL. -// This is like [I,~,~] = find (v). - -GrB_Info GrB_Vector_extractTuples_BOOL // [I,~,X] = find (v) +GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - bool *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices (64-bit) + GrB_Index nj, // number of column indices + const GrB_Descriptor desc // descriptor for C, M, and A ) ; -GrB_Info GrB_Vector_extractTuples_INT8 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_extract_Vector // C = accum (C, A(I,J)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C, M, and A ) ; -GrB_Info GrB_Vector_extractTuples_UINT8 // [I,~,X] = find (v) +GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices (64-bit) + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_extractTuples_INT16 // [I,~,X] = find (v) +GrB_Info GxB_Col_extract_Vector // w = accum (w, A(I,j)) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GrB_Vector_extractTuples_UINT16 // [I,~,X] = find (v) -( - GrB_Index *Ilist, // array for returning row indices of tuples - uint16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from -) ; +// GrB_extract is a polymorphic interface to the following functions: +// +// GrB_Vector_extract (w,m,acc,u,I,ni,d) +// GxB_Vector_extract_Vector (w,m,acc,u,I,d) where I is a GrB_Vector +// GrB_Col_extract (w,m,acc,A,I,ni,j,d) +// GxB_Col_extract_Vector (w,m,acc,A,I,j,d) where I is a GrB_Vector +// GrB_Matrix_extract (C,M,acc,A,I,ni,J,nj,d) +// GxB_Matrix_extract_Vector (C,M,acc,A,I,ni,J,nj,d) where I,J are GrB_Vector +#if GxB_STDC_VERSION >= 201112L +#define GrB_extract(C,M,accum,A,I,...) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((A), \ + GrB_Vector : \ + _Generic ((I), \ + GrB_Vector: GxB_Vector_extract_Vector, \ + default: GrB_Vector_extract), \ + GrB_Matrix : \ + _Generic ((I), \ + GrB_Vector: GxB_Col_extract_Vector, \ + default: GrB_Col_extract)), \ + GrB_Matrix : \ + _Generic ((I), \ + GrB_Vector: GxB_Matrix_extract_Vector, \ + default: GrB_Matrix_extract)) \ + (C, M, accum, A, I, __VA_ARGS__) +#endif + +//============================================================================== +// GxB_subassign: matrix and vector subassign: C(I,J) = accum (C(I,J), A) +//============================================================================== + +// Assign entries in a matrix or vector; C(I,J) = A. + +// Most assign and subassign methods have two variants depending on how the +// integer lists I and J are passed: (1) as C arrays of type (GrB_Index *) and +// a corresponding array length, and (2) as GrB_Vectors. The latter methods +// have a "_Vector" suffix to their name. The exception to this rule are +// methods with a type suffix (_BOOL, _UINT*, _INT*, _FP*, _FC*, and _UDT) +// where the scalar x is provided as a plain C scalar or (void *) for _UDT. +// Those methods only accept C arrays of type (GrB_Index *) for I and J. + +// Each GxB_subassign function is very similar to its corresponding GrB_assign +// function in the spec, but they differ in two ways: (1) the mask in +// GxB_subassign has the same size as w(I) for vectors and C(I,J) for matrices, +// and (2) they differ in the GrB_REPLACE option. See the user guide for +// details. + +// In GraphBLAS notation, assign and subassign can be described as follows: + +// matrix and vector subassign: C(I,J) = accum (C(I,J), A) +// matrix and vector assign: C(I,J) = accum (C(I,J), A) + +// --- assign ------------------------------------------------------------------ +// +// GrB_Matrix_assign C(I,J) += A M same size as matrix C. +// A is |I|-by-|J| +// +// GrB_Vector_assign w(I) += u m same size as column vector w. +// u is |I|-by-1 +// +// GrB_Row_assign C(i,J) += u' m is a column vector the same +// size as a row of C. +// u is |J|-by-1, i is a scalar. +// +// GrB_Col_assign C(I,j) += u m is a column vector the same +// size as a column of C. +// u is |I|-by-1, j is a scalar. +// +// --- subassign --------------------------------------------------------------- +// +// GxB_Matrix_subassign C(I,J) += A M same size as matrix A. +// A is |I|-by-|J| +// +// GxB_Vector_subassign w(I) += u m same size as column vector u. +// u is |I|-by-1 +// +// GxB_Row_subassign C(i,J) += u' m same size as column vector u. +// u is |J|-by-1, i is a scalar. +// +// GxB_Col_subassign C(I,j) += u m same size as column vector u. +// u is |I|-by-1, j is a scalar. -GrB_Info GrB_Vector_extractTuples_INT32 // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign // w(I) = accum (w(I),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UINT32 // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign_Vector // w(I) = accum (w(I),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_INT64 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_subassign // C(I,J) = accum (C(I,J),A) ( - GrB_Index *Ilist, // array for returning row indices of tuples - int64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UINT64 // [I,~,X] = find (v) +GrB_Info GxB_Matrix_subassign_Vector // C(I,J) = accum (C(I,J),A) ( - GrB_Index *Ilist, // array for returning row indices of tuples - uint64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_FP32 // [I,~,X] = find (v) +GrB_Info GxB_Col_subassign // C(I,j) = accum (C(I,j),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - float *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_FP64 // [I,~,X] = find (v) +GrB_Info GxB_Col_subassign_Vector // C(I,j) = accum (C(I,j),u) ( - GrB_Index *Ilist, // array for returning row indices of tuples - double *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_extractTuples_FC32 // [I,~,X] = find (v) +GrB_Info GxB_Row_subassign // C(i,J) = accum (C(i,J),u') ( - GrB_Index *Ilist, // array for returning row indices of tuples - GxB_FC32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_extractTuples_FC64 // [I,~,X] = find (v) +GrB_Info GxB_Row_subassign_Vector // C(i,J) = accum (C(i,J),u') ( - GrB_Index *Ilist, // array for returning row indices of tuples - GxB_FC64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Vector_extractTuples_UDT // [I,~,X] = find (v) +//------------------------------------------------------------------------------ +// GxB_Vector_subassign_[SCALAR]: scalar expansion assignment to subvector +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The +// scalar x is implicitly expanded into a vector u of size ni-by-1, with each +// entry in u equal to x, and then w(I) = accum(w(I),u) is done. + +GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),x) ( - GrB_Index *Ilist, // array for returning row indices of tuples - void *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Vector_extractTuples // [I,~,X] = find (v) +GrB_Info GxB_Vector_subassign_Scalar_Vector // w(I) = accum (w(I),x) ( - GrB_Index *Ilist, // array for returning row indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I, X size on input; # tuples on output - const GrB_Vector v // vector to extract tuples from + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -*/ -#if GxB_STDC_VERSION >= 201112L -#define GrB_Vector_extractTuples(Ilist,X,nvals,v) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Vector_extractTuples) \ - ) \ - (Ilist, X, nvals, v) -#endif +// The following methods do not accept a GrB_Vector I parameter: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Vector_subassign ## suffix /* w(I) = accum (w(I),x) */ \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w(I), unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Descriptor desc \ +) ; +GB_DECLARE_14 (GxB_, void *) -//============================================================================== -// GrB_Matrix: a GraphBLAS matrix -//============================================================================== +//------------------------------------------------------------------------------ +// GxB_Matrix_subassign_[SCALAR]: scalar expansion assignment to submatrix +//------------------------------------------------------------------------------ -// These methods create, free, copy, and clear a matrix. The nrows, ncols, -// nvals, and type methods return basic information about a matrix. +// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The +// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each +// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. -GrB_Info GrB_Matrix_new // create a new matrix with no entries +GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols // (nrows and ncols must be <= GrB_INDEX_MAX+1) + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_dup // make an exact copy of a matrix +GrB_Info GxB_Matrix_subassign_Scalar_Vector // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix *C, // handle of output matrix to create - const GrB_Matrix A // input matrix to copy + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_clear // clear a matrix of all entries; -( // type and dimensions remain unchanged - GrB_Matrix A // matrix to clear +// The following methods do not accept GrB_Vector I,J parameters: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info GxB_Matrix_subassign ## suffix /* C(I,J) = accum (C(I,J),x) */ \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C(I,J), unused if NULL */\ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C(I,J),x) */ \ + type x, /* scalar to assign to C(I,J) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Index *J, /* column indices */ \ + GrB_Index nj, /* number of column indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GxB_, void *) -GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix -( - GrB_Index *nrows, // matrix has nrows rows - const GrB_Matrix A // matrix to query -) ; +//------------------------------------------------------------------------------ +// GxB_subassign: polymorphic submatrix/subvector assignment +//------------------------------------------------------------------------------ -GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix -( - GrB_Index *ncols, // matrix has ncols columns - const GrB_Matrix A // matrix to query -) ; +// GxB_subassign is a polymorphic function that provides access to all +// non-polymorphic *_subassign* functions. -GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix -( - GrB_Index *nvals, // matrix has nvals entries - const GrB_Matrix A // matrix to query -) ; +// GB_VECTOR_SUBASSIGN: +// GxB_Vector_subassign_TYPE (w,m,acc,x,I,ni,d) +// GxB_Vector_subassign_Scalar_Vector (w,m,acc,s,I,d) I is a GrB_Vector +// GxB_Vector_subassign_Scalar (w,m,acc,s,I,ni,d) +// GxB_Vector_subassign_Vector (w,m,acc,u,I,d) I is a GrB_Vector +// GxB_Vector_subassign (w,m,acc,u,I,ni,d) +#if GxB_STDC_VERSION >= 201112L +#define GB_VECTOR_SUBASSIGN(w,mask,accum,arg4,arg5,...) \ + _Generic ((arg4), \ + GB_CASES (GxB, Vector_subassign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_subassign_Scalar_Vector, \ + default: GxB_Vector_subassign_Scalar), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_subassign_Vector, \ + default: GxB_Vector_subassign)) + +// GB_MATRIX_SUBASSIGN: +// GxB_Matrix_subassign_TYPE (C,M,acc,x,I,ni,J,nj,d) +// GxB_Matrix_subassign_Scalar_Vector (C,M,acc,s,I,J,d) I,J are GrB_Vector +// GxB_Matrix_subassign_Scalar (C,M,acc,s,I,ni,J,nj,d) +// GxB_Col_subassign (C,m,acc,u,I,ni,j,d) +// GxB_Col_subassign_Vector (C,m,acc,u,I,j,d) I is a GrB_Vector +// GxB_Row_subassign (C,m,acc,u,i,J,nj,d) +// GxB_Row_subassign_Vector (C,m,acc,u,i,J,d) J is a GrB_Vector +// GxB_Matrix_subassign_Vector (C,M,acc,A,I,J,d) I,J are GrB_Vector +// GxB_Matrix_subassign (C,M,acc,A,I,ni,J,nj,d) +#define GB_MATRIX_SUBASSIGN(C,M,accum,arg4,arg5,arg6,...) \ + _Generic ((arg4), \ + GB_CASES (GxB, Matrix_subassign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_subassign_Scalar_Vector, \ + default: GxB_Matrix_subassign_Scalar), \ + GrB_Vector : \ + _Generic ((arg5), \ + const GrB_Index *: GxB_Col_subassign, \ + GrB_Index *: GxB_Col_subassign, \ + GrB_Vector : GxB_Col_subassign_Vector, \ + default: \ + _Generic ((arg6), \ + const GrB_Index *: GxB_Row_subassign, \ + GrB_Index *: GxB_Row_subassign, \ + default: GxB_Row_subassign_Vector)), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_subassign_Vector, \ + default: GxB_Matrix_subassign)) + +#define GxB_subassign(C,...) \ + _Generic ((C), \ + GrB_Vector : GB_VECTOR_SUBASSIGN (C, __VA_ARGS__), \ + GrB_Matrix : GB_MATRIX_SUBASSIGN (C, __VA_ARGS__)) \ + (C, __VA_ARGS__) +#endif -GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix -( - size_t *size, // # of bytes used by the matrix A - const GrB_Matrix A // matrix to query -) ; +//============================================================================== +// GrB_assign: matrix and vector assign: C(I,J) = accum (C(I,J), A) +//============================================================================== -GrB_Info GxB_Matrix_iso // return iso status of a matrix -( - bool *iso, // true if the matrix is iso-valued - const GrB_Matrix A // matrix to query -) ; +// Assign entries in a matrix or vector; C(I,J) = A. +// Each of these can be used with their polymorphic name, GrB_assign. -GrB_Info GrB_Matrix_free // free a matrix +GrB_Info GrB_Vector_assign // w(I) = accum (w(I),u) ( - GrB_Matrix *A // handle of matrix to free + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -//------------------------------------------------------------------------------ -// GrB_Matrix_build -//------------------------------------------------------------------------------ - -// GrB_Matrix_build: C = sparse (I,J,X), but using any -// associative operator to assemble duplicate entries. -// The dup operator cannot be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples +GrB_Info GxB_Vector_assign_Vector // w(I) = accum (w(I),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const bool *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT8 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Matrix_assign // C(I,J) = accum (C(I,J),A) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT8 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Matrix_assign_Vector // C(I,J) = accum (C(I,J),A) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint8_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT16 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Col_assign // C(I,j) = accum (C(I,j),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT16 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Col_assign_Vector // C(I,j) = accum (C(I,j),u) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint16_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + GrB_Index j, // column index + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT32 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Row_assign // C(i,J) = accum (C(i,J),u') ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UINT32 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Row_assign_Vector // C(i,J) = accum(C(i,j),u') ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + GrB_Index i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_INT64 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const int64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +//------------------------------------------------------------------------------ +// GrB_Vector_assign_[SCALAR]: scalar expansion assignment to subvector +//------------------------------------------------------------------------------ -GrB_Info GrB_Matrix_build_UINT64 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const uint64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The +// scalar x is implicitly expanded into a vector u of size ni-by-1, with each +// entry in u equal to x, and then w(I) = accum(w(I),u) is done. -GrB_Info GrB_Matrix_build_FP32 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const float *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_FP64 // build a matrix from (I,J,X) tuples +GrB_Info GxB_Vector_assign_Scalar_Vector // w(I) = accum (w(I),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const double *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar x, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_build_FC32 // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const GxB_FC32_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates +// The following methods do not accept a GrB_Vector I parameter: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_assign ## suffix /* w(I) = accum (w(I),x) */ \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void *) + +//------------------------------------------------------------------------------ +// GrB_Matrix_assign_[SCALAR]: scalar expansion assignment to submatrix +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The +// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each +// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. -GrB_Info GxB_Matrix_build_FC64 // build a matrix from (I,J,X) tuples +GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const GxB_FC64_t *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Index *I_, // row indices + GrB_Index ni, // number of row indices + const GrB_Index *J, // column indices + GrB_Index nj, // number of column indices + const GrB_Descriptor desc ) ; -GrB_Info GrB_Matrix_build_UDT // build a matrix from (I,J,X) tuples +GrB_Info GxB_Matrix_assign_Scalar_Vector // C(I,J) = accum (C(I,J),x) ( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const void *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar x, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_build_Scalar // build a matrix from (I,J,scalar) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples +// The following methods do not accept GrB_Vector I,J parameters: +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_assign ## suffix /* C(I,J) = accum(C(I,J),x)*/\ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C(I,J),x) */ \ + type x, /* scalar to assign to C(I,J) */ \ + const GrB_Index *I_, /* row indices */ \ + GrB_Index ni, /* number of row indices */ \ + const GrB_Index *J, /* column indices */ \ + GrB_Index nj, /* number of column indices */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void *) -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. +//------------------------------------------------------------------------------ +// GrB_assign: polymorphic submatrix/subvector assignment +//------------------------------------------------------------------------------ -/* -GrB_Info GrB_Matrix_build // build a matrix from (I,J,X) tuples -( - GrB_Matrix C, // matrix to build - const GrB_Index *Ilist, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples - const *X, // array of values of tuples - GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup // binary function to assemble duplicates -) ; -*/ +// GrB_assign is a polymorphic function that provides access to all +// non-polymorphic *_assign* functions. +// GB_VECTOR_ASSIGN: +// GrB_Vector_assign_TYPE (w,m,acc,x,I,ni,d) +// GxB_Vector_assign_Scalar_Vector (w,m,acc,s,I,d) where I is a GrB_Vector +// GrB_Vector_assign_Scalar (w,m,acc,s,I,ni,d) +// GxB_Vector_assign_Vector (w,m,acc,u,I,d) where I is a GrB_Vector +// GrB_Vector_assign (w,m,acc,u,I,ni,d) #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_build(C,Ilist,J,X,nvals,dup) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Matrix_build) \ - ) \ - (C, Ilist, J, ((const void *) (X)), nvals, dup) +#define GB_VECTOR_ASSIGN(w,mask,accum,arg4,arg5,...) \ + _Generic ((arg4), \ + GB_CASES (GrB, Vector_assign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_assign_Scalar_Vector, \ + default: GrB_Vector_assign_Scalar), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Vector_assign_Vector, \ + default: GrB_Vector_assign)) + +// GB_MATRIX_ASSIGN: +// GrB_Matrix_assign_TYPE (C,M,acc,x,I,ni,J,nj,d) +// GxB_Matrix_assign_Scalar_Vector (C,M,acc,s,I,J,d) where I,J are GrB_Vector +// GrB_Matrix_assign_Scalar (C,M,acc,s,I,ni,J,nj,d) +// GrB_Col_assign (C,m,acc,u,I,ni,j,d) +// GxB_Col_assign_Vector (C,m,acc,u,I,j,d) where I is a GrB_Vector +// GrB_Row_assign (C,m,acc,u,i,J,nj,d) +// GxB_Row_assign_Vector (C,m,acc,u,i,J,d) where J is a GrB_Vector +// GxB_Matrix_assign_Vector (C,M,acc,A,I,J,d) where I,J are GrB_Vector +// GrB_Matrix_assign (C,M,acc,A,I,ni,J,nj,d) +#define GB_MATRIX_ASSIGN(C,M,accum,arg4,arg5,arg6,...) \ + _Generic ((arg4), \ + GB_CASES (GrB, Matrix_assign), \ + GrB_Scalar : \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_assign_Scalar_Vector, \ + default: GrB_Matrix_assign_Scalar), \ + GrB_Vector : \ + _Generic ((arg5), \ + const GrB_Index *: GrB_Col_assign, \ + GrB_Index *: GrB_Col_assign, \ + GrB_Vector : GxB_Col_assign_Vector, \ + default: \ + _Generic ((arg6), \ + const GrB_Index *: GrB_Row_assign, \ + GrB_Index *: GrB_Row_assign, \ + default: GxB_Row_assign_Vector)), \ + default: \ + _Generic ((arg5), \ + GrB_Vector : GxB_Matrix_assign_Vector, \ + default: GrB_Matrix_assign)) + +#define GrB_assign(C,...) \ + _Generic ((C), \ + GrB_Vector : GB_VECTOR_ASSIGN (C, __VA_ARGS__), \ + GrB_Matrix : GB_MATRIX_ASSIGN (C, __VA_ARGS__)) \ + (C, __VA_ARGS__) #endif -//------------------------------------------------------------------------------ -// GrB_Matrix_setElement -//------------------------------------------------------------------------------ - -// Set a single entry in a matrix, C(i,j) = x, typecasting -// from the type of x to the type of C, as needed. +//============================================================================== +// GrB_apply: matrix and vector apply +//============================================================================== -GrB_Info GrB_Matrix_setElement_BOOL // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - bool x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a unary, index_unary, or binary operator to entries in a matrix or +// vector, C = accum (C, op (A)). -GrB_Info GrB_Matrix_setElement_INT8 // C (i,j) = x +GrB_Info GrB_Vector_apply // w = accum (w, op(u)) ( - GrB_Matrix C, // matrix to modify - int8_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Matrix_setElement_UINT8 // C (i,j) = x +GrB_Info GrB_Matrix_apply // C = accum (C, op(A)) or op(A') ( - GrB_Matrix C, // matrix to modify - uint8_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_UnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -GrB_Info GrB_Matrix_setElement_INT16 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - int16_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +//------------------------------------------- +// vector apply: binaryop variants (bind 1st) +//------------------------------------------- -GrB_Info GrB_Matrix_setElement_UINT16 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint16_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a binary operator to the entries in a vector, binding the first +// input to a scalar x, w = accum (w, op (x,u)). -GrB_Info GrB_Matrix_setElement_INT32 // C (i,j) = x +GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) ( - GrB_Matrix C, // matrix to modify - int32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Scalar x, // first input: scalar x + const GrB_Vector u, // second input: vector u + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GrB_Matrix_setElement_UINT32 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_BinaryOp1st ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + type x, /* first input: scalar x */ \ + const GrB_Vector u, /* second input: vector u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) -GrB_Info GrB_Matrix_setElement_INT64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - int64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +//------------------------------------------- +// vector apply: binaryop variants (bind 2nd) +//------------------------------------------- -GrB_Info GrB_Matrix_setElement_UINT64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - uint64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; +// Apply a binary operator to the entries in a vector, binding the second +// input to a scalar y, w = accum (w, op (u,y)). -GrB_Info GrB_Matrix_setElement_FP32 // C (i,j) = x +GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) ( - GrB_Matrix C, // matrix to modify - float x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_FP64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - double x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_setElement_FC32 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GxB_FC32_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_setElement_FC64 // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GxB_FC64_t x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_UDT // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - void *x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_setElement_Scalar // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - GrB_Scalar x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; - -// Type-generic version: x can be any supported C type or void * for a -// user-defined type. - -/* -GrB_Info GrB_Matrix_setElement // C (i,j) = x -( - GrB_Matrix C, // matrix to modify - x, // scalar to assign to C(i,j) - GrB_Index i, // row index - GrB_Index j // column index -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_setElement(C,x,i,j) \ - _Generic \ - ( \ - (x), \ - GB_CASES (GrB, Matrix_setElement), \ - default: GrB_Matrix_setElement_Scalar \ - ) \ - (C, x, i, j) -#endif - -//------------------------------------------------------------------------------ -// GrB_Matrix_extractElement -//------------------------------------------------------------------------------ - -// Extract a single entry from a matrix, x = A(i,j), typecasting from the type -// of A to the type of x, as needed. - -GrB_Info GrB_Matrix_extractElement_BOOL // x = A(i,j) -( - bool *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT8 // x = A(i,j) -( - int8_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT8 // x = A(i,j) -( - uint8_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT16 // x = A(i,j) -( - int16_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT16 // x = A(i,j) -( - uint16_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT32 // x = A(i,j) -( - int32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT32 // x = A(i,j) -( - uint32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_INT64 // x = A(i,j) -( - int64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UINT64 // x = A(i,j) -( - uint64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_FP32 // x = A(i,j) -( - float *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_FP64 // x = A(i,j) -( - double *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_extractElement_FC32 // x = A(i,j) -( - GxB_FC32_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GxB_Matrix_extractElement_FC64 // x = A(i,j) -( - GxB_FC64_t *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_UDT // x = A(i,j) -( - void *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -GrB_Info GrB_Matrix_extractElement_Scalar // x = A(i,j) -( - GrB_Scalar x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -// Type-generic version: x can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Matrix_extractElement // x = A(i,j) -( - *x, // extracted scalar - const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_extractElement(x,A,i,j) \ - _Generic \ - ( \ - (x), \ - GB_PCASES (GrB, Matrix_extractElement), \ - default: GrB_Matrix_extractElement_Scalar \ - ) \ - (x, A, i, j) -#endif - -// GxB_Matrix_isStoredElement determines if A(i,j) is present in the structure -// of the matrix A, as a stored element. It does not return the value. It -// returns GrB_SUCCESS if the element is present, or GrB_NO_VALUE otherwise. - -GrB_Info GxB_Matrix_isStoredElement // determine if A(i,j) is a stored element -( - const GrB_Matrix A, // matrix to check - GrB_Index i, // row index - GrB_Index j // column index -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_removeElement -//------------------------------------------------------------------------------ - -// GrB_Matrix_removeElement (A,i,j) removes the entry A(i,j) from the matrix A. - -GrB_Info GrB_Matrix_removeElement -( - GrB_Matrix C, // matrix to remove entry from - GrB_Index i, // row index - GrB_Index j // column index -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_extractTuples -//------------------------------------------------------------------------------ - -// Extracts all tuples from a matrix, like [I,J,X] = find (A). If -// any parameter I, J and/or X is NULL, then that component is not extracted. -// For example, to extract just the row and col indices, pass I and J as -// non-NULL, and X as NULL. This is like [I,J,~] = find (A). - -GrB_Info GrB_Matrix_extractTuples_BOOL // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - bool *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT8 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT8 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint8_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT16 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT16 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint16_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_INT64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - int64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UINT64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - uint64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_FP32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - float *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_FP64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - double *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GxB_Matrix_extractTuples_FC32 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - GxB_FC32_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GxB_Matrix_extractTuples_FC64 // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - GxB_FC64_t *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -GrB_Info GrB_Matrix_extractTuples_UDT // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - void *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; - -// Type-generic version: X can be a pointer to any supported C type or void * -// for a user-defined type. - -/* -GrB_Info GrB_Matrix_extractTuples // [I,J,X] = find (A) -( - GrB_Index *Ilist, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples - *X, // array for returning values of tuples - GrB_Index *nvals, // I,J,X size on input; # tuples on output - const GrB_Matrix A // matrix to extract tuples from -) ; -*/ - -#if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_extractTuples(Ilist,J,X,nvals,A) \ - _Generic \ - ( \ - (X), \ - GB_PCASES (GrB, Matrix_extractTuples) \ - ) \ - (Ilist, J, X, nvals, A) -#endif - -//------------------------------------------------------------------------------ -// GxB_Matrix_concat and GxB_Matrix_split -//------------------------------------------------------------------------------ - -// GxB_Matrix_concat concatenates an array of matrices (Tiles) into a single -// GrB_Matrix C. - -// Tiles is an m-by-n dense array of matrices held in row-major format, where -// Tiles [i*n+j] is the (i,j)th tile, and where m > 0 and n > 0 must hold. Let -// A{i,j} denote the (i,j)th tile. The matrix C is constructed by -// concatenating these tiles together, as: - -// C = [ A{0,0} A{0,1} A{0,2} ... A{0,n-1} -// A{1,0} A{1,1} A{1,2} ... A{1,n-1} -// ... -// A{m-1,0} A{m-1,1} A{m-1,2} ... A{m-1,n-1} ] - -// On input, the matrix C must already exist. Any existing entries in C are -// discarded. C must have dimensions nrows by ncols where nrows is the sum of -// # of rows in the matrices A{i,0} for all i, and ncols is the sum of the # of -// columns in the matrices A{0,j} for all j. All matrices in any given tile -// row i must have the same number of rows (that is, nrows(A{i,0}) must equal -// nrows(A{i,j}) for all j), and all matrices in any given tile column j must -// have the same number of columns (that is, ncols(A{0,j}) must equal -// ncols(A{i,j}) for all i). - -// The type of C is unchanged, and all matrices A{i,j} are typecasted into the -// type of C. Any settings made to C by GrB_set (format by row -// or by column, bitmap switch, hyper switch, and sparsity control) are -// unchanged. - -GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Descriptor desc // unused, except threading control -) ; - -// GxB_Matrix_split does the opposite of GxB_Matrix_concat. It splits a single -// input matrix A into a 2D array of tiles. On input, the Tiles array must be -// a non-NULL pointer to a previously allocated array of size at least m*n -// where both m and n must be > 0. The Tiles_nrows array has size m, and -// Tiles_ncols has size n. The (i,j)th tile has dimension -// Tiles_nrows[i]-by-Tiles_ncols[j]. The sum of Tiles_nrows [0:m-1] must equal -// the number of rows of A, and the sum of Tiles_ncols [0:n-1] must equal the -// number of columns of A. The type of each tile is the same as the type of A; -// no typecasting is done. - -GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices -( - GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n - const GrB_Matrix A, // input matrix to split - const GrB_Descriptor desc // unused, except threading control -) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_diag, GxB_Vector_diag, GrB_Matrix_diag -//------------------------------------------------------------------------------ - -// GrB_Matrix_diag constructs a new matrix from a vector. Let n be the length -// of the v vector, from GrB_Vector_size (&n, v). If k = 0, then C is an -// n-by-n diagonal matrix with the entries from v along the main diagonal of C, -// with C(i,i) = v(i). If k is nonzero, C is square with dimension n+abs(k). -// If k is positive, it denotes diagonals above the main diagonal, with -// C(i,i+k) = v(i). If k is negative, it denotes diagonals below the main -// diagonal of C, with C(i-k,i) = v(i). C is constructed with the same type -// as v. - -GrB_Info GrB_Matrix_diag // build a diagonal matrix from a vector -( - GrB_Matrix *C, // output matrix - const GrB_Vector v, // input vector - int64_t k -) ; - -// GrB_Matrix_diag is like GxB_Matrix_diag (&C, v, k, NULL), except that C must -// already exist on input, of the correct size. Any existing entries in C are -// discarded. The type of C is preserved, so that if the type of C and v -// differ, the entries are typecasted into the type of C. Any settings made to -// C by GrB_set (format by row or by column, bitmap switch, hyper -// switch, and sparsity control) are unchanged. - -GrB_Info GxB_Matrix_diag // construct a diagonal matrix from a vector -( - GrB_Matrix C, // output matrix - const GrB_Vector v, // input vector - int64_t k, - const GrB_Descriptor desc // to specify # of threads -) ; - -// GxB_Vector_diag extracts a vector v from an input matrix A, which may be -// rectangular. If k = 0, the main diagonal of A is extracted; k > 0 denotes -// diagonals above the main diagonal of A, and k < 0 denotes diagonals below -// the main diagonal of A. Let A have dimension m-by-n. If k is in the range -// 0 to n-1, then v has length min(m,n-k). If k is negative and in the range -// -1 to -m+1, then v has length min(m+k,n). If k is outside these ranges, -// v has length 0 (this is not an error). - -// v must already exist on input, of the correct length; that is -// GrB_Vector_size (&len,v) must return len = 0 if k >= n or k <= -m, len = -// min(m,n-k) if k is in the range 0 to n-1, and len = min(m+k,n) if k is in -// the range -1 to -m+1. Any existing entries in v are discarded. The type of -// v is preserved, so that if the type of A and v differ, the entries are -// typecasted into the type of v. Any settings made to v by -// GrB_set (bitmap switch and sparsity control) are unchanged. - -GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector -( - GrB_Vector v, // output vector - const GrB_Matrix A, // input matrix - int64_t k, - const GrB_Descriptor desc // unused, except threading control -) ; - -//============================================================================== -// GxB_Context: for managing computational resources -//============================================================================== - -GrB_Info GxB_Context_new // create a new Context -( - GxB_Context *Context // handle of Context to create -) ; - -GrB_Info GxB_Context_free // free a Context -( - GxB_Context *Context // handle of Context to free -) ; - -GrB_Info GxB_Context_engage // engage a Context -( - GxB_Context Context // Context to engage -) ; - -GrB_Info GxB_Context_disengage // disengage a Context -( - GxB_Context Context // Context to disengage -) ; - -//============================================================================== -// GrB_set and GrB_get -//============================================================================== - -//------------------------------------------------------------------------------ -// GrB_get: get a scalar, string, enum, size, or void * from an object -//------------------------------------------------------------------------------ - -GrB_Info GrB_Scalar_get_Scalar (GrB_Scalar, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Scalar_get_String (GrB_Scalar, char * , GrB_Field) ; -GrB_Info GrB_Scalar_get_INT32 (GrB_Scalar, int32_t * , GrB_Field) ; -GrB_Info GrB_Scalar_get_SIZE (GrB_Scalar, size_t * , GrB_Field) ; -GrB_Info GrB_Scalar_get_VOID (GrB_Scalar, void * , GrB_Field) ; - -GrB_Info GrB_Vector_get_Scalar (GrB_Vector, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Vector_get_String (GrB_Vector, char * , GrB_Field) ; -GrB_Info GrB_Vector_get_INT32 (GrB_Vector, int32_t * , GrB_Field) ; -GrB_Info GrB_Vector_get_SIZE (GrB_Vector, size_t * , GrB_Field) ; -GrB_Info GrB_Vector_get_VOID (GrB_Vector, void * , GrB_Field) ; - -GrB_Info GrB_Matrix_get_Scalar (GrB_Matrix, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Matrix_get_String (GrB_Matrix, char * , GrB_Field) ; -GrB_Info GrB_Matrix_get_INT32 (GrB_Matrix, int32_t * , GrB_Field) ; -GrB_Info GrB_Matrix_get_SIZE (GrB_Matrix, size_t * , GrB_Field) ; -GrB_Info GrB_Matrix_get_VOID (GrB_Matrix, void * , GrB_Field) ; - -GrB_Info GxB_Serialized_get_Scalar (const void *, GrB_Scalar, GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_String (const void *, char * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_INT32 (const void *, int32_t * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_SIZE (const void *, size_t * , GrB_Field, - size_t) ; -GrB_Info GxB_Serialized_get_VOID (const void *, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_UnaryOp_get_Scalar (GrB_UnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_UnaryOp_get_String (GrB_UnaryOp, char * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_INT32 (GrB_UnaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_SIZE (GrB_UnaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_UnaryOp_get_VOID (GrB_UnaryOp, void * , GrB_Field) ; - -GrB_Info GrB_IndexUnaryOp_get_Scalar (GrB_IndexUnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_String (GrB_IndexUnaryOp, char * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_INT32 (GrB_IndexUnaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_SIZE (GrB_IndexUnaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_get_VOID (GrB_IndexUnaryOp, void * , GrB_Field) ; - -GrB_Info GrB_BinaryOp_get_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_BinaryOp_get_String (GrB_BinaryOp, char * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_INT32 (GrB_BinaryOp, int32_t * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_SIZE (GrB_BinaryOp, size_t * , GrB_Field) ; -GrB_Info GrB_BinaryOp_get_VOID (GrB_BinaryOp, void * , GrB_Field) ; - -GrB_Info GxB_IndexBinaryOp_get_Scalar (GxB_IndexBinaryOp, GrB_Scalar, - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_String (GxB_IndexBinaryOp, char * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_INT32 (GxB_IndexBinaryOp, int32_t * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_SIZE (GxB_IndexBinaryOp, size_t * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_get_VOID (GxB_IndexBinaryOp, void * , - GrB_Field) ; - -GrB_Info GrB_Monoid_get_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Monoid_get_String (GrB_Monoid, char * , GrB_Field) ; -GrB_Info GrB_Monoid_get_INT32 (GrB_Monoid, int32_t * , GrB_Field) ; -GrB_Info GrB_Monoid_get_SIZE (GrB_Monoid, size_t * , GrB_Field) ; -GrB_Info GrB_Monoid_get_VOID (GrB_Monoid, void * , GrB_Field) ; - -GrB_Info GrB_Semiring_get_Scalar (GrB_Semiring, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Semiring_get_String (GrB_Semiring, char * , GrB_Field) ; -GrB_Info GrB_Semiring_get_INT32 (GrB_Semiring, int32_t * , GrB_Field) ; -GrB_Info GrB_Semiring_get_SIZE (GrB_Semiring, size_t * , GrB_Field) ; -GrB_Info GrB_Semiring_get_VOID (GrB_Semiring, void * , GrB_Field) ; - -GrB_Info GrB_Descriptor_get_Scalar (GrB_Descriptor, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Descriptor_get_String (GrB_Descriptor, char * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_INT32 (GrB_Descriptor, int32_t * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_SIZE (GrB_Descriptor, size_t * , GrB_Field) ; -GrB_Info GrB_Descriptor_get_VOID (GrB_Descriptor, void * , GrB_Field) ; - -GrB_Info GrB_Type_get_Scalar (GrB_Type, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Type_get_String (GrB_Type, char * , GrB_Field) ; -GrB_Info GrB_Type_get_INT32 (GrB_Type, int32_t * , GrB_Field) ; -GrB_Info GrB_Type_get_SIZE (GrB_Type, size_t * , GrB_Field) ; -GrB_Info GrB_Type_get_VOID (GrB_Type, void * , GrB_Field) ; - -GrB_Info GrB_Global_get_Scalar (GrB_Global, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Global_get_String (GrB_Global, char * , GrB_Field) ; -GrB_Info GrB_Global_get_INT32 (GrB_Global, int32_t * , GrB_Field) ; -GrB_Info GrB_Global_get_SIZE (GrB_Global, size_t * , GrB_Field) ; -GrB_Info GrB_Global_get_VOID (GrB_Global, void * , GrB_Field) ; - -GrB_Info GxB_Context_get_Scalar (GxB_Context, GrB_Scalar, GrB_Field) ; -GrB_Info GxB_Context_get_String (GxB_Context, char * , GrB_Field) ; -GrB_Info GxB_Context_get_INT (GxB_Context, int32_t * , GrB_Field) ; -GrB_Info GxB_Context_get_SIZE (GxB_Context, size_t * , GrB_Field) ; -GrB_Info GxB_Context_get_VOID (GxB_Context, void * , GrB_Field) ; - -// GrB_get (object, value, field): -#if GxB_STDC_VERSION >= 201112L -#define GrB_get(object,value,...) \ - _Generic \ - ( \ - (object), \ - GrB_Scalar : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Scalar_get_Scalar , \ - char * : GrB_Scalar_get_String , \ - int32_t * : GrB_Scalar_get_INT32 , \ - size_t * : GrB_Scalar_get_SIZE , \ - void * : GrB_Scalar_get_VOID \ - ) , \ - GrB_Vector : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Vector_get_Scalar , \ - char * : GrB_Vector_get_String , \ - int32_t * : GrB_Vector_get_INT32 , \ - size_t * : GrB_Vector_get_SIZE , \ - void * : GrB_Vector_get_VOID \ - ) , \ - GrB_Matrix : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Matrix_get_Scalar , \ - char * : GrB_Matrix_get_String , \ - int32_t * : GrB_Matrix_get_INT32 , \ - size_t * : GrB_Matrix_get_SIZE , \ - void * : GrB_Matrix_get_VOID \ - ) , \ - GrB_UnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_UnaryOp_get_Scalar , \ - char * : GrB_UnaryOp_get_String , \ - int32_t * : GrB_UnaryOp_get_INT32 , \ - size_t * : GrB_UnaryOp_get_SIZE , \ - void * : GrB_UnaryOp_get_VOID \ - ) , \ - GrB_IndexUnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_IndexUnaryOp_get_Scalar , \ - char * : GrB_IndexUnaryOp_get_String , \ - int32_t * : GrB_IndexUnaryOp_get_INT32 , \ - size_t * : GrB_IndexUnaryOp_get_SIZE , \ - void * : GrB_IndexUnaryOp_get_VOID \ - ) , \ - GrB_BinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_BinaryOp_get_Scalar , \ - char * : GrB_BinaryOp_get_String , \ - int32_t * : GrB_BinaryOp_get_INT32 , \ - size_t * : GrB_BinaryOp_get_SIZE , \ - void * : GrB_BinaryOp_get_VOID \ - ) , \ - GxB_IndexBinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ - char * : GxB_IndexBinaryOp_get_String , \ - int32_t * : GxB_IndexBinaryOp_get_INT32 , \ - size_t * : GxB_IndexBinaryOp_get_SIZE , \ - void * : GxB_IndexBinaryOp_get_VOID \ - ) , \ - GrB_Monoid : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Monoid_get_Scalar , \ - char * : GrB_Monoid_get_String , \ - int32_t * : GrB_Monoid_get_INT32 , \ - size_t * : GrB_Monoid_get_SIZE , \ - void * : GrB_Monoid_get_VOID \ - ) , \ - GrB_Semiring : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Semiring_get_Scalar , \ - char * : GrB_Semiring_get_String , \ - int32_t * : GrB_Semiring_get_INT32 , \ - size_t * : GrB_Semiring_get_SIZE , \ - void * : GrB_Semiring_get_VOID \ - ) , \ - GrB_Type : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Type_get_Scalar , \ - char * : GrB_Type_get_String , \ - int32_t * : GrB_Type_get_INT32 , \ - size_t * : GrB_Type_get_SIZE , \ - void * : GrB_Type_get_VOID \ - ) , \ - GrB_Descriptor : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Descriptor_get_Scalar , \ - char * : GrB_Descriptor_get_String , \ - int32_t * : GrB_Descriptor_get_INT32 , \ - size_t * : GrB_Descriptor_get_SIZE , \ - void * : GrB_Descriptor_get_VOID \ - ) , \ - GrB_Global : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Global_get_Scalar , \ - char * : GrB_Global_get_String , \ - int32_t * : GrB_Global_get_INT32 , \ - size_t * : GrB_Global_get_SIZE , \ - void * : GrB_Global_get_VOID \ - ) , \ - GxB_Context : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Context_get_Scalar , \ - char * : GxB_Context_get_String , \ - int32_t * : GxB_Context_get_INT , \ - size_t * : GxB_Context_get_SIZE , \ - void * : GxB_Context_get_VOID \ - ) , \ - const void *: \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Serialized_get_Scalar , \ - char * : GxB_Serialized_get_String , \ - int32_t * : GxB_Serialized_get_INT32 , \ - size_t * : GxB_Serialized_get_SIZE , \ - void * : GxB_Serialized_get_VOID \ - ) , \ - void *: \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Serialized_get_Scalar , \ - char * : GxB_Serialized_get_String , \ - int32_t * : GxB_Serialized_get_INT32 , \ - size_t * : GxB_Serialized_get_SIZE , \ - void * : GxB_Serialized_get_VOID \ - ) \ - ) (object, value, __VA_ARGS__) -#endif - -//------------------------------------------------------------------------------ -// GrB_set: set a scalar, string, enum, size, or void * of an object -//------------------------------------------------------------------------------ - -GrB_Info GrB_Scalar_set_Scalar (GrB_Scalar, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Scalar_set_String (GrB_Scalar, char * , GrB_Field) ; -GrB_Info GrB_Scalar_set_INT32 (GrB_Scalar, int32_t , GrB_Field) ; -GrB_Info GrB_Scalar_set_VOID (GrB_Scalar, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Vector_set_Scalar (GrB_Vector, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Vector_set_String (GrB_Vector, char * , GrB_Field) ; -GrB_Info GrB_Vector_set_INT32 (GrB_Vector, int32_t , GrB_Field) ; -GrB_Info GrB_Vector_set_VOID (GrB_Vector, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Matrix_set_Scalar (GrB_Matrix, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Matrix_set_String (GrB_Matrix, char * , GrB_Field) ; -GrB_Info GrB_Matrix_set_INT32 (GrB_Matrix, int32_t , GrB_Field) ; -GrB_Info GrB_Matrix_set_VOID (GrB_Matrix, void * , GrB_Field, size_t) ; - -GrB_Info GrB_UnaryOp_set_Scalar (GrB_UnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_UnaryOp_set_String (GrB_UnaryOp, char * , GrB_Field) ; -GrB_Info GrB_UnaryOp_set_INT32 (GrB_UnaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_UnaryOp_set_VOID (GrB_UnaryOp, void * , GrB_Field, size_t) ; - -GrB_Info GrB_IndexUnaryOp_set_Scalar (GrB_IndexUnaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_String (GrB_IndexUnaryOp, char * , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_INT32 (GrB_IndexUnaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_IndexUnaryOp_set_VOID (GrB_IndexUnaryOp, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_BinaryOp_set_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_BinaryOp_set_String (GrB_BinaryOp, char * , GrB_Field) ; -GrB_Info GrB_BinaryOp_set_INT32 (GrB_BinaryOp, int32_t , GrB_Field) ; -GrB_Info GrB_BinaryOp_set_VOID (GrB_BinaryOp, void * , GrB_Field, size_t) ; - -GrB_Info GxB_IndexBinaryOp_set_Scalar (GxB_IndexBinaryOp, GrB_Scalar, - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_String (GxB_IndexBinaryOp, char * , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_INT32 (GxB_IndexBinaryOp, int32_t , - GrB_Field) ; -GrB_Info GxB_IndexBinaryOp_set_VOID (GxB_IndexBinaryOp, void * , - GrB_Field, size_t) ; - -GrB_Info GrB_Monoid_set_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Monoid_set_String (GrB_Monoid, char * , GrB_Field) ; -GrB_Info GrB_Monoid_set_INT32 (GrB_Monoid, int32_t , GrB_Field) ; -GrB_Info GrB_Monoid_set_VOID (GrB_Monoid, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Semiring_set_Scalar (GrB_Semiring, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Semiring_set_String (GrB_Semiring, char * , GrB_Field) ; -GrB_Info GrB_Semiring_set_INT32 (GrB_Semiring, int32_t , GrB_Field) ; -GrB_Info GrB_Semiring_set_VOID (GrB_Semiring, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Descriptor_set_Scalar (GrB_Descriptor, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Descriptor_set_String (GrB_Descriptor, char * , GrB_Field) ; -GrB_Info GrB_Descriptor_set_INT32 (GrB_Descriptor, int32_t , GrB_Field) ; -GrB_Info GrB_Descriptor_set_VOID (GrB_Descriptor, void * , GrB_Field, - size_t) ; - -GrB_Info GrB_Type_set_Scalar (GrB_Type, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Type_set_String (GrB_Type, char * , GrB_Field) ; -GrB_Info GrB_Type_set_INT32 (GrB_Type, int32_t , GrB_Field) ; -GrB_Info GrB_Type_set_VOID (GrB_Type, void * , GrB_Field, size_t) ; - -GrB_Info GrB_Global_set_Scalar (GrB_Global, GrB_Scalar, GrB_Field) ; -GrB_Info GrB_Global_set_String (GrB_Global, char * , GrB_Field) ; -GrB_Info GrB_Global_set_INT32 (GrB_Global, int32_t , GrB_Field) ; -GrB_Info GrB_Global_set_VOID (GrB_Global, void * , GrB_Field, size_t) ; - -GrB_Info GxB_Context_set_Scalar (GxB_Context, GrB_Scalar, GrB_Field) ; -GrB_Info GxB_Context_set_String (GxB_Context, char * , GrB_Field) ; -GrB_Info GxB_Context_set_INT (GxB_Context, int32_t , GrB_Field) ; -GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; - -// GrB_set (object, value, field) or (object, value, field, size) for _VOID -#if GxB_STDC_VERSION >= 201112L -#define GrB_set(object,value,...) \ - _Generic \ - ( \ - (object), \ - GrB_Scalar : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Scalar_set_Scalar , \ - char * : GrB_Scalar_set_String , \ - int32_t : GrB_Scalar_set_INT32 , \ - void * : GrB_Scalar_set_VOID \ - ) , \ - GrB_Vector : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Vector_set_Scalar , \ - char * : GrB_Vector_set_String , \ - int32_t : GrB_Vector_set_INT32 , \ - void * : GrB_Vector_set_VOID \ - ) , \ - GrB_Matrix : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Matrix_set_Scalar , \ - char * : GrB_Matrix_set_String , \ - int32_t : GrB_Matrix_set_INT32 , \ - void * : GrB_Matrix_set_VOID \ - ) , \ - GrB_UnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_UnaryOp_set_Scalar , \ - char * : GrB_UnaryOp_set_String , \ - int32_t : GrB_UnaryOp_set_INT32 , \ - void * : GrB_UnaryOp_set_VOID \ - ) , \ - GrB_IndexUnaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_IndexUnaryOp_set_Scalar , \ - char * : GrB_IndexUnaryOp_set_String , \ - int32_t : GrB_IndexUnaryOp_set_INT32 , \ - void * : GrB_IndexUnaryOp_set_VOID \ - ) , \ - GrB_BinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_BinaryOp_set_Scalar , \ - char * : GrB_BinaryOp_set_String , \ - int32_t : GrB_BinaryOp_set_INT32 , \ - void * : GrB_BinaryOp_set_VOID \ - ) , \ - GxB_IndexBinaryOp : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ - char * : GxB_IndexBinaryOp_set_String , \ - int32_t : GxB_IndexBinaryOp_set_INT32 , \ - void * : GxB_IndexBinaryOp_set_VOID \ - ) , \ - GrB_Monoid : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Monoid_set_Scalar , \ - char * : GrB_Monoid_set_String , \ - int32_t : GrB_Monoid_set_INT32 , \ - void * : GrB_Monoid_set_VOID \ - ) , \ - GrB_Semiring : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Semiring_set_Scalar , \ - char * : GrB_Semiring_set_String , \ - int32_t : GrB_Semiring_set_INT32 , \ - void * : GrB_Semiring_set_VOID \ - ) , \ - GrB_Type : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Type_set_Scalar , \ - char * : GrB_Type_set_String , \ - int32_t : GrB_Type_set_INT32 , \ - void * : GrB_Type_set_VOID \ - ) , \ - GrB_Descriptor : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Descriptor_set_Scalar , \ - char * : GrB_Descriptor_set_String , \ - int32_t : GrB_Descriptor_set_INT32 , \ - void * : GrB_Descriptor_set_VOID \ - ) , \ - GrB_Global : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GrB_Global_set_Scalar , \ - char * : GrB_Global_set_String , \ - int32_t : GrB_Global_set_INT32 , \ - void * : GrB_Global_set_VOID \ - ) , \ - GxB_Context : \ - _Generic \ - ( \ - (value), \ - GrB_Scalar : GxB_Context_set_Scalar , \ - char * : GxB_Context_set_String , \ - int32_t : GxB_Context_set_INT , \ - void * : GxB_Context_set_VOID \ - ) \ - ) (object, value, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_free: free any GraphBLAS object -//============================================================================== - -#if GxB_STDC_VERSION >= 201112L -#define GrB_free(object) \ - _Generic \ - ( \ - (object), \ - GrB_Type *: GrB_Type_free , \ - GrB_UnaryOp *: GrB_UnaryOp_free , \ - GrB_BinaryOp *: GrB_BinaryOp_free , \ - GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ - GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ - GrB_Monoid *: GrB_Monoid_free , \ - GrB_Semiring *: GrB_Semiring_free , \ - GrB_Scalar *: GrB_Scalar_free , \ - GrB_Vector *: GrB_Vector_free , \ - GrB_Matrix *: GrB_Matrix_free , \ - GrB_Descriptor *: GrB_Descriptor_free , \ - GxB_Context *: GxB_Context_free , \ - GxB_Iterator *: GxB_Iterator_free \ - ) \ - (object) -#endif - -//============================================================================== -// GrB_wait: finish computations -//============================================================================== - -// Finish all pending work in a specific object. - -GrB_Info GrB_Type_wait (GrB_Type type , GrB_WaitMode waitmode); -GrB_Info GrB_UnaryOp_wait (GrB_UnaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_BinaryOp_wait (GrB_BinaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_IndexUnaryOp_wait (GrB_IndexUnaryOp op , GrB_WaitMode waitmode); -GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op , GrB_WaitMode waitmode); -GrB_Info GrB_Monoid_wait (GrB_Monoid monoid , GrB_WaitMode waitmode); -GrB_Info GrB_Semiring_wait (GrB_Semiring semiring, GrB_WaitMode waitmode); -GrB_Info GrB_Descriptor_wait (GrB_Descriptor desc , GrB_WaitMode waitmode); -GrB_Info GrB_Scalar_wait (GrB_Scalar s , GrB_WaitMode waitmode); -GrB_Info GrB_Vector_wait (GrB_Vector v , GrB_WaitMode waitmode); -GrB_Info GrB_Matrix_wait (GrB_Matrix A , GrB_WaitMode waitmode); -GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); - -// GrB_wait (object,waitmode) polymorphic function: -#if GxB_STDC_VERSION >= 201112L -#define GrB_wait(object,waitmode) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GrB_Type_wait , \ - GrB_UnaryOp : GrB_UnaryOp_wait , \ - GrB_BinaryOp : GrB_BinaryOp_wait , \ - GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ - GrB_Monoid : GrB_Monoid_wait , \ - GrB_Semiring : GrB_Semiring_wait , \ - GrB_Scalar : GrB_Scalar_wait , \ - GrB_Vector : GrB_Vector_wait , \ - GrB_Matrix : GrB_Matrix_wait , \ - GxB_Context : GxB_Context_wait , \ - GrB_Descriptor : GrB_Descriptor_wait \ - ) \ - (object, waitmode) -#endif - -//============================================================================== -// GrB_error: error handling -//============================================================================== - -// Each GraphBLAS method and operation returns a GrB_Info error code. -// GrB_error returns additional information on the error in a thread-safe -// null-terminated string. The string returned by GrB_error is owned by -// the GraphBLAS library and must not be free'd. - -GrB_Info GrB_Type_error (const char **error, const GrB_Type type) ; -GrB_Info GrB_UnaryOp_error (const char **error, const GrB_UnaryOp op) ; -GrB_Info GrB_BinaryOp_error (const char **error, const GrB_BinaryOp op) ; -GrB_Info GrB_IndexUnaryOp_error (const char **error, - const GrB_IndexUnaryOp op) ; -GrB_Info GxB_IndexBinaryOp_error(const char **error, - const GxB_IndexBinaryOp op); -GrB_Info GrB_Monoid_error (const char **error, const GrB_Monoid monoid) ; -GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring - semiring) ; -GrB_Info GrB_Scalar_error (const char **error, const GrB_Scalar s) ; -GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) ; -GrB_Info GrB_Matrix_error (const char **error, const GrB_Matrix A) ; -GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor d) ; -GrB_Info GxB_Context_error (const char **error, const GxB_Context c) ; - -// GrB_error (error,object) polymorphic function: -#if GxB_STDC_VERSION >= 201112L -#define GrB_error(error,object) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GrB_Type_error , \ - GrB_UnaryOp : GrB_UnaryOp_error , \ - GrB_BinaryOp : GrB_BinaryOp_error , \ - GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ - GrB_Monoid : GrB_Monoid_error , \ - GrB_Semiring : GrB_Semiring_error , \ - GrB_Scalar : GrB_Scalar_error , \ - GrB_Vector : GrB_Vector_error , \ - GrB_Matrix : GrB_Matrix_error , \ - GxB_Context : GxB_Context_error , \ - GrB_Descriptor : GrB_Descriptor_error \ - ) \ - (error, object) -#endif - -//============================================================================== -// GrB_mxm, vxm, mxv: matrix multiplication over a semiring -//============================================================================== - -// No accum operator in any method can be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_mxm // C = accum (C, A*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_vxm // w' = accum (w, u'*A) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for u'*A - const GrB_Vector u, // first input: vector u - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -GrB_Info GrB_mxv // w = accum (w, A*u) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' and '*' for A*B - const GrB_Matrix A, // first input: matrix A - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -//============================================================================== -// GrB_eWiseMult: element-wise matrix and vector operations, set intersection -//============================================================================== - -// GrB_eWiseMult computes C = accum (C, A.*B), where ".*" is the Hadamard -// product, and where pairs of elements in two matrices (or vectors) are -// pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). - -// The mult operator can be based on a GxB_IndexBinaryOp. - -GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp mult, // defines '.*' for t=u.*v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp mult, // defines '.*' for T=A.*B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -// All 6 of the above type-specific functions are captured in a single -// type-generic function, GrB_eWiseMult: - -#if GxB_STDC_VERSION >= 201112L -#define GrB_eWiseMult(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_eWiseMult_Semiring , \ - GrB_Monoid : GrB_Matrix_eWiseMult_Monoid , \ - GrB_BinaryOp : GrB_Matrix_eWiseMult_BinaryOp \ - ), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Vector_eWiseMult_Semiring , \ - GrB_Monoid : GrB_Vector_eWiseMult_Monoid , \ - GrB_BinaryOp : GrB_Vector_eWiseMult_BinaryOp \ - ) \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GrB_eWiseAdd: element-wise matrix and vector operations, set union -//============================================================================== - -// GrB_eWiseAdd computes C = accum (C, A+B), where pairs of elements in -// two matrices (or two vectors) are pairwise "added". - -GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Semiring semiring, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Vector v, // second input: vector v - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GrB_eWiseAdd(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_eWiseAdd_Semiring , \ - GrB_Monoid : GrB_Matrix_eWiseAdd_Monoid , \ - GrB_BinaryOp : GrB_Matrix_eWiseAdd_BinaryOp \ - ), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Vector_eWiseAdd_Semiring , \ - GrB_Monoid : GrB_Vector_eWiseAdd_Monoid , \ - GrB_BinaryOp : GrB_Vector_eWiseAdd_BinaryOp \ - ) \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GxB_eWiseUnion: a variant of GrB_eWiseAdd -//============================================================================== - -// GxB_eWiseUnion is a variant of eWiseAdd. The methods create a result with -// the same sparsity structure. They differ when an entry is present in A but -// not B, or in B but not A. - -// eWiseAdd does the following, for a matrix, where "+" is the add binary op: - -// if A(i,j) and B(i,j) are both present: -// C(i,j) = A(i,j) + B(i,j) -// else if A(i,j) is present but not B(i,j) -// C(i,j) = A(i,j) -// else if B(i,j) is present but not A(i,j) -// C(i,j) = B(i,j) - -// by contrast, eWiseUnion always applies the operator: - -// if A(i,j) and B(i,j) are both present: -// C(i,j) = A(i,j) + B(i,j) -// else if A(i,j) is present but not B(i,j) -// C(i,j) = A(i,j) + beta -// else if B(i,j) is present but not A(i,j) -// C(i,j) = alpha + B(i,j) - -GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v - const GrB_Vector u, // first input: vector u - const GrB_Scalar alpha, - const GrB_Vector v, // second input: vector v - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar alpha, - const GrB_Matrix B, // second input: matrix B - const GrB_Scalar beta, - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GxB_eWiseUnion(C,Mask,accum,op,A,alpha,B,beta,desc) \ - _Generic \ - ( \ - (C), \ - GrB_Matrix : GxB_Matrix_eWiseUnion , \ - GrB_Vector : GxB_Vector_eWiseUnion \ - ) \ - (C, Mask, accum, op, A, alpha, B, beta, desc) -#endif - -//============================================================================== -// GrB_extract: extract a submatrix or subvector -//============================================================================== - -GrB_Info GrB_Vector_extract // w = accum (w, u(I)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -// GrB_extract is a generic interface to the following functions: - -// GrB_Vector_extract (w,mask,acc,u,I,ni,d) // w = acc (w, u(I)) -// GrB_Col_extract (w,mask,acc,A,I,ni,j,d) // w = acc (w, A(I,j)) -// GrB_Matrix_extract (C,Mask,acc,A,I,ni,J,nj,d) // C = acc (C, A(I,J)) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_extract(arg1,Mask,accum,arg4,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GrB_Vector : GrB_Vector_extract , \ - GrB_Matrix : GrB_Col_extract \ - ), \ - GrB_Matrix : GrB_Matrix_extract \ - ) \ - (arg1, Mask, accum, arg4, __VA_ARGS__) -#endif - -//============================================================================== -// GxB_subassign: matrix and vector subassign: C(I,J) = accum (C(I,J), A) -//============================================================================== - -// Assign entries in a matrix or vector; C(I,J) = A. - -// Each GxB_subassign function is very similar to its corresponding GrB_assign -// function in the spec, but they differ in two ways: (1) the mask in -// GxB_subassign has the same size as w(I) for vectors and C(I,J) for matrices, -// and (2) they differ in the GrB_REPLACE option. See the user guide for -// details. - -// In GraphBLAS notation, the two methods can be described as follows: - -// matrix and vector subassign: C(I,J) = accum (C(I,J), A) -// matrix and vector assign: C(I,J) = accum (C(I,J), A) - -// --- assign ------------------------------------------------------------------ -// -// GrB_Matrix_assign C(I,J) += A M same size as matrix C. -// A is |I|-by-|J| -// -// GrB_Vector_assign w(I) += u m same size as column vector w. -// u is |I|-by-1 -// -// GrB_Row_assign C(i,J) += u' m is a column vector the same -// size as a row of C. -// u is |J|-by-1, i is a scalar. -// -// GrB_Col_assign C(I,j) += u m is a column vector the same -// size as a column of C. -// u is |I|-by-1, j is a scalar. -// -// --- subassign --------------------------------------------------------------- -// -// GxB_Matrix_subassign C(I,J) += A M same size as matrix A. -// A is |I|-by-|J| -// -// GxB_Vector_subassign w(I) += u m same size as column vector u. -// u is |I|-by-1 -// -// GxB_Row_subassign C(i,J) += u' m same size as column vector u. -// u is |J|-by-1, i is a scalar. -// -// GxB_Col_subassign C(I,j) += u m same size as column vector u. -// u is |I|-by-1, j is a scalar. - -GrB_Info GxB_Vector_subassign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Matrix_subassign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J), Mask, and A -) ; - -GrB_Info GxB_Col_subassign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(I,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(I,j) and mask -) ; - -GrB_Info GxB_Row_subassign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - GrB_Index i, // row index - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,J) and mask -) ; - -//------------------------------------------------------------------------------ -// GxB_Vector_subassign_[SCALAR]: scalar expansion assignment to subvector -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The -// scalar x is implicitly expanded into a vector u of size ni-by-1, with each -// entry in u equal to x, and then w(I) = accum(w(I),u) is done. - -GrB_Info GxB_Vector_subassign_BOOL // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - bool x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_INT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UINT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FP32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - float x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FP64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - double x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FC32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_FC64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_UDT // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - void *x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w(I), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w(I) and mask -) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_subassign_[SCALAR]: scalar expansion assignment to submatrix -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The -// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each -// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. - -GrB_Info GxB_Matrix_subassign_BOOL // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - bool x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_INT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UINT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FP32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - float x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FP64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - double x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FC32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_FC64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_UDT // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - void *x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C(I,J), unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(I,J) and Mask -) ; - -//------------------------------------------------------------------------------ -// GxB_subassign: generic submatrix/subvector assignment -//------------------------------------------------------------------------------ - -// GxB_subassign is a generic function that provides access to all specific -// GxB_*_subassign* functions: - -// GxB_Vector_subassign (w,m,acc,u,I,ni,d) // w(I) = acc(w(I),u) -// GxB_Matrix_subassign (C,M,acc,A,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),A) -// GxB_Col_subassign (C,m,acc,u,I,ni,j,d) // C(I,j) = acc(C(I,j),u) -// GxB_Row_subassign (C,m,acc,u,i,J,nj,d) // C(i,J) = acc(C(i,J),u') -// GxB_Vector_subassign_T (w,m,acc,x,I,ni,d) // w(I) = acc(w(I),x) -// GxB_Matrix_subassign_T (C,M,acc,x,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),x) - -#if GxB_STDC_VERSION >= 201112L -#define GxB_subassign(arg1,Mask,accum,arg4,arg5,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GxB, Vector_subassign) , \ - GrB_Scalar : GxB_Vector_subassign_Scalar, \ - default: GxB_Vector_subassign \ - ), \ - default: \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GxB, Matrix_subassign) , \ - GrB_Scalar : GxB_Matrix_subassign_Scalar, \ - GrB_Vector : \ - _Generic \ - ( \ - (arg5), \ - const GrB_Index *: GxB_Col_subassign , \ - GrB_Index *: GxB_Col_subassign , \ - default: GxB_Row_subassign \ - ), \ - default: GxB_Matrix_subassign \ - ) \ - ) \ - (arg1, Mask, accum, arg4, arg5, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_assign: matrix and vector assign: C(I,J) = accum (C(I,J), A) -//============================================================================== - -// Assign entries in a matrix or vector; C(I,J) = A. -// Each of these can be used with their generic name, GrB_assign. - -GrB_Info GrB_Vector_assign // w(I) = accum (w(I),u) -( - GrB_Vector w, // input/output matrix for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) - const GrB_Vector u, // first input: vector u - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_assign // C(I,J) = accum (C(I,J),A) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -GrB_Info GrB_Col_assign // C(I,j) = accum (C(I,j),u) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(:,j), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) - const GrB_Vector u, // input vector - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for C(:,j) and mask -) ; - -GrB_Info GrB_Row_assign // C(i,J) = accum (C(i,J),u') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Vector mask, // optional mask for C(i,:), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) - const GrB_Vector u, // input vector - GrB_Index i, // row index - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C(i,:) and mask -) ; - -//------------------------------------------------------------------------------ -// GrB_Vector_assign_[SCALAR]: scalar expansion assignment to subvector -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a subvector, w(I) = accum(w(I),x). The -// scalar x is implicitly expanded into a vector u of size ni-by-1, with each -// entry in u equal to x, and then w(I) = accum(w(I),u) is done. - -GrB_Info GrB_Vector_assign_BOOL // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w(I),x) - bool x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT8 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint8_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT16 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint16_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_INT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - int64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UINT64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - uint64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_FP32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - float x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_FP64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - double x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_assign_FC32 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC32_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_assign_FC64 // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GxB_FC64_t x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_UDT // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - void *x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),x) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar x, // scalar to assign to w(I) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------------------------------------------ -// GrB_Matrix_assign_[SCALAR]: scalar expansion assignment to submatrix -//------------------------------------------------------------------------------ - -// Assigns a single scalar to a submatrix, C(I,J) = accum(C(I,J),x). The -// scalar x is implicitly expanded into a matrix A of size ni-by-nj, with each -// entry in A equal to x, and then C(I,J) = accum(C(I,J),A) is done. - -GrB_Info GrB_Matrix_assign_BOOL // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - bool x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT8 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint8_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT16 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint16_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_INT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - int64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UINT64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - uint64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_FP32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - float x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_FP64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - double x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GxB_Matrix_assign_FC32 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC32_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GxB_Matrix_assign_FC64 // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GxB_FC64_t x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_UDT // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - void *x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),x) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar x, // scalar to assign to C(I,J) - const GrB_Index *Ilist, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C and Mask -) ; - -//------------------------------------------------------------------------------ -// GrB_assign: generic submatrix/subvector assignment -//------------------------------------------------------------------------------ - -// GrB_assign is a generic function that provides access to all specific -// GrB_*_assign* functions: - -// GrB_Vector_assign_T (w,m,acc,x,I,ni,d) // w(I) = acc(w(I),x) -// GrB_Vector_assign (w,m,acc,u,I,ni,d) // w(I) = acc(w(I),u) -// GrB_Matrix_assign_T (C,M,acc,x,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),x) -// GrB_Col_assign (C,m,acc,u,I,ni,j,d) // C(I,j) = acc(C(I,j),u) -// GrB_Row_assign (C,m,acc,u,i,J,nj,d) // C(i,J) = acc(C(i,J),u') -// GrB_Matrix_assign (C,M,acc,A,I,ni,J,nj,d) // C(I,J) = acc(C(I,J),A) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_assign(arg1,Mask,accum,arg4,arg5,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GrB, Vector_assign) , \ - GrB_Scalar : GrB_Vector_assign_Scalar , \ - default: GrB_Vector_assign \ - ), \ - default: \ - _Generic \ - ( \ - (arg4), \ - GB_CASES (GrB, Matrix_assign) , \ - GrB_Scalar : GrB_Matrix_assign_Scalar , \ - GrB_Vector : \ - _Generic \ - ( \ - (arg5), \ - const GrB_Index *: GrB_Col_assign , \ - GrB_Index *: GrB_Col_assign , \ - default: GrB_Row_assign \ - ), \ - default: GrB_Matrix_assign \ - ) \ - ) \ - (arg1, Mask, accum, arg4, arg5, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_apply: matrix and vector apply -//============================================================================== - -// Apply a unary, index_unary, or binary operator to entries in a matrix or -// vector, C = accum (C, op (A)). - -GrB_Info GrB_Vector_apply // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Matrix_apply // C = accum (C, op(A)) or op(A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_UnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// vector apply: binaryop variants (bind 1st) -//------------------------------------------- - -// Apply a binary operator to the entries in a vector, binding the first -// input to a scalar x, w = accum (w, op (x,u)). - -GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - bool x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT8 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int8_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT16 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int16_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_INT64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - int64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint8_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint16_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - uint64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_FP32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - float x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_FP64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - double x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp1st_FC32 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC32_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp1st_FC64 // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC64_t x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp1st_UDT // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const void *x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// vector apply: binaryop variants (bind 2nd) -//------------------------------------------- - -// Apply a binary operator to the entries in a vector, binding the second -// input to a scalar y, w = accum (w, op (u,y)). - -GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64 // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// vector apply: IndexUnaryOp variants -//------------------------------------------- - -// Apply a GrB_IndexUnaryOp to the entries in a vector - -GrB_Info GrB_Vector_apply_IndexOp_Scalar // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_BOOL // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_INT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UINT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_FP32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_FP64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_IndexOp_FC32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_apply_IndexOp_FC64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_apply_IndexOp_UDT // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// matrix apply: binaryop variants (bind 1st) -//------------------------------------------- - -// Apply a binary operator to the entries in a matrix, binding the first input -// to a scalar x, C = accum (C, op (x,A)), or op(x,A'). - -GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - bool x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int8_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int16_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - int64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint8_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint16_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - uint64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - float x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - double x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC32_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64 // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - GxB_FC64_t x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const void *x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// matrix apply: binaryop variants (bind 2nd) -//------------------------------------------- - -// Apply a binary operator to the entries in a matrix, binding the second input -// to a scalar y, C = accum (C, op (A,y)), or op(A',y). - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64 // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------- -// matrix apply: IndexUnaryOp variants -//------------------------------------------- - -// Apply a GrB_IndexUnaryOp to the entries in a matrix. - -GrB_Info GrB_Matrix_apply_IndexOp_Scalar // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_BOOL // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_INT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UINT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_FP32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_FP64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_IndexOp_FC32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_apply_IndexOp_FC64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_apply_IndexOp_UDT // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -//------------------------------------------------------------------------------ -// GrB_apply: generic matrix/vector apply -//------------------------------------------------------------------------------ - -// GrB_apply is a generic function for applying a unary operator to a matrix -// or vector and provides access to these functions: - -// GrB_Vector_apply (w,mask,acc,op,u,d) // w = accum (w, op(u)) -// GrB_Matrix_apply (C,Mask,acc,op,A,d) // C = accum (C, op(A)) - -// GrB_Vector_apply (w,m,acc,unop ,u,d) -// GrB_Vector_apply_BinaryOp1st_TYPE (w,m,acc,binop,x,u,d) -// GrB_Vector_apply_BinaryOp2nd_TYPE (w,m,acc,binop,u,y,d) -// GrB_Vector_apply_IndexOp_TYPE (w,m,acc,idxop,u,y,d) - -// GrB_Matrix_apply (C,M,acc,unop ,A,d) -// GrB_Matrix_apply_BinaryOp1st_TYPE (C,M,acc,binop,x,A,d) -// GrB_Matrix_apply_BinaryOp2nd_TYPE (C,M,acc,binop,A,y,d) -// GrB_Matrix_apply_IndexOp_TYPE (C,M,acc,idxop,A,y,d) - -#if GxB_STDC_VERSION >= 201112L - -#define GB_BIND(kind,x,y,...) \ - _Generic \ - ( \ - (x), \ - GrB_Scalar: GB_CONCAT ( GrB,_,kind,_apply_BinaryOp1st_Scalar), \ - GB_CASES (GrB, GB_CONCAT ( kind, _apply_BinaryOp1st,, )) , \ - default: \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, GB_CONCAT ( kind , _apply_BinaryOp2nd,, )), \ - default: GB_CONCAT ( GrB,_,kind,_apply_BinaryOp2nd_Scalar) \ - ) \ - ) - -#define GB_IDXOP(kind,A,y,...) \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, GB_CONCAT ( kind, _apply_IndexOp,, )), \ - default: GB_CONCAT ( GrB, _, kind, _apply_IndexOp_Scalar) \ - ) - -#define GrB_apply(C,Mask,accum,op,...) \ - _Generic \ - ( \ - (C), \ - GrB_Vector : \ - _Generic \ - ( \ - (op), \ - GrB_UnaryOp : GrB_Vector_apply , \ - GrB_BinaryOp : GB_BIND (Vector, __VA_ARGS__), \ - GrB_IndexUnaryOp : GB_IDXOP (Vector, __VA_ARGS__) \ - ), \ - GrB_Matrix : \ - _Generic \ - ( \ - (op), \ - GrB_UnaryOp : GrB_Matrix_apply , \ - GrB_BinaryOp : GB_BIND (Matrix, __VA_ARGS__), \ - GrB_IndexUnaryOp : GB_IDXOP (Matrix, __VA_ARGS__) \ - ) \ - ) \ - (C, Mask, accum, op, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_select: matrix and vector selection using an IndexUnaryOp -//============================================================================== - -//------------------------------------------- -// vector select using an IndexUnaryOp -//------------------------------------------- - -GrB_Info GrB_Vector_select_Scalar // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_BOOL // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_INT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT8 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT16 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UINT64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_FP32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_FP64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_select_FC32 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GxB_Vector_select_FC64 // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -GrB_Info GrB_Vector_select_UDT // w = accum (w, op(u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - -//------------------------------------------- -// matrix select using an IndexUnaryOp -//------------------------------------------- - -GrB_Info GrB_Matrix_select_Scalar // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_BOOL // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - bool y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_INT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - int64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT8 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint8_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT16 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint16_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UINT64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - uint64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_FP32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - float y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_FP64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - double y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_select_FC32 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC32_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GxB_Matrix_select_FC64 // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - GxB_FC64_t y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -GrB_Info GrB_Matrix_select_UDT // C=accum(C,op(A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_IndexUnaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const void *y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - -// GrB_select is a generic method that applies an IndexUnaryOp to -// a matrix or vector, using any type of the scalar y. - -// GrB_Vector_select_TYPE (w,m,acc,idxop,u,y,d) -// GrB_Matrix_select_TYPE (C,M,acc,idxop,A,y,d) - -#if GxB_STDC_VERSION >= 201112L -#define GrB_select(C,Mask,accum,op,x,y,d) \ - _Generic \ - ( \ - (C), \ - GrB_Vector : \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, Vector_select), \ - default: GrB_Vector_select_Scalar \ - ), \ - GrB_Matrix : \ - _Generic \ - ( \ - (y), \ - GB_CASES (GrB, Matrix_select), \ - default: GrB_Matrix_select_Scalar \ - ) \ - ) \ - (C, Mask, accum, op, x, y, d) -#endif - -//============================================================================== -// GrB_reduce: matrix and vector reduction -//============================================================================== - -// Reduce the entries in a matrix to a vector, a column vector t such that -// t(i) = sum (A (i,:)), and where "sum" is a commutative and associative -// monoid with an identity value. A can be transposed, which reduces down the -// columns instead of the rows. - -// For GrB_Matrix_reduce_BinaryOp, the GrB_BinaryOp op must correspond to a -// known built-in monoid: -// -// operator data-types (all built-in) -// ---------------------- --------------------------- -// MIN, MAX INT*, UINT*, FP* -// TIMES, PLUS INT*, UINT*, FP*, FC* -// ANY INT*, UINT*, FP*, FC*, BOOL -// LOR, LAND, LXOR, EQ BOOL -// BOR, BAND, BXOR, BXNOR UINT* - -GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Monoid monoid, // reduce operator for t=reduce(A) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -GrB_Info GrB_Matrix_reduce_BinaryOp // w = accum (w,reduce(A)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // reduce operator for t=reduce(A) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for w, mask, and A -) ; - -//------------------------------------------------------------------------------ -// reduce a vector to a scalar -//------------------------------------------------------------------------------ - -// Reduce entries in a vector to a scalar, c = accum (c, reduce_to_scalar(u)) - -GrB_Info GrB_Vector_reduce_BOOL // c = accum (c, reduce_to_scalar (u)) -( - bool *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT8 // c = accum (c, reduce_to_scalar (u)) -( - int8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT8 // c = accum (c, reduce_to_scalar (u)) -( - uint8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT16 // c = accum (c, reduce_to_scalar (u)) -( - int16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT16 // c = accum (c, reduce_to_scalar (u)) -( - uint16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT32 // c = accum (c, reduce_to_scalar (u)) -( - int32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT32 // c = accum (c, reduce_to_scalar (u)) -( - uint32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_INT64 // c = accum (c, reduce_to_scalar (u)) -( - int64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UINT64 // c = accum (c, reduce_to_scalar (u)) -( - uint64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_FP32 // c = accum (c, reduce_to_scalar (u)) -( - float *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_FP64 // c = accum (c, reduce_to_scalar (u)) -( - double *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Vector_reduce_FC32 // c = accum (c, reduce_to_scalar (u)) -( - GxB_FC32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Vector_reduce_FC64 // c = accum (c, reduce_to_scalar (u)) -( - GxB_FC64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_UDT // c = accum (c, reduce_to_scalar (u)) -( - void *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(u)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Vector_reduce_BinaryOp_Scalar -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_BinaryOp op, // binary op to do the reduction - const GrB_Vector u, // vector to reduce - const GrB_Descriptor desc -) ; - -//------------------------------------------------------------------------------ -// reduce a matrix to a scalar -//------------------------------------------------------------------------------ - -// Reduce entries in a matrix to a scalar, c = accum (c, reduce_to_scalar(A)) - -GrB_Info GrB_Matrix_reduce_BOOL // c = accum (c, reduce_to_scalar (A)) -( - bool *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT8 // c = accum (c, reduce_to_scalar (A)) -( - int8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT8 // c = accum (c, reduce_to_scalar (A)) -( - uint8_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT16 // c = accum (c, reduce_to_scalar (A)) -( - int16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT16 // c = accum (c, reduce_to_scalar (A)) -( - uint16_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT32 // c = accum (c, reduce_to_scalar (A)) -( - int32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT32 // c = accum (c, reduce_to_scalar (A)) -( - uint32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_INT64 // c = accum (c, reduce_to_scalar (A)) -( - int64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UINT64 // c = accum (c, reduce_to_scalar (A)) -( - uint64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_FP32 // c = accum (c, reduce_to_scalar (A)) -( - float *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_FP64 // c = accum (c, reduce_to_scalar (A)) -( - double *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Matrix_reduce_FC32 // c = accum (c, reduce_to_scalar (A)) -( - GxB_FC32_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GxB_Matrix_reduce_FC64 // c = accum (c, reduce_to_scalar (A)) -( - GxB_FC64_t *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_UDT // c = accum (c, reduce_to_scalar (A)) -( - void *c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(A)) -( - GrB_Scalar c, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar -( - GrB_Scalar S, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_BinaryOp op, // binary op to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) ; - -//------------------------------------------------------------------------------ -// GrB_reduce: generic matrix/vector reduction to a vector or scalar -//------------------------------------------------------------------------------ - -// GrB_reduce is a generic function that provides access to all GrB_*reduce* -// functions: - -// reduce matrix to vector: -// GrB_Matrix_reduce_Monoid (w,mask,acc,mo,A,d) // w = acc (w,reduce(A)) -// GrB_Matrix_reduce_BinaryOp (w,mask,acc,op,A,d) // w = acc (w,reduce(A)) - -// reduce matrix to scalar: -// GrB_Vector_reduce_[SCALAR] (c,acc,monoid,u,d) // c = acc (c,reduce(u)) -// GrB_Matrix_reduce_[SCALAR] (c,acc,monoid,A,d) // c = acc (c,reduce(A)) -// GrB_Vector_reduce_Monoid_Scalar (s,acc,monoid,u,d) // s = acc (s,reduce(u)) -// GrB_Matrix_reduce_Monoid_Scalar (s,acc,monoid,A,d) // s = acc (s,reduce(A)) -// GrB_Vector_reduce_BinaryOp_Scalar (s,acc,op,u,d) // s = acc (s,reduce(u)) -// GrB_Matrix_reduce_BinaryOp_Scalar (s,acc,op,A,d) // s = acc (s,reduce(A)) - -#if GxB_STDC_VERSION >= 201112L -#define GB_REDUCE_TO_SCALAR(kind,c,op) \ - _Generic \ - ( \ - (c), \ - GB_PCASES (GrB, GB_CONCAT ( kind, _reduce,, )), \ - default: \ - _Generic \ - ( \ - (op), \ - GrB_BinaryOp : \ - GB_CONCAT (GrB,_,kind,_reduce_BinaryOp_Scalar),\ - default: GB_CONCAT (GrB,_,kind,_reduce_Monoid_Scalar) \ - ) \ - ) - -#define GrB_reduce(arg1,arg2,arg3,arg4,...) \ - _Generic \ - ( \ - (arg4), \ - GrB_Vector : GB_REDUCE_TO_SCALAR (Vector, arg1, arg3), \ - GrB_Matrix : GB_REDUCE_TO_SCALAR (Matrix, arg1, arg3), \ - GrB_Monoid : GrB_Matrix_reduce_Monoid , \ - GrB_BinaryOp : GrB_Matrix_reduce_BinaryOp \ - ) \ - (arg1, arg2, arg3, arg4, __VA_ARGS__) -#endif - -//============================================================================== -// GrB_transpose: matrix transpose -//============================================================================== - -GrB_Info GrB_transpose // C = accum (C, A') -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Descriptor desc // descriptor for C, Mask, and A -) ; - -//============================================================================== -// GrB_kronecker: Kronecker product -//============================================================================== - -GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Monoid monoid, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Semiring semiring, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, M, A, and B -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GrB_kronecker(C,Mask,accum,op,A,B,desc) \ - _Generic \ - ( \ - (op), \ - GrB_Semiring : GrB_Matrix_kronecker_Semiring , \ - GrB_Monoid : GrB_Matrix_kronecker_Monoid , \ - GrB_BinaryOp : GrB_Matrix_kronecker_BinaryOp \ - ) \ - (C, Mask, accum, op, A, B, desc) -#endif - -//============================================================================== -// GrB_*_resize: change the size of a matrix or vector -//============================================================================== - -// If the dimensions decrease, entries that fall outside the resized matrix or -// vector are deleted. - -GrB_Info GrB_Matrix_resize // change the size of a matrix -( - GrB_Matrix C, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix -) ; - -GrB_Info GrB_Vector_resize // change the size of a vector -( - GrB_Vector w, // vector to modify - GrB_Index nrows_new // new number of rows in vector -) ; - -// GxB_resize is a generic function for resizing a matrix or vector: -// GrB_Vector_resize (u,nrows_new) -// GrB_Matrix_resize (A,nrows_new,ncols_new) -#if GxB_STDC_VERSION >= 201112L -#define GxB_resize(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : GrB_Vector_resize , \ - GrB_Matrix : GrB_Matrix_resize \ - ) \ - (arg1, __VA_ARGS__) -#endif - -//============================================================================== -// GxB_fprint and GxB_print: print the contents of a GraphBLAS object -//============================================================================== - -// GxB_fprint (object, GxB_Print_Level pr, FILE *f) prints the contents of any -// of the 9 GraphBLAS objects to the file f, and also does an extensive test on -// the object to determine if it is valid. It returns one of the following -// error conditions: -// -// GrB_SUCCESS object is valid -// GrB_UNINITIALIZED_OBJECT object is not initialized -// GrB_INVALID_OBJECT object is not valid -// GrB_NULL_POINTER object is a NULL pointer -// GrB_INVALID_VALUE fprintf returned an I/O error; see the ANSI C -// errno or GrB_error( )for details. -// -// GxB_fprint does not modify the status of any object. If a matrix or vector -// has not been completed, the pending computations are guaranteed to *not* be -// performed by GxB_fprint. The reason is simple. It is possible for a bug in -// the user application (such as accessing memory outside the bounds of an -// array) to mangle the internal content of a GraphBLAS object, and GxB_fprint -// can be a helpful tool to track down this bug. If GxB_fprint attempted to -// complete any computations prior to printing or checking the contents of the -// matrix or vector, then further errors could occur, including a segfault. -// -// The type-specific functions include an additional argument, the name string. -// The name is printed at the beginning of the display (assuming pr is not -// GxB_SILENT) so that the object can be more easily identified in the output. -// For the type-generic methods GxB_fprint and GxB_print, the name string is -// the variable name of the object itself. -// -// If f is NULL, stdout is used; this is not an error condition. If pr is -// outside the bounds 0 to 3, negative values are treated as GxB_SILENT, and -// values > 3 are treated as GxB_COMPLETE. If name is NULL, it is treated as -// the empty string. -// -// GxB_print (object, GxB_Print_Level pr) is the same as GxB_fprint, except -// that it prints the contents with printf instead of fprintf to a file f. -// -// The exact content and format of what is printed is implementation-dependent, -// and will change from version to version of SuiteSparse:GraphBLAS. Do not -// attempt to rely on the exact content or format by trying to parse the -// resulting output via another program. The intent of these functions is to -// produce a report of the object for visual inspection. - -GrB_Info GxB_Type_fprint // print and check a GrB_Type -( - GrB_Type type, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp -( - GrB_UnaryOp unaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp -( - GrB_BinaryOp binaryop, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp -( - GrB_IndexUnaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp -( - GxB_IndexBinaryOp op, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid -( - GrB_Monoid monoid, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring -( - GrB_Semiring semiring, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor -( - GrB_Descriptor descriptor, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix -( - GrB_Matrix A, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Vector_fprint // print and check a GrB_Vector -( - GrB_Vector v, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar -( - GrB_Scalar s, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -GrB_Info GxB_Context_fprint // print and check a GxB_Context -( - GxB_Context Context, // object to print and check - const char *name, // name of the object - GxB_Print_Level pr, // print level - FILE *f // file for output -) ; - -#if GxB_STDC_VERSION >= 201112L -#define GxB_fprint(object,pr,f) \ - _Generic \ - ( \ - (object), \ - GrB_Type : GxB_Type_fprint , \ - GrB_UnaryOp : GxB_UnaryOp_fprint , \ - GrB_BinaryOp : GxB_BinaryOp_fprint , \ - GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ - GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ - GrB_Monoid : GxB_Monoid_fprint , \ - GrB_Semiring : GxB_Semiring_fprint , \ - GrB_Scalar : GxB_Scalar_fprint , \ - GrB_Vector : GxB_Vector_fprint , \ - GrB_Matrix : GxB_Matrix_fprint , \ - GrB_Descriptor : GxB_Descriptor_fprint , \ - GxB_Context : GxB_Context_fprint \ - ) \ - (object, GB_STR(object), pr, f) - -#define GxB_print(object,pr) GxB_fprint(object,pr,NULL) -#endif - -//============================================================================== -// GxB_pack/GxB_unpack: Matrix and vector pack/unpack -//============================================================================== - -// The pack/unpack functions allow the user application to create a GrB_Matrix -// or GrB_Vector object, and to extract its contents, faster and with less -// memory overhead than the GrB_*_build and GrB_*_extractTuples functions. - -// The semantics of pack/unpack are the same as the "move constructor" in C++. -// On pack, the user provides a set of arrays that have been previously -// allocated via the ANSI C malloc function. The arrays define the content of -// the matrix or vector. Unlike GrB_*_build, the GraphBLAS library then takes -// ownership of the user's input arrays and may either (a) incorporate them -// into its internal data structure for the new GrB_Matrix or GrB_Vector, -// potentially creating the GrB_Matrix or GrB_Vector in constant time with no -// memory copying performed, or (b) if the library does not support the format -// directly, then it may convert the input to its internal format, and then -// free the user's input arrays. GraphBLAS may also choose to use a mix of the -// two strategies. In either case, the input arrays are no longer "owned" by -// the user application. If A is a GrB_Matrix created by a pack, the user -// input arrays are freed no later than GrB_free (&A), and may be freed -// earlier, at the discretion of the GraphBLAS library. The data structure of -// the GrB_Matrix and GrB_Vector remain opaque. - -// The unpack of a GrB_Matrix or GrB_Vector is symmetric with the pack -// operation. The GrB_Matrix or GrB_Vector exists after an unpack operation, -// just with no entries. For unpack, the user is returned several arrays that -// contain the matrix or vector in the requested format. Ownership of these -// arrays is given to the user application, which is then responsible for -// freeing them via the ANSI C free function. If the output format is -// supported by the GraphBLAS library, then these arrays may be returned to the -// user application in O(1) time and with no memory copying performed. -// Otherwise, the GraphBLAS library will create the output arrays for the user -// (via the ANSI C malloc function), fill them with the GrB_Matrix or -// GrB_Vector data, and then return the newly allocated arrays to the user. - -// Eight different formats are provided for pack/unpack. For each format, the -// Ax array has a C-type corresponding to one of the 13 built-in types -// in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or double -// complex), or a user-defined type. - -// On pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must be -// non-NULL pointers to memory space allocated by the ANSI C malloc (or calloc, -// or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, vb, vi, -// and vx arrays may all be NULL). For the pack, A (or GrB_Vector v) is -// undefined on input, just like GrB_*_new, the GrB_Matrix. If the pack is -// successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers to -// the user input arrays have been set to NULL. These user arrays have either -// been incorporated directly into the GrB_Matrix A or GrB_Vector v, in which -// case the user input arrays will eventually be freed by GrB_free (&A), or -// their contents have been copied and the arrays freed. This decision is made -// by the GraphBLAS library itself, and the user application has no control -// over this decision. - -// If any of the arrays Ab, Aj, Ai, Ax, vb, vi, or vx have zero size (with -// nzmax of zero), they are allowed to be be NULL pointers on input. - -// A matrix or vector may be "iso", where all entries present in the pattern -// have the same value. In this case, the boolean iso flag is true, and the -// corresponding numerical array (Ax for matrices, vx for vectors, below) need -// be only large enough to hold a single value. - -// No error checking is performed on the content of the user input arrays. If -// the user input arrays do not conform to the precise specifications above, -// results are undefined. No typecasting of the values of the matrix or vector -// entries is performed on pack/unpack - -// SuiteSparse:GraphBLAS supports all eight formats natively (CSR, CSC, -// HyperCSR, and HyperCSC, BitmapR, BitmapC, FullR, FullC). For vectors, only -// CSC, BitmapC, and FullC formats are used. On pack, the all eight formats -// take O(1) time and memory to pack. On unpack, if the GrB_Matrix or -// GrB_Vector is already in this particular format, then the unpack takes O(1) -// time and no memory copying is performed. - -// If the input data is untrusted, use the following descriptor setting for -// GxB_Matrix_pack*. The pack will be slower, but secure. GrB_Matrix_import -// uses the slow, secure method, since it has no descriptor input. -// -// GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_CSR: pack a CSR matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; - // CSR: an nrows-by-ncols matrix with nvals entries in CSR format consists - // of 3 arrays, where nvals = Ap [nrows]: - // - // GrB_Index Ap [nrows+1], Aj [nvals] ; Ax [nvals] ; - // - // The column indices of entries in the ith row of the matrix are held - // in Aj [Ap [i] to Ap[i+1]-1], and the corresponding values are held - // in the same positions in Ax. Column indices must be in the range 0 - // to ncols-1. If jumbled is false, the column indices must appear in - // sorted order within each row. No duplicate column indices may - // appear in any row. Ap [0] must equal zero, and Ap [nrows] must - // equal nvals. The Ap array must be of size nrows+1 (or larger), and - // the Aj and Ax arrays must have size at least nvals. If nvals is - // zero, then the Aj and Ax arrays need not be present and can be - // NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_CSC: pack a CSC matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_BinaryOp2nd ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // CSC: an nrows-by-ncols matrix with nvals entries in CSC format consists - // of 3 arrays, where nvals = Ap [ncols]: - // - // GrB_Index Ap [ncols+1], Ai [nvals] ; Ax [nvals] ; - // - // The row indices of entries in the jth column of the matrix are held - // in Ai [Ap [j] to Ap[j+1]-1], and the corresponding values are held - // in the same positions in Ax. Row indices must be in the range 0 to - // nrows-1. If jumbled is false, the row indices must appear in - // sorted order within each column. No duplicate row indices may - // appear in any column. Ap [0] must equal zero, and Ap [ncols] must - // equal nvals. The Ap array must be of size ncols+1 (or larger), and - // the Ai and Ax arrays must have size at least nvals. If nvals is - // zero, then the Ai and Ax arrays need not be present and can be - // NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_HyperCSR: pack a hypersparse CSR matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// vector apply: IndexUnaryOp variants +//------------------------------------------- - // HyperCSR: an nrows-by-ncols matrix with nvals entries and nvec - // rows that may have entries in HyperCSR format consists of 4 arrays, - // where nvals = Ap [nvec]: - // - // GrB_Index Ah [nvec], Ap [nvec+1], Aj [nvals] ; - // Ax [nvals] ; - // - // The Aj and Ax arrays are the same for a matrix in CSR or HyperCSR - // format. Only Ap and Ah differ. - // - // The Ah array is a list of the row indices of rows that appear in - // the matrix. It - // must appear in sorted order, and no duplicates may appear. If i = - // Ah [k] is the kth row, then the column indices of the ith - // row appear in Aj [Ap [k] to Ap [k+1]-1], and the corresponding - // values appear in the same locations in Ax. Column indices must be - // in the range 0 to ncols-1, and must appear in sorted order within - // each row. No duplicate column indices may appear in any row. nvec - // may be zero, to denote an array with no entries. The Ah array must - // be of size at least nvec, Ap must be of size at least nvec+1, and - // Aj and Ax must be at least of size nvals. If nvals is zero, then - // the Aj and Ax arrays need not be present and can be NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_HyperCSC: pack a hypersparse CSC matrix -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A)*(type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc +// Apply a GrB_IndexUnaryOp to the entries in a vector + +GrB_Info GrB_Vector_apply_IndexOp_Scalar // w = accum (w, op(u)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; - // HyperCSC: an nrows-by-ncols matrix with nvals entries and nvec - // columns that may have entries in HyperCSC format consists of 4 arrays, - // where nvals = Ap [nvec]: - // - // - // GrB_Index Ah [nvec], Ap [nvec+1], Ai [nvals] ; - // Ax [nvals] ; - // - // The Ai and Ax arrays are the same for a matrix in CSC or HyperCSC - // format. Only Ap and Ah differ. - // - // The Ah array is a list of the column indices of non-empty columns. - // It must appear in sorted order, and no duplicates may appear. If j - // = Ah [k] is the kth non-empty column, then the row indices of the - // jth column appear in Ai [Ap [k] to Ap [k+1]-1], and the - // corresponding values appear in the same locations in Ax. Row - // indices must be in the range 0 to nrows-1, and must appear in - // sorted order within each column. No duplicate row indices may - // appear in any column. nvec may be zero, to denote an array with no - // entries. The Ah array must be of size at least nvec, Ap must be of - // size at least nvec+1, and Ai and Ax must be at least of size nvals. - // If nvals is zero, then the Ai and Ax arrays need not be present and - // can be NULL. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_BitmapR: pack a bitmap matrix, held by row -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_apply_IndexOp ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar u */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // BitmapR: a dense format, but able to represent sparsity structure of A. - // - // int8_t Ab [nrows*ncols] ; - // Ax [nrows*ncols] ; - // - // Ab and Ax are both of size nrows*ncols. Ab [i*ncols+j] = 1 if the - // A(i,j) entry is present with value Ax [i*ncols+j], or 0 if A(i,j) - // is not present. nvals must equal the number of 1's in the Ab - // array. +//------------------------------------------- +// matrix apply: binaryop variants (bind 1st) +//------------------------------------------- -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_BitmapC: pack a bitmap matrix, held by column -//------------------------------------------------------------------------------ +// Apply a binary operator to the entries in a matrix, binding the first input +// to a scalar x, C = accum (C, op (x,A)), or op(x,A'). -GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column +GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) ( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Scalar x, // first input: scalar x + const GrB_Matrix A, // second input: matrix A + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // BitmapC: a dense format, but able to represent sparsity structure of A. - // - // int8_t Ab [nrows*ncols] ; - // Ax [nrows*ncols] ; - // - // Ab and Ax are both of size nrows*ncols. Ab [i+j*nrows] = 1 if the - // A(i,j) entry is present with value Ax [i+j*nrows], or 0 if A(i,j) - // is not present. nvals must equal the number of 1's in the Ab - // array. - -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_FullR: pack a full matrix, held by row -//------------------------------------------------------------------------------ - -GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row -( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_BinaryOp1st ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + type x, /* first input: scalar x */ \ + const GrB_Matrix A, /* second input: matrix A */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) - // FullR: an nrows-by-ncols full matrix held in row-major order: - // - // Ax [nrows*ncols] ; - // - // Ax is an array of size nrows*ncols, where A(i,j) is held in - // Ax [i*ncols+j]. All entries in A are present. +//------------------------------------------- +// matrix apply: binaryop variants (bind 2nd) +//------------------------------------------- -//------------------------------------------------------------------------------ -// GxB_Matrix_pack_FullC: pack a full matrix, held by column -//------------------------------------------------------------------------------ +// Apply a binary operator to the entries in a matrix, binding the second input +// to a scalar y, C = accum (C, op (A,y)), or op(A',y). -GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column +GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) ( - GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // FullC: an nrows-by-ncols full matrix held in column-major order: - // - // Ax [nrows*ncols] ; - // - // Ax is an array of size nrows*ncols, where A(i,j) is held in - // Ax [i+j*nrows]. All entries in A are present. +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_BinaryOp2nd ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_BinaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ +) ; +GB_DECLARE_14 (GrB_, const void *) -//------------------------------------------------------------------------------ -// GxB_Vector_pack_CSC: pack a vector in CSC format -//------------------------------------------------------------------------------ +//------------------------------------------- +// matrix apply: IndexUnaryOp variants +//------------------------------------------- + +// Apply a GrB_IndexUnaryOp to the entries in a matrix. -GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format +GrB_Info GrB_Matrix_apply_IndexOp_Scalar // C=accum(C,op(A)) ( - GrB_Vector v, // vector to create (type and length unchanged) - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector - bool jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in CSC format, except that no vp array is required. If nvals is - // zero, then the vi and vx arrays need not be present and can be NULL. +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_apply_IndexOp ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ +) ; +GB_DECLARE_14 (GrB_, const void *) //------------------------------------------------------------------------------ -// GxB_Vector_pack_Bitmap: pack a vector in bitmap format +// GrB_apply: polymorphic matrix/vector apply //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector -( - GrB_Vector v, // vector to create (type and length unchanged) - int8_t **vb, // bitmap, vb_size >= n - void **vx, // values, vx_size >= n * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; +// GrB_apply is a polymorphic function for applying a unary operator to a matrix +// or vector and provides access to these functions: - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in BitmapC format. +// GrB_Vector_apply (w,mask,acc,op,u,d) // w = accum (w, op(u)) +// GrB_Matrix_apply (C,Mask,acc,op,A,d) // C = accum (C, op(A)) -//------------------------------------------------------------------------------ -// GxB_Vector_pack_Full: pack a vector in full format -//------------------------------------------------------------------------------ +// GrB_Vector_apply (w,m,acc,unop ,u,d) +// GrB_Vector_apply_BinaryOp1st_TYPE (w,m,acc,binop,x,u,d) +// GrB_Vector_apply_BinaryOp2nd_TYPE (w,m,acc,binop,u,y,d) +// GrB_Vector_apply_IndexOp_TYPE (w,m,acc,idxop,u,y,d) -GrB_Info GxB_Vector_pack_Full // pack a full vector -( - GrB_Vector v, // vector to create (type and length unchanged) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - const GrB_Descriptor desc -) ; +// GrB_Matrix_apply (C,M,acc,unop ,A,d) +// GrB_Matrix_apply_BinaryOp1st_TYPE (C,M,acc,binop,x,A,d) +// GrB_Matrix_apply_BinaryOp2nd_TYPE (C,M,acc,binop,A,y,d) +// GrB_Matrix_apply_IndexOp_TYPE (C,M,acc,idxop,A,y,d) - // The GrB_Vector is treated as if it was a single column of an n-by-1 - // matrix in FullC format. +#if GxB_STDC_VERSION >= 201112L +#define GB_BIND(kind,x,y,...) \ + _Generic ((x), \ + GrB_Scalar: GB_CONCAT (GrB,_,kind,_apply_BinaryOp1st_Scalar), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_BinaryOp1st,,)), \ + default: \ + _Generic ((y), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_BinaryOp2nd,,)), \ + default: GB_CONCAT (GrB,_,kind,_apply_BinaryOp2nd_Scalar))) +#define GB_IDXOP(kind,A,y,...) \ + _Generic ((y), \ + GB_CASES (GrB, GB_CONCAT (kind, _apply_IndexOp,,)), \ + default: GB_CONCAT (GrB, _, kind, _apply_IndexOp_Scalar)) +#define GrB_apply(C,Mask,accum,op,...) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((op), \ + GrB_UnaryOp : GrB_Vector_apply, \ + GrB_BinaryOp : GB_BIND (Vector, __VA_ARGS__), \ + GrB_IndexUnaryOp : GB_IDXOP (Vector, __VA_ARGS__)), \ + GrB_Matrix : \ + _Generic ((op), \ + GrB_UnaryOp : GrB_Matrix_apply, \ + GrB_BinaryOp : GB_BIND (Matrix, __VA_ARGS__), \ + GrB_IndexUnaryOp : GB_IDXOP (Matrix, __VA_ARGS__))) \ + (C, Mask, accum, op, __VA_ARGS__) +#endif -//------------------------------------------------------------------------------ -// GxB unpack -//------------------------------------------------------------------------------ +//============================================================================== +// GrB_select: matrix and vector selection using an IndexUnaryOp +//============================================================================== -// The GxB_*_unpack functions are symmetric with the GxB_*_pack functions. The -// unpack functions force completion of any pending operations, prior to the -// unpack, except if the only pending operation is to unjumble the matrix. -// -// If there are no entries in the matrix or vector, then the index arrays (Ai, -// Aj, or vi) and value arrays (Ax or vx) are returned as NULL. This is not an -// error condition. -// -// A GrB_Matrix may be unpacked in any one of four different formats. -// -// If jumbled is NULL on input, this indicates to GxB_*unpack* that the -// unpacked matrix cannot be returned in a jumbled format. In this case, if -// the matrix is jumbled, it is sorted before unpacking it to the caller. -// -// If iso is NULL on input, this indicates to the unpack methods that the -// unpacked matrix cannot be returned in a iso format, with an Ax array with -// just one entry. In this case, if the matrix is iso, it is expanded before -// unpacking it to the caller. -// -// For the unpack*Full* methods, all entries in the matrix or must be present. -// That is, GrB_*_nvals must report nvals equal to nrows*ncols or a matrix. If -// this condition does not hold, the matrix/vector is not unpack, and -// GrB_INVALID_VALUE is returned. -// -// If the unpack is not successful, the unpack functions do not modify matrix -// or vector and the user arrays are returned as NULL. - -GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// vector select using an IndexUnaryOp +//------------------------------------------- -GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix +GrB_Info GrB_Vector_select_Scalar // w = accum (w, op(u)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Vector u, // first input: vector u + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for w and mask ) ; -GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_select ## suffix \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector mask, /* optional mask for w, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for z=accum(w,t) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Vector u, /* first input: vector u */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) -GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; +//------------------------------------------- +// matrix select using an IndexUnaryOp +//------------------------------------------- -GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row +GrB_Info GrB_Matrix_select_Scalar // C=accum(C,op(A)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_IndexUnaryOp op, // operator to apply to the entries + const GrB_Matrix A, // first input: matrix A + const GrB_Scalar y, // second input: scalar y + const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col -( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_select ## suffix \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix Mask, /* optional mask for C, unused if NULL */ \ + const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ + const GrB_IndexUnaryOp op, /* operator to apply to the entries */ \ + const GrB_Matrix A, /* first input: matrix A */ \ + type y, /* second input: scalar y */ \ + const GrB_Descriptor desc /* descriptor for C, mask, and A */ \ ) ; +GB_DECLARE_14 (GrB_, const void *) + +// GrB_select is a polymorphic method that applies an IndexUnaryOp to +// a matrix or vector, using any type of the scalar y. +// +// GrB_Vector_select_TYPE (w,m,acc,idxop,u,y,d) +// GrB_Matrix_select_TYPE (C,M,acc,idxop,A,y,d) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_select(C,Mask,accum,op,x,y,d) \ + _Generic ((C), \ + GrB_Vector : \ + _Generic ((y), \ + GB_CASES (GrB, Vector_select), \ + default: GrB_Vector_select_Scalar), \ + GrB_Matrix : \ + _Generic ((y), \ + GB_CASES (GrB, Matrix_select), \ + default: GrB_Matrix_select_Scalar)) \ + (C, Mask, accum, op, x, y, d) +#endif + +//============================================================================== +// GrB_reduce: matrix and vector reduction +//============================================================================== + +// Reduce the entries in a matrix to a vector, a column vector t such that +// t(i) = sum (A (i,:)), and where "sum" is a commutative and associative +// monoid with an identity value. A can be transposed, which reduces down the +// columns instead of the rows. -GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row +GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Monoid monoid, // reduce operator for t=reduce(A) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for w, mask, and A ) ; -GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column +//------------------------------------------------------------------------------ +// reduce a vector to a scalar +//------------------------------------------------------------------------------ + +// Reduce entries in a vector to a scalar, c = accum (c, reduce_to_scalar(u)) + +GrB_Info GrB_Vector_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(u)) ( - GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Vector u, // vector to reduce const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - GrB_Index **vi, // indices - void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector - bool *jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Vector_reduce ## suffix \ +( \ + type *c, /* result scalar */ \ + const GrB_BinaryOp accum, /* optional accum for c=accum(c,t) */ \ + const GrB_Monoid monoid, /* monoid to do the reduction */ \ + const GrB_Vector u, /* vector to reduce */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void) + +//------------------------------------------------------------------------------ +// reduce a matrix to a scalar +//------------------------------------------------------------------------------ + +// Reduce entries in a matrix to a scalar, c = accum (c, reduce_to_scalar(A)) -GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector +GrB_Info GrB_Matrix_reduce_Monoid_Scalar // c = accum(c,reduce_to_scalar(A)) ( - GrB_Vector v, // vector to unpack (type and length unchanged) - int8_t **vb, // bitmap - void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap + GrB_Scalar c, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Matrix A, // matrix to reduce const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_unpack_Full // unpack a full vector -( - GrB_Vector v, // vector to unpack (type and length unchanged) - void **vx, // values - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - const GrB_Descriptor desc +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_reduce ## suffix \ +( \ + type *c, /* result scalar */ \ + const GrB_BinaryOp accum, /* optional accum for c=accum(c,t) */ \ + const GrB_Monoid monoid, /* monoid to do the reduction */ \ + const GrB_Matrix A, /* matrix to reduce */ \ + const GrB_Descriptor desc \ ) ; +GB_DECLARE_14 (GrB_, void) //------------------------------------------------------------------------------ -// GxB hyper_hash pack/unpack +// GrB_reduce: polymorphic matrix/vector reduction to a vector or scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v7.3.0 adds a new internal component to the -// hypersparse matrix format: the hyper_hash GrB_Matrix A->Y. The matrix -// provides a fast lookup into the hyperlist Ah. - -// GxB_unpack_HyperHash unpacks the hyper_hash from the hypersparse matrix A. -// Normally, this method is called immediately before calling one of the four -// methods GxB_Matrix_unpack_Hyper(CSR/CSC). For example, to unpack -// then pack a hypersparse CSC matrix: - -// GrB_Matrix Y = NULL ; -// -// // to unpack all of A: -// GxB_unpack_HyperHash (A, &Y, desc) ; // first unpack A->Y into Y -// GxB_Matrix_unpack_HyperCSC (A, // then unpack the rest of A -// &Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, -// &iso, &nvec, &jumbled, descriptor) ; +// GrB_reduce is a polymorphic function that provides access to all GrB_*reduce* +// functions: // -// // use the unpacked contents of A here, but do not change Ah or nvec. +// reduce matrix to vector: +// GrB_Matrix_reduce_Monoid (w,mask,acc,mo,A,d) +// GrB_Matrix_reduce_BinaryOp (w,mask,acc,op,A,d); do not use this method // -// // to pack the data back into A: -// GxB_Matrix_pack_HyperCSC (A, etc) ; // pack most of A, except A->Y -// GxB_pack_HyperHash (A, &Y, desc) ; // then pack A->Y - -// The same process is used with GxB_Matrix_unpack_HyperCSR. +// reduce matrix to scalar: +// GrB_Vector_reduce_[SCALAR] (c,acc,monoid,u,d) +// GrB_Matrix_reduce_[SCALAR] (c,acc,monoid,A,d) +// GrB_Vector_reduce_Monoid_Scalar (s,acc,monoid,u,d) +// GrB_Matrix_reduce_Monoid_Scalar (s,acc,monoid,A,d) +// GrB_Vector_reduce_BinaryOp_Scalar (s,acc,op,u,d); do not use this method +// GrB_Matrix_reduce_BinaryOp_Scalar (s,acc,op,A,d); do not use this method -// If A is not hypersparse on input to GxB_unpack_HyperHash, or if A is -// hypersparse but does yet not have a hyper_hash, then Y is returned as NULL. -// This is not an error condition, and GrB_SUCCESS is returned. The hyper_hash -// of a hypersparse matrix A is a matrix that provides quick access to the -// inverse of Ah. It is not always needed and may not be present. It is left -// as pending work to be computed when needed. GrB_Matrix_wait (A) will ensure -// that the hyper_hash is constructed, if A is hypersparse. +#if GxB_STDC_VERSION >= 201112L +#define GB_REDUCE_TO_SCALAR(kind,c,op) \ + _Generic ((c), \ + GB_PCASES (GrB, GB_CONCAT (kind, _reduce,,)), \ + default: \ + _Generic ((op), \ + GrB_BinaryOp : GB_CONCAT (GrB,_,kind,_reduce_BinaryOp_Scalar),\ + default: GB_CONCAT (GrB,_,kind,_reduce_Monoid_Scalar))) +#define GrB_reduce(arg1,arg2,arg3,arg4,...) \ + _Generic ((arg4), \ + GrB_Vector : GB_REDUCE_TO_SCALAR (Vector, arg1, arg3), \ + GrB_Matrix : GB_REDUCE_TO_SCALAR (Matrix, arg1, arg3), \ + GrB_Monoid : GrB_Matrix_reduce_Monoid, \ + GrB_BinaryOp : GrB_Matrix_reduce_BinaryOp) \ + (arg1, arg2, arg3, arg4, __VA_ARGS__) +#endif -// If Y is moved from A and returned as non-NULL to the caller, then it is -// the responsibility of the user application to free it, or to re-pack it back -// into A via GxB_pack_HyperHash, as shown in the example above. +// The following methods are not recommended; use a GrB_Monoid instead. The +// GrB_BinaryOp op must correspond to a known built-in monoid. +GrB_Info GrB_Matrix_reduce_BinaryOp (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, + const GrB_Descriptor) ; +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar (GrB_Scalar, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Vector, const GrB_Descriptor) ; +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar (GrB_Scalar, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor) ; -// If this method is called to remove the hyper_hash Y from the hypersparse -// matrix A, and then GrB_Matrix_wait (A) is called, a new hyper_hash matrix is -// constructed for A. +//============================================================================== +// GrB_transpose: matrix transpose +//============================================================================== -GrB_Info GxB_unpack_HyperHash // move A->Y into Y +GrB_Info GrB_transpose // C = accum (C, A') ( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to move from A - const GrB_Descriptor desc // unused + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Descriptor desc // descriptor for C, Mask, and A ) ; -// GxB_pack_HyperHash assigns the input Y matrix as the A->Y hyper_hash of the -// hypersparse matrix A. Normally, this method is called immediately after -// calling one of the four methods GxB_Matrix_pack_Hyper(CSR/CSC). - -// If A is not hypersparse on input to GxB_pack_HyperHash, or if A already has -// a hyper_hash matrix, or if Y is NULL on input, then nothing happens and Y is -// unchanged. This is not an error condition and this method returns -// GrB_SUCCESS. In this case, if Y is non-NULL after calling this method, it -// owned by the user application and freeing it is the responsibility of the -// user application. - -// Basic checks are perfomed on Y: Y must have the right dimensions: if A is -// HyperCSR and m-by-n with nvec vectors present in Ah, then Y must be n-by-v -// where v is a power of 2; if A is HyperCSR and m-by-n, then Y must be m-by-v. -// nvals(Y) must equal nvec. Y must be sparse, held by column, and have type -// int64. It cannot have any pending work. It cannot have a hyper_hash -// of its own. If any of these conditions hold, GrB_INVALID is returned and -// A and Y are unchanged. - -// If Y is moved into A as its hyper_hash, then the caller's Y is set to NULL -// to indicate that it has been moved into A. It is no longer owned by the -// caller, but is instead an opaque component of the A matrix. It will be -// freed by SuiteSparse:GraphBLAS if A is modified or freed. +//============================================================================== +// GrB_kronecker: Kronecker product +//============================================================================== -// Results are undefined if the input Y was not created by GxB_unpack_HyperHash -// (see the example above) or if the Ah contents or nvec of the matrix A are -// modified after they were unpacked by -// GxB_Matrix_unpack_Hyper(CSR/CSC). +GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_BinaryOp op, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B +) ; -GrB_Info GxB_pack_HyperHash // move Y into A->Y +GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) ( - GrB_Matrix A, // matrix to modify - GrB_Matrix *Y, // hyper_hash matrix to pack into A - const GrB_Descriptor desc // unused + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Monoid monoid, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B ) ; -//============================================================================== -// GrB_import/GrB_export -//============================================================================== +GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix M, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Semiring semiring, // defines '*' for T=kron(A,B) + const GrB_Matrix A, // first input: matrix A + const GrB_Matrix B, // second input: matrix B + const GrB_Descriptor desc // descriptor for C, M, A, and B +) ; -// The GrB_Matrix_import method copies from user-provided arrays into an -// opaque GrB_Matrix and GrB_Matrix_export copies data out, from an opaque -// GrB_Matrix into user-provided arrays. Unlike the GxB pack/unpack methods, -// memory is not handed off between the user application and GraphBLAS. +#if GxB_STDC_VERSION >= 201112L +#define GrB_kronecker(C,Mask,accum,op,A,B,desc) \ + _Generic ((op), \ + GrB_Semiring : GrB_Matrix_kronecker_Semiring, \ + GrB_Monoid : GrB_Matrix_kronecker_Monoid, \ + GrB_BinaryOp : GrB_Matrix_kronecker_BinaryOp) \ + (C, Mask, accum, op, A, B, desc) +#endif -// These methods are much slower than the GxB pack/unpack methods, since they -// require a copy of the data to be made. GrB_Matrix_import also must assume -// its input data cannot be trusted, and so it does extensive checks. The GxB -// pack takes O(1) time in all cases (unless it is told the input data is -// untrusted, via the descriptor). GxB unpack takes O(1) time unless the -// matrix is exported in a different format than it currently has. +//============================================================================== +// GrB_*_resize: change the size of a matrix or vector +//============================================================================== -// No typecasting of the values is done on import or export. +// If the dimensions decrease, entries that fall outside the resized matrix or +// vector are deleted. -GrB_Info GrB_Matrix_import_BOOL // import a GrB_BOOL matrix +GrB_Info GrB_Matrix_resize // change the size of a matrix ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_BOOL) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const bool *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Matrix C, // matrix to modify + GrB_Index nrows_new, // new number of rows in matrix + GrB_Index ncols_new // new number of columns in matrix ) ; -GrB_Info GrB_Matrix_import_INT8 // import a GrB_INT8 matrix +GrB_Info GrB_Vector_resize // change the size of a vector ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_iNT8) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int8_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Vector w, // vector to modify + GrB_Index nrows_new // new number of rows in vector ) ; -GrB_Info GrB_Matrix_import_INT16 // import a GrB_INT16 matrix +// GxB_resize is a polymorphic function for resizing a matrix or vector: +// GrB_Vector_resize (u,nrows_new) +// GrB_Matrix_resize (A,nrows_new,ncols_new) + +#if GxB_STDC_VERSION >= 201112L +#define GxB_resize(C,...) \ + _Generic ((C), \ + GrB_Vector : GrB_Vector_resize, \ + GrB_Matrix : GrB_Matrix_resize) \ + (C, __VA_ARGS__) +#endif + +//============================================================================== +// GxB_fprint and GxB_print: print the contents of a GraphBLAS object +//============================================================================== + +// GxB_fprint (object, int pr, FILE *f) prints the contents of any of the 9 +// GraphBLAS objects to the file f, and also does an extensive test on the +// object to determine if it is valid. It returns one of the following error +// conditions: +// +// GrB_SUCCESS object is valid +// GrB_UNINITIALIZED_OBJECT object is not initialized +// GrB_INVALID_OBJECT object is not valid +// GrB_NULL_POINTER object is a NULL pointer +// GrB_INVALID_VALUE fprintf returned an I/O error; see the ANSI C +// errno or GrB_error( )for details. +// +// GxB_fprint does not modify the status of any object. If a matrix or vector +// has not been completed, the pending computations are guaranteed to *not* be +// performed by GxB_fprint. The reason is simple. It is possible for a bug in +// the user application (such as accessing memory outside the bounds of an +// array) to mangle the internal content of a GraphBLAS object, and GxB_fprint +// can be a helpful tool to track down this bug. If GxB_fprint attempted to +// complete any computations prior to printing or checking the contents of the +// matrix or vector, then further errors could occur, including a segfault. +// +// The type-specific functions include an additional argument, the name string. +// The name is printed at the beginning of the display (assuming pr is not +// GxB_SILENT) so that the object can be more easily identified in the output. +// For the type-polymorphic methods GxB_fprint and GxB_print, the name string is +// the variable name of the object itself. +// +// If f is NULL, stdout is used; this is not an error condition. If pr is +// outside the bounds 0 to 3, negative values are treated as GxB_SILENT, and +// values > 3 are treated as GxB_COMPLETE. If name is NULL, it is treated as +// the empty string. +// +// GxB_print (object, int pr) is the same as GxB_fprint, except that it prints +// the contents with printf instead of fprintf to a file f. +// +// The exact content and format of what is printed is implementation-dependent, +// and will change from version to version of SuiteSparse:GraphBLAS. Do not +// attempt to rely on the exact content or format by trying to parse the +// resulting output via another program. The intent of these functions is to +// produce a report of the object for visual inspection. + +GrB_Info GxB_Type_fprint // print and check a GrB_Type ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT16) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int16_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Type type, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_INT32 // import a GrB_INT32 matrix +GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_UnaryOp unaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_INT64 // import a GrB_INT64 matrix +GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_INT64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const int64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_BinaryOp binaryop, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT8 // import a GrB_UINT8 matrix +GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT8) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint8_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_IndexUnaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT16 // import a GrB_UINT16 matrix +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT16) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint16_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT32 // import a GrB_UINT32 matrix +GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Monoid monoid, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UINT64 // import a GrB_UINT64 matrix +GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_UINT64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const uint64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Semiring semiring, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_FP32 // import a GrB_FP32 matrix +GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_FP32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const float *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Descriptor descriptor, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_FP64 // import a GrB_FP64 matrix +GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GrB_FP64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const double *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Matrix A, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GxB_Matrix_import_FC32 // import a GxB_FC32 matrix +GrB_Info GxB_Vector_fprint // print and check a GrB_Vector ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GxB_FC32) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const GxB_FC32_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Vector v, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GxB_Matrix_import_FC64 // import a GxB_FC64 matrix +GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create (must be GxB_FC64) - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const GxB_FC64_t *Ax, // values - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GrB_Scalar s, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; -GrB_Info GrB_Matrix_import_UDT // import a matrix with a user-defined type +GrB_Info GxB_Context_fprint // print and check a GxB_Context ( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC - const void *Ax, // values (must match the type parameter) - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format // import format + GxB_Context Context, // object to print and check + const char *name, // name of the object + int pr, // print level (GxB_Print_Level) + FILE *f // file for output ) ; #if GxB_STDC_VERSION >= 201112L -#define GrB_Matrix_import(A,type,nrows,ncols,Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt)\ - _Generic \ - ( \ - (Ax), \ - GB_PCASES (GrB, Matrix_import) \ - ) \ - (A, type, nrows, ncols, Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt) +#define GxB_fprint(object,pr,f) \ + _Generic ((object), \ + GrB_Type : GxB_Type_fprint , \ + GrB_UnaryOp : GxB_UnaryOp_fprint , \ + GrB_BinaryOp : GxB_BinaryOp_fprint , \ + GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ + GrB_Monoid : GxB_Monoid_fprint , \ + GrB_Semiring : GxB_Semiring_fprint , \ + GrB_Scalar : GxB_Scalar_fprint , \ + GrB_Vector : GxB_Vector_fprint , \ + GrB_Matrix : GxB_Matrix_fprint , \ + GrB_Descriptor : GxB_Descriptor_fprint , \ + GxB_Context : GxB_Context_fprint) \ + (object, GB_STR(object), pr, f) +#define GxB_print(object,pr) GxB_fprint(object,pr,NULL) #endif -// For GrB_Matrix_export_T: on input, Ap_len, Ai_len, and Ax_len are -// the size of the 3 arrays Ap, Ai, and Ax, in terms of the # of entries. -// On output, these 3 values are modified to be the # of entries copied -// into those 3 arrays. +//============================================================================== +// GxB_Container methods +//============================================================================== -GrB_Info GrB_Matrix_export_BOOL // export a GrB_BOOL matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - bool *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_BOOL) -) ; +struct GxB_Container_struct +{ + // 16 words of uint64_t / int64_t: + uint64_t nrows ; + uint64_t ncols ; + int64_t nrows_nonempty ; + int64_t ncols_nonempty ; + uint64_t nvals ; + uint64_t u64_future [11] ; // for future expansion + + // 16 words of uint32_t / int32_t: + int32_t format ; // GxB_HYPERSPARSE, GxB_SPARSE, GxB_BITMAP, + // or GxB_FULL + int32_t orientation ; // GrB_ROWMAJOR or GrB_COLMAJOR + uint32_t u32_future [14] ; // for future expansion + + // 16 GrB_Vector objects: + GrB_Vector p ; + GrB_Vector h ; + GrB_Vector b ; + GrB_Vector i ; + GrB_Vector x ; + GrB_Vector vector_future [11] ; // for future expansion + + // 16 GrB_Matrix objects: + GrB_Matrix Y ; + GrB_Matrix matrix_future [15] ; // for future expansion + + // 32 words of bool + bool iso ; + bool jumbled ; + bool bool_future [30] ; // for future expansion + + // 16 (void *) pointers + void *void_future [16] ; // for future expansion +} ; -GrB_Info GrB_Matrix_export_INT8 // export a GrB_INT8 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int8_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT8) -) ; +typedef struct GxB_Container_struct *GxB_Container ; -GrB_Info GrB_Matrix_export_INT16 // export a GrB_INT16 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int16_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT16) -) ; +GrB_Info GxB_Container_new (GxB_Container *Container) ; -GrB_Info GrB_Matrix_export_INT32 // export a GrB_INT32 matrix +GrB_Info GxB_load_Matrix_from_Container // GrB_Matrix <- GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT32) + GrB_Matrix A, // matrix to load from the Container. On input, + // A is a matrix of any size or type; on output + // any prior size, type, or contents is freed + // and overwritten with the Container. + GxB_Container Container, // Container with contents to load into A + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_INT64 // export a GrB_INT64 matrix +GrB_Info GxB_load_Vector_from_Container // GrB_Vector <- GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - int64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_INT64) + GrB_Vector V, // GrB_Vector to load from the Container + GxB_Container Container, // Container with contents to load into V + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT8 // export a GrB_UINT8 matrix +GrB_Info GxB_unload_Matrix_into_Container // GrB_Matrix -> GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint8_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT8) + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT16 // export a GrB_UINT16 matrix +GrB_Info GxB_unload_Vector_into_Container // GrB_Vector -> GxB_Container ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint16_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT16) + GrB_Vector V, // vector to unload into the Container + GxB_Container Container, // Container to hold the contents of V + const GrB_Descriptor desc // currently unused ) ; -GrB_Info GrB_Matrix_export_UINT32 // export a GrB_UINT32 matrix +GrB_Info GxB_Vector_load ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT32) + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + int handling, // GrB_DEFAULT (0): transfer ownership to GraphBLAS + // GxB_IS_READONLY: X treated as readonly; + // ownership kept by the user application + const GrB_Descriptor desc // currently unused; for future expansion ) ; -GrB_Info GrB_Matrix_export_UINT64 // export a GrB_UINT64 matrix +GrB_Info GxB_Vector_unload ( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - uint64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_UINT64) + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + int *handling, // see GxB_Vector_load + const GrB_Descriptor desc // currently unused; for future expansion ) ; -GrB_Info GrB_Matrix_export_FP32 // export a GrB_FP32 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - float *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FP32) -) ; +//============================================================================== +// GrB_import/GrB_export +//============================================================================== -GrB_Info GrB_Matrix_export_FP64 // export a GrB_FP64 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - double *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FP64) -) ; +// The GrB_Matrix_import method copies from user-provided arrays into an +// opaque GrB_Matrix and GrB_Matrix_export copies data out, from an opaque +// GrB_Matrix into user-provided arrays. Unlike the GxB pack/unpack methods, +// memory is not handed off between the user application and GraphBLAS. -GrB_Info GxB_Matrix_export_FC32 // export a GrB_FC32 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - GxB_FC32_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FC32) -) ; +// These methods are much slower than the GxB pack/unpack methods, since they +// require a copy of the data to be made. GrB_Matrix_import also must assume +// its input data cannot be trusted, and so it does extensive checks. The GxB +// pack takes O(1) time in all cases (unless it is told the input data is +// untrusted, via the descriptor). GxB unpack takes O(1) time unless the +// matrix is exported in a different format than it currently has. -GrB_Info GxB_Matrix_export_FC64 // export a GrB_FC64 matrix -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - GxB_FC64_t *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export (must be of type GrB_FC64) -) ; +// No typecasting of the values is done on import or export. The GrB_Type type +// parameter must be the equivalent of the ctype of the *Ax parameter. -GrB_Info GrB_Matrix_export_UDT // export a matrix with a user-defined type -( - GrB_Index *Ap, // pointers for CSR, CSC, column indices for COO - GrB_Index *Ai, // col indices for CSR/COO, row indices for CSC - void *Ax, // values (must match the type of A) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format - GrB_Matrix A // matrix to export +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,ctype) \ +GrB_Info prefix ## Matrix_import ## suffix \ +( \ + GrB_Matrix *A, /* handle of matrix to create */ \ + GrB_Type type, /* type of matrix to create */ \ + GrB_Index nrows, /* number of rows of the matrix */ \ + GrB_Index ncols, /* number of columns of the matrix */ \ + const GrB_Index *Ap, /* pointers for CSR, CSC, col indices for COO */\ + const GrB_Index *Ai, /* row indices for CSR, CSC */ \ + const ctype *Ax, /* values */ \ + GrB_Index Ap_len, /* number of entries in Ap (not # of bytes) */ \ + GrB_Index Ai_len, /* number of entries in Ai (not # of bytes) */ \ + GrB_Index Ax_len, /* number of entries in Ax (not # of bytes) */ \ + int format /* import format (GrB_Format) */ \ +) ; +GB_DECLARE_14 (GrB_, void) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_Matrix_import(A,type,nrows,ncols,Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt)\ + _Generic ((Ax), GB_PCASES (GrB, Matrix_import)) \ + (A, type, nrows, ncols, Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt) +#endif + +// For GrB_Matrix_export_T: on input, Ap_len, Ai_len, and Ax_len are +// the size of the 3 arrays Ap, Ai, and Ax, in terms of the # of entries. +// On output, these 3 values are modified to be the # of entries copied +// into those 3 arrays. + +#undef GB_DECLARE +#define GB_DECLARE(prefix,suffix,type) \ +GrB_Info prefix ## Matrix_export ## suffix \ +( \ + GrB_Index *Ap, /* pointers for CSR, CSC, col indices for COO */\ + GrB_Index *Ai, /* col indices for CSR/COO, row indices for CSC*/\ + type *Ax, /* values (must match the type of A) */ \ + GrB_Index *Ap_len, /* number of entries in Ap (not # of bytes) */ \ + GrB_Index *Ai_len, /* number of entries in Ai (not # of bytes) */ \ + GrB_Index *Ax_len, /* number of entries in Ax (not # of bytes) */ \ + int format, /* export format (GrB_Format) */ \ + GrB_Matrix A /* matrix to export */ \ ) ; +GB_DECLARE_14 (GrB_, void) #if GxB_STDC_VERSION >= 201112L #define GrB_Matrix_export(Ap,Ai,Ax,Ap_len,Ai_len,Ax_len,fmt,A) \ - _Generic \ - ( \ - (Ax), \ - GB_PCASES (GrB, Matrix_export) \ - ) \ + _Generic ((Ax), GB_PCASES (GrB, Matrix_export)) \ (Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, fmt, A) #endif @@ -10164,13 +6031,13 @@ GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export GrB_Index *Ap_len, // # of entries required for Ap (not # of bytes) GrB_Index *Ai_len, // # of entries required for Ai (not # of bytes) GrB_Index *Ax_len, // # of entries required for Ax (not # of bytes) - GrB_Format format, // export format + int format, // export format GrB_Matrix A // matrix to export ) ; GrB_Info GrB_Matrix_exportHint // suggest the best export format ( - GrB_Format *format, // export format + int *format, // export format GrB_Matrix A // matrix to export ) ; @@ -10207,7 +6074,7 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format // below do a few basic checks so that no out-of-bounds access occurs during // deserialization, but the output matrix itself may still be corrupted. If // the data is untrusted, use this to check the matrix: -// GxB_Matrix_fprint (A, "A deserialized", GrB_SILENT, NULL) +// GxB_Matrix_fprint (A, "A deserialized", GxB_SILENT, NULL) // Example usage: @@ -10413,14 +6280,13 @@ GrB_Info GxB_Matrix_sort const GrB_Descriptor desc ) ; -#define GxB_sort(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - GrB_Vector : GxB_Vector_sort , \ - GrB_Matrix : GxB_Matrix_sort \ - ) \ - (arg1, __VA_ARGS__) +#if GxB_STDC_VERSION >= 201112L +#define GxB_sort(C,P,op,A,desc) \ + _Generic ((C), \ + GrB_Vector : GxB_Vector_sort, \ + GrB_Matrix : GxB_Matrix_sort) \ + (C, P, op, A, desc) +#endif //============================================================================== // GxB_Matrix_reshape and GxB_Matrix_reshapeDup: reshape a matrix @@ -10555,7 +6421,6 @@ parallel iteration using 4 threads (work may be imbalanced however): then compute the cumulative sum (ideally in parallel). Next, partition the cumulative sum into one part per thread via binary search, and divide the rows into parts accordingly. - */ //------------------------------------------------------------------------------ @@ -10566,7 +6431,7 @@ parallel iteration using 4 threads (work may be imbalanced however): // application. Only the functions and macros provided here may access // "iterator->" contents. The iterator is defined here only so that macros // can be used to speed up the use of the iterator methods. User applications -// must not use "iterator->" directly. +// must not use "iterator->" directly; results are undefined otherwise. struct GB_Iterator_opaque { @@ -10584,25 +6449,26 @@ struct GB_Iterator_opaque int64_t avlen ; // length of each vector in the matrix int64_t avdim ; // number of vectors in the matrix dimension int64_t anvec ; // # of vectors present in the matrix - const int64_t *GB_restrict Ap ; // pointers for sparse and hypersparse - const int64_t *GB_restrict Ah ; // vector names for hypersparse - const int8_t *GB_restrict Ab ; // bitmap - const int64_t *GB_restrict Ai ; // indices for sparse and hypersparse - const void *GB_restrict Ax ; // values for all 4 data structures + + // Ap, Ah, Ai: can be 32 bit or 64-bit integers + const uint32_t *GB_restrict Ap32 ; // offsets for sparse/hypersparse + const uint64_t *GB_restrict Ap64 ; + const uint32_t *GB_restrict Ah32 ; // vector names for hypersparse + const uint64_t *GB_restrict Ah64 ; + const uint32_t *GB_restrict Ai32 ; // indices for sparse/hypersparse + const uint64_t *GB_restrict Ai64 ; + const int8_t *GB_restrict Ab ; // bitmap + const void *GB_restrict Ax ; // values for all 4 data structures + size_t type_size ; // size of the type of A int A_sparsity ; // sparse, hyper, bitmap, or full bool iso ; // true if A is iso-valued, false otherwise bool by_col ; // true if A is held by column, false if by row } ; -typedef struct GB_Iterator_opaque *GxB_Iterator ; - // GxB_Iterator_new: create a new iterator, not attached to any matrix/vector GrB_Info GxB_Iterator_new (GxB_Iterator *iterator) ; -// GxB_Iterator_free: free an iterator -GrB_Info GxB_Iterator_free (GxB_Iterator *iterator) ; - //============================================================================== // GB_Iterator_*: implements user-callable GxB_*Iterator_* methods //============================================================================== @@ -10618,7 +6484,7 @@ GrB_Info GB_Iterator_attach ( GxB_Iterator iterator, // iterator to attach to the matrix A GrB_Matrix A, // matrix to attach - GxB_Format_Value format, // by row, by col, or by entry (GxB_NO_FORMAT) + int format, // by row, col, or entry (GxB_Format_Value) GrB_Descriptor desc ) ; @@ -10661,8 +6527,12 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; (iterator->A_sparsity <= GxB_SPARSE) ? \ ( \ /* matrix is sparse or hypersparse */ \ - iterator->pstart = iterator->Ap [iterator->k], \ - iterator->pend = iterator->Ap [iterator->k+1], \ + iterator->pstart = ((iterator->Ap32 != NULL) ? \ + iterator->Ap32 [iterator->k] : \ + iterator->Ap64 [iterator->k]), \ + iterator->pend = ((iterator->Ap32 != NULL) ? \ + iterator->Ap32 [iterator->k+1] : \ + iterator->Ap64 [iterator->k+1]), \ iterator->p = iterator->pstart, \ ((iterator->p >= iterator->pend) ? GrB_NO_VALUE : GrB_SUCCESS) \ ) \ @@ -10711,8 +6581,6 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; ) \ ) \ ) - - //------------------------------------------------------------------------------ // GB_Iterator_rc_getj: get index of current vector for row/col iterator //------------------------------------------------------------------------------ @@ -10729,7 +6597,9 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; (iterator->A_sparsity == GxB_HYPERSPARSE) ? \ ( \ /* return the name of kth vector: j = Ah [k] if it appears */ \ - iterator->Ah [iterator->k] \ + ((iterator->Ah32 != NULL) ? \ + iterator->Ah32 [iterator->k] : \ + iterator->Ah64 [iterator->k]) \ ) \ : \ ( \ @@ -10745,14 +6615,9 @@ GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator) ; #define GB_Iterator_rc_geti(iterator) \ ( \ - (iterator->Ai != NULL) ? \ - ( \ - iterator->Ai [iterator->p] \ - ) \ - : \ - ( \ - (iterator->p - iterator->pstart) \ - ) \ + (iterator->Ai32 != NULL) ? iterator->Ai32 [iterator->p] : \ + ((iterator->Ai64 != NULL) ? iterator->Ai64 [iterator->p] : \ + (iterator->p - iterator->pstart)) \ ) //============================================================================== @@ -11262,8 +7127,7 @@ GrB_Index GxB_Vector_Iterator_getpmax (GxB_Iterator iterator) ; // Returns GrB_SUCCESS if the iterator is at an entry that exists in the // vector, or GxB_EXHAUSTED if the iterator is exhausted. -GrB_Info GB_Vector_Iterator_bitmap_seek (GxB_Iterator iterator, - GrB_Index unused) ; // unused parameter to be removed in v8.x +GrB_Info GB_Vector_Iterator_bitmap_seek (GxB_Iterator iterator) ; GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, GrB_Index p) ; @@ -11281,7 +7145,7 @@ GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, GrB_Index p) ; iterator->p = q, \ (iterator->A_sparsity == GxB_BITMAP) ? \ ( \ - GB_Vector_Iterator_bitmap_seek (iterator, 0) \ + GB_Vector_Iterator_bitmap_seek (iterator) \ ) \ : \ ( \ @@ -11324,7 +7188,7 @@ GrB_Info GxB_Vector_Iterator_next (GxB_Iterator iterator) ; (iterator->A_sparsity == GxB_BITMAP) ? \ ( \ /* bitmap: seek to the next entry present in the bitmap */ \ - GB_Vector_Iterator_bitmap_seek (iterator, 0) \ + GB_Vector_Iterator_bitmap_seek (iterator) \ ) \ : \ ( \ @@ -11370,7 +7234,8 @@ GrB_Index GxB_Vector_Iterator_getIndex (GxB_Iterator iterator) ; #define GxB_Vector_Iterator_getIndex(iterator) \ ( \ - ((iterator->Ai != NULL) ? iterator->Ai [iterator->p] : iterator->p) \ + (iterator->Ai32 != NULL) ? iterator->Ai32 [iterator->p] : \ + ((iterator->Ai64 != NULL) ? iterator->Ai64 [iterator->p] : iterator->p) \ ) //============================================================================== @@ -11413,8 +7278,7 @@ float GxB_Iterator_get_FP32 (GxB_Iterator iterator) ; double GxB_Iterator_get_FP64 (GxB_Iterator iterator) ; GxB_FC32_t GxB_Iterator_get_FC32 (GxB_Iterator iterator) ; GxB_FC64_t GxB_Iterator_get_FC64 (GxB_Iterator iterator) ; -void GxB_Iterator_get_UDT (GxB_Iterator iterator, - void *value) ; +void GxB_Iterator_get_UDT (GxB_Iterator iterator, void *value) ; #define GB_Iterator_get(iterator, type) \ ( \ @@ -11442,6 +7306,50 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, (iterator)->type_size) \ ) +//============================================================================== +// GrB_free: free any GraphBLAS object +//============================================================================== + +// GrB_free (&object) frees any of the 14 allocatable GraphBLAS objects. +// The GrB_Global object cannot be freed. + +#undef GB_DECLARE +#define GB_DECLARE(Object) GrB_Info Object ## _free (Object *object) ; +GB_DECLARE (GrB_Type ) +GB_DECLARE (GrB_UnaryOp ) +GB_DECLARE (GrB_BinaryOp ) +GB_DECLARE (GrB_IndexUnaryOp ) +GB_DECLARE (GxB_IndexBinaryOp) +GB_DECLARE (GrB_Monoid ) +GB_DECLARE (GrB_Semiring ) +GB_DECLARE (GrB_Descriptor ) +GB_DECLARE (GrB_Scalar ) +GB_DECLARE (GrB_Vector ) +GB_DECLARE (GrB_Matrix ) +GB_DECLARE (GxB_Context ) +GB_DECLARE (GxB_Container ) +GB_DECLARE (GxB_Iterator ) + +#if GxB_STDC_VERSION >= 201112L +#define GrB_free(object) \ + _Generic ((object), \ + GrB_Type *: GrB_Type_free , \ + GrB_UnaryOp *: GrB_UnaryOp_free , \ + GrB_BinaryOp *: GrB_BinaryOp_free , \ + GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ + GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ + GrB_Monoid *: GrB_Monoid_free , \ + GrB_Semiring *: GrB_Semiring_free , \ + GrB_Scalar *: GrB_Scalar_free , \ + GrB_Vector *: GrB_Vector_free , \ + GrB_Matrix *: GrB_Matrix_free , \ + GrB_Descriptor *: GrB_Descriptor_free , \ + GxB_Context *: GxB_Context_free , \ + GxB_Container *: GxB_Container_free , \ + GxB_Iterator *: GxB_Iterator_free) \ + (object) +#endif + //============================================================================== //=== Historical methods ======================================================= //============================================================================== @@ -11457,31 +7365,34 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, // the usage of these historical methods, and upgrade to the newer methods // present in this version of GraphBLAS. +// A user application can request that no historical methods should be +// available, by compiling with -DNHISTORICAL. + +#ifndef NHISTORICAL + +// GxB_*_iso: use GrB_get instead +GrB_Info GxB_Matrix_iso (bool *, const GrB_Matrix) ; +GrB_Info GxB_Vector_iso (bool *, const GrB_Vector) ; + +typedef int GrB_Field ; // STRONGLY DEPRECATED: will be removed in v11.0.0, + // to allow the creation of a GraphBLAS object that represents a + // mathematical field: https://en.wikipedia.org/wiki/Field_(mathematics) + // GrB_getVersion: use GrB_get instead GrB_Info GrB_getVersion (unsigned int *, unsigned int *) ; // GxB_INDEX_MAX: use GrB_INDEX_MAX+1 instead -#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) - -// GxB_SelectOp: use GrB_IndexUnaryOp instead -GB_GLOBAL GxB_SelectOp GxB_TRIL, GxB_TRIU, GxB_DIAG, GxB_OFFDIAG, GxB_NONZERO, - GxB_EQ_ZERO, GxB_GT_ZERO, GxB_GE_ZERO, GxB_LT_ZERO, GxB_LE_ZERO, - GxB_NE_THUNK, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, - GxB_LE_THUNK ; -GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; -GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; -GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, - GxB_Print_Level pr, FILE *f) ; +#define GxB_INDEX_MAX ((uint64_t) (1ULL << 60)) // GxB_Desc*get/set and GrB_Descriptor_set: use GrB_get/set instead. -GrB_Info GrB_Descriptor_set (GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value) ; -GrB_Info GxB_Descriptor_get (GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field) ; -GrB_Info GxB_Desc_set (GrB_Descriptor, GrB_Desc_Field, ...) ; -GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t) ; -GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, GrB_Desc_Field, double) ; -GrB_Info GxB_Desc_get (GrB_Descriptor, GrB_Desc_Field, ...) ; -GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t *) ; -GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, GrB_Desc_Field, double *) ; +GrB_Info GrB_Descriptor_set (GrB_Descriptor, int, int) ; +GrB_Info GxB_Descriptor_get (int32_t *, GrB_Descriptor, int) ; +GrB_Info GxB_Desc_set (GrB_Descriptor, int, ...) ; +GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, int, int32_t) ; +GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, int, double) ; +GrB_Info GxB_Desc_get (GrB_Descriptor, int, ...) ; +GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, int, int32_t *) ; +GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, int, double *) ; // GxB_Type_* queries: use GrB_get instead GrB_Info GxB_Type_name (char *, const GrB_Type) ; @@ -11516,14 +7427,13 @@ GrB_Info GxB_Semiring_add (GrB_Monoid *, GrB_Semiring) ; GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *, GrB_Semiring) ; // GxB_Scalar_* queries: use GrB_get instead -GrB_Info GxB_Scalar_type (GrB_Type *, const GrB_Scalar) ; GrB_Info GxB_Scalar_type_name (char *, const GrB_Scalar) ; // GxB_Scalar_* methods: use GrB_Scalar_* instead (as-is) GrB_Info GxB_Scalar_new (GrB_Scalar *, GrB_Type) ; GrB_Info GxB_Scalar_dup (GrB_Scalar *, const GrB_Scalar) ; GrB_Info GxB_Scalar_clear (GrB_Scalar ) ; -GrB_Info GxB_Scalar_nvals (GrB_Index *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_nvals (uint64_t *, const GrB_Scalar) ; GrB_Info GxB_Scalar_free (GrB_Scalar *) ; GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar, bool) ; GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar, int8_t) ; @@ -11557,71 +7467,63 @@ GrB_Info GxB_Scalar_error (const char **, const GrB_Scalar) ; #endif // GxB_Vector_* queries: use GrB_get instead -GrB_Info GxB_Vector_type (GrB_Type *, const GrB_Vector) ; GrB_Info GxB_Vector_type_name (char *, const GrB_Vector) ; // GxB_Matrix_* queries: use GrB_get instead -GrB_Info GxB_Matrix_type (GrB_Type *, const GrB_Matrix) ; GrB_Info GxB_Matrix_type_name (char *, const GrB_Matrix) ; // GxB_*_Option_set/get: use GrB_get/set instead -GrB_Info GxB_Matrix_Option_set (GrB_Matrix, GxB_Option_Field, ...) ; -GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, GxB_Option_Field, int32_t) ; -GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, GxB_Option_Field, double) ; -GrB_Info GxB_Matrix_Option_get (GrB_Matrix, GxB_Option_Field, ...) ; -GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, GxB_Option_Field, double *) ; -GrB_Info GxB_Vector_Option_set (GrB_Vector, GxB_Option_Field, ...) ; -GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, GxB_Option_Field, int32_t) ; -GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, GxB_Option_Field, double) ; -GrB_Info GxB_Vector_Option_get (GrB_Vector, GxB_Option_Field, ...) ; -GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_set (GxB_Option_Field, ...) ; -GrB_Info GxB_Global_Option_set_INT32 (GxB_Option_Field, int32_t) ; -GrB_Info GxB_Global_Option_set_FP64 (GxB_Option_Field, double) ; -GrB_Info GxB_Global_Option_set_FP64_ARRAY (GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_set_INT64_ARRAY (GxB_Option_Field, int64_t *) ; -GrB_Info GxB_Global_Option_set_CHAR (GxB_Option_Field, const char *) ; -GrB_Info GxB_Global_Option_set_FUNCTION (GxB_Option_Field, void *) ; -GrB_Info GxB_Global_Option_get (GxB_Option_Field, ...) ; -GrB_Info GxB_Global_Option_get_INT32 (GxB_Option_Field, int32_t *) ; -GrB_Info GxB_Global_Option_get_FP64 (GxB_Option_Field, double *) ; -GrB_Info GxB_Global_Option_get_INT64 (GxB_Option_Field, int64_t *) ; -GrB_Info GxB_Global_Option_get_CHAR (GxB_Option_Field, const char **) ; -GrB_Info GxB_Global_Option_get_FUNCTION (GxB_Option_Field, void **) ; -GrB_Info GxB_Context_set_INT32 (GxB_Context, GxB_Context_Field, int32_t) ; -GrB_Info GxB_Context_set_FP64 (GxB_Context, GxB_Context_Field, double) ; -GrB_Info GxB_Context_set (GxB_Context, GxB_Context_Field, ...) ; -GrB_Info GxB_Context_get_INT32 (GxB_Context, GxB_Context_Field, int32_t *) ; -GrB_Info GxB_Context_get_FP64 (GxB_Context, GxB_Context_Field, double *) ; -GrB_Info GxB_Context_get (GxB_Context, GxB_Context_Field, ...) ; +GrB_Info GxB_Matrix_Option_set (GrB_Matrix, int, ...) ; +GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, int, int32_t) ; +GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, int, double) ; +GrB_Info GxB_Matrix_Option_get (GrB_Matrix, int, ...) ; +GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, int, int32_t *) ; +GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, int, double *) ; +GrB_Info GxB_Vector_Option_set (GrB_Vector, int, ...) ; +GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, int, int32_t) ; +GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, int, double) ; +GrB_Info GxB_Vector_Option_get (GrB_Vector, int, ...) ; +GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, int, int32_t *) ; +GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, int, double *) ; +GrB_Info GxB_Global_Option_set (int, ...) ; +GrB_Info GxB_Global_Option_set_INT32 (int, int32_t) ; +GrB_Info GxB_Global_Option_set_FP64 (int, double) ; +GrB_Info GxB_Global_Option_set_FP64_ARRAY (int, double *) ; +GrB_Info GxB_Global_Option_set_INT64_ARRAY (int, int64_t *) ; +GrB_Info GxB_Global_Option_set_CHAR (int, const char *) ; +GrB_Info GxB_Global_Option_set_FUNCTION (int, void *) ; +GrB_Info GxB_Global_Option_get (int, ...) ; +GrB_Info GxB_Global_Option_get_INT32 (int, int32_t *) ; +GrB_Info GxB_Global_Option_get_FP64 (int, double *) ; +GrB_Info GxB_Global_Option_get_INT64 (int, int64_t *) ; +GrB_Info GxB_Global_Option_get_CHAR (int, const char **) ; +GrB_Info GxB_Global_Option_get_FUNCTION (int, void **) ; +GrB_Info GxB_Context_set_INT32 (GxB_Context, int, int32_t) ; +GrB_Info GxB_Context_set_FP64 (GxB_Context, int, double) ; +GrB_Info GxB_Context_set (GxB_Context, int, ...) ; +GrB_Info GxB_Context_get_INT32 (GxB_Context, int, int32_t *) ; +GrB_Info GxB_Context_get_FP64 (GxB_Context, int, double *) ; +GrB_Info GxB_Context_get (GxB_Context, int, ...) ; // GxB_get/set: use GrB_get/set instead #if GxB_STDC_VERSION >= 201112L -#define GxB_set(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_set , \ - GxB_Option_Field : GxB_Global_Option_set , \ - GrB_Vector : GxB_Vector_Option_set , \ - GrB_Matrix : GxB_Matrix_Option_set , \ - GrB_Descriptor : GxB_Desc_set , \ - GxB_Context : GxB_Context_set \ - ) \ +#define GxB_set(arg1,...) \ + _Generic ((arg1), \ + default: GxB_Global_Option_set, \ + int : GxB_Global_Option_set, \ + GrB_Vector : GxB_Vector_Option_set, \ + GrB_Matrix : GxB_Matrix_Option_set, \ + GrB_Descriptor : GxB_Desc_set, \ + GxB_Context : GxB_Context_set) \ (arg1, __VA_ARGS__) -#define GxB_get(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_get , \ - GxB_Option_Field : GxB_Global_Option_get , \ - GrB_Vector : GxB_Vector_Option_get , \ - GrB_Matrix : GxB_Matrix_Option_get , \ - GrB_Descriptor : GxB_Desc_get , \ - GxB_Context : GxB_Context_get \ - ) \ +#define GxB_get(arg1,...) \ + _Generic ((arg1), \ + default: GxB_Global_Option_get, \ + int : GxB_Global_Option_get, \ + GrB_Vector : GxB_Vector_Option_get, \ + GrB_Matrix : GxB_Matrix_Option_get, \ + GrB_Descriptor : GxB_Desc_get, \ + GxB_Context : GxB_Context_get) \ (arg1, __VA_ARGS__) #endif @@ -11645,94 +7547,91 @@ GrB_Info GxB_kron (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_Descriptor) ; // GxB_*_resize: use GrB_*_resize instead (as-is) -GrB_Info GxB_Matrix_resize (GrB_Matrix, GrB_Index, GrB_Index) ; -GrB_Info GxB_Vector_resize (GrB_Vector, GrB_Index) ; +GrB_Info GxB_Matrix_resize (GrB_Matrix, uint64_t, uint64_t) ; +GrB_Info GxB_Vector_resize (GrB_Vector, uint64_t) ; // GxB_*_import/export_[FORMAT]: use GxB_*_pack/unpack_[FORMAT] instead -GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, +GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, +GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, +GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, - GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, - GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, GrB_Index, - GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, +GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, + uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, + uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, uint64_t, + uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - void **, GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, - void **, GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, - void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, - const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, GrB_Index, int8_t **, - void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor) ; -GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, GrB_Index, void **, - GrB_Index, bool, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, - GrB_Index *, bool *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, - GrB_Index *, bool *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, - GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + void **, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, uint64_t, uint64_t, + void **, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, uint64_t, uint64_t **, + void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, uint64_t, int8_t **, + void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, uint64_t, void **, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, + uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, + uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, - GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, +GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, + uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, - GrB_Index *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, - GrB_Index *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, GrB_Index *, - GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, GrB_Index *, - GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, + uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, + uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, uint64_t *, + uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, uint64_t *, + uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, GrB_Index *, - int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, +GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, uint64_t *, + int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; -GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, GrB_Index *, - void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, uint64_t *, + void **, uint64_t *, bool *, const GrB_Descriptor) ; + +// GxB_SelectOp_: use GrB_IndexUnaryOp instead +GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_fprint (GxB_SelectOp, const char *, int, FILE *) ; // GxB_select: use GrB_select instead -GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +GrB_Info GxB_Vector_select (GrB_Vector, const GrB_Vector, const GrB_BinaryOp, + const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_select (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, + const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, + const GrB_Descriptor) ; #if GxB_STDC_VERSION >= 201112L -#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic ((C), \ - GrB_Vector : GxB_Vector_select , \ - GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, Thunk, desc) +#define GxB_select(C,Mask,accum,op,A,y,desc) _Generic ((C), \ + GrB_Vector : GxB_Vector_select , \ + GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, y, desc) #endif // GxB_deserialize_* queries: use GrB_get instead -GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; - -#endif // GB_CUDA_FOLDER -#if defined ( __cplusplus ) -} -#endif +GrB_Info GxB_deserialize_type_name (char *, const void *, uint64_t) ; // GxB_ABS_*: use GrB_ABS_* instead (as-is) GB_GLOBAL GrB_UnaryOp @@ -11760,7 +7659,6 @@ GB_GLOBAL GrB_Monoid // GxB_* semirings: use the GrB_* semirings instead (as-is) GB_GLOBAL GrB_Semiring - GxB_PLUS_TIMES_INT8, GxB_PLUS_MIN_INT8, GxB_MIN_PLUS_INT8, GxB_PLUS_TIMES_INT16, GxB_PLUS_MIN_INT16, GxB_MIN_PLUS_INT16, GxB_PLUS_TIMES_INT32, GxB_PLUS_MIN_INT32, GxB_MIN_PLUS_INT32, @@ -11808,5 +7706,72 @@ GB_GLOBAL GrB_Semiring GxB_LOR_LAND_BOOL, GxB_LAND_LOR_BOOL, GxB_LXOR_LAND_BOOL, GxB_EQ_LOR_BOOL ; // use GrB_LXNOR_LOR_SEMIRING_BOOL instead (as-is) +// GxB_SelectOp: use GrB_IndexUnaryOp instead +GB_GLOBAL GxB_SelectOp GxB_TRIL, GxB_TRIU, GxB_DIAG, GxB_OFFDIAG, GxB_NONZERO, + GxB_EQ_ZERO, GxB_GT_ZERO, GxB_GE_ZERO, GxB_LT_ZERO, GxB_LE_ZERO, + GxB_NE_THUNK, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, + GxB_LE_THUNK ; + +// pack/unpack: use the GxB_Container methods instead +GrB_Info GxB_Matrix_pack_CSR (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_CSC (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_HyperCSR (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_HyperCSC (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, + uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_BitmapR (GrB_Matrix, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_BitmapC (GrB_Matrix, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_FullR (GrB_Matrix, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_pack_FullC (GrB_Matrix, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_CSC (GrB_Vector, uint64_t **, void **, uint64_t, + uint64_t, bool, uint64_t, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_Bitmap (GrB_Vector, int8_t **, void **, uint64_t, + uint64_t, bool, uint64_t, const GrB_Descriptor) ; +GrB_Info GxB_Vector_pack_Full (GrB_Vector, void **, uint64_t, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_CSR (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_CSC (GrB_Matrix, uint64_t **, uint64_t **, void **, + uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_HyperCSR (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, + bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_HyperCSC (GrB_Matrix, uint64_t **, uint64_t **, + uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, + bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_BitmapR (GrB_Matrix, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_BitmapC (GrB_Matrix, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_FullR (GrB_Matrix, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_unpack_FullC (GrB_Matrix, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_CSC (GrB_Vector, uint64_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_Bitmap (GrB_Vector, int8_t **, void **, uint64_t *, + uint64_t *, bool *, uint64_t *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_unpack_Full (GrB_Vector, void **, uint64_t *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_unpack_HyperHash (GrB_Matrix, GrB_Matrix *, const GrB_Descriptor) ; +GrB_Info GxB_pack_HyperHash (GrB_Matrix, GrB_Matrix *, const GrB_Descriptor) ; + +#endif + +#endif // GB_CUDA_FOLDER +#if defined ( __cplusplus ) +} +#endif + +#undef GB_DECLARE +#undef GB_DECLARE_14 #endif diff --git a/GraphBLAS/JITpackage/CMakeLists.txt b/GraphBLAS/JITpackage/CMakeLists.txt index f0ded1b552..64492a1620 100644 --- a/GraphBLAS/JITpackage/CMakeLists.txt +++ b/GraphBLAS/JITpackage/CMakeLists.txt @@ -2,7 +2,7 @@ # GraphBLAS/JITpackage/CMakeLists.txt: package source for the GraphBLAS JIT #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- @@ -42,7 +42,7 @@ if ( CMAKE_CROSSCOMPILING ) if ( NOT TARGET grb_jitpackage ) # target to rerun cmake after jitpackage_generator_native was built - # FIXME: This likely won't work with the Ninja generator or other + # fixme: This likely won't work with the Ninja generator or other # generators that lock their own files. But it should work # with a "* Makefiles" generator (which is the default on # most platforms apart from Windows). diff --git a/GraphBLAS/JITpackage/GB_JITpackage.h b/GraphBLAS/JITpackage/GB_JITpackage.h index 79681de6d8..861fce7eaf 100644 --- a/GraphBLAS/JITpackage/GB_JITpackage.h +++ b/GraphBLAS/JITpackage/GB_JITpackage.h @@ -2,7 +2,7 @@ // GB_JITpackage.h: definitions to package GraphBLAS source code for the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/JITpackage/Makefile b/GraphBLAS/JITpackage/Makefile index bd7c75d2b6..540a18ba9f 100644 --- a/GraphBLAS/JITpackage/Makefile +++ b/GraphBLAS/JITpackage/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Package/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/JITpackage/README.md b/GraphBLAS/JITpackage/README.md index 395ffacb81..989b68267d 100644 --- a/GraphBLAS/JITpackage/README.md +++ b/GraphBLAS/JITpackage/README.md @@ -1,6 +1,6 @@ # GraphBLAS/JITPackage: package GraphBLAS source for the JIT -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 The use of this package is not required by the end user. If you edit the diff --git a/GraphBLAS/JITpackage/Source/grb_jitpackage.c b/GraphBLAS/JITpackage/Source/grb_jitpackage.c index b8304998b9..dc69149017 100644 --- a/GraphBLAS/JITpackage/Source/grb_jitpackage.c +++ b/GraphBLAS/JITpackage/Source/grb_jitpackage.c @@ -2,7 +2,7 @@ // grb_jitpackage: package GraphBLAS source code for the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,11 +13,6 @@ #include #include -#if defined (__GNUC__) -// ignore strlen warning -#pragma GCC diagnostic ignored "-Wstringop-overflow" -#endif - //------------------------------------------------------------------------------ // zstd.h include file //------------------------------------------------------------------------------ @@ -79,6 +74,30 @@ #include "zstd_subset/decompress/zstd_decompress.c" */ +//------------------------------------------------------------------------------ +// safe_strlen: compute the length of a string +//------------------------------------------------------------------------------ + +// This is the same as the POSIX strnlen, but just using my own method. +// Non-POSIX systems do not have strnlen. + +// This method returns the # of bytes in the string s, excluding the null +// terminating byte. If s has no null terminating byte, it returns maxlen. + +#define BUF_LENGTH 4096 + +size_t safe_strlen (const char *s, size_t maxlen) ; + +size_t safe_strlen (const char *s, size_t maxlen) +{ + if (s == NULL) return (0) ; + for (size_t k = 0 ; k < maxlen ; k++) + { + if (s [k] == '\0') return (k) ; + } + return (maxlen) ; +} + //------------------------------------------------------------------------------ // match_prefix: return true if the input string matches the prefix //------------------------------------------------------------------------------ @@ -131,7 +150,7 @@ int main (int argc, char **argv) char **file_list = NULL; size_t nfiles = 0; - fprintf (stderr, "grb_jitpackage: building JITpackge\n") ; + fprintf (stderr, "grb_jitpackage: building JITpackage\n") ; if (argc == 2 && argv[1][0] == '@') { @@ -162,13 +181,12 @@ int main (int argc, char **argv) file_list[0][0] = '\0'; // glibc defines MAX_PATH to 4096. // Use this as a buffer size on all platforms. - #define BUF_LENGTH 4096 char temp[BUF_LENGTH]; size_t length; for (size_t i = 1 ; i < nfiles+1 ; i++) { OK ( fgets (temp, BUF_LENGTH, fr) != NULL ); - length = strlen (temp); // this is safe; ignore -Wstringop-overflow + length = safe_strlen (temp, BUF_LENGTH); file_list[i] = malloc (length+1); OK (file_list [i] != NULL) ; strncpy (file_list[i], temp, length); @@ -177,9 +195,11 @@ int main (int argc, char **argv) } else { - // input argument list is the file list - nfiles = argc - 1 ; - file_list = argv; +// // input argument list is the file list +// nfiles = argc - 1 ; +// file_list = argv; + fprintf (stderr, "feature no longer supported\n") ; + OK (false) ; } //-------------------------------------------------------------------------- @@ -195,7 +215,7 @@ int main (int argc, char **argv) "// GB_JITpackage.c: packaged GraphBLAS source code for the JIT\n" "//------------------------------------------------------------------------------\n" "\n" - "// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n" + "// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n" "// SPDX-License-Identifier: Apache-2.0\n" "\n" "//------------------------------------------------------------------------------\n" @@ -262,7 +282,7 @@ int main (int argc, char **argv) fprintf (fp, "// %s:\n", file_list [k]) ; fprintf (fp, "uint8_t GB_JITpackage_%zu [%zu] = {\n", k-1, dsize) ; - for (int64_t k = 0 ; k < dsize ; k++) + for (uint64_t k = 0 ; k < dsize ; k++) { fprintf (fp, "%3d,", dst [k]) ; if (k % 20 == 19) fprintf (fp, "\n") ; @@ -293,12 +313,12 @@ int main (int argc, char **argv) fprintf (fp, "\nstatic GB_JITpackage_index_struct " "GB_JITpackage_index [%zu] =\n{\n", nfiles) ; - for (int k = 1 ; k < nfiles+1 ; k++) + for (int k = 1 ; k < ((int) nfiles) + 1 ; k++) { // get the filename char *fullname = file_list [k] ; char *filename = fullname ; - int len = (int) strlen (fullname) ; + int len = (int) safe_strlen (fullname, BUF_LENGTH) ; for (int i = 0 ; i < len ; i++) { if (fullname [i] == '/') diff --git a/GraphBLAS/LICENSE b/GraphBLAS/LICENSE index 205d59d279..355664e46f 100644 --- a/GraphBLAS/LICENSE +++ b/GraphBLAS/LICENSE @@ -1,4 +1,4 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. The following Apache-2.0 applies to all of SuiteSparse:GraphBLAS, except for 3rd-party software: @@ -41,7 +41,7 @@ SPDX-License-Identifier: BSD-3-Clause In addition, any source files not part of the above packages is hereby licensed under the Apache-2.0 license. -Copyright 2020-2023, NVIDIA Corporation +Copyright 2020-2025, NVIDIA Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file expect in compilance with the License. diff --git a/GraphBLAS/Makefile b/GraphBLAS/Makefile index f1d5ecef93..eadc6385d1 100644 --- a/GraphBLAS/Makefile +++ b/GraphBLAS/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- @@ -60,7 +60,14 @@ all: # run the demos demos: all - ( cd Demo && ./demo ) + ./build/grow_demo < Demo/Matrix/west0067 + ./build/simple_demo > ./build/simple_demo.out + ./build/complex_demo > ./build/complex_demo_out.m + ./build/complex_demo 1 > ./build/complex_demo_out2.m + ./build/wildtype_demo > ./build/wildtype_demo.out + ./build/gauss_demo > ./build/gauss_demo1.out + ./build/gauss_demo > ./build/gauss_demo.out + ./build/wathen_demo > ./build/wathen_demo.out # diff the demo output demodiffs: demos diff --git a/GraphBLAS/README.md b/GraphBLAS/README.md index 67363d8f7f..244f1b6685 100644 --- a/GraphBLAS/README.md +++ b/GraphBLAS/README.md @@ -4,7 +4,7 @@ SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 -VERSION 9.4.5, Feb 20, 2025 +VERSION 10.0.0, Mar 3, 2025 SuiteSparse:GraphBLAS is a complete implementation of the GraphBLAS standard, which defines a set of sparse matrix operations on an extended algebra of diff --git a/GraphBLAS/Source/GB.h b/GraphBLAS/Source/GB.h index dabda328a1..971b60f64e 100644 --- a/GraphBLAS/Source/GB.h +++ b/GraphBLAS/Source/GB.h @@ -2,7 +2,7 @@ // GB.h: definitions visible only inside GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,10 +10,15 @@ #ifndef GB_H #define GB_H +// These methods and definitions are also available to JIT kernels; +// see GB_jit_kernel.h: #include "include/GB_include.h" + +// These are not needed by JIT kernels and do not appear in GB_jit_kernel.h: #include "global/GB_Global.h" +#include "pji_control/GB_determine_pji_is_32.h" #include "print/GB_printf.h" -#include "ok/GB_assert.h" +#include "ok/GB_assert_library.h" #if defined ( GRAPHBLAS_HAS_CUDA ) #include "rmm_wrap.h" #endif @@ -27,7 +32,7 @@ #include "pending/GB_Pending_n.h" #include "nvals/GB_nvals.h" #include "aliased/GB_aliased.h" -#include "matrix/GB_new.h" +#include "matrix/GB_matrix.h" #include "clear/GB_clear.h" #include "dup/GB_dup.h" #include "compatible/GB_code_compatible.h" @@ -43,14 +48,14 @@ #include "element/GB_Element.h" #include "op/GB_op.h" #include "hyper/GB_hyper.h" -#include "ok/GB_check_inputs.h" +#include "werk/GB_where.h" #include "cast/GB_cast.h" #include "wait/GB_wait.h" #include "convert/GB_convert.h" -#include "werk/GB_where.h" #include "context/GB_Context.h" #include "gateway/GB_cuda_gateway.h" #include "callback/GB_callbacks.h" #include "helper/GB_factory.h" + #endif diff --git a/GraphBLAS/Source/GB_control.h b/GraphBLAS/Source/GB_control.h index c4e260deff..33a69616a1 100644 --- a/GraphBLAS/Source/GB_control.h +++ b/GraphBLAS/Source/GB_control.h @@ -2,7 +2,7 @@ // GB_control.h: disable hard-coded functions to reduce code size //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -64,12 +64,7 @@ // SECOND and RDIV : SECOND // MIN, TIMES, and LAND : LAND // MAX, PLUS, and LOR : LOR - // ISNE, NE, MINUS, RMINUS, and LXOR : LXOR - // ISEQ, EQ : EQ - // ISGT, GT : GT - // ISLT, LT : LT - // ISGE, GE : GE - // ISLE, LE : LE + // NE, MINUS, RMINUS, and LXOR : LXOR // Thus, below there is a #define GxB_NO_LAND_FIRST_BOOL, but no #define // GxB_NO_LAND_DIV_BOOL. @@ -80,6 +75,16 @@ // To renable the fast versions of these semirings, simply comment out the // specific "#define GxB_NO..." statements below, and recompile this library. +//------------------------------------------------------------------------------ +// handling empty source files +//------------------------------------------------------------------------------ + +// If types are disabled, some files become completely empty, which is not +// allowed in the ISO C standard. This #define is placed in those files to +// ensure they are not empty. + +#define GB_EMPTY_PLACEHOLDER typedef int dummy ; + //------------------------------------------------------------------------------ // uncomment any of these lines to disable the types //------------------------------------------------------------------------------ @@ -118,57 +123,57 @@ // #define GxB_NO_LNOT 1 // #define GxB_NO_MINV 1 // #define GxB_NO_ONE 1 -// #define GxB_NO_BNOT 1 + #define GxB_NO_BNOT 1 -// #define GxB_NO_SQRT 1 -// #define GxB_NO_LOG 1 -// #define GxB_NO_EXP 1 + #define GxB_NO_SQRT 1 + #define GxB_NO_LOG 1 + #define GxB_NO_EXP 1 -// #define GxB_NO_SIN 1 -// #define GxB_NO_COS 1 -// #define GxB_NO_TAN 1 + #define GxB_NO_SIN 1 + #define GxB_NO_COS 1 + #define GxB_NO_TAN 1 -// #define GxB_NO_ASIN 1 -// #define GxB_NO_ACOS 1 -// #define GxB_NO_ATAN 1 + #define GxB_NO_ASIN 1 + #define GxB_NO_ACOS 1 + #define GxB_NO_ATAN 1 -// #define GxB_NO_SINH 1 -// #define GxB_NO_COSH 1 -// #define GxB_NO_TANH 1 + #define GxB_NO_SINH 1 + #define GxB_NO_COSH 1 + #define GxB_NO_TANH 1 -// #define GxB_NO_ASINH 1 -// #define GxB_NO_ACOSH 1 -// #define GxB_NO_ATANH 1 + #define GxB_NO_ASINH 1 + #define GxB_NO_ACOSH 1 + #define GxB_NO_ATANH 1 -// #define GxB_NO_SIGNUM 1 -// #define GxB_NO_CEIL 1 -// #define GxB_NO_FLOOR 1 -// #define GxB_NO_ROUND 1 -// #define GxB_NO_TRUNC 1 + #define GxB_NO_SIGNUM 1 + #define GxB_NO_CEIL 1 + #define GxB_NO_FLOOR 1 + #define GxB_NO_ROUND 1 + #define GxB_NO_TRUNC 1 -// #define GxB_NO_EXP2 1 -// #define GxB_NO_EXPM1 1 -// #define GxB_NO_LOG10 1 -// #define GxB_NO_LOG1P 1 -// #define GxB_NO_LOG2 1 + #define GxB_NO_EXP2 1 + #define GxB_NO_EXPM1 1 + #define GxB_NO_LOG10 1 + #define GxB_NO_LOG1P 1 + #define GxB_NO_LOG2 1 -// #define GxB_NO_LGAMMA 1 -// #define GxB_NO_TGAMMA 1 -// #define GxB_NO_ERF 1 -// #define GxB_NO_ERFC 1 -// #define GxB_NO_CBRT 1 + #define GxB_NO_LGAMMA 1 + #define GxB_NO_TGAMMA 1 + #define GxB_NO_ERF 1 + #define GxB_NO_ERFC 1 + #define GxB_NO_CBRT 1 -// #define GxB_NO_FREXPX 1 -// #define GxB_NO_FREXPE 1 + #define GxB_NO_FREXPX 1 + #define GxB_NO_FREXPE 1 // #define GxB_NO_CONJ 1 // #define GxB_NO_CREAL 1 // #define GxB_NO_CIMAG 1 -// #define GxB_NO_CARG 1 + #define GxB_NO_CARG 1 -// #define GxB_NO_ISINF 1 -// #define GxB_NO_ISNAN 1 -// #define GxB_NO_ISFINITE 1 + #define GxB_NO_ISINF 1 + #define GxB_NO_ISNAN 1 + #define GxB_NO_ISFINITE 1 //------------------------------------------------------------------------------ // uncomment any of these lines to disable the binary operators for all types @@ -188,16 +193,11 @@ // #define GxB_NO_MAX 1 // #define GxB_NO_PLUS 1 // #define GxB_NO_MINUS 1 -// #define GxB_NO_RMINUS 1 // #define GxB_NO_TIMES 1 // #define GxB_NO_DIV 1 -// #define GxB_NO_RDIV 1 - #define GxB_NO_ISEQ 1 - #define GxB_NO_ISNE 1 - #define GxB_NO_ISGT 1 - #define GxB_NO_ISGE 1 - #define GxB_NO_ISLT 1 - #define GxB_NO_ISLE 1 + #define GxB_NO_RDIV 1 + #define GxB_NO_RMINUS 1 + // #define GxB_NO_EQ 1 // #define GxB_NO_NE 1 // #define GxB_NO_GT 1 @@ -208,14 +208,14 @@ // #define GxB_NO_LOR 1 // #define GxB_NO_LXOR 1 -// #define GxB_NO_BOR 1 -// #define GxB_NO_BAND 1 -// #define GxB_NO_BXOR 1 -// #define GxB_NO_BXNOR 1 -// #define GxB_NO_BGET 1 -// #define GxB_NO_BSET 1 -// #define GxB_NO_BCLR 1 -// #define GxB_NO_BSHIFT 1 + #define GxB_NO_BOR 1 + #define GxB_NO_BAND 1 + #define GxB_NO_BXOR 1 + #define GxB_NO_BXNOR 1 + #define GxB_NO_BGET 1 + #define GxB_NO_BSET 1 + #define GxB_NO_BCLR 1 + #define GxB_NO_BSHIFT 1 #define GxB_NO_ATAN2 1 #define GxB_NO_HYPOT 1 @@ -223,18 +223,19 @@ #define GxB_NO_REMAINDER 1 #define GxB_NO_COPYSIGN 1 #define GxB_NO_LDEXP 1 + #define GxB_NO_POW 1 // #define GxB_NO_CMPLX 1 -// #define GxB_NO_POW 1 // #define GxB_NO_FIRSTI 1 -// #define GxB_NO_FIRSTI1 1 // #define GxB_NO_FIRSTJ 1 -// #define GxB_NO_FIRSTJ1 1 // #define GxB_NO_SECONDI 1 -// #define GxB_NO_SECONDI1 1 // #define GxB_NO_SECONDJ 1 -// #define GxB_NO_SECONDJ1 1 + + #define GxB_NO_FIRSTI1 1 + #define GxB_NO_FIRSTJ1 1 + #define GxB_NO_SECONDI1 1 + #define GxB_NO_SECONDJ1 1 //------------------------------------------------------------------------------ // uncomment any of these lines to disable the binary operators for each type @@ -418,76 +419,6 @@ // #define GxB_NO_RDIV_FC32 1 // #define GxB_NO_RDIV_FC64 1 -// #define GxB_NO_ISEQ_INT8 1 -// #define GxB_NO_ISEQ_INT16 1 -// #define GxB_NO_ISEQ_INT32 1 -// #define GxB_NO_ISEQ_INT64 1 -// #define GxB_NO_ISEQ_UINT8 1 -// #define GxB_NO_ISEQ_UINT16 1 -// #define GxB_NO_ISEQ_UINT32 1 -// #define GxB_NO_ISEQ_UINT64 1 -// #define GxB_NO_ISEQ_FP32 1 -// #define GxB_NO_ISEQ_FP64 1 -// #define GxB_NO_ISEQ_FC32 1 -// #define GxB_NO_ISEQ_FC64 1 - -// #define GxB_NO_ISNE_INT8 1 -// #define GxB_NO_ISNE_INT16 1 -// #define GxB_NO_ISNE_INT32 1 -// #define GxB_NO_ISNE_INT64 1 -// #define GxB_NO_ISNE_UINT8 1 -// #define GxB_NO_ISNE_UINT16 1 -// #define GxB_NO_ISNE_UINT32 1 -// #define GxB_NO_ISNE_UINT64 1 -// #define GxB_NO_ISNE_FP32 1 -// #define GxB_NO_ISNE_FP64 1 -// #define GxB_NO_ISNE_FC32 1 -// #define GxB_NO_ISNE_FC64 1 - -// #define GxB_NO_ISGT_INT8 1 -// #define GxB_NO_ISGT_INT16 1 -// #define GxB_NO_ISGT_INT32 1 -// #define GxB_NO_ISGT_INT64 1 -// #define GxB_NO_ISGT_UINT8 1 -// #define GxB_NO_ISGT_UINT16 1 -// #define GxB_NO_ISGT_UINT32 1 -// #define GxB_NO_ISGT_UINT64 1 -// #define GxB_NO_ISGT_FP32 1 -// #define GxB_NO_ISGT_FP64 1 - -// #define GxB_NO_ISLT_INT8 1 -// #define GxB_NO_ISLT_INT16 1 -// #define GxB_NO_ISLT_INT32 1 -// #define GxB_NO_ISLT_INT64 1 -// #define GxB_NO_ISLT_UINT8 1 -// #define GxB_NO_ISLT_UINT16 1 -// #define GxB_NO_ISLT_UINT32 1 -// #define GxB_NO_ISLT_UINT64 1 -// #define GxB_NO_ISLT_FP32 1 -// #define GxB_NO_ISLT_FP64 1 - -// #define GxB_NO_ISGE_INT8 1 -// #define GxB_NO_ISGE_INT16 1 -// #define GxB_NO_ISGE_INT32 1 -// #define GxB_NO_ISGE_INT64 1 -// #define GxB_NO_ISGE_UINT8 1 -// #define GxB_NO_ISGE_UINT16 1 -// #define GxB_NO_ISGE_UINT32 1 -// #define GxB_NO_ISGE_UINT64 1 -// #define GxB_NO_ISGE_FP32 1 -// #define GxB_NO_ISGE_FP64 1 - -// #define GxB_NO_ISLE_INT8 1 -// #define GxB_NO_ISLE_INT16 1 -// #define GxB_NO_ISLE_INT32 1 -// #define GxB_NO_ISLE_INT64 1 -// #define GxB_NO_ISLE_UINT8 1 -// #define GxB_NO_ISLE_UINT16 1 -// #define GxB_NO_ISLE_UINT32 1 -// #define GxB_NO_ISLE_UINT64 1 -// #define GxB_NO_ISLE_FP32 1 -// #define GxB_NO_ISLE_FP64 1 - // #define GxB_NO_EQ_INT8 1 // #define GxB_NO_EQ_INT16 1 // #define GxB_NO_EQ_INT32 1 @@ -620,109 +551,115 @@ // #define GxB_NO_CMPLX_FP32 1 // #define GxB_NO_CMPLX_FP64 1 - #define GxB_NO_POW_INT8 1 - #define GxB_NO_POW_INT16 1 - #define GxB_NO_POW_INT32 1 - #define GxB_NO_POW_INT64 1 - #define GxB_NO_POW_UINT8 1 - #define GxB_NO_POW_UINT16 1 - #define GxB_NO_POW_UINT32 1 - #define GxB_NO_POW_UINT64 1 +// #define GxB_NO_POW_INT8 1 +// #define GxB_NO_POW_INT16 1 +// #define GxB_NO_POW_INT32 1 +// #define GxB_NO_POW_INT64 1 +// #define GxB_NO_POW_UINT8 1 +// #define GxB_NO_POW_UINT16 1 +// #define GxB_NO_POW_UINT32 1 +// #define GxB_NO_POW_UINT64 1 // #define GxB_NO_POW_FP32 1 // #define GxB_NO_POW_FP64 1 - #define GxB_NO_POW_FC32 1 - #define GxB_NO_POW_FC64 1 - #define GxB_NO_POW_BOOL 1 - - #define GxB_NO_BOR_INT8 1 - #define GxB_NO_BOR_INT16 1 - #define GxB_NO_BOR_INT32 1 - #define GxB_NO_BOR_INT64 1 +// #define GxB_NO_POW_FC32 1 +// #define GxB_NO_POW_FC64 1 +// #define GxB_NO_POW_BOOL 1 + +// #define GxB_NO_BOR_INT8 1 +// #define GxB_NO_BOR_INT16 1 +// #define GxB_NO_BOR_INT32 1 +// #define GxB_NO_BOR_INT64 1 // #define GxB_NO_BOR_UINT8 1 // #define GxB_NO_BOR_UINT16 1 // #define GxB_NO_BOR_UINT32 1 // #define GxB_NO_BOR_UINT64 1 - #define GxB_NO_BAND_INT8 1 - #define GxB_NO_BAND_INT16 1 - #define GxB_NO_BAND_INT32 1 - #define GxB_NO_BAND_INT64 1 +// #define GxB_NO_BAND_INT8 1 +// #define GxB_NO_BAND_INT16 1 +// #define GxB_NO_BAND_INT32 1 +// #define GxB_NO_BAND_INT64 1 // #define GxB_NO_BAND_UINT8 1 // #define GxB_NO_BAND_UINT16 1 // #define GxB_NO_BAND_UINT32 1 // #define GxB_NO_BAND_UINT64 1 - #define GxB_NO_BXOR_INT8 1 - #define GxB_NO_BXOR_INT16 1 - #define GxB_NO_BXOR_INT32 1 - #define GxB_NO_BXOR_INT64 1 +// #define GxB_NO_BXOR_INT8 1 +// #define GxB_NO_BXOR_INT16 1 +// #define GxB_NO_BXOR_INT32 1 +// #define GxB_NO_BXOR_INT64 1 // #define GxB_NO_BXOR_UINT8 1 // #define GxB_NO_BXOR_UINT16 1 // #define GxB_NO_BXOR_UINT32 1 // #define GxB_NO_BXOR_UINT64 1 - #define GxB_NO_BXNOR_INT8 1 - #define GxB_NO_BXNOR_INT16 1 - #define GxB_NO_BXNOR_INT32 1 - #define GxB_NO_BXNOR_INT64 1 +// #define GxB_NO_BXNOR_INT8 1 +// #define GxB_NO_BXNOR_INT16 1 +// #define GxB_NO_BXNOR_INT32 1 +// #define GxB_NO_BXNOR_INT64 1 // #define GxB_NO_BXNOR_UINT8 1 // #define GxB_NO_BXNOR_UINT16 1 // #define GxB_NO_BXNOR_UINT32 1 // #define GxB_NO_BXNOR_UINT64 1 - #define GxB_NO_BGET_INT8 1 - #define GxB_NO_BGET_INT16 1 - #define GxB_NO_BGET_INT32 1 - #define GxB_NO_BGET_INT64 1 +// #define GxB_NO_BGET_INT8 1 +// #define GxB_NO_BGET_INT16 1 +// #define GxB_NO_BGET_INT32 1 +// #define GxB_NO_BGET_INT64 1 // #define GxB_NO_BGET_UINT8 1 // #define GxB_NO_BGET_UINT16 1 // #define GxB_NO_BGET_UINT32 1 // #define GxB_NO_BGET_UINT64 1 - #define GxB_NO_BSET_INT8 1 - #define GxB_NO_BSET_INT16 1 - #define GxB_NO_BSET_INT32 1 - #define GxB_NO_BSET_INT64 1 +// #define GxB_NO_BSET_INT8 1 +// #define GxB_NO_BSET_INT16 1 +// #define GxB_NO_BSET_INT32 1 +// #define GxB_NO_BSET_INT64 1 // #define GxB_NO_BSET_UINT8 1 // #define GxB_NO_BSET_UINT16 1 // #define GxB_NO_BSET_UINT32 1 // #define GxB_NO_BSET_UINT64 1 - #define GxB_NO_BCLR_INT8 1 - #define GxB_NO_BCLR_INT16 1 - #define GxB_NO_BCLR_INT32 1 - #define GxB_NO_BCLR_INT64 1 +// #define GxB_NO_BCLR_INT8 1 +// #define GxB_NO_BCLR_INT16 1 +// #define GxB_NO_BCLR_INT32 1 +// #define GxB_NO_BCLR_INT64 1 // #define GxB_NO_BCLR_UINT8 1 // #define GxB_NO_BCLR_UINT16 1 // #define GxB_NO_BCLR_UINT32 1 // #define GxB_NO_BCLR_UINT64 1 - #define GxB_NO_BSHIFT_INT8 1 - #define GxB_NO_BSHIFT_INT16 1 - #define GxB_NO_BSHIFT_INT32 1 - #define GxB_NO_BSHIFT_INT64 1 +// #define GxB_NO_BSHIFT_INT8 1 +// #define GxB_NO_BSHIFT_INT16 1 +// #define GxB_NO_BSHIFT_INT32 1 +// #define GxB_NO_BSHIFT_INT64 1 // #define GxB_NO_BSHIFT_UINT8 1 // #define GxB_NO_BSHIFT_UINT16 1 // #define GxB_NO_BSHIFT_UINT32 1 // #define GxB_NO_BSHIFT_UINT64 1 +// #define GxB_NO_FIRSTI_INT32 1 // #define GxB_NO_FIRSTI_INT64 1 -// #define GxB_NO_FIRSTI1_INT64 1 + +// #define GxB_NO_FIRSTJ_INT32 1 // #define GxB_NO_FIRSTJ_INT64 1 -// #define GxB_NO_FIRSTJ1_INT64 1 + +// #define GxB_NO_SECONDI_INT32 1 // #define GxB_NO_SECONDI_INT64 1 -// #define GxB_NO_SECONDI1_INT64 1 + +// #define GxB_NO_SECONDJ_INT32 1 // #define GxB_NO_SECONDJ_INT64 1 -// #define GxB_NO_SECONDJ1_INT64 1 -// #define GxB_NO_FIRSTI_INT32 1 // #define GxB_NO_FIRSTI1_INT32 1 -// #define GxB_NO_FIRSTJ_INT32 1 +// #define GxB_NO_FIRSTI1_INT64 1 + // #define GxB_NO_FIRSTJ1_INT32 1 -// #define GxB_NO_SECONDI_INT32 1 +// #define GxB_NO_FIRSTJ1_INT64 1 + // #define GxB_NO_SECONDI1_INT32 1 -// #define GxB_NO_SECONDJ_INT32 1 +// #define GxB_NO_SECONDI1_INT64 1 + // #define GxB_NO_SECONDJ1_INT32 1 +// #define GxB_NO_SECONDJ1_INT64 1 //------------------------------------------------------------------------------ // uncomment any of these lines to disable the corresponding semiring @@ -1499,17 +1436,16 @@ #define GxB_NO_PLUS_MAX_UINT64 1 #define GxB_NO_PLUS_MAX_UINT8 1 -// not GrB_*, used in LAGraph: sparse deep neural network -// #define GxB_NO_PLUS_PLUS_FP32 1 -// #define GxB_NO_PLUS_PLUS_FP64 1 -// #define GxB_NO_PLUS_PLUS_INT16 1 -// #define GxB_NO_PLUS_PLUS_INT32 1 -// #define GxB_NO_PLUS_PLUS_INT64 1 -// #define GxB_NO_PLUS_PLUS_INT8 1 -// #define GxB_NO_PLUS_PLUS_UINT16 1 -// #define GxB_NO_PLUS_PLUS_UINT32 1 -// #define GxB_NO_PLUS_PLUS_UINT64 1 -// #define GxB_NO_PLUS_PLUS_UINT8 1 + #define GxB_NO_PLUS_PLUS_FP32 1 + #define GxB_NO_PLUS_PLUS_FP64 1 + #define GxB_NO_PLUS_PLUS_INT16 1 + #define GxB_NO_PLUS_PLUS_INT32 1 + #define GxB_NO_PLUS_PLUS_INT64 1 + #define GxB_NO_PLUS_PLUS_INT8 1 + #define GxB_NO_PLUS_PLUS_UINT16 1 + #define GxB_NO_PLUS_PLUS_UINT32 1 + #define GxB_NO_PLUS_PLUS_UINT64 1 + #define GxB_NO_PLUS_PLUS_UINT8 1 // builtin GrB_*: the classical semiring of linear algebra // #define GxB_NO_PLUS_TIMES_FP32 1 @@ -1527,27 +1463,27 @@ // also needed by GrB_reduce to vector // #define GxB_NO_PLUS_FIRST_FP32 1 // #define GxB_NO_PLUS_FIRST_FP64 1 -// #define GxB_NO_PLUS_FIRST_INT16 1 // #define GxB_NO_PLUS_FIRST_INT32 1 // #define GxB_NO_PLUS_FIRST_INT64 1 -// #define GxB_NO_PLUS_FIRST_INT8 1 -// #define GxB_NO_PLUS_FIRST_UINT16 1 -// #define GxB_NO_PLUS_FIRST_UINT32 1 -// #define GxB_NO_PLUS_FIRST_UINT64 1 -// #define GxB_NO_PLUS_FIRST_UINT8 1 + #define GxB_NO_PLUS_FIRST_INT8 1 + #define GxB_NO_PLUS_FIRST_INT16 1 + #define GxB_NO_PLUS_FIRST_UINT8 1 + #define GxB_NO_PLUS_FIRST_UINT16 1 + #define GxB_NO_PLUS_FIRST_UINT32 1 + #define GxB_NO_PLUS_FIRST_UINT64 1 // not GrB_*, used in LAGraph: Betweeness-Centrality and PageRank // also needed by GrB_reduce to vector // #define GxB_NO_PLUS_SECOND_FP32 1 // #define GxB_NO_PLUS_SECOND_FP64 1 -// #define GxB_NO_PLUS_SECOND_INT16 1 // #define GxB_NO_PLUS_SECOND_INT32 1 // #define GxB_NO_PLUS_SECOND_INT64 1 -// #define GxB_NO_PLUS_SECOND_INT8 1 -// #define GxB_NO_PLUS_SECOND_UINT16 1 -// #define GxB_NO_PLUS_SECOND_UINT32 1 -// #define GxB_NO_PLUS_SECOND_UINT64 1 -// #define GxB_NO_PLUS_SECOND_UINT8 1 + #define GxB_NO_PLUS_SECOND_INT8 1 + #define GxB_NO_PLUS_SECOND_INT16 1 + #define GxB_NO_PLUS_SECOND_UINT8 1 + #define GxB_NO_PLUS_SECOND_UINT16 1 + #define GxB_NO_PLUS_SECOND_UINT32 1 + #define GxB_NO_PLUS_SECOND_UINT64 1 #define GxB_NO_PLUS_DIV_FP32 1 #define GxB_NO_PLUS_DIV_FP64 1 @@ -1883,7 +1819,7 @@ // None of these are GrB_*, since the ANY monoid is a GxB* extension. // However, semirings based on the ANY monoid are common: BFS in particular -// uses ANY_FIRST, ANY_SECOND, and ANY_PAIR. +// uses ANY_FIRSTI, ANY_SECONDI, and ANY_PAIR. // The ANY_PAIR_ISO semiring cannot be disabled. @@ -1891,33 +1827,33 @@ // // ANY: FIRST, SECOND, PAIR (with bool, 10 real types) -// used in LAGraph: BFS, and GrB_reduce to vector -// #define GxB_NO_ANY_FIRST_BOOL 1 -// #define GxB_NO_ANY_FIRST_FP32 1 -// #define GxB_NO_ANY_FIRST_FP64 1 -// #define GxB_NO_ANY_FIRST_INT16 1 -// #define GxB_NO_ANY_FIRST_INT32 1 -// #define GxB_NO_ANY_FIRST_INT64 1 -// #define GxB_NO_ANY_FIRST_INT8 1 -// #define GxB_NO_ANY_FIRST_UINT16 1 -// #define GxB_NO_ANY_FIRST_UINT32 1 -// #define GxB_NO_ANY_FIRST_UINT64 1 -// #define GxB_NO_ANY_FIRST_UINT8 1 +// used in GrB_reduce to vector + #define GxB_NO_ANY_FIRST_BOOL 1 + #define GxB_NO_ANY_FIRST_FP32 1 + #define GxB_NO_ANY_FIRST_FP64 1 + #define GxB_NO_ANY_FIRST_INT16 1 + #define GxB_NO_ANY_FIRST_INT32 1 + #define GxB_NO_ANY_FIRST_INT64 1 + #define GxB_NO_ANY_FIRST_INT8 1 + #define GxB_NO_ANY_FIRST_UINT16 1 + #define GxB_NO_ANY_FIRST_UINT32 1 + #define GxB_NO_ANY_FIRST_UINT64 1 + #define GxB_NO_ANY_FIRST_UINT8 1 #define GxB_NO_ANY_FIRST_FC32 1 #define GxB_NO_ANY_FIRST_FC64 1 -// used in LAGraph: BFS, and GrB_reduce to vector -// #define GxB_NO_ANY_SECOND_BOOL 1 -// #define GxB_NO_ANY_SECOND_FP32 1 -// #define GxB_NO_ANY_SECOND_FP64 1 -// #define GxB_NO_ANY_SECOND_INT16 1 -// #define GxB_NO_ANY_SECOND_INT32 1 -// #define GxB_NO_ANY_SECOND_INT64 1 -// #define GxB_NO_ANY_SECOND_INT8 1 -// #define GxB_NO_ANY_SECOND_UINT16 1 -// #define GxB_NO_ANY_SECOND_UINT32 1 -// #define GxB_NO_ANY_SECOND_UINT64 1 -// #define GxB_NO_ANY_SECOND_UINT8 1 +// used in GrB_reduce to vector + #define GxB_NO_ANY_SECOND_BOOL 1 + #define GxB_NO_ANY_SECOND_FP32 1 + #define GxB_NO_ANY_SECOND_FP64 1 + #define GxB_NO_ANY_SECOND_INT16 1 + #define GxB_NO_ANY_SECOND_INT32 1 + #define GxB_NO_ANY_SECOND_INT64 1 + #define GxB_NO_ANY_SECOND_INT8 1 + #define GxB_NO_ANY_SECOND_UINT16 1 + #define GxB_NO_ANY_SECOND_UINT32 1 + #define GxB_NO_ANY_SECOND_UINT64 1 + #define GxB_NO_ANY_SECOND_UINT8 1 #define GxB_NO_ANY_SECOND_FC32 1 #define GxB_NO_ANY_SECOND_FC64 1 @@ -2227,9 +2163,9 @@ //---------------------------------------- // No builtin GrB_* semirings use positional multiplicative operators. -// BFS_parent uses ANY_SECONDI. 1-based semirings are important for 1-based -// framewarks such as Julia and Octave. In a semiring, the multiplicative -// operator SECONDI is the same as FIRSTJ. +// BFS_parent uses ANY_SECONDI (which is ANY_FIRSTJ below). 1-based semirings +// are important for 1-based framewarks such as Julia, MATLAB, and Octave. In +// a semiring, the multiplicative operator SECONDI is the same as FIRSTJ. // 36 positional semirings: // @@ -2246,8 +2182,8 @@ #define GxB_NO_MIN_FIRSTI1_INT64 1 // #define GxB_NO_MIN_FIRSTJ_INT32 1 // #define GxB_NO_MIN_FIRSTJ_INT64 1 -// #define GxB_NO_MIN_FIRSTJ1_INT32 1 -// #define GxB_NO_MIN_FIRSTJ1_INT64 1 + #define GxB_NO_MIN_FIRSTJ1_INT32 1 + #define GxB_NO_MIN_FIRSTJ1_INT64 1 #define GxB_NO_MIN_SECONDJ_INT32 1 #define GxB_NO_MIN_SECONDJ_INT64 1 #define GxB_NO_MIN_SECONDJ1_INT32 1 @@ -2259,8 +2195,8 @@ #define GxB_NO_MAX_FIRSTI1_INT64 1 // #define GxB_NO_MAX_FIRSTJ_INT32 1 // #define GxB_NO_MAX_FIRSTJ_INT64 1 -// #define GxB_NO_MAX_FIRSTJ1_INT32 1 -// #define GxB_NO_MAX_FIRSTJ1_INT64 1 + #define GxB_NO_MAX_FIRSTJ1_INT32 1 + #define GxB_NO_MAX_FIRSTJ1_INT64 1 #define GxB_NO_MAX_SECONDJ_INT32 1 #define GxB_NO_MAX_SECONDJ_INT64 1 #define GxB_NO_MAX_SECONDJ1_INT32 1 @@ -2272,8 +2208,8 @@ #define GxB_NO_ANY_FIRSTI1_INT64 1 // #define GxB_NO_ANY_FIRSTJ_INT32 1 // #define GxB_NO_ANY_FIRSTJ_INT64 1 -// #define GxB_NO_ANY_FIRSTJ1_INT32 1 -// #define GxB_NO_ANY_FIRSTJ1_INT64 1 + #define GxB_NO_ANY_FIRSTJ1_INT32 1 + #define GxB_NO_ANY_FIRSTJ1_INT64 1 #define GxB_NO_ANY_SECONDJ_INT32 1 #define GxB_NO_ANY_SECONDJ_INT64 1 #define GxB_NO_ANY_SECONDJ1_INT32 1 diff --git a/GraphBLAS/Source/README.txt b/GraphBLAS/Source/README.txt index 1962acd4fa..cf973242d7 100644 --- a/GraphBLAS/Source/README.txt +++ b/GraphBLAS/Source/README.txt @@ -1,4 +1,4 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 This folder, GraphBLAS/Source, contains all the primary source files for @@ -57,7 +57,7 @@ context GxB_Context object convert convert between matrix formats (sparse, hypersparse, bitmap, and full), and conform a matrix to its desired format. -cpu wrapper for Google's cpu_featuers package +cpu wrapper for Google's cpu_features package cumsum cumulative sum diff --git a/GraphBLAS/Source/add/GB_add.c b/GraphBLAS/Source/add/GB_add.c index 7739c5bf53..807da8353e 100644 --- a/GraphBLAS/Source/add/GB_add.c +++ b/GraphBLAS/Source/add/GB_add.c @@ -2,7 +2,7 @@ // GB_add: C = A+B, C=A+B, and C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,17 +15,18 @@ // Let the op be z=f(x,y) where x, y, and z have type xtype, ytype, and ztype. // If both A(i,j) and B(i,j) are present, then: - // C(i,j) = (ctype) op ((xtype) A(i,j), (ytype) B(i,j)) - // If just A(i,j) is present but not B(i,j), then: - // C(i,j) = (ctype) A (i,j) - // If just B(i,j) is present but not A(i,j), then: - // C(i,j) = (ctype) B (i,j) +// For eWiseUnion, the above is revised to: +// If just A(i,j) is present but not B(i,j), then: +// C(i,j) = (ctype) op ((xtype) A(i,j), (ytype) beta) +// If just B(i,j) is present but not A(i,j), then: +// C(i,j) = (ctype) op ((xtype) alpha, (ytype) B(i,j)) + // ctype is the type of matrix C. The pattern of C is the union of A and B. // If A_and_B_are_disjoint is true, the intersection of A and B must be empty. @@ -48,7 +49,21 @@ #include "add/GB_add.h" -#define GB_FREE_ALL ; +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&C_to_M, C_to_M_size) ; \ + GB_FREE_MEMORY (&C_to_A, C_to_A_size) ; \ + GB_FREE_MEMORY (&C_to_B, C_to_B_size) ; \ +} + +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORKSPACE ; \ + GB_FREE_MEMORY (&Ch, Ch_size) ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ + GB_phybix_free (C) ; \ +} GrB_Info GB_add // C=A+B, C=A+B, or C=A+B ( @@ -77,7 +92,7 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT (mask_applied != NULL) ; (*mask_applied) = false ; @@ -89,11 +104,26 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B ASSERT (A->vdim == B->vdim && A->vlen == B->vlen) ; ASSERT (GB_IMPLIES (M != NULL, A->vdim == M->vdim && A->vlen == M->vlen)) ; + //-------------------------------------------------------------------------- + // declare workspace + //-------------------------------------------------------------------------- + + int64_t Cnvec = 0, Cnvec_nonempty = 0 ; + void *Cp = NULL ; size_t Cp_size = 0 ; + void *Ch = NULL ; size_t Ch_size = 0 ; + int64_t *C_to_M = NULL ; size_t C_to_M_size = 0 ; + int64_t *C_to_A = NULL ; size_t C_to_A_size = 0 ; + int64_t *C_to_B = NULL ; size_t C_to_B_size = 0 ; + bool Ch_is_Mh ; + int C_ntasks = 0, C_nthreads ; + GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + //-------------------------------------------------------------------------- // delete any lingering zombies and assemble any pending tuples //-------------------------------------------------------------------------- - // TODO: some cases can allow M, A, and/or B to be jumbled + // FUTURE: some cases can allow M, A, and/or B to be jumbled GB_MATRIX_WAIT (M) ; // cannot be jumbled GB_MATRIX_WAIT (A) ; // cannot be jumbled GB_MATRIX_WAIT (B) ; // cannot be jumbled @@ -106,37 +136,21 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B int C_sparsity = GB_add_sparsity (&apply_mask, M, Mask_struct, Mask_comp, A, B) ; - //-------------------------------------------------------------------------- - // initializations - //-------------------------------------------------------------------------- - - int64_t Cnvec = 0 , Cnvec_nonempty = 0 ; - int64_t *Cp = NULL ; size_t Cp_size = 0 ; - int64_t *Ch = NULL ; size_t Ch_size = 0 ; - int64_t *C_to_M = NULL ; size_t C_to_M_size = 0 ; - int64_t *C_to_A = NULL ; size_t C_to_A_size = 0 ; - int64_t *C_to_B = NULL ; size_t C_to_B_size = 0 ; - bool Ch_is_Mh ; - int C_ntasks = 0, C_nthreads ; - GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; - //-------------------------------------------------------------------------- // phase0: finalize the sparsity C and find the vectors in C //-------------------------------------------------------------------------- - info = GB_add_phase0 ( - // computed by by phase0: - &Cnvec, &Ch, &Ch_size, &C_to_M, &C_to_M_size, &C_to_A, &C_to_A_size, + GB_OK (GB_add_phase0 ( + // computed by phase0: + &Cnvec, &Ch, &Ch_size, + &C_to_M, &C_to_M_size, + &C_to_A, &C_to_A_size, &C_to_B, &C_to_B_size, &Ch_is_Mh, + &Cp_is_32, &Cj_is_32, &Ci_is_32, // input/output to phase0: &C_sparsity, // original input: - (apply_mask) ? M : NULL, A, B, Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory - return (info) ; - } + (apply_mask) ? M : NULL, A, B, Werk)) ; GBURBLE ("add:(%s<%s%s>=%s+%s) ", GB_sparsity_char (C_sparsity), @@ -157,43 +171,24 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B //---------------------------------------------------------------------- // phase1a: split C into tasks - info = GB_ewise_slice ( + GB_OK (GB_ewise_slice ( // computed by phase1a &TaskList, &TaskList_size, &C_ntasks, &C_nthreads, // computed by phase0: - Cnvec, Ch, C_to_M, C_to_A, C_to_B, Ch_is_Mh, + Cnvec, Ch, Cj_is_32, C_to_M, C_to_A, C_to_B, Ch_is_Mh, // original input: - (apply_mask) ? M : NULL, A, B, Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory; free everything allocated by GB_add_phase0 - GB_FREE (&Ch, Ch_size) ; - GB_FREE_WORK (&C_to_M, C_to_M_size) ; - GB_FREE_WORK (&C_to_A, C_to_A_size) ; - GB_FREE_WORK (&C_to_B, C_to_B_size) ; - return (info) ; - } + (apply_mask) ? M : NULL, A, B, Werk)) ; // count the number of entries in each vector of C - info = GB_add_phase1 ( + GB_OK (GB_add_phase1 ( // computed or used by phase1: &Cp, &Cp_size, &Cnvec_nonempty, A_and_B_are_disjoint, // from phase1a: TaskList, C_ntasks, C_nthreads, // from phase0: - Cnvec, Ch, C_to_M, C_to_A, C_to_B, Ch_is_Mh, + Cnvec, Ch, C_to_M, C_to_A, C_to_B, Ch_is_Mh, Cp_is_32, Cj_is_32, // original input: - (apply_mask) ? M : NULL, Mask_struct, Mask_comp, A, B, Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory; free everything allocated by GB_add_phase0 - GB_FREE_WORK (&TaskList, TaskList_size) ; - GB_FREE (&Ch, Ch_size) ; - GB_FREE_WORK (&C_to_M, C_to_M_size) ; - GB_FREE_WORK (&C_to_A, C_to_A_size) ; - GB_FREE_WORK (&C_to_B, C_to_B_size) ; - return (info) ; - } + (apply_mask) ? M : NULL, Mask_struct, Mask_comp, A, B, Werk)) ; } else @@ -215,7 +210,7 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B // Cp and Ch are either freed by phase2, or transplanted into C. // Either way, they are not freed here. - info = GB_add_phase2 ( + GB_OK (GB_add_phase2 ( // computed or used by phase2: C, ctype, C_is_csc, op, flipij, A_and_B_are_disjoint, // from phase1 @@ -223,30 +218,21 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B // from phase1a: TaskList, C_ntasks, C_nthreads, // from phase0: - Cnvec, &Ch, Ch_size, C_to_M, C_to_A, C_to_B, Ch_is_Mh, C_sparsity, + Cnvec, &Ch, Ch_size, C_to_M, C_to_A, C_to_B, Ch_is_Mh, + Cp_is_32, Cj_is_32, Ci_is_32, C_sparsity, // original input: (apply_mask) ? M : NULL, Mask_struct, Mask_comp, A, B, - is_eWiseUnion, alpha, beta, Werk) ; + is_eWiseUnion, alpha, beta, Werk)) ; - // Ch and Cp must not be freed; they are now C->h and C->p. + // Ch and Cp have been set to NULL and now appear as C->h and C->p. // If the method failed, Cp and Ch have already been freed. - // free workspace - GB_FREE_WORK (&TaskList, TaskList_size) ; - GB_FREE_WORK (&C_to_M, C_to_M_size) ; - GB_FREE_WORK (&C_to_A, C_to_A_size) ; - GB_FREE_WORK (&C_to_B, C_to_B_size) ; - - if (info != GrB_SUCCESS) - { - // out of memory - return (info) ; - } - //-------------------------------------------------------------------------- - // return result + // free workspace and return result //-------------------------------------------------------------------------- + GB_FREE_WORKSPACE ; + GB_OK (info) ; ASSERT_MATRIX_OK (C, "C output for add", GB0) ; (*mask_applied) = apply_mask ; return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/add/GB_add.h b/GraphBLAS/Source/add/GB_add.h index a3adeb59d0..9dbad91504 100644 --- a/GraphBLAS/Source/add/GB_add.h +++ b/GraphBLAS/Source/add/GB_add.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_add.h: definitiions for GB_add and related functions +// GB_add.h: definitions for GB_add and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,25 +34,28 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B GrB_Info GB_add_phase1 // count nnz in each C(:,j) ( - int64_t **Cp_handle, // output of size Cnvec+1 + // output of phase1: + void **Cp_handle, // output of size Cnvec+1 size_t *Cp_size_handle, int64_t *Cnvec_nonempty, // # of non-empty vectors in C const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // tasks from phase0b: - GB_task_struct *restrict TaskList, // array of structs + GB_task_struct *restrict TaskList, // array of structs const int C_ntasks, // # of tasks const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, + const void *Ch, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, - const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit // original input: - const GrB_Matrix M, // optional mask, may be NULL - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, use !M + const GrB_Matrix M, // optional mask, may be NULL + const bool Mask_struct, // if true, use the only structure of M + const bool Mask_comp, // if true, use !M const GrB_Matrix A, const GrB_Matrix B, GB_Werk Werk @@ -67,7 +70,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // from phase1: - int64_t **Cp_handle, // vector pointers for C + void **Cp_handle, // vector pointers for C size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: @@ -76,12 +79,15 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - int64_t **Ch_handle, + void **Ch_handle, size_t Ch_size, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit + const bool Ci_is_32, // if true, Ci is 32-bit; else 64-bit const int C_sparsity, // original input: const GrB_Matrix M, // optional mask, may be NULL @@ -90,8 +96,8 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const GrB_Matrix A, const GrB_Matrix B, const bool is_eWiseUnion, // if true, eWiseUnion, else eWiseAdd - const GrB_Scalar alpha, // alpha and beta ignored for eWiseAdd, - const GrB_Scalar beta, // nonempty scalars for GxB_eWiseUnion + const GrB_Scalar alpha, // alpha and beta ignored for eWiseAdd, + const GrB_Scalar beta, // nonempty scalars for GxB_eWiseUnion GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/add/GB_add_iso.c b/GraphBLAS/Source/add/GB_add_iso.c index 1b3637c197..6ef15b6be0 100644 --- a/GraphBLAS/Source/add/GB_add_iso.c +++ b/GraphBLAS/Source/add/GB_add_iso.c @@ -2,7 +2,7 @@ // GB_add_iso: apply a binary op and check for iso result for C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/GB_add_phase0.c b/GraphBLAS/Source/add/GB_add_phase0.c index a1a0bfcb16..79493a2c02 100644 --- a/GraphBLAS/Source/add/GB_add_phase0.c +++ b/GraphBLAS/Source/add/GB_add_phase0.c @@ -2,7 +2,7 @@ // GB_add_phase0: find vectors of C to compute for C=A+B or C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,7 @@ // It is pruned at the end of GB_add_phase2. If Ch is NULL then it is an // implicit list of size n, and Ch [k] == k for all k = 0:n-1. In this // case, C will be a sparse matrix, not hypersparse. Thus, the kth -// vector is j = GBH (Ch, k). +// vector is j = GBh (Ch, k). // Ch is freed by GB_add if phase1 fails. phase2 either frees it or // transplants it into C, if C is hypersparse. @@ -38,17 +38,17 @@ // is determined by passing in p_Ch_is_Mh as a NULL or non-NULL pointer. // C_to_A: if A is hypersparse, then C_to_A [k] = kA if the kth vector, -// j = GBH (Ch, k) appears in A, as j = Ah [kA]. If j does not appear in +// j = GBh (Ch, k) appears in A, as j = Ah [kA]. If j does not appear in // A, then C_to_A [k] = -1. If A is not hypersparse, then C_to_A is // returned as NULL. // C_to_B: if B is hypersparse, then C_to_B [k] = kB if the kth vector, -// j = GBH (Ch, k) appears in B, as j = Bh [kB]. If j does not appear in +// j = GBh (Ch, k) appears in B, as j = Bh [kB]. If j does not appear in // B, then C_to_B [k] = -1. If B is not hypersparse, then C_to_B is // returned as NULL. // C_to_M: if M is hypersparse, and Ch_is_Mh is false, then C_to_M [k] = -// kM if the kth vector, j = GBH (Ch, k) appears in M, as j = Mh [kM]. If +// kM if the kth vector, j = GBh (Ch, k) appears in M, as j = Mh [kM]. If // j does not appear in M, then C_to_M [k] = -1. If M is not hypersparse, // then C_to_M is returned as NULL. @@ -63,10 +63,10 @@ #define GB_FREE_ALL \ { \ - GB_FREE (&Ch, Ch_size) ; \ - GB_FREE_WORK (&C_to_M, C_to_M_size) ; \ - GB_FREE_WORK (&C_to_A, C_to_A_size) ; \ - GB_FREE_WORK (&C_to_B, C_to_B_size) ; \ + GB_FREE_MEMORY (&Ch, Ch_size) ; \ + GB_FREE_MEMORY (&C_to_M, C_to_M_size) ; \ + GB_FREE_MEMORY (&C_to_A, C_to_A_size) ; \ + GB_FREE_MEMORY (&C_to_B, C_to_B_size) ; \ GB_FREE_WORKSPACE ; \ } @@ -79,31 +79,34 @@ static inline bool GB_allocate_result ( int64_t Cnvec, - int64_t *restrict *Ch_handle, size_t *Ch_size_handle, - int64_t *restrict *C_to_M_handle, size_t *C_to_M_size_handle, - int64_t *restrict *C_to_A_handle, size_t *C_to_A_size_handle, - int64_t *restrict *C_to_B_handle, size_t *C_to_B_size_handle + void **Ch_handle, size_t *Ch_size_handle, size_t cjsize, + int64_t *restrict *C_to_M_handle, size_t *C_to_M_size_handle, + int64_t *restrict *C_to_A_handle, size_t *C_to_A_size_handle, + int64_t *restrict *C_to_B_handle, size_t *C_to_B_size_handle ) { bool ok = true ; if (Ch_handle != NULL) { - (*Ch_handle) = GB_MALLOC (Cnvec, int64_t, Ch_size_handle) ; + (*Ch_handle) = GB_MALLOC_MEMORY (Cnvec, cjsize, Ch_size_handle) ; ok = (*Ch_handle != NULL) ; } if (C_to_M_handle != NULL) { - (*C_to_M_handle) = GB_MALLOC_WORK (Cnvec, int64_t, C_to_M_size_handle) ; + (*C_to_M_handle) = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), + C_to_M_size_handle) ; ok = ok && (*C_to_M_handle != NULL) ; } if (C_to_A_handle != NULL) { - *C_to_A_handle = GB_MALLOC_WORK (Cnvec, int64_t, C_to_A_size_handle) ; + *C_to_A_handle = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), + C_to_A_size_handle) ; ok = ok && (*C_to_A_handle != NULL) ; } if (C_to_B_handle != NULL) { - *C_to_B_handle = GB_MALLOC_WORK (Cnvec, int64_t, C_to_B_size_handle) ; + *C_to_B_handle = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), + C_to_B_size_handle) ; ok = ok && (*C_to_B_handle != NULL) ; } return (ok) ; @@ -113,6 +116,28 @@ static inline bool GB_allocate_result // GB_add_phase0: find the vectors of C for C=A+B //------------------------------------------------------------------------------ +// GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B +// ( +// int64_t *p_Cnvec, // # of vectors to compute in C +// void **Ch_handle, // Ch: size Cnvec, or NULL +// size_t *Ch_size_handle, // size of Ch in bytes +// int64_t *restrict *C_to_M_handle, // C_to_M: size Cnvec, or NULL +// size_t *C_to_M_size_handle, // size of C_to_M in bytes +// int64_t *restrict *C_to_A_handle, // C_to_A: size Cnvec, or NULL +// size_t *C_to_A_size_handle, // size of C_to_A in bytes +// int64_t *restrict *C_to_B_handle, // C_to_B: size Cnvec, or NULL +// size_t *C_to_B_size_handle, // size of C_to_A in bytes +// bool *p_Ch_is_Mh, // if true, then Ch == Mh +// bool *p_Cp_is_32, // if true, Cp is 32-bit; else 64-bit +// bool *p_Cj_is_32, // if true, Ch is 32-bit; else 64-bit +// bool *p_Ci_is_32, // if true, Ci is 32-bit; else 64-bit +// int *C_sparsity, // sparsity structure of C +// const GrB_Matrix M, // optional mask, may be NULL; not compl. +// const GrB_Matrix A, // first input matrix +// const GrB_Matrix B, // second input matrix +// GB_Werk Werk +// ) + GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) { @@ -127,6 +152,9 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT (Ch_handle != NULL) ; ASSERT (C_to_A_handle != NULL) ; ASSERT (C_to_B_handle != NULL) ; + ASSERT (p_Cp_is_32 != NULL) ; + ASSERT (p_Cj_is_32 != NULL) ; + ASSERT (p_Ci_is_32 != NULL) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for add phase0", GB0) ; ASSERT (!GB_ZOMBIES (M)) ; @@ -149,7 +177,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT (GB_IMPLIES (M != NULL, A->vlen == M->vlen)) ; //-------------------------------------------------------------------------- - // initializations + // initializations and check for quick return //-------------------------------------------------------------------------- (*p_Cnvec) = 0 ; @@ -169,10 +197,14 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) { // nothing to do in phase0 for C bitmap or full (*p_Cnvec) = A->vdim ; // not needed; to be consistent with GB_emult + (*p_Cp_is_32) = false ; + (*p_Cj_is_32) = false ; + (*p_Ci_is_32) = false ; return (GrB_SUCCESS) ; } - int64_t *restrict Ch = NULL ; size_t Ch_size = 0 ; + GB_MDECL (Ch, , u) ; size_t Ch_size = 0 ; + int64_t *restrict C_to_M = NULL ; size_t C_to_M_size = 0 ; int64_t *restrict C_to_A = NULL ; size_t C_to_A_size = 0 ; int64_t *restrict C_to_B = NULL ; size_t C_to_B_size = 0 ; @@ -196,29 +228,43 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) int64_t n = A->vdim ; int64_t Anvec = A->nvec ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - bool A_is_hyper = (Ah != NULL) ; + void *Ap = A->p ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + const bool A_is_hyper = (Ah != NULL) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; + const int64_t anz = GB_nnz (A) ; int64_t Bnvec = B->nvec ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - bool B_is_hyper = (Bh != NULL) ; - - int64_t Mnvec = 0 ; - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; + void *Bp = B->p ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + const bool B_is_hyper = (Bh != NULL) ; + const bool Bp_is_32 = B->p_is_32 ; + const bool Bj_is_32 = B->j_is_32 ; + const int64_t bnz = GB_nnz (A) ; + + int64_t Mnvec = (M == NULL) ? 0 : M->nvec ; + void *Mp = (M == NULL) ? NULL : M->p ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; - if (M != NULL) - { - Mnvec = M->nvec ; - Mp = M->p ; - Mh = M->h ; - } + const bool Mp_is_32 = (M == NULL) ? false : M->p_is_32 ; + const bool Mj_is_32 = (M == NULL) ? false : M->j_is_32 ; + + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, anz + bnz, A->vlen, A->vdim, Werk) ; + (*p_Cp_is_32) = Cp_is_32 ; + (*p_Cj_is_32) = Cj_is_32 ; + (*p_Ci_is_32) = Ci_is_32 ; + size_t cjsize = (Cj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + GB_Type_code cjcode = (Cj_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code mjcode = (Mj_is_32) ? GB_UINT32_code : GB_UINT64_code ; // For GB_add, if M is present, hypersparse, and not complemented, then C - // will be hypersparse, and it will have set of vectors as M (Ch == Mh). - // For GB_masker, Ch is never equal to Mh. + // will be hypersparse, and it will have the same set of vectors as M (Ch + // will contain the same content as Mh). For GB_masker, Ch is never equal + // to Mh. bool Ch_is_Mh = (p_Ch_is_Mh != NULL) && (M != NULL && M_is_hyper) ; //-------------------------------------------------------------------------- @@ -238,8 +284,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) nthreads = GB_nthreads (Cnvec, chunk, nthreads_max) ; if (!GB_allocate_result (Cnvec, - &Ch, &Ch_size, - NULL, NULL, + &Ch, &Ch_size, cjsize, + NULL, NULL, (A_is_hyper) ? (&C_to_A) : NULL, &C_to_A_size, (B_is_hyper) ? (&C_to_B) : NULL, &C_to_B_size)) { @@ -247,9 +293,10 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Ch, Cj_is_32) ; // copy Mh into Ch. Ch is Mh so C_to_M is not needed. - GB_memcpy (Ch, Mh, Mnvec * sizeof (int64_t), nthreads) ; + GB_cast_int (Ch, cjcode, Mh, mjcode, Mnvec, nthreads) ; // construct the mapping from C to A and B, if they are hypersparse if (A_is_hyper || B_is_hyper) @@ -259,35 +306,37 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) GB_OK (GB_hyper_hash_build (A, Werk)) ; GB_OK (GB_hyper_hash_build (B, Werk)) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - const int64_t *restrict B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *restrict B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *restrict B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; + const void *B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; + const void *B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; + const void *B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; int64_t k ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < Cnvec ; k++) { - int64_t j = Ch [k] ; + int64_t j = GB_IGET (Ch, k) ; // j = Ch [k] if (A_is_hyper) { // C_to_A [k] = kA if Ah [kA] == j and A(:,j) is non-empty int64_t pA, pA_end ; - int64_t kA = GB_hyper_hash_lookup (Ah, Anvec, Ap, A_Yp, - A_Yi, A_Yx, A_hash_bits, j, &pA, &pA_end) ; + int64_t kA = GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, Anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + j, &pA, &pA_end) ; C_to_A [k] = (pA < pA_end) ? kA : -1 ; } if (B_is_hyper) { // C_to_B [k] = kB if Bh [kB] == j and B(:,j) is non-empty int64_t pB, pB_end ; - int64_t kB = GB_hyper_hash_lookup (Bh, Bnvec, Bp, B_Yp, - B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; + int64_t kB = GB_hyper_hash_lookup (Bp_is_32, Bj_is_32, + Bh, Bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB, &pB_end) ; C_to_B [k] = (pB < pB_end) ? kB : -1 ; } } @@ -339,9 +388,9 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) double target_work = ((ntasks-taskid) * work) / ntasks ; GB_slice_vector (NULL, NULL, &(kA_start [taskid]), &(kB_start [taskid]), - 0, 0, NULL, // Mi not present - 0, Anvec, Ah, // Ah, explicit list - 0, Bnvec, Bh, // Bh, explicit list + 0, 0, NULL, false, // Mi not present + 0, Anvec, Ah, Aj_is_32, // Ah, explicit list + 0, Bnvec, Bh, Bj_is_32, // Bh, explicit list n, // Ah and Bh have dimension n target_work) ; } @@ -362,8 +411,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) int64_t kC = 0 ; for ( ; kA < kA_end && kB < kB_end ; kC++) { - int64_t jA = Ah [kA] ; - int64_t jB = Bh [kB] ; + int64_t jA = GB_IGET (Ah, kA) ; + int64_t jB = GB_IGET (Bh, kB) ; if (jA < jB) { // jA appears in A but not B @@ -388,7 +437,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) // cumulative sum of entries in Ch for each task //---------------------------------------------------------------------- - GB_cumsum1 (kC_start, ntasks) ; + GB_cumsum1_64 ((uint64_t *) kC_start, ntasks) ; Cnvec = kC_start [ntasks] ; //---------------------------------------------------------------------- @@ -399,7 +448,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) // for computing Ch. Ch is the set union of Ah and Bh. if (!GB_allocate_result (Cnvec, - &Ch, &Ch_size, + &Ch, &Ch_size, cjsize, (M_is_hyper) ? (&C_to_M) : NULL, &C_to_M_size, &C_to_A, &C_to_A_size, &C_to_B, &C_to_B_size)) @@ -408,6 +457,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Ch, Cj_is_32) ; //---------------------------------------------------------------------- // compute the result: Ch and the mappings C_to_[AB] @@ -426,26 +476,26 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) // merge Ah and Bh into Ch for ( ; kA < kA_end && kB < kB_end ; kC++) { - int64_t jA = Ah [kA] ; - int64_t jB = Bh [kB] ; + int64_t jA = GB_IGET (Ah, kA) ; + int64_t jB = GB_IGET (Bh, kB) ; if (jA < jB) { // append jA to Ch - Ch [kC] = jA ; + GB_ISET (Ch, kC, jA) ; // Ch [kC] = jA C_to_A [kC] = kA++ ; - C_to_B [kC] = -1 ; // jA does not appear in B + C_to_B [kC] = -1 ; // jA does not appear in B } else if (jB < jA) { // append jB to Ch - Ch [kC] = jB ; - C_to_A [kC] = -1 ; // jB does not appear in A + GB_ISET (Ch, kC, jB) ; // Ch [kC] = jB ; + C_to_A [kC] = -1 ; // jB does not appear in A C_to_B [kC] = kB++ ; } else { // j appears in both A and B; append it to Ch - Ch [kC] = jA ; + GB_ISET (Ch, kC, jA) ; // Ch [kC] = jA C_to_A [kC] = kA++ ; C_to_B [kC] = kB++ ; } @@ -456,8 +506,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) for ( ; kA < kA_end ; kA++, kC++) { // append jA to Ch - int64_t jA = Ah [kA] ; - Ch [kC] = jA ; + int64_t jA = GB_IGET (Ah, kA) ; + GB_ISET (Ch, kC, jA) ; // Ch [kC] = jA C_to_A [kC] = kA ; C_to_B [kC] = -1 ; } @@ -468,8 +518,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) for ( ; kB < kB_end ; kB++, kC++) { // append jB to Ch - int64_t jB = Bh [kB] ; - Ch [kC] = jB ; + int64_t jB = GB_IGET (Bh, kB) ; + GB_ISET (Ch, kC, jB) ; // Ch [kC] = jB ; C_to_A [kC] = -1 ; C_to_B [kC] = kB ; } @@ -488,26 +538,26 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) int64_t kC = 0 ; for ( ; kA < Anvec && kB < Bnvec ; kC++) { - int64_t jA = Ah [kA] ; - int64_t jB = Bh [kB] ; + int64_t jA = GB_IGET (Ah, kA) ; + int64_t jB = GB_IGET (Bh, kB) ; if (jA < jB) { // append jA to Ch - ASSERT (Ch [kC] == jA) ; + ASSERT (GB_IGET (Ch, kC) == jA) ; ASSERT (C_to_A [kC] == kA) ; kA++ ; ASSERT (C_to_B [kC] == -1) ; // jA does not appear in B } else if (jB < jA) { // append jB to Ch - ASSERT (Ch [kC] == jB) ; + ASSERT (GB_IGET (Ch, kC) == jB) ; ASSERT (C_to_A [kC] == -1) ; // jB does not appear in A ASSERT (C_to_B [kC] == kB) ; kB++ ; } else { // j appears in both A and B; append it to Ch - ASSERT (Ch [kC] == jA) ; + ASSERT (GB_IGET (Ch, kC) == jA) ; ASSERT (C_to_A [kC] == kA) ; kA++ ; ASSERT (C_to_B [kC] == kB) ; kB++ ; } @@ -518,8 +568,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) for ( ; kA < Anvec ; kA++, kC++) { // append jA to Ch - int64_t jA = Ah [kA] ; - ASSERT (Ch [kC] == jA) ; + int64_t jA = GB_IGET (Ah, kA) ; + ASSERT (GB_IGET (Ch, kC) == jA) ; ASSERT (C_to_A [kC] == kA) ; ASSERT (C_to_B [kC] == -1) ; } @@ -530,8 +580,8 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) for ( ; kB < Bnvec ; kB++, kC++) { // append jB to Ch - int64_t jB = Bh [kB] ; - ASSERT (Ch [kC] == jB) ; + int64_t jB = GB_IGET (Bh, kB) ; + ASSERT (GB_IGET (Ch, kC) == jB) ; ASSERT (C_to_A [kC] == -1) ; ASSERT (C_to_B [kC] == kB) ; } @@ -553,7 +603,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) nthreads = GB_nthreads (Cnvec, chunk, nthreads_max) ; if (!GB_allocate_result (Cnvec, - NULL, NULL, + NULL, NULL, 0, (M_is_hyper) ? (&C_to_M) : NULL, &C_to_M_size, &C_to_A, &C_to_A_size, NULL, NULL)) @@ -575,7 +625,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) #pragma omp parallel for num_threads(nthreads) schedule(static) for (kA = 0 ; kA < Anvec ; kA++) { - int64_t jA = Ah [kA] ; + int64_t jA = GB_IGET (Ah, kA) ; C_to_A [jA] = kA ; } @@ -593,7 +643,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) nthreads = GB_nthreads (Cnvec, chunk, nthreads_max) ; if (!GB_allocate_result (Cnvec, - NULL, NULL, + NULL, NULL, 0, (M_is_hyper) ? (&C_to_M) : NULL, &C_to_M_size, NULL, NULL, &C_to_B, &C_to_B_size)) @@ -615,7 +665,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) #pragma omp parallel for num_threads(nthreads) schedule(static) for (kB = 0 ; kB < Bnvec ; kB++) { - int64_t jB = Bh [kB] ; + int64_t jB = GB_IGET (Bh, kB) ; C_to_B [jB] = kB ; } @@ -632,7 +682,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) nthreads = GB_nthreads (Cnvec, chunk, nthreads_max) ; if (!GB_allocate_result (Cnvec, - NULL, NULL, + NULL, NULL, 0, (M_is_hyper) ? (&C_to_M) : NULL, &C_to_M_size, NULL, NULL, NULL, NULL)) @@ -657,20 +707,21 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) // create the M->Y hyper_hash GB_OK (GB_hyper_hash_build (M, Werk)) ; - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; int64_t k ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < Cnvec ; k++) { - int64_t j = Ch [k] ; + int64_t j = GB_IGET (Ch, k) ; // C_to_M [k] = kM if Mh [kM] == j and M(:,j) is non-empty int64_t pM, pM_end ; - int64_t kM = GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, - M_Yx, M_hash_bits, j, &pM, &pM_end) ; + int64_t kM = GB_hyper_hash_lookup (Mp_is_32, Mj_is_32, + Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, + j, &pM, &pM_end) ; C_to_M [k] = (pM < pM_end) ? kM : -1 ; } } @@ -688,7 +739,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) #pragma omp parallel for num_threads(nthreads) schedule(static) for (kM = 0 ; kM < Mnvec ; kM++) { - int64_t jM = Mh [kM] ; + int64_t jM = GB_IGET (Mh, kM) ; C_to_M [jM] = kM ; } } @@ -721,10 +772,10 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT ((*C_sparsity) == GxB_SPARSE || (*C_sparsity) == GxB_HYPERSPARSE) ; ASSERT (A != NULL) ; // A and B are always present ASSERT (B != NULL) ; + GB_IPTR (Ch, Cj_is_32) ; int64_t jlast = -1 ; for (int64_t k = 0 ; k < Cnvec ; k++) { - // C(:,j) is in the list, as the kth vector int64_t j ; if (Ch == NULL) @@ -737,7 +788,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) { // C will be constructed as hypersparse ASSERT ((*C_sparsity) == GxB_HYPERSPARSE) ; - j = Ch [k] ; + j = GB_IGET (Ch, k) ; } // vectors j in Ch are sorted, and in the range 0:n-1 @@ -754,7 +805,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT (kA >= -1 && kA < A->nvec) ; if (kA >= 0) { - int64_t jA = A->h [kA] ; + int64_t jA = GB_IGET (Ah, kA) ; ASSERT (j == jA) ; } } @@ -774,7 +825,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT (kB >= -1 && kB < B->nvec) ; if (kB >= 0) { - int64_t jB = B->h [kB] ; + int64_t jB = GB_IGET (Bh, kB) ; ASSERT (j == jB) ; } } @@ -791,7 +842,9 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) // Ch is the same as Mh ASSERT (M != NULL) ; ASSERT (M_is_hyper) ; - ASSERT (Ch != NULL && M->h != NULL && Ch [k] == M->h [k]) ; + ASSERT (Ch != NULL) ; + ASSERT (Mh != NULL) ; + ASSERT (GB_IGET (Ch, k) == GB_IGET (Mh, k)) ; ASSERT (C_to_M == NULL) ; } else if (C_to_M != NULL) @@ -803,7 +856,7 @@ GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ASSERT (kM >= -1 && kM < M->nvec) ; if (kM >= 0) { - int64_t jM = M->h [kM] ; + int64_t jM = GB_IGET (Mh, kM) ; ASSERT (j == jM) ; } } diff --git a/GraphBLAS/Source/add/GB_add_phase1.c b/GraphBLAS/Source/add/GB_add_phase1.c index dd81a89780..8a44b04939 100644 --- a/GraphBLAS/Source/add/GB_add_phase1.c +++ b/GraphBLAS/Source/add/GB_add_phase1.c @@ -2,7 +2,7 @@ // GB_add_phase1: # entries in C=A+B, C=A+B (C is sparse/hyper) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,29 +20,31 @@ // Cp is constructed here, and either freed by phase2, or transplanted into C. #include "add/GB_add.h" -#include "include/GB_unused.h" GrB_Info GB_add_phase1 // count nnz in each C(:,j) ( - int64_t **Cp_handle, // output of size Cnvec+1 + // output of phase1: + void **Cp_handle, // output of size Cnvec+1 size_t *Cp_size_handle, int64_t *Cnvec_nonempty, // # of non-empty vectors in C const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // tasks from phase0b: - GB_task_struct *restrict TaskList, // array of structs + GB_task_struct *restrict TaskList, // array of structs const int C_ntasks, // # of tasks const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, + const void *Ch, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, - const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit // original input: - const GrB_Matrix M, // optional mask, may be NULL - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, use !M + const GrB_Matrix M, // optional mask, may be NULL + const bool Mask_struct, // if true, use the only structure of M + const bool Mask_comp, // if true, use !M const GrB_Matrix A, const GrB_Matrix B, GB_Werk Werk @@ -78,13 +80,16 @@ GrB_Info GB_add_phase1 // count nnz in each C(:,j) //-------------------------------------------------------------------------- (*Cp_handle) = NULL ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - Cp = GB_CALLOC (GB_IMAX (2, Cnvec+1), int64_t, &Cp_size) ; + GB_MDECL (Cp, , u) ; size_t Cp_size = 0 ; + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Cp = GB_CALLOC_MEMORY (GB_IMAX (2, Cnvec+1), cpsize, &Cp_size) ; if (Cp == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Cp, Cp_is_32) ; + GB_IDECL (Ch, const, u) ; GB_IPTR (Ch, Cj_is_32) ; //-------------------------------------------------------------------------- // count the entries in each vector of C @@ -101,8 +106,8 @@ GrB_Info GB_add_phase1 // count nnz in each C(:,j) // cumulative sum of Cp and fine tasks in TaskList //-------------------------------------------------------------------------- - GB_task_cumsum (Cp, Cnvec, Cnvec_nonempty, TaskList, C_ntasks, C_nthreads, - Werk) ; + GB_task_cumsum (Cp, Cp_is_32, Cnvec, Cnvec_nonempty, TaskList, + C_ntasks, C_nthreads, Werk) ; //-------------------------------------------------------------------------- // return the result diff --git a/GraphBLAS/Source/add/GB_add_phase2.c b/GraphBLAS/Source/add/GB_add_phase2.c index b07c095d7d..b0fb76d349 100644 --- a/GraphBLAS/Source/add/GB_add_phase2.c +++ b/GraphBLAS/Source/add/GB_add_phase2.c @@ -2,7 +2,7 @@ // GB_add_phase2: C=A+B or C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,8 +29,6 @@ #include "add/GB_add.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" -#include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -61,7 +59,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // from phase1: - int64_t **Cp_handle, // vector pointers for C + void **Cp_handle, // vector pointers for C size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: @@ -70,12 +68,15 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - int64_t **Ch_handle, + void **Ch_handle, size_t Ch_size, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, const bool Ch_is_Mh, // if true, then Ch == M->h + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit + const bool Ci_is_32, // if true, Ci is 32-bit; else 64-bit const int C_sparsity, // original input: const GrB_Matrix M, // optional mask, may be NULL @@ -94,7 +95,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_BINARYOP_OK (op, "op for add phase2", GB0) ; ASSERT_MATRIX_OK (A, "A for add phase2", GB0) ; ASSERT_MATRIX_OK (B, "B for add phase2", GB0) ; @@ -111,8 +112,12 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B ASSERT (Cp_handle != NULL) ; ASSERT (Ch_handle != NULL) ; - int64_t *restrict Cp = (*Cp_handle) ; - int64_t *restrict Ch = (*Ch_handle) ; + + GB_MDECL (Cp, , u) ; + Cp = (*Cp_handle) ; + GB_IPTR (Cp, Cp_is_32) ; + + void * Ch = (*Ch_handle) ; //-------------------------------------------------------------------------- // get the opcode @@ -253,27 +258,29 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B // or if M is present, not complemented, and hypersparse. // C acquires the same hyperatio as A. - int64_t cnz = (C_is_sparse_or_hyper) ? (Cp [Cnvec]) : GB_nnz_full (A) ; + int64_t cnz = (C_is_sparse_or_hyper) ? + (GB_IGET (Cp, Cnvec)) : GB_nnz_full (A) ; // allocate the result C (but do not allocate C->p or C->h) - // set C->iso = C_iso OK GrB_Info info = GB_new_bix (&C, // any sparsity, existing header - ctype, A->vlen, A->vdim, GB_Ap_null, C_is_csc, - C_sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso) ; + ctype, A->vlen, A->vdim, GB_ph_null, C_is_csc, + C_sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32) ; if (info != GrB_SUCCESS) { // out of memory; caller must free C_to_M, C_to_A, C_to_B GB_FREE_ALL ; - GB_FREE (Cp_handle, Cp_size) ; - GB_FREE (Ch_handle, Ch_size) ; + GB_FREE_MEMORY (Cp_handle, Cp_size) ; + GB_FREE_MEMORY (Ch_handle, Ch_size) ; return (info) ; } // add Cp as the vector pointers for C, from GB_add_phase1 if (C_is_sparse_or_hyper) { - C->nvec_nonempty = Cnvec_nonempty ; - C->p = (int64_t *) Cp ; C->p_size = Cp_size ; +// C->nvec_nonempty = Cnvec_nonempty ; + GB_nvec_nonempty_set (C, Cnvec_nonempty) ; + C->p = Cp ; C->p_size = Cp_size ; (*Cp_handle) = NULL ; C->nvals = cnz ; } @@ -281,7 +288,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B // add Ch as the hypersparse list for C, from GB_add_phase0 if (C_is_hyper) { - C->h = (int64_t *) Ch ; C->h_size = Ch_size ; + C->h = Ch ; C->h_size = Ch_size ; C->nvec = Cnvec ; (*Ch_handle) = NULL ; } @@ -307,15 +314,15 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B double chunk = GB_Context_chunk ( ) ; if (M != NULL && (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M))) { - GB_SLICE_MATRIX (M, 8) ; + GB_SLICE_MATRIX2 (M, 8) ; } if (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) { - GB_SLICE_MATRIX (A, 8) ; + GB_SLICE_MATRIX2 (A, 8) ; } if (GB_IS_SPARSE (B) || GB_IS_HYPERSPARSE (B)) { - GB_SLICE_MATRIX (B, 8) ; + GB_SLICE_MATRIX2 (B, 8) ; } } @@ -572,7 +579,9 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B //------------------------------------------------------------------ // The binary op is not used if fadd is null since in that case - // the intersection of A and B is empty + // the intersection of A and B is empty. The fadd function pointer + // can be NULL if the op is a generated FIRST_UDT or SECOND_UDT + // operator. // z = op (aij, bij) #undef GB_BINOP @@ -603,18 +612,13 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B info = GrB_SUCCESS ; } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //-------------------------------------------------------------------------- // remove empty vectors from C, if hypersparse //-------------------------------------------------------------------------- - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/add/GB_add_sparsity.c b/GraphBLAS/Source/add/GB_add_sparsity.c index a05ee29225..f756313d75 100644 --- a/GraphBLAS/Source/add/GB_add_sparsity.c +++ b/GraphBLAS/Source/add/GB_add_sparsity.c @@ -2,7 +2,7 @@ // GB_add_sparsity: determine the sparsity structure for C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/GrB_Matrix_eWiseAdd.c b/GraphBLAS/Source/add/GrB_Matrix_eWiseAdd.c index 54da87d3f4..00703a9911 100644 --- a/GraphBLAS/Source/add/GrB_Matrix_eWiseAdd.c +++ b/GraphBLAS/Source/add/GrB_Matrix_eWiseAdd.c @@ -2,7 +2,7 @@ // GrB_Matrix_eWiseAdd: matrix element-wise operations, set union //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,29 +12,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (B) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - A_tran, B_tran, xx, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; \ - /* C = accum (C,T) where T = A+B, A'+B, A+B', or A'+B' */ \ - info = GB_ewise ( \ - C, C_replace, /* C and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and its descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '+' */ \ - A, A_tran, /* A matrix and its descriptor */ \ - B, B_tran, /* B matrix and its descriptor */ \ - true, /* eWiseAdd */ \ - false, NULL, NULL, /* not eWiseUnion */ \ - Werk) ; - //------------------------------------------------------------------------------ // GrB_Matrix_eWiseAdd_BinaryOp: matrix addition //------------------------------------------------------------------------------ @@ -42,9 +19,9 @@ GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix Mask, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_BinaryOp op, // defines '+' for T=A+B const GrB_Matrix A, // first input: matrix A const GrB_Matrix B, // second input: matrix B const GrB_Descriptor desc // descriptor for C, M, A, and B @@ -55,16 +32,38 @@ GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_eWiseAdd_BinaryOp (C, M, accum, add, A, B, desc)"); + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (B) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, Mask, A, B, "GrB_Matrix_eWiseAdd (C, M, accum, op, A, B, " + "desc)") ; GB_BURBLE_START ("GrB_eWiseAdd") ; - GB_RETURN_IF_NULL_OR_FAULTY (add) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_tran, B_tran, xx, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // apply the eWise kernel (using set union) + // C = accum (C,T) where T = A+B, A'+B, A+B', or A'+B' //-------------------------------------------------------------------------- - GB_EWISE (add) ; + info = GB_ewise ( + C, C_replace, // C and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // accumulate operator + op, // operator that defines '+' + A, A_tran, // A matrix and its descriptor + B, B_tran, // B matrix and its descriptor + true, // eWiseAdd + false, NULL, NULL, // not eWiseUnion, no alpha/beta + Werk) ; GB_BURBLE_END ; + return (info) ; } @@ -77,7 +76,7 @@ GrB_Info GrB_Matrix_eWiseAdd_BinaryOp // C = accum (C, A+B) GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Monoid monoid, // defines '+' for T=A+B const GrB_Matrix A, // first input: matrix A @@ -85,23 +84,9 @@ GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_eWiseAdd_Monoid " - "(C, M, accum, monoid, A, B, desc)") ; - GB_BURBLE_START ("GrB_eWiseAdd") ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - - //-------------------------------------------------------------------------- - // eWiseAdd using the monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (monoid->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = monoid->op ; + return (GrB_Matrix_eWiseAdd_BinaryOp (C, M, accum, op, A, B, desc)) ; } //------------------------------------------------------------------------------ @@ -113,7 +98,7 @@ GrB_Info GrB_Matrix_eWiseAdd_Monoid // C = accum (C, A+B) GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Semiring semiring, // defines '+' for T=A+B const GrB_Matrix A, // first input: matrix A @@ -121,22 +106,8 @@ GrB_Info GrB_Matrix_eWiseAdd_Semiring // C = accum (C, A+B) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_eWiseAdd_Semiring (C, M, accum, semiring, A, B," - " desc)") ; - GB_BURBLE_START ("GrB_eWiseAdd") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - - //-------------------------------------------------------------------------- - // eWise add using the semiring monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (semiring->add->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = semiring->add->op ; + return (GrB_Matrix_eWiseAdd_BinaryOp (C, M, accum, op, A, B, desc)) ; } diff --git a/GraphBLAS/Source/add/GrB_Vector_eWiseAdd.c b/GraphBLAS/Source/add/GrB_Vector_eWiseAdd.c index ba1d3e0a3e..fad8350d47 100644 --- a/GraphBLAS/Source/add/GrB_Vector_eWiseAdd.c +++ b/GraphBLAS/Source/add/GrB_Vector_eWiseAdd.c @@ -2,7 +2,7 @@ // GrB_Vector_eWiseAdd: vector element-wise operations, set union //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,33 +12,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (u) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (v) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - ASSERT (GB_VECTOR_OK (w)) ; \ - ASSERT (GB_VECTOR_OK (u)) ; \ - ASSERT (GB_VECTOR_OK (v)) ; \ - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - xx1, xx2, xx3, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; \ - /* w = accum (w,t) where t = u+v, u'+v, u+v', or u'+v' */ \ - info = GB_ewise ( \ - (GrB_Matrix) w, C_replace, /* w and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and its descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '+' */ \ - (GrB_Matrix) u, false, /* u, never transposed */ \ - (GrB_Matrix) v, false, /* v, never transposed */ \ - true, /* eWiseAdd */ \ - false, NULL, NULL, /* not eWiseUnion */ \ - Werk) ; - //------------------------------------------------------------------------------ // GrB_Vector_eWiseAdd_BinaryOp: vector addition //------------------------------------------------------------------------------ @@ -46,9 +19,9 @@ GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector Mask, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_BinaryOp op, // defines '+' for t=u+v const GrB_Vector u, // first input: vector u const GrB_Vector v, // second input: vector v const GrB_Descriptor desc // descriptor for w and M @@ -59,16 +32,42 @@ GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_eWiseAdd_BinaryOp (w, M, accum, add, u, v, desc)"); - GB_BURBLE_START ("GrB_eWiseAdd") ; - GB_RETURN_IF_NULL_OR_FAULTY (add) ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, Mask, u, v, "GrB_Vector_eWiseAdd (w, M, accum, op, u, v, " + "desc)") ; + GB_BURBLE_START ("GrB_Vector_eWiseAdd") ; + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_VECTOR_OK (u)) ; + ASSERT (GB_VECTOR_OK (v)) ; + ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // apply the eWise kernel (using set union) + // w = accum (w,t) where t = u+v, u'+v, u+v', or u'+v' //-------------------------------------------------------------------------- - GB_EWISE (add) ; + info = GB_ewise ( + (GrB_Matrix) w, C_replace, // w and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // accumulate operator + op, // operator that defines '+' + (GrB_Matrix) u, false, // u, never transposed + (GrB_Matrix) v, false, // v, never transposed + true, // eWiseAdd + false, NULL, NULL, // not eWiseUnion + Werk) ; GB_BURBLE_END ; + return (info) ; } @@ -79,7 +78,7 @@ GrB_Info GrB_Vector_eWiseAdd_BinaryOp // w = accum (w, u+v) GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector M, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) const GrB_Monoid monoid, // defines '+' for t=u+v const GrB_Vector u, // first input: vector u @@ -87,23 +86,9 @@ GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) const GrB_Descriptor desc // descriptor for w and M ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (w, "GrB_Vector_eWiseAdd_Monoid " - "(w, M, accum, monoid, u, v, desc)") ; - GB_BURBLE_START ("GrB_eWiseAdd") ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - - //-------------------------------------------------------------------------- - // eWise add using the monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (monoid->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = monoid->op ; + return (GrB_Vector_eWiseAdd_BinaryOp (w, M, accum, op, u, v, desc)) ; } //------------------------------------------------------------------------------ @@ -113,7 +98,7 @@ GrB_Info GrB_Vector_eWiseAdd_Monoid // w = accum (w, u+v) GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector M, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) const GrB_Semiring semiring, // defines '+' for t=u+v const GrB_Vector u, // first input: vector u @@ -121,22 +106,8 @@ GrB_Info GrB_Vector_eWiseAdd_Semiring // w = accum (w, u+v) const GrB_Descriptor desc // descriptor for w and M ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (w, "GrB_Vector_eWiseAdd_Semiring " - "(w, M, accum, semiring, u, v, desc)") ; - GB_BURBLE_START ("GrB_eWiseAdd") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - - //-------------------------------------------------------------------------- - // eWise add using the semiring monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (semiring->add->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = semiring->add->op ; + return (GrB_Vector_eWiseAdd_BinaryOp (w, M, accum, op, u, v, desc)) ; } diff --git a/GraphBLAS/Source/add/GxB_Matrix_eWiseUnion.c b/GraphBLAS/Source/add/GxB_Matrix_eWiseUnion.c index 9f91bf6d04..8d59fdb3a1 100644 --- a/GraphBLAS/Source/add/GxB_Matrix_eWiseUnion.c +++ b/GraphBLAS/Source/add/GxB_Matrix_eWiseUnion.c @@ -2,7 +2,7 @@ // GxB_Matrix_eWiseUnion: matrix element-wise operations, set union //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,29 +28,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (B) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - A_tran, B_tran, xx, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; \ - /* C = accum (C,T) where T = A+B, A'+B, A+B', or A'+B' */ \ - info = GB_ewise ( \ - C, C_replace, /* C and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and its descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '+' */ \ - A, A_tran, /* A matrix and its descriptor */ \ - B, B_tran, /* B matrix and its descriptor */ \ - true, /* eWiseAdd */ \ - true, alpha, beta, /* eWiseUnion */ \ - Werk) ; - //------------------------------------------------------------------------------ // GxB_Matrix_eWiseUnion: matrix addition //------------------------------------------------------------------------------ @@ -60,7 +37,7 @@ GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) GrB_Matrix C, // input/output matrix for results const GrB_Matrix M_in, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp add, // defines '+' for T=A+B + const GrB_BinaryOp op, // defines '+' for T=A+B const GrB_Matrix A, // first input: matrix A const GrB_Scalar alpha, const GrB_Matrix B, // second input: matrix B @@ -73,16 +50,39 @@ GrB_Info GxB_Matrix_eWiseUnion // C = accum (C, A+B) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_eWiseUnion (C, M, accum, add, A, alpha," - " B, beta, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (B) ; + GB_RETURN_IF_NULL (alpha) ; + GB_RETURN_IF_NULL (beta) ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE6 (C, M_in, A, alpha, B, beta, + "GxB_Matrix_eWiseUnion (C, M, accum, op, A, alpha, B, beta, desc)") ; GB_BURBLE_START ("GxB_eWiseUnion") ; - GB_RETURN_IF_NULL_OR_FAULTY (add) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_tran, + B_tran, xx, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- // apply the eWise kernel (using set union) //-------------------------------------------------------------------------- - GB_EWISE (add) ; + // C = accum (C,T) where T = A+B, A'+B, A+B', or A'+B' + info = GB_ewise ( + C, C_replace, // C and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // accumulate operator + op, // operator that defines '+' + A, A_tran, // A matrix and its descriptor + B, B_tran, // B matrix and its descriptor + true, // eWiseAdd + true, alpha, beta, // eWiseUnion + Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/add/GxB_Vector_eWiseUnion.c b/GraphBLAS/Source/add/GxB_Vector_eWiseUnion.c index fb33508d17..b4e9e43002 100644 --- a/GraphBLAS/Source/add/GxB_Vector_eWiseUnion.c +++ b/GraphBLAS/Source/add/GxB_Vector_eWiseUnion.c @@ -2,7 +2,7 @@ // GxB_Vector_eWiseUnion: vector element-wise operations, set union //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,33 +19,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (u) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (v) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - ASSERT (GB_VECTOR_OK (w)) ; \ - ASSERT (GB_VECTOR_OK (u)) ; \ - ASSERT (GB_VECTOR_OK (v)) ; \ - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - xx1, xx2, xx3, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; \ - /* w = accum (w,t) where t = u+v, u'+v, u+v', or u'+v' */ \ - info = GB_ewise ( \ - (GrB_Matrix) w, C_replace, /* w and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and its descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '+' */ \ - (GrB_Matrix) u, false, /* u, never transposed */ \ - (GrB_Matrix) v, false, /* v, never transposed */ \ - true, /* eWiseAdd */ \ - true, alpha, beta, /* eWiseUnion */ \ - Werk) - //------------------------------------------------------------------------------ // GxB_Vector_eWiseUnion: vector addition //------------------------------------------------------------------------------ @@ -55,7 +28,7 @@ GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) GrB_Vector w, // input/output vector for results const GrB_Vector M_in, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp add, // defines '+' for t=u+v + const GrB_BinaryOp op, // defines '+' for t=u+v const GrB_Vector u, // first input: vector u const GrB_Scalar alpha, const GrB_Vector v, // second input: vector v @@ -68,16 +41,45 @@ GrB_Info GxB_Vector_eWiseUnion // w = accum (w, u+v) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GxB_Vector_eWiseUnion (w, M, accum, add, u, alpha," - " v, beta, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_NULL (alpha) ; + GB_RETURN_IF_NULL (beta) ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE6 (w, M_in, u, alpha, v, beta, + "GxB_Vector_eWiseUnion (w, M, accum, op, u, alpha, v, beta, desc)") ; GB_BURBLE_START ("GxB_eWiseUnion") ; - GB_RETURN_IF_NULL_OR_FAULTY (add) ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_VECTOR_OK (u)) ; + ASSERT (GB_VECTOR_OK (v)) ; + ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- // apply the eWise kernel (using set union) //-------------------------------------------------------------------------- - GB_EWISE (add) ; + // w = accum (w,t) where t = u+v, u'+v, u+v', or u'+v' + info = GB_ewise ( + (GrB_Matrix) w, C_replace, // w and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // accumulate operator + op, // operator that defines '+' + (GrB_Matrix) u, false, // u, never transposed + (GrB_Matrix) v, false, // v, never transposed + true, // eWiseAdd + true, alpha, beta, // eWiseUnion + Werk) ; + GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap.c index e9712e32ae..998125b68d 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_bitmap: C<#M>=A+B, C bitmap, M bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -68,12 +68,12 @@ // bitmap full full full - ASSERT (M_is_bitmap || M_is_full) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; ASSERT (A_is_bitmap || A_is_full || B_is_bitmap || B_is_full) ; #undef GB_GET_MIJ #define GB_GET_MIJ(p) \ - bool mij = GBB_M (Mb, p) && GB_MCAST (Mx, p, msize) ; \ + bool mij = GBb_M (Mb, p) && GB_MCAST (Mx, p, msize) ; \ if (Mask_comp) mij = !mij ; #ifdef GB_JIT_KERNEL diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_27.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_27.c index a4d521e9ee..6ec97fb9dd 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_27.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_27.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_bitmap_27: C<#M>=A+B, C bitmap; M, A, and B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,8 @@ if (mij) { // M(i,j) is true, so C(i,j) can be computed - int8_t a = GBB_A (Ab, p) ; - int8_t b = GBB_B (Bb, p) ; + int8_t a = GBb_A (Ab, p) ; + int8_t b = GBb_B (Bb, p) ; #ifdef GB_ISO_ADD int8_t c = a || b ; #else diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_28.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_28.c index 7bd78f8a1c..b7a443683f 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_28.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_28.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_bitmap_28: C<#M>=A+B, C bitmap; M,A bitmap/full, B sp./hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ GB_GET_MIJ (p) ; if (mij) { - int8_t a = GBB_A (Ab, p) ; + int8_t a = GBb_A (Ab, p) ; #ifndef GB_ISO_ADD if (a) { @@ -73,14 +73,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of B(:,k) for this task - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; GB_GET_PA (pB_start, pB_end, taskid, k, kfirst, klast, - pstart_Bslice, GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen)) ; + pstart_Bslice, GB_IGET (Bp, k), GB_IGET (Bp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over B(:,j), the kth vector of B for (int64_t pB = pB_start ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t p = pC_start + i ; GB_GET_MIJ (p) ; if (mij) diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_29.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_29.c index a96354dabc..b3aa858be5 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_29.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_bitmap_29.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_bitmap_29: C<#M>=A+B, C bitmap; M,B bitmap/full, A sp./hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ GB_GET_MIJ (p) ; if (mij) { - int8_t b = GBB_B (Bb, p) ; + int8_t b = GBb_B (Bb, p) ; #ifndef GB_ISO_ADD if (b) { @@ -73,14 +73,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of A(:,k) for this task - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, - pstart_Aslice, GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen)) ; + pstart_Aslice, GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t pC_start = j * vlen ; // traverse over A(:,j), the kth vector of A for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t p = pC_start + i ; GB_GET_MIJ (p) ; if (mij) diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse.c index 58d60737df..e02e49923b 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_sparse: C=A+B, C bitmap, M sparse/hyper and comp. //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -54,9 +54,9 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of M(:,k) for this task - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, taskid, k, kfirst, klast, - pstart_Mslice, GBP_M (Mp, k, vlen), GBP_M (Mp, k+1, vlen)) ; + pstart_Mslice, GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over M(:,j), the kth vector of M for (int64_t pM = pM_start ; pM < pM_end ; pM++) @@ -65,7 +65,7 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t p = pC_start + i ; Cb [p] = 2 ; } @@ -144,9 +144,9 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of M(:,k) for this task - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, taskid, k, kfirst, klast, - pstart_Mslice, GBP_M (Mp, k, vlen), GBP_M (Mp, k+1, vlen)) ; + pstart_Mslice, GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over M(:,j), the kth vector of M for (int64_t pM = pM_start ; pM < pM_end ; pM++) @@ -155,7 +155,7 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t p = pC_start + i ; Cb [p] = 0 ; } diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_24.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_24.c index c768593363..6754fafb48 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_24.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_24.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_sparse_24: C=A+B, C bitmap, M sparse/hyper; A,B bit/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,8 @@ if (c == 0) { // M(i,j) is zero, so C(i,j) can be computed - int8_t a = GBB_A (Ab, p) ; - int8_t b = GBB_B (Bb, p) ; + int8_t a = GBb_A (Ab, p) ; + int8_t b = GBb_B (Bb, p) ; #ifdef GB_ISO_ADD c = a || b ; #else diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_25.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_25.c index 7682cdcc30..5656e92989 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_25.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_25.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_sparse_25: C=A+B, C bitmap; M,B sparse/hyper, A bit/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ { if (Cb [p] == 0) { - int8_t a = GBB_A (Ab, p) ; + int8_t a = GBb_A (Ab, p) ; #ifndef GB_ISO_ADD if (a) { @@ -68,14 +68,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of B(:,k) for this task - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; GB_GET_PA (pB_start, pB_end, taskid, k, kfirst, klast, - pstart_Bslice, GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen)) ; + pstart_Bslice, GB_IGET (Bp, k), GB_IGET (Bp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over B(:,j), the kth vector of B for (int64_t pB = pB_start ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t p = pC_start + i ; int8_t c = Cb [p] ; if (c == 1) diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_26.c b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_26.c index 718b660ec4..02052d1e32 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_26.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_M_sparse_26.c @@ -2,7 +2,7 @@ // GB_add_bitmap_M_sparse_26: C=A+B, C bitmap; M,A sparse/hyper, B bit/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ { if (Cb [p] == 0) { - int8_t b = GBB_B (Bb, p) ; + int8_t b = GBb_B (Bb, p) ; #ifndef GB_ISO_ADD if (b) { @@ -68,14 +68,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of A(:,k) for this task - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, - pstart_Aslice, GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen)) ; + pstart_Aslice, GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t pC_start = j * vlen ; // traverse over A(:,j), the kth vector of A for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t p = pC_start + i ; int8_t c = Cb [p] ; if (c == 1) diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_noM.c b/GraphBLAS/Source/add/template/GB_add_bitmap_noM.c index 1f27120332..42a93ba27a 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_noM.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_noM.c @@ -2,7 +2,7 @@ // GB_add_bitmap_noM: C=A+B, C bitmap, A or B bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_21.c b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_21.c index a6bc4435d5..cffcc5e9e4 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_21.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_21.c @@ -2,7 +2,7 @@ // GB_add_bitmap_noM_21: C=A+B, C bitmap, A and B bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_22.c b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_22.c index db69f27371..80aae22428 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_22.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_22.c @@ -2,7 +2,7 @@ // GB_add_bitmap_noM_22: C=A+B, C bitmap, A bitmap, B sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -58,14 +58,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of B(:,k) for this task - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; GB_GET_PA (pB_start, pB_end, taskid, k, kfirst, klast, - pstart_Bslice, GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen)) ; + pstart_Bslice, GB_IGET (Bp, k), GB_IGET (Bp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over B(:,j), the kth vector of B for (int64_t pB = pB_start ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t p = pC_start + i ; if (Cb [p]) { diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_23.c b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_23.c index 63acc898a8..f7f959a78c 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_noM_23.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_noM_23.c @@ -2,7 +2,7 @@ // GB_add_bitmap_noM_23: C=A+B, C bitmap, A sparse/hyper, B bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -59,14 +59,14 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of A(:,k) for this task - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, - pstart_Aslice, GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen)) ; + pstart_Aslice, GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t pC_start = j * vlen ; // traverse over A(:,j), the kth vector of A for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t p = pC_start + i ; if (Cb [p]) { diff --git a/GraphBLAS/Source/add/template/GB_add_bitmap_template.c b/GraphBLAS/Source/add/template/GB_add_bitmap_template.c index 9aa944352c..c50bb07c4c 100644 --- a/GraphBLAS/Source/add/template/GB_add_bitmap_template.c +++ b/GraphBLAS/Source/add/template/GB_add_bitmap_template.c @@ -2,7 +2,7 @@ // GB_add_bitmap_template: C=A+B, C<#M>=A+B, C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_full_30.c b/GraphBLAS/Source/add/template/GB_add_full_30.c index 0d5e4ca268..2d529bc84e 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_30.c +++ b/GraphBLAS/Source/add/template/GB_add_full_30.c @@ -2,7 +2,7 @@ // GB_add_full_30: C=A+B; C, A and B are full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_full_31.c b/GraphBLAS/Source/add/template/GB_add_full_31.c index 4f7c24cbcf..7a96e741e7 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_31.c +++ b/GraphBLAS/Source/add/template/GB_add_full_31.c @@ -2,7 +2,7 @@ // GB_add_full_31: C=A+B; C and A are full, B is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_full_32.c b/GraphBLAS/Source/add/template/GB_add_full_32.c index df089e315e..094177a8ec 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_32.c +++ b/GraphBLAS/Source/add/template/GB_add_full_32.c @@ -2,7 +2,7 @@ // GB_add_full_32: C=A+B, C and A are full, B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,15 +42,15 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of B(:,k) for this task - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; GB_GET_PA (pB_start, pB_end, taskid, k, kfirst, klast, - pstart_Bslice, GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen)) ; + pstart_Bslice, GB_IGET (Bp, k), GB_IGET (Bp, k+1)) ; int64_t pC_start = j * vlen ; // traverse over B(:,j), the kth vector of B for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // C (i,j) = A (i,j) + B (i,j) - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t p = pC_start + i ; GB_LOAD_A (aij, Ax, p , A_iso) ; GB_LOAD_B (bij, Bx, pB, B_iso) ; diff --git a/GraphBLAS/Source/add/template/GB_add_full_33.c b/GraphBLAS/Source/add/template/GB_add_full_33.c index 2bfc33b9b9..fea7f54401 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_33.c +++ b/GraphBLAS/Source/add/template/GB_add_full_33.c @@ -2,7 +2,7 @@ // GB_add_full_33: C=A+B; C and B are full, A is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_full_34.c b/GraphBLAS/Source/add/template/GB_add_full_34.c index a7b20524fc..b6822704e2 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_34.c +++ b/GraphBLAS/Source/add/template/GB_add_full_34.c @@ -2,7 +2,7 @@ // GB_add_full_34: C=A+B; C and B are full, A is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,15 +42,15 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of A(:,k) for this task - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, - pstart_Aslice, GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen)) ; + pstart_Aslice, GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t pC_start = j * vlen ; // traverse over A(:,j), the kth vector of A for (int64_t pA = pA_start ; pA < pA_end ; pA++) { // C (i,j) = A (i,j) + B (i,j) - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t p = pC_start + i ; GB_LOAD_A (aij, Ax, pA, A_iso) ; GB_LOAD_B (bij, Bx, p , B_iso) ; diff --git a/GraphBLAS/Source/add/template/GB_add_full_template.c b/GraphBLAS/Source/add/template/GB_add_full_template.c index fb9601ff22..f1ba9f8894 100644 --- a/GraphBLAS/Source/add/template/GB_add_full_template.c +++ b/GraphBLAS/Source/add/template/GB_add_full_template.c @@ -2,7 +2,7 @@ // GB_add_full_template: C=A+B; C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/add/template/GB_add_sparse_M_bitmap.c b/GraphBLAS/Source/add/template/GB_add_sparse_M_bitmap.c index 17a59316c6..a8baa37506 100644 --- a/GraphBLAS/Source/add/template/GB_add_sparse_M_bitmap.c +++ b/GraphBLAS/Source/add/template/GB_add_sparse_M_bitmap.c @@ -2,7 +2,7 @@ // GB_add_sparse_M_bitmap: C(:,j)=A(:,j)+B(:,j), C sparse/hyper, M bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,16 +35,16 @@ // GB_GET_MIJ: get M(i,j) where M is bitmap or full #undef GB_GET_MIJ - #define GB_GET_MIJ(i) \ - int64_t pM = pM_start + i ; \ - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; \ + #define GB_GET_MIJ(i) \ + int64_t pM = pM_start + i ; \ + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; \ if (Mask_comp) mij = !mij ; // A and B are sparse or hypersparse, not bitmap or full, but individual // vectors of A and B might have all entries present (adense and/or // bdense). - ASSERT (A_is_sparse || A_is_hyper) ; - ASSERT (B_is_sparse || B_is_hyper) ; + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; + ASSERT (GB_IS_SPARSE (B) || GB_IS_HYPERSPARSE (B)) ; int64_t pM_start = j * vlen ; @@ -61,8 +61,8 @@ for (int64_t p = 0 ; p < ajnz ; p++) { int64_t i = p + iA_first ; - ASSERT (Ai [pA + p] == i) ; - ASSERT (Bi [pB + p] == i) ; + ASSERT (GB_IGET (Ai, pA + p) == i) ; + ASSERT (GB_IGET (Bi, pB + p) == i) ; GB_GET_MIJ (i) ; if (mij) { @@ -70,7 +70,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA + p, A_iso) ; GB_LOAD_B (bij, Bx, pB + p, B_iso) ; @@ -91,7 +91,7 @@ for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; GB_GET_MIJ (i) ; if (mij) { @@ -99,7 +99,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -129,14 +129,14 @@ for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; GB_GET_MIJ (i) ; if (mij) { #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -166,14 +166,14 @@ for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; GB_GET_MIJ (i) ; if (mij) { #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -195,14 +195,14 @@ for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; GB_GET_MIJ (i) ; if (mij) { #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -232,7 +232,7 @@ for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; GB_GET_MIJ (i) ; if (mij) { @@ -240,7 +240,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -262,14 +262,14 @@ for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; GB_GET_MIJ (i) ; if (mij) { #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -299,8 +299,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t iA = Ai [pA] ; - int64_t iB = Bi [pB] ; + int64_t iA = GB_IGET (Ai, pA) ; + int64_t iB = GB_IGET (Bi, pB) ; if (iA < iB) { GB_GET_MIJ (iA) ; @@ -309,7 +309,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = iA ; + GB_ISET (Ci, pC, iA) ; // Ci [pC] = iA ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -338,7 +338,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -367,7 +367,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA, A_iso) ; GB_LOAD_B (bij, Bx, pB, B_iso) ; @@ -387,14 +387,14 @@ for ( ; pA < pA_end ; pA++) { - int64_t iA = Ai [pA] ; + int64_t iA = GB_IGET (Ai, pA) ; GB_GET_MIJ (iA) ; if (mij) { #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = iA ; + GB_ISET (Ci, pC, iA) ; // Ci [pC] = iA ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -416,7 +416,7 @@ for ( ; pB < pB_end ; pB++) { - int64_t iB = Bi [pB] ; + int64_t iB = GB_IGET (Bi, pB) ; GB_GET_MIJ (iB) ; if (mij) { @@ -424,7 +424,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { diff --git a/GraphBLAS/Source/add/template/GB_add_sparse_M_sparse.c b/GraphBLAS/Source/add/template/GB_add_sparse_M_sparse.c index 4023e96425..8bd0297cf4 100644 --- a/GraphBLAS/Source/add/template/GB_add_sparse_M_sparse.c +++ b/GraphBLAS/Source/add/template/GB_add_sparse_M_sparse.c @@ -2,7 +2,7 @@ // GB_add_sparse_M_sparse: C(:,j)=A(:,j)+B(:,j), C and M sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,7 +34,10 @@ // Ch is the same as Mh (a deep copy) ASSERT (Ch != NULL) ; ASSERT (M_is_hyper) ; - ASSERT (Ch [k] == M->h [k]) ; + #ifdef GB_DEBUG + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + ASSERT (GB_IGET (Ch, k) == GB_IGET (Mh, k)) ; + #endif kM = k ; } else @@ -43,8 +46,8 @@ } if (kM >= 0) { - pM = GBP_M (Mp, kM , vlen) ; - pM_end = GBP_M (Mp, kM+1, vlen) ; + pM = GB_IGET (Mp, kM ) ; + pM_end = GB_IGET (Mp, kM+1) ; } } @@ -93,9 +96,10 @@ // copy the pattern into C (:,j) int64_t pC_start = pC ; int64_t pM_start = pM ; - memcpy (Ci + pC, Mi + pM, mjnz * sizeof (int64_t)) ; + #if defined ( GB_DEBUG ) || !defined ( GB_ISO_ADD ) int64_t pA_offset = pA_start - iA_first ; int64_t pB_offset = pB_start - iB_first ; + #endif if (adense && M_is_B) { @@ -109,10 +113,11 @@ { int64_t pM = p + pM_start ; int64_t pC = p + pC_start ; - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ASSERT (GB_MCAST (Mx, pM, msize)) ; - ASSERT (GBI_A (Ai, pA_offset + i, vlen) == i) ; - ASSERT (GBI_B (Bi, pM, vlen) == i) ; + ASSERT (GBi_A (Ai, pA_offset + i, vlen) == i) ; + ASSERT (GBi_B (Bi, pM, vlen) == i) ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA_offset + i, A_iso) ; GB_LOAD_B (bij, Bx, pM, B_iso) ; @@ -133,10 +138,11 @@ { int64_t pM = p + pM_start ; int64_t pC = p + pC_start ; - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ASSERT (GB_MCAST (Mx, pM, msize)) ; - ASSERT (GBI_A (Ai, pM, vlen) == i) ; - ASSERT (GBI_B (Bi, pB_offset + i, vlen) == i) ; + ASSERT (GBi_A (Ai, pM, vlen) == i) ; + ASSERT (GBi_B (Bi, pB_offset + i, vlen) == i) ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pM, A_iso) ; GB_LOAD_B (bij, Bx, pB_offset + i, B_iso) ; @@ -152,20 +158,22 @@ // Method13: M == A == B: all three matrices the same //------------------------------------------------------------------ - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < mjnz ; p++) { int64_t pM = p + pM_start ; int64_t pC = p + pC_start ; + int64_t i = GB_IGET (Mi, pM) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i + #ifndef GB_ISO_ADD #if GB_OP_IS_SECOND GB_LOAD_B (t, Bx, pM, B_iso) ; #else GB_LOAD_A (t, Ax, pM, A_iso) ; #endif - GB_EWISEOP (Cx, pC, t, t, Mi [pM], j) ; + GB_EWISEOP (Cx, pC, t, t, i, j) ; + #endif } - #endif } #endif @@ -220,7 +228,7 @@ // get M(i,j) for A(i,j) + B (i,j) //------------------------------------------------------------------ - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; bool mij = GB_MCAST (Mx, pM, msize) ; if (!mij) continue ; @@ -233,17 +241,17 @@ { // A is dense, bitmap, or full; use quick lookup pA = pA_start + (i - iA_first) ; - afound = GBB_A (Ab, pA) ; + afound = GBb_A (Ab, pA) ; } else { // A is sparse; use binary search. This is slow unless // M is very sparse compared with A. int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (i, Ai, pA, apright, afound) ; + afound = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &apright) ; } - ASSERT (GB_IMPLIES (afound, GBI_A (Ai, pA, vlen) == i)) ; + ASSERT (GB_IMPLIES (afound, GBi_A (Ai, pA, vlen) == i)) ; //------------------------------------------------------------------ // get B(i,j) @@ -254,17 +262,17 @@ { // B is dense; use quick lookup pB = pB_start + (i - iB_first) ; - bfound = GBB_B (Bb, pB) ; + bfound = GBb_B (Bb, pB) ; } else { // B is sparse; use binary search. This is slow unless // M is very sparse compared with B. int64_t bpright = pB_end - 1 ; - GB_BINARY_SEARCH (i, Bi, pB, bpright, bfound) ; + bfound = GB_binary_search (i, Bi, GB_Bi_IS_32, &pB, &bpright) ; } - ASSERT (GB_IMPLIES (bfound, GBI_B (Bi, pB, vlen) == i)) ; + ASSERT (GB_IMPLIES (bfound, GBi_B (Bi, pB, vlen) == i)) ; //------------------------------------------------------------------ // C(i,j) = A(i,j) + B(i,j) @@ -276,7 +284,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA, A_iso) ; GB_LOAD_B (bij, Bx, pB, B_iso) ; @@ -290,7 +298,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -313,7 +321,7 @@ #if ( GB_ADD_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { diff --git a/GraphBLAS/Source/add/template/GB_add_sparse_noM.c b/GraphBLAS/Source/add/template/GB_add_sparse_noM.c index 52de20f79c..c49d2d5bdb 100644 --- a/GraphBLAS/Source/add/template/GB_add_sparse_noM.c +++ b/GraphBLAS/Source/add/template/GB_add_sparse_noM.c @@ -2,7 +2,7 @@ // GB_add_sparse_noM: C(:,j)=A(:,j)+B(:,j), C sparse/hyper, no mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,9 +30,8 @@ // A and B are both sparse or hypersparse, not bitmap or full, but // individual vectors of A and B might have all entries present (adense // and/or bdense). - - ASSERT (A_is_sparse || A_is_hyper) ; - ASSERT (B_is_sparse || B_is_hyper) ; + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; + ASSERT (GB_IS_SPARSE (B) || GB_IS_HYPERSPARSE (B)) ; #if ( GB_ADD_PHASE == 1 ) @@ -69,9 +68,9 @@ { // C (i,j) = A (i,j) + B (i,j) int64_t i = p + iA_first ; - Ci [pC + p] = i ; - ASSERT (Ai [pA + p] == i) ; - ASSERT (Bi [pB + p] == i) ; + GB_ISET (Ci, pC + p, i) ; // Ci [pC + p] = i ; + ASSERT (GB_IGET (Ai, pA + p) == i) ; + ASSERT (GB_IGET (Bi, pB + p) == i) ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA + p, A_iso) ; GB_LOAD_B (bij, Bx, pB + p, B_iso) ; @@ -96,8 +95,8 @@ for (int64_t p = 0 ; p < ajnz ; p++) { int64_t i = p + iA_first ; - Ci [pC + p] = i ; - ASSERT (Ai [pA + p] == i) ; + GB_ISET (Ci, pC + p, i) ; // Ci [pC + p] = i ; + ASSERT (GB_IGET (Ai, pA + p) == i) ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -113,20 +112,20 @@ #endif #endif } + #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < bjnz ; p++) { // C (i,j) = A (i,j) + B (i,j) - int64_t i = Bi [pB + p] ; + int64_t i = GB_IGET (Bi, pB + p) ; int64_t ii = i - iA_first ; - ASSERT (Ai [pA + ii] == i) ; - #ifndef GB_ISO_ADD + ASSERT (GB_IGET (Ai, pA + ii) == i) ; GB_LOAD_A (aij, Ax, pA + ii, A_iso) ; GB_LOAD_B (bij, Bx, pB + p, B_iso) ; GB_EWISEOP (Cx, pC + ii, aij, bij, i, j) ; - #endif } #endif + #endif } else if (bdense) @@ -144,8 +143,8 @@ for (int64_t p = 0 ; p < bjnz ; p++) { int64_t i = p + iB_first ; - Ci [pC + p] = i ; - ASSERT (Bi [pB + p] == i) ; + GB_ISET (Ci, pC + p, i) ; // Ci [pC + p] = i ; + ASSERT (GB_IGET (Bi, pB + p) == i) ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -167,20 +166,20 @@ #endif #endif } + #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < ajnz ; p++) { // C (i,j) = A (i,j) + B (i,j) - int64_t i = Ai [pA + p] ; + int64_t i = GB_IGET (Ai, pA + p) ; int64_t ii = i - iB_first ; - ASSERT (Bi [pB + ii] == i) ; - #ifndef GB_ISO_ADD + ASSERT (GB_IGET (Bi, pB + ii) == i) ; GB_LOAD_A (aij, Ax, pA + p, A_iso) ; GB_LOAD_B (bij, Bx, pB + ii, B_iso) ; GB_EWISEOP (Cx, pC + ii, aij, bij, i, j) ; - #endif } #endif + #endif } else if (ajnz == 0) @@ -194,16 +193,17 @@ cjnz = bjnz ; #else ASSERT (cjnz == bjnz) ; - memcpy (Ci + pC, Bi + pB, bjnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < bjnz ; p++) { + int64_t i = GB_IGET (Bi, pB+p) ; // i = Bi [pB+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = alpha + B(i,j) GB_LOAD_B (bij, Bx, pB+p, B_iso) ; - GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, Bi [pB+p], j) ; + GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, i, j) ; } #else { @@ -211,9 +211,9 @@ GB_COPY_B_to_C (Cx, pC+p, Bx, pB+p, B_iso) ; } #endif + #endif } #endif - #endif } else if (bjnz == 0) @@ -227,16 +227,17 @@ cjnz = ajnz ; #else ASSERT (cjnz == ajnz) ; - memcpy (Ci + pC, Ai + pA, ajnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < ajnz ; p++) { + int64_t i = GB_IGET (Ai, pA+p) ; // i = Ai [pA+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = A(i,j) + beta GB_LOAD_A (aij, Ax, pA+p, A_iso) ; - GB_EWISEOP (Cx, pC+p, aij, beta_scalar, Ai [pA+p], j) ; + GB_EWISEOP (Cx, pC+p, aij, beta_scalar, i, j) ; } #else { @@ -244,9 +245,9 @@ GB_COPY_A_to_C (Cx, pC+p, Ax, pA+p, A_iso) ; } #endif + #endif } #endif - #endif } else if (iA_last < iB_first) @@ -260,16 +261,17 @@ cjnz = ajnz + bjnz ; #else ASSERT (cjnz == ajnz + bjnz) ; - memcpy (Ci + pC, Ai + pA, ajnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < ajnz ; p++) { + int64_t i = GB_IGET (Ai, pA+p) ; // i = Ai [pA+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = A(i,j) + beta GB_LOAD_A (aij, Ax, pA+p, A_iso) ; - GB_EWISEOP (Cx, pC+p, aij, beta_scalar, Ai [pA+p], j) ; + GB_EWISEOP (Cx, pC+p, aij, beta_scalar, i, j) ; } #else { @@ -277,19 +279,20 @@ GB_COPY_A_to_C (Cx, pC+p, Ax, pA+p, A_iso) ; } #endif + #endif } - #endif pC += ajnz ; - memcpy (Ci + pC, Bi + pB, bjnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < bjnz ; p++) { + int64_t i = GB_IGET (Bi, pB+p) ; // i = Bi [pB+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = alpha + B(i,j) GB_LOAD_B (bij, Bx, pB+p, B_iso) ; - GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, Bi [pB+p], j) ; + GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, i, j) ; } #else { @@ -297,9 +300,9 @@ GB_COPY_B_to_C (Cx, pC+p, Bx, pB+p, B_iso) ; } #endif + #endif } #endif - #endif } else if (iB_last < iA_first) @@ -313,16 +316,17 @@ cjnz = ajnz + bjnz ; #else ASSERT (cjnz == ajnz + bjnz) ; - memcpy (Ci + pC, Bi + pB, bjnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < bjnz ; p++) { + int64_t i = GB_IGET (Bi, pB+p) ; // i = Bi [pB+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = alpha + B(i,j) GB_LOAD_B (bij, Bx, pB+p, B_iso) ; - GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, Bi [pB+p], j) ; + GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, i, j) ; } #else { @@ -330,19 +334,20 @@ GB_COPY_B_to_C (Cx, pC+p, Bx, pB+p, B_iso) ; } #endif + #endif } - #endif pC += bjnz ; - memcpy (Ci + pC, Ai + pA, ajnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = 0 ; p < ajnz ; p++) { + int64_t i = GB_IGET (Ai, pA+p) ; // i = Ai [pA+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = A(i,j) + beta GB_LOAD_A (aij, Ax, pA+p, A_iso) ; - GB_EWISEOP (Cx, pC+p, aij, beta_scalar, Ai [pA+p], j) ; + GB_EWISEOP (Cx, pC+p, aij, beta_scalar, i, j) ; } #else { @@ -350,9 +355,9 @@ GB_COPY_A_to_C (Cx, pC+p, Ax, pA+p, A_iso) ; } #endif + #endif } #endif - #endif } @@ -369,11 +374,11 @@ cjnz = ajnz + bjnz ; for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; // find i in A(:,j) int64_t pright = pA_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Ai, pA, pright, found) ; + found = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &pright) ; if (found) cjnz-- ; } @@ -390,11 +395,11 @@ cjnz = ajnz + bjnz ; for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; // find i in B(:,j) int64_t pright = pB_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Bi, pB, pright, found) ; + found = GB_binary_search (i, Bi, GB_Bi_IS_32, &pB, &pright) ; if (found) cjnz-- ; } @@ -410,12 +415,12 @@ while (pA < pA_end && pB < pB_end) { - int64_t iA = Ai [pA] ; - int64_t iB = Bi [pB] ; + int64_t iA = GB_IGET (Ai, pA) ; + int64_t iB = GB_IGET (Bi, pB) ; if (iA < iB) { #if ( GB_ADD_PHASE == 2 ) - Ci [pC] = iA ; + GB_ISET (Ci, pC, iA) ; // Ci [pC] = iA ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -436,7 +441,7 @@ else if (iA > iB) { #if ( GB_ADD_PHASE == 2 ) - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { @@ -458,7 +463,7 @@ { // C (i,j) = A (i,j) + B (i,j) #if ( GB_ADD_PHASE == 2 ) - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_ADD GB_LOAD_A (aij, Ax, pA, A_iso) ; GB_LOAD_B (bij, Bx, pB, B_iso) ; @@ -485,15 +490,16 @@ #if ( GB_ADD_PHASE == 1 ) cjnz += ajnz + bjnz ; #else - memcpy (Ci + pC, Ai + pA, ajnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD for (int64_t p = 0 ; p < ajnz ; p++) { + int64_t i = GB_IGET (Ai, pA+p) ; // i = Ai [pA+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = A(i,j) + beta GB_LOAD_A (aij, Ax, pA+p, A_iso) ; - GB_EWISEOP (Cx, pC+p, aij, beta_scalar, Ai [pA+p], j) ; + GB_EWISEOP (Cx, pC+p, aij, beta_scalar, i, j) ; } #else { @@ -501,17 +507,18 @@ GB_COPY_A_to_C (Cx, pC+p, Ax, pA+p, A_iso) ; } #endif + #endif } - #endif - memcpy (Ci + pC, Bi + pB, bjnz * sizeof (int64_t)) ; - #ifndef GB_ISO_ADD for (int64_t p = 0 ; p < bjnz ; p++) { + int64_t i = GB_IGET (Bi, pB+p) ; // i = Bi [pB+p] + GB_ISET (Ci, pC+p, i) ; // Ci [pC+p] = i + #ifndef GB_ISO_ADD #if GB_IS_EWISEUNION { // C (i,j) = alpha + B(i,j) GB_LOAD_B (bij, Bx, pB+p, B_iso) ; - GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, Bi [pB+p], j) ; + GB_EWISEOP (Cx, pC+p, alpha_scalar, bij, i, j) ; } #else { @@ -519,8 +526,8 @@ GB_COPY_B_to_C (Cx, pC+p, Bx, pB+p, B_iso) ; } #endif + #endif } - #endif ASSERT (pC + ajnz + bjnz == pC_end) ; #endif } diff --git a/GraphBLAS/Source/add/template/GB_add_sparse_template.c b/GraphBLAS/Source/add/template/GB_add_sparse_template.c index 58d3e94183..bf5eefeb9a 100644 --- a/GraphBLAS/Source/add/template/GB_add_sparse_template.c +++ b/GraphBLAS/Source/add/template/GB_add_sparse_template.c @@ -2,7 +2,7 @@ // GB_add_sparse_template: C=A+B, C=A+B when C is sparse/hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -92,7 +92,7 @@ // get j, the kth vector of C //------------------------------------------------------------------ - int64_t j = GBH_C (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; #if ( GB_ADD_PHASE == 1 ) int64_t cjnz = 0 ; @@ -103,13 +103,15 @@ // A fine task computes a slice of C(:,j) pC = TaskList [taskid ].pC ; pC_end = TaskList [taskid+1].pC ; - ASSERT (Cp [k] <= pC && pC <= pC_end && pC_end <= Cp [k+1]) ; + ASSERT (GB_IGET (Cp, k) <= pC) ; + ASSERT (pC <= pC_end) ; + ASSERT (pC_end <= GB_IGET (Cp, k+1)) ; } else { // The vectors of C are never sliced for a coarse task. - pC = Cp [k ] ; - pC_end = Cp [k+1] ; + pC = GB_IGET (Cp, k ) ; + pC_end = GB_IGET (Cp, k+1) ; } int64_t cjnz = pC_end - pC ; if (cjnz == 0) continue ; @@ -133,8 +135,8 @@ int64_t kA = (C_to_A == NULL) ? j : C_to_A [k] ; if (kA >= 0) { - pA = GBP_A (Ap, kA, vlen) ; - pA_end = GBP_A (Ap, kA+1, vlen) ; + pA = GBp_A (Ap, kA, vlen) ; + pA_end = GBp_A (Ap, kA+1, vlen) ; } } @@ -146,8 +148,8 @@ int64_t iA_first = -1, iA_last = -1 ; if (ajnz > 0) { - iA_first = GBI_A (Ai, pA, vlen) ; - iA_last = GBI_A (Ai, pA_end-1, vlen) ; + iA_first = GBi_A (Ai, pA, vlen) ; + iA_last = GBi_A (Ai, pA_end-1, vlen) ; } //------------------------------------------------------------------ @@ -168,8 +170,8 @@ int64_t kB = (C_to_B == NULL) ? j : C_to_B [k] ; if (kB >= 0) { - pB = GBP_B (Bp, kB, vlen) ; - pB_end = GBP_B (Bp, kB+1, vlen) ; + pB = GBp_B (Bp, kB, vlen) ; + pB_end = GBp_B (Bp, kB+1, vlen) ; } } @@ -181,8 +183,8 @@ int64_t iB_first = -1, iB_last = -1 ; if (bjnz > 0) { - iB_first = GBI_B (Bi, pB, vlen) ; - iB_last = GBI_B (Bi, pB_end-1, vlen) ; + iB_first = GBi_B (Bi, pB, vlen) ; + iB_last = GBi_B (Bi, pB_end-1, vlen) ; } //------------------------------------------------------------------ @@ -233,7 +235,7 @@ } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } #endif } diff --git a/GraphBLAS/Source/add/template/GB_add_template.c b/GraphBLAS/Source/add/template/GB_add_template.c index a82a10e93f..5530d87a7e 100644 --- a/GraphBLAS/Source/add/template/GB_add_template.c +++ b/GraphBLAS/Source/add/template/GB_add_template.c @@ -2,7 +2,7 @@ // GB_add_template: phase1 and phase2 for C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,75 +32,53 @@ int taskid ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; const int64_t vlen = A->vlen ; #ifdef GB_JIT_KERNEL - #define A_is_hyper GB_A_IS_HYPER - #define A_is_sparse GB_A_IS_SPARSE #define A_is_bitmap GB_A_IS_BITMAP - #define A_is_full GB_A_IS_FULL - #define A_iso GB_A_ISO #else - const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_is_bitmap = GB_IS_BITMAP (A) ; - const bool A_is_full = GB_IS_FULL (A) ; // unlike GB_emult, both A and B may be iso - const bool A_iso = A->iso ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ai_IS_32 Ai_is_32 #endif - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; #ifdef GB_JIT_KERNEL - #define B_is_hyper GB_B_IS_HYPER - #define B_is_sparse GB_B_IS_SPARSE #define B_is_bitmap GB_B_IS_BITMAP - #define B_is_full GB_B_IS_FULL - #define B_iso GB_B_ISO #else - const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; - const bool B_is_sparse = GB_IS_SPARSE (B) ; const bool B_is_bitmap = GB_IS_BITMAP (B) ; - const bool B_is_full = GB_IS_FULL (B) ; - const bool B_iso = B->iso ; + const bool Bi_is_32 = B->i_is_32 ; + #define GB_Bi_IS_32 Bi_is_32 #endif - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; - const int8_t *restrict Mb = NULL ; - const int64_t *restrict Mi = NULL ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = NULL ; const GB_M_TYPE *restrict Mx = NULL ; size_t msize = 0 ; #ifdef GB_JIT_KERNEL #define M_is_hyper GB_M_IS_HYPER #define M_is_sparse GB_M_IS_SPARSE - #define M_is_bitmap GB_M_IS_BITMAP - #define M_is_full GB_M_IS_FULL #define M_is_sparse_or_hyper (GB_M_IS_SPARSE || GB_M_IS_HYPER) #define Mask_comp GB_MASK_COMP #define Mask_struct GB_MASK_STRUCT #else const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_sparse = GB_IS_SPARSE (M) ; - const bool M_is_bitmap = GB_IS_BITMAP (M) ; - const bool M_is_full = GB_IS_FULL (M) ; const bool M_is_sparse_or_hyper = M_is_sparse || M_is_hyper ; #endif if (M != NULL) { - Mp = M->p ; - Mh = M->h ; Mb = M->b ; - Mi = M->i ; Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; msize = M->type->size ; } @@ -122,6 +100,11 @@ #ifdef GB_JIT_KERNEL ASSERT (!C->iso) ; + #define A_is_full GB_A_IS_FULL + #define B_is_full GB_B_IS_FULL + #else + const bool A_is_full = GB_IS_FULL (A) ; + const bool B_is_full = GB_IS_FULL (B) ; #endif #ifdef GB_ISO_ADD @@ -131,16 +114,28 @@ const GB_B_TYPE *restrict Bx = (GB_B_TYPE *) B->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; ASSERT (!C->iso) ; + #ifdef GB_JIT_KERNEL + #define A_iso GB_A_ISO + #define B_iso GB_B_ISO + #else + const bool A_iso = A->iso ; + const bool B_iso = B->iso ; + #endif #endif - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ch = C->h ; - int8_t *restrict Cb = C->b ; - int64_t *restrict Ci = C->i ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + int8_t *restrict Cb = C->b ; GB_C_NHELD (cnz) ; // const int64_t cnz = GB_nnz_held (C) ; #endif + //-------------------------------------------------------------------------- // C=A+B, C=A+B, or C=A+B: 3 cases for the sparsity of C //-------------------------------------------------------------------------- @@ -213,4 +208,3 @@ #undef GB_LOAD_B #undef GB_IS_EWISEUNION - diff --git a/GraphBLAS/Source/aliased/GB_aliased.h b/GraphBLAS/Source/aliased/GB_aliased.h index 58ff79dbc7..3fa350f82e 100644 --- a/GraphBLAS/Source/aliased/GB_aliased.h +++ b/GraphBLAS/Source/aliased/GB_aliased.h @@ -2,7 +2,7 @@ // GB_aliased.h: definitions for aliased and shallow matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/aliased/GB_all_aliased.c b/GraphBLAS/Source/aliased/GB_all_aliased.c index a1a16b3b8d..9b5a5d7e69 100644 --- a/GraphBLAS/Source/aliased/GB_all_aliased.c +++ b/GraphBLAS/Source/aliased/GB_all_aliased.c @@ -2,7 +2,7 @@ // GB_all_aliased: determine if two matrices are entirely aliased //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/aliased/GB_any_aliased.c b/GraphBLAS/Source/aliased/GB_any_aliased.c index 82991fa12b..d1648a0291 100644 --- a/GraphBLAS/Source/aliased/GB_any_aliased.c +++ b/GraphBLAS/Source/aliased/GB_any_aliased.c @@ -2,7 +2,7 @@ // GB_any_aliased: determine if two matrices are aliased in any way //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/aliased/GB_is_shallow.c b/GraphBLAS/Source/aliased/GB_is_shallow.c index de093a884c..07e14d7fac 100644 --- a/GraphBLAS/Source/aliased/GB_is_shallow.c +++ b/GraphBLAS/Source/aliased/GB_is_shallow.c @@ -2,7 +2,7 @@ // GB_is_shallow: determine if a GrB_matrix has any shallow components //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/apply/GB_apply.c b/GraphBLAS/Source/apply/GB_apply.c index 8da6bd9958..12195f388a 100644 --- a/GraphBLAS/Source/apply/GB_apply.c +++ b/GraphBLAS/Source/apply/GB_apply.c @@ -2,7 +2,7 @@ // GB_apply: apply a unary operator; optionally transpose a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GB_Operator op_in, // unary/idxunop/binop to apply - const GrB_Scalar scalar_in, // scalar to bind to binop, or thunk + const GrB_Scalar scalar_in, // scalar to bind to binop bool binop_bind1st, // if true, binop(x,A) else binop(A,y) const GrB_Matrix A, // first or 2nd input: matrix A bool A_transpose, // A matrix descriptor @@ -62,7 +62,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') bool op_is_binop = GB_IS_BINARYOP_CODE (opcode) ; bool op_is_idxunop = GB_IS_INDEXUNARYOP_CODE (opcode) ; bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; - struct GB_Scalar_opaque Thunk_header ; + struct GB_Scalar_opaque scalar_header ; int64_t ithunk = 0 ; if (GB_IS_INDEXBINARYOP_CODE (opcode)) @@ -150,14 +150,14 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') } else // op_is_idxunop { - // apply an idxunop operator, with a thunk scalar + // apply an idxunop operator, with a y scalar ASSERT_OP_OK (op, "idxunop for GB_apply", GB0) ; - ASSERT_SCALAR_OK (scalar, "thunk for GB_apply", GB0) ; + ASSERT_SCALAR_OK (scalar, "y for GB_apply", GB0) ; // A must be compatible with op->xtype if (!GB_Type_compatible (A->type, op->xtype)) { GB_ERROR (GrB_DOMAIN_MISMATCH, - "Incompatible type for z=%s(x,i,j,thunk):\n" + "Incompatible type for z=%s(x,i,j,y):\n" "input A of type [%s]\n" "cannot be typecast to x input of type [%s]", op->name, A->type->name, op->xtype->name) ; @@ -166,9 +166,9 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') if (!GB_Type_compatible (scalar->type, op->ytype)) { GB_ERROR (GrB_DOMAIN_MISMATCH, - "Incompatible type for z=%s(x,i,j,thunk):\n" + "Incompatible type for z=%s(x,i,j,y):\n" "input scalar of type [%s]\n" - "cannot be typecast to thunk input of type [%s]", + "cannot be typecast to y input of type [%s]", op->name, scalar->type->name, op->ytype->name) ; } } @@ -230,7 +230,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') GB_cast_scalar (&ithunk, GB_INT64_code, scalar->x, scalar->type->code, scalar->type->size) ; // wrap ithunk in the new scalar - scalar = GB_Scalar_wrap (&Thunk_header, GrB_INT64, &ithunk) ; + scalar = GB_Scalar_wrap (&scalar_header, GrB_INT64, &ithunk) ; } //-------------------------------------------------------------------------- @@ -272,7 +272,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') { // T = op (A'), typecasting to op->ztype GBURBLE ("(transpose-op) ") ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; info = GB_transpose (T, T_type, T_is_csc, A, op, scalar, binop_bind1st, flipij, Werk) ; ASSERT (GB_JUMBLED_OK (T)) ; @@ -316,7 +316,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') { // T = op (A), pattern is a shallow copy of A, type is op->ztype. GBURBLE ("(shallow-op) ") ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; info = GB_shallow_op (T, T_is_csc, op, scalar, binop_bind1st, flipij, A, Werk) ; } @@ -333,6 +333,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') // C = accum (C,T): accumulate the results into C via the M //-------------------------------------------------------------------------- + ASSERT_MATRIX_OK (T, "T for accum/mask; T=apply(A) output", GB0) ; return (GB_accum_mask (C, M, NULL, accum, &T, C_replace, Mask_comp, Mask_struct, Werk)) ; } diff --git a/GraphBLAS/Source/apply/GB_apply.h b/GraphBLAS/Source/apply/GB_apply.h index 1727e9f589..b321eb90d8 100644 --- a/GraphBLAS/Source/apply/GB_apply.h +++ b/GraphBLAS/Source/apply/GB_apply.h @@ -2,7 +2,7 @@ // GB_apply.h: definitions for GB_apply //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,3 +56,4 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator ) ; #endif + diff --git a/GraphBLAS/Source/apply/GB_apply_op.c b/GraphBLAS/Source/apply/GB_apply_op.c index 48bf4ba527..914a0c7464 100644 --- a/GraphBLAS/Source/apply/GB_apply_op.c +++ b/GraphBLAS/Source/apply/GB_apply_op.c @@ -2,7 +2,7 @@ // GB_apply_op: typecast and apply a unary/binary/idxunop operator to an array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,8 +17,6 @@ #include "apply/GB_apply.h" #include "binaryop/GB_binop.h" -#include "slice/GB_ek_slice.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -54,6 +52,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) ASSERT (Cx != NULL) ; ASSERT_MATRIX_OK (A, "A input for GB_apply_op", GB0) ; ASSERT (GB_JUMBLED_OK (A)) ; // A can be jumbled + ASSERT (!GB_ZOMBIES (A)) ; GB_WERK_DECLARE (A_ek_slicing, int64_t) ; ASSERT (GB_IMPLIES (op != NULL, ctype == op->ztype)) ; ASSERT_SCALAR_OK_OR_NULL (scalar, "scalar for GB_apply_op", GB0) ; @@ -69,6 +68,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) const int8_t *Ab = A->b ; // only if A is bitmap const GrB_Type Atype = A->type ; // type of A->x const int64_t anz = GB_nnz_held (A) ; // size of A->x and Cx + #define GB_A_IS_BITMAP (Ab != NULL) //-------------------------------------------------------------------------- // determine the maximum number of threads to use @@ -84,17 +84,18 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) GB_Opcode opcode ; bool op_is_unop = false ; bool op_is_binop = false ; - bool is64 = false ; - bool is32 = false ; + bool opz64 = false ; + bool opz32 = false ; if (op != NULL) { + ASSERT_OP_OK (op, "op for GB_apply_op", GB0) ; opcode = op->opcode ; op_is_unop = GB_IS_UNARYOP_CODE (opcode) ; op_is_binop = GB_IS_BINARYOP_CODE (opcode) ; ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; - is64 = (op->ztype == GrB_INT64) ; - is32 = (op->ztype == GrB_INT32) ; + opz64 = (op->ztype == GrB_INT64) ; + opz32 = (op->ztype == GrB_INT32) ; if (GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) { @@ -102,38 +103,39 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) GrB_UnaryOp op1 = NULL ; switch (opcode) { - case GB_FIRSTI_binop_code : // z = first_i(A(i,j),y) == i - case GB_SECONDI_binop_code : // z = second_i(x,A(i,j)) == i + case GB_FIRSTI_binop_code : // z = first_i(A(i,j),y) == i + case GB_SECONDI_binop_code : // z = second_i(x,A(i,j)) == i // rename FIRSTI and SECONDI to POSITIONI - op1 = is64 ? GxB_POSITIONI_INT64 : GxB_POSITIONI_INT32 ; + op1 = opz64 ? GxB_POSITIONI_INT64 : GxB_POSITIONI_INT32 ; break ; - case GB_FIRSTI1_binop_code : // z = first_i1(A(i,j),y) == i+1 - case GB_SECONDI1_binop_code : // z = second_i1(x,A(i,j)) == i+1 + case GB_FIRSTI1_binop_code : // z = first_i1(A(i,j),y) == i+1 + case GB_SECONDI1_binop_code : // z = second_i1(x,A(i,j)) == i+1 // rename FIRSTI1 and SECONDI1 to POSITIONI1 - op1 = is64 ? GxB_POSITIONI1_INT64 : GxB_POSITIONI1_INT32 ; + op1 = opz64 ? GxB_POSITIONI1_INT64 : GxB_POSITIONI1_INT32 ; break ; - case GB_FIRSTJ_binop_code : // z = first_j(A(i,j),y) == j - case GB_SECONDJ_binop_code : // z = second_j(x,A(i,j)) == j + case GB_FIRSTJ_binop_code : // z = first_j(A(i,j),y) == j + case GB_SECONDJ_binop_code : // z = second_j(x,A(i,j)) == j // rename FIRSTJ and SECONDJ to POSITIONJ - op1 = is64 ? GxB_POSITIONJ_INT64 : GxB_POSITIONJ_INT32 ; + op1 = opz64 ? GxB_POSITIONJ_INT64 : GxB_POSITIONJ_INT32 ; break ; - case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,j),y) == j+1 - case GB_SECONDJ1_binop_code : // z = second_j1(x,A(i,j)) == j+1 + case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,j),y) == j+1 + case GB_SECONDJ1_binop_code : // z = second_j1(x,A(i,j)) == j+1 // rename FIRSTJ1 and SECONDJ1 to POSITIONJ1 - op1 = is64 ? GxB_POSITIONJ1_INT64 : GxB_POSITIONJ1_INT32 ; + op1 = opz64 ? GxB_POSITIONJ1_INT64 : GxB_POSITIONJ1_INT32 ; break ; default:; } ASSERT (op1 != NULL) ; op = (GB_Operator) op1 ; + ASSERT_OP_OK (op, "revised op for GB_apply_op", GB0) ; opcode = op->opcode ; op_is_unop = true ; op_is_binop = false ; - ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; + ASSERT (GB_IS_BUILTIN_UNOP_CODE_POSITIONAL (opcode)) ; } } @@ -150,7 +152,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) // determine number of threads to use and slice the A matrix if needed //-------------------------------------------------------------------------- - int64_t anvec = A->nvec ; + // int64_t anvec = A->nvec ; int A_ntasks = 0 ; int A_nthreads = GB_nthreads (anz, chunk, nthreads_max) ; @@ -163,12 +165,6 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) thunk = GB_positional_offset (opcode, scalar, &depends_on_j) ; } - if (depends_on_j) - { - // slice the entries for each task - GB_SLICE_MATRIX (A, 32) ; - } - //-------------------------------------------------------------------------- // apply the operator //-------------------------------------------------------------------------- @@ -177,31 +173,46 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) { //---------------------------------------------------------------------- - // via the positional kernel + // apply a positional op //---------------------------------------------------------------------- ASSERT_OP_OK (op, "positional unop/idxunop: GB_apply_op", GB0) ; + //---------------------------------------------------------------------- + // positional op via the CUDA kernel + //---------------------------------------------------------------------- + #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_apply_unop_branch (ctype, A, op)) { + if (GB_cuda_apply_unop_branch (ctype, A, op)) + { info = GB_cuda_apply_unop (Cx, ctype, op, flipij, A, (GB_void *) &thunk) ; - } + } #endif - + + //---------------------------------------------------------------------- + // positional op via the CPU factory kernel + //---------------------------------------------------------------------- + if (info == GrB_NO_VALUE) { // get A and C - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; int64_t avlen = A->vlen ; + if (depends_on_j) + { + // slice the entries for each task + GB_SLICE_MATRIX2 (A, 32) ; + } + //------------------------------------------------------------------ // Cx = positional_op (A) //------------------------------------------------------------------ - if (is64) + if (opz64) { //-------------------------------------------------------------- @@ -216,9 +227,9 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_POSITIONI1_unop_code : // z = pos_i1(A(i,j)) == i+1 case GB_ROWINDEX_idxunop_code : // z = i+thunk #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (i + thunk) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" break ; case GB_POSITIONJ_unop_code : // z = pos_j(A(i,j)) == j @@ -226,28 +237,28 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_COLINDEX_idxunop_code : // z = j+thunk #define GB_APPLY_OP(pC,pA) \ Cz [pC] = (j + thunk) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; case GB_DIAGINDEX_idxunop_code : // z = (j-(i+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (j - (i+thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; case GB_FLIPDIAGINDEX_idxunop_code : // z = (i-(j+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (i - (j+thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; default: ; } } - else if (is32) + else if (opz32) { //-------------------------------------------------------------- @@ -262,9 +273,9 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_POSITIONI1_unop_code : // z = pos_i1(A(i,j)) == i+1 case GB_ROWINDEX_idxunop_code : // z = i+thunk #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (i + thunk) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" break ; case GB_POSITIONJ_unop_code : // z = pos_j(A(i,j)) == j @@ -272,21 +283,21 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_COLINDEX_idxunop_code : // z = j+thunk #define GB_APPLY_OP(pC,pA) \ Cz [pC] = (int32_t) (j + thunk) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; case GB_DIAGINDEX_idxunop_code : // z = (j-(i+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (j - (i+thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; case GB_FLIPDIAGINDEX_idxunop_code : // z = (i-(j+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (i - (j+thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; default: ; @@ -307,56 +318,56 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_TRIL_idxunop_code : // z = (j <= (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (j <= (i + thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_TRIU_idxunop_code : // z = (j >= (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (j >= (i + thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_DIAG_idxunop_code : // z = (j == (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (j == (i + thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_OFFDIAG_idxunop_code : // z = (j != (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (j != (i + thunk)) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_COLLE_idxunop_code : // z = (j <= thunk) #define GB_APPLY_OP(pC,pA) \ Cz [pC] = (j <= thunk) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_COLGT_idxunop_code : // z = (j > thunk) #define GB_APPLY_OP(pC,pA) \ Cz [pC] = (j > thunk) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" break ; ; case GB_ROWLE_idxunop_code : // z = (i <= thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (i <= thunk) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" break ; ; case GB_ROWGT_idxunop_code : // z = (i > thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ Cz [pC] = (i > thunk) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" break ; ; default: ; @@ -369,10 +380,9 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) { //---------------------------------------------------------------------- - // via the iso kernel + // via the iso kernel, in O(1) time //---------------------------------------------------------------------- - // if C is iso, this function takes O(1) time GBURBLE ("(iso apply) ") ; ASSERT_MATRIX_OK (A, "A passing to GB_unop_iso", GB0) ; if (anz > 0) @@ -388,19 +398,27 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) { //---------------------------------------------------------------------- - // unop via the factory kernel + // apply a unary op //---------------------------------------------------------------------- ASSERT_OP_OK (op, "unop for GB_apply_op", GB0) ; ASSERT (!A->iso) ; + //---------------------------------------------------------------------- + // unary op via the CUDA kernel + //---------------------------------------------------------------------- + #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_apply_unop_branch (ctype, A, op)) { + if (GB_cuda_apply_unop_branch (ctype, A, op)) + { info = GB_cuda_apply_unop (Cx, ctype, op, flipij, A, NULL) ; - } + } #endif - // determine number of threads to use + //---------------------------------------------------------------------- + // unary op via the factory kernel + //---------------------------------------------------------------------- + #ifndef GBCOMPACT if (info == GrB_NO_VALUE) { @@ -438,7 +456,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) #endif //---------------------------------------------------------------------- - // via the JIT or PreJIT kernel + // unary op via the JIT or PreJIT kernel //---------------------------------------------------------------------- if (info == GrB_NO_VALUE) @@ -448,7 +466,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) } //---------------------------------------------------------------------- - // via the generic kernel + // unary op via the generic kernel //---------------------------------------------------------------------- if (info == GrB_NO_VALUE) @@ -470,7 +488,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) /* Cx [pC] = fop (xwork) */ \ fop (Cx +((pC)*zsize), xwork) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" info = GrB_SUCCESS ; } @@ -527,15 +545,11 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) scalarx = swork ; } - //---------------------------------------------------------------------- - // via the factory kernel - //---------------------------------------------------------------------- - if (binop_bind1st) { //------------------------------------------------------------------ - // z = binop (scalar,Ax) + // binary op (bind 1st) via the CUDA kernel //------------------------------------------------------------------ #if defined ( GRAPHBLAS_HAS_CUDA ) @@ -543,9 +557,13 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) { info = GB_cuda_apply_binop (Cx, ctype, (GrB_BinaryOp) op, A, scalarx, true) ; - } + } #endif + //------------------------------------------------------------------ + // binary op (bind 1st) via the CPU factory kernel + //------------------------------------------------------------------ + #ifndef GBCOMPACT if (info == GrB_NO_VALUE) { @@ -583,7 +601,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) #endif //------------------------------------------------------------------ - // via the JIT or PreJIT kernel + // binary op (bind 1st) via the JIT or PreJIT kernel //------------------------------------------------------------------ if (info == GrB_NO_VALUE) @@ -597,17 +615,20 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) { //------------------------------------------------------------------ - // z = binop (Ax,scalar) + // binary op (bind 2nd) via the CUDA kernel //------------------------------------------------------------------ - + #if defined ( GRAPHBLAS_HAS_CUDA ) if (GB_cuda_apply_binop_branch (ctype, (GrB_BinaryOp) op, A)) { info = GB_cuda_apply_binop (Cx, ctype, (GrB_BinaryOp) op, A, scalarx, false) ; - } + } #endif + //------------------------------------------------------------------ + // binary op (bind 2nd) via the CPU factory kernel + //------------------------------------------------------------------ #ifndef GBCOMPACT if (info == GrB_NO_VALUE) @@ -647,7 +668,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) #endif //------------------------------------------------------------------ - // via the JIT or PreJIT kernel + // binary op (bind 2nd) via the JIT or PreJIT kernel //------------------------------------------------------------------ if (info == GrB_NO_VALUE) @@ -658,7 +679,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) } //---------------------------------------------------------------------- - // via the generic kernel + // binary op (bind 1st or 2nd) via the generic kernel //---------------------------------------------------------------------- if (info == GrB_NO_VALUE) @@ -681,7 +702,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) cast_A_to_Y (ywork, Ax +(pA)*asize, asize) ; \ /* Cx [pC] = fop (scalarx, ywork) */ \ fop (Cx +((pC)*zsize), scalarx, ywork) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" } else { @@ -693,7 +714,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) cast_A_to_X (xwork, Ax +(pA)*asize, asize) ; \ /* Cx [pC] = fop (xwork, scalarx) */ \ fop (Cx +((pC)*zsize), xwork, scalarx) ; - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" } info = GrB_SUCCESS ; } @@ -730,24 +751,36 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) ythunk = ywork ; } + //---------------------------------------------------------------------- + // user-defined index-unary op via the CUDA kernel + //---------------------------------------------------------------------- + #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_apply_unop_branch (ctype, A, op)) { + if (GB_cuda_apply_unop_branch (ctype, A, op)) + { info = GB_cuda_apply_unop (Cx, ctype, op, flipij, A, ythunk) ; - } + } #endif //---------------------------------------------------------------------- - // via the JIT or PreJIT kernel + // user-defined index-unary op via the JIT or PreJIT kernel //---------------------------------------------------------------------- if (info == GrB_NO_VALUE) { + + if (depends_on_j) + { + // slice the entries for each task + GB_SLICE_MATRIX2 (A, 32) ; + } + info = GB_apply_unop_jit (Cx, ctype, op, flipij, A, ythunk, A_ek_slicing, A_ntasks, A_nthreads) ; } //---------------------------------------------------------------------- - // via the generic kernel + // user-defined index-unary op via the generic kernel //---------------------------------------------------------------------- if (info == GrB_NO_VALUE) @@ -755,9 +788,9 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) GB_BURBLE_N (anz, "(generic apply: user-defined idxunop) ") ; // get A and C - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; int64_t avlen = A->vlen ; GB_Type_code acode = Atype->code ; @@ -778,12 +811,12 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) // Cx [pC] = op (Ax [A_iso ? 0 : pA], i, j, ythunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ GB_void xwork [GB_VLA(xsize)] ; \ cast_A_to_X (xwork, Ax +(A_iso ? 0 : (pA))*asize, asize) ; \ fop (Cx +((pC)*zsize), xwork, \ flipij ? j : i, flipij ? i : j, ythunk) ; - #include "apply/template/GB_apply_unop_ijp.c" + #include "apply/template/GB_apply_unop_ijp_template.c" info = GrB_SUCCESS ; } } diff --git a/GraphBLAS/Source/apply/GB_shallow_op.c b/GraphBLAS/Source/apply/GB_shallow_op.c index b3d0bbf434..4774d85d48 100644 --- a/GraphBLAS/Source/apply/GB_shallow_op.c +++ b/GraphBLAS/Source/apply/GB_shallow_op.c @@ -2,7 +2,7 @@ // GB_shallow_op: create a shallow copy and apply a unary operator to a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,9 +18,8 @@ // The values are typically not a shallow copy, unless no typecasting is needed // and the operator is an identity operator. -// The pattern is always a shallow copy. No errors are checked except for -// out-of-memory conditions. This function is not user-callable. Shallow -// matrices are never passed back to the user. +// The pattern is always a shallow copy; C and A have the same integer sizes. +// Shallow matrices are never passed back to the user. // Compare this function with GB_shallow_copy.c. @@ -45,7 +44,7 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for shallow_op", GB0) ; ASSERT_OP_OK (op, "unop/binop for shallow_op", GB0) ; ASSERT (!GB_ZOMBIES (A)) ; @@ -93,8 +92,9 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator // C has the exact same sparsity structure as A. GrB_Info info ; info = GB_new (&C, // any sparsity, existing header - ztype, A->vlen, A->vdim, GB_Ap_null, C_is_csc, - GB_sparsity (A), A->hyper_switch, 0) ; + ztype, A->vlen, A->vdim, GB_ph_null, C_is_csc, + GB_sparsity (A), A->hyper_switch, 0, + A->p_is_32, A->j_is_32, A->i_is_32) ; ASSERT (info == GrB_SUCCESS) ; //-------------------------------------------------------------------------- @@ -107,9 +107,13 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator C->h = A->h ; // C->h is of size A->plen C->p_size = A->p_size ; C->h_size = A->h_size ; + C->p_is_32 = A->p_is_32 ; + C->j_is_32 = A->j_is_32 ; + C->i_is_32 = A->i_is_32 ; C->plen = A->plen ; // C and A have the same hyperlist sizes C->nvec = A->nvec ; - C->nvec_nonempty = A->nvec_nonempty ; +// C->nvec_nonempty = A->nvec_nonempty ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty_get (A)) ; C->jumbled = A->jumbled ; // C is jumbled if A is jumbled C->nvals = A->nvals ; C->magic = GB_MAGIC ; @@ -182,7 +186,7 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator //-------------------------------------------------------------------------- // allocate new space for the numerical values of C; use calloc if bitmap - C->x = GB_XALLOC (GB_IS_BITMAP (C), C_iso, anz, // x:OK + C->x = GB_XALLOC_MEMORY (GB_IS_BITMAP (C), C_iso, anz, C->type->size, &(C->x_size)) ; C->x_shallow = false ; // free C->x when freeing C if (C->x == NULL) diff --git a/GraphBLAS/Source/apply/GrB_Matrix_apply.c b/GraphBLAS/Source/apply/GrB_Matrix_apply.c index b6d699c08d..64dd75773d 100644 --- a/GraphBLAS/Source/apply/GrB_Matrix_apply.c +++ b/GraphBLAS/Source/apply/GrB_Matrix_apply.c @@ -2,7 +2,7 @@ // GrB_Matrix_apply: apply a unary or binary operator to a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,11 +30,11 @@ GrB_Info GrB_Matrix_apply // C = accum (C, op(A)) or op(A') // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_apply (C, M, accum, op, A, desc)") ; + GB_WHERE3 (C, M_in, A, "GrB_Matrix_apply (C, M, accum, op, A, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, @@ -80,13 +80,14 @@ static inline GrB_Info GB_1st // C=accum(C,op(x,A)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (x) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (x) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor, using GrB_INP1 to transpose the matrix + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx1, A_transpose, xx2, xx7) ; @@ -130,13 +131,14 @@ static inline GrB_Info GB_2nd // C=accum(C,op(A,y)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (y) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (y) ; // get the descriptor, using GrB_INP0 to transpose the matrix + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; @@ -174,8 +176,8 @@ GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_BinaryOp1st_Scalar" - " (C, M, accum, op, x, A, desc)") ; + GB_WHERE4 (C, M, x, A, + "GrB_Matrix_apply_BinaryOp1st_Scalar (C, M, accum, op, x, A, desc)") ; return (GB_1st (C, M, accum, op, x, A, desc, Werk)) ; } @@ -213,8 +215,8 @@ GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_BinaryOp2nd_Scalar" - " (C, M, accum, op, A, y, desc)") ; + GB_WHERE4 (C, M, A, y, + "GrB_Matrix_apply_BinaryOp2nd_Scalar (C, M, accum, op, A, y, desc)") ; return (GB_2nd (C, M, accum, (GB_Operator) op, A, y, desc, Werk)) ; } @@ -253,7 +255,8 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_apply_BinaryOp1st_, T) \ const GrB_Descriptor desc /* descriptor for C, M, and A */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_apply_BinaryOp1st_" GB_STR(T) \ + GB_WHERE3 (C, M, A, \ + GB_STR(prefix) "_Matrix_apply_BinaryOp1st_" GB_STR(T) \ " (C, M, accum, op, x, A, desc)") ; \ GB_SCALAR_WRAP (scalar, x, GB_EVAL3 (prefix, _, T)) ; \ return (GB_1st (C, M, accum, op, scalar, A, desc, Werk)) ; \ @@ -288,8 +291,8 @@ GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_BinaryOp1st_UDT " - " (C, M, accum, op, x, A, desc)") ; + GB_WHERE3 (C, M, A, + "GrB_Matrix_apply_BinaryOp1st_UDT (C, M, accum, op, x, A, desc)") ; GB_SCALAR_WRAP_UDT (scalar, x, (op == NULL) ? NULL : op->xtype) ; return (GB_1st (C, M, accum, op, scalar, A, desc, Werk)) ; } @@ -310,8 +313,8 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_apply_BinaryOp2nd_, T) \ const GrB_Descriptor desc /* descriptor for C, M, and A */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_apply_BinaryOp2nd_" GB_STR(T) \ - " (C, M, accum, op, A, y, desc)") ; \ + GB_WHERE3 (C, M, A, GB_STR(prefix) "_Matrix_apply_BinaryOp2nd_" \ + GB_STR(T) " (C, M, accum, op, A, y, desc)") ; \ GB_SCALAR_WRAP (scalar, y, GB_EVAL3 (prefix, _, T)) ; \ return (GB_2nd (C, M, accum, (GB_Operator) op, A, scalar, desc, Werk)) ;\ } @@ -345,8 +348,8 @@ GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_BinaryOp2nd_UDT" - " (C, M, accum, op, A, y, desc)") ; + GB_WHERE3 (C, M, A, + "GrB_Matrix_apply_BinaryOp2nd_UDT (C, M, accum, op, A, y, desc)") ; GB_SCALAR_WRAP_UDT (scalar, y, (op == NULL) ? NULL : op->ytype) ; return (GB_2nd (C, M, accum, (GB_Operator) op, A, scalar, desc, Werk)) ; } @@ -367,7 +370,7 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_apply_IndexOp_, T) \ const GrB_Descriptor desc /* descriptor for C, M, and A */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_apply_IndexOp_" GB_STR(T) \ + GB_WHERE3 (C, M, A, GB_STR(prefix) "_Matrix_apply_IndexOp_" GB_STR(T) \ " (C, M, accum, op, A, thunk, desc)") ; \ GB_SCALAR_WRAP (scalar, thunk, GB_EVAL3 (prefix, _, T)) ; \ return (GB_2nd (C, M, accum, (GB_Operator) op, A, scalar, desc, Werk)) ;\ @@ -402,8 +405,8 @@ GrB_Info GrB_Matrix_apply_IndexOp_UDT const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_IndexOp_UDT" - " (C, M, accum, op, A, thunk, desc)") ; + GB_WHERE3 (C, M, A, + "GrB_Matrix_apply_IndexOp_UDT (C, M, accum, op, A, thunk, desc)") ; GB_SCALAR_WRAP_UDT (scalar, thunk, (op == NULL) ? NULL : op->ytype) ; return (GB_2nd (C, M, accum, (GB_Operator) op, A, scalar, desc, Werk)) ; } @@ -423,8 +426,8 @@ GrB_Info GrB_Matrix_apply_IndexOp_Scalar // C=accum(C,op(A,i,j,thunk)) const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_apply_IndexOp_Scalar" - " (C, M, accum, op, A, thunk, desc)") ; + GB_WHERE4 (C, M, A, thunk, + "GrB_Matrix_apply_IndexOp_Scalar (C, M, accum, op, A, thunk, desc)") ; return (GB_2nd (C, M, accum, (GB_Operator) op, A, thunk, desc, Werk)) ; } diff --git a/GraphBLAS/Source/apply/GrB_Vector_apply.c b/GraphBLAS/Source/apply/GrB_Vector_apply.c index 455951f236..51a3723257 100644 --- a/GraphBLAS/Source/apply/GrB_Vector_apply.c +++ b/GraphBLAS/Source/apply/GrB_Vector_apply.c @@ -2,7 +2,7 @@ // GrB_Vector_apply: apply a unary or binary operator to a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,11 +30,11 @@ GrB_Info GrB_Vector_apply // w = accum (w, op(u)) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_apply (w, M, accum, op, u, desc)") ; + GB_WHERE3 (w, M_in, u, "GrB_Vector_apply (w, M, accum, op, u, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; @@ -84,17 +84,18 @@ static inline GrB_Info GB_1st // w = accum (w, op(x,u)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (x) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (x) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx1, xx2, xx3, xx7) ; @@ -138,17 +139,18 @@ static inline GrB_Info GB_2nd // w = accum (w, op(u,y)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_NULL (y) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_apply") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - GB_RETURN_IF_NULL_OR_FAULTY (y) ; ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx1, xx2, xx3, xx7) ; @@ -186,8 +188,8 @@ GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_BinaryOp1st_Scalar" - " (w, M, accum, op, x, u, desc)") ; + GB_WHERE4 (w, M, x, u, + "GrB_Vector_apply_BinaryOp1st_Scalar (w, M, accum, op, x, u, desc)") ; return (GB_1st (w, M, accum, op, x, u, desc, Werk)) ; } @@ -225,8 +227,8 @@ GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_BinaryOp2nd_Scalar" - " (w, M, accum, op, u, y, desc)") ; + GB_WHERE4 (w, M, u, y, + "GrB_Vector_apply_BinaryOp2nd_Scalar (w, M, accum, op, u, y, desc)") ; return (GB_2nd (w, M, accum, (GB_Operator) op, u, y, desc, Werk)) ; } @@ -265,8 +267,8 @@ GrB_Info GB_EVAL3 (prefix, _Vector_apply_BinaryOp1st_, T) \ const GrB_Descriptor desc /* descriptor for w and M */ \ ) \ { \ - GB_WHERE (w, GB_STR(prefix) "_Vector_apply_BinaryOp1st_" GB_STR(T) \ - " (w, M, accum, op, x, u, desc)") ; \ + GB_WHERE3 (w, M, u, GB_STR(prefix) "_Vector_apply_BinaryOp1st_" \ + GB_STR(T) " (w, M, accum, op, x, u, desc)") ; \ GB_SCALAR_WRAP (scalar, x, GB_EVAL3 (prefix, _, T)) ; \ return (GB_1st (w, M, accum, op, scalar, u, desc, Werk)) ; \ } @@ -300,8 +302,8 @@ GrB_Info GrB_Vector_apply_BinaryOp1st_UDT const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_BinaryOp1st_UDT" - " (w, M, accum, op, x, u, desc)") ; + GB_WHERE3 (w, M, u, + "GrB_Vector_apply_BinaryOp1st_UDT (w, M, accum, op, x, u, desc)") ; GB_SCALAR_WRAP_UDT (scalar, x, (op == NULL) ? NULL : op->xtype) ; return (GB_1st (w, M, accum, op, scalar, u, desc, Werk)) ; } @@ -322,8 +324,8 @@ GrB_Info GB_EVAL3 (prefix, _Vector_apply_BinaryOp2nd_, T) \ const GrB_Descriptor desc /* descriptor for w and M */ \ ) \ { \ - GB_WHERE (w, GB_STR(prefix) "_Vector_apply_BinaryOp2nd_" GB_STR(T) \ - " (w, M, accum, op, u, y, desc)") ; \ + GB_WHERE3 (w, M, u, GB_STR(prefix) "_Vector_apply_BinaryOp2nd_" \ + GB_STR(T) " (w, M, accum, op, u, y, desc)") ; \ GB_SCALAR_WRAP (scalar, y, GB_EVAL3 (prefix, _, T)) ; \ return (GB_2nd (w, M, accum, (GB_Operator) op, u, scalar, desc, Werk)) ;\ } @@ -357,8 +359,8 @@ GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_BinaryOp2nd_UDT" - " (w, M, accum, op, u, y, desc)") ; + GB_WHERE3 (w, M, u, + "GrB_Vector_apply_BinaryOp2nd_UDT (w, M, accum, op, u, y, desc)") ; GB_SCALAR_WRAP_UDT (scalar, y, (op == NULL) ? NULL : op->ytype) ; return (GB_2nd (w, M, accum, (GB_Operator) op, u, scalar, desc, Werk)) ; } @@ -379,7 +381,7 @@ GrB_Info GB_EVAL3 (prefix, _Vector_apply_IndexOp_, T) \ const GrB_Descriptor desc /* descriptor for w and M */ \ ) \ { \ - GB_WHERE (w, GB_STR(prefix) "_Vector_apply_IndexOp_" GB_STR(T) \ + GB_WHERE3 (w, M, u, GB_STR(prefix) "_Vector_apply_IndexOp_" GB_STR(T) \ " (w, M, accum, op, u, thunk, desc)") ; \ GB_SCALAR_WRAP (scalar, thunk, GB_EVAL3 (prefix, _, T)) ; \ return (GB_2nd (w, M, accum, (GB_Operator) op, u, scalar, desc, Werk)) ;\ @@ -414,8 +416,8 @@ GrB_Info GrB_Vector_apply_IndexOp_UDT const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_IndexOp_UDT" - " (w, M, accum, op, u, thunk, desc)") ; + GB_WHERE3 (w, M, u, + "GrB_Vector_apply_IndexOp_UDT (w, M, accum, op, u, thunk, desc)") ; GB_SCALAR_WRAP_UDT (scalar, thunk, (op == NULL) ? NULL : op->ytype) ; return (GB_2nd (w, M, accum, (GB_Operator) op, u, scalar, desc, Werk)) ; } @@ -435,8 +437,8 @@ GrB_Info GrB_Vector_apply_IndexOp_Scalar const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_apply_IndexOp_Scalar" - " (w, M, accum, op, u, thunk, desc)") ; + GB_WHERE4 (w, M, u, thunk, + "GrB_Vector_apply_IndexOp_Scalar (w, M, accum, op, u, thunk, desc)") ; return (GB_2nd (w, M, accum, (GB_Operator) op, u, thunk, desc, Werk)) ; } diff --git a/GraphBLAS/Source/apply/template/GB_apply_unop_template.c b/GraphBLAS/Source/apply/factory/GB_apply_unop_template.c similarity index 86% rename from GraphBLAS/Source/apply/template/GB_apply_unop_template.c rename to GraphBLAS/Source/apply/factory/GB_apply_unop_template.c index 6e34e906e9..4ea47ded61 100644 --- a/GraphBLAS/Source/apply/template/GB_apply_unop_template.c +++ b/GraphBLAS/Source/apply/factory/GB_apply_unop_template.c @@ -2,7 +2,7 @@ // GB_apply_unop_template.c: C = op(A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ int64_t p ; if (Ab == NULL) { + // C and A are sparse, hypersparse, or full #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < anz ; p++) { @@ -22,7 +23,7 @@ } else { - // bitmap case, no transpose; A->b already memcpy'd into C->b + // C and A are bitmap #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < anz ; p++) { diff --git a/GraphBLAS/Source/apply/factory/GB_twotype_factory.c b/GraphBLAS/Source/apply/factory/GB_twotype_factory.c index d3cbeeec90..8e42ae0470 100644 --- a/GraphBLAS/Source/apply/factory/GB_twotype_factory.c +++ b/GraphBLAS/Source/apply/factory/GB_twotype_factory.c @@ -2,7 +2,7 @@ // GB_twotype_factory.c: 2-type switch factory //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/apply/factory/GB_unop_factory.c b/GraphBLAS/Source/apply/factory/GB_unop_factory.c index 3adf72f56f..a9ed8420ce 100644 --- a/GraphBLAS/Source/apply/factory/GB_unop_factory.c +++ b/GraphBLAS/Source/apply/factory/GB_unop_factory.c @@ -2,7 +2,7 @@ // GB_unop_factory.c: switch factory for unary operators and 2 types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -188,7 +188,8 @@ } } - else if (code1 == GB_BOOL_code && (code2 >= GB_FP32_code && code2 <= GB_FC64_code)) + else if (code1 == GB_BOOL_code && + (code2 >= GB_FP32_code && code2 <= GB_FC64_code)) { //---------------------------------------------------------------------- @@ -249,19 +250,14 @@ switch (opcode) { - case GB_AINV_unop_code : // z = -x, all 13 types + case GB_AINV_unop_code : // z = -x, all signed types switch (code1) { - GB_CASE_BOOL (_ainv, _bool , bool ) GB_CASE_INT8 (_ainv, _int8 , int8_t ) GB_CASE_INT16 (_ainv, _int16 , int16_t ) GB_CASE_INT32 (_ainv, _int32 , int32_t ) GB_CASE_INT64 (_ainv, _int64 , int64_t ) - GB_CASE_UINT8 (_ainv, _uint8 , uint8_t ) - GB_CASE_UINT16 (_ainv, _uint16, uint16_t ) - GB_CASE_UINT32 (_ainv, _uint32, uint32_t ) - GB_CASE_UINT64 (_ainv, _uint64, uint64_t ) GB_CASE_FP32 (_ainv, _fp32 , float ) GB_CASE_FP64 (_ainv, _fp64 , double ) GB_CASE_FC32 (_ainv, _fc32 , GxB_FC32_t) @@ -270,19 +266,10 @@ } break ; - case GB_MINV_unop_code : // z = 1/x, all 13 types + case GB_MINV_unop_code : // z = 1/x, just floating-point types switch (code1) { - GB_CASE_BOOL (_minv, _bool , bool ) - GB_CASE_INT8 (_minv, _int8 , int8_t ) - GB_CASE_INT16 (_minv, _int16 , int16_t ) - GB_CASE_INT32 (_minv, _int32 , int32_t ) - GB_CASE_INT64 (_minv, _int64 , int64_t ) - GB_CASE_UINT8 (_minv, _uint8 , uint8_t ) - GB_CASE_UINT16 (_minv, _uint16, uint16_t ) - GB_CASE_UINT32 (_minv, _uint32, uint32_t ) - GB_CASE_UINT64 (_minv, _uint64, uint64_t ) GB_CASE_FP32 (_minv, _fp32 , float ) GB_CASE_FP64 (_minv, _fp64 , double ) GB_CASE_FC32 (_minv, _fc32 , GxB_FC32_t) @@ -291,52 +278,33 @@ } break ; - case GB_ABS_unop_code : // z = abs (x), for all but complex + case GB_ABS_unop_code : // z = abs (x), signed, not cmplx switch (code1) { - GB_CASE_BOOL (_abs, _bool , bool ) GB_CASE_INT8 (_abs, _int8 , int8_t ) GB_CASE_INT16 (_abs, _int16 , int16_t ) GB_CASE_INT32 (_abs, _int32 , int32_t ) GB_CASE_INT64 (_abs, _int64 , int64_t ) - GB_CASE_UINT8 (_abs, _uint8 , uint8_t ) - GB_CASE_UINT16 (_abs, _uint16, uint16_t) - GB_CASE_UINT32 (_abs, _uint32, uint32_t) - GB_CASE_UINT64 (_abs, _uint64, uint64_t) GB_CASE_FP32 (_abs, _fp32 , float ) GB_CASE_FP64 (_abs, _fp64 , double ) default: ; } break ; - case GB_LNOT_unop_code : // z = ! (x != 0), no complex case + case GB_LNOT_unop_code : // z = !x, boolean only switch (code1) { GB_CASE_BOOL (_lnot, _bool , bool ) - GB_CASE_INT8 (_lnot, _int8 , int8_t ) - GB_CASE_INT16 (_lnot, _int16 , int16_t ) - GB_CASE_INT32 (_lnot, _int32 , int32_t ) - GB_CASE_INT64 (_lnot, _int64 , int64_t ) - GB_CASE_UINT8 (_lnot, _uint8 , uint8_t ) - GB_CASE_UINT16 (_lnot, _uint16, uint16_t) - GB_CASE_UINT32 (_lnot, _uint32, uint32_t) - GB_CASE_UINT64 (_lnot, _uint64, uint64_t) - GB_CASE_FP32 (_lnot, _fp32 , float ) - GB_CASE_FP64 (_lnot, _fp64 , double ) default: ; } break ; - case GB_BNOT_unop_code : // z = ~x (bitwise complement), integers only + case GB_BNOT_unop_code : // z = ~x (bitwise compl), integers only switch (code1) { - GB_CASE_INT8 (_bnot, _int8 , int8_t ) - GB_CASE_INT16 (_bnot, _int16 , int16_t ) - GB_CASE_INT32 (_bnot, _int32 , int32_t ) - GB_CASE_INT64 (_bnot, _int64 , int64_t ) GB_CASE_UINT8 (_bnot, _uint8 , uint8_t ) GB_CASE_UINT16 (_bnot, _uint16, uint16_t) GB_CASE_UINT32 (_bnot, _uint32, uint32_t) @@ -701,7 +669,7 @@ } break ; - case GB_FREXPX_unop_code : // z = frexpx (x), mantissa from C11 frexp + case GB_FREXPX_unop_code : // z = frexpx (x), mantissa of frexp switch (code1) { @@ -711,7 +679,7 @@ } break ; - case GB_FREXPE_unop_code : // z = frexpe (x), exponent from C11 frexp + case GB_FREXPE_unop_code : // z = frexpe (x), exponent of frexp switch (code1) { diff --git a/GraphBLAS/Source/apply/template/GB_apply_bind1st_template.c b/GraphBLAS/Source/apply/template/GB_apply_bind1st_template.c index 96607542fb..4992258d86 100644 --- a/GraphBLAS/Source/apply/template/GB_apply_bind1st_template.c +++ b/GraphBLAS/Source/apply/template/GB_apply_bind1st_template.c @@ -2,7 +2,7 @@ // GB_apply_bind1st_template: Cx = op (x,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < bnz ; p++) { - if (!GBB_B (Bb, p)) continue ; + if (!GBb_B (Bb, p)) continue ; GB_DECLAREB (bij) ; GB_GETB (bij, Bx, p, false) ; GB_EWISEOP (Cx, p, x, bij, 0, 0) ; diff --git a/GraphBLAS/Source/apply/template/GB_apply_bind2nd_template.c b/GraphBLAS/Source/apply/template/GB_apply_bind2nd_template.c index 8ceaa20e96..0421c10a5a 100644 --- a/GraphBLAS/Source/apply/template/GB_apply_bind2nd_template.c +++ b/GraphBLAS/Source/apply/template/GB_apply_bind2nd_template.c @@ -2,7 +2,7 @@ // GB_apply_bind2nd_template: Cx = op (A,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < anz ; p++) { - if (!GBB_A (Ab, p)) continue ; + if (!GBb_A (Ab, p)) continue ; GB_DECLAREA (aij) ; GB_GETA (aij, Ax, p, false) ; GB_EWISEOP (Cx, p, aij, y, 0, 0) ; diff --git a/GraphBLAS/Source/apply/template/GB_apply_unop_ijp.c b/GraphBLAS/Source/apply/template/GB_apply_unop_ijp_template.c similarity index 88% rename from GraphBLAS/Source/apply/template/GB_apply_unop_ijp.c rename to GraphBLAS/Source/apply/template/GB_apply_unop_ijp_template.c index ac31223e0c..b1d12130ec 100644 --- a/GraphBLAS/Source/apply/template/GB_apply_unop_ijp.c +++ b/GraphBLAS/Source/apply/template/GB_apply_unop_ijp_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_apply_unop_ijp: C = op (A), depending j +// GB_apply_unop_ijp_template: C = op (A), depending j //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,9 +40,9 @@ // find the part of A(:,k) and Cx to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GBp_A (Ap, k, avlen), GBp_A (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // C(:,j) = op (A(:,j)) @@ -50,7 +50,7 @@ for (int64_t p = pA_start ; p < pA_end ; p++) { - if (!GBB_A (Ab, p)) continue ; + if (!GBb_A (Ab, p)) continue ; // Cx [p] = op (A (i,j)) GB_APPLY_OP (p, p) ; } diff --git a/GraphBLAS/Source/apply/template/GB_apply_unop_ip.c b/GraphBLAS/Source/apply/template/GB_apply_unop_ip.c deleted file mode 100644 index 910a058913..0000000000 --- a/GraphBLAS/Source/apply/template/GB_apply_unop_ip.c +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_apply_unop_ip: C = op (A), depending only on i -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// A can be jumbled. If A is jumbled, so is C. - -{ - - //-------------------------------------------------------------------------- - // Cx = op (A) - //-------------------------------------------------------------------------- - - int64_t p ; - #pragma omp parallel for num_threads(A_nthreads) schedule(static) - for (p = 0 ; p < anz ; p++) - { - if (!GBB_A (Ab, p)) continue ; - // Cx [p] = op (A (i,j)) - GB_APPLY_OP (p, p) ; - } -} - -#undef GB_APPLY_OP - diff --git a/GraphBLAS/Source/apply/template/GB_apply_unop_ip_template.c b/GraphBLAS/Source/apply/template/GB_apply_unop_ip_template.c new file mode 100644 index 0000000000..140a373211 --- /dev/null +++ b/GraphBLAS/Source/apply/template/GB_apply_unop_ip_template.c @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// GB_apply_unop_ip_template: C = op (A), depending only on i +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A can be jumbled. If A is jumbled, so is C. + +{ + + //-------------------------------------------------------------------------- + // Cx = op (A) + //-------------------------------------------------------------------------- + + int64_t p ; + if (GB_A_IS_BITMAP) + { + // A is bitmap + #pragma omp parallel for num_threads(A_nthreads) schedule(static) + for (p = 0 ; p < anz ; p++) + { + if (!Ab [p]) continue ; + // Cx [p] = op (A (i,j)) + GB_APPLY_OP (p, p) ; + } + } + else + { + // A is sparse, hypersparse, or full + #pragma omp parallel for num_threads(A_nthreads) schedule(static) + for (p = 0 ; p < anz ; p++) + { + // Cx [p] = op (A (i,j)) + GB_APPLY_OP (p, p) ; + } + } +} + +#undef GB_APPLY_OP + diff --git a/GraphBLAS/Source/assign/GB_Matrix_assign_scalar.c b/GraphBLAS/Source/assign/GB_Matrix_assign_scalar.c new file mode 100644 index 0000000000..4b82daf09b --- /dev/null +++ b/GraphBLAS/Source/assign/GB_Matrix_assign_scalar.c @@ -0,0 +1,180 @@ +//------------------------------------------------------------------------------ +// GB_Matrix_assign_scalar: assign a scalar to matrix, via scalar expansion +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a matrix: + +// C(I,J) = accum(C(I,J),x) + +// The scalar x is implicitly expanded into a matrix A of size nI-by-nJ, +// with each entry in A equal to x. + +// Compare with GxB_Matrix_subassign_scalar, +// which uses M and C_Replace differently. + +#include "assign/GB_assign.h" +#include "ij/GB_ij.h" +#include "mask/GB_get_mask.h" +#define GB_FREE_ALL GB_Matrix_free (&A) ; + +GrB_Info GB_Matrix_assign_scalar // C(I,J) = accum (C(I,J),s) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const void *J, // column indices + const bool J_is_32, + uint64_t nj, // number of column indices + const GrB_Descriptor desc, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_NULL (I) ; + GB_RETURN_IF_NULL (J) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + + // if C has a user-defined type, its type must match the scalar type + if (C->type->code == GB_UDT_code && C->type != scalar->type) + { + GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" + "cannot be typecast to output of type [%s]", + scalar->type->name, C->type->name) ; + } + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), scalar) + //-------------------------------------------------------------------------- + + uint64_t nvals ; + GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; + + if (M == NULL && !Mask_comp && ni == 1 && nj == 1 && !C_replace) + { + + //---------------------------------------------------------------------- + // scalar assignment + //---------------------------------------------------------------------- + + uint64_t row, col ; + if (I_is_32) + { + const uint32_t *I32 = (uint32_t *) I ; + row = I32 [0] ; + } + else + { + const uint64_t *I64 = (uint64_t *) I ; + row = I64 [0] ; + } + if (J_is_32) + { + const uint32_t *J32 = (uint32_t *) J ; + col = J32 [0] ; + } + else + { + const uint64_t *J64 = (uint64_t *) J ; + col = J64 [0] ; + } + + if (nvals == 1) + { + // set the element: C(row,col) += scalar or C(row,col) = scalar + info = GB_setElement (C, accum, scalar->x, row, col, + scalar->type->code, Werk) ; + } + else if (accum == NULL) + { + // delete the C(row,col) element + info = GB_Matrix_removeElement (C, row, col, Werk) ; + } + + } + else if (nvals == 1) + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has a single entry + //---------------------------------------------------------------------- + + // This is identical to non-opaque scalar assignment + + info = GB_assign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),scalar) + NULL, false, // no explicit matrix A + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + true, // do scalar expansion + scalar->x, // scalar to assign, expands to become A + scalar->type->code, // type code of scalar to expand + GB_ASSIGN, + Werk) ; + + } + else + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has no entry + //---------------------------------------------------------------------- + + // determine the properites of the I and J index lists + int64_t nI, nJ, Icolon [3], Jcolon [3] ; + int I_Kind, J_Kind ; + GB_ijlength (I, I_is_32, ni, GB_NROWS (C), &nI, &I_Kind, Icolon) ; + GB_ijlength (J, J_is_32, nj, GB_NCOLS (C), &nJ, &J_Kind, Jcolon) ; + + // create an empty matrix A of the right size, and use matrix assign + struct GB_Matrix_opaque A_header ; + GB_CLEAR_MATRIX_HEADER (A, &A_header) ; + bool is_csc = C->is_csc ; + int64_t vlen = is_csc ? nI : nJ ; + int64_t vdim = is_csc ? nJ : nI ; + GB_OK (GB_new (&A, // existing header + scalar->type, vlen, vdim, GB_ph_calloc, is_csc, GxB_AUTO_SPARSITY, + GB_HYPER_SWITCH_DEFAULT, 1, /* OK: */ false, false, false)) ; + info = GB_assign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),A) + A, false, // A matrix and its descriptor + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + GB_ASSIGN, + Werk) ; + GB_FREE_ALL ; + } + + return (info) ; +} + diff --git a/GraphBLAS/Source/assign/GB_Matrix_subassign_scalar.c b/GraphBLAS/Source/assign/GB_Matrix_subassign_scalar.c new file mode 100644 index 0000000000..214c31311c --- /dev/null +++ b/GraphBLAS/Source/assign/GB_Matrix_subassign_scalar.c @@ -0,0 +1,178 @@ +//------------------------------------------------------------------------------ +// GB_Matrix_subassign_scalar: assign to submatrix, via scalar expansion +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a submatrix: + +// C(I,J) = accum(C(I,J),x) + +// The scalar x is implicitly expanded into a matrix A of size nI-by-nJ, +// with each entry in A equal to x. + +// Compare with GrB_Matrix_assign_scalar, +// which uses M and C_Replace differently. + +#include "assign/GB_subassign.h" +#include "ij/GB_ij.h" +#include "mask/GB_get_mask.h" +#define GB_FREE_ALL GB_Matrix_free (&A) ; + +GrB_Info GB_Matrix_subassign_scalar // C(I,J) = accum (C(I,J),s) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const void *J, // column indices + const bool J_is_32, + uint64_t nj, // number of column indices + const GrB_Descriptor desc, // descriptor for C and Mask + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_NULL (I) ; + GB_RETURN_IF_NULL (J) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + + // if C has a user-defined type, its type must match the scalar type + if (C->type->code == GB_UDT_code && C->type != scalar->type) + { + GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" + "cannot be typecast to output of type [%s]", + scalar->type->name, C->type->name) ; + } + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), scalar) + //-------------------------------------------------------------------------- + + uint64_t nvals ; + GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; + + if (M == NULL && !Mask_comp && ni == 1 && nj == 1 && !C_replace) + { + + //---------------------------------------------------------------------- + // scalar assignment + //---------------------------------------------------------------------- + + uint64_t row, col ; + if (I_is_32) + { + const uint32_t *I32 = (uint32_t *) I ; + row = I32 [0] ; + } + else + { + const uint64_t *I64 = (uint64_t *) I ; + row = I64 [0] ; + } + if (J_is_32) + { + const uint32_t *J32 = (uint32_t *) J ; + col = J32 [0] ; + } + else + { + const uint64_t *J64 = (uint64_t *) J ; + col = J64 [0] ; + } + + if (nvals == 1) + { + // set the element: C(row,col) += scalar or C(row,col) = scalar + info = GB_setElement (C, accum, scalar->x, row, col, + scalar->type->code, Werk) ; + } + else if (accum == NULL) + { + // delete the C(row,col) element + info = GB_Matrix_removeElement (C, row, col, Werk) ; + } + + } + else if (nvals == 1) + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has a single entry + //---------------------------------------------------------------------- + + // This is identical to non-opaque scalar subassignment + + info = GB_subassign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),scalar) + NULL, false, // no explicit matrix A + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + true, // do scalar expansion + scalar->x, // scalar to assign, expands to become A + scalar->type->code, // type code of scalar to expand + Werk) ; + + } + else + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has no entry + //---------------------------------------------------------------------- + + // determine the properites of the I and J index lists + int64_t nI, nJ, Icolon [3], Jcolon [3] ; + int I_Kind, J_Kind ; + GB_ijlength (I, I_is_32, ni, GB_NROWS (C), &nI, &I_Kind, Icolon) ; + GB_ijlength (J, J_is_32, nj, GB_NCOLS (C), &nJ, &J_Kind, Jcolon) ; + + // create an empty matrix A of the right size, and use matrix assign + struct GB_Matrix_opaque A_header ; + GB_CLEAR_MATRIX_HEADER (A, &A_header) ; + bool is_csc = C->is_csc ; + int64_t vlen = is_csc ? nI : nJ ; + int64_t vdim = is_csc ? nJ : nI ; + GB_OK (GB_new (&A, // existing header + scalar->type, vlen, vdim, GB_ph_calloc, is_csc, GxB_AUTO_SPARSITY, + GB_HYPER_SWITCH_DEFAULT, 1, /* OK: */ false, false, false)) ; + info = GB_subassign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),A) + A, false, // A matrix and its descriptor + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + Werk) ; + GB_FREE_ALL ; + } + + return (info) ; +} + diff --git a/GraphBLAS/Source/assign/GB_Vector_assign_scalar.c b/GraphBLAS/Source/assign/GB_Vector_assign_scalar.c new file mode 100644 index 0000000000..fdef96351b --- /dev/null +++ b/GraphBLAS/Source/assign/GB_Vector_assign_scalar.c @@ -0,0 +1,167 @@ +//------------------------------------------------------------------------------ +// GB_Vector_assign_scalar: assign scalar to vector, via scalar expansion +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a vector, w(I) = accum(w(I),x) +// The scalar x is implicitly expanded into a vector u of size nI-by-1, +// with each entry in u equal to x. + +#include "assign/GB_assign.h" +#include "ij/GB_ij.h" +#include "mask/GB_get_mask.h" +#define GB_FREE_ALL GB_Matrix_free (&A) ; + +// If the GrB_Scalar s is non-empty, then this is the same as the non-opapue +// scalar subassignment above. + +// If the GrB_Scalar s is empty of type stype, then this is identical to: +// GrB_Vector_new (&A, stype, nI) ; +// GrB_Vector_assign (w, M, accum, A, I, nI, desc) ; +// GrB_Vector_free (&A) ; + +GrB_Info GB_Vector_assign_scalar // w(I) = accum (w(I),s) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const GrB_Descriptor desc, // descriptor for w and Mask + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_NULL (I) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + + // if w has a user-defined type, its type must match the scalar type + if (w->type->code == GB_UDT_code && w->type != scalar->type) + { + GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" + "cannot be typecast to output of type [%s]", + scalar->type->name, w->type->name) ; + } + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), scalar) + //-------------------------------------------------------------------------- + + uint64_t nvals ; + GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; + + if (M == NULL && !Mask_comp && ni == 1 && !C_replace) + { + + //---------------------------------------------------------------------- + // scalar assignment + //---------------------------------------------------------------------- + + uint64_t row ; + if (I_is_32) + { + const uint32_t *I32 = (uint32_t *) I ; + row = I32 [0] ; + } + else + { + const uint64_t *I64 = (uint64_t *) I ; + row = I64 [0] ; + } + + if (nvals == 1) + { + // set the element: w(row) += scalar or w(row) = scalar + info = GB_setElement ((GrB_Matrix) w, accum, scalar->x, row, 0, + scalar->type->code, Werk) ; + } + else if (accum == NULL) + { + // delete the w(row) element + info = GB_Vector_removeElement (w, row, Werk) ; + } + + } + else if (nvals == 1) + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has a single entry + //---------------------------------------------------------------------- + + // This is identical to non-opaque scalar assignment + + info = GB_assign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask vector and its descriptor + false, // do not transpose the mask + accum, // for accum (w(I),scalar) + NULL, false, // no explicit vector u + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // column indices + true, // do scalar expansion + scalar->x, // scalar to assign, expands to become u + scalar->type->code, // type code of scalar to expand + GB_ASSIGN, + Werk) ; + + } + else + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has no entry + //---------------------------------------------------------------------- + + // determine the properites of the I index list + int64_t nI, Icolon [3] ; + int I_Kind ; + GB_ijlength (I, I_is_32, ni, GB_NROWS (w), &nI, &I_Kind, Icolon) ; + + // create an empty matrix A of the right size, and use matrix assign + struct GB_Matrix_opaque A_header ; + GB_CLEAR_MATRIX_HEADER (A, &A_header) ; + GB_OK (GB_new (&A, // existing header + scalar->type, nI, 1, GB_ph_calloc, true, GxB_AUTO_SPARSITY, + GB_HYPER_SWITCH_DEFAULT, 1, /* OK: */ false, false, false)) ; + info = GB_assign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (w(I),scalar) + A, false, // A matrix and its descriptor + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + GB_ASSIGN, + Werk) ; + GB_FREE_ALL ; + } + + return (info) ; +} + diff --git a/GraphBLAS/Source/assign/GB_Vector_subassign_scalar.c b/GraphBLAS/Source/assign/GB_Vector_subassign_scalar.c new file mode 100644 index 0000000000..a3fdba5609 --- /dev/null +++ b/GraphBLAS/Source/assign/GB_Vector_subassign_scalar.c @@ -0,0 +1,165 @@ +//------------------------------------------------------------------------------ +// GB_Vector_subassign_scalar: assign scalar to vector, via scalar expansion +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x) +// The scalar x is implicitly expanded into a vector u of size nI-by-1, +// with each entry in u equal to x. + +#include "assign/GB_subassign.h" +#include "ij/GB_ij.h" +#include "mask/GB_get_mask.h" +#define GB_FREE_ALL GB_Matrix_free (&A) ; + +// If the GrB_Scalar s is non-empty, then this is the same as the non-opapue +// scalar assignment above. + +// If the GrB_Scalar s is empty of type stype, then this is identical to: +// GrB_Vector_new (&A, stype, nI) ; +// GxB_Vector_subassign (w, M, accum, A, I, nI, desc) ; +// GrB_Vector_free (&A) ; + +GrB_Info GB_Vector_subassign_scalar // w(I)> = accum (w(I),s) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const GrB_Descriptor desc, // descriptor for w and Mask + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_NULL (I) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + + // if w has a user-defined type, its type must match the scalar type + if (w->type->code == GB_UDT_code && w->type != scalar->type) + { + GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" + "cannot be typecast to output of type [%s]", + scalar->type->name, w->type->name) ; + } + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), scalar) + //-------------------------------------------------------------------------- + + uint64_t nvals ; + GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; + + if (M == NULL && !Mask_comp && ni == 1 && !C_replace) + { + + //---------------------------------------------------------------------- + // scalar assignment + //---------------------------------------------------------------------- + + uint64_t row ; + if (I_is_32) + { + const uint32_t *I32 = (uint32_t *) I ; + row = I32 [0] ; + } + else + { + const uint64_t *I64 = (uint64_t *) I ; + row = I64 [0] ; + } + + if (nvals == 1) + { + // set the element: w(row) += scalar or w(wrow) = scalar + info = GB_setElement ((GrB_Matrix) w, accum, scalar->x, row, 0, + scalar->type->code, Werk) ; + } + else if (accum == NULL) + { + // delete the w(row) element + info = GB_Vector_removeElement (w, row, Werk) ; + } + + } + else if (nvals == 1) + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has a single entry + //---------------------------------------------------------------------- + + // This is identical to non-opaque scalar assignment + + info = GB_subassign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask vector and its descriptor + false, // do not transpose the mask + accum, // for accum (w(I),scalar) + NULL, false, // no explicit vector u + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // column indices + true, // do scalar expansion + scalar->x, // scalar to assign, expands to become u + scalar->type->code, // type code of scalar to expand + Werk) ; + + } + else + { + + //---------------------------------------------------------------------- + // the opaque GrB_Scalar has no entry + //---------------------------------------------------------------------- + + // determine the properites of the I index list + int64_t nI, Icolon [3] ; + int I_Kind ; + GB_ijlength (I, I_is_32, ni, GB_NROWS (w), &nI, &I_Kind, Icolon) ; + + // create an empty matrix A of the right size, and use matrix assign + struct GB_Matrix_opaque A_header ; + GB_CLEAR_MATRIX_HEADER (A, &A_header) ; + GB_OK (GB_new (&A, // existing header + scalar->type, nI, 1, GB_ph_calloc, true, GxB_AUTO_SPARSITY, + GB_HYPER_SWITCH_DEFAULT, 1, /* OK: */ false, false, false)) ; + info = GB_subassign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (w(I),scalar) + A, false, // A matrix and its descriptor + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + Werk) ; + GB_FREE_ALL ; + } + + return (info) ; +} + diff --git a/GraphBLAS/Source/assign/GB_assign.c b/GraphBLAS/Source/assign/GB_assign.c index 2d61e52ac9..771fd8b305 100644 --- a/GraphBLAS/Source/assign/GB_assign.c +++ b/GraphBLAS/Source/assign/GB_assign.c @@ -2,7 +2,7 @@ // GB_assign: submatrix assignment: C(Rows,Cols) = accum (C(Rows,Cols),A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,8 @@ GB_Matrix_free (&Mwork) ; \ GB_Matrix_free (&Awork) ; \ GB_Matrix_free (&SubMask) ; \ - GB_FREE_WORK (&I2, I2_size) ; \ - GB_FREE_WORK (&J2, J2_size) ; \ + GB_FREE_MEMORY (&I2, I2_size) ; \ + GB_FREE_MEMORY (&J2, J2_size) ; \ } #include "assign/GB_assign.h" @@ -51,10 +51,12 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix const bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand @@ -71,15 +73,16 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GrB_Matrix C = NULL ; // C_in or Cwork GrB_Matrix M = NULL ; // M_in or Mwork GrB_Matrix A = NULL ; // A_in or Awork - GrB_Index *I = NULL ; // Rows, Cols, or I2 - GrB_Index *J = NULL ; // Rows, Cols, or J2 + void *I = NULL ; // Rows, Cols, or I2 + void *J = NULL ; // Rows, Cols, or J2 + bool I_is_32, J_is_32 ; // temporary matrices and arrays GrB_Matrix Cwork = NULL, Mwork = NULL, Awork = NULL, SubMask = NULL ; struct GB_Matrix_opaque Cwork_header, Mwork_header, Awork_header, MT_header, AT_header, SubMask_header ; - GrB_Index *I2 = NULL ; size_t I2_size = 0 ; - GrB_Index *J2 = NULL ; size_t J2_size = 0 ; + void *I2 = NULL ; size_t I2_size = 0 ; + void *J2 = NULL ; size_t J2_size = 0 ; GrB_Type scalar_type = NULL ; int64_t ni, nj, nI, nJ, Icolon [3], Jcolon [3] ; @@ -90,11 +93,13 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GB_OK (GB_assign_prep (&C, &M, &A, &subassign_method, &Cwork, &Mwork, &Awork, &Cwork_header, &Mwork_header, &Awork_header, &MT_header, &AT_header, - &I, &I2, &I2_size, &ni, &nI, &Ikind, Icolon, - &J, &J2, &J2_size, &nj, &nJ, &Jkind, Jcolon, + &I, &I_is_32, &I2, &I2_size, &ni, &nI, &Ikind, Icolon, + &J, &J_is_32, &J2, &J2_size, &nj, &nJ, &Jkind, Jcolon, &scalar_type, C_in, &C_replace, &assign_kind, M_in, Mask_comp, Mask_struct, M_transpose, accum, - A_in, A_transpose, Rows, nRows_in, Cols, nCols_in, + A_in, A_transpose, + Rows, Rows_is_32, nRows_in, + Cols, Cols_is_32, nCols_in, scalar_expansion, scalar, scalar_code, Werk)) ; ASSERT_MATRIX_OK (C, "initial C for assign", GB0) ; @@ -164,7 +169,8 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // structure, but otherwise C is returned as bitmap. GB_OK (GB_bitmap_assign (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; @@ -196,7 +202,8 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GB_OK (GB_subassigner (C, subassign_method, C_replace, M, Mask_comp, Mask_struct, accum, A, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, scalar_expansion, scalar, scalar_type, Werk)) ; } @@ -208,10 +215,10 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' //------------------------------------------------------------------ ASSERT_MATRIX_OK (M, "big mask", GB0) ; - GB_CLEAR_STATIC_HEADER (SubMask, &SubMask_header) ; + GB_CLEAR_MATRIX_HEADER (SubMask, &SubMask_header) ; - const GrB_Index *I_SubMask = I ; int64_t ni_SubMask = ni ; - const GrB_Index *J_SubMask = J ; int64_t nj_SubMask = nj ; + const void *I_SubMask = I ; int64_t ni_SubMask = ni ; + const void *J_SubMask = J ; int64_t nj_SubMask = nj ; if (assign_kind == GB_ROW_ASSIGN) { @@ -234,8 +241,9 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' } // if Mask_struct is true then SubMask is extracted as iso - GB_OK (GB_subref (SubMask, Mask_struct, - true, M, I_SubMask, ni_SubMask, J_SubMask, nj_SubMask, + GB_OK (GB_subref (SubMask, Mask_struct, true, M, + I_SubMask, I_is_32, ni_SubMask, + J_SubMask, J_is_32, nj_SubMask, false, Werk)) ; // GB_subref can return a jumbled result @@ -257,7 +265,8 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GB_OK (GB_subassigner (C, subassign_method, C_replace, SubMask, Mask_comp, Mask_struct, accum, A, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, scalar_expansion, scalar, scalar_type, Werk)) ; GB_Matrix_free (&SubMask) ; @@ -305,8 +314,11 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // delete entries outside C(I,J) for which M(i,j) is false //------------------------------------------------------------------ - // C must be sparse or hypersparse - GB_ENSURE_SPARSE (C) ; + // C must be sparse or hypersparse; convert full/bitmap to sparse + if (GB_IS_BITMAP (C) || GB_IS_FULL (C)) + { + GB_OK (GB_convert_any_to_sparse (C, Werk)) ; + } if (assign_kind == GB_COL_ASSIGN) { @@ -318,12 +330,13 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // M is a single column so it is never hypersparse ASSERT (nJ == 1) ; ASSERT (M->vlen == C->vlen && M->vdim == 1 && M->h == NULL) ; - int64_t j = GB_ijlist (J, 0, Jkind, Jcolon) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + int64_t j = GB_IJLIST (J, 0, Jkind, Jcolon) ; GBURBLE ("assign zombies outside C(I,j) ") ; GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (C, Werk)) ; GB_OK (GB_assign_zombie3 (C, M, Mask_comp, Mask_struct, - j, I, nI, Ikind, Icolon)) ; + j, I, I_is_32, nI, Ikind, Icolon)) ; } else if (assign_kind == GB_ROW_ASSIGN) @@ -337,13 +350,14 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // M s a single row with vlen == 1 and the same vdim as C ASSERT (nI == 1) ; ASSERT (M->vlen == 1 && M->vdim == C->vdim) ; - int64_t i = GB_ijlist (I, 0, Ikind, Icolon) ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + int64_t i = GB_IJLIST (I, 0, Ikind, Icolon) ; GBURBLE ("assign zombies outside C(i,J) ") ; GB_UNJUMBLE (C) ; GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (M, Werk)) ; GB_OK (GB_assign_zombie4 (C, M, Mask_comp, Mask_struct, - i, J, nJ, Jkind, Jcolon)) ; + i, J, J_is_32, nJ, Jkind, Jcolon)) ; } else @@ -359,9 +373,10 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (M, Werk)) ; GB_OK (GB_assign_zombie5 (C, M, Mask_comp, Mask_struct, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, Werk)) ; + I, I_is_32, nI, Ikind, Icolon, + J, J_is_32, nJ, Jkind, Jcolon, Werk)) ; } - ASSERT_MATRIX_OK (C, "C for C-replace-phase done", GB_ZOMBIE (GB0)) ; + ASSERT_MATRIX_OK (C, "C for C-replace-phase done", GB0_Z) ; } } diff --git a/GraphBLAS/Source/assign/GB_assign.h b/GraphBLAS/Source/assign/GB_assign.h index c81f4b398c..a86aeaed99 100644 --- a/GraphBLAS/Source/assign/GB_assign.h +++ b/GraphBLAS/Source/assign/GB_assign.h @@ -2,7 +2,7 @@ // GB_assign.h: definitions for GB_assign and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ #include "GB.h" #include "math/GB_math.h" -GrB_Info GB_assign // C(Rows,Cols) += A or A' +GrB_Info GB_assign // C(I,J) += A or A' ( GrB_Matrix C, // input/output matrix for results bool C_replace, // descriptor for C @@ -23,10 +23,12 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix const bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *I, // row indices + const bool I_is_32, // if true, I is 32-bit; else 64-bit + const uint64_t nI_in, // number of row indices + const void *J, // column indices + const bool J_is_32, // if true, J is 32-bit; else 64-bit + const uint64_t nJ_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand @@ -34,19 +36,51 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' GB_Werk Werk ) ; -GrB_Info GB_assign_scalar // C(Rows,Cols) += x +GrB_Info GB_assign_scalar // C(I,J) += x ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M, // mask for C(Rows,Cols), unused if NULL - const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) - const void *scalar, // scalar to assign to C(Rows,Cols) + const GrB_Matrix M, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) + const void *scalar, // scalar to assign to C(I,J) const GB_Type_code scalar_code, // type code of scalar to assign - const GrB_Index *Rows, // row indices - const GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols, // number of column indices + const void *I, // row indices + const bool I_is_32, // if true, I is 32-bit; else 64-bit + const uint64_t nI, // number of row indices + const void *J, // column indices + const bool J_is_32, // if true, J is 32-bit; else 64-bit + const uint64_t nJ, // number of column indices const GrB_Descriptor desc, // descriptor for C and M GB_Werk Werk ) ; +GrB_Info GB_Matrix_assign_scalar // C(I,J) = accum (C(I,J),s) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const void *J, // column indices + const bool J_is_32, + uint64_t nj, // number of column indices + const GrB_Descriptor desc, + GB_Werk Werk +) ; + +GrB_Info GB_Vector_assign_scalar // w(I) = accum (w(I),s) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const GrB_Descriptor desc, // descriptor for w and Mask + GB_Werk Werk +) ; + #endif + diff --git a/GraphBLAS/Source/assign/GB_assign_burble.c b/GraphBLAS/Source/assign/GB_assign_burble.c index 790f956f90..f9f41c3ce5 100644 --- a/GraphBLAS/Source/assign/GB_assign_burble.c +++ b/GraphBLAS/Source/assign/GB_assign_burble.c @@ -2,7 +2,7 @@ // GB_assign_burble.c: burble the assign method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/GB_assign_describe.c b/GraphBLAS/Source/assign/GB_assign_describe.c index 05e8602bae..af1b318817 100644 --- a/GraphBLAS/Source/assign/GB_assign_describe.c +++ b/GraphBLAS/Source/assign/GB_assign_describe.c @@ -2,7 +2,7 @@ // GB_assign_describe: construct a string that describes GrB_assign / subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,13 +18,11 @@ void GB_assign_describe const bool C_replace, // descriptor for C const int Ikind, const int Jkind, -// const GrB_Matrix M, const bool M_is_null, const int M_sparsity, const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here -// const GrB_Matrix A, // input matrix, not transposed const bool A_is_null, const int assign_kind // row assign, col assign, assign, or subassign ) @@ -35,24 +33,24 @@ void GB_assign_describe //-------------------------------------------------------------------------- str [0] = '\0' ; - char *Op ; + char *op_str ; if (accum == NULL) { // no accum operator is present - Op = "" ; + op_str = "" ; } else { // use a simpler version of accum->name - if (accum->opcode == GB_USER_binop_code) Op = "op" ; - else if (GB_STRING_MATCH (accum->name, "plus")) Op = "+" ; - else if (GB_STRING_MATCH (accum->name, "minus")) Op = "-" ; - else if (GB_STRING_MATCH (accum->name, "times")) Op = "*" ; - else if (GB_STRING_MATCH (accum->name, "div")) Op = "/" ; - else if (GB_STRING_MATCH (accum->name, "or")) Op = "|" ; - else if (GB_STRING_MATCH (accum->name, "and")) Op = "&" ; - else if (GB_STRING_MATCH (accum->name, "xor")) Op = "^" ; - else Op = accum->name ; + if (accum->opcode == GB_USER_binop_code) op_str = "op" ; + else if (GB_STRING_MATCH (accum->name, "plus")) op_str = "+" ; + else if (GB_STRING_MATCH (accum->name, "minus")) op_str = "-" ; + else if (GB_STRING_MATCH (accum->name, "times")) op_str = "*" ; + else if (GB_STRING_MATCH (accum->name, "div")) op_str = "/" ; + else if (GB_STRING_MATCH (accum->name, "or")) op_str = "|" ; + else if (GB_STRING_MATCH (accum->name, "and")) op_str = "&" ; + else if (GB_STRING_MATCH (accum->name, "xor")) op_str = "^" ; + else op_str = accum->name ; } //-------------------------------------------------------------------------- @@ -107,12 +105,12 @@ void GB_assign_describe { case GB_ROW_ASSIGN : // C(i,J) = A - snprintf (str, slen, "C%s(i,%s) %s= A ", Mask, Jstr, Op) ; + snprintf (str, slen, "C%s(i,%s) %s= A ", Mask, Jstr, op_str) ; break ; case GB_COL_ASSIGN : // C(I,j) = A - snprintf (str, slen, "C%s(%s,j) %s= A ", Mask, Istr, Op) ; + snprintf (str, slen, "C%s(%s,j) %s= A ", Mask, Istr, op_str) ; break ; case GB_ASSIGN : @@ -120,13 +118,13 @@ void GB_assign_describe if (Ikind == GB_ALL && Jkind == GB_ALL) { // C += A - snprintf (str, slen, "C%s %s= %s ", Mask, Op, S) ; + snprintf (str, slen, "C%s %s= %s ", Mask, op_str, S) ; } else { // C(I,J) = A snprintf (str, slen, "C%s(%s,%s) %s= %s ", Mask, Istr, Jstr, - Op, S) ; + op_str, S) ; } break ; @@ -135,13 +133,13 @@ void GB_assign_describe if (Ikind == GB_ALL && Jkind == GB_ALL) { // C += A - snprintf (str, slen, "C%s %s= %s ", Mask, Op, S) ; + snprintf (str, slen, "C%s %s= %s ", Mask, op_str, S) ; } else { // C(I,J) = A snprintf (str, slen, "C(%s,%s)%s %s= %s ", Istr, Jstr, Mask, - Op, S) ; + op_str, S) ; } break ; diff --git a/GraphBLAS/Source/assign/GB_assign_prep.c b/GraphBLAS/Source/assign/GB_assign_prep.c index 3969225290..7b1a5e36da 100644 --- a/GraphBLAS/Source/assign/GB_assign_prep.c +++ b/GraphBLAS/Source/assign/GB_assign_prep.c @@ -2,7 +2,7 @@ // GB_assign_prep: check and prepare inputs for GB_assign and GB_subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,7 @@ #include "assign/GB_subassign_methods.h" #include "transpose/GB_transpose.h" #include "extract/GB_subref.h" +#include "include/GB_unused.h" #undef GB_FREE_ALL #define GB_FREE_ALL \ @@ -24,10 +25,10 @@ GB_Matrix_free (&AT) ; \ GB_Matrix_free (&Mwork) ; \ GB_Matrix_free (&MT) ; \ - GB_FREE_WORK (&I2, I2_size) ; \ - GB_FREE_WORK (&J2, J2_size) ; \ - GB_FREE_WORK (&I2k, I2k_size) ; \ - GB_FREE_WORK (&J2k, J2k_size) ; \ + GB_FREE_MEMORY (&I2, I2_size) ; \ + GB_FREE_MEMORY (&J2, J2_size) ; \ + GB_FREE_MEMORY (&I2k, I2k_size) ; \ + GB_FREE_MEMORY (&J2k, J2k_size) ; \ } GrB_Info GB_assign_prep @@ -51,16 +52,18 @@ GrB_Info GB_assign_prep GrB_Matrix AT_header_handle, // modified versions of the Rows/Cols lists, and their analysis: - GrB_Index **I_handle, // Rows, Cols, or a modified copy I2 - GrB_Index **I2_handle, // NULL, or sorted/pruned Rows or Cols + void **I_handle, // Rows, Cols, or a modified copy I2 + bool *I_is_32_handle, + void **I2_handle, // NULL, or sorted/pruned Rows or Cols size_t *I2_size_handle, int64_t *ni_handle, int64_t *nI_handle, int *Ikind_handle, int64_t Icolon [3], - GrB_Index **J_handle, // Rows, Cols, or a modified copy J2 - GrB_Index **J2_handle, // NULL, or sorted/pruned Rows or Cols + void **J_handle, // Rows, Cols, or a modified copy J2 + bool *J_is_32_handle, + void **J2_handle, // NULL, or sorted/pruned Rows or Cols size_t *J2_size_handle, int64_t *nj_handle, int64_t *nJ_handle, @@ -82,10 +85,12 @@ GrB_Info GB_assign_prep const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand @@ -118,10 +123,11 @@ GrB_Info GB_assign_prep GrB_Matrix MT = NULL ; GrB_Matrix AT = NULL ; - GrB_Index *I2 = NULL ; size_t I2_size = 0 ; - GrB_Index *J2 = NULL ; size_t J2_size = 0 ; - GrB_Index *I2k = NULL ; size_t I2k_size = 0 ; - GrB_Index *J2k = NULL ; size_t J2k_size = 0 ; + void *I2 = NULL ; size_t I2_size = 0 ; + void *J2 = NULL ; size_t J2_size = 0 ; + void *I2k = NULL ; size_t I2k_size = 0 ; + void *J2k = NULL ; size_t J2k_size = 0 ; + (*scalar_type_handle) = NULL ; (*Chandle) = NULL ; @@ -240,8 +246,10 @@ GrB_Info GB_assign_prep int64_t nRows, nCols, RowColon [3], ColColon [3] ; int RowsKind, ColsKind ; - GB_ijlength (Rows, nRows_in, GB_NROWS (C), &nRows, &RowsKind, RowColon) ; - GB_ijlength (Cols, nCols_in, GB_NCOLS (C), &nCols, &ColsKind, ColColon) ; + GB_ijlength (Rows, Rows_is_32, nRows_in, GB_NROWS (C), &nRows, &RowsKind, + RowColon) ; + GB_ijlength (Cols, Cols_is_32, nCols_in, GB_NCOLS (C), &nCols, &ColsKind, + ColColon) ; //-------------------------------------------------------------------------- // check the dimensions of M @@ -378,7 +386,8 @@ GrB_Info GB_assign_prep // get the I and J index lists int Ikind, Jkind ; - const GrB_Index *I, *J ; + GB_MDECL (I, const, u) ; + GB_MDECL (J, const, u) ; int64_t ni, nj, nI, nJ ; if (C_is_csc) @@ -413,6 +422,11 @@ GrB_Info GB_assign_prep } } + bool I_is_32 = (C_is_csc) ? Rows_is_32 : Cols_is_32 ; + bool J_is_32 = (C_is_csc) ? Cols_is_32 : Rows_is_32 ; + GB_IPTR (I, I_is_32) ; + GB_IPTR (J, J_is_32) ; + // J is now a list of vectors in the range 0:C->vdim-1 // I is now a list of indices in the range 0:C->vlen-1 @@ -481,8 +495,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(i,:)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - I, 1, 1, GB_LIST, NULL, // I = [i] - NULL, 0, 0, GB_ALL, NULL, // J = [:] + I, I_is_32, 1, 1, GB_LIST, NULL, // I = [i] + NULL, false , 0, 0, GB_ALL, NULL, // J = [:] /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, @@ -494,9 +508,13 @@ GrB_Info GB_assign_prep else { GB_UNJUMBLE (C) ; - GB_ENSURE_SPARSE (C) ; + // ensure C is sparse; wait(C) may change it + if (GB_IS_BITMAP (C) || GB_IS_FULL (C)) + { + GB_OK (GB_convert_any_to_sparse (C, Werk)) ; + } GBURBLE ("C(i,:)=zombie ") ; - GB_OK (GB_assign_zombie2 (C, I [0])) ; + GB_OK (GB_assign_zombie2 (C, GB_IGET (I, 0))) ; } } break ; @@ -515,8 +533,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(:,j)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - NULL, 0, 0, GB_ALL, NULL, // I = [:] - J, 1, 1, GB_LIST, NULL, // J = [j] + NULL, false , 0, 0, GB_ALL, NULL, // I = [:] + J, J_is_32, 1, 1, GB_LIST, NULL, // J = [j] /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, @@ -527,10 +545,14 @@ GrB_Info GB_assign_prep } else { - GB_ENSURE_SPARSE (C) ; + // ensure C is sparse; wait(C) may change it + if (GB_IS_BITMAP (C) || GB_IS_FULL (C)) + { + GB_OK (GB_convert_any_to_sparse (C, Werk)) ; + } GBURBLE ("C(:,j)=zombie ") ; GB_OK (GB_hyper_hash_build (C, Werk)) ; - GB_OK (GB_assign_zombie1 (C, J [0])) ; + GB_OK (GB_assign_zombie1 (C, GB_IGET (J, 0))) ; } } break ; @@ -566,8 +588,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(I,J)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, @@ -580,10 +602,14 @@ GrB_Info GB_assign_prep { // Method 00: C(I,J) = empty, using S GBURBLE ("C(I,J)=zombie ") ; - GB_ENSURE_SPARSE (C) ; + // ensure C is sparse; wait(C) may change it + if (GB_IS_BITMAP (C) || GB_IS_FULL (C)) + { + GB_OK (GB_convert_any_to_sparse (C, Werk)) ; + } GB_OK (GB_subassign_zombie (C, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, Werk)) ; + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, Werk)) ; } } break ; @@ -677,7 +703,7 @@ GrB_Info GB_assign_prep // TODO: if accum is present and it does not depend on the values of // A, construct AT as iso. GBURBLE ("(A transpose) ") ; - GB_CLEAR_STATIC_HEADER (AT, AT_header_handle) ; + GB_CLEAR_MATRIX_HEADER (AT, AT_header_handle) ; GB_OK (GB_transpose_cast (AT, A->type, C_is_csc, A, false, Werk)) ; GB_MATRIX_WAIT (AT) ; // A cannot be jumbled A = AT ; @@ -706,7 +732,7 @@ GrB_Info GB_assign_prep // MT = M' to conform M to the same CSR/CSC format as C, // and typecast to boolean. GBURBLE ("(M transpose) ") ; - GB_CLEAR_STATIC_HEADER (MT, MT_header_handle) ; + GB_CLEAR_MATRIX_HEADER (MT, MT_header_handle) ; GB_OK (GB_transpose_cast (MT, GrB_BOOL, C_is_csc, M, Mask_struct, Werk)) ; GB_MATRIX_WAIT (MT) ; // M cannot be jumbled @@ -724,9 +750,9 @@ GrB_Info GB_assign_prep bool I_unsorted, I_has_dupl, I_contig, J_unsorted, J_has_dupl, J_contig ; int64_t imin, imax, jmin, jmax ; - GB_OK (GB_ijproperties (I, ni, nI, C->vlen, &Ikind, Icolon, + GB_OK (GB_ijproperties (I, I_is_32, ni, nI, C->vlen, &Ikind, Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Werk)) ; - GB_OK (GB_ijproperties (J, nj, nJ, C->vdim, &Jkind, Jcolon, + GB_OK (GB_ijproperties (J, J_is_32, nj, nJ, C->vdim, &Jkind, Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Werk)) ; //-------------------------------------------------------------------------- @@ -798,45 +824,65 @@ GrB_Info GB_assign_prep ASSERT (Ikind == GB_LIST || Jkind == GB_LIST) ; ASSERT (!whole_C_matrix) ; + bool I2k_is_32 = false ; + bool J2k_is_32 = false ; if (I_unsorted_or_has_dupl) { // I2 = sort I and remove duplicates + bool I2_is_32 ; + int64_t ni2 ; ASSERT (Ikind == GB_LIST) ; - GB_OK (GB_ijsort (I, &ni, &I2, &I2_size, &I2k, &I2k_size)); + GB_OK (GB_ijsort (I, I_is_32, ni, imax, + &ni2, &I2 , &I2_is_32 , &I2_size, + &I2k, &I2k_is_32, &I2k_size, Werk)) ; // Recheck the length and properties of the new I2. This may // convert I2 to GB_ALL or GB_RANGE, after I2 has been sorted. - GB_ijlength (I2, ni, C->vlen, &nI, &Ikind, Icolon) ; - GB_OK (GB_ijproperties (I2, ni, nI, C->vlen, &Ikind, Icolon, - &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Werk)) ; + GB_ijlength (I2, I2_is_32, ni2, C->vlen, &nI, &Ikind, Icolon) ; + GB_OK (GB_ijproperties (I2, I2_is_32, ni2, nI, C->vlen, &Ikind, + Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, + Werk)) ; ASSERT (! (I_unsorted || I_has_dupl)) ; + // replace I with I2 I = I2 ; + ni = ni2 ; + I_is_32 = I2_is_32 ; } if (J_unsorted_or_has_dupl) { // J2 = sort J and remove duplicates + bool J2_is_32 ; + int64_t nj2 ; ASSERT (Jkind == GB_LIST) ; - GB_OK (GB_ijsort (J, &nj, &J2, &J2_size, &J2k, &J2k_size)); + GB_OK (GB_ijsort (J, J_is_32, nj, jmax, + &nj2, &J2 , &J2_is_32 , &J2_size, + &J2k, &J2k_is_32, &J2k_size, Werk)) ; // Recheck the length and properties of the new J2. This may // convert J2 to GB_ALL or GB_RANGE, after J2 has been sorted. - GB_ijlength (J2, nj, C->vdim, &nJ, &Jkind, Jcolon) ; - GB_OK (GB_ijproperties (J2, nj, nJ, C->vdim, &Jkind, Jcolon, - &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Werk)) ; + GB_ijlength (J2, J2_is_32, nj2, C->vdim, &nJ, &Jkind, Jcolon) ; + GB_OK (GB_ijproperties (J2, J2_is_32, nj2, nJ, C->vdim, &Jkind, + Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, + Werk)) ; ASSERT (! (J_unsorted || J_has_dupl)) ; + // replace J with J2 J = J2 ; + nj = nj2 ; + J_is_32 = J2_is_32 ; } // inverse index lists to create the Awork and Mwork submatrices: - const GrB_Index *Iinv = I_unsorted_or_has_dupl ? I2k : GrB_ALL ; - const GrB_Index *Jinv = J_unsorted_or_has_dupl ? J2k : GrB_ALL ; + const void *Iinv = I_unsorted_or_has_dupl ? I2k : GrB_ALL ; + const void *Jinv = J_unsorted_or_has_dupl ? J2k : GrB_ALL ; if (!scalar_expansion) { // Awork = A (Iinv, Jinv) - GB_CLEAR_STATIC_HEADER (Awork, Awork_header_handle) ; - GB_OK (GB_subref (Awork, false, // TODO::: make A if accum is PAIR - A->is_csc, A, Iinv, ni, Jinv, nj, false, Werk)) ; + GB_CLEAR_MATRIX_HEADER (Awork, Awork_header_handle) ; + GB_OK (GB_subref (Awork, false, A->is_csc, A, + Iinv, I2k_is_32, ni, + Jinv, J2k_is_32, nj, + false, Werk)) ; // GB_subref can return a jumbled result ASSERT (GB_JUMBLED_OK (Awork)) ; if (A == AT) @@ -851,9 +897,11 @@ GrB_Info GB_assign_prep { // Mwork = M (Iinv, Jinv) // if Mask_struct then Mwork is extracted as iso - GB_CLEAR_STATIC_HEADER (Mwork, Mwork_header_handle) ; - GB_OK (GB_subref (Mwork, Mask_struct, - M->is_csc, M, Iinv, ni, Jinv, nj, false, Werk)) ; + GB_CLEAR_MATRIX_HEADER (Mwork, Mwork_header_handle) ; + GB_OK (GB_subref (Mwork, Mask_struct, M->is_csc, M, + Iinv, I2k_is_32, ni, + Jinv, J2k_is_32, nj, + false, Werk)) ; // GB_subref can return a jumbled result ASSERT (GB_JUMBLED_OK (Mwork)) ; if (M == MT) @@ -864,8 +912,8 @@ GrB_Info GB_assign_prep M = Mwork ; } - GB_FREE_WORK (&I2k, I2k_size) ; - GB_FREE_WORK (&J2k, J2k_size) ; + GB_FREE_MEMORY (&I2k, I2k_size) ; + GB_FREE_MEMORY (&J2k, J2k_size) ; } // I and J are now sorted, with no duplicate entries. They are either @@ -981,14 +1029,15 @@ GrB_Info GB_assign_prep else if (C_aliased) { // C is aliased with M or A: make a copy of C to assign into - GB_CLEAR_STATIC_HEADER (Cwork, Cwork_header_handle) ; + GB_CLEAR_MATRIX_HEADER (Cwork, Cwork_header_handle) ; if (C_replace_may_be_done_early) { // Instead of duplicating C, create a new empty matrix Cwork. int sparsity = (C->h != NULL) ? GxB_HYPERSPARSE : GxB_SPARSE ; GB_OK (GB_new (&Cwork, // sparse or hyper, existing header - ctype, C->vlen, C->vdim, GB_Ap_calloc, C_is_csc, - sparsity, C->hyper_switch, 1)) ; + ctype, C->vlen, C->vdim, GB_ph_calloc, C_is_csc, + sparsity, C->hyper_switch, 1, + C->p_is_32, C->j_is_32, C->i_is_32)) ; GBURBLE ("(C alias cleared; C_replace early) ") ; (*C_replace) = false ; } @@ -1006,7 +1055,7 @@ GrB_Info GB_assign_prep } // Cwork must be transplanted back into C when done C = Cwork ; - ASSERT (C->static_header || GBNSTATIC) ; + ASSERT (C->header_size == 0 || GBNSTATIC) ; } else { @@ -1178,8 +1227,7 @@ GrB_Info GB_assign_prep // C has changed so recompute the subassigner method (*subassign_method) = GB_subassigner_method (&C_iso_out, cout, C, (*C_replace), M, Mask_comp, Mask_struct, accum, A, Ikind, Jkind, - nJ, J, /* FUTURE: Jcolon, */ - scalar_expansion, scalar, scalar_type) ; + nJ, Jcolon, scalar_expansion, scalar, scalar_type) ; } ASSERT_MATRIX_OK (C, "C before subassign", GB0) ; @@ -1256,19 +1304,21 @@ GrB_Info GB_assign_prep (*scalar_type_handle) = scalar_type ; // may be NULL // modified versions of the Rows/Cols lists, and their analysis: - (*I_handle) = (GrB_Index *) I ; // either Rows, Cols, or I2 - (*I2_handle) = I2 ; // temporary sorted copy of Rows or Cols list + (*I_handle ) = (void *) I ; // either Rows, Cols, or I2 + (*I_is_32_handle) = I_is_32 ; + (*I2_handle ) = I2 ; // temporary sorted copy of Rows/Cols list (*I2_size_handle) = I2_size ; - (*ni_handle) = ni ; - (*nI_handle) = nI ; - (*Ikind_handle) = Ikind ; + (*ni_handle ) = ni ; + (*nI_handle ) = nI ; + (*Ikind_handle ) = Ikind ; - (*J_handle) = (GrB_Index *) J ; // either Rows, Cols, or J2 - (*J2_handle) = J2 ; // temporary sorted copy of Rows or Cols list + (*J_handle ) = (void *) J ; // either Rows, Cols, or J2 + (*J_is_32_handle) = J_is_32 ; + (*J2_handle ) = J2 ; // temporary sorted copy of Rows/Cols list (*J2_size_handle) = J2_size ; - (*nj_handle) = nj ; - (*nJ_handle) = nJ ; - (*Jkind_handle) = Jkind ; + (*nj_handle ) = nj ; + (*nJ_handle ) = nJ ; + (*Jkind_handle ) = Jkind ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/assign/GB_assign_scalar.c b/GraphBLAS/Source/assign/GB_assign_scalar.c index 1e4511cdb8..855468fb8b 100644 --- a/GraphBLAS/Source/assign/GB_assign_scalar.c +++ b/GraphBLAS/Source/assign/GB_assign_scalar.c @@ -2,7 +2,7 @@ // GB_assign_scalar: C(Rows,Cols) = accum (C(Rows,Cols),x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,12 @@ GrB_Info GB_assign_scalar // C(Rows,Cols) += x const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) const void *scalar, // scalar to assign to C(Rows,Cols) const GB_Type_code scalar_code, // type code of scalar to assign - const GrB_Index *Rows, // row indices - const GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Cols is 32-bit; else 64-bit + const uint64_t nCols, // number of column indices const GrB_Descriptor desc, // descriptor for C and M GB_Werk Werk ) @@ -44,9 +46,11 @@ GrB_Info GB_assign_scalar // C(Rows,Cols) += x GB_RETURN_IF_NULL (scalar) ; GB_RETURN_IF_NULL (Rows) ; GB_RETURN_IF_NULL (Cols) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; ASSERT (scalar_code <= GB_UDT_code) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx1, xx2, xx3, xx7) ; @@ -60,8 +64,10 @@ GrB_Info GB_assign_scalar // C(Rows,Cols) += x if (M == NULL && !Mask_comp && nRows == 1 && nCols == 1 && !C_replace) { // C(i,j) = scalar or C(i,j) += scalar - return (GB_setElement (C, accum, scalar, Rows [0], Cols [0], - scalar_code, Werk)) ; + GB_IDECL (Rows, const, u) ; GB_IPTR (Rows, Rows_is_32) ; + GB_IDECL (Cols, const, u) ; GB_IPTR (Cols, Cols_is_32) ; + return (GB_setElement (C, accum, scalar, + GB_IGET (Rows, 0), GB_IGET (Cols, 0), scalar_code, Werk)) ; } else { @@ -71,8 +77,8 @@ GrB_Info GB_assign_scalar // C(Rows,Cols) += x false, // do not transpose the mask accum, // for accum (C(Rows,Cols),scalar) NULL, false, // no explicit matrix A - Rows, nRows, // row indices - Cols, nCols, // column indices + Rows, Rows_is_32, nRows, // row indices + Cols, Cols_is_32, nCols, // column indices true, // do scalar expansion scalar, // scalar to assign, expands to become A scalar_code, // type code of scalar to expand diff --git a/GraphBLAS/Source/assign/GB_assign_zombie.h b/GraphBLAS/Source/assign/GB_assign_zombie.h index 0bfd692b97..9853a6087f 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie.h +++ b/GraphBLAS/Source/assign/GB_assign_zombie.h @@ -2,7 +2,7 @@ // GB_assign_zombie.h: definitions for GB_assign_zombie* functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,12 +25,13 @@ GrB_Info GB_assign_zombie2 GrB_Info GB_assign_zombie3 ( - GrB_Matrix C, + GrB_Matrix C, // the matrix C, or a copy const GrB_Matrix M, const bool Mask_comp, - const bool Mask_struct, // if true, use the only structure of M - const int64_t j, - const GrB_Index *I, + const bool Mask_struct, + const int64_t j, // vector index with entries to delete + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3] @@ -43,7 +44,8 @@ GrB_Info GB_assign_zombie4 const bool Mask_comp, const bool Mask_struct, // if true, use the only structure of M const int64_t i, - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3] @@ -51,15 +53,17 @@ GrB_Info GB_assign_zombie4 GrB_Info GB_assign_zombie5 ( - GrB_Matrix C, + GrB_Matrix C, // the matrix C, or a copy const GrB_Matrix M, const bool Mask_comp, - const bool Mask_struct, // if true, use the only structure of M - const GrB_Index *I, + const bool Mask_struct, + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], diff --git a/GraphBLAS/Source/assign/GB_assign_zombie1.c b/GraphBLAS/Source/assign/GB_assign_zombie1.c index 4e2b4a2c01..1b4713ef8c 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie1.c +++ b/GraphBLAS/Source/assign/GB_assign_zombie1.c @@ -2,7 +2,7 @@ // GB_assign_zombie1: delete all entries in C(:,j) for GB_assign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,27 +37,28 @@ GrB_Info GB_assign_zombie1 // get C(:,j) //-------------------------------------------------------------------------- - int64_t *restrict Ci = C->i ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + const void *Ch = C->h ; int64_t pC_start, pC_end ; const int64_t Cnvec = C->nvec ; if (Ch != NULL) { // C is hypersparse - const int64_t *restrict C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; - const int64_t *restrict C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; - const int64_t *restrict C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; + const void *C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; + const void *C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; + const void *C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; const int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; - GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, + GB_hyper_hash_lookup (C->p_is_32, C->j_is_32, + Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; } else { // C is sparse - pC_start = Cp [j] ; - pC_end = Cp [j+1] ; + pC_start = GB_IGET (Cp, j) ; + pC_end = GB_IGET (Cp, j+1) ; } int64_t cjnz = pC_end - pC_start ; @@ -80,12 +81,13 @@ GrB_Info GB_assign_zombie1 reduction(+:nzombies) for (pC = pC_start ; pC < pC_end ; pC++) { - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; if (!GB_IS_ZOMBIE (i)) { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } diff --git a/GraphBLAS/Source/assign/GB_assign_zombie2.c b/GraphBLAS/Source/assign/GB_assign_zombie2.c index 5be9b40587..0f915420cb 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie2.c +++ b/GraphBLAS/Source/assign/GB_assign_zombie2.c @@ -2,7 +2,7 @@ // GB_assign_zombie2: delete all entries in C(i,:) for GB_assign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,11 +37,11 @@ GrB_Info GB_assign_zombie2 // get C //-------------------------------------------------------------------------- - const int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; const int64_t Cnvec = C->nvec ; int64_t nzombies = C->nzombies ; - const int64_t zorig = nzombies ; + const bool Ci_is_32 = C->i_is_32 ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -70,12 +70,12 @@ GrB_Info GB_assign_zombie2 // find C(i,j) //------------------------------------------------------------------ - int64_t pC = Cp [k] ; - int64_t pC_end = Cp [k+1] ; + int64_t pC = GB_IGET (Cp, k) ; + int64_t pC_end = GB_IGET (Cp, k+1) ; int64_t pright = pC_end - 1 ; - bool found, is_zombie ; - GB_BINARY_SEARCH_ZOMBIE (i, Ci, pC, pright, found, zorig, - is_zombie) ; + bool is_zombie ; + bool found = GB_binary_search_zombie (i, Ci, Ci_is_32, &pC, &pright, + true, &is_zombie) ; //------------------------------------------------------------------ // if found and not a zombie, mark it as a zombie @@ -83,9 +83,10 @@ GrB_Info GB_assign_zombie2 if (found && !is_zombie) { - ASSERT (i == Ci [pC]) ; + ASSERT (i == GB_IGET (Ci, pC)) ; nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + int64_t iC = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, iC) ; // Ci [pC] = iC ; } } } diff --git a/GraphBLAS/Source/assign/GB_assign_zombie3.c b/GraphBLAS/Source/assign/GB_assign_zombie3.c index 9176d9cfa2..fd481cd487 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie3.c +++ b/GraphBLAS/Source/assign/GB_assign_zombie3.c @@ -2,7 +2,7 @@ // GB_assign_zombie3: delete entries in C(:,j) for C_replace_phase //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,8 @@ GrB_Info GB_assign_zombie3 const bool Mask_comp, const bool Mask_struct, const int64_t j, // vector index with entries to delete - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3] @@ -64,27 +65,31 @@ GrB_Info GB_assign_zombie3 // get C (:,j) //-------------------------------------------------------------------------- - int64_t *restrict Ci = C->i ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; int64_t pC_start, pC_end ; const int64_t Cnvec = C->nvec ; + const bool Cp_is_32 = C->p_is_32 ; + const bool Cj_is_32 = C->j_is_32 ; + const bool Ci_is_32 = C->i_is_32 ; if (Ch != NULL) { // C is hypersparse - const int64_t *restrict C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; - const int64_t *restrict C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; - const int64_t *restrict C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; + const void *C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; + const void *C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; + const void *C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; const int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; - GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, + GB_hyper_hash_lookup (Cp_is_32, Cj_is_32, + Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; } else { // C is sparse - pC_start = Cp [j] ; - pC_end = Cp [j+1] ; + pC_start = GB_IGET (Cp, j) ; + pC_end = GB_IGET (Cp, j+1) ; } int64_t nzombies = C->nzombies ; @@ -94,16 +99,19 @@ GrB_Info GB_assign_zombie3 // get M(:,0) //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; const size_t msize = M->type->size ; const int64_t Mvlen = M->vlen ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; + const bool Mi_is_32 = M->i_is_32 ; int64_t pM_start = 0 ; // Mp [0] - int64_t pM_end = GBP_M (Mp, 1, Mvlen) ; + int64_t pM_end = GBp_M (Mp, 1, Mvlen) ; const bool mjdense = (pM_end - pM_start) == Mvlen ; //-------------------------------------------------------------------------- @@ -133,7 +141,7 @@ GrB_Info GB_assign_zombie3 // get C(i,j) //------------------------------------------------------------------ - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; if (!GB_IS_ZOMBIE (i)) { @@ -141,7 +149,8 @@ GrB_Info GB_assign_zombie3 // C(i,j) is outside C(I,j) if i is not in the list I //-------------------------------------------------------------- - bool i_outside = !GB_ij_is_in_list (I, nI, i, Ikind, Icolon) ; + bool i_outside = !GB_ij_is_in_list (I, I_is_32, nI, i, Ikind, + Icolon) ; if (i_outside) { @@ -160,7 +169,8 @@ GrB_Info GB_assign_zombie3 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } } diff --git a/GraphBLAS/Source/assign/GB_assign_zombie4.c b/GraphBLAS/Source/assign/GB_assign_zombie4.c index 673acfa9e1..87b0ff02b9 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie4.c +++ b/GraphBLAS/Source/assign/GB_assign_zombie4.c @@ -2,7 +2,7 @@ // GB_assign_zombie4: delete entries in C(i,:) for C_replace_phase //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,12 +28,13 @@ GrB_Info GB_assign_zombie4 ( - GrB_Matrix C, // the matrix C, or a copy + GrB_Matrix C, const GrB_Matrix M, const bool Mask_comp, - const bool Mask_struct, - const int64_t i, // index of entries to delete - const GrB_Index *J, + const bool Mask_struct, // if true, use the only structure of M + const int64_t i, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3] @@ -58,20 +59,20 @@ GrB_Info GB_assign_zombie4 // get C //-------------------------------------------------------------------------- - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; const int64_t Cnvec = C->nvec ; - int64_t *restrict Ci = C->i ; int64_t nzombies = C->nzombies ; - const int64_t zorig = nzombies ; + const bool Ci_is_32 = C->i_is_32 ; //-------------------------------------------------------------------------- // get M //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int8_t *restrict Mb = M->b ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + const void *Mh = M->h ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; const size_t msize = M->type->size ; const int64_t Mnvec = M->nvec ; @@ -79,9 +80,11 @@ GrB_Info GB_assign_zombie4 const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; const bool M_is_full = GB_IS_FULL (M) ; - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //-------------------------------------------------------------------------- @@ -114,8 +117,9 @@ GrB_Info GB_assign_zombie4 // get C(:,j) and determine if j is outside the list J //------------------------------------------------------------------ - int64_t j = GBH_C (Ch, k) ; - bool j_outside = !GB_ij_is_in_list (J, nJ, j, Jkind, Jcolon) ; + int64_t j = GBh_C (Ch, k) ; + bool j_outside = !GB_ij_is_in_list (J, J_is_32, nJ, j, Jkind, + Jcolon) ; if (j_outside) { @@ -123,12 +127,12 @@ GrB_Info GB_assign_zombie4 // j is not in J; find C(i,j) //-------------------------------------------------------------- - int64_t pC = Cp [k] ; - int64_t pC_end = Cp [k+1] ; + int64_t pC = GB_IGET (Cp, k) ; + int64_t pC_end = GB_IGET (Cp, k+1) ; int64_t pright = pC_end - 1 ; - bool found, is_zombie ; - GB_BINARY_SEARCH_ZOMBIE (i, Ci, pC, pright, found, zorig, - is_zombie) ; + bool is_zombie ; + bool found = GB_binary_search_zombie (i, Ci, Ci_is_32, + &pC, &pright, true, &is_zombie) ; //-------------------------------------------------------------- // delete C(i,j) if found, not a zombie, and M(0,j) allows it @@ -148,7 +152,7 @@ GrB_Info GB_assign_zombie4 { // M is bitmap/full int64_t pM = j ; - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; } else { @@ -158,14 +162,15 @@ GrB_Info GB_assign_zombie4 if (M_is_hyper) { // M is hypersparse - GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, - M_Yx, M_hash_bits, j, &pM, &pM_end) ; + GB_hyper_hash_lookup (Mp_is_32, Mj_is_32, + Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, + j, &pM, &pM_end) ; } else { // M is sparse - pM = Mp [j] ; - pM_end = Mp [j+1] ; + pM = GB_IGET (Mp, j) ; + pM_end = GB_IGET (Mp, j+1) ; } if (pM < pM_end) @@ -184,7 +189,8 @@ GrB_Info GB_assign_zombie4 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + int64_t iC = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, iC) ; // Ci [pC] = iC } } } diff --git a/GraphBLAS/Source/assign/GB_assign_zombie5.c b/GraphBLAS/Source/assign/GB_assign_zombie5.c index e39707d446..e4f547cf99 100644 --- a/GraphBLAS/Source/assign/GB_assign_zombie5.c +++ b/GraphBLAS/Source/assign/GB_assign_zombie5.c @@ -2,7 +2,7 @@ // GB_assign_zombie5: delete entries in C for C_replace_phase //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,6 @@ #include "assign/GB_assign.h" #include "assign/GB_assign_zombie.h" #include "assign/GB_subassign_methods.h" -#include "slice/GB_ek_slice.h" #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 #include "assign/include/GB_assign_shared_definitions.h" @@ -42,11 +41,13 @@ GrB_Info GB_assign_zombie5 const GrB_Matrix M, const bool Mask_comp, const bool Mask_struct, - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -72,10 +73,9 @@ GrB_Info GB_assign_zombie5 // get C //-------------------------------------------------------------------------- - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - // const int64_t Cnvec = C->nvec ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; int64_t nzombies = C->nzombies ; const int64_t zvlen = C->vlen ; @@ -83,10 +83,10 @@ GrB_Info GB_assign_zombie5 // get M //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mi = M->i ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; const size_t msize = M->type->size ; const int64_t Mnvec = M->nvec ; @@ -94,9 +94,12 @@ GrB_Info GB_assign_zombie5 const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; const bool M_is_full = GB_IS_FULL (M) ; - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; + const bool Mi_is_32 = M->i_is_32 ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //-------------------------------------------------------------------------- @@ -142,11 +145,12 @@ GrB_Info GB_assign_zombie5 // get C(:,j) and determine if j is outside the list J //------------------------------------------------------------------ - int64_t j = GBH_C (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; // j_outside is true if column j is outside the C(I,J) submatrix - bool j_outside = !GB_ij_is_in_list (J, nJ, j, Jkind, Jcolon) ; + bool j_outside = !GB_ij_is_in_list (J, J_is_32, nJ, j, Jkind, + Jcolon) ; GB_GET_PA (pC_start, pC_end, tid, k, kfirst, klast, pstart_Cslice, - Cp [k], Cp [k+1]) ; + GB_IGET (Cp, k), GB_IGET (Cp, k+1)) ; //------------------------------------------------------------------ // get M(:,j) @@ -170,9 +174,9 @@ GrB_Info GB_assign_zombie5 // C(i,j) is outside the C(I,J) submatrix if either i is // not in the list I, or j is not in J, or both. - int64_t i = Ci [pC] ; - if (!GB_IS_ZOMBIE (i) && - (j_outside || !GB_ij_is_in_list (I, nI, i, Ikind, Icolon))) + int64_t i = GB_IGET (Ci, pC) ; + if (!GB_IS_ZOMBIE (i) && (j_outside || + !GB_ij_is_in_list (I, I_is_32, nI, i, Ikind, Icolon))) { //---------------------------------------------------------- @@ -190,7 +194,8 @@ GrB_Info GB_assign_zombie5 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } } diff --git a/GraphBLAS/Source/assign/GB_bitmap_M_scatter_whole.c b/GraphBLAS/Source/assign/GB_bitmap_M_scatter_whole.c index 22b9f0a0ef..34652c20ae 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_M_scatter_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_M_scatter_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_M_scatter_whole: scatter M into/from the C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign.c b/GraphBLAS/Source/assign/GB_bitmap_assign.c index ff515ceaa7..0685bd2faf 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign.c @@ -2,7 +2,7 @@ // GB_bitmap_assign: assign to C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,12 +27,14 @@ GrB_Info GB_bitmap_assign GrB_Matrix C, // input/output matrix // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -88,7 +90,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) = A or scalar, no mask GB_OK (GB_bitmap_assign_6 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* no M, */ Mask_comp, Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -106,7 +109,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) += A or scalar, no mask. GB_OK (GB_bitmap_assign_5 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* no M, */ Mask_comp, Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -127,7 +131,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) = A or scalar GB_OK (GB_bitmap_assign_2 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -145,7 +150,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) + A or scalar GB_OK (GB_bitmap_assign_1 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -166,7 +172,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) = A or scalar, M is sparse or hypersparse GB_OK (GB_bitmap_assign_4 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp false, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -184,7 +191,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) += A or scalar, M is sparse or hypersparse GB_OK (GB_bitmap_assign_3 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp false, */ Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -205,7 +213,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) = A or scalar, M is sparse or hypersparse GB_OK (GB_bitmap_assign_8 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp true, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -223,7 +232,8 @@ GrB_Info GB_bitmap_assign { // C(I,J) += A or scalar, M is sparse or hypersparse GB_OK (GB_bitmap_assign_7 (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp true, */ Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign.h b/GraphBLAS/Source/assign/GB_bitmap_assign.h index 860d26e6c5..fb21a0b602 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign.h +++ b/GraphBLAS/Source/assign/GB_bitmap_assign.h @@ -2,7 +2,7 @@ // GB_bitmap_assign.h: definitions for GB_bitmap_assign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,12 +18,14 @@ GrB_Info GB_bitmap_assign GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_1.c b/GraphBLAS/Source/assign/GB_bitmap_assign_1.c index 53fd90d0ed..2ae3e80933 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_1.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_1.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_1: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,12 +39,14 @@ GrB_Info GB_bitmap_assign_1 // C bitmap, M bitmap/full, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -79,7 +81,7 @@ GrB_Info GB_bitmap_assign_1 // C bitmap, M bitmap/full, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_1, "bitmap_assign_1", @@ -93,6 +95,9 @@ GrB_Info GB_bitmap_assign_1 // C bitmap, M bitmap/full, with accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_1_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_1_whole.c index 035564ab56..1538ae3405 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_1_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_1_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_1_whole: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,11 +40,13 @@ GrB_Info GB_bitmap_assign_1_whole // C bitmap, M bitmap/full, with accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -79,7 +81,7 @@ GrB_Info GB_bitmap_assign_1_whole // C bitmap, M bitmap/full, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_1_WHOLE, "bitmap_assign_1_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_2.c b/GraphBLAS/Source/assign/GB_bitmap_assign_2.c index 34d8e3075f..32b6a63bc1 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_2.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_2.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_2: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,12 +40,14 @@ GrB_Info GB_bitmap_assign_2 // C bitmap, M bitmap/full, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -80,7 +82,7 @@ GrB_Info GB_bitmap_assign_2 // C bitmap, M bitmap/full, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_2, "bitmap_assign_2", @@ -94,6 +96,9 @@ GrB_Info GB_bitmap_assign_2 // C bitmap, M bitmap/full, no accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_2_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_2_whole.c index 13ddc5edc0..773920c233 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_2_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_2_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_2_whole: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,11 +41,13 @@ GrB_Info GB_bitmap_assign_2_whole // C bitmap, M bitmap/full, no accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -80,7 +82,7 @@ GrB_Info GB_bitmap_assign_2_whole // C bitmap, M bitmap/full, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_2_WHOLE, "bitmap_assign_2_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_3.c b/GraphBLAS/Source/assign/GB_bitmap_assign_3.c index 4c7ac244cf..609356cb54 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_3.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_3.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_3: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,12 +33,14 @@ GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -73,7 +75,7 @@ GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_3, "bitmap_assign_3", @@ -87,6 +89,9 @@ GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_3_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_3_whole.c index b4abb0fb0d..ffb4ccce76 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_3_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_3_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_3_whole: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,11 +34,13 @@ GrB_Info GB_bitmap_assign_3_whole // C bitmap, M sparse/hyper, with accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -74,7 +76,7 @@ GrB_Info GB_bitmap_assign_3_whole // C bitmap, M sparse/hyper, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_3_WHOLE, "bitmap_assign_3_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_4.c b/GraphBLAS/Source/assign/GB_bitmap_assign_4.c index d2d4003457..05a2ef47a6 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_4.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_4.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_4: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,12 +34,14 @@ GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -74,7 +76,7 @@ GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_4, "bitmap_assign_4", @@ -88,6 +90,9 @@ GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_4_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_4_whole.c index de79262536..7480432c48 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_4_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_4_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_4_whole: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,11 +35,13 @@ GrB_Info GB_bitmap_assign_4_whole // C bitmap, M sparse/hyper, no accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -75,7 +77,7 @@ GrB_Info GB_bitmap_assign_4_whole // C bitmap, M sparse/hyper, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_4_WHOLE, "bitmap_assign_4_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_5.c b/GraphBLAS/Source/assign/GB_bitmap_assign_5.c index a817dd66c3..f565875fe8 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_5.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_5.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_5: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,12 +43,14 @@ GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -82,7 +84,7 @@ GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_5, "bitmap_assign_5", @@ -96,6 +98,9 @@ GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_5_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_5_whole.c index 1e81bd38e7..0e61c2f538 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_5_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_5_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_5_whole: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,11 +44,13 @@ GrB_Info GB_bitmap_assign_5_whole // C bitmap, no M, with accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -82,7 +84,7 @@ GrB_Info GB_bitmap_assign_5_whole // C bitmap, no M, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_5_WHOLE, "bitmap_assign_5_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_6.c b/GraphBLAS/Source/assign/GB_bitmap_assign_6.c index fefa0554ba..bf72914f1d 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_6.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_6.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_6: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -46,12 +46,14 @@ GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -84,7 +86,7 @@ GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_6, "bitmap_assign_6", @@ -98,6 +100,9 @@ GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_6_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_6_whole.c index da15070ce6..708fe99cfa 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_6_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_6_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_6_whole: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,11 +48,13 @@ GrB_Info GB_bitmap_assign_6_whole // C bitmap, no M, no accum // inputs: #define C_replace false #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_6b_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_6b_whole.c index 2ed7de32b7..024c3fcbd4 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_6b_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_6b_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_6b_whole: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,11 +20,13 @@ GrB_Info GB_bitmap_assign_6b_whole // C bitmap, no M, no accum // inputs: #define C_replace false #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -55,7 +57,7 @@ GrB_Info GB_bitmap_assign_6b_whole // C bitmap, no M, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_6b_WHOLE, "bitmap_assign_6b_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_7.c b/GraphBLAS/Source/assign/GB_bitmap_assign_7.c index 1e4c85e2af..6e7b240665 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_7.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_7.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_7: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,12 +33,14 @@ GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -73,7 +75,7 @@ GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_7, "bitmap_assign_7", @@ -87,6 +89,9 @@ GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_7_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_7_whole.c index 7a0d655a50..275b334491 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_7_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_7_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_7_whole: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,11 +34,13 @@ GrB_Info GB_bitmap_assign_7_whole // C bitmap, !M sparse/hyper, with accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -74,7 +76,7 @@ GrB_Info GB_bitmap_assign_7_whole // C bitmap, !M sparse/hyper, with accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_7_WHOLE, "bitmap_assign_7_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_8.c b/GraphBLAS/Source/assign/GB_bitmap_assign_8.c index 00ff601e3c..a2f1e5c555 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_8.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_8.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_8: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,12 +34,14 @@ GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -74,7 +76,7 @@ GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_8, "bitmap_assign_8", @@ -88,6 +90,9 @@ GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_8_whole.c b/GraphBLAS/Source/assign/GB_bitmap_assign_8_whole.c index 77ab5d0653..d8815adac5 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_8_whole.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_8_whole.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_8_whole: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,11 +35,13 @@ GrB_Info GB_bitmap_assign_8_whole // C bitmap, !M sparse/hyper, no accum // inputs: const bool C_replace, // descriptor for C #define I NULL /* I index list */ + #define I_is_32 false #define ni 0 #define nI 0 #define Ikind GB_ALL #define Icolon NULL #define J NULL /* J index list */ + #define J_is_32 false #define nj 0 #define nJ 0 #define Jkind GB_ALL @@ -74,7 +76,7 @@ GrB_Info GB_bitmap_assign_8_whole // C bitmap, !M sparse/hyper, no accum //-------------------------------------------------------------------------- GrB_Info info = GB_subassign_jit (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, /* S: */ NULL, assign_kind, GB_JIT_KERNEL_BITMAP_ASSIGN_8_WHOLE, "bitmap_assign_8_whole", diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_methods.h b/GraphBLAS/Source/assign/GB_bitmap_assign_methods.h index 2a60e8cb28..446e86ed40 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_methods.h +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_methods.h @@ -2,7 +2,7 @@ // GB_bitmap_assign_methods.h: definitions for GB_bitmap_assign* methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,6 @@ #include "GB.h" #include "assign/GB_bitmap_assign.h" -#include "slice/GB_ek_slice.h" #include "ij/GB_ij.h" #include "include/GB_unused.h" #include "assign/include/GB_bitmap_scatter.h" @@ -27,12 +26,14 @@ GrB_Info GB_bitmap_assign_1 // C bitmap, M or !M bitmap/full, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -61,7 +62,6 @@ GrB_Info GB_bitmap_assign_1_whole // C bitmap, M or !M bitmap/full, with accum const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -71,12 +71,14 @@ GrB_Info GB_bitmap_assign_2 // C bitmap, M or !M bitmap/full, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -84,7 +86,6 @@ GrB_Info GB_bitmap_assign_2 // C bitmap, M or !M bitmap/full, no accum const GrB_Matrix M, // mask matrix, which is present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar @@ -101,11 +102,9 @@ GrB_Info GB_bitmap_assign_2_whole // C bitmap, M or !M bitmap/full, no accum const GrB_Matrix M, // mask matrix, which is present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -115,18 +114,19 @@ GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, // mask matrix, which is present here -// const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here const GrB_Matrix A, // input matrix, not transposed @@ -143,13 +143,11 @@ GrB_Info GB_bitmap_assign_3_whole // C bitmap, M sparse/hyper, with accum // inputs: const bool C_replace, // descriptor for C const GrB_Matrix M, // mask matrix, which is present here -// const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -159,20 +157,20 @@ GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, // mask matrix, which is present here -// const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar @@ -187,13 +185,10 @@ GrB_Info GB_bitmap_assign_4_whole // C bitmap, M sparse/hyper, no accum // inputs: const bool C_replace, // descriptor for C const GrB_Matrix M, // mask matrix, which is present here -// const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -203,17 +198,18 @@ GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], -// const GrB_Matrix M, // mask matrix, not present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present @@ -230,14 +226,12 @@ GrB_Info GB_bitmap_assign_5_whole // C bitmap, no M, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C -// const GrB_Matrix M, // mask matrix, not present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -247,20 +241,20 @@ GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], -// const GrB_Matrix M, // mask matrix, not present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar @@ -294,18 +288,19 @@ GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present const GrB_Matrix A, // input matrix, not transposed @@ -322,13 +317,11 @@ GrB_Info GB_bitmap_assign_7_whole // C bitmap, !M sparse/hyper, with accum // inputs: const bool C_replace, // descriptor for C const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; @@ -338,20 +331,20 @@ GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // J index list + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar @@ -366,13 +359,10 @@ GrB_Info GB_bitmap_assign_8_whole // C bitmap, !M sparse/hyper, no accum // inputs: const bool C_replace, // descriptor for C const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar -// const int assign_kind, // assign GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/assign/GB_bitmap_assign_to_full.c b/GraphBLAS/Source/assign/GB_bitmap_assign_to_full.c index 2f5d32abc2..3690b86d55 100644 --- a/GraphBLAS/Source/assign/GB_bitmap_assign_to_full.c +++ b/GraphBLAS/Source/assign/GB_bitmap_assign_to_full.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_to_full: all entries present in C; set bitmap to all 1's //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO (GB_bitmap_assign_to_full) if (GB_sparsity_control (C->sparsity_control, C->vdim) & GxB_FULL) { // C is bitmap but can become full; convert it to full - GB_FREE (&(C->b), C->b_size) ; + GB_FREE_MEMORY (&(C->b), C->b_size) ; C->nvals = -1 ; } else diff --git a/GraphBLAS/Source/assign/GB_subassign.c b/GraphBLAS/Source/assign/GB_subassign.c index a1218a759f..8cd6ec86ac 100644 --- a/GraphBLAS/Source/assign/GB_subassign.c +++ b/GraphBLAS/Source/assign/GB_subassign.c @@ -2,7 +2,7 @@ // GB_subassign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,8 +28,8 @@ GB_Matrix_free (&Cwork) ; \ GB_Matrix_free (&Mwork) ; \ GB_Matrix_free (&Awork) ; \ - GB_FREE_WORK (&I2, I2_size) ; \ - GB_FREE_WORK (&J2, J2_size) ; \ + GB_FREE_MEMORY (&I2, I2_size) ; \ + GB_FREE_MEMORY (&J2, J2_size) ; \ } GrB_Info GB_subassign // C(Rows,Cols) += A or A' @@ -43,10 +43,12 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix const bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Cols is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand @@ -62,8 +64,9 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' GrB_Matrix C = NULL ; // C_in or Cwork GrB_Matrix M = NULL ; // M_in or Mwork GrB_Matrix A = NULL ; // A_in or Awork - GrB_Index *I = NULL ; // Rows, Cols, or I2 - GrB_Index *J = NULL ; // Rows, Cols, or J2 + void *I = NULL ; // Rows, Cols, or I2 + void *J = NULL ; // Rows, Cols, or J2 + bool I_is_32, J_is_32 ; // temporary matrices and arrays GrB_Matrix Cwork = NULL ; @@ -71,8 +74,8 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' GrB_Matrix Awork = NULL ; struct GB_Matrix_opaque Cwork_header, Mwork_header, Awork_header, MT_header, AT_header ; - GrB_Index *I2 = NULL ; size_t I2_size = 0 ; - GrB_Index *J2 = NULL ; size_t J2_size = 0 ; + void *I2 = NULL ; size_t I2_size = 0 ; + void *J2 = NULL ; size_t J2_size = 0 ; GrB_Type scalar_type = NULL ; int64_t ni, nj, nI, nJ, Icolon [3], Jcolon [3] ; @@ -83,11 +86,13 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' GB_OK (GB_assign_prep (&C, &M, &A, &subassign_method, &Cwork, &Mwork, &Awork, &Cwork_header, &Mwork_header, &Awork_header, &MT_header, &AT_header, - &I, &I2, &I2_size, &ni, &nI, &Ikind, Icolon, - &J, &J2, &J2_size, &nj, &nJ, &Jkind, Jcolon, + &I, &I_is_32, &I2, &I2_size, &ni, &nI, &Ikind, Icolon, + &J, &J_is_32, &J2, &J2_size, &nj, &nJ, &Jkind, Jcolon, &scalar_type, C_in, &C_replace, &assign_kind, M_in, Mask_comp, Mask_struct, M_transpose, accum, - A_in, A_transpose, Rows, nRows_in, Cols, nCols_in, + A_in, A_transpose, + Rows, Rows_is_32, nRows_in, + Cols, Cols_is_32, nCols_in, scalar_expansion, scalar, scalar_code, Werk)) ; // GxB_Row_subassign, GxB_Col_subassign, GxB_Matrix_subassign and @@ -108,7 +113,8 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' GB_OK (GB_subassigner (C, subassign_method, C_replace, M, Mask_comp, Mask_struct, accum, A, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, scalar_expansion, scalar, scalar_type, Werk)) ; //-------------------------------------------------------------------------- @@ -120,7 +126,7 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' // Transplant the content of Cwork into C_in and free Cwork. Zombies // and pending tuples can be transplanted from Cwork into C_in, and if // Cwork is jumbled, C_in becomes jumbled too. - ASSERT (Cwork->static_header || GBNSTATIC) ; + ASSERT (Cwork->header_size == 0 || GBNSTATIC) ; GB_OK (GB_transplant (C_in, C_in->type, &Cwork, Werk)) ; } @@ -128,6 +134,7 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' // free workspace, finalize C, and return result //-------------------------------------------------------------------------- + ASSERT_MATRIX_OK (C_in, "C for subassign before conform", GB0) ; GB_OK (GB_conform (C_in, Werk)) ; ASSERT_MATRIX_OK (C_in, "Final C for subassign", GB0) ; GB_FREE_ALL ; diff --git a/GraphBLAS/Source/assign/GB_subassign.h b/GraphBLAS/Source/assign/GB_subassign.h index 35a2e67c96..1935f6d895 100644 --- a/GraphBLAS/Source/assign/GB_subassign.h +++ b/GraphBLAS/Source/assign/GB_subassign.h @@ -2,7 +2,7 @@ // GB_subassign.h: definitions for GB_subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,10 +23,12 @@ GrB_Info GB_subassign // C(Rows,Cols) += A or A' const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix const bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Cols is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand @@ -40,14 +42,45 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) const void *scalar, // scalar to assign to C(Rows,Cols) const GB_Type_code scalar_code, // type code of scalar to assign - const GrB_Index *Rows, // row indices - const GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Cols is 32-bit; else 64-bit + const uint64_t nCols, // number of column indices const GrB_Descriptor desc, // descriptor for C(Rows,Cols) and M GB_Werk Werk ) ; +GrB_Info GB_Matrix_subassign_scalar // C(I,J) = accum (C(I,J),s) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const void *J, // column indices + const bool J_is_32, + uint64_t nj, // number of column indices + const GrB_Descriptor desc, // descriptor for C and Mask + GB_Werk Werk +) ; + +GrB_Info GB_Vector_subassign_scalar // w(I)> = accum (w(I),s) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const void *I, // row indices + const bool I_is_32, + uint64_t ni, // number of row indices + const GrB_Descriptor desc, // descriptor for w and Mask + GB_Werk Werk +) ; + int GB_subassigner_method // return method to use in GB_subassigner ( // outputs @@ -82,13 +115,15 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),A) const GrB_Matrix A, // input matrix (NULL for scalar expansion) - const GrB_Index *I, // list of indices - const int64_t ni, // number of indices + const void *I, // I index list + const bool I_is_32, + const int64_t ni, // number of indices const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // list of vector indices - const int64_t nj, // number of column indices + const void *J, // J index list + const bool J_is_32, + const int64_t nj, // number of column indices const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -119,16 +154,18 @@ GrB_Info GB_assign_prep GrB_Matrix AT_header_handle, // modified versions of the Rows/Cols lists, and their analysis: - GrB_Index **I_handle, // Rows, Cols, or a modified copy I2 - GrB_Index **I2_handle, // NULL, or sorted/pruned Rows or Cols + void **I_handle, // Rows, Cols, or a modified copy I2 + bool *I_is_32_handle, + void **I2_handle, // NULL, or sorted/pruned Rows or Cols size_t *I2_size_handle, int64_t *ni_handle, int64_t *nI_handle, int *Ikind_handle, int64_t Icolon [3], - GrB_Index **J_handle, // Rows, Cols, or a modified copy J2 - GrB_Index **J2_handle, // NULL, or sorted/pruned Rows or Cols + void **J_handle, // Rows, Cols, or a modified copy J2 + bool *J_is_32_handle, + void **J2_handle, // NULL, or sorted/pruned Rows or Cols size_t *J2_size_handle, int64_t *nj_handle, int64_t *nJ_handle, @@ -150,10 +187,12 @@ GrB_Info GB_assign_prep const GrB_BinaryOp accum, // optional accum for accum(C,T) const GrB_Matrix A_in, // input matrix bool A_transpose, // true if A is transposed - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand diff --git a/GraphBLAS/Source/assign/GB_subassign_01.c b/GraphBLAS/Source/assign/GB_subassign_01.c index ceb8227edc..9ce5e9a2dc 100644 --- a/GraphBLAS/Source/assign/GB_subassign_01.c +++ b/GraphBLAS/Source/assign/GB_subassign_01.c @@ -2,7 +2,7 @@ // GB_subassign_01: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,12 +27,14 @@ GrB_Info GB_subassign_01 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -62,8 +64,9 @@ GrB_Info GB_subassign_01 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -71,8 +74,8 @@ GrB_Info GB_subassign_01 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, @@ -92,6 +95,9 @@ GrB_Info GB_subassign_01 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_02.c b/GraphBLAS/Source/assign/GB_subassign_02.c index bc8cbd87ae..9820c735e1 100644 --- a/GraphBLAS/Source/assign/GB_subassign_02.c +++ b/GraphBLAS/Source/assign/GB_subassign_02.c @@ -2,7 +2,7 @@ // GB_subassign_02: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,12 +28,14 @@ GrB_Info GB_subassign_02 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -65,8 +67,9 @@ GrB_Info GB_subassign_02 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -74,8 +77,8 @@ GrB_Info GB_subassign_02 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, @@ -95,6 +98,9 @@ GrB_Info GB_subassign_02 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_03.c b/GraphBLAS/Source/assign/GB_subassign_03.c index 79cfbd850f..d40cfb449a 100644 --- a/GraphBLAS/Source/assign/GB_subassign_03.c +++ b/GraphBLAS/Source/assign/GB_subassign_03.c @@ -2,7 +2,7 @@ // GB_subassign_03: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,12 +27,14 @@ GrB_Info GB_subassign_03 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -62,8 +64,9 @@ GrB_Info GB_subassign_03 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -71,8 +74,8 @@ GrB_Info GB_subassign_03 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, @@ -92,6 +95,9 @@ GrB_Info GB_subassign_03 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_04.c b/GraphBLAS/Source/assign/GB_subassign_04.c index 350c5a7dc9..9dc1d6c1b7 100644 --- a/GraphBLAS/Source/assign/GB_subassign_04.c +++ b/GraphBLAS/Source/assign/GB_subassign_04.c @@ -2,7 +2,7 @@ // GB_subassign_04: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,12 +28,14 @@ GrB_Info GB_subassign_04 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -65,8 +67,9 @@ GrB_Info GB_subassign_04 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -74,8 +77,8 @@ GrB_Info GB_subassign_04 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, @@ -95,6 +98,9 @@ GrB_Info GB_subassign_04 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_05.c b/GraphBLAS/Source/assign/GB_subassign_05.c index 69afa1689f..2d3d31ee75 100644 --- a/GraphBLAS/Source/assign/GB_subassign_05.c +++ b/GraphBLAS/Source/assign/GB_subassign_05.c @@ -2,7 +2,7 @@ // GB_subassign_05: C(I,J) = scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,12 +28,14 @@ GrB_Info GB_subassign_05 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -67,8 +69,8 @@ GrB_Info GB_subassign_05 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -87,6 +89,9 @@ GrB_Info GB_subassign_05 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_05d.c b/GraphBLAS/Source/assign/GB_subassign_05d.c index 85c5e8ba41..fcfac0c206 100644 --- a/GraphBLAS/Source/assign/GB_subassign_05d.c +++ b/GraphBLAS/Source/assign/GB_subassign_05d.c @@ -2,7 +2,7 @@ // GB_subassign_05d: C(:,:) = scalar where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -128,8 +128,8 @@ GrB_Info GB_subassign_05d { info = GB_subassign_jit (C, /* C_replace: */ false, - /* I, ni, nI, Ikind, Icolon: */ NULL, 0, 0, GB_ALL, NULL, - /* J, nj, nJ, Jkind, Jcolon: */ NULL, 0, 0, GB_ALL, NULL, + /* I, ni, nI, Ikind, Icolon: */ NULL, false, 0, 0, GB_ALL, NULL, + /* J, nj, nJ, Jkind, Jcolon: */ NULL, false, 0, 0, GB_ALL, NULL, M, /* Mask_comp: */ false, Mask_struct, diff --git a/GraphBLAS/Source/assign/GB_subassign_05e.c b/GraphBLAS/Source/assign/GB_subassign_05e.c index aa7e7733df..1cb3b0720d 100644 --- a/GraphBLAS/Source/assign/GB_subassign_05e.c +++ b/GraphBLAS/Source/assign/GB_subassign_05e.c @@ -2,7 +2,7 @@ // GB_subassign_05e: C(:,:) = scalar ; no S, C empty, M structural //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/GB_subassign_06d.c b/GraphBLAS/Source/assign/GB_subassign_06d.c index ca42f85270..ed39b1bda4 100644 --- a/GraphBLAS/Source/assign/GB_subassign_06d.c +++ b/GraphBLAS/Source/assign/GB_subassign_06d.c @@ -2,7 +2,7 @@ // GB_subassign_06d: C(:,:) = A; C is full/bitmap, M and A are aliased //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -153,8 +153,8 @@ GrB_Info GB_subassign_06d { info = GB_subassign_jit (C, /* C_replace: */ false, - /* I, ni, nI, Ikind, Icolon: */ NULL, 0, 0, GB_ALL, NULL, - /* J, nj, nJ, Jkind, Jcolon: */ NULL, 0, 0, GB_ALL, NULL, + /* I, ni, nI, Ikind, Icolon: */ NULL, false, 0, 0, GB_ALL, NULL, + /* J, nj, nJ, Jkind, Jcolon: */ NULL, false, 0, 0, GB_ALL, NULL, /* M and A are aliased: */ A, /* Mask_comp: */ false, Mask_struct, diff --git a/GraphBLAS/Source/assign/GB_subassign_06n.c b/GraphBLAS/Source/assign/GB_subassign_06n.c index afc271d613..4c1e24b8e1 100644 --- a/GraphBLAS/Source/assign/GB_subassign_06n.c +++ b/GraphBLAS/Source/assign/GB_subassign_06n.c @@ -2,7 +2,7 @@ // GB_subassign_06n: C(I,J) = A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,12 +36,14 @@ GrB_Info GB_subassign_06n GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -84,8 +86,8 @@ GrB_Info GB_subassign_06n info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -104,6 +106,9 @@ GrB_Info GB_subassign_06n // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_06s_and_14.c b/GraphBLAS/Source/assign/GB_subassign_06s_and_14.c index 55dc1f4397..1516c5b642 100644 --- a/GraphBLAS/Source/assign/GB_subassign_06s_and_14.c +++ b/GraphBLAS/Source/assign/GB_subassign_06s_and_14.c @@ -2,7 +2,7 @@ // GB_subassign_06s_and_14: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,19 +30,21 @@ GrB_Info GB_subassign_06s_and_14 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_comp, // if true, !M, else use M - const bool Mask_struct, // if true, use the only structure of M + const bool Mask_comp, + const bool Mask_struct, #define accum NULL const GrB_Matrix A, #define scalar NULL @@ -69,8 +71,9 @@ GrB_Info GB_subassign_06s_and_14 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -78,8 +81,8 @@ GrB_Info GB_subassign_06s_and_14 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, @@ -99,6 +102,9 @@ GrB_Info GB_subassign_06s_and_14 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_07.c b/GraphBLAS/Source/assign/GB_subassign_07.c index 7fca3bf045..67deb425fd 100644 --- a/GraphBLAS/Source/assign/GB_subassign_07.c +++ b/GraphBLAS/Source/assign/GB_subassign_07.c @@ -2,7 +2,7 @@ // GB_subassign_07: C(I,J) += scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_07 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -68,8 +70,8 @@ GrB_Info GB_subassign_07 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -88,6 +90,9 @@ GrB_Info GB_subassign_07 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_08n.c b/GraphBLAS/Source/assign/GB_subassign_08n.c index e5f588de32..9b6798f488 100644 --- a/GraphBLAS/Source/assign/GB_subassign_08n.c +++ b/GraphBLAS/Source/assign/GB_subassign_08n.c @@ -2,7 +2,7 @@ // GB_subassign_08n: C(I,J) += A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,12 +30,14 @@ GrB_Info GB_subassign_08n GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -73,8 +75,8 @@ GrB_Info GB_subassign_08n info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -93,6 +95,9 @@ GrB_Info GB_subassign_08n // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_08n_slice.c b/GraphBLAS/Source/assign/GB_subassign_08n_slice.c index 50d407c217..8a2959e2c4 100644 --- a/GraphBLAS/Source/assign/GB_subassign_08n_slice.c +++ b/GraphBLAS/Source/assign/GB_subassign_08n_slice.c @@ -2,7 +2,7 @@ // GB_subassign_08n_slice: slice the entries and vectors for GB_subassign_08n //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,6 +35,39 @@ #define GB_SCALAR_ASSIGN 0 #include "assign/include/GB_assign_shared_definitions.h" +#if 0 +GrB_Info GX_subassign_08n_slice \ +( \ + /* output: */ \ + GB_task_struct **p_TaskList, /* size max_ntasks */ \ + size_t *p_TaskList_size, /* size of TaskList */ \ + int *p_ntasks, /* # of tasks constructed */ \ + int *p_nthreads, /* # of threads to use */ \ + int64_t *p_Znvec, /* # of vectors to compute in Z */ \ + const void **Zh_handle, /* Zh is A->h, M->h, or NULL */ \ + int64_t **Z_to_A_handle, /* Z_to_A: size Znvec, or NULL */ \ + size_t *Z_to_A_size_handle, \ + int64_t **Z_to_M_handle, /* Z_to_M: size Znvec, or NULL */ \ + size_t *Z_to_M_size_handle, \ + bool *Zj_is_32_handle, \ + /* input: */ \ + const GrB_Matrix C, /* output matrix C */ \ + const void *I, /* I index list */ \ + const bool I_is_32, \ + const int64_t nI, \ + const int Ikind, \ + const int64_t Icolon [3], \ + const void *J, /* J index list */ \ + const bool J_is_32, \ + const int64_t nJ, \ + const int Jkind, \ + const int64_t Jcolon [3], \ + const GrB_Matrix A, /* matrix to slice */ \ + const GrB_Matrix M, /* matrix to slice */ \ + GB_Werk Werk \ +) +#endif + GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) { @@ -79,25 +112,31 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) // get inputs //-------------------------------------------------------------------------- - int64_t *restrict Ci = C->i ; - int64_t nzombies = C->nzombies ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + void *Ch = C->h ; + void *Ci = C->i ; + const bool may_see_zombies = (C->nzombies > 0) ; const int64_t Cnvec = C->nvec ; const int64_t Cvlen = C->vlen ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; const bool C_is_hyper = (Ch != NULL) ; + const bool Cp_is_32 = C->p_is_32 ; + const bool Cj_is_32 = C->j_is_32 ; + const bool Ci_is_32 = C->i_is_32 ; GB_GET_C_HYPER_HASH ; - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + void *Mh = M->h ; const int64_t Mvlen = M->vlen ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + void *Ah = A->h ; const int64_t Avlen = A->vlen ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + //-------------------------------------------------------------------------- // construct fine/coarse tasks for eWise multiply of A.*M //-------------------------------------------------------------------------- @@ -106,20 +145,26 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) // function takes the place of B in GB_emult. int64_t Znvec ; - const int64_t *restrict Zh_shallow = NULL ; + GB_MDECL (Zh_shallow, const, u) ; + + bool Zp_is_32, Zj_is_32, Zi_is_32 ; + int Z_sparsity = GxB_SPARSE ; GB_OK (GB_emult_08_phase0 (&Znvec, &Zh_shallow, &Zh_size, NULL, NULL, - &Z_to_A, &Z_to_A_size, &Z_to_M, &Z_to_M_size, &Z_sparsity, NULL, A, M, - Werk)) ; + &Z_to_A, &Z_to_A_size, &Z_to_M, &Z_to_M_size, + &Zp_is_32, &Zj_is_32, &Zi_is_32, + &Z_sparsity, NULL, false, A, M, Werk)) ; // Z is still sparse or hypersparse, not bitmap or full ASSERT (Z_sparsity == GxB_SPARSE || Z_sparsity == GxB_HYPERSPARSE) ; GB_OK (GB_ewise_slice ( &TaskList, &TaskList_size, &ntasks, &nthreads, - Znvec, Zh_shallow, NULL, Z_to_A, Z_to_M, false, + Znvec, Zh_shallow, Zj_is_32, NULL, Z_to_A, Z_to_M, false, NULL, A, M, Werk)) ; + GB_IPTR (Zh_shallow, Zj_is_32) ; + //-------------------------------------------------------------------------- // slice C(:,jC) for each fine task //-------------------------------------------------------------------------- @@ -156,9 +201,15 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) //------------------------------------------------------------------ int64_t k = kfirst ; - int64_t j = GBH (Zh_shallow, k) ; - GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; - GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; + int64_t j = GBh (Zh_shallow, k) ; + + // A fine task operates on a slice of A(:,k) + int64_t pA = TaskList [taskid].pA ; + int64_t pA_end = TaskList [taskid].pA_end ; + + // A fine task operates on a slice of M(:,k) + int64_t pM = TaskList [taskid].pB ; + int64_t pM_end = TaskList [taskid].pB_end ; //------------------------------------------------------------------ // quick checks for empty intersection of A(:,j) and M(:,j) @@ -167,10 +218,10 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) int64_t ajnz = pA_end - pA ; int64_t mjnz = pM_end - pM ; if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI_A (Ai, pA, Avlen) ; - int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; - int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; + int64_t iA_first = GBi_A (Ai, pA, Avlen) ; + int64_t iA_last = GBi_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBi_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBi_M (Mi, pM_end-1, Mvlen) ; if (iA_last < iM_first || iM_last < iA_first) continue ; //------------------------------------------------------------------ @@ -179,7 +230,7 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) // lookup jC in C // jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, Jkind, Jcolon) ; int64_t pC_start, pC_end ; GB_LOOKUP_VECTOR_C (jC, pC_start, pC_end) ; @@ -199,9 +250,9 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) { // find where this task starts and ends in C(:,jC) int64_t iA_start = GB_IMIN (iA_first, iM_first) ; - int64_t iC1 = GB_ijlist (I, iA_start, Ikind, Icolon) ; + int64_t iC1 = GB_IJLIST (I, iA_start, Ikind, Icolon) ; int64_t iA_end = GB_IMAX (iA_last, iM_last) ; - int64_t iC2 = GB_ijlist (I, iA_end, Ikind, Icolon) ; + int64_t iC2 = GB_IJLIST (I, iA_end, Ikind, Icolon) ; // If I is an explicit list, it must be already sorted // in ascending order, and thus iC1 <= iC2. If I is @@ -216,14 +267,14 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) int64_t pleft = pC_start ; int64_t pright = pC_end - 1 ; bool found, is_zombie ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (iC_start, Ci, pleft, pright, - found, nzombies, is_zombie) ; + GB_split_binary_search_zombie (iC_start, Ci, Ci_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; TaskList [taskid].pC = pleft ; pleft = pC_start ; pright = pC_end - 1 ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (iC_end, Ci, pleft, pright, - found, nzombies, is_zombie) ; + found = GB_split_binary_search_zombie (iC_end, Ci, Ci_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; TaskList [taskid].pC_end = (found) ? (pleft+1) : pleft ; } @@ -244,6 +295,7 @@ GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) (*Zh_handle ) = Zh_shallow ; (*Z_to_A_handle) = Z_to_A ; (*Z_to_A_size_handle) = Z_to_A_size ; (*Z_to_M_handle) = Z_to_M ; (*Z_to_M_size_handle) = Z_to_M_size ; + (*Zj_is_32_handle) = Zj_is_32 ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/assign/GB_subassign_08s_and_16.c b/GraphBLAS/Source/assign/GB_subassign_08s_and_16.c index 114eea60f1..1cc30b9994 100644 --- a/GraphBLAS/Source/assign/GB_subassign_08s_and_16.c +++ b/GraphBLAS/Source/assign/GB_subassign_08s_and_16.c @@ -2,7 +2,7 @@ // GB_subassign_08s_and_16: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,19 +30,21 @@ GrB_Info GB_subassign_08s_and_16 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_comp, // if true, !M, else use M - const bool Mask_struct, // if true, use the only structure of M + const bool Mask_comp, + const bool Mask_struct, const GrB_BinaryOp accum, const GrB_Matrix A, #define scalar NULL @@ -69,8 +71,9 @@ GrB_Info GB_subassign_08s_and_16 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -78,8 +81,8 @@ GrB_Info GB_subassign_08s_and_16 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, @@ -99,6 +102,9 @@ GrB_Info GB_subassign_08s_and_16 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_09.c b/GraphBLAS/Source/assign/GB_subassign_09.c index c59ca3509e..54717b2008 100644 --- a/GraphBLAS/Source/assign/GB_subassign_09.c +++ b/GraphBLAS/Source/assign/GB_subassign_09.c @@ -2,7 +2,7 @@ // GB_subassign_09: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_09 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_09 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_09 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_09 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_10_and_18.c b/GraphBLAS/Source/assign/GB_subassign_10_and_18.c index ce6ab3e560..6da115cf09 100644 --- a/GraphBLAS/Source/assign/GB_subassign_10_and_18.c +++ b/GraphBLAS/Source/assign/GB_subassign_10_and_18.c @@ -2,7 +2,7 @@ // GB_subassign_10_and_18: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,19 +30,21 @@ GrB_Info GB_subassign_10_and_18 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_comp, // if true, !M, else use M - const bool Mask_struct, // if true, use the only structure of M + const bool Mask_comp, + const bool Mask_struct, #define accum NULL const GrB_Matrix A, #define scalar NULL @@ -69,8 +71,9 @@ GrB_Info GB_subassign_10_and_18 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -78,8 +81,8 @@ GrB_Info GB_subassign_10_and_18 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, @@ -99,6 +102,9 @@ GrB_Info GB_subassign_10_and_18 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_11.c b/GraphBLAS/Source/assign/GB_subassign_11.c index e228d157c3..3aa77f34bf 100644 --- a/GraphBLAS/Source/assign/GB_subassign_11.c +++ b/GraphBLAS/Source/assign/GB_subassign_11.c @@ -2,7 +2,7 @@ // GB_subassign_11: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_11 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_11 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_11 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ false, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_11 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_12_and_20.c b/GraphBLAS/Source/assign/GB_subassign_12_and_20.c index 428bccf85e..3256e2d512 100644 --- a/GraphBLAS/Source/assign/GB_subassign_12_and_20.c +++ b/GraphBLAS/Source/assign/GB_subassign_12_and_20.c @@ -2,7 +2,7 @@ // GB_subassign_12_and_20: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,12 +30,14 @@ GrB_Info GB_subassign_12_and_20 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -69,8 +71,9 @@ GrB_Info GB_subassign_12_and_20 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -78,8 +81,8 @@ GrB_Info GB_subassign_12_and_20 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, @@ -99,6 +102,9 @@ GrB_Info GB_subassign_12_and_20 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 0 diff --git a/GraphBLAS/Source/assign/GB_subassign_13.c b/GraphBLAS/Source/assign/GB_subassign_13.c index 00d4215527..7b88bfba14 100644 --- a/GraphBLAS/Source/assign/GB_subassign_13.c +++ b/GraphBLAS/Source/assign/GB_subassign_13.c @@ -2,7 +2,7 @@ // GB_subassign_13: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_13 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_13 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_13 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ true, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_13 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_15.c b/GraphBLAS/Source/assign/GB_subassign_15.c index b2d17e7b37..a054b38bd4 100644 --- a/GraphBLAS/Source/assign/GB_subassign_15.c +++ b/GraphBLAS/Source/assign/GB_subassign_15.c @@ -2,7 +2,7 @@ // GB_subassign_15: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_15 GrB_Matrix C, // input: #define C_replace false - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_15 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_15 info = GB_subassign_jit (C, /* C_replace: */ false, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ true, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_15 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_17.c b/GraphBLAS/Source/assign/GB_subassign_17.c index dcaff67794..7f282a601a 100644 --- a/GraphBLAS/Source/assign/GB_subassign_17.c +++ b/GraphBLAS/Source/assign/GB_subassign_17.c @@ -2,7 +2,7 @@ // GB_subassign_17: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_17 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_17 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_17 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ true, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_17 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_19.c b/GraphBLAS/Source/assign/GB_subassign_19.c index 5dc4cda964..c4f9cd9456 100644 --- a/GraphBLAS/Source/assign/GB_subassign_19.c +++ b/GraphBLAS/Source/assign/GB_subassign_19.c @@ -2,7 +2,7 @@ // GB_subassign_19: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,12 +29,14 @@ GrB_Info GB_subassign_19 GrB_Matrix C, // input: #define C_replace true - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -66,8 +68,9 @@ GrB_Info GB_subassign_19 //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, true, + Werk)) ; //-------------------------------------------------------------------------- // via the JIT or PreJIT kernel @@ -75,8 +78,8 @@ GrB_Info GB_subassign_19 info = GB_subassign_jit (C, /* C_replace: */ true, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, /* Mask_comp: */ true, Mask_struct, @@ -96,6 +99,9 @@ GrB_Info GB_subassign_19 // via the generic kernel //-------------------------------------------------------------------------- + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + GBURBLE ("(generic assign) ") ; #define GB_GENERIC #define GB_SCALAR_ASSIGN 1 diff --git a/GraphBLAS/Source/assign/GB_subassign_22.c b/GraphBLAS/Source/assign/GB_subassign_22.c index 67c6633559..c3eb98ca76 100644 --- a/GraphBLAS/Source/assign/GB_subassign_22.c +++ b/GraphBLAS/Source/assign/GB_subassign_22.c @@ -2,7 +2,7 @@ // GB_subassign_22: C += scalar where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,8 +19,8 @@ // C += scalar where C is full -#include "assign/GB_subassign_dense.h" #include "binaryop/GB_binop.h" +#include "assign/GB_subassign_dense.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT @@ -147,8 +147,8 @@ GrB_Info GB_subassign_22 // C += scalar where C is full { info = GB_subassign_jit (C, /* C_replace: */ false, - /* I, ni, nI, Ikind, Icolon: */ NULL, 0, 0, GB_ALL, NULL, - /* J, nj, nJ, Jkind, Jcolon: */ NULL, 0, 0, GB_ALL, NULL, + /* I, I_is_32, ni, nI, Ikind, Icolon: */ NULL, false, 0, 0, GB_ALL, NULL, + /* J, I_is_32, nj, nJ, Jkind, Jcolon: */ NULL, false, 0, 0, GB_ALL, NULL, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, diff --git a/GraphBLAS/Source/assign/GB_subassign_23.c b/GraphBLAS/Source/assign/GB_subassign_23.c index 5f9af04419..95ccc6eea1 100644 --- a/GraphBLAS/Source/assign/GB_subassign_23.c +++ b/GraphBLAS/Source/assign/GB_subassign_23.c @@ -2,7 +2,7 @@ // GB_subassign_23: C += A where C is full and A is any matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,8 +24,8 @@ // C and A can have any sparsity structure, but C must be as-if-full. -#include "assign/GB_subassign_dense.h" #include "binaryop/GB_binop.h" +#include "assign/GB_subassign_dense.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -141,8 +141,8 @@ GrB_Info GB_subassign_23 // C += A; C is full { info = GB_subassign_jit (C, /* C_replace: */ false, - /* I, ni, nI, Ikind, Icolon: */ NULL, 0, 0, GB_ALL, NULL, - /* J, nj, nJ, Jkind, Jcolon: */ NULL, 0, 0, GB_ALL, NULL, + /* I, ni, nI, Ikind, Icolon: */ NULL, false, 0, 0, GB_ALL, NULL, + /* J, nj, nJ, Jkind, Jcolon: */ NULL, false, 0, 0, GB_ALL, NULL, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ true, diff --git a/GraphBLAS/Source/assign/GB_subassign_24.c b/GraphBLAS/Source/assign/GB_subassign_24.c index 1b6c8b0eae..02bf91bcd5 100644 --- a/GraphBLAS/Source/assign/GB_subassign_24.c +++ b/GraphBLAS/Source/assign/GB_subassign_24.c @@ -2,7 +2,7 @@ // GB_subassign_24: make a deep copy of a sparse or dense matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,8 +20,8 @@ // A can be jumbled, in which case C is also jumbled. // A can have any sparsity structure (sparse, hyper, bitmap, or full). -#include "assign/GB_subassign_dense.h" #include "pending/GB_Pending.h" +#include "assign/GB_subassign_dense.h" #define GB_FREE_ALL ; GrB_Info GB_subassign_24 // C = A, copy A into an existing matrix C @@ -112,7 +112,6 @@ GrB_Info GB_subassign_24 // C = A, copy A into an existing matrix C bool C_is_csc = C->is_csc ; GB_phybix_free (C) ; // copy the pattern, not the values - // set C->iso = C_iso OK GB_OK (GB_dup_worker (&C, C_iso, A, false, C->type)) ; C->is_csc = C_is_csc ; // do not change the CSR/CSC format of C // GB_assign_prep has assigned the C->x iso value, but this has just diff --git a/GraphBLAS/Source/assign/GB_subassign_25.c b/GraphBLAS/Source/assign/GB_subassign_25.c index 13b5e737a5..6fe9a8436a 100644 --- a/GraphBLAS/Source/assign/GB_subassign_25.c +++ b/GraphBLAS/Source/assign/GB_subassign_25.c @@ -2,7 +2,7 @@ // GB_subassign_25: C(:,:) = A; C empty, A full, M structural //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -101,7 +101,6 @@ GrB_Info GB_subassign_25 bool C_is_csc = C->is_csc ; GB_phybix_free (C) ; - // set C->iso = C_iso OK GB_OK (GB_dup_worker (&C, C_iso, M, false, C->type)) ; C->is_csc = C_is_csc ; @@ -166,8 +165,8 @@ GrB_Info GB_subassign_25 { info = GB_subassign_jit (C, /* C_replace: */ false, - /* I, ni, nI, Ikind, Icolon: */ NULL, 0, 0, GB_ALL, NULL, - /* J, nj, nJ, Jkind, Jcolon: */ NULL, 0, 0, GB_ALL, NULL, + /* I, ni, nI, Ikind, Icolon: */ NULL, false, 0, 0, GB_ALL, NULL, + /* J, nj, nJ, Jkind, Jcolon: */ NULL, false, 0, 0, GB_ALL, NULL, M, /* Mask_comp: */ false, /* Mask_struct: */ true, diff --git a/GraphBLAS/Source/assign/GB_subassign_26.c b/GraphBLAS/Source/assign/GB_subassign_26.c index 42c9fd5676..8117c20d4d 100644 --- a/GraphBLAS/Source/assign/GB_subassign_26.c +++ b/GraphBLAS/Source/assign/GB_subassign_26.c @@ -2,7 +2,7 @@ // GB_subassign_26: C(:,j1:j2) = A ; append columns, no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ GrB_Info GB_subassign_26 const GrB_Matrix A, GB_Werk Werk ) -{ +{ //-------------------------------------------------------------------------- // check inputs @@ -60,10 +60,13 @@ GrB_Info GB_subassign_26 int64_t Cnvec = C->nvec ; int64_t cnz = C->nvals ; - int64_t *restrict Ap = A->p ; - int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + void *Ai = A->i ; GB_void *restrict Ax = (GB_void *) A->x ; int64_t anz = A->nvals ; + bool Ai_is_32 = A->i_is_32 ; + size_t aisize = (Ai_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + GB_Type_code aicode = (Ai_is_32) ? GB_UINT32_code : GB_UINT64_code ; int64_t j1 = Jcolon [GxB_BEGIN] ; int64_t j2 = Jcolon [GxB_END ] ; @@ -96,85 +99,65 @@ GrB_Info GB_subassign_26 GB_OK (GB_ix_realloc (C, 2*cnz_new + 1)) ; } - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, ) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; GB_void *restrict Cx = (GB_void *) C->x ; + bool Ci_is_32 = C->i_is_32 ; + GB_Type_code cicode = (Ci_is_32) ? GB_UINT32_code : GB_UINT64_code ; //-------------------------------------------------------------------------- // determine any parallelism to use //-------------------------------------------------------------------------- - ASSERT (Cnvec == 0 || Ch [Cnvec-1] == j1-1) ; + ASSERT (Cnvec == 0 || GB_IGET (Ch, Cnvec-1) == j1-1) ; bool phase1_parallel = (nJ > GB_CHUNK_DEFAULT) ; - bool phase2_parallel = (anz * (sizeof (int64_t) + csize) > GB_MEM_CHUNK) ; - int nthreads_max ; - double chunk ; - - if (phase1_parallel || phase2_parallel) - { - nthreads_max = GB_Context_nthreads_max ( ) ; - chunk = GB_Context_chunk ( ) ; - } + bool phase2_parallel = (anz * (aisize + csize) > GB_MEM_CHUNK) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; //-------------------------------------------------------------------------- - // phase1: compute Cp, Ch, # of new nonempty vectors, and matrix properties + // phase1: append to Cp and Ch; find # new nonempty vectors, and properties //-------------------------------------------------------------------------- int64_t Anvec_nonempty = 0 ; - #define COMPUTE_CP_AND_CH \ - for (k = 0 ; k < nJ ; k++) \ - { \ - int64_t apk = Ap [k] ; \ - int64_t anzk = Ap [k+1] - apk ; \ - Ch [Cnvec + k] = j1 + k ; \ - Cp [Cnvec + k] = cnz + apk ; \ - Anvec_nonempty += (anzk > 0) ; \ - } - int nthreads = (phase1_parallel) ? GB_nthreads (nJ, chunk, nthreads_max) : 1 ; int64_t k ; - if (nthreads > 1) - { - // compute Cp and Ch in parallel - #pragma omp parallel for num_threads(nthreads) schedule(static) \ - reduction(+:Anvec_nonempty) - COMPUTE_CP_AND_CH ; - } - else + + // compute Cp, Ch, and Anvec_nonempty in parallel + #pragma omp parallel for num_threads(nthreads) schedule(static) \ + reduction(+:Anvec_nonempty) + for (k = 0 ; k < nJ ; k++) { - // compute Cp and Ch in a single thread - COMPUTE_CP_AND_CH ; + int64_t apk = GB_IGET (Ap, k) ; + int64_t anzk = GB_IGET (Ap, k+1) - apk ; + GB_ISET (Ch, Cnvec + k, j1 + k) ; + GB_ISET (Cp, Cnvec + k, cnz + apk) ; + Anvec_nonempty += (anzk > 0) ; } - if (C->nvec_nonempty >= 0) + int64_t C_nvec_nonempty = GB_nvec_nonempty_get (C) ; + if (C_nvec_nonempty >= 0) { - C->nvec_nonempty += Anvec_nonempty ; +// C->nvec_nonempty += Anvec_nonempty ; + GB_nvec_nonempty_set (C, C_nvec_nonempty + Anvec_nonempty) ; } C->nvec += nJ ; - Cp [C->nvec] = cnz_new ; + GB_ISET (Cp, C->nvec, cnz_new) ; C->nvals = cnz_new ; C->jumbled = C->jumbled || A->jumbled ; //-------------------------------------------------------------------------- - // phase2: copy the indices and values + // phase2: append the indices and values to the end of Ci and Cx //-------------------------------------------------------------------------- nthreads = (phase2_parallel) ? GB_nthreads (anz, chunk, nthreads_max) : 1 ; - if (nthreads > 1) - { - // copy Ci and Cx with parallel memcpy's - GB_memcpy (Ci + cnz, Ai, anz * sizeof (int64_t), nthreads) ; - GB_memcpy (Cx + cnz * csize, Ax, anz * csize, nthreads) ; - } - else - { - // copy Ci and Cx with single-threaded memcpy's - memcpy (Ci + cnz, Ai, anz * sizeof (int64_t)) ; - memcpy (Cx + cnz * csize, Ax, anz * csize) ; - } + + // copy Ci and Cx + GB_cast_int (GB_IADDR (Ci, cnz), cicode, Ai, aicode, anz, nthreads) ; + GB_memcpy (Cx + cnz * csize, Ax, anz * csize, nthreads) ; //-------------------------------------------------------------------------- // return result diff --git a/GraphBLAS/Source/assign/GB_subassign_IxJ_slice.c b/GraphBLAS/Source/assign/GB_subassign_IxJ_slice.c index 20ed7a7b0c..172939a23a 100644 --- a/GraphBLAS/Source/assign/GB_subassign_IxJ_slice.c +++ b/GraphBLAS/Source/assign/GB_subassign_IxJ_slice.c @@ -2,7 +2,7 @@ // GB_subassign_IxJ_slice: slice IxJ for subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,13 +47,28 @@ #undef GB_FREE_ALL #define GB_FREE_ALL \ { \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } //------------------------------------------------------------------------------ // GB_subassign_IxJ_slice //------------------------------------------------------------------------------ +#if 0 +GrB_Info GB_subassign_IxJ_slice +( + // output: + GB_task_struct **p_TaskList, // array of structs + size_t *p_TaskList_size, // size of TaskList + int *p_ntasks, // # of tasks constructed + int *p_nthreads, // # of threads to use + // input: + const int64_t nI, + const int64_t nJ, + GB_Werk Werk +) +#endif + GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO (GB_subassign_IxJ_slice) { diff --git a/GraphBLAS/Source/assign/GB_subassign_dense.h b/GraphBLAS/Source/assign/GB_subassign_dense.h index b16bb2c6ea..9f04b43969 100644 --- a/GraphBLAS/Source/assign/GB_subassign_dense.h +++ b/GraphBLAS/Source/assign/GB_subassign_dense.h @@ -2,7 +2,7 @@ // GB_subassign_dense.h: definitions for dense subassign methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,8 +10,6 @@ #ifndef GB_SUBASSIGN_DENSE_H #define GB_SUBASSIGN_DENSE_H -#include "slice/GB_ek_slice.h" - //------------------------------------------------------------------------------ // GB_subassign_23: C(:,:) += A where C is dense and A is sparse or dense //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/GB_subassign_methods.h b/GraphBLAS/Source/assign/GB_subassign_methods.h index 0aebca90bb..457296a2fd 100644 --- a/GraphBLAS/Source/assign/GB_subassign_methods.h +++ b/GraphBLAS/Source/assign/GB_subassign_methods.h @@ -2,7 +2,7 @@ // GB_subassign_methods.h: definitions for GB_subassign methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,9 +25,11 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values GrB_Matrix S, // S = symbolic(C(I,J)), static header // inputs, not modified: const GrB_Matrix C, // matrix to extract the pattern of - const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc + const void *I, // I index list + const bool I_is_32, const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc + const void *J, // J index list + const bool J_is_32, const int64_t nj, // length of J, or special const bool S_must_not_be_jumbled, // if true, S cannot be jumbled GB_Werk Werk @@ -41,12 +43,14 @@ GrB_Info GB_subassign_zombie ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -62,12 +66,14 @@ GrB_Info GB_subassign_01 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -85,12 +91,14 @@ GrB_Info GB_subassign_02 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -107,12 +115,14 @@ GrB_Info GB_subassign_03 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -131,12 +141,14 @@ GrB_Info GB_subassign_04 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -154,12 +166,14 @@ GrB_Info GB_subassign_05 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -193,12 +207,14 @@ GrB_Info GB_subassign_06n ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -217,12 +233,14 @@ GrB_Info GB_subassign_06s_and_14 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -242,12 +260,14 @@ GrB_Info GB_subassign_07 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -268,12 +288,14 @@ GrB_Info GB_subassign_08n ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -293,12 +315,14 @@ GrB_Info GB_subassign_09 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -318,12 +342,14 @@ GrB_Info GB_subassign_10_and_18 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -343,12 +369,14 @@ GrB_Info GB_subassign_11 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -369,19 +397,21 @@ GrB_Info GB_subassign_12_and_20 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_comp, - const bool Mask_struct, + const bool Mask_comp, // if true, !M, else use M + const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, const GrB_Matrix A, GB_Werk Werk @@ -395,12 +425,14 @@ GrB_Info GB_subassign_13 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -420,12 +452,14 @@ GrB_Info GB_subassign_15 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -447,12 +481,14 @@ GrB_Info GB_subassign_08s_and_16 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -473,12 +509,14 @@ GrB_Info GB_subassign_17 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -498,12 +536,14 @@ GrB_Info GB_subassign_19 ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -516,38 +556,6 @@ GrB_Info GB_subassign_19 GB_Werk Werk ) ; -//------------------------------------------------------------------------------ -// GB_subassign_08n_slice: slice the entries and vectors for GB_subassign_08n -//------------------------------------------------------------------------------ - -GrB_Info GB_subassign_08n_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs, of size max_ntasks - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - int64_t *p_Znvec, // # of vectors to compute in Z - const int64_t *restrict *Zh_handle, // Zh_shallow is A->h, M->h, or NULL - int64_t *restrict *Z_to_A_handle, // Z_to_A: size Znvec, or NULL - size_t *Z_to_A_size_handle, - int64_t *restrict *Z_to_M_handle, // Z_to_M: size Znvec, or NULL - size_t *Z_to_M_size_handle, - // input: - const GrB_Matrix C, // output matrix C - const GrB_Index *I, - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix A, // matrix to slice - const GrB_Matrix M, // matrix to slice - GB_Werk Werk -) ; - //------------------------------------------------------------------------------ // GB_subassign_26: C(:,j) = A, append column, no S //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/GB_subassign_one_slice.c b/GraphBLAS/Source/assign/GB_subassign_one_slice.c index 28985d0bab..62268ca60b 100644 --- a/GraphBLAS/Source/assign/GB_subassign_one_slice.c +++ b/GraphBLAS/Source/assign/GB_subassign_one_slice.c @@ -2,7 +2,7 @@ // GB_subassign_one_slice: slice the entries and vectors for subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,13 +39,38 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } //------------------------------------------------------------------------------ // GB_subassign_one_slice //------------------------------------------------------------------------------ +#if 0 +GrB_Info GB_subassign_one_slice // slice M for subassign_05, 06n, 07 +( + // output: + GB_task_struct **p_TaskList, // array of structs + size_t *p_TaskList_size, // size of TaskList + int *p_ntasks, // # of tasks constructed + int *p_nthreads, // # of threads to use + // input: + const GrB_Matrix C, // output matrix C + const void *I, + const bool I_is_32, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const void *J, + const bool J_is_32, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // matrix to slice + GB_Werk Werk +) +#endif + GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) { @@ -61,14 +86,18 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) ASSERT_MATRIX_OK (M, "M for 1_slice", GB0) ; ASSERT (!GB_IS_BITMAP (C)) ; + ASSERT (GB_ZOMBIES_OK (C)) ; // C may have zombies + ASSERT (!GB_JUMBLED (C)) ; // but it is not jumbled - ASSERT (!GB_JUMBLED (C)) ; ASSERT (!GB_JUMBLED (M)) ; (*p_TaskList ) = NULL ; (*p_ntasks ) = 0 ; (*p_nthreads ) = 1 ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + //-------------------------------------------------------------------------- // determine # of threads to use //-------------------------------------------------------------------------- @@ -80,21 +109,24 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) // get M and C //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; -// const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; const int64_t mnz = GB_nnz_held (M) ; const int64_t Mnvec = M->nvec ; const int64_t Mvlen = M->vlen ; + const bool Mp_is_32 = M->p_is_32 ; - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Ci = C->i ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t nzombies = C->nzombies ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + void *Ch = C->h ; + void *Ci = C->i ; + const bool C_is_hyper = (C->h != NULL) ; + const bool may_see_zombies = (C->nzombies > 0) ; const int64_t Cnvec = C->nvec ; const int64_t Cvlen = C->vlen ; + const bool Cp_is_32 = C->p_is_32 ; + const bool Cj_is_32 = C->j_is_32 ; + const bool Ci_is_32 = C->i_is_32 ; //-------------------------------------------------------------------------- // allocate the initial TaskList @@ -149,7 +181,7 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Mp, Mnvec, ntasks1, false) ; + GB_p_slice (Coarse, Mp, Mp_is_32, Mnvec, ntasks1, false) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine @@ -222,12 +254,12 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) //------------------------------------------------------------------ ASSERT (k >= 0 && k < Mnvec) ; - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; ASSERT (j >= 0 && j < nJ) ; // lookup jC in C // jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, Jkind, Jcolon) ; int64_t pC_start, pC_end ; GB_LOOKUP_VECTOR_C (jC, pC_start, pC_end) ; @@ -237,7 +269,8 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) // determine the # of fine-grain tasks to create for vector k //------------------------------------------------------------------ - int64_t mknz = (Mp == NULL) ? Mvlen : (Mp [k+1] - Mp [k]) ; + int64_t mknz = (Mp == NULL) ? + Mvlen : (GB_IGET (Mp, k+1) - GB_IGET (Mp, k)) ; int nfine = ((double) mknz) / target_task_size ; nfine = GB_IMAX (nfine, 1) ; @@ -279,7 +312,7 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) // slice M(:,k) for this task int64_t p1, p2 ; GB_PARTITION (p1, p2, mknz, tfine, nfine) ; - int64_t pM_start = GBP_M (Mp, k, Mvlen) ; + int64_t pM_start = GBp_M (Mp, k, Mvlen) ; int64_t pM = pM_start + p1 ; int64_t pM_end = pM_start + p2 ; TaskList [ntasks].pA = pM ; @@ -294,10 +327,10 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) else { // find where this task starts and ends in C(:,jC) - int64_t iM_start = GBI_M (Mi, pM, Mvlen) ; - int64_t iC1 = GB_ijlist (I, iM_start, Ikind, Icolon) ; - int64_t iM_end = GBI_M (Mi, pM_end-1, Mvlen) ; - int64_t iC2 = GB_ijlist (I, iM_end, Ikind, Icolon) ; + int64_t iM_start = GBi_M (Mi, pM, Mvlen) ; + int64_t iC1 = GB_IJLIST (I, iM_start, Ikind, Icolon) ; + int64_t iM_end = GBi_M (Mi, pM_end-1, Mvlen) ; + int64_t iC2 = GB_IJLIST (I, iM_end, Ikind, Icolon) ; // If I is an explicit list, it must be already sorted // in ascending order, and thus iC1 <= iC2. If I is @@ -312,14 +345,15 @@ GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) int64_t pleft = pC_start ; int64_t pright = pC_end - 1 ; bool found, is_zombie ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (iC_start, Ci, - pleft, pright, found, nzombies, is_zombie) ; + GB_split_binary_search_zombie (iC_start, Ci, Ci_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; TaskList [ntasks].pC = pleft ; pleft = pC_start ; pright = pC_end - 1 ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (iC_end, Ci, - pleft, pright, found, nzombies, is_zombie) ; + found = + GB_split_binary_search_zombie (iC_end, Ci, Ci_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; TaskList [ntasks].pC_end = (found) ? (pleft+1) : pleft ; } diff --git a/GraphBLAS/Source/assign/GB_subassign_scalar.c b/GraphBLAS/Source/assign/GB_subassign_scalar.c index 781db9035c..6e77eddc22 100644 --- a/GraphBLAS/Source/assign/GB_subassign_scalar.c +++ b/GraphBLAS/Source/assign/GB_subassign_scalar.c @@ -2,7 +2,7 @@ // GB_subassign_scalar: C(Rows,Cols) = accum (C(Rows,Cols),x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,10 +27,12 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) const void *scalar, // scalar to assign to C(Rows,Cols) const GB_Type_code scalar_code, // type code of scalar to assign - const GrB_Index *Rows, // row indices - const GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Cols is 32-bit; else 64-bit + const uint64_t nCols, // number of column indices const GrB_Descriptor desc, // descriptor for C(Rows,Cols) and M GB_Werk Werk ) @@ -43,9 +45,11 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x GB_RETURN_IF_NULL (scalar) ; GB_RETURN_IF_NULL (Rows) ; GB_RETURN_IF_NULL (Cols) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; ASSERT (scalar_code <= GB_UDT_code) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx1, xx2, xx3, xx7) ; @@ -59,8 +63,10 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x if (M == NULL && !Mask_comp && nRows == 1 && nCols == 1 && !C_replace) { // C(i,j) = scalar or C(i,j) += scalar - return (GB_setElement (C, accum, scalar, Rows [0], Cols [0], - scalar_code, Werk)) ; + GB_IDECL (Rows, const, u) ; GB_IPTR (Rows, Rows_is_32) ; + GB_IDECL (Cols, const, u) ; GB_IPTR (Cols, Cols_is_32) ; + return (GB_setElement (C, accum, scalar, + GB_IGET (Rows, 0), GB_IGET (Cols, 0), scalar_code, Werk)) ; } else { @@ -70,11 +76,12 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x false, // do not transpose the mask accum, // for accum (C(Rows,Cols),scalar) NULL, false, // no explicit matrix A - Rows, nRows, // row indices - Cols, nCols, // column indices + Rows, Rows_is_32, nRows, // row indices + Cols, Cols_is_32, nCols, // column indices true, // do scalar expansion scalar, // scalar to assign, expands to become A scalar_code, // type code of scalar to expand Werk)) ; } } + diff --git a/GraphBLAS/Source/assign/GB_subassign_symbolic.c b/GraphBLAS/Source/assign/GB_subassign_symbolic.c index 4483c1a7a8..fb2467511c 100644 --- a/GraphBLAS/Source/assign/GB_subassign_symbolic.c +++ b/GraphBLAS/Source/assign/GB_subassign_symbolic.c @@ -2,7 +2,7 @@ // GB_subassign_symbolic: S = C(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ #include "extract/GB_subref.h" #define GB_GENERIC #include "assign/include/GB_assign_shared_definitions.h" +#include "hyper/factory/GB_lookup_debug.h" #undef GB_FREE_ALL #define GB_FREE_ALL GB_phybix_free (S) ; @@ -21,9 +22,11 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values GrB_Matrix S, // S = symbolic(C(I,J)), static header // inputs, not modified: const GrB_Matrix C, // matrix to extract the pattern of - const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc + const void *I, // I index list + const bool I_is_32, const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc + const void *J, // J index list + const bool J_is_32, const int64_t nj, // length of J, or special const bool S_must_not_be_jumbled, // if true, S cannot be jumbled GB_Werk Werk @@ -36,7 +39,7 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values GrB_Info info ; ASSERT (!GB_IS_BITMAP (C)) ; // the caller cannot tolerate C bitmap - ASSERT (S != NULL && (S->static_header || GBNSTATIC)) ; + ASSERT (S != NULL && (S->header_size == 0 || GBNSTATIC)) ; //-------------------------------------------------------------------------- // extract the pattern: S = C(I,J) for S_Extraction method, and quick mask @@ -57,7 +60,7 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values //-------------------------------------------------------------------------- // FUTURE::: if whole_C_matrix is true, then C(:,:) = ... and S == C, - // except that S is zombie-free, read-only; and C collects zombies. + // except that S is zombie-free and not modified, but C collects zombies. // FUTURE:: the properties of I and J are already known, and thus do // not need to be recomputed by GB_subref. @@ -67,7 +70,8 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values // it is always returned as hypersparse). This also checks I and J. // S is not iso, even if C is iso. S can be sparse, hypersparse, or full // (not bitmap). - GB_OK (GB_subref (S, false, C->is_csc, C, I, ni, J, nj, true, Werk)) ; + GB_OK (GB_subref (S, false, C->is_csc, C, I, I_is_32, ni, J, J_is_32, nj, + /* symbolic: */ true, Werk)) ; ASSERT (GB_JUMBLED_OK (S)) ; // GB_subref can return S as jumbled ASSERT (!GB_ZOMBIES (S)) ; ASSERT (!GB_PENDING (S)) ; @@ -100,37 +104,48 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values // this body of code explains what S contains. // S is nI-by-nJ where nI = length (I) and nJ = length (J) + // get I and J int64_t nI, Icolon [3], nJ, Jcolon [3] ; int Ikind, Jkind ; - GB_ijlength (I, ni, C->vlen, &nI, &Ikind, Icolon) ; - GB_ijlength (J, nj, C->vdim, &nJ, &Jkind, Jcolon) ; + GB_ijlength (I, I_is_32, ni, C->vlen, &nI, &Ikind, Icolon) ; + GB_ijlength (J, J_is_32, nj, C->vdim, &nJ, &Jkind, Jcolon) ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; // get S - const int64_t *restrict Sp = S->p ; - const int64_t *restrict Sh = S->h ; - const int64_t *restrict Si = S->i ; - const int64_t *restrict Sx = (int64_t *) S->x ; + ASSERT (S->type == GrB_UINT32 || S->type == GrB_UINT64) ; + const bool Sx_is_32 = (S->type->code == GB_UINT32_code) ; + GB_Sp_DECLARE (Sp, const) ; GB_Sp_PTR (Sp, S) ; + GB_Sh_DECLARE (Sh, const) ; GB_Sh_PTR (Sh, S) ; + GB_Si_DECLARE (Si, const) ; GB_Si_PTR (Si, S) ; + GB_MDECL (Sx, const, u) ; + Sx = S->x ; + GB_IPTR (Sx, Sx_is_32) ; + + // get C + GB_Ci_DECLARE (Ci, const) ; GB_Ci_PTR (Ci, C) ; + // for each vector of S for (int64_t k = 0 ; k < S->nvec ; k++) { // prepare to iterate over the entries of vector S(:,jnew) - int64_t jnew = GBH_S (Sh, k) ; - int64_t pS_start = GBP_S (Sp, k, S->vlen) ; - int64_t pS_end = GBP_S (Sp, k+1, S->vlen) ; + int64_t jnew = GBh_S (Sh, k) ; + int64_t pS_start = GBp_S (Sp, k, S->vlen) ; + int64_t pS_end = GBp_S (Sp, k+1, S->vlen) ; // S (inew,jnew) corresponds to C (iC, jC) ; // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, jnew, Jkind, Jcolon) ; + int64_t jC = GB_IJLIST (J, jnew, Jkind, Jcolon) ; for (int64_t pS = pS_start ; pS < pS_end ; pS++) { // S (inew,jnew) is a pointer back into C (I(inew), J(jnew)) - int64_t inew = GBI_S (Si, pS, S->vlen) ; + int64_t inew = GBi_S (Si, pS, S->vlen) ; ASSERT (inew >= 0 && inew < nI) ; // iC = I [iA] ; or I is a colon expression - int64_t iC = GB_ijlist (I, inew, Ikind, Icolon) ; - int64_t p = Sx [pS] ; + int64_t iC = GB_IJLIST (I, inew, Ikind, Icolon) ; + int64_t p = GB_IGET (Sx, pS) ; ASSERT (p >= 0 && p < GB_nnz (C)) ; int64_t pC_start, pC_end, pleft = 0, pright = C->nvec-1 ; - bool found = GB_lookup (C->h != NULL, // for debug only + bool found = GB_lookup_debug (C->p_is_32, C->j_is_32, C->h != NULL, C->h, C->p, C->vlen, &pleft, pright, jC, &pC_start, &pC_end) ; ASSERT (found) ; // If iC == I [inew] and jC == J [jnew], (or the equivaleent @@ -138,7 +153,7 @@ GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values // assigned to C(iC,jC), and p = S(inew,jnew) gives the pointer // into C to where the entry (C(iC,jC) appears in C: ASSERT (pC_start <= p && p < pC_end) ; - ASSERT (iC == GB_UNZOMBIE (GBI_C (C->i, p, C->vlen))) ; + ASSERT (iC == GB_UNZOMBIE (GBi_C (Ci, p, C->vlen))) ; } } #endif diff --git a/GraphBLAS/Source/assign/GB_subassign_zombie.c b/GraphBLAS/Source/assign/GB_subassign_zombie.c index 54317e952d..ddfa141dc3 100644 --- a/GraphBLAS/Source/assign/GB_subassign_zombie.c +++ b/GraphBLAS/Source/assign/GB_subassign_zombie.c @@ -2,7 +2,7 @@ // GB_subassign_zombie: C(I,J) = empty ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,12 +32,14 @@ GrB_Info GB_subassign_zombie ( GrB_Matrix C, // input: - const GrB_Index *I, + const void *I, // I index list + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, + const void *J, // J index list + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -59,8 +61,9 @@ GrB_Info GB_subassign_zombie //-------------------------------------------------------------------------- struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, false, Werk)) ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_subassign_symbolic (S, C, I, I_is_32, ni, J, J_is_32, nj, + /* S_can_be_jumbled: */ false, Werk)) ; ASSERT (GB_JUMBLED_OK (S)) ; // S can be returned as jumbled // the S->Y hyper_hash is not needed @@ -68,8 +71,13 @@ GrB_Info GB_subassign_zombie // get inputs //-------------------------------------------------------------------------- - const int64_t *restrict Sx = (int64_t *) S->x ; - int64_t *restrict Ci = C->i ; + ASSERT (S->type == GrB_UINT32 || S->type == GrB_UINT64) ; + const bool Sx_is_32 = (S->type->code == GB_UINT32_code) ; + GB_MDECL (Sx, const, u) ; + Sx = S->x ; + GB_IPTR (Sx, Sx_is_32) ; + + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; //-------------------------------------------------------------------------- // Method 00: C(I,J) = empty ; using S @@ -98,8 +106,8 @@ GrB_Info GB_subassign_zombie for (pS = 0 ; pS < snz ; pS++) { // S (inew,jnew) is a pointer back into C (I(inew), J(jnew)) - int64_t pC = Sx [pS] ; - int64_t i = Ci [pC] ; + int64_t pC = GB_IGET (Sx, pS) ; + int64_t i = GB_IGET (Ci, pC) ; // ----[X A 0] or [X . 0]----------------------------------------------- // action: ( X ): still a zombie // ----[C A 0] or [C . 0]----------------------------------------------- @@ -107,7 +115,8 @@ GrB_Info GB_subassign_zombie if (!GB_IS_ZOMBIE (i)) { nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } diff --git a/GraphBLAS/Source/assign/GB_subassigner.c b/GraphBLAS/Source/assign/GB_subassigner.c index 9563a6cbef..d64653c741 100644 --- a/GraphBLAS/Source/assign/GB_subassigner.c +++ b/GraphBLAS/Source/assign/GB_subassigner.c @@ -2,7 +2,7 @@ // GB_subassigner: C(I,J)<#M> = accum (C(I,J), A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -75,19 +75,21 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),A) const GrB_Matrix A, // input matrix (NULL for scalar expansion) - const GrB_Index *I, // list of indices - const int64_t ni, // number of indices + const void *I, // I index list + const bool I_is_32, + const int64_t ni, // number of indices const int64_t nI, const int Ikind, const int64_t Icolon [3], - const GrB_Index *J, // list of vector indices - const int64_t nj, // number of column indices + const void *J, // J index list + const bool J_is_32, + const int64_t nj, // number of column indices const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded - const GrB_Type scalar_type, // type of scalar to expand + const GrB_Type scalar_type, // type code of scalar to expand GB_Werk Werk ) { @@ -235,7 +237,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // sparsity (if present). GBURBLE ("Method: bitmap_subassign ") ; GB_OK (GB_bitmap_assign (C, C_replace, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, GB_SUBASSIGN, Werk)) ; } @@ -351,7 +354,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 05: C(%s,%s) = scalar ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_05 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, scalar, scalar_type, Werk)) ; } break ; @@ -362,7 +366,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 07: C(%s,%s) += scalar ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_07 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, scalar_type, Werk)) ; } break ; @@ -386,8 +391,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // Method 08n: C(I,J) += A ; no S GBURBLE ("Method 08n: C(%s,%s) += Z ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_08n (C, - I, ni, nI, Ikind, Icolon, - J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, Werk)) ; } break ; @@ -398,7 +403,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 08s: C(%s,%s) += Z ; with S ", Istring, Jstring) ; GB_OK (GB_subassign_08s_and_16 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, false, Mask_struct, accum, A, Werk)) ; } break ; @@ -426,7 +432,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // Method 06n: C(I,J) = A ; no S GBURBLE ("Method 06n: C(%s,%s) = Z ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_06n (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, A, Werk)) ; } break ; @@ -437,7 +444,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 06s: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_06s_and_14 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, false, Mask_struct, A, Werk)) ; } break ; @@ -461,7 +469,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 01: C(%s,%s) = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_01 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, scalar, scalar_type, Werk)) ; } break ; @@ -472,7 +481,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 03: C(%s,%s) += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_03 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, accum, scalar, scalar_type, Werk)) ; } break ; @@ -494,7 +504,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 02: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_02 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, A, Werk)) ; } break ; @@ -504,7 +515,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // Method 04: C(I,J) += A ; using S GBURBLE ("Method 04: C(%s,%s) += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_04 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, accum, A, Werk)) ; } break ; @@ -529,7 +541,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 17: C(%s,%s) = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_17 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, scalar, scalar_type, Werk)) ; } break ; @@ -540,7 +553,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 13: C(%s,%s) = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_13 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, scalar, scalar_type, Werk)) ; } break ; @@ -551,7 +565,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 09: C(%s,%s) = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_09 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, scalar, scalar_type, Werk)) ; } break ; @@ -562,7 +577,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 19: C(%s,%s) += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_19 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, scalar_type, Werk)) ; } break ; @@ -573,7 +589,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 15: C(%s,%s) += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_15 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, scalar_type, Werk)) ; } break ; @@ -584,7 +601,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 11: C(%s,%s) += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_11 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, scalar_type, Werk)) ; } break ; @@ -609,7 +627,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 18: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_10_and_18 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, true, Mask_struct, A, Werk)) ; } break ; @@ -620,7 +639,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 14: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_06s_and_14 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, true, Mask_struct, A, Werk)) ; } break ; @@ -631,7 +651,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 10: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_10_and_18 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, false, Mask_struct, A, Werk)) ; } break ; @@ -642,7 +663,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 20: C(%s,%s) += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_12_and_20 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, true, Mask_struct, accum, A, Werk)) ; } break ; @@ -653,7 +675,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 16: C(%s,%s) += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_08s_and_16 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, true, Mask_struct, accum, A, Werk)) ; } break ; @@ -664,7 +687,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 12: C(%s,%s) += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_12_and_20 (C, - I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + I, I_is_32, ni, nI, Ikind, Icolon, + J, J_is_32, nj, nJ, Jkind, Jcolon, M, false, Mask_struct, accum, A, Werk)) ; } break ; diff --git a/GraphBLAS/Source/assign/GB_subassigner_method.c b/GraphBLAS/Source/assign/GB_subassigner_method.c index d7a9d25b78..89b699261a 100644 --- a/GraphBLAS/Source/assign/GB_subassigner_method.c +++ b/GraphBLAS/Source/assign/GB_subassigner_method.c @@ -2,7 +2,7 @@ // GB_subassigner_method: determine method for GB_subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -50,7 +50,6 @@ int GB_subassigner_method // return method to use in GB_subassigner bool A_is_bitmap = GB_IS_BITMAP (A) ; bool A_is_full = GB_IS_FULL (A) ; - bool A_is_sparse = GB_IS_SPARSE (A) ; int64_t anz = GB_nnz (A) ; // these properties of C are not affected by wait(C): @@ -465,10 +464,11 @@ int GB_subassigner_method // return method to use in GB_subassigner { if (accum == NULL) { + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; if (Ikind == GB_ALL && GB_IS_HYPERSPARSE (C) && GB_IS_SPARSE (A) && (Jkind == GB_RANGE) && (nJ >= 1) && (Jcolon [0] == - ((C->nvec == 0) ? 0 : (C->h [C->nvec-1] + 1))) + ((C->nvec == 0) ? 0 : (GB_IGET (Ch, C->nvec-1) + 1))) && (C->type == A->type) && !(A->iso) // FUTURE: allow A to be iso && !(C->iso)) // FUTURE: allow C to be iso diff --git a/GraphBLAS/Source/assign/GrB_Col_assign.c b/GraphBLAS/Source/assign/GrB_Col_assign.c index fa0210b40d..50605bc35e 100644 --- a/GraphBLAS/Source/assign/GrB_Col_assign.c +++ b/GraphBLAS/Source/assign/GrB_Col_assign.c @@ -1,28 +1,25 @@ //------------------------------------------------------------------------------ -// GrB_Col_assign: C(Rows,col) = accum (C(Rows,col),u) +// GrB_Col_assign: C(I,j) = accum (C(I,j),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Compare with GxB_Col_subassign, which uses the M and C_replace differently - #include "assign/GB_assign.h" -#include "assign/GB_bitmap_assign.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Col_assign // C(Rows,col) = accum (C(Rows,col),u) +GrB_Info GrB_Col_assign // C(I,j) = accum (C(I,j),u) ( GrB_Matrix C, // input/output matrix for results - const GrB_Vector M_in, // mask for C(:,col), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(Rows,col),t) + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) const GrB_Vector u, // input vector - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices - GrB_Index col, // column index - const GrB_Descriptor desc // descriptor for C(:,col) and M + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for C(:,j) and M ) { @@ -30,12 +27,14 @@ GrB_Info GrB_Col_assign // C(Rows,col) = accum (C(Rows,col),u) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Col_assign (C, M, accum, u, Rows, nRows, col, desc)") ; + GB_WHERE3 (C, mask, u, + "GrB_Col_assign (C, M, accum, u, I, ni, j, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -43,24 +42,24 @@ GrB_Info GrB_Col_assign // C(Rows,col) = accum (C(Rows,col),u) xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,col) = accum (C(Rows,col), u) + // C(I,j) = accum (C(I,j), u) //-------------------------------------------------------------------------- - // construct the column index list Cols = [ col ] of length nCols = 1 - GrB_Index Cols [1] ; - Cols [0] = col ; + // construct the index list J = [ j ] of length nj = 1 + uint64_t J [1] ; + J [0] = j ; info = GB_assign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask and its descriptor false, // do not transpose the mask - accum, // for accum (C(Rows,col),u) + accum, // for accum (C(I,j),u) (GrB_Matrix) u, false, // u as a matrix; never transposed - Rows, nRows, // row indices - Cols, 1, // a single column index + I, false, ni, // row indices + J, false, 1, // a single column index false, NULL, GB_ignore_code, // no scalar expansion GB_COL_ASSIGN, Werk) ; @@ -68,3 +67,4 @@ GrB_Info GrB_Col_assign // C(Rows,col) = accum (C(Rows,col),u) GB_BURBLE_END ; return (info) ; } + diff --git a/GraphBLAS/Source/assign/GrB_Matrix_assign.c b/GraphBLAS/Source/assign/GrB_Matrix_assign.c index 0db15b7561..7363910b91 100644 --- a/GraphBLAS/Source/assign/GrB_Matrix_assign.c +++ b/GraphBLAS/Source/assign/GrB_Matrix_assign.c @@ -1,26 +1,25 @@ //------------------------------------------------------------------------------ -// GrB_Matrix_assign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' +// GrB_Matrix_assign: C(I,J) = accum (C(I,J),A) or A' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "assign/GB_assign.h" -#include "assign/GB_bitmap_assign.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Matrix_assign // C(Rows,Cols) += A or A' +GrB_Info GrB_Matrix_assign // C(I,J) += A or A' ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // mask for C, unused if NULL - const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) + const GrB_Matrix Mask, // mask for C, unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) const GrB_Matrix A, // first input: matrix A - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - GrB_Index nCols, // number of column indices + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const uint64_t *J, // column indices + uint64_t nj, // number of column indices const GrB_Descriptor desc // descriptor for C, M, and A ) { @@ -29,33 +28,32 @@ GrB_Info GrB_Matrix_assign // C(Rows,Cols) += A or A' // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_assign" - " (C, M, accum, A, Rows, nRows, Cols, nCols, desc)") ; + GB_WHERE3 (C, Mask, A, + "GrB_Matrix_assign (C, M, accum, A, I, ni, J, nj, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,Cols) = accum (C(Rows,Cols), A) and variations + // C(I,J) = accum (C(I,J), A) //-------------------------------------------------------------------------- info = GB_assign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask matrix and its descriptor false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),A) + accum, // for accum (C(I,J),A) A, A_transpose, // A and its descriptor (T=A or A') - Rows, nRows, // row indices - Cols, nCols, // column indices + I, false, ni, // row indices + J, false, nj, // column indices false, NULL, GB_ignore_code, // no scalar expansion GB_ASSIGN, Werk) ; diff --git a/GraphBLAS/Source/assign/GrB_Matrix_assign_scalar.c b/GraphBLAS/Source/assign/GrB_Matrix_assign_scalar.c index dc61d8f502..52689618cb 100644 --- a/GraphBLAS/Source/assign/GrB_Matrix_assign_scalar.c +++ b/GraphBLAS/Source/assign/GrB_Matrix_assign_scalar.c @@ -2,7 +2,7 @@ // GrB_Matrix_assign_[SCALAR]: assign a scalar to matrix, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,32 +21,29 @@ #define GB_FREE_ALL ; #include "assign/GB_assign.h" -#include "ij/GB_ij.h" -#include "mask/GB_get_mask.h" - -#define GB_ASSIGN_SCALAR(prefix,type,T,ampersand) \ -GrB_Info GB_EVAL3 (prefix, _Matrix_assign_, T) /* C(Rows,Cols) += x */ \ -( \ - GrB_Matrix C, /* input/output matrix for results */ \ - const GrB_Matrix M, /* optional mask for C */ \ - const GrB_BinaryOp accum, /* accum for Z=accum(C(Rows,Cols),x) */ \ - type x, /* scalar to assign to C(Rows,Cols) */ \ - const GrB_Index *Rows, /* row indices */ \ - GrB_Index nRows, /* number of row indices */ \ - const GrB_Index *Cols, /* column indices */ \ - GrB_Index nCols, /* number of column indices */ \ - const GrB_Descriptor desc /* descriptor for C and M */ \ -) \ -{ \ - GB_WHERE (C, "GrB_Matrix_assign_" GB_STR(T) \ - " (C, M, accum, x, Rows, nRows, Cols, nCols, desc)") ; \ - GB_BURBLE_START ("GrB_assign") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ - GB_RETURN_IF_FAULTY (M) ; \ - GrB_Info info = GB_assign_scalar (C, M, accum, ampersand x, \ - GB_## T ## _code, Rows, nRows, Cols, nCols, desc, Werk) ; \ - GB_BURBLE_END ; \ - return (info) ; \ + +#define GB_ASSIGN_SCALAR(prefix,type,T,ampersand) \ +GrB_Info GB_EVAL3 (prefix, _Matrix_assign_, T) /* C(Rows,Cols) += x */ \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix M, /* optional mask for C */ \ + const GrB_BinaryOp accum, /* accum for Z=accum(C(Rows,Cols),x) */ \ + type x, /* scalar to assign to C(Rows,Cols) */ \ + const uint64_t *Rows, /* row indices */ \ + uint64_t nRows, /* number of row indices */ \ + const uint64_t *Cols, /* column indices */ \ + uint64_t nCols, /* number of column indices */ \ + const GrB_Descriptor desc /* descriptor for C and M */ \ +) \ +{ \ + GB_WHERE2 (C, M, "GrB_Matrix_assign_" GB_STR(T) \ + " (C, M, accum, x, Rows, nRows, Cols, nCols, desc)") ; \ + GB_RETURN_IF_NULL (C) ; \ + GB_BURBLE_START ("GrB_assign") ; \ + info = GB_assign_scalar (C, M, accum, ampersand x, GB_## T ## _code, \ + Rows, false, nRows, Cols, false, nCols, desc, Werk) ; \ + GB_BURBLE_END ; \ + return (info) ; \ } GB_ASSIGN_SCALAR (GrB, bool , BOOL , &) @@ -72,147 +69,44 @@ GB_ASSIGN_SCALAR (GrB, void * , UDT , ) // scalar assignment above. // If the GrB_Scalar s is empty of type stype, then this is identical to: -// GrB_Matrix_new (&S, stype, nRows, nCols) ; -// GrB_Matrix_assign (C, M, accum, S, Rows, nRows, Cols, nCols, desc) ; -// GrB_Matrix_free (&S) ; - -#undef GB_FREE_ALL -#define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/include/GB_static_header.h" +// GrB_Matrix_new (&A, stype, nRows, nCols) ; +// GrB_Matrix_assign (C, M, accum, A, Rows, nRows, Cols, nCols, desc) ; +// GrB_Matrix_free (&A) ; GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),s) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix Mask, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar scalar, // scalar to assign to C(I,J) - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const uint64_t *J, // column indices + uint64_t nj, // number of column indices const GrB_Descriptor desc // descriptor for C and Mask ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GrB_Matrix S = NULL ; - GB_WHERE (C, "GrB_Matrix_assign_Scalar" - " (C, M, accum, s, Rows, nRows, Cols, nCols, desc)") ; + GB_WHERE3 (C, Mask, scalar, + "GrB_Matrix_assign_Scalar (C, M, accum, s, I, ni, J, nj, desc)") ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL (I) ; - GB_RETURN_IF_NULL (J) ; - - // if C has a user-defined type, its type must match the scalar type - if (C->type->code == GB_UDT_code && C->type != scalar->type) - { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" - "cannot be typecast to output of type [%s]", - scalar->type->name, C->type->name) ; - } - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - xx1, xx2, xx3, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,Cols) = accum (C(Rows,Cols), scalar) + // C(I,J) = accum (C(I,J), scalar) //-------------------------------------------------------------------------- - GrB_Index nvals ; - GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; - - if (M == NULL && !Mask_comp && ni == 1 && nj == 1 && !C_replace) - { - - //---------------------------------------------------------------------- - // scalar assignment - //---------------------------------------------------------------------- - - const GrB_Index row = I [0] ; - const GrB_Index col = J [0] ; - if (nvals == 1) - { - // set the element: C(row,col) += scalar or C(row,col) = scalar - info = GB_setElement (C, accum, scalar->x, row, col, - scalar->type->code, Werk) ; - } - else if (accum == NULL) - { - // delete the C(row,col) element - info = GB_Matrix_removeElement (C, row, col, Werk) ; - } - - } - else if (nvals == 1) - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has a single entry - //---------------------------------------------------------------------- - - // This is identical to non-opaque scalar assignment - - info = GB_assign ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),scalar) - NULL, false, // no explicit matrix A - I, ni, // row indices - J, nj, // column indices - true, // do scalar expansion - scalar->x, // scalar to assign, expands to become A - scalar->type->code, // type code of scalar to expand - GB_ASSIGN, - Werk) ; - - } - else - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has no entry - //---------------------------------------------------------------------- - - // determine the properites of the I and J index lists - int64_t nRows, nCols, RowColon [3], ColColon [3] ; - int RowsKind, ColsKind ; - GB_ijlength (I, ni, GB_NROWS (C), &nRows, &RowsKind, RowColon); - GB_ijlength (J, nj, GB_NCOLS (C), &nCols, &ColsKind, ColColon); - - // create an empty matrix S of the right size, and use matrix assign - struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - bool is_csc = C->is_csc ; - int64_t vlen = is_csc ? nRows : nCols ; - int64_t vdim = is_csc ? nCols : nRows ; - GB_OK (GB_new (&S, // existing header - scalar->type, vlen, vdim, GB_Ap_calloc, is_csc, GxB_AUTO_SPARSITY, - GB_HYPER_SWITCH_DEFAULT, 1)) ; - info = GB_assign ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),A) - S, false, // S matrix and its descriptor - I, ni, // row indices - J, nj, // column indices - false, NULL, GB_ignore_code, // no scalar expansion - GB_ASSIGN, - Werk) ; - GB_FREE_ALL ; - } + GB_OK (GB_Matrix_assign_scalar (C, Mask, accum, scalar, + I, false, ni, J, false, nj, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- GB_BURBLE_END ; - return (info) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/assign/GrB_Row_assign.c b/GraphBLAS/Source/assign/GrB_Row_assign.c index 476fe6420a..e723206887 100644 --- a/GraphBLAS/Source/assign/GrB_Row_assign.c +++ b/GraphBLAS/Source/assign/GrB_Row_assign.c @@ -1,28 +1,25 @@ //------------------------------------------------------------------------------ -// GrB_Row_assign: C(row,Cols) = accum (C(row,Cols),u') +// GrB_Row_assign: C(i,J) = accum (C(i,J),u') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Compare with GxB_Row_subassign, which uses M and C_replace differently - #include "assign/GB_assign.h" -#include "assign/GB_bitmap_assign.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Row_assign // C(row,Cols) += u' +GrB_Info GrB_Row_assign // C(i,J) = accum (C(i,J),u') ( GrB_Matrix C, // input/output matrix for results - const GrB_Vector M_in, // M for C(row,:), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(row,Cols),t) + const GrB_Vector mask, // optional mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) const GrB_Vector u, // input vector - GrB_Index row, // row index - const GrB_Index *Cols, // column indices - GrB_Index nCols, // number of column indices - const GrB_Descriptor desc // descriptor for C(row,:) and M + uint64_t i, // row index + const uint64_t *J, // column indices + uint64_t nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(i,:) and mask ) { @@ -30,12 +27,14 @@ GrB_Info GrB_Row_assign // C(row,Cols) += u' // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Row_assign (C, M, accum, u, row, Cols, nCols, desc)") ; + GB_WHERE3 (C, mask, u, + "GrB_Row_assign (C, M, accum, u, i, J, nj, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -43,24 +42,24 @@ GrB_Info GrB_Row_assign // C(row,Cols) += u' xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(row,Cols) = accum (C(row,Cols), u') + // C(i,J) = accum (C(i,J), u') //-------------------------------------------------------------------------- - // construct the row index list Rows = [ row ] of length nRows = 1 - GrB_Index Rows [1] ; - Rows [0] = row ; + // construct the index list I = [ i ] of length ni = 1 + uint64_t I [1] ; + I [0] = i ; // OK: 64-bit only info = GB_assign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask and its descriptor true, // transpose the mask - accum, // for accum (C(Rows,col),u) + accum, // for accum (C(i,J),u) (GrB_Matrix) u, true, // u as a matrix; always transposed - Rows, 1, // a single row index - Cols, nCols, // column indices + I, false, 1, // a single row index (64-bit) + J, false, nj, // column indices (64-bit) false, NULL, GB_ignore_code, // no scalar expansion GB_ROW_ASSIGN, Werk) ; diff --git a/GraphBLAS/Source/assign/GrB_Vector_assign.c b/GraphBLAS/Source/assign/GrB_Vector_assign.c index 4b1fc7850d..6e2092f675 100644 --- a/GraphBLAS/Source/assign/GrB_Vector_assign.c +++ b/GraphBLAS/Source/assign/GrB_Vector_assign.c @@ -2,7 +2,7 @@ // GrB_Vector_assign: w(Rows) = accum (w(Rows),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,7 @@ #include "assign/GB_assign.h" #include "assign/GB_bitmap_assign.h" #include "mask/GB_get_mask.h" +#define GB_FREE_ALL ; GrB_Info GrB_Vector_assign // w(Rows) = accum (w(Rows),u) ( @@ -19,8 +20,8 @@ GrB_Info GrB_Vector_assign // w(Rows) = accum (w(Rows),u) const GrB_Vector M_in, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w(Rows),t) const GrB_Vector u, // first input: vector u - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices + const uint64_t *Rows, // row indices + uint64_t nRows, // number of row indices const GrB_Descriptor desc // descriptor for w and M ) { @@ -29,11 +30,13 @@ GrB_Info GrB_Vector_assign // w(Rows) = accum (w(Rows),u) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_assign (w, M, accum, u, Rows, nRows, desc)") ; + GB_WHERE3 (w, M_in, u, + "GrB_Vector_assign (w, M, accum, u, Rows, nRows, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; ASSERT (GB_VECTOR_OK (u)) ; @@ -46,7 +49,7 @@ GrB_Info GrB_Vector_assign // w(Rows) = accum (w(Rows),u) GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // w(Rows) = accum (w(Rows), u) and variations + // w(Rows) = accum (w(Rows), u) //-------------------------------------------------------------------------- info = GB_assign ( @@ -55,8 +58,8 @@ GrB_Info GrB_Vector_assign // w(Rows) = accum (w(Rows),u) false, // do not transpose the mask accum, // for accum (C(Rows,:),A) (GrB_Matrix) u, false, // u as a matrix; never transposed - Rows, nRows, // row indices - GrB_ALL, 1, // all column indices + Rows, false, nRows, // row indices + GrB_ALL, false, 1, // all column indices false, NULL, GB_ignore_code, // no scalar expansion GB_ASSIGN, Werk) ; diff --git a/GraphBLAS/Source/assign/GrB_Vector_assign_scalar.c b/GraphBLAS/Source/assign/GrB_Vector_assign_scalar.c index 6d77de3c46..39173cddea 100644 --- a/GraphBLAS/Source/assign/GrB_Vector_assign_scalar.c +++ b/GraphBLAS/Source/assign/GrB_Vector_assign_scalar.c @@ -2,43 +2,41 @@ // GrB_Vector_assign_[SCALAR]: assign scalar to vector, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Assigns a single scalar to a vector, w(Rows) = accum(w(Rows),x) -// The scalar x is implicitly expanded into a vector u of size nRows-by-1, +// Assigns a single scalar to a vector, w(I) = accum(w(I),x) +// The scalar x is implicitly expanded into a vector u of size ni-by-1, // with each entry in u equal to x. #define GB_FREE_ALL ; #include "assign/GB_assign.h" -#include "ij/GB_ij.h" -#include "mask/GB_get_mask.h" - -#define GB_ASSIGN_SCALAR(prefix,type,T,ampersand) \ -GrB_Info GB_EVAL3 (prefix, _Vector_assign_, T) /* w(Rows)=accum(w(Rows),x)*/\ -( \ - GrB_Vector w, /* input/output vector for results */ \ - const GrB_Vector M, /* optional mask for w */ \ - const GrB_BinaryOp accum, /* optional accum for Z=accum(w(Rows),x)*/ \ - type x, /* scalar to assign to w(Rows) */ \ - const GrB_Index *Rows, /* row indices */ \ - GrB_Index nRows, /* number of row indices */ \ - const GrB_Descriptor desc /* descriptor for w and mask */ \ -) \ -{ \ - GB_WHERE (w, "GrB_Vector_assign_" GB_STR(T) \ - " (w, M, accum, x, Rows, nRows, desc)") ; \ - GB_BURBLE_START ("GrB_assign") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ - GB_RETURN_IF_FAULTY (M) ; \ - ASSERT (GB_VECTOR_OK (w)) ; \ - ASSERT (GB_IMPLIES (M != NULL, GB_VECTOR_OK (M))) ; \ - GrB_Info info = GB_assign_scalar ((GrB_Matrix) w, (GrB_Matrix) M, accum, \ - ampersand x, GB_## T ## _code, Rows, nRows, GrB_ALL, 1, desc, Werk) ; \ - GB_BURBLE_END ; \ - return (info) ; \ + +#define GB_ASSIGN_SCALAR(prefix,type,T,ampersand) \ +GrB_Info GB_EVAL3 (prefix, _Vector_assign_, T) /* w(I)=accum(w(I),x)*/ \ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector M, /* optional mask for w */ \ + const GrB_BinaryOp accum, /* opt. accum for Z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const uint64_t *I, /* row indices */ \ + uint64_t ni, /* number of row indices */ \ + const GrB_Descriptor desc /* descriptor for w and mask */ \ +) \ +{ \ + GB_WHERE2 (w, M, "GrB_Vector_assign_" GB_STR(T) \ + " (w, M, accum, x, I, ni, desc)") ; \ + GB_RETURN_IF_NULL (w) ; \ + GB_BURBLE_START ("GrB_assign") ; \ + ASSERT (GB_VECTOR_OK (w)) ; \ + ASSERT (GB_IMPLIES (M != NULL, GB_VECTOR_OK (M))) ; \ + info = GB_assign_scalar ((GrB_Matrix) w, (GrB_Matrix) M, accum, \ + ampersand x, GB_## T ## _code, \ + I, false, ni, GrB_ALL, false, 1, desc, Werk) ; \ + GB_BURBLE_END ; \ + return (info) ; \ } GB_ASSIGN_SCALAR (GrB, bool , BOOL , &) @@ -64,140 +62,42 @@ GB_ASSIGN_SCALAR (GrB, void * , UDT , ) // scalar subassignment above. // If the GrB_Scalar s is empty of type stype, then this is identical to: -// GrB_Vector_new (&S, stype, nRows) ; -// GrB_Vector_assign (w, M, accum, S, Rows, nRows, desc) ; -// GrB_Vector_free (&S) ; - -#undef GB_FREE_ALL -#define GB_FREE_ALL GB_Matrix_free (&S) ; +// GrB_Vector_new (&A, stype, ni) ; +// GrB_Vector_assign (w, M, accum, A, I, ni, desc) ; +// GrB_Vector_free (&A) ; -GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),s) +GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),s) ( GrB_Vector w, // input/output matrix for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector mask, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar scalar, // scalar to assign to w(I) - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and Mask + const GrB_Scalar scalar, // scalar to assign to w(I) + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GrB_Matrix S = NULL ; - GB_WHERE (w, "GrB_Vector_assign_Scalar" - " (w, M, accum, s, Rows, nRows, desc)") ; + GB_WHERE3 (w, mask, scalar, + "GrB_Vector_assign_Scalar (w, M, accum, s, I, ni, desc)") ; GB_BURBLE_START ("GrB_assign") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL (I) ; - ASSERT (GB_VECTOR_OK (w)) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; - - // if w has a user-defined type, its type must match the scalar type - if (w->type->code == GB_UDT_code && w->type != scalar->type) - { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" - "cannot be typecast to output of type [%s]", - scalar->type->name, w->type->name) ; - } - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - xx1, xx2, xx3, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // w(Rows) = accum (w(Rows), scalar) + // w(I) = accum (w(I), scalar) //-------------------------------------------------------------------------- - GrB_Index nvals ; - GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; - - if (M == NULL && !Mask_comp && ni == 1 && !C_replace) - { - - //---------------------------------------------------------------------- - // scalar assignment - //---------------------------------------------------------------------- - - const GrB_Index row = I [0] ; - if (nvals == 1) - { - // set the element: w(row) += scalar or w(row) = scalar - info = GB_setElement ((GrB_Matrix) w, accum, scalar->x, row, 0, - scalar->type->code, Werk) ; - } - else if (accum == NULL) - { - // delete the w(row) element - info = GB_Vector_removeElement (w, row, Werk) ; - } - - } - else if (nvals == 1) - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has a single entry - //---------------------------------------------------------------------- - - // This is identical to non-opaque scalar subassignment - - info = GB_assign ( - (GrB_Matrix) w, C_replace, // w vector and its descriptor - M, Mask_comp, Mask_struct, // mask vector and its descriptor - false, // do not transpose the mask - accum, // for accum (w(Rows),scalar) - NULL, false, // no explicit vector u - I, ni, // row indices - GrB_ALL, 1, // column indices - true, // do scalar expansion - scalar->x, // scalar to assign, expands to become u - scalar->type->code, // type code of scalar to expand - GB_ASSIGN, - Werk) ; - - } - else - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has no entry - //---------------------------------------------------------------------- - - // determine the properites of the I index list - int64_t nRows, RowColon [3] ; - int RowsKind ; - GB_ijlength (I, ni, GB_NROWS (w), &nRows, &RowsKind, RowColon); - - // create an empty matrix S of the right size, and use matrix assign - struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_new (&S, // existing header - scalar->type, nRows, 1, GB_Ap_calloc, true, GxB_AUTO_SPARSITY, - GB_HYPER_SWITCH_DEFAULT, 1)) ; - info = GB_assign ( - (GrB_Matrix) w, C_replace, // w vector and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (w(Rows),scalar) - S, false, // S matrix and its descriptor - I, ni, // row indices - GrB_ALL, 1, // column indices - false, NULL, GB_ignore_code, // no scalar expansion - GB_ASSIGN, - Werk) ; - GB_FREE_ALL ; - } + GB_OK (GB_Vector_assign_scalar (w, mask, accum, scalar, + I, false, ni, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- GB_BURBLE_END ; - return (info) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/assign/GxB_Col_assign_Vector.c b/GraphBLAS/Source/assign/GxB_Col_assign_Vector.c new file mode 100644 index 0000000000..c71b75d7ae --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Col_assign_Vector.c @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// GxB_Col_assign_Vector: C(I,j) = accum (C(I,j),u) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_assign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Col_assign_Vector // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(:,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for C(:,j) and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, mask, u, I_vector, + "GxB_Col_assign_Vector (C, M, accum, u, I, j, desc)") ; + GB_BURBLE_START ("GrB_assign") ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,j) = accum (C(I,j), u) + //-------------------------------------------------------------------------- + + // construct the index list J = [ j ] of length nj = 1 + uint64_t J [1] ; + J [0] = j ; + + GB_OK (GB_assign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,j),u) + (GrB_Matrix) u, false, // u as a matrix; never transposed + I, I_is_32, ni, // row indices + J, false, 1, // a single column index + false, NULL, GB_ignore_code, // no scalar expansion + GB_COL_ASSIGN, + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Col_subassign.c b/GraphBLAS/Source/assign/GxB_Col_subassign.c index 47643ede63..03f8cf671b 100644 --- a/GraphBLAS/Source/assign/GxB_Col_subassign.c +++ b/GraphBLAS/Source/assign/GxB_Col_subassign.c @@ -1,27 +1,25 @@ //------------------------------------------------------------------------------ -// GxB_Col_subassign: C(Rows,col) = accum (C(Rows,col),u) +// GxB_Col_subassign: C(I,j) = accum (C(I,j),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Compare with GrB_Col_assign, which uses M and C_replace differently - #include "assign/GB_subassign.h" #include "mask/GB_get_mask.h" -GrB_Info GxB_Col_subassign // C(Rows,col) = accum (C(Rows,col),u) +GrB_Info GxB_Col_subassign // C(I,j) = accum (C(I,j),u) ( GrB_Matrix C, // input/output matrix for results - const GrB_Vector M_in, // mask for C(Rows,col), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(Rows,col),t) + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) const GrB_Vector u, // input vector - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices - GrB_Index col, // column index - const GrB_Descriptor desc // descriptor for C(Rows,col) and M + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for C(I,j) and mask ) { @@ -29,13 +27,14 @@ GrB_Info GxB_Col_subassign // C(Rows,col) = accum (C(Rows,col),u) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Col_subassign (C, M, accum, u, Rows, nRows, col, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE3 (C, mask, u, + "GxB_Col_subassign (C, M, accum, u, I, ni, j, desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -43,24 +42,24 @@ GrB_Info GxB_Col_subassign // C(Rows,col) = accum (C(Rows,col),u) xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,col) = accum (C(Rows,col), u) and variations + // C(I,j) = accum (C(I,j), u) //-------------------------------------------------------------------------- - // construct the column index list Cols = [ col ] of length nCols = 1 - GrB_Index Cols [1] ; - Cols [0] = col ; + // construct the index list J = [ j ] of length nj = 1 + uint64_t J [1] ; + J [0] = j ; info = GB_subassign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask and its descriptor false, // do not transpose the mask - accum, // for accum (C(Rows,col),u) + accum, // for accum (C(I,j),u) (GrB_Matrix) u, false, // u as a matrix; never transposed - Rows, nRows, // row indices - Cols, 1, // a single column index + I, false, ni, // row indices + J, false, 1, // a single column index false, NULL, GB_ignore_code, // no scalar expansion Werk) ; diff --git a/GraphBLAS/Source/assign/GxB_Col_subassign_Vector.c b/GraphBLAS/Source/assign/GxB_Col_subassign_Vector.c new file mode 100644 index 0000000000..87c38c3d99 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Col_subassign_Vector.c @@ -0,0 +1,88 @@ +//------------------------------------------------------------------------------ +// GxB_Col_subassign_Vector: C(I,j) = accum (C(I,j),u) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_subassign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Col_subassign_Vector // C(I,j) = accum (C(I,j),u) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(I,j), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(I,j),t) + const GrB_Vector u, // input vector + const GrB_Vector I_vector, // row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for C(I,j) and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, mask, u, I_vector, + "GxB_Col_subassign_Vector (C, M, accum, u, I, ni, j, desc)") ; + GB_BURBLE_START ("GxB_subassign") ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,j) = accum (C(I,j), u) + //-------------------------------------------------------------------------- + + // construct the index list J = [ j ] of length nj = 1 + uint64_t J [1] ; + J [0] = j ; + + GB_OK (GB_subassign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,j),u) + (GrB_Matrix) u, false, // u as a matrix; never transposed + I, I_is_32, ni, // row indices + J, false, 1, // a single column index + false, NULL, GB_ignore_code, // no scalar expansion + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Matrix_assign_Scalar_Vector.c b/GraphBLAS/Source/assign/GxB_Matrix_assign_Scalar_Vector.c new file mode 100644 index 0000000000..69adc74d2e --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Matrix_assign_Scalar_Vector.c @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_assign_Scalar_Vector: assign a scalar to matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_assign.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_assign_Scalar_Vector // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C and Mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE5 (C, Mask, scalar, I_vector, J_vector, + "GxB_Matrix_assign_Scalar_Vector (C, M, accum, s, I, J, desc)") ; + GB_BURBLE_START ("GxB_Matrix_assign_Scalar_Vector") ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), scalar) + //-------------------------------------------------------------------------- + + GB_OK (GB_Matrix_assign_scalar (C, Mask, accum, scalar, + I, I_is_32, ni, J, J_is_32, nj, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Matrix_assign_Vector.c b/GraphBLAS/Source/assign/GxB_Matrix_assign_Vector.c new file mode 100644 index 0000000000..ee3eb22c08 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Matrix_assign_Vector.c @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_assign_Vector: C(I,J) = accum (C(I,J),A) or A' +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_assign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_assign_Vector // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C, Mask, and A +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE5 (C, Mask, A, I_vector, J_vector, + "GxB_Matrix_assign_Vector (C, M, accum, A, I, J, desc)") ; + GB_BURBLE_START ("GxB_Matrix_assign_Vector") ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_transpose, xx1, xx2, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), A) + //-------------------------------------------------------------------------- + + GB_OK (GB_assign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),A) + A, A_transpose, // A and its descriptor (T=A or A') + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + GB_ASSIGN, + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Matrix_subassign.c b/GraphBLAS/Source/assign/GxB_Matrix_subassign.c index 40d3c6ff60..f481c96750 100644 --- a/GraphBLAS/Source/assign/GxB_Matrix_subassign.c +++ b/GraphBLAS/Source/assign/GxB_Matrix_subassign.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GxB_Matrix_subassign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' +// GxB_Matrix_subassign: C(I,J) = accum (C(I,J),A) or A' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,17 +12,17 @@ #include "assign/GB_subassign.h" #include "mask/GB_get_mask.h" -GrB_Info GxB_Matrix_subassign // C(Rows,Cols) += A or A' +GrB_Info GxB_Matrix_subassign // C(I,J) += A or A' ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // mask for C(Rows,Cols), unused if NULL - const GrB_BinaryOp accum, // accum for Z=accum(C(Rows,Cols),T) + const GrB_Matrix Mask, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) const GrB_Matrix A, // first input: matrix A - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices - const GrB_Index *Cols, // column indices - GrB_Index nCols, // number of column indices - const GrB_Descriptor desc // descriptor for C(Rows,Cols), M, and A + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const uint64_t *J, // column indices + uint64_t nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(I,J), M, and A ) { @@ -30,32 +30,32 @@ GrB_Info GxB_Matrix_subassign // C(Rows,Cols) += A or A' // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_subassign" - " (C, M, accum, A, Rows, nRows, Cols, nCols, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE3 (C, Mask, A, + "GxB_Matrix_subassign (C, M, accum, A, I, ni, J, nj, desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,Cols) = accum (C(Rows,Cols), A) and variations + // C(I,J) = accum (C(I,J), A) //-------------------------------------------------------------------------- info = GB_subassign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask matrix and its descriptor false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),A) + accum, // for accum (C(I,J),A) A, A_transpose, // A and its descriptor (T=A or A') - Rows, nRows, // row indices - Cols, nCols, // column indices + I, false, ni, // row indices + J, false, nj, // column indices false, NULL, GB_ignore_code, // no scalar expansion Werk) ; diff --git a/GraphBLAS/Source/assign/GxB_Matrix_subassign_Scalar_Vector.c b/GraphBLAS/Source/assign/GxB_Matrix_subassign_Scalar_Vector.c new file mode 100644 index 0000000000..2268e2bc9c --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Matrix_subassign_Scalar_Vector.c @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_subassign_Scalar_Vector: assign a scalar to matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_subassign.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_subassign_Scalar_Vector // C(I,J) = accum (C(I,J),x) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C(I,J) and Mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE5 (C, Mask, scalar, I_vector, J_vector, + "GxB_Matrix_subassign_Scalar_Vector (C, M, accum, s, I, J, desc)") ; + GB_BURBLE_START ("GxB_Matrix_subassign_Scalar_Vector") ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), scalar) + //-------------------------------------------------------------------------- + + GB_OK (GB_Matrix_subassign_scalar (C, Mask, accum, scalar, + I, I_is_32, ni, J, J_is_32, nj, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Matrix_subassign_Vector.c b/GraphBLAS/Source/assign/GxB_Matrix_subassign_Vector.c new file mode 100644 index 0000000000..db1707b726 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Matrix_subassign_Vector.c @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_subassign_Vector: C(I,J) = accum (C(I,J),A) or A' +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compare with GrB_Matrix_assign, which uses M and C_replace differently + +#include "assign/GB_subassign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_subassign_Vector // C(I,J) = accum (C(I,J),A) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // mask for C(I,J), unused if NULL + const GrB_BinaryOp accum, // accum for Z=accum(C(I,J),T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C(I,J), M, and A +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE5 (C, Mask, A, I_vector, J_vector, + "GxB_Matrix_subassign_Vector (C, M, accum, A, I, J desc)") ; + GB_BURBLE_START ("GxB_Matrix_subassign_Vector") ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_transpose, xx1, xx2, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(I,J) = accum (C(I,J), A) + //-------------------------------------------------------------------------- + + GB_OK (GB_subassign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask matrix and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,J),A) + A, A_transpose, // A and its descriptor (T=A or A') + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Matrix_subassign_scalar.c b/GraphBLAS/Source/assign/GxB_Matrix_subassign_scalar.c index 9234c53406..adeeebe838 100644 --- a/GraphBLAS/Source/assign/GxB_Matrix_subassign_scalar.c +++ b/GraphBLAS/Source/assign/GxB_Matrix_subassign_scalar.c @@ -2,7 +2,7 @@ // GxB_Matrix_subassign_[SCALAR]: assign to submatrix, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,32 +19,29 @@ #define GB_FREE_ALL ; #include "assign/GB_subassign.h" -#include "ij/GB_ij.h" -#include "mask/GB_get_mask.h" - -#define GB_ASSIGN_SCALAR(type,T,ampersand) \ -GrB_Info GB_EVAL2 (GXB (Matrix_subassign_), T) /* C(Rows,Cols) += x */ \ -( \ - GrB_Matrix C, /* input/output matrix for results */ \ - const GrB_Matrix M, /* optional mask for C(Rows,Cols) */ \ - const GrB_BinaryOp accum, /* accum for Z=accum(C(Rows,Cols),x) */ \ - type x, /* scalar to assign to C(Rows,Cols) */ \ - const GrB_Index *Rows, /* row indices */ \ - GrB_Index nRows, /* number of row indices */ \ - const GrB_Index *Cols, /* column indices */ \ - GrB_Index nCols, /* number of column indices */ \ - const GrB_Descriptor desc /* descriptor for C(Rows,Cols) and M */ \ -) \ -{ \ - GB_WHERE (C, "GxB_Matrix_subassign_" GB_STR(T) \ - " (C, M, accum, x, Rows, nRows, Cols, nCols, desc)") ; \ - GB_BURBLE_START ("GxB_Matrix_subassign " GB_STR(T)) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ - GB_RETURN_IF_FAULTY (M) ; \ - GrB_Info info = GB_subassign_scalar (C, M, accum, ampersand x, \ - GB_## T ## _code, Rows, nRows, Cols, nCols, desc, Werk) ; \ - GB_BURBLE_END ; \ - return (info) ; \ + +#define GB_ASSIGN_SCALAR(type,T,ampersand) \ +GrB_Info GB_EVAL2 (GXB (Matrix_subassign_), T) /* C(Rows,Cols) += x */ \ +( \ + GrB_Matrix C, /* input/output matrix for results */ \ + const GrB_Matrix M, /* optional mask for C(Rows,Cols) */ \ + const GrB_BinaryOp accum, /* accum for Z=accum(C(Rows,Cols),x) */ \ + type x, /* scalar to assign to C(Rows,Cols) */ \ + const uint64_t *Rows, /* row indices */ \ + uint64_t nRows, /* number of row indices */ \ + const uint64_t *Cols, /* column indices */ \ + uint64_t nCols, /* number of column indices */ \ + const GrB_Descriptor desc /* descriptor for C and M */ \ +) \ +{ \ + GB_WHERE2 (C, M, "GxB_Matrix_subassign_" GB_STR(T) \ + " (C, M, accum, x, Rows, nRows, Cols, nCols, desc)") ; \ + GB_RETURN_IF_NULL (C) ; \ + GB_BURBLE_START ("GxB_Matrix_subassign " GB_STR(T)) ; \ + info = GB_subassign_scalar (C, M, accum, ampersand x, GB_## T ## _code, \ + Rows, false, nRows, Cols, false, nCols, desc, Werk) ; \ + GB_BURBLE_END ; \ + return (info) ; \ } GB_ASSIGN_SCALAR (bool , BOOL , &) @@ -70,144 +67,45 @@ GB_ASSIGN_SCALAR (void * , UDT , ) // scalar subassignment above. // If the GrB_Scalar s is empty of type stype, then this is identical to: -// GrB_Matrix_new (&S, stype, nRows, nCols) ; -// GxB_Matrix_subassign (C, M, accum, S, Rows, nRows, Cols, nCols, desc) ; -// GrB_Matrix_free (&S) ; - -#undef GB_FREE_ALL -#define GB_FREE_ALL GB_Matrix_free (&S) ; +// GrB_Matrix_new (&A, stype, nRows, nCols) ; +// GxB_Matrix_subassign (C, M, accum, A, Rows, nRows, Cols, nCols, desc) ; +// GrB_Matrix_free (&A) ; GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),s) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix Mask, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),x) - GrB_Scalar scalar, // scalar to assign to C(I,J) - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices + const GrB_Scalar scalar, // scalar to assign to C(I,J) + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const uint64_t *J, // column indices + uint64_t nj, // number of column indices const GrB_Descriptor desc // descriptor for C and Mask ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GrB_Matrix S = NULL ; - GB_WHERE (C, "GxB_Matrix_subassign_Scalar" - " (C, M, accum, s, Rows, nRows, Cols, nCols, desc)") ; + GB_WHERE3 (C, Mask, scalar, + "GxB_Matrix_subassign_Scalar (C, M, accum, s, Rows, nRows, Cols, nCols," + " desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL (I) ; - GB_RETURN_IF_NULL (J) ; - - // if C has a user-defined type, its type must match the scalar type - if (C->type->code == GB_UDT_code && C->type != scalar->type) - { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" - "cannot be typecast to output of type [%s]", - scalar->type->name, C->type->name) ; - } - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - xx1, xx2, xx3, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(Rows,Cols) = accum (C(Rows,Cols), scalar) + // C(I,J) = accum (C(I,J), scalar) //-------------------------------------------------------------------------- - GrB_Index nvals ; - GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; - - if (M == NULL && !Mask_comp && ni == 1 && nj == 1 && !C_replace) - { - - //---------------------------------------------------------------------- - // scalar assignment - //---------------------------------------------------------------------- - - const GrB_Index row = I [0] ; - const GrB_Index col = J [0] ; - if (nvals == 1) - { - // set the element: C(row,col) += scalar or C(row,col) = scalar - info = GB_setElement (C, accum, scalar->x, row, col, - scalar->type->code, Werk) ; - } - else if (accum == NULL) - { - // delete the C(row,col) element - info = GB_Matrix_removeElement (C, row, col, Werk) ; - } - - } - else if (nvals == 1) - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has a single entry - //---------------------------------------------------------------------- - - // This is identical to non-opaque scalar subassignment - - info = GB_subassign ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),scalar) - NULL, false, // no explicit matrix A - I, ni, // row indices - J, nj, // column indices - true, // do scalar expansion - scalar->x, // scalar to assign, expands to become A - scalar->type->code, // type code of scalar to expand - Werk) ; - - } - else - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has no entry - //---------------------------------------------------------------------- - - // determine the properites of the I and J index lists - int64_t nRows, nCols, RowColon [3], ColColon [3] ; - int RowsKind, ColsKind ; - GB_ijlength (I, ni, GB_NROWS (C), &nRows, &RowsKind, RowColon); - GB_ijlength (J, nj, GB_NCOLS (C), &nCols, &ColsKind, ColColon); - - // create an empty matrix S of the right size, and use matrix assign - struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - bool is_csc = C->is_csc ; - int64_t vlen = is_csc ? nRows : nCols ; - int64_t vdim = is_csc ? nCols : nRows ; - GB_OK (GB_new (&S, // existing header - scalar->type, vlen, vdim, GB_Ap_calloc, is_csc, GxB_AUTO_SPARSITY, - GB_HYPER_SWITCH_DEFAULT, 1)) ; - info = GB_subassign ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (C(Rows,Cols),A) - S, false, // S matrix and its descriptor - I, ni, // row indices - J, nj, // column indices - false, NULL, GB_ignore_code, // no scalar expansion - Werk) ; - GB_FREE_ALL ; - } + GB_OK (GB_Matrix_subassign_scalar (C, Mask, accum, scalar, + I, false, ni, J, false, nj, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- GB_BURBLE_END ; - return (info) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/assign/GxB_Row_assign_Vector.c b/GraphBLAS/Source/assign/GxB_Row_assign_Vector.c new file mode 100644 index 0000000000..13064ad7e2 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Row_assign_Vector.c @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// GxB_Row_assign_Vector: C(i,J) = accum (C(i,J),u') +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_assign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Row_assign_Vector // C(i,J) = accum(C(i,j),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // mask for C(i,:), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + uint64_t i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C(i,:) and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, mask, u, J_vector, + "GxB_Row_assign_Vector (C, M, accum, u, i, J, desc)") ; + GB_BURBLE_START ("GxB_Row_assign_Vector") ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *J = NULL ; + size_t J_size = 0 ; + int64_t nj = 0 ; + GrB_Type J_type = NULL ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(i,J) = accum (C(i,J), u') + //-------------------------------------------------------------------------- + + // construct the index list I = [ i ] of length ni = 1 + uint64_t I [1] ; + I [0] = i ; // OK: 64-bit only + + GB_OK (GB_assign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + true, // transpose the mask + accum, // for accum (C(i,J),u) + (GrB_Matrix) u, true, // u as a matrix; always transposed + I, false, 1, // a single row index (64-bit only) + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + GB_ROW_ASSIGN, + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Row_subassign.c b/GraphBLAS/Source/assign/GxB_Row_subassign.c index 3fbf6d1b87..ff153dfa68 100644 --- a/GraphBLAS/Source/assign/GxB_Row_subassign.c +++ b/GraphBLAS/Source/assign/GxB_Row_subassign.c @@ -1,27 +1,25 @@ //------------------------------------------------------------------------------ -// GxB_Row_subassign: C(row,Cols) = accum (C(row,Cols),u') +// GxB_Row_subassign: C(i,J) = accum (C(i,J),u') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Compare with GrB_Row_assign, which uses the M and C_replace differently - #include "assign/GB_subassign.h" #include "mask/GB_get_mask.h" -GrB_Info GxB_Row_subassign // C(row,Cols) += u' +GrB_Info GxB_Row_subassign // C(i,J) = accum (C(i,J),u') ( GrB_Matrix C, // input/output matrix for results - const GrB_Vector M_in, // mask for C(row,Cols), unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(C(row,Cols),t) + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) const GrB_Vector u, // input vector - GrB_Index row, // row index - const GrB_Index *Cols, // column indices - GrB_Index nCols, // number of column indices - const GrB_Descriptor desc // descriptor for C(row,Cols) and M + uint64_t i, // row index + const uint64_t *J, // column indices + uint64_t nj, // number of column indices + const GrB_Descriptor desc // descriptor for C(i,J) and mask ) { @@ -29,12 +27,14 @@ GrB_Info GxB_Row_subassign // C(row,Cols) += u' // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Row_subassign (C, M, accum, u, row, Cols, nCols, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE3 (C, mask, u, + "GxB_Row_subassign (C, M, accum, u, i, J, nj, desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -42,24 +42,24 @@ GrB_Info GxB_Row_subassign // C(row,Cols) += u' xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // C(row,Cols) = accum (C(row,Cols), u') + // C(i,J) = accum (C(i,J), u') //-------------------------------------------------------------------------- - // construct the row index list Rows = [ row ] of length nRows = 1 - GrB_Index Rows [1] ; - Rows [0] = row ; + // construct the index list I = [ i ] of length ni = 1 + uint64_t I [1] ; + I [0] = i ; // OK: 64-bit only info = GB_subassign ( C, C_replace, // C matrix and its descriptor M, Mask_comp, Mask_struct, // mask and its descriptor true, // transpose the mask - accum, // for accum (C(Rows,col),u) + accum, // for accum (C(i,J),u) (GrB_Matrix) u, true, // u as a matrix; always transposed - Rows, 1, // a single row index - Cols, nCols, // column indices + I, false, 1, // a single row index (64-bit only) + J, false, nj, // column indices (64-bit only) false, NULL, GB_ignore_code, // no scalar expansion Werk) ; diff --git a/GraphBLAS/Source/assign/GxB_Row_subassign_Vector.c b/GraphBLAS/Source/assign/GxB_Row_subassign_Vector.c new file mode 100644 index 0000000000..fb7cbe5ae6 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Row_subassign_Vector.c @@ -0,0 +1,88 @@ +//------------------------------------------------------------------------------ +// GxB_Row_subassign_Vector: C(i,J) = accum (C(i,J),u') +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "assign/GB_subassign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Row_subassign_Vector // C(i,J) = accum (C(i,J),u') +( + GrB_Matrix C, // input/output matrix for results + const GrB_Vector mask, // optional mask for C(i,J), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(C(i,J),t) + const GrB_Vector u, // input vector + uint64_t i, // row index + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C(i,J) and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, mask, u, J_vector, + "GxB_Row_subassign_Vector (C, M, accum, u, i, J, desc)") ; + GB_BURBLE_START ("GxB_Row_subassign_Vector") ; + + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *J = NULL ; + size_t J_size = 0 ; + int64_t nj = 0 ; + GrB_Type J_type = NULL ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // C(i,J) = accum (C(i,J), u') + //-------------------------------------------------------------------------- + + // construct the index list I = [ i ] of length ni = 1 + uint64_t I [1] ; + I [0] = i ; // OK: 64-bit only + + GB_OK (GB_subassign ( + C, C_replace, // C matrix and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + true, // transpose the mask + accum, // for accum (C(i,J),u) + (GrB_Matrix) u, true, // u as a matrix; always transposed + I, false, 1, // a single row index (64-bit only) + J, J_is_32, nj, // column indices + false, NULL, GB_ignore_code, // no scalar expansion + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Vector_assign_Scalar_Vector.c b/GraphBLAS/Source/assign/GxB_Vector_assign_Scalar_Vector.c new file mode 100644 index 0000000000..c013d43b10 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Vector_assign_Scalar_Vector.c @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_assign_Scalar_Vector: assign scalar to vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a vector, w(Rows) = accum(w(Rows),x) +// The scalar x is implicitly expanded into a vector u of size ni-by-1, +// with each entry in u equal to x. + +#include "assign/GB_assign.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_assign_Scalar_Vector // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE4 (w, mask, scalar, I_vector, + "GxB_Vector_assign_Scalar_Vector (w, M, accum, s, I, desc)") ; + GB_BURBLE_START ("GxB_Vector_assign_Scalar_Vector") ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), scalar) + //-------------------------------------------------------------------------- + + GB_OK (GB_Vector_assign_scalar (w, mask, accum, scalar, + I, I_is_32, ni, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Vector_assign_Vector.c b/GraphBLAS/Source/assign/GxB_Vector_assign_Vector.c new file mode 100644 index 0000000000..0fe2f8d768 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Vector_assign_Vector.c @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_assign_Vector: w(I) = accum (w(I),u) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compare with GxB_Vector_subassign, which uses M and C_replace differently + +#include "assign/GB_assign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_assign_Vector // w(I) = accum (w(I),u) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, mask, u, I_vector, + "GxB_Vector_assign_Vector (w, M, accum, u, I, desc)") ; + GB_BURBLE_START ("GxB_Vector_assign_Vector") ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), u) + //-------------------------------------------------------------------------- + + GB_OK (GB_assign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + false, // do not transpose the mask + accum, // for accum (C(I,:),A) + (GrB_Matrix) u, false, // u as a matrix; never transposed + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // all column indices + false, NULL, GB_ignore_code, // no scalar expansion + GB_ASSIGN, + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Vector_subassign.c b/GraphBLAS/Source/assign/GxB_Vector_subassign.c index 61c04fb979..391aaf5636 100644 --- a/GraphBLAS/Source/assign/GxB_Vector_subassign.c +++ b/GraphBLAS/Source/assign/GxB_Vector_subassign.c @@ -2,7 +2,7 @@ // GxB_Vector_subassign: w(Rows) = accum (w(Rows),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,11 +15,11 @@ GrB_Info GxB_Vector_subassign // w(Rows) = accum (w(Rows),u) ( GrB_Vector w, // input/output matrix for results - const GrB_Vector M_in, // optional mask for w(Rows), unused if NULL + const GrB_Vector mask, // optional mask for w(Rows), unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w(Rows),t) const GrB_Vector u, // first input: vector u - const GrB_Index *Rows, // row indices - GrB_Index nRows, // number of row indices + const uint64_t *Rows, // row indices + uint64_t nRows, // number of row indices const GrB_Descriptor desc // descriptor for w(Rows) and M ) { @@ -28,14 +28,15 @@ GrB_Info GxB_Vector_subassign // w(Rows) = accum (w(Rows),u) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GxB_Vector_subassign (w, M, accum, u, Rows, nRows, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE3 (w, mask, u, + "GxB_Vector_subassign (w, M, accum, u, Rows, nRows, desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; ASSERT (GB_VECTOR_OK (w)) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -43,10 +44,10 @@ GrB_Info GxB_Vector_subassign // w(Rows) = accum (w(Rows),u) xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // w(Rows) = accum (w(Rows), u) and variations + // w(Rows) = accum (w(Rows), u) //-------------------------------------------------------------------------- info = GB_subassign ( @@ -55,8 +56,8 @@ GrB_Info GxB_Vector_subassign // w(Rows) = accum (w(Rows),u) false, // do not transpose the mask accum, // for accum (C(Rows,:),A) (GrB_Matrix) u, false, // u as a matrix; never transposed - Rows, nRows, // row indices - GrB_ALL, 1, // all column indices + Rows, false, nRows, // row indices + GrB_ALL, false, 1, // all column indices false, NULL, GB_ignore_code, // no scalar expansion Werk) ; diff --git a/GraphBLAS/Source/assign/GxB_Vector_subassign_Scalar_Vector.c b/GraphBLAS/Source/assign/GxB_Vector_subassign_Scalar_Vector.c new file mode 100644 index 0000000000..fab4755d46 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Vector_subassign_Scalar_Vector.c @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_subassign_Scalar_Vector: assign scalar to vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Assigns a single scalar to a vector, w(I) = accum(w(I),x) +// The scalar x is implicitly expanded into a vector u of size ni-by-1, +// with each entry in u equal to x. + +#include "assign/GB_subassign.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_subassign_Scalar_Vector // w(I) = accum (w(I),x) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) + const GrB_Scalar scalar, // scalar to assign to w(I) + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE4 (w, mask, scalar, I_vector, + "GxB_Vector_subassign_Scalar_Vector (w, M, accum, s, I, desc)") ; + GB_BURBLE_START ("GxB_Vector_subassign_Scalar_Vector") ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), scalar) + //-------------------------------------------------------------------------- + + GB_OK (GB_Vector_subassign_scalar (w, mask, accum, scalar, + I, I_is_32, ni, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Vector_subassign_Vector.c b/GraphBLAS/Source/assign/GxB_Vector_subassign_Vector.c new file mode 100644 index 0000000000..97a0437be2 --- /dev/null +++ b/GraphBLAS/Source/assign/GxB_Vector_subassign_Vector.c @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_subassign_Vector: w(I) = accum (w(I),u) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compare with GrB_Vector_assign, which uses M and C_replace differently + +#include "assign/GB_subassign.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_subassign_Vector // w(I) = accum (w(I),u) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w(I), unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w(I),t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w(I) and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, mask, u, I_vector, + "GxB_Vector_subassign_Vector (w, M, accum, u, I, desc)") ; + GB_BURBLE_START ("GxB_Vector_subassign_Vector") ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // w(I) = accum (w(I), u) + //-------------------------------------------------------------------------- + + GB_OK (GB_subassign ( + (GrB_Matrix) w, C_replace, // w vector and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + false, // do not transpose the mask + accum, // for accum (w(I),u) + (GrB_Matrix) u, false, // u as a matrix; never transposed + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // all column indices + false, NULL, GB_ignore_code, // no scalar expansion + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/assign/GxB_Vector_subassign_scalar.c b/GraphBLAS/Source/assign/GxB_Vector_subassign_scalar.c index 63cb216473..2895172650 100644 --- a/GraphBLAS/Source/assign/GxB_Vector_subassign_scalar.c +++ b/GraphBLAS/Source/assign/GxB_Vector_subassign_scalar.c @@ -2,46 +2,43 @@ // GxB_Vector_subassign_[SCALAR]: assign scalar to vector, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Assigns a single scalar to a subvector, w(Rows) = accum(w(Rows),x) -// The scalar x is implicitly expanded into a vector u of size nRows-by-1, +// Assigns a single scalar to a subvector, w(I) = accum(w(I),x) +// The scalar x is implicitly expanded into a vector u of size ni-by-1, // with each entry in u equal to x. // The actual work is done in GB_subassign_scalar.c. #define GB_FREE_ALL ; #include "assign/GB_subassign.h" -#include "ij/GB_ij.h" -#include "mask/GB_get_mask.h" - -#define GB_ASSIGN_SCALAR(type,T,ampersand) \ -GrB_Info GB_EVAL2 (GXB (Vector_subassign_), T) /* w(I) = accum (w(I),x) */ \ -( \ - GrB_Vector w, /* input/output vector for results */ \ - const GrB_Vector M, /* optional mask for w(Rows) */ \ - const GrB_BinaryOp accum, /* optional accum for Z=accum(w(Rows),x)*/ \ - type x, /* scalar to assign to w(Rows) */ \ - const GrB_Index *Rows, /* row indices */ \ - GrB_Index nRows, /* number of row indices */ \ - const GrB_Descriptor desc /* descriptor for w(Rows) and M */ \ -) \ -{ \ - GB_WHERE (w, "GxB_Vector_subassign_" GB_STR(T) \ - " (w, M, accum, x, Rows, nRows, desc)") ; \ - GB_BURBLE_START ("GxB_subassign") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ - GB_RETURN_IF_FAULTY (M) ; \ - ASSERT (GB_VECTOR_OK (w)) ; \ - ASSERT (GB_IMPLIES (M != NULL, GB_VECTOR_OK (M))) ; \ - GrB_Info info = GB_subassign_scalar ((GrB_Matrix) w, (GrB_Matrix) M, \ - accum, ampersand x, GB_## T ## _code, Rows, nRows, GrB_ALL, 1, desc, \ - Werk) ; \ - GB_BURBLE_END ; \ - return (info) ; \ + +#define GB_ASSIGN_SCALAR(type,T,ampersand) \ +GrB_Info GB_EVAL2 (GXB (Vector_subassign_), T) /* w(I) = accum (w(I),x)*/\ +( \ + GrB_Vector w, /* input/output vector for results */ \ + const GrB_Vector M, /* optional mask for w(I) */ \ + const GrB_BinaryOp accum, /* opt. accum for Z=accum(w(I),x) */ \ + type x, /* scalar to assign to w(I) */ \ + const uint64_t *I, /* row indices */ \ + uint64_t ni, /* number of row indices */ \ + const GrB_Descriptor desc /* descriptor for w(I) and M */ \ +) \ +{ \ + GB_WHERE2 (w, M, "GxB_Vector_subassign_" GB_STR(T) \ + " (w, M, accum, x, I, ni, desc)") ; \ + GB_RETURN_IF_NULL (w) ; \ + GB_BURBLE_START ("GxB_subassign") ; \ + ASSERT (GB_VECTOR_OK (w)) ; \ + ASSERT (GB_IMPLIES (M != NULL, GB_VECTOR_OK (M))) ; \ + info = GB_subassign_scalar ((GrB_Matrix) w, (GrB_Matrix) M, accum, \ + ampersand x, GB_## T ## _code, \ + I, false, ni, GrB_ALL, false, 1, desc, Werk) ; \ + GB_BURBLE_END ; \ + return (info) ; \ } GB_ASSIGN_SCALAR (bool , BOOL , &) @@ -67,136 +64,40 @@ GB_ASSIGN_SCALAR (void * , UDT , ) // scalar assignment above. // If the GrB_Scalar s is empty of type stype, then this is identical to: -// GrB_Vector_new (&S, stype, nRows) ; -// GxB_Vector_subassign (w, M, accum, S, Rows, nRows, desc) ; -// GrB_Vector_free (&S) ; - -#undef GB_FREE_ALL -#define GB_FREE_ALL GB_Matrix_free (&S) ; +// GrB_Vector_new (&A, stype, ni) ; +// GxB_Vector_subassign (w, M, accum, A, I, ni, desc) ; +// GrB_Vector_free (&A) ; -GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),s) +GrB_Info GxB_Vector_subassign_Scalar // w(I)> = accum (w(I),s) ( GrB_Vector w, // input/output matrix for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector mask, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(w(I),x) - GrB_Scalar scalar, // scalar to assign to w(I) - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and Mask + const GrB_Scalar scalar, // scalar to assign to w(I) + const uint64_t *I, // row indices + uint64_t ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GrB_Matrix S = NULL ; - GB_WHERE (w, "GxB_Vector_subassign_Scalar" - " (w, M, accum, s, Rows, nRows, desc)") ; + GB_WHERE3 (w, mask, scalar, + "GxB_Vector_subassign_Scalar (w, M, accum, s, I, desc)") ; GB_BURBLE_START ("GxB_subassign") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL (I) ; - ASSERT (GB_VECTOR_OK (w)) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; - - // if w has a user-defined type, its type must match the scalar type - if (w->type->code == GB_UDT_code && w->type != scalar->type) - { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Input of type [%s]\n" - "cannot be typecast to output of type [%s]", - scalar->type->name, w->type->name) ; - } - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - xx1, xx2, xx3, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // w(Rows) = accum (w(Rows), scalar) + // w(I) = accum (w(I), scalar) //-------------------------------------------------------------------------- - GrB_Index nvals ; - GB_OK (GB_nvals (&nvals, (GrB_Matrix) scalar, Werk)) ; - - if (M == NULL && !Mask_comp && ni == 1 && !C_replace) - { - - //---------------------------------------------------------------------- - // scalar assignment - //---------------------------------------------------------------------- - - const GrB_Index row = I [0] ; - if (nvals == 1) - { - // set the element: w(row) += scalar or w(wrow) = scalar - info = GB_setElement ((GrB_Matrix) w, accum, scalar->x, row, 0, - scalar->type->code, Werk) ; - } - else if (accum == NULL) - { - // delete the w(row) element - info = GB_Vector_removeElement (w, row, Werk) ; - } - - } - else if (nvals == 1) - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has a single entry - //---------------------------------------------------------------------- - - // This is identical to non-opaque scalar assignment - - info = GB_subassign ( - (GrB_Matrix) w, C_replace, // w vector and its descriptor - M, Mask_comp, Mask_struct, // mask vector and its descriptor - false, // do not transpose the mask - accum, // for accum (w(Rows),scalar) - NULL, false, // no explicit vector u - I, ni, // row indices - GrB_ALL, 1, // column indices - true, // do scalar expansion - scalar->x, // scalar to assign, expands to become u - scalar->type->code, // type code of scalar to expand - Werk) ; - - } - else - { - - //---------------------------------------------------------------------- - // the opaque GrB_Scalar has no entry - //---------------------------------------------------------------------- - - // determine the properites of the I index list - int64_t nRows, RowColon [3] ; - int RowsKind ; - GB_ijlength (I, ni, GB_NROWS (w), &nRows, &RowsKind, RowColon); - - // create an empty matrix S of the right size, and use matrix assign - struct GB_Matrix_opaque S_header ; - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_new (&S, // existing header - scalar->type, nRows, 1, GB_Ap_calloc, true, GxB_AUTO_SPARSITY, - GB_HYPER_SWITCH_DEFAULT, 1)) ; - info = GB_subassign ( - (GrB_Matrix) w, C_replace, // w vector and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - false, // do not transpose the mask - accum, // for accum (w(Rows),scalar) - S, false, // S matrix and its descriptor - I, ni, // row indices - GrB_ALL, 1, // column indices - false, NULL, GB_ignore_code, // no scalar expansion - Werk) ; - GB_FREE_ALL ; - } + GB_OK (GB_Vector_subassign_scalar (w, mask, accum, scalar, + I, false, ni, desc, Werk)) ; + + //-------------------------------------------------------------------------- + // return results + //-------------------------------------------------------------------------- GB_BURBLE_END ; return (info) ; diff --git a/GraphBLAS/Source/assign/dodiff b/GraphBLAS/Source/assign/dodiff index 97f35fc710..f9ef85567a 100755 --- a/GraphBLAS/Source/assign/dodiff +++ b/GraphBLAS/Source/assign/dodiff @@ -1,6 +1,6 @@ #!/bin/bash -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 echo "=======================================================================" diff --git a/GraphBLAS/Source/assign/factory/GB_assign_factory.c b/GraphBLAS/Source/assign/factory/GB_assign_factory.c index 2f1d652c58..4f98fe3146 100644 --- a/GraphBLAS/Source/assign/factory/GB_assign_factory.c +++ b/GraphBLAS/Source/assign/factory/GB_assign_factory.c @@ -2,7 +2,7 @@ // GB_assign_factory.c: switch factory for assign (a single type) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c b/GraphBLAS/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c index 23d90598b5..0d9010a594 100644 --- a/GraphBLAS/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c +++ b/GraphBLAS/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_M_scatter_whole_template: scatter M into/from the C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,3 +44,4 @@ } #undef GB_NO_CNVALS + diff --git a/GraphBLAS/Source/assign/include/GB_assign_shared_definitions.h b/GraphBLAS/Source/assign/include/GB_assign_shared_definitions.h index da3983380c..4f6ec8d82f 100644 --- a/GraphBLAS/Source/assign/include/GB_assign_shared_definitions.h +++ b/GraphBLAS/Source/assign/include/GB_assign_shared_definitions.h @@ -2,7 +2,7 @@ // GB_assign_shared_definitions.h: definitions for GB_subassign kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ #include "include/GB_kernel_shared_definitions.h" #include "include/GB_cumsum1.h" +#include "include/GB_unused.h" //============================================================================== // definitions redefined as needed @@ -34,12 +35,12 @@ { \ GB_FREE_WORKSPACE ; \ GB_WERK_POP (Npending, int64_t) ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ - GB_FREE (&Zh, Zh_size) ; \ - GB_FREE_WORK (&Z_to_X, Z_to_X_size) ; \ - GB_FREE_WORK (&Z_to_S, Z_to_S_size) ; \ - GB_FREE_WORK (&Z_to_A, Z_to_A_size) ; \ - GB_FREE_WORK (&Z_to_M, Z_to_M_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&Zh, Zh_size) ; \ + GB_FREE_MEMORY (&Z_to_X, Z_to_X_size) ; \ + GB_FREE_MEMORY (&Z_to_S, Z_to_S_size) ; \ + GB_FREE_MEMORY (&Z_to_A, Z_to_A_size) ; \ + GB_FREE_MEMORY (&Z_to_M, Z_to_M_size) ; \ GB_FREE_S ; \ } @@ -116,6 +117,15 @@ #ifndef GB_C_ISO #define GB_C_ISO C_iso #endif +#ifndef GB_Cp_IS_32 +#define GB_Cp_IS_32 Cp_is_32 +#endif +#ifndef GB_Cj_IS_32 +#define GB_Cj_IS_32 Cj_is_32 +#endif +#ifndef GB_Ci_IS_32 +#define GB_Ci_IS_32 Ci_is_32 +#endif #ifndef GB_M_IS_BITMAP #define GB_M_IS_BITMAP M_is_bitmap @@ -129,6 +139,15 @@ #ifndef GB_M_IS_HYPER #define GB_M_IS_HYPER M_is_hyper #endif +#ifndef GB_Mp_IS_32 +#define GB_Mp_IS_32 Mp_is_32 +#endif +#ifndef GB_Mj_IS_32 +#define GB_Mj_IS_32 Mj_is_32 +#endif +#ifndef GB_Mi_IS_32 +#define GB_Mi_IS_32 Mi_is_32 +#endif #ifndef GB_A_IS_BITMAP #define GB_A_IS_BITMAP A_is_bitmap @@ -145,6 +164,15 @@ #ifndef GB_A_ISO #define GB_A_ISO A_iso #endif +#ifndef GB_Ap_IS_32 +#define GB_Ap_IS_32 Ap_is_32 +#endif +#ifndef GB_Aj_IS_32 +#define GB_Aj_IS_32 Aj_is_32 +#endif +#ifndef GB_Ai_IS_32 +#define GB_Ai_IS_32 Ai_is_32 +#endif #ifndef GB_S_IS_BITMAP #define GB_S_IS_BITMAP S_is_bitmap @@ -158,6 +186,22 @@ #ifndef GB_S_IS_HYPER #define GB_S_IS_HYPER S_is_hyper #endif +#ifndef GB_Sp_IS_32 +#define GB_Sp_IS_32 Sp_is_32 +#endif +#ifndef GB_Sj_IS_32 +#define GB_Sj_IS_32 Sj_is_32 +#endif +#ifndef GB_Si_IS_32 +#define GB_Si_IS_32 Si_is_32 +#endif + +#ifndef GB_I_IS_32 +#define GB_I_IS_32 I_is_32 +#endif +#ifndef GB_J_IS_32 +#define GB_J_IS_32 J_is_32 +#endif //------------------------------------------------------------------------------ // GB_EMPTY_TASKLIST: declare an empty TaskList @@ -168,7 +212,7 @@ int taskid, ntasks = 0, nthreads = 0 ; \ GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; \ GB_WERK_DECLARE (Npending, int64_t) ; \ - int64_t *restrict Zh = NULL ; size_t Zh_size = 0 ; \ + GB_MDECL (Zh, , u) ; size_t Zh_size = 0 ; \ int64_t *restrict Z_to_X = NULL ; size_t Z_to_X_size = 0 ; \ int64_t *restrict Z_to_S = NULL ; size_t Z_to_S_size = 0 ; \ int64_t *restrict Z_to_A = NULL ; size_t Z_to_A_size = 0 ; \ @@ -184,14 +228,20 @@ ASSERT_MATRIX_OK (C, "C for subassign kernel", GB0) ; \ ASSERT (!GB_IS_BITMAP (C)) ; \ const bool C_iso = C->iso ; \ - int64_t *restrict Ci = C->i ; \ + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; \ + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; \ + void *Ch = C->h ; \ + const int64_t Cnvec = C->nvec ; \ + const bool Cp_is_32 = C->p_is_32 ; \ + const bool Cj_is_32 = C->j_is_32 ; \ + const bool Ci_is_32 = C->i_is_32 ; \ + const bool C_is_hyper = (Ch != NULL) ; \ GB_C_TYPE *restrict Cx = (GB_C_ISO) ? NULL : (GB_C_TYPE *) C->x ; \ const size_t csize = C->type->size ; \ const GB_Type_code ccode = C->type->code ; \ const int64_t Cvdim = C->vdim ; \ const int64_t Cvlen = C->vlen ; \ - int64_t nzombies = C->nzombies ; \ - const bool is_matrix = (Cvdim > 1) ; + int64_t nzombies = C->nzombies ; #ifndef GB_DECLAREC #define GB_DECLAREC(cwork) GB_void cwork [GB_VLA(csize)] ; @@ -199,9 +249,9 @@ #define GB_GET_C_HYPER_HASH \ GB_OK (GB_hyper_hash_build (C, Werk)) ; \ - const int64_t *restrict C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; \ - const int64_t *restrict C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; \ - const int64_t *restrict C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; \ + const void *C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; \ + const void *C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; \ + const void *C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; \ const int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; //------------------------------------------------------------------------------ @@ -212,10 +262,13 @@ #define GB_GET_MASK \ ASSERT_MATRIX_OK (M, "mask M", GB0) ; \ - const int64_t *Mp = M->p ; \ - const int8_t *Mb = M->b ; \ - const int64_t *Mh = M->h ; \ - const int64_t *Mi = M->i ; \ + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; \ + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; \ + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; \ + const bool Mp_is_32 = M->p_is_32 ; \ + const bool Mj_is_32 = M->j_is_32 ; \ + const bool Mi_is_32 = M->i_is_32 ; \ + const int8_t *Mb = M->b ; \ const GB_M_TYPE *Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; \ const size_t msize = M->type->size ; \ const size_t Mvlen = M->vlen ; \ @@ -225,9 +278,9 @@ #define GB_GET_MASK_HYPER_HASH \ GB_OK (GB_hyper_hash_build (M, Werk)) ; \ - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; \ - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; \ - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; \ + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; \ + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; \ + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; \ const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; //------------------------------------------------------------------------------ @@ -274,13 +327,19 @@ ASSERT_MATRIX_OK (A, "A for assign", GB0) ; \ const GrB_Type atype = A->type ; \ const size_t asize = atype->size ; \ - const int64_t *Ap = A->p ; \ - const int8_t *Ab = A->b ; \ - const int64_t *Ai = A->i ; \ + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; \ + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; \ + const void *Ah = A->h ; \ + const bool Ap_is_32 = A->p_is_32 ; \ + const bool Aj_is_32 = A->j_is_32 ; \ + const bool Ai_is_32 = A->i_is_32 ; \ + const int8_t *Ab = A->b ; \ const int64_t Avlen = A->vlen ; \ const GB_A_TYPE *Ax = (GB_A_TYPE *) A->x ; \ const bool A_iso = A->iso ; \ const bool A_is_bitmap = GB_IS_BITMAP (A) ; \ + const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; \ + const int64_t Anvec = A->nvec ; \ const GB_Type_code acode = atype->code ; \ GB_DECLAREC (cwork) ; \ GB_CAST_FUNCTION (cast_A_to_C, ccode, acode) ; \ @@ -347,20 +406,35 @@ //------------------------------------------------------------------------------ // S is never aliased with any other matrix. -// FUTURE: S->p could be C->p and S->x NULL if I and J are (:,:) + +#ifdef GB_JIT_KERNEL + #define GB_GET_SX \ + const GB_Sx_TYPE *restrict Sx = S->x ; +#else + #define GB_GET_SX \ + const bool Sx_is_32 = (S->type->code == GB_UINT32_code) ; \ + GB_MDECL (Sx, const, u) ; \ + Sx = S->x ; \ + GB_IPTR (Sx, Sx_is_32) ; +#endif #define GB_GET_S \ ASSERT_MATRIX_OK (S, "S extraction", GB0) ; \ - const int64_t *restrict Sp = S->p ; \ - const int64_t *restrict Sh = S->h ; \ - const int64_t *restrict Si = S->i ; \ - const int64_t *restrict Sx = (int64_t *) S->x ; \ + GB_Sp_DECLARE (Sp, const) ; GB_Sp_PTR (Sp, S) ; \ + GB_Sh_DECLARE (Sh, const) ; GB_Sh_PTR (Sh, S) ; \ + GB_Si_DECLARE (Si, const) ; GB_Si_PTR (Si, S) ; \ + const bool Sp_is_32 = S->p_is_32 ; \ + const bool Sj_is_32 = S->j_is_32 ; \ + const bool Si_is_32 = S->i_is_32 ; \ + ASSERT (S->type->code == GB_UINT32_code \ + || S->type->code == GB_UINT64_code) ; \ + GB_GET_SX ; \ const int64_t Svlen = S->vlen ; \ const int64_t Snvec = S->nvec ; \ const bool S_is_hyper = GB_IS_HYPERSPARSE (S) ; \ - const int64_t *restrict S_Yp = (S->Y == NULL) ? NULL : S->Y->p ; \ - const int64_t *restrict S_Yi = (S->Y == NULL) ? NULL : S->Y->i ; \ - const int64_t *restrict S_Yx = (S->Y == NULL) ? NULL : S->Y->x ; \ + const void *S_Yp = (S->Y == NULL) ? NULL : S->Y->p ; \ + const void *S_Yi = (S->Y == NULL) ? NULL : S->Y->i ; \ + const void *S_Yx = (S->Y == NULL) ? NULL : S->Y->x ; \ const int64_t S_hash_bits = (S->Y == NULL) ? 0 : (S->Y->vdim - 1) ; //------------------------------------------------------------------------------ @@ -383,8 +457,8 @@ // Used for Methods 00 to 04, 06s, and 09 to 20, all of which use S. #define GB_C_S_LOOKUP \ - int64_t pC = Sx [pS] ; \ - int64_t iC = GBI_C (Ci, pC, Cvlen) ; \ + int64_t pC = GB_IGET (Sx, pS) ; \ + int64_t iC = GBi_C (Ci, pC, Cvlen) ; \ bool is_zombie = GB_IS_ZOMBIE (iC) ; \ if (is_zombie) iC = GB_DEZOMBIE (iC) ; @@ -399,10 +473,10 @@ // This used for Methods 05, 06n, 07, and 08n, which do not use S. #define GB_iC_DENSE_LOOKUP \ - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; \ + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; \ int64_t pC = pC_start + iC ; \ - bool is_zombie = (Ci != NULL) && GB_IS_ZOMBIE (Ci [pC]) ; \ - ASSERT (GB_IMPLIES (Ci != NULL, GB_UNZOMBIE (Ci [pC]) == iC)) ; + bool is_zombie = (Ci != NULL) && GB_IS_ZOMBIE (GB_IGET (Ci, pC)) ; \ + ASSERT (GB_IMPLIES (Ci != NULL, GB_UNZOMBIE (GB_IGET (Ci, pC)) == iC)) ; //-------------------------------------------------------------------------- // get C(iC,jC) via binary search of C(:,jC) @@ -416,13 +490,13 @@ // is given a unique range of pC_start:pC_end-1 to search. Thus, no binary // search of any fine tasks conflict with each other. - #define GB_iC_BINARY_SEARCH \ - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; \ + #define GB_iC_BINARY_SEARCH(may_see_zombies) \ + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; \ int64_t pC = pC_start ; \ int64_t pright = pC_end - 1 ; \ bool cij_found, is_zombie ; \ - GB_BINARY_SEARCH_ZOMBIE (iC, Ci, pC, pright, cij_found, zorig, \ - is_zombie) ; + cij_found = GB_binary_search_zombie (iC, Ci, GB_Ci_IS_32, \ + &pC, &pright, may_see_zombies, &is_zombie) ; //-------------------------------------------------------------------------- // basic operations @@ -507,7 +581,7 @@ /* turn C(iC,jC) into a zombie */ \ ASSERT (!GB_IS_FULL (C)) ; \ task_nzombies++ ; \ - Ci [pC] = GB_ZOMBIE (iC) ; \ + GB_ISET (Ci, pC, GB_ZOMBIE (iC)) ; /* Ci [pC] = GB_ZOMBIE (iC) */ \ } #define GB_UNDELETE \ @@ -515,7 +589,7 @@ /* bring a zombie C(iC,jC) back to life; */ \ /* the value of C(iC,jC) must also be assigned. */ \ ASSERT (!GB_IS_FULL (C)) ; \ - Ci [pC] = iC ; \ + GB_ISET (Ci, pC, iC) ; /* Ci [pC] = iC */ \ task_nzombies-- ; \ } @@ -541,7 +615,7 @@ // pending tuples inserted here, by GxB_subassign. // (2) zombie entries. These are entries that are still present in the - // pattern but marked for deletion (via GB_ZOMBIE(i) for the row index). + // pattern but marked for deletion (via GB_ZOMBIE (i) for row i). // For the current GxB_subassign, there are 16 cases to handle, // all combinations of the following options: @@ -838,8 +912,8 @@ // ( X ): - // C(I(i),J(j)) was a zombie, and still is a zombie. - // row index is < 0, and actual index is GB_DEZOMBIE(I(i)) + // C(I(i),J(j)) was a zombie, and still is a zombie. row + // index is < 0, and actual index is GB_DEZOMBIE (I(i)) // ( C ): @@ -1237,8 +1311,9 @@ #define GB_SUBASSIGN_ONE_SLICE(M) \ GB_OK (GB_subassign_one_slice ( \ - &TaskList, &TaskList_size, &ntasks, &nthreads, \ - C, I, nI, GB_I_KIND, Icolon, J, nJ, GB_J_KIND, Jcolon, \ + &TaskList, &TaskList_size, &ntasks, &nthreads, C, \ + I, GB_I_IS_32, nI, GB_I_KIND, Icolon, \ + J, GB_J_IS_32, nJ, GB_J_KIND, Jcolon, \ M, Werk)) ; \ GB_ALLOCATE_NPENDING_WERK ; @@ -1258,13 +1333,15 @@ #define GB_SUBASSIGN_TWO_SLICE(X,S) \ int Z_sparsity = GxB_SPARSE ; \ int64_t Znvec ; \ + bool Zp_is_32, Zj_is_32, Zi_is_32 ; \ GB_OK (GB_add_phase0 ( \ &Znvec, &Zh, &Zh_size, NULL, NULL, &Z_to_X, &Z_to_X_size, \ - &Z_to_S, &Z_to_S_size, NULL, &Z_sparsity, \ - NULL, X, S, Werk)) ; \ + &Z_to_S, &Z_to_S_size, NULL, &Zp_is_32, &Zj_is_32, &Zi_is_32, \ + &Z_sparsity, NULL, X, S, Werk)) ; \ + GB_IPTR (Zh, Zj_is_32) ; \ GB_OK (GB_ewise_slice ( \ &TaskList, &TaskList_size, &ntasks, &nthreads, \ - Znvec, Zh, NULL, Z_to_X, Z_to_S, false, \ + Znvec, Zh, Zj_is_32, NULL, Z_to_X, Z_to_S, false, \ NULL, X, S, Werk)) ; \ GB_ALLOCATE_NPENDING_WERK ; @@ -1300,56 +1377,25 @@ int64_t task_pending = 0 ; //------------------------------------------------------------------------------ -// GB_GET_MAPPED: get the content of a vector for a coarse/fine task +// GB_GET_VECTOR_M: get the content of a vector of M for a coarse/fine task //------------------------------------------------------------------------------ -// Used for the M, S, and A matrices. Note that the generic GBP macro is used, -// so this is not fully optimized for the JIT. +// This method is used for methods 05, 06n, and 07. -#define GB_GET_MAPPED(pX_start, pX_fini, pX, pX_end, Xp, j, k, Z_to_X, Xvlen) \ - int64_t pX_start = -1, pX_fini = -1 ; \ +// GB_GET_VECTOR_M: optimized for the M matrix +#define GB_GET_VECTOR_M \ + int64_t pM, pM_end ; \ if (fine_task) \ { \ - /* A fine task operates on a slice of X(:,k) */ \ - pX_start = TaskList [taskid].pX ; \ - pX_fini = TaskList [taskid].pX_end ; \ + /* A fine task operates on a slice of M(:,k) */ \ + pM = TaskList [taskid].pA ; \ + pM_end = TaskList [taskid].pA_end ; \ } \ else \ { \ /* vectors are never sliced for a coarse task */ \ - int64_t kX = (Z_to_X == NULL) ? j : Z_to_X [k] ; \ - if (kX >= 0) \ - { \ - pX_start = GBP (Xp, kX, Xvlen) ; \ - pX_fini = GBP (Xp, kX+1, Xvlen) ; \ - } \ - } - -//------------------------------------------------------------------------------ -// GB_GET_EVEC: get the content of a vector for Method08n -//------------------------------------------------------------------------------ - -// Used for the M and A matrices. Note that the generic GBP macro is used, -// so this is not fully optimized for the JIT. - -#define GB_GET_EVEC(pX_start, pX_fini, pX, pX_end, Xp, Xh, j,k,Z_to_X,Xvlen)\ - int64_t pX_start = -1, pX_fini = -1 ; \ - if (fine_task) \ - { \ - /* A fine task operates on a slice of X(:,k) */ \ - pX_start = TaskList [taskid].pX ; \ - pX_fini = TaskList [taskid].pX_end ; \ - } \ - else \ - { \ - /* vectors are never sliced for a coarse task */ \ - int64_t kX = (Zh_shallow == Xh) ? k : \ - ((Z_to_X == NULL) ? j : Z_to_X [k]) ; \ - if (kX >= 0) \ - { \ - pX_start = GBP (Xp, kX, Xvlen) ; \ - pX_fini = GBP (Xp, kX+1, Xvlen) ; \ - } \ + pM = GBp_M (Mp, k, Mvlen) ; \ + pM_end = GBp_M (Mp, k+1, Mvlen) ; \ } //------------------------------------------------------------------------------ @@ -1385,13 +1431,14 @@ { \ if (GB_C_IS_HYPER) \ { \ - GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, \ - C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; \ + GB_hyper_hash_lookup (GB_Cp_IS_32, GB_Cj_IS_32, \ + Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, \ + j, &pC_start, &pC_end) ; \ } \ else \ { \ - pC_start = GBP_C (Cp, j , Cvlen) ; \ - pC_end = GBP_C (Cp, j+1, Cvlen) ; \ + pC_start = GBp_C (Cp, j , Cvlen) ; \ + pC_end = GBp_C (Cp, j+1, Cvlen) ; \ } \ } @@ -1400,13 +1447,14 @@ { \ if (GB_M_IS_HYPER) \ { \ - GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, \ - M_Yi, M_Yx, M_hash_bits, j, &pM_start, &pM_end) ; \ + GB_hyper_hash_lookup (GB_Mp_IS_32, GB_Mj_IS_32, \ + Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, \ + j, &pM_start, &pM_end) ; \ } \ else \ { \ - pM_start = GBP_M (Mp, j , Mvlen) ; \ - pM_end = GBP_M (Mp, j+1, Mvlen) ; \ + pM_start = GBp_M (Mp, j , Mvlen) ; \ + pM_end = GBp_M (Mp, j+1, Mvlen) ; \ } \ } @@ -1415,13 +1463,14 @@ { \ if (GB_A_IS_HYPER) \ { \ - GB_hyper_hash_lookup (Ah, Anvec, Ap, A_Yp, \ - A_Yi, A_Yx, A_hash_bits, j, &pA_start, &pA_end) ; \ + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, \ + Ah, Anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, \ + j, &pA_start, &pA_end) ; \ } \ else \ { \ - pA_start = GBP_A (Ap, j , Avlen) ; \ - pA_end = GBP_A (Ap, j+1, Avlen) ; \ + pA_start = GBp_A (Ap, j , Avlen) ; \ + pA_end = GBp_A (Ap, j+1, Avlen) ; \ } \ } @@ -1430,13 +1479,14 @@ { \ if (GB_S_IS_HYPER) \ { \ - GB_hyper_hash_lookup (Sh, Snvec, Sp, S_Yp, \ - S_Yi, S_Yx, S_hash_bits, j, &pS_start, &pS_end) ; \ + GB_hyper_hash_lookup (GB_Sp_IS_32, GB_Sj_IS_32, \ + Sh, Snvec, Sp, S_Yp, S_Yi, S_Yx, S_hash_bits, \ + j, &pS_start, &pS_end) ; \ } \ else \ { \ - pS_start = GBP_S (Sp, j , Svlen) ; \ - pS_end = GBP_S (Sp, j+1, Svlen) ; \ + pS_start = GBp_S (Sp, j , Svlen) ; \ + pS_end = GBp_S (Sp, j+1, Svlen) ; \ } \ } @@ -1447,7 +1497,7 @@ #define GB_LOOKUP_VECTOR_jC \ /* lookup jC in C */ \ /* jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend */ \ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; \ + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; \ int64_t pC_start, pC_end ; \ if (fine_task) \ { \ @@ -1483,8 +1533,8 @@ { \ /* S is sparse or hypersparse */ \ int64_t pright = pS_end - 1 ; \ - bool found ; \ - GB_SPLIT_BINARY_SEARCH (iQ_start, Si, pS, pright, found) ; \ + GB_split_binary_search (iQ_start, Si, GB_Si_IS_32, \ + &pS, &pright) ; \ } \ } @@ -1503,8 +1553,8 @@ { \ /* M is sparse or hypersparse */ \ int64_t pright = pM_end - 1 ; \ - bool found ; \ - GB_SPLIT_BINARY_SEARCH (iQ_start, Mi, pM, pright, found) ; \ + GB_split_binary_search (iQ_start, Mi, GB_Mi_IS_32, \ + &pM, &pright) ; \ } \ } @@ -1534,7 +1584,7 @@ int64_t pM = pM_start ; \ int64_t pright = pM_end - 1 ; \ bool found ; \ - GB_BINARY_SEARCH (i, Mi, pM, pright, found) ; \ + found = GB_binary_search (i, Mi, GB_Mi_IS_32, &pM, &pright) ; \ if (found) \ { \ mij = GB_MCAST (Mx, pM, msize) ; \ @@ -1562,28 +1612,28 @@ #define GB_PENDING_CUMSUM \ C->nzombies = nzombies ; \ /* cumsum Npending for each task, and get total from all tasks */ \ - GB_cumsum1 (Npending, ntasks) ; \ + GB_cumsum1_64 ((uint64_t *) Npending, ntasks) ; \ int64_t total_new_npending = Npending [ntasks] ; \ if (total_new_npending == 0) \ { \ /* no pending tuples, so skip phase 2 */ \ GB_FREE_ALL ; \ - ASSERT_MATRIX_OK (C, "C, no pending tuples ", GB_ZOMBIE (GB0)) ; \ + ASSERT_MATRIX_OK (C, "C, no pending tuples ", GB0_Z) ; \ return (GrB_SUCCESS) ; \ } \ /* ensure C->Pending is large enough to handle total_new_npending */ \ /* more tuples. The type of Pending->x is atype, the type of A or */ \ /* the scalar. */ \ - if (!GB_Pending_ensure (&(C->Pending), GB_C_ISO, atype, accum, \ - is_matrix, total_new_npending, Werk)) \ + if (!GB_Pending_ensure (C, GB_C_ISO, atype, accum, total_new_npending, \ + Werk)) \ { \ GB_FREE_ALL ; \ return (GrB_OUT_OF_MEMORY) ; \ } \ GB_Pending Pending = C->Pending ; \ - int64_t *restrict Pending_i = Pending->i ; \ - int64_t *restrict Pending_j = Pending->j ; \ - GB_A_TYPE *restrict Pending_x = Pending->x ; /* NULL if C is iso */ \ + GB_CPendingi_DECLARE (Pending_i) ; GB_CPendingi_PTR (Pending_i, C) ; \ + GB_CPendingj_DECLARE (Pending_j) ; GB_CPendingj_PTR (Pending_j, C) ; \ + GB_A_TYPE *restrict Pending_x = (GB_A_TYPE *) Pending->x ; \ int64_t npending_orig = Pending->n ; \ bool pending_sorted = Pending->sorted ; @@ -1614,7 +1664,7 @@ // Pending->x is NULL. // The type of Pending_x is always identical to the type of A, or the scalar, -// so no typecasting is required. +// so no typecasting is required. Pending_x is NULL if C is iso. // insert a scalar into Pending_x: #undef GB_COPY_scalar_to_PENDING_X @@ -1648,8 +1698,13 @@ task_sorted = false ; \ } \ } \ - Pending_i [my_npending] = iC ; \ - if (Pending_j != NULL) Pending_j [my_npending] = jC ; \ + /* Pending_i [my_npending] = iC ; */ \ + GB_ISET (Pending_i, my_npending, iC) ; \ + if (Pending_j != NULL) \ + { \ + /* Pending_j [my_npending] = jC ; */ \ + GB_ISET (Pending_j, my_npending, jC) ; \ + } \ if (Pending_x != NULL) copy_to_Pending_x ; \ my_npending++ ; \ ilast = iC ; \ @@ -1684,12 +1739,12 @@ /* (i,j) is the first pending tuple for this task; check */ \ /* with the pending tuple just before it */ \ ASSERT (my_npending < npending_orig + total_new_npending) ; \ - int64_t i = Pending_i [my_npending] ; \ + int64_t i = GB_IGET (Pending_i, my_npending) ; \ int64_t j = (Pending_j != NULL) ? \ - Pending_j [my_npending] : 0 ; \ - int64_t ilast = Pending_i [my_npending-1] ; \ + GB_IGET (Pending_j, my_npending) : 0 ; \ + int64_t ilast = GB_IGET (Pending_i, my_npending-1) ; \ int64_t jlast = (Pending_j != NULL) ? \ - Pending_j [my_npending-1] : 0 ; \ + GB_IGET (Pending_j, my_npending-1) : 0 ; \ pending_sorted = pending_sorted && \ ((jlast < j) || (jlast == j && ilast <= i)) ; \ } \ @@ -1698,7 +1753,7 @@ Pending->n += total_new_npending ; \ Pending->sorted = pending_sorted ; \ GB_FREE_ALL ; \ - ASSERT_MATRIX_OK (C, "C with pending tuples", GB_ZOMBIE (GB0)) ; \ + ASSERT_MATRIX_OK (C, "C with pending tuples", GB0_Z) ; \ return (GrB_SUCCESS) ; //============================================================================== @@ -1708,7 +1763,7 @@ #define GB_FREE_ALL_FOR_BITMAP \ GB_WERK_POP (A_ek_slicing, int64_t) ; \ GB_WERK_POP (M_ek_slicing, int64_t) ; \ - GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; + GB_FREE_MEMORY (&TaskList_IxJ, TaskList_IxJ_size) ; //------------------------------------------------------------------------------ // GB_GET_C_A_SCALAR_FOR_BITMAP: get the C and A matrices and the scalar @@ -1729,7 +1784,7 @@ /* C matrix: */ \ ASSERT_MATRIX_OK (C, "C for bitmap assign", GB0) ; \ ASSERT (GB_IS_BITMAP (C)) ; \ - int8_t *Cb = C->b ; \ + int8_t *Cb = C->b ; \ const bool C_iso = C->iso ; \ GB_C_TYPE *Cx = (GB_C_ISO) ? NULL : (GB_C_TYPE *) C->x ; \ const size_t csize = C->type->size ; \ @@ -1740,10 +1795,10 @@ const int64_t cnzmax = Cvlen * Cvdim ; \ int64_t cnvals = C->nvals ; \ /* A matrix and scalar: */ \ - const int64_t *Ap = NULL ; \ - const int64_t *Ah = NULL ; \ - const int8_t *Ab = NULL ; \ - const int64_t *Ai = NULL ; \ + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; \ + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; \ + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; \ + const int8_t *Ab = NULL ; \ const GB_A_TYPE *Ax = NULL ; \ const bool A_iso = (GB_SCALAR_ASSIGN) ? false : A->iso ; \ const GrB_Type atype = (GB_SCALAR_ASSIGN) ? scalar_type : A->type ; \ @@ -1753,10 +1808,7 @@ if (!(GB_SCALAR_ASSIGN)) \ { \ ASSERT_MATRIX_OK (A, "A for bitmap assign/subassign", GB0) ; \ - Ap = A->p ; \ - Ah = A->h ; \ Ab = A->b ; \ - Ai = A->i ; \ Ax = (GB_C_ISO) ? NULL : (GB_A_TYPE *) A->x ; \ Avlen = A->vlen ; \ } \ diff --git a/GraphBLAS/Source/assign/include/GB_bitmap_scatter.h b/GraphBLAS/Source/assign/include/GB_bitmap_scatter.h index 021ee23eb9..68d37d07c3 100644 --- a/GraphBLAS/Source/assign/include/GB_bitmap_scatter.h +++ b/GraphBLAS/Source/assign/include/GB_bitmap_scatter.h @@ -2,7 +2,7 @@ // GB_bitmap_scatter.h: definitions for GB_bitmap_assign* methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/include/GB_index.h b/GraphBLAS/Source/assign/include/GB_index.h deleted file mode 100644 index ffe8c9acdd..0000000000 --- a/GraphBLAS/Source/assign/include/GB_index.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_index.h: definitions for index lists and types of assignments -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_INDEX_H -#define GB_INDEX_H - -//------------------------------------------------------------------------------ -// maximum matrix or vector dimension -//------------------------------------------------------------------------------ - -#ifndef GrB_INDEX_MAX -#define GrB_INDEX_MAX ((GrB_Index) (1ULL << 60) - 1) -#endif - -#define GB_NMAX (GrB_INDEX_MAX + 1) - -//------------------------------------------------------------------------------ -// kind of index list, Ikind and Jkind, and assign variations -//------------------------------------------------------------------------------ - -#define GB_ALL 0 -#define GB_RANGE 1 -#define GB_STRIDE 2 -#define GB_LIST 3 - -#define GB_ASSIGN 0 -#define GB_SUBASSIGN 1 -#define GB_ROW_ASSIGN 2 -#define GB_COL_ASSIGN 3 - -#endif - diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_template.c index 78ceac9a8d..8cc8748c34 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_1_template: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; + bool mij = (GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // assignment phase @@ -78,26 +78,26 @@ // FUTURE: if C FULL: Cb is effectively all 1's and stays that way #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pC,pA) \ - { \ - int64_t pM = GB_GET_pM ; \ - GB_GET_MIJ (mij, pM) ; \ - if (mij) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else /* (cb == 1) */ \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ - } \ + #define GB_IXJ_WORK(pC,pA) \ + { \ + int64_t pM = GB_GET_pM ; \ + GB_GET_MIJ (mij, pM) ; \ + if (mij) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else /* (cb == 1) */ \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + } \ } ASSERT (GB_ASSIGN_KIND == GB_ASSIGN || GB_ASSIGN_KIND == GB_SUBASSIGN) ; @@ -144,26 +144,26 @@ // FUTURE: if C FULL: Cb is effectively all 1's and stays that way - #define GB_AIJ_WORK(pC,pA) \ - { \ - int64_t pM = GB_GET_pM ; \ - GB_GET_MIJ (mij, pM) ; \ - if (mij) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = Ax [pA] */ \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int64_t pM = GB_GET_pM ; \ + GB_GET_MIJ (mij, pM) ; \ + if (mij) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = Ax [pA] */ \ GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else /* (cb == 1) */ \ - { \ - /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ - } \ - } \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else /* (cb == 1) */ \ + { \ + /* Cx [pC] += Ax [pA] */ \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ;\ + } \ + } \ } switch (GB_ASSIGN_KIND) diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_whole_template.c index 2b1bcc6b30..48136c9bcd 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_1_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_1_whole_template: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pC) \ - bool mij = (GBB_M (Mb, pC) && GB_MCAST (Mx, pC, msize)) ^ GB_MASK_COMP ; + bool mij = (GBb_M (Mb, pC) && GB_MCAST (Mx, pC, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // slice @@ -73,30 +73,30 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - int8_t cb = Cb [pC] ; \ - if (mij) \ - { \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else /* (cb == 1) */ \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ - } \ - else \ - { \ - /* delete C(i,j) if present */ \ - Cb [pC] = 0 ; \ - task_cnvals -= (cb == 1) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + int8_t cb = Cb [pC] ; \ + if (mij) \ + { \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else /* (cb == 1) */ \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + } \ + else \ + { \ + /* delete C(i,j) if present */ \ + Cb [pC] = 0 ; \ + task_cnvals -= (cb == 1) ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" @@ -109,23 +109,23 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - if (mij) \ - { \ - if (Cb [pC]) \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ - else \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + if (mij) \ + { \ + if (Cb [pC]) \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" } @@ -148,36 +148,36 @@ //-------------------------------------------------------------- #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - int8_t cb = Cb [pC] ; \ - if (mij) \ - { \ - if (GBB_A (Ab, pC)) \ - { \ - /* mij true and A(i,j) present */ \ - if (cb) \ - { \ - /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ - C_iso) ; \ - } \ - else \ - { \ - /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ - C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - } \ - } \ - else \ - { \ - /* delete C(i,j) if present */ \ - Cb [pC] = 0 ; \ - task_cnvals -= (cb == 1) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + int8_t cb = Cb [pC] ; \ + if (mij) \ + { \ + if (GBb_A (Ab, pC)) \ + { \ + /* mij true and A(i,j) present */ \ + if (cb) \ + { \ + /* Cx [pC] += Ax [pC] */ \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ + C_iso) ; \ + } \ + else \ + { \ + /* Cx [pC] = Ax [pC] */ \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + } \ + } \ + else \ + { \ + /* delete C(i,j) if present */ \ + Cb [pC] = 0 ; \ + task_cnvals -= (cb == 1) ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" @@ -192,7 +192,7 @@ #undef GB_CIJ_WORK #define GB_CIJ_WORK(pC) \ { \ - if (mij && GBB_A (Ab, pC)) \ + if (mij && GBb_A (Ab, pC)) \ { \ /* mij true and A(i,j) present */ \ if (Cb [pC]) \ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_template.c index edaedd639c..c12323e1ce 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_2_template: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ #undef GB_GET_MIJ #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; + bool mij = (GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // C_replace phase @@ -93,18 +93,18 @@ // for all entries in IxJ #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pC,pA) \ - { \ - int64_t pM = GB_GET_pM ; \ - GB_GET_MIJ (mij, pM) ; \ - if (mij) \ - { \ - int8_t cb = Cb [pC] ; \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals += (cb == 0) ; \ - } \ + #define GB_IXJ_WORK(pC,pA) \ + { \ + int64_t pM = GB_GET_pM ; \ + GB_GET_MIJ (mij, pM) ; \ + if (mij) \ + { \ + int8_t cb = Cb [pC] ; \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals += (cb == 0) ; \ + } \ } ASSERT (GB_ASSIGN_KIND == GB_ASSIGN || GB_ASSIGN_KIND == GB_SUBASSIGN) ; @@ -158,18 +158,18 @@ // TODO: if A is bitmap or full, use a single pass - #define GB_AIJ_WORK(pC,pA) \ - { \ - int64_t pM = GB_GET_pM ; \ - GB_GET_MIJ (mij, pM) ; \ - if (mij) \ - { \ - int8_t cb = Cb [pC] ; \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 4 ; \ - task_cnvals += (cb == 0) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int64_t pM = GB_GET_pM ; \ + GB_GET_MIJ (mij, pM) ; \ + if (mij) \ + { \ + int8_t cb = Cb [pC] ; \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 4 ; \ + task_cnvals += (cb == 0) ; \ + } \ } #undef GB_IXJ_WORK diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_whole_template.c index 975a5cf1cb..c7941d3123 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_2_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_2_whole_template: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; + bool mij = (GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // assignment phase @@ -69,22 +69,22 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - int8_t cb = Cb [pC] ; \ - if (mij) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals += (cb == 0) ; \ - } \ - else \ - { \ - /* delete C(i,j) if present */ \ - Cb [pC] = 0 ; \ - task_cnvals -= (cb == 1) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + int8_t cb = Cb [pC] ; \ + if (mij) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals += (cb == 0) ; \ + } \ + else \ + { \ + /* delete C(i,j) if present */ \ + Cb [pC] = 0 ; \ + task_cnvals -= (cb == 1) ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" @@ -97,16 +97,16 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - if (mij) \ - { \ - /* Cx [pC] = scalar */ \ - int8_t cb = Cb [pC] ; \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals += (cb == 0) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + if (mij) \ + { \ + /* Cx [pC] = scalar */ \ + int8_t cb = Cb [pC] ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals += (cb == 0) ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" } @@ -137,7 +137,7 @@ #define GB_CIJ_WORK(pC) \ { \ int8_t cb = Cb [pC] ; \ - if (mij && GBB_A (Ab, pC)) \ + if (mij && GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ; \ @@ -167,7 +167,7 @@ if (mij) \ { \ int8_t cb = Cb [pC] ; \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_template.c index 6dd5fe4f93..98db67ec21 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_3_template: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,22 +56,22 @@ // for all entries in the mask M: #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) \ - { \ - int8_t cb = Cb [pC] ; \ - /* keep this entry */ \ - Cb [pC] = keep ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - task_cnvals++ ; \ - } \ - else /* (cb == 1) */ \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ + #define GB_MASK_WORK(pC) \ + { \ + int8_t cb = Cb [pC] ; \ + /* keep this entry */ \ + Cb [pC] = keep ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + task_cnvals++ ; \ + } \ + else /* (cb == 1) */ \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ } #include "template/GB_bitmap_assign_M_sub_template.c" @@ -119,21 +119,21 @@ ASSERT (GB_ASSIGN_KIND == GB_ASSIGN) ; // for all entries in IxJ #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 2) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 3 ; \ - task_cnvals++ ; \ - } \ - else if (cb == 3) \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 2) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 3 ; \ + task_cnvals++ ; \ + } \ + else if (cb == 3) \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -156,21 +156,21 @@ // Cx(p) += aij // C(iC,jC) still present, updated // Cb(p) still 3 - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 2) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 3 ; \ - task_cnvals++ ; \ - } \ - else if (cb == 3) \ - { \ - /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 2) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 3 ; \ + task_cnvals++ ; \ + } \ + else if (cb == 3) \ + { \ + /* Cx [pC] += Ax [pA] */ \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ;\ + } \ } #include "template/GB_bitmap_assign_A_template.c" } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_whole_template.c index 41f4f4bef6..b84c52ee83 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_3_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_3_whole_template: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -66,28 +66,28 @@ // Cb (i,j) = 3: cij present, mij 1 #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - switch (Cb [pC]) \ - { \ - case 1: /* C(i,j) present, M(i,j) = 0 */ \ - /* delete this entry */ \ - Cb [pC] = 0 ; \ - task_cnvals-- ; \ - break ; \ - case 2: /* C(i,j) not present, M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - break ; \ - case 3: /* C(i,j) present, M(i,j) = 1 */ \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - Cb [pC] = 1 ; \ - break ; \ - default: ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + switch (Cb [pC]) \ + { \ + case 1: /* C(i,j) present, M(i,j) = 0 */ \ + /* delete this entry */ \ + Cb [pC] = 0 ; \ + task_cnvals-- ; \ + break ; \ + case 2: /* C(i,j) not present, M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + break ; \ + case 3: /* C(i,j) present, M(i,j) = 1 */ \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + Cb [pC] = 1 ; \ + break ; \ + default: ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" @@ -100,22 +100,22 @@ //------------------------------------------------------------------ #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) \ - { \ - if (Cb [pC]) \ - { \ - /* C(i,j) present, M(i,j) = 1 */ \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ - else \ - { \ - /* C(i,j) not present, M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ + #define GB_MASK_WORK(pC) \ + { \ + if (Cb [pC]) \ + { \ + /* C(i,j) present, M(i,j) = 1 */ \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* C(i,j) not present, M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ } #include "template/GB_bitmap_assign_M_all_template.c" } @@ -163,7 +163,7 @@ task_cnvals-- ; \ break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -178,7 +178,7 @@ } \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ @@ -202,7 +202,7 @@ #undef GB_MASK_WORK #define GB_MASK_WORK(pC) \ { \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* A(i,j) is present */ \ if (Cb [pC]) \ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_template.c index dc40a2f293..b99a76ed20 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_4_template: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -84,22 +84,22 @@ // for all IxJ #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb >= 2) \ - { \ - /* Cx [pC] = scalar */ \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb >= 2) \ + { \ + /* Cx [pC] = scalar */ \ GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals += (cb == 2) ; \ - } \ - else if (C_replace && cb == 1) \ - { \ - /* delete this entry */ \ - Cb [pC] = 0 ; \ - task_cnvals-- ; \ - } \ + Cb [pC] = 1 ; \ + task_cnvals += (cb == 2) ; \ + } \ + else if (C_replace && cb == 1) \ + { \ + /* delete this entry */ \ + Cb [pC] = 0 ; \ + task_cnvals-- ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -115,16 +115,16 @@ // for all IxJ #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb >= 2) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = keep ; \ - task_cnvals += (cb == 2) ; \ - } \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb >= 2) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = keep ; \ + task_cnvals += (cb == 2) ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -171,16 +171,16 @@ // Cx(p) = aij // C(iC,jC) is present, update it // Cb(p) = 4 // keep it - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb >= 2) \ - { \ - /* Cx [pC] = Ax [pA] ; */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 4 ; \ - task_cnvals += (cb == 2) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb >= 2) \ + { \ + /* Cx [pC] = Ax [pA] ; */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 4 ; \ + task_cnvals += (cb == 2) ; \ + } \ } #include "template/GB_bitmap_assign_A_template.c" diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_whole_template.c index 7a05033aa9..69852cb852 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_4_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_4_whole_template: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -102,22 +102,22 @@ //------------------------------------------------------------------ #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) \ - { \ - if (Cb [pC]) \ - { \ - /* C(i,j) present, M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ + #define GB_MASK_WORK(pC) \ + { \ + if (Cb [pC]) \ + { \ + /* C(i,j) present, M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - } \ - else \ - { \ - /* C(i,j) not present, M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ + } \ + else \ + { \ + /* C(i,j) not present, M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ } #include "template/GB_bitmap_assign_M_all_template.c" } @@ -164,7 +164,7 @@ task_cnvals-- ; \ break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -179,7 +179,7 @@ } \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -212,7 +212,7 @@ if (Cb [pC]) \ { \ /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ @@ -227,7 +227,7 @@ else \ { \ /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ @@ -299,8 +299,6 @@ // C = A where A is sparse or hyper, with no entries //-------------------------------------------------------------- - GBURBLE ("(A empty) ") ; - // delete entries via the mask #undef GB_MASK_WORK #define GB_MASK_WORK(pC) \ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_template.c index c1680868ca..62b22fd343 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_5_template: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -65,21 +65,21 @@ //------------------------------------------------------------------ // for all entries in IxJ - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -99,21 +99,21 @@ // Cx(p) += aij // C(iC,jC) still present, updated // task_cnvals++ - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = Ax [pA] */ \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = Ax [pA] */ \ GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else \ - { \ - /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ - } \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else \ + { \ + /* Cx [pC] += Ax [pA] */ \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ;\ + } \ } #include "template/GB_bitmap_assign_A_template.c" } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_whole_template.c index 644d5666e6..f4e93ce11b 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_5_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_5_whole_template: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -65,19 +65,19 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - } \ - else \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + } \ + else \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ } if (!C_iso) { diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_6_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_6_template.c index fcbe2cb736..fd70007841 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_6_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_6_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_6_template: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -130,12 +130,12 @@ // Cx(p) = aij // C(iC,jC) inserted or updated // Cb(p) = 1 - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ } #include "template/GB_bitmap_assign_A_template.c" diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_6b_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_6b_whole_template.c index 6a8d90335a..005e2ab9e7 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_6b_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_6b_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_6b_whole_template: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_template.c index 21a009c6ae..c2c098c44f 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_7_template: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -66,21 +66,21 @@ //---------------------------------------------------------------------- // for all IxJ - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else if (cb == 1) \ - { \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - } \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else if (cb == 1) \ + { \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -103,21 +103,21 @@ // if Cb(p) == 2 // do nothing // if Cb(p) == 3 // do nothing - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else if (cb == 1) \ - { \ - /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else if (cb == 1) \ + { \ + /* Cx [pC] += Ax [pA] */ \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ + } \ } #include "template/GB_bitmap_assign_A_template.c" } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_whole_template.c index 6ec5e41e6f..88d834e247 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_7_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_7_whole_template: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -69,31 +69,31 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - switch (Cb [pC]) \ - { \ - case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - break ; \ - case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - break ; \ - case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ - /* clear the mask from C */ \ - Cb [pC] = 0 ; \ - break ; \ - case 3: /* C(i,j) present, !M(i,j) = 0 */ \ - /* delete this entry */ \ - Cb [pC] = 0 ; \ - task_cnvals-- ; \ - break ; \ - default: ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + switch (Cb [pC]) \ + { \ + case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + break ; \ + case 1: /* C(i,j) present, !M(i,j) = 1 */ \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + break ; \ + case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ + /* clear the mask from C */ \ + Cb [pC] = 0 ; \ + break ; \ + case 3: /* C(i,j) present, !M(i,j) = 0 */ \ + /* delete this entry */ \ + Cb [pC] = 0 ; \ + task_cnvals-- ; \ + break ; \ + default: ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" @@ -106,30 +106,30 @@ //------------------------------------------------------------------ #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - switch (Cb [pC]) \ - { \ - case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - break ; \ - case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ - break ; \ - case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ - /* clear the mask from C */ \ - Cb [pC] = 0 ; \ - break ; \ - case 3: /* C(i,j) present, !M(i,j) = 0 */ \ - /* C(i,j) remains; clear the mask from C */ \ - Cb [pC] = 1 ; \ - break ; \ - default: ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + switch (Cb [pC]) \ + { \ + case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + break ; \ + case 1: /* C(i,j) present, !M(i,j) = 1 */ \ + /* Cx [pC] += scalar */ \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + break ; \ + case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ + /* clear the mask from C */ \ + Cb [pC] = 0 ; \ + break ; \ + case 3: /* C(i,j) present, !M(i,j) = 0 */ \ + /* C(i,j) remains; clear the mask from C */ \ + Cb [pC] = 1 ; \ + break ; \ + default: ; \ + } \ } #include "template/GB_bitmap_assign_C_whole_template.c" } @@ -162,7 +162,7 @@ switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -172,7 +172,7 @@ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ @@ -207,7 +207,7 @@ switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -217,7 +217,7 @@ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ @@ -249,21 +249,21 @@ // assign or accumulate entries from A into C #undef GB_AIJ_WORK - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb == 0) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals++ ; \ - } \ - else if (cb == 1) \ - { \ - /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb == 0) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals++ ; \ + } \ + else if (cb == 1) \ + { \ + /* Cx [pC] += Ax [pA] */ \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ;\ + } \ } #include "template/GB_bitmap_assign_A_whole_template.c" diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_template.c index dcc6bfd674..971c556230 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_8_template: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -66,27 +66,27 @@ //---------------------------------------------------------------------- // for all IxJ - #define GB_IXJ_WORK(pC,ignore) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb <= 1) \ - { \ - /* Cx [pC] = scalar */ \ - GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ - Cb [pC] = 1 ; \ - task_cnvals += (cb == 0) ; \ - } \ - else if (C_replace) \ - { \ - /* delete this entry */ \ - Cb [pC] = 0 ; \ - task_cnvals -= (cb == 3) ; \ - } \ - else \ - { \ - /* keep this entry */ \ - Cb [pC] = (cb == 3) ; \ - } \ + #define GB_IXJ_WORK(pC,ignore) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb <= 1) \ + { \ + /* Cx [pC] = scalar */ \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ + Cb [pC] = 1 ; \ + task_cnvals += (cb == 0) ; \ + } \ + else if (C_replace) \ + { \ + /* delete this entry */ \ + Cb [pC] = 0 ; \ + task_cnvals -= (cb == 3) ; \ + } \ + else \ + { \ + /* keep this entry */ \ + Cb [pC] = (cb == 3) ; \ + } \ } #include "template/GB_bitmap_assign_IxJ_template.c" @@ -109,16 +109,16 @@ // if Cb(p) == 2 // do nothing // if Cb(p) == 3 // do nothing - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb <= 1) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 4 ; \ - task_cnvals += (cb == 0) ; \ - } \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb <= 1) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ + Cb [pC] = 4 ; \ + task_cnvals += (cb == 0) ; \ + } \ } #include "template/GB_bitmap_assign_A_template.c" diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_whole_template.c index 9714a6690a..e287e3afcf 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_8_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_8_whole_template: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -162,7 +162,7 @@ switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -172,7 +172,7 @@ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -213,7 +213,7 @@ switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -223,7 +223,7 @@ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB_A (Ab, pC)) \ + if (GBb_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ @@ -260,16 +260,16 @@ // assign entries from A into C #undef GB_AIJ_WORK - #define GB_AIJ_WORK(pC,pA) \ - { \ - int8_t cb = Cb [pC] ; \ - if (cb <= 1) \ - { \ - /* Cx [pC] = Ax [pA] */ \ + #define GB_AIJ_WORK(pC,pA) \ + { \ + int8_t cb = Cb [pC] ; \ + if (cb <= 1) \ + { \ + /* Cx [pC] = Ax [pA] */ \ GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ - Cb [pC] = 4 ; \ - task_cnvals += (cb == 0) ; \ - } \ + Cb [pC] = 4 ; \ + task_cnvals += (cb == 0) ; \ + } \ } #include "template/GB_bitmap_assign_A_whole_template.c" diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_template.c index e9b2e8cbdf..da89aab4b4 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_A_template: traverse over A for bitmap assignment into C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -64,22 +64,22 @@ // find the part of A(:,k) for this task //------------------------------------------------------------------ - int64_t jA = GBH_A (Ah, k) ; + int64_t jA = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, nI), GBP_A (Ap, k+1, nI)) ; + GBp_A (Ap, k, nI), GBp_A (Ap, k+1, nI)) ; //------------------------------------------------------------------ // traverse over A(:,jA), the kth vector of A //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, jA, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, jA, GB_J_KIND, Jcolon) ; int64_t pC0 = jC * Cvlen ; // first entry in C(:,jC) for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - if (!GBB_A (Ab, pA)) continue ; - int64_t iA = GBI_A (Ai, pA, nI) ; - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + if (!GBb_A (Ab, pA)) continue ; + int64_t iA = GBi_A (Ai, pA, nI) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; // operate on C(iC,jC) at pC, and A(iA,jA) at pA. The mask // can be accessed at pC if M is bitmap or full. A has any diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_whole_template.c index 7817a0e20d..b8d57800e2 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_A_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_A_whole_template: traverse A for bitmap assignment into C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -64,9 +64,9 @@ // find the part of A(:,k) for this task //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, Avlen), GBP_A (Ap, k+1, Avlen)) ; + GBp_A (Ap, k, Avlen), GBp_A (Ap, k+1, Avlen)) ; //------------------------------------------------------------------ // traverse over A(:,j), the kth vector of A @@ -76,7 +76,7 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pC = i + pC0 ; // operate on C(i,j) at pC, and A(i,j) at pA. The mask // can be accessed at pC if M is bitmap or full. A has any diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_template.c index 20f6657fe3..b81f5213e3 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_C_template: iterate over a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ case GB_ROW_ASSIGN : { // iterate over all of C(iC,:) - const int64_t iC = I [0] ; + const int64_t iC = GB_IGET (I, 0) ; const int nthreads = GB_nthreads (Cvdim, chunk, nthreads_max) ; int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) \ @@ -59,7 +59,7 @@ case GB_COL_ASSIGN : { // iterate over all of C(:,jC) - const int64_t jC = J [0] ; + const int64_t jC = GB_IGET (J, 0) ; const int64_t pC0 = jC * Cvlen ; const int nthreads = GB_nthreads (Cvlen, chunk, nthreads_max) ; int tid ; diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_whole_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_whole_template.c index b48926b34c..1722e776d2 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_whole_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_C_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_C_whole_template: iterate over a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_IxJ_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_IxJ_template.c index f8f52ec745..5dda5a4b4f 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_IxJ_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_IxJ_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_IxJ_template: iterate over all of C(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,7 +27,7 @@ // It is not freed, so it can be used for subsequent uses of this template. // To free the workspace, the method that uses this template must do: // -// GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; +// GB_FREE_MEMORY (&TaskList_IxJ, TaskList_IxJ_size) ; { @@ -57,7 +57,9 @@ int64_t kfirst = TaskList_IxJ [taskid].kfirst ; int64_t klast = TaskList_IxJ [taskid].klast ; + #ifndef GB_NO_CNVALS int64_t task_cnvals = 0 ; + #endif bool fine_task = (klast == -1) ; int64_t iA_start = 0, iA_end = nI ; if (fine_task) @@ -79,7 +81,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, jA, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, jA, GB_J_KIND, Jcolon) ; int64_t pC0 = jC * vlen ; // first entry in C(:,jC) int64_t pA0 = jA * nI ; // first entry in A(:,jA) @@ -89,7 +91,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; int64_t pA = iA + pA0 ; // operate on C(iC,jC) at pC (if C is bitmap or full) diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_all_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_all_template.c index 3d1a1ac552..57c3aa2ba5 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_all_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_all_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_all_template: traverse M for GB_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,9 +42,9 @@ // find the part of M(:,k) for this task //------------------------------------------------------------------ - int64_t jM = GBH_M (Mh, k) ; + int64_t jM = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, - Mp [k], Mp [k+1]) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //------------------------------------------------------------------ // traverse over M(:,jM), the kth vector of M @@ -58,7 +58,7 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iC = Mi [pM] ; + int64_t iC = GB_IGET (Mi, pM) ; int64_t pC = iC + jC * Cvlen ; GB_MASK_WORK (pC) ; } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_col_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_col_template.c index bdce18551c..d9a50dc3e1 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_col_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_col_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_col_template: traverse M for GB_COL_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; const int64_t *restrict pstart_Mslice = M_ek_slicing + M_ntasks * 2 ; - int64_t jC = J [0] ; + int64_t jC = GB_IGET (J, 0) ; int tid ; #pragma omp parallel for num_threads(M_nthreads) schedule(dynamic,1) \ reduction(+:cnvals) @@ -43,9 +43,9 @@ //------------------------------------------------------------------ ASSERT (k == 0) ; - ASSERT (GBH_M (Mh, k) == 0) ; + ASSERT (GBh_M (Mh, k) == 0) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, - Mp [k], Mp [k+1]) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //------------------------------------------------------------------ // traverse over M(:,0), the kth vector of M @@ -57,7 +57,7 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iC = Mi [pM] ; + int64_t iC = GB_IGET (Mi, pM) ; int64_t pC = iC + jC * Cvlen ; GB_MASK_WORK (pC) ; } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_row_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_row_template.c index 487cb31cd6..c9f0dd9a34 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_row_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_row_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_row_template: traverse M for GB_ROW_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ const int64_t *restrict pstart_Mslice = M_ek_slicing + M_ntasks * 2 ; ASSERT (Mvlen == 1) ; - int64_t iC = I [0] ; + int64_t iC = GB_IGET (I, 0) ; int tid ; #pragma omp parallel for num_threads(M_nthreads) schedule(dynamic,1) \ reduction(+:cnvals) @@ -43,9 +43,9 @@ // find the part of M(0,k) for this task //------------------------------------------------------------------ - int64_t jM = GBH_M (Mh, k) ; + int64_t jM = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, - Mp [k], Mp [k+1]) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //------------------------------------------------------------------ // traverse over M(0,jM), the kth vector of M diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_sub_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_sub_template.c index f81ef6f1a4..7d300e9cd0 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_sub_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_sub_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_sub_template: traverse M for GB_SUBASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,16 +43,16 @@ // find the part of M(:,k) for this task //------------------------------------------------------------------ - int64_t jM = GBH_M (Mh, k) ; + int64_t jM = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, - Mp [k], Mp [k+1]) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //------------------------------------------------------------------ // traverse over M(:,jM), the kth vector of M //------------------------------------------------------------------ // for subassign, M has same size as C(I,J) and A. - int64_t jC = GB_ijlist (J, jM, Jkind, Jcolon) ; + int64_t jC = GB_IJLIST (J, jM, Jkind, Jcolon) ; int64_t pC0 = jC * Cvlen ; for (int64_t pM = pM_start ; pM < pM_end ; pM++) @@ -60,8 +60,8 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iM = Mi [pM] ; - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iM = GB_IGET (Mi, pM) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; GB_MASK_WORK (pC) ; } diff --git a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_template.c b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_template.c index 234e055606..00744c55a9 100644 --- a/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_template.c +++ b/GraphBLAS/Source/assign/template/GB_bitmap_assign_M_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_template: traverse over M for bitmap assignment into C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/assign/template/GB_subassign_01_template.c b/GraphBLAS/Source/assign/template/GB_subassign_01_template.c index 1e6bf59d6e..c604b74aba 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_01_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_01_template.c @@ -2,7 +2,7 @@ // GB_subassign_01_template: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,10 +26,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; GB_GET_SCALAR ; GB_GET_S ; @@ -77,7 +73,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) @@ -91,7 +87,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + bool found = (pS < pS_end) && (GBi_S (Si, pS, Svlen) == iA) ; if (!found) { // ----[. A 1]---------------------------------------------- @@ -143,7 +139,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) @@ -157,13 +153,13 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + bool found = (pS < pS_end) && (GBi_S (Si, pS, Svlen) == iA) ; if (!found) { // ----[. A 1]---------------------------------------------- // S (i,j) is not present, the scalar is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } else diff --git a/GraphBLAS/Source/assign/template/GB_subassign_02_template.c b/GraphBLAS/Source/assign/template/GB_subassign_02_template.c index ba2997ae98..f9f62a680e 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_02_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_02_template.c @@ -2,7 +2,7 @@ // GB_subassign_02_template: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -98,7 +98,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) { @@ -162,22 +162,58 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and A(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -273,19 +309,19 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { // ----[. A 1]------------------------------------------ // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } @@ -329,22 +365,58 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and A(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -355,7 +427,7 @@ // ----[. A 1]------------------------------------------ // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } @@ -374,8 +446,8 @@ // ----[. A 1]---------------------------------------------- // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iA = GBI_A (Ai, pA, Avlen) ; - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_03_template.c b/GraphBLAS/Source/assign/template/GB_subassign_03_template.c index c626abc2d2..17a99ff292 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_03_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_03_template.c @@ -2,7 +2,7 @@ // GB_subassign_02_template: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,10 +26,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; GB_GET_S ; GB_GET_ACCUM_SCALAR ; @@ -76,7 +72,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) @@ -90,7 +86,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - bool found = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool found = (pS < pS_end) && (GBi_S (Si, pS, Svlen) == iA) ; if (!found) { // ----[. A 1]---------------------------------------------- @@ -142,7 +138,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) @@ -156,13 +152,13 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + bool found = (pS < pS_end) && (GBi_S (Si, pS, Svlen) == iA) ; if (!found) { // ----[. A 1]---------------------------------------------- // S (i,j) is not present, the scalar is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } else diff --git a/GraphBLAS/Source/assign/template/GB_subassign_04_template.c b/GraphBLAS/Source/assign/template/GB_subassign_04_template.c index cf86c99038..80d3f8fe27 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_04_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_04_template.c @@ -2,7 +2,7 @@ // GB_subassign_02_template: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -106,7 +106,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) { @@ -167,22 +167,58 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and A(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -266,19 +302,19 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { // ----[. A 1]------------------------------------------ // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } @@ -322,22 +358,58 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and A(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -348,7 +420,7 @@ // ----[. A 1]------------------------------------------ // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } @@ -367,8 +439,8 @@ // ----[. A 1]---------------------------------------------- // S (i,j) is not present, A (i,j) is present // [. A 1]: action: ( insert ) - int64_t iA = GBI_A (Ai, pA, Avlen) ; - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; pA++ ; // go to the next entry in A(:,j) } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_05_template.c b/GraphBLAS/Source/assign/template/GB_subassign_05_template.c index 1a3bf494b8..f6392f8405 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_05_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_05_template.c @@ -2,13 +2,16 @@ // GB_subassign_05_template: C(I,J) = scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // Method 05: C(I,J) = scalar ; no S +// No entries can be deleted (no new zombies), but entries can be inserted. +// Prior zombies may exist in C. + // M: present // Mask_comp: false // C_replace: false @@ -27,11 +30,7 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; + const bool may_see_zombies_phase1 = (C->nzombies > 0) ; GB_GET_C_HYPER_HASH ; GB_GET_MASK ; GB_GET_SCALAR ; @@ -84,8 +83,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -115,10 +114,10 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; GB_iC_DENSE_LOOKUP ; // ----[C A 1] or [X A 1]------------------------------- @@ -143,13 +142,13 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase1) ; if (cij_found) { // ----[C A 1] or [X A 1]--------------------------- @@ -175,8 +174,11 @@ // phase 2: insert pending tuples //-------------------------------------------------------------------------- + // All zombies might have just been brought back to life, so recheck the + // may_see_zombies condition. + GB_PENDING_CUMSUM ; - zorig = C->nzombies ; + const bool may_see_zombies_phase2 = (C->nzombies > 0) ; #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ reduction(&&:pending_sorted) @@ -200,8 +202,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -230,13 +232,13 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase2) ; if (!cij_found) { // ----[. A 1]-------------------------------------- diff --git a/GraphBLAS/Source/assign/template/GB_subassign_05d_template.c b/GraphBLAS/Source/assign/template/GB_subassign_05d_template.c index ea8bc701e0..bdb7a85ab8 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_05d_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_05d_template.c @@ -2,7 +2,7 @@ // GB_subassign_05d_template: C = x where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,15 +44,17 @@ ASSERT (GB_JUMBLED_OK (M)) ; ASSERT (!C->iso) ; - - const int64_t *restrict Mp = M->p ; - const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; const size_t Mvlen = M->vlen ; const size_t msize = M->type->size ; + #ifndef GB_JIT_KERNEL + const bool M_is_bitmap = (Mb != NULL) ; + #endif GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; const int64_t Cvlen = C->vlen ; @@ -81,10 +83,10 @@ // find the part of M(:,k) to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, taskid, k, kfirst, klast, pstart_Mslice, - GBP_M (Mp, k, Mvlen), GBP_M (Mp, k+1, Mvlen)) ; + GBp_M (Mp, k, Mvlen), GBp_M (Mp, k+1, Mvlen)) ; // pC_start points to the start of C(:,j) int64_t pC_start = j * Cvlen ; @@ -93,14 +95,13 @@ // C = x //------------------------------------------------------------------ - if (Mx == NULL && Mb == NULL) // FIXME -// if (GB_MASK_STRUCT && !GB_M_IS_BITMAP) <--- use this instead + if (GB_MASK_STRUCT && !GB_M_IS_BITMAP) { // mask is structural and not bitmap GB_PRAGMA_SIMD_VECTORIZE for (int64_t pM = pM_start ; pM < pM_end ; pM++) { - int64_t pC = pC_start + GBI_M (Mi, pM, Mvlen) ; + int64_t pC = pC_start + GBi_M (Mi, pM, Mvlen) ; // Cx [pC] = cwork GB_COPY_cwork_to_C (Cx, pC, cwork, false) ; } @@ -110,9 +111,9 @@ GB_PRAGMA_SIMD_VECTORIZE for (int64_t pM = pM_start ; pM < pM_end ; pM++) { - if (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) + if (GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) { - int64_t pC = pC_start + GBI_M (Mi, pM, Mvlen) ; + int64_t pC = pC_start + GBi_M (Mi, pM, Mvlen) ; // Cx [pC] = cwork GB_COPY_cwork_to_C (Cx, pC, cwork, false) ; } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_06d_template.c b/GraphBLAS/Source/assign/template/GB_subassign_06d_template.c index 485bcb8d5a..e6688fe526 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_06d_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_06d_template.c @@ -2,7 +2,7 @@ // GB_subassign_06d_template: C = A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -67,7 +67,7 @@ } else { - GB_SLICE_MATRIX_WORK (A, 8, work, anz) ; + GB_SLICE_MATRIX_WORK2 (A, 8, work, anz) ; } //-------------------------------------------------------------------------- @@ -78,9 +78,9 @@ ASSERT (GB_JUMBLED_OK (A)) ; ASSERT (!GB_PENDING (A)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int8_t *restrict Ab = A->b ; const int64_t avlen = A->vlen ; @@ -251,17 +251,17 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // get A(:,j), the kth vector of A - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // pC is the start of C(:,j) int64_t pC = j * Cvlen ; // C=A(:,j) with C bitmap, A sparse GB_PRAGMA_SIMD_REDUCTION (+,task_cnvals) for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t p = pC + Ai [pA] ; + int64_t p = pC + GB_IGET (Ai, pA) ; // Cx [p] = Ax [pA] #ifndef GB_ISO_ASSIGN GB_COPY_aij_to_C (Cx, p, Ax, pA, @@ -295,17 +295,17 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // get A(:,j), the kth vector of A - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // pC is the start of C(:,j) int64_t pC = j * Cvlen ; // C=A(:,j) with C full, A sparse GB_PRAGMA_SIMD_VECTORIZE for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t p = pC + Ai [pA] ; + int64_t p = pC + GB_IGET (Ai, pA) ; // Cx [p] = Ax [pA] GB_COPY_aij_to_C (Cx, p, Ax, pA, GB_A_ISO, cwork, GB_C_ISO) ; @@ -475,10 +475,10 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // get A(:,j), the kth vector of A - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // pC is the start of C(:,j) int64_t pC = j * Cvlen ; // C=A(:,j) with C bitmap, A sparse @@ -487,7 +487,7 @@ { if (GB_AX_MASK (Ax, pA, asize)) { - int64_t p = pC + Ai [pA] ; + int64_t p = pC + GB_IGET (Ai, pA) ; // Cx [p] = Ax [pA] GB_COPY_aij_to_C (Cx, p, Ax, pA, GB_A_ISO, cwork, GB_C_ISO) ; @@ -518,10 +518,10 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // get A(:,j), the kth vector of A - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, taskid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // pC is the start of C(:,j) int64_t pC = j * Cvlen ; // C=A(:,j) with C full, A sparse @@ -530,7 +530,7 @@ { if (GB_AX_MASK (Ax, pA, asize)) { - int64_t p = pC + Ai [pA] ; + int64_t p = pC + GB_IGET (Ai, pA) ; // Cx [p] = Ax [pA] GB_COPY_aij_to_C (Cx, p, Ax, pA, GB_A_ISO, cwork, GB_C_ISO) ; diff --git a/GraphBLAS/Source/assign/template/GB_subassign_06n_template.c b/GraphBLAS/Source/assign/template/GB_subassign_06n_template.c index 73ea5938e7..a94e448890 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_06n_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_06n_template.c @@ -2,7 +2,7 @@ // GB_subassign_06n_template: C(I,J) = A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,22 +35,15 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; + const bool may_see_zombies_phase1 = (C->nzombies > 0) ; GB_GET_C_HYPER_HASH ; GB_GET_MASK ; GB_GET_A ; - const int64_t *restrict Ah = A->h ; - const int64_t Anvec = A->nvec ; - const bool A_is_hyper = (Ah != NULL) ; GB_OK (GB_hyper_hash_build (A, Werk)) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; //-------------------------------------------------------------------------- @@ -99,8 +92,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -143,13 +136,13 @@ if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; GB_iC_DENSE_LOOKUP ; // find iA in A(:,j) // A(:,j) is dense; no need for binary search pA = pA_start + iA ; - ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + ASSERT (GBi_A (Ai, pA, Avlen) == iA) ; // ----[C A 1] or [X A 1]----------------------- // [C A 1]: action: ( =A ): copy A to C, no acc // [X A 1]: action: ( undelete ): zombie lives @@ -174,13 +167,14 @@ if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; GB_iC_DENSE_LOOKUP ; // find iA in A(:,j) bool aij_found ; int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + aij_found = GB_binary_search (iA, Ai, GB_Ai_IS_32, + &pA, &apright) ; if (!aij_found) { @@ -217,14 +211,14 @@ if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase1) ; // lookup iA in A(:,j) pA = pA_start + iA ; - ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + ASSERT (GBi_A (Ai, pA, Avlen) == iA) ; if (cij_found) { @@ -260,15 +254,16 @@ if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (true) ; // sees its own new zombies // find iA in A(:,j) bool aij_found ; int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + aij_found = GB_binary_search (iA, Ai, GB_Ai_IS_32, + &pA, &apright) ; if (cij_found && aij_found) { @@ -291,6 +286,8 @@ // [C . 1]: action: ( delete ): becomes zombie // [X . 1]: action: ( X ): still zombie GB_DELETE_ENTRY ; + // a new zombie has been inserted into C(:,jC), so + // the next binary search above may see it. } } } @@ -304,8 +301,11 @@ // phase 2: insert pending tuples //-------------------------------------------------------------------------- + // All zombies might have just been brought back to life, so recheck the + // may_see_zombies condition. + GB_PENDING_CUMSUM ; - zorig = C->nzombies ; + const bool may_see_zombies_phase2 = (C->nzombies > 0) ; #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ reduction(&&:pending_sorted) @@ -329,8 +329,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -372,26 +372,27 @@ if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find iA in A(:,j) if (ajdense) { // A(:,j) is dense; no need for binary search pA = pA_start + iA ; - ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + ASSERT (GBi_A (Ai, pA, Avlen) == iA) ; } else { // A(:,j) is sparse; use binary search int64_t apright = pA_end - 1 ; bool aij_found ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + aij_found = GB_binary_search (iA, Ai, GB_Ai_IS_32, + &pA, &apright) ; if (!aij_found) continue ; } // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase2) ; if (!cij_found) { // C (iC,jC) is not present, A (i,j) is present diff --git a/GraphBLAS/Source/assign/template/GB_subassign_06s_template.c b/GraphBLAS/Source/assign/template/GB_subassign_06s_template.c index 956ffc3368..0f56fed95f 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_06s_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_06s_template.c @@ -2,7 +2,7 @@ // GB_subassign_06s_template: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -118,7 +118,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) @@ -198,9 +198,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -215,13 +251,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -273,7 +309,7 @@ while (pS < pS_end) { // S (i,j) is present but A (i,j) is not - int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; if (GB_MASK_COMP) mij = !mij ; if (mij) @@ -291,7 +327,7 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) @@ -359,12 +395,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { @@ -375,7 +411,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } } @@ -419,9 +455,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -436,13 +508,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -458,7 +530,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) @@ -475,14 +547,14 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_07_template.c b/GraphBLAS/Source/assign/template/GB_subassign_07_template.c index 9a86e3dc0d..8f54ae39dd 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_07_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_07_template.c @@ -2,7 +2,7 @@ // GB_subassign_07_template: C(I,J) += scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,11 +28,7 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; + const bool may_see_zombies_phase1 = (C->nzombies > 0) ; GB_GET_C_HYPER_HASH ; GB_GET_MASK ; GB_GET_ACCUM_SCALAR ; @@ -77,8 +73,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -107,10 +103,10 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; GB_iC_DENSE_LOOKUP ; // ----[C A 1] or [X A 1]------------------------------- @@ -135,13 +131,13 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase1) ; if (cij_found) { // ----[C A 1] or [X A 1]--------------------------- @@ -167,8 +163,11 @@ // phase 2: insert pending tuples //-------------------------------------------------------------------------- + // All zombies might have just been brought back to life, so recheck the + // may_see_zombies condition. + GB_PENDING_CUMSUM ; - zorig = C->nzombies ; + const bool may_see_zombies_phase2 = (C->nzombies > 0) ; #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ reduction(&&:pending_sorted) @@ -192,8 +191,8 @@ // get j, the kth vector of M //------------------------------------------------------------------ - int64_t j = GBH_M (Mh, k) ; - GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t j = GBh_M (Mh, k) ; + GB_GET_VECTOR_M ; int64_t mjnz = pM_end - pM ; if (mjnz == 0) continue ; @@ -222,13 +221,13 @@ // update C(iC,jC), but only if M(iA,j) allows it //---------------------------------------------------------- - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; + GB_iC_BINARY_SEARCH (may_see_zombies_phase2) ; if (!cij_found) { // ----[. A 1]-------------------------------------- diff --git a/GraphBLAS/Source/assign/template/GB_subassign_08n_template.c b/GraphBLAS/Source/assign/template/GB_subassign_08n_template.c index e15dd2b2ef..e140bd2b22 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_08n_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_08n_template.c @@ -2,7 +2,7 @@ // GB_subassign_08n_template: C(I,J) += A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ else \ { \ /* binary search for C(iC,jC) in C(:,jC) */ \ - GB_iC_BINARY_SEARCH ; \ + GB_iC_BINARY_SEARCH (may_see_zombies_phase1) ; \ if (cij_found) \ { \ /* ----[C A 1] or [X A 1]--------------------------- */ \ @@ -67,7 +67,7 @@ ASSERT (!cjdense) ; \ { \ /* binary search for C(iC,jC) in C(:,jC) */ \ - GB_iC_BINARY_SEARCH ; \ + GB_iC_BINARY_SEARCH (may_see_zombies_phase2) ; \ if (!cij_found) \ { \ /* ----[. A 1]-------------------------------------- */ \ @@ -85,15 +85,10 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; + const bool may_see_zombies_phase1 = (C->nzombies > 0) ; GB_GET_C_HYPER_HASH ; GB_GET_MASK ; GB_GET_ACCUM_MATRIX ; - const int64_t *Ah = A->h ; //-------------------------------------------------------------------------- // Method 08n: C(I,J) += A ; no S @@ -125,12 +120,16 @@ // in any combination. int64_t Znvec ; - const int64_t *restrict Zh_shallow = NULL ; + GB_MDECL (Zh_shallow, const, u) ; + bool Zj_is_32 ; GB_OK (GB_subassign_08n_slice ( &TaskList, &TaskList_size, &ntasks, &nthreads, &Znvec, &Zh_shallow, &Z_to_A, &Z_to_A_size, &Z_to_M, &Z_to_M_size, - C, I, nI, GB_I_KIND, Icolon, J, nJ, GB_J_KIND, Jcolon, + &Zj_is_32, C, + I, GB_I_IS_32, nI, GB_I_KIND, Icolon, + J, GB_J_IS_32, nJ, GB_J_KIND, Jcolon, A, M, Werk)) ; + GB_IPTR (Zh_shallow, Zj_is_32) ; GB_ALLOCATE_NPENDING_WERK ; //-------------------------------------------------------------------------- @@ -159,9 +158,45 @@ // get A(:,j) and M(:,j) //------------------------------------------------------------------ - int64_t j = GBH (Zh_shallow, k) ; - GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; - GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; + int64_t j = GBh (Zh_shallow, k) ; + + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Zh_shallow == Ah) ? k : + ((Z_to_A == NULL) ? j : Z_to_A [k]) ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pB ; + pM_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Zh_shallow == Mh) ? k : + ((Z_to_M == NULL) ? j : Z_to_M [k]) ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } //------------------------------------------------------------------ // quick checks for empty intersection of A(:,j) and M(:,j) @@ -170,10 +205,10 @@ int64_t ajnz = pA_end - pA ; int64_t mjnz = pM_end - pM ; if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI_A (Ai, pA, Avlen) ; - int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; - int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; + int64_t iA_first = GBi_A (Ai, pA, Avlen) ; + int64_t iA_last = GBi_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBi_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBi_M (Mi, pM_end-1, Mvlen) ; if (iA_last < iM_first || iM_last < iA_first) continue ; int64_t pM_start = pM ; @@ -199,12 +234,13 @@ { if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find iA in A(:,j) int64_t pright = pA_end - 1 ; bool found ; // FUTURE::: exploit dense A(:,j) - GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; + found = GB_binary_search (iA, Ai, GB_Ai_IS_32, + &pA, &pright) ; if (found) GB_PHASE1_ACTION ; } } @@ -222,7 +258,7 @@ for ( ; pA < pA_end ; pA++) { - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (mij) GB_PHASE1_ACTION ; } @@ -239,8 +275,8 @@ while (pA < pA_end && pM < pM_end) { - int64_t iA = GBI_A (Ai, pA, Avlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iA < iM) { // A(i,j) exists but not M(i,j) @@ -269,8 +305,11 @@ // phase 2: insert pending tuples //-------------------------------------------------------------------------- + // All zombies might have just been brought back to life, so recheck the + // may_see_zombies condition. + GB_PENDING_CUMSUM ; - zorig = C->nzombies ; + const bool may_see_zombies_phase2 = (C->nzombies > 0) ; #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ reduction(&&:pending_sorted) @@ -294,9 +333,45 @@ // get A(:,j) and M(:,j) //------------------------------------------------------------------ - int64_t j = GBH (Zh_shallow, k) ; - GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; - GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; + int64_t j = GBh (Zh_shallow, k) ; + + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Zh_shallow == Ah) ? k : + ((Z_to_A == NULL) ? j : Z_to_A [k]) ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pB ; + pM_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Zh_shallow == Mh) ? k : + ((Z_to_M == NULL) ? j : Z_to_M [k]) ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } //------------------------------------------------------------------ // quick checks for empty intersection of A(:,j) and M(:,j) @@ -305,10 +380,10 @@ int64_t ajnz = pA_end - pA ; int64_t mjnz = pM_end - pM ; if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI_A (Ai, pA, Avlen) ; - int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; - int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; + int64_t iA_first = GBi_A (Ai, pA, Avlen) ; + int64_t iA_last = GBi_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBi_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBi_M (Mi, pM_end-1, Mvlen) ; if (iA_last < iM_first || iM_last < iA_first) continue ; int64_t pM_start = pM ; @@ -335,12 +410,13 @@ { if (GB_MCAST (Mx, pM, msize)) { - int64_t iA = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_M (Mi, pM, Mvlen) ; // find iA in A(:,j) int64_t pright = pA_end - 1 ; bool found ; // FUTURE::: exploit dense A(:,j) - GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; + found = GB_binary_search (iA, Ai, GB_Ai_IS_32, + &pA, &pright) ; if (found) GB_PHASE2_ACTION ; } } @@ -358,7 +434,7 @@ for ( ; pA < pA_end ; pA++) { - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (mij) GB_PHASE2_ACTION ; } @@ -375,8 +451,8 @@ while (pA < pA_end && pM < pM_end) { - int64_t iA = GBI_A (Ai, pA, Avlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iA < iM) { // A(i,j) exists but not M(i,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_08s_template.c b/GraphBLAS/Source/assign/template/GB_subassign_08s_template.c index 184909b87e..c9ebff08d2 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_08s_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_08s_template.c @@ -2,7 +2,7 @@ // GB_subassign_08s_template: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -116,7 +116,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) @@ -193,9 +193,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -210,13 +246,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -267,7 +303,7 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) @@ -335,12 +371,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { @@ -351,7 +387,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } } @@ -395,9 +431,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -412,13 +484,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -434,7 +506,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) @@ -451,14 +523,14 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_09_template.c b/GraphBLAS/Source/assign/template/GB_subassign_09_template.c index 79abb6d03e..ee2929ad72 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_09_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_09_template.c @@ -2,7 +2,7 @@ // GB_subassign_09_template: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -105,7 +105,7 @@ { int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iM) ; bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; if (Sfound && !mij) @@ -170,22 +170,58 @@ // get S(:,j) and M(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pA ; + pM_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and M(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and M (:,j) have entries while (pS < pS_end && pM < pM_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iS < iM) { @@ -304,12 +340,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iM = iM_start ; iM < iM_end ; iM++) { int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iM) ; bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; if (!Sfound && mij) @@ -317,7 +353,7 @@ // S (i,j) is not present, M (i,j) is true // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } else if (Sfound) @@ -360,22 +396,58 @@ // get S(:,j) and M(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pA ; + pM_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and M(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and M (:,j) have entries while (pS < pS_end && pM < pM_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iS < iM) { @@ -389,7 +461,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } pM++ ; // go to the next entry in M(:,j) @@ -410,8 +482,8 @@ { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iM = GBI_M (Mi, pM, Mvlen) ; - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } pM++ ; // go to the next entry in M(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_10_template.c b/GraphBLAS/Source/assign/template/GB_subassign_10_template.c index 90080e68e3..0a4ccb4d38 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_10_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_10_template.c @@ -2,7 +2,7 @@ // GB_subassign_10_template: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -109,7 +109,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) @@ -194,9 +194,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -211,13 +247,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -286,7 +322,7 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) @@ -354,12 +390,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { @@ -370,7 +406,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } } @@ -414,9 +450,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -431,13 +503,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -453,7 +525,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) @@ -470,14 +542,14 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_11_template.c b/GraphBLAS/Source/assign/template/GB_subassign_11_template.c index 5fff189e63..8f96bc839c 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_11_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_11_template.c @@ -2,7 +2,7 @@ // GB_subassign_11_template: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -105,7 +105,7 @@ { int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iM) ; bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; if (Sfound && !mij) @@ -170,22 +170,58 @@ // get S(:,j) and M(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pA ; + pM_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and M(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and M (:,j) have entries while (pS < pS_end && pM < pM_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iS < iM) { @@ -304,12 +340,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iM = iM_start ; iM < iM_end ; iM++) { int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iM) ; bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; if (!Sfound && mij) @@ -317,7 +353,7 @@ // S (i,j) is not present, M (i,j) is true // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } else if (Sfound) @@ -360,22 +396,58 @@ // get S(:,j) and M(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + int64_t pM = -1, pM_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pA ; + pM_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kM = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kM >= 0) + { + pM = GBp_M (Mp, kM, Mvlen) ; + pM_end = GBp_M (Mp, kM+1, Mvlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // do a 2-way merge of S(:,j) and M(:,j) //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and M (:,j) have entries while (pS < pS_end && pM < pM_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; if (iS < iM) { @@ -389,7 +461,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } pM++ ; // go to the next entry in M(:,j) @@ -410,8 +482,8 @@ { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iM = GBI_M (Mi, pM, Mvlen) ; - int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + int64_t iM = GBi_M (Mi, pM, Mvlen) ; + int64_t iC = GB_IJLIST (I, iM, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } pM++ ; // go to the next entry in M(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_12_template.c b/GraphBLAS/Source/assign/template/GB_subassign_12_template.c index 0d1d1f29da..aa10db3f13 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_12_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_12_template.c @@ -2,7 +2,7 @@ // GB_subassign_12_template: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -109,7 +109,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (Sfound && !Afound) @@ -197,9 +197,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -214,13 +250,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + // int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -279,7 +315,7 @@ // while list S (:,j) has entries. List A (:,j) exhausted. while (pS < pS_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; if (GB_MASK_COMP) mij = !mij ; if (!mij) @@ -297,7 +333,7 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) @@ -365,12 +401,12 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; for (int64_t iA = iA_start ; iA < iA_end ; iA++) { int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Sfound = (pS < pS_end) && (GBi_S (Si,pS,Svlen) == iA) ; bool Afound = Ab [pA] ; if (!Sfound && Afound) { @@ -381,7 +417,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } } @@ -425,9 +461,45 @@ // get A(:,j) and S(:,j) //-------------------------------------------------------------- - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t j = GBh (Zh, k) ; + +// GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + int64_t pA = -1, pA_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of A(:,k) + pA = TaskList [taskid].pA ; + pA_end = TaskList [taskid].pA_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kA = (Z_to_X == NULL) ? j : Z_to_X [k] ; + if (kA >= 0) + { + pA = GBp_A (Ap, kA, Avlen) ; + pA_end = GBp_A (Ap, kA+1, Avlen) ; + } + } + +// GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + int64_t pS = -1, pS_end = -1 ; + if (fine_task) + { + // A fine task operates on a slice of X(:,k) + pS = TaskList [taskid].pB ; + pS_end = TaskList [taskid].pB_end ; + } + else + { + // vectors are never sliced for a coarse task + int64_t kS = (Z_to_S == NULL) ? j : Z_to_S [k] ; + if (kS >= 0) + { + pS = GBp_S (Sp, kS, Svlen) ; + pS_end = GBp_S (Sp, kS+1, Svlen) ; + } + } //-------------------------------------------------------------- // get M(:,j) @@ -442,13 +514,13 @@ //-------------------------------------------------------------- // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; // while both list S (:,j) and A (:,j) have entries while (pS < pS_end && pA < pA_end) { - int64_t iS = GBI_S (Si, pS, Svlen) ; - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iS = GBi_S (Si, pS, Svlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; if (iS < iA) { @@ -464,7 +536,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) @@ -481,14 +553,14 @@ while (pA < pA_end) { // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iA = GBi_A (Ai, pA, Avlen) ; GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; if (GB_MASK_COMP) mij = !mij ; if (mij) { // ----[. A 1]------------------------------------------ // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_aij ; } pA++ ; // go to the next entry in A(:,j) diff --git a/GraphBLAS/Source/assign/template/GB_subassign_13_template.c b/GraphBLAS/Source/assign/template/GB_subassign_13_template.c index e4350dcbc6..4e130940f7 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_13_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_13_template.c @@ -2,7 +2,7 @@ // GB_subassign_13_template: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; GB_GET_MASK ; GB_GET_MASK_HYPER_HASH ; GB_GET_SCALAR ; @@ -78,7 +74,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -98,8 +94,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -115,7 +111,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -195,7 +191,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -215,8 +211,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -232,7 +228,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -265,7 +261,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_15_template.c b/GraphBLAS/Source/assign/template/GB_subassign_15_template.c index 748c9dc5b3..8d2ceffa5f 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_15_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_15_template.c @@ -2,7 +2,7 @@ // GB_subassign_15_template: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; GB_GET_MASK ; GB_GET_MASK_HYPER_HASH ; GB_GET_S ; @@ -78,7 +74,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -98,8 +94,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -115,7 +111,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -195,7 +191,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -215,8 +211,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -232,7 +228,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -265,7 +261,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_17_template.c b/GraphBLAS/Source/assign/template/GB_subassign_17_template.c index 8a6547b74a..ed60db88c4 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_17_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_17_template.c @@ -2,7 +2,7 @@ // GB_subassign_17_template: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; GB_GET_MASK ; GB_GET_MASK_HYPER_HASH ; GB_GET_SCALAR ; @@ -78,7 +74,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -98,8 +94,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -115,7 +111,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -202,7 +198,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -222,8 +218,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -239,7 +235,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -272,7 +268,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_19_template.c b/GraphBLAS/Source/assign/template/GB_subassign_19_template.c index 0b692b7abe..614f41a393 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_19_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_19_template.c @@ -2,7 +2,7 @@ // GB_subassign_19: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,6 @@ GB_EMPTY_TASKLIST ; GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; GB_GET_MASK ; GB_GET_MASK_HYPER_HASH ; GB_GET_S ; @@ -78,7 +74,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -98,8 +94,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -115,7 +111,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -202,7 +198,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + int64_t jC = GB_IJLIST (J, j, GB_J_KIND, Jcolon) ; //------------------------------------------------------------------ // get S(iA_start:end,j) and M(iA_start:end,j) @@ -222,8 +218,8 @@ // Get the indices at the top of each list. //-------------------------------------------------------------- - int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + int64_t iS = (pS < pS_end) ? GBi_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi, pM, Mvlen) : INT64_MAX ; //-------------------------------------------------------------- // find the smallest index of [iS iA iM] (always iA) @@ -239,7 +235,7 @@ if (i == iM) { // mij = (bool) M [pM] - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; // go to the next entry in M(:,j) } else @@ -272,7 +268,7 @@ { // ----[. A 1]-------------------------------------- // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + int64_t iC = GB_IJLIST (I, iA, GB_I_KIND, Icolon) ; GB_PENDING_INSERT_scalar ; } } diff --git a/GraphBLAS/Source/assign/template/GB_subassign_22_template.c b/GraphBLAS/Source/assign/template/GB_subassign_22_template.c index d5c5b1ebb0..dd9709a5bf 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_22_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_22_template.c @@ -2,7 +2,7 @@ // GB_subassign_22_template: C += y where C is full and y is a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ // determine the number of threads to use //-------------------------------------------------------------------------- - GB_C_NVALS (cnz) ; // int64_t cnz = GB_nnz (C) ; + GB_C_NVALS (cnz) ; const int nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/assign/template/GB_subassign_23_template.c b/GraphBLAS/Source/assign/template/GB_subassign_23_template.c index 5cac9bebdc..03804bcd8c 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_23_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_23_template.c @@ -2,7 +2,7 @@ // GB_subassign_23_template: C += A where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -124,9 +124,9 @@ ASSERT (GB_JUMBLED_OK (A)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int64_t avlen = A->vlen ; const int64_t Cvlen = C->vlen ; bool A_jumbled = A->jumbled ; @@ -155,9 +155,9 @@ // find the part of A(:,k) and C(:,k) for this task //-------------------------------------------------------------- - int64_t j = GBH_A (Ah, k) ; - int64_t pA_start = GBP_A (Ap, k, avlen) ; - int64_t pA_end = GBP_A (Ap, k+1, avlen) ; + int64_t j = GBh_A (Ah, k) ; + int64_t pA_start = GB_IGET (Ap, k) ; + int64_t pA_end = GB_IGET (Ap, k+1) ; GB_GET_PA (my_pA_start, my_pA_end, taskid, k, kfirst, klast, pstart_Aslice, pA_start, pA_end) ; bool ajdense = ((pA_end - pA_start) == Cvlen) ; @@ -197,7 +197,7 @@ GB_PRAGMA_SIMD_VECTORIZE for (int64_t pA = my_pA_start ; pA < my_pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t p = pC + i ; // Cx [p] += (ytype) Ax [pA], with typecasting GB_ACCUMULATE_aij (Cx, p, Ax, pA, GB_A_ISO, ywork, diff --git a/GraphBLAS/Source/assign/template/GB_subassign_25_template.c b/GraphBLAS/Source/assign/template/GB_subassign_25_template.c index 5e7f8cd37c..f1a436ec6b 100644 --- a/GraphBLAS/Source/assign/template/GB_subassign_25_template.c +++ b/GraphBLAS/Source/assign/template/GB_subassign_25_template.c @@ -2,7 +2,7 @@ // GB_subassign_25_template: C = A where C is empty and A is dense //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -58,16 +58,15 @@ // get C, M, and A //-------------------------------------------------------------------------- - int64_t *restrict Ci = C->i ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; ASSERT (GB_JUMBLED_OK (M)) ; - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; const int64_t Mvlen = M->vlen ; - - const int8_t *restrict Ab = A->b ; + const int8_t *restrict Ab = A->b ; const int64_t avlen = A->vlen ; bool C_iso = C->iso ; @@ -126,9 +125,9 @@ // find the part of M(:,k) to be operated on by this task //-------------------------------------------------------------- - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, - pstart_Mslice, Mp [k], Mp [k+1]) ; + pstart_Mslice, GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //-------------------------------------------------------------- // C = A(:,j) @@ -139,7 +138,7 @@ int64_t pA = j * avlen ; for (int64_t pM = pM_start ; pM < pM_end ; pM++) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t p = pA + i ; if (Ab [p]) { @@ -153,7 +152,8 @@ { // C(i,j) becomes a zombie task_nzombies++ ; - Ci [pM] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pM, i) ; // Ci [pM] = i } } } @@ -192,9 +192,9 @@ // find the part of M(:,k) to be operated on by this task //---------------------------------------------------------- - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, - pstart_Mslice, Mp [k], Mp [k+1]) ; + pstart_Mslice, GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; //---------------------------------------------------------- // C = A(:,j) @@ -207,7 +207,7 @@ for (int64_t pM = pM_start ; pM < pM_end ; pM++) { // C(i,j) = A(i,j) - int64_t p = pA + GBI_M (Mi, pM, Mvlen) ; + int64_t p = pA + GB_IGET (Mi, pM) ; GB_COPY_aij_to_C (Cx, pM, Ax, p, GB_A_ISO, cwork, GB_C_ISO) ; } diff --git a/GraphBLAS/Source/binaryop/GB_binop.h b/GraphBLAS/Source/binaryop/GB_binop.h index 0d00fc2a71..af491648a4 100644 --- a/GraphBLAS/Source/binaryop/GB_binop.h +++ b/GraphBLAS/Source/binaryop/GB_binop.h @@ -2,7 +2,7 @@ // GB_binop.h: definitions for binary operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,8 @@ #ifndef GB_BINOP_H #define GB_BINOP_H +#include "GB.h" + bool GB_binop_builtin // true if binary operator is builtin ( // inputs: @@ -58,7 +60,7 @@ GrB_Info GB_binop_new GrB_Monoid GB_binop_to_monoid // return the corresponding monoid, or NULL ( - const GrB_BinaryOp op_in // binary op to convert + GrB_BinaryOp op // binary op to convert ) ; void GB_binop_rename // rename a bound binary op diff --git a/GraphBLAS/Source/binaryop/GB_binop_builtin.c b/GraphBLAS/Source/binaryop/GB_binop_builtin.c index cce03bbb6d..65d1c61826 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_builtin.c +++ b/GraphBLAS/Source/binaryop/GB_binop_builtin.c @@ -2,24 +2,17 @@ // GB_binop_builtin: determine if a binary operator is built-in //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Determine if the binary operator is built-in, for the multiplicative binary -// operator for A*B, or the binary operator for ewise operations (A+B, A.*B, -// and some uses of accum in GrB_assign) - -// If so, determine the opcodes and type codes of the semiring. - -// This function is not used by the CUDA jitified kernels, since they can -// typecast the entries in the matrices A and B to the types of x and y of the -// operator, as needed. +// Determine if the binary operator is built-in and matches the types of its +// inputs. Returns the opcodes and type codes of the op. If this method +// returns true, the operator is a candidate for a switch factory. #include "GB.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" bool GB_binop_builtin // true if binary operator is builtin ( @@ -56,7 +49,8 @@ bool GB_binop_builtin // true if binary operator is builtin return (false) ; } - ASSERT (GB_IS_BINARYOP_CODE (*opcode)) ; + ASSERT (GB_IS_BINARYOP_CODE (*opcode) || + GB_IS_INDEXBINARYOP_CODE (*opcode)) ; if (*opcode == GB_USER_binop_code || *opcode == GB_USER_idxbinop_code) { // the binary operator is user-defined @@ -99,16 +93,6 @@ bool GB_binop_builtin // true if binary operator is builtin if ((*xcode) == GB_BOOL_code) { // z = op(x,y) where both x and y are boolean. - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE and POW become GE - // ISLE becomes LE (*opcode) = GB_boolean_rename (*opcode) ; } diff --git a/GraphBLAS/Source/binaryop/GB_binop_new.c b/GraphBLAS/Source/binaryop/GB_binop_new.c index d970ac9b7f..d5995f4470 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_new.c +++ b/GraphBLAS/Source/binaryop/GB_binop_new.c @@ -2,7 +2,7 @@ // GB_binop_new: create a new operator (user-defined or internal) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -53,6 +53,10 @@ GrB_Info GB_binop_new op->unop_function = NULL ; op->idxunop_function = NULL ; op->binop_function = function ; // NULL for GB_reduce_to_vector + op->idxbinop_function = NULL ; + op->theta_type = NULL ; + op->theta = NULL ; + op->theta_size = 0 ; op->opcode = opcode ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/binaryop/GB_binop_pattern.c b/GraphBLAS/Source/binaryop/GB_binop_pattern.c index 948ec18524..6d331d0371 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_pattern.c +++ b/GraphBLAS/Source/binaryop/GB_binop_pattern.c @@ -2,7 +2,7 @@ // GB_binop_pattern: determine if values of A and B will be used by C=op(A,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GB_binop_rename.c b/GraphBLAS/Source/binaryop/GB_binop_rename.c index ffbc5e2702..f953b63a0a 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_rename.c +++ b/GraphBLAS/Source/binaryop/GB_binop_rename.c @@ -2,7 +2,7 @@ // GB_binop_rename: rename a bound binary operator to its unary op equivalent //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,7 +44,6 @@ void GB_binop_rename // rename a bound binary op or an idxunop if (xcode == GB_BOOL_code) { - // for boolean: DIV becomes FIRST, RDIV becomes SECOND opcode = GB_boolean_rename (opcode) ; } diff --git a/GraphBLAS/Source/binaryop/GB_binop_second.c b/GraphBLAS/Source/binaryop/GB_binop_second.c index a03bf1619a..48ebf8e1d0 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_second.c +++ b/GraphBLAS/Source/binaryop/GB_binop_second.c @@ -2,14 +2,13 @@ // GB_binop_second: return a SECOND binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" GrB_BinaryOp GB_binop_second // return SECOND operator, or NULL on error ( @@ -46,17 +45,30 @@ GrB_BinaryOp GB_binop_second // return SECOND operator, or NULL on error // be used at all anyway). This binary op will not be treated as a // builtin operator, however, since its data type is not builtin. // Its hash, op->hash, will be nonzero. The name of SECOND_UDT is - // the same as the name of the type. + // the same as the name of the type. This is a sufficiently unique + // name for the JIT, because the opcode differs from any user- + // defined op, and no other mechanism exists for creating a + // SECOND_UDT opertor except for this method. if (op == NULL) return (NULL) ; // op = &op_header has been provided by the caller op->header_size = 0 ; - GrB_Info info = GB_binop_new (op, - NULL, // op->binop_function is NULL for SECOND_UDT + #ifdef GB_DEBUG + GrB_Info info = + #endif + GB_binop_new (op, NULL, // op->binop_function NULL for 2nd type, type, type, // type is user-defined type->name, // same name as type NULL, // no op->defn for the SECOND_UDT operator GB_SECOND_binop_code) ; // using a built-in opcode ASSERT (info == GrB_SUCCESS) ; + if (GB_Global_burble_get ( )) + { + #ifdef GB_DEBUG + info = + #endif + GB_BinaryOp_check (op, "2nd_UDT", GxB_COMPLETE, NULL) ; + ASSERT (info == GrB_SUCCESS) ; + } ASSERT_BINARYOP_OK (op, "2nd_UDT", GB0) ; return (op) ; } diff --git a/GraphBLAS/Source/binaryop/GB_binop_to_monoid.c b/GraphBLAS/Source/binaryop/GB_binop_to_monoid.c index aeca0225f8..4ec2e43094 100644 --- a/GraphBLAS/Source/binaryop/GB_binop_to_monoid.c +++ b/GraphBLAS/Source/binaryop/GB_binop_to_monoid.c @@ -2,7 +2,7 @@ // GB_binop_to_monoid: convert a binary op into its corresponding monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ GrB_Monoid GB_binop_to_monoid // return the corresponding monoid, or NULL ( - const GrB_BinaryOp op_in // binary op to convert + GrB_BinaryOp op // binary op to convert ) { @@ -20,14 +20,13 @@ GrB_Monoid GB_binop_to_monoid // return the corresponding monoid, or NULL // check inputs //-------------------------------------------------------------------------- - ASSERT (op_in != NULL) ; + ASSERT_BINARYOP_OK (op, "binary op to convert to monoid", GB0) ; //-------------------------------------------------------------------------- - // convert the binary op_in to its corresponding monoid + // convert the binary op to its corresponding monoid //-------------------------------------------------------------------------- - ASSERT_BINARYOP_OK (op_in, "binary op to convert to monoid", GB0) ; - GrB_BinaryOp op = GB_boolean_rename_op (op_in) ; + op = GB_boolean_rename_op (op) ; GB_Type_code zcode = op->ztype->code ; GB_Opcode opcode = op->opcode ; @@ -200,7 +199,7 @@ GrB_Monoid GB_binop_to_monoid // return the corresponding monoid, or NULL } //-------------------------------------------------------------------------- - // op_in binary operator does not correspond to a known monoid + // op binary operator does not correspond to a known monoid //-------------------------------------------------------------------------- return (NULL) ; diff --git a/GraphBLAS/Source/binaryop/GB_boolean_rename.c b/GraphBLAS/Source/binaryop/GB_boolean_rename.c index d0a5651b7f..ea573a21c2 100644 --- a/GraphBLAS/Source/binaryop/GB_boolean_rename.c +++ b/GraphBLAS/Source/binaryop/GB_boolean_rename.c @@ -2,7 +2,7 @@ // GB_boolean_rename: rename a boolean opcode //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GB_boolean_rename_op.c b/GraphBLAS/Source/binaryop/GB_boolean_rename_op.c index ff3b336def..c3eca65f64 100644 --- a/GraphBLAS/Source/binaryop/GB_boolean_rename_op.c +++ b/GraphBLAS/Source/binaryop/GB_boolean_rename_op.c @@ -2,7 +2,7 @@ // GB_boolean_rename_op: rename a boolean operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GB_flip_binop.c b/GraphBLAS/Source/binaryop/GB_flip_binop.c index a6730e1a6e..eed35a9762 100644 --- a/GraphBLAS/Source/binaryop/GB_flip_binop.c +++ b/GraphBLAS/Source/binaryop/GB_flip_binop.c @@ -2,7 +2,7 @@ // GB_flip_binop: flip a binary operator for GrB_mxm //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GrB_BinaryOp_free.c b/GraphBLAS/Source/binaryop/GrB_BinaryOp_free.c index b6c6ba1491..0e2a5e0636 100644 --- a/GraphBLAS/Source/binaryop/GrB_BinaryOp_free.c +++ b/GraphBLAS/Source/binaryop/GrB_BinaryOp_free.c @@ -2,7 +2,7 @@ // GrB_BinaryOp_free: free a binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GrB_BinaryOp_new.c b/GraphBLAS/Source/binaryop/GrB_BinaryOp_new.c index ca659a44ad..ecb7f4166c 100644 --- a/GraphBLAS/Source/binaryop/GrB_BinaryOp_new.c +++ b/GraphBLAS/Source/binaryop/GrB_BinaryOp_new.c @@ -2,7 +2,7 @@ // GrB_BinaryOp_new: create a new user-defined binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_new.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_new.c index 8e71f0dda3..c2c08f2b5d 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_new.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_new.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_new: create a new user-defined binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,8 +33,7 @@ GrB_Info GxB_BinaryOp_new // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_new (op, function, ztype, xtype, ytype" - ", name, defn)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (op_handle) ; (*op_handle) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (ztype) ; @@ -46,7 +45,8 @@ GrB_Info GxB_BinaryOp_new //-------------------------------------------------------------------------- size_t header_size ; - GrB_BinaryOp op = GB_CALLOC (1, struct GB_BinaryOp_opaque, &header_size) ; + GrB_BinaryOp op = GB_CALLOC_MEMORY (1, sizeof (struct GB_BinaryOp_opaque), + &header_size) ; if (op == NULL) { // out of memory @@ -63,7 +63,7 @@ GrB_Info GxB_BinaryOp_new if (info != GrB_SUCCESS) { // out of memory - GB_FREE (&op, header_size) ; + GB_FREE_MEMORY (&op, header_size) ; return (info) ; } @@ -85,6 +85,7 @@ GrB_Info GxB_BinaryOp_new // and cannot be compiled by the JIT). return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } + #include "include/GB_pedantic_disable.h" op->binop_function = (GxB_binary_function) user_function ; GB_BURBLE_END ; } diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype.c index a4524e93f4..ea6a61ae23 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_xtype: return the type of x for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_BinaryOp_xtype // type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_xtype (&xtype, binaryop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (xtype) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for xtype", GB0) ; diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype_name.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype_name.c index d44994a0c9..87a38dbbf0 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype_name.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_xtype_name.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_xtype_name: return the type_name of x for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_BinaryOp_xtype_name // return the name of the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_xtype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for xtype_name", GB0) ; diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype.c index 8c1b63f56a..b07e72cc29 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_ytype: return the type of y for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_BinaryOp_ytype // type of y // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_ytype (&ytype, binaryop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (ytype) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for ytype", GB0) ; diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype_name.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype_name.c index b9e31e2e3c..39c2008e5e 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype_name.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ytype_name.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_ytype_name: return the type_name of y for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_BinaryOp_ytype_name // return the name of the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_ytype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for ytype_name", GB0) ; diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype.c index 182e128783..b9f16ec26a 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_ztype: return the type of z for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_BinaryOp_ztype // return the type of z // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_ztype (&ztype, binaryop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (ztype) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for ztype", GB0) ; diff --git a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype_name.c b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype_name.c index 8d95571e75..2037566e8f 100644 --- a/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype_name.c +++ b/GraphBLAS/Source/binaryop/GxB_BinaryOp_ztype_name.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_ztype_name: return the type_name of y for z=f(x,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_BinaryOp_ztype_name // return the name of the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_ztype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (binaryop) ; ASSERT_BINARYOP_OK (binaryop, "binaryop for ztype_name", GB0) ; diff --git a/GraphBLAS/Source/binaryop/factory/GB_binop_factory.c b/GraphBLAS/Source/binaryop/factory/GB_binop_factory.c index d0d861a000..a792347380 100644 --- a/GraphBLAS/Source/binaryop/factory/GB_binop_factory.c +++ b/GraphBLAS/Source/binaryop/factory/GB_binop_factory.c @@ -2,7 +2,7 @@ // GB_binop_factory.c: switch factory for built-in methods for C=binop(A,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -369,65 +369,6 @@ break ; #endif -#if 0 - - //---------------------------------------------------------------------- - // IS* operators fully disabled - //---------------------------------------------------------------------- - - //---------------------------------------------------------------------- - case GB_ISEQ_binop_code: // z = (x == y) - //---------------------------------------------------------------------- - - // ISEQ == EQ for boolean - switch (xcode) - { - GB_CASE_INT8 (_iseq) - GB_CASE_INT16 (_iseq) - GB_CASE_INT32 (_iseq) - GB_CASE_INT64 (_iseq) - GB_CASE_UINT8 (_iseq) - GB_CASE_UINT16 (_iseq) - GB_CASE_UINT32 (_iseq) - GB_CASE_UINT64 (_iseq) - GB_CASE_FP32 (_iseq) - GB_CASE_FP64 (_iseq) - #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER - // ISEQ does not appear in a builtin complex semiring - GB_CASE_FC32 (_iseq) - GB_CASE_FC64 (_iseq) - #endif - default: ; - } - break ; - - //---------------------------------------------------------------------- - case GB_ISNE_binop_code: // z = (x != y) - //---------------------------------------------------------------------- - - // MINUS == RMINUS == NE == ISNE == XOR for boolean - switch (xcode) - { - GB_CASE_INT8 (_isne) - GB_CASE_INT16 (_isne) - GB_CASE_INT32 (_isne) - GB_CASE_INT64 (_isne) - GB_CASE_UINT8 (_isne) - GB_CASE_UINT16 (_isne) - GB_CASE_UINT32 (_isne) - GB_CASE_UINT64 (_isne) - GB_CASE_FP32 (_isne) - GB_CASE_FP64 (_isne) - #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER - // ISNE does not appear in a builtin complex semiring - GB_CASE_FC32 (_isne) - GB_CASE_FC64 (_isne) - #endif - default: ; - } - break ; -#endif - //---------------------------------------------------------------------- case GB_EQ_binop_code : // z = (x == y) //---------------------------------------------------------------------- @@ -556,97 +497,6 @@ } break ; -#endif - -#if 0 - //---------------------------------------------------------------------- - // IS* operators fully disabled - //---------------------------------------------------------------------- - - //---------------------------------------------------------------------- - case GB_ISGT_binop_code: // z = (x > y) - //---------------------------------------------------------------------- - - // ISGT == GT for boolean. no complex case - switch (xcode) - { - GB_CASE_INT8 (_isgt) - GB_CASE_INT16 (_isgt) - GB_CASE_INT32 (_isgt) - GB_CASE_INT64 (_isgt) - GB_CASE_UINT8 (_isgt) - GB_CASE_UINT16 (_isgt) - GB_CASE_UINT32 (_isgt) - GB_CASE_UINT64 (_isgt) - GB_CASE_FP32 (_isgt) - GB_CASE_FP64 (_isgt) - default: ; - } - break ; - - //---------------------------------------------------------------------- - case GB_ISLT_binop_code: // z = (x < y) - //---------------------------------------------------------------------- - - // ISLT == LT for boolean. no complex case - switch (xcode) - { - GB_CASE_INT8 (_islt) - GB_CASE_INT16 (_islt) - GB_CASE_INT32 (_islt) - GB_CASE_INT64 (_islt) - GB_CASE_UINT8 (_islt) - GB_CASE_UINT16 (_islt) - GB_CASE_UINT32 (_islt) - GB_CASE_UINT64 (_islt) - GB_CASE_FP32 (_islt) - GB_CASE_FP64 (_islt) - default: ; - } - break ; - - //---------------------------------------------------------------------- - case GB_ISGE_binop_code: // z = (x >= y) - //---------------------------------------------------------------------- - - // POW == ISGE == GE for boolean. no complex case. - switch (xcode) - { - GB_CASE_INT8 (_isge) - GB_CASE_INT16 (_isge) - GB_CASE_INT32 (_isge) - GB_CASE_INT64 (_isge) - GB_CASE_UINT8 (_isge) - GB_CASE_UINT16 (_isge) - GB_CASE_UINT32 (_isge) - GB_CASE_UINT64 (_isge) - GB_CASE_FP32 (_isge) - GB_CASE_FP64 (_isge) - default: ; - } - break ; - - //---------------------------------------------------------------------- - case GB_ISLE_binop_code: // z = (x <= y) - //---------------------------------------------------------------------- - - // ISLE == LE for boolean. no complex case - switch (xcode) - { - GB_CASE_INT8 (_isle) - GB_CASE_INT16 (_isle) - GB_CASE_INT32 (_isle) - GB_CASE_INT64 (_isle) - GB_CASE_UINT8 (_isle) - GB_CASE_UINT16 (_isle) - GB_CASE_UINT32 (_isle) - GB_CASE_UINT64 (_isle) - GB_CASE_FP32 (_isle) - GB_CASE_FP64 (_isle) - default: ; - } - break ; - #endif //---------------------------------------------------------------------- diff --git a/GraphBLAS/Source/builder/GB_build.c b/GraphBLAS/Source/builder/GB_build.c index 02301e4d0e..09dfa7516c 100644 --- a/GraphBLAS/Source/builder/GB_build.c +++ b/GraphBLAS/Source/builder/GB_build.c @@ -2,7 +2,7 @@ // GB_build: build a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -102,14 +102,16 @@ GrB_Info GB_build // build matrix ( GrB_Matrix C, // matrix to build - const GrB_Index *I, // row indices of tuples - const GrB_Index *J, // col indices of tuples (NULL for vector) + const void *I, // row indices of tuples + const void *J, // col indices of tuples (NULL for vector) const void *X, // values, size 1 if iso - const GrB_Index nvals, // number of tuples + const uint64_t nvals, // number of tuples const GrB_BinaryOp dup, // binary op to assemble duplicates (or NULL) const GrB_Type xtype, // type of X array const bool is_matrix, // true if C is a matrix, false if GrB_Vector const bool X_iso, // if true the C is iso and X has size 1 entry + bool I_is_32, // if true, I is 32-bit; else 64-bit + bool J_is_32, // if true, J is 32-bit; else 64-bit GB_Werk Werk ) { @@ -120,7 +122,10 @@ GrB_Info GB_build // build matrix // check C GrB_Info info ; + struct GB_Matrix_opaque T_header ; + GrB_Matrix T = NULL ; ASSERT (C != NULL) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; if (GB_nnz (C) > 0 || GB_PENDING (C)) { // The matrix has existing entries. This is required by the GraphBLAS @@ -168,7 +173,7 @@ GrB_Info GB_build // build matrix { // problem too large GB_ERROR (GrB_INVALID_VALUE, "Problem too large: nvals " GBu - " exceeds " GBu, nvals, GB_NMAX) ; + " exceeds " GBu, nvals, (uint64_t) GB_NMAX) ; } //-------------------------------------------------------------------------- @@ -252,20 +257,25 @@ GrB_Info GB_build // build matrix // build the matrix T //-------------------------------------------------------------------------- + // Determine the Tp_is_32, Tj_is_32, and Ti_is_32 settings for the new + // matrix, assuming that nvals is not reduced by a massive # of duplicates. + bool Tp_is_32, Tj_is_32, Ti_is_32 ; + GB_determine_pji_is_32 (&Tp_is_32, &Tj_is_32, &Ti_is_32, + GxB_HYPERSPARSE, nvals, C->vlen, C->vdim, Werk) ; + // T is always built as hypersparse. Its type is the same as the z output // of the z=dup(x,y) operator if dup is present, or xtype if dup is NULL. // If C->type differs from T->type, it is typecasted by // GB_transplant_conform. - // X must be treated as read-only, so GB_builder is not allowed to - // transplant it into T->x. + // I, J, and X must be treated as readonly, so GB_builder is not allowed + // to transplant them into T->x. - int64_t *no_I_work = NULL ; size_t I_work_size = 0 ; - int64_t *no_J_work = NULL ; size_t J_work_size = 0 ; + void *no_I_work = NULL ; size_t I_work_size = 0 ; + void *no_J_work = NULL ; size_t J_work_size = 0 ; GB_void *no_X_work = NULL ; size_t X_work_size = 0 ; - struct GB_Matrix_opaque T_header ; - GrB_Matrix T = NULL ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; GrB_Type ttype = (discard_duplicates) ? xtype : dup->ztype ; GB_OK (GB_builder ( @@ -284,15 +294,18 @@ GrB_Info GB_build // build matrix false, // known_no_duplicates: not yet known 0, // I_work, J_work, and X_work not used here is_matrix, // true if T is a GrB_Matrix - (int64_t *) ((C->is_csc) ? I : J), // size nvals - (int64_t *) ((C->is_csc) ? J : I), // size nvals, or NULL for vector + C->is_csc ? I : J, // size nvals + C->is_csc ? J : I, // size nvals, or NULL for vector (const GB_void *) X, // values, size nvals or 1 if iso X_iso, // true if X is iso nvals, // number of tuples dup2, // operator to assemble duplicates (may be NULL) xtype, // type of the X array true, // burble is OK - Werk + Werk, + I_is_32, // if true, I is 32-bit; else 64-bit + J_is_32, // if true, J is 32-bit; else 64-bit + Tp_is_32, Tj_is_32, Ti_is_32 // integer sizes to create T )) ; //-------------------------------------------------------------------------- @@ -331,7 +344,7 @@ GrB_Info GB_build // build matrix // All entries in T are the same; convert T to iso GBURBLE ("(post iso) ") ; T->iso = true ; - GB_OK (GB_convert_any_to_iso (T, NULL)) ; + GB_OK (GB_convert_any_to_iso (T, NULL)) ; // OK } //-------------------------------------------------------------------------- @@ -342,6 +355,7 @@ GrB_Info GB_build // build matrix ASSERT (!GB_ZOMBIES (T)) ; ASSERT (!GB_JUMBLED (T)) ; ASSERT (!GB_PENDING (T)) ; - return (GB_transplant_conform (C, C->type, &T, Werk)) ; + GB_OK (GB_transplant_conform (C, C->type, &T, Werk)) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/builder/GB_build.h b/GraphBLAS/Source/builder/GB_build.h index e5e1be2f21..51165b9f84 100644 --- a/GraphBLAS/Source/builder/GB_build.h +++ b/GraphBLAS/Source/builder/GB_build.h @@ -2,7 +2,7 @@ // GB_build.h: definitions for GB_build //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,14 +14,16 @@ GrB_Info GB_build // build matrix ( GrB_Matrix C, // matrix to build - const GrB_Index *I, // row indices of tuples - const GrB_Index *J, // col indices of tuples (NULL for vector) + const void *I, // row indices of tuples + const void *J, // col indices of tuples (NULL for vector) const void *X, // values, size 1 if iso - const GrB_Index nvals, // number of tuples - const GrB_BinaryOp dup, // binary op to assemble duplicates + const uint64_t nvals, // number of tuples + const GrB_BinaryOp dup, // binary op to assemble duplicates (or NULL) const GrB_Type xtype, // type of X array const bool is_matrix, // true if C is a matrix, false if GrB_Vector const bool X_iso, // if true the C is iso and X has size 1 entry + bool I_is_32, // if true, I is 32-bit; else 64-bit + bool J_is_32, // if true, J is 32-bit; else 64-bit GB_Werk Werk ) ; @@ -32,9 +34,9 @@ GrB_Info GB_builder // build a matrix from tuples const int64_t vlen, // length of each vector of T const int64_t vdim, // number of vectors in T const bool is_csc, // true if T is CSC, false if CSR - int64_t **I_work_handle, // for (i,k) or (j,i,k) tuples + void **I_work_handle, // for (i,k) or (j,i,k) tuples size_t *I_work_size_handle, - int64_t **J_work_handle, // for (j,i,k) tuples + void **J_work_handle, // for (j,i,k) tuples size_t *J_work_size_handle, GB_void **S_work_handle, // array of values of tuples, size ijslen, // or size 1 if S is iso @@ -43,8 +45,8 @@ GrB_Info GB_builder // build a matrix from tuples bool known_no_duplicates, // true if tuples known to not have dupl int64_t ijslen, // size of I_work and J_work arrays const bool is_matrix, // true if T a GrB_Matrix, false if vector - const int64_t *restrict I_input,// original indices, size nvals - const int64_t *restrict J_input,// original indices, size nvals + const void *restrict I_input, // original indices, size nvals + const void *restrict J_input, // original indices, size nvals const GB_void *restrict S_input,// array of values of tuples, size nvals, // or size 1 if S_input or S_work are iso const bool S_iso, // true if S_input or S_work are iso @@ -54,7 +56,13 @@ GrB_Info GB_builder // build a matrix from tuples // keep the most recent duplicate. const GrB_Type stype, // the type of S_work or S_input bool do_burble, // if true, then burble is allowed - GB_Werk Werk + GB_Werk Werk, + bool I_is_32, // true if I (I_work or I_input) is 32 bit, false if 64 + bool J_is_32, // true if J (J_work or J_input) is 32 bit, false if 64 + bool Tp_is_32, // true if T->p is built as 32 bit, false if 64 + bool Tj_is_32, // true if T->h is built as 32 bit, false if 64 + bool Ti_is_32 // true if T->i is built as 32 bit, false if 64 ) ; #endif + diff --git a/GraphBLAS/Source/builder/GB_builder.c b/GraphBLAS/Source/builder/GB_builder.c index 50c1d0b67a..f01a4142c4 100644 --- a/GraphBLAS/Source/builder/GB_builder.c +++ b/GraphBLAS/Source/builder/GB_builder.c @@ -2,7 +2,7 @@ // GB_builder: build a matrix from tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -103,6 +103,8 @@ // This method always returns T as hypersparse, and T is iso if and only if Sx // is iso. +// FUTURE: add a descriptor that allows input I,J to be 1-based + #include "builder/GB_build.h" #include "sort/GB_sort.h" #include "binaryop/GB_binop.h" @@ -112,19 +114,21 @@ #include "FactoryKernels/GB_bld__include.h" #endif -#define GB_I_WORK(t) (((t) < 0) ? -1 : I_work [t]) -#define GB_J_WORK(t) (((t) < 0) ? -1 : ((J_work == NULL) ? 0 : J_work [t])) -#define GB_K_WORK(t) (((t) < 0) ? -1 : ((K_work == NULL) ? t : K_work [t])) +#define GB_I_WORK(t) (((t) < 0) ? -1 : GB_IGET (I_work, t)) +#define GB_J_WORK(t) (((t) < 0) ? -1 : (J_work ? GB_IGET (J_work, t) : 0 )) +#define GB_K_WORK(t) (((t) < 0) ? -1 : (K_work ? GB_IGET (K_work, t) : (t) )) #define GB_FREE_WORKSPACE \ { \ GB_WERK_POP (Work, int64_t) ; \ - GB_FREE (I_work_handle, *I_work_size_handle) ; \ - GB_FREE (J_work_handle, *J_work_size_handle) ; \ - GB_FREE (S_work_handle, *S_work_size_handle) ; \ - GB_FREE_WORK (&K_work, K_work_size) ; \ + GB_FREE_MEMORY (I_work_handle, *I_work_size_handle) ; \ + GB_FREE_MEMORY (J_work_handle, *J_work_size_handle) ; \ + GB_FREE_MEMORY (S_work_handle, *S_work_size_handle) ; \ + GB_FREE_MEMORY (&K_work, K_work_size) ; \ } +#define GB_FREE_ALL GB_FREE_WORKSPACE + //------------------------------------------------------------------------------ // GB_builder //------------------------------------------------------------------------------ @@ -136,9 +140,9 @@ GrB_Info GB_builder // build a matrix from tuples const int64_t vlen, // length of each vector of T const int64_t vdim, // number of vectors in T const bool is_csc, // true if T is CSC, false if CSR - int64_t **I_work_handle, // for (i,k) or (j,i,k) tuples + void **I_work_handle, // for (i,k) or (j,i,k) tuples size_t *I_work_size_handle, - int64_t **J_work_handle, // for (j,i,k) tuples + void **J_work_handle, // for (j,i,k) tuples size_t *J_work_size_handle, GB_void **S_work_handle, // array of values of tuples, size ijslen, // or size 1 if S is iso @@ -147,8 +151,8 @@ GrB_Info GB_builder // build a matrix from tuples bool known_no_duplicates, // true if tuples known to not have dupl int64_t ijslen, // size of I_work and J_work arrays const bool is_matrix, // true if T a GrB_Matrix, false if vector - const int64_t *restrict I_input,// original indices, size nvals - const int64_t *restrict J_input,// original indices, size nvals + const void *restrict I_input, // original indices, size nvals + const void *restrict J_input, // original indices, size nvals const GB_void *restrict S_input,// array of values of tuples, size nvals, // or size 1 if S_input or S_work are iso const bool S_iso, // true if S_input or S_work are iso @@ -158,7 +162,12 @@ GrB_Info GB_builder // build a matrix from tuples // keep the most recent duplicate. const GrB_Type stype, // the type of S_work or S_input bool do_burble, // if true, then burble is allowed - GB_Werk Werk + GB_Werk Werk, + bool I_is_32, // true if I (I_work or I_input) is 32 bit, false if 64 + bool J_is_32, // true if J (J_work or J_input) is 32 bit, false if 64 + bool Tp_is_32, // true if T->p is built as 32 bit, false if 64 + bool Tj_is_32, // true if T->h is built as 32 bit, false if 64 + bool Ti_is_32 // true if T->i is built as 32 bit, false if 64 ) { @@ -166,6 +175,7 @@ GrB_Info GB_builder // build a matrix from tuples // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; ASSERT (T != NULL) ; // T is a static or dynamic header on input ASSERT (nvals >= 0) ; ASSERT_TYPE_OK (ttype, "ttype for builder", GB0) ; @@ -204,10 +214,25 @@ GrB_Info GB_builder // build a matrix from tuples // J_work may already be NULL on input, if T has one or zero vectors // (J_work_handle is always non-NULL however). - GrB_Info info ; - int64_t *restrict I_work = (*I_work_handle) ; - int64_t *restrict J_work = (*J_work_handle) ; - int64_t *restrict K_work = NULL ; size_t K_work_size = 0 ; + void *restrict I_work = (*I_work_handle) ; + void *restrict J_work = (*J_work_handle) ; + + GB_IDECL (I_work, , u) ; GB_IPTR (I_work , I_is_32) ; + GB_IDECL (I_input, const, u) ; GB_IPTR (I_input, I_is_32) ; + GB_IDECL (J_work, , u) ; GB_IPTR (J_work , J_is_32) ; + GB_IDECL (J_input, const, u) ; GB_IPTR (J_input, J_is_32) ; + + // K_is_32 does not use GB_determine_i_is_32 since it is not transplanted + // into the output matrix T. + bool K_is_32 = (nvals < UINT32_MAX) ; + GB_MDECL (K_work, , u) ; size_t K_work_size = 0 ; + + Tj_is_32 = GB_determine_j_is_32 (Tj_is_32, vdim) ; // OK + Ti_is_32 = GB_determine_i_is_32 (Ti_is_32, vlen) ; // OK + + // duplicate indices are flagged using an out-of-range index, after + // any out-of-range indices on input have been checked. + int64_t duplicate_entry = vlen ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -290,12 +315,49 @@ GrB_Info GB_builder // build a matrix from tuples // tuples: I_input [k] and Sx [k] when vdim <= 1, and also J_input [k] // for matrices with vdim > 1. - // The workspace I_work and J_work are allocated here but freed (or - // transplanted) inside GB_builder. K_work is allocated, used, and - // freed in GB_builder. + // The workspace I_work is allocated here but freed (or transplanted) + // inside GB_builder. J_work and K_work are allocated, used, and freed + // in GB_builder. ASSERT (J_work == NULL) ; - I_work = GB_MALLOC (nvals, int64_t, I_work_size_handle) ; + + // Revise I_is_32 for I_work. This has no effect on I_input32 and + // I_input64 since they are already assigned with the original value of + // I_is_32. There are four options for choosing I_is_32. + + // (1) This option uses GB_determine_i_is_32 since I_work can be + // transplanted into T->i. If 32-bit integers are used when + // max(vlen,vdim) is > GB_NMAX32, then I_work must be cast to T->i when + // transplanted later. This option avoids the cast. However, the sort + // (if needed) would be a bit slower, and the transplant can only + // happen if there are no duplicates. If there are duplicates, T->i is + // computed out-of-place from I_work, so there is no cast. + // I_is_32 = GB_determine_i_is_32 (true, vlen) ; // OK + + // (2) This option allows the widest use of 32-bit indices for I_work, + // which speeds up the sort when max(vlen,vdim) > GB_NMAX32. However, + // the sort may be skipped, and if there are no duplicates, I_work is + // transplanted into T->i. In that case, this is slightly slower than + // option (1), but it does use the least amount of memory of all 4 + // options when duplicates appear. + // I_is_32 = vlen < UINT32_MAX ; + + // (3) This option ensures I_work can be transplanted into T->i with no + // cast when no duplicates appear. The caller can request 64-bit + // indices for T->i (with Ti_is_32 = false on input) even for small + // matrices. However, this option makes the sort (if needed) slower. + // It uses the least amount of memory when no duplicates appear, since + // I_work can then always be transplanted into T->i with no extra time + // and memory. + I_is_32 = Ti_is_32 ; + + // (4) Do nothing, letting I_is_32 be determined by the integer size + // of the I_input array. + + I_work = GB_MALLOC_MEMORY (nvals, + I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t), + I_work_size_handle) ; + (*I_work_handle) = I_work ; ijslen = nvals ; if (I_work == NULL) @@ -305,6 +367,8 @@ GrB_Info GB_builder // build a matrix from tuples return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (I_work, I_is_32) ; + //---------------------------------------------------------------------- // create the tuples to sort, and check for any invalid indices //---------------------------------------------------------------------- @@ -335,19 +399,20 @@ GrB_Info GB_builder // build a matrix from tuples reduction(&&:known_sorted) reduction(&&:no_duplicates_found) for (tid = 0 ; tid < nthreads ; tid++) { - kbad [tid] = -1 ; int64_t my_tnvec = 0 ; - int64_t kstart = tstart_slice [tid] ; - int64_t kend = tstart_slice [tid+1] ; - int64_t ilast = (kstart == 0) ? -1 : I_input [kstart-1] ; - int64_t jlast = (kstart == 0) ? -1 : J_input [kstart-1] ; + int64_t kstart = tstart_slice [tid] ; + int64_t kend = tstart_slice [tid+1] ; + int64_t ilast = (kstart == 0) ? (-1) : + GB_IGET (I_input, kstart-1) ; + int64_t jlast = (kstart == 0) ? (-1) : + GB_IGET (J_input, kstart-1) ; for (int64_t k = kstart ; k < kend ; k++) { // get k-th index from user input: (i,j) - int64_t i = I_input [k] ; - int64_t j = J_input [k] ; + int64_t i = GB_IGET (I_input, k) ; + int64_t j = GB_IGET (J_input, k) ; if (i < 0 || i >= vlen || j < 0 || j >= vdim) { @@ -365,7 +430,8 @@ GrB_Info GB_builder // build a matrix from tuples (!(jlast == j && ilast == i)) ; // copy the tuple into I_work. J_work is done later. - I_work [k] = i ; + // Iwork [k] = i + GB_ISET (I_work, k, i) ; if (j > jlast) { @@ -382,7 +448,6 @@ GrB_Info GB_builder // build a matrix from tuples // input, with no duplicates present. tnvec_slice [tid] = my_tnvec ; tnz_slice [tid] = kend - kstart ; - } // collect the report from each thread @@ -391,16 +456,16 @@ GrB_Info GB_builder // build a matrix from tuples if (kbad [tid] >= 0) { // invalid index - int64_t i = I_input [kbad [tid]] ; - int64_t j = J_input [kbad [tid]] ; - int64_t row = is_csc ? i : j ; - int64_t col = is_csc ? j : i ; - int64_t nrows = is_csc ? vlen : vdim ; - int64_t ncols = is_csc ? vdim : vlen ; + uint64_t i = GB_IGET (I_input, kbad [tid]) ; + uint64_t j = GB_IGET (J_input, kbad [tid]) ; + uint64_t row = is_csc ? i : j ; + uint64_t col = is_csc ? j : i ; + uint64_t nrows = is_csc ? vlen : vdim ; + uint64_t ncols = is_csc ? vdim : vlen ; GB_FREE_WORKSPACE ; GB_ERROR (GrB_INDEX_OUT_OF_BOUNDS, - "index (" GBd "," GBd ") out of bounds," - " must be < (" GBd ", " GBd ")", + "index (" GBu "," GBu ") out of bounds," + " must be < (" GBu ", " GBu ")", row, col, nrows, ncols) ; } } @@ -415,9 +480,15 @@ GrB_Info GB_builder // build a matrix from tuples //------------------------------------------------------------------ if (vdim > 1 && !known_sorted) - { - // copy J_input into J_work, so the tuples can be sorted - J_work = GB_MALLOC (nvals, int64_t, J_work_size_handle) ; + { + // copy J_input into J_work, so the tuples can be sorted. + // J_work can be smaller than J_input, so GB_cast_int is used. + // This does not need to use GB_determine_i_is_32, since J_work + // is not transplanted into the output matrix T. + bool J_is_32_new = (vdim < UINT32_MAX) ; + J_work = GB_MALLOC_MEMORY (nvals, + J_is_32_new ? sizeof (uint32_t) : sizeof (uint64_t), + J_work_size_handle) ; (*J_work_handle) = J_work ; if (J_work == NULL) { @@ -425,17 +496,28 @@ GrB_Info GB_builder // build a matrix from tuples GB_FREE_WORKSPACE ; return (GrB_OUT_OF_MEMORY) ; } - GB_memcpy (J_work, J_input, nvals * sizeof (int64_t), nthreads); + // J_work = cast (J_input) + if (do_burble) + { + GBURBLE ("(cast J %d %d) ", J_is_32_new, J_is_32) ; + } + GB_cast_int ( + J_work, J_is_32_new ? GB_UINT32_code : GB_UINT64_code, + J_input, J_is_32 ? GB_UINT32_code : GB_UINT64_code, + nvals, nthreads) ; + J_is_32 = J_is_32_new ; } else { // J_work is a shallow copy of J_input. The pointer is not // copied into (*J_work_handle), so it will not be freed. - // J_input is not modified, even though it is typecast to the - // int64_t *J_work, since J_work is not modified in this case. - J_work = (int64_t *) J_input ; + // J_input is not modified since J_work is not modified in + // this case. J_is_32 is unchanged. + J_work = (void *) J_input ; } + GB_IPTR (J_work, J_is_32) ; + } else { @@ -453,16 +535,15 @@ GrB_Info GB_builder // build a matrix from tuples reduction(&&:known_sorted) reduction(&&:no_duplicates_found) for (tid = 0 ; tid < nthreads ; tid++) { - kbad [tid] = -1 ; - int64_t kstart = tstart_slice [tid] ; - int64_t kend = tstart_slice [tid+1] ; - int64_t ilast = (kstart == 0) ? -1 : I_input [kstart-1] ; + int64_t kstart = tstart_slice [tid] ; + int64_t kend = tstart_slice [tid+1] ; + int64_t ilast = GB_I_WORK (kstart - 1) ; for (int64_t k = kstart ; k < kend ; k++) { // get k-th index from user input: (i) - int64_t i = I_input [k] ; + int64_t i = GB_IGET (I_input, k) ; if (i < 0 || i >= vlen) { @@ -479,7 +560,8 @@ GrB_Info GB_builder // build a matrix from tuples (!(ilast == i)) ; // copy the tuple into the work arrays to be sorted - I_work [k] = i ; + // I_work [k] = i ; + GB_ISET (I_work, k, i) ; // log the last index seen ilast = i ; @@ -492,10 +574,10 @@ GrB_Info GB_builder // build a matrix from tuples if (kbad [tid] >= 0) { // invalid index - int64_t i = I_input [kbad [tid]] ; + uint64_t i = GB_IGET (I_input, kbad [tid]) ; GB_FREE_WORKSPACE ; GB_ERROR (GrB_INDEX_OUT_OF_BOUNDS, - "index (" GBd ") out of bounds, must be < (" GBd ")", + "index (" GBu ") out of bounds, must be < (" GBd ")", i, vlen) ; } } @@ -513,6 +595,9 @@ GrB_Info GB_builder // build a matrix from tuples known_no_duplicates = known_sorted && no_duplicates_found ; } + // I_input and J_input are now verified and have been copied into I_work + // and J_work. They are no longer used below. + //-------------------------------------------------------------------------- // STEP 2: sort the tuples in ascending order //-------------------------------------------------------------------------- @@ -532,7 +617,9 @@ GrB_Info GB_builder // build a matrix from tuples if (!S_iso) { // create the k part of each tuple - K_work = GB_MALLOC_WORK (nvals, int64_t, &K_work_size) ; + K_work = GB_MALLOC_MEMORY (nvals, + K_is_32 ? sizeof (uint32_t) : sizeof (uint64_t), + &K_work_size) ; if (K_work == NULL) { // out of memory @@ -540,6 +627,8 @@ GrB_Info GB_builder // build a matrix from tuples return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (K_work, K_is_32) ; + // The k part of each tuple (i,k) or (j,i,k) records the original // position of the tuple in the input list. This allows an // unstable sorting algorithm to be used. Since k is unique, it @@ -552,7 +641,7 @@ GrB_Info GB_builder // build a matrix from tuples #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < nvals ; k++) { - K_work [k] = k ; + GB_ISET (K_work, k, k) ; } } @@ -570,29 +659,15 @@ GrB_Info GB_builder // build a matrix from tuples if (S_iso) { // K_work is NULL; only sort (j,i) - info = GB_msort_2 (J_work, I_work, nvals, nthreads) ; + GB_OK (GB_msort_2 (J_work, J_is_32, I_work, I_is_32, nvals, + nthreads)) ; } else { - info = GB_msort_3 (J_work, I_work, K_work, nvals, nthreads) ; + GB_OK (GB_msort_3 (J_work, J_is_32, I_work, I_is_32, + K_work, K_is_32, nvals, nthreads)) ; } - #ifdef GB_DEBUG - if (info == GrB_SUCCESS) - { - int64_t ilast = -1 ; - int64_t jlast = -1 ; - for (int64_t k = 0 ; k < nvals ; k++) - { - int64_t i = I_work [k] ; - int64_t j = J_work [k] ; - ASSERT ((jlast < j) || (jlast == j && ilast <= i)) ; - ilast = i ; - jlast = j ; - } - } - #endif - } else { @@ -604,34 +679,45 @@ GrB_Info GB_builder // build a matrix from tuples if (S_iso) { // K_work is NULL; only sort (i) - info = GB_msort_1 (I_work, nvals, nthreads) ; + GB_OK (GB_msort_1 (I_work, I_is_32, nvals, nthreads)) ; } else { - info = GB_msort_2 (I_work, K_work, nvals, nthreads) ; - } - - #ifdef GB_DEBUG - if (info == GrB_SUCCESS) - { - int64_t ilast = -1 ; - for (int64_t k = 0 ; k < nvals ; k++) - { - int64_t i = I_work [k] ; - ASSERT (ilast <= i) ; - ilast = i ; - } + GB_OK (GB_msort_2 (I_work, I_is_32, K_work, K_is_32, nvals, + nthreads)) ; } - #endif } + } + + //-------------------------------------------------------------------------- + // STEP 2 finished: the tuples are now sorted + //-------------------------------------------------------------------------- - if (info != GrB_SUCCESS) + #ifdef GB_DEBUG + if (vdim > 1) + { + int64_t ilast = -1 ; + int64_t jlast = -1 ; + for (int64_t k = 0 ; k < nvals ; k++) { - // out of memory in GB_msort_* - GB_FREE_WORKSPACE ; - return (GrB_OUT_OF_MEMORY) ; + int64_t i = GB_IGET (I_work, k) ; + int64_t j = GB_IGET (J_work, k) ; + ASSERT ((jlast < j) || (jlast == j && ilast <= i)) ; + ilast = i ; + jlast = j ; + } + } + else + { + int64_t ilast = -1 ; + for (int64_t k = 0 ; k < nvals ; k++) + { + int64_t i = GB_IGET (I_work, k) ; + ASSERT (ilast <= i) ; + ilast = i ; } } + #endif //-------------------------------------------------------------------------- // STEP 3: count vectors and duplicates in each slice @@ -700,11 +786,10 @@ GrB_Info GB_builder // build a matrix from tuples int64_t tstart = tstart_slice [tid] ; int64_t tend = tstart_slice [tid+1] ; int64_t jlast = GB_J_WORK (tstart-1) ; - for (int64_t t = tstart ; t < tend ; t++) { // get the t-th tuple - int64_t j = J_work [t] ; + int64_t j = GB_IGET (J_work, t) ; if (j > jlast) { // vector j starts in this slice @@ -712,7 +797,6 @@ GrB_Info GB_builder // build a matrix from tuples jlast = j ; } } - tnvec_slice [tid] = my_tnvec ; tnz_slice [tid] = tend - tstart ; } @@ -737,18 +821,17 @@ GrB_Info GB_builder // build a matrix from tuples #pragma omp parallel for num_threads(nthreads) schedule(static) for (tid = 0 ; tid < nthreads ; tid++) { - int64_t my_tnvec = 0 ; int64_t my_ndupl = 0 ; - int64_t tstart = tstart_slice [tid] ; - int64_t tend = tstart_slice [tid+1] ; - int64_t ilast = ilast_slice [tid] ; - int64_t jlast = GB_J_WORK (tstart-1) ; + int64_t tstart = tstart_slice [tid] ; + int64_t tend = tstart_slice [tid+1] ; + int64_t ilast = ilast_slice [tid] ; + int64_t jlast = GB_J_WORK (tstart-1) ; for (int64_t t = tstart ; t < tend ; t++) { // get the t-th tuple - int64_t i = I_work [t] ; + int64_t i = GB_IGET (I_work, t) ; int64_t j = GB_J_WORK (t) ; // tuples are now sorted but there may be duplicates @@ -758,11 +841,16 @@ GrB_Info GB_builder // build a matrix from tuples if (i == ilast && j == jlast) { // flag the tuple as a duplicate - I_work [t] = -1 ; + // I_work [t] = duplicate_entry + GB_ISET (I_work, t, duplicate_entry) ; my_ndupl++ ; // the sort places earlier duplicate tuples (with smaller // k) after later ones (with larger k). - ASSERT (GB_K_WORK (t-1) < GB_K_WORK (t)) ; + #ifdef GB_DEBUG + int64_t kprev = GB_K_WORK (t-1) ; + int64_t kthis = GB_K_WORK (t) ; + ASSERT (kprev < kthis) ; + #endif } else { @@ -781,6 +869,9 @@ GrB_Info GB_builder // build a matrix from tuples } } + #undef GB_K_WORK + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) + //-------------------------------------------------------------------------- // find total # of vectors and duplicates in all tuples //-------------------------------------------------------------------------- @@ -788,16 +879,18 @@ GrB_Info GB_builder // build a matrix from tuples // Replace tnvec_slice with its cumulative sum, after which each slice tid // will be responsible for the # vectors in T that range from tnvec_slice // [tid] to tnvec_slice [tid+1]-1. - GB_cumsum1 (tnvec_slice, nthreads) ; + GB_cumsum1_64 ((uint64_t *) tnvec_slice, nthreads) ; int64_t tnvec = tnvec_slice [nthreads] ; // Replace tnz_slice with its cumulative sum - GB_cumsum1 (tnz_slice, nthreads) ; + GB_cumsum1_64 ((uint64_t *) tnz_slice, nthreads) ; // find the total # of final entries, after assembling duplicates int64_t tnz = tnz_slice [nthreads] ; int64_t ndupl = nvals - tnz ; + Tp_is_32 = GB_determine_p_is_32 (Tp_is_32, tnz) ; // OK + //-------------------------------------------------------------------------- // allocate T; always hypersparse //-------------------------------------------------------------------------- @@ -805,15 +898,10 @@ GrB_Info GB_builder // build a matrix from tuples // allocate T; allocate T->p and T->h but do not initialize them. // T is always hypersparse. The header T always exists on input, as // either a static or dynamic header. - info = GB_new (&T, // always hyper, existing header - ttype, vlen, vdim, GB_Ap_malloc, is_csc, - GxB_HYPERSPARSE, GB_ALWAYS_HYPER, tnvec) ; - if (info != GrB_SUCCESS) - { - // out of memory - GB_FREE_WORKSPACE ; - return (info) ; - } + GB_OK (GB_new (&T, // always hyper, existing header + ttype, vlen, vdim, GB_ph_malloc, is_csc, + GxB_HYPERSPARSE, GB_ALWAYS_HYPER, tnvec, + Tp_is_32, Tj_is_32, Ti_is_32)) ; ASSERT (T->p != NULL) ; ASSERT (T->h != NULL) ; @@ -821,17 +909,17 @@ GrB_Info GB_builder // build a matrix from tuples ASSERT (T->i == NULL) ; ASSERT (T->x == NULL) ; - T->iso = S_iso ; // OK: T is iso if and only if Sx is iso + T->iso = S_iso ; // T is iso if and only if Sx is iso do_burble = do_burble && (vlen > 1 || vdim > 1) && (nvals > 1) ; if (do_burble) { if (S_iso) { - GBURBLE ("(iso build) ") ; + GBURBLE ("(iso build, %d threads) ", nthreads) ; } else { - GBURBLE ("(build) ") ; + GBURBLE ("(build, %d threads) ", nthreads) ; } } @@ -841,8 +929,10 @@ GrB_Info GB_builder // build a matrix from tuples // Step 4 scans the J_work indices and constructs T->h and T->p. - int64_t *restrict Th = T->h ; - int64_t *restrict Tp = T->p ; + void *Tp = T->p ; + void *Th = T->h ; + GB_IDECL (Tp, , u) ; GB_IPTR (Tp, Tp_is_32) ; + GB_IDECL (Th, , u) ; GB_IPTR (Th, Tj_is_32) ; if (vdim <= 1) { @@ -854,8 +944,8 @@ GrB_Info GB_builder // build a matrix from tuples ASSERT (tnvec == 0 || tnvec == 1) ; if (tnvec > 0) { - Th [0] = 0 ; - Tp [0] = 0 ; + GB_ISET (Tp, 0, 0) ; // Tp [0] = 0 + GB_ISET (Th, 0, 0) ; // Th [0] = 0 ; } } @@ -870,12 +960,10 @@ GrB_Info GB_builder // build a matrix from tuples #pragma omp parallel for num_threads(nthreads) schedule(static) for (tid = 0 ; tid < nthreads ; tid++) { - int64_t my_tnvec = tnvec_slice [tid] ; int64_t tstart = tstart_slice [tid] ; int64_t tend = tstart_slice [tid+1] ; int64_t jlast = GB_J_WORK (tstart-1) ; - for (int64_t t = tstart ; t < tend ; t++) { // get the t-th tuple @@ -883,8 +971,8 @@ GrB_Info GB_builder // build a matrix from tuples if (j > jlast) { // vector j starts in this slice - Th [my_tnvec] = j ; - Tp [my_tnvec] = t ; + GB_ISET (Th, my_tnvec, j) ; // Th [my_tnvec] = j ; + GB_ISET (Tp, my_tnvec, t) ; // Tp [my_tnvec] = t ; my_tnvec++ ; jlast = j ; } @@ -903,26 +991,25 @@ GrB_Info GB_builder // build a matrix from tuples #pragma omp parallel for num_threads(nthreads) schedule(static) for (tid = 0 ; tid < nthreads ; tid++) { - int64_t my_tnz = tnz_slice [tid] ; int64_t my_tnvec = tnvec_slice [tid] ; int64_t tstart = tstart_slice [tid] ; int64_t tend = tstart_slice [tid+1] ; int64_t jlast = GB_J_WORK (tstart-1) ; - for (int64_t t = tstart ; t < tend ; t++) { // get the t-th tuple - int64_t i = I_work [t] ; + int64_t i = GB_IGET (I_work, t) ; int64_t j = GB_J_WORK (t) ; - if (i >= 0) + // a duplicate index i is set to duplicate_entry + if (i != duplicate_entry) { - // this is a new tuple + // this is a new tuple; not a duplicate if (j > jlast) { // vector j starts in this slice - Th [my_tnvec] = j ; - Tp [my_tnvec] = my_tnz ; + GB_ISET (Th, my_tnvec, j) ; // Th [my_tnvec]=j + GB_ISET (Tp, my_tnvec, my_tnz) ;// Tp [my_tnvec]=my_tnz my_tnvec++ ; jlast = j ; } @@ -933,20 +1020,25 @@ GrB_Info GB_builder // build a matrix from tuples } // log the end of the last vector - T->nvec_nonempty = tnvec ; +// T->nvec_nonempty = tnvec ; + GB_nvec_nonempty_set (T, tnvec) ; T->nvec = tnvec ; - Tp [tnvec] = tnz ; + GB_ISET (Tp, tnvec, tnz) ; // Tp [tnvec] = tnz ; T->nvals = tnz ; ASSERT (T->nvec == T->plen || (T->plen == 1 && T->nvec == 0)) ; T->magic = GB_MAGIC ; //-------------------------------------------------------------------------- - // free J_work if it exists + // free J_work if it has been allocated //-------------------------------------------------------------------------- + // J_work might be aliased to J_input, and in this case, J_work_handle + // is NULL. J_input is not modified. ASSERT (J_work_handle != NULL) ; - GB_FREE (J_work_handle, *J_work_size_handle) ; + GB_FREE_MEMORY (J_work_handle, *J_work_size_handle) ; J_work = NULL ; + J_work32 = NULL ; + J_work64 = NULL ; //-------------------------------------------------------------------------- // allocate T->i @@ -954,34 +1046,78 @@ GrB_Info GB_builder // build a matrix from tuples if (ndupl == 0) { - // shrink I_work from size ijslen to size tnz - if (tnz < ijslen) + + //---------------------------------------------------------------------- + // no duplicates: copy/transplant I_work into T->i + //---------------------------------------------------------------------- + + if (Ti_is_32 == I_is_32) { - // this cannot fail since the size is shrinking. - bool ok ; - GB_REALLOC (I_work, tnz, int64_t, I_work_size_handle, &ok) ; - ASSERT (ok) ; + // shrink I_work from size ijslen to size tnz + if (tnz < ijslen) + { + // this cannot fail since the size is shrinking. + bool ok ; + GB_REALLOC_MEMORY (I_work, tnz, + I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t), + I_work_size_handle, &ok) ; + ASSERT (ok) ; + } + // transplant I_work into T->i + T->i = I_work ; T->i_size = (*I_work_size_handle) ; } - // transplant I_work into T->i - T->i = I_work ; T->i_size = (*I_work_size_handle) ; + else + { + // T->i and I_work have different sizes, so they must be typecast + T->i = GB_MALLOC_MEMORY (tnz, + Ti_is_32 ? sizeof (int32_t) : sizeof (int64_t), &(T->i_size)) ; + if (T->i != NULL) + { + // T->i = cast (I_work), but use uint32/64 for T->i since + // I_work has no zombies. + if (do_burble) + { + GBURBLE ("(cast Ti %d %d) ", Ti_is_32, I_is_32) ; + } + GB_cast_int ( + T->i, Ti_is_32 ? GB_UINT32_code : GB_UINT64_code, + I_work, I_is_32 ? GB_UINT32_code : GB_UINT64_code, + tnz, nthreads) ; + } + // free I_work + GB_FREE_MEMORY (I_work_handle, *I_work_size_handle) ; + } + + // I_work has been free or transplanted into T->i I_work = NULL ; + I_work32 = NULL ; + I_work64 = NULL ; (*I_work_handle) = NULL ; (*I_work_size_handle) = 0 ; } else - { + { + + //---------------------------------------------------------------------- + // duplicates exist: T->i is computed from I_work in step 5 + //---------------------------------------------------------------------- + // duplicates exist, so allocate a new T->i. I_work must be freed later - T->i = GB_MALLOC (tnz, int64_t, &(T->i_size)) ; - if (T->i == NULL) - { - // out of memory - GB_phybix_free (T) ; - GB_FREE_WORKSPACE ; - return (GrB_OUT_OF_MEMORY) ; - } + T->i = GB_MALLOC_MEMORY (tnz, + Ti_is_32 ? sizeof (int32_t) : sizeof (int64_t), &(T->i_size)) ; + } + + if (T->i == NULL) + { + // out of memory + GB_phybix_free (T) ; + GB_FREE_WORKSPACE ; + return (GrB_OUT_OF_MEMORY) ; } - int64_t *restrict Ti = T->i ; + T->i_is_32 = Ti_is_32 ; + void *restrict Ti = T->i ; + GB_IDECL (Ti, , ) ; GB_IPTR (Ti, Ti_is_32) ; //========================================================================== // numerical phase of the build: assemble any duplicates @@ -1119,7 +1255,7 @@ GrB_Info GB_builder // build a matrix from tuples { // shrink the size of T->x bool ok = true ; - GB_REALLOC (T->x, tx_size_required, GB_void, &(T->x_size), &ok) ; + GB_REALLOC_MEMORY (T->x, tnz, tsize, &(T->x_size), &ok) ; } info = GrB_SUCCESS ; @@ -1131,7 +1267,7 @@ GrB_Info GB_builder // build a matrix from tuples // allocate T->x //---------------------------------------------------------------------- - T->x = GB_XALLOC (false, S_iso, tnz, tsize, &(T->x_size)) ; // x:OK + T->x = GB_XALLOC_MEMORY (false, S_iso, tnz, tsize, &(T->x_size)) ; if (T->x == NULL) { // out of memory @@ -1227,12 +1363,14 @@ GrB_Info GB_builder // build a matrix from tuples #define GB_bld(opname,aname) \ GB (_bld_ ## opname ## aname) - #define GB_BLD_WORKER(opname,aname,st_type) \ - { \ - info = GB_bld (opname, aname) ((st_type *) Tx, Ti, \ - (st_type *) Sx, nvals, ndupl, I_work, K_work, \ - tstart_slice, tnz_slice, nthreads) ; \ - } \ + #define GB_BLD_WORKER(opname,aname,st_type) \ + { \ + info = GB_bld (opname, aname) ((st_type *) Tx, Ti, \ + Ti_is_32, (st_type *) Sx, nvals, ndupl, \ + I_work, I_is_32, K_work, K_is_32, \ + duplicate_entry, \ + tstart_slice, tnz_slice, nthreads) ; \ + } \ break ; //---------------------------------------------------------- @@ -1256,8 +1394,10 @@ GrB_Info GB_builder // build a matrix from tuples if (info == GrB_NO_VALUE) { - info = GB_build_jit (Tx, Ti, Sx, ttype, stype, dup, nvals, - ndupl, I_work, K_work, tstart_slice, tnz_slice, nthreads) ; + info = GB_build_jit (Tx, T->i, Ti_is_32, Sx, ttype, stype, dup, + nvals, ndupl, I_work, I_is_32, K_work, K_is_32, + K_work == NULL, duplicate_entry, tstart_slice, tnz_slice, + nthreads) ; } //------------------------------------------------------------------ @@ -1273,10 +1413,10 @@ GrB_Info GB_builder // build a matrix from tuples //-------------------------------------------------------------- // Either the fdup operator or type of Sx and T are - // user-defined, or fdup is not an associative operator handled - // by the GB_bld_factory, or some combination of these - // conditions. User-defined types cannot be typecasted, so - // this handles all user-defined types. + // user-defined, or fdup is not handled by the GB_bld_factory, + // or some combination of these conditions. User-defined types + // cannot be typecasted, so this handles all user-defined + // types. // Tx [p] = (ttype) Sx [k], but with no typecasting #undef GB_BLD_COPY @@ -1327,8 +1467,10 @@ GrB_Info GB_builder // build a matrix from tuples if (info == GrB_NO_VALUE) { - info = GB_build_jit (Tx, Ti, Sx, ttype, stype, dup, nvals, - ndupl, I_work, K_work, tstart_slice, tnz_slice, nthreads) ; + info = GB_build_jit (Tx, T->i, Ti_is_32, Sx, ttype, stype, dup, + nvals, ndupl, I_work, I_is_32, K_work, K_is_32, + K_work == NULL, duplicate_entry, tstart_slice, tnz_slice, + nthreads) ; } //------------------------------------------------------------------ diff --git a/GraphBLAS/Source/builder/GrB_Matrix_build.c b/GraphBLAS/Source/builder/GrB_Matrix_build.c index 18a736189d..ad9a02027a 100644 --- a/GraphBLAS/Source/builder/GrB_Matrix_build.c +++ b/GraphBLAS/Source/builder/GrB_Matrix_build.c @@ -2,7 +2,7 @@ // GrB_Matrix_build: build a sparse GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,39 +14,39 @@ #include "builder/GB_build.h" -#define GB_MATRIX_BUILD(prefix,type,T,xtype) \ -GrB_Info GB_EVAL3 (prefix, _Matrix_build_, T) /* build a matrix from tuples */\ +#define GB_BUILD(function_name,ctype,xtype) \ +GrB_Info function_name /* build a matrix from tuples */ \ ( \ - GrB_Matrix C, /* matrix to build */ \ - const GrB_Index *I, /* array of row indices of tuples */ \ - const GrB_Index *J, /* array of column indices of tuples */ \ - const type *X, /* array of values of tuples */ \ - GrB_Index nvals, /* number of tuples */ \ - const GrB_BinaryOp dup /* binary op to assemble duplicates */ \ + GrB_Matrix C, /* matrix to build */ \ + const uint64_t *I, /* array of row indices of tuples */ \ + const uint64_t *J, /* array of column indices of tuples */ \ + const ctype *X, /* array of values of tuples */ \ + uint64_t nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary op to assemble duplicates */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_build_" GB_STR(T) \ - " (C, I, J, X, nvals, dup)") ; \ - GB_BURBLE_START ("GrB_Matrix_build_" GB_STR(T)) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; /* check now so C->type can be done */ \ - GrB_Info info = GB_build (C, I, J, X, nvals, dup, \ - xtype, true, false, Werk) ; \ + GB_WHERE1 (C, GB_STR(function_name) " (C, I, J, X, nvals, dup)") ; \ + GB_RETURN_IF_NULL (C) ; /* check now so C->type can be done */ \ + GB_BURBLE_START (GB_STR(function_name)) ; \ + info = GB_build (C, I, J, X, nvals, dup, xtype, /* is_matrix: */ true, \ + /* X iso: */ false, /* I,J is 32: */ false, false, Werk) ; \ GB_BURBLE_END ; \ return (info) ; \ } -GB_MATRIX_BUILD (GrB, bool , BOOL , GrB_BOOL ) -GB_MATRIX_BUILD (GrB, int8_t , INT8 , GrB_INT8 ) -GB_MATRIX_BUILD (GrB, int16_t , INT16 , GrB_INT16 ) -GB_MATRIX_BUILD (GrB, int32_t , INT32 , GrB_INT32 ) -GB_MATRIX_BUILD (GrB, int64_t , INT64 , GrB_INT64 ) -GB_MATRIX_BUILD (GrB, uint8_t , UINT8 , GrB_UINT8 ) -GB_MATRIX_BUILD (GrB, uint16_t , UINT16 , GrB_UINT16) -GB_MATRIX_BUILD (GrB, uint32_t , UINT32 , GrB_UINT32) -GB_MATRIX_BUILD (GrB, uint64_t , UINT64 , GrB_UINT64) -GB_MATRIX_BUILD (GrB, float , FP32 , GrB_FP32 ) -GB_MATRIX_BUILD (GrB, double , FP64 , GrB_FP64 ) -GB_MATRIX_BUILD (GxB, GxB_FC32_t, FC32 , GxB_FC32 ) -GB_MATRIX_BUILD (GxB, GxB_FC64_t, FC64 , GxB_FC64 ) -GB_MATRIX_BUILD (GrB, void , UDT , C->type ) +// with 64-bit I and J arrays: +GB_BUILD (GrB_Matrix_build_BOOL , bool , GrB_BOOL ) +GB_BUILD (GrB_Matrix_build_INT8 , int8_t , GrB_INT8 ) +GB_BUILD (GrB_Matrix_build_INT16 , int16_t , GrB_INT16 ) +GB_BUILD (GrB_Matrix_build_INT32 , int32_t , GrB_INT32 ) +GB_BUILD (GrB_Matrix_build_INT64 , int64_t , GrB_INT64 ) +GB_BUILD (GrB_Matrix_build_UINT8 , uint8_t , GrB_UINT8 ) +GB_BUILD (GrB_Matrix_build_UINT16, uint16_t , GrB_UINT16) +GB_BUILD (GrB_Matrix_build_UINT32, uint32_t , GrB_UINT32) +GB_BUILD (GrB_Matrix_build_UINT64, uint64_t , GrB_UINT64) +GB_BUILD (GrB_Matrix_build_FP32 , float , GrB_FP32 ) +GB_BUILD (GrB_Matrix_build_FP64 , double , GrB_FP64 ) +GB_BUILD (GxB_Matrix_build_FC32 , GxB_FC32_t, GxB_FC32 ) +GB_BUILD (GxB_Matrix_build_FC64 , GxB_FC64_t, GxB_FC64 ) +GB_BUILD (GrB_Matrix_build_UDT , void , C->type ) diff --git a/GraphBLAS/Source/builder/GrB_Vector_build.c b/GraphBLAS/Source/builder/GrB_Vector_build.c index 811c040db7..3367bf6faa 100644 --- a/GraphBLAS/Source/builder/GrB_Vector_build.c +++ b/GraphBLAS/Source/builder/GrB_Vector_build.c @@ -2,7 +2,7 @@ // GrB_Vector_build: build a sparse GraphBLAS vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,40 +14,40 @@ #include "builder/GB_build.h" -#define GB_VECTOR_BUILD(prefix,type,T,xtype) \ -GrB_Info GB_EVAL3 (prefix, _Vector_build_, T) /* build a vector from tuples*/ \ +#define GB_BUILD(function_name,ctype,xtype) \ +GrB_Info function_name /* build a vector from tuples */ \ ( \ - GrB_Vector w, /* vector to build */ \ - const GrB_Index *I, /* array of row indices of tuples */ \ - const type *X, /* array of values of tuples */ \ - GrB_Index nvals, /* number of tuples */ \ - const GrB_BinaryOp dup /* binary op to assemble duplicates */ \ + GrB_Vector w, /* vector to build */ \ + const uint64_t *I, /* array of row indices of tuples */ \ + const ctype *X, /* array of values of tuples */ \ + uint64_t nvals, /* number of tuples */ \ + const GrB_BinaryOp dup /* binary op to assemble duplicates */ \ ) \ { \ - GB_WHERE (w, "GrB_Vector_build_" GB_STR(T) " (w, I, X, nvals, dup)") ; \ - GB_BURBLE_START ("GrB_Vector_build_" GB_STR(T)) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; /* check now so w->type can be done */ \ + GB_WHERE1 (w, GB_STR(function_name) " (w, I, X, nvals, dup)") ; \ + GB_RETURN_IF_NULL (w) ; /* check now so w->type can be done */ \ + GB_BURBLE_START (GB_STR(function_name)) ; \ ASSERT (GB_VECTOR_OK (w)) ; \ - GrB_Info info = GB_build ((GrB_Matrix) w, I, NULL, X, nvals, dup, \ - xtype, false, false, Werk) ; \ + info = GB_build ((GrB_Matrix) w, I, NULL, X, nvals, dup, xtype, \ + /* is_matrix: */ false, /* X_iso: */ false, \ + /* I,J is 32: */ false, false, Werk) ; \ GB_BURBLE_END ; \ return (info) ; \ } -GB_VECTOR_BUILD (GrB, bool , BOOL , GrB_BOOL ) -GB_VECTOR_BUILD (GrB, int8_t , INT8 , GrB_INT8 ) -GB_VECTOR_BUILD (GrB, int16_t , INT16 , GrB_INT16 ) -GB_VECTOR_BUILD (GrB, int32_t , INT32 , GrB_INT32 ) -GB_VECTOR_BUILD (GrB, int64_t , INT64 , GrB_INT64 ) -GB_VECTOR_BUILD (GrB, uint8_t , UINT8 , GrB_UINT8 ) -GB_VECTOR_BUILD (GrB, uint16_t , UINT16 , GrB_UINT16) -GB_VECTOR_BUILD (GrB, uint32_t , UINT32 , GrB_UINT32) -GB_VECTOR_BUILD (GrB, uint64_t , UINT64 , GrB_UINT64) -GB_VECTOR_BUILD (GrB, float , FP32 , GrB_FP32 ) -GB_VECTOR_BUILD (GrB, double , FP64 , GrB_FP64 ) -GB_VECTOR_BUILD (GxB, GxB_FC32_t, FC32 , GxB_FC32 ) -GB_VECTOR_BUILD (GxB, GxB_FC64_t, FC64 , GxB_FC64 ) - -// for user-defined types, X is assumed to have the same type as w -GB_VECTOR_BUILD (GrB, void , UDT , w->type ) +// with 64-bit I arrays: +GB_BUILD (GrB_Vector_build_BOOL , bool , GrB_BOOL ) +GB_BUILD (GrB_Vector_build_INT8 , int8_t , GrB_INT8 ) +GB_BUILD (GrB_Vector_build_INT16 , int16_t , GrB_INT16 ) +GB_BUILD (GrB_Vector_build_INT32 , int32_t , GrB_INT32 ) +GB_BUILD (GrB_Vector_build_INT64 , int64_t , GrB_INT64 ) +GB_BUILD (GrB_Vector_build_UINT8 , uint8_t , GrB_UINT8 ) +GB_BUILD (GrB_Vector_build_UINT16, uint16_t , GrB_UINT16) +GB_BUILD (GrB_Vector_build_UINT32, uint32_t , GrB_UINT32) +GB_BUILD (GrB_Vector_build_UINT64, uint64_t , GrB_UINT64) +GB_BUILD (GrB_Vector_build_FP32 , float , GrB_FP32 ) +GB_BUILD (GrB_Vector_build_FP64 , double , GrB_FP64 ) +GB_BUILD (GxB_Vector_build_FC32 , GxB_FC32_t, GxB_FC32 ) +GB_BUILD (GxB_Vector_build_FC64 , GxB_FC64_t, GxB_FC64 ) +GB_BUILD (GrB_Vector_build_UDT , void , w->type ) diff --git a/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar.c b/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar.c index 2c92582d39..0db2c67376 100644 --- a/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar.c +++ b/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar.c @@ -2,7 +2,7 @@ // GxB_Matrix_build_Scalar: build a sparse GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,10 +19,10 @@ GrB_Info GxB_Matrix_build_Scalar ( GrB_Matrix C, // matrix to build - const GrB_Index *I, // array of row indices of tuples - const GrB_Index *J, // array of column indices of tuples + const uint64_t *I, // array of row indices of tuples + const uint64_t *J, // array of column indices of tuples GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples + uint64_t nvals // number of tuples ) { @@ -30,9 +30,12 @@ GrB_Info GxB_Matrix_build_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_build_Scalar (C, I, J, scalar, nvals)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE2 (C, scalar, "GxB_Matrix_build_Scalar (C, I, J, scalar, nvals)") ; GB_BURBLE_START ("GxB_Matrix_build_Scalar") ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; + GB_MATRIX_WAIT (scalar) ; if (GB_nnz ((GrB_Matrix) scalar) != 1) { @@ -43,8 +46,9 @@ GrB_Info GxB_Matrix_build_Scalar // build the matrix, ignoring duplicates //-------------------------------------------------------------------------- - GrB_Info info = GB_build (C, I, J, scalar->x, nvals, GxB_IGNORE_DUP, - scalar->type, true, true, Werk) ; + info = GB_build (C, I, J, scalar->x, nvals, GxB_IGNORE_DUP, scalar->type, + /* is_matrix: */ true, /* X_iso: */ true, + /* I,J is 32: */ false, false, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar_Vector.c b/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar_Vector.c new file mode 100644 index 0000000000..a805065329 --- /dev/null +++ b/GraphBLAS/Source/builder/GxB_Matrix_build_Scalar_Vector.c @@ -0,0 +1,97 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_build_Scalar_Vector: build a sparse GraphBLAS matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// GxB_Matrix_build_Scalar_Vector builds a matrix C whose values in its +// sparsity pattern are all equal to a value given by a GrB_Scalar. Unlike the +// GrB_Matrix_build_* methods, there is no binary dup operator. Instead, any +// duplicate indices are ignored, which is not an error condition. The I and J +// GrB_Vectors are of size nvals, just like GrB_Matrix_build_*. + +#include "builder/GB_build.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_build_Scalar_Vector // build a matrix from (I,J,s) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + const GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, I_vector, J_vector, scalar, + "GxB_Matrix_build_Scalar_Vector (C, I, J, scalar, nvals, desc)") ; + GB_BURBLE_START ("GxB_Matrix_build_Scalar") ; + ASSERT (GB_VECTOR_OK (I_vector)) ; + ASSERT (GB_VECTOR_OK (J_vector)) ; + + //-------------------------------------------------------------------------- + // finish any pending work + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + + GB_MATRIX_WAIT (scalar) ; + if (GB_nnz ((GrB_Matrix) scalar) != 1) + { + GB_ERROR (GrB_EMPTY_OBJECT, "Scalar value is %s", "missing") ; + } + + GB_MATRIX_WAIT (I_vector) ; + GB_MATRIX_WAIT (J_vector) ; + int64_t nvals = GB_nnz ((GrB_Matrix) I_vector) ; + int64_t jvals = GB_nnz ((GrB_Matrix) J_vector) ; + if (nvals != jvals) + { + GB_ERROR (GrB_INVALID_VALUE, "Input vectors I,J must have the " + "same number of entries; nvals(I) = " GBd ", nvals(J) = " GBd, + nvals, jvals) ; + } + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, true, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, true, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // build the matrix, ignoring duplicates + //-------------------------------------------------------------------------- + + GB_OK (GB_build (C, I, J, scalar->x, nvals, GxB_IGNORE_DUP, scalar->type, + /* is_matrix: */ true, /* X_iso: */ true, I_is_32, J_is_32, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/builder/GxB_Matrix_build_Vector.c b/GraphBLAS/Source/builder/GxB_Matrix_build_Vector.c new file mode 100644 index 0000000000..fb23341109 --- /dev/null +++ b/GraphBLAS/Source/builder/GxB_Matrix_build_Vector.c @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_build_Vector: build a sparse GraphBLAS matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// If dup is NULL: any duplicates result in an error. +// If dup is GxB_IGNORE_DUP: duplicates are ignored, which is not an error. +// If dup is a valid binary operator, it is used to reduce any duplicates to +// a single value. + +#include "builder/GB_build.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; \ + if (X_size > 0) GB_FREE_MEMORY (&X, X_size) ; + +GrB_Info GxB_Matrix_build_Vector // build a matrix from (I,J,X) tuples +( + GrB_Matrix C, // matrix to build + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // col indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (I_vector) ; + GB_RETURN_IF_NULL (J_vector) ; + GB_RETURN_IF_NULL (X_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, I_vector, J_vector, X_vector, + "GxB_Matrix_build_Vector (C, I, J, X, dup, desc)") ; + GB_BURBLE_START ("GxB_Matrix_build_Vector") ; + ASSERT_VECTOR_OK (I_vector, "I_vector for build", GB0) ; + ASSERT_VECTOR_OK (J_vector, "J_vector for build", GB0) ; + ASSERT_VECTOR_OK (X_vector, "X_vector for build", GB0) ; + + //-------------------------------------------------------------------------- + // finish any pending work + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL, *X = NULL ; + size_t I_size = 0, J_size = 0, X_size = 0 ; + + GB_MATRIX_WAIT (I_vector) ; + GB_MATRIX_WAIT (J_vector) ; + GB_MATRIX_WAIT (X_vector) ; + int64_t nvals = GB_nnz ((GrB_Matrix) X_vector) ; + int64_t ivals = GB_nnz ((GrB_Matrix) I_vector) ; + int64_t jvals = GB_nnz ((GrB_Matrix) J_vector) ; + if (nvals != ivals || nvals != jvals) + { + GB_ERROR (GrB_INVALID_VALUE, "Input vectors I,J must have the " + "same number of entries; nvals(I) = " GBd ", nvals(J) = " GBd + " nvals(X) = " GBd, ivals, jvals, nvals) ; + } + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + int64_t ni = 0, nj = 0, nx = 0 ; + GrB_Type I_type = NULL, J_type = NULL, X_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, true, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, true, + &J, &nj, &J_size, &J_type, Werk)) ; + GB_OK (GB_ijxvector (X_vector, false, 2, desc, true, + &X, &nx, &X_size, &X_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + // FUTURE: if they come from List->i, then I,J,X are known to be sorted + // with no duplicates. Exploit this in GB_build. + + // FUTURE: if I,J,X have been allocated, they can be ingested into C; + // exploit this in GB_build. + + //-------------------------------------------------------------------------- + // build the matrix + //-------------------------------------------------------------------------- + + GB_OK (GB_build (C, I, J, X, nvals, dup, X_type, /* is_matrix: */ true, + /* X iso: */ false, I_is_32, J_is_32, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/builder/GxB_Vector_build_Scalar.c b/GraphBLAS/Source/builder/GxB_Vector_build_Scalar.c index 73ce52e569..ee991a025b 100644 --- a/GraphBLAS/Source/builder/GxB_Vector_build_Scalar.c +++ b/GraphBLAS/Source/builder/GxB_Vector_build_Scalar.c @@ -2,7 +2,7 @@ // GxB_Vector_build_Scalar: build a sparse GraphBLAS vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,10 +18,10 @@ GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples ( - GrB_Vector w, // vector to build - const GrB_Index *I, // array of row indices of tuples - GrB_Scalar scalar, // value for all tuples - GrB_Index nvals // number of tuples + GrB_Vector w, // vector to build + const uint64_t *I, // array of row indices of tuples + const GrB_Scalar scalar, // value for all tuples + uint64_t nvals // number of tuples ) { @@ -29,11 +29,17 @@ GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GxB_Vector_build_Scalar (w, I, scalar, nvals)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE2 (w, scalar, "GxB_Vector_build_Scalar (w, I, scalar, nvals)") ; GB_BURBLE_START ("GxB_Vector_build_Scalar") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; ASSERT (GB_VECTOR_OK (w)) ; + + //-------------------------------------------------------------------------- + // finish any pending work + //-------------------------------------------------------------------------- + GB_MATRIX_WAIT (scalar) ; if (GB_nnz ((GrB_Matrix) scalar) != 1) { @@ -44,8 +50,10 @@ GrB_Info GxB_Vector_build_Scalar // build a vector from (i,scalar) tuples // build the vector //-------------------------------------------------------------------------- - GrB_Info info = GB_build ((GrB_Matrix) w, I, NULL, scalar->x, nvals, - GxB_IGNORE_DUP, scalar->type, false, true, Werk) ; + info = GB_build ((GrB_Matrix) w, I, NULL, scalar->x, nvals, + GxB_IGNORE_DUP, scalar->type, + /* is_matrix: */ false, /* X_iso: */ true, + /* I,J is 32: */ false, false, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/builder/GxB_Vector_build_Scalar_Vector.c b/GraphBLAS/Source/builder/GxB_Vector_build_Scalar_Vector.c new file mode 100644 index 0000000000..84233fcf1a --- /dev/null +++ b/GraphBLAS/Source/builder/GxB_Vector_build_Scalar_Vector.c @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_build_Scalar_Vector: build a sparse GraphBLAS vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// GxB_Vector_build_Scalar_Vector builds a vector w whose values in its +// sparsity pattern are all equal to a value given by a GrB_Scalar. Unlike the +// GrB_Vector_build_* methods, there is no binary dup operator. Instead, any +// duplicate indices are ignored, which is not an error condition. The I +// GrB_Vector is of size nvals, just like GrB_Vector_build_*. + +#include "builder/GB_build.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_build_Scalar_Vector // build a vector from (I,s) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Scalar scalar, // value for all tuples + const GrB_Descriptor desc +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_NULL (I_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE3 (w, scalar, I_vector, + "GxB_Vector_build_Scalar_Vector (w, I, scalar, desc)") ; + GB_BURBLE_START ("GxB_Vector_build_Scalar_Vector") ; + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_VECTOR_OK (I_vector)) ; + + //-------------------------------------------------------------------------- + // finish any pending work + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + + GB_MATRIX_WAIT (scalar) ; + if (GB_nnz ((GrB_Matrix) scalar) != 1) + { + GB_ERROR (GrB_EMPTY_OBJECT, "Scalar value is %s", "missing") ; + } + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + bool need_copy = (w == I_vector) ; + GB_OK (GB_ijxvector (I_vector, need_copy, 0, desc, true, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // build the vector + //-------------------------------------------------------------------------- + + GB_OK (GB_build ((GrB_Matrix) w, I, NULL, scalar->x, ni, + GxB_IGNORE_DUP, scalar->type, + /* is_matrix: */ false, /* X_iso: */ true, + /* I,J is 32: */ I_is_32, false, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/builder/GxB_Vector_build_Vector.c b/GraphBLAS/Source/builder/GxB_Vector_build_Vector.c new file mode 100644 index 0000000000..bc9295f9e7 --- /dev/null +++ b/GraphBLAS/Source/builder/GxB_Vector_build_Vector.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_build_Vector: build a sparse GraphBLAS vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// If dup is NULL: any duplicates result in an error. +// If dup is GxB_IGNORE_DUP: duplicates are ignored, which is not an error. +// If dup is a valid binary operator, it is used to reduce any duplicates to +// a single value. + +#include "builder/GB_build.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (X_size > 0) GB_FREE_MEMORY (&X, X_size) ; + +GrB_Info GxB_Vector_build_Vector // build a vector from (I,X) tuples +( + GrB_Vector w, // vector to build + const GrB_Vector I_vector, // row indices + const GrB_Vector X_vector, // values + const GrB_BinaryOp dup, // binary function to assemble duplicates + const GrB_Descriptor desc +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (I_vector) ; + GB_RETURN_IF_NULL (X_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE3 (w, I_vector, X_vector, + "GxB_Vector_build_Vector (w, I, X, dup, desc)") ; + GB_BURBLE_START ("GxB_Vector_build_Vector") ; + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_VECTOR_OK (I_vector)) ; + ASSERT (GB_VECTOR_OK (X_vector)) ; + + //-------------------------------------------------------------------------- + // finish any pending work + //-------------------------------------------------------------------------- + + void *I = NULL, *X = NULL ; + size_t I_size = 0, X_size = 0 ; + + GB_MATRIX_WAIT (I_vector) ; + GB_MATRIX_WAIT (X_vector) ; + int64_t nvals = GB_nnz ((GrB_Matrix) X_vector) ; + int64_t ivals = GB_nnz ((GrB_Matrix) I_vector) ; + if (nvals != ivals) + { + GB_ERROR (GrB_INVALID_VALUE, "Input vectors I,X must have the " + "same number of entries; nvals(I) = " GBd ", nvals(X) = " GBd, + ivals, nvals) ; + } + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + int64_t ni = 0, nx = 0 ; + GrB_Type I_type = NULL, X_type = NULL ; + bool need_copy = (w == I_vector || w == X_vector) ; + GB_OK (GB_ijxvector (I_vector, need_copy, 0, desc, true, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (X_vector, need_copy, 2, desc, true, + &X, &nx, &X_size, &X_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + // FUTURE: if they come from List->i, then I,X are known to be sorted + // with no duplicates. Exploit this in GB_build. + + // FUTURE: if I,X have been allocated, they can be ingested into w. + // Exploit this in GB_build. + + //-------------------------------------------------------------------------- + // build the vector + //-------------------------------------------------------------------------- + + GB_OK (GB_build ((GrB_Matrix) w, I, NULL, X, nvals, dup, X_type, + /* is_matrix: */ false, /* X iso: */ false, I_is_32, false, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/builder/factory/GB_bld_factory.c b/GraphBLAS/Source/builder/factory/GB_bld_factory.c index 66ceca544d..5fc24c3f53 100644 --- a/GraphBLAS/Source/builder/factory/GB_bld_factory.c +++ b/GraphBLAS/Source/builder/factory/GB_bld_factory.c @@ -2,7 +2,7 @@ // GB_bld_factory.c: switch factory for builder //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/builder/template/GB_bld_template.c b/GraphBLAS/Source/builder/template/GB_bld_template.c index b885a26df7..8b073483cf 100644 --- a/GraphBLAS/Source/builder/template/GB_bld_template.c +++ b/GraphBLAS/Source/builder/template/GB_bld_template.c @@ -2,7 +2,7 @@ // GB_bld_template.c: Tx=build(Sx), and assemble any duplicate tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,10 +18,15 @@ { - // k unused for some uses of this template - #include "include/GB_unused.h" + #ifndef GB_NO_DUPLICATES + #define GB_NO_DUPLICATES (ndupl == 0) + #endif - if (ndupl == 0) + #ifndef GB_K_IS_NULL + #define GB_K_IS_NULL (K_work == NULL) + #endif + + if (GB_NO_DUPLICATES) { //---------------------------------------------------------------------- @@ -35,7 +40,7 @@ #ifndef GB_ISO_BUILD - if (K_work == NULL) + if (GB_K_IS_NULL) { int tid ; @@ -64,7 +69,8 @@ for (int64_t t = tstart ; t < tend ; t++) { // Tx [t] = (ttype) Sx [K_work [t]] ; - GB_BLD_COPY (Tx, t, Sx, K_work [t]) ; + int64_t k = GB_IGET (K_work, t) ; + GB_BLD_COPY (Tx, t, Sx, k) ; } } } @@ -96,30 +102,32 @@ for (t = tstart ; t < tend ; t++) { // get the tuple and break if it is not a duplicate - if (I_work [t] >= 0) break ; + int64_t i = GB_IGET (I_work, t) ; + if (i != duplicate_entry) break ; } // scan all tuples and assemble any duplicates for ( ; t < tend ; t++) { // get the t-th tuple, a unique tuple - int64_t i = I_work [t] ; - ASSERT (i >= 0) ; + int64_t i = GB_IGET (I_work, t) ; + ASSERT (i != duplicate_entry) ; #ifndef GB_ISO_BUILD - int64_t k = (K_work == NULL) ? t : K_work [t] ; + int64_t k = GB_K_WORK (t) ; // Tx [my_tnz] = (ttype) Sx [k] ; GB_BLD_COPY (Tx, my_tnz, Sx, k) ; #endif - Ti [my_tnz] = i ; + GB_ISET (Ti, my_tnz, i) ; // Ti [my_tnz] = i // assemble all duplicates that follow it. This may assemble // the first duplicates in the next slice(s) (up to but not // including the first unique tuple in the subsequent slice(s)). - for ( ; t+1 < nvals && I_work [t+1] < 0 ; t++) + for ( ; t+1 < nvals && + GB_IGET (I_work, t+1) == duplicate_entry ; t++) { // assemble the duplicate tuple - #ifndef GB_ISO_BUILD - int64_t k = (K_work == NULL) ? (t+1) : K_work [t+1] ; + #if !(defined (GB_ISO_BUILD) || defined (GB_DUP_IS_FIRST)) + int64_t k = GB_K_WORK (t+1) ; // Tx [my_tnz] += Sx [k], typecasting as needed GB_BLD_DUP (Tx, my_tnz, Sx, k) ; #endif diff --git a/GraphBLAS/Source/builtin/GB_builtin.c b/GraphBLAS/Source/builtin/GB_builtin.c index 5776e3c965..56fe2c523f 100644 --- a/GraphBLAS/Source/builtin/GB_builtin.c +++ b/GraphBLAS/Source/builtin/GB_builtin.c @@ -2,7 +2,7 @@ // GB_builtin.c: built-in types, functions, operators, and other externs //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,8 @@ GB_TYPEDEF (GxB, FC64 , GxB_FC64_t, "GxB_FC64_t") ; o, /* default: axb */ \ 0, /* default compression */ \ 0, /* no sort */ \ - 0 /* import */ \ + 0, /* import */ \ + 0, 0, 0 /* row_list, col_list, val_list */ \ } ; \ GrB_Descriptor GRB (DESC_ ## name) = & GB_OPAQUE (desc_ ## name) ; @@ -252,8 +253,8 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // helper macros to define binary operators based on an index-binary op #define GXB_OP2_POS(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, \ - const void *x, GrB_Index ix, GrB_Index jx, \ - const void *y, GrB_Index iy, GrB_Index jy, \ + const void *x, uint64_t ix, uint64_t jx, \ + const void *y, uint64_t iy, uint64_t jy, \ const void *theta_parameter) ; \ GB_TYPE GB_OPAQUE (GB_EVAL3 (op, GB_XTYPE, _theta)) = 0 ; \ struct GB_BinaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ @@ -282,7 +283,7 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // the same type as the scalar y: ROWINDEX, COLINDEX, DIAGINDEX #define GRB_IDXOP_POSITIONAL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, const void *unused, \ - GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ + uint64_t i, uint64_t j, const GB_TYPE *y) ; \ struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ @@ -302,7 +303,7 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // the same type as the scalar y: FLIPDIAGINDEX #define GXB_IDXOP_POSITIONAL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, const void *unused, \ - GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ + uint64_t i, uint64_t j, const GB_TYPE *y) ; \ struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ @@ -323,7 +324,7 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // No suffix on the GrB name. #define GRB_IDXOP_POSITIONAL_BOOL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const void *unused, \ - GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ + uint64_t i, uint64_t j, const GB_TYPE *y) ; \ struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ @@ -342,7 +343,7 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // GrB_IndexUnaryOps that depend on A(i,j), and result is bool: VALUE* ops #define GRB_IDXOP_VALUE(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const GB_TYPE *x, \ - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) ; \ + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) ; \ struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ @@ -361,7 +362,7 @@ GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; // GxB* IndexUnaryOps that depend on A(i,j), result is bool: VALUE* complex ops #define GXB_IDXOP_VALUE(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const GB_TYPE *x, \ - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) ; \ + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) ; \ struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ @@ -540,7 +541,7 @@ GrB_BinaryOp GxB_ONEB_FC64 = & GB_OPAQUE (PAIR_FC64) ; // nonzombie function for generic case extern void GB_nonzombie_func (bool *z, const void *x, - int64_t i, GrB_Index j, const void *y) ; + int64_t i, uint64_t j, const void *y) ; // GxB_NONZOMBIE: internal use only struct GB_IndexUnaryOp_opaque GB_OPAQUE (NONZOMBIE) = @@ -562,11 +563,11 @@ GrB_IndexUnaryOp GxB_NONZOMBIE = & GB_OPAQUE (NONZOMBIE) ; // GrB_ALL //------------------------------------------------------------------------------ -// The GrB_ALL pointer is never dereferenced. It is passed in as an argument to -// indicate that all indices are to be used, as in the colon in C = A(:,j). +// The GrB_ALL pointer is never dereferenced. It is passed in as an argument +// to indicate that all indices are to be used, as in the colon in C = A(:,j). -GrB_Index GB_OPAQUE (ALL) = 0 ; -const GrB_Index *GrB_ALL = & GB_OPAQUE (ALL) ; +uint64_t GB_OPAQUE (ALL) = 0 ; +const uint64_t *GrB_ALL = & GB_OPAQUE (ALL) ; // the default hyper_switch is defined in GB_defaults.h const double GxB_HYPER_DEFAULT = GB_HYPER_SWITCH_DEFAULT ; @@ -575,7 +576,7 @@ const double GxB_HYPER_DEFAULT = GB_HYPER_SWITCH_DEFAULT ; // stored in hypersparse format, respectively. const double GxB_ALWAYS_HYPER = GB_ALWAYS_HYPER ; const double GxB_NEVER_HYPER = GB_NEVER_HYPER ; -const GxB_Format_Value GxB_FORMAT_DEFAULT = GxB_BY_ROW ; +const int GxB_FORMAT_DEFAULT = GxB_BY_ROW ; //------------------------------------------------------------------------------ // predefined built-in monoids diff --git a/GraphBLAS/Source/builtin/GB_builtin.h b/GraphBLAS/Source/builtin/GB_builtin.h index 2e0b3d9046..1984a263fe 100644 --- a/GraphBLAS/Source/builtin/GB_builtin.h +++ b/GraphBLAS/Source/builtin/GB_builtin.h @@ -2,7 +2,7 @@ // GB_builtin.h: built-in unary and binary operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ // nonzombie function for generic case inline void GB_nonzombie_func (bool *z, const void *x, - int64_t i, GrB_Index j, const void *y) + int64_t i, uint64_t j, const void *y) { (*z) = (i >= 0) ; } diff --git a/GraphBLAS/Source/builtin/factory/GB_builtin_template.c b/GraphBLAS/Source/builtin/factory/GB_builtin_template.c index 7bed927bd1..9065d3fee1 100644 --- a/GraphBLAS/Source/builtin/factory/GB_builtin_template.c +++ b/GraphBLAS/Source/builtin/factory/GB_builtin_template.c @@ -2,7 +2,7 @@ // GB_builtin_template.c: built-in unary and binary functions and operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/builtin/factory/GB_builtin_template.h b/GraphBLAS/Source/builtin/factory/GB_builtin_template.h index 4f3b9fd79c..622261be69 100644 --- a/GraphBLAS/Source/builtin/factory/GB_builtin_template.h +++ b/GraphBLAS/Source/builtin/factory/GB_builtin_template.h @@ -2,7 +2,7 @@ // GB_builtin_template.h: define the unary and binary functions and operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -1072,25 +1072,25 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_IDXOP_STRUCT (ROWINDEX, GB_XTYPE) ; inline void GB_FUNC (ROWINDEX) (GB_TYPE *z, const void *unused, - GrB_Index i, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i, uint64_t j_unused, const GB_TYPE *y) { (*z) = (GB_TYPE) (((int64_t) i) + (*y)) ; } GB_IDXOP_STRUCT (COLINDEX, GB_XTYPE) ; inline void GB_FUNC (COLINDEX) (GB_TYPE *z, const void *unused, - GrB_Index i_unused, GrB_Index j, const GB_TYPE *y) + uint64_t i_unused, uint64_t j, const GB_TYPE *y) { (*z) = (GB_TYPE) (((int64_t) j) + (*y)) ; } GB_IDXOP_STRUCT (DIAGINDEX, GB_XTYPE) ; inline void GB_FUNC (DIAGINDEX) (GB_TYPE *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (GB_TYPE) (((int64_t) j) - (((int64_t) i) + (*y))) ; } GB_IDXOP_STRUCT (FLIPDIAGINDEX, GB_XTYPE) ; inline void GB_FUNC (FLIPDIAGINDEX) (GB_TYPE *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (GB_TYPE) (((int64_t) i) - (((int64_t) j) + (*y))) ; } @@ -1105,56 +1105,56 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_IDXOP_STRUCT (TRIL, GB_XTYPE) ; inline void GB_FUNC (TRIL) (bool *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) <= (((int64_t) i) + (*y))) ; } GB_IDXOP_STRUCT (TRIU, GB_XTYPE) ; inline void GB_FUNC (TRIU) (bool *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) >= (((int64_t) i) + (*y))) ; } GB_IDXOP_STRUCT (DIAG, GB_XTYPE) ; inline void GB_FUNC (DIAG) (bool *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) == (((int64_t) i) + (*y))) ; } GB_IDXOP_STRUCT (OFFDIAG, GB_XTYPE) ; inline void GB_FUNC (OFFDIAG) (bool *z, const void *unused, - GrB_Index i, GrB_Index j, const GB_TYPE *y) + uint64_t i, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) != (((int64_t) i) + (*y))) ; } GB_IDXOP_STRUCT (COLLE, GB_XTYPE) ; inline void GB_FUNC (COLLE) (bool *z, const void *unused, - GrB_Index i_unused, GrB_Index j, const GB_TYPE *y) + uint64_t i_unused, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) <= (*y)) ; } GB_IDXOP_STRUCT (COLGT, GB_XTYPE) ; inline void GB_FUNC (COLGT) (bool *z, const void *unused, - GrB_Index i_unused, GrB_Index j, const GB_TYPE *y) + uint64_t i_unused, uint64_t j, const GB_TYPE *y) { (*z) = (((int64_t) j) > (*y)) ; } GB_IDXOP_STRUCT (ROWLE, GB_XTYPE) ; inline void GB_FUNC (ROWLE) (bool *z, const void *unused, - GrB_Index i, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i, uint64_t j_unused, const GB_TYPE *y) { (*z) = (((int64_t) i) <= (*y)) ; } GB_IDXOP_STRUCT (ROWGT, GB_XTYPE) ; inline void GB_FUNC (ROWGT) (bool *z, const void *unused, - GrB_Index i, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i, uint64_t j_unused, const GB_TYPE *y) { (*z) = (((int64_t) i) > (*y)) ; } @@ -1167,7 +1167,7 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_IDXOP_STRUCT (VALUEEQ, GB_XTYPE) ; inline void GB_FUNC (VALUEEQ) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { #if defined ( GB_FLOAT_COMPLEX ) (*z) = GB_FC32_eq (*x, *y) ; @@ -1180,7 +1180,7 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_IDXOP_STRUCT (VALUENE, GB_XTYPE) ; inline void GB_FUNC (VALUENE) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { #if defined ( GB_FLOAT_COMPLEX ) (*z) = GB_FC32_ne (*x, *y) ; @@ -1199,28 +1199,28 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_IDXOP_STRUCT (VALUELT, GB_XTYPE) ; inline void GB_FUNC (VALUELT) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { (*z) = ((*x) < (*y)) ; } GB_IDXOP_STRUCT (VALUELE, GB_XTYPE) ; inline void GB_FUNC (VALUELE) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { (*z) = ((*x) <= (*y)) ; } GB_IDXOP_STRUCT (VALUEGT, GB_XTYPE) ; inline void GB_FUNC (VALUEGT) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { (*z) = ((*x) > (*y)) ; } GB_IDXOP_STRUCT (VALUEGE, GB_XTYPE) ; inline void GB_FUNC (VALUEGE) (bool *z, const GB_TYPE *x, - GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) + uint64_t i_unused, uint64_t j_unused, const GB_TYPE *y) { (*z) = ((*x) >= (*y)) ; } @@ -1235,8 +1235,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (FIRSTI, GB_XTYPE) ; inline void GB_FUNC (FIRSTI) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = (GB_TYPE) ix ; @@ -1244,8 +1244,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (FIRSTI1, GB_XTYPE) ; inline void GB_FUNC (FIRSTI1) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = ((GB_TYPE) ix) + 1 ; @@ -1253,8 +1253,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (FIRSTJ, GB_XTYPE) ; inline void GB_FUNC (FIRSTJ) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = (GB_TYPE) jx ; @@ -1262,8 +1262,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (FIRSTJ1, GB_XTYPE) ; inline void GB_FUNC (FIRSTJ1) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = ((GB_TYPE) jx) + 1 ; @@ -1271,8 +1271,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (SECONDI, GB_XTYPE) ; inline void GB_FUNC (SECONDI) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = (GB_TYPE) iy ; @@ -1280,8 +1280,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (SECONDI1, GB_XTYPE) ; inline void GB_FUNC (SECONDI1) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = ((GB_TYPE) iy) + 1 ; @@ -1289,8 +1289,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (SECONDJ, GB_XTYPE) ; inline void GB_FUNC (SECONDJ) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = (GB_TYPE) jy ; @@ -1298,8 +1298,8 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) GB_BINOP_STRUCT (SECONDJ1, GB_XTYPE) ; inline void GB_FUNC (SECONDJ1) (GB_TYPE *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { (*z) = ((GB_TYPE) jy) + 1 ; diff --git a/GraphBLAS/Source/builtin/factory/GB_semiring_template.c b/GraphBLAS/Source/builtin/factory/GB_semiring_template.c index 55dadff19a..07fa5f471c 100644 --- a/GraphBLAS/Source/builtin/factory/GB_semiring_template.c +++ b/GraphBLAS/Source/builtin/factory/GB_semiring_template.c @@ -2,7 +2,7 @@ // GB_semiring_template.c: built-in unary and binary functions and operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/builtin/include/GB_matrix.h b/GraphBLAS/Source/builtin/include/GB_Matrix_content.h similarity index 92% rename from GraphBLAS/Source/builtin/include/GB_matrix.h rename to GraphBLAS/Source/builtin/include/GB_Matrix_content.h index 5dbf66fcbd..6bd8d270df 100644 --- a/GraphBLAS/Source/builtin/include/GB_matrix.h +++ b/GraphBLAS/Source/builtin/include/GB_Matrix_content.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_matrix.h: definitions for GrB_Matrix and GrB_Vector +// GB_Matrix_content.h: content of GrB_Matrix, GrB_Vector, and GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -219,9 +219,10 @@ int64_t nvec ; // number of non-empty vectors for hypersparse form, int64_t nvec_nonempty ; // the actual number of non-empty vectors, or -1 if // not known -int64_t *h ; // list of non-empty vectors: h_size >= 8*max(plen,1) -int64_t *p ; // pointers: p_size >= 8*(plen+1) -int64_t *i ; // indices: i_size >= 8*max(anz,1) +// A->p, A->h, and A->i can be 32 or 64 bit integers +void *h ; // non-empty vector list: h_size >= (4 or 8)*max(plen,1) +void *p ; // pointers: p_size >= (4 or 8)*(plen+1) +void *i ; // indices: i_size >= (4 or 8)*max(anz,1) void *x ; // values: x_size >= max(anz*A->type->size,1), // or x_size >= 1 if A is iso int8_t *b ; // bitmap: b_size >= max(anz,1) @@ -278,7 +279,7 @@ size_t x_size ; // exact size of A->x in bytes, zero if A->x is NULL // This can be done once, and reused for many searches: int64_t nhash = A->Y->vdim ; // # of buckets in the hash table int64_t hash_bits = nhash-1 ; - int64_t *Yp = A->Y->p ; // pointers to each hash bucket + uint64_t *Yp = A->Y->p ; // pointers to each hash bucket // Yp has size nhash+1. int64_t *Yi = A->Y->i ; // "row" indices j; Yi has size anvec. int64_t *Yx = A->Y->x ; // values k; Yx has size anvec. @@ -367,9 +368,9 @@ GB_Pending Pending ; // list of pending tuples // has been marked for deletion, but has not been deleted yet because it is // more efficient to delete all zombies all at once, rather than one (or a few) // at a time. An entry A(i,j) is marked as a zombie by 'zombifying' its index -// via GB_ZOMBIE(i). A zombie index is negative, and the actual index can be -// obtained by GB_UNZOMBIE(i). GB_ZOMBIE(i) is a function that is its own -// inverse: GB_ZOMBIE(GB_ZOMBIE(x))=x for all x. +// via GB_ZOMBIE (i). A zombie index is negative, and the actual index can be +// obtained by GB_UNZOMBIE (i). GB_ZOMBIE (i) is a function that is its own +// inverse: GB_ZOMBIE (GB_ZOMBIE (x))=x for all x. // Using zombies allows entries to be marked for deletion. Their index is // still important, for two reasons: (1) the indices in each vector of the @@ -480,8 +481,16 @@ int32_t x_memory_location ; float hyper_switch ; // controls conversion hyper to/from sparse float bitmap_switch ; // controls conversion sparse to/from bitmap -int sparsity_control ; // controls sparsity structure: hypersparse, - // sparse, bitmap, or full, or any combination. + +// the remaining content of this struct is 17 bytes + +// 5 bytes: +int8_t sparsity_control ; // controls sparsity structure: hypersparse, + // sparse, bitmap, or full, or any combination. +uint8_t p_control ; // controls 32/64 settings for A->p +uint8_t j_control ; // controls 32/64 settings for A->h and A->Y->[pix] +uint8_t i_control ; // controls 32/64 settings for A->i +bool no_hyper_hash ; // if true, disable the Y hyper_hash matrix //------------------------------------------------------------------------------ // shallow matrices @@ -498,24 +507,23 @@ int sparsity_control ; // controls sparsity structure: hypersparse, // object is a pointer into components of another object. They must not // be freed when freeing this object. +// 6 bytes bool p_shallow ; // true if p is a shallow copy bool h_shallow ; // true if h is a shallow copy bool b_shallow ; // true if b is a shallow copy bool i_shallow ; // true if i is a shallow copy bool x_shallow ; // true if x is a shallow copy bool Y_shallow ; // true if Y is a shallow matrix -bool no_hyper_hash ; // if true, disable the Y hyper_hash matrix -bool static_header ; // true if this struct is statically allocated //------------------------------------------------------------------------------ // other bool content //------------------------------------------------------------------------------ +// 2 bytes: bool is_csc ; // true if stored by column, false if by row bool jumbled ; // true if the matrix may be jumbled. bitmap and full // matrices are never jumbled. - //------------------------------------------------------------------------------ // iso matrices //------------------------------------------------------------------------------ @@ -538,7 +546,20 @@ bool jumbled ; // true if the matrix may be jumbled. bitmap and full // If A is full, A->x is the only component present, and thus a full iso matrix // takes only O(1) memory, regardless of its dimension. -bool iso ; // true if all entries have the same value +// 1 bytes: +bool iso ; // true if all entries have the same value and only a + // single entry is stored in A->x + +//------------------------------------------------------------------------------ +// integer sizes +//------------------------------------------------------------------------------ + +// A->p, A->h, and A->i can be either 32-bit or 64-bit integers. + +// 3 bytes: +bool p_is_32 ; // true if A->p is 32-bit, false if 64 +bool j_is_32 ; // true if A->h and A->Y->[pix] are 32-bit, false if 64 +bool i_is_32 ; // true if A->i is 32-bit, false if 64 //------------------------------------------------------------------------------ // iterating through a matrix @@ -551,13 +572,6 @@ bool iso ; // true if all entries have the same value #ifdef for_comments_only // only so vim will add color to the code below: -// for reference: -#define GBI(Ai,p,avlen) ((Ai == NULL) ? ((p) % (avlen)) : Ai [p]) -#define GBB(Ab,p) ((Ab == NULL) ? 1 : Ab [p]) -#define GBP(Ap,k,avlen) ((Ap == NULL) ? ((k) * (avlen)) : Ap [k]) -#define GBH(Ah,k) ((Ah == NULL) ? (k) : Ah [k]) -#define GBX(Ax,p,A_iso) (Ax [(A_iso) ? 0 : (p)]) - // A->vdim: the vector dimension of A (ncols(A)) // A->nvec: # of vectors that appear in A. For the hypersparse case, // these are the number of column indices in Ah [0..nvec-1], since @@ -577,7 +591,7 @@ bool iso ; // true if all entries have the same value { // entry A(i,j) with row index i and value aij int64_t i = (p % vlen) ; - double aij = GBX (Ax, p, A->iso) ; + double aij = Ax [A->iso ? 0 : p] ; } } @@ -597,7 +611,7 @@ bool iso ; // true if all entries have the same value { // entry A(i,j) with row index i and value aij int64_t i = (p % vlen) ; - double aij = GBX (Ax, p, A->iso) ; + double aij = Ax [A->iso ? 0 : p] ; } else { @@ -619,7 +633,7 @@ bool iso ; // true if all entries have the same value { // entry A(i,j) with row index i and value aij int64_t i = Ai [p] ; - double aij = GBX (Ax, p, A->iso) ; + double aij = Ax [A->iso ? 0 : p] ; } } @@ -636,13 +650,19 @@ bool iso ; // true if all entries have the same value { // entry A(i,j) with row index i and value aij int64_t i = Ai [p] ; - double aij = GBX (Ax, p, A->iso) ; + double aij = Ax [A->iso ? 0 : p] ; } } //-------------------- // generic: for any matrix + // for reference: + #define GBI(Ai,p,avlen) ((Ai == NULL) ? ((p) % (avlen)) : Ai [p]) + #define GBB(Ab,p) ((Ab == NULL) ? 1 : Ab [p]) + #define GBP(Ap,k,avlen) ((Ap == NULL) ? ((k) * (avlen)) : Ap [k]) + #define GBH(Ah,k) ((Ah == NULL) ? (k) : Ah [k]) + int64_t vlen = A->vlen ; for (k = 0 ; k < A->nvec ; k++) { @@ -655,7 +675,7 @@ bool iso ; // true if all entries have the same value if (!GBB (Ab, p)) continue ; // entry A(i,j) with row index i and value aij int64_t i = GBI (Ai, p, vlen) ; - double aij = GBX (Ax, p, A->iso) ; + double aij = Ax [A->iso ? 0 : p] ; } } diff --git a/GraphBLAS/Source/builtin/include/GB_Operator.h b/GraphBLAS/Source/builtin/include/GB_Operator_content.h similarity index 94% rename from GraphBLAS/Source/builtin/include/GB_Operator.h rename to GraphBLAS/Source/builtin/include/GB_Operator_content.h index 7436310b2b..17f112277a 100644 --- a/GraphBLAS/Source/builtin/include/GB_Operator.h +++ b/GraphBLAS/Source/builtin/include/GB_Operator_content.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_Operator.h: definitions of all operator objects +// GB_Operator_content.h: content of all operator objects //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/builtin/include/GB_opaque.h b/GraphBLAS/Source/builtin/include/GB_opaque.h index d7968894d0..160503c1c2 100644 --- a/GraphBLAS/Source/builtin/include/GB_opaque.h +++ b/GraphBLAS/Source/builtin/include/GB_opaque.h @@ -2,7 +2,7 @@ // GB_opaque.h: definitions of opaque objects //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -378,32 +378,32 @@ struct GB_Type_opaque // content of GrB_Type struct GB_UnaryOp_opaque // content of GrB_UnaryOp { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; struct GB_IndexUnaryOp_opaque // content of GrB_IndexUnaryOp { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; struct GB_BinaryOp_opaque // content of GrB_BinaryOp { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; struct GB_IndexBinaryOp_opaque // content of GxB_IndexBinaryOp { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; struct GB_SelectOp_opaque // content of GxB_SelectOp { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; struct GB_Operator_opaque // content of GB_Operator { - #include "include/GB_Operator.h" + #include "include/GB_Operator_content.h" } ; // Any GrB_UnaryOp, GrB_IndexUnaryOp, GrB_BinaryOp, or GxB_SelectOp can be @@ -464,6 +464,9 @@ struct GB_Descriptor_opaque // content of GrB_Descriptor int compression ; // compression method for GxB_Matrix_serialize bool do_sort ; // if nonzero, do the sort in GrB_mxm int import ; // if zero (default), trust input data + int row_list ; // how to use the row index list, I + int col_list ; // how to use the col index list, J + int val_list ; // how to use the value list, X } ; struct GB_Context_opaque // content of GxB_Context @@ -487,7 +490,8 @@ struct GB_Context_opaque // content of GxB_Context //------------------------------------------------------------------------------ // Pending tuples are a list of unsorted (i,j,x) tuples that have not yet been -// added to a matrix. The data structure is defined in GB_Pending.h. +// added to a matrix. The indices Pending->i and Pending->j are 32/64 bit, as +// determined by A->i_is_32 and A->j_is_32, respectively. struct GB_Pending_struct // list of pending tuples for a matrix { @@ -495,9 +499,9 @@ struct GB_Pending_struct // list of pending tuples for a matrix int64_t n ; // number of pending tuples to add to matrix int64_t nmax ; // size of i,j,x bool sorted ; // true if pending tuples are in sorted order - int64_t *i ; // row indices of pending tuples + void *i ; // row indices of pending tuples size_t i_size ; - int64_t *j ; // col indices of pending tuples; NULL if A->vdim <= 1 + void *j ; // col indices of pending tuples; NULL if A->vdim <= 1 size_t j_size ; GB_void *x ; // values of pending tuples size_t x_size ; @@ -528,86 +532,476 @@ typedef struct GB_Pending_struct *GB_Pending ; struct GB_Scalar_opaque // content of GrB_Scalar: 1-by-1 standard CSC matrix { - #include "include/GB_matrix.h" + #include "include/GB_Matrix_content.h" } ; struct GB_Vector_opaque // content of GrB_Vector: m-by-1 standard CSC matrix { - #include "include/GB_matrix.h" + #include "include/GB_Matrix_content.h" } ; struct GB_Matrix_opaque // content of GrB_Matrix { - #include "include/GB_matrix.h" + #include "include/GB_Matrix_content.h" } ; //------------------------------------------------------------------------------ // Accessing the content of a scalar, vector, or matrix //------------------------------------------------------------------------------ -#define GBP(Ap,k,avlen) ((Ap == NULL) ? ((k) * (avlen)) : Ap [k]) -#define GBH(Ah,k) ((Ah == NULL) ? (k) : Ah [k]) -#define GBI(Ai,p,avlen) ((Ai == NULL) ? ((p) % (avlen)) : Ai [p]) -#define GBB(Ab,p) ((Ab == NULL) ? 1 : Ab [p]) -#define GBX(Ax,p,A_iso) (Ax [(A_iso) ? 0 : (p)]) - -// these macros are redefined by the JIT kernels: - -// accessing the C matrix -#define GBP_C(Cp,k,vlen) GBP (Cp,k,vlen) -#define GBH_C(Ch,k) GBH (Ch,k) -#define GBI_C(Ci,p,vlen) GBI (Ci,p,vlen) -#define GBB_C(Cb,p) GBB (Cb,p) -#define GB_C_NVALS(e) int64_t e = GB_nnz (C) -#define GB_C_NHELD(e) int64_t e = GB_nnz_held (C) - -// accessing the M matrix -#define GBP_M(Mp,k,vlen) GBP (Mp,k,vlen) -#define GBH_M(Mh,k) GBH (Mh,k) -#define GBI_M(Mi,p,vlen) GBI (Mi,p,vlen) -#define GBB_M(Mb,p) GBB (Mb,p) -#define GB_M_NVALS(e) int64_t e = GB_nnz (M) -#define GB_M_NHELD(e) int64_t e = GB_nnz_held (M) - -// accessing the A matrix -#define GBP_A(Ap,k,vlen) GBP (Ap,k,vlen) -#define GBH_A(Ah,k) GBH (Ah,k) -#define GBI_A(Ai,p,vlen) GBI (Ai,p,vlen) -#define GBB_A(Ab,p) GBB (Ab,p) -#define GB_A_NVALS(e) int64_t e = GB_nnz (A) -#define GB_A_NHELD(e) int64_t e = GB_nnz_held (A) - -// accessing the B matrix -#define GBP_B(Bp,k,vlen) GBP (Bp,k,vlen) -#define GBH_B(Bh,k) GBH (Bh,k) -#define GBI_B(Bi,p,vlen) GBI (Bi,p,vlen) -#define GBB_B(Bb,p) GBB (Bb,p) -#define GB_B_NVALS(e) int64_t e = GB_nnz (B) -#define GB_B_NHELD(e) int64_t e = GB_nnz_held (B) - -// accessing the S matrix -#define GBP_S(Sp,k,vlen) GBP (Sp,k,vlen) -#define GBH_S(Sh,k) GBH (Sh,k) -#define GBI_S(Si,p,vlen) GBI (Si,p,vlen) -#define GBB_S(Sb,p) GBB (Sb,p) -#define GB_S_NVALS(e) int64_t e = GB_nnz (S) -#define GB_S_NHELD(e) int64_t e = GB_nnz_held (S) - -// accessing the R matrix -#define GBP_R(Rp,k,vlen) GBP (Rp,k,vlen) -#define GBH_R(Rh,k) GBH (Rh,k) -#define GBI_R(Ri,p,vlen) GBI (Ri,p,vlen) -#define GBB_R(Rb,p) GBB (Rb,p) -#define GB_R_NVALS(e) int64_t e = GB_nnz (R) -#define GB_R_NHELD(e) int64_t e = GB_nnz_held (R) - -// accessing the Z matrix -#define GBP_Z(Zp,k,vlen) GBP (Zp,k,vlen) -#define GBH_Z(Zh,k) GBH (Zh,k) -#define GBI_Z(Zi,p,vlen) GBI (Zi,p,vlen) -#define GBB_Z(Zb,p) GBB (Zb,p) -#define GB_Z_NVALS(e) int64_t e = GB_nnz (Z) -#define GB_Z_NHELD(e) int64_t e = GB_nnz_held (Z) +// A GrB_Matrix has three different types of integers: +// +// (1) A->p can be uint32_t or uint64_t, as determined by A->p_is_32. +// +// (2) These types are all determined by A->i_is_32: +// A->i can be int32_t or int64_t (signed, for flagging zombies: default) +// A->i can be uint32_t or uint64_t (unsigned, if no zombies appear) +// +// (3) These types are all determined by A->j_is_32: +// A->h can be uint32_t or uint64_t +// A->Y->p can be uint32_t or uint64_t +// A->Y->i can be uint32_t or uint64_t (never has zombies) +// A->Y->x can be uint32_t or uint64_t + +// For examples on how these macros expand, see Source/math/include/GB_zombie.h. + +// helper macro: declare a 32/64-bit integer array I +#define GB_MDECL(I,const,u) \ + const void *I = NULL ; \ + const u ## int32_t *restrict I ## 32 = NULL ; \ + const u ## int64_t *restrict I ## 64 = NULL + +// assign to a type-specific pointer from a void pointer, 32/64 bit +#define GB_IPTR(I,is_32) \ + I ## 32 = (is_32) ? I : NULL ; \ + I ## 64 = (is_32) ? NULL : I + +// general method for getting an entry from the Ah array of a matrix; used for +// generic kernels, and JIT kernels for hyperlist arrays created inside the +// kernel (assign JIT kernels only) +#define GBh(Ah,k) \ + ((Ah ## 32) ? Ah ## 32 [k] : \ + ((Ah ## 64) ? Ah ## 64 [k] : \ + (k))) + +#ifndef GB_JIT_KERNEL + + //-------------------------------------------------------------------------- + // for mainline, Factory, and generic kernels + //-------------------------------------------------------------------------- + + // GB_IGET: get I [k] for a 32/64-bit integer array I + #define GB_IGET(I,k) (I ## 32 ? I ## 32 [k] : I ## 64 [k]) + + // GB_ISET: set I [k] for a 32/64-bit integer array I + #define GB_ISET(I,k,i) \ + { if (I ## 64) { I ## 64 [k] = (i) ; } else { I ## 32 [k] = (i) ; } } + + // GB_IINC: increment I [k] for a 32/64-bit integer array I + #define GB_IINC(I,k,i) \ + { if (I ## 64) { I ## 64 [k] += (i) ; } else { I ## 32 [k] += (i) ; } } + + // GB_IADDR: &(I [k]) for a 32/64-bit integer array I + #define GB_IADDR(I,k) (I ## 32 ? \ + ((void *) (I ## 32 + k)) : \ + ((void *) (I ## 64 + k))) + + // helper macro: declare a 32/64-bit integer array I + #define GB_IDECL(I,const,u) \ + const u ## int32_t *restrict I ## 32 = NULL ; \ + const u ## int64_t *restrict I ## 64 = NULL + + // helper macro: get a 32/64-bit pointer from a matrix + #define GB_GET_MATRIX_PTR(I,A,is_32,component) \ + I = (A) ? A->component : NULL ; \ + I ## 32 = (A) ? (A->is_32 ? I : NULL) : NULL ; \ + I ## 64 = (A) ? (A->is_32 ? NULL : I) : NULL + + // helper macro: get a 32/64-bit pointer from a matrix hyper_hash. The + // integer types of A->Y->[pix] are defined by A->j_is_32. + #define GB_GET_HYPER_PTR(I,A,pix) \ + I = (A && A->Y) ? A->Y->pix : NULL ; \ + I ## 32 = (A && A->Y) ? (A->j_is_32 ? A->Y->pix : NULL) : NULL ; \ + I ## 64 = (A && A->Y) ? (A->j_is_32 ? NULL : A->Y->pix) : NULL + + // helper macros: get 32/64-bit pointers from a matrix Pending object. The + // integer types of A->Pending->[ij] are defined by A->i_is_32 and + // A->j_is_32, respectively. A->Pending must be non-NULL. + #define GB_GET_PENDINGi_PTR(I,A) \ + I = A->Pending->i ; \ + I ## 32 = (A->i_is_32 ? A->Pending->i : NULL) ; \ + I ## 64 = (A->i_is_32 ? NULL : A->Pending->i) + #define GB_GET_PENDINGj_PTR(I,A) \ + I = A->Pending->j ; \ + I ## 32 = (A->j_is_32 ? A->Pending->j : NULL) ; \ + I ## 64 = (A->j_is_32 ? NULL : A->Pending->j) + + // general method for getting an entry from the Ap array of a matrix + #define GBp(Ap,k,vlen) \ + ((Ap ## 32) ? Ap ## 32 [k] : \ + ((Ap ## 64) ? Ap ## 64 [k] : \ + ((k) * (vlen)))) + + // general method for getting an entry from the Ai array of a matrix + #define GBi(Ai,p,vlen) \ + ((Ai ## 32) ? Ai ## 32 [p] : \ + ((Ai ## 64) ? Ai ## 64 [p] : \ + ((p) % (vlen)))) + + // general method for getting an entry from the Ab array of a matrix + #define GBb(Ab,p) ((Ab) ? Ab [p] : 1) + + // for declaring pointers for specific matrices (C, M, A, B, S, R, Z): + + // C matrix: + #define GB_Cp_DECLARE(Cp,const) GB_MDECL (Cp, const, u) + #define GB_Ch_DECLARE(Ch,const) GB_MDECL (Ch, const, u) + #define GB_Ci_DECLARE(Ci,const) GB_MDECL (Ci, const, ) + #define GB_Ci_DECLARE_U(Ci,const) GB_MDECL (Ci, const, u) + #define GB_CYp_DECLARE(C_Yp,const) GB_MDECL (C_Yp, const, u) + #define GB_CYi_DECLARE(C_Yi,const) GB_MDECL (C_Yi, const, u) + #define GB_CYx_DECLARE(C_Yx,const) GB_MDECL (C_Yx, const, u) + #define GB_CPendingi_DECLARE(Pending_i) GB_MDECL (Pending_i, , u) + #define GB_CPendingj_DECLARE(Pending_j) GB_MDECL (Pending_j, , u) + + // M matrix: + #define GB_Mp_DECLARE(Mp,const) GB_MDECL (Mp, const, u) + #define GB_Mh_DECLARE(Mh,const) GB_MDECL (Mh, const, u) + #define GB_Mi_DECLARE(Mi,const) GB_MDECL (Mi, const, ) + #define GB_Mi_DECLARE_U(Mi,const) GB_MDECL (Mi, const, u) + #define GB_MYp_DECLARE(M_Yp,const) GB_MDECL (M_Yp, const, u) + #define GB_MYi_DECLARE(M_Yi,const) GB_MDECL (M_Yi, const, u) + #define GB_MYx_DECLARE(M_Yx,const) GB_MDECL (M_Yx, const, u) + + // A matrix: + #define GB_Ap_DECLARE(Ap,const) GB_MDECL (Ap, const, u) + #define GB_Ah_DECLARE(Ah,const) GB_MDECL (Ah, const, u) + #define GB_Ai_DECLARE(Ai,const) GB_MDECL (Ai, const, ) + #define GB_Ai_DECLARE_U(Ai,const) GB_MDECL (Ai, const, u) + #define GB_AYp_DECLARE(A_Yp,const) GB_MDECL (A_Yp, const, u) + #define GB_AYi_DECLARE(A_Yi,const) GB_MDECL (A_Yi, const, u) + #define GB_AYx_DECLARE(A_Yx,const) GB_MDECL (A_Yx, const, u) + + // B matrix: + #define GB_Bp_DECLARE(Bp,const) GB_MDECL (Bp, const, u) + #define GB_Bh_DECLARE(Bh,const) GB_MDECL (Bh, const, u) + #define GB_Bi_DECLARE(Bi,const) GB_MDECL (Bi, const, ) + #define GB_Bi_DECLARE_U(Bi,const) GB_MDECL (Bi, const, u) + #define GB_BYp_DECLARE(B_Yp,const) GB_MDECL (B_Yp, const, u) + #define GB_BYi_DECLARE(B_Yi,const) GB_MDECL (B_Yi, const, u) + #define GB_BYx_DECLARE(B_Yx,const) GB_MDECL (B_Yx, const, u) + + // S matrix: + #define GB_Sp_DECLARE(Sp,const) GB_MDECL (Sp, const, u) + #define GB_Sh_DECLARE(Sh,const) GB_MDECL (Sh, const, u) + #define GB_Si_DECLARE(Si,const) GB_MDECL (Si, const, ) + #define GB_Si_DECLARE_U(Si,const) GB_MDECL (Si, const, u) + #define GB_SYp_DECLARE(S_Yp,const) GB_MDECL (S_Yp, const, u) + #define GB_SYi_DECLARE(S_Yi,const) GB_MDECL (S_Yi, const, u) + #define GB_SYx_DECLARE(S_Yx,const) GB_MDECL (S_Yx, const, u) + + // R matrix: + #define GB_Rp_DECLARE(Rp,const) GB_MDECL (Rp, const, u) + #define GB_Rh_DECLARE(Rh,const) GB_MDECL (Rh, const, u) + #define GB_Ri_DECLARE(Ri,const) GB_MDECL (Ri, const, ) + #define GB_Ri_DECLARE_U(Ri,const) GB_MDECL (Ri, const, u) + + // Z matrix: + #define GB_Zp_DECLARE(Zp,const) GB_MDECL (Zp, const, u) + #define GB_Zh_DECLARE(Zh,const) GB_MDECL (Zh, const, u) + #define GB_Zi_DECLARE(Zi,const) GB_MDECL (Zi, const, ) + #define GB_Zi_DECLARE_U(Zi,const) GB_MDECL (Zi, const, u) + + // for getting pointers from specific matrices: + + // C matrix: + #define GB_Cp_PTR(Cp,C) GB_GET_MATRIX_PTR (Cp, C, p_is_32, p) + #define GB_Ch_PTR(Ch,C) GB_GET_MATRIX_PTR (Ch, C, j_is_32, h) + #define GB_Ci_PTR(Ci,C) GB_GET_MATRIX_PTR (Ci, C, i_is_32, i) + #define GB_CYp_PTR(C_Yp,C) GB_GET_HYPER_PTR (C_Yp, C, p) + #define GB_CYi_PTR(C_Yi,C) GB_GET_HYPER_PTR (C_Yi, C, i) + #define GB_CYx_PTR(C_Yx,C) GB_GET_HYPER_PTR (C_Yx, C, x) + #define GB_CPendingi_PTR(Pending_i,C) GB_GET_PENDINGi_PTR (Pending_i, C) + #define GB_CPendingj_PTR(Pending_j,C) GB_GET_PENDINGj_PTR (Pending_j, C) + + // M matrix: + #define GB_Mp_PTR(Mp,M) GB_GET_MATRIX_PTR (Mp, M, p_is_32, p) + #define GB_Mh_PTR(Mh,M) GB_GET_MATRIX_PTR (Mh, M, j_is_32, h) + #define GB_Mi_PTR(Mi,M) GB_GET_MATRIX_PTR (Mi, M, i_is_32, i) + #define GB_MYp_PTR(M_Yp,M) GB_GET_HYPER_PTR (M_Yp, M, p) + #define GB_MYi_PTR(M_Yi,M) GB_GET_HYPER_PTR (M_Yi, M, i) + #define GB_MYx_PTR(M_Yx,M) GB_GET_HYPER_PTR (M_Yx, M, x) + + // A matrix: + #define GB_Ap_PTR(Ap,A) GB_GET_MATRIX_PTR (Ap, A, p_is_32, p) + #define GB_Ah_PTR(Ah,A) GB_GET_MATRIX_PTR (Ah, A, j_is_32, h) + #define GB_Ai_PTR(Ai,A) GB_GET_MATRIX_PTR (Ai, A, i_is_32, i) + #define GB_AYp_PTR(A_Yp,A) GB_GET_HYPER_PTR (A_Yp, A, p) + #define GB_AYi_PTR(A_Yi,A) GB_GET_HYPER_PTR (A_Yi, A, i) + #define GB_AYx_PTR(A_Yx,A) GB_GET_HYPER_PTR (A_Yx, A, x) + + // B matrix: + #define GB_Bp_PTR(Bp,B) GB_GET_MATRIX_PTR (Bp, B, p_is_32, p) + #define GB_Bh_PTR(Bh,B) GB_GET_MATRIX_PTR (Bh, B, j_is_32, h) + #define GB_Bi_PTR(Bi,B) GB_GET_MATRIX_PTR (Bi, B, i_is_32, i) + #define GB_BYp_PTR(B_Yp,B) GB_GET_HYPER_PTR (B_Yp, B, p) + #define GB_BYi_PTR(B_Yi,B) GB_GET_HYPER_PTR (B_Yi, B, i) + #define GB_BYx_PTR(B_Yx,B) GB_GET_HYPER_PTR (B_Yx, B, x) + + // S matrix: + #define GB_Sp_PTR(Sp,S) GB_GET_MATRIX_PTR (Sp, S, p_is_32, p) + #define GB_Sh_PTR(Sh,S) GB_GET_MATRIX_PTR (Sh, S, j_is_32, h) + #define GB_Si_PTR(Si,S) GB_GET_MATRIX_PTR (Si, S, i_is_32, i) + #define GB_SYp_PTR(S_Yp,S) GB_GET_HYPER_PTR (S_Yp, S, p) + #define GB_SYi_PTR(S_Yi,S) GB_GET_HYPER_PTR (S_Yi, S, i) + #define GB_SYx_PTR(S_Yx,S) GB_GET_HYPER_PTR (S_Yx, S, x) + + // R matrix: + #define GB_Rp_PTR(Rp,R) GB_GET_MATRIX_PTR (Rp, R, p_is_32, p) + #define GB_Rh_PTR(Rh,R) GB_GET_MATRIX_PTR (Rh, R, j_is_32, h) + #define GB_Ri_PTR(Ri,R) GB_GET_MATRIX_PTR (Ri, R, i_is_32, i) + + // Z matrix: + #define GB_Zp_PTR(Zp,Z) GB_GET_MATRIX_PTR (Zp, Z, p_is_32, p) + #define GB_Zh_PTR(Zh,Z) GB_GET_MATRIX_PTR (Zh, Z, j_is_32, h) + #define GB_Zi_PTR(Zi,Z) GB_GET_MATRIX_PTR (Zi, Z, i_is_32, i) + + // for getting entries from Ap, Ah, Ai for specific matrices: + + // C matrix: + #define GBp_C(Cp,k,vlen) GBp (Cp, k, vlen) + #define GBh_C(Ch,k) GBh (Ch, k) + #define GBi_C(Ci,p,vlen) GBi (Ci, p, vlen) + #define GBb_C(Cb,p) GBb (Cb, p) + #define GB_C_NVALS(e) int64_t e = GB_nnz (C) + #define GB_C_NHELD(e) int64_t e = GB_nnz_held (C) + + // M matrix: + #define GBp_M(Mp,k,vlen) GBp (Mp, k, vlen) + #define GBh_M(Mh,k) GBh (Mh, k) + #define GBi_M(Mi,p,vlen) GBi (Mi, p, vlen) + #define GBb_M(Mb,p) GBb (Mb, p) + #define GB_M_NVALS(e) int64_t e = GB_nnz (M) + #define GB_M_NHELD(e) int64_t e = GB_nnz_held (M) + + // A matrix: + #define GBp_A(Ap,k,vlen) GBp (Ap, k, vlen) + #define GBh_A(Ah,k) GBh (Ah, k) + #define GBi_A(Ai,p,vlen) GBi (Ai, p, vlen) + #define GBb_A(Ab,p) GBb (Ab, p) + #define GB_A_NVALS(e) int64_t e = GB_nnz (A) + #define GB_A_NHELD(e) int64_t e = GB_nnz_held (A) + + // B matrix: + #define GBp_B(Bp,k,vlen) GBp (Bp, k, vlen) + #define GBh_B(Bh,k) GBh (Bh, k) + #define GBi_B(Bi,p,vlen) GBi (Bi, p, vlen) + #define GBb_B(Bb,p) GBb (Bb, p) + #define GB_B_NVALS(e) int64_t e = GB_nnz (B) + #define GB_B_NHELD(e) int64_t e = GB_nnz_held (B) + + // S matrix: + #define GBp_S(Sp,k,vlen) GBp (Sp, k, vlen) + #define GBh_S(Sh,k) GBh (Sh, k) + #define GBi_S(Si,p,vlen) GBi (Si, p, vlen) + #define GBb_S(Sb,p) GBb (Sb, p) + #define GB_S_NVALS(e) int64_t e = GB_nnz (S) + #define GB_S_NHELD(e) int64_t e = GB_nnz_held (S) + + // R matrix: + #define GBp_R(Rp,k,vlen) GBp (Rp, k, vlen) + #define GBh_R(Rh,k) GBh (Rh, k) + #define GBi_R(Ri,p,vlen) GBi (Ri, p, vlen) + #define GBb_R(Rb,p) GBb (Rb, p) + #define GB_R_NVALS(e) int64_t e = GB_nnz (R) + #define GB_R_NHELD(e) int64_t e = GB_nnz_held (R) + + // Z matrix: + #define GBp_Z(Zp,k,vlen) GBp (Zp, k, vlen) + #define GBh_Z(Zh,k) GBh (Zh, k) + #define GBi_Z(Zi,p,vlen) GBi (Zi, p, vlen) + #define GBb_Z(Zb,p) GBb (Zb, p) + #define GB_Z_NVALS(e) int64_t e = GB_nnz (Z) + #define GB_Z_NHELD(e) int64_t e = GB_nnz_held (Z) + +#else + + //-------------------------------------------------------------------------- + // for JIT and PreJIT kernels + //-------------------------------------------------------------------------- + + // The JIT kernels only need to define GB_Ap_BITS, GB_Aj_BITS, and + // GB_Ai_BITS for each matrix, as 32 or 64. + + // GB_IGET: get I [k] for a 32/64-bit integer array I + #define GB_IGET(I,k) I [k] + + // GB_ISET: set I [k] for a 32/64-bit integer array I + #define GB_ISET(I,k,i) I [k] = (i) + + // GB_IINC: increment I [k] for a 32/64-bit integer array I + #define GB_IINC(I,k,i) I [k] += (i) + + // JIT helper macro + #ifdef GB_CUDA_KERNEL + #define GB_JDECL(I,const,u,bits) \ + const GB_EVAL4 (u,int,bits,_t) *__restrict__ I = NULL + #else + #define GB_JDECL(I,const,u,bits) \ + const GB_EVAL4 (u,int,bits,_t) *restrict I = NULL + #endif + + // helper macro: get a 32/64-bit pointer from a matrix + #define GB_GET_MATRIX_PTR(I,A,component) \ + I = (A) ? (A->component) : NULL + + // helper macro: get a 32/64-bit pointer from a matrix hyper_hash. + #define GB_GET_HYPER_PTR(I,A,component) \ + I = (A && A->Y) ? (A->Y->component) : NULL + + // for declaring pointers for specific matrices: + + // C matrix: + #define GB_Cp_DECLARE(Cp,const) GB_JDECL (Cp, const, u, GB_Cp_BITS) + #define GB_Ch_DECLARE(Ch,const) GB_JDECL (Ch, const, u, GB_Cj_BITS) + #define GB_Ci_DECLARE(Ci,const) GB_JDECL (Ci, const, , GB_Ci_BITS) + #define GB_Ci_DECLARE_U(Ci,const) GB_JDECL (Ci, const, u, GB_Ci_BITS) + #define GB_CYp_DECLARE(C_Yp,const) GB_JDECL (C_Yp,const, u, GB_Cj_BITS) + #define GB_CYi_DECLARE(C_Yi,const) GB_JDECL (C_Yi,const, u, GB_Cj_BITS) + #define GB_CYx_DECLARE(C_Yx,const) GB_JDECL (C_Yx,const, u, GB_Cj_BITS) + #define GB_CPendingi_DECLARE(Pending_i) \ + GB_JDECL (Pending_i, , u, GB_Ci_BITS) + #define GB_CPendingj_DECLARE(Pending_j) \ + GB_JDECL (Pending_j, , u, GB_Cj_BITS) + #define GB_Cp_IS_32 (GB_Cp_BITS == 32) + #define GB_Cj_IS_32 (GB_Cj_BITS == 32) + #define GB_Ci_IS_32 (GB_Ci_BITS == 32) + + // M matrix: + #define GB_Mp_DECLARE(Mp,const) GB_JDECL (Mp, const, u, GB_Mp_BITS) + #define GB_Mh_DECLARE(Mh,const) GB_JDECL (Mh, const, u, GB_Mj_BITS) + #define GB_Mi_DECLARE(Mi,const) GB_JDECL (Mi, const, , GB_Mi_BITS) + #define GB_Mi_DECLARE_U(Mi,const) GB_JDECL (Mi, const, u, GB_Mi_BITS) + #define GB_MYp_DECLARE(M_Yp,const) GB_JDECL (M_Yp,const, u, GB_Mj_BITS) + #define GB_MYi_DECLARE(M_Yi,const) GB_JDECL (M_Yi,const, u, GB_Mj_BITS) + #define GB_MYx_DECLARE(M_Yx,const) GB_JDECL (M_Yx,const, u, GB_Mj_BITS) + #define GB_Mp_IS_32 (GB_Mp_BITS == 32) + #define GB_Mj_IS_32 (GB_Mj_BITS == 32) + #define GB_Mi_IS_32 (GB_Mi_BITS == 32) + + // A matrix: + #define GB_Ap_DECLARE(Ap,const) GB_JDECL (Ap, const, u, GB_Ap_BITS) + #define GB_Ah_DECLARE(Ah,const) GB_JDECL (Ah, const, u, GB_Aj_BITS) + #define GB_Ai_DECLARE(Ai,const) GB_JDECL (Ai, const, , GB_Ai_BITS) + #define GB_Ai_DECLARE_U(Ai,const) GB_JDECL (Ai, const, u, GB_Ai_BITS) + #define GB_AYp_DECLARE(A_Yp,const) GB_JDECL (A_Yp,const, u, GB_Aj_BITS) + #define GB_AYi_DECLARE(A_Yi,const) GB_JDECL (A_Yi,const, u, GB_Aj_BITS) + #define GB_AYx_DECLARE(A_Yx,const) GB_JDECL (A_Yx,const, u, GB_Aj_BITS) + #define GB_Ap_IS_32 (GB_Ap_BITS == 32) + #define GB_Aj_IS_32 (GB_Aj_BITS == 32) + #define GB_Ai_IS_32 (GB_Ai_BITS == 32) + + // B matrix: + #define GB_Bp_DECLARE(Bp,const) GB_JDECL (Bp, const, u, GB_Bp_BITS) + #define GB_Bh_DECLARE(Bh,const) GB_JDECL (Bh, const, u, GB_Bj_BITS) + #define GB_Bi_DECLARE(Bi,const) GB_JDECL (Bi, const, , GB_Bi_BITS) + #define GB_Bi_DECLARE_U(Bi,const) GB_JDECL (Bi, const, u, GB_Bi_BITS) + #define GB_BYp_DECLARE(B_Yp,const) GB_JDECL (B_Yp,const, u, GB_Bj_BITS) + #define GB_BYi_DECLARE(B_Yi,const) GB_JDECL (B_Yi,const, u, GB_Bj_BITS) + #define GB_BYx_DECLARE(B_Yx,const) GB_JDECL (B_Yx,const, u, GB_Bj_BITS) + #define GB_Bp_IS_32 (GB_Bp_BITS == 32) + #define GB_Bj_IS_32 (GB_Bj_BITS == 32) + #define GB_Bi_IS_32 (GB_Bi_BITS == 32) + + // S matrix: + #define GB_Sp_DECLARE(Sp,const) GB_JDECL (Sp, const, u, GB_Sp_BITS) + #define GB_Sh_DECLARE(Sh,const) GB_JDECL (Sh, const, u, GB_Sj_BITS) + #define GB_Si_DECLARE(Si,const) GB_JDECL (Si, const, , GB_Si_BITS) + #define GB_Si_DECLARE_U(Si,const) GB_JDECL (Si, const, u, GB_Si_BITS) + #define GB_SYp_DECLARE(S_Yp,const) GB_JDECL (S_Yp,const, u, GB_Sj_BITS) + #define GB_SYi_DECLARE(S_Yi,const) GB_JDECL (S_Yi,const, u, GB_Sj_BITS) + #define GB_SYx_DECLARE(S_Yx,const) GB_JDECL (S_Yx,const, u, GB_Sj_BITS) + #define GB_Sp_IS_32 (GB_Sp_BITS == 32) + #define GB_Sj_IS_32 (GB_Sj_BITS == 32) + #define GB_Si_IS_32 (GB_Si_BITS == 32) + + // R matrix: + #define GB_Rp_DECLARE(Rp,const) GB_JDECL (Rp, const, u, GB_Rp_BITS) + #define GB_Rh_DECLARE(Rh,const) GB_JDECL (Rh, const, u, GB_Rj_BITS) + #define GB_Ri_DECLARE(Ri,const) GB_JDECL (Ri, const, , GB_Ri_BITS) + #define GB_Ri_DECLARE_U(Ri,const) GB_JDECL (Ri, const, u, GB_Ri_BITS) + #define GB_Rp_IS_32 (GB_Rp_BITS == 32) + #define GB_Rj_IS_32 (GB_Rj_BITS == 32) + #define GB_Ri_IS_32 (GB_Ri_BITS == 32) + + // Z matrix: + #define GB_Zp_DECLARE(Zp,const) GB_JDECL (Zp, const, u, GB_Zp_BITS) + #define GB_Zh_DECLARE(Zh,const) GB_JDECL (Zh, const, u, GB_Zj_BITS) + #define GB_Zi_DECLARE(Zi,const) GB_JDECL (Zi, const, , GB_Zi_BITS) + #define GB_Zi_DECLARE_U(Zi,const) GB_JDECL (Zi, const, u, GB_Zi_BITS) + #define GB_Zp_IS_32 (GB_Zp_BITS == 32) + #define GB_Zj_IS_32 (GB_Zj_BITS == 32) + #define GB_Zi_IS_32 (GB_Zi_BITS == 32) + + // for getting pointers from specific matrices: + + // C matrix: + #define GB_Cp_PTR(Cp,C) GB_GET_MATRIX_PTR (Cp, C, p) + #define GB_Ch_PTR(Ch,C) GB_GET_MATRIX_PTR (Ch, C, h) + #define GB_Ci_PTR(Ci,C) GB_GET_MATRIX_PTR (Ci, C, i) + #define GB_CYp_PTR(C_Yp,C) GB_GET_HYPER_PTR (C_Yp, C, p) + #define GB_CYi_PTR(C_Yi,C) GB_GET_HYPER_PTR (C_Yi, C, i) + #define GB_CYx_PTR(C_Yx,C) GB_GET_HYPER_PTR (C_Yx, C, x) + #define GB_CPendingi_PTR(Pending_i,C) Pending_i = C->Pending->i + #define GB_CPendingj_PTR(Pending_j,C) Pending_j = C->Pending->j + + // M matrix: + #define GB_Mp_PTR(Mp,M) GB_GET_MATRIX_PTR (Mp, M, p) + #define GB_Mh_PTR(Mh,M) GB_GET_MATRIX_PTR (Mh, M, h) + #define GB_Mi_PTR(Mi,M) GB_GET_MATRIX_PTR (Mi, M, i) + #define GB_MYp_PTR(M_Yp,M) GB_GET_HYPER_PTR (M_Yp, M, p) + #define GB_MYi_PTR(M_Yi,M) GB_GET_HYPER_PTR (M_Yi, M, i) + #define GB_MYx_PTR(M_Yx,M) GB_GET_HYPER_PTR (M_Yx, M, x) + + // A matrix: + #define GB_Ap_PTR(Ap,A) GB_GET_MATRIX_PTR (Ap, A, p) + #define GB_Ah_PTR(Ah,A) GB_GET_MATRIX_PTR (Ah, A, h) + #define GB_Ai_PTR(Ai,A) GB_GET_MATRIX_PTR (Ai, A, i) + #define GB_AYp_PTR(A_Yp,A) GB_GET_HYPER_PTR (A_Yp, A, p) + #define GB_AYi_PTR(A_Yi,A) GB_GET_HYPER_PTR (A_Yi, A, i) + #define GB_AYx_PTR(A_Yx,A) GB_GET_HYPER_PTR (A_Yx, A, x) + + // B matrix: + #define GB_Bp_PTR(Bp,B) GB_GET_MATRIX_PTR (Bp, B, p) + #define GB_Bh_PTR(Bh,B) GB_GET_MATRIX_PTR (Bh, B, h) + #define GB_Bi_PTR(Bi,B) GB_GET_MATRIX_PTR (Bi, B, i) + #define GB_BYp_PTR(B_Yp,B) GB_GET_HYPER_PTR (B_Yp, B, p) + #define GB_BYi_PTR(B_Yi,B) GB_GET_HYPER_PTR (B_Yi, B, i) + #define GB_BYx_PTR(B_Yx,B) GB_GET_HYPER_PTR (B_Yx, B, x) + + // S matrix: + #define GB_Sp_PTR(Sp,S) GB_GET_MATRIX_PTR (Sp, S, p) + #define GB_Sh_PTR(Sh,S) GB_GET_MATRIX_PTR (Sh, S, h) + #define GB_Si_PTR(Si,S) GB_GET_MATRIX_PTR (Si, S, i) + #define GB_SYp_PTR(S_Yp,S) GB_GET_HYPER_PTR (S_Yp, S, p) + #define GB_SYi_PTR(S_Yi,S) GB_GET_HYPER_PTR (S_Yi, S, i) + #define GB_SYx_PTR(S_Yx,S) GB_GET_HYPER_PTR (S_Yx, S, x) + + // R matrix: + #define GB_Rp_PTR(Rp,R) GB_GET_MATRIX_PTR (Rp, R, p) + #define GB_Rh_PTR(Rh,R) GB_GET_MATRIX_PTR (Rh, R, h) + #define GB_Ri_PTR(Ri,R) GB_GET_MATRIX_PTR (Ri, R, i) + + // Z matrix: + #define GB_Zp_PTR(Zp,Z) GB_GET_MATRIX_PTR (Zp, Z, p) + #define GB_Zh_PTR(Zh,Z) GB_GET_MATRIX_PTR (Zh, Z, h) + #define GB_Zi_PTR(Zi,Z) GB_GET_MATRIX_PTR (Zi, Z, i) + + // for getting entries from Ap, Ah, Ai for specific matrices: + + // These must be #define'd in each JIT kernel, via GB_macrofy_* + +#endif #endif diff --git a/GraphBLAS/Source/callback/GB_callback.c b/GraphBLAS/Source/callback/GB_callback.c index 42c228533f..7a640615d8 100644 --- a/GraphBLAS/Source/callback/GB_callback.c +++ b/GraphBLAS/Source/callback/GB_callback.c @@ -2,7 +2,7 @@ // GB_callback.c: global callback struct for kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,15 +16,11 @@ GB_callback_struct GB_callback = .GB_bitmap_M_scatter_whole_func = GB_bitmap_M_scatter_whole, .GB_bix_alloc_func = GB_bix_alloc, .GB_ek_slice_func = GB_ek_slice, - .GB_ek_slice_merge1_func = GB_ek_slice_merge1, .GB_free_memory_func = GB_free_memory, .GB_malloc_memory_func = GB_malloc_memory, .GB_memset_func = GB_memset, - .GB_qsort_1_func = GB_qsort_1, .GB_werk_pop_func = GB_werk_pop, .GB_werk_push_func = GB_werk_push, - - // added for assign: .GB_hyper_hash_build_func = GB_hyper_hash_build, .GB_subassign_one_slice_func = GB_subassign_one_slice, .GB_add_phase0_func = GB_add_phase0, @@ -33,9 +29,7 @@ GB_callback_struct GB_callback = .GB_Pending_ensure_func = GB_Pending_ensure, .GB_subassign_08n_slice_func = GB_subassign_08n_slice, .GB_bitmap_assign_to_full_func = GB_bitmap_assign_to_full, - - // added for sort: .GB_p_slice_func = GB_p_slice, - + .GB_abort_func = GB_abort, } ; diff --git a/GraphBLAS/Source/callback/GB_callbacks.h b/GraphBLAS/Source/callback/GB_callbacks.h index bc35bc83c5..b14d661048 100644 --- a/GraphBLAS/Source/callback/GB_callbacks.h +++ b/GraphBLAS/Source/callback/GB_callbacks.h @@ -2,7 +2,7 @@ // GB_callbacks.h: prototypes for kernel callbacks //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,17 +12,13 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) ; GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) ; -GB_CALLBACK_EK_SLICE_MERGE1_PROTO (GB_ek_slice_merge1) ; GB_CALLBACK_MALLOC_MEMORY_PROTO (GB_malloc_memory) ; GB_CALLBACK_FREE_MEMORY_PROTO (GB_free_memory) ; GB_CALLBACK_MEMSET_PROTO (GB_memset) ; GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) ; -GB_CALLBACK_QSORT_1_PROTO (GB_qsort_1) ; GB_CALLBACK_WERK_PUSH_PROTO (GB_werk_push) ; GB_CALLBACK_WERK_POP_PROTO (GB_werk_pop) ; GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO (GB_bitmap_M_scatter_whole) ; - -// added for assign: GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) ; GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) ; GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ; @@ -31,8 +27,6 @@ GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO (GB_subassign_IxJ_slice) ; GB_CALLBACK_PENDING_ENSURE_PROTO (GB_Pending_ensure) ; GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) ; GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO (GB_bitmap_assign_to_full) ; - -// added for sort: GB_CALLBACK_P_SLICE_PROTO (GB_p_slice) ; #endif diff --git a/GraphBLAS/Source/callback/include/GB_callback.h b/GraphBLAS/Source/callback/include/GB_callback.h index e974fdb8da..3b31663c7a 100644 --- a/GraphBLAS/Source/callback/include/GB_callback.h +++ b/GraphBLAS/Source/callback/include/GB_callback.h @@ -2,7 +2,7 @@ // GB_callback.h: typedefs for kernel callbacks //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,15 +18,11 @@ typedef GB_CALLBACK_SAXPY3_CUMSUM_PROTO ((*GB_AxB_saxpy3_cumsum_f)) ; typedef GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO ((*GB_bitmap_M_scatter_whole_f)) ; typedef GB_CALLBACK_BIX_ALLOC_PROTO ((*GB_bix_alloc_f)) ; typedef GB_CALLBACK_EK_SLICE_PROTO ((*GB_ek_slice_f)) ; -typedef GB_CALLBACK_EK_SLICE_MERGE1_PROTO ((*GB_ek_slice_merge1_f)) ; typedef GB_CALLBACK_FREE_MEMORY_PROTO ((*GB_free_memory_f)) ; typedef GB_CALLBACK_MALLOC_MEMORY_PROTO ((*GB_malloc_memory_f)) ; typedef GB_CALLBACK_MEMSET_PROTO ((*GB_memset_f)) ; -typedef GB_CALLBACK_QSORT_1_PROTO ((*GB_qsort_1_f)) ; typedef GB_CALLBACK_WERK_POP_PROTO ((*GB_werk_pop_f)) ; typedef GB_CALLBACK_WERK_PUSH_PROTO ((*GB_werk_push_f)) ; - -// added for assign: typedef GB_CALLBACK_HYPER_HASH_BUILD_PROTO ((*GB_hyper_hash_build_f)) ; typedef GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO ((*GB_subassign_one_slice_f)) ; typedef GB_CALLBACK_ADD_PHASE0_PROTO ((*GB_add_phase0_f)) ; @@ -34,9 +30,7 @@ typedef GB_CALLBACK_EWISE_SLICE_PROTO ((*GB_ewise_slice_f)) ; typedef GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO ((*GB_subassign_IxJ_slice_f)) ; typedef GB_CALLBACK_PENDING_ENSURE_PROTO ((*GB_Pending_ensure_f)) ; typedef GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO ((*GB_subassign_08n_slice_f)) ; -typedef GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO ((*GB_bitmap_assign_to_full_f)) ; - -// added for sort: +typedef GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO ((*GB_bitmap_assign_to_full_f)); typedef GB_CALLBACK_P_SLICE_PROTO ((*GB_p_slice_f)) ; //------------------------------------------------------------------------------ @@ -49,15 +43,11 @@ typedef struct GB_bitmap_M_scatter_whole_f GB_bitmap_M_scatter_whole_func ; GB_bix_alloc_f GB_bix_alloc_func ; GB_ek_slice_f GB_ek_slice_func ; - GB_ek_slice_merge1_f GB_ek_slice_merge1_func ; GB_free_memory_f GB_free_memory_func ; GB_malloc_memory_f GB_malloc_memory_func ; GB_memset_f GB_memset_func ; - GB_qsort_1_f GB_qsort_1_func ; GB_werk_pop_f GB_werk_pop_func ; GB_werk_push_f GB_werk_push_func ; - - // added for assign: GB_hyper_hash_build_f GB_hyper_hash_build_func ; GB_subassign_one_slice_f GB_subassign_one_slice_func ; GB_add_phase0_f GB_add_phase0_func ; @@ -66,9 +56,8 @@ typedef struct GB_Pending_ensure_f GB_Pending_ensure_func ; GB_subassign_08n_slice_f GB_subassign_08n_slice_func ; GB_bitmap_assign_to_full_f GB_bitmap_assign_to_full_func ; - - // added for sort: GB_p_slice_f GB_p_slice_func ; + GB_abort_f GB_abort_func ; } GB_callback_struct ; diff --git a/GraphBLAS/Source/callback/include/GB_callback_proto.h b/GraphBLAS/Source/callback/include/GB_callback_proto.h index ed1aa1ddcb..9b3e732f64 100644 --- a/GraphBLAS/Source/callback/include/GB_callback_proto.h +++ b/GraphBLAS/Source/callback/include/GB_callback_proto.h @@ -2,7 +2,7 @@ // GB_callback_proto.h: prototypes for functions for kernel callbacks //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ #define GB_CALLBACK_PROTO_H #define GB_CALLBACK_SAXPY3_CUMSUM_PROTO(GX_AxB_saxpy3_cumsum) \ -void GX_AxB_saxpy3_cumsum \ +GrB_Info GX_AxB_saxpy3_cumsum \ ( \ GrB_Matrix C, /* finalize C->p */ \ GB_saxpy3task_struct *SaxpyTasks, /* list of tasks, and workspace */ \ @@ -45,7 +45,7 @@ void GX_bitmap_M_scatter_whole /* scatter M into the C bitmap */ \ GrB_Info GX_bix_alloc /* allocate A->b, A->i, and A->x in a matrix */ \ ( \ GrB_Matrix A, /* matrix to allocate space for */ \ - const GrB_Index nzmax, /* number of entries the matrix can hold; */ \ + const uint64_t nzmax, /* number of entries the matrix can hold; */ \ /* ignored if A is iso and full */ \ const int sparsity, /* sparse (=hyper/auto) / bitmap / full */ \ const bool bitmap_calloc, /* if true, calloc A->b, else use malloc */ \ @@ -57,22 +57,10 @@ GrB_Info GX_bix_alloc /* allocate A->b, A->i, and A->x in a matrix */ \ void GX_ek_slice /* slice a matrix */ \ ( \ /* output: */ \ - int64_t *restrict A_ek_slicing, /* size 3*ntasks+1 */ \ + int64_t *restrict A_ek_slicing, /* size 3*A_ntasks+1 */ \ /* input: */ \ GrB_Matrix A, /* matrix to slice */ \ - int ntasks /* # of tasks */ \ -) - -#define GB_CALLBACK_EK_SLICE_MERGE1_PROTO(GX_ek_slice_merge1) \ -void GX_ek_slice_merge1 /* merge column counts for the matrix C */ \ -( \ - /* input/output: */ \ - int64_t *restrict Cp, /* column counts */ \ - /* input: */ \ - const int64_t *restrict Wfirst, /* size A_ntasks */ \ - const int64_t *restrict Wlast, /* size A_ntasks */ \ - const int64_t *A_ek_slicing, /* size 3*A_ntasks+1 */ \ - const int A_ntasks /* # of tasks */ \ + int A_ntasks /* # of tasks */ \ ) #define GB_CALLBACK_FREE_MEMORY_PROTO(GX_free_memory) \ @@ -144,11 +132,13 @@ GrB_Info GX_subassign_one_slice /* slice M for subassign_05, 06n, 07 */ \ int *p_nthreads, /* # of threads to use */ \ /* input: */ \ const GrB_Matrix C, /* output matrix C */ \ - const GrB_Index *I, \ + const void *I, \ + const bool I_is_32, \ const int64_t nI, \ const int Ikind, \ const int64_t Icolon [3], \ - const GrB_Index *J, \ + const void *J, \ + const bool J_is_32, \ const int64_t nJ, \ const int Jkind, \ const int64_t Jcolon [3], \ @@ -160,7 +150,7 @@ GrB_Info GX_subassign_one_slice /* slice M for subassign_05, 06n, 07 */ \ GrB_Info GX_add_phase0 /* find vectors in C for C=A+B or C=A+B*/\ ( \ int64_t *p_Cnvec, /* # of vectors to compute in C */ \ - int64_t *restrict *Ch_handle, /* Ch: size Cnvec, or NULL */ \ + void **Ch_handle, /* Ch: size Cnvec, or NULL */ \ size_t *Ch_size_handle, /* size of Ch in bytes */ \ int64_t *restrict *C_to_M_handle, /* C_to_M: size Cnvec, or NULL */ \ size_t *C_to_M_size_handle, /* size of C_to_M in bytes */ \ @@ -169,6 +159,9 @@ GrB_Info GX_add_phase0 /* find vectors in C for C=A+B or C=A+B*/\ int64_t *restrict *C_to_B_handle, /* C_to_B: size Cnvec, or NULL */ \ size_t *C_to_B_size_handle, /* size of C_to_A in bytes */ \ bool *p_Ch_is_Mh, /* if true, then Ch == Mh */ \ + bool *p_Cp_is_32, /* if true, Cp is 32-bit; else 64-bit */ \ + bool *p_Cj_is_32, /* if true, Ch is 32-bit; else 64-bit */ \ + bool *p_Ci_is_32, /* if true, Ci is 32-bit; else 64-bit */ \ int *C_sparsity, /* sparsity structure of C */ \ const GrB_Matrix M, /* optional mask, may be NULL; not compl */ \ const GrB_Matrix A, /* first input matrix */ \ @@ -186,7 +179,8 @@ GrB_Info GX_ewise_slice \ int *p_nthreads, /* # of threads for eWise operation */ \ /* input: */ \ const int64_t Cnvec, /* # of vectors of C */ \ - const int64_t *restrict Ch, /* vectors of C, if hypersparse */ \ + const void *Ch, /* vectors of C, if hypersparse */ \ + const bool Cj_is_32, /* if true, Ch is 32-bit, else 64-bit */\ const int64_t *restrict C_to_M, /* mapping of C to M */ \ const int64_t *restrict C_to_A, /* mapping of C to A */ \ const int64_t *restrict C_to_B, /* mapping of C to B */ \ @@ -214,11 +208,10 @@ GrB_Info GX_subassign_IxJ_slice \ #define GB_CALLBACK_PENDING_ENSURE_PROTO(GX_Pending_ensure) \ bool GX_Pending_ensure \ ( \ - GB_Pending *PHandle, /* input/output */ \ + GrB_Matrix C, /* matrix with C->Pending */ \ bool iso, /* if true, do not allocate Pending->x */ \ GrB_Type type, /* type of pending tuples */ \ GrB_BinaryOp op, /* operator for assembling pending tuples */ \ - bool is_matrix, /* true if Pending->j must be allocated */ \ int64_t nnew, /* # of pending tuples to add */ \ GB_Werk Werk \ ) @@ -232,23 +225,26 @@ GrB_Info GX_subassign_08n_slice \ int *p_ntasks, /* # of tasks constructed */ \ int *p_nthreads, /* # of threads to use */ \ int64_t *p_Znvec, /* # of vectors to compute in Z */ \ - const int64_t *restrict *Zh_handle, /* Zh is A->h, M->h, or NULL */ \ - int64_t *restrict *Z_to_A_handle, /* Z_to_A: size Znvec, or NULL */ \ + const void **Zh_handle, /* Zh is A->h, M->h, or NULL */ \ + int64_t *restrict *Z_to_A_handle, /* Z_to_A: size Znvec, or NULL */ \ size_t *Z_to_A_size_handle, \ - int64_t *restrict *Z_to_M_handle, /* Z_to_M: size Znvec, or NULL */ \ + int64_t *restrict *Z_to_M_handle, /* Z_to_M: size Znvec, or NULL */ \ size_t *Z_to_M_size_handle, \ + bool *Zj_is_32_handle, \ /* input: */ \ - const GrB_Matrix C, /* output matrix C */ \ - const GrB_Index *I, \ + const GrB_Matrix C, /* output matrix C */ \ + const void *I, /* I index list */ \ + const bool I_is_32, \ const int64_t nI, \ const int Ikind, \ const int64_t Icolon [3], \ - const GrB_Index *J, \ + const void *J, /* J index list */ \ + const bool J_is_32, \ const int64_t nJ, \ const int Jkind, \ const int64_t Jcolon [3], \ - const GrB_Matrix A, /* matrix to slice */ \ - const GrB_Matrix M, /* matrix to slice */ \ + const GrB_Matrix A, /* matrix to slice */ \ + const GrB_Matrix M, /* matrix to slice */ \ GB_Werk Werk \ ) @@ -259,22 +255,16 @@ void GX_bitmap_assign_to_full /* set all C->b to 1, or make C full */ \ int nthreads_max \ ) -#define GB_CALLBACK_QSORT_1_PROTO(GX_qsort_1) \ -void GX_qsort_1 /* sort array A of size 1-by-n */ \ -( \ - int64_t *restrict A_0, /* size n array */ \ - const int64_t n \ -) - #define GB_CALLBACK_P_SLICE_PROTO(GX_p_slice) \ -void GX_p_slice /* slice Ap */ \ +void GX_p_slice /* slice Ap, 32-bit or 64-bit */ \ ( \ /* output: */ \ - int64_t *restrict Slice, /* size ntasks+1 */ \ + int64_t *restrict Slice, /* size ntasks+1 */ \ /* input: */ \ - const int64_t *restrict Ap, /* array size n+1 (full/bitmap: NULL)*/ \ + const void *Work, /* array size n+1 (full/bitmap: NULL)*/ \ + bool Work_is_32, /* if true, Ap is uint32_t, else uint64_t */\ const int64_t n, \ - const int ntasks, /* # of tasks */ \ + const int ntasks, /* # of tasks */ \ const bool perfectly_balanced \ ) diff --git a/GraphBLAS/Source/cast/GB_cast.h b/GraphBLAS/Source/cast/GB_cast.h index d0aa1e772a..53776a1d2d 100644 --- a/GraphBLAS/Source/cast/GB_cast.h +++ b/GraphBLAS/Source/cast/GB_cast.h @@ -2,7 +2,7 @@ // GB_cast: definitions for GB_cast_* methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -91,5 +91,15 @@ GrB_Info GB_cast_matrix // copy or typecast the values from A into C GrB_Matrix A ) ; +void GB_cast_int // parallel memcpy/cast of integer arrays +( + void *dest, // destination + GB_Type_code dest_code, // destination type: int32/64, or uint32/64 + const void *src, // source + GB_Type_code src_code, // source type: int32/64, or uint32/64 + size_t n, // # of entries to copy + int nthreads_max // max # of threads to use +) ; + #endif diff --git a/GraphBLAS/Source/cast/GB_cast_array.c b/GraphBLAS/Source/cast/GB_cast_array.c index 062164744c..d217bfae17 100644 --- a/GraphBLAS/Source/cast/GB_cast_array.c +++ b/GraphBLAS/Source/cast/GB_cast_array.c @@ -2,7 +2,7 @@ // GB_cast_array: typecast an array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -110,9 +110,10 @@ GrB_Info GB_cast_array // typecast an array int64_t csize = GB_code_size (ccode, 0) ; int64_t asize = GB_code_size (acode, 0) ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; + #define GB_A_IS_BITMAP (Ab != NULL) #define GB_APPLY_OP(pC,pA) \ cast_A_to_C (Cx +((pC)*csize), Ax +((pA)*asize), asize) - #include "apply/template/GB_apply_unop_ip.c" + #include "apply/template/GB_apply_unop_ip_template.c" info = GrB_SUCCESS ; } diff --git a/GraphBLAS/Source/cast/GB_cast_factory.c b/GraphBLAS/Source/cast/GB_cast_factory.c index 79304f908d..2e913d7f3e 100644 --- a/GraphBLAS/Source/cast/GB_cast_factory.c +++ b/GraphBLAS/Source/cast/GB_cast_factory.c @@ -2,7 +2,7 @@ // GB_cast_factory: return a pointer to a typecasting function //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cast/GB_cast_int.c b/GraphBLAS/Source/cast/GB_cast_int.c new file mode 100644 index 0000000000..f0362ef07d --- /dev/null +++ b/GraphBLAS/Source/cast/GB_cast_int.c @@ -0,0 +1,172 @@ +//------------------------------------------------------------------------------ +// GB_cast_int: parallel memcpy or int32_t/int64_t/uint32_t/uint64_t type cast +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" + +void GB_cast_int // parallel memcpy/cast of integer arrays +( + void *dest, // destination + GB_Type_code dest_code, // destination type: int32/64, or uint32/64 + const void *src, // source + GB_Type_code src_code, // source type: int32/64, or uint32/64 + size_t n, // # of entries to copy + int nthreads_max // max # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // get the # of threads + //-------------------------------------------------------------------------- + + int nthreads = GB_nthreads (n, GB_CHUNK_DEFAULT, nthreads_max) ; + int64_t k ; + + //-------------------------------------------------------------------------- + // copy/cast the integer array + //-------------------------------------------------------------------------- + + switch (dest_code) + { + + //---------------------------------------------------------------------- + // destination is int32_t + //---------------------------------------------------------------------- + + case GB_INT32_code : + + switch (src_code) + { + case GB_INT32_code : + case GB_UINT32_code : + GB_memcpy (dest, src, n * sizeof (uint32_t), nthreads) ; + break ; + + case GB_INT64_code : + { + int32_t *restrict Dest = (int32_t *) dest ; + const int64_t *restrict Src = (int64_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_UINT64_code : + { + int32_t *restrict Dest = (int32_t *) dest ; + const uint64_t *restrict Src = (uint64_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + // destination is uint32_t + //---------------------------------------------------------------------- + + case GB_UINT32_code : + + switch (src_code) + { + case GB_INT32_code : + case GB_UINT32_code : + GB_memcpy (dest, src, n * sizeof (uint32_t), nthreads) ; + break ; + + case GB_INT64_code : + { + uint32_t *restrict Dest = (uint32_t *) dest ; + const int64_t *restrict Src = (int64_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_UINT64_code : + { + uint32_t *restrict Dest = (uint32_t *) dest ; + const uint64_t *restrict Src = (uint64_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + // destination is int64_t + //---------------------------------------------------------------------- + + case GB_INT64_code : + + switch (src_code) + { + case GB_INT32_code : + { + int64_t *restrict Dest = (int64_t *) dest ; + const int32_t *restrict Src = (int32_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_UINT32_code : + { + int64_t *restrict Dest = (int64_t *) dest ; + const uint32_t *restrict Src = (uint32_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_INT64_code : + case GB_UINT64_code : + GB_memcpy (dest, src, n * sizeof (uint64_t), nthreads) ; + break ; + + default: ; + } + break ; + + //---------------------------------------------------------------------- + // destination is uint64_t + //---------------------------------------------------------------------- + + case GB_UINT64_code : + + switch (src_code) + { + case GB_INT32_code : + { + uint64_t *restrict Dest = (uint64_t *) dest ; + const int32_t *restrict Src = (int32_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_UINT32_code : + { + uint64_t *restrict Dest = (uint64_t *) dest ; + const uint32_t *restrict Src = (uint32_t *) src ; + #include "cast/factory/GB_cast_int_template.c" + } + break ; + + case GB_INT64_code : + case GB_UINT64_code : + GB_memcpy (dest, src, n * sizeof (uint64_t), nthreads) ; + break ; + + default: ; + } + break ; + + default: ; + } +} + diff --git a/GraphBLAS/Source/cast/GB_cast_matrix.c b/GraphBLAS/Source/cast/GB_cast_matrix.c index 5edd45c09f..61cd32ccc9 100644 --- a/GraphBLAS/Source/cast/GB_cast_matrix.c +++ b/GraphBLAS/Source/cast/GB_cast_matrix.c @@ -2,7 +2,7 @@ // GB_cast_matrix: copy or typecast the values from A into C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cast/GB_casting.c b/GraphBLAS/Source/cast/GB_casting.c index b5ce206dd3..a4e8616546 100644 --- a/GraphBLAS/Source/cast/GB_casting.c +++ b/GraphBLAS/Source/cast/GB_casting.c @@ -2,7 +2,7 @@ // GB_casting.c: unary typecasting functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cast/GB_casting.h b/GraphBLAS/Source/cast/GB_casting.h index 3cbf7dd4e1..727746b224 100644 --- a/GraphBLAS/Source/cast/GB_casting.h +++ b/GraphBLAS/Source/cast/GB_casting.h @@ -2,7 +2,7 @@ // GB_casting.h: define the unary typecasting functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -537,8 +537,12 @@ GB_CAST_FUNCTION (GxB_FC64_t, GxB_FC64_t) // a specific matrix type for M, and they #undef these definitions and replace // them with specific types and a simpler test of the M(i,j) value. +#ifndef GB_JIT_KERNEL +// JIT kernels (including PreJIT) #define their own GB_M_TYPE and +// GB_MCAST macros. #define GB_M_TYPE GB_void #define GB_MCAST(Mx,pM,msize) GB_mcast ((GB_void *) Mx, pM, msize) +#endif static inline bool GB_mcast // return the value of M(i,j) ( diff --git a/GraphBLAS/Source/cast/GB_copy_user_user.c b/GraphBLAS/Source/cast/GB_copy_user_user.c index cf61a6ad5b..f0589e07ef 100644 --- a/GraphBLAS/Source/cast/GB_copy_user_user.c +++ b/GraphBLAS/Source/cast/GB_copy_user_user.c @@ -2,7 +2,7 @@ // GB_copy_user_user.c: copy a user type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cast/factory/GB_cast_int_template.c b/GraphBLAS/Source/cast/factory/GB_cast_int_template.c new file mode 100644 index 0000000000..e19cc1fc3c --- /dev/null +++ b/GraphBLAS/Source/cast/factory/GB_cast_int_template.c @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// GB_cast_int_template: parallel int32_t/int64_t/uint32_t/uint64_t type cast +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +{ + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (k = 0 ; k < n ; k++) + { + Dest [k] = Src [k] ; + } +} + diff --git a/GraphBLAS/Source/clear/GB_clear.c b/GraphBLAS/Source/clear/GB_clear.c index 6935429d29..2493981810 100644 --- a/GraphBLAS/Source/clear/GB_clear.c +++ b/GraphBLAS/Source/clear/GB_clear.c @@ -2,7 +2,7 @@ // GB_clear: clears the content of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,12 +20,15 @@ // the matrix A is left in an invalid state (A->magic == GB_MAGIC2). Only the // header is left. +// Depending on the sparsity control, A may be left in bitmap form. Otherwise, // A is first converted to sparse or hypersparse, and then conformed via // GB_conform. If A->sparsity_control disables the sparse and hypersparse // structures, A is converted bitmap instead. #include "GB.h" +#define GB_FREE_ALL GB_phybix_free (A) ; + GrB_Info GB_clear // clear a matrix, type and dimensions unchanged ( GrB_Matrix A, // matrix to clear @@ -73,6 +76,17 @@ GrB_Info GB_clear // clear a matrix, type and dimensions unchanged ASSERT (!GB_JUMBLED (A)) ; ASSERT (!GB_PENDING (A)) ; + //-------------------------------------------------------------------------- + // determine the integer sizes to use + //-------------------------------------------------------------------------- + + // determine the p_is_32 and i_is_32 settings for the cleared matrix + GB_determine_pji_is_32 (&(A->p_is_32), &(A->j_is_32), &(A->i_is_32), + GxB_AUTO_SPARSITY, 1, A->vlen, A->vdim, Werk) ; + + size_t apsize = (A->p_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t ajsize = (A->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + //-------------------------------------------------------------------------- // allocate new A->p and A->h components //-------------------------------------------------------------------------- @@ -92,7 +106,7 @@ GrB_Info GB_clear // clear a matrix, type and dimensions unchanged int64_t plen = A->vdim ; A->nvec = plen ; A->plen = plen ; - A->p = GB_MALLOC (plen+1, int64_t, &(A->p_size)) ; + A->p = GB_MALLOC_MEMORY (plen+1, apsize, &(A->p_size)) ; ASSERT (A->h == NULL) ; if (A->p == NULL) { @@ -100,7 +114,7 @@ GrB_Info GB_clear // clear a matrix, type and dimensions unchanged GB_phybix_free (A) ; return (GrB_OUT_OF_MEMORY) ; } - GB_memset (A->p, 0, (plen+1) * sizeof (int64_t), nthreads_max) ; + GB_memset (A->p, 0, (plen+1) * apsize, nthreads_max) ; } else @@ -113,20 +127,14 @@ GrB_Info GB_clear // clear a matrix, type and dimensions unchanged int64_t plen = GB_IMIN (1, A->vdim) ; A->nvec = 0 ; A->plen = plen ; - A->p = GB_MALLOC (plen+1, int64_t, &(A->p_size)) ; - A->h = GB_MALLOC (plen , int64_t, &(A->h_size)) ; + A->p = GB_CALLOC_MEMORY (plen+1, apsize, &(A->p_size)) ; + A->h = GB_CALLOC_MEMORY (plen , ajsize, &(A->h_size)) ; if (A->p == NULL || A->h == NULL) { // out of memory GB_phybix_free (A) ; return (GrB_OUT_OF_MEMORY) ; } - A->p [0] = 0 ; - if (plen > 0) - { - A->p [1] = 0 ; - A->h [0] = 0 ; - } } A->magic = GB_MAGIC ; @@ -135,6 +143,7 @@ GrB_Info GB_clear // clear a matrix, type and dimensions unchanged // conform A to its desired sparsity //-------------------------------------------------------------------------- + ASSERT_MATRIX_OK (A, "cleared", GB0) ; return (GB_conform (A, Werk)) ; } diff --git a/GraphBLAS/Source/clear/GB_clear.h b/GraphBLAS/Source/clear/GB_clear.h index c35a3bea2d..9b4072c58b 100644 --- a/GraphBLAS/Source/clear/GB_clear.h +++ b/GraphBLAS/Source/clear/GB_clear.h @@ -2,7 +2,7 @@ // GB_clear.h: definitions for GB_clear //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/clear/GrB_Matrix_clear.c b/GraphBLAS/Source/clear/GrB_Matrix_clear.c index 2dae7607e1..41a7dd6d85 100644 --- a/GraphBLAS/Source/clear/GrB_Matrix_clear.c +++ b/GraphBLAS/Source/clear/GrB_Matrix_clear.c @@ -2,14 +2,15 @@ // GrB_Matrix_clear: clears the content of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // The A->x and A->i content is freed and the vector pointers A->p are set to // zero. This puts the matrix A in the same state it had after GrB_Matrix_new -// (&A, ...). The dimensions and type of A are not changed. +// (&A, ...). The dimensions and type of A are not changed. The matrix A on +// input may have readonly (shallow) components; these are simply removed. #include "GB.h" @@ -23,8 +24,8 @@ GrB_Info GrB_Matrix_clear // clear a matrix of all entries; // check inputs //-------------------------------------------------------------------------- - GB_WHERE (A, "GrB_Matrix_clear (A)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_clear (A)") ; //-------------------------------------------------------------------------- // clear the matrix diff --git a/GraphBLAS/Source/scalar/GrB_Scalar_clear.c b/GraphBLAS/Source/clear/GrB_Scalar_clear.c similarity index 89% rename from GraphBLAS/Source/scalar/GrB_Scalar_clear.c rename to GraphBLAS/Source/clear/GrB_Scalar_clear.c index 46591a7502..690fa8d39a 100644 --- a/GraphBLAS/Source/scalar/GrB_Scalar_clear.c +++ b/GraphBLAS/Source/clear/GrB_Scalar_clear.c @@ -2,11 +2,13 @@ // GrB_Scalar_clear: clears the content of a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// See GrB_Matrix_clear for details. + #include "GB.h" GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry @@ -19,8 +21,9 @@ GrB_Info GrB_Scalar_clear // clear a GrB_Scalar of its entry // check inputs //-------------------------------------------------------------------------- - GB_WHERE (s, "GrB_Scalar_clear (s)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_WHERE1 (s, "GrB_Scalar_clear (s)") ; + GB_RETURN_IF_NULL (s) ; + ASSERT (GB_SCALAR_OK (s)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/clear/GrB_Vector_clear.c b/GraphBLAS/Source/clear/GrB_Vector_clear.c index 828374d1a9..ff7208c5f8 100644 --- a/GraphBLAS/Source/clear/GrB_Vector_clear.c +++ b/GraphBLAS/Source/clear/GrB_Vector_clear.c @@ -2,11 +2,13 @@ // GrB_Vector_clear: clears the content of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// See GrB_Matrix_clear for details. + #include "GB.h" GrB_Info GrB_Vector_clear // clear a vector of all entries; @@ -19,8 +21,9 @@ GrB_Info GrB_Vector_clear // clear a vector of all entries; // check inputs //-------------------------------------------------------------------------- - GB_WHERE (v, "GrB_Vector_clear (v)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE_1 (v, "GrB_Vector_clear (v)") ; + ASSERT (GB_VECTOR_OK (v)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/codegen/Contents.m b/GraphBLAS/Source/codegen/Contents.m index 481d28bfaa..8b36772252 100644 --- a/GraphBLAS/Source/codegen/Contents.m +++ b/GraphBLAS/Source/codegen/Contents.m @@ -28,6 +28,6 @@ % codegen_uop_method - create a function to compute C=uop(A) % codegen_uop_template - CODEGEN_UNOP_TEMPLATE create uop functions -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/Source/codegen/Generator/GB_AxB.c b/GraphBLAS/Source/codegen/Generator/GB_AxB.c index ad8475ec12..b334597fd3 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_AxB.c +++ b/GraphBLAS/Source/codegen/Generator/GB_AxB.c @@ -2,7 +2,7 @@ // GB_AxB.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,6 @@ GB_type_enabled #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" GB_axb__include_h @@ -557,5 +556,7 @@ GrB_Info GB (_Asaxpy3B) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_aop.c b/GraphBLAS/Source/codegen/Generator/GB_aop.c index 892fbebda4..8c08493f48 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_aop.c +++ b/GraphBLAS/Source/codegen/Generator/GB_aop.c @@ -2,7 +2,7 @@ // GB_aop: assign/subassign kernels with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,6 @@ GB_type_enabled #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" // accum operator @@ -105,5 +104,7 @@ GrB_Info GB (_subassign_22) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_as.c b/GraphBLAS/Source/codegen/Generator/GB_as.c index 358ffddef1..a6c19f6c2e 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_as.c +++ b/GraphBLAS/Source/codegen/Generator/GB_as.c @@ -2,7 +2,7 @@ // GB_as: assign/subassign kernels with no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,6 @@ GB_type_enabled #if GB_TYPE_ENABLED #include "GB.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" // A and C matrices @@ -106,5 +105,7 @@ GrB_Info GB (_subassign_25) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_bld.c b/GraphBLAS/Source/codegen/Generator/GB_bld.c index c7250e8478..d74ab7ae38 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_bld.c +++ b/GraphBLAS/Source/codegen/Generator/GB_bld.c @@ -2,7 +2,7 @@ // GB_bld: hard-coded functions for builder methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,7 @@ GB_type_enabled // dup operator: Tx [k] += Sx [i], no typecast here GB_bld_dup +GB_dup_is_first #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T @@ -38,12 +39,16 @@ GB_disable GrB_Info GB (_bld) ( GB_Tx_TYPE *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -52,10 +57,16 @@ GrB_Info GB (_bld) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + GB_IDECL (I_work, const, u) ; GB_IPTR (I_work, I_is_32 ) ; + GB_IDECL (K_work, const, u) ; GB_IPTR (K_work, K_is_32 ) ; + GB_IDECL (Ti , , ) ; GB_IPTR (Ti , Ti_is_32) ; + #define GB_K_WORK(t) (K_work ? GB_IGET (K_work, t) : (t)) #include "builder/template/GB_bld_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_bld.h b/GraphBLAS/Source/codegen/Generator/GB_bld.h index 0d3fab44a0..829b73bea3 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_bld.h +++ b/GraphBLAS/Source/codegen/Generator/GB_bld.h @@ -3,12 +3,16 @@ GrB_Info GB (_bld) ( GB_ttype_parameter *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, + bool Ti_is_32, const GB_stype_parameter *restrict Sx, int64_t nvals, int64_t ndupl, - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, + const void *restrict K_work, + bool K_is_32, + const int64_t duplicate_entry, const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads diff --git a/GraphBLAS/Source/codegen/Generator/GB_ew.c b/GraphBLAS/Source/codegen/Generator/GB_ew.c index 1ec31f59e6..be93bee1d8 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_ew.c +++ b/GraphBLAS/Source/codegen/Generator/GB_ew.c @@ -2,7 +2,7 @@ // GB_ew: ewise kernels for each built-in binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,6 @@ GB_type_enabled #if GB_TYPE_ENABLED #include "GB.h" #include "emult/GB_emult.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -41,6 +40,7 @@ GB_copy_a_to_c GB_copy_b_to_c GB_ctype_is_atype GB_ctype_is_btype +#define GB_Cp_IS_32 Cp_is_32 // disable this operator and use the generic case if these conditions hold GB_disable @@ -242,7 +242,7 @@ GrB_Info GB (_AemultB_08) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" return (GrB_SUCCESS) ; #endif } @@ -259,7 +259,7 @@ GrB_Info GB (_AemultB_02) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -286,7 +286,7 @@ GrB_Info GB (_AemultB_03) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -312,7 +312,7 @@ GrB_Info GB (_AemultB_04) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -415,7 +415,7 @@ GrB_Info GB (_bind1st_tran) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -426,6 +426,7 @@ GrB_Info GB (_bind1st_tran) return (GrB_NO_VALUE) ; #else GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif @@ -450,7 +451,7 @@ GrB_Info GB (_bind2nd_tran) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -460,11 +461,14 @@ GrB_Info GB (_bind2nd_tran) return (GrB_NO_VALUE) ; #else GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } m4_divert(0) +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_ew.h b/GraphBLAS/Source/codegen/Generator/GB_ew.h index b3f8cc15c9..ed9f2c9e62 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_ew.h +++ b/GraphBLAS/Source/codegen/Generator/GB_ew.h @@ -119,7 +119,7 @@ GrB_Info GB (_AemultB_02) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -134,7 +134,7 @@ GrB_Info GB (_AemultB_03) const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -148,7 +148,7 @@ GrB_Info GB (_AemultB_04) const bool Mask_struct, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -184,7 +184,7 @@ GrB_Info GB (_bind1st_tran) GrB_Matrix C, const GB_void *x_input, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -205,7 +205,7 @@ GrB_Info GB (_bind2nd_tran) GrB_Matrix C, const GrB_Matrix A, const GB_void *y_input, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads diff --git a/GraphBLAS/Source/codegen/Generator/GB_red.c b/GraphBLAS/Source/codegen/Generator/GB_red.c index a7b165be92..0e8697b7a3 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_red.c +++ b/GraphBLAS/Source/codegen/Generator/GB_red.c @@ -2,7 +2,7 @@ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -73,5 +73,7 @@ GrB_Info GB (_red) #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_sel.c b/GraphBLAS/Source/codegen/Generator/GB_sel.c index fd8b9b50fc..b514b74efa 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_sel.c +++ b/GraphBLAS/Source/codegen/Generator/GB_sel.c @@ -2,13 +2,12 @@ // GB_sel: hard-coded functions for selection operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_sel__include.h" #define GB_ENTRY_SELECTOR @@ -27,9 +26,9 @@ m4_divert(if_phase1) GrB_Info GB (_sel_phase1) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -49,10 +48,8 @@ m4_divert(if_phase2) GrB_Info GB (_sel_phase2) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -60,7 +57,6 @@ GrB_Info GB (_sel_phase2) const int A_nthreads ) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; @@ -73,9 +69,8 @@ m4_divert(if_bitmap) GrB_Info GB (_sel_bitmap) ( - int8_t *Cb, - int64_t *cnvals_handle, - GrB_Matrix A, + GrB_Matrix C, + const GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads ) diff --git a/GraphBLAS/Source/codegen/Generator/GB_sel.h b/GraphBLAS/Source/codegen/Generator/GB_sel.h index 8200281910..f7bf4582f9 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_sel.h +++ b/GraphBLAS/Source/codegen/Generator/GB_sel.h @@ -3,9 +3,9 @@ m4_divert(if_phase1) GrB_Info GB (_sel_phase1) ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -16,10 +16,8 @@ GrB_Info GB (_sel_phase1) m4_divert(if_phase2) GrB_Info GB (_sel_phase2) ( - int64_t *restrict Ci, - GB_void *restrict Cx_out, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + GrB_Matrix C, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const GB_void *restrict ythunk, const int64_t *A_ek_slicing, @@ -30,8 +28,7 @@ GrB_Info GB (_sel_phase2) m4_divert(if_bitmap) GrB_Info GB (_sel_bitmap) ( - int8_t *Cb, - int64_t *cnvals_handle, + GrB_Matrix C, GrB_Matrix A, const GB_void *restrict ythunk, const int nthreads diff --git a/GraphBLAS/Source/codegen/Generator/GB_uop.c b/GraphBLAS/Source/codegen/Generator/GB_uop.c index 09658e7afd..0c80e24f32 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_uop.c +++ b/GraphBLAS/Source/codegen/Generator/GB_uop.c @@ -2,7 +2,7 @@ // GB_uop.c: hard-coded functions for each built-in unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,6 +25,7 @@ GB_geta // C matrix GB_ctype +#define GB_Cp_IS_32 Cp_is_32 // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ @@ -58,7 +59,7 @@ GrB_Info GB (_uop_apply) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "apply/template/GB_apply_unop_template.c" + #include "apply/factory/GB_apply_unop_template.c" return (GrB_SUCCESS) ; #endif } @@ -72,7 +73,7 @@ GrB_Info GB (_uop_tran) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -81,10 +82,13 @@ GrB_Info GB (_uop_tran) #if GB_DISABLE return (GrB_NO_VALUE) ; #else + bool Cp_is_32 = C->p_is_32 ; #include "transpose/template/GB_transpose_template.c" return (GrB_SUCCESS) ; #endif } +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/codegen/Generator/GB_uop.h b/GraphBLAS/Source/codegen/Generator/GB_uop.h index ffae0a775a..495238f7e8 100644 --- a/GraphBLAS/Source/codegen/Generator/GB_uop.h +++ b/GraphBLAS/Source/codegen/Generator/GB_uop.h @@ -15,7 +15,7 @@ GrB_Info GB (_uop_tran) ( GrB_Matrix C, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads diff --git a/GraphBLAS/Source/codegen/codegen.m b/GraphBLAS/Source/codegen/codegen.m index 5017fff771..6fb21588f6 100644 --- a/GraphBLAS/Source/codegen/codegen.m +++ b/GraphBLAS/Source/codegen/codegen.m @@ -3,7 +3,7 @@ % % This code generation method works on octave7 and MATLAB. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 codegen_as ; % subassign/assign with no accum diff --git a/GraphBLAS/Source/codegen/codegen_aop.m b/GraphBLAS/Source/codegen/codegen_aop.m index 2fd6d4bc2b..cf3726f1e6 100644 --- a/GraphBLAS/Source/codegen/codegen_aop.m +++ b/GraphBLAS/Source/codegen/codegen_aop.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_aop__*.[ch], including 260 % functions (GB_aop__*.c) and one include file, GB_aop__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\nassign/subassign with accum operator:\n') ; @@ -14,7 +14,7 @@ fprintf (fh, '// GB_aop__include.h: definitions for GB_aop__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_aop.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_aop_method.m b/GraphBLAS/Source/codegen/codegen_aop_method.m index 9c813f6341..3e2b6defd9 100644 --- a/GraphBLAS/Source/codegen/codegen_aop_method.m +++ b/GraphBLAS/Source/codegen/codegen_aop_method.m @@ -3,7 +3,7 @@ function codegen_aop_method (binop, op, xtype) % % codegen_aop_method (binop, op, xtype) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % determine type of z, x, and y from xtype and binop diff --git a/GraphBLAS/Source/codegen/codegen_aop_template.m b/GraphBLAS/Source/codegen/codegen_aop_template.m index 50faaf0405..51be48d4f7 100644 --- a/GraphBLAS/Source/codegen/codegen_aop_template.m +++ b/GraphBLAS/Source/codegen/codegen_aop_template.m @@ -3,7 +3,7 @@ function codegen_aop_template (binop, bfunc, ifunc, ffunc, dfunc, fcfunc, dcfunc % % Generate functions for a binary operator, for all types, for assign/subassign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n%-9s', binop) ; diff --git a/GraphBLAS/Source/codegen/codegen_as.m b/GraphBLAS/Source/codegen/codegen_as.m index d41c115e4e..e69a99cd65 100644 --- a/GraphBLAS/Source/codegen/codegen_as.m +++ b/GraphBLAS/Source/codegen/codegen_as.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_as__*.[ch], including 13 % functions (GB_as__*.c) and one include file, GB_as__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\nsubassign/assign with no accum:\n') ; @@ -14,7 +14,7 @@ fprintf (fh, '// GB_as__include.h: definitions for GB_as__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_as.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_as_template.m b/GraphBLAS/Source/codegen/codegen_as_template.m index a228eccc2f..c63d3226dd 100644 --- a/GraphBLAS/Source/codegen/codegen_as_template.m +++ b/GraphBLAS/Source/codegen/codegen_as_template.m @@ -3,7 +3,7 @@ function codegen_as_template (xtype) % % codegen_as_template (xtype) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 f = fopen ('control.m4', 'w') ; diff --git a/GraphBLAS/Source/codegen/codegen_axb.m b/GraphBLAS/Source/codegen/codegen_axb.m index a99d84d5fe..6887c805a9 100644 --- a/GraphBLAS/Source/codegen/codegen_axb.m +++ b/GraphBLAS/Source/codegen/codegen_axb.m @@ -5,7 +5,7 @@ % built-in semirings (GB_AxB__*.c) and two include files, % Source/mxm/GB_AxB__include1.h and FactoryKernels/GB_AxB__include2.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % The ANY operator is not used as a multiplicative operator in the generated @@ -25,7 +25,7 @@ fprintf (fh, '// GB_AxB__include%d.h: definitions for GB_AxB__*.c methods\n', k) ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; - fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; + fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_AxB.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_axb_compare_template.m b/GraphBLAS/Source/codegen/codegen_axb_compare_template.m index 93366c8ba0..de439b1398 100644 --- a/GraphBLAS/Source/codegen/codegen_axb_compare_template.m +++ b/GraphBLAS/Source/codegen/codegen_axb_compare_template.m @@ -1,7 +1,7 @@ function codegen_axb_compare_template (multop, bmult, mult) %CODEGEN_AXB_COMPARE_TEMPLATE create a function for a semiring with a TxT -> bool multiplier -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n%-7s', multop) ; diff --git a/GraphBLAS/Source/codegen/codegen_axb_method.m b/GraphBLAS/Source/codegen/codegen_axb_method.m index 41b47c62a5..1777ff7185 100644 --- a/GraphBLAS/Source/codegen/codegen_axb_method.m +++ b/GraphBLAS/Source/codegen/codegen_axb_method.m @@ -3,7 +3,7 @@ function codegen_axb_method (addop, multop, update, addfunc, mult, ztype, xytype % % codegen_axb_method (addop, multop, update, addfunc, mult, ztype, xytype, identity, terminal) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin >= 5 && isempty (mult)) diff --git a/GraphBLAS/Source/codegen/codegen_axb_template.m b/GraphBLAS/Source/codegen/codegen_axb_template.m index 782d7097ea..e5700541b4 100644 --- a/GraphBLAS/Source/codegen/codegen_axb_template.m +++ b/GraphBLAS/Source/codegen/codegen_axb_template.m @@ -1,7 +1,7 @@ function codegen_axb_template (multop, bmult, imult, fmult, dmult, fcmult, dcmult, no_min_max_any_times_monoids) %CODEGEN_AXB_TEMPLATE create a function for a semiring with a TxT->T multiplier -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n%-7s', multop) ; diff --git a/GraphBLAS/Source/codegen/codegen_contains.m b/GraphBLAS/Source/codegen/codegen_contains.m index c25b252290..9a796c1ce8 100644 --- a/GraphBLAS/Source/codegen/codegen_contains.m +++ b/GraphBLAS/Source/codegen/codegen_contains.m @@ -1,7 +1,7 @@ function s = codegen_contains (text, pattern) %CODEGEN_CONTAINS same as contains (text, pattern) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = ~isempty (strfind (text, pattern)) ; diff --git a/GraphBLAS/Source/codegen/codegen_ew.m b/GraphBLAS/Source/codegen/codegen_ew.m index 72f4247e3d..aef52b245f 100644 --- a/GraphBLAS/Source/codegen/codegen_ew.m +++ b/GraphBLAS/Source/codegen/codegen_ew.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_ew__*.[ch] % and one include file, GB_ew__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\newise binary operators:\n') ; @@ -14,7 +14,7 @@ fprintf (fh, '// GB_ew__include.h: definitions for GB_ew__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_ew.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_ew_method.m b/GraphBLAS/Source/codegen/codegen_ew_method.m index 15bbc68f36..c7e6290187 100644 --- a/GraphBLAS/Source/codegen/codegen_ew_method.m +++ b/GraphBLAS/Source/codegen/codegen_ew_method.m @@ -1,7 +1,7 @@ function codegen_ew_method (binop, op, xtype) %CODEGEN_EW_METHOD create an ewise kernel -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 f = fopen ('control.m4', 'w') ; diff --git a/GraphBLAS/Source/codegen/codegen_ew_template.m b/GraphBLAS/Source/codegen/codegen_ew_template.m index ca7713456a..785c64f087 100644 --- a/GraphBLAS/Source/codegen/codegen_ew_template.m +++ b/GraphBLAS/Source/codegen/codegen_ew_template.m @@ -3,7 +3,7 @@ function codegen_ew_template (binop, bfunc, ifunc, ffunc, dfunc, fcfunc, dcfunc) % % Generate ewise kernels for a binary operator, for all types. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n%-9s', binop) ; diff --git a/GraphBLAS/Source/codegen/codegen_red.m b/GraphBLAS/Source/codegen/codegen_red.m index 26dc661266..dba0f26b80 100644 --- a/GraphBLAS/Source/codegen/codegen_red.m +++ b/GraphBLAS/Source/codegen/codegen_red.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_red__*.c, GB_bld__*.c % and the include files GB_red__include.h and GB_bld__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\nreduction operators:\n') ; @@ -14,7 +14,7 @@ fprintf (fh, '// GB_red__include.h: definitions for GB_red__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_red.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; @@ -25,7 +25,7 @@ fprintf (fh, '// GB_bld__include.h: definitions for GB_bld__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_bld.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_red_method.m b/GraphBLAS/Source/codegen/codegen_red_method.m index cc3c79ff72..21e4d929b7 100644 --- a/GraphBLAS/Source/codegen/codegen_red_method.m +++ b/GraphBLAS/Source/codegen/codegen_red_method.m @@ -3,7 +3,7 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) % % codegen_red_method (opname, op, atype, identity, terminal) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 f = fopen ('control.m4', 'w') ; @@ -50,7 +50,7 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) fprintf (f, 'm4_define(`GB_declare_const_identity'', `#define GB_DECLARE_IDENTITY_CONST(z)%s'')\n', define_const_id) ; end -% A is never iso, so GBX is not needed +% A is never iso fprintf (f, 'm4_define(`GB_declarea'', `#define GB_DECLAREA(aij) %s aij'')\n', atype) ; fprintf (f, 'm4_define(`GB_geta'', `#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA]'')\n') ; @@ -66,7 +66,8 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) % monoid is terminal is_terminal = 1 ; tbreak = sprintf (' if (z == %s) { break ; }', terminal) ; - tvalue = sprintf (' const %s zterminal = %s', ztype, terminal) ; +% tvalue = sprintf (' const %s zterminal = %s ;', ztype, terminal) ; + tvalue = '' ; tcondition = sprintf (' (z == %s)', terminal) ; else % monoid is not terminal @@ -91,11 +92,15 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) % monoid is terminal fprintf (f, 'm4_define(`GB_terminal_condition'', `#define GB_TERMINAL_CONDITION(z,zterminal)%s'')\n', tcondition) ; fprintf (f, 'm4_define(`GB_if_terminal_break'', `#define GB_IF_TERMINAL_BREAK(z,zterminal)%s'')\n', tbreak) ; - fprintf (f, 'm4_define(`GB_declare_const_terminal'', `#define GB_DECLARE_TERMINAL_CONST(zterminal)%s'')\n', tvalue) ; else % will be defined by GB_monoid_shared_definitions.h fprintf (f, 'm4_define(`GB_terminal_condition'', `'')\n') ; fprintf (f, 'm4_define(`GB_if_terminal_break'', `'')\n') ; +end + +if (~isempty (tvalue)) + fprintf (f, 'm4_define(`GB_declare_const_terminal'', `#define GB_DECLARE_TERMINAL_CONST(zterminal)%s'')\n', tvalue) ; +else fprintf (f, 'm4_define(`GB_declare_const_terminal'', `'')\n') ; end @@ -123,6 +128,11 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) dup_op = strrep (dup_op, 'zarg', 'Tx [k]') ; dup_op = strrep (dup_op, 'yarg', 'Sx [i]') ; fprintf (f, 'm4_define(`GB_bld_dup'', `#define GB_BLD_DUP(Tx,k,Sx,i) %s'')\n', dup_op) ; +if (isequal (opname, 'first')) + fprintf (f, 'm4_define(`GB_dup_is_first'', `#define GB_DUP_IS_FIRST'')\n') ; +else + fprintf (f, 'm4_define(`GB_dup_is_first'', `'')\n') ; +end % create the function operator add_op = op {2} ; diff --git a/GraphBLAS/Source/codegen/codegen_sel.m b/GraphBLAS/Source/codegen/codegen_sel.m index d77ea64fcf..62c7de671e 100644 --- a/GraphBLAS/Source/codegen/codegen_sel.m +++ b/GraphBLAS/Source/codegen/codegen_sel.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_sel__*.c, % and the include file GB_sel__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\nselection operators:\n') ; @@ -15,7 +15,7 @@ fprintf (fh, '// GB_sel__include.h: definitions for GB_sel__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_sel.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; diff --git a/GraphBLAS/Source/codegen/codegen_sel_method.m b/GraphBLAS/Source/codegen/codegen_sel_method.m index ab0e716ef3..4193a81e88 100644 --- a/GraphBLAS/Source/codegen/codegen_sel_method.m +++ b/GraphBLAS/Source/codegen/codegen_sel_method.m @@ -1,7 +1,7 @@ function codegen_sel_method (opname, func, atype) %CODEGEN_SEL_METHOD create a selection function, C = select (A,thunk) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 is_nonzombie_selector = isequal (opname, 'nonzombie') ; diff --git a/GraphBLAS/Source/codegen/codegen_type.m b/GraphBLAS/Source/codegen/codegen_type.m index cac18065e2..ffadfaa0b8 100644 --- a/GraphBLAS/Source/codegen/codegen_type.m +++ b/GraphBLAS/Source/codegen/codegen_type.m @@ -2,7 +2,7 @@ %CODEGEN_TYPE determine function fname, signed or not % and # bits a C type -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 unsigned = (type (1) == 'u') ; diff --git a/GraphBLAS/Source/codegen/codegen_uop.m b/GraphBLAS/Source/codegen/codegen_uop.m index 52ddfdfd0d..347096532f 100644 --- a/GraphBLAS/Source/codegen/codegen_uop.m +++ b/GraphBLAS/Source/codegen/codegen_uop.m @@ -4,7 +4,7 @@ % This function creates all files of the form GB_uop__*.[ch], % and the include file GB_uop__include.h. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\nunary operators:\n') ; @@ -14,7 +14,7 @@ fprintf (fh, '// GB_uop__include.h: definitions for GB_uop__*.c\n') ; fprintf (fh, '//------------------------------------------------------------------------------\n') ; fprintf (fh, '\n') ; -fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.\n') ; +fprintf (fh, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.\n') ; fprintf (fh, '// SPDX-License-Identifier: Apache-2.0\n\n') ; fprintf (fh, '// This file has been automatically generated from Generator/GB_uop.h') ; fprintf (fh, '\n#include "math/GB_math.h"\n\n') ; @@ -23,27 +23,27 @@ codegen_uop_identity ; codegen_uop_template ('ainv', ... - 'xarg', ... % bool + [ ], ... % bool '-xarg', ... % int - '-xarg', ... % uint + [ ], ... % uint '-xarg', ... % float '-xarg', ... % double 'GB_FC32_ainv (xarg)', ... % GxB_FC32_t 'GB_FC64_ainv (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('abs', ... - 'xarg', ... % bool + [ ], ... % bool 'GB_IABS (xarg)', ... % int - 'xarg', ... % uint + [ ], ... % uint 'fabsf (xarg)', ... % float 'fabs (xarg)', ... % double [ ], ... % GxB_FC32_t (see below) [ ]) ; ... % GxB_FC64_t (see below) codegen_uop_template ('minv', ... - 'true', ... % bool - 'GB_iminv (xarg)', ... % int - 'GB_iminv (xarg)', ... % uint + [ ], ... % bool + [ ], ... % int + [ ], ... % uint '(1.0F)/xarg', ... % float '1./xarg', ... % double 'GB_FC32_div (GxB_CMPLXF (1,0), xarg)', ... % GxB_FC32_t @@ -51,16 +51,16 @@ codegen_uop_template ('lnot', ... '!xarg', ... % bool - '!(xarg != 0)', ... % int - '!(xarg != 0)', ... % uint - '!(xarg != 0)', ... % float - '!(xarg != 0)', ... % double + [ ], ... % int + [ ], ... % uint + [ ], ... % float + [ ], ... % double [ ], ... % GxB_FC32_t [ ]) ; ... % GxB_FC64_t codegen_uop_template ('bnot', ... [ ], ... % bool - '~(xarg)', ... % int + [ ], ... % int '~(xarg)', ... % uint [ ], ... % float [ ], ... % double @@ -73,8 +73,8 @@ [ ], ... % uint 'sqrtf (xarg)', ... % float 'sqrt (xarg)', ... % double - 'GB_csqrtf (xarg)', ... % GxB_FC32_t - 'GB_csqrt (xarg)') ; ... % GxB_FC64_t + 'GB_csqrtf (xarg)', ... % GxB_FC32_t + 'GB_csqrt (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('log', ... [ ], ... % bool @@ -82,8 +82,8 @@ [ ], ... % uint 'logf (xarg)', ... % float 'log (xarg)', ... % double - 'GB_clogf (xarg)', ... % GxB_FC32_t - 'GB_clog (xarg)') ; ... % GxB_FC64_t + 'GB_clogf (xarg)', ... % GxB_FC32_t + 'GB_clog (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('exp', ... [ ], ... % bool @@ -91,8 +91,8 @@ [ ], ... % uint 'expf (xarg)', ... % float 'exp (xarg)', ... % double - 'GB_cexpf (xarg)', ... % GxB_FC32_t - 'GB_cexp (xarg)') ; ... % GxB_FC64_t + 'GB_cexpf (xarg)', ... % GxB_FC32_t + 'GB_cexp (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('sin', ... [ ], ... % bool @@ -100,8 +100,8 @@ [ ], ... % uint 'sinf (xarg)', ... % float 'sin (xarg)', ... % double - 'GB_csinf (xarg)', ... % GxB_FC32_t - 'GB_csin (xarg)') ; ... % GxB_FC64_t + 'GB_csinf (xarg)', ... % GxB_FC32_t + 'GB_csin (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('cos', ... [ ], ... % bool @@ -109,8 +109,8 @@ [ ], ... % uint 'cosf (xarg)', ... % float 'cos (xarg)', ... % double - 'GB_ccosf (xarg)', ... % GxB_FC32_t - 'GB_ccos (xarg)') ; ... % GxB_FC64_t + 'GB_ccosf (xarg)', ... % GxB_FC32_t + 'GB_ccos (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('tan', ... [ ], ... % bool @@ -118,8 +118,8 @@ [ ], ... % uint 'tanf (xarg)', ... % float 'tan (xarg)', ... % double - 'GB_ctanf (xarg)', ... % GxB_FC32_t - 'GB_ctan (xarg)') ; ... % GxB_FC64_t + 'GB_ctanf (xarg)', ... % GxB_FC32_t + 'GB_ctan (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('asin', ... [ ], ... % bool @@ -127,8 +127,8 @@ [ ], ... % uint 'asinf (xarg)', ... % float 'asin (xarg)', ... % double - 'GB_casinf (xarg)', ... % GxB_FC32_t - 'GB_casin (xarg)') ; ... % GxB_FC64_t + 'GB_casinf (xarg)', ... % GxB_FC32_t + 'GB_casin (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('acos', ... [ ], ... % bool @@ -136,8 +136,8 @@ [ ], ... % uint 'acosf (xarg)', ... % float 'acos (xarg)', ... % double - 'GB_cacosf (xarg)', ... % GxB_FC32_t - 'GB_cacos (xarg)') ; ... % GxB_FC64_t + 'GB_cacosf (xarg)', ... % GxB_FC32_t + 'GB_cacos (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('atan', ... [ ], ... % bool @@ -145,8 +145,8 @@ [ ], ... % uint 'atanf (xarg)', ... % float 'atan (xarg)', ... % double - 'GB_catanf (xarg)', ... % GxB_FC32_t - 'GB_catan (xarg)') ; ... % GxB_FC64_t + 'GB_catanf (xarg)', ... % GxB_FC32_t + 'GB_catan (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('sinh', ... @@ -155,8 +155,8 @@ [ ], ... % uint 'sinhf (xarg)', ... % float 'sinh (xarg)', ... % double - 'GB_csinhf (xarg)', ... % GxB_FC32_t - 'GB_csinh (xarg)') ; ... % GxB_FC64_t + 'GB_csinhf (xarg)', ... % GxB_FC32_t + 'GB_csinh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('cosh', ... [ ], ... % bool @@ -164,8 +164,8 @@ [ ], ... % uint 'coshf (xarg)', ... % float 'cosh (xarg)', ... % double - 'GB_ccoshf (xarg)', ... % GxB_FC32_t - 'GB_ccosh (xarg)') ; ... % GxB_FC64_t + 'GB_ccoshf (xarg)', ... % GxB_FC32_t + 'GB_ccosh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('tanh', ... [ ], ... % bool @@ -173,8 +173,8 @@ [ ], ... % uint 'tanhf (xarg)', ... % float 'tanh (xarg)', ... % double - 'GB_ctanhf (xarg)', ... % GxB_FC32_t - 'GB_ctanh (xarg)') ; ... % GxB_FC64_t + 'GB_ctanhf (xarg)', ... % GxB_FC32_t + 'GB_ctanh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('asinh', ... [ ], ... % bool @@ -182,8 +182,8 @@ [ ], ... % uint 'asinhf (xarg)', ... % float 'asinh (xarg)', ... % double - 'GB_casinhf (xarg)', ... % GxB_FC32_t - 'GB_casinh (xarg)') ; ... % GxB_FC64_t + 'GB_casinhf (xarg)', ... % GxB_FC32_t + 'GB_casinh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('acosh', ... [ ], ... % bool @@ -191,8 +191,8 @@ [ ], ... % uint 'acoshf (xarg)', ... % float 'acosh (xarg)', ... % double - 'GB_cacoshf (xarg)', ... % GxB_FC32_t - 'GB_cacosh (xarg)') ; ... % GxB_FC64_t + 'GB_cacoshf (xarg)', ... % GxB_FC32_t + 'GB_cacosh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('atanh', ... [ ], ... % bool @@ -200,8 +200,8 @@ [ ], ... % uint 'atanhf (xarg)', ... % float 'atanh (xarg)', ... % double - 'GB_catanhf (xarg)', ... % GxB_FC32_t - 'GB_catanh (xarg)') ; ... % GxB_FC64_t + 'GB_catanhf (xarg)', ... % GxB_FC32_t + 'GB_catanh (xarg)') ; ... % GxB_FC64_t codegen_uop_template ('signum', ... [ ], ... % bool @@ -362,8 +362,8 @@ [ ], ... % uint [ ], ... % float [ ], ... % double - 'GB_conjf (xarg)', ... % GxB_FC32_t - 'GB_conj (xarg)') ; ... % GxB_FC64_t + 'GB_conjf (xarg)', ... % GxB_FC32_t + 'GB_conj (xarg)') ; ... % GxB_FC64_t %------------------------------------------------------------------------------- % z = f(x) where the type of z and x differ diff --git a/GraphBLAS/Source/codegen/codegen_uop_identity.m b/GraphBLAS/Source/codegen/codegen_uop_identity.m index d0de1fde6f..c92d4e9c7a 100644 --- a/GraphBLAS/Source/codegen/codegen_uop_identity.m +++ b/GraphBLAS/Source/codegen/codegen_uop_identity.m @@ -4,7 +4,7 @@ % The 'identity' operator is unique: it is used for typecasting, and all 13*13 % pairs of functions are generated. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 uop = 'identity' ; diff --git a/GraphBLAS/Source/codegen/codegen_uop_method.m b/GraphBLAS/Source/codegen/codegen_uop_method.m index 7642d0ffdf..29ab3cadff 100644 --- a/GraphBLAS/Source/codegen/codegen_uop_method.m +++ b/GraphBLAS/Source/codegen/codegen_uop_method.m @@ -8,7 +8,7 @@ function codegen_uop_method (uop, op, ztype, xtype) % ztype: the type of z for z=f(x) % xtype: the type of x for z=f(x) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 f = fopen ('control.m4', 'w') ; diff --git a/GraphBLAS/Source/codegen/codegen_uop_template.m b/GraphBLAS/Source/codegen/codegen_uop_template.m index ae2a73f7c6..94e8d0056d 100644 --- a/GraphBLAS/Source/codegen/codegen_uop_template.m +++ b/GraphBLAS/Source/codegen/codegen_uop_template.m @@ -19,7 +19,7 @@ function codegen_uop_template (uop, bfunc, ifunc, ufunc, ffunc, dfunc, ... % % Generate functions for a unary operator, for all types. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n%-9s', uop) ; diff --git a/GraphBLAS/Source/compatible/GB_BinaryOp_compatible.c b/GraphBLAS/Source/compatible/GB_BinaryOp_compatible.c index 27c036ee49..1fb34afd5e 100644 --- a/GraphBLAS/Source/compatible/GB_BinaryOp_compatible.c +++ b/GraphBLAS/Source/compatible/GB_BinaryOp_compatible.c @@ -2,7 +2,7 @@ // GB_BinaryOp_compatible: check binary operator for type compatibility //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/compatible/GB_Mask_compatible.c b/GraphBLAS/Source/compatible/GB_Mask_compatible.c index 5f46aed55a..d042fe13b5 100644 --- a/GraphBLAS/Source/compatible/GB_Mask_compatible.c +++ b/GraphBLAS/Source/compatible/GB_Mask_compatible.c @@ -2,7 +2,7 @@ // GB_Mask_compatible: check input and operators for type compatibility //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GB_Mask_compatible // check type and dimensions of mask const GrB_Matrix M, // mask to check const bool Mask_struct, // true if M is structural const GrB_Matrix C, // C= ... - const GrB_Index nrows, // size of output if C is NULL (see GB*assign) - const GrB_Index ncols, + const uint64_t nrows, // size of output if C is NULL (see GB*assign) + const uint64_t ncols, GB_Werk Werk ) { @@ -44,8 +44,8 @@ GrB_Info GB_Mask_compatible // check type and dimensions of mask } // check the mask dimensions - GrB_Index cnrows = (C == NULL) ? nrows : GB_NROWS (C) ; - GrB_Index cncols = (C == NULL) ? ncols : GB_NCOLS (C) ; + uint64_t cnrows = (C == NULL) ? nrows : GB_NROWS (C) ; + uint64_t cncols = (C == NULL) ? ncols : GB_NCOLS (C) ; if (GB_NROWS (M) != cnrows || GB_NCOLS (M) != cncols) { GB_ERROR (GrB_DIMENSION_MISMATCH, diff --git a/GraphBLAS/Source/compatible/GB_Type_compatible.c b/GraphBLAS/Source/compatible/GB_Type_compatible.c index 2d5af57a8a..2e6ae6fec5 100644 --- a/GraphBLAS/Source/compatible/GB_Type_compatible.c +++ b/GraphBLAS/Source/compatible/GB_Type_compatible.c @@ -2,7 +2,7 @@ // GB_Type_compatible: return true if domains are compatible //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/compatible/GB_code_compatible.h b/GraphBLAS/Source/compatible/GB_code_compatible.h index 57816f566d..4884239f2f 100644 --- a/GraphBLAS/Source/compatible/GB_code_compatible.h +++ b/GraphBLAS/Source/compatible/GB_code_compatible.h @@ -2,7 +2,7 @@ // GB_code_compatible: return true if domains are compatible //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/compatible/GB_compatible.c b/GraphBLAS/Source/compatible/GB_compatible.c index 2d23c99566..f58c875602 100644 --- a/GraphBLAS/Source/compatible/GB_compatible.c +++ b/GraphBLAS/Source/compatible/GB_compatible.c @@ -2,7 +2,7 @@ // GB_compatible: check input and operators for type compatibility //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/compatible/GB_compatible.h b/GraphBLAS/Source/compatible/GB_compatible.h index b4b65ca1cd..23108dfa7d 100644 --- a/GraphBLAS/Source/compatible/GB_compatible.h +++ b/GraphBLAS/Source/compatible/GB_compatible.h @@ -2,7 +2,7 @@ // GB_compatible.h: definitions for GB_compatible and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,8 @@ GrB_Info GB_Mask_compatible // check type and dimensions of mask const GrB_Matrix M, // mask to check const bool Mask_struct, // true if M is structural const GrB_Matrix C, // C= ... - const GrB_Index nrows, // size of output if C is NULL (see GB*assign) - const GrB_Index ncols, + const uint64_t nrows, // size of output if C is NULL (see GB*assign) + const uint64_t ncols, GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/concat/GB_concat.c b/GraphBLAS/Source/concat/GB_concat.c index 935e5e877b..302372860d 100644 --- a/GraphBLAS/Source/concat/GB_concat.c +++ b/GraphBLAS/Source/concat/GB_concat.c @@ -2,7 +2,7 @@ // GB_concat: concatenate an array of matrices into a single matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices ( GrB_Matrix C, // input/output matrix for results const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, GB_Werk Werk ) { @@ -51,7 +51,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices for (int64_t k = 0 ; k < m*n ; k++) { GrB_Matrix A = Tiles [k] ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_OK (GB_valid_matrix (A)) ; ASSERT_MATRIX_OK (A, "Tile[k] input for GB_concat", GB0) ; GB_MATRIX_WAIT (A) ; } @@ -197,8 +198,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices // replace Tile_rows and Tile_cols with their cumulative sum //-------------------------------------------------------------------------- - GB_cumsum1 (Tile_rows, m) ; - GB_cumsum1 (Tile_cols, n) ; + GB_cumsum1_64 ((uint64_t *) Tile_rows, m) ; + GB_cumsum1_64 ((uint64_t *) Tile_cols, n) ; int64_t cnrows = Tile_rows [m] ; int64_t cncols = Tile_cols [n] ; if (cnrows != GB_NROWS (C) || cncols != GB_NCOLS (C)) @@ -255,7 +256,6 @@ GrB_Info GB_concat // concatenate a 2D array of matrices //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - ASSERT_MATRIX_OK (C, "C before conform for GB_concat", GB0) ; GB_OK (GB_conform (C, Werk)) ; ASSERT_MATRIX_OK (C, "C output for GB_concat", GB0) ; return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/concat/GB_concat.h b/GraphBLAS/Source/concat/GB_concat.h index 13ef525717..f141eef933 100644 --- a/GraphBLAS/Source/concat/GB_concat.h +++ b/GraphBLAS/Source/concat/GB_concat.h @@ -2,7 +2,7 @@ // GB_concat.h: definitions for GxB_concat //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,6 @@ #define GB_CONCAT_H #include "GB.h" #include "transpose/GB_transpose.h" -#include "slice/GB_ek_slice.h" #include "builder/GB_build.h" #define GB_TILE(Tiles,i,j) (*(Tiles + (i) * n + (j))) @@ -20,8 +19,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices ( GrB_Matrix C, // input/output matrix for results const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, GB_Werk Werk ) ; @@ -29,10 +28,10 @@ GrB_Info GB_concat_full // concatenate into a full matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -42,11 +41,11 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -56,11 +55,11 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -70,11 +69,11 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk diff --git a/GraphBLAS/Source/concat/GB_concat_bitmap.c b/GraphBLAS/Source/concat/GB_concat_bitmap.c index d090689d67..5a21549a19 100644 --- a/GraphBLAS/Source/concat/GB_concat_bitmap.c +++ b/GraphBLAS/Source/concat/GB_concat_bitmap.c @@ -2,7 +2,7 @@ // GB_concat_bitmap: concatenate an array of matrices into a bitmap matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,6 @@ GB_phybix_free (C) ; #include "concat/GB_concat.h" -#include "include/GB_unused.h" #include "apply/GB_apply.h" #include "jitifyer/GB_stringify.h" @@ -24,11 +23,11 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -53,13 +52,16 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix GB_Type_code ccode = ctype->code ; if (!GB_IS_BITMAP (C) || C->iso != C_iso) { - // set C->iso = C_iso OK GB_phybix_free (C) ; + C->p_is_32 = false ; // OK: bitmap always has p_is_32 = false + C->j_is_32 = false ; // OK: bitmap always has j_is_32 = false + C->i_is_32 = false ; // OK: bitmap always has i_is_32 = false GB_OK (GB_bix_alloc (C, GB_nnz_full (C), GxB_BITMAP, true, true, C_iso)) ; C->plen = -1 ; C->nvec = cvdim ; - C->nvec_nonempty = (cvlen > 0) ? cvdim : 0 ; +// C->nvec_nonempty = (cvlen > 0) ? cvdim : 0 ; + GB_nvec_nonempty_set (C, (cvlen > 0) ? cvdim : 0) ; } ASSERT (GB_IS_BITMAP (C)) ; ASSERT (C->iso == C_iso) ; @@ -92,7 +94,7 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix if (csc != A->is_csc) { // T = (ctype) A' - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; GB_OK (GB_transpose_cast (T, ctype, csc, A, false, Werk)) ; A = T ; GB_MATRIX_WAIT (A) ; @@ -108,13 +110,18 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix // The tile A appears in vectors cvstart:cvend-1 of C, and indices // cistart:ciend-1. - int64_t cvstart, cvend, cistart, ciend ; + #ifdef GB_DEBUG + int64_t cvend ; + #endif + int64_t cvstart, cistart, ciend ; if (csc) { // C and A are held by column // Tiles is row-major and accessed in column order cvstart = Tile_cols [outer] ; + #ifdef GB_DEBUG cvend = Tile_cols [outer+1] ; + #endif cistart = Tile_rows [inner] ; ciend = Tile_rows [inner+1] ; } @@ -123,12 +130,16 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix // C and A are held by row // Tiles is row-major and accessed in row order cvstart = Tile_rows [outer] ; + #ifdef GB_DEBUG cvend = Tile_rows [outer+1] ; + #endif cistart = Tile_cols [inner] ; ciend = Tile_cols [inner+1] ; } + #ifdef GB_DEBUG int64_t avdim = cvend - cvstart ; + #endif int64_t avlen = ciend - cistart ; ASSERT (avdim == A->vdim) ; ASSERT (avlen == A->vlen) ; @@ -170,7 +181,7 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix { #undef GB_COPY #define GB_COPY(pC,pA,A_iso) \ - Cx [pC] = GBX (Ax, pA, A_iso) ; + Cx [pC] = Ax [A_iso ? 0 : pA] ; case GB_1BYTE : // uint8, int8, bool, or 1-byte user #define GB_C_TYPE uint8_t @@ -248,13 +259,7 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix } GB_FREE_WORKSPACE ; - - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; } } diff --git a/GraphBLAS/Source/concat/GB_concat_full.c b/GraphBLAS/Source/concat/GB_concat_full.c index f00835a510..8f9a8b7f4e 100644 --- a/GraphBLAS/Source/concat/GB_concat_full.c +++ b/GraphBLAS/Source/concat/GB_concat_full.c @@ -2,7 +2,7 @@ // GB_concat_full: concatenate an array of matrices into a full matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,10 +22,10 @@ GrB_Info GB_concat_full // concatenate into a full matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -49,12 +49,15 @@ GrB_Info GB_concat_full // concatenate into a full matrix GB_Type_code ccode = ctype->code ; if (!GB_IS_FULL (C)) { - // set C->iso = C_iso OK GB_phybix_free (C) ; + C->p_is_32 = false ; // OK: full always has p_is_32 = false + C->j_is_32 = false ; // OK: full always has j_is_32 = false + C->i_is_32 = false ; // OK: full always has i_is_32 = false GB_OK (GB_bix_alloc (C, GB_nnz_full (C), GxB_FULL, false, true, C_iso)); C->plen = -1 ; C->nvec = cvdim ; - C->nvec_nonempty = (cvlen > 0) ? cvdim : 0 ; +// C->nvec_nonempty = (cvlen > 0) ? cvdim : 0 ; + GB_nvec_nonempty_set (C, (cvlen > 0) ? cvdim : 0) ; } ASSERT (GB_IS_FULL (C)) ; int nthreads_max = GB_Context_nthreads_max ( ) ; @@ -91,7 +94,7 @@ GrB_Info GB_concat_full // concatenate into a full matrix if (csc != A->is_csc) { // T = (ctype) A', not in-place - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; GB_OK (GB_transpose_cast (T, ctype, csc, A, false, Werk)) ; A = T ; GB_MATRIX_WAIT (A) ; @@ -154,7 +157,7 @@ GrB_Info GB_concat_full // concatenate into a full matrix switch (csize) { #define GB_COPY(pC,pA,A_iso) \ - Cx [pC] = GBX (Ax, pA, A_iso) ; + Cx [pC] = Ax [A_iso ? 0 : pA] ; case GB_1BYTE : // uint8, int8, bool, or 1-byte user #define GB_C_TYPE uint8_t diff --git a/GraphBLAS/Source/concat/GB_concat_hyper.c b/GraphBLAS/Source/concat/GB_concat_hyper.c index ca3e4e8de9..14ce387480 100644 --- a/GraphBLAS/Source/concat/GB_concat_hyper.c +++ b/GraphBLAS/Source/concat/GB_concat_hyper.c @@ -2,16 +2,16 @@ // GB_concat_hyper: concatenate an array of matrices into a hypersparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #define GB_FREE_ALL \ { \ - GB_FREE (&Wi, Wi_size) ; \ - GB_FREE_WORK (&Wj, Wj_size) ; \ - GB_FREE_WORK (&Wx, Wx_size) ; \ + GB_FREE_MEMORY (&Wi, Wi_size) ; \ + GB_FREE_MEMORY (&Wj, Wj_size) ; \ + GB_FREE_MEMORY (&Wx, Wx_size) ; \ GB_phybix_free (C) ; \ } @@ -25,8 +25,8 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -41,27 +41,34 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix GrB_Matrix A = NULL ; ASSERT_MATRIX_OK (C, "C input to concat hyper", GB0) ; - int64_t *restrict Wi = NULL ; size_t Wi_size = 0 ; - int64_t *restrict Wj = NULL ; size_t Wj_size = 0 ; - GB_void *restrict Wx = NULL ; size_t Wx_size = 0 ; - GrB_Type ctype = C->type ; int64_t cvlen = C->vlen ; int64_t cvdim = C->vdim ; bool csc = C->is_csc ; size_t csize = ctype->size ; + GB_MDECL (Wi, , u) ; size_t Wi_size = 0 ; + GB_MDECL (Wj, , u) ; size_t Wj_size = 0 ; + GB_void *restrict Wx = NULL ; size_t Wx_size = 0 ; + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_HYPERSPARSE, cnz, cvlen, cvdim, Werk) ; + float hyper_switch = C->hyper_switch ; float bitmap_switch = C->bitmap_switch ; int sparsity_control = C->sparsity_control ; GB_phybix_free (C) ; - Wi = GB_MALLOC (cnz, int64_t, &Wi_size) ; // becomes C->i - Wj = GB_MALLOC_WORK (cnz, int64_t, &Wj_size) ; // freed below + size_t cjsize = Cj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t cisize = Ci_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Wi = GB_MALLOC_MEMORY (cnz, cisize, &Wi_size) ; // becomes C->i + Wj = GB_MALLOC_MEMORY (cnz, cjsize, &Wj_size) ; // freed below if (!C_iso) { - Wx = GB_MALLOC_WORK (cnz * csize, GB_void, &Wx_size) ; // freed below + Wx = GB_MALLOC_MEMORY (cnz, csize, &Wx_size) ; // freed below } if (Wi == NULL || Wj == NULL || (!C_iso && Wx == NULL)) { @@ -70,6 +77,9 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Wi, Ci_is_32) ; + GB_IPTR (Wj, Cj_is_32) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; @@ -121,48 +131,38 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix // extract the tuples from tile A //------------------------------------------------------------------ - // if A is iso but C is not, extractTuples expands A->x [0] into - // all Wx [...]. If both A and C are iso, then all tiles are iso, - // and Wx is not extracted. - int64_t anz = GB_nnz (A) ; - GB_OK (GB_extractTuples ( - (GrB_Index *) ((csc ? Wi : Wj) + pC), - (GrB_Index *) ((csc ? Wj : Wi) + pC), - (C_iso) ? NULL : (Wx + pC * csize), - (GrB_Index *) (&anz), ctype, A, Werk)) ; - - //------------------------------------------------------------------ - // adjust the indices to reflect their new place in C - //------------------------------------------------------------------ - int nth = GB_nthreads (anz, chunk, nthreads_max) ; - if (cistart > 0 && cvstart > 0) - { - int64_t pA ; - #pragma omp parallel for num_threads(nth) schedule(static) - for (pA = 0 ; pA < anz ; pA++) + int64_t pA ; + + if (Cj_is_32) + { + if (Ci_is_32) { - Wi [pC + pA] += cistart ; - Wj [pC + pA] += cvstart ; + #define WORK_I Wi32 + #define WORK_J Wj32 + #include "concat/factory/GB_concat_hyper_template.c" } - } - else if (cistart > 0) - { - int64_t pA ; - #pragma omp parallel for num_threads(nth) schedule(static) - for (pA = 0 ; pA < anz ; pA++) + else { - Wi [pC + pA] += cistart ; + #define WORK_I Wi64 + #define WORK_J Wj32 + #include "concat/factory/GB_concat_hyper_template.c" } } - else if (cvstart > 0) - { - int64_t pA ; - #pragma omp parallel for num_threads(nth) schedule(static) - for (pA = 0 ; pA < anz ; pA++) + else + { + if (Ci_is_32) + { + #define WORK_I Wi32 + #define WORK_J Wj64 + #include "concat/factory/GB_concat_hyper_template.c" + } + else { - Wj [pC + pA] += cvstart ; + #define WORK_I Wi64 + #define WORK_J Wj64 + #include "concat/factory/GB_concat_hyper_template.c" } } @@ -190,9 +190,9 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix cvlen, // C->vlen cvdim, // C->vdim csc, // C->is_csc - (int64_t **) &Wi, // Wi is C->i on output, or freed on error + (void **) &Wi, // Wi is C->i on output, or freed on error &Wi_size, - (int64_t **) &Wj, // Wj, free on output + (void **) &Wj, // Wj, free on output &Wj_size, (GB_void **) &Wx, // Wx, free on output; or NULL if C is iso &Wx_size, @@ -207,7 +207,10 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix NULL, // no duplicates, so dup is NUL ctype, // the type of Wx (no typecasting) true, // burble is allowed - Werk + Werk, + Ci_is_32, Cj_is_32, // Wi and Wj have the same integers as C->i + // and C->h, respectively + Cp_is_32, Cj_is_32, Ci_is_32 // C->[pji]_is_32 for the new matrix )) ; C->hyper_switch = hyper_switch ; diff --git a/GraphBLAS/Source/concat/GB_concat_sparse.c b/GraphBLAS/Source/concat/GB_concat_sparse.c index ad890f860e..20c1499fa9 100644 --- a/GraphBLAS/Source/concat/GB_concat_sparse.c +++ b/GraphBLAS/Source/concat/GB_concat_sparse.c @@ -2,7 +2,7 @@ // GB_concat_sparse: concatenate an array of matrices into a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,8 +15,8 @@ GB_Matrix_free (&(S [k])) ; \ } \ } \ - GB_FREE_WORK (&S, S_size) ; \ - GB_FREE_WORK (&Work, Work_size) ; \ + GB_FREE_MEMORY (&S, S_size) ; \ + GB_FREE_MEMORY (&Work, Work_size) ; \ GB_WERK_POP (A_ek_slicing, int64_t) ; #define GB_FREE_ALL \ @@ -28,17 +28,16 @@ #include "concat/GB_concat.h" #include "jitifyer/GB_stringify.h" #include "apply/GB_apply.h" -#include "include/GB_unused.h" GrB_Info GB_concat_sparse // concatenate into a sparse matrix ( GrB_Matrix C, // input/output matrix for results const bool C_iso, // if true, construct C as iso - const GB_void *cscalar, // iso value of C, if C is io + const GB_void *cscalar, // iso value of C, if C is iso const int64_t cnz, // # of entries in C const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n, - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 GB_Werk Werk @@ -53,8 +52,7 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix GrB_Matrix A = NULL ; ASSERT_MATRIX_OK (C, "C input to concat sparse", GB0) ; GB_WERK_DECLARE (A_ek_slicing, int64_t) ; - int64_t *Work = NULL ; - size_t Work_size = 0 ; + GB_MDECL (Work, , u) ; size_t Work_size = 0 ; GrB_Matrix *S = NULL ; size_t S_size = 0 ; @@ -68,15 +66,25 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix float hyper_switch = C->hyper_switch ; float bitmap_switch = C->bitmap_switch ; int sparsity_control = C->sparsity_control ; + + // free all content of C and reallocate it GB_phybix_free (C) ; - // set C->iso = C_iso OK + + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_SPARSE, cnz, cvlen, cvdim, Werk) ; + GB_OK (GB_new_bix (&C, // existing header - ctype, cvlen, cvdim, GB_Ap_malloc, csc, GxB_SPARSE, false, - hyper_switch, cvdim, cnz, true, C_iso)) ; + ctype, cvlen, cvdim, GB_ph_malloc, csc, GxB_SPARSE, false, + hyper_switch, cvdim, cnz, true, C_iso, Cp_is_32, Cj_is_32, Ci_is_32)) ; + + // restore the settings of C C->bitmap_switch = bitmap_switch ; C->sparsity_control = sparsity_control ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; @@ -92,8 +100,9 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix int64_t nouter = csc ? n : m ; int64_t ninner = csc ? m : n ; - Work = GB_CALLOC_WORK (ninner * cvdim, int64_t, &Work_size) ; - S = GB_CALLOC_WORK (m * n, GrB_Matrix, &S_size) ; + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Work = GB_CALLOC_MEMORY (ninner * cvdim, cpsize, &Work_size) ; + S = GB_CALLOC_MEMORY (m * n, sizeof (GrB_Matrix), &S_size) ; if (S == NULL || Work == NULL) { // out of memory @@ -101,6 +110,9 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Work, Cp_is_32) ; + GB_MDECL (W, , u) ; + //-------------------------------------------------------------------------- // count entries in each vector of each tile //-------------------------------------------------------------------------- @@ -122,8 +134,9 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix { // T = (ctype) A', not in-place, using a dynamic header GB_OK (GB_new (&T, // auto sparsity, new header - A->type, A->vdim, A->vlen, GB_Ap_null, csc, - GxB_AUTO_SPARSITY, -1, 1)) ; + A->type, A->vdim, A->vlen, GB_ph_null, csc, + GxB_AUTO_SPARSITY, -1, 1, + A->p_is_32, A->j_is_32, A->i_is_32)) ; // save T in array S if (csc) { @@ -150,7 +163,6 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix if (T == NULL) { // copy A into T - // set T->iso = A->iso OK: no burble needed GB_OK (GB_dup_worker (&T, A->iso, A, true, NULL)) ; // save T in array S if (csc) @@ -177,8 +189,12 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; - int64_t cvstart = csc ? Tile_cols [outer] : Tile_rows [outer] ; - int64_t *restrict W = Work + inner * cvdim + cvstart ; + int64_t cvstart = csc ? Tile_cols [outer] : Tile_rows [outer] ; + + // get the workspace pointer array W for this tile + W = ((GB_void *) Work) + (inner * cvdim + cvstart) * cpsize ; + GB_IPTR (W, Cp_is_32) ; + int nth = GB_nthreads (anvec, chunk, nthreads_max) ; if (GB_IS_FULL (A)) { @@ -188,21 +204,22 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix for (j = 0 ; j < anvec ; j++) { // W [j] = # of entries in A(:,j), which is just avlen - W [j] = avlen ; + GB_ISET (W, j, avlen) ; // W [j] = avlen } } else { // A is sparse or hyper int64_t k ; - int64_t *restrict Ah = A->h ; - int64_t *restrict Ap = A->p ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; #pragma omp parallel for num_threads(nth) schedule(static) for (k = 0 ; k < anvec ; k++) { // W [j] = # of entries in A(:,j), the kth column of A - int64_t j = GBH (Ah, k) ; - W [j] = Ap [k+1] - Ap [k] ; + int64_t j = GBh_A (Ah, k) ; + int64_t ajnz = GB_IGET (Ap, k+1) - GB_IGET (Ap, k) ; + GB_ISET (W, j, ajnz) ; // W [j] = ajnz ; } } } @@ -221,26 +238,28 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix for (int64_t inner = 0 ; inner < ninner ; inner++) { int64_t p = inner * cvdim + k ; - int64_t c = Work [p] ; - Work [p] = s ; + int64_t c = GB_IGET (Work, p) ; + GB_ISET (Work, p, s) ; // Work [p] = s ; s += c ; } // total number of entries in C(:,k) - Cp [k] = s ; + GB_ISET (Cp, k, s) ; // Cp [k] = s ; } - GB_cumsum (Cp, cvdim, &(C->nvec_nonempty), nthreads_max, Werk) ; - ASSERT (cnz == Cp [cvdim]) ; + int64_t C_nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, cvdim, &C_nvec_nonempty, nthreads_max, Werk) ; + ASSERT (cnz == GB_IGET (Cp, cvdim)) ; C->nvals = cnz ; + GB_nvec_nonempty_set (C, C_nvec_nonempty) ; #pragma omp parallel for num_threads(nth) schedule(static) for (k = 0 ; k < cvdim ; k++) { - int64_t pC = Cp [k] ; + int64_t pC = GB_IGET (Cp, k) ; for (int64_t inner = 0 ; inner < ninner ; inner++) { int64_t p = inner * cvdim + k ; - Work [p] += pC ; + GB_IINC (Work, p, pC) ; // Work [p] += pC ; } } @@ -278,13 +297,18 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix // The tile A appears in vectors cvstart:cvend-1 of C, and indices // cistart:ciend-1. - int64_t cvstart, cvend, cistart, ciend ; + #ifdef GB_DEBUG + int64_t cvend ; + #endif + int64_t cvstart, cistart, ciend ; if (csc) { // C and A are held by column // Tiles is row-major and accessed in column order cvstart = Tile_cols [outer] ; + #ifdef GB_DEBUG cvend = Tile_cols [outer+1] ; + #endif cistart = Tile_rows [inner] ; ciend = Tile_rows [inner+1] ; } @@ -293,26 +317,31 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix // C and A are held by row // Tiles is row-major and accessed in row order cvstart = Tile_rows [outer] ; + #ifdef GB_DEBUG cvend = Tile_rows [outer+1] ; + #endif cistart = Tile_cols [inner] ; ciend = Tile_cols [inner+1] ; } // get the workspace pointer array W for this tile - int64_t *restrict W = Work + inner * cvdim + cvstart ; + W = ((GB_void *) Work) + (inner * cvdim + cvstart) * cpsize ; + GB_IPTR (W, Cp_is_32) ; //------------------------------------------------------------------ // slice the tile //------------------------------------------------------------------ + #ifdef GB_DEBUG int64_t avdim = cvend - cvstart ; + #endif int64_t avlen = ciend - cistart ; ASSERT (avdim == A->vdim) ; ASSERT (avlen == A->vlen) ; int A_nthreads, A_ntasks ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const bool A_iso = A->iso ; GB_SLICE_MATRIX (A, 1) ; @@ -352,7 +381,7 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix { #undef GB_COPY #define GB_COPY(pC,pA,A_iso) \ - Cx [pC] = GBX (Ax, pA, A_iso) ; + Cx [pC] = Ax [A_iso ? 0 : pA] ; case GB_1BYTE : // uint8, int8, bool, or 1-byte user #define GB_C_TYPE uint8_t diff --git a/GraphBLAS/Source/concat/GxB_Matrix_concat.c b/GraphBLAS/Source/concat/GxB_Matrix_concat.c index 43902df654..a8e5e4e2b0 100644 --- a/GraphBLAS/Source/concat/GxB_Matrix_concat.c +++ b/GraphBLAS/Source/concat/GxB_Matrix_concat.c @@ -2,7 +2,7 @@ // GxB_Matrix_concat: concatenate an array of matrices into a single matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,8 +13,8 @@ GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices ( GrB_Matrix C, // input/output matrix for results const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const uint64_t m, + const uint64_t n, const GrB_Descriptor desc // unused, except threading control ) { @@ -23,15 +23,17 @@ GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_concat (C, Tiles, m, n, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (Tiles) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE1 (C, "GxB_Matrix_concat (C, Tiles, m, n, desc)") ; GB_BURBLE_START ("GxB_Matrix_concat") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; + if (m <= 0 || n <= 0) { GB_ERROR (GrB_INVALID_VALUE, "m (" GBd ") and n (" GBd ") must be > 0", m, n) ; } - GB_RETURN_IF_NULL (Tiles) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; diff --git a/GraphBLAS/Source/concat/factory/GB_concat_hyper_template.c b/GraphBLAS/Source/concat/factory/GB_concat_hyper_template.c new file mode 100644 index 0000000000..cbc4412ff1 --- /dev/null +++ b/GraphBLAS/Source/concat/factory/GB_concat_hyper_template.c @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// GB_concat_hyper_template: create tuples from one tile +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// WORK_I and WORK_J are macro arguments, either uint32_t or uint64_t arrays. + +{ + // if A is iso but C is not, extractTuples expands A->x [0] into + // all Wx [...]. If both A and C are iso, then all tiles are iso, + // and Wx is not extracted. + + // FUTURE: could revise GB_extractTuples to take in an offset instead + + if (csc) + { + GB_OK (GB_extractTuples (WORK_I + pC, Ci_is_32, WORK_J + pC, Cj_is_32, + (C_iso) ? NULL : (Wx + pC * csize), + (uint64_t *) (&anz), ctype, A, Werk)) ; + } + else + { + GB_OK (GB_extractTuples (WORK_J + pC, Cj_is_32, WORK_I + pC, Ci_is_32, + (C_iso) ? NULL : (Wx + pC * csize), + (uint64_t *) (&anz), ctype, A, Werk)) ; + } + + // adjust the indices to reflect their new place in C + + if (cistart > 0 && cvstart > 0) + { + #pragma omp parallel for num_threads(nth) schedule(static) + for (pA = 0 ; pA < anz ; pA++) + { + WORK_I [pC + pA] += cistart ; + WORK_J [pC + pA] += cvstart ; + } + } + else if (cistart > 0) + { + #pragma omp parallel for num_threads(nth) schedule(static) + for (pA = 0 ; pA < anz ; pA++) + { + WORK_I [pC + pA] += cistart ; + } + } + else if (cvstart > 0) + { + #pragma omp parallel for num_threads(nth) schedule(static) + for (pA = 0 ; pA < anz ; pA++) + { + WORK_J [pC + pA] += cvstart ; + } + } +} + +#undef WORK_I +#undef WORK_J + diff --git a/GraphBLAS/Source/concat/template/GB_concat_bitmap_bitmap.c b/GraphBLAS/Source/concat/template/GB_concat_bitmap_bitmap.c index 7f4668a562..2baf6c3cdc 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_bitmap_bitmap.c +++ b/GraphBLAS/Source/concat/template/GB_concat_bitmap_bitmap.c @@ -2,12 +2,15 @@ // GB_concat_bitmap_bitmap: concatenate a bitmap tile into a bitmap matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ { + ASSERT (GB_IS_BITMAP (A)) + ASSERT (GB_IS_BITMAP (C)) ; + const int A_nthreads = GB_nthreads (anz, chunk, nthreads_max) ; const int8_t *restrict Ab = A->b ; int64_t pA ; diff --git a/GraphBLAS/Source/concat/template/GB_concat_bitmap_full.c b/GraphBLAS/Source/concat/template/GB_concat_bitmap_full.c index f589c93b47..fb722369b0 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_bitmap_full.c +++ b/GraphBLAS/Source/concat/template/GB_concat_bitmap_full.c @@ -2,12 +2,15 @@ // GB_concat_bitmap_full: concatenate a full tile into a bitmap matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ { + ASSERT (GB_IS_FULL (A)) + ASSERT (GB_IS_BITMAP (C)) ; + const int A_nthreads = GB_nthreads (anz, chunk, nthreads_max) ; int64_t pA ; #pragma omp parallel for num_threads(A_nthreads) schedule(static) diff --git a/GraphBLAS/Source/concat/template/GB_concat_bitmap_sparse.c b/GraphBLAS/Source/concat/template/GB_concat_bitmap_sparse.c index 8ea4dfb430..75ac88868c 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_bitmap_sparse.c +++ b/GraphBLAS/Source/concat/template/GB_concat_bitmap_sparse.c @@ -2,12 +2,14 @@ // GB_concat_bitmap_sparse: concatenate a sparse tile into a bitmap matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ { + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; + ASSERT (GB_IS_BITMAP (C)) ; #ifdef GB_JIT_KERNEL GB_WERK_DECLARE (A_ek_slicing, int64_t) ; @@ -18,9 +20,10 @@ int A_nthreads, A_ntasks ; GB_A_NHELD (A_nnz_held) ; GB_SLICE_MATRIX_WORK (A, 1, A_nnz_held + A->nvec, A_nnz_held) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; int tid ; #pragma omp parallel for num_threads(A_nthreads) schedule(static) @@ -30,16 +33,15 @@ int64_t klast = klast_Aslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t jC = cvstart + j ; int64_t pC_start = cistart + jC * cvlen ; - GB_GET_PA (pA_start, pA_end, tid, k, - kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; GB_PRAGMA_SIMD for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pC = pC_start + i ; // Cx [pC] = Ax [pA] ; GB_COPY (pC, pA, A_iso) ; diff --git a/GraphBLAS/Source/concat/template/GB_concat_bitmap_template.c b/GraphBLAS/Source/concat/template/GB_concat_bitmap_template.c index d88fd8b81f..a4dc4df1f4 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_bitmap_template.c +++ b/GraphBLAS/Source/concat/template/GB_concat_bitmap_template.c @@ -2,7 +2,7 @@ // GB_concat_bitmap_template: concatenate a tile into a bitmap matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,22 +10,26 @@ { //-------------------------------------------------------------------------- - // get C and the tile A + // get C (bitmap) and the tile A (any sparsity) //-------------------------------------------------------------------------- + ASSERT (GB_IS_BITMAP (C)) ; + #ifdef GB_JIT_KERNEL - #define A_iso GB_A_ISO const int64_t avdim = A->vdim ; const int64_t avlen = A->vlen ; const int64_t cvlen = C->vlen ; const int64_t anz = avlen * avdim ; - #else - const bool A_iso = A->iso ; #endif #ifndef GB_ISO_CONCAT const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + #ifdef GB_JIT_KERNEL + #define A_iso GB_A_ISO + #else + const bool A_iso = A->iso ; + #endif #endif int8_t *restrict Cb = C->b ; diff --git a/GraphBLAS/Source/concat/template/GB_concat_full_template.c b/GraphBLAS/Source/concat/template/GB_concat_full_template.c index 131a42f2d4..9380820bca 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_full_template.c +++ b/GraphBLAS/Source/concat/template/GB_concat_full_template.c @@ -2,7 +2,7 @@ // GB_concat_full_template: concatenate a full tile into a full matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/concat/template/GB_concat_sparse_template.c b/GraphBLAS/Source/concat/template/GB_concat_sparse_template.c index 4aac44f082..0833dd0cb4 100644 --- a/GraphBLAS/Source/concat/template/GB_concat_sparse_template.c +++ b/GraphBLAS/Source/concat/template/GB_concat_sparse_template.c @@ -2,7 +2,7 @@ // GB_concat_sparse_template: concatenate a tile into a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,20 +16,27 @@ // get C and the tile A //-------------------------------------------------------------------------- + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A) || GB_IS_FULL (A)) ; + #ifndef GB_ISO_CONCAT const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif #ifdef GB_JIT_KERNEL - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; int64_t avlen = A->vlen ; - int64_t *restrict Ci = C->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; const int64_t *restrict kfirst_Aslice = A_ek_slicing ; const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + #if GB_Cp_IS_32 + const uint32_t *restrict W = W_parameter ; + #else + const uint64_t *restrict W = W_parameter ; + #endif #endif //-------------------------------------------------------------------------- @@ -44,41 +51,16 @@ int64_t klast = klast_Aslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_A (Ah, k) ; - const int64_t pC_start = W [j] ; + int64_t j = GBh_A (Ah, k) ; + const int64_t pC_start = GB_IGET (W, j) ; //------------------------------------------------------------------ // find the part of the kth vector A(:,j) for this task //------------------------------------------------------------------ -#if 0 - int64_t pA_start, pA_end ; - // as done by GB_GET_PA, but also get p0 = Ap [k] - const int64_t p0 = GBP_A (Ap, k, avlen) ; - const int64_t p1 = GBP_A (Ap, k+1, avlen) ; - if (k == kfirst) - { - // First vector for task tid; may only be partially owned. - pA_start = pstart_Aslice [tid] ; - pA_end = GB_IMIN (p1, pstart_Aslice [tid+1]) ; - } - else if (k == klast) - { - // Last vector for task tid; may only be partially owned. - pA_start = p0 ; - pA_end = pstart_Aslice [tid+1] ; - } - else - { - // task tid entirely owns this vector A(:,k). - pA_start = p0 ; - pA_end = p1 ; - } -#endif - - const int64_t p0 = GBP_A (Ap, k, avlen) ; + const int64_t p0 = GBp_A (Ap, k, avlen) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - p0, GBP_A (Ap, k+1, avlen)) ; + p0, GBp_A (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // append A(:,j) onto C(:,j) @@ -87,9 +69,10 @@ GB_PRAGMA_SIMD for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = GBI_A (Ai, pA, avlen) ; // i = Ai [pA] + int64_t i = GBi_A (Ai, pA, avlen) ; // i = Ai [pA] int64_t pC = pC_start + pA - p0 ; - Ci [pC] = cistart + i ; + int64_t ci = cistart + i ; + GB_ISET (Ci, pC, ci) ; // Ci [pC] = ci ; // Cx [pC] = Ax [pA] ; GB_COPY (pC, pA, A_iso) ; } diff --git a/GraphBLAS/Source/container/GB_container.h b/GraphBLAS/Source/container/GB_container.h new file mode 100644 index 0000000000..d0a8f94b11 --- /dev/null +++ b/GraphBLAS/Source/container/GB_container.h @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// GB_container.h: Container methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_CONTAINER_H +#define GB_CONTAINER_H + +#include "GB.h" + +// ensure a Container->component exists and is valid +#define GB_CHECK_CONTAINER_COMPONENT(Container,component,type) \ + if (Container->component == NULL) \ + { \ + GB_OK (GB_container_component_new (&(Container->component), type)) ; \ + } \ + GB_RETURN_IF_INVALID (Container->component) ; \ + ASSERT_VECTOR_OK (Container->component, "Container component", GB0) ; + +#define GB_CHECK_CONTAINER(Container) \ + GB_CHECK_CONTAINER_COMPONENT (Container, p, GrB_UINT32) ; \ + GB_CHECK_CONTAINER_COMPONENT (Container, h, GrB_UINT32) ; \ + GB_CHECK_CONTAINER_COMPONENT (Container, b, GrB_INT8) ; \ + GB_CHECK_CONTAINER_COMPONENT (Container, i, GrB_UINT32) ; \ + GB_CHECK_CONTAINER_COMPONENT (Container, x, GrB_BOOL) ; + +void GB_vector_load +( + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + bool readonly // if true, X is treated as readonly +) ; + +GrB_Info GB_vector_unload +( + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + bool *readonly, // if true, X is treated as readonly + GB_Werk Werk +) ; + +GrB_Info GB_unload_into_container // GrB_Matrix -> GxB_Container +( + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + GB_Werk Werk +) ; + +GrB_Info GB_load_from_container // GxB_Container -> GrB_Matrix +( + GrB_Matrix A, // matrix to load from the Container + GxB_Container Container, // Container with contents to load into A + GB_Werk Werk +) ; + +void GB_vector_reset // clear almost all prior content; making V length 0 +( + GrB_Vector V +) ; + +GrB_Info GB_container_component_new +( + GrB_Vector *component, + GrB_Type type +) ; + +#endif + diff --git a/GraphBLAS/Source/container/GB_container_component_new.c b/GraphBLAS/Source/container/GB_container_component_new.c new file mode 100644 index 0000000000..db2e23be07 --- /dev/null +++ b/GraphBLAS/Source/container/GB_container_component_new.c @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// GB_container_component_new: create a new component for a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_container.h" +#define GB_FREE_ALL ; + +GrB_Info GB_container_component_new +( + GrB_Vector *component, + GrB_Type type +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + ASSERT (component != NULL) ; + + //-------------------------------------------------------------------------- + // allocate a length-0 full vector and initialize its contents + //-------------------------------------------------------------------------- + + GB_OK (GB_new ((GrB_Matrix *) component, + type, 0, 1, GB_ph_null, /* is_csc: */ true, GxB_FULL, + GB_HYPER_SWITCH_DEFAULT, 0, /* pji: */ false, false, false)) ; + + GB_vector_reset (*component) ; + + ASSERT_VECTOR_OK (*component, "new component", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GB_load_from_container.c b/GraphBLAS/Source/container/GB_load_from_container.c new file mode 100644 index 0000000000..8102f35883 --- /dev/null +++ b/GraphBLAS/Source/container/GB_load_from_container.c @@ -0,0 +1,333 @@ +//------------------------------------------------------------------------------ +// GB_load_from_container: load a GrB_Matrix from a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A->user_name and all controls are preserved. Everything else in the matrix +// A is revised: the dimensions, type, content, 32/64 integer status, iso +// status, jumbled status, orientation (by row/col), etc. + +#include "GB_container.h" +#define GB_FREE_ALL GB_phybix_free (A) ; + +static inline bool GB_type_ok (GrB_Type type) +{ + return (type == GrB_INT32 || type == GrB_UINT32 || + type == GrB_INT64 || type == GrB_UINT64) ; +} + +//------------------------------------------------------------------------------ +// GB_load_from_container +//------------------------------------------------------------------------------ + +GrB_Info GB_load_from_container // GxB_Container -> GrB_Matrix +( + GrB_Matrix A, // matrix to load from the Container + GxB_Container Container, // Container with contents to load into A + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + ASSERT_MATRIX_OK (A, "A to load from Container", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (Container->Y, "Container->Y before load", GB0) ; + GB_CHECK_CONTAINER (Container) ; + + //-------------------------------------------------------------------------- + // free any prior content of A + //-------------------------------------------------------------------------- + + GB_phybix_free (A) ; + + //-------------------------------------------------------------------------- + // load the matrix from the container + //-------------------------------------------------------------------------- + + int format = Container->format ; + uint64_t nvals = (format == GxB_FULL) ? 0 : (Container->nvals) ; + uint64_t nrows = Container->nrows ; + uint64_t ncols = Container->ncols ; + + A->nvals = nvals ; + A->is_csc = (Container->orientation == GrB_COLMAJOR) ; + A->vlen = (A->is_csc) ? nrows : ncols ; + A->vdim = (A->is_csc) ? ncols : nrows ; + +// A->nvec_nonempty = (A->is_csc) ? +// Container->ncols_nonempty : Container->nrows_nonempty ; + GB_nvec_nonempty_set (A, (A->is_csc) ? + Container->ncols_nonempty : Container->nrows_nonempty) ; + + A->iso = Container->iso ; + A->jumbled = false ; + uint64_t plen1 = 0, plen, Ab_len = 0, Ax_len = 0, Ai_len = 0 ; + GrB_Type Ap_type = NULL, Ah_type = NULL, Ab_type = NULL, Ai_type = NULL ; + uint64_t Ah_size = 0, Ap_size = 0, Ai_size = 0, Ab_size = 0, Ax_size = 0 ; + uint64_t nrows_times_ncols = UINT64_MAX ; + bool okb = GB_uint64_multiply (&nrows_times_ncols, nrows, ncols) ; + bool ok = true ; + bool jumbled = Container->jumbled ; + + // determine the A->j_is_32 condition when Container->h is empty + bool h_empty = (Container->h == NULL || + (Container->h->vlen == 0 && Container->h->x == NULL)) ; + if ((format == GxB_SPARSE) || (format == GxB_HYPERSPARSE && h_empty)) + { + bool Ap_is_32, Aj_is_32, Ai_is_32 ; + GB_determine_pji_is_32 (&Ap_is_32, &Aj_is_32, &Ai_is_32, + GxB_SPARSE, A->nvals, A->vlen, A->vdim, Werk) ; + Ah_type = Aj_is_32 ? GrB_UINT32 : GrB_UINT64 ; + } + + // clear the Container scalars + Container->nrows = 0 ; + Container->ncols = 0 ; + Container->nrows_nonempty = -1 ; + Container->ncols_nonempty = -1 ; + Container->nvals = 0 ; + Container->format = GxB_FULL ; + Container->orientation = GrB_ROWMAJOR ; + Container->iso = false ; + Container->jumbled = false ; + + // Get or clear the phybix content: Ap, Ah, A->Y, A->b, A->i, and A->x, + // depending on the format of the data held in the container. + + switch (format) + { + + case GxB_HYPERSPARSE : + + //------------------------------------------------------------------ + // hypersparse: load A->p, A->h, A->Y, and A->i from the container + //------------------------------------------------------------------ + + // load A->p + GB_OK (GB_vector_unload (Container->p, &(A->p), &Ap_type, + &plen1, &Ap_size, &(A->p_shallow), Werk)) ; + A->p_size = (size_t) Ap_size ; + ok = GB_type_ok (Ap_type) ; + + // load or create A->h + if (h_empty) + { + // A is an empty hypersparse matrix but A->h must not be NULL; + // allocate space for A->h of type Ah_type for a single entry + // Ah_type is uint32 or uint64, so sizeof (uint64_t) is fine. + plen = 0 ; + size_t s = 0 ; + A->h = GB_CALLOC_MEMORY (1, sizeof (uint64_t), &s) ; + if (A->h == NULL) + { + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + Ah_size = (uint64_t) s ; + A->h_shallow = false ; + } + else + { + GB_OK (GB_vector_unload (Container->h, &(A->h), &Ah_type, + &plen, &Ah_size, &(A->h_shallow), Werk)) ; + } + A->h_size = (size_t) Ah_size ; + ok = ok && GB_type_ok (Ah_type) ; + + // load A->Y + A->Y = Container->Y ; + Container->Y = NULL ; + + // clear Container->b + GB_vector_reset (Container->b) ; + + // load A->i + GB_OK (GB_vector_unload (Container->i, &(A->i), &Ai_type, + &Ai_len, &Ai_size, &(A->i_shallow), Werk)) ; + A->i_size = (size_t) Ai_size ; + ok = ok && GB_type_ok (Ai_type) ; + + // define plen, nvec, and jumbled + A->plen = plen ; + A->nvec = plen ; + A->jumbled = jumbled ; + + // basic sanity checks + if (!ok || plen1 != plen + 1 || + !(A->nvec >= 0 && A->nvec <= A->plen && A->plen <= A->vdim)) + { + GB_FREE_ALL ; + return (GrB_INVALID_VALUE) ; + } + break ; + + case GxB_SPARSE : + + //------------------------------------------------------------------ + // sparse: load A->p and A->i from the container + //------------------------------------------------------------------ + + // load A->p + GB_OK (GB_vector_unload (Container->p, &(A->p), &Ap_type, + &plen1, &Ap_size, &(A->p_shallow), Werk)) ; + A->p_size = (size_t) Ap_size ; + ok = GB_type_ok (Ap_type) ; + + // clear Container->h, Y, and b + GB_vector_reset (Container->h) ; + GB_Matrix_free (&(Container->Y)) ; + GB_vector_reset (Container->b) ; + + // load A->i + GB_OK (GB_vector_unload (Container->i, &(A->i), &Ai_type, + &Ai_len, &Ai_size, &(A->i_shallow), Werk)) ; + A->i_size = (size_t) Ai_size ; + ok = ok && GB_type_ok (Ai_type) ; + + // define plen, nvec, and jumbled + A->plen = plen1 - 1 ; + A->nvec = A->plen ; + A->jumbled = jumbled ; + + // basic sanity checks + if (!ok || !(A->nvec == A->plen && A->plen == A->vdim)) + { + GB_FREE_ALL ; + return (GrB_INVALID_VALUE) ; + } + break ; + + case GxB_BITMAP : + + //------------------------------------------------------------------ + // bitmap: load A->b from the container + //------------------------------------------------------------------ + + // clear Container->p, h, and Y + GB_vector_reset (Container->p) ; + GB_vector_reset (Container->h) ; + GB_Matrix_free (&(Container->Y)) ; + + // load A->b + GB_OK (GB_vector_unload (Container->b, (void **) &(A->b), &Ab_type, + &Ab_len, &Ab_size, &(A->b_shallow), Werk)) ; + A->b_size = (size_t) Ab_size ; + + // clear Container->i + GB_vector_reset (Container->i) ; + + // define plen and nvec + A->plen = -1 ; + A->nvec = A->vdim ; + + // basic sanity checks + if (Ab_type != GrB_INT8 || !okb || Ab_len < nrows_times_ncols) + { + GB_FREE_ALL ; + return (GrB_INVALID_VALUE) ; + } + break ; + + case GxB_FULL : + + //------------------------------------------------------------------ + // full: clear phybi components + //------------------------------------------------------------------ + + GB_vector_reset (Container->p) ; + GB_vector_reset (Container->h) ; + GB_Matrix_free (&(Container->Y)) ; + GB_vector_reset (Container->b) ; + GB_vector_reset (Container->i) ; + + // define plen and nvec + A->plen = -1 ; + A->nvec = A->vdim ; + break ; + + default :; + break ; + } + + // load A->x + GB_OK (GB_vector_unload (Container->x, &(A->x), &(A->type), + &Ax_len, &Ax_size, &(A->x_shallow), Werk)) ; + A->x_size = (size_t) Ax_size ; + + // define the integer types + A->p_is_32 = (Ap_type == GrB_UINT32 || Ap_type == GrB_INT32) ; + A->j_is_32 = (Ah_type == GrB_UINT32 || Ah_type == GrB_INT32) ; + A->i_is_32 = (Ai_type == GrB_UINT32 || Ai_type == GrB_INT32) ; + + //-------------------------------------------------------------------------- + // more basic sanity checks + //-------------------------------------------------------------------------- + + // Loading a GrB_Matrix from a Container takes O(1) time, so there is not + // enough time to test the entire content of the matrix to see if it's + // valid. The user application can do that with GxB_Matrix_fprint with a + // print level of zero, after the matrix is loaded. + + // ensure Ax_len is the right size + if (A->iso) + { + // A->x must have size >= 1 for all iso matrices + ok = (Ax_len >= 1) ; + } + else if (format == GxB_HYPERSPARSE || format == GxB_SPARSE) + { + // A->x must have size >= A->nvals for non-iso sparse/hypersparse + ok = (Ax_len >= A->nvals) ; + } + else // A is full or bitmap + { + // A->x must have size >= nrows*ncols for non-iso full/bitmap + ok = okb && (Ax_len >= nrows_times_ncols) ; + } + + // ensure Ai_len is the right size + if (format == GxB_HYPERSPARSE || format == GxB_SPARSE && ok) + { + // A->i must have size >= A->nvals for sparse/hypersparse + ok = ok && (Ai_len >= A->nvals) ; + + // A->p [A->plen] must match A->nvals + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + ok = ok && (A->nvals == GB_IGET (Ap, A->plen)) ; + } + + // if A->jumbled is true, ensure A has no readonly components + if (A->jumbled) + { + ok = ok && !GB_is_shallow (A) ; + } + + if (!ok) + { + GB_FREE_ALL ; + return (GrB_INVALID_VALUE) ; + } + + // the matrix has passed the basic checks + A->magic = GB_MAGIC ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_MATRIX_OK (A, "A loaded from Container", GB0) ; + ASSERT_VECTOR_OK (Container->p, "Container->p after load", GB0) ; + ASSERT_VECTOR_OK (Container->h, "Container->h after load", GB0) ; + ASSERT_VECTOR_OK (Container->b, "Container->b after load", GB0) ; + ASSERT_VECTOR_OK (Container->i, "Container->i after load", GB0) ; + ASSERT_VECTOR_OK (Container->x, "Container->x after load", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GB_unload_into_container.c b/GraphBLAS/Source/container/GB_unload_into_container.c new file mode 100644 index 0000000000..1f8315739b --- /dev/null +++ b/GraphBLAS/Source/container/GB_unload_into_container.c @@ -0,0 +1,145 @@ +//------------------------------------------------------------------------------ +// GB_unload_into_container: unload a GrB_Matrix into a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This method takes O(1) time and performs no mallocs at all, unless A has +// pending work that must be finished. It typically will perform no frees, +// unless A has an error string in A->logger, or if the Container has prior +// content (which is freed). + +#include "GB_container.h" +#define GB_FREE_ALL ; + +GrB_Info GB_unload_into_container // GrB_Matrix -> GxB_Container +( + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + ASSERT_MATRIX_OK (A, "A to unload into Container", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (Container->Y, "Container->Y before unload", GB0) ; + GB_CHECK_CONTAINER (Container) ; + + //-------------------------------------------------------------------------- + // finish any pending work, but permit A to still be jumbled + //-------------------------------------------------------------------------- + + GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (A) ; + + //-------------------------------------------------------------------------- + // unload the matrix into the container + //-------------------------------------------------------------------------- + + int64_t nvals = GB_nnz (A) ; + int64_t nx = GB_nnz_held (A) ; + bool iso = A->iso ; + bool is_csc = A->is_csc ; + + int64_t nvec_nonempty = GB_nvec_nonempty_get (A) ; + + Container->nrows = (is_csc) ? A->vlen : A->vdim ; + Container->ncols = (is_csc) ? A->vdim : A->vlen ; + Container->nrows_nonempty = (is_csc) ? -1 : nvec_nonempty ; + Container->ncols_nonempty = (is_csc) ? nvec_nonempty : -1 ; + Container->nvals = nvals ; + Container->format = GB_sparsity (A) ; + Container->orientation = (is_csc) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + Container->iso = iso ; + Container->jumbled = A->jumbled ; + + switch (Container->format) + { + + case GxB_HYPERSPARSE : + + // unload A->Y into the Container unless it is entirely shallow + GB_Matrix_free (&(Container->Y)) ; + if (!A->Y_shallow) + { + // A->Y may still have shallow components, which is OK + Container->Y = A->Y ; + A->Y = NULL ; + } + // unload A->p, A->h, and A->i into the Container + GB_vector_load (Container->p, &(A->p), + A->p_is_32 ? GrB_UINT32 : GrB_UINT64, + A->nvec+1, A->p_size, A->p_shallow) ; + GB_vector_load (Container->h, &(A->h), + A->j_is_32 ? GrB_INT32 : GrB_INT64, + A->nvec, A->h_size, A->h_shallow) ; + GB_vector_load (Container->i, &(A->i), + A->i_is_32 ? GrB_INT32 : GrB_INT64, + nvals, A->i_size, A->i_shallow) ; + break ; + + case GxB_SPARSE : + + // unload A->p and A->i into the Container + GB_vector_load (Container->p, &(A->p), + A->p_is_32 ? GrB_UINT32 : GrB_UINT64, + A->plen+1, A->p_size, A->p_shallow) ; + GB_vector_load (Container->i, &(A->i), + A->i_is_32 ? GrB_INT32 : GrB_INT64, + nvals, A->i_size, A->i_shallow) ; + break ; + + case GxB_BITMAP : + + // unload A->b into the Container + GB_vector_load (Container->b, (void **) &(A->b), GrB_INT8, + nx, A->b_size, A->b_shallow) ; + break ; + + case GxB_FULL : + default :; + break ; + } + + // unload A->x into the Container + GB_vector_load (Container->x, &(A->x), A->type, iso ? 1 : nx, + A->x_size, A->x_shallow) ; + + //-------------------------------------------------------------------------- + // change A to a dense 0-by-0 matrix with no content + //-------------------------------------------------------------------------- + + // A->user_name, A->type, and all controls are preserved. Everything else + // is revised. + + GB_phybix_free (A) ; + A->plen = -1 ; + A->vlen = 0 ; + A->vdim = 0 ; +// A->nvec_nonempty = 0 ; + GB_nvec_nonempty_set (A, 0) ; + A->p_is_32 = false ; + A->j_is_32 = false ; + A->i_is_32 = false ; + A->magic = GB_MAGIC ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_MATRIX_OK (A, "A unloaded into Container", GB0) ; + ASSERT_VECTOR_OK (Container->p, "Container->p after unload", GB0) ; + ASSERT_VECTOR_OK (Container->h, "Container->h after unload", GB0) ; + ASSERT_VECTOR_OK (Container->b, "Container->b after unload", GB0) ; + ASSERT_VECTOR_OK (Container->i, "Container->i after unload", GB0) ; + ASSERT_VECTOR_OK (Container->x, "Container->x after unload", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (Container->Y, "Container->Y after unload", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GB_vector_load.c b/GraphBLAS/Source/container/GB_vector_load.c new file mode 100644 index 0000000000..15fef2eb70 --- /dev/null +++ b/GraphBLAS/Source/container/GB_vector_load.c @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// GB_vector_load: load C array into a dense GrB_Vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_container.h" + +void GB_vector_load +( + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + bool readonly // if true, X is treated as readonly +) +{ + + //-------------------------------------------------------------------------- + // clear prior content of V and load X, making V a dense GrB_Vector + //-------------------------------------------------------------------------- + + // V->user_name is preserved; all other content is freed. get/set controls + // (hyper_switch, bitmap_switch, [pji]_control, etc) are preserved, except + // that V->sparsity_control is revised to allow V to become a full vector. + + GB_phybix_free ((GrB_Matrix) V) ; + + V->type = type ; + V->plen = -1 ; + V->vlen = n ; + V->vdim = 1 ; + V->nvec = 1 ; +// V->nvec_nonempty = (n == 0) ? 0 : 1 ; + GB_nvec_nonempty_set ((GrB_Matrix) V, (n == 0) ? 0 : 1) ; + V->nvals = n ; + V->sparsity_control = V->sparsity_control | GxB_FULL ; + V->is_csc = true ; + V->jumbled = false ; + V->iso = false ; + V->p_is_32 = false ; + V->j_is_32 = false ; + V->i_is_32 = false ; + + //-------------------------------------------------------------------------- + // load the content into V + //-------------------------------------------------------------------------- + + V->x = (*X) ; + V->x_shallow = readonly ; + V->x_size = X_size ; + if (!readonly) + { + // tell the caller that X has been moved into V + (*X) = NULL ; + } + + // V is now a valid GrB_Vector of length n, in the full format + V->magic = GB_MAGIC ; +} + diff --git a/GraphBLAS/Source/container/GB_vector_reset.c b/GraphBLAS/Source/container/GB_vector_reset.c new file mode 100644 index 0000000000..6e2609d90d --- /dev/null +++ b/GraphBLAS/Source/container/GB_vector_reset.c @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// GB_vector_reset: empty contents of a GrB_Vector and set its length to 0 +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Clears nearly all prior content of V, making V a full GrB_Vector of length +// zero. The type is not changed. V->user_name is preserved. get/set +// controls (hyper_switch, bitmap_switch, [pji]_control, etc) are preserved, +// except that V->sparsity_control is revised to allow V to become a full +// vector. All other content is freed. + +#include "GB_container.h" + +void GB_vector_reset +( + GrB_Vector V +) +{ + if (V != NULL) + { + GB_phybix_free ((GrB_Matrix) V) ; + V->plen = -1 ; + V->vlen = 0 ; + V->vdim = 1 ; + V->nvec = 1 ; +// V->nvec_nonempty = 0 ; + GB_nvec_nonempty_set ((GrB_Matrix) V, 0) ; + V->nvals = 0 ; + V->sparsity_control = V->sparsity_control | GxB_FULL ; + V->is_csc = true ; + V->p_is_32 = false ; + V->j_is_32 = false ; + V->i_is_32 = false ; + V->magic = GB_MAGIC ; + + // V is now a valid GrB_Vector of length 0, in the full format + ASSERT_VECTOR_OK (V, "V reset", GB0) ; + ASSERT (GB_IS_FULL (V)) ; + } +} + diff --git a/GraphBLAS/Source/container/GB_vector_unload.c b/GraphBLAS/Source/container/GB_vector_unload.c new file mode 100644 index 0000000000..c6b690c50e --- /dev/null +++ b/GraphBLAS/Source/container/GB_vector_unload.c @@ -0,0 +1,111 @@ +//------------------------------------------------------------------------------ +// GB_vector_unload: unload C array from a dense GrB_Vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This method is guaranteed to take O(1) time and space, if on input V is a +// non-iso vector in the full data format. + +// On input, V is a GrB_Vector with nvals(V) == length(V), in any data format. +// That is, all entries of V must be present. If this condition does not hold, +// the method returns an error code, GrB_INVALID_OBJECT, indicating that the +// vector is not a valid input for this method. + +// V is returned as valid full vector of length 0 with no content (V->x == +// NULL). It type is not changed. If on input V was in the full data format, +// then no mallocs/frees are performed. + +// If readonly is returned as true, then V was created as a "shallow" vector +// by GxB_Vector_load. Its numerical content, V->x = (*X), was "shallow" and +// thus treated as readonly by GraphBLAS. Its allocation/deallocation is the +// responsibility of the user application that created V via GxB_Vector_load. + +// On output, *X is a pointer to the numerical contents of V. If V had length +// zero on input, *X may be returned as a NULL pointer (which is not an error). + +// X is not removed from the debug memtable since this method is used +// internally to move data between GraphBLAS objects. See GxB_Vector_unload, +// which unloads a GrB_Vector and gives the memory space to the user +// application. + +#include "GB_container.h" +#define GB_FREE_ALL ; + +GrB_Info GB_vector_unload +( + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + bool *readonly, // if true, X is treated as readonly + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL (type) ; + GB_RETURN_IF_NULL (X) ; + GB_RETURN_IF_NULL (n) ; + GB_RETURN_IF_NULL (X_size) ; + ASSERT_VECTOR_OK (V, "V to unload", GB0) ; + + //-------------------------------------------------------------------------- + // finish any pending work and ensure V is not iso + //-------------------------------------------------------------------------- + + // This will do nothing (and take O(1) time) if the GrB_Vector V is a + // component of a Container obtained by unloading a GrB_Matrix or + // GrB_Vector into the Container. + + if (GB_ANY_PENDING_WORK (V)) + { + GB_OK (GB_wait ((GrB_Matrix) V, "V_to_unload", Werk)) ; + } + if (!GB_is_dense ((GrB_Matrix) V)) + { + // V must be dense with all entries present + return (GrB_INVALID_OBJECT) ; + } + GB_OK (GB_convert_any_to_non_iso ((GrB_Matrix) V, true)) ; + ASSERT_VECTOR_OK (V, "V ready to unload", GB0) ; + + //-------------------------------------------------------------------------- + // unload the content from V into X + //-------------------------------------------------------------------------- + + (*X) = V->x ; + (*n) = V->vlen ; + (*X_size) = V->x_size ; + (*type) = V->type ; + (*readonly) = V->x_shallow ; + V->x = NULL ; + V->x_size = 0 ; + V->x_shallow = false ; + + //-------------------------------------------------------------------------- + // clear prior content of V, making V a dense GrB_Vector of length 0 + //-------------------------------------------------------------------------- + + GB_vector_reset (V) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_VECTOR_OK (V, "V unloaded", GB0) ; + ASSERT (GB_IS_FULL (V)) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_Container_free.c b/GraphBLAS/Source/container/GxB_Container_free.c new file mode 100644 index 0000000000..c35fd8aa6d --- /dev/null +++ b/GraphBLAS/Source/container/GxB_Container_free.c @@ -0,0 +1,46 @@ +//------------------------------------------------------------------------------ +// GxB_Container_free: free a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_container.h" + +GrB_Info GxB_Container_free +( + GxB_Container *Container +) +{ + + if (Container != NULL && (*Container) != NULL) + { + + //---------------------------------------------------------------------- + // free each GrB_Vector component of the Container + //---------------------------------------------------------------------- + + GB_Matrix_free ((GrB_Matrix *) &((*Container)->p)) ; + GB_Matrix_free ((GrB_Matrix *) &((*Container)->h)) ; + GB_Matrix_free ((GrB_Matrix *) &((*Container)->b)) ; + GB_Matrix_free ((GrB_Matrix *) &((*Container)->i)) ; + GB_Matrix_free ((GrB_Matrix *) &((*Container)->x)) ; + + //---------------------------------------------------------------------- + // free each GrB_Matrix component of the Container + //---------------------------------------------------------------------- + + GB_Matrix_free (&((*Container)->Y)) ; + + //---------------------------------------------------------------------- + // free the Container itself + //---------------------------------------------------------------------- + + GB_FREE_MEMORY (Container, sizeof (struct GxB_Container_struct)) ; + } + + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_Container_new.c b/GraphBLAS/Source/container/GxB_Container_new.c new file mode 100644 index 0000000000..568b314d49 --- /dev/null +++ b/GraphBLAS/Source/container/GxB_Container_new.c @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// GxB_Container_new: create a new Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_container.h" +#define GB_FREE_ALL GxB_Container_free (Container) ; + +//------------------------------------------------------------------------------ +// GxB_Container_new +//------------------------------------------------------------------------------ + +GrB_Info GxB_Container_new +( + GxB_Container *Container +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL (Container) ; + (*Container) = NULL ; + + //-------------------------------------------------------------------------- + // allocate the new Container + //-------------------------------------------------------------------------- + + size_t header_size ; + (*Container) = GB_CALLOC_MEMORY (1, sizeof (struct GxB_Container_struct), + &header_size) ; + if (*Container == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + + // clear the Container scalars + (*Container)->nrows = 0 ; + (*Container)->ncols = 0 ; + (*Container)->nrows_nonempty = -1 ; + (*Container)->ncols_nonempty = -1 ; + (*Container)->nvals = 0 ; + (*Container)->format = GxB_FULL ; + (*Container)->orientation = GrB_ROWMAJOR ; + (*Container)->iso = false ; + (*Container)->jumbled = false ; + + //-------------------------------------------------------------------------- + // allocate the p, h, b, i and x components + //-------------------------------------------------------------------------- + + GB_OK (GB_container_component_new (&((*Container)->p), GrB_UINT32)) ; + GB_OK (GB_container_component_new (&((*Container)->h), GrB_INT32)) ; + GB_OK (GB_container_component_new (&((*Container)->b), GrB_INT8)) ; + GB_OK (GB_container_component_new (&((*Container)->i), GrB_INT32)) ; + GB_OK (GB_container_component_new (&((*Container)->x), GrB_BOOL)) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_Vector_load.c b/GraphBLAS/Source/container/GxB_Vector_load.c new file mode 100644 index 0000000000..7011882aa5 --- /dev/null +++ b/GraphBLAS/Source/container/GxB_Vector_load.c @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_load: load C array into a dense GrB_Vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This method is guaranteed to take O(1) time and space. If V starts as +// dense vector of length 0 with no content (V->x == NULL), then no malloc +// or frees are performed. + +// If readonly is true, then V is created as a "shallow" vector. Its +// numerical content, V->x = (*X), is "shallow" and thus treated as readonly +// by GraphBLAS. It is not freed if V is freed with GrB_Vector_free. (*X) +// need not be a malloc'd array at all. Its allocation/deallocation is the +// responsibility of the user application. + +// V is returned as a non-iso vector of length n, in the full data format. + +// If handling is GxB_IS_READONLY, *X is returned unchanged. Otherwise, it is +// returned as NULL to indicate that it has been moved into V. + +// The vector V may have readonly components on input; they are simply removed +// from V and not modified. + +#include "GB_container.h" + +GrB_Info GxB_Vector_load +( + // input/output: + GrB_Vector V, // vector to load from the C array X + void **X, // numerical array to load into V + // input: + GrB_Type type, // type of X + uint64_t n, // # of entries in X + uint64_t X_size, // size of X in bytes (at least n*(sizeof the type)) + int handling, // GrB_DEFAULT (0): transfer ownership to GraphBLAS + // GxB_IS_READONLY: X treated as readonly; + // ownership kept by the user application + const GrB_Descriptor desc // currently unused; for future expansion +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL_OR_FAULTY (type) ; + GB_RETURN_IF_NULL (X) ; + if (n > 0) + { + GB_RETURN_IF_NULL (*X) ; + } + if (X_size < n * type->size) + { + // X is too small + return (GrB_INVALID_VALUE) ; + } + ASSERT_VECTOR_OK (V, "V to load (contents mostly ignored)", GB0) ; + + //-------------------------------------------------------------------------- + // clear prior content of V and load X, making V a dense GrB_Vector + //-------------------------------------------------------------------------- + + // V->user_name is preserved; all other content is freed. get/set controls + // (hyper_switch, bitmap_switch, [pji]_control, etc) are preserved, except + // that V->sparsity_control is revised to allow V to become a full vector. + + bool readonly = (handling != GrB_DEFAULT) ; + if (!readonly) + { + // *X is given to GraphBLAS to be owned by the vector V, so add it to + // the global debug memtable. + GB_Global_memtable_add (*X, X_size) ; + } + + GB_vector_load (V, X, type, n, X_size, readonly) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_VECTOR_OK (V, "V loaded", GB0) ; + ASSERT (GB_IS_FULL (V)) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_Vector_unload.c b/GraphBLAS/Source/container/GxB_Vector_unload.c new file mode 100644 index 0000000000..f1a118357c --- /dev/null +++ b/GraphBLAS/Source/container/GxB_Vector_unload.c @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_unload: unload C array from a dense GrB_Vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This method is guaranteed to take O(1) time and space, if on input V is a +// non-iso vector in the full data format. + +// On input, V is a GrB_Vector with nvals(V) == length(V), in any data format. +// That is, all entries of V must be present. If this condition does not hold, +// the method returns an error code, GrB_INVALID_OBJECT, indicating that the +// vector is not a valid input for this method. + +// V is returned as valid full vector of length 0 with no content (V->x == +// NULL). It type is not changed. If on input V was in the full data format, +// then no mallocs/frees are performed. + +// If readonly is returned as true, then V was created as a "shallow" vector +// by GxB_Vector_load. Its numerical content, V->x = (*X), was "shallow" and +// thus treated as readonly by GraphBLAS. Its allocation/deallocation is the +// responsibility of the user application that created V via GxB_Vector_load. + +// On output, *X is a pointer to the numerical contents of V. If V had length +// zero on input, *X may be returned as a NULL pointer (which is not an error). + +// This method removes X from the debug memtable, since X is being returned +// to the user application. + +#include "GB_container.h" +#define GB_FREE_ALL ; + +GrB_Info GxB_Vector_unload +( + // input/output: + GrB_Vector V, // vector to unload + void **X, // numerical array to unload from V + // output: + GrB_Type *type, // type of X + uint64_t *n, // # of entries in X + uint64_t *X_size, // size of X in bytes (at least n*(sizeof the type)) + int *handling, // see GxB_Vector_load + const GrB_Descriptor desc // currently unused; for future expansion +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + // just check V; other inputs are checked in GB_vector_unload + GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL (handling) ; + GB_WHERE_1 (V, "GxB_Vector_unload") ; + ASSERT_VECTOR_OK (V, "V to unload", GB0) ; + + //-------------------------------------------------------------------------- + // unload the vector + //-------------------------------------------------------------------------- + + bool readonly ; + GB_OK (GB_vector_unload (V, X, type, n, X_size, &readonly, Werk)) ; + GBMDUMP ("vector_unload, remove X from memtable %p\n", *X) ; + if (!readonly) + { + // *X is given to the user application, so remove it from the debug + // global memtable + GB_Global_memtable_remove (*X) ; + } + (*handling) = readonly ? GxB_IS_READONLY : GrB_DEFAULT ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_load_Matrix_from_Container.c b/GraphBLAS/Source/container/GxB_load_Matrix_from_Container.c new file mode 100644 index 0000000000..fb97c2a223 --- /dev/null +++ b/GraphBLAS/Source/container/GxB_load_Matrix_from_Container.c @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// GxB_load_Matrix_from_Container: load a GrB_Matrix from a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// The matrix A may have readonly components on input; they are simply removed +// from A and not modified. + +#include "GB_container.h" + +GrB_Info GxB_load_Matrix_from_Container // GrB_Matrix <- GxB_Container +( + GrB_Matrix A, // matrix to load from the Container. On input, + // A is a matrix of any size or type; on output + // any prior size, type, or contents is freed + // and overwritten with the Container. + GxB_Container Container, // Container with contents to load into A + const GrB_Descriptor desc // currently unused +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (Container) ; + GB_WHERE_1 (A, "GxB_load_Matrix_from_Container") ; + + //-------------------------------------------------------------------------- + // load the matrix from the container + //-------------------------------------------------------------------------- + + return (GB_load_from_container (A, Container, Werk)) ; +} + diff --git a/GraphBLAS/Source/container/GxB_load_Vector_from_Container.c b/GraphBLAS/Source/container/GxB_load_Vector_from_Container.c new file mode 100644 index 0000000000..ecf37c79cb --- /dev/null +++ b/GraphBLAS/Source/container/GxB_load_Vector_from_Container.c @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// GxB_load_Vector_from_Container: load a GrB_Vector from a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// The vector V may have readonly components on input; they are simply removed +// from V and not modified. + +#include "GB_container.h" +#define GB_FREE_ALL GB_phybix_free ((GrB_Matrix) V) ; + +GrB_Info GxB_load_Vector_from_Container // GrB_Vector <- GxB_Container +( + GrB_Vector V, // vector to load from the Container + GxB_Container Container, // Container with contents to load into A + const GrB_Descriptor desc // currently unused +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL (Container) ; + GB_WHERE_1 (V, "GxB_load_Vector_from_Container") ; + + //-------------------------------------------------------------------------- + // load the vector from the container + //-------------------------------------------------------------------------- + + GB_OK (GB_load_from_container ((GrB_Matrix) V, Container, Werk)) ; + GB_OK ((GB_VECTOR_OK (V) ? GrB_SUCCESS : GrB_INVALID_OBJECT)) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/container/GxB_unload_Matrix_into_Container.c b/GraphBLAS/Source/container/GxB_unload_Matrix_into_Container.c new file mode 100644 index 0000000000..4bded54b14 --- /dev/null +++ b/GraphBLAS/Source/container/GxB_unload_Matrix_into_Container.c @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// GxB_unload_Matrix_into_Container: unload a GrB_Matrix into a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A is returned as a 0-by-0 matrix in full data format, with no content. + +#include "GB_container.h" + +GrB_Info GxB_unload_Matrix_into_Container // GrB_Matrix -> GxB_Container +( + GrB_Matrix A, // matrix to unload into the Container + GxB_Container Container, // Container to hold the contents of A + const GrB_Descriptor desc // currently unused +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (Container) ; + GB_WHERE_1 (A, "GxB_Matrix_unload_into_Container") ; + + //-------------------------------------------------------------------------- + // unload the matrix into the container + //-------------------------------------------------------------------------- + + return (GB_unload_into_container (A, Container, Werk)) ; +} + diff --git a/GraphBLAS/Source/container/GxB_unload_Vector_into_Container.c b/GraphBLAS/Source/container/GxB_unload_Vector_into_Container.c new file mode 100644 index 0000000000..24d6b5e097 --- /dev/null +++ b/GraphBLAS/Source/container/GxB_unload_Vector_into_Container.c @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// GxB_unload_Vector_into_Container: unload a GrB_Vector into a Container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// V is returned as a length-0 vector in full data format, with no content. + +#include "GB_container.h" +#define GB_FREE_ALL ; + +GrB_Info GxB_unload_Vector_into_Container // GrB_Vector -> GxB_Container +( + GrB_Vector V, // vector to unload into the Container + GxB_Container Container, // Container to hold the contents of V + const GrB_Descriptor desc // currently unused +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL (Container) ; + GB_WHERE_1 (V, "GxB_Vector_unload_into_Container") ; + ASSERT_VECTOR_OK (V, "Vector to unload into container", GB0) ; + + //-------------------------------------------------------------------------- + // unload the vector + //-------------------------------------------------------------------------- + + GB_OK (GB_unload_into_container ((GrB_Matrix) V, Container, Werk)) ; + V->vdim = 1 ; + V->nvec = 1 ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_VECTOR_OK (V, "Vector unloaded", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/context/GB_Context.c b/GraphBLAS/Source/context/GB_Context.c index 2a94fe7574..ba7e0dcb92 100644 --- a/GraphBLAS/Source/context/GB_Context.c +++ b/GraphBLAS/Source/context/GB_Context.c @@ -2,7 +2,7 @@ // GB_Context.c: Context object for computational resources //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/context/GB_Context.h b/GraphBLAS/Source/context/GB_Context.h index f15805cdc2..8bc4147b26 100644 --- a/GraphBLAS/Source/context/GB_Context.h +++ b/GraphBLAS/Source/context/GB_Context.h @@ -2,7 +2,7 @@ // GB_Context.h: definitions for the GraphBLAS Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/context/GxB_Context_disengage.c b/GraphBLAS/Source/context/GxB_Context_disengage.c index 2e02eb0142..e4323c0b75 100644 --- a/GraphBLAS/Source/context/GxB_Context_disengage.c +++ b/GraphBLAS/Source/context/GxB_Context_disengage.c @@ -2,7 +2,7 @@ // GxB_Context_disengage: disengage a Context for this user thread //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/context/GxB_Context_engage.c b/GraphBLAS/Source/context/GxB_Context_engage.c index c7c77e499d..92de752102 100644 --- a/GraphBLAS/Source/context/GxB_Context_engage.c +++ b/GraphBLAS/Source/context/GxB_Context_engage.c @@ -2,7 +2,7 @@ // GxB_Context_engage: engage a Context for this user thread //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,17 +36,7 @@ GrB_Info GxB_Context_engage // engage a Context GxB_Context Context // Context to engage ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - GB_RETURN_IF_NULL_OR_FAULTY (Context) ; - - //-------------------------------------------------------------------------- - // engage the Context - //-------------------------------------------------------------------------- - return (GB_Context_engage (Context)) ; } diff --git a/GraphBLAS/Source/context/GxB_Context_free.c b/GraphBLAS/Source/context/GxB_Context_free.c index 32b975961b..4c7d78efbc 100644 --- a/GraphBLAS/Source/context/GxB_Context_free.c +++ b/GraphBLAS/Source/context/GxB_Context_free.c @@ -2,7 +2,7 @@ // GxB_Context_free: free a Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,12 +35,12 @@ GrB_Info GxB_Context_free // free a Context { size_t header_size = Context->header_size ; // free the Context user_name - GB_FREE (&(Context->user_name), Context->user_name_size) ; + GB_FREE_MEMORY (&(Context->user_name), Context->user_name_size) ; if (header_size > 0) { Context->magic = GB_FREED ; // to help detect dangling pointers Context->header_size = 0 ; - GB_FREE (Context_handle, header_size) ; + GB_FREE_MEMORY (Context_handle, header_size) ; } } } diff --git a/GraphBLAS/Source/context/GxB_Context_new.c b/GraphBLAS/Source/context/GxB_Context_new.c index ad0e7d9de9..7495e66295 100644 --- a/GraphBLAS/Source/context/GxB_Context_new.c +++ b/GraphBLAS/Source/context/GxB_Context_new.c @@ -2,7 +2,7 @@ // GxB_Context_new: create a new Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_Context_new // create a new Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GB_Context_new (&Context)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (Context_handle) ; (*Context_handle) = NULL ; GxB_Context Context = NULL ; @@ -32,7 +32,8 @@ GrB_Info GxB_Context_new // create a new Context // allocate the Context size_t header_size ; - Context = GB_MALLOC (1, struct GB_Context_opaque, &header_size); + Context = GB_MALLOC_MEMORY (1, sizeof (struct GB_Context_opaque), + &header_size); if (Context == NULL) { // out of memory diff --git a/GraphBLAS/Source/convert/GB_conform.c b/GraphBLAS/Source/convert/GB_conform.c index bfb0d707ab..95558b1998 100644 --- a/GraphBLAS/Source/convert/GB_conform.c +++ b/GraphBLAS/Source/convert/GB_conform.c @@ -2,7 +2,7 @@ // GB_conform: conform any matrix to its desired sparsity structure //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -136,10 +136,7 @@ GrB_Info GB_conform // conform a matrix to its desired sparsity structure bool is_full = GB_IS_FULL (A) ; bool is_bitmap = GB_IS_BITMAP (A) ; bool as_if_full = GB_as_if_full (A) ; - if (A->nvec_nonempty < 0) - { - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + GB_nvec_nonempty_update (A) ; if (A->no_hyper_hash) { // A does not want the hyper_hash, so free A->Y if present diff --git a/GraphBLAS/Source/convert/GB_conform_hyper.c b/GraphBLAS/Source/convert/GB_conform_hyper.c index 3b4175065b..9a8f833a48 100644 --- a/GraphBLAS/Source/convert/GB_conform_hyper.c +++ b/GraphBLAS/Source/convert/GB_conform_hyper.c @@ -2,7 +2,7 @@ // GB_conform_hyper: conform a sparse matrix to its desired hypersparse format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,20 +40,17 @@ GrB_Info GB_conform_hyper // conform a matrix to sparse/hypersparse // convert to sparse or hypersparse //-------------------------------------------------------------------------- - if (A->nvec_nonempty < 0) - { - // A->nvec_nonempty is used to select sparse vs hypersparse - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + // A->nvec_nonempty is used to select sparse vs hypersparse + int64_t nvec_nonempty = GB_nvec_nonempty_update (A) ; if (A->h == NULL && GB_convert_sparse_to_hyper_test (A->hyper_switch, - A->nvec_nonempty, A->vdim)) // A->nvec_nonempty used here + nvec_nonempty, A->vdim)) { // A is sparse but should be converted to hypersparse GB_OK (GB_convert_sparse_to_hyper (A, Werk)) ; } else if (A->h != NULL && GB_convert_hyper_to_sparse_test (A->hyper_switch, - A->nvec_nonempty, A->vdim)) // A->nvec_nonempty used here + nvec_nonempty, A->vdim)) { // A is hypersparse but should be converted to sparse GB_OK (GB_convert_hyper_to_sparse (A, true)) ; diff --git a/GraphBLAS/Source/convert/GB_convert.h b/GraphBLAS/Source/convert/GB_convert.h index 3fe6273e1d..3fdbbc730b 100644 --- a/GraphBLAS/Source/convert/GB_convert.h +++ b/GraphBLAS/Source/convert/GB_convert.h @@ -2,7 +2,7 @@ // GB_convert.h: converting between sparsity structures //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -92,7 +92,8 @@ bool GB_convert_sparse_to_bitmap_test // test for hyper/sparse to bitmap GrB_Info GB_convert_full_to_sparse // convert matrix from full to sparse ( - GrB_Matrix A // matrix to convert from full to sparse + GrB_Matrix A, // matrix to convert from full to sparse + GB_Werk Werk ) ; GrB_Info GB_convert_full_to_bitmap // convert matrix from full to bitmap @@ -115,14 +116,17 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ( // outputs: - int64_t *restrict Cp, // vector pointers for CSC/CSR form - int64_t *restrict Ci, // indices for CSC/CSR or triplet form - int64_t *restrict Cj, // vector indices for triplet form - GB_void *restrict Cx, // values for CSC/CSR or triplet form - int64_t *cnvec_nonempty, // # of non-empty vectors + void *Cp, // vector pointers for CSC/CSR form + void *Ci, // indices for CSC/CSR or triplet form + void *Cj, // vector indices for triplet form + void *Cx_new, // values for CSC/CSR or triplet form + int64_t *cnvec_nonempty, // # of non-empty vectors // inputs: not modified - const GrB_Type ctype, // type of Cx - const GrB_Matrix A, // matrix to extract; not modified + const bool Cp_is_32, // if true, Cp is uint32_t; otherwise uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t; otherwise uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t; otherwise uint64_t + const GrB_Type ctype, // type of Cx + const GrB_Matrix A, // matrix to extract; not modified GB_Werk Werk ) ; @@ -155,20 +159,23 @@ GrB_Info GB_convert_to_nonfull // ensure a matrix is not full GB_Werk Werk ) ; -/* ensure C is sparse or hypersparse */ -#define GB_ENSURE_SPARSE(C) \ -{ \ - if (GB_IS_BITMAP (C)) \ - { \ - /* convert C from bitmap to sparse */ \ - GB_OK (GB_convert_bitmap_to_sparse (C, Werk)) ; \ - } \ - else if (GB_IS_FULL (C)) \ - { \ - /* convert C from full to sparse */ \ - GB_OK (GB_convert_full_to_sparse (C)) ; \ - } \ -} +GrB_Info GB_convert_to_nonfull // ensure a matrix is not full +( + GrB_Matrix A, + GB_Werk Werk +) ; + +GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso +( + GrB_Matrix A, // input/output matrix + bool initialize // if true, copy the iso value to all of A->x +) ; + +GrB_Info GB_convert_any_to_iso // convert non-iso matrix to iso +( + GrB_Matrix A, // input/output matrix + GB_void *scalar // scalar value, of size A->type->size, or NULL +) ; //------------------------------------------------------------------------------ // GB_is_dense @@ -265,10 +272,16 @@ static inline const char *GB_sparsity_char_matrix (GrB_Matrix A) ASSERT (0) ; return ("?") ; } -GrB_Matrix GB_hyper_shallow // return C +GrB_Info GB_convert_int // convert the integers of a matrix ( - GrB_Matrix C, // output matrix - const GrB_Matrix A // input matrix + GrB_Matrix A, // matrix to convert + bool p_is_32_new, // new integer format for A->p + bool j_is_32_new, // new integer format for A->p + bool i_is_32_new, // new integer format for A->h, A->i, and A->Y + bool determine // if true, revise p_is_32_new, j_is_32_new, + // and i_is_32_new based on A->vlen, A->vdim and A->nvals. Otherwise, + // ignore the matrix properties and always convert to the new integer + // sizes. ) ; #endif diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_bitmap.c b/GraphBLAS/Source/convert/GB_convert_any_to_bitmap.c index dff9e7bd6f..da37b3d21a 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_bitmap.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_bitmap.c @@ -2,7 +2,7 @@ // GB_convert_any_to_bitmap: convert any matrix to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_full.c b/GraphBLAS/Source/convert/GB_convert_any_to_full.c index cc0aeed2e0..6e32725331 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_full.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_full.c @@ -2,7 +2,7 @@ // GB_convert_any_to_full: convert any matrix to full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,11 +42,14 @@ void GB_convert_any_to_full // convert any matrix to full GB_phy_free (A) ; - if (!A->i_shallow) GB_FREE (&(A->i), A->i_size) ; + if (!A->i_shallow) GB_FREE_MEMORY (&(A->i), A->i_size) ; A->i = NULL ; A->i_shallow = false ; + A->p_is_32 = false ; // OK: full always has p_is_32 = false + A->j_is_32 = false ; // OK: full always has j_is_32 = false + A->i_is_32 = false ; // OK: full always has i_is_32 = false - if (!A->b_shallow) GB_FREE (&(A->b), A->b_size) ; + if (!A->b_shallow) GB_FREE_MEMORY (&(A->b), A->b_size) ; A->b = NULL ; A->b_shallow = false ; @@ -55,7 +58,8 @@ void GB_convert_any_to_full // convert any matrix to full A->plen = -1 ; A->nvec = avdim ; - A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; +// A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; + GB_nvec_nonempty_set (A, (avlen == 0) ? 0 : avdim) ; A->magic = GB_MAGIC ; diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_hyper.c b/GraphBLAS/Source/convert/GB_convert_any_to_hyper.c index d253adeab0..03fe98271c 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_hyper.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_hyper.c @@ -2,7 +2,7 @@ // GB_convert_any_to_hyper: convert any matrix to hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ GrB_Info GB_convert_any_to_hyper // convert to hypersparse else if (GB_IS_FULL (A)) { // convert from full to hypersparse - GB_OK (GB_convert_full_to_sparse (A)) ; + GB_OK (GB_convert_full_to_sparse (A, Werk)) ; GB_OK (GB_convert_sparse_to_hyper (A, Werk)) ; } else if (GB_IS_BITMAP (A)) diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_iso.c b/GraphBLAS/Source/convert/GB_convert_any_to_iso.c index 3b2c9a658f..dbaf4d236d 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_iso.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_iso.c @@ -2,7 +2,7 @@ // GB_convert_any_to_iso: convert a matrix from non-iso to iso //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,11 +52,11 @@ GrB_Info GB_convert_any_to_iso // convert non-iso matrix to iso if (!A->x_shallow) { // free the old space - GB_FREE (&(A->x), A->x_size) ; + GB_FREE_MEMORY (&(A->x), A->x_size) ; } // allocate the new space - A->x = GB_MALLOC (asize, GB_void, &(A->x_size)) ; // x:OK + A->x = GB_MALLOC_MEMORY (1, asize, &(A->x_size)) ; A->x_shallow = false ; if (A->x == NULL) { diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_non_iso.c b/GraphBLAS/Source/convert/GB_convert_any_to_non_iso.c index f39e4b7bf3..bbeaa0fe19 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_non_iso.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_non_iso.c @@ -2,7 +2,7 @@ // GB_convert_any_to_non_iso: convert a matrix from iso to non-iso //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,10 +51,10 @@ GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso if (!A->x_shallow) { // free the old space - GB_FREE (&(A->x), A->x_size) ; + GB_FREE_MEMORY (&(A->x), A->x_size) ; } // allocate the new space - A->x = GB_MALLOC (Ax_size_required, GB_void, &(A->x_size)) ; // x:OK + A->x = GB_MALLOC_MEMORY (anz, asize, &(A->x_size)) ; A->x_shallow = false ; if (A->x == NULL) { @@ -83,7 +83,7 @@ GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso // finalize the matrix and return result //-------------------------------------------------------------------------- - A->iso = false ; // OK: convert_any_to_non_iso + A->iso = false ; ASSERT_MATRIX_OK (A, "A converted to non-iso", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/convert/GB_convert_any_to_sparse.c b/GraphBLAS/Source/convert/GB_convert_any_to_sparse.c index 8153702ca2..054ebe9004 100644 --- a/GraphBLAS/Source/convert/GB_convert_any_to_sparse.c +++ b/GraphBLAS/Source/convert/GB_convert_any_to_sparse.c @@ -2,7 +2,7 @@ // GB_convert_any_to_sparse: convert any matrix to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ GrB_Info GB_convert_any_to_sparse // convert to sparse else if (GB_IS_FULL (A)) { // convert from full to sparse - GB_OK (GB_convert_full_to_sparse (A)) ; + GB_OK (GB_convert_full_to_sparse (A, Werk)) ; } else if (GB_IS_BITMAP (A)) { diff --git a/GraphBLAS/Source/convert/GB_convert_b2s.c b/GraphBLAS/Source/convert/GB_convert_b2s.c index 651bc4ba88..3089be8066 100644 --- a/GraphBLAS/Source/convert/GB_convert_b2s.c +++ b/GraphBLAS/Source/convert/GB_convert_b2s.c @@ -2,7 +2,7 @@ // GB_convert_b2s: construct triplets or CSC/CSR from bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,23 +11,29 @@ // bitmap input matrix A. If A is iso or Cx_new is NULL then no values are // extracted. The iso case is handled by the caller. +// Ci, Cj, and Cx_new may be NULL. + +// FUTURE: make a separate function for constructing triplets + #include "GB.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #include "unaryop/GB_unop.h" -#define GB_FREE_ALL GB_FREE_WORK (&W, W_size) ; +#define GB_FREE_ALL GB_FREE_MEMORY (&W, W_size) ; GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ( // outputs: - int64_t *restrict Cp, // vector pointers for CSC/CSR form - int64_t *restrict Ci, // indices for CSC/CSR or triplet form - int64_t *restrict Cj, // vector indices for triplet form - GB_void *restrict Cx_new, // values for CSC/CSR or triplet form - int64_t *cnvec_nonempty, // # of non-empty vectors + void *Cp, // vector pointers for CSC/CSR form + void *Ci, // indices for CSC/CSR or triplet form + void *Cj, // vector indices for triplet form + void *Cx_new, // values for CSC/CSR or triplet form + int64_t *cnvec_nonempty, // # of non-empty vectors // inputs: not modified - const GrB_Type ctype, // type of Cx - const GrB_Matrix A, // matrix to extract; not modified + const bool Cp_is_32, // if true, Cp is uint32_t; otherwise uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t; otherwise uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t; otherwise uint64_t + const GrB_Type ctype, // type of Cx + const GrB_Matrix A, // matrix to extract; not modified GB_Werk Werk ) { @@ -40,12 +46,20 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ASSERT (Cp != NULL) ; // must be provided on input, size avdim+1 ASSERT_MATRIX_OK (A, "A for b2s", GB0) ; ASSERT_TYPE_OK (ctype, "ctype for b2s", GB0) ; + ASSERT ((Cp_is_32 && A->nvals < UINT32_MAX) || !Cp_is_32) ; //-------------------------------------------------------------------------- // get inputs and determine tasks //-------------------------------------------------------------------------- - int64_t *restrict W = NULL ; size_t W_size = 0 ; + void *W = NULL ; size_t W_size = 0 ; + GB_IDECL (W , , u) ; + GB_IDECL (Cp, , u) ; GB_IPTR (Cp, Cp_is_32) ; + GB_IDECL (Ci, , u) ; GB_IPTR (Ci, Ci_is_32) ; + GB_IDECL (Cj, , u) ; GB_IPTR (Cj, Cj_is_32) ; + + size_t psize = Cp_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + const int64_t avdim = A->vdim ; const int64_t avlen = A->vlen ; const size_t asize = A->type->size ; @@ -72,7 +86,7 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap for (j = 0 ; j < avdim ; j++) { // ajnz = nnz (A (:,j)) - int64_t ajnz = 0 ; + uint64_t ajnz = 0 ; int64_t pA_start = j * avlen ; for (int64_t i = 0 ; i < avlen ; i++) { @@ -81,7 +95,8 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ajnz += Ab [p] ; ASSERT (Ab [p] == 0 || Ab [p] == 1) ; } - Cp [j] = ajnz ; + // Cp [j] = ajnz ; + GB_ISET (Cp, j, ajnz) ; } } @@ -93,24 +108,30 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap //---------------------------------------------------------------------- // allocate one row of W per thread, each row of length avdim - W = GB_MALLOC_WORK (nthreads * avdim, int64_t, &W_size) ; + W = GB_MALLOC_MEMORY (nthreads * avdim, psize, &W_size) ; if (W == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (W, Cp_is_32) ; + + //---------------------------------------------------------------------- + // count each block + //---------------------------------------------------------------------- - int taskid ; + int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) - for (taskid = 0 ; taskid < nthreads ; taskid++) + for (tid = 0 ; tid < nthreads ; tid++) { - int64_t *restrict Wtask = W + taskid * avdim ; + uint32_t *restrict Wtask32 = Cp_is_32 ? (W32 + tid * avdim) : NULL ; + uint64_t *restrict Wtask64 = Cp_is_32 ? NULL : (W64 + tid * avdim) ; int64_t istart, iend ; - GB_PARTITION (istart, iend, avlen, taskid, nthreads) ; + GB_PARTITION (istart, iend, avlen, tid, nthreads) ; for (int64_t j = 0 ; j < avdim ; j++) { // ajnz = nnz (A (istart:iend-1,j)) - int64_t ajnz = 0 ; + uint64_t ajnz = 0 ; int64_t pA_start = j * avlen ; for (int64_t i = istart ; i < iend ; i++) { @@ -119,24 +140,47 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ajnz += Ab [p] ; ASSERT (Ab [p] == 0 || Ab [p] == 1) ; } - Wtask [j] = ajnz ; + // Wtask [j] = ajnz ; + GB_ISET (Wtask, j, ajnz) ; } } + //---------------------------------------------------------------------- // cumulative sum to compute nnz(A(:,j)) for each vector j + //---------------------------------------------------------------------- + int64_t j ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (j = 0 ; j < avdim ; j++) + if (Cp_is_32) { - int64_t ajnz = 0 ; - for (int taskid = 0 ; taskid < nthreads ; taskid++) - { - int64_t *restrict Wtask = W + taskid * avdim ; - int64_t c = Wtask [j] ; - Wtask [j] = ajnz ; - ajnz += c ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (j = 0 ; j < avdim ; j++) + { + uint32_t ajnz = 0 ; + for (int tid = 0 ; tid < nthreads ; tid++) + { + uint32_t *restrict Wtask32 = W32 + tid * avdim ; + uint32_t c = Wtask32 [j] ; + Wtask32 [j] = ajnz ; + ajnz += c ; + } + Cp32 [j] = ajnz ; + } + } + else + { + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (j = 0 ; j < avdim ; j++) + { + uint64_t ajnz = 0 ; + for (int tid = 0 ; tid < nthreads ; tid++) + { + uint64_t *restrict Wtask64 = W64 + tid * avdim ; + uint64_t c = Wtask64 [j] ; + Wtask64 [j] = ajnz ; + ajnz += c ; + } + Cp64 [j] = ajnz ; } - Cp [j] = ajnz ; } } @@ -144,18 +188,20 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap // cumulative sum of Cp //-------------------------------------------------------------------------- + // This cannot overflow if Cp is uint32_t, because in that case A->nvals + // is < UINT32_MAX (see assertion above). + int nth = GB_nthreads (avdim, chunk, nthreads_max) ; - GB_cumsum (Cp, avdim, cnvec_nonempty, nth, Werk) ; - ASSERT (Cp [avdim] == A->nvals) ; + GB_cumsum (Cp, Cp_is_32, avdim, cnvec_nonempty, nth, Werk) ; + ASSERT (GB_IGET (Cp, avdim) == A->nvals) ; //-------------------------------------------------------------------------- // gather the pattern and values from the bitmap //-------------------------------------------------------------------------- GrB_Info info = GrB_NO_VALUE ; - const GB_void *restrict Ax = (GB_void *) (A->x) ; - if (Cx_new == NULL || Ax == NULL || A->iso) + if (Cx_new == NULL || A->x == NULL || A->iso) { //---------------------------------------------------------------------- @@ -172,7 +218,7 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap { //---------------------------------------------------------------------- - // via the factory kernel + // via an inline kernel for types of size 1, 2, 4, 8, or 16 //---------------------------------------------------------------------- if (ctype == A->type) @@ -237,8 +283,8 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap { struct GB_UnaryOp_opaque op_header ; GB_Operator op = GB_unop_identity (ctype, &op_header) ; - info = GB_convert_b2s_jit (Cp, Ci, Cj, Cx_new, ctype, op, A, - W, nthreads) ; + info = GB_convert_b2s_jit (Cp, Ci, Cj, Cx_new, + Cp_is_32, Ci_is_32, Cj_is_32, ctype, op, A, W, nthreads) ; } //---------------------------------------------------------------------- @@ -251,7 +297,8 @@ GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap GB_Type_code acode = A->type->code ; const size_t csize = ctype->size ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; - GB_void *restrict Cx = (GB_void *) Cx_new ; + #define GB_C_TYPE GB_void + #define GB_A_TYPE GB_void #undef GB_COPY #define GB_COPY(Cx,pC,Ax,pA) \ cast_A_to_C (Cx +(pC)*csize, Ax +(pA)*asize, asize) diff --git a/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse.c b/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse.c index 75f3062933..452019741c 100644 --- a/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse.c +++ b/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse.c @@ -2,7 +2,7 @@ // GB_convert_bitmap_to_sparse: convert a matrix from bitmap to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,9 +11,9 @@ #define GB_FREE_ALL \ { \ - GB_FREE (&Cp, Cp_size) ; \ - GB_FREE (&Ci, Ci_size) ; \ - GB_FREE (&Cx, Cx_size) ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ + GB_FREE_MEMORY (&Ci, Ci_size) ; \ + GB_FREE_MEMORY (&Cx, Cx_size) ; \ } GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse @@ -47,11 +47,19 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse int64_t cnvec_nonempty ; const int64_t avdim = A->vdim ; const size_t asize = A->type->size ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - int64_t *restrict Ci = NULL ; size_t Ci_size = 0 ; - GB_void *restrict Cx = NULL ; size_t Cx_size = 0 ; - Cp = GB_MALLOC (avdim+1, int64_t, &Cp_size) ; - Ci = GB_MALLOC (anzmax, int64_t, &Ci_size) ; + void *Cp = NULL ; size_t Cp_size = 0 ; + void *Ci = NULL ; size_t Ci_size = 0 ; + void *Cx = NULL ; size_t Cx_size = 0 ; + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, anzmax, A->vlen, avdim, Werk) ; + + size_t psize = Cp_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = Ci_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Cp = GB_MALLOC_MEMORY (avdim+1, psize, &Cp_size) ; + Ci = GB_MALLOC_MEMORY (anzmax, isize, &Ci_size) ; if (Cp == NULL || Ci == NULL) { // out of memory @@ -59,24 +67,12 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse return (GrB_OUT_OF_MEMORY) ; } - bool Cx_shallow ; const bool A_iso = A->iso ; - if (A_iso) + if (!A_iso) { - // A is iso. Remove A->x from the matrix so it is not freed by - // GB_phybix_free. It is not modified by GB_convert_b2s, and is - // transplanted back into A, below. - Cx = (GB_void *) A->x ; - Cx_shallow = A->x_shallow ; - Cx_size = A->x_size ; - A->x = NULL ; - } - else - { // A is not iso. Allocate new space for Cx, which is filled by // GB_convert_b2s. - Cx = GB_MALLOC (anzmax * asize, GB_void, &Cx_size) ; - Cx_shallow = false ; + Cx = GB_MALLOC_MEMORY (anzmax, asize, &Cx_size) ; if (Cx == NULL) { // out of memory @@ -89,26 +85,39 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse // convert to sparse format (Cp, Ci, and Cx) //-------------------------------------------------------------------------- - // Cx and A->x always have the same type - - // the values are not converted if A is iso - GB_OK (GB_convert_b2s (Cp, Ci, NULL, (A_iso) ? NULL : Cx, - &cnvec_nonempty, A->type, A, Werk)) ; + // Cx and A->x always have the same type. + // The values are not converted if A is iso (Cx is NULL). + GB_OK (GB_convert_b2s (Cp, Ci, NULL, Cx, &cnvec_nonempty, + Cp_is_32, Ci_is_32, false, A->type, A, Werk)) ; //-------------------------------------------------------------------------- // free prior content of A and transplant the new content //-------------------------------------------------------------------------- - GB_phybix_free (A) ; // clears A->nvals + bool Cx_shallow = false ; + if (A_iso) + { + // A is iso. Remove A->x from the matrix so it is not freed by + // GB_phybix_free; it is transplanted back again just below. + Cx = A->x ; + Cx_size = A->x_size ; + Cx_shallow = A->x_shallow ; + A->x = NULL ; + } + + GB_phybix_free (A) ; // clears A->nvals A->p = Cp ; A->p_size = Cp_size ; A->p_shallow = false ; A->i = Ci ; A->i_size = Ci_size ; A->i_shallow = false ; A->x = Cx ; A->x_size = Cx_size ; A->x_shallow = Cx_shallow ; + A->p_is_32 = Cp_is_32 ; + A->j_is_32 = Cj_is_32 ; + A->i_is_32 = Ci_is_32 ; A->iso = A_iso ; A->nvals = anvals ; - ASSERT (A->nvals == Cp [avdim]) ; A->plen = avdim ; A->nvec = avdim ; - A->nvec_nonempty = cnvec_nonempty ; +// A->nvec_nonempty = cnvec_nonempty ; + GB_nvec_nonempty_set (A, cnvec_nonempty) ; A->magic = GB_MAGIC ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse_test.c b/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse_test.c index 8cd046f4da..53b6425fea 100644 --- a/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse_test.c +++ b/GraphBLAS/Source/convert/GB_convert_bitmap_to_sparse_test.c @@ -2,7 +2,7 @@ // GB_convert_bitmap_to_sparse_test: test conversion of bitmap to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/GB_convert_full_to_bitmap.c b/GraphBLAS/Source/convert/GB_convert_full_to_bitmap.c index d420634e0e..6d6c75cebf 100644 --- a/GraphBLAS/Source/convert/GB_convert_full_to_bitmap.c +++ b/GraphBLAS/Source/convert/GB_convert_full_to_bitmap.c @@ -2,7 +2,7 @@ // GB_convert_full_to_bitmap: convert a matrix from full to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,7 +34,7 @@ GrB_Info GB_convert_full_to_bitmap // convert matrix from full to bitmap int64_t anz = GB_nnz_full (A) ; GB_BURBLE_N (anz, "(full to bitmap) ") ; - A->b = GB_MALLOC (anz, int8_t, &(A->b_size)) ; + A->b = GB_MALLOC_MEMORY (anz, sizeof (int8_t), &(A->b_size)) ; if (A->b == NULL) { // out of memory diff --git a/GraphBLAS/Source/convert/GB_convert_full_to_sparse.c b/GraphBLAS/Source/convert/GB_convert_full_to_sparse.c index 074a4b34d8..99bd82a19f 100644 --- a/GraphBLAS/Source/convert/GB_convert_full_to_sparse.c +++ b/GraphBLAS/Source/convert/GB_convert_full_to_sparse.c @@ -2,7 +2,7 @@ // GB_convert_full_to_sparse: convert a matrix from full to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,8 @@ GrB_Info GB_convert_full_to_sparse // convert matrix from full to sparse ( - GrB_Matrix A // matrix to convert from full to sparse + GrB_Matrix A, // matrix to convert from full to sparse + GB_Werk Werk ) { @@ -36,23 +37,36 @@ GrB_Info GB_convert_full_to_sparse // convert matrix from full to sparse int64_t avlen = A->vlen ; int64_t anz = GB_nnz_full (A) ; GB_BURBLE_N (anz, "(full to sparse) ") ; - int64_t *restrict Ap = NULL ; size_t Ap_size = 0 ; - int64_t *restrict Ai = NULL ; size_t Ai_size = 0 ; - Ap = GB_MALLOC (avdim+1, int64_t, &Ap_size) ; - Ai = GB_MALLOC (anz, int64_t, &Ai_size) ; + + bool Ap_is_32, Aj_is_32, Ai_is_32 ; + GB_determine_pji_is_32 (&Ap_is_32, &Aj_is_32, &Ai_is_32, + GxB_AUTO_SPARSITY, anz, avlen, avdim, Werk) ; + + void *Ap = NULL ; size_t Ap_size = 0 ; + void *Ai = NULL ; size_t Ai_size = 0 ; + + size_t psize = (Ap_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = (Ai_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Ap = GB_MALLOC_MEMORY (avdim+1, psize, &Ap_size) ; + Ai = GB_MALLOC_MEMORY (anz, isize, &Ai_size) ; if (Ap == NULL || Ai == NULL) { // out of memory - GB_FREE (&Ap, Ap_size) ; - GB_FREE (&Ai, Ai_size) ; + GB_FREE_MEMORY (&Ap, Ap_size) ; + GB_FREE_MEMORY (&Ai, Ai_size) ; return (GrB_OUT_OF_MEMORY) ; } A->p = Ap ; A->p_size = Ap_size ; A->i = Ai ; A->i_size = Ai_size ; + A->p_is_32 = Ap_is_32 ; + A->j_is_32 = Aj_is_32 ; + A->i_is_32 = Ai_is_32 ; A->plen = avdim ; A->nvec = avdim ; - A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; +// A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; + GB_nvec_nonempty_set (A, (avlen == 0) ? 0 : avdim) ; A->nvals = anz ; //-------------------------------------------------------------------------- @@ -67,18 +81,23 @@ GrB_Info GB_convert_full_to_sparse // convert matrix from full to sparse // fill the A->p and A->i pattern //-------------------------------------------------------------------------- + GB_IDECL (Ap, , u) ; GB_IPTR (Ap, Ap_is_32) ; + GB_IDECL (Ai, , u) ; GB_IPTR (Ai, Ai_is_32) ; + int64_t k ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k <= avdim ; k++) { - Ap [k] = k * avlen ; + // Ap [k] = k * avlen ; + GB_ISET (Ap, k, k * avlen) ; } int64_t p ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < anz ; p++) { - Ai [p] = p % avlen ; + // Ai [p] = p % avlen ; + GB_ISET (Ai, p, p % avlen) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse.c b/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse.c index cb4f758d46..604faa6671 100644 --- a/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse.c +++ b/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse.c @@ -2,7 +2,7 @@ // GB_convert_hyper_to_sparse: convert a matrix from hypersparse to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,6 +21,10 @@ #include "GB.h" +//------------------------------------------------------------------------------ +// GB_convert_hyper_to_sparse +//------------------------------------------------------------------------------ + GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse ( GrB_Matrix A, // matrix to convert to non-hypersparse @@ -51,6 +55,10 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse int64_t n = A->vdim ; int64_t anz = GB_nnz (A) ; + bool Ap_is_32 = A->p_is_32 ; + bool Aj_is_32 = A->j_is_32 ; + size_t psize = Ap_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + if (n == 1) { @@ -63,29 +71,32 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // user as an invalid GrB_Vector. ASSERT (A->plen == 1) ; - ASSERT (A->p_size >= 2 * sizeof (int64_t)) ; + ASSERT (A->p_size >= 2 * psize) ; ASSERT (A->nvec == 0 || A->nvec == 1) ; if (A->nvec == 0) { - A->p [0] = 0 ; - A->p [1] = 0 ; + // Ap [0:1] = 0 + memset (A->p, 0, 2 * psize) ; A->nvec = 1 ; } - A->nvec_nonempty = (anz > 0) ? 1 : 0 ; +// A->nvec_nonempty = (anz > 0) ? 1 : 0 ; + GB_nvec_nonempty_set (A, (anz > 0) ? 1 : 0) ; - // free A->h unless it is shallow - if (!A->h_shallow) - { - GB_FREE (&(A->h), A->h_size) ; - } - A->h = NULL ; - A->h_size = 0 ; - A->h_shallow = false ; - GB_hyper_hash_free (A) ; + GB_hy_free (A) ; + + } + else if (A->nvec == A->plen && A->plen == A->vdim) + { + + //---------------------------------------------------------------------- + // all entries are present in A->h, so just free it, and A->Y if present + //---------------------------------------------------------------------- + + GB_hy_free (A) ; } else - { + { //---------------------------------------------------------------------- // determine the number of threads to use @@ -102,17 +113,23 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // allocate the new Ap array, of size n+1 //---------------------------------------------------------------------- - int64_t *restrict Ap_new = NULL ; size_t Ap_new_size = 0 ; - Ap_new = GB_MALLOC (n+1, int64_t, &Ap_new_size) ; + void *Ap_new = NULL ; size_t Ap_new_size = 0 ; + Ap_new = GB_MALLOC_MEMORY (n+1, psize, &Ap_new_size) ; if (Ap_new == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } + GB_IDECL (Ap_new, , u) ; GB_IPTR (Ap_new, Ap_is_32) ; + #ifdef GB_DEBUG // to ensure all values of Ap_new are assigned below. - for (int64_t j = 0 ; j <= n ; j++) Ap_new [j] = -99999 ; + for (int64_t j = 0 ; j <= n ; j++) + { + // Ap_new [j] = -99999 ; + GB_ISET (Ap_new, j, -99999) ; + } #endif //---------------------------------------------------------------------- @@ -120,10 +137,13 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse //---------------------------------------------------------------------- int64_t nvec = A->nvec ; // # of vectors in Ah_old - int64_t *restrict Ap_old = A->p ; // size nvec+1 - int64_t *restrict Ah_old = A->h ; // size nvec int64_t nvec_nonempty = 0 ; // recompute A->nvec_nonempty + void *Ap_old = A->p ; // size nvec+1 + void *Ah_old = A->h ; // size nvec + GB_IDECL (Ap_old, const, u) ; GB_IPTR (Ap_old, Ap_is_32) ; + GB_IDECL (Ah_old, const, u) ; GB_IPTR (Ah_old, Aj_is_32) ; + //---------------------------------------------------------------------- // construct the new vector pointers //---------------------------------------------------------------------- @@ -139,7 +159,7 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // task tid computes Ap_new [jstart:jend-1] from Ap_old, Ah_old. - // GB_SPLIT_BINARY_SEARCH of Ah_old [0..nvec-1] for jstart: + // GB_split_binary_search of Ah_old [0..nvec-1] for jstart: // If found is true then Ah_old [k] == jstart. // If found is false, and nvec > 0 then // Ah_old [0 ... k-1] < jstart < Ah_old [k ... nvec-1] @@ -150,12 +170,16 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // since Ah_old is completely empty (Ah_old [0] is invalid). int64_t k = 0, pright = nvec-1 ; - bool found ; - GB_SPLIT_BINARY_SEARCH (jstart, Ah_old, k, pright, found) ; + #ifdef GB_DEBUG + bool found = + #endif + GB_split_binary_search (jstart, Ah_old, Aj_is_32, &k, &pright) ; + ASSERT (k >= 0 && k <= nvec) ; ASSERT (GB_IMPLIES (nvec == 0, !found && k == 0)) ; - ASSERT (GB_IMPLIES (found, jstart == Ah_old [k])) ; - ASSERT (GB_IMPLIES (!found && k < nvec, jstart < Ah_old [k])) ; + ASSERT (GB_IMPLIES (found, jstart == GB_IGET (Ah_old, k))) ; + ASSERT (GB_IMPLIES (!found && k < nvec, + jstart < GB_IGET (Ah_old, k))) ; // Let jk = Ah_old [k], jlast = Ah_old [k-1], and pk = Ah_old [k]. // Then Ap_new [jlast+1:jk] must be set to pk. This must be done @@ -167,7 +191,7 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // jstart:jend-1, even if it does not own that particular vector k. // This happens only at the tail end of jstart:jend-1. - int64_t jlast = (k == 0) ? (-1) : Ah_old [k-1] ; + int64_t jlast = (k == 0) ? (-1) : GB_IGET (Ah_old, k-1) ; jlast = GB_IMAX (jstart-1, jlast) ; bool done = false ; @@ -179,8 +203,8 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // get the kth vector in Ah_old, which is vector index jk. //-------------------------------------------------------------- - int64_t jk = (k < nvec) ? Ah_old [k] : n ; - int64_t pk = (k < nvec) ? Ap_old [k] : anz ; + int64_t jk = (k < nvec) ? GB_IGET (Ah_old, k) : n ; + int64_t pk = (k < nvec) ? GB_IGET (Ap_old, k) : anz ; //-------------------------------------------------------------- // determine if this task owns jk @@ -202,7 +226,10 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // Ap must be set to pk for all vector indices jlast+1:jk. jfin = jk ; ASSERT (k >= 0 && k < nvec && nvec > 0) ; - if (pk < Ap_old [k+1]) my_nvec_nonempty++ ; + if (pk < GB_IGET (Ap_old, k+1)) + { + my_nvec_nonempty++ ; + } } //-------------------------------------------------------------- @@ -214,7 +241,8 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse for (int64_t j = jlast+1 ; j <= jfin ; j++) { - Ap_new [j] = pk ; + // Ap_new [j] = pk ; + GB_ISET (Ap_new, j, pk) ; } //-------------------------------------------------------------- @@ -232,7 +260,8 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse if (tid == ntasks-1) { ASSERT (jend == n) ; - Ap_new [n] = anz ; + // Ap_new [n] = anz ; + GB_ISET (Ap_new, n, anz) ; } } @@ -244,7 +273,8 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse A->p = Ap_new ; A->p_size = Ap_new_size ; A->h = NULL ; A->nvec = n ; - A->nvec_nonempty = nvec_nonempty ; +// A->nvec_nonempty = nvec_nonempty ; + GB_nvec_nonempty_set (A, nvec_nonempty) ; A->plen = n ; A->p_shallow = false ; A->h_shallow = false ; @@ -257,7 +287,6 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse // A is now sparse //-------------------------------------------------------------------------- - ASSERT (anz == A->p [n]) ; ASSERT (anz == GB_nnz (A)) ; ASSERT_MATRIX_OK (A, "A converted to sparse", GB0) ; ASSERT (GB_IS_SPARSE (A)) ; diff --git a/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse_test.c b/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse_test.c index 8ba7ba92d1..dbeb6f8f45 100644 --- a/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse_test.c +++ b/GraphBLAS/Source/convert/GB_convert_hyper_to_sparse_test.c @@ -2,7 +2,7 @@ // GB_convert_hyper_to_sparse_test: test conversion of hypersparse to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/GB_convert_int.c b/GraphBLAS/Source/convert/GB_convert_int.c new file mode 100644 index 0000000000..0bc174d5f1 --- /dev/null +++ b/GraphBLAS/Source/convert/GB_convert_int.c @@ -0,0 +1,373 @@ +//------------------------------------------------------------------------------ +// GB_convert_int: convert the integers in a matrix to/from 32/64 bits +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// The integer arrays A->[phi] and A->Y in the matrix A are converted to match +// the requested p_is_32_new, j_is_32_new, and i_is_32_new. If converted, +// A->[phi] are no longer shallow. If A->Y is entirely shallow, it is simply +// removed from A. If A->Y is itself not shallow but contains any shallow +// A->Y->[phi] components, those components are converted and are no longer +// shallow. + +// If A has too many entries for p_is_32_new == true, A->p is left unchanged. +// If the dimension of A is too large for j_is_32_new == true, A->h and A->Y +// are left unchanged. If the dimension of A is too large for i_is_32_new == +// true, A->i. is left unchanged. These are not error conditions. + +#include "GB.h" +#define GB_FREE_ALL ; + +GrB_Info GB_convert_int // convert the integers of a matrix +( + GrB_Matrix A, // matrix to convert + bool p_is_32_new, // new integer format for A->p + bool j_is_32_new, // new integer format for A->p + bool i_is_32_new, // new integer format for A->h, A->i, and A->Y + bool determine // if true, revise p_is_32_new, j_is_32_new, + // and i_is_32_new based on A->vlen, A->vdim and A->nvals. Otherwise, + // ignore the matrix properties and always convert to the new integer + // sizes. +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (A == NULL || A->magic != GB_MAGIC) + { + // nothing to convert + return (GrB_SUCCESS) ; + } + + ASSERT (GB_ZOMBIES_OK (A)) ; + ASSERT (GB_JUMBLED_OK (A)) ; + ASSERT (GB_PENDING_OK (A)) ; + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + if (GB_IS_FULL (A) || GB_IS_BITMAP (A)) + { + // quick return: nothing to do + return (GrB_SUCCESS) ; + } + + int64_t anz = GB_nnz (A) ; + if (determine) + { + ASSERT_MATRIX_OK (A, "A converting integers", GB0) ; + p_is_32_new = GB_determine_p_is_32 (p_is_32_new, anz) ; + j_is_32_new = GB_determine_j_is_32 (j_is_32_new, A->vdim) ; + i_is_32_new = GB_determine_i_is_32 (i_is_32_new, A->vlen) ; + } + bool p_is_32 = A->p_is_32 ; + bool j_is_32 = A->j_is_32 ; + bool i_is_32 = A->i_is_32 ; + + if (p_is_32 == p_is_32_new && + j_is_32 == j_is_32_new && + i_is_32 == i_is_32_new) + { + // quick return: nothing to do + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // at least some integers must be converted + //-------------------------------------------------------------------------- + + // simply remove A->Y if it is entirely shallow + if (A->Y_shallow) + { + A->Y = NULL ; + A->Y_shallow = false ; + } + + bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; // (A->h != NULL) + int64_t plen = A->plen ; + GrB_Matrix Y = A->Y ; + GB_Pending Pending = A->Pending ; + int64_t ynz = GB_nnz (Y) ; + int64_t yplen = (Y == NULL) ? 0 : Y->plen ; + int64_t npending = (Pending == NULL) ? 0 : Pending->n ; + int64_t nmax_pending = (Pending == NULL) ? 0 : Pending->nmax ; + + //-------------------------------------------------------------------------- + // allocate new space for A->[phi] and Y->[pix] if present + //-------------------------------------------------------------------------- + + // Y is not converted via a recurisive call to this method. Instead, it is + // converted directly below. This is because Y->x must also be converted, + // and also so that the conversion will be all-or-nothing, if out of + // memory. + + void *Ap_new = NULL ; size_t Ap_new_size = 0 ; + void *Ah_new = NULL ; size_t Ah_new_size = 0 ; + void *Ai_new = NULL ; size_t Ai_new_size = 0 ; + void *Yp_new = NULL ; size_t Yp_new_size = 0 ; + void *Yi_new = NULL ; size_t Yi_new_size = 0 ; + void *Yx_new = NULL ; size_t Yx_new_size = 0 ; + void *Pending_i_new = NULL ; size_t Pending_i_new_size = 0 ; + void *Pending_j_new = NULL ; size_t Pending_j_new_size = 0 ; + bool has_Pending_i = (Pending != NULL) && (Pending->i != NULL) ; + bool has_Pending_j = (Pending != NULL) && (Pending->j != NULL) ; + + size_t psize_new = p_is_32_new ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize_new = j_is_32_new ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize_new = i_is_32_new ? sizeof (uint32_t) : sizeof (uint64_t) ; + + bool ok = true ; + + if (p_is_32 != p_is_32_new && A->p != NULL) + { + // allocate new space for A->p + Ap_new = GB_MALLOC_MEMORY (plen+1, psize_new, &Ap_new_size) ; + ok = ok && (Ap_new != NULL) ; + } + + if (i_is_32 != i_is_32_new) + { + // allocate new space for A->i + if (A->i != NULL) + { + Ai_new = GB_MALLOC_MEMORY (anz, isize_new, &Ai_new_size) ; + ok = ok && (Ai_new != NULL) ; + } + if (has_Pending_i) + { + // allocate new space for Pending->i; matches A->i_is_32 + Pending_i_new = GB_MALLOC_MEMORY (nmax_pending, isize_new, + &Pending_i_new_size) ; + ok = ok && (Pending_i_new != NULL) ; + } + } + + if (j_is_32 != j_is_32_new) + { + if (A_is_hyper) + { + // allocate new space for A->h + Ah_new = GB_MALLOC_MEMORY (plen, jsize_new, &Ah_new_size) ; + ok = ok && (Ah_new != NULL) ; + } + if (Y != NULL) + { + // allocate new space for Y->[phi]; matches A->j_is_32 + Yp_new = GB_MALLOC_MEMORY (yplen+1, jsize_new, &Yp_new_size) ; + Yi_new = GB_MALLOC_MEMORY (ynz, jsize_new, &Yi_new_size) ; + Yx_new = GB_MALLOC_MEMORY (ynz, jsize_new, &Yx_new_size) ; + ok = ok && (Yp_new != NULL && Yi_new != NULL && Yx_new != NULL) ; + } + if (has_Pending_j) + { + // allocate new space for Pending->j; matches A->j_is_32 + Pending_j_new = GB_MALLOC_MEMORY (nmax_pending, jsize_new, + &Pending_j_new_size) ; + ok = ok && (Pending_j_new != NULL) ; + } + } + + if (!ok) + { + // out of memory: A is unchanged + GB_FREE_MEMORY (&Ap_new, Ap_new_size) ; + GB_FREE_MEMORY (&Ah_new, Ah_new_size) ; + GB_FREE_MEMORY (&Ai_new, Ai_new_size) ; + GB_FREE_MEMORY (&Yp_new, Yp_new_size) ; + GB_FREE_MEMORY (&Yi_new, Yi_new_size) ; + GB_FREE_MEMORY (&Yx_new, Yx_new_size) ; + GB_FREE_MEMORY (&Pending_i_new, Pending_i_new_size) ; + GB_FREE_MEMORY (&Pending_j_new, Pending_j_new_size) ; + return (GrB_OUT_OF_MEMORY) ; + } + + // the conversion will now succeed + + //-------------------------------------------------------------------------- + // convert A->p + //-------------------------------------------------------------------------- + + int nthreads_max = GB_Context_nthreads_max ( ) ; + + if (p_is_32 != p_is_32_new && A->p != NULL) + { + GB_cast_int (Ap_new, p_is_32_new ? GB_UINT32_code : GB_UINT64_code, + A->p , p_is_32 ? GB_UINT32_code : GB_UINT64_code, + plen+1, nthreads_max) ; + if (!A->p_shallow) + { + GB_FREE_MEMORY (&(A->p), A->p_size) ; + } + A->p = Ap_new ; + A->p_size = Ap_new_size ; + A->p_shallow = false ; + } + + A->p_is_32 = p_is_32_new ; + + //-------------------------------------------------------------------------- + // convert A->i and Pending->i + //-------------------------------------------------------------------------- + + if (i_is_32 != i_is_32_new) + { + bool zombies = (A->nzombies > 0) ; + GB_Type_code zombie32 = zombies ? GB_INT32_code : GB_UINT32_code ; + GB_Type_code zombie64 = zombies ? GB_INT32_code : GB_UINT64_code ; + GB_Type_code icode_new = i_is_32_new ? zombie32 : zombie64 ; + GB_Type_code icode = i_is_32 ? zombie32 : zombie64 ; + GB_Type_code ucode_new = i_is_32_new ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code ucode = i_is_32 ? GB_UINT32_code : GB_UINT64_code ; + + //---------------------------------------------------------------------- + // convert A->i + //---------------------------------------------------------------------- + + if (A->i != NULL) + { + GB_cast_int (Ai_new, icode_new, A->i, icode, anz, nthreads_max) ; + if (!A->i_shallow) + { + GB_FREE_MEMORY (&(A->i), A->i_size) ; + } + A->i = Ai_new ; + A->i_size = Ai_new_size ; + A->i_shallow = false ; + } + + //---------------------------------------------------------------------- + // convert Pending->i if present + //---------------------------------------------------------------------- + + if (has_Pending_i) + { + GB_cast_int (Pending_i_new, ucode_new, Pending->i, ucode, npending, + nthreads_max) ; + GB_FREE_MEMORY (&(Pending->i), Pending->i_size) ; + Pending->i = Pending_i_new ; + Pending->i_size = Pending_i_new_size ; + } + } + + A->i_is_32 = i_is_32_new ; + + //-------------------------------------------------------------------------- + // convert A->h, Y->p, Y->i, Y->x, and Pending->j + //-------------------------------------------------------------------------- + + if (j_is_32 != j_is_32_new) + { + + GB_Type_code ucode_new = j_is_32_new ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code ucode = j_is_32 ? GB_UINT32_code : GB_UINT64_code ; + + //---------------------------------------------------------------------- + // convert A->h if present + //---------------------------------------------------------------------- + + if (A_is_hyper) + { + GB_cast_int (Ah_new, ucode_new, A->h, ucode, plen, nthreads_max) ; + if (!A->h_shallow) + { + GB_FREE_MEMORY (&(A->h), A->h_size) ; + } + A->h = Ah_new ; + A->h_size = Ah_new_size ; + A->h_shallow = false ; + } + + //---------------------------------------------------------------------- + // convert A->Y if present + //---------------------------------------------------------------------- + + if (Y != NULL) + { + // A is hypersparse, and the integers of Y match A->j_is_32 + ASSERT (A_is_hyper) ; + ASSERT (Y->p_is_32 == j_is_32) ; + ASSERT (Y->j_is_32 == j_is_32) ; + ASSERT (Y->i_is_32 == j_is_32) ; + ASSERT_MATRIX_OK (Y, "Y converting integers", GB0) ; + + //------------------------------------------------------------------ + // convert Y->p + //------------------------------------------------------------------ + + GB_cast_int (Yp_new, ucode_new, Y->p, ucode, yplen+1, nthreads_max); + if (!Y->p_shallow) + { + GB_FREE_MEMORY (&(Y->p), Y->p_size) ; + } + Y->p = Yp_new ; + Y->p_size = Yp_new_size ; + Y->p_shallow = false ; + Y->p_is_32 = j_is_32_new ; + + //------------------------------------------------------------------ + // convert Y->i + //------------------------------------------------------------------ + + GB_cast_int (Yi_new, ucode_new, Y->i, ucode, ynz, nthreads_max) ; + if (!Y->i_shallow) + { + GB_FREE_MEMORY (&(Y->i), Y->i_size) ; + } + Y->i = Yi_new ; + Y->i_size = Yi_new_size ; + Y->i_shallow = false ; + Y->i_is_32 = j_is_32_new ; + + //------------------------------------------------------------------ + // convert Y->x + //------------------------------------------------------------------ + + GB_cast_int (Yx_new, ucode_new, Y->x, ucode, ynz, nthreads_max) ; + if (!Y->x_shallow) + { + GB_FREE_MEMORY (&(Y->x), Y->x_size) ; + } + Y->x = Yx_new ; + Y->x_size = Yx_new_size ; + Y->x_shallow = false ; + Y->type = j_is_32_new ? GrB_UINT32 : GrB_UINT64 ; + + //------------------------------------------------------------------ + // revise Y->j_is_32 + //------------------------------------------------------------------ + + Y->j_is_32 = j_is_32_new ; + ASSERT_MATRIX_OK (Y, "Y converted integers", GB0) ; + } + + //---------------------------------------------------------------------- + // convert Pending->j if present + //---------------------------------------------------------------------- + + if (has_Pending_j) + { + GB_cast_int (Pending_j_new, ucode_new, Pending->j, ucode, npending, + nthreads_max) ; + GB_FREE_MEMORY (&(Pending->j), Pending->j_size) ; + Pending->j = Pending_j_new ; + Pending->j_size = Pending_j_new_size ; + } + } + + A->j_is_32 = j_is_32_new ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_MATRIX_OK (A, "A integers converted", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/convert/GB_convert_s2b.c b/GraphBLAS/Source/convert/GB_convert_s2b.c index a65cf1b52a..2876a75df7 100644 --- a/GraphBLAS/Source/convert/GB_convert_s2b.c +++ b/GraphBLAS/Source/convert/GB_convert_s2b.c @@ -2,7 +2,7 @@ // GB_convert_s2b: convert from sparse/hypersparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,6 @@ // via the JIT kernel. #include "apply/GB_apply.h" -#include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #define GB_FREE_WORKSPACE \ @@ -24,8 +23,8 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE (&Cx_new, Cx_size) ; \ - GB_FREE (&Cb, Cb_size) ; \ + GB_FREE_MEMORY (&Cx_new, Cx_size) ; \ + GB_FREE_MEMORY (&Cb, Cb_size) ; \ } GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap @@ -78,13 +77,13 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap const int64_t avdim = A->vdim ; const int64_t avlen = A->vlen ; int64_t anzmax ; - if (!GB_int64_multiply ((GrB_Index *) (&anzmax), avdim, avlen)) + if (!GB_int64_multiply ((uint64_t *) (&anzmax), avdim, avlen)) { // problem too large return (GrB_OUT_OF_MEMORY) ; } anzmax = GB_IMAX (anzmax, 1) ; - Cb = GB_MALLOC (anzmax, int8_t, &Cb_size) ; + Cb = GB_MALLOC_MEMORY (anzmax, sizeof (int8_t), &Cb_size) ; if (Cb == NULL) { // out of memory @@ -109,7 +108,7 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap // A->x must be modified to fit the bitmap structure. A->x is calloc'd // since otherwise it would contain uninitialized values where A->b is // false and entries are not present. - Cx_new = GB_CALLOC (anzmax * asize, GB_void, &Cx_size) ; + Cx_new = GB_CALLOC_MEMORY (anzmax, asize, &Cx_size) ; Ax_shallow = false ; if (Cx_new == NULL) { @@ -270,7 +269,7 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap } GB_phybix_free (A) ; - A->iso = A_iso ; // OK: convert_s2b, keep iso + A->iso = A_iso ; A->b = Cb ; A->b_size = Cb_size ; A->b_shallow = false ; Cb = NULL ; @@ -282,7 +281,12 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap A->plen = -1 ; A->nvec = avdim ; - A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; +// A->nvec_nonempty = (avlen == 0) ? 0 : avdim ; + GB_nvec_nonempty_set (A, (avlen == 0) ? 0 : avdim) ; + + A->p_is_32 = false ; // OK: bitmap always has p_is_32 = false + A->j_is_32 = false ; // OK: bitmap always has j_is_32 = false + A->i_is_32 = false ; // OK: bitmap always has i_is_32 = false A->magic = GB_MAGIC ; diff --git a/GraphBLAS/Source/convert/GB_convert_sparse_to_bitmap_test.c b/GraphBLAS/Source/convert/GB_convert_sparse_to_bitmap_test.c index 0694c045b5..7d52e5fbc9 100644 --- a/GraphBLAS/Source/convert/GB_convert_sparse_to_bitmap_test.c +++ b/GraphBLAS/Source/convert/GB_convert_sparse_to_bitmap_test.c @@ -2,7 +2,7 @@ // GB_convert_sparse_to_bitmap_test: test conversion of hyper/sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper.c b/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper.c index 9aa61133e1..c86bdf3e10 100644 --- a/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper.c +++ b/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper.c @@ -2,7 +2,7 @@ // GB_convert_sparse_to_hyper: convert a matrix from sparse to hyperspasre //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -64,7 +64,7 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse ASSERT (A->nvec == A->plen && A->plen == n) ; - const int64_t *restrict Ap_old = A->p ; + GB_Ap_DECLARE (Ap_old, const) ; GB_Ap_PTR (Ap_old, A) ; size_t Ap_old_size = A->p_size ; bool Ap_old_shallow = A->p_shallow ; @@ -83,8 +83,11 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse int64_t jstart, jend, my_nvec_nonempty = 0 ; ; GB_PARTITION (jstart, jend, n, tid, ntasks) ; for (int64_t j = jstart ; j < jend ; j++) - { - if (Ap_old [j] < Ap_old [j+1]) my_nvec_nonempty++ ; + { + if (GB_IGET (Ap_old, j) < GB_IGET (Ap_old, j+1)) + { + my_nvec_nonempty++ ; + } } Count [tid] = my_nvec_nonempty ; } @@ -93,27 +96,32 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse // compute cumulative sum of Counts and nvec_nonempty //---------------------------------------------------------------------- - GB_cumsum1 (Count, ntasks) ; + GB_cumsum1_64 ((uint64_t *) Count, ntasks) ; int64_t nvec_nonempty = Count [ntasks] ; - A->nvec_nonempty = nvec_nonempty ; +// A->nvec_nonempty = nvec_nonempty ; + GB_nvec_nonempty_set (A, nvec_nonempty) ; //---------------------------------------------------------------------- // allocate the new A->p and A->h //---------------------------------------------------------------------- - int64_t *restrict Ap_new = NULL ; size_t Ap_new_size = 0 ; - int64_t *restrict Ah_new = NULL ; size_t Ah_new_size = 0 ; + GB_Ap_DECLARE (Ap_new, ) ; size_t Ap_new_size = 0 ; + GB_Ah_DECLARE (Ah_new, ) ; size_t Ah_new_size = 0 ; int64_t plen_new = (n == 1) ? 1 : nvec_nonempty ; - Ap_new = GB_MALLOC (plen_new+1, int64_t, &Ap_new_size) ; - Ah_new = GB_MALLOC (plen_new , int64_t, &Ah_new_size) ; + size_t psize = A->p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = A->j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + Ap_new = GB_MALLOC_MEMORY (plen_new+1, psize, &Ap_new_size) ; + Ah_new = GB_MALLOC_MEMORY (plen_new , jsize, &Ah_new_size) ; if (Ap_new == NULL || Ah_new == NULL) { // out of memory GB_WERK_POP (Count, int64_t) ; - GB_FREE (&Ap_new, Ap_new_size) ; - GB_FREE (&Ah_new, Ah_new_size) ; + GB_FREE_MEMORY (&Ap_new, Ap_new_size) ; + GB_FREE_MEMORY (&Ah_new, Ah_new_size) ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Ap_new, A->p_is_32) ; + GB_IPTR (Ah_new, A->j_is_32) ; //---------------------------------------------------------------------- // transplant the new A->p and A->h into the matrix @@ -137,18 +145,22 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse GB_PARTITION (jstart, jend, n, tid, ntasks) ; for (int64_t j = jstart ; j < jend ; j++) { - if (Ap_old [j] < Ap_old [j+1]) + int64_t p = GB_IGET (Ap_old, j) ; + if (p < GB_IGET (Ap_old, j+1)) { // vector index j is the kth vector in the new Ah - Ap_new [k] = Ap_old [j] ; - Ah_new [k] = j ; + // Ap_new [k] = p + GB_ISET (Ap_new, k, p) ; + // Ah_new [k] = j + GB_ISET (Ah_new, k, j) ; k++ ; } } ASSERT (k == Count [tid+1]) ; } - Ap_new [nvec_nonempty] = anz ; + // Ap_new [nvec_nonempty] = anz ; + GB_ISET (Ap_new, nvec_nonempty, anz) ; A->magic = GB_MAGIC ; //---------------------------------------------------------------------- @@ -158,7 +170,7 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse GB_WERK_POP (Count, int64_t) ; if (!Ap_old_shallow) { - GB_FREE (&Ap_old, Ap_old_size) ; + GB_FREE_MEMORY (&Ap_old, Ap_old_size) ; } //---------------------------------------------------------------------- diff --git a/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper_test.c b/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper_test.c index 6ca2b31deb..fb968721e5 100644 --- a/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper_test.c +++ b/GraphBLAS/Source/convert/GB_convert_sparse_to_hyper_test.c @@ -2,7 +2,7 @@ // GB_convert_sparse_to_hyper_test: test for sparse to hypersparse conversion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/GB_convert_to_nonfull.c b/GraphBLAS/Source/convert/GB_convert_to_nonfull.c index 7f7276a838..2e2526cea1 100644 --- a/GraphBLAS/Source/convert/GB_convert_to_nonfull.c +++ b/GraphBLAS/Source/convert/GB_convert_to_nonfull.c @@ -2,7 +2,7 @@ // GB_convert_to_nonfull: ensure a matrix is not full (hyper, sparse, or bitmap) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ GrB_Info GB_convert_to_nonfull // ensure a matrix is not full else if (sparsity_control & GxB_SPARSE) { // C can become sparse - return (GB_convert_full_to_sparse (A)) ; + return (GB_convert_full_to_sparse (A, Werk)) ; } else if (sparsity_control & GxB_HYPERSPARSE) { diff --git a/GraphBLAS/Source/convert/GB_sparsity_control.c b/GraphBLAS/Source/convert/GB_sparsity_control.c index 7b29bd57c4..8bbc18efbb 100644 --- a/GraphBLAS/Source/convert/GB_sparsity_control.c +++ b/GraphBLAS/Source/convert/GB_sparsity_control.c @@ -2,7 +2,7 @@ // GB_sparsity_control: ensure the sparsity_control is in the proper range //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/convert/template/GB_convert_b2s_template.c b/GraphBLAS/Source/convert/template/GB_convert_b2s_template.c index c3654b9bf4..99a565513e 100644 --- a/GraphBLAS/Source/convert/template/GB_convert_b2s_template.c +++ b/GraphBLAS/Source/convert/template/GB_convert_b2s_template.c @@ -2,7 +2,7 @@ // GB_convert_b2s_template: construct triplets or CSC/CSR from bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,6 +17,10 @@ const int64_t avdim = A->vdim ; const int64_t avlen = A->vlen ; const int8_t *restrict Ab = A->b ; + const GB_Cp_TYPE *restrict W = W_input ; + const GB_Cp_TYPE *restrict Cp = Cp_input ; + GB_Ci_TYPE *restrict Ci = Ci_input ; + GB_Cj_TYPE *restrict Cj = Cj_input ; #endif #ifdef GB_A_TYPE @@ -40,7 +44,7 @@ for (j = 0 ; j < avdim ; j++) { // gather from the bitmap into the new A (:,j) - int64_t pC = Cp [j] ; + int64_t pC = GB_IGET (Cp, j) ; int64_t pA_start = j * avlen ; for (int64_t i = 0 ; i < avlen ; i++) { @@ -48,14 +52,14 @@ if (Ab [pA]) { // A(i,j) is in the bitmap - if (Ci != NULL) Ci [pC] = i ; - if (Cj != NULL) Cj [pC] = j ; + if (Ci != NULL) GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ + if (Cj != NULL) GB_ISET (Cj, pC, j) ; /* Cj [pC] = j */ // Cx [pC] = Ax [pA]) GB_COPY (Cx, pC, Ax, pA) ; pC++ ; } } - ASSERT (pC == Cp [j+1]) ; + ASSERT (pC == GB_IGET (Cp, j+1)) ; } } @@ -66,17 +70,22 @@ // compute blocks of rows in parallel //---------------------------------------------------------------------- - int taskid ; + int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) - for (taskid = 0 ; taskid < nthreads ; taskid++) + for (tid = 0 ; tid < nthreads ; tid++) { - const int64_t *restrict Wtask = W + taskid * avdim ; + #ifdef GB_JIT_KERNEL + const GB_Cp_TYPE *restrict Wtask = W + tid * avdim ; + #else + uint32_t *restrict Wtask32 = Cp_is_32 ? (W32 + tid * avdim) : NULL ; + uint64_t *restrict Wtask64 = Cp_is_32 ? NULL : (W64 + tid * avdim) ; + #endif int64_t istart, iend ; - GB_PARTITION (istart, iend, avlen, taskid, nthreads) ; + GB_PARTITION (istart, iend, avlen, tid, nthreads) ; for (int64_t j = 0 ; j < avdim ; j++) { // gather from the bitmap into the new A (:,j) - int64_t pC = Cp [j] + Wtask [j] ; + int64_t pC = GB_IGET (Cp, j) + GB_IGET (Wtask, j) ; int64_t pA_start = j * avlen ; for (int64_t i = istart ; i < iend ; i++) { @@ -85,8 +94,8 @@ if (Ab [pA]) { // A(i,j) is in the bitmap - if (Ci != NULL) Ci [pC] = i ; - if (Cj != NULL) Cj [pC] = j ; + if (Ci != NULL) GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ + if (Cj != NULL) GB_ISET (Cj, pC, j) ; /* Cj [pC] = j */ GB_COPY (Cx, pC, Ax, pA) ; pC++ ; } @@ -96,6 +105,6 @@ } } -#undef GB_A_TYPE #undef GB_C_TYPE +#undef GB_A_TYPE diff --git a/GraphBLAS/Source/convert/template/GB_convert_s2b_nozombies.c b/GraphBLAS/Source/convert/template/GB_convert_s2b_nozombies.c index acb7e85cf8..f624132865 100644 --- a/GraphBLAS/Source/convert/template/GB_convert_s2b_nozombies.c +++ b/GraphBLAS/Source/convert/template/GB_convert_s2b_nozombies.c @@ -2,7 +2,7 @@ // GB_convert_s2b_nozombies: convert A from sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,9 +28,9 @@ // find the part of A(:,j) to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; - GB_GET_PA (pA_start, pA_end, tid, k, - kfirst, klast, pstart_Aslice, Ap [k], Ap [k+1]) ; + int64_t j = GBh_A (Ah, k) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // the start of A(:,j) in the new bitmap int64_t pC_start = j * avlen ; @@ -42,7 +42,7 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) { // A(i,j) has index i, value Ax [pA] - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pC = i + pC_start ; // move A(i,j) to its new place in the bitmap // Cx [pC] = Ax [pA] diff --git a/GraphBLAS/Source/convert/template/GB_convert_s2b_template.c b/GraphBLAS/Source/convert/template/GB_convert_s2b_template.c index 62aa626bcc..06eb033890 100644 --- a/GraphBLAS/Source/convert/template/GB_convert_s2b_template.c +++ b/GraphBLAS/Source/convert/template/GB_convert_s2b_template.c @@ -2,7 +2,7 @@ // GB_convert_s2b_template: convert A from sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,14 +13,13 @@ { //-------------------------------------------------------------------------- - // get A + // get A and Cx_new //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int64_t avlen = A->vlen ; - #ifdef GB_A_TYPE const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_new ; diff --git a/GraphBLAS/Source/convert/template/GB_convert_s2b_zombies.c b/GraphBLAS/Source/convert/template/GB_convert_s2b_zombies.c index 9039b88a86..7b0bdf095a 100644 --- a/GraphBLAS/Source/convert/template/GB_convert_s2b_zombies.c +++ b/GraphBLAS/Source/convert/template/GB_convert_s2b_zombies.c @@ -2,7 +2,7 @@ // GB_convert_s2b_zombies: convert A from sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,9 +29,9 @@ // find the part of A(:,j) to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; - GB_GET_PA (pA_start, pA_end, tid, k, - kfirst, klast, pstart_Aslice, Ap [k], Ap [k+1]) ; + int64_t j = GBh_A (Ah, k) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; // the start of A(:,j) in the new bitmap int64_t pA_new = j * avlen ; @@ -43,7 +43,7 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) { // A(i,j) has index i, value Ax [pA] - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; if (!GB_IS_ZOMBIE (i)) { int64_t pC = i + pA_new ; diff --git a/GraphBLAS/Source/cpu/GB_cpu_features.h b/GraphBLAS/Source/cpu/GB_cpu_features.h index 9e52dbde1b..bb9775b4fc 100644 --- a/GraphBLAS/Source/cpu/GB_cpu_features.h +++ b/GraphBLAS/Source/cpu/GB_cpu_features.h @@ -2,7 +2,7 @@ // GB_cpu_features.h: GraphBLAS interface to Google's cpu_features package //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cpu/GB_cpu_features_impl.c b/GraphBLAS/Source/cpu/GB_cpu_features_impl.c index a8da662b12..43780ae28d 100644 --- a/GraphBLAS/Source/cpu/GB_cpu_features_impl.c +++ b/GraphBLAS/Source/cpu/GB_cpu_features_impl.c @@ -2,7 +2,7 @@ // GB_cpu_features_impl.c: Google's cpu_features package for GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,8 @@ #include "include/GB_compiler.h" #include "cpu/GB_cpu_features.h" +#include "include/GB_pedantic_disable.h" +#include "include/GB_unused.h" #if !defined ( GBNCPUFEAT ) diff --git a/GraphBLAS/Source/cpu/GB_cpu_features_support.c b/GraphBLAS/Source/cpu/GB_cpu_features_support.c index 38cde171d0..7f20a4baa3 100644 --- a/GraphBLAS/Source/cpu/GB_cpu_features_support.c +++ b/GraphBLAS/Source/cpu/GB_cpu_features_support.c @@ -2,7 +2,7 @@ // GB_cpu_features_support.c: Google's cpu_features package for GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/cumsum/GB_cumsum.c b/GraphBLAS/Source/cumsum/GB_cumsum.c index 5c3efb3da5..10dcf82fe4 100644 --- a/GraphBLAS/Source/cumsum/GB_cumsum.c +++ b/GraphBLAS/Source/cumsum/GB_cumsum.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_cumsum: cumlative sum of an array +// GB_cumsum: cumlative sum of an integer array (uint32_t or uint64_t) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,13 +16,17 @@ // On input, count [n] is not accessed and is implicitly zero on input. // On output, count [n] is the total sum. +// If count is uint32, returns true if OK, false if overflow. The overflow +// condition is not checked if count is uint64_t (always returns true). + #include "GB.h" -void GB_cumsum // cumulative sum of an array +bool GB_cumsum // cumulative sum of an array ( - int64_t *restrict count, // size n+1, input/output + void *restrict count_arg, // size n+1, input/output + bool count_is_32, // if true: count is uint32_t, else uint64_t const int64_t n, - int64_t *restrict kresult, // return k, if needed by the caller + int64_t *restrict kresult, // return k, if needed by the caller int nthreads, GB_Werk Werk ) @@ -32,7 +36,7 @@ void GB_cumsum // cumulative sum of an array // check inputs //-------------------------------------------------------------------------- - ASSERT (count != NULL) ; + ASSERT (count_arg != NULL) ; ASSERT (n >= 0) ; //-------------------------------------------------------------------------- @@ -45,7 +49,7 @@ void GB_cumsum // cumulative sum of an array if (nthreads > 1) { - nthreads = GB_IMIN (nthreads, n / (64 * 1024)) ; + nthreads = GB_IMIN (nthreads, n / GB_CHUNK_DEFAULT) ; nthreads = GB_IMAX (nthreads, 1) ; } @@ -53,176 +57,23 @@ void GB_cumsum // cumulative sum of an array // count = cumsum ([0 count[0:n-1]]) ; //-------------------------------------------------------------------------- - if (kresult == NULL) - { - - if (nthreads <= 2) - { - - //------------------------------------------------------------------ - // cumsum with one thread - //------------------------------------------------------------------ - - GB_cumsum1 (count, n) ; - - } - else - { - - //------------------------------------------------------------------ - // cumsum with multiple threads - //------------------------------------------------------------------ - - // allocate workspace - GB_WERK_DECLARE (ws, int64_t) ; - GB_WERK_PUSH (ws, nthreads, int64_t) ; - if (ws == NULL) - { - // out of memory; use a single thread instead - GB_cumsum1 (count, n) ; - return ; - } - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - // each task sums up its own part - int64_t istart, iend ; - GB_PARTITION (istart, iend, n, tid, nthreads) ; - int64_t s = 0 ; - for (int64_t i = istart ; i < iend ; i++) - { - s += count [i] ; - } - ws [tid] = s ; - } - - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - // each tasks computes the cumsum of its own part - int64_t istart, iend ; - GB_PARTITION (istart, iend, n, tid, nthreads) ; - int64_t s = 0 ; - for (int i = 0 ; i < tid ; i++) - { - s += ws [i] ; - } - for (int64_t i = istart ; i < iend ; i++) - { - int64_t c = count [i] ; - count [i] = s ; - s += c ; - } - if (iend == n) - { - count [n] = s ; - } - } - - // free workspace - GB_WERK_POP (ws, int64_t) ; - } + #define GB_WS_TYPE uint64_t + if (count_is_32) + { + uint32_t *restrict count = (uint32_t *) count_arg ; + #define GB_CUMSUM1_TYPE GB_cumsum1_32 + #define GB_CHECK_OVERFLOW 1 + #include "cumsum/factory/GB_cumsum_template.c" } else - { - - if (nthreads <= 2) - { - - //------------------------------------------------------------------ - // cumsum with one thread, also compute k - //------------------------------------------------------------------ - - int64_t k = 0 ; - int64_t s = 0 ; - for (int64_t i = 0 ; i < n ; i++) - { - int64_t c = count [i] ; - if (c != 0) k++ ; - count [i] = s ; - s += c ; - } - count [n] = s ; - (*kresult) = k ; - - } - else - { - - //------------------------------------------------------------------ - // cumsum with multiple threads, also compute k - //------------------------------------------------------------------ - - // allocate workspace - GB_WERK_DECLARE (ws, int64_t) ; - GB_WERK_DECLARE (wk, int64_t) ; - GB_WERK_PUSH (ws, nthreads, int64_t) ; - GB_WERK_PUSH (wk, nthreads, int64_t) ; - if (ws == NULL || wk == NULL) - { - // out of memory; use a single thread instead - GB_WERK_POP (wk, int64_t) ; - GB_WERK_POP (ws, int64_t) ; - GB_cumsum (count, n, kresult, 1, NULL) ; - return ; - } - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - // each task sums up its own part - int64_t istart, iend ; - GB_PARTITION (istart, iend, n, tid, nthreads) ; - int64_t k = 0 ; - int64_t s = 0 ; - for (int64_t i = istart ; i < iend ; i++) - { - int64_t c = count [i] ; - if (c != 0) k++ ; - s += c ; - } - ws [tid] = s ; - wk [tid] = k ; - } - - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - // each task computes the cumsum of its own part - int64_t istart, iend ; - GB_PARTITION (istart, iend, n, tid, nthreads) ; - int64_t s = 0 ; - for (int i = 0 ; i < tid ; i++) - { - s += ws [i] ; - } - for (int64_t i = istart ; i < iend ; i++) - { - int64_t c = count [i] ; - count [i] = s ; - s += c ; - } - if (iend == n) - { - count [n] = s ; - } - } - - int64_t k = 0 ; - for (int tid = 0 ; tid < nthreads ; tid++) - { - k += wk [tid] ; - } - (*kresult) = k ; - - // free workspace - GB_WERK_POP (wk, int64_t) ; - GB_WERK_POP (ws, int64_t) ; - } + { + uint64_t *restrict count = (uint64_t *) count_arg ; + #define GB_CUMSUM1_TYPE GB_cumsum1_64 + #define GB_CHECK_OVERFLOW 0 + #include "cumsum/factory/GB_cumsum_template.c" } + + return (true) ; } diff --git a/GraphBLAS/Source/cumsum/GB_cumsum.h b/GraphBLAS/Source/cumsum/GB_cumsum.h index 21d1687c60..071d707cef 100644 --- a/GraphBLAS/Source/cumsum/GB_cumsum.h +++ b/GraphBLAS/Source/cumsum/GB_cumsum.h @@ -2,7 +2,7 @@ // GB_cumsum.h: definitions for GB_cumsum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,11 +12,20 @@ #include "include/GB_cumsum1.h" -void GB_cumsum // cumulative sum of an array +bool GB_cumsum // cumulative sum of an array ( - int64_t *restrict count, // size n+1, input/output + void *restrict count_arg, // size n+1, input/output + bool count_is_32, // if true: count is uint32_t, else uint64_t + const int64_t n, + int64_t *restrict kresult, // return k, if needed by the caller + int nthreads, + GB_Werk Werk +) ; + +bool GB_cumsum_float // cumulative sum of an array +( + float *restrict count, // size n+1, input/output const int64_t n, - int64_t *restrict kresult, // return k, if needed by the caller int nthreads, GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/cumsum/GB_cumsum_float.c b/GraphBLAS/Source/cumsum/GB_cumsum_float.c new file mode 100644 index 0000000000..f449c40148 --- /dev/null +++ b/GraphBLAS/Source/cumsum/GB_cumsum_float.c @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// GB_cumsum_float: cumlative sum of a float array +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compute the cumulative sum of an array count[0:n], of size n+1: + +// count = cumsum ([0 count[0:n-1]]) ; + +// That is, count [j] on input is overwritten with sum (count [0..j-1]). +// On input, count [n] is not accessed and is implicitly zero on input. +// On output, count [n] is the total sum. + +#include "GB.h" + +bool GB_cumsum_float // cumulative sum of an array +( + float *restrict count, // size n+1, input/output + const int64_t n, + int nthreads, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (count != NULL) ; + ASSERT (n >= 0) ; + + //-------------------------------------------------------------------------- + // determine # of threads to use + //-------------------------------------------------------------------------- + + #if !defined ( _OPENMP ) + nthreads = 1 ; + #endif + + if (nthreads > 1) + { + nthreads = GB_IMIN (nthreads, n / GB_CHUNK_DEFAULT) ; + nthreads = GB_IMAX (nthreads, 1) ; + } + + //-------------------------------------------------------------------------- + // count = cumsum ([0 count[0:n-1]]) ; + //-------------------------------------------------------------------------- + + #define GB_CUMSUM1_TYPE GB_cumsum1_float + #define GB_CHECK_OVERFLOW 0 + #define GB_NO_KRESULT + #define GB_WS_TYPE double + #include "cumsum/factory/GB_cumsum_template.c" + + return (true) ; +} + diff --git a/GraphBLAS/Source/cumsum/factory/GB_cumsum_template.c b/GraphBLAS/Source/cumsum/factory/GB_cumsum_template.c new file mode 100644 index 0000000000..b34b8960b6 --- /dev/null +++ b/GraphBLAS/Source/cumsum/factory/GB_cumsum_template.c @@ -0,0 +1,281 @@ +//------------------------------------------------------------------------------ +// GB_cumsum_template: cumlative sum of an array (uint32_t or uint64_t) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compute the cumulative sum of an array count[0:n], of size n+1, +// and of type uint32_t or uint64_t: + +// k = sum (count [0:n-1] != 0) ; +// count = cumsum ([0 count[0:n-1]]) ; + +// That is, count [j] on input is overwritten with sum (count [0..j-1]). +// On input, count [n] is not accessed and is implicitly zero on input. +// On output, count [n] is the total sum. + +// If the type is uint32_t, integer overflow is checked. If it occurs, +// the count array is not modified and the method returns false. + +// Testing how GraphBLAS handles integer overflow would require a very large +// test problem (a matrix with over 4 billion entries). To keep the test suite +// modest in size, an artificial integer overflow can be triggered, but only +// when GraphBLAS is compiled with test coverage, inside MATLAB +// (GraphBLAS/Tcov). + +{ + #ifndef GB_NO_KRESULT + if (kresult != NULL) + { + + //---------------------------------------------------------------------- + // cumsum, and compute k, for uint32_t or uint64_t cases only + //---------------------------------------------------------------------- + + if (nthreads <= 2) + { + + //------------------------------------------------------------------ + // cumsum with one thread, also compute k + //------------------------------------------------------------------ + + uint64_t s = 0 ; + + #if GB_CHECK_OVERFLOW + { + for (int64_t i = 0 ; i < n ; i++) + { + s += count [i] ; + if (s > UINT32_MAX) + { + return (false) ; + } + } + #ifdef GBCOVER + // pretend to fail, for test coverage only + if (GB_Global_hack_get (5)) return (false) ; + #endif + s = 0 ; + } + #endif + + uint64_t k = 0 ; + for (int64_t i = 0 ; i < n ; i++) + { + uint64_t c = count [i] ; + if (c != 0) k++ ; + count [i] = s ; + s += c ; + } + count [n] = s ; + (*kresult) = k ; + + } + else + { + + //------------------------------------------------------------------ + // cumsum with multiple threads, also compute k + //------------------------------------------------------------------ + + // allocate workspace + GB_WERK_DECLARE (ws, uint64_t) ; + GB_WERK_DECLARE (wk, uint64_t) ; + GB_WERK_PUSH (ws, nthreads, uint64_t) ; + GB_WERK_PUSH (wk, nthreads, uint64_t) ; + if (ws == NULL || wk == NULL) + { + // out of memory; use a single thread instead + GB_WERK_POP (wk, uint64_t) ; + GB_WERK_POP (ws, uint64_t) ; + return (GB_cumsum (count, count_is_32, n, kresult, 1, NULL)) ; + } + + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + // each task sums up its own part + int64_t istart, iend ; + GB_PARTITION (istart, iend, n, tid, nthreads) ; + uint64_t k = 0 ; + uint64_t s = 0 ; + for (int64_t i = istart ; i < iend ; i++) + { + uint64_t c = count [i] ; + if (c != 0) k++ ; + s += c ; + } + ws [tid] = s ; + wk [tid] = k ; + } + + #if GB_CHECK_OVERFLOW + { + // for uint32_t case only + uint64_t total = 0 ; + for (tid = 0 ; tid < nthreads ; tid++) + { + total += ws [tid] ; + } + if (total > UINT32_MAX) + { + GB_WERK_POP (wk, uint64_t) ; + GB_WERK_POP (ws, uint64_t) ; + return (false) ; + } + } + #ifdef GBCOVER + if (GB_Global_hack_get (5)) + { + // pretend to fail, for test coverage only + GB_WERK_POP (wk, uint64_t) ; + GB_WERK_POP (ws, uint64_t) ; + return (false) ; + } + #endif + #endif + + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + // each task computes the cumsum of its own part + int64_t istart, iend ; + GB_PARTITION (istart, iend, n, tid, nthreads) ; + uint64_t s = 0 ; + for (int i = 0 ; i < tid ; i++) + { + s += ws [i] ; + } + for (int64_t i = istart ; i < iend ; i++) + { + uint64_t c = count [i] ; + count [i] = s ; + s += c ; + } + if (iend == n) + { + count [n] = s ; + } + } + + uint64_t k = 0 ; + for (int tid = 0 ; tid < nthreads ; tid++) + { + k += wk [tid] ; + } + (*kresult) = (int64_t) k ; + + // free workspace + GB_WERK_POP (wk, uint64_t) ; + GB_WERK_POP (ws, uint64_t) ; + } + } + else + #endif + { + + //---------------------------------------------------------------------- + // cumsum without k, for all types (uint32_t, uint64_t, and float) + //---------------------------------------------------------------------- + + if (nthreads <= 2) + { + + //------------------------------------------------------------------ + // cumsum with one thread + //------------------------------------------------------------------ + + return (GB_CUMSUM1_TYPE (count, n)) ; + + } + else + { + + //------------------------------------------------------------------ + // cumsum with multiple threads + //------------------------------------------------------------------ + + // allocate workspace + GB_WERK_DECLARE (ws, GB_WS_TYPE) ; + GB_WERK_PUSH (ws, nthreads, GB_WS_TYPE) ; + if (ws == NULL) + { + // out of memory; use a single thread instead + return (GB_CUMSUM1_TYPE (count, n)) ; + } + + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + // each task sums up its own part + int64_t istart, iend ; + GB_PARTITION (istart, iend, n, tid, nthreads) ; + GB_WS_TYPE s = 0 ; + for (int64_t i = istart ; i < iend ; i++) + { + s += count [i] ; + } + ws [tid] = s ; + } + + #if GB_CHECK_OVERFLOW + { + // for uint32_t case only + uint64_t total = 0 ; + for (tid = 0 ; tid < nthreads ; tid++) + { + total += ws [tid] ; + } + if (total > UINT32_MAX) + { + GB_WERK_POP (ws, GB_WS_TYPE) ; + return (false) ; + } + } + #ifdef GBCOVER + if (GB_Global_hack_get (5)) + { + // pretend to fail, for test coverage only + GB_WERK_POP (ws, GB_WS_TYPE) ; + return (false) ; + } + #endif + #endif + + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + // each tasks computes the cumsum of its own part + int64_t istart, iend ; + GB_PARTITION (istart, iend, n, tid, nthreads) ; + GB_WS_TYPE s = 0 ; + for (int i = 0 ; i < tid ; i++) + { + s += ws [i] ; + } + for (int64_t i = istart ; i < iend ; i++) + { + GB_WS_TYPE c = count [i] ; + count [i] = s ; + s += c ; + } + if (iend == n) + { + count [n] = s ; + } + } + + // free workspace + GB_WERK_POP (ws, GB_WS_TYPE) ; + } + } +} + +#undef GB_CHECK_OVERFLOW +#undef GB_CUMSUM1_TYPE + diff --git a/GraphBLAS/Source/cumsum/include/GB_cumsum1.h b/GraphBLAS/Source/cumsum/include/GB_cumsum1.h index d261d5cef1..a452f71dce 100644 --- a/GraphBLAS/Source/cumsum/include/GB_cumsum1.h +++ b/GraphBLAS/Source/cumsum/include/GB_cumsum1.h @@ -2,7 +2,7 @@ // GB_cumsum1: cumlative sum of an array (single threaded) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,9 +18,13 @@ #ifndef GB_CUMSUM1_H #define GB_CUMSUM1_H -static inline void GB_cumsum1 // cumulative sum of an array +//------------------------------------------------------------------------------ +// GB_cumsum1_64: uint64_t variant +//------------------------------------------------------------------------------ + +static inline bool GB_cumsum1_64 // cumulative sum of an array ( - int64_t *restrict count, // size n+1, input/output + uint64_t *restrict count, // size n+1, input/output const int64_t n ) { @@ -36,14 +40,100 @@ static inline void GB_cumsum1 // cumulative sum of an array // count = cumsum ([0 count[0:n-1]]) ; //-------------------------------------------------------------------------- - int64_t s = 0 ; + uint64_t s = 0 ; for (int64_t i = 0 ; i < n ; i++) { - int64_t c = count [i] ; + uint64_t c = count [i] ; count [i] = s ; s += c ; } count [n] = s ; + + return (true) ; // do not check for integer overflow +} + +//------------------------------------------------------------------------------ +// GB_cumsum1_32: uint32_t variant +//------------------------------------------------------------------------------ + +// Returns true if successful, false if integer overflow occurs. + +static inline bool GB_cumsum1_32 // cumulative sum of an array +( + uint32_t *restrict count, // size n+1, input/output + const int64_t n +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (count != NULL) ; + ASSERT (n >= 0) ; + + //-------------------------------------------------------------------------- + // check for overflow + //-------------------------------------------------------------------------- + + uint64_t s = 0 ; + for (int64_t i = 0 ; i < n ; i++) + { + s += count [i] ; + if (s > UINT32_MAX) + { + return (false) ; + } + } + + //-------------------------------------------------------------------------- + // count = cumsum ([0 count[0:n-1]]) ; + //-------------------------------------------------------------------------- + + s = 0 ; + for (int64_t i = 0 ; i < n ; i++) + { + uint64_t c = count [i] ; + count [i] = s ; + s += c ; + } + count [n] = s ; + + return (true) ; +} + +//------------------------------------------------------------------------------ +// GB_cumsum1_float: float variant +//------------------------------------------------------------------------------ + +static inline bool GB_cumsum1_float // cumulative sum of an array +( + float *restrict count, // size n+1, input/output + const int64_t n +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (count != NULL) ; + ASSERT (n >= 0) ; + + //-------------------------------------------------------------------------- + // count = cumsum ([0 count[0:n-1]]) ; + //-------------------------------------------------------------------------- + + double s = 0 ; + for (int64_t i = 0 ; i < n ; i++) + { + double c = count [i] ; + count [i] = s ; + s += c ; + } + count [n] = s ; + + return (true) ; } #endif diff --git a/GraphBLAS/Source/descriptor/GrB_Descriptor_free.c b/GraphBLAS/Source/descriptor/GrB_Descriptor_free.c index acff7daefd..95e073e8a3 100644 --- a/GraphBLAS/Source/descriptor/GrB_Descriptor_free.c +++ b/GraphBLAS/Source/descriptor/GrB_Descriptor_free.c @@ -2,7 +2,7 @@ // GrB_Descriptor_free: free a descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,14 +26,14 @@ GrB_Info GrB_Descriptor_free // free a descriptor { size_t header_size = desc->header_size ; // free the Descriptor user_name - GB_FREE (&(desc->user_name), desc->user_name_size) ; + GB_FREE_MEMORY (&(desc->user_name), desc->user_name_size) ; if (header_size > 0) { - GB_FREE (&(desc->logger), desc->logger_size) ; + GB_FREE_MEMORY (&(desc->logger), desc->logger_size) ; desc->logger_size = 0 ; desc->magic = GB_FREED ; // to help detect dangling pointers desc->header_size = 0 ; - GB_FREE (descriptor, header_size) ; + GB_FREE_MEMORY (descriptor, header_size) ; } } } diff --git a/GraphBLAS/Source/descriptor/GrB_Descriptor_new.c b/GraphBLAS/Source/descriptor/GrB_Descriptor_new.c index 7c220179f7..bb74c76ad7 100644 --- a/GraphBLAS/Source/descriptor/GrB_Descriptor_new.c +++ b/GraphBLAS/Source/descriptor/GrB_Descriptor_new.c @@ -2,7 +2,7 @@ // GrB_Descriptor_new: create a new descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GrB_Descriptor_new // create a new descriptor // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_new (&descriptor)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (descriptor) ; (*descriptor) = NULL ; @@ -31,7 +31,8 @@ GrB_Info GrB_Descriptor_new // create a new descriptor // allocate the descriptor size_t header_size ; - (*descriptor) = GB_MALLOC (1, struct GB_Descriptor_opaque, &header_size) ; + (*descriptor) = GB_MALLOC_MEMORY (1, sizeof (struct GB_Descriptor_opaque), + &header_size) ; if (*descriptor == NULL) { // out of memory @@ -54,6 +55,9 @@ GrB_Info GrB_Descriptor_new // create a new descriptor desc->do_sort = false ; // do not sort in GrB_mxm and others desc->compression = GxB_DEFAULT ; desc->import = GxB_DEFAULT ; // trust input data in GxB import/deserialize + desc->row_list = GxB_DEFAULT ; // use List->x of row index vector + desc->col_list = GxB_DEFAULT ; // use List->x of col index vector + desc->val_list = GxB_DEFAULT ; // use List->x of value vector return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/diag/GB_Matrix_diag.c b/GraphBLAS/Source/diag/GB_Matrix_diag.c index 9c5c5505e0..472c2eecf6 100644 --- a/GraphBLAS/Source/diag/GB_Matrix_diag.c +++ b/GraphBLAS/Source/diag/GB_Matrix_diag.c @@ -2,7 +2,7 @@ // GB_Matrix_diag: construct a diagonal matrix from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,7 +19,6 @@ } #include "diag/GB_diag.h" -#include "include/GB_unused.h" GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector ( @@ -38,19 +37,18 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector ASSERT_MATRIX_OK (C, "C input for GB_Matrix_diag", GB0) ; ASSERT_MATRIX_OK (V_in, "V input for GB_Matrix_diag", GB0) ; ASSERT (GB_VECTOR_OK (V_in)) ; // V_in is a vector on input - ASSERT (!GB_any_aliased (C, V_in)) ; // C and V_in cannot be aliased + ASSERT (!GB_any_aliased (C, V_in)) ; // C and V_in cannot be aliased ASSERT (!GB_IS_HYPERSPARSE (V_in)) ; // vectors cannot be hypersparse struct GB_Matrix_opaque T_header ; GrB_Matrix T = NULL ; GrB_Type ctype = C->type ; - GrB_Type vtype = V_in->type ; int64_t n = V_in->vlen + GB_IABS (k) ; // C must be n-by-n ASSERT (GB_NROWS (C) == GB_NCOLS (C)) ASSERT (GB_NROWS (C) == n) - ASSERT (GB_Type_compatible (ctype, vtype)) ; + ASSERT (GB_Type_compatible (ctype, V_in->type)) ; //-------------------------------------------------------------------------- // finish any pending work in V_in and clear the output matrix C @@ -67,8 +65,7 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector if (GB_IS_BITMAP (V_in)) { // make a deep copy of V_in and convert to CSC - // set T->iso = V_in->iso OK - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; GB_OK (GB_dup_worker (&T, V_in->iso, V_in, true, NULL)) ; GB_OK (GB_convert_bitmap_to_sparse (T, Werk)) ; V = T ; @@ -96,10 +93,14 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector const float bitmap_switch = C->bitmap_switch ; const int sparsity_control = C->sparsity_control ; - // set C->iso = C_iso OK + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + C_sparsity, vnz, n, n, Werk) ; + GB_OK (GB_new_bix (&C, // existing header - ctype, n, n, GB_Ap_malloc, csc, C_sparsity, false, - C->hyper_switch, vnz, vnz, true, C_iso)) ; + ctype, n, n, GB_ph_malloc, csc, C_sparsity, false, + C->hyper_switch, vnz, vnz, true, C_iso, Cp_is_32, Cj_is_32, Ci_is_32)) ; C->sparsity_control = sparsity_control ; C->bitmap_switch = bitmap_switch ; @@ -134,14 +135,18 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; int nthreads = GB_nthreads (vnz, chunk, nthreads_max) ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, ) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE_U (Ci, ) ; GB_Ci_PTR (Ci, C) ; //-------------------------------------------------------------------------- // copy the contents of V into the kth diagonal of C //-------------------------------------------------------------------------- + // C->x = (ctype) V->x + GB_OK (GB_cast_matrix (C, V)) ; + if (C_sparsity == GxB_SPARSE) { @@ -149,16 +154,13 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector // V is full, or can be treated as full, and k == 0 //---------------------------------------------------------------------- - // C->x = (ctype) V->x - GB_OK (GB_cast_matrix (C, V)) ; - // construct Cp and Ci int64_t p ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < vnz ; p++) { - Cp [p] = p ; - Ci [p] = p ; + GB_ISET (Cp, p, p) ; // Cp [p] = p ; + GB_ISET (Ci, p, p) ; // Ci [p] = p ; } } @@ -169,17 +171,16 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector // V is full, or can be treated as full, and k != 0 //---------------------------------------------------------------------- - // C->x = (ctype) V->x - GB_OK (GB_cast_matrix (C, V)) ; - // construct Cp, Ch, and Ci int64_t p ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < vnz ; p++) { - Cp [p] = p ; - Ch [p] = p + kpositive ; - Ci [p] = p + knegative ; + int64_t j = p + kpositive ; + int64_t i = p + knegative ; + GB_ISET (Cp, p, p) ; // Cp [p] = p ; + GB_ISET (Ch, p, j) ; // Ch [p] = j ; + GB_ISET (Ci, p, i) ; // Ci [p] = i ; } } @@ -190,19 +191,19 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector // V is sparse //---------------------------------------------------------------------- - // C->x = (ctype) V->x - GB_OK (GB_cast_matrix (C, V)) ; - - int64_t *restrict Vi = V->i ; + GB_Ai_DECLARE (Vi, const) ; GB_Ai_PTR (Vi, V) ; // construct Cp, Ch, and Ci int64_t p ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < vnz ; p++) { - Cp [p] = p ; - Ch [p] = Vi [p] + kpositive ; - Ci [p] = Vi [p] + knegative ; + int64_t i = GB_IGET (Vi, p) ; // i = Vi [p] + int64_t j = i + kpositive ; + i += knegative ; + GB_ISET (Cp, p, p) ; // Cp [p] = p ; + GB_ISET (Ch, p, j) ; // Ch [p] = j ; + GB_ISET (Ci, p, i) ; // Ci [p] = i ; } } @@ -210,10 +211,11 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector // finalize the matrix C //-------------------------------------------------------------------------- - Cp [vnz] = vnz ; + GB_ISET (Cp, vnz, vnz) ; // Cp [vnz] = vnz ; C->nvals = vnz ; C->nvec = vnz ; - C->nvec_nonempty = vnz ; +// C->nvec_nonempty = vnz ; + GB_nvec_nonempty_set (C, vnz) ; C->magic = GB_MAGIC ; //-------------------------------------------------------------------------- @@ -221,7 +223,6 @@ GrB_Info GB_Matrix_diag // build a diagonal matrix from a vector //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - ASSERT_MATRIX_OK (C, "C before conform for GB_Matrix_diag", GB0) ; GB_OK (GB_conform (C, Werk)) ; ASSERT_MATRIX_OK (C, "C output for GB_Matrix_diag", GB0) ; return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/diag/GB_Vector_diag.c b/GraphBLAS/Source/diag/GB_Vector_diag.c index 016d51f232..025aed5d81 100644 --- a/GraphBLAS/Source/diag/GB_Vector_diag.c +++ b/GraphBLAS/Source/diag/GB_Vector_diag.c @@ -2,7 +2,7 @@ // GB_Vector_diag: extract a diagonal from a matrix, as a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector ASSERT_MATRIX_OK (A, "A input for GB_Vector_diag", GB0) ; ASSERT_MATRIX_OK (V, "V input for GB_Vector_diag", GB0) ; ASSERT (GB_VECTOR_OK (V)) ; // V is a vector on input - ASSERT (!GB_any_aliased (A, V)) ; // A and V cannot be aliased + ASSERT (!GB_any_aliased (A, V)) ; // A and V cannot be aliased ASSERT (!GB_IS_HYPERSPARSE (V)) ; // vectors cannot be hypersparse struct GB_Matrix_opaque T_header ; @@ -103,12 +103,10 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector // extract the kth diagonal of A into the temporary hypersparse matrix T //-------------------------------------------------------------------------- - struct GB_Scalar_opaque Thunk_header ; - GrB_Scalar Thunk = GB_Scalar_wrap (&Thunk_header, GrB_INT64, &k) ; - - GB_CLEAR_STATIC_HEADER (T, &T_header) ; - GB_OK (GB_selector (T, GrB_DIAG, false, A, Thunk, Werk)) ; - + struct GB_Scalar_opaque scalar_header ; + GrB_Scalar scalar = GB_Scalar_wrap (&scalar_header, GrB_INT64, &k) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; + GB_OK (GB_selector (T, GrB_DIAG, false, A, scalar, Werk)) ; GB_OK (GB_convert_any_to_hyper (T, Werk)) ; GB_MATRIX_WAIT (T) ; ASSERT_MATRIX_OK (T, "T = diag (A,k)", GB0) ; @@ -121,9 +119,13 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector float bitmap_switch = V->bitmap_switch ; int sparsity_control = V->sparsity_control ; + bool Vp_is_32 = T->p_is_32 ; + bool Vj_is_32 = T->j_is_32 ; + bool Vi_is_32 = (k >= 0) ? T->i_is_32 : T->j_is_32 ; + GB_OK (GB_new (&V, // existing header - vtype, n, 1, GB_Ap_malloc, true, GxB_SPARSE, - GxB_NEVER_HYPER, 1)) ; + vtype, n, 1, GB_ph_malloc, true, GxB_SPARSE, + GxB_NEVER_HYPER, 1, Vp_is_32, Vj_is_32, Vi_is_32)) ; V->sparsity_control = sparsity_control ; V->bitmap_switch = bitmap_switch ; @@ -133,8 +135,10 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector GBURBLE ("(iso diag) ") ; } - V->p [0] = 0 ; - V->p [1] = vnz ; + GB_Cp_DECLARE (Vp, ) ; GB_Cp_PTR (Vp, V) ; + GB_ISET (Vp, 0, 0) ; // Vp [0] = 0 ; + GB_ISET (Vp, 1, vnz) ; // Vp [1] = vnz ; + V->nvals = vnz ; if (k >= 0) { @@ -168,7 +172,8 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector { // V->x = (vtype) T->x // V is sparse so malloc is OK - V->x = GB_XALLOC (false, V->iso, vnz, vtype->size, &(V->x_size)) ; + V->x = GB_XALLOC_MEMORY (false, V->iso, vnz, vtype->size, + &(V->x_size)) ; if (V->x == NULL) { // out of memory @@ -183,7 +188,8 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector //-------------------------------------------------------------------------- V->jumbled = T->jumbled ; - V->nvec_nonempty = (vnz == 0) ? 0 : 1 ; +// V->nvec_nonempty = (vnz == 0) ? 0 : 1 ; + GB_nvec_nonempty_set ((GrB_Matrix) V, (vnz == 0) ? 0 : 1) ; V->magic = GB_MAGIC ; //-------------------------------------------------------------------------- @@ -191,7 +197,6 @@ GrB_Info GB_Vector_diag // extract a diagonal from a matrix, as a vector //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - ASSERT_MATRIX_OK (V, "V before conform for GB_Vector_diag", GB0) ; GB_OK (GB_conform (V, Werk)) ; ASSERT_MATRIX_OK (V, "V output for GB_Vector_diag", GB0) ; return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/diag/GB_diag.h b/GraphBLAS/Source/diag/GB_diag.h index 95532167a1..f7414afb87 100644 --- a/GraphBLAS/Source/diag/GB_diag.h +++ b/GraphBLAS/Source/diag/GB_diag.h @@ -2,7 +2,7 @@ // GB_diag: definitions for GxB_Matrix_diag and GxB_Vector_diag //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/diag/GrB_Matrix_diag.c b/GraphBLAS/Source/diag/GrB_Matrix_diag.c index bbab3e6310..e638082f85 100644 --- a/GraphBLAS/Source/diag/GrB_Matrix_diag.c +++ b/GraphBLAS/Source/diag/GrB_Matrix_diag.c @@ -2,7 +2,7 @@ // GrB_Matrix_diag: construct a diagonal matrix from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,8 @@ #include "diag/GB_diag.h" +#define GB_FREE_ALL ; + GrB_Info GrB_Matrix_diag // construct a diagonal matrix from a vector ( GrB_Matrix *C, // output matrix @@ -24,22 +26,19 @@ GrB_Info GrB_Matrix_diag // construct a diagonal matrix from a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_diag (&C, v, k)") ; + GB_WHERE_1 (v, "GrB_Matrix_diag (&C, v, k)") ; + GB_RETURN_IF_NULL (v) ; GB_BURBLE_START ("GrB_Matrix_diag") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; //-------------------------------------------------------------------------- // C = diag (v,k) //-------------------------------------------------------------------------- - GrB_Index n = v->vlen + GB_IABS (k) ; - GrB_Info info = GB_Matrix_new (C, v->type, n, n) ; - if (info == GrB_SUCCESS) - { - info = GB_Matrix_diag (*C, (GrB_Matrix) v, k, Werk) ; - } + uint64_t n = v->vlen + GB_IABS (k) ; + GB_OK (GB_Matrix_new (C, v->type, n, n)) ; + GB_OK (GB_Matrix_diag (*C, (GrB_Matrix) v, k, Werk)) ; GB_BURBLE_END ; - return (info) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/diag/GxB_Matrix_diag.c b/GraphBLAS/Source/diag/GxB_Matrix_diag.c index 99db07bfc6..d66a1fc6e3 100644 --- a/GraphBLAS/Source/diag/GxB_Matrix_diag.c +++ b/GraphBLAS/Source/diag/GxB_Matrix_diag.c @@ -2,7 +2,7 @@ // GxB_Matrix_diag: build a diagonal matrix from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,10 +22,11 @@ GrB_Info GxB_Matrix_diag // build a diagonal matrix from a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_diag (C, v, k, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE2 (C, v, "GxB_Matrix_diag (C, v, k, desc)") ; GB_BURBLE_START ("GxB_Matrix_diag") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; GrB_Type ctype = C->type ; GrB_Type vtype = v->type ; diff --git a/GraphBLAS/Source/diag/GxB_Vector_diag.c b/GraphBLAS/Source/diag/GxB_Vector_diag.c index f49fbce1ec..5876f58479 100644 --- a/GraphBLAS/Source/diag/GxB_Vector_diag.c +++ b/GraphBLAS/Source/diag/GxB_Vector_diag.c @@ -2,7 +2,7 @@ // GxB_Vector_diag: extract a diagonal (as a vector) from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,10 +22,11 @@ GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE (v, "GxB_Vector_diag (v, A, k, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE2 (v, A, "GxB_Vector_diag (v, A, k, desc)") ; GB_BURBLE_START ("GxB_Vector_diag") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; diff --git a/GraphBLAS/Source/dup/GB_dup.c b/GraphBLAS/Source/dup/GB_dup.c index 42a3425a18..912c1fef15 100644 --- a/GraphBLAS/Source/dup/GB_dup.c +++ b/GraphBLAS/Source/dup/GB_dup.c @@ -2,7 +2,7 @@ // GB_dup: make a deep copy of a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -57,8 +57,7 @@ GrB_Info GB_dup // make an exact copy of a matrix // C = A //-------------------------------------------------------------------------- - // set C->iso = A->iso OK - GB_BURBLE_MATRIX (A, "(iso dup) ") ; + GB_BURBLE_MATRIX (A, "(%sdup) ", A->iso ? "iso " : "") ; return (GB_dup_worker (Chandle, A->iso, A, true, NULL)) ; } diff --git a/GraphBLAS/Source/dup/GB_dup.h b/GraphBLAS/Source/dup/GB_dup.h index ac36f75551..9b16434bf3 100644 --- a/GraphBLAS/Source/dup/GB_dup.h +++ b/GraphBLAS/Source/dup/GB_dup.h @@ -2,7 +2,7 @@ // GB_dup.h: definitions for GB_dup* //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/dup/GB_dup_worker.c b/GraphBLAS/Source/dup/GB_dup_worker.c index be15e25474..cd004af000 100644 --- a/GraphBLAS/Source/dup/GB_dup_worker.c +++ b/GraphBLAS/Source/dup/GB_dup_worker.c @@ -2,7 +2,7 @@ // GB_dup_worker: make a deep copy of a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,12 +12,12 @@ // if numeric is false, C->x is allocated but not initialized. // If *Chandle is not NULL on input, the header is reused. It may be a static -// or dynamic header, depending on C->static_header. +// or dynamic header, depending on C->header_size. #include "GB.h" #include "get_set/GB_get_set.h" #define GB_FREE_ALL \ - GB_FREE (&C_user_name, C_user_name_size) ; + GB_FREE_MEMORY (&C_user_name, C_user_name_size) ; GrB_Info GB_dup_worker // make an exact copy of a matrix ( @@ -53,14 +53,9 @@ GrB_Info GB_dup_worker // make an exact copy of a matrix //-------------------------------------------------------------------------- int64_t anz = GB_nnz_held (A) ; - int64_t *Ap = A->p ; - int64_t *Ah = A->h ; - int64_t *Ai = A->i ; - int8_t *Ab = A->b ; - GB_void *Ax = (GB_void *) A->x ; int64_t anvec = A->nvec ; int64_t anvals = A->nvals ; - int64_t anvec_nonempty = A->nvec_nonempty ; + int64_t anvec_nonempty = GB_nvec_nonempty_update (A) ; int64_t A_nzombies = A->nzombies ; bool A_jumbled = A->jumbled ; int sparsity_control = A->sparsity_control ; @@ -88,15 +83,15 @@ GrB_Info GB_dup_worker // make an exact copy of a matrix //-------------------------------------------------------------------------- // create C; allocate C->p and do not initialize it. - // C has the exact same sparsity structure as A. + // C has the exact same sparsity structure and integer sizes as A. // allocate a new user header for C if (*Chandle) is NULL, or reuse the // existing static or dynamic header if (*Chandle) is not NULL. GrB_Matrix C = (*Chandle) ; - // set C->iso = C_iso OK: burble in the caller GB_OK (GB_new_bix (Chandle, // can be new or existing header - numeric ? atype : ctype, A->vlen, A->vdim, GB_Ap_malloc, A->is_csc, - GB_sparsity (A), false, A->hyper_switch, A->plen, anz, true, C_iso)) ; + numeric ? atype : ctype, A->vlen, A->vdim, GB_ph_malloc, A->is_csc, + GB_sparsity (A), false, A->hyper_switch, A->plen, anz, true, C_iso, + A->p_is_32, A->j_is_32, A->i_is_32)) ; C = (*Chandle) ; //-------------------------------------------------------------------------- @@ -104,33 +99,38 @@ GrB_Info GB_dup_worker // make an exact copy of a matrix //-------------------------------------------------------------------------- C->nvec = anvec ; - C->nvec_nonempty = anvec_nonempty ; +// C->nvec_nonempty = anvec_nonempty ; + GB_nvec_nonempty_set (C, anvec_nonempty) ; C->nvals = anvals ; C->jumbled = A_jumbled ; // C is jumbled if A is jumbled C->nzombies = A_nzombies ; // zombies can be duplicated C->sparsity_control = sparsity_control ; - if (Ap != NULL) + size_t psize = A->p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = A->j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = A->i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + if (A->p != NULL) { - GB_memcpy (C->p, Ap, (anvec+1) * sizeof (int64_t), nthreads_max) ; + GB_memcpy (C->p, A->p, (anvec+1) * psize, nthreads_max) ; } - if (Ah != NULL) + if (A->h != NULL) { - GB_memcpy (C->h, Ah, anvec * sizeof (int64_t), nthreads_max) ; + GB_memcpy (C->h, A->h, anvec * jsize, nthreads_max) ; } - if (Ab != NULL) + if (A->b != NULL) { - GB_memcpy (C->b, Ab, anz * sizeof (int8_t), nthreads_max) ; + GB_memcpy (C->b, A->b, anz * sizeof (int8_t), nthreads_max) ; } - if (Ai != NULL) + if (A->i != NULL) { - GB_memcpy (C->i, Ai, anz * sizeof (int64_t), nthreads_max) ; + GB_memcpy (C->i, A->i, anz * isize, nthreads_max) ; } if (numeric) { ASSERT (C_iso == A->iso) ; ASSERT (C->type == A->type) ; - GB_memcpy (C->x, Ax, (A->iso ? 1:anz) * atype->size, nthreads_max) ; + GB_memcpy (C->x, A->x, (A->iso ? 1:anz) * atype->size, nthreads_max) ; } C->magic = GB_MAGIC ; // C->p and C->h are now initialized diff --git a/GraphBLAS/Source/dup/GrB_Matrix_dup.c b/GraphBLAS/Source/dup/GrB_Matrix_dup.c index 70a9a885d8..31ee7c1717 100644 --- a/GraphBLAS/Source/dup/GrB_Matrix_dup.c +++ b/GraphBLAS/Source/dup/GrB_Matrix_dup.c @@ -2,7 +2,7 @@ // GrB_Matrix_dup: make a deep copy of a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,16 +22,16 @@ GrB_Info GrB_Matrix_dup // make an exact copy of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_dup (&C, A)") ; - GB_BURBLE_START ("GrB_Matrix_dup") ; GB_RETURN_IF_NULL (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_dup (&C, A)") ; + GB_BURBLE_START ("GrB_Matrix_dup") ; //-------------------------------------------------------------------------- // duplicate the matrix //-------------------------------------------------------------------------- - GrB_Info info = GB_dup (C, A, Werk) ; + info = GB_dup (C, A, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/dup/GrB_Scalar_dup.c b/GraphBLAS/Source/dup/GrB_Scalar_dup.c index 65d95f3459..12d7b29bd8 100644 --- a/GraphBLAS/Source/dup/GrB_Scalar_dup.c +++ b/GraphBLAS/Source/dup/GrB_Scalar_dup.c @@ -2,7 +2,7 @@ // GrB_Scalar_dup: make a deep copy of a sparse GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,9 +22,9 @@ GrB_Info GrB_Scalar_dup // make an exact copy of a GrB_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_dup (&s, t)") ; GB_RETURN_IF_NULL (s) ; - GB_RETURN_IF_NULL_OR_FAULTY (t) ; + GB_WHERE_1 (t, "GrB_Scalar_dup (&s, t)") ; + ASSERT (GB_SCALAR_OK (t)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/dup/GrB_Vector_dup.c b/GraphBLAS/Source/dup/GrB_Vector_dup.c index aaab2c285d..0612fa5711 100644 --- a/GraphBLAS/Source/dup/GrB_Vector_dup.c +++ b/GraphBLAS/Source/dup/GrB_Vector_dup.c @@ -2,7 +2,7 @@ // GrB_Vector_dup: make a deep copy of a sparse vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,17 +22,18 @@ GrB_Info GrB_Vector_dup // make an exact copy of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_dup (&w, u)") ; - GB_BURBLE_START ("GrB_Vector_dup") ; GB_RETURN_IF_NULL (w) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + GB_RETURN_IF_NULL (u) ; + GB_WHERE_1 (u, "GrB_Vector_dup (&w, u)") ; + GB_BURBLE_START ("GrB_Vector_dup") ; + ASSERT (GB_VECTOR_OK (u)) ; //-------------------------------------------------------------------------- // duplicate the vector //-------------------------------------------------------------------------- - GrB_Info info = GB_dup ((GrB_Matrix *) w, (GrB_Matrix) u, Werk) ; + info = GB_dup ((GrB_Matrix *) w, (GrB_Matrix) u, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/element/GB_Element.h b/GraphBLAS/Source/element/GB_Element.h index 67224a92d7..7561411d1a 100644 --- a/GraphBLAS/Source/element/GB_Element.h +++ b/GraphBLAS/Source/element/GB_Element.h @@ -2,7 +2,7 @@ // GB_Element.h: definitions for GB_*Element methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar const GrB_BinaryOp accum, // if NULL: C(row,col) = scalar // else: C(row,col) += scalar const void *scalar, // scalar to set - const GrB_Index row, // row index - const GrB_Index col, // column index + const uint64_t row, // row index + const uint64_t col, // column index const GB_Type_code scalar_code, // type of the scalar GB_Werk Werk ) ; @@ -25,15 +25,15 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar GrB_Info GB_Vector_removeElement ( GrB_Vector V, // vector to remove entry from - GrB_Index i, // index + uint64_t i, // index GB_Werk Werk ) ; GrB_Info GB_Matrix_removeElement ( GrB_Matrix C, // matrix to remove entry from - GrB_Index row, // row index - GrB_Index col, // column index + uint64_t row, // row index + uint64_t col, // column index GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/element/GB_setElement.c b/GraphBLAS/Source/element/GB_setElement.c index 2c6c88eee6..acff3fcf03 100644 --- a/GraphBLAS/Source/element/GB_setElement.c +++ b/GraphBLAS/Source/element/GB_setElement.c @@ -2,7 +2,7 @@ // GB_setElement: C(row,col) = scalar or += scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,8 +39,8 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar const GrB_BinaryOp accum, // if NULL: C(row,col) = scalar // else: C(row,col) += scalar const void *scalar, // scalar to set - const GrB_Index row, // row index - const GrB_Index col, // column index + const uint64_t row, // row index + const uint64_t col, // column index const GB_Type_code scalar_code, // type of the scalar GB_Werk Werk ) @@ -53,6 +53,7 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar GrB_Info info ; ASSERT (C != NULL) ; GB_RETURN_IF_NULL (scalar) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; if (row >= GB_NROWS (C)) { @@ -170,11 +171,11 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar // s = (ctype) scalar GB_void s [GB_VLA(csize)] ; GB_cast_scalar (s, ccode, scalar, scalar_code, csize) ; - GB_OK (GB_convert_any_to_iso (C, s)) ; + GB_OK (GB_convert_any_to_iso (C, s)) ; // OK } else { - GB_OK (GB_convert_any_to_iso (C, (GB_void *) scalar)) ; + GB_OK (GB_convert_any_to_iso (C, (GB_void *) scalar)) ; // OK } } @@ -222,31 +223,34 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar //---------------------------------------------------------------------- int64_t pC_start, pC_end ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; if (C->nvals == 0) { // C is empty found = false ; } - else if (Ch != NULL) + else if (C->h != NULL) { // C is hypersparse, with at least one entry - const int64_t *restrict C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; - const int64_t *restrict C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; - const int64_t *restrict C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; + void *C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; + void *C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; + void *C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; const int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; const int64_t cnvec = C->nvec ; - int64_t k = GB_hyper_hash_lookup (Ch, cnvec, Cp, C_Yp, C_Yi, C_Yx, - C_hash_bits, j, &pC_start, &pC_end) ; + int64_t k = GB_hyper_hash_lookup (C->p_is_32, C->j_is_32, + C->h, cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, + j, &pC_start, &pC_end) ; found = (k >= 0) ; - ASSERT (GB_IMPLIES (found, j == Ch [k])) ; + #ifdef GB_DEBUG + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + ASSERT (GB_IMPLIES (found, j == GB_IGET (Ch, k))) ; + #endif } else { // C is sparse - pC_start = Cp [j] ; - pC_end = Cp [j+1] ; + pC_start = GB_IGET (Cp, j) ; + pC_end = GB_IGET (Cp, j+1) ; found = true ; } @@ -261,9 +265,9 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar int64_t pright = pC_end - 1 ; // Time taken for this step is at most O(log(nnz(C(:,j))). - const int64_t *restrict Ci = C->i ; - GB_BINARY_SEARCH_ZOMBIE (i, Ci, pleft, pright, found, - C->nzombies, is_zombie) ; + const bool may_see_zombies = (C->nzombies > 0) ; + found = GB_binary_search_zombie (i, C->i, C->i_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; } } @@ -326,7 +330,8 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar if (is_zombie) { // bring the zombie back to life - C->i [pleft] = i ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + GB_ISET (Ci, pleft, i) ; // Ci [pleft] = i ; C->nzombies-- ; } else if (C_is_bitmap) @@ -428,8 +433,8 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar // tuples becomes the type of this scalar, and the pending operator // becomes NULL, which is the implicit SECOND_ctype operator, // or non-NULL if accum is present. - if (!GB_Pending_add (&(C->Pending), C->iso, (GB_void *) scalar, - stype, accum, i, j, C->vdim > 1, Werk)) + if (!GB_Pending_add (C, (GB_void *) scalar, stype, accum, i, j, + Werk)) { // out of memory GB_phybix_free (C) ; diff --git a/GraphBLAS/Source/element/GrB_Matrix_extractElement.c b/GraphBLAS/Source/element/GrB_Matrix_extractElement.c index 79a02fe05d..faf972be4b 100644 --- a/GraphBLAS/Source/element/GrB_Matrix_extractElement.c +++ b/GraphBLAS/Source/element/GrB_Matrix_extractElement.c @@ -2,7 +2,7 @@ // GrB_Matrix_extractElement: extract a single entry from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,8 +23,8 @@ GrB_Info GrB_Matrix_extractElement_Scalar // S = A(i,j) ( GrB_Scalar S, // extracted scalar const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index i, // row index - GrB_Index j // column index + uint64_t i, // row index + uint64_t j // column index ) { @@ -32,9 +32,9 @@ GrB_Info GrB_Matrix_extractElement_Scalar // S = A(i,j) // check inputs (just the GrB_Scalar S) //-------------------------------------------------------------------------- - GrB_Info info ; - GB_WHERE (S, "GrB_Matrix_extractElement_Scalar (s, A, row, col)") ; - GB_RETURN_IF_NULL_OR_FAULTY (S) ; + GB_WHERE2 (S, A, "GrB_Matrix_extractElement_Scalar (s, A, row, col)") ; + GB_RETURN_IF_NULL (S) ; + GB_RETURN_IF_NULL (A) ; //-------------------------------------------------------------------------- // ensure S is bitmap diff --git a/GraphBLAS/Source/element/GrB_Matrix_removeElement.c b/GraphBLAS/Source/element/GrB_Matrix_removeElement.c index bed63ddb23..a59bc247dd 100644 --- a/GraphBLAS/Source/element/GrB_Matrix_removeElement.c +++ b/GraphBLAS/Source/element/GrB_Matrix_removeElement.c @@ -2,7 +2,7 @@ // GrB_Matrix_removeElement: remove a single entry from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,8 +20,8 @@ static inline bool GB_removeElement // return true if found ( GrB_Matrix C, - GrB_Index i, - GrB_Index j + uint64_t i, + uint64_t j ) { @@ -63,33 +63,37 @@ static inline bool GB_removeElement // return true if found // C is sparse or hypersparse //---------------------------------------------------------------------- - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ci = C->i ; - const int64_t *restrict Ch = C->h ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + bool found ; int64_t pC_start, pC_end ; - if (Ch != NULL) + if (C->h != NULL) { //------------------------------------------------------------------ // C is hypersparse: look for j in hyperlist C->h [0 ... C->nvec-1] //------------------------------------------------------------------ - const int64_t *restrict C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; - const int64_t *restrict C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; - const int64_t *restrict C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; + void *C_Yp = (C->Y == NULL) ? NULL : C->Y->p ; + void *C_Yi = (C->Y == NULL) ? NULL : C->Y->i ; + void *C_Yx = (C->Y == NULL) ? NULL : C->Y->x ; const int64_t C_hash_bits = (C->Y == NULL) ? 0 : (C->Y->vdim - 1) ; const int64_t cnvec = C->nvec ; - int64_t k = GB_hyper_hash_lookup (Ch, cnvec, Cp, C_Yp, C_Yi, C_Yx, - C_hash_bits, j, &pC_start, &pC_end) ; + int64_t k = GB_hyper_hash_lookup (C->p_is_32, C->j_is_32, + C->h, cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, + j, &pC_start, &pC_end) ; found = (k >= 0) ; if (!found) { // vector j is empty return (false) ; } - ASSERT (j == Ch [k]) ; + #ifdef GB_DEBUG + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + ASSERT (j == GB_IGET (Ch, k)) ; + #endif } else @@ -99,8 +103,8 @@ static inline bool GB_removeElement // return true if found // C is sparse, C(:,j) is the jth vector of C //------------------------------------------------------------------ - pC_start = Cp [j] ; - pC_end = Cp [j+1] ; + pC_start = GB_IGET (Cp, j) ; + pC_end = GB_IGET (Cp, j+1) ; } // look in C(:,k), the kth vector of C @@ -113,23 +117,29 @@ static inline bool GB_removeElement // return true if found { // C(:,k) is as-if-full so no binary search needed to find C(i,k) pleft = pleft + i ; - ASSERT (GB_UNZOMBIE (Ci [pleft]) == i) ; + int64_t iC = GB_IGET (Ci, pleft) ; + ASSERT (i == GB_UNZOMBIE (iC)) ; found = true ; - is_zombie = GB_IS_ZOMBIE (Ci [pleft]) ; + is_zombie = GB_IS_ZOMBIE (iC) ; } else { // binary search for C(i,k): time is O(log(cknz)) - int64_t nzombies = C->nzombies ; - GB_BINARY_SEARCH_ZOMBIE (i, Ci, pleft, pright, found, - nzombies, is_zombie) ; + const bool may_see_zombies = (C->nzombies > 0) ; + found = GB_binary_search_zombie (i, Ci, C->i_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; } - // remove the entry + // remove the entry if found (unless it is already a zombie) if (found && !is_zombie) { // C(i,j) becomes a zombie - C->i [pleft] = GB_ZOMBIE (i) ; + #ifdef GB_DEBUG + int64_t iC = GB_IGET (Ci, pleft) ; + ASSERT (i == iC) ; + #endif + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pleft, i) ; // Ci [pleft] = i ; C->nzombies++ ; } return (found) ; @@ -143,8 +153,8 @@ static inline bool GB_removeElement // return true if found GrB_Info GB_Matrix_removeElement ( GrB_Matrix C, // matrix to remove entry from - GrB_Index row, // row index - GrB_Index col, // column index + uint64_t row, // row index + uint64_t col, // column index GB_Werk Werk ) { @@ -153,9 +163,9 @@ GrB_Info GB_Matrix_removeElement // if C is jumbled, wait on the matrix first. If full, convert to nonfull //-------------------------------------------------------------------------- + GrB_Info info ; if (C->jumbled || GB_IS_FULL (C)) { - GrB_Info info ; if (GB_IS_FULL (C)) { // convert C from full to sparse @@ -232,7 +242,6 @@ GrB_Info GB_Matrix_removeElement // assemble any pending tuples; zombies are OK if (C_is_pending) { - GrB_Info info ; GB_OK (GB_wait (C, "C (removeElement:pending tuples)", Werk)) ; ASSERT (!GB_ZOMBIES (C)) ; ASSERT (!GB_JUMBLED (C)) ; @@ -251,12 +260,14 @@ GrB_Info GB_Matrix_removeElement GrB_Info GrB_Matrix_removeElement ( GrB_Matrix C, // matrix to remove entry from - GrB_Index row, // row index - GrB_Index col // column index + uint64_t row, // row index + uint64_t col // column index ) { - GB_WHERE (C, "GrB_Matrix_removeElement (C, row, col)") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; + GB_RETURN_IF_NULL (C) ; + GB_WHERE1 (C, "GrB_Matrix_removeElement (C, row, col)") ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + return (GB_Matrix_removeElement (C, row, col, Werk)) ; } diff --git a/GraphBLAS/Source/element/GrB_Matrix_setElement.c b/GraphBLAS/Source/element/GrB_Matrix_setElement.c index a71ef5870a..669a262770 100644 --- a/GraphBLAS/Source/element/GrB_Matrix_setElement.c +++ b/GraphBLAS/Source/element/GrB_Matrix_setElement.c @@ -2,7 +2,7 @@ // GrB_Matrix_setElement: set an entry in a matrix, C(row,col) = x //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,17 +16,17 @@ #define GB_SET(prefix,type,T,ampersand) \ GrB_Info GB_EVAL3 (prefix, _Matrix_setElement_, T) /* C (row,col) = x */ \ ( \ - GrB_Matrix C, /* matrix to modify */\ - type x, /* scalar to assign to C(row,col) */\ - GrB_Index row, /* row index */\ - GrB_Index col /* column index */\ + GrB_Matrix C, /* matrix to modify */ \ + type x, /* scalar to assign to C(row,col) */ \ + uint64_t row, /* row index */ \ + uint64_t col /* column index */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_setElement_" GB_STR(T) \ - " (C, row, col, x)") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ + GB_RETURN_IF_NULL (C) ; \ + GB_WHERE1 (C, GB_STR(prefix) "_Matrix_setElement_" GB_STR(T) \ + " (C, row, col, x)"); \ return (GB_setElement (C, NULL, ampersand x, row, col, \ - GB_ ## T ## _code, Werk)) ; \ + GB_ ## T ## _code, Werk)) ; \ } GB_SET (GrB, bool , BOOL , &) @@ -54,10 +54,10 @@ GB_SET (GrB, void * , UDT , ) GrB_Info GrB_Matrix_setElement_Scalar ( - GrB_Matrix C, // matrix to modify - GrB_Scalar scalar, // scalar to assign to C(row,col) - GrB_Index row, // row index - GrB_Index col // column index + GrB_Matrix C, // matrix to modify + GrB_Scalar scalar, // scalar to assign to C(row,col) + uint64_t row, // row index + uint64_t col // column index ) { @@ -65,9 +65,9 @@ GrB_Info GrB_Matrix_setElement_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_setElement_Scalar (C, x, row, col)") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; + GB_WHERE2 (C, scalar, "GrB_Matrix_setElement_Scalar (C, x, row, col)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (scalar) ; //-------------------------------------------------------------------------- // set or remove the element diff --git a/GraphBLAS/Source/element/GrB_Scalar_extractElement.c b/GraphBLAS/Source/element/GrB_Scalar_extractElement.c index d7d1b659d9..5680a49aad 100644 --- a/GraphBLAS/Source/element/GrB_Scalar_extractElement.c +++ b/GraphBLAS/Source/element/GrB_Scalar_extractElement.c @@ -2,7 +2,7 @@ // GrB_Scalar_extractElement: extract a single entry from a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/element/GrB_Scalar_setElement.c b/GraphBLAS/Source/element/GrB_Scalar_setElement.c index 4d770d1df2..51550ad6a6 100644 --- a/GraphBLAS/Source/element/GrB_Scalar_setElement.c +++ b/GraphBLAS/Source/element/GrB_Scalar_setElement.c @@ -2,7 +2,7 @@ // GrB_Scalar_setElement: set an entry in a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,8 +19,8 @@ GrB_Info GB_EVAL2 (GRB (Scalar_setElement_), T) /* s = x */ \ type x /* user scalar to assign to s */ \ ) \ { \ - GB_WHERE (s, "GrB_Scalar_setElement_" GB_STR(T) " (w, x)") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (s) ; \ + GB_RETURN_IF_NULL (s) ; \ + GB_WHERE1 (s, "GrB_Scalar_setElement_" GB_STR(T) " (w, x)") ; \ ASSERT (GB_SCALAR_OK (s)) ; \ return (GB_setElement ((GrB_Matrix) s, NULL, ampersand x, 0, 0, \ GB_ ## T ## _code, Werk)) ; \ @@ -50,8 +50,8 @@ GrB_Info GB_EVAL2 (GXB (Scalar_setElement_), T) /* s = x */ \ type x /* user scalar to assign to s */ \ ) \ { \ - GB_WHERE (s, "GxB_Scalar_setElement_" GB_STR(T) " (w, x)") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (s) ; \ + GB_RETURN_IF_NULL (s) ; \ + GB_WHERE1 (s, "GxB_Scalar_setElement_" GB_STR(T) " (w, x)") ; \ ASSERT (GB_SCALAR_OK (s)) ; \ return (GB_setElement ((GrB_Matrix) s, NULL, ampersand x, 0, 0, \ GB_ ## T ## _code, Werk)) ; \ diff --git a/GraphBLAS/Source/element/GrB_Vector_extractElement.c b/GraphBLAS/Source/element/GrB_Vector_extractElement.c index 70b3ec81bc..67d703aee7 100644 --- a/GraphBLAS/Source/element/GrB_Vector_extractElement.c +++ b/GraphBLAS/Source/element/GrB_Vector_extractElement.c @@ -2,7 +2,7 @@ // GrB_Vector_extractElement: extract a single entry from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ GrB_Info GrB_Vector_extractElement_Scalar // S = V(i,j) ( GrB_Scalar S, // extracted scalar const GrB_Vector V, // vector to extract a scalar from - GrB_Index i // index + uint64_t i // index ) { @@ -31,9 +31,9 @@ GrB_Info GrB_Vector_extractElement_Scalar // S = V(i,j) // check inputs (just the GrB_Scalar S) //-------------------------------------------------------------------------- - GrB_Info info ; - GB_WHERE (S, "GrB_Vector_extractElement_Scalar (s, V, i)") ; - GB_RETURN_IF_NULL_OR_FAULTY (S) ; + GB_WHERE2 (S, V, "GrB_Vector_extractElement_Scalar (s, V, i)") ; + GB_RETURN_IF_NULL (S) ; + GB_RETURN_IF_NULL (V) ; //-------------------------------------------------------------------------- // ensure S is bitmap diff --git a/GraphBLAS/Source/element/GrB_Vector_removeElement.c b/GraphBLAS/Source/element/GrB_Vector_removeElement.c index d7f17419bf..ac76baf45e 100644 --- a/GraphBLAS/Source/element/GrB_Vector_removeElement.c +++ b/GraphBLAS/Source/element/GrB_Vector_removeElement.c @@ -2,7 +2,7 @@ // GrB_Vector_removeElement: remove a single entry from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ static inline bool GB_removeElement // returns true if found ( GrB_Vector V, - GrB_Index i + uint64_t i ) { @@ -60,13 +60,14 @@ static inline bool GB_removeElement // returns true if found // V is sparse //---------------------------------------------------------------------- - const int64_t *restrict Vp = V->p ; - const int64_t *restrict Vi = V->i ; + GB_Cp_DECLARE (Vp, const) ; GB_Cp_PTR (Vp, V) ; + GB_Ci_DECLARE (Vi, ) ; GB_Ci_PTR (Vi, V) ; + bool found ; // look in V(:) int64_t pleft = 0 ; - int64_t pright = Vp [1] ; + int64_t pright = GB_IGET (Vp, 1) ; int64_t vnz = pright ; bool is_zombie ; @@ -74,24 +75,30 @@ static inline bool GB_removeElement // returns true if found { // V(:) is as-if-full so no binary search is needed to find V(i) pleft = i ; - ASSERT (GB_UNZOMBIE (Vi [pleft]) == i) ; + int64_t iV = GB_IGET (Vi, pleft) ; + ASSERT (i == GB_UNZOMBIE (iV)) ; found = true ; - is_zombie = GB_IS_ZOMBIE (Vi [pleft]) ; + is_zombie = GB_IS_ZOMBIE (iV) ; } else { // binary search for V(i): time is O(log(vnz)) - int64_t nzombies = V->nzombies ; pright-- ; - GB_BINARY_SEARCH_ZOMBIE (i, Vi, pleft, pright, found, - nzombies, is_zombie) ; + const bool may_see_zombies = (V->nzombies > 0) ; + found = GB_binary_search_zombie (i, Vi, V->i_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; } - // remove the entry + // remove the entry if found (unless it is already a zombie) if (found && !is_zombie) { // V(i) becomes a zombie - V->i [pleft] = GB_ZOMBIE (i) ; + #ifdef GB_DEBUG + int64_t iV = GB_IGET (Vi, pleft) ; + ASSERT (i == iV) ; + #endif + i = GB_ZOMBIE (i) ; + GB_ISET (Vi, pleft, i) ; // Vi [pleft] = i ; V->nzombies++ ; } return (found) ; @@ -105,7 +112,7 @@ static inline bool GB_removeElement // returns true if found GrB_Info GB_Vector_removeElement ( GrB_Vector V, // vector to remove entry from - GrB_Index i, // index + uint64_t i, // index GB_Werk Werk ) { @@ -114,9 +121,9 @@ GrB_Info GB_Vector_removeElement // if V is jumbled, wait on the vector first. If full, convert to nonfull //-------------------------------------------------------------------------- + GrB_Info info ; if (V->jumbled || GB_IS_FULL (V)) { - GrB_Info info ; if (GB_IS_FULL (V)) { // convert V from full to sparse @@ -170,7 +177,6 @@ GrB_Info GB_Vector_removeElement // assemble any pending tuples; zombies are OK if (V_is_pending) { - GrB_Info info ; GB_OK (GB_wait ((GrB_Matrix) V, "v (removeElement:pending tuples)", Werk)) ; ASSERT (!GB_ZOMBIES (V)) ; @@ -190,11 +196,13 @@ GrB_Info GB_Vector_removeElement GrB_Info GrB_Vector_removeElement ( GrB_Vector V, // vector to remove entry from - GrB_Index i // index + uint64_t i // index ) { - GB_WHERE (V, "GrB_Vector_removeElement (v, i)") ; - GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GB_RETURN_IF_NULL (V) ; + GB_WHERE1 (V, "GrB_Vector_removeElement (v, i)") ; + GB_RETURN_IF_OUTPUT_IS_READONLY (V) ; + ASSERT (GB_VECTOR_OK (V)) ; return (GB_Vector_removeElement (V, i, Werk)) ; } diff --git a/GraphBLAS/Source/element/GrB_Vector_setElement.c b/GraphBLAS/Source/element/GrB_Vector_setElement.c index 8dbb6723f5..7190fddc4f 100644 --- a/GraphBLAS/Source/element/GrB_Vector_setElement.c +++ b/GraphBLAS/Source/element/GrB_Vector_setElement.c @@ -2,7 +2,7 @@ // GrB_Vector_setElement: set an entry in a vector, w (row) = x //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,16 +16,16 @@ #define GB_SET(prefix,type,T,ampersand) \ GrB_Info GB_EVAL3 (prefix, _Vector_setElement_, T) /* w(row) = x */ \ ( \ - GrB_Vector w, /* vector to modify */ \ - type x, /* scalar to assign to w(row) */ \ - GrB_Index row /* row index */ \ + GrB_Vector w, /* vector to modify */ \ + type x, /* scalar to assign to w(row) */ \ + uint64_t row /* row index */ \ ) \ { \ - GB_WHERE (w, "GrB_Vector_setElement_" GB_STR(T) " (w, x, row)") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ + GB_RETURN_IF_NULL (w) ; \ + GB_WHERE1 (w, "GrB_Vector_setElement_" GB_STR(T) " (w, x, row)") ; \ ASSERT (GB_VECTOR_OK (w)) ; \ return (GB_setElement ((GrB_Matrix) w, NULL, ampersand x, row, 0, \ - GB_ ## T ## _code, Werk)) ; \ + GB_ ## T ## _code, Werk)) ; \ } GB_SET (GrB, bool , BOOL , &) @@ -55,7 +55,7 @@ GrB_Info GrB_Vector_setElement_Scalar ( GrB_Vector w, // vector to modify GrB_Scalar scalar, // scalar to assign to w(row) - GrB_Index row // row index + uint64_t row // row index ) { @@ -63,9 +63,10 @@ GrB_Info GrB_Vector_setElement_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_setElement_Scalar (w, x, row)") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_NULL_OR_FAULTY (scalar) ; + GB_WHERE2 (w, scalar, "GrB_Vector_setElement_Scalar (w, x, row)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (scalar) ; + ASSERT (GB_VECTOR_OK (w)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/element/factory/GB_Matrix_extractElement.c b/GraphBLAS/Source/element/factory/GB_Matrix_extractElement.c index edac45e920..9e8b7fc731 100644 --- a/GraphBLAS/Source/element/factory/GB_Matrix_extractElement.c +++ b/GraphBLAS/Source/element/factory/GB_Matrix_extractElement.c @@ -2,7 +2,7 @@ // GB_Matrix_extractElement: x = A(row,col) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,8 +25,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) GB_XTYPE *x, // scalar to extract, not modified if not found #endif const GrB_Matrix A, // matrix to extract a scalar from - GrB_Index row, // row index - GrB_Index col // column index + uint64_t row, // row index + uint64_t col // column index ) { @@ -34,7 +34,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) // check inputs //-------------------------------------------------------------------------- - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; #ifdef GB_XTYPE GB_RETURN_IF_NULL (x) ; #endif @@ -46,8 +47,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) // delete any lingering zombies, assemble any pending tuples, and unjumble if (A->Pending != NULL || A->nzombies > 0 || A->jumbled) { - GrB_Info info ; - GB_WHERE1 (GB_WHERE_STRING) ; + GB_WHERE_1 (A, GB_WHERE_STRING) ; GB_BURBLE_START ("GrB_Matrix_extractElement") ; GB_OK (GB_wait (A, "A", Werk)) ; GB_BURBLE_END ; @@ -83,7 +83,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) int64_t pleft ; bool found ; - const int64_t *restrict Ap = A->p ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; if (Ap != NULL) { @@ -93,27 +93,30 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) //---------------------------------------------------------------------- int64_t pA_start, pA_end ; - const int64_t *restrict Ah = A->h ; - if (Ah != NULL) + if (A->h != NULL) { //------------------------------------------------------------------ // A is hypersparse: look for j in hyperlist A->h [0 ... A->nvec-1] //------------------------------------------------------------------ - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - int64_t k = GB_hyper_hash_lookup (Ah, A->nvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, j, &pA_start, &pA_end) ; + int64_t k = GB_hyper_hash_lookup (A->p_is_32, A->j_is_32, + A->h, A->nvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + j, &pA_start, &pA_end) ; found = (k >= 0) ; if (!found) { // vector j is empty return (GrB_NO_VALUE) ; } - ASSERT (j == Ah [k]) ; + #ifdef GB_DEBUG + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + ASSERT (j == GB_IGET (Ah, k)) ; + #endif } else @@ -123,8 +126,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) // A is sparse: look in the jth vector //------------------------------------------------------------------ - pA_start = Ap [j] ; - pA_end = Ap [j+1] ; + pA_start = GB_IGET (Ap, j); + pA_end = GB_IGET (Ap, j+1) ; } // vector j has been found, now look for index i @@ -132,8 +135,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = A(row,col) int64_t pright = pA_end - 1 ; // Time taken for this step is at most O(log(nnz(A(:,j))). - const int64_t *restrict Ai = A->i ; - GB_BINARY_SEARCH (i, Ai, pleft, pright, found) ; + found = GB_binary_search (i, A->i, A->i_is_32, &pleft, &pright) ; } else diff --git a/GraphBLAS/Source/element/factory/GB_Scalar_extractElement.c b/GraphBLAS/Source/element/factory/GB_Scalar_extractElement.c index 636a3e52d3..0151ade576 100644 --- a/GraphBLAS/Source/element/factory/GB_Scalar_extractElement.c +++ b/GraphBLAS/Source/element/factory/GB_Scalar_extractElement.c @@ -2,7 +2,7 @@ // GB_Scalar_extractElement_template: x = S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S // check inputs //-------------------------------------------------------------------------- - GB_RETURN_IF_NULL_OR_FAULTY (S) ; + GrB_Info info ; + GB_RETURN_IF_NULL_OR_INVALID (S) ; GB_RETURN_IF_NULL (x) ; // delete any lingering zombies, assemble any pending tuples, and unjumble @@ -36,8 +37,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S { // extract scalar with pending tuples or zombies. It cannot be // actually jumbled, but S->jumbled might true anyway. - GrB_Info info ; - GB_WHERE1 (GB_WHERE_STRING) ; + GB_WHERE_1 (S, GB_WHERE_STRING) ; GB_BURBLE_START ("GrB_Scalar_extractElement") ; GB_OK (GB_wait ((GrB_Matrix) S, "s", Werk)) ; GB_BURBLE_END ; @@ -52,8 +52,9 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S return (GrB_DOMAIN_MISMATCH) ; } + GB_Ap_DECLARE (Sp, const) ; GB_Ap_PTR (Sp, S) ; if (GB_nnz ((GrB_Matrix) S) == 0 // empty - || (S->p != NULL && S->p [1] == 0) // sparse/hyper with no entry + || (Sp != NULL && GB_IGET (Sp, 1) == 0) // sparse/hyper with no entry || (S->b != NULL && S->b [0] == 0)) // bitmap with no entry { // quick return diff --git a/GraphBLAS/Source/element/factory/GB_Vector_extractElement.c b/GraphBLAS/Source/element/factory/GB_Vector_extractElement.c index c6e2e85af8..268ae0c903 100644 --- a/GraphBLAS/Source/element/factory/GB_Vector_extractElement.c +++ b/GraphBLAS/Source/element/factory/GB_Vector_extractElement.c @@ -2,7 +2,7 @@ // GB_Vector_extractElement: x = V(i) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = V(i) GB_XTYPE *x, // scalar to extract, not modified if not found #endif const GrB_Vector V, // vector to extract a scalar from - GrB_Index i // index + uint64_t i // index ) { @@ -33,7 +33,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = V(i) // check inputs //-------------------------------------------------------------------------- - GB_RETURN_IF_NULL_OR_FAULTY (V) ; + GrB_Info info ; + GB_RETURN_IF_NULL_OR_INVALID (V) ; #ifdef GB_XTYPE GB_RETURN_IF_NULL (x) ; #endif @@ -41,8 +42,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = V(i) // delete any lingering zombies, assemble any pending tuples, and unjumble if (GB_ANY_PENDING_WORK (V)) { - GrB_Info info ; - GB_WHERE1 (GB_WHERE_STRING) ; + GB_WHERE_1 (V, GB_WHERE_STRING) ; GB_BURBLE_START ("GrB_Vector_extractElement") ; GB_OK (GB_wait ((GrB_Matrix) V, "v", Werk)) ; GB_BURBLE_END ; @@ -62,16 +62,15 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry, x = V(i) int64_t pleft ; bool found ; - const int64_t *restrict Vp = V->p ; + GB_Ap_DECLARE (Vp, const) ; GB_Ap_PTR (Vp, V) ; if (Vp != NULL) { // V is sparse pleft = 0 ; - int64_t pright = Vp [1] - 1 ; + int64_t pright = GB_IGET (Vp, 1) - 1 ; // Time taken for this step is at most O(log(nnz(V))). - const int64_t *restrict Vi = V->i ; - GB_BINARY_SEARCH (i, Vi, pleft, pright, found) ; + found = GB_binary_search (i, V->i, V->i_is_32, &pleft, &pright) ; } else { diff --git a/GraphBLAS/Source/emult/GB_emult.c b/GraphBLAS/Source/emult/GB_emult.c index bd4c825b61..37393258af 100644 --- a/GraphBLAS/Source/emult/GB_emult.c +++ b/GraphBLAS/Source/emult/GB_emult.c @@ -2,7 +2,7 @@ // GB_emult: C = A.*B, C=A.*B, or C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,7 @@ // The pattern of C is the intersection of A and B, and also intersection with // M if present and not complemented. -// TODO: if C is bitmap on input and C_sparsity is GxB_BITMAP, then C=A.*B, +// FUTURE: if C is bitmap on input and C_sparsity is GxB_BITMAP, then C=A.*B, // C=A.*B and C+=A.*B can all be done in-place. Also, if C is bitmap // but T=A.*B is sparse (M sparse, with A and B bitmap), then it too can // be done in place. @@ -37,15 +37,16 @@ #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ - GB_FREE_WORK (&C_to_M, C_to_M_size) ; \ - GB_FREE_WORK (&C_to_A, C_to_A_size) ; \ - GB_FREE_WORK (&C_to_B, C_to_B_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&C_to_M, C_to_M_size) ; \ + GB_FREE_MEMORY (&C_to_A, C_to_A_size) ; \ + GB_FREE_MEMORY (&C_to_B, C_to_B_size) ; \ } #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ GB_phybix_free (C) ; \ } @@ -71,7 +72,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for emult", GB0) ; ASSERT_MATRIX_OK (B, "B for emult", GB0) ; @@ -85,9 +86,14 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B //-------------------------------------------------------------------------- GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; - int64_t *restrict C_to_M = NULL ; size_t C_to_M_size = 0 ; - int64_t *restrict C_to_A = NULL ; size_t C_to_A_size = 0 ; - int64_t *restrict C_to_B = NULL ; size_t C_to_B_size = 0 ; + int64_t *C_to_M = NULL ; size_t C_to_M_size = 0 ; + int64_t *C_to_A = NULL ; size_t C_to_A_size = 0 ; + int64_t *C_to_B = NULL ; size_t C_to_B_size = 0 ; + int64_t Cnvec, Cnvec_nonempty ; + void *Cp = NULL ; size_t Cp_size = 0 ; + const void *Ch = NULL ; size_t Ch_size = 0 ; + int C_ntasks = 0, C_nthreads ; + bool Cp_is_32, Cj_is_32, Ci_is_32 ; //-------------------------------------------------------------------------- // delete any lingering zombies and assemble any pending tuples @@ -125,8 +131,6 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B case GB_PLUS_binop_code : // z = x + y case GB_TIMES_binop_code : // z = x * y case GB_PAIR_binop_code : // z = 1 - case GB_ISEQ_binop_code : // z = (x == y) - case GB_ISNE_binop_code : // z = (x != y) case GB_EQ_binop_code : // z = (x == y) case GB_NE_binop_code : // z = (x != y) case GB_LOR_binop_code : // z = x || y @@ -361,7 +365,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // sparse sparse sparse bitmap (method: 9) // sparse sparse sparse full (method: 9) - // TODO: this will use Method9 (M,A,B, flipxy=false) + // TODO: this will use Method9 (M,A,B) // The method will compute the 2-way intersection of M and A, // using the same parallization as C=A.*B when both A and B are @@ -376,7 +380,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // sparse sparse bitmap sparse (method: 10) // sparse sparse full sparse (method: 10) - // TODO: this will use Method10 (M,B,A, flipxy=true) + // TODO: this will use Method10 (M,B,A) // M and B must not be jumbled. default:; @@ -398,27 +402,24 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B GB_sparsity_char_matrix (A), GB_sparsity_char_matrix (B)) ; - //-------------------------------------------------------------------------- - // initializations - //-------------------------------------------------------------------------- - - int64_t Cnvec, Cnvec_nonempty ; - int64_t *Cp = NULL ; size_t Cp_size = 0 ; - const int64_t *Ch = NULL ; size_t Ch_size = 0 ; - int C_ntasks = 0, C_nthreads ; - //-------------------------------------------------------------------------- // phase0: finalize the sparsity C and find the vectors in C //-------------------------------------------------------------------------- + // Ch is either NULL, or a shallow copy of M->h, A->h, or B->h, and must + // not be freed here. + GB_OK (GB_emult_08_phase0 ( // computed by phase0: - &Cnvec, &Ch, &Ch_size, &C_to_M, &C_to_M_size, &C_to_A, &C_to_A_size, + &Cnvec, &Ch, &Ch_size, + &C_to_M, &C_to_M_size, + &C_to_A, &C_to_A_size, &C_to_B, &C_to_B_size, + &Cp_is_32, &Cj_is_32, &Ci_is_32, // input/output to phase0: &C_sparsity, // original input: - (apply_mask) ? M : NULL, A, B, Werk)) ; + (apply_mask) ? M : NULL, Mask_comp, A, B, Werk)) ; // C is still sparse or hypersparse, not bitmap or full ASSERT (C_sparsity == GxB_SPARSE || C_sparsity == GxB_HYPERSPARSE) ; @@ -432,7 +433,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // computed by phase1a: &TaskList, &TaskList_size, &C_ntasks, &C_nthreads, // computed by phase0: - Cnvec, Ch, C_to_M, C_to_A, C_to_B, false, + Cnvec, Ch, Cj_is_32, C_to_M, C_to_A, C_to_B, /* Ch_is_Mh: */ false, // original input: (apply_mask) ? M : NULL, A, B, Werk)) ; @@ -443,7 +444,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // from phase1a: TaskList, C_ntasks, C_nthreads, // from phase0: - Cnvec, Ch, C_to_M, C_to_A, C_to_B, + Cnvec, Ch, C_to_M, C_to_A, C_to_B, Cp_is_32, Cj_is_32, // original input: (apply_mask) ? M : NULL, Mask_struct, Mask_comp, A, B, Werk)) ; @@ -462,7 +463,8 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // from phase1a: TaskList, C_ntasks, C_nthreads, // from phase0: - Cnvec, Ch, Ch_size, C_to_M, C_to_A, C_to_B, C_sparsity, + Cnvec, Ch, Ch_size, C_to_M, C_to_A, C_to_B, + Cp_is_32, Cj_is_32, Ci_is_32, C_sparsity, // from GB_emult_sparsity: ewise_method, // original input: diff --git a/GraphBLAS/Source/emult/GB_emult.h b/GraphBLAS/Source/emult/GB_emult.h index d8c9d0ccae..2d5720246a 100644 --- a/GraphBLAS/Source/emult/GB_emult.h +++ b/GraphBLAS/Source/emult/GB_emult.h @@ -2,7 +2,7 @@ // GB_emult.h: definitions for GB_emult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -55,7 +55,7 @@ int GB_emult_sparsity // return the sparsity structure for C GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ( int64_t *p_Cnvec, // # of vectors to compute in C - const int64_t *restrict *Ch_handle, // Ch is M->h, A->h, B->h, or NULL + const void **Ch_handle, // Ch is M->h, A->h, B->h, or NULL size_t *Ch_size_handle, int64_t *restrict *C_to_M_handle, // C_to_M: size Cnvec, or NULL size_t *C_to_M_size_handle, @@ -63,9 +63,13 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B size_t *C_to_A_size_handle, int64_t *restrict *C_to_B_handle, // C_to_B: size Cnvec, or NULL size_t *C_to_B_size_handle, + bool *p_Cp_is_32, // if true, Cp is 32-bit; else 64-bit + bool *p_Cj_is_32, // if true, Ch is 32-bit; else 64-bit + bool *p_Ci_is_32, // if true, Ci is 32-bit; else 64-bit int *C_sparsity, // sparsity structure of C // original input: const GrB_Matrix M, // optional mask, may be NULL + const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, GB_Werk Werk @@ -74,19 +78,21 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B GrB_Info GB_emult_08_phase1 // count nnz in each C(:,j) ( // computed by phase1: - int64_t **Cp_handle, // output of size Cnvec+1 + void **Cp_handle, // output of size Cnvec+1 size_t *Cp_size_handle, - int64_t *Cnvec_nonempty, // # of non-empty vectors in C + int64_t *Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: GB_task_struct *restrict TaskList, // array of structs - const int C_ntasks, // # of tasks - const int C_nthreads, // # of threads to use + const int C_ntasks, // # of tasks + const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, // Ch is NULL, or shallow pointer + const void *Ch, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit // original input: const GrB_Matrix M, // optional mask, may be NULL const bool Mask_struct, // if true, use the only structure of M @@ -104,7 +110,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const GrB_BinaryOp op, // op to perform C = op (A,B) const bool flipij, // if true, i,j must be flipped // from phase1: - int64_t **Cp_handle, // vector pointers for C + void **Cp_handle, // vector pointers for C size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: @@ -113,11 +119,14 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, + const void *Ch, size_t Ch_size, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, + const bool Cp_is_32, + const bool Cj_is_32, + const bool Ci_is_32, const int C_sparsity, // from GB_emult_sparsity: const int ewise_method, @@ -160,10 +169,10 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 const int A_ntasks, const int A_nthreads, // workspace: - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, // output: - int64_t *Cp_kfirst, + uint64_t *Cp_kfirst, GB_Werk Werk ) ; @@ -244,7 +253,7 @@ GrB_Info GB_emult_generic // generic emult // from GB_emult_sparsity: const int ewise_method, // from GB_emult_04, GB_emult_03, GB_emult_02: - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, // to slice M, A, and/or B, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads, diff --git a/GraphBLAS/Source/emult/GB_emult_02.c b/GraphBLAS/Source/emult/GB_emult_02.c index 7879358b4d..f30447ab1a 100644 --- a/GraphBLAS/Source/emult/GB_emult_02.c +++ b/GraphBLAS/Source/emult/GB_emult_02.c @@ -2,7 +2,7 @@ // GB_emult_02: C = A.*B where A is sparse/hyper and B is bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,7 +56,6 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -65,7 +64,7 @@ #define GB_FREE_WORKSPACE \ { \ - GB_WERK_POP (Work, int64_t) ; \ + GB_WERK_POP (Work, uint64_t) ; \ GB_WERK_POP (A_ek_slicing, int64_t) ; \ } @@ -96,7 +95,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for emult_02", GB0) ; ASSERT_MATRIX_OK (A, "A for emult_02", GB0) ; @@ -135,7 +134,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full // declare workspace //-------------------------------------------------------------------------- - GB_WERK_DECLARE (Work, int64_t) ; + GB_WERK_DECLARE (Work, uint64_t) ; GB_WERK_DECLARE (A_ek_slicing, int64_t) ; //-------------------------------------------------------------------------- @@ -147,9 +146,6 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full (const GB_M_TYPE *) M->x ; const size_t msize = (M == NULL) ? 0 : M->type->size ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; const int64_t vlen = A->vlen ; const int64_t vdim = A->vdim ; const int64_t nvec = A->nvec ; @@ -171,9 +167,13 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full //-------------------------------------------------------------------------- GB_OK (GB_new (&C, // sparse or hyper (same as A), existing header - ctype, vlen, vdim, GB_Ap_calloc, C_is_csc, - C_sparsity, A->hyper_switch, nvec)) ; - int64_t *restrict Cp = C->p ; + ctype, vlen, vdim, GB_ph_calloc, C_is_csc, + C_sparsity, A->hyper_switch, nvec, + A->p_is_32, A->j_is_32, A->i_is_32)) ; + + ASSERT (C->p_is_32 == A->p_is_32) ; + ASSERT (C->j_is_32 == A->j_is_32) ; + ASSERT (C->i_is_32 == A->i_is_32) ; //-------------------------------------------------------------------------- // slice the input matrix A @@ -188,16 +188,16 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Work, 3*A_ntasks, int64_t) ; + GB_WERK_PUSH (Work, 3*A_ntasks, uint64_t) ; if (Work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - int64_t *restrict Wfirst = Work ; - int64_t *restrict Wlast = Work + A_ntasks ; - int64_t *restrict Cp_kfirst = Work + A_ntasks * 2 ; + uint64_t *restrict Wfirst = Work ; + uint64_t *restrict Wlast = Work + A_ntasks ; + uint64_t *restrict Cp_kfirst = Work + A_ntasks * 2 ; //-------------------------------------------------------------------------- // phase1: count entries in C and allocate C->i and C->x @@ -333,7 +333,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full return (info) ; } - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/emult/GB_emult_02_phase1.c b/GraphBLAS/Source/emult/GB_emult_02_phase1.c index 61bd226a0d..a4a8329dba 100644 --- a/GraphBLAS/Source/emult/GB_emult_02_phase1.c +++ b/GraphBLAS/Source/emult/GB_emult_02_phase1.c @@ -2,7 +2,7 @@ // GB_emult_02_phase1: C = A.*B where A is sparse/hyper and B is bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,6 +18,7 @@ #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" +#include "slice/factory/GB_ek_slice_merge.h" GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 ( @@ -34,10 +35,10 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 const int A_ntasks, const int A_nthreads, // workspace: - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, // output: - int64_t *Cp_kfirst, + uint64_t *Cp_kfirst, GB_Werk Werk ) { @@ -56,9 +57,10 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 (const GB_M_TYPE *) M->x ; const size_t msize = (M == NULL) ? 0 : M->type->size ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int64_t vlen = A->vlen ; const int64_t nvec = A->nvec ; const int64_t anz = GB_nnz (A) ; @@ -66,7 +68,14 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 const int8_t *restrict Bb = B->b ; const bool B_is_bitmap = GB_IS_BITMAP (B) ; - int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + const bool Cp_is_32 = C->p_is_32 ; + const bool Cj_is_32 = C->j_is_32 ; + const bool Ci_is_32 = C->i_is_32 ; + + ASSERT (C->p_is_32 == A->p_is_32) ; + ASSERT (C->j_is_32 == A->j_is_32) ; + ASSERT (C->i_is_32 == A->i_is_32) ; const int64_t *restrict kfirst_Aslice = A_ek_slicing ; const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; @@ -76,7 +85,8 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 // count entries in C //-------------------------------------------------------------------------- - C->nvec_nonempty = A->nvec_nonempty ; +// C->nvec_nonempty = A->nvec_nonempty ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty_get (A)) ; C->nvec = nvec ; const bool C_has_pattern_of_A = !B_is_bitmap && (M == NULL) ; @@ -105,14 +115,14 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 for (int64_t k = kfirst ; k <= klast ; k++) { // count the entries in C(:,j) - int64_t j = GBH (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t pB_start = j * vlen ; GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, - Ap [k], Ap [k+1]) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t cjnz = 0 ; for ( ; pA < pA_end ; pA++) { - cjnz += Bb [pB_start + Ai [pA]] ; + cjnz += Bb [pB_start + GB_IGET (Ai, pA)] ; } if (k == kfirst) { @@ -124,7 +134,7 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } } } @@ -152,18 +162,18 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 for (int64_t k = kfirst ; k <= klast ; k++) { // count the entries in C(:,j) - int64_t j = GBH (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t pB_start = j * vlen ; GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, - Ap [k], Ap [k+1]) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; int64_t cjnz = 0 ; for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pB = pB_start + i ; - bool mij = GBB (Mb, pB) && GB_MCAST (Mx, pB, msize) ; + bool mij = GBb_M (Mb, pB) && GB_MCAST (Mx, pB, msize) ; mij = mij ^ Mask_comp ; - cjnz += (mij && GBB (Bb, pB)) ; + cjnz += (mij && GBb_M (Bb, pB)) ; } if (k == kfirst) { @@ -175,7 +185,7 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } } } @@ -185,37 +195,46 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 // finalize Cp, cumulative sum of Cp and compute Cp_kfirst //---------------------------------------------------------------------- - GB_ek_slice_merge1 (Cp, Wfirst, Wlast, A_ek_slicing, A_ntasks) ; - GB_ek_slice_merge2 (&(C->nvec_nonempty), Cp_kfirst, Cp, nvec, - Wfirst, Wlast, A_ek_slicing, A_ntasks, A_nthreads, Werk) ; + GB_ek_slice_merge1 (Cp, Cp_is_32, + Wfirst, Wlast, A_ek_slicing, A_ntasks) ; + + int64_t nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, nvec, &nvec_nonempty, A_nthreads, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + + GB_ek_slice_merge2 (Cp_kfirst, Cp, Cp_is_32, + Wfirst, Wlast, A_ek_slicing, A_ntasks) ; } //-------------------------------------------------------------------------- // allocate C->i and C->x //-------------------------------------------------------------------------- - int64_t cnz = (C_has_pattern_of_A) ? anz : Cp [nvec] ; - // set C->iso = C_iso OK + int64_t cnz = (C_has_pattern_of_A) ? anz : GB_IGET (Cp, nvec) ; GB_OK (GB_bix_alloc (C, cnz, GxB_SPARSE, false, true, C_iso)) ; //-------------------------------------------------------------------------- // copy pattern into C //-------------------------------------------------------------------------- - // TODO: could make these components of C shallow instead of memcpy + // FUTURE: could make these components of C shallow instead of memcpy + + size_t cpsize = Cp_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t cjsize = Cj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t cisize = Ci_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; if (GB_IS_HYPERSPARSE (A)) { // copy A->h into C->h - GB_memcpy (C->h, Ah, nvec * sizeof (int64_t), A_nthreads) ; + GB_memcpy (C->h, Ah, nvec * cjsize, A_nthreads) ; } if (C_has_pattern_of_A) { // Method2/3(b): B is full and no mask present, so the pattern of C is // the same as the pattern of A - GB_memcpy (Cp, Ap, (nvec+1) * sizeof (int64_t), A_nthreads) ; - GB_memcpy (C->i, Ai, cnz * sizeof (int64_t), A_nthreads) ; + GB_memcpy (Cp, Ap, (nvec+1) * cpsize, A_nthreads) ; + GB_memcpy (C->i, Ai, cnz * cisize, A_nthreads) ; } C->nvals = cnz ; diff --git a/GraphBLAS/Source/emult/GB_emult_03.c b/GraphBLAS/Source/emult/GB_emult_03.c index 8a9f18c85a..1f77f90bfc 100644 --- a/GraphBLAS/Source/emult/GB_emult_03.c +++ b/GraphBLAS/Source/emult/GB_emult_03.c @@ -2,7 +2,7 @@ // GB_emult_03: C = A.*B where A is bitmap/full and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,7 +56,6 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -65,7 +64,7 @@ #define GB_FREE_WORKSPACE \ { \ - GB_WERK_POP (Work, int64_t) ; \ + GB_WERK_POP (Work, uint64_t) ; \ GB_WERK_POP (B_ek_slicing, int64_t) ; \ } @@ -96,7 +95,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for emult_03", GB0) ; ASSERT_MATRIX_OK (A, "A for emult_03", GB0) ; @@ -135,21 +134,18 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper // declare workspace //-------------------------------------------------------------------------- - GB_WERK_DECLARE (Work, int64_t) ; + GB_WERK_DECLARE (Work, uint64_t) ; GB_WERK_DECLARE (B_ek_slicing, int64_t) ; //-------------------------------------------------------------------------- // get M, A, and B //-------------------------------------------------------------------------- - const int8_t *restrict Mb = (M == NULL) ? NULL : M->b ; + const int8_t *restrict Mb = (M == NULL) ? NULL : M->b ; const GB_M_TYPE *restrict Mx = (M == NULL || Mask_struct) ? NULL : (const GB_M_TYPE *) M->x ; const size_t msize = (M == NULL) ? 0 : M->type->size ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; const int64_t vlen = B->vlen ; const int64_t vdim = B->vdim ; const int64_t nvec = B->nvec ; @@ -171,9 +167,13 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper //-------------------------------------------------------------------------- GB_OK (GB_new (&C, // sparse or hyper (same as B), existing header - ctype, vlen, vdim, GB_Ap_calloc, C_is_csc, - C_sparsity, B->hyper_switch, nvec)) ; - int64_t *restrict Cp = C->p ; + ctype, vlen, vdim, GB_ph_calloc, C_is_csc, + C_sparsity, B->hyper_switch, nvec, + B->p_is_32, B->j_is_32, B->i_is_32)) ; + + ASSERT (C->p_is_32 == B->p_is_32) ; + ASSERT (C->j_is_32 == B->j_is_32) ; + ASSERT (C->i_is_32 == B->i_is_32) ; //-------------------------------------------------------------------------- // slice the input matrix B @@ -188,16 +188,16 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Work, 3*B_ntasks, int64_t) ; + GB_WERK_PUSH (Work, 3*B_ntasks, uint64_t) ; if (Work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - int64_t *restrict Wfirst = Work ; - int64_t *restrict Wlast = Work + B_ntasks ; - int64_t *restrict Cp_kfirst = Work + B_ntasks * 2 ; + uint64_t *restrict Wfirst = Work ; + uint64_t *restrict Wlast = Work + B_ntasks ; + uint64_t *restrict Cp_kfirst = Work + B_ntasks * 2 ; //-------------------------------------------------------------------------- // phase1: count entries in C and allocate C->i and C->x @@ -334,7 +334,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper return (info) ; } - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/emult/GB_emult_04.c b/GraphBLAS/Source/emult/GB_emult_04.c index e64c65f62b..8855686914 100644 --- a/GraphBLAS/Source/emult/GB_emult_04.c +++ b/GraphBLAS/Source/emult/GB_emult_04.c @@ -2,13 +2,11 @@ // GB_emult_04: C= A.*B, M sparse/hyper, A and B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// full) = 48. Use the JIT for select phase1 instead? - // C= A.*B, M sparse/hyper, A and B bitmap/full. C has the same sparsity // structure as M, and its pattern is a subset of M. M is not complemented. @@ -27,16 +25,16 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif +#include "slice/factory/GB_ek_slice_merge.h" #define GB_FREE_WORKSPACE \ { \ - GB_WERK_POP (Work, int64_t) ; \ + GB_WERK_POP (Work, uint64_t) ; \ GB_WERK_POP (M_ek_slicing, int64_t) ; \ } @@ -67,7 +65,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (M, "M for emult_04", GB0) ; ASSERT_MATRIX_OK (A, "A for emult_04", GB0) ; @@ -93,19 +91,17 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // declare workspace //-------------------------------------------------------------------------- - GB_WERK_DECLARE (Work, int64_t) ; - int64_t *restrict Wfirst = NULL ; - int64_t *restrict Wlast = NULL ; - int64_t *restrict Cp_kfirst = NULL ; + GB_WERK_DECLARE (Work, uint64_t) ; GB_WERK_DECLARE (M_ek_slicing, int64_t) ; //-------------------------------------------------------------------------- // get M, A, and B //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const GB_M_TYPE *restrict Mx = (Mask_struct) ? NULL : (GB_M_TYPE *) M->x ; const int64_t vlen = M->vlen ; const int64_t vdim = M->vdim ; @@ -129,9 +125,17 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full //-------------------------------------------------------------------------- GB_OK (GB_new (&C, // sparse or hyper (same as M), existing header - ctype, vlen, vdim, GB_Ap_calloc, C_is_csc, - C_sparsity, M->hyper_switch, nvec)) ; - int64_t *restrict Cp = C->p ; + ctype, vlen, vdim, GB_ph_calloc, C_is_csc, + C_sparsity, M->hyper_switch, nvec, + M->p_is_32, M->j_is_32, M->i_is_32)) ; + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + bool Cp_is_32 = C->p_is_32 ; + bool Cj_is_32 = C->j_is_32 ; + ASSERT (Cp_is_32 == M->p_is_32) ; + ASSERT (Cj_is_32 == M->j_is_32) ; + ASSERT (C->i_is_32 == M->i_is_32) ; //-------------------------------------------------------------------------- // slice the mask matrix M @@ -146,16 +150,16 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Work, 3*M_ntasks, int64_t) ; + GB_WERK_PUSH (Work, 3*M_ntasks, uint64_t) ; if (Work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - Wfirst = Work ; - Wlast = Work + M_ntasks ; - Cp_kfirst = Work + M_ntasks * 2 ; + uint64_t *restrict Wfirst = Work ; + uint64_t *restrict Wlast = Work + M_ntasks ; + uint64_t *restrict Cp_kfirst = Work + M_ntasks * 2 ; //-------------------------------------------------------------------------- // count entries in C @@ -177,21 +181,18 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full for (int64_t k = kfirst ; k <= klast ; k++) { // count the entries in C(:,j) - int64_t j = GBH (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; int64_t pstart = j * vlen ; // start of A(:,j) and B(:,j) GB_GET_PA (pM, pM_end, tid, k, kfirst, klast, pstart_Mslice, - Mp [k], Mp [k+1]) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; int64_t cjnz = 0 ; for ( ; pM < pM_end ; pM++) { bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t i = Mi [pM] ; - cjnz += - (GBB (Ab, pstart + i) - && // TODO: for GB_add, use || instead - GBB (Bb, pstart + i)) ; + int64_t i = GB_IGET (Mi, pM) ; + cjnz += (GBb_A (Ab, pstart + i) && GBb_B (Bb, pstart + i)) ; } } if (k == kfirst) @@ -204,7 +205,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } } } @@ -213,28 +214,32 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // finalize Cp, cumulative sum of Cp and compute Cp_kfirst //-------------------------------------------------------------------------- - GB_ek_slice_merge1 (Cp, Wfirst, Wlast, M_ek_slicing, M_ntasks) ; - GB_ek_slice_merge2 (&(C->nvec_nonempty), Cp_kfirst, Cp, nvec, - Wfirst, Wlast, M_ek_slicing, M_ntasks, M_nthreads, Werk) ; + GB_ek_slice_merge1 (Cp, Cp_is_32, Wfirst, Wlast, M_ek_slicing, M_ntasks) ; + int64_t nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, nvec, &nvec_nonempty, M_nthreads, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + GB_ek_slice_merge2 (Cp_kfirst, Cp, Cp_is_32, + Wfirst, Wlast, M_ek_slicing, M_ntasks) ; //-------------------------------------------------------------------------- // allocate C->i and C->x //-------------------------------------------------------------------------- - int64_t cnz = Cp [nvec] ; - // set C->iso = C_iso OK + int64_t cnz = GB_IGET (Cp, nvec) ; GB_OK (GB_bix_alloc (C, cnz, GxB_SPARSE, false, true, C_iso)) ; //-------------------------------------------------------------------------- // copy pattern into C //-------------------------------------------------------------------------- - // TODO: could make these components of C shallow instead + // FUTURE: could make this components of C shallow instead + + size_t cjsize = Cj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; if (GB_IS_HYPERSPARSE (M)) { // copy M->h into C->h - GB_memcpy (C->h, Mh, nvec * sizeof (int64_t), M_nthreads) ; + GB_memcpy (C->h, Mh, nvec * cjsize, M_nthreads) ; } C->nvec = nvec ; @@ -367,7 +372,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full return (info) ; } - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/emult/GB_emult_08_phase0.c b/GraphBLAS/Source/emult/GB_emult_08_phase0.c index f2abf1920d..7ab29e12c2 100644 --- a/GraphBLAS/Source/emult/GB_emult_08_phase0.c +++ b/GraphBLAS/Source/emult/GB_emult_08_phase0.c @@ -2,7 +2,7 @@ // GB_emult_08_phase0: find vectors of C to compute for C=A.*B or C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,31 +16,32 @@ // The M, A, and B matrices are sparse or hypersparse. C will be sparse // (if Ch is returned NULL) or hypersparse (if Ch is returned non-NULL). -// Ch: the vectors to compute in C. Not allocated, but equal to either -// A->h, B->h, or M->h, or NULL if C is not hypersparse. +// Ch: the vectors to compute in C. Not allocated, either NULL if C is +// not hypersparse, or shallow and equal to A->h, B->h, or M->h. Ch is +// never allocated. // C_to_A: if A is hypersparse, and Ch is not A->h, then C_to_A [k] = kA // if the kth vector j = Ch [k] is equal to Ah [kA]. If j does not appear -// in A, then C_to_A [k] = -1. Otherwise, C_to_A is returned as NULL. -// C is always hypersparse in this case. +// in A, then C_to_A [k] = -1. C is always hypersparse in this case. +// Otherwise, C_to_A is returned as NULL. // C_to_B: if B is hypersparse, and Ch is not B->h, then C_to_B [k] = kB // if the kth vector j = Ch [k] is equal to Bh [kB]. If j does not appear -// in B, then C_to_B [k] = -1. Otherwise, C_to_B is returned as NULL. -// C is always hypersparse in this case. +// in B, then C_to_B [k] = -1. C is always hypersparse in this case. +// Otherwise, C_to_B is returned as NULL. // C_to_M: if M is hypersparse, and Ch is not M->h, then C_to_M [k] = kM -// if the kth vector j = GBH (Ch, k) is equal to Mh [kM]. -// If j does not appear in M, then C_to_M [k] = -1. Otherwise, C_to_M is -// returned as NULL. C is always hypersparse in this case. +// if the kth vector j = Ch [k] is equal to Mh [kM]. If j does not appear +// in M, then C_to_M [k] = -1. C is always hypersparse in this case. +// Otherwise, C_to_M is returned as NULL. // FUTURE:: exploit A==M, B==M, and A==B aliases #define GB_FREE_ALL \ { \ - GB_FREE_WORK (&C_to_M, C_to_M_size) ; \ - GB_FREE_WORK (&C_to_A, C_to_A_size) ; \ - GB_FREE_WORK (&C_to_B, C_to_B_size) ; \ + GB_FREE_MEMORY (&C_to_M, C_to_M_size) ; \ + GB_FREE_MEMORY (&C_to_A, C_to_A_size) ; \ + GB_FREE_MEMORY (&C_to_B, C_to_B_size) ; \ } #include "emult/GB_emult.h" @@ -48,7 +49,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ( int64_t *p_Cnvec, // # of vectors to compute in C - const int64_t *restrict *Ch_handle, // Ch is M->h, A->h, B->h, or NULL + const void **Ch_handle, // Ch is M->h, A->h, B->h, or NULL size_t *Ch_size_handle, int64_t *restrict *C_to_M_handle, // C_to_M: size Cnvec, or NULL size_t *C_to_M_size_handle, @@ -56,9 +57,13 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B size_t *C_to_A_size_handle, int64_t *restrict *C_to_B_handle, // C_to_B: size Cnvec, or NULL size_t *C_to_B_size_handle, + bool *p_Cp_is_32, // if true, Cp is 32-bit; else 64-bit + bool *p_Cj_is_32, // if true, Ch is 32-bit; else 64-bit + bool *p_Ci_is_32, // if true, Ci is 32-bit; else 64-bit int *C_sparsity, // sparsity structure of C // original input: const GrB_Matrix M, // optional mask, may be NULL + const bool Mask_comp, const GrB_Matrix A, const GrB_Matrix B, GB_Werk Werk @@ -75,6 +80,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ASSERT (p_Cnvec != NULL) ; ASSERT (Ch_handle != NULL) ; ASSERT (Ch_size_handle != NULL) ; + ASSERT (p_Cp_is_32 != NULL) ; + ASSERT (p_Cj_is_32 != NULL) ; + ASSERT (p_Ci_is_32 != NULL) ; ASSERT (C_to_A_handle != NULL) ; ASSERT (C_to_B_handle != NULL) ; @@ -114,7 +122,8 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ASSERT ((*C_sparsity) == GxB_SPARSE || (*C_sparsity) == GxB_HYPERSPARSE) ; - const int64_t *restrict Ch = NULL ; size_t Ch_size = 0 ; + GB_MDECL (Ch, , u) ; size_t Ch_size = 0 ; + int64_t *restrict C_to_M = NULL ; size_t C_to_M_size = 0 ; int64_t *restrict C_to_A = NULL ; size_t C_to_A_size = 0 ; int64_t *restrict C_to_B = NULL ; size_t C_to_B_size = 0 ; @@ -126,16 +135,15 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B int64_t n = A->vdim ; int64_t Anvec = A->nvec ; - int64_t vlen = A->vlen ; - const int64_t *restrict Ah = A->h ; + void *Ah = A->h ; bool A_is_hyper = (Ah != NULL) ; int64_t Bnvec = B->nvec ; - const int64_t *restrict Bh = B->h ; + void *Bh = B->h ; bool B_is_hyper = (Bh != NULL) ; int64_t Mnvec = 0 ; - const int64_t *restrict Mh = NULL ; + void *Mh = NULL ; bool M_is_hyper = false ; if (M != NULL) @@ -146,9 +154,27 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B } //-------------------------------------------------------------------------- - // determine how to construct the vectors of C + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + //-------------------------------------------------------------------------- + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + int64_t anz = GB_nnz (A) ; + int64_t bnz = GB_nnz (B) ; + int64_t cnz = GB_IMIN (anz, bnz) ; + if (M != NULL && !Mask_comp) + { + int64_t mnz = GB_nnz (M) ; + cnz = GB_IMIN (cnz, mnz) ; + } + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, cnz, A->vlen, A->vdim, Werk) ; + + //-------------------------------------------------------------------------- + // determine if C is sparse or hypersparse, and find its hyperlist //-------------------------------------------------------------------------- + int64_t Cnvec ; + if (M != NULL) { @@ -171,19 +197,23 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // Ch = smaller of Mh, Bh, Ah - int64_t nvec = GB_IMIN (Anvec, Bnvec) ; - nvec = GB_IMIN (nvec, Mnvec) ; - if (nvec == Anvec) + (*C_sparsity) = GxB_HYPERSPARSE ; + Cnvec = GB_IMIN (Anvec, Bnvec) ; + Cnvec = GB_IMIN (Cnvec, Mnvec) ; + if (Cnvec == Anvec) { Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; } - else if (nvec == Bnvec) + else if (Cnvec == Bnvec) { Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; } - else // (nvec == Mnvec) + else // (Cnvec == Mnvec) { Ch = Mh ; Ch_size = M->h_size ; + Cj_is_32 = M->j_is_32 ; } } @@ -195,13 +225,18 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B //---------------------------------------------------------- // Ch = smaller of Ah, Bh + (*C_sparsity) = GxB_HYPERSPARSE ; if (Anvec <= Bnvec) { Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; + Cnvec = Anvec ; } else { Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; + Cnvec = Bnvec ; } } @@ -217,13 +252,18 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B //---------------------------------------------------------- // Ch = smaller of Mh, Ah + (*C_sparsity) = GxB_HYPERSPARSE ; if (Anvec <= Mnvec) { Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; + Cnvec = Anvec ; } else { Ch = Mh ; Ch_size = M->h_size ; + Cj_is_32 = M->j_is_32 ; + Cnvec = Mnvec ; } } @@ -234,7 +274,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (4) A hyper, B sparse, M sparse: C hyper //---------------------------------------------------------- + (*C_sparsity) = GxB_HYPERSPARSE ; Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; + Cnvec = Anvec ; } } @@ -252,14 +295,18 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B //---------------------------------------------------------- // Ch = smaller of Mh, Bh - + (*C_sparsity) = GxB_HYPERSPARSE ; if (Bnvec <= Mnvec) { Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; + Cnvec = Bnvec ; } else { Ch = Mh ; Ch_size = M->h_size ; + Cj_is_32 = M->j_is_32 ; + Cnvec = Mnvec ; } } @@ -270,7 +317,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (6) A sparse, B hyper, M sparse: C hyper //---------------------------------------------------------- + (*C_sparsity) = GxB_HYPERSPARSE ; Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; + Cnvec = Bnvec ; } } @@ -284,7 +334,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (7) A sparse, B sparse, M hyper: C hyper //---------------------------------------------------------- + (*C_sparsity) = GxB_HYPERSPARSE ; Ch = Mh ; Ch_size = M->h_size ; + Cj_is_32 = M->j_is_32 ; + Cnvec = Mnvec ; } else @@ -294,7 +347,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (8) A sparse, B sparse, M sparse: C sparse //---------------------------------------------------------- + (*C_sparsity) = GxB_SPARSE ; Ch = NULL ; + Cnvec = n ; } } } @@ -319,14 +374,20 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B //-------------------------------------------------------------- // Ch = smaller of Ah, Bh + (*C_sparsity) = GxB_HYPERSPARSE ; if (Anvec <= Bnvec) { Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; + Cnvec = Anvec ; } else { Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; + Cnvec = Bnvec ; } + } else { @@ -335,7 +396,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (2) A hyper, B sparse: C hyper //-------------------------------------------------------------- + (*C_sparsity) = GxB_HYPERSPARSE ; Ch = Ah ; Ch_size = A->h_size ; + Cj_is_32 = A->j_is_32 ; + Cnvec = Anvec ; } @@ -350,7 +414,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (3) A sparse, B hyper: C hyper //-------------------------------------------------------------- + (*C_sparsity) = GxB_HYPERSPARSE ; Ch = Bh ; Ch_size = B->h_size ; + Cj_is_32 = B->j_is_32 ; + Cnvec = Bnvec ; } else @@ -360,41 +427,14 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // (4) A sparse, B sparse: C sparse //-------------------------------------------------------------- + (*C_sparsity) = GxB_SPARSE ; Ch = NULL ; + Cnvec = n ; } } } - //-------------------------------------------------------------------------- - // find Cnvec - //-------------------------------------------------------------------------- - - int64_t Cnvec ; - - if (Ch == NULL) - { - // C is sparse - (*C_sparsity) = GxB_SPARSE ; - Cnvec = n ; - } - else - { - // C is hypersparse; one of A, B, or M are hypersparse - ASSERT (A_is_hyper || B_is_hyper || M_is_hyper) ; - (*C_sparsity) = GxB_HYPERSPARSE ; - if (Ch == Ah) - { - Cnvec = Anvec ; - } - else if (Ch == Bh) - { - Cnvec = Bnvec ; - } - else // (Ch == Mh) - { - Cnvec = Mnvec ; - } - } + GB_IPTR (Ch, Cj_is_32) ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -412,7 +452,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { // allocate C_to_M ASSERT (Ch != NULL) ; - C_to_M = GB_MALLOC_WORK (Cnvec, int64_t, &C_to_M_size) ; + C_to_M = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), &C_to_M_size) ; if (C_to_M == NULL) { // out of memory @@ -423,10 +463,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // create the M->Y hyper_hash GB_OK (GB_hyper_hash_build (M, Werk)) ; - const int64_t *restrict Mp = M->p ; - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *Mp = M->p ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; // compute C_to_M @@ -435,9 +475,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B for (k = 0 ; k < Cnvec ; k++) { int64_t pM, pM_end ; - int64_t j = Ch [k] ; - int64_t kM = GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, - M_hash_bits, j, &pM, &pM_end) ; + int64_t j = GB_IGET (Ch, k) ; + int64_t kM = GB_hyper_hash_lookup (M->p_is_32, M->j_is_32, + Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, j, &pM, &pM_end) ; C_to_M [k] = (pM < pM_end) ? kM : -1 ; } } @@ -450,7 +490,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { // allocate C_to_A ASSERT (Ch != NULL) ; - C_to_A = GB_MALLOC_WORK (Cnvec, int64_t, &C_to_A_size) ; + C_to_A = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), &C_to_A_size) ; if (C_to_A == NULL) { // out of memory @@ -461,10 +501,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // create the A->Y hyper_hash GB_OK (GB_hyper_hash_build (A, Werk)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *Ap = A->p ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; // compute C_to_A @@ -473,9 +513,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B for (k = 0 ; k < Cnvec ; k++) { int64_t pA, pA_end ; - int64_t j = Ch [k] ; - int64_t kA = GB_hyper_hash_lookup (Ah, Anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, j, &pA, &pA_end) ; + int64_t j = GB_IGET (Ch, k) ; + int64_t kA = GB_hyper_hash_lookup (A->p_is_32, A->j_is_32, + Ah, Anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, j, &pA, &pA_end) ; C_to_A [k] = (pA < pA_end) ? kA : -1 ; } } @@ -488,7 +528,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B { // allocate C_to_B ASSERT (Ch != NULL) ; - C_to_B = GB_MALLOC_WORK (Cnvec, int64_t, &C_to_B_size) ; + C_to_B = GB_MALLOC_MEMORY (Cnvec, sizeof (int64_t), &C_to_B_size) ; if (C_to_B == NULL) { // out of memory @@ -499,10 +539,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B // create the B->Y hyper_hash GB_OK (GB_hyper_hash_build (B, Werk)) ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *restrict B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *restrict B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; + const void *Bp = B->p ; + const void *B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; + const void *B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; + const void *B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; // compute C_to_B @@ -511,9 +551,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B for (k = 0 ; k < Cnvec ; k++) { int64_t pB, pB_end ; - int64_t j = Ch [k] ; - int64_t kB = GB_hyper_hash_lookup (Bh, Bnvec, Bp, B_Yp, B_Yi, B_Yx, - B_hash_bits, j, &pB, &pB_end) ; + int64_t j = GB_IGET (Ch, k) ; + int64_t kB = GB_hyper_hash_lookup (B->p_is_32, B->j_is_32, + Bh, Bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, j, &pB, &pB_end) ; C_to_B [k] = (pB < pB_end) ? kB : -1 ; } } @@ -525,6 +565,9 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B (*p_Cnvec) = Cnvec ; (*Ch_handle) = Ch ; (*Ch_size_handle) = Ch_size ; + (*p_Cp_is_32) = Cp_is_32 ; + (*p_Cj_is_32) = Cj_is_32 ; + (*p_Ci_is_32) = Ci_is_32 ; if (C_to_M_handle != NULL) { (*C_to_M_handle) = C_to_M ; @@ -540,6 +583,10 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B #ifdef GB_DEBUG ASSERT (A != NULL) ; // A and B are always present ASSERT (B != NULL) ; + GB_IDECL (Ah, const, u) ; GB_IPTR (Ah, A->j_is_32) ; + GB_IDECL (Bh, const, u) ; GB_IPTR (Bh, B->j_is_32) ; + bool Mj_is_32 = (M == NULL) ? false : M->j_is_32 ; + GB_IDECL (Mh, const, u) ; GB_IPTR (Mh, Mj_is_32) ; int64_t jlast = -1 ; for (int64_t k = 0 ; k < Cnvec ; k++) { @@ -554,7 +601,7 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B else { // C will be constructed as hypersparse - j = Ch [k] ; + j = GB_IGET (Ch, k) ; } // vectors j in Ch are sorted, and in the range 0:n-1 @@ -571,14 +618,15 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ASSERT (kA >= -1 && kA < A->nvec) ; if (kA >= 0) { - int64_t jA = A->h [kA] ; + int64_t jA = GB_IGET (Ah, kA) ; // OK: A is hyper ASSERT (j == jA) ; } } else if (A_is_hyper) { // A is hypersparse, and Ch is a shallow copy of A->h - ASSERT (Ch == A->h) ; + ASSERT (Ch == Ah) ; + ASSERT (Cj_is_32 == A->j_is_32) ; } // see if B (:,j) exists @@ -590,45 +638,44 @@ GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ASSERT (kB >= -1 && kB < B->nvec) ; if (kB >= 0) { - int64_t jB = B->h [kB] ; + int64_t jB = GB_IGET (Bh, kB) ; // OK: B is hyper ASSERT (j == jB) ; } } else if (B_is_hyper) { // A is hypersparse, and Ch is a shallow copy of A->h - ASSERT (Ch == B->h) ; + ASSERT (Ch == Bh) ; + ASSERT (Cj_is_32 == B->j_is_32) ; } // see if M (:,j) exists - if (Ch != NULL && M != NULL && Ch == M->h) + if (Ch != NULL && M != NULL && Ch == Mh) { // Ch is the same as Mh - ASSERT (M != NULL) ; - ASSERT (M->h != NULL) ; - ASSERT (Ch != NULL && M->h != NULL && Ch [k] == M->h [k]) ; ASSERT (C_to_M == NULL) ; + ASSERT (Cj_is_32 == M->j_is_32) ; } else if (C_to_M != NULL) { // M is present and hypersparse ASSERT (M != NULL) ; - ASSERT (M->h != NULL) ; + ASSERT (Mh != NULL) ; + ASSERT (M_is_hyper) ; int64_t kM = C_to_M [k] ; ASSERT (kM >= -1 && kM < M->nvec) ; if (kM >= 0) { - int64_t jM = M->h [kM] ; + int64_t jM = GB_IGET (Mh, kM) ; // OK: M is hyper ASSERT (j == jM) ; } } else { // M is not present, or in sparse form - ASSERT (M == NULL || M->h == NULL) ; + ASSERT (M == NULL || Mh == NULL) ; } } - #endif return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/emult/GB_emult_08_phase1.c b/GraphBLAS/Source/emult/GB_emult_08_phase1.c index d5f4069e56..1a448d9d5e 100644 --- a/GraphBLAS/Source/emult/GB_emult_08_phase1.c +++ b/GraphBLAS/Source/emult/GB_emult_08_phase1.c @@ -2,7 +2,7 @@ // GB_emult_08_phase1: # entries in C=A.*B or C=A.*B (C sparse/hyper) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,19 +24,21 @@ GrB_Info GB_emult_08_phase1 // count nnz in each C(:,j) ( // computed by phase1: - int64_t **Cp_handle, // output of size Cnvec+1 + void **Cp_handle, // output of size Cnvec+1 size_t *Cp_size_handle, - int64_t *Cnvec_nonempty, // # of non-empty vectors in C + int64_t *Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: GB_task_struct *restrict TaskList, // array of structs - const int C_ntasks, // # of tasks - const int C_nthreads, // # of threads to use + const int C_ntasks, // # of tasks + const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, // Ch is NULL, or shallow pointer + const void *Ch, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + const bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit // original input: const GrB_Matrix M, // optional mask, may be NULL const bool Mask_struct, // if true, use the only structure of M @@ -83,27 +85,30 @@ GrB_Info GB_emult_08_phase1 // count nnz in each C(:,j) //-------------------------------------------------------------------------- (*Cp_handle) = NULL ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - Cp = GB_CALLOC (GB_IMAX (2, Cnvec+1), int64_t, &Cp_size) ; + GB_MDECL (Cp, , u) ; size_t Cp_size = 0 ; + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Cp = GB_CALLOC_MEMORY (GB_IMAX (2, Cnvec+1), cpsize, &Cp_size) ; if (Cp == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Cp, Cp_is_32) ; + GB_IDECL (Ch, const, u) ; GB_IPTR (Ch, Cj_is_32) ; //-------------------------------------------------------------------------- // count the entries in each vector of C //-------------------------------------------------------------------------- #define GB_EMULT_08_PHASE 1 - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" //-------------------------------------------------------------------------- // cumulative sum of Cp and fine tasks in TaskList //-------------------------------------------------------------------------- - GB_task_cumsum (Cp, Cnvec, Cnvec_nonempty, TaskList, C_ntasks, C_nthreads, - Werk) ; + GB_task_cumsum (Cp, Cp_is_32, Cnvec, Cnvec_nonempty, TaskList, + C_ntasks, C_nthreads, Werk) ; //-------------------------------------------------------------------------- // return the result diff --git a/GraphBLAS/Source/emult/GB_emult_08_phase2.c b/GraphBLAS/Source/emult/GB_emult_08_phase2.c index bd1c6726c4..b3b8028d56 100644 --- a/GraphBLAS/Source/emult/GB_emult_08_phase2.c +++ b/GraphBLAS/Source/emult/GB_emult_08_phase2.c @@ -2,15 +2,16 @@ // GB_emult_08_phase2: C=A.*B, C=A.*B, or C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // GB_emult_08_phase2 computes C=A.*B, C=A.*B, or C=A.*B. It is -// preceded first by GB_emult_08_phase0, which computes the list of vectors of -// C to compute (Ch) and their location in M, A, and B (C_to_[MAB]). Next, -// GB_emult_08_phase1 counts the entries in each vector C(:,j) and computes Cp. +// preceded first by GB_emult_08_phase0, which finds the list of vectors of +// C to compute (Ch, either NULL, or a shallow copy of A->h, B->h, or M->h) and +// their location in M, A, and B (C_to_[MAB]). Next, GB_emult_08_phase1 counts +// the entries in each vector C(:,j) and computes Cp. // GB_emult_08_phase2 computes the pattern and values of each vector of C(:,j), // entirely in parallel. @@ -26,7 +27,6 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -46,7 +46,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const GrB_BinaryOp op, // op to perform C = op (A,B) const bool flipij, // if true, i,j must be flipped // from phase1: - int64_t **Cp_handle, // vector pointers for C + void **Cp_handle, // vector pointers for C size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1a: @@ -55,11 +55,14 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const int C_nthreads, // # of threads to use // analysis from phase0: const int64_t Cnvec, - const int64_t *restrict Ch, + const void *Ch, size_t Ch_size, const int64_t *restrict C_to_M, const int64_t *restrict C_to_A, const int64_t *restrict C_to_B, + const bool Cp_is_32, + const bool Cj_is_32, + const bool Ci_is_32, const int C_sparsity, // from GB_emult_sparsity: const int ewise_method, @@ -77,20 +80,20 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_BINARYOP_OK (op, "op for emult phase2", GB0) ; - ASSERT_MATRIX_OK (A, "A for emult phase2", GB0) ; + ASSERT_MATRIX_OK (A, "A for emult 08 phase2", GB0) ; ASSERT (!GB_ZOMBIES (A)) ; ASSERT (!GB_JUMBLED (A)) ; ASSERT (!GB_PENDING (A)) ; - ASSERT_MATRIX_OK (B, "B for emult phase2", GB0) ; + ASSERT_MATRIX_OK (B, "B for emult 08 phase2", GB0) ; ASSERT (!GB_ZOMBIES (B)) ; ASSERT (!GB_JUMBLED (B)) ; ASSERT (!GB_PENDING (B)) ; - ASSERT_MATRIX_OK_OR_NULL (M, "M for emult phase2", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (M, "M for 08 emult phase2", GB0) ; ASSERT (!GB_ZOMBIES (M)) ; ASSERT (!GB_JUMBLED (M)) ; ASSERT (!GB_PENDING (M)) ; @@ -98,7 +101,10 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B ASSERT (A->vdim == B->vdim) ; ASSERT (Cp_handle != NULL) ; - int64_t *restrict Cp = (*Cp_handle) ; + + GB_MDECL (Cp, , u) ; + Cp = (*Cp_handle) ; + GB_IPTR (Cp, Cp_is_32) ; //-------------------------------------------------------------------------- // get the opcode @@ -138,24 +144,29 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B // allocate the output matrix C //-------------------------------------------------------------------------- - int64_t cnz = Cp [Cnvec] ; + int64_t cnz = GB_IGET (Cp, Cnvec) ; // allocate the result C (but do not allocate C->p or C->h) - // set C->iso = C_iso OK GrB_Info info = GB_new_bix (&C, // sparse/hyper, existing header - ctype, A->vlen, A->vdim, GB_Ap_null, C_is_csc, - C_sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso) ; + ctype, A->vlen, A->vdim, GB_ph_null, C_is_csc, + C_sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32) ; if (info != GrB_SUCCESS) { // out of memory; caller must free C_to_M, C_to_A, C_to_B // Ch must not be freed since Ch is always shallow - GB_FREE (Cp_handle, Cp_size) ; + GB_FREE_MEMORY (Cp_handle, Cp_size) ; return (info) ; } + ASSERT (C->p_is_32 == Cp_is_32) ; + ASSERT (C->j_is_32 == Cj_is_32) ; + ASSERT (C->i_is_32 == Ci_is_32) ; + // transplant Cp into C as the vector pointers, from GB_emult_08_phase1 - C->nvec_nonempty = Cnvec_nonempty ; - C->p = (int64_t *) Cp ; C->p_size = Cp_size ; +// C->nvec_nonempty = Cnvec_nonempty ; + GB_nvec_nonempty_set (C, Cnvec_nonempty) ; + C->p = Cp ; C->p_size = Cp_size ; C->nvals = cnz ; (*Cp_handle) = NULL ; @@ -163,7 +174,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B if (C_is_hyper) { // C->h is currently shallow; a copy is made at the end - C->h = (int64_t *) Ch ; C->h_size = Ch_size ; + C->h = (void *) Ch ; C->h_size = Ch_size ; C->h_shallow = true ; C->nvec = Cnvec ; } @@ -206,7 +217,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" info = GrB_SUCCESS ; } @@ -286,13 +297,14 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B return (info) ; } - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + ASSERT_MATRIX_OK (C, "C before hyper prune for emult 08 phase2", GB0) ; + GB_OK (GB_hyper_prune (C, Werk)) ; //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- - ASSERT_MATRIX_OK (C, "C output for emult phase2", GB0) ; + ASSERT_MATRIX_OK (C, "C output for emult 08 phase2", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/emult/GB_emult_bitmap.c b/GraphBLAS/Source/emult/GB_emult_bitmap.c index bca1196a42..534eff99c8 100644 --- a/GraphBLAS/Source/emult/GB_emult_bitmap.c +++ b/GraphBLAS/Source/emult/GB_emult_bitmap.c @@ -2,7 +2,7 @@ // GB_emult_bitmap: C = A.*B, C=A.*B, or C=A.*B when C is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -59,8 +59,6 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" -#include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -101,7 +99,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for bitmap emult ", GB0) ; ASSERT_MATRIX_OK (B, "B for bitmap emult ", GB0) ; @@ -173,10 +171,10 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B //-------------------------------------------------------------------------- // allocate the result C (but do not allocate C->p or C->h) - // set C->iso = C_iso OK GB_OK (GB_new_bix (&C, // bitmap, existing header - ctype, A->vlen, A->vdim, GB_Ap_null, C_is_csc, - GxB_BITMAP, true, A->hyper_switch, -1, cnz, true, C_iso)) ; + ctype, A->vlen, A->vdim, GB_ph_null, C_is_csc, + GxB_BITMAP, true, A->hyper_switch, -1, cnz, true, C_iso, + /* OK: */ false, false, false)) ; C->magic = GB_MAGIC ; GB_Type_code ccode = ctype->code ; diff --git a/GraphBLAS/Source/emult/GB_emult_generic.c b/GraphBLAS/Source/emult/GB_emult_generic.c index 0b252711fc..e54fbf026b 100644 --- a/GraphBLAS/Source/emult/GB_emult_generic.c +++ b/GraphBLAS/Source/emult/GB_emult_generic.c @@ -2,7 +2,7 @@ // GB_emult_generic: generic methods for eWiseMult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,8 +17,6 @@ #include "ewise/GB_ewise.h" #include "emult/GB_emult.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" -#include "slice/GB_ek_slice.h" #include "generic/GB_generic.h" GrB_Info GB_emult_generic // generic emult @@ -40,7 +38,7 @@ GrB_Info GB_emult_generic // generic emult // from GB_emult_sparsity const int ewise_method, // from GB_emult_04, GB_emult_03, GB_emult_02: - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, // to slice M, A, and/or B, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads, @@ -58,7 +56,7 @@ GrB_Info GB_emult_generic // generic emult // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for ewise generic", GB0) ; ASSERT_MATRIX_OK (A, "A for ewise generic", GB0) ; ASSERT_MATRIX_OK (B, "B for ewise generic", GB0) ; @@ -104,12 +102,12 @@ GrB_Info GB_emult_generic // generic emult const GB_cast_function cast_A_to_X = (A_is_pattern) ? NULL : GB_cast_factory (xtype->code, A->type->code) ; - const GB_cast_function cast_B_to_Y = + const GB_cast_function cast_B_to_Y = (B_is_pattern) ? NULL : GB_cast_factory (ytype->code, B->type->code) ; const GB_cast_function cast_Z_to_C = GB_cast_factory (ccode, op->ztype->code) ; - + // declare aij as xtype #define GB_DECLAREA(aij) \ GB_void aij [GB_VLA(xsize)] ; @@ -195,7 +193,7 @@ GrB_Info GB_emult_generic // generic emult else { // C is sparse: emult method 8 (abcdefgh) - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" } } else @@ -232,7 +230,7 @@ GrB_Info GB_emult_generic // generic emult else { // C is sparse: emult method 8 (abcdefgh) - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" } } @@ -279,7 +277,7 @@ GrB_Info GB_emult_generic // generic emult else { // C is sparse: emult method 8 (abcdefgh) - #include "emult/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_template.c" } } diff --git a/GraphBLAS/Source/emult/GB_emult_iso.c b/GraphBLAS/Source/emult/GB_emult_iso.c index 40e64ca3c6..40e88b0f1d 100644 --- a/GraphBLAS/Source/emult/GB_emult_iso.c +++ b/GraphBLAS/Source/emult/GB_emult_iso.c @@ -2,7 +2,7 @@ // GB_emult_iso: apply a binary op and check for iso result for C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/emult/GB_emult_sparsity.c b/GraphBLAS/Source/emult/GB_emult_sparsity.c index 8ffebd6969..72afb7da5e 100644 --- a/GraphBLAS/Source/emult/GB_emult_sparsity.c +++ b/GraphBLAS/Source/emult/GB_emult_sparsity.c @@ -2,7 +2,7 @@ // GB_emult_sparsity: determine the sparsity structure for C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/emult/GrB_Matrix_eWiseMult.c b/GraphBLAS/Source/emult/GrB_Matrix_eWiseMult.c index aab642981a..260398f11b 100644 --- a/GraphBLAS/Source/emult/GrB_Matrix_eWiseMult.c +++ b/GraphBLAS/Source/emult/GrB_Matrix_eWiseMult.c @@ -2,7 +2,7 @@ // GrB_Matrix_eWiseMult: matrix element-wise operations, using set intersection //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,29 +12,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (C) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (B) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - A_tran, B_tran, xx, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; \ - /* C = accum (C,T) where T = A.*B, A'.*B, A.*B', or A'.*B' */ \ - info = GB_ewise ( \ - C, C_replace, /* C and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and its descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '.*' */ \ - A, A_tran, /* A matrix and its descriptor */ \ - B, B_tran, /* B matrix and its descriptor */ \ - false, /* eWiseMult */ \ - false, NULL, NULL, /* not eWiseUnion */ \ - Werk) ; - //------------------------------------------------------------------------------ // GrB_Matrix_eWiseMult_BinaryOp: matrix element-wise multiplication //------------------------------------------------------------------------------ @@ -42,9 +19,9 @@ GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix Mask, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp mult, // defines '.*' for T=A.*B + const GrB_BinaryOp op, // defines '.*' for T=A.*B const GrB_Matrix A, // first input: matrix A const GrB_Matrix B, // second input: matrix B const GrB_Descriptor desc // descriptor for C, M, A, and B @@ -55,17 +32,38 @@ GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_eWiseMult_BinaryOp " - "(C, M, accum, mult, A, B, desc)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (B) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, Mask, A, B, + "GrB_Matrix_eWiseMult (C, M, accum, op, A, B, desc)") ; GB_BURBLE_START ("GrB_eWiseMult") ; - GB_RETURN_IF_NULL_OR_FAULTY (mult) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_tran, B_tran, xx, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // apply the eWise kernel (using set intersection) + // C = accum (C,T) where T = A.*B, A'.*B, A.*B', or A'.*B' //-------------------------------------------------------------------------- - GB_EWISE (mult) ; + info = GB_ewise ( + C, C_replace, // C and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // accumulate operator + op, // operator that defines '.*' + A, A_tran, // A matrix and its descriptor + B, B_tran, // B matrix and its descriptor + false, // eWiseMult + false, NULL, NULL, // not eWiseUnion + Werk) ; GB_BURBLE_END ; + return (info) ; } @@ -78,7 +76,7 @@ GrB_Info GrB_Matrix_eWiseMult_BinaryOp // C = accum (C, A.*B) GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Monoid monoid, // defines '.*' for T=A.*B const GrB_Matrix A, // first input: matrix A @@ -86,23 +84,9 @@ GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_eWiseMult_Monoid " - "(C, M, accum, monoid, A, B, desc)") ; - GB_BURBLE_START ("GrB_eWiseMult") ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - - //-------------------------------------------------------------------------- - // eWise multiply using the monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (monoid->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = monoid->op ; + return (GrB_Matrix_eWiseMult_BinaryOp (C, M, accum, op, A, B, desc)) ; } //------------------------------------------------------------------------------ @@ -114,7 +98,7 @@ GrB_Info GrB_Matrix_eWiseMult_Monoid // C = accum (C, A.*B) GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Semiring semiring, // defines '.*' for T=A.*B const GrB_Matrix A, // first input: matrix A @@ -122,22 +106,8 @@ GrB_Info GrB_Matrix_eWiseMult_Semiring // C = accum (C, A.*B) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_eWiseMult_Semiring " - "(C, M, accum, semiring, A, B, desc)") ; - GB_BURBLE_START ("GrB_eWiseMult") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - - //-------------------------------------------------------------------------- - // eWise multiply using the semiring multiply operator - //-------------------------------------------------------------------------- - - GB_EWISE (semiring->multiply) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = semiring->multiply ; + return (GrB_Matrix_eWiseMult_BinaryOp (C, M, accum, op, A, B, desc)) ; } diff --git a/GraphBLAS/Source/emult/GrB_Vector_eWiseMult.c b/GraphBLAS/Source/emult/GrB_Vector_eWiseMult.c index e28930f9c8..2508bdec0f 100644 --- a/GraphBLAS/Source/emult/GrB_Vector_eWiseMult.c +++ b/GraphBLAS/Source/emult/GrB_Vector_eWiseMult.c @@ -2,7 +2,7 @@ // GrB_Vector_eWiseMult: vector element-wise multiplication //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,33 +12,6 @@ #include "ewise/GB_ewise.h" #include "mask/GB_get_mask.h" -#define GB_EWISE(op) \ - /* check inputs */ \ - GB_RETURN_IF_NULL_OR_FAULTY (w) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (u) ; \ - GB_RETURN_IF_NULL_OR_FAULTY (v) ; \ - GB_RETURN_IF_FAULTY (M_in) ; \ - ASSERT (GB_VECTOR_OK (w)) ; \ - ASSERT (GB_VECTOR_OK (u)) ; \ - ASSERT (GB_VECTOR_OK (v)) ; \ - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; \ - /* get the descriptor */ \ - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, \ - xx1, xx2, xx3, xx7) ; \ - /* get the mask */ \ - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ;\ - /* w = accum (w,t) where t = u.*v, u'.*v, u.*v', or u'.*v' */ \ - info = GB_ewise ( \ - (GrB_Matrix) w, C_replace, /* w and its descriptor */ \ - M, Mask_comp, Mask_struct, /* mask and descriptor */ \ - accum, /* accumulate operator */ \ - op, /* operator that defines '.*' */ \ - (GrB_Matrix) u, false, /* u, never transposed */ \ - (GrB_Matrix) v, false, /* v, never transposed */ \ - false, /* eWiseMult */ \ - false, NULL, NULL, /* not eWiseUnion */ \ - Werk) ; - //------------------------------------------------------------------------------ // GrB_Vector_eWiseMult_BinaryOp: vector element-wise multiplication //------------------------------------------------------------------------------ @@ -46,9 +19,9 @@ GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector Mask, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp mult, // defines '.*' for t=u.*v + const GrB_BinaryOp op, // defines '.*' for t=u.*v const GrB_Vector u, // first input: vector u const GrB_Vector v, // second input: vector v const GrB_Descriptor desc // descriptor for w and M @@ -59,17 +32,42 @@ GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_eWiseMult_BinaryOp " - "(w, M, accum, mult, u, v, desc)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, Mask, u, v, + "GrB_Vector_eWiseMult (w, M, accum, op, u, v, desc)") ; GB_BURBLE_START ("GrB_eWiseMult") ; - GB_RETURN_IF_NULL_OR_FAULTY (mult) ; + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_VECTOR_OK (u)) ; + ASSERT (GB_VECTOR_OK (v)) ; + ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- - // apply the eWise kernel (using set intersection) + // w = accum (w,t) where t = u.*v, u'.*v, u.*v', or u'.*v' //-------------------------------------------------------------------------- - GB_EWISE (mult) ; + info = GB_ewise ( + (GrB_Matrix) w, C_replace, // w and its descriptor + M, Mask_comp, Mask_struct, // mask and descriptor + accum, // accumulate operator + op, // operator that defines '.*' + (GrB_Matrix) u, false, // u, never transposed + (GrB_Matrix) v, false, // v, never transposed + false, // eWiseMult + false, NULL, NULL, // not eWiseUnion + Werk) ; GB_BURBLE_END ; + return (info) ; } @@ -80,7 +78,7 @@ GrB_Info GrB_Vector_eWiseMult_BinaryOp // w = accum (w, u.*v) GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector M, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) const GrB_Monoid monoid, // defines '.*' for t=u.*v const GrB_Vector u, // first input: vector u @@ -88,23 +86,9 @@ GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) const GrB_Descriptor desc // descriptor for w and M ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (w, "GrB_Vector_eWiseMult_Monoid " - "(w, M, accum, monoid, u, v, desc)") ; - GB_BURBLE_START ("GrB_eWiseMult") ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - - //-------------------------------------------------------------------------- - // eWise multiply using the monoid operator - //-------------------------------------------------------------------------- - - GB_EWISE (monoid->op) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = monoid->op ; + return (GrB_Vector_eWiseMult_BinaryOp (w, M, accum, op, u, v, desc)) ; } //------------------------------------------------------------------------------ @@ -114,7 +98,7 @@ GrB_Info GrB_Vector_eWiseMult_Monoid // w = accum (w, u.*v) GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector M, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) const GrB_Semiring semiring, // defines '.*' for t=u.*v const GrB_Vector u, // first input: vector u @@ -122,22 +106,8 @@ GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) const GrB_Descriptor desc // descriptor for w and M ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (w, "GrB_Vector_eWiseMult_Semiring " - "(w, M, accum, semiring, u, v, desc)") ; - GB_BURBLE_START ("GrB_eWiseMult") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - - //-------------------------------------------------------------------------- - // eWise multiply using the semiring multiply operator - //-------------------------------------------------------------------------- - - GB_EWISE (semiring->multiply) ; - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = semiring->multiply ; + return (GrB_Vector_eWiseMult_BinaryOp (w, M, accum, op, u, v, desc)) ; } diff --git a/GraphBLAS/Source/emult/template/GB_emult_02_template.c b/GraphBLAS/Source/emult/template/GB_emult_02_template.c index ee5eeb8720..b627b5809f 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_02_template.c +++ b/GraphBLAS/Source/emult/template/GB_emult_02_template.c @@ -2,7 +2,7 @@ // GB_emult_02_template: C = A.*B when A is sparse/hyper and B is bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,12 +16,12 @@ // get A, B, and C //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int64_t vlen = A->vlen ; - const int8_t *restrict Bb = B->b ; + const int8_t *restrict Bb = B->b ; const int64_t *restrict kfirst_Aslice = A_ek_slicing ; const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; @@ -45,8 +45,8 @@ GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif - const int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; #ifdef GB_JIT_KERNEL #define Mask_comp GB_MASK_COMP diff --git a/GraphBLAS/Source/emult/template/GB_emult_02a.c b/GraphBLAS/Source/emult/template/GB_emult_02a.c index dfd828d781..78dc9d2a1e 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_02a.c +++ b/GraphBLAS/Source/emult/template/GB_emult_02a.c @@ -2,7 +2,7 @@ // GB_emult_02a: C = A.*B when A is sparse/hyper and B is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,19 +24,18 @@ int64_t klast = klast_Aslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t pB_start = j * vlen ; GB_GET_PA_AND_PC (pA, pA_end, pC, tid, k, kfirst, klast, pstart_Aslice, Cp_kfirst, - GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen), - GBP_C (Cp, k, vlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1), GB_IGET (Cp, k)) ; for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pB = pB_start + i ; if (!Bb [pB]) continue ; // C (i,j) = A (i,j) .* B (i,j) - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_02b.c b/GraphBLAS/Source/emult/template/GB_emult_02b.c index 04ad1d4b3d..b98c1546d6 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_02b.c +++ b/GraphBLAS/Source/emult/template/GB_emult_02b.c @@ -2,7 +2,7 @@ // GB_emult_02b: C = A.*B when A is sparse/hyper and B is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,14 +24,14 @@ int64_t klast = klast_Aslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t pB_start = j * vlen ; GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; for ( ; pA < pA_end ; pA++) { // C (i,j) = A (i,j) .* B (i,j) - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pB = pB_start + i ; // Ci [pA] = i ; already defined #ifndef GB_ISO_EMULT diff --git a/GraphBLAS/Source/emult/template/GB_emult_02c.c b/GraphBLAS/Source/emult/template/GB_emult_02c.c index d56ebce986..218835fe39 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_02c.c +++ b/GraphBLAS/Source/emult/template/GB_emult_02c.c @@ -2,7 +2,7 @@ // GB_emult_02c: C<#M>=A.*B when A is sparse/hyper; M and B are bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ // Method2(c): C<#M>=A.*B, A is sparse/hyper, M and B are bitmap/full //-------------------------------------------------------------------------- - const int8_t *restrict Mb = M->b ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (Mask_struct) ? NULL : ((GB_M_TYPE *) M->x) ; const size_t msize = M->type->size ; @@ -28,22 +28,21 @@ int64_t klast = klast_Aslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t pB_start = j * vlen ; GB_GET_PA_AND_PC (pA, pA_end, pC, tid, k, kfirst, klast, pstart_Aslice, Cp_kfirst, - GBP_A (Ap, k, vlen), GBP_A (Ap, k+1, vlen), - GBP_C (Cp, k, vlen)) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1), GB_IGET (Cp, k)) ; for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; int64_t pB = pB_start + i ; - if (!GBB_B (Bb, pB)) continue ; - bool mij = GBB_M (Mb, pB) && GB_MCAST (Mx, pB, msize) ; + if (!GBb_B (Bb, pB)) continue ; + bool mij = GBb_M (Mb, pB) && GB_MCAST (Mx, pB, msize) ; mij = mij ^ Mask_comp ; if (!mij) continue ; // C (i,j) = A (i,j) .* B (i,j) - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_03_template.c b/GraphBLAS/Source/emult/template/GB_emult_03_template.c index 3640aa8f9e..939172de5d 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_03_template.c +++ b/GraphBLAS/Source/emult/template/GB_emult_03_template.c @@ -2,7 +2,7 @@ // GB_emult_03_template: C = A.*B when A is bitmap/full and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,12 +16,12 @@ // get A, B, and C //-------------------------------------------------------------------------- - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; const int64_t vlen = B->vlen ; - const int8_t *restrict Ab = A->b ; + const int8_t *restrict Ab = A->b ; const int64_t *restrict kfirst_Bslice = B_ek_slicing ; const int64_t *restrict klast_Bslice = B_ek_slicing + B_ntasks ; @@ -45,8 +45,8 @@ GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif - const int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; #ifdef GB_JIT_KERNEL #define Mask_comp GB_MASK_COMP diff --git a/GraphBLAS/Source/emult/template/GB_emult_03a.c b/GraphBLAS/Source/emult/template/GB_emult_03a.c index 750a0a8d0b..f15312f3e7 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_03a.c +++ b/GraphBLAS/Source/emult/template/GB_emult_03a.c @@ -2,7 +2,7 @@ // GB_emult_03a: C = A.*B when A is bitmap and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,19 +24,18 @@ int64_t klast = klast_Bslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; int64_t pA_start = j * vlen ; GB_GET_PA_AND_PC (pB, pB_end, pC, tid, k, kfirst, klast, pstart_Bslice, Cp_kfirst, - GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen), - GBP_C (Cp, k, vlen)) ; + GB_IGET (Bp, k), GB_IGET (Bp, k+1), GB_IGET (Cp, k)) ; for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t pA = pA_start + i ; if (!Ab [pA]) continue ; // C (i,j) = A (i,j) .* B (i,j) - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_03b.c b/GraphBLAS/Source/emult/template/GB_emult_03b.c index 50e6ef3654..03b4281c8a 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_03b.c +++ b/GraphBLAS/Source/emult/template/GB_emult_03b.c @@ -2,7 +2,7 @@ // GB_emult_03b: C = A.*B when A is full and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,14 +24,14 @@ int64_t klast = klast_Bslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; int64_t pA_start = j * vlen ; GB_GET_PA (pB, pB_end, tid, k, kfirst, klast, pstart_Bslice, - GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen)) ; + GB_IGET (Bp, k), GB_IGET (Bp, k+1)) ; for ( ; pB < pB_end ; pB++) { // C (i,j) = A (i,j) .* B (i,j) - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t pA = pA_start + i ; // Ci [pB] = i ; already defined #ifndef GB_ISO_EMULT diff --git a/GraphBLAS/Source/emult/template/GB_emult_03c.c b/GraphBLAS/Source/emult/template/GB_emult_03c.c index f72a34625d..a050b1afb7 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_03c.c +++ b/GraphBLAS/Source/emult/template/GB_emult_03c.c @@ -2,7 +2,7 @@ // GB_emult_03c: C<#M>=A.*B when M and A are bitmap/full and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ // Method3(c): C<#M>=A.*B; M and A are bitmap/full; B is sparse/hyper //-------------------------------------------------------------------------- - const int8_t *restrict Mb = M->b ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (Mask_struct) ? NULL : ((GB_M_TYPE *) M->x) ; const size_t msize = M->type->size ; @@ -28,22 +28,21 @@ int64_t klast = klast_Bslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_B (Bh, k) ; + int64_t j = GBh_B (Bh, k) ; int64_t pA_start = j * vlen ; GB_GET_PA_AND_PC (pB, pB_end, pC, tid, k, kfirst, klast, pstart_Bslice, Cp_kfirst, - GBP_B (Bp, k, vlen), GBP_B (Bp, k+1, vlen), - GBP_C (Cp, k, vlen)) ; + GB_IGET (Bp, k), GB_IGET (Bp, k+1), GB_IGET (Cp, k)) ; for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; int64_t pA = pA_start + i ; - if (!GBB_A (Ab, pA)) continue ; - bool mij = GBB_M (Mb, pA) && GB_MCAST (Mx, pA, msize) ; + if (!GBb_A (Ab, pA)) continue ; + bool mij = GBb_M (Mb, pA) && GB_MCAST (Mx, pA, msize) ; mij = mij ^ Mask_comp ; if (!mij) continue ; // C (i,j) = A (i,j) .* B (i,j) - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_04_template.c b/GraphBLAS/Source/emult/template/GB_emult_04_template.c index a67407e8b9..9e55a028fd 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_04_template.c +++ b/GraphBLAS/Source/emult/template/GB_emult_04_template.c @@ -2,7 +2,7 @@ // GB_emult_04_template: C= A.*B, M sparse/hyper, A and B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,15 +43,16 @@ ASSERT (!Mask_comp) ; #endif - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) ((Mask_struct) ? NULL : M->x) ; const int64_t vlen = M->vlen ; const size_t msize = M->type->size ; - const int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; const int64_t *restrict kfirst_Mslice = M_ek_slicing ; const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; @@ -69,23 +70,21 @@ int64_t klast = klast_Mslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; int64_t pstart = j * vlen ; GB_GET_PA_AND_PC (pM, pM_end, pC, tid, k, kfirst, klast, pstart_Mslice, Cp_kfirst, - GBP_M (Mp, k, vlen), GBP_M (Mp, k+1, vlen), - GBP_C (Cp, k, vlen)) ; + GB_IGET (Mp, k), GB_IGET (Mp, k+1), GB_IGET (Cp, k)) ; for ( ; pM < pM_end ; pM++) { - int64_t i = Mi [pM] ; - if (GB_MCAST (Mx, pM, msize) && - (GBB_A (Ab, pstart + i) - && // TODO: for GB_add, use || instead - GBB_B (Bb, pstart + i))) + int64_t i = GB_IGET (Mi, pM) ; + if (GB_MCAST (Mx, pM, msize) + && GBb_A (Ab, pstart + i) + && GBb_B (Bb, pstart + i)) { int64_t p = pstart + i ; // C (i,j) = A (i,j) .* B (i,j) - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, p, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_08_meta.c b/GraphBLAS/Source/emult/template/GB_emult_08_meta.c deleted file mode 100644 index 322e9b43d8..0000000000 --- a/GraphBLAS/Source/emult/template/GB_emult_08_meta.c +++ /dev/null @@ -1,143 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_emult_08_meta: phase1 and phase2 for C=A.*B, C=A.*B, C=A.*B -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Computes C=A.*B, C=A.*B, or C=A.*B. - -// C is sparse or hypersparse. M, A, and B can have any sparsity structure. -// If both A and B are full, then GB_add is used instead (this is the only case -// where C can be full). - -// phase1: does not compute C itself, but just counts the # of entries in each -// vector of C. Fine tasks compute the # of entries in their slice of a -// single vector of C, and the results are cumsum'd. - -// phase2: computes C, using the counts computed by phase1. - -{ - - // iB_first is unused if the operator is FIRST or PAIR - #include "include/GB_unused.h" - - //-------------------------------------------------------------------------- - // get A, B, M, and C - //-------------------------------------------------------------------------- - - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; - const int64_t vlen = A->vlen ; - - #ifdef GB_JIT_KENEL - #define A_is_hyper GB_A_IS_HYPER - #define A_is_sparse GB_A_IS_SPARSE - #define A_is_bitmap GB_A_IS_BITMAP - #define A_is_full GB_A_IS_FULL - #else - const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - const bool A_is_sparse = GB_IS_SPARSE (A) ; - const bool A_is_bitmap = GB_IS_BITMAP (A) ; - const bool A_is_full = GB_IS_FULL (A) ; - #endif - - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; - - #ifdef GB_JIT_KENEL - #define B_is_hyper GB_B_IS_HYPER - #define B_is_sparse GB_B_IS_SPARSE - #define B_is_bitmap GB_B_IS_BITMAP - #define B_is_full GB_B_IS_FULL - #else - const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; - const bool B_is_sparse = GB_IS_SPARSE (B) ; - const bool B_is_bitmap = GB_IS_BITMAP (B) ; - const bool B_is_full = GB_IS_FULL (B) ; - #endif - - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; - const int8_t *restrict Mb = NULL ; - const int64_t *restrict Mi = NULL ; - const GB_M_TYPE *restrict Mx = NULL ; - - #ifdef GB_JIT_KENEL - #define M_is_hyper GB_M_IS_HYPER - #define M_is_sparse GB_M_IS_SPARSE - #define M_is_bitmap GB_M_IS_BITMAP - #define M_is_full GB_M_IS_FULL - #define M_is_sparse_or_hyper (GB_M_IS_SPARSE || GB_M_IS_HYPER) - #define Mask_comp GB_MASK_COMP - #define Mask_struct GB_MASK_STRUCT - #define M_is_present (!GB_NO_MASK) - #else - const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; - const bool M_is_sparse = GB_IS_SPARSE (M) ; - const bool M_is_bitmap = GB_IS_BITMAP (M) ; - const bool M_is_full = GB_IS_FULL (M) ; - const bool M_is_sparse_or_hyper = M_is_sparse || M_is_hyper ; - const bool M_is_present = (M != NULL) ; - #endif - - size_t msize = 0 ; - if (M_is_present) - { - Mp = M->p ; - Mh = M->h ; - Mb = M->b ; - Mi = M->i ; - Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; - msize = M->type->size ; - } - - #ifndef GB_EMULT_08_PHASE - #define GB_EMULT_08_PHASE 2 - #endif - - #if ( GB_EMULT_08_PHASE == 2 ) - #ifdef GB_JIT_KERNEL - #define A_iso GB_A_ISO - #define B_iso GB_B_ISO - #else - const bool A_iso = A->iso ; - const bool B_iso = B->iso ; - #endif - #ifdef GB_ISO_EMULT - ASSERT (C->iso) ; - #else - ASSERT (!C->iso) ; - ASSERT (!(A_iso && B_iso)) ; // one of A or B can be iso, but not both - const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; - const GB_B_TYPE *restrict Bx = (GB_B_TYPE *) B->x ; - GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; - #endif - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; - #endif - - //-------------------------------------------------------------------------- - // C=A.*B, C=A.*B, or C=A.*B: C is sparse or hypersparse - //-------------------------------------------------------------------------- - - #if ( GB_EMULT_08_PHASE == 1 ) - { - // phase1: symbolic phase - #include "template/GB_emult_08_template.c" - } - #else - { - // phase2: numerical phase - #include "template/GB_emult_08_template.c" - } - #endif -} - diff --git a/GraphBLAS/Source/emult/template/GB_emult_08_template.c b/GraphBLAS/Source/emult/template/GB_emult_08_template.c index 44027ca605..7ff4381252 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_08_template.c +++ b/GraphBLAS/Source/emult/template/GB_emult_08_template.c @@ -1,13 +1,16 @@ //------------------------------------------------------------------------------ -// GB_emult_08_template: C=A.*B, C=A.*B when C is sparse/hyper +// GB_emult_08_template: phase1 and phase2 for C=A.*B, C=A.*B, C=A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Computes C=A.*B, C=A.*B, or C=A.*B when C is sparse or hypersparse: +// Computes C=A.*B, C=A.*B, or C=A.*B, where C is sparse/hypersparse. + +// M, A, and B can have any sparsity structure. If both A and B are full, then +// GB_add is used instead (this is the only case where C can be full). // phase1: does not compute C itself, but just counts the # of entries in each // vector of C. Fine tasks compute the # of entries in their slice of a @@ -49,6 +52,113 @@ { + // iB_first is unused if the operator is FIRST or PAIR + + //-------------------------------------------------------------------------- + // get A, B, M, and C + //-------------------------------------------------------------------------- + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; + const int64_t vlen = A->vlen ; + + #ifdef GB_JIT_KERNEL + #define A_is_hyper GB_A_IS_HYPER + #define A_is_sparse GB_A_IS_SPARSE + #define A_is_bitmap GB_A_IS_BITMAP + #define A_is_full GB_A_IS_FULL + #else + const bool Ai_is_32 = A->i_is_32 ; + const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; + const bool A_is_sparse = GB_IS_SPARSE (A) ; + const bool A_is_bitmap = GB_IS_BITMAP (A) ; + const bool A_is_full = GB_IS_FULL (A) ; + #define GB_Ai_IS_32 Ai_is_32 + #endif + + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; + + #ifdef GB_JIT_KERNEL + #define B_is_hyper GB_B_IS_HYPER + #define B_is_sparse GB_B_IS_SPARSE + #define B_is_bitmap GB_B_IS_BITMAP + #define B_is_full GB_B_IS_FULL + #else + const bool Bi_is_32 = B->i_is_32 ; + const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; + const bool B_is_sparse = GB_IS_SPARSE (B) ; + const bool B_is_bitmap = GB_IS_BITMAP (B) ; + const bool B_is_full = GB_IS_FULL (B) ; + #define GB_Bi_IS_32 Bi_is_32 + #endif + + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = NULL ; + const GB_M_TYPE *restrict Mx = NULL ; + + #ifdef GB_JIT_KERNEL + #define M_is_hyper GB_M_IS_HYPER + #define M_is_sparse GB_M_IS_SPARSE + #define M_is_bitmap GB_M_IS_BITMAP + #define M_is_full GB_M_IS_FULL + #define M_is_sparse_or_hyper (GB_M_IS_SPARSE || GB_M_IS_HYPER) + #define Mask_comp GB_MASK_COMP + #define Mask_struct GB_MASK_STRUCT + #define M_is_present (!GB_NO_MASK) + #else + const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; + const bool M_is_sparse = GB_IS_SPARSE (M) ; + const bool M_is_bitmap = GB_IS_BITMAP (M) ; + const bool M_is_full = GB_IS_FULL (M) ; + const bool M_is_sparse_or_hyper = M_is_sparse || M_is_hyper ; + const bool M_is_present = (M != NULL) ; + #endif + + size_t msize = 0 ; + if (M_is_present) + { + Mb = M->b ; + Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; + msize = M->type->size ; + } + + #ifndef GB_EMULT_08_PHASE + #define GB_EMULT_08_PHASE 2 + #endif + + #if ( GB_EMULT_08_PHASE == 2 ) + #ifdef GB_JIT_KERNEL + #define A_iso GB_A_ISO + #define B_iso GB_B_ISO + #else + const bool A_iso = A->iso ; + const bool B_iso = B->iso ; + #endif + #ifdef GB_ISO_EMULT + ASSERT (C->iso) ; + #else + ASSERT (!C->iso) ; + ASSERT (!(A_iso && B_iso)) ; // one of A or B can be iso, but not both + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; + const GB_B_TYPE *restrict Bx = (GB_B_TYPE *) B->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + #endif + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + #endif + + //-------------------------------------------------------------------------- + // C=A.*B, C=A.*B, or C=A.*B: C is sparse or hypersparse + //-------------------------------------------------------------------------- + int taskid ; #pragma omp parallel for num_threads(C_nthreads) schedule(dynamic,1) for (taskid = 0 ; taskid < C_ntasks ; taskid++) @@ -85,7 +195,7 @@ // get j, the kth vector of C //------------------------------------------------------------------ - int64_t j = GBH_C (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; #if ( GB_EMULT_08_PHASE == 1 ) int64_t cjnz = 0 ; @@ -96,13 +206,15 @@ // A fine task computes a slice of C(:,j) pC = TaskList [taskid ].pC ; pC_end = TaskList [taskid+1].pC ; - ASSERT (Cp [k] <= pC && pC <= pC_end && pC_end <= Cp [k+1]) ; + ASSERT (GB_IGET (Cp, k) <= pC) ; + ASSERT (pC <= pC_end) ; + ASSERT (pC_end <= GB_IGET (Cp, k+1)) ; } else { // The vectors of C are never sliced for a coarse task. - pC = Cp [k] ; - pC_end = Cp [k+1] ; + pC = GB_IGET (Cp, k) ; + pC_end = GB_IGET (Cp, k+1) ; } int64_t cjnz = pC_end - pC ; if (cjnz == 0) continue ; @@ -123,12 +235,12 @@ else { // A coarse task operates on the entire vector A (:,j) - int64_t kA = (Ch == Ah) ? k : + int64_t kA = ((void *) Ch == (void *) Ah) ? k : ((C_to_A == NULL) ? j : C_to_A [k]) ; if (kA >= 0) { - pA = GBP_A (Ap, kA, vlen) ; - pA_end = GBP_A (Ap, kA+1, vlen) ; + pA = GBp_A (Ap, kA, vlen) ; + pA_end = GBp_A (Ap, kA+1, vlen) ; } } @@ -140,13 +252,13 @@ int64_t iA_first = -1 ; if (ajnz > 0) { - iA_first = GBI_A (Ai, pA, vlen) ; + iA_first = GBi_A (Ai, pA, vlen) ; } #if ( GB_EMULT_08_PHASE == 1 ) || defined ( GB_DEBUG ) int64_t iA_last = -1 ; if (ajnz > 0) { - iA_last = GBI_A (Ai, pA_end-1, vlen) ; + iA_last = GBi_A (Ai, pA_end-1, vlen) ; } #endif @@ -165,12 +277,12 @@ else { // A coarse task operates on the entire vector B (:,j) - int64_t kB = (Ch == Bh) ? k : + int64_t kB = ((void *) Ch == (void *) Bh) ? k : ((C_to_B == NULL) ? j : C_to_B [k]) ; if (kB >= 0) { - pB = GBP_B (Bp, kB, vlen) ; - pB_end = GBP_B (Bp, kB+1, vlen) ; + pB = GBp_B (Bp, kB, vlen) ; + pB_end = GBp_B (Bp, kB+1, vlen) ; } } @@ -182,13 +294,13 @@ int64_t iB_first = -1 ; if (bjnz > 0) { - iB_first = GBI_B (Bi, pB, vlen) ; + iB_first = GBi_B (Bi, pB, vlen) ; } #if ( GB_EMULT_08_PHASE == 1 ) || defined ( GB_DEBUG ) int64_t iB_last = -1 ; if (bjnz > 0) { - iB_last = GBI_B (Bi, pB_end-1, vlen) ; + iB_last = GBi_B (Bi, pB_end-1, vlen) ; } #endif @@ -264,7 +376,7 @@ } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } #endif } diff --git a/GraphBLAS/Source/emult/template/GB_emult_08bcd.c b/GraphBLAS/Source/emult/template/GB_emult_08bcd.c index 266bcd3095..1f1ff1b0b6 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_08bcd.c +++ b/GraphBLAS/Source/emult/template/GB_emult_08bcd.c @@ -2,7 +2,7 @@ // GB_emult_08bcd: C=A.*B; C, A, and B are all sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,11 +32,11 @@ for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; // find i in A(:,j) int64_t pright = pA_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Ai, pA, pright, found) ; + found = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &pright) ; if (found) { // C (i,j) = A (i,j) .* B (i,j) @@ -44,7 +44,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; @@ -70,11 +70,11 @@ for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; // find i in B(:,j) int64_t pright = pB_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Bi, pB, pright, found) ; + found = GB_binary_search (i, Bi, GB_Bi_IS_32, &pB, &pright) ; if (found) { // C (i,j) = A (i,j) .* B (i,j) @@ -82,7 +82,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; @@ -110,8 +110,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t iA = Ai [pA] ; - int64_t iB = Bi [pB] ; + int64_t iA = GB_IGET (Ai, pA) ; + int64_t iB = GB_IGET (Bi, pB) ; if (iA < iB) { // A(i,j) exists but not B(i,j) @@ -130,7 +130,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = iB ; + GB_ISET (Ci, pC, iB) ; // Ci [pC] = iB ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_08e.c b/GraphBLAS/Source/emult/template/GB_emult_08e.c index 53928176de..a1bdde10de 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_08e.c +++ b/GraphBLAS/Source/emult/template/GB_emult_08e.c @@ -2,7 +2,7 @@ // GB_emult_08e: C=A.*B when C and M are sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ else { int64_t kM = -1 ; - if (Ch == Mh) + if ((void *) Ch == (void *) Mh) { // Ch is the same as Mh (a shallow copy), or both NULL kM = k ; @@ -59,8 +59,8 @@ } if (kM >= 0) { - pM = GBP_M (Mp, kM, vlen) ; - pM_end = GBP_M (Mp, kM+1, vlen) ; + pM = GBp_M (Mp, kM, vlen) ; + pM_end = GBp_M (Mp, kM+1, vlen) ; } } @@ -75,7 +75,7 @@ // get M(i,j) for A(i,j) .* B (i,j) //---------------------------------------------------------------------- - int64_t i = GBI_M (Mi, pM, vlen) ; + int64_t i = GBi_M (Mi, pM, vlen) ; bool mij = GB_MCAST (Mx, pM, msize) ; if (!mij) continue ; @@ -88,16 +88,16 @@ { // A(:,j) is dense, bitmap, or full; use quick lookup pA = pA_start + i - iA_first ; - afound = GBB_A (Ab, pA) ; + afound = GBb_A (Ab, pA) ; } else { // A(:,j) is sparse; use binary search for A(i,j) int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (i, Ai, pA, apright, afound) ; + afound = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &apright) ; } if (!afound) continue ; - ASSERT (GBI_A (Ai, pA, vlen) == i) ; + ASSERT (GBi_A (Ai, pA, vlen) == i) ; //---------------------------------------------------------------------- // get B(i,j) @@ -108,16 +108,16 @@ { // B(:,j) is dense; use direct lookup for B(i,j) pB = pB_start + i - iB_first ; - bfound = GBB_B (Bb, pB) ; + bfound = GBb_B (Bb, pB) ; } else { // B(:,j) is sparse; use binary search for B(i,j) int64_t bpright = pB_end - 1 ; - GB_BINARY_SEARCH (i, Bi, pB, bpright, bfound) ; + bfound = GB_binary_search (i, Bi, GB_Bi_IS_32, &pB, &bpright) ; } if (!bfound) continue ; - ASSERT (GBI_B (Bi, pB, vlen) == i) ; + ASSERT (GBi_B (Bi, pB, vlen) == i) ; //---------------------------------------------------------------------- // C(i,j) = A(i,j) .* B(i,j) @@ -127,7 +127,7 @@ #if ( GB_EMULT_08_PHASE == 1 ) cjnz++ ; #else - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_08fgh.c b/GraphBLAS/Source/emult/template/GB_emult_08fgh.c index ae3fc6d511..4798def604 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_08fgh.c +++ b/GraphBLAS/Source/emult/template/GB_emult_08fgh.c @@ -2,7 +2,7 @@ // GB_emult_08fgh: C<#M>=A.*B when C is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,17 +42,17 @@ for ( ; pB < pB_end ; pB++) { - int64_t i = Bi [pB] ; + int64_t i = GB_IGET (Bi, pB) ; // get M(i,j) int64_t pM = pM_start + i ; - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (Mask_comp) mij = !mij ; if (mij) { // find i in A(:,j) int64_t pright = pA_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Ai, pA, pright, found) ; + found = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &pright) ; if (found) { // C (i,j) = A (i,j) .* B (i,j) @@ -60,7 +60,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; @@ -88,10 +88,10 @@ for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; // get M(i,j) int64_t pM = pM_start + i ; - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (Mask_comp) mij = !mij ; if (mij) { @@ -99,7 +99,7 @@ // find i in B(:,j) int64_t pright = pB_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Bi, pB, pright, found) ; + found = GB_binary_search (i, Bi, GB_Bi_IS_32, &pB, &pright) ; if (found) { // C (i,j) = A (i,j) .* B (i,j) @@ -107,7 +107,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; @@ -137,8 +137,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t iA = Ai [pA] ; - int64_t iB = Bi [pB] ; + int64_t iA = GB_IGET (Ai, pA) ; + int64_t iB = GB_IGET (Bi, pB) ; if (iA < iB) { // A(i,j) exists but not B(i,j) @@ -155,7 +155,7 @@ int64_t i = iA ; // get M(i,j) int64_t pM = pM_start + i ; - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; if (Mask_comp) mij = !mij ; if (mij) { @@ -164,7 +164,7 @@ cjnz++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #ifndef GB_ISO_EMULT GB_DECLAREA (aij) ; GB_GETA (aij, Ax, pA, A_iso) ; diff --git a/GraphBLAS/Source/emult/template/GB_emult_bitmap_5.c b/GraphBLAS/Source/emult/template/GB_emult_bitmap_5.c index b9b57a1800..153aae820e 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_bitmap_5.c +++ b/GraphBLAS/Source/emult/template/GB_emult_bitmap_5.c @@ -2,7 +2,7 @@ // GB_emult_bitmap_5: C = A.*B; C is bitmap, M is not present. //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,7 +31,7 @@ GB_PARTITION (pstart, pend, cnz, tid, C_nthreads) ; for (int64_t p = pstart ; p < pend ; p++) { - if (GBB_A (Ab, p) && GBB_B (Bb,p)) + if (GBb_A (Ab, p) && GBb_B (Bb,p)) { // C (i,j) = A (i,j) + B (i,j) #ifndef GB_ISO_EMULT diff --git a/GraphBLAS/Source/emult/template/GB_emult_bitmap_6.c b/GraphBLAS/Source/emult/template/GB_emult_bitmap_6.c index babfff98ac..7bdb15f584 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_bitmap_6.c +++ b/GraphBLAS/Source/emult/template/GB_emult_bitmap_6.c @@ -2,7 +2,7 @@ // GB_emult_bitmap_6: C=A.*B, C bitmap, M sparse, A and B are bitmap/full. //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -58,7 +58,7 @@ if (Cb [p] == 0) { // M(i,j) is zero, so C(i,j) can be computed - if (GBB_A (Ab, p) && GBB_B (Bb, p)) + if (GBb_A (Ab, p) && GBb_B (Bb, p)) { // C (i,j) = A (i,j) + B (i,j) #ifndef GB_ISO_EMULT diff --git a/GraphBLAS/Source/emult/template/GB_emult_bitmap_7.c b/GraphBLAS/Source/emult/template/GB_emult_bitmap_7.c index e7dc434fbf..c7dd9a511b 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_bitmap_7.c +++ b/GraphBLAS/Source/emult/template/GB_emult_bitmap_7.c @@ -2,7 +2,7 @@ // GB_emult_bitmap_7: C<#M>=A.*B; C bitmap; M, A, and B are bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -59,12 +59,12 @@ for (int64_t p = pstart ; p < pend ; p++) { // get M(i,j) - bool mij = GBB_M (Mb, p) && GB_MCAST (Mx, p, msize) ; - if (Mask_comp) mij = !mij ; /* TODO: use ^ */ + bool mij = GBb_M (Mb, p) && GB_MCAST (Mx, p, msize) ; + if (Mask_comp) mij = !mij ; if (mij) { // M(i,j) is true, so C(i,j) can be computed - if (GBB_A (Ab, p) && GBB_B (Bb, p)) + if (GBb_A (Ab, p) && GBb_B (Bb, p)) { // C (i,j) = A (i,j) + B (i,j) #ifndef GB_ISO_EMULT diff --git a/GraphBLAS/Source/emult/template/GB_emult_bitmap_template.c b/GraphBLAS/Source/emult/template/GB_emult_bitmap_template.c index bab484f47b..d3b68f7d0c 100644 --- a/GraphBLAS/Source/emult/template/GB_emult_bitmap_template.c +++ b/GraphBLAS/Source/emult/template/GB_emult_bitmap_template.c @@ -2,7 +2,7 @@ // GB_emult_bitmap_template: C = A.*B, C=A.*B, and C=A.*B, C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/ewise/GB_ewise.c b/GraphBLAS/Source/ewise/GB_ewise.c index 2ef856849b..e7775984fb 100644 --- a/GraphBLAS/Source/ewise/GB_ewise.c +++ b/GraphBLAS/Source/ewise/GB_ewise.c @@ -2,7 +2,7 @@ // GB_ewise: C = accum (C, A+B) or A.*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -83,8 +83,8 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B if (is_eWiseUnion) { // alpha and beta scalars must be present - GB_RETURN_IF_NULL_OR_FAULTY (alpha) ; - GB_RETURN_IF_NULL_OR_FAULTY (beta) ; + ASSERT_SCALAR_OK (alpha, "alpha for GB_ewise", GB0) ; + ASSERT_SCALAR_OK (beta, "beta for GB_ewise", GB0) ; GB_MATRIX_WAIT (alpha) ; GB_MATRIX_WAIT (beta) ; if (GB_nnz ((GrB_Matrix) alpha) == 0) @@ -235,7 +235,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B { // MT = (bool) M' GBURBLE ("(M transpose) ") ; - GB_CLEAR_STATIC_HEADER (MT, &MT_header) ; + GB_CLEAR_MATRIX_HEADER (MT, &MT_header) ; GB_OK (GB_transpose_cast (MT, GrB_BOOL, T_is_csc, M, Mask_struct, Werk)) ; M1 = MT ; @@ -258,7 +258,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B { // AT = (xtype) A' or AT = (xtype) one (A') GBURBLE ("(A transpose) ") ; - GB_CLEAR_STATIC_HEADER (AT, &AT_header) ; + GB_CLEAR_MATRIX_HEADER (AT, &AT_header) ; GB_OK (GB_transpose_cast (AT, op->xtype, T_is_csc, A, A_is_pattern, Werk)) ; A1 = AT ; @@ -270,7 +270,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B { // BT = (ytype) B' or BT = (ytype) one (B') GBURBLE ("(B transpose) ") ; - GB_CLEAR_STATIC_HEADER (BT, &BT_header) ; + GB_CLEAR_MATRIX_HEADER (BT, &BT_header) ; GB_OK (GB_transpose_cast (BT, op->ytype, T_is_csc, B, B_is_pattern, Werk)) ; B1 = BT ; @@ -366,7 +366,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B //-------------------------------------------------------------------------- bool mask_applied = false ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; if (eWiseAdd) { @@ -403,7 +403,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B // shallow copy of A1->h, B1->h, or M1->h. T is hypersparse if any // matrix A1, B1, or M1 are hypersparse. Internally, T->h always // starts as a shallow copy of A1->h, B1->h, or M1->h, but it may be - // pruned by GB_hypermatrix_prune, and thus no longer shallow. + // pruned by GB_hyper_prune, and thus no longer shallow. GB_OK (GB_emult (T, T_type, T_is_csc, M1, Mask_struct, Mask_comp, &mask_applied, A1, B1, op, flipij, Werk)) ; diff --git a/GraphBLAS/Source/ewise/GB_ewise.h b/GraphBLAS/Source/ewise/GB_ewise.h index 4c80be9adf..87113e8d88 100644 --- a/GraphBLAS/Source/ewise/GB_ewise.h +++ b/GraphBLAS/Source/ewise/GB_ewise.h @@ -2,7 +2,7 @@ // GB_ewise.h: definitions for GB_ewise //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/ewise/GB_ewise_fulla.c b/GraphBLAS/Source/ewise/GB_ewise_fulla.c index f6190beebe..6e05e4bc85 100644 --- a/GraphBLAS/Source/ewise/GB_ewise_fulla.c +++ b/GraphBLAS/Source/ewise/GB_ewise_fulla.c @@ -2,7 +2,7 @@ // GB_ewise_fulla: C += A+B where all 3 matries are full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/ewise/GB_ewise_fulln.c b/GraphBLAS/Source/ewise/GB_ewise_fulln.c index 7203583f9a..c9710fd7f2 100644 --- a/GraphBLAS/Source/ewise/GB_ewise_fulln.c +++ b/GraphBLAS/Source/ewise/GB_ewise_fulln.c @@ -2,7 +2,7 @@ // GB_ewise_fulln: C = A+B where A and B are full, C is anything //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -83,10 +83,10 @@ GrB_Info GB_ewise_fulln // C = A+B // free the content of C and reallocate it as a non-iso full matrix ASSERT (C != A && C != B) ; GB_phybix_free (C) ; - // set C->iso = false OK GB_OK (GB_new_bix (&C, // existing header - C->type, C->vlen, C->vdim, GB_Ap_null, C->is_csc, GxB_FULL, false, - C->hyper_switch, -1, GB_nnz_full (C), true, false)) ; + C->type, C->vlen, C->vdim, GB_ph_null, C->is_csc, GxB_FULL, false, + C->hyper_switch, -1, GB_nnz_full (C), true, false, + /* OK: */ false, false, false)) ; C->magic = GB_MAGIC ; } else if (!GB_IS_FULL (C)) diff --git a/GraphBLAS/Source/ewise/include/GB_ewise_shared_definitions.h b/GraphBLAS/Source/ewise/include/GB_ewise_shared_definitions.h index 8b0e542512..fa036b608d 100644 --- a/GraphBLAS/Source/ewise/include/GB_ewise_shared_definitions.h +++ b/GraphBLAS/Source/ewise/include/GB_ewise_shared_definitions.h @@ -2,7 +2,7 @@ // GB_ewise_shared_definitions.h: common macros for ewise kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/ewise/template/GB_ewise_fulla_template.c b/GraphBLAS/Source/ewise/template/GB_ewise_fulla_template.c index c3b3cd2640..f58446bd55 100644 --- a/GraphBLAS/Source/ewise/template/GB_ewise_fulla_template.c +++ b/GraphBLAS/Source/ewise/template/GB_ewise_fulla_template.c @@ -2,7 +2,7 @@ // GB_ewise_fulla_template: C += A+B where all 3 matrices are dense //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/ewise/template/GB_ewise_fulln_template.c b/GraphBLAS/Source/ewise/template/GB_ewise_fulln_template.c index 0e73d5b45b..81472bc346 100644 --- a/GraphBLAS/Source/ewise/template/GB_ewise_fulln_template.c +++ b/GraphBLAS/Source/ewise/template/GB_ewise_fulln_template.c @@ -2,15 +2,13 @@ // GB_ewise_fulln_template: C = A+B where all 3 matrices are full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // This template is not used for any generic kernels. -#include "include/GB_unused.h" - { //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/extract/GB_I_inverse.c b/GraphBLAS/Source/extract/GB_I_inverse.c index d761ebecef..6a54f62732 100644 --- a/GraphBLAS/Source/extract/GB_I_inverse.c +++ b/GraphBLAS/Source/extract/GB_I_inverse.c @@ -2,13 +2,13 @@ // GB_I_inverse: invert an index list //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // I is a large list relative to the vector length, avlen, and it is not -// contiguous. Scatter I into the I inverse buckets (Mark and Inext) for quick +// contiguous. Scatter I into the I inverse buckets (Ihead and Inext) for quick // lookup. // FUTURE:: this code is sequential. Constructing the I inverse buckets in @@ -21,14 +21,16 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) ( - const GrB_Index *I, // list of indices, duplicates OK + const void *I, // list of indices, duplicates OK + const bool I_is_32, // if true, I is 32-bit; else 64 bit int64_t nI, // length of I int64_t avlen, // length of the vectors of A // outputs: - int64_t *restrict *p_Mark, // head pointers for buckets, size avlen - size_t *p_Mark_size, - int64_t *restrict *p_Inext, // next pointers for buckets, size nI + void **p_Ihead, // head pointers for buckets, size avlen + size_t *p_Ihead_size, + void **p_Inext, // next pointers for buckets, size nI size_t *p_Inext_size, + bool *p_Ihead_is_32, // if true, Ihead and Inext are 32-bit; else 64 int64_t *p_nduplicates, // number of duplicate entries in I GB_Werk Werk ) @@ -38,77 +40,92 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) // get inputs //-------------------------------------------------------------------------- - int64_t *Mark = NULL ; size_t Mark_size = 0 ; - int64_t *Inext = NULL ; size_t Inext_size = 0 ; + GB_MDECL (Ihead, , u) ; size_t Ihead_size = 0 ; + GB_MDECL (Inext, , u) ; size_t Inext_size = 0 ; int64_t nduplicates = 0 ; - (*p_Mark ) = NULL ; (*p_Mark_size ) = 0 ; + (*p_Ihead) = NULL ; (*p_Ihead_size) = 0 ; (*p_Inext) = NULL ; (*p_Inext_size) = 0 ; (*p_nduplicates) = 0 ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + //-------------------------------------------------------------------------- // allocate workspace //-------------------------------------------------------------------------- - Mark = GB_CALLOC_WORK (avlen, int64_t, &Mark_size) ; - Inext = GB_MALLOC_WORK (nI, int64_t, &Inext_size) ; - if (Inext == NULL || Mark == NULL) + // Entries in Ihead and Inext range in value from 0 to nI. Entries equal + // to nI or larger are invalid indices, need to tag the end of each bucket. + // Thus + + bool Ihead_is_32 = (nI < UINT32_MAX) ; + size_t isize = (Ihead_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Ihead = GB_MALLOC_MEMORY (avlen, isize, &Ihead_size) ; + Inext = GB_MALLOC_MEMORY (nI, isize, &Inext_size) ; + if (Inext == NULL || Ihead == NULL) { // out of memory - GB_FREE_WORK (&Mark, Mark_size) ; - GB_FREE_WORK (&Inext, Inext_size) ; + GB_FREE_MEMORY (&Ihead, Ihead_size) ; + GB_FREE_MEMORY (&Inext, Inext_size) ; return (GrB_OUT_OF_MEMORY) ; } + // set all entries of Ihead to UINT*_MAX (32-bit or 64-bit) + int nthreads_max = GB_Context_nthreads_max ( ) ; + GB_memset (Ihead, 0xFF, Ihead_size, nthreads_max) ; + + GB_IPTR (Ihead, Ihead_is_32) ; + GB_IPTR (Inext, Ihead_is_32) ; + //-------------------------------------------------------------------------- // scatter the I indices into buckets //-------------------------------------------------------------------------- - // at this point, Mark is all zero, so Mark [i] < 1 for all i in - // the range 0 to avlen-1. + // At this point, Ihead [0..avlen-1] >= nI = UINT64_MAX. // O(nI) time; not parallel for (int64_t inew = nI-1 ; inew >= 0 ; inew--) { - int64_t i = I [inew] ; + int64_t i = GB_IGET (I, inew) ; ASSERT (i >= 0 && i < avlen) ; - int64_t ihead = (Mark [i] - 1) ; - if (ihead < 0) - { - // first time i has been seen in the list I - ihead = -1 ; - } - else + int64_t ihead = GB_IGET (Ihead, i) ; + if (ihead < nI) { // i has already been seen in the list I nduplicates++ ; } - Mark [i] = inew + 1 ; // (Mark [i] - 1) = inew - Inext [inew] = ihead ; + GB_ISET (Ihead, i, inew) ; // Ihead [i] = inew ; + GB_ISET (Inext, inew, ihead) ; // Inext [inew] = ihead ; } // indices in I are now in buckets. An index i might appear more than once - // in the list I. inew = (Mark [i] - 1) is the first position of i in I (i - // will be I [inew]), (Mark [i] - 1) is the head of a link list of all - // places where i appears in I. inew = Inext [inew] traverses this list, - // until inew is -1. + // in the list I. inew = Ihead [i] is the first position of i in I (i will + // be I [inew]), Ihead [i] is the head of a link list of all places where i + // appears in I. inew = Inext [inew] traverses this list, until inew is >= + // nI, which denotes the end of the bucket. // to traverse all entries in bucket i, do: - // GB_for_each_index_in_bucket (inew,i)) { ... } + // GB_for_each_index_in_bucket (inew,i,nI,Ihead,Inext) { ... } - #define GB_for_each_index_in_bucket(inew,i) \ - for (int64_t inew = Mark [i] - 1 ; inew >= 0 ; inew = Inext [inew]) + #define GB_for_each_index_in_bucket(inew,i,nI,Ihead,Inext) \ + for (uint64_t inew = GB_IGET (Ihead, i) ; \ + inew < nI ; \ + inew = GB_IGET (Inext, inew)) - // If Mark [i] < 1, then the ith bucket is empty and i is not in I. - // Otherise, the first index in bucket i is (Mark [i] - 1). + // If Ihead [i] > nI, then the ith bucket is empty and i is not in I. + // Otherise, the first index in bucket i is Ihead [i]. #ifdef GB_DEBUG for (int64_t i = 0 ; i < avlen ; i++) { - GB_for_each_index_in_bucket (inew, i) + GB_for_each_index_in_bucket (inew, i, nI, Ihead, Inext) { + // inew is the new index in C, and i is the index in A. + // All entries in the ith bucket refer to the same row A(i,:), + // but with different indices C (inew,:) in C. ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == I [inew]) ; + ASSERT (i == GB_IGET (I, inew)) ; } } #endif @@ -117,8 +134,9 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) // return result //-------------------------------------------------------------------------- - (*p_Mark ) = Mark ; (*p_Mark_size ) = Mark_size ; + (*p_Ihead) = Ihead ; (*p_Ihead_size) = Ihead_size ; (*p_Inext) = Inext ; (*p_Inext_size) = Inext_size ; + (*p_Ihead_is_32) = Ihead_is_32 ; (*p_nduplicates) = nduplicates ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/extract/GB_bitmap_subref.c b/GraphBLAS/Source/extract/GB_bitmap_subref.c index b813b49ed2..daca97ae29 100644 --- a/GraphBLAS/Source/extract/GB_bitmap_subref.c +++ b/GraphBLAS/Source/extract/GB_bitmap_subref.c @@ -2,7 +2,7 @@ // GB_bitmap_subref: C = A(I,J) where A is bitmap or full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,10 +11,11 @@ #include "extract/GB_subref.h" #include "jitifyer/GB_stringify.h" +#include "include/GB_unused.h" #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; \ + GB_FREE_MEMORY (&TaskList_IxJ, TaskList_IxJ_size) ; \ } #define GB_FREE_ALL \ @@ -25,16 +26,19 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric ( - // output + // output: GrB_Matrix C, // output matrix, static header - // input, not modified + // inputs, not modified: + const GrB_Type ctype, // type of C to create const bool C_iso, // if true, C is iso const GB_void *cscalar, // scalar value of C, if iso const bool C_is_csc, // requested format of C const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, J is 32-bit; else 64-bit const int64_t nj, // length of J, or special const bool symbolic, // if true, construct C as symbolic GB_Werk Werk @@ -46,7 +50,7 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for C=A(I,J) bitmap subref", GB0) ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; ASSERT (!GB_IS_SPARSE (A)) ; @@ -56,7 +60,7 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric ASSERT (!GB_PENDING (A)) ; //-------------------------------------------------------------------------- - // workspace for GB_bitmap_assign_IxJ_template.c + // workspace for assign/template/GB_bitmap_assign_IxJ_template.c //-------------------------------------------------------------------------- GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; @@ -77,13 +81,13 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // C = A(I,J) so I is in range 0:avlen-1 and J is in range 0:avdim-1 int64_t nI, nJ, Icolon [3], Jcolon [3] ; int Ikind, Jkind ; - GB_ijlength (I, ni, avlen, &nI, &Ikind, Icolon) ; - GB_ijlength (J, nj, avdim, &nJ, &Jkind, Jcolon) ; + GB_ijlength (I, I_is_32, ni, avlen, &nI, &Ikind, Icolon) ; + GB_ijlength (J, J_is_32, nj, avdim, &nJ, &Jkind, Jcolon) ; bool I_unsorted, I_has_dupl, I_contig, J_unsorted, J_has_dupl, J_contig ; int64_t imin, imax, jmin, jmax ; - info = GB_ijproperties (I, ni, nI, avlen, &Ikind, Icolon, + info = GB_ijproperties (I, I_is_32, ni, nI, avlen, &Ikind, Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Werk) ; if (info != GrB_SUCCESS) { @@ -91,7 +95,7 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric return (info) ; } - info = GB_ijproperties (J, nj, nJ, avdim, &Jkind, Jcolon, + info = GB_ijproperties (J, J_is_32, nj, nJ, avdim, &Jkind, Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Werk) ; if (info != GrB_SUCCESS) { @@ -99,6 +103,9 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric return (info) ; } + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + #define GB_I_KIND Ikind #define GB_J_KIND Jkind #define GB_C_IS_BITMAP (sparsity == GxB_BITMAP) @@ -109,14 +116,13 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric //-------------------------------------------------------------------------- int64_t cnzmax ; - bool ok = GB_int64_multiply ((GrB_Index *) (&cnzmax), nI, nJ) ; + bool ok = GB_int64_multiply ((uint64_t *) (&cnzmax), nI, nJ) ; if (!ok) cnzmax = INT64_MAX ; - GrB_Type ctype = symbolic ? GrB_INT64 : A->type ; int sparsity = GB_IS_BITMAP (A) ? GxB_BITMAP : GxB_FULL ; - // set C->iso = C_iso OK GB_OK (GB_new_bix (&C, // bitmap or full, existing header - ctype, nI, nJ, GB_Ap_null, C_is_csc, - sparsity, true, A->hyper_switch, -1, cnzmax, true, C_iso)) ; + ctype, nI, nJ, GB_ph_null, C_is_csc, + sparsity, true, A->hyper_switch, -1, cnzmax, true, C_iso, + /* OK: */ false, false, false)) ; //-------------------------------------------------------------------------- // get C @@ -124,11 +130,11 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric int8_t *restrict Cb = C->b ; - // In GB_bitmap_assign_IxJ_template, vlen is the vector length of the - // submatrix C(I,J), but here the template is used to access A(I,J), and so - // the vector length is A->vlen, not C->vlen. The pointers pA and pC are - // swapped in GB_IXJ_WORK macro below, since C=A(I,J) is being computed, - // instead of C(I,J)=A for the bitmap assignment. + // In assign/template/GB_bitmap_assign_IxJ_template, vlen is the vector + // length of the submatrix C(I,J), but here the template is used to access + // A(I,J), and so the vector length is A->vlen, not C->vlen. The pointers + // pA and pC are swapped in GB_IXJ_WORK macro below, since C=A(I,J) is + // being computed, instead of C(I,J)=A for the bitmap assignment. int64_t vlen = avlen ; @@ -146,40 +152,34 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // symbolic subref is only used by GB_subassign_symbolic, which only // operates on a matrix that is hypersparse, sparse, or full, but not // bitmap. As a result, the symbolic subref C=A(I,J) where both A and - // C are bitmap is not needed. The code is left here in case it is - // needed in the future. + // C are bitmap is not needed. ASSERT (GB_C_IS_FULL) ; + ASSERT (ctype == GrB_UINT32 || ctype == GrB_UINT64) ; + // cnvals must be declared for the omp #pragma, but it is not used int64_t cnvals = 0 ; - #if 0 - if (GB_C_IS_BITMAP) - { - // C=A(I,J) symbolic with A and C bitmap - ASSERT (GB_DEAD_CODE) ; - int64_t *restrict Cx = (int64_t *) C->x ; - #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pA,pC) \ - { \ - int8_t ab = Ab [pA] ; \ - Cb [pC] = ab ; \ - Cx [pC] = pA ; \ - task_cnvals += ab ; \ - } - #include "template/GB_bitmap_assign_IxJ_template.c" + + #undef GB_IXJ_WORK + #define GB_IXJ_WORK(pA,pC) \ + { \ + Cx [pC] = pA ; \ + } + + if (ctype == GrB_UINT32) + { + // C=A(I,J) symbolic (32-bit) with A and C full + uint32_t *restrict Cx = (uint32_t *) C->x ; + #define GB_NO_CNVALS + #include "assign/template/GB_bitmap_assign_IxJ_template.c" + #undef GB_NO_CNVALS } else - #endif { - // C=A(I,J) symbolic with A and C full - int64_t *restrict Cx = (int64_t *) C->x ; - #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pA,pC) \ - { \ - Cx [pC] = pA ; \ - } + // C=A(I,J) symbolic (64-bit) with A and C full + uint64_t *restrict Cx = (uint64_t *) C->x ; #define GB_NO_CNVALS - #include "template/GB_bitmap_assign_IxJ_template.c" + #include "assign/template/GB_bitmap_assign_IxJ_template.c" #undef GB_NO_CNVALS } @@ -191,7 +191,6 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // C=A(I,J) iso numeric with A and C bitmap/full //---------------------------------------------------------------------- - if (GB_C_IS_BITMAP) { // iso case where C and A are bitmap @@ -204,7 +203,7 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric Cb [pC] = ab ; \ task_cnvals += ab ; \ } - #include "template/GB_bitmap_assign_IxJ_template.c" + #include "assign/template/GB_bitmap_assign_IxJ_template.c" C->nvals = cnvals ; } else @@ -221,9 +220,12 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // C=A(I,J) non-iso numeric with A and C bitmap/full //---------------------------------------------------------------------- + ASSERT (ctype == A->type) ; + // via the JIT kernel info = GB_subref_bitmap_jit (C, A, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, Werk) ; + I, I_is_32, nI, Ikind, Icolon, + J, J_is_32, nJ, Jkind, Jcolon, Werk) ; // via the generic kernel if (info == GrB_NO_VALUE) @@ -240,12 +242,7 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric } } - if (info != GrB_SUCCESS) - { - // out of memory or JIT kernel failed - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //-------------------------------------------------------------------------- // return result diff --git a/GraphBLAS/Source/extract/GB_extract.c b/GraphBLAS/Source/extract/GB_extract.c index e4ad520295..bcd024cc47 100644 --- a/GraphBLAS/Source/extract/GB_extract.c +++ b/GraphBLAS/Source/extract/GB_extract.c @@ -2,7 +2,7 @@ // GB_extract: C = accum(C,A(I,J)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,10 +33,12 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Matrix A, // input matrix const bool A_transpose, // A matrix descriptor - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices GB_Werk Werk ) { @@ -73,14 +75,18 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) if (!A_transpose) { // T = A(Rows,Cols) - GB_ijlength (Rows, nRows_in, GB_NROWS (A), &nRows, &rkind, RowColon) ; - GB_ijlength (Cols, nCols_in, GB_NCOLS (A), &nCols, &ckind, ColColon) ; + GB_ijlength (Rows, Rows_is_32, nRows_in, GB_NROWS (A), &nRows, &rkind, + RowColon) ; + GB_ijlength (Cols, Cols_is_32, nCols_in, GB_NCOLS (A), &nCols, &ckind, + ColColon) ; } else { // T = A(Cols,Rows) - GB_ijlength (Rows, nRows_in, GB_NCOLS (A), &nRows, &rkind, RowColon) ; - GB_ijlength (Cols, nCols_in, GB_NROWS (A), &nCols, &ckind, ColColon) ; + GB_ijlength (Rows, Rows_is_32, nRows_in, GB_NCOLS (A), &nRows, &rkind, + RowColon) ; + GB_ijlength (Cols, Cols_is_32, nCols_in, GB_NROWS (A), &nCols, &ckind, + ColColon) ; } if (cnrows != nRows || cncols != nCols) @@ -107,9 +113,10 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) // handle the CSR/CSC format and transpose; T = A (I,J) or T = A (J,I) //-------------------------------------------------------------------------- - const GrB_Index *I, *J ; + const void *I, *J ; int64_t ni, nj ; bool T_is_csc ; + bool I_is_32, J_is_32 ; if (A->is_csc) { @@ -119,6 +126,8 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) I = Rows ; ni = nRows_in ; // indices into the vectors J = Cols ; nj = nCols_in ; // vectors T_is_csc = true ; // return T in CSC format + I_is_32 = Rows_is_32 ; + J_is_32 = Cols_is_32 ; } else { @@ -126,6 +135,8 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) I = Cols ; ni = nCols_in ; // indices into the vectors J = Rows ; nj = nRows_in ; // vectors T_is_csc = false ; // return T in CSR format + I_is_32 = Cols_is_32 ; + J_is_32 = Rows_is_32 ; } } else @@ -136,6 +147,8 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) I = Cols ; ni = nCols_in ; // indices into the vectors J = Rows ; nj = nRows_in ; // vectors T_is_csc = false ; // return T in CSR format + I_is_32 = Cols_is_32 ; + J_is_32 = Rows_is_32 ; } else { @@ -143,6 +156,8 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) I = Rows ; ni = nRows_in ; // indices into the vectors J = Cols ; nj = nCols_in ; // vectors T_is_csc = true ; // return T in CSC format + I_is_32 = Rows_is_32 ; + J_is_32 = Cols_is_32 ; } } @@ -162,8 +177,9 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) // TODO::: iso: if accum is PAIR, extract T as iso - GB_CLEAR_STATIC_HEADER (T, &T_header) ; - GB_OK (GB_subref (T, false, T_is_csc, A, I, ni, J, nj, false, Werk)) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; + GB_OK (GB_subref (T, false, T_is_csc, A, + I, I_is_32, ni, J, J_is_32, nj, false, Werk)) ; ASSERT_MATRIX_OK (T, "T extracted", GB0) ; ASSERT (GB_JUMBLED_OK (T)) ; diff --git a/GraphBLAS/Source/extract/GB_extract.h b/GraphBLAS/Source/extract/GB_extract.h index 777a260349..054e758dc9 100644 --- a/GraphBLAS/Source/extract/GB_extract.h +++ b/GraphBLAS/Source/extract/GB_extract.h @@ -2,7 +2,7 @@ // GB_extract.h: definitions for GB_extract //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,10 +21,12 @@ GrB_Info GB_extract // C = accum (C, A(I,J)) const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Matrix A, // input matrix const bool A_transpose, // A matrix descriptor - const GrB_Index *Rows, // row indices - const GrB_Index nRows_in, // number of row indices - const GrB_Index *Cols, // column indices - const GrB_Index nCols_in, // number of column indices + const void *Rows, // row indices + const bool Rows_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nRows_in, // number of row indices + const void *Cols, // column indices + const bool Cols_is_32, // if true, Rows is 32-bit; else 64-bit + const uint64_t nCols_in, // number of column indices GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/extract/GB_subref.c b/GraphBLAS/Source/extract/GB_subref.c index 6e6019760f..cb7e4f4e89 100644 --- a/GraphBLAS/Source/extract/GB_subref.c +++ b/GraphBLAS/Source/extract/GB_subref.c @@ -2,7 +2,7 @@ // GB_subref: C = A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -72,17 +72,19 @@ #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ - GB_FREE_WORK (&Ap_start, Ap_start_size) ; \ - GB_FREE_WORK (&Ap_end, Ap_end_size) ; \ - GB_FREE_WORK (&Mark, Mark_size) ; \ - GB_FREE_WORK (&Inext, Inext_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&Ap_start, Ap_start_size) ; \ + GB_FREE_MEMORY (&Ap_end, Ap_end_size) ; \ + GB_FREE_MEMORY (&Ihead, Ihead_size) ; \ + GB_FREE_MEMORY (&Inext, Inext_size) ; \ + GB_FREE_MEMORY (&Cwork, Cwork_size) ; \ } #define GB_FREE_ALL \ { \ - GB_FREE (&Cp, Cp_size) ; \ - GB_FREE (&Ch, Ch_size) ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ + GB_FREE_MEMORY (&Ch, Ch_size) ; \ + GB_phybix_free (C) ; \ GB_FREE_WORKSPACE ; \ } @@ -96,9 +98,11 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric bool C_iso, // if true, return C as iso, regardless of A const bool C_is_csc, // requested format of C const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, I is 32-bit; else 64-bit const int64_t nj, // length of J, or special const bool symbolic, // if true, construct C as symbolic GB_Werk Werk @@ -110,17 +114,33 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for C=A(I,J) subref", GB0) ; ASSERT (GB_ZOMBIES_OK (A)) ; ASSERT (GB_JUMBLED_OK (A)) ; // A is sorted, below, if jumbled on input ASSERT (GB_PENDING_OK (A)) ; + //-------------------------------------------------------------------------- + // determine the type of C + //-------------------------------------------------------------------------- + + GrB_Type ctype ; + if (symbolic) + { + // select the integer type for symbolic subref, based on nnz (A) + int64_t anz = GB_nnz_held (A) ; + ctype = (anz <= UINT32_MAX) ? GrB_UINT32 : GrB_UINT64 ; + } + else + { + // for all other cases, C is given the same type as A. + ctype = A->type ; + } + //-------------------------------------------------------------------------- // check if C is iso and get its iso value //-------------------------------------------------------------------------- - GrB_Type ctype = (symbolic) ? GrB_INT64 : A->type ; size_t csize = ctype->size ; GB_void cscalar [GB_VLA(csize)] ; memset (cscalar, 0, csize) ; @@ -128,6 +148,7 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric { // symbolic extraction never results in an iso matrix C_iso = false ; + ASSERT (GB_ZOMBIES_OK (A)) ; } else { @@ -137,6 +158,7 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric memcpy (cscalar, A->x, csize) ; C_iso = true ; } + ASSERT (!GB_ZOMBIES (A)) ; } if (C_iso) @@ -151,24 +173,24 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric if (GB_IS_BITMAP (A) || GB_IS_FULL (A)) { // C is constructed with same sparsity as A (bitmap or full) - return (GB_bitmap_subref (C, C_iso, cscalar, C_is_csc, A, I, ni, J, nj, - symbolic, Werk)) ; + return (GB_bitmap_subref (C, ctype, C_iso, cscalar, C_is_csc, A, + I, I_is_32, ni, J, J_is_32, nj, symbolic, Werk)) ; } //-------------------------------------------------------------------------- - // initializations + // C = A(I,J) where C and A are both sparse or hypersparse //-------------------------------------------------------------------------- - int64_t *Cp = NULL ; size_t Cp_size = 0 ; - int64_t *Ch = NULL ; size_t Ch_size = 0 ; - int64_t *Ap_start = NULL ; size_t Ap_start_size = 0 ; - int64_t *Ap_end = NULL ; size_t Ap_end_size = 0 ; - int64_t *Mark = NULL ; size_t Mark_size = 0 ; - int64_t *Inext = NULL ; size_t Inext_size = 0 ; - GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; - + void *Cp = NULL ; size_t Cp_size = 0 ; + void *Ch = NULL ; size_t Ch_size = 0 ; + void *Ap_start = NULL ; size_t Ap_start_size = 0 ; + void *Ap_end = NULL ; size_t Ap_end_size = 0 ; + void *Ihead = NULL ; size_t Ihead_size = 0 ; + void *Inext = NULL ; size_t Inext_size = 0 ; + uint64_t *Cwork = NULL ; size_t Cwork_size = 0 ; + GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; int64_t Cnvec = 0, nI = 0, nJ, Icolon [3], Cnvec_nonempty, ndupl ; - bool post_sort, need_qsort ; + bool post_sort, need_qsort, Cp_is_32, Cj_is_32, Ci_is_32, Ihead_is_32 ; int Ikind, ntasks, nthreads ; //-------------------------------------------------------------------------- @@ -179,6 +201,7 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric // Pending tuples are OK (and ignored) for symbolic extraction. // GB_subref_phase0 may build the hyper_hash. GB_UNJUMBLE (A) ; + ASSERT (!GB_JUMBLED (A)) ; //-------------------------------------------------------------------------- // phase0: find vectors for C=A(I,J), and I,J properties @@ -186,25 +209,27 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric GB_OK (GB_subref_phase0 ( // computed by phase0: - &Ch, &Ch_size, &Ap_start, &Ap_start_size, &Ap_end, &Ap_end_size, - &Cnvec, &need_qsort, &Ikind, &nI, Icolon, &nJ, + &Ch, &Cj_is_32, &Ci_is_32, &Ch_size, &Ap_start, &Ap_start_size, + &Ap_end, &Ap_end_size, &Cnvec, &need_qsort, &Ikind, &nI, Icolon, &nJ, // original input: - A, I, ni, J, nj, Werk)) ; + A, I, I_is_32, ni, J, J_is_32, nj, Werk)) ; //-------------------------------------------------------------------------- // phase1: split C=A(I,J) into tasks for phase2 and phase3 //-------------------------------------------------------------------------- + // Cwork is allocated; it either becomes Cp, or it is freed by phase2 // This phase also inverts I if needed. GB_OK (GB_subref_slice ( // computed by phase1: &TaskList, &TaskList_size, &ntasks, &nthreads, &post_sort, - &Mark, &Mark_size, &Inext, &Inext_size, &ndupl, + &Ihead, &Ihead_size, &Inext, &Inext_size, &Ihead_is_32, + &ndupl, &Cwork, &Cwork_size, // computed by phase0: Ap_start, Ap_end, Cnvec, need_qsort, Ikind, nI, Icolon, // original input: - A->vlen, GB_nnz (A), I, Werk)) ; + A->vlen, GB_nnz (A), A->p_is_32, I, I_is_32, Werk)) ; //-------------------------------------------------------------------------- // phase2: count the number of entries in each vector of C @@ -212,13 +237,14 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric GB_OK (GB_subref_phase2 ( // computed by phase2: - &Cp, &Cp_size, &Cnvec_nonempty, + &Cp, &Cp_is_32, &Cp_size, &Cnvec_nonempty, // computed by phase1: - TaskList, ntasks, nthreads, Mark, Inext, ndupl, + TaskList, ntasks, nthreads, Ihead, Inext, Ihead_is_32, + ndupl > 0, &Cwork, Cwork_size, // computed by phase0: - Ap_start, Ap_end, Cnvec, need_qsort, Ikind, nI, Icolon, + Ap_start, Ap_end, Cnvec, need_qsort, Ikind, nI, Icolon, nJ, // original input: - A, I, symbolic, Werk)) ; + A, I, I_is_32, symbolic, Werk)) ; //-------------------------------------------------------------------------- // phase3: compute the entries (indices and values) in each vector of C @@ -228,16 +254,20 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric // computed by phase3: C, // from phase2: - &Cp, Cp_size, Cnvec_nonempty, + &Cp, Cp_is_32, Cp_size, Cnvec_nonempty, // from phase1: - TaskList, ntasks, nthreads, post_sort, Mark, Inext, ndupl, + TaskList, ntasks, nthreads, post_sort, Ihead, Inext, Ihead_is_32, ndupl, // from phase0: - &Ch, Ch_size, Ap_start, Ap_end, Cnvec, need_qsort, + &Ch, Cj_is_32, Ci_is_32, Ch_size, Ap_start, Ap_end, Cnvec, need_qsort, Ikind, nI, Icolon, nJ, - // from the iso test above: - C_iso, cscalar, + // from GB_subref, above: + ctype, C_iso, cscalar, // original input: - C_is_csc, A, I, symbolic, Werk)) ; + C_is_csc, A, I, I_is_32, symbolic, Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- // Cp and Ch have been imported into C->p and C->h, or freed if phase3 // fails. Either way, Cp and Ch are set to NULL so that they cannot be @@ -246,10 +276,6 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric // free workspace GB_FREE_WORKSPACE ; - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - // C can be returned jumbled, even if A is not jumbled ASSERT_MATRIX_OK (C, "C output for C=A(I,J)", GB0) ; ASSERT (GB_ZOMBIES_OK (C)) ; diff --git a/GraphBLAS/Source/extract/GB_subref.h b/GraphBLAS/Source/extract/GB_subref.h index 18487a9aba..ff12b55633 100644 --- a/GraphBLAS/Source/extract/GB_subref.h +++ b/GraphBLAS/Source/extract/GB_subref.h @@ -2,7 +2,7 @@ // GB_subref.h: definitions for GB_subref_* functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,11 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric bool C_iso, // if true, return C as iso, regardless of A const bool C_is_csc, // requested format of C const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, I is 32-bit; else 64-bit const int64_t nj, // length of J, or special const bool symbolic, // if true, construct C as symbolic GB_Werk Werk @@ -31,11 +33,13 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric GrB_Info GB_subref_phase0 ( // output - int64_t *restrict *p_Ch, // Ch = C->h hyperlist, or NULL standard + void **p_Ch, // Ch = C->h hyperlist, or NULL + bool *p_Cj_is_32, // if true, C->h is 32-bit; else 64-bit + bool *p_Ci_is_32, // if true, C->i is 32-bit; else 64-bit size_t *p_Ch_size, - int64_t *restrict *p_Ap_start, // A(:,kA) starts at Ap_start [kC] + void **p_Ap_start, // A(:,kA) starts at Ap_start [kC] size_t *p_Ap_start_size, - int64_t *restrict *p_Ap_end, // ... and ends at Ap_end [kC] - 1 + void **p_Ap_end, // ... and ends at Ap_end [kC] - 1 size_t *p_Ap_end_size, int64_t *p_Cnvec, // # of vectors in C bool *p_need_qsort, // true if C must be sorted @@ -45,11 +49,28 @@ GrB_Info GB_subref_phase0 int64_t *p_nJ, // length of J // input, not modified const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, I is 32-bit; else 64-bit const int64_t nj, // length of J, or special -// const bool must_sort, // true if C must be returned sorted + GB_Werk Werk +) ; + +GrB_Info GB_I_inverse // invert the I list for C=A(I,:) +( + const void *I, // list of indices, duplicates OK + const bool I_is_32, // if true, I is 32-bit; else 64 bit + int64_t nI, // length of I + int64_t avlen, // length of the vectors of A + // outputs: + void **p_Ihead, // head pointers for buckets, size avlen + size_t *p_Ihead_size, + void **p_Inext, // next pointers for buckets, size nI + size_t *p_Inext_size, + bool *p_Ihead_is_32, // if true, Ihead and Inext are 32-bit; else 64 + int64_t *p_nduplicates, // number of duplicate entries in I GB_Werk Werk ) ; @@ -58,53 +79,64 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // output: GB_task_struct **p_TaskList, // array of structs size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads for subref operation - bool *p_post_sort, // true if a final post-sort is needed - int64_t *restrict *p_Mark, // for I inverse, if needed; size avlen - size_t *p_Mark_size, - int64_t *restrict *p_Inext, // for I inverse, if needed; size nI + int *p_ntasks, // # of tasks constructed + int *p_nthreads, // # of threads for subref operation + bool *p_post_sort, // true if a final post-sort is needed + void **p_Ihead, // for I inverse, if needed; size avlen + size_t *p_Ihead_size, + void **p_Inext, // for I inverse, if needed; size nI size_t *p_Inext_size, - int64_t *p_nduplicates, // # of duplicates, if I inverse computed + bool *p_Ihead_is_32, // if true, Ihead and Inext are 32-bit; else 64 + int64_t *p_nduplicates, // # of duplicates, if I inverse computed + uint64_t **p_Cwork, // workspace of size max(2,C->nvec+1) + size_t *p_Cwork_size, // from phase0: - const int64_t *restrict Ap_start, // location of A(imin:imax,kA) - const int64_t *restrict Ap_end, - const int64_t Cnvec, // # of vectors of C - const bool need_qsort, // true if C must be sorted - const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE or GB_LIST - const int64_t nI, // length of I - const int64_t Icolon [3], // for GB_RANGE and GB_STRIDE + const void *Ap_start, // location of A(imin:imax,kA) + const void *Ap_end, + const int64_t Cnvec, // # of vectors of C + const bool need_qsort, // true if C must be sorted + const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE or GB_LIST + const int64_t nI, // length of I + const int64_t Icolon [3], // for GB_RANGE and GB_STRIDE // original input: - const int64_t avlen, // A->vlen - const int64_t anz, // nnz (A) - const GrB_Index *I, + const int64_t avlen, // A->vlen + const int64_t anz, // nnz (A) + const bool Ap_is_32, // if true, Ap_start/end are 32-bit; else 64 + const void *I, + const bool I_is_32, // if true, I is 32-bit; else 64 bit GB_Werk Werk ) ; GrB_Info GB_subref_phase2 // count nnz in each C(:,j) ( - // computed by phase1: - int64_t **Cp_handle, // output of size Cnvec+1 + // computed by phase2: + void **Cp_handle, // output of size Cnvec+1 + bool *p_Cp_is_32, // if true, Cp is 32-bit; else 64 bit size_t *Cp_size_handle, int64_t *Cnvec_nonempty, // # of non-empty vectors in C - // tasks from phase0b: + // tasks from phase1: GB_task_struct *restrict TaskList, // array of structs const int ntasks, // # of tasks const int nthreads, // # of threads to use - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead,Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates + uint64_t **p_Cwork, // workspace of size max(2,C->nvec+1) + size_t Cwork_size, // analysis from phase0: - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const int64_t Cnvec, const bool need_qsort, const int Ikind, const int64_t nI, const int64_t Icolon [3], + const int64_t nJ, // original input: const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const bool symbolic, GB_Werk Werk ) ; @@ -112,23 +144,27 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) GrB_Info GB_subref_phase3 // C=A(I,J) ( GrB_Matrix C, // output matrix, static header - // from phase1: - int64_t **Cp_handle, // vector pointers for C + // from phase2: + void **Cp_handle, // vector pointers for C + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C - // from phase0b: + // from phase1: const GB_task_struct *restrict TaskList, // array of structs const int ntasks, // # of tasks const int nthreads, // # of threads to use const bool post_sort, // true if post-sort needed - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead,Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates // from phase0: - int64_t **Ch_handle, + void **Ch_handle, + const bool Cj_is_32, // if true, C->h is 32-bit; else 64-bit + const bool Ci_is_32, // if true, C->i is 32-bit; else 64-bit size_t Ch_size, - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const int64_t Cnvec, const bool need_qsort, const int Ikind, @@ -136,42 +172,33 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const int64_t Icolon [3], const int64_t nJ, // from GB_subref: + const GrB_Type ctype, // type of C to create const bool C_iso, // if true, C is iso const GB_void *cscalar, // iso value of C // original input: const bool C_is_csc, // format of output matrix C const GrB_Matrix A, - const GrB_Index *I, + const void *I, + const bool I_is_32, // if true, I is 32-bit; else 64-bit const bool symbolic, GB_Werk Werk ) ; -GrB_Info GB_I_inverse // invert the I list for C=A(I,:) -( - const GrB_Index *I, // list of indices, duplicates OK - int64_t nI, // length of I - int64_t avlen, // length of the vectors of A - // outputs: - int64_t *restrict *p_Mark, // head pointers for buckets, size avlen - size_t *p_Mark_size, - int64_t *restrict *p_Inext, // next pointers for buckets, size nI - size_t *p_Inext_size, - int64_t *p_nduplicates, // number of duplicate entries in I - GB_Werk Werk -) ; - GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric ( - // output + // output: GrB_Matrix C, // output matrix, static header - // input, not modified + // inputs, not modified: + const GrB_Type ctype, // type of C to create const bool C_iso, // if true, C is iso const GB_void *cscalar, // scalar value of C, if iso const bool C_is_csc, // requested format of C const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, J is 32-bit; else 64-bit const int64_t nj, // length of J, or special const bool symbolic, // if true, construct C as symbolic GB_Werk Werk diff --git a/GraphBLAS/Source/extract/GB_subref_phase0.c b/GraphBLAS/Source/extract/GB_subref_phase0.c index 2fe1342a98..4d177affee 100644 --- a/GraphBLAS/Source/extract/GB_subref_phase0.c +++ b/GraphBLAS/Source/extract/GB_subref_phase0.c @@ -2,14 +2,16 @@ // GB_subref_phase0: find vectors of C = A(I,J) and determine I,J properties //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#include "extract/GB_subref.h" +// Finds the vectors for C=A(I,J) when A and C are sparse or hypersparse, and +// determines the properties of I and J. -#define GB_Ai(p) GBI_UNZOMBIE (Ai, p, avlen) +#include "extract/GB_subref.h" +#include "hyper/factory/GB_lookup_debug.h" //------------------------------------------------------------------------------ // GB_find_Ap_start_end @@ -24,17 +26,19 @@ static inline void GB_find_Ap_start_end ( // input, not modified - const int64_t kA, - const int64_t *restrict Ap, - const int64_t *restrict Ai, + const int64_t kA, // searching A(:,kA) + const void *Ap, // column pointers of A + const bool Ap_is_32, + const void *Ai, // row indices of A (with zombies) + const bool Ai_is_32, const int64_t avlen, - const int64_t imin, - const int64_t imax, - const int64_t kC, - const int64_t nzombies, - // output: Ap_start [kC] and Ap_end [kC]: - int64_t *restrict Ap_start, - int64_t *restrict Ap_end + const int64_t imin, // min (I) + const int64_t imax, // max (I) + const int64_t kC, // result will be C(:,kC) + const bool may_see_zombies, + // Ap_start [kC] and Ap_end [kC], defines A(imin:imax,kA) for C(:,kC): + void *Ap_start, // location of A(imin,kA) for C(:,kC) + void *Ap_end // location of A(imax,kA) for C(:,kC) ) { @@ -42,10 +46,25 @@ static inline void GB_find_Ap_start_end // get A(:,kA) //-------------------------------------------------------------------------- - int64_t pA = GBP (Ap, kA, avlen) ; - int64_t pA_end = GBP (Ap, kA+1, avlen) ; + GB_IDECL (Ap, const, u) ; GB_IPTR (Ap , Ap_is_32) ; + GB_IDECL (Ap_start, , u) ; GB_IPTR (Ap_start, Ap_is_32) ; + GB_IDECL (Ap_end , , u) ; GB_IPTR (Ap_end , Ap_is_32) ; + GB_IDECL (Ai, const, ) ; GB_IPTR (Ai , Ai_is_32) ; + + int64_t pA = GB_IGET (Ap, kA) ; + int64_t pA_end = GB_IGET (Ap, kA+1) ; int64_t ajnz = pA_end - pA ; + int64_t ifirst = 0, ilast = 0 ; + if (ajnz > 0) + { + // get the first and last entries in A(:,kA), if any entries appear + ifirst = GB_IGET (Ai, pA) ; + ilast = GB_IGET (Ai, pA_end-1) ; + ifirst = GB_UNZOMBIE (ifirst) ; + ilast = GB_UNZOMBIE (ilast ) ; + } + //-------------------------------------------------------------------------- // trim it to A(imin:imax,kA) //-------------------------------------------------------------------------- @@ -60,7 +79,7 @@ static inline void GB_find_Ap_start_end ; } - else if (ajnz == 0 || GB_Ai (pA) > imax || GB_Ai (pA_end-1) < imin) + else if (ajnz == 0 || ifirst > imax || ilast < imin) { //---------------------------------------------------------------------- @@ -79,36 +98,43 @@ static inline void GB_find_Ap_start_end //---------------------------------------------------------------------- // trim the leading part of A(:,kA) - if (GB_Ai (pA) < imin) + if (ifirst < imin) { - bool found, is_zombie ; + // search for A(imin,kA) + bool is_zombie ; int64_t pright = pA_end - 1 ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (imin, Ai, - pA, pright, found, nzombies, is_zombie) ; + GB_split_binary_search_zombie (imin, Ai, Ai_is_32, + &pA, &pright, may_see_zombies, &is_zombie) ; + // find the first entry of A(imin:imax,kA) + ifirst = GB_IGET (Ai, pA) ; + ifirst = GB_UNZOMBIE (ifirst) ; } // trim the trailing part of A (:,kA) if (imin == imax) { - if (GB_Ai (pA) == imin) + // A(imin:imax,kA) is a single entrie, A(i,kA) + if (ifirst == imin) { - // found the the single entry A (i,kA) + // found the the single entry A (i,kA) where i == imin == imax pA_end = pA + 1 ; } else { - // A (i,kA) has not been found + // A (i,kA) has not been found; A(imin:imax,kA) is empty pA = -1 ; pA_end = -1 ; } } - else if (imax < GB_Ai (pA_end-1)) + else if (imax < ilast) { + // search for A(imax,kA) bool found, is_zombie ; int64_t pleft = pA ; int64_t pright = pA_end - 1 ; - GB_SPLIT_BINARY_SEARCH_ZOMBIE (imax, Ai, - pleft, pright, found, nzombies, is_zombie) ; + found = GB_split_binary_search_zombie (imax, Ai, Ai_is_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; + // adjust pA_end if A(imax,kA) was found pA_end = (found) ? (pleft + 1) : pleft ; } @@ -116,11 +142,29 @@ static inline void GB_find_Ap_start_end ajnz = pA_end - pA ; if (ajnz > 0 && Ap != NULL) { - // A(imin:imax,kA) is now in Ai [pA:pA_end-1] - ASSERT (GB_IMPLIES (Ap [kA] < pA, GB_Ai (pA-1) < imin)) ; - ASSERT (GB_IMPLIES (pA_end < Ap [kA+1], imax < GB_Ai (pA_end))) ; - ASSERT (imin <= GB_Ai (pA)) ; - ASSERT (GB_Ai (pA_end-1) <= imax) ; + // A(imin:imax,kA) is now in Ai [pA:pA_end-1], and is non-empty + if (GB_IGET (Ap, kA) < pA) + { + // check the entry just before A(imin,kA), it must be < imin + int64_t iprev = GB_IGET (Ai, pA-1) ; + iprev = GB_UNZOMBIE (iprev) ; + ASSERT (iprev < imin) ; + } + if (pA_end < GB_IGET (Ap, kA+1)) + { + // check the entry just after A(imax,kA), it must be > imax + int64_t inext = GB_IGET (Ai, pA_end) ; + inext = GB_UNZOMBIE (inext) ; + ASSERT (imax < inext) ; + } + // check the first and last entries of A(imin:imax,kA) to ensure + // their row indices are in range imin:imax + ifirst = GB_IGET (Ai, pA) ; + ilast = GB_IGET (Ai, pA_end-1) ; + ifirst = GB_UNZOMBIE (ifirst) ; + ilast = GB_UNZOMBIE (ilast ) ; + ASSERT (imin <= ifirst) ; + ASSERT (ilast <= imax) ; } #endif } @@ -130,10 +174,11 @@ static inline void GB_find_Ap_start_end //-------------------------------------------------------------------------- // The result [pA:pA_end-1] defines the range of entries that need to be - // accessed for constructing C(:,kC). + // accessed for constructing C(:,kC), for computing C(:,kC) = A(I,kA) with + // the list of row indices I. - Ap_start [kC] = pA ; - Ap_end [kC] = pA_end ; + GB_ISET (Ap_start, kC, pA) ; // Ap_start [kC] = pA + GB_ISET (Ap_end , kC, pA_end) ; // Ap_end [kC] = pA_end } //------------------------------------------------------------------------------ @@ -142,25 +187,27 @@ static inline void GB_find_Ap_start_end #define GB_FREE_WORKSPACE \ { \ - GB_WERK_POP (Count, int64_t) ; \ + GB_WERK_POP (Count, uint64_t) ; \ } #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE (&Ch, Ch_size) ; \ - GB_FREE_WORK (&Ap_start, Ap_start_size) ; \ - GB_FREE_WORK (&Ap_end, Ap_end_size) ; \ + GB_FREE_MEMORY (&Ch, Ch_size) ; \ + GB_FREE_MEMORY (&Ap_start, Ap_start_size) ; \ + GB_FREE_MEMORY (&Ap_end, Ap_end_size) ; \ } GrB_Info GB_subref_phase0 ( // output - int64_t *restrict *p_Ch, // Ch = C->h hyperlist, or NULL standard + void **p_Ch, // Ch = C->h hyperlist, or NULL + bool *p_Cj_is_32, // if true, C->h is 32-bit; else 64-bit + bool *p_Ci_is_32, // if true, C->i is 32-bit; else 64-bit size_t *p_Ch_size, - int64_t *restrict *p_Ap_start, // A(:,kA) starts at Ap_start [kC] + void **p_Ap_start, // A(:,kA) starts at Ap_start [kC] size_t *p_Ap_start_size, - int64_t *restrict *p_Ap_end, // ... and ends at Ap_end [kC] - 1 + void **p_Ap_end, // ... and ends at Ap_end [kC] - 1 size_t *p_Ap_end_size, int64_t *p_Cnvec, // # of vectors in C bool *p_need_qsort, // true if C must be sorted @@ -170,11 +217,12 @@ GrB_Info GB_subref_phase0 int64_t *p_nJ, // length of J // input, not modified const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for C = A(I,J), or GrB_ALL, etc. + const void *J, // index list for C = A(I,J), or GrB_ALL, etc. + const bool J_is_32, // if true, I is 32-bit; else 64-bit const int64_t nj, // length of J, or special -// const bool must_sort, // true if C must be returned sorted GB_Werk Werk ) { @@ -184,7 +232,7 @@ GrB_Info GB_subref_phase0 //-------------------------------------------------------------------------- ASSERT_MATRIX_OK (A, "A for subref phase 0", GB0) ; - ASSERT (!GB_IS_BITMAP (A)) ; // GB_bitmap_subref is used instead + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; ASSERT (p_Ch != NULL) ; ASSERT (p_Ap_start != NULL) ; @@ -198,10 +246,11 @@ GrB_Info GB_subref_phase0 ASSERT (J != NULL) ; GrB_Info info ; - GB_WERK_DECLARE (Count, int64_t) ; - int64_t *restrict Ch = NULL ; size_t Ch_size = 0 ; - int64_t *restrict Ap_start = NULL ; size_t Ap_start_size = 0 ; - int64_t *restrict Ap_end = NULL ; size_t Ap_end_size = 0 ; + GB_WERK_DECLARE (Count, uint64_t) ; + GB_MDECL (Ch, , u) ; size_t Ch_size = 0 ; + + void *Ap_start = NULL ; size_t Ap_start_size = 0 ; + void *Ap_end = NULL ; size_t Ap_end_size = 0 ; (*p_Ch ) = NULL ; (*p_Ap_start ) = NULL ; @@ -216,13 +265,18 @@ GrB_Info GB_subref_phase0 // get A //-------------------------------------------------------------------------- - int64_t *restrict Ap = A->p ; // Ap (but not A->p) may be trimmed - int64_t *restrict Ah = A->h ; // Ah (but not A->h) may be trimmed - int64_t *restrict Ai = A->i ; + void *Ap = A->p ; + void *Ai = A->i ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; // Ah may be trimmed int64_t anvec = A->nvec ; // may be trimmed int64_t avlen = A->vlen ; int64_t avdim = A->vdim ; - int64_t nzombies = A->nzombies ; + const bool may_see_zombies = (A->nzombies > 0) ; + bool Ap_is_32 = A->p_is_32 ; + bool Aj_is_32 = A->j_is_32 ; + bool Ai_is_32 = A->i_is_32 ; + size_t apsize = (Ap_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t ajsize = (Aj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; //-------------------------------------------------------------------------- // check the properties of I and J @@ -231,13 +285,13 @@ GrB_Info GB_subref_phase0 // C = A(I,J) so I is in range 0:avlen-1 and J is in range 0:avdim-1 int64_t nI, nJ, Jcolon [3] ; int Ikind, Jkind ; - GB_ijlength (I, ni, avlen, &nI, &Ikind, Icolon) ; - GB_ijlength (J, nj, avdim, &nJ, &Jkind, Jcolon) ; + GB_ijlength (I, I_is_32, ni, avlen, &nI, &Ikind, Icolon) ; + GB_ijlength (J, J_is_32, nj, avdim, &nJ, &Jkind, Jcolon) ; bool I_unsorted, I_has_dupl, I_contig, J_unsorted, J_has_dupl, J_contig ; int64_t imin, imax, jmin, jmax ; - info = GB_ijproperties (I, ni, nI, avlen, &Ikind, Icolon, + info = GB_ijproperties (I, I_is_32, ni, nI, avlen, &Ikind, Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Werk) ; if (info != GrB_SUCCESS) { @@ -245,7 +299,7 @@ GrB_Info GB_subref_phase0 return (info) ; } - info = GB_ijproperties (J, nj, nJ, avdim, &Jkind, Jcolon, + info = GB_ijproperties (J, J_is_32, nj, nJ, avdim, &Jkind, Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Werk) ; if (info != GrB_SUCCESS) { @@ -255,6 +309,8 @@ GrB_Info GB_subref_phase0 bool need_qsort = I_unsorted ; + GB_IDECL (J, const, u) ; GB_IPTR (J, J_is_32) ; + //-------------------------------------------------------------------------- // determine if C is empty //-------------------------------------------------------------------------- @@ -262,6 +318,21 @@ GrB_Info GB_subref_phase0 bool C_empty = (nI == 0 || nJ == 0) ; bool A_is_hyper = (Ah != NULL) ; + //-------------------------------------------------------------------------- + // determine the integer sizes of C + //-------------------------------------------------------------------------- + + // determine the j_is_32 and i_is_32 settings for the new matrix; p_is_32 + // is found later + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + ASSERT (p_Cj_is_32 != NULL) ; + ASSERT (p_Ci_is_32 != NULL) ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, 0, nI, nJ, Werk) ; + + size_t cjsize = (Cj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + //-------------------------------------------------------------------------- // trim the hyperlist of A for (J = jbegin:jend case only) //-------------------------------------------------------------------------- @@ -281,13 +352,13 @@ GrB_Info GB_subref_phase0 if (jmin > 0) { - bool found ; int64_t kleft = 0 ; int64_t kright = anvec-1 ; - GB_SPLIT_BINARY_SEARCH (jmin, Ah, kleft, kright, found) ; - Ah += kleft ; - Ap += kleft ; + GB_split_binary_search (jmin, Ah, Aj_is_32, &kleft, &kright) ; + Ap = (void *) ((GB_void *) Ap + kleft * apsize) ; // Ap += kleft + Ah = (void *) ((GB_void *) Ah + kleft * ajsize) ; // Ah += kleft anvec -= kleft ; + GB_IPTR (Ah, Aj_is_32) ; } //---------------------------------------------------------------------- @@ -299,12 +370,14 @@ GrB_Info GB_subref_phase0 bool found ; int64_t kleft = 0 ; int64_t kright = anvec-1 ; - GB_SPLIT_BINARY_SEARCH (jmax, Ah, kleft, kright, found) ; + found = GB_split_binary_search (jmax, Ah, Aj_is_32, + &kleft, &kright) ; anvec = (found) ? (kleft + 1) : kleft ; } // Ah has been trimmed - ASSERT (GB_IMPLIES (anvec > 0, jmin <= Ah [0] && Ah [anvec-1] <= jmax)); + ASSERT (GB_IMPLIES (anvec > 0, + jmin <= GB_IGET (Ah, 0) && GB_IGET (Ah, anvec-1) <= jmax)) ; } // Ah may now be empty, after being trimmed @@ -325,9 +398,9 @@ GrB_Info GB_subref_phase0 GB_OK (GB_hyper_hash_build (A, Werk)) ; } - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; //-------------------------------------------------------------------------- @@ -352,7 +425,7 @@ GrB_Info GB_subref_phase0 // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Count, ntasks_max+1, int64_t) ; + GB_WERK_PUSH (Count, ntasks_max+1, uint64_t) ; if (Count == NULL) { // out of memory @@ -439,8 +512,8 @@ GrB_Info GB_subref_phase0 (jinc > 0) ? tid : (ntasks-tid-1), ntasks) ; for (int64_t kA = kA_start ; kA < kA_end ; kA++) { - int64_t jA = Ah [kA] ; - if (GB_ij_is_in_list (J, nJ, jA, GB_STRIDE, Jcolon)) + int64_t jA = GB_IGET (Ah, kA) ; + if (GB_ij_is_in_list (J, J_is_32, nJ, jA, GB_STRIDE, Jcolon)) { my_Cnvec++ ; } @@ -448,7 +521,7 @@ GrB_Info GB_subref_phase0 Count [tid] = my_Cnvec ; } - GB_cumsum1 (Count, ntasks) ; + GB_cumsum1_64 (Count, ntasks) ; Cnvec = Count [ntasks] ; } @@ -477,22 +550,23 @@ GrB_Info GB_subref_phase0 int64_t my_Cnvec = 0 ; for (int64_t jC = jC_start ; jC < jC_end ; jC++) { - int64_t jA = GB_ijlist (J, jC, Jkind, Jcolon) ; + int64_t jA = GB_IJLIST (J, jC, Jkind, Jcolon) ; bool found ; int64_t kA = 0 ; if (use_hyper_hash) { // find jA using the hyper_hash int64_t ignore1, ignore2 ; - kA = GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, jA, &ignore1, &ignore2) ; + kA = GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, jA, + &ignore1, &ignore2) ; found = (kA >= 0) ; } else { // find jA using binary search int64_t kright = anvec-1 ; - GB_BINARY_SEARCH (jA, Ah, kA, kright, found) ; + found = GB_binary_search (jA, Ah, Aj_is_32, &kA, &kright) ; } if (found) { @@ -502,7 +576,7 @@ GrB_Info GB_subref_phase0 Count [tid] = my_Cnvec ; } - GB_cumsum1 (Count, ntasks) ; + GB_cumsum1_64 (Count, ntasks) ; Cnvec = Count [ntasks] ; } @@ -517,18 +591,19 @@ GrB_Info GB_subref_phase0 if (C_is_hyper) { - Ch = GB_MALLOC (Cnvec, int64_t, &Ch_size) ; + Ch = GB_MALLOC_MEMORY (Cnvec, cjsize, &Ch_size) ; if (Ch == NULL) { GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Ch, Cj_is_32) ; } if (Cnvec > 0) { - Ap_start = GB_MALLOC_WORK (Cnvec, int64_t, &Ap_start_size) ; - Ap_end = GB_MALLOC_WORK (Cnvec, int64_t, &Ap_end_size) ; + Ap_start = GB_MALLOC_MEMORY (Cnvec, apsize, &Ap_start_size) ; + Ap_end = GB_MALLOC_MEMORY (Cnvec, apsize, &Ap_end_size) ; if (Ap_start == NULL || Ap_end == NULL) { // out of memory @@ -566,9 +641,9 @@ GrB_Info GB_subref_phase0 #pragma omp parallel for num_threads(nthreads) schedule(static) for (jC = 0 ; jC < nJ ; jC++) { - int64_t jA = GB_ijlist (J, jC, Jkind, Jcolon) ; - GB_find_Ap_start_end (jA, Ap, Ai, avlen, imin, imax, - jC, nzombies, Ap_start, Ap_end) ; + int64_t jA = GB_IJLIST (J, jC, Jkind, Jcolon) ; + GB_find_Ap_start_end (jA, Ap, Ap_is_32, Ai, Ai_is_32, avlen, + imin, imax, jC, may_see_zombies, Ap_start, Ap_end) ; } } @@ -587,11 +662,11 @@ GrB_Info GB_subref_phase0 for (kC = 0 ; kC < Cnvec ; kC++) { int64_t kA = kC ; - int64_t jA = Ah [kA] ; + int64_t jA = GB_IGET (Ah, kA) ; int64_t jC = jA - jmin ; - Ch [kC] = jC ; - GB_find_Ap_start_end (kA, Ap, Ai, avlen, imin, imax, - kC, nzombies, Ap_start, Ap_end) ; + GB_ISET (Ch, kC, jC) ; // Ch [kC] = jC ; + GB_find_Ap_start_end (kA, Ap, Ap_is_32, Ai, Ai_is_32, avlen, + imin, imax, kC, may_see_zombies, Ap_start, Ap_end) ; } } @@ -617,13 +692,15 @@ GrB_Info GB_subref_phase0 int64_t kC = Count [tid] ; for (int64_t kA = kA_start ; kA < kA_end ; kA++) { - int64_t jA = Ah [kA] ; - if (GB_ij_is_in_list (J, nJ, jA, GB_STRIDE, Jcolon)) + int64_t jA = GB_IGET (Ah, kA) ; + if (GB_ij_is_in_list (J, J_is_32, nJ, jA, GB_STRIDE, + Jcolon)) { int64_t jC = (jA - jbegin) / jinc ; - Ch [kC] = jC ; - GB_find_Ap_start_end (kA, Ap, Ai, avlen, imin, imax, - kC, nzombies, Ap_start, Ap_end) ; + GB_ISET (Ch, kC, jC) ; // Ch [kC] = jC + GB_find_Ap_start_end (kA, Ap, Ap_is_32, Ai, Ai_is_32, + avlen, imin, imax, kC, may_see_zombies, + Ap_start, Ap_end) ; kC++ ; } } @@ -640,13 +717,15 @@ GrB_Info GB_subref_phase0 int64_t kC = Count [tid] ; for (int64_t kA = kA_end-1 ; kA >= kA_start ; kA--) { - int64_t jA = Ah [kA] ; - if (GB_ij_is_in_list (J, nJ, jA, GB_STRIDE, Jcolon)) + int64_t jA = GB_IGET (Ah, kA) ; + if (GB_ij_is_in_list (J, J_is_32, nJ, jA, GB_STRIDE, + Jcolon)) { int64_t jC = (jA - jbegin) / jinc ; - Ch [kC] = jC ; - GB_find_Ap_start_end (kA, Ap, Ai, avlen, imin, imax, - kC, nzombies, Ap_start, Ap_end) ; + GB_ISET (Ch, kC, jC) ; // Ch [kC] = jC + GB_find_Ap_start_end (kA, Ap, Ap_is_32, Ai, Ai_is_32, + avlen, imin, imax, kC, may_see_zombies, + Ap_start, Ap_end) ; kC++ ; } } @@ -674,29 +753,31 @@ GrB_Info GB_subref_phase0 int64_t kC = Count [tid] ; for (int64_t jC = jC_start ; jC < jC_end ; jC++) { - int64_t jA = GB_ijlist (J, jC, Jkind, Jcolon) ; + int64_t jA = GB_IJLIST (J, jC, Jkind, Jcolon) ; bool found ; int64_t kA = 0 ; if (use_hyper_hash) { // find jA using the hyper_hash int64_t ignore1, ignore2 ; - kA = GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, jA, &ignore1, &ignore2) ; + kA = GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, jA, + &ignore1, &ignore2) ; found = (kA >= 0) ; } else { // find jA using binary search int64_t kright = anvec-1 ; - GB_BINARY_SEARCH (jA, Ah, kA, kright, found) ; + found = GB_binary_search (jA, Ah, Aj_is_32, &kA, &kright) ; } if (found) { - ASSERT (jA == Ah [kA]) ; - Ch [kC] = jC ; - GB_find_Ap_start_end (kA, Ap, Ai, avlen, imin, imax, - kC, nzombies, Ap_start, Ap_end) ; + ASSERT (jA == GB_IGET (Ah, kA)) ; + GB_ISET (Ch, kC, jC) ; // Ch [kC] = jC + GB_find_Ap_start_end (kA, Ap, Ap_is_32, Ai, Ai_is_32, + avlen, imin, imax, kC, may_see_zombies, + Ap_start, Ap_end) ; kC++ ; } } @@ -711,40 +792,62 @@ GrB_Info GB_subref_phase0 for (int64_t kC = 0 ; kC < Cnvec ; kC++) { // jC is the (kC)th vector of C = A(I,J) - int64_t jC = GBH (Ch, kC) ; - int64_t jA = GB_ijlist (J, jC, Jkind, Jcolon) ; + int64_t jC = GBh_C (Ch, kC) ; + int64_t jA = GB_IJLIST (J, jC, Jkind, Jcolon) ; // jA = J (jC) // jA is the corresponding (kA)th vector of A. int64_t kA = 0 ; int64_t pright = A->nvec - 1 ; int64_t pA_start_all, pA_end_all ; - bool found = GB_lookup (A->h != NULL, // for debug only - A->h, A->p, A->vlen, &kA, pright, jA, &pA_start_all, &pA_end_all) ; - if (found && A->h != NULL) - { - ASSERT (jA == A->h [kA]) ; - } - int64_t pA = Ap_start [kC] ; - int64_t pA_end = Ap_end [kC] ; - int64_t ajnz = pA_end - pA ; - if (ajnz == avlen) + // look for A(:,jA) + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + bool found = GB_lookup_debug (Ap_is_32, Aj_is_32, A_is_hyper, + Ah, A->p, A->vlen, &kA, pright, jA, &pA_start_all, &pA_end_all) ; + // ensure that A(:,jA) is in Ai,Ax [pA_start_all:pA_end_all-1]: + if (found && Ah != NULL) { - // A(:,kA) is dense; Ai [pA:pA_end-1] is the entire vector. - // C(:,kC) will have exactly nI entries. - ASSERT (pA == pA_start_all) ; - ASSERT (pA_end == pA_end_all ) ; - ; + // A(:,jA) appears in the hypersparse A, as the (kA)th vector in A + ASSERT (jA == GB_IGET (Ah, kA)) ; } - else if (ajnz > 0) + if (!found) { - // A(imin:imax,kA) has at least one entry, in Ai [pA:pA_end-1] - ASSERT (imin <= GB_Ai (pA)) ; - ASSERT (GB_Ai (pA_end-1) <= imax) ; - ASSERT (pA_start_all <= pA && pA < pA_end && pA_end <= pA_end_all) ; + // A(:,jA) is empty + ASSERT (pA_start_all == -1) ; + ASSERT (pA_end_all == -1) ; } else { - // A(imin:imax,kA) and C(:,kC) are empty - ; + // A(imin:imax,jA) is in Ai,Ax [pA:pA_end-1] + GB_IDECL (Ap_start, const, u) ; GB_IPTR (Ap_start, Ap_is_32) ; + GB_IDECL (Ap_end , const, u) ; GB_IPTR (Ap_end , Ap_is_32) ; + uint64_t pA = GB_IGET (Ap_start, kC) ; + uint64_t pA_end = GB_IGET (Ap_end , kC) ; + int64_t ajnz = pA_end - pA ; + if (ajnz == avlen) + { + // A(:,jA) is dense; Ai [pA:pA_end-1] is the entire vector. + // C(:,jC) will have exactly nI entries. + ASSERT (pA == pA_start_all) ; + ASSERT (pA_end == pA_end_all ) ; + } + else if (ajnz > 0) + { + // A(imin:imax,jA) is non-empty and a subset of A(:,jA) + int64_t ifirst = GB_IGET (Ai, pA) ; + int64_t ilast = GB_IGET (Ai, pA_end-1) ; + ifirst = GB_UNZOMBIE (ifirst) ; + ilast = GB_UNZOMBIE (ilast ) ; + ASSERT (imin <= ifirst) ; + ASSERT (ilast <= imax) ; + ASSERT (pA_start_all <= pA) ; + ASSERT (pA < pA_end) ; + ASSERT (pA_end <= pA_end_all) ; + } + else + { + // A(imin:imax,jA) and C(:,jC) are empty + ; + } } } #endif @@ -754,14 +857,19 @@ GrB_Info GB_subref_phase0 //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - (*p_Ch ) = Ch ; (*p_Ch_size) = Ch_size ; - (*p_Ap_start ) = Ap_start ; (*p_Ap_start_size) = Ap_start_size ; - (*p_Ap_end ) = Ap_end ; (*p_Ap_end_size) = Ap_end_size ; - (*p_Cnvec ) = Cnvec ; - (*p_need_qsort) = need_qsort ; - (*p_Ikind ) = Ikind ; - (*p_nI ) = nI ; - (*p_nJ ) = nJ ; + (*p_Ch ) = Ch ; + (*p_Ch_size ) = Ch_size ; + (*p_Cj_is_32 ) = Cj_is_32 ; + (*p_Ci_is_32 ) = Ci_is_32 ; + (*p_Ap_start ) = Ap_start ; + (*p_Ap_start_size) = Ap_start_size ; + (*p_Ap_end ) = Ap_end ; + (*p_Ap_end_size ) = Ap_end_size ; + (*p_Cnvec ) = Cnvec ; + (*p_need_qsort ) = need_qsort ; + (*p_Ikind ) = Ikind ; + (*p_nI ) = nI ; + (*p_nJ ) = nJ ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/extract/GB_subref_phase2.c b/GraphBLAS/Source/extract/GB_subref_phase2.c index a9e3f6e09c..818522ff7e 100644 --- a/GraphBLAS/Source/extract/GB_subref_phase2.c +++ b/GraphBLAS/Source/extract/GB_subref_phase2.c @@ -2,13 +2,14 @@ // GB_subref_phase2: find # of entries in C=A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // GB_subref_phase2 counts the number of entries in each vector of C, for -// C=A(I,J) and then does a cumulative sum to find Cp. +// C=A(I,J) and then does a cumulative sum to find Cp. A is sparse or +// hypersparse. // Cp is either freed by phase2, or transplanted into C. @@ -17,27 +18,33 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) ( // computed by phase2: - int64_t **Cp_handle, // output of size Cnvec+1 + void **Cp_handle, // output of size Cnvec+1 + bool *p_Cp_is_32, // if true, Cp is 32-bit; else 64 bit size_t *Cp_size_handle, int64_t *Cnvec_nonempty, // # of non-empty vectors in C // tasks from phase1: GB_task_struct *restrict TaskList, // array of structs const int ntasks, // # of tasks const int nthreads, // # of threads to use - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead,Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates + uint64_t **p_Cwork, // workspace of size max(2,C->nvec+1) + size_t Cwork_size, // analysis from phase0: - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const int64_t Cnvec, const bool need_qsort, const int Ikind, const int64_t nI, const int64_t Icolon [3], + const int64_t nJ, // original input: const GrB_Matrix A, - const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. + const void *I, // index list for C = A(I,J), or GrB_ALL, etc. + const bool I_is_32, // if true, I is 32-bit; else 64-bit const bool symbolic, GB_Werk Werk ) @@ -50,20 +57,38 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) ASSERT (Cp_handle != NULL) ; ASSERT (Cp_size_handle != NULL) ; ASSERT_MATRIX_OK (A, "A for subref phase2", GB0) ; - ASSERT (!GB_IS_BITMAP (A)) ; // GB_bitmap_subref is used instead + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; - //-------------------------------------------------------------------------- - // allocate the result - //-------------------------------------------------------------------------- + GB_IDECL (I , const, u) ; GB_IPTR (I , I_is_32) ; + GB_IDECL (Ap_start, const, u) ; GB_IPTR (Ap_start, A->p_is_32) ; + GB_IDECL (Ap_end , const, u) ; GB_IPTR (Ap_end , A->p_is_32) ; + GB_IDECL (Ihead , const, u) ; GB_IPTR (Ihead , Ihead_is_32) ; + GB_IDECL (Inext , const, u) ; GB_IPTR (Inext , Ihead_is_32) ; (*Cp_handle) = NULL ; (*Cp_size_handle) = 0 ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - Cp = GB_CALLOC (GB_IMAX (2, Cnvec+1), int64_t, &Cp_size) ; - if (Cp == NULL) - { - // out of memory - return (GrB_OUT_OF_MEMORY) ; + uint64_t *restrict Cwork = (*p_Cwork) ; + const bool Ai_is_32 = A->i_is_32 ; + ASSERT (Cwork != NULL) ; + + // clear Cwork [k] for fine tasks that compute vector k + #ifdef GB_DEBUG + GB_memset (Cwork, 0xFF, (Cnvec+1) * sizeof (uint64_t), nthreads) ; + #endif + for (int taskid = 0 ; taskid < ntasks ; taskid++) + { + int64_t kfirst = TaskList [taskid].kfirst ; + int64_t klast = TaskList [taskid].klast ; + bool fine_task = (klast < 0) ; + if (fine_task) + { + // The set of fine tasks that compute C(:,kC) do not compute Cwork + // [kC] directly. Instead, they compute their partial results in + // TaskList [taskid].pC, which is then summed by GB_task_cumsum. + // That method sums up the work of each fine task and adds it to + // Cwork [kC], which must be initialized here to zero. + Cwork [kfirst] = 0 ; + } } //-------------------------------------------------------------------------- @@ -79,7 +104,7 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) { #define GB_SYMBOLIC // symbolic extraction must handle zombies - const int64_t nzombies = A->nzombies ; + const bool may_see_zombies = (A->nzombies > 0) ; #include "extract/template/GB_subref_template.c" } else @@ -90,18 +115,57 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) } //-------------------------------------------------------------------------- - // cumulative sum of Cp and fine tasks in TaskList + // cumulative sum of Cwork and fine tasks in TaskList + //-------------------------------------------------------------------------- + + Cwork [Cnvec] = 0 ; + GB_task_cumsum (Cwork, false, Cnvec, Cnvec_nonempty, TaskList, ntasks, + nthreads, Werk) ; + int64_t cnz = Cwork [Cnvec] ; + + //-------------------------------------------------------------------------- + // allocate the final result Cp //-------------------------------------------------------------------------- - GB_task_cumsum (Cp, Cnvec, Cnvec_nonempty, TaskList, ntasks, nthreads, - Werk) ; + // determine the final p_is_32 setting for the new matrix; + // j_is_32 and i_is_32 have already been determined by GB_subref_phase0 + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + ASSERT (p_Cp_is_32 != NULL) ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, cnz, nI, nJ, Werk) ; + + void *Cp = NULL ; size_t Cp_size = 0 ; + + if (Cp_is_32) + { + // Cp is 32-bit; allocate and typecast from Cwork + Cp = GB_MALLOC_MEMORY (GB_IMAX (2, Cnvec+1), sizeof (uint32_t), + &Cp_size) ; + if (Cp == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + int nthreads_max = GB_Context_nthreads_max ( ) ; + GB_cast_int (Cp, GB_UINT32_code, Cwork, GB_UINT64_code, Cnvec+1, + nthreads_max) ; + } + else + { + // Cp is 64-bit; transplant Cwork as Cp + Cp = Cwork ; + Cp_size = Cwork_size ; + (*p_Cwork) = NULL ; + } //-------------------------------------------------------------------------- // return the result //-------------------------------------------------------------------------- - (*Cp_handle) = Cp ; + (*Cp_handle ) = Cp ; (*Cp_size_handle) = Cp_size ; + (*p_Cp_is_32 ) = Cp_is_32 ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/extract/GB_subref_phase3.c b/GraphBLAS/Source/extract/GB_subref_phase3.c index 56503179df..43112d366a 100644 --- a/GraphBLAS/Source/extract/GB_subref_phase3.c +++ b/GraphBLAS/Source/extract/GB_subref_phase3.c @@ -2,7 +2,7 @@ // GB_subref_phase3: C=A(I,J) where C and A are sparse/hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,14 +12,14 @@ #include "extract/GB_subref.h" #include "sort/GB_sort.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" GrB_Info GB_subref_phase3 // C=A(I,J) ( GrB_Matrix C, // output matrix, static header // from phase2: - int64_t **Cp_handle, // vector pointers for C + void **Cp_handle, // vector pointers for C + const bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit size_t Cp_size, const int64_t Cnvec_nonempty, // # of non-empty vectors in C // from phase1: @@ -27,14 +27,17 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const int ntasks, // # of tasks const int nthreads, // # of threads to use const bool post_sort, // true if post-sort needed - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead,Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates // from phase0: - int64_t **Ch_handle, + void **Ch_handle, + const bool Cj_is_32, // if true, C->h is 32-bit; else 64-bit + const bool Ci_is_32, // if true, C->i is 32-bit; else 64-bit size_t Ch_size, - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const int64_t Cnvec, const bool need_qsort, const int Ikind, @@ -42,12 +45,14 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const int64_t Icolon [3], const int64_t nJ, // from GB_subref: + const GrB_Type ctype, // type of C to create const bool C_iso, // if true, C is iso const GB_void *cscalar, // iso value of C // original input: const bool C_is_csc, // format of output matrix C const GrB_Matrix A, - const GrB_Index *I, + const void *I, + const bool I_is_32, // if true, I is 32-bit; else 64-bit const bool symbolic, GB_Werk Werk ) @@ -57,47 +62,61 @@ GrB_Info GB_subref_phase3 // C=A(I,J) // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT (Cp_handle != NULL) ; ASSERT (Ch_handle != NULL) ; - const int64_t *restrict Ch = (*Ch_handle) ; - const int64_t *restrict Cp = (*Cp_handle) ; + + GB_MDECL (Cp, const, u) ; + Cp = (*Cp_handle) ; + GB_IPTR (Cp, Cp_is_32) ; + + void *Ch = (*Ch_handle) ; + + bool Ap_is_32 = A->p_is_32 ; + bool Ai_is_32 = A->i_is_32 ; + + GB_IDECL (I , const, u) ; GB_IPTR (I , I_is_32) ; + GB_IDECL (Ap_start, const, u) ; GB_IPTR (Ap_start, Ap_is_32) ; + GB_IDECL (Ap_end , const, u) ; GB_IPTR (Ap_end , Ap_is_32) ; + GB_IDECL (Ihead , const, u) ; GB_IPTR (Ihead , Ihead_is_32) ; + GB_IDECL (Inext , const, u) ; GB_IPTR (Inext , Ihead_is_32) ; + ASSERT (Cp != NULL) ; ASSERT_MATRIX_OK (A, "A for subref phase3", GB0) ; ASSERT (!GB_IS_BITMAP (A)) ; ASSERT (!GB_IS_FULL (A)) ; + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; //-------------------------------------------------------------------------- // allocate the output matrix C //-------------------------------------------------------------------------- - int64_t cnz = Cp [Cnvec] ; + int64_t cnz = GB_IGET (Cp, Cnvec) ; bool C_is_hyper = (Ch != NULL) ; - GrB_Type ctype = (symbolic) ? GrB_INT64 : A->type ; // allocate the result C (but do not allocate C->p or C->h) int sparsity = C_is_hyper ? GxB_HYPERSPARSE : GxB_SPARSE ; - // set C->iso = C_iso OK GrB_Info info = GB_new_bix (&C, // sparse or hyper, existing header - ctype, nI, nJ, GB_Ap_null, C_is_csc, - sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso) ; + ctype, nI, nJ, GB_ph_null, C_is_csc, + sparsity, true, A->hyper_switch, Cnvec, cnz, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32) ; if (info != GrB_SUCCESS) { // out of memory - GB_FREE (Cp_handle, Cp_size) ; - GB_FREE (Ch_handle, Ch_size) ; + GB_FREE_MEMORY (Cp_handle, Cp_size) ; + GB_FREE_MEMORY (Ch_handle, Ch_size) ; return (info) ; } - // add Cp as the vector pointers for C, from GB_subref_phase1 - C->p = (int64_t *) Cp ; C->p_size = Cp_size ; + // add Cp as the vector pointers for C, from GB_subref_phase2 + C->p = (*Cp_handle) ; C->p_size = Cp_size ; (*Cp_handle) = NULL ; // add Ch as the hypersparse list for C, from GB_subref_phase0 if (C_is_hyper) { // transplant Ch into C - C->h = (int64_t *) Ch ; C->h_size = Ch_size ; + C->h = Ch ; C->h_size = Ch_size ; (*Ch_handle) = NULL ; C->nvec = Cnvec ; } @@ -105,17 +124,21 @@ GrB_Info GB_subref_phase3 // C=A(I,J) // now Cp and Ch have been transplanted into C, so they must not be freed. ASSERT ((*Cp_handle) == NULL) ; ASSERT ((*Ch_handle) == NULL) ; - C->nvec_nonempty = Cnvec_nonempty ; +// C->nvec_nonempty = Cnvec_nonempty ; + GB_nvec_nonempty_set (C, Cnvec_nonempty) ; C->nvals = cnz ; C->magic = GB_MAGIC ; + ASSERT (C->p_is_32 == Cp_is_32) ; + ASSERT (C->j_is_32 == Cj_is_32) ; + ASSERT (C->i_is_32 == Ci_is_32) ; //-------------------------------------------------------------------------- // phase3: C = A(I,J) //-------------------------------------------------------------------------- + GB_Ci_DECLARE_U (Ci, ) ; GB_Ci_PTR (Ci, C) ; + #define GB_PHASE_2_OF_2 - int64_t *restrict Ci = C->i ; - int64_t *restrict Cx = (int64_t *) C->x ; #define GB_I_KIND Ikind #define GB_NEED_QSORT need_qsort #define GB_I_HAS_DUPLICATES I_has_duplicates @@ -124,25 +147,64 @@ GrB_Info GB_subref_phase3 // C=A(I,J) { //---------------------------------------------------------------------- - // symbolic subref + // symbolic subref: Cx is uint32_t or uint64_t; the values of A ignored //---------------------------------------------------------------------- ASSERT (!C_iso) ; + ASSERT (ctype == GrB_UINT32 || ctype == GrB_UINT64) ; // symbolic subref must handle zombies - const int64_t nzombies = A->nzombies ; + const bool may_see_zombies = (A->nzombies > 0) ; + + if (ctype == GrB_UINT32) + { + uint32_t *restrict Cx = (uint32_t *) C->x ; + + #define GB_COPY_RANGE(pC,pA,len) \ + for (int64_t k = 0 ; k < (len) ; k++) \ + { \ + Cx [(pC) + k] = (pA) + k ; \ + } + #define GB_COPY_ENTRY(pC,pA) Cx [pC] = (pA) ; + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + { \ + if (Ci_is_32) \ + { \ + GB_qsort_1b_32_size4 (Ci32 + pC, Cx + pC, clen) ; \ + } \ + else \ + { \ + GB_qsort_1b_64_size4 (Ci64 + pC, Cx + pC, clen) ; \ + } \ + } + #define GB_SYMBOLIC + #include "extract/template/GB_subref_template.c" - // symbolic copy: Cx is int64_t; the values of A ignored - #define GB_COPY_RANGE(pC,pA,len) \ - for (int64_t k = 0 ; k < (len) ; k++) \ - { \ - Cx [(pC) + k] = (pA) + k ; \ + } + else + { + uint64_t *restrict Cx = (uint64_t *) C->x ; + + #define GB_COPY_RANGE(pC,pA,len) \ + for (int64_t k = 0 ; k < (len) ; k++) \ + { \ + Cx [(pC) + k] = (pA) + k ; \ + } + #define GB_COPY_ENTRY(pC,pA) Cx [pC] = (pA) ; + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + { \ + if (Ci_is_32) \ + { \ + GB_qsort_1b_32_size8 (Ci32 + pC, Cx + pC, clen) ; \ + } \ + else \ + { \ + GB_qsort_1b_64_size8 (Ci64 + pC, Cx + pC, clen) ; \ + } \ } - #define GB_COPY_ENTRY(pC,pA) Cx [pC] = (pA) ; - #define GB_QSORT_1B(Ci,Cx,pC,clen) \ - GB_qsort_1b_size8 (Ci + pC, (uint64_t *) (Cx + pC), clen) ; - #define GB_SYMBOLIC - #include "extract/template/GB_subref_template.c" + #define GB_SYMBOLIC + #include "extract/template/GB_subref_template.c" + } } else if (C_iso) @@ -153,11 +215,21 @@ GrB_Info GB_subref_phase3 // C=A(I,J) //---------------------------------------------------------------------- // C is iso; no numeric values to extract; just set the iso value - memcpy (Cx, cscalar, A->type->size) ; + memcpy (C->x, cscalar, A->type->size) ; #define GB_COPY_RANGE(pC,pA,len) ; #define GB_COPY_ENTRY(pC,pA) ; #define GB_ISO_SUBREF - #define GB_QSORT_1B(Ci,Cx,pC,clen) ; + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + { \ + if (Ci_is_32) \ + { \ + GB_qsort_1_32 (Ci32 + pC, clen) ; \ + } \ + else \ + { \ + GB_qsort_1_64 (Ci64 + pC, clen) ; \ + } \ + } #include "extract/template/GB_subref_template.c" } @@ -168,10 +240,12 @@ GrB_Info GB_subref_phase3 // C=A(I,J) // non-iso numeric subref //---------------------------------------------------------------------- + ASSERT (ctype == A->type) ; + // using the JIT kernel info = GB_subref_sparse_jit (C, TaskList, ntasks, nthreads, post_sort, - Mark, Inext, I_has_duplicates, Ap_start, Ap_end, need_qsort, - Ikind, nI, Icolon, A, I) ; + Ihead, Inext, Ihead_is_32, I_has_duplicates, Ap_start, Ap_end, + need_qsort, Ikind, nI, Icolon, A, I, I_is_32) ; if (info == GrB_NO_VALUE) { @@ -187,8 +261,19 @@ GrB_Info GB_subref_phase3 // C=A(I,J) memcpy (Cx + (pC)*csize, Ax + (pA)*csize, (len) * csize) ; #define GB_COPY_ENTRY(pC,pA) \ memcpy (Cx + (pC)*csize, Ax + (pA)*csize, csize) ; - #define GB_QSORT_1B(Ci,Cx,pC,clen) \ - GB_qsort_1b (Ci+(pC), (GB_void *) (Cx+(pC)*csize), csize, clen); + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + { \ + if (Ci_is_32) \ + { \ + GB_qsort_1b_32_generic (Ci32 + pC, \ + (GB_void *) (Cx+(pC)*csize), csize, clen) ; \ + } \ + else \ + { \ + GB_qsort_1b_64_generic (Ci64 + pC, \ + (GB_void *) (Cx+(pC)*csize), csize, clen) ; \ + } \ + } #include "extract/template/GB_subref_template.c" info = GrB_SUCCESS ; } @@ -200,7 +285,7 @@ GrB_Info GB_subref_phase3 // C=A(I,J) if (info == GrB_SUCCESS) { - info = GB_hypermatrix_prune (C, Werk) ; + info = GB_hyper_prune (C, Werk) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/extract/GB_subref_slice.c b/GraphBLAS/Source/extract/GB_subref_slice.c index 90ba4c7e11..d3d8073b8d 100644 --- a/GraphBLAS/Source/extract/GB_subref_slice.c +++ b/GraphBLAS/Source/extract/GB_subref_slice.c @@ -2,7 +2,7 @@ // GB_subref_slice: construct coarse/fine tasks for C = A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,23 +24,43 @@ // Note that J can have duplicates. kC is unique (0:Cnvec-1) but the // corresponding vector kA in A may repeat, if J has duplicates. Duplicates in // J are not exploited, since the coarse/fine tasks are constructed by slicing -// slicing the list of vectors Ch of size Cnvec, not the vectors of A. +// the list of vectors Ch of size Cnvec, not the vectors of A. // Compare this function with GB_ewise_slice, which constructs coarse/fine // tasks for the eWise operations (C=A+B, C=A.*B, and C=Z). +// The matrices C and A are sparse or hypersparse, but the matrices themselves +// do not appear in this method. + #define GB_FREE_WORKSPACE \ { \ GB_WERK_POP (Coarse, int64_t) ; \ - GB_FREE_WORK (&Cwork, Cwork_size) ; \ } #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ - GB_FREE_WORK (&Mark, Mark_size) ; \ - GB_FREE_WORK (&Inext, Inext_size) ; \ + GB_FREE_MEMORY (&Cwork, Cwork_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&Ihead, Ihead_size) ; \ + GB_FREE_MEMORY (&Inext, Inext_size) ; \ +} + +#define GB_RETURN_RESULTS \ +{ \ + (*p_TaskList ) = TaskList ; \ + (*p_TaskList_size) = TaskList_size ; \ + (*p_ntasks ) = ntasks ; \ + (*p_nthreads ) = nthreads ; \ + (*p_post_sort ) = post_sort ; \ + (*p_Ihead ) = Ihead ; \ + (*p_Ihead_size ) = Ihead_size ; \ + (*p_Inext ) = Inext ; \ + (*p_Inext_size ) = Inext_size ; \ + (*p_Ihead_is_32 ) = Ihead_is_32 ; \ + (*p_nduplicates ) = nduplicates ; \ + (*p_Cwork ) = Cwork ; \ + (*p_Cwork_size ) = Cwork_size ; \ } #include "extract/GB_subref.h" @@ -50,26 +70,31 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // output: GB_task_struct **p_TaskList, // array of structs size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads for subref operation - bool *p_post_sort, // true if a final post-sort is needed - int64_t *restrict *p_Mark, // for I inverse, if needed; size avlen - size_t *p_Mark_size, - int64_t *restrict *p_Inext, // for I inverse, if needed; size nI + int *p_ntasks, // # of tasks constructed + int *p_nthreads, // # of threads for subref operation + bool *p_post_sort, // true if a final post-sort is needed + void **p_Ihead, // for I inverse, if needed; size avlen + size_t *p_Ihead_size, + void **p_Inext, // for I inverse, if needed; size nI size_t *p_Inext_size, - int64_t *p_nduplicates, // # of duplicates, if I inverse computed + bool *p_Ihead_is_32, // if true, Ihead and Inext are 32-bit; else 64 + int64_t *p_nduplicates, // # of duplicates, if I inverse computed + uint64_t **p_Cwork, // workspace of size max(2,C->nvec+1) + size_t *p_Cwork_size, // from phase0: - const int64_t *restrict Ap_start, // location of A(imin:imax,kA) - const int64_t *restrict Ap_end, - const int64_t Cnvec, // # of vectors of C - const bool need_qsort, // true if C must be sorted - const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE or GB_LIST - const int64_t nI, // length of I - const int64_t Icolon [3], // for GB_RANGE and GB_STRIDE + const void *Ap_start, // location of A(imin:imax,kA) + const void *Ap_end, + const int64_t Cnvec, // # of vectors of C + const bool need_qsort, // true if C must be sorted + const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE or GB_LIST + const int64_t nI, // length of I + const int64_t Icolon [3], // for GB_RANGE and GB_STRIDE // original input: - const int64_t avlen, // A->vlen - const int64_t anz, // nnz (A) - const GrB_Index *I, + const int64_t avlen, // A->vlen + const int64_t anz, // nnz (A) + const bool Ap_is_32, // if true, Ap_start/end are 32-bit; else 64 + const void *I, + const bool I_is_32, // if true, I is 32-bit; else 64 bit GB_Werk Werk ) { @@ -83,27 +108,40 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref ASSERT (p_ntasks != NULL) ; ASSERT (p_nthreads != NULL) ; ASSERT (p_post_sort != NULL) ; - ASSERT (p_Mark != NULL) ; + ASSERT (p_Ihead != NULL) ; + ASSERT (p_Ihead_size != NULL) ; ASSERT (p_Inext != NULL) ; + ASSERT (p_Inext_size != NULL) ; ASSERT (p_nduplicates != NULL) ; + ASSERT (p_Cwork != NULL) ; + ASSERT (p_Cwork_size != NULL) ; ASSERT ((Cnvec > 0) == (Ap_start != NULL)) ; ASSERT ((Cnvec > 0) == (Ap_end != NULL)) ; (*p_TaskList) = NULL ; (*p_TaskList_size) = 0 ; - (*p_Mark ) = NULL ; - (*p_Inext ) = NULL ; - - int64_t *restrict Mark = NULL ; size_t Mark_size = 0 ; - int64_t *restrict Inext = NULL ; size_t Inext_size = 0 ; - - int64_t *restrict Cwork = NULL ; size_t Cwork_size = 0 ; + (*p_Ihead) = NULL ; + (*p_Inext) = NULL ; + (*p_Ihead_is_32) = false ; + (*p_Cwork) = NULL ; + (*p_Ihead_size) = 0 ; + (*p_Inext_size) = 0 ; + (*p_Cwork_size) = 0 ; + (*p_nduplicates) = 0 ; + + void *Ihead = NULL ; size_t Ihead_size = 0 ; + void *Inext = NULL ; size_t Inext_size = 0 ; + bool Ihead_is_32 = false ; + uint64_t *restrict Cwork = NULL ; size_t Cwork_size = 0 ; GB_WERK_DECLARE (Coarse, int64_t) ; // size ntasks1+1 int ntasks1 = 0 ; GrB_Info info ; + GB_IDECL (Ap_start, const, u) ; GB_IPTR (Ap_start, Ap_is_32) ; + GB_IDECL (Ap_end , const, u) ; GB_IPTR (Ap_end , Ap_is_32) ; + //-------------------------------------------------------------------------- // determine # of threads to use //-------------------------------------------------------------------------- @@ -153,7 +191,8 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // allocate workspace //-------------------------------------------------------------------------- - Cwork = GB_MALLOC_WORK (Cnvec+1, int64_t, &Cwork_size) ; + Cwork = GB_MALLOC_MEMORY (GB_IMAX (2, Cnvec+1), sizeof (uint64_t), + &Cwork_size) ; if (Cwork == NULL) { // out of memory @@ -173,10 +212,10 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref for (kC = 0 ; kC < Cnvec ; kC++) { // jC is the (kC)th vector of C = A(I,J) - // int64_t jC = GBH (Ch, kC) ; + // int64_t jC = GBh_C (Ch, kC) ; // but this is not needed // C(:,kC) = A(I,kA) will be constructed - int64_t pA = Ap_start [kC] ; - int64_t pA_end = Ap_end [kC] ; + int64_t pA = GB_IGET (Ap_start, kC) ; + int64_t pA_end = GB_IGET (Ap_end , kC) ; int64_t alen = pA_end - pA ; // nnz (A (imin:imax,j)) bool this_needs_I_inverse ; // true if this vector needs I inverse @@ -189,11 +228,13 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref Cwork [kC] = work ; } + Cwork [Cnvec] = 0 ; + //-------------------------------------------------------------------------- // replace Cwork with its cumulative sum //-------------------------------------------------------------------------- - GB_cumsum (Cwork, Cnvec, NULL, nthreads_for_Cwork, Werk) ; + GB_cumsum (Cwork, false, Cnvec, NULL, nthreads_for_Cwork, Werk) ; double cwork = (double) Cwork [Cnvec] ; //-------------------------------------------------------------------------- @@ -201,7 +242,7 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref //-------------------------------------------------------------------------- int nthreads = GB_nthreads (cwork, chunk, nthreads_max) ; - + int ntasks = 0 ; ntasks1 = (nthreads == 1) ? 1 : (32 * nthreads) ; double target_task_size = cwork / (double) (ntasks1) ; target_task_size = GB_IMAX (target_task_size, chunk) ; @@ -213,9 +254,9 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref int64_t nduplicates = 0 ; if (need_I_inverse) { - GB_OK (GB_I_inverse (I, nI, avlen, &Mark, &Mark_size, - &Inext, &Inext_size, &nduplicates, Werk)) ; - ASSERT (Mark != NULL) ; + GB_OK (GB_I_inverse (I, I_is_32, nI, avlen, &Ihead, &Ihead_size, + &Inext, &Inext_size, &Ihead_is_32, &nduplicates, Werk)) ; + ASSERT (Ihead != NULL) ; ASSERT (Inext != NULL) ; } @@ -228,19 +269,12 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // construct a single coarse task that computes all of C TaskList [0].kfirst = 0 ; TaskList [0].klast = Cnvec-1 ; + ntasks = (Cnvec == 0) ? 0 : 1 ; + nthreads = 1 ; // free workspace and return result GB_FREE_WORKSPACE ; - (*p_TaskList ) = TaskList ; - (*p_TaskList_size) = TaskList_size ; - (*p_ntasks ) = (Cnvec == 0) ? 0 : 1 ; - (*p_nthreads ) = 1 ; - (*p_post_sort ) = false ; - (*p_Mark ) = Mark ; - (*p_Mark_size ) = Mark_size ; - (*p_Inext ) = Inext ; - (*p_Inext_size ) = Inext_size ; - (*p_nduplicates) = nduplicates ; + GB_RETURN_RESULTS ; return (GrB_SUCCESS) ; } @@ -255,13 +289,12 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Cwork, Cnvec, ntasks1, false) ; + GB_p_slice (Coarse, Cwork, false, Cnvec, ntasks1, false) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine //-------------------------------------------------------------------------- - int ntasks = 0 ; bool I_has_duplicates = (nduplicates > 0) ; for (int t = 0 ; t < ntasks1 ; t++) @@ -366,8 +399,8 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // are sliced (of size alen). Three methods (1, 2, and 6) // iterate across all entries in I instead (of size nI). - int64_t pA = Ap_start [k] ; - int64_t pA_end = Ap_end [k] ; + int64_t pA = GB_IGET (Ap_start, k) ; + int64_t pA_end = GB_IGET (Ap_end , k) ; int64_t alen = pA_end - pA ; // nnz (A (imin:imax,j)) int method = GB_subref_method (alen, avlen, Ikind, nI, @@ -438,7 +471,8 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref TaskList [ntasks].pM_end = -1 ; // flag the task that does the post sort - TaskList [ntasks].len = (tfine == 0 && method == 10) ; + bool do_post_sort = (tfine == 0 && method == 10) ; + TaskList [ntasks].len = do_post_sort ; ntasks++ ; } } @@ -453,16 +487,7 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - (*p_TaskList ) = TaskList ; - (*p_TaskList_size) = TaskList_size ; - (*p_ntasks ) = ntasks ; - (*p_nthreads ) = nthreads ; - (*p_post_sort ) = post_sort ; - (*p_Mark ) = Mark ; - (*p_Mark_size ) = Mark_size ; - (*p_Inext ) = Inext ; - (*p_Inext_size ) = Inext_size ; - (*p_nduplicates) = nduplicates ; + GB_RETURN_RESULTS ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/extract/GrB_Col_extract.c b/GraphBLAS/Source/extract/GrB_Col_extract.c index 8940a31b27..90ea270154 100644 --- a/GraphBLAS/Source/extract/GrB_Col_extract.c +++ b/GraphBLAS/Source/extract/GrB_Col_extract.c @@ -2,7 +2,7 @@ // GrB_Col_extract: w = accum (w, A(I,j)) or A(j,I)' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,39 +15,41 @@ #include "extract/GB_extract.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) or (A(j,I))' +GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) ( - GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - GrB_Index j, // column index - const GrB_Descriptor desc // descriptor for w, M, and A + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const uint64_t *I, // row indices (64-bit) + uint64_t ni, // number of row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Col_extract (w, M, accum, A, I, ni, j, desc)") ; + GB_WHERE3 (w, mask, A, + "GrB_Col_extract (w, M, accum, A, I, ni, j, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_extract") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + ASSERT (GB_VECTOR_OK (w)) ; - ASSERT (GB_IMPLIES (M_in != NULL, GB_VECTOR_OK (M_in))) ; + ASSERT (GB_IMPLIES (mask != NULL, GB_VECTOR_OK (mask))) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; - GrB_Index ancols = (A_transpose ? GB_NROWS (A) : GB_NCOLS (A)) ; + uint64_t ancols = (A_transpose ? GB_NROWS (A) : GB_NCOLS (A)) ; if (j >= ancols) { GB_ERROR (GrB_INVALID_INDEX, @@ -60,7 +62,7 @@ GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) or (A(j,I))' //-------------------------------------------------------------------------- // construct the column index list J = [ j ] of length nj = 1 - GrB_Index J [1] ; + uint64_t J [1] ; J [0] = j ; //-------------------------------------------------------------------------- @@ -72,8 +74,8 @@ GrB_Info GrB_Col_extract // w = accum (w, A(I,j)) or (A(j,I))' M, Mask_comp, Mask_struct, // mask and its descriptor accum, // optional accum for z=accum(w,t) A, A_transpose, // A and its descriptor - I, ni, // row indices I and length ni - J, 1, // one column index, nj = 1 + I, false, ni, // row indices I and length ni (64-bit) + J, false, 1, // one column index, nj = 1 (64-bit) Werk) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/extract/GrB_Matrix_extract.c b/GraphBLAS/Source/extract/GrB_Matrix_extract.c index 667d9a084d..b727cc0720 100644 --- a/GraphBLAS/Source/extract/GrB_Matrix_extract.c +++ b/GraphBLAS/Source/extract/GrB_Matrix_extract.c @@ -2,7 +2,7 @@ // GrB_Matrix_extract: C = accum (C, A(I,J)) or A(J,I)' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,17 +10,17 @@ #include "extract/GB_extract.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) +GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) ( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_Matrix A, // first input: matrix A - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Index *J, // column indices - GrB_Index nj, // number of column indices - const GrB_Descriptor desc // descriptor for C, M, and A + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const uint64_t *I, // row indices (64-bit) + uint64_t ni, // number of row indices + const uint64_t *J, // column indices (64-bit) + uint64_t nj, // number of column indices + const GrB_Descriptor desc // descriptor for C, M, and A ) { @@ -28,18 +28,19 @@ GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_extract (C, M, accum, A, I, ni, J, nj, desc)") ; + GB_WHERE3 (C, Mask, A, + "GrB_Matrix_extract (C, M, accum, A, I, ni, J, nj, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_extract") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- // do the work in GB_extract @@ -50,8 +51,8 @@ GrB_Info GrB_Matrix_extract // C = accum (C, A(I,J)) M, Mask_comp, Mask_struct, // mask and its descriptor accum, // optional accum for Z=accum(C,T) A, A_transpose, // A and its descriptor - I, ni, // row indices - J, nj, // column indices + I, false, ni, // row indices (64-bit) + J, false, nj, // column indices (64-bit) Werk) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/extract/GrB_Vector_extract.c b/GraphBLAS/Source/extract/GrB_Vector_extract.c index 34c1ffb880..a179659dd7 100644 --- a/GraphBLAS/Source/extract/GrB_Vector_extract.c +++ b/GraphBLAS/Source/extract/GrB_Vector_extract.c @@ -2,7 +2,7 @@ // GrB_Vector_extract: w = accum (w, u(I)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,15 +10,15 @@ #include "extract/GB_extract.h" #include "mask/GB_get_mask.h" -GrB_Info GrB_Vector_extract // w = accum (w, u(I)) +GrB_Info GrB_Vector_extract // w = accum (w, u(I)) ( GrB_Vector w, // input/output vector for results - const GrB_Vector M_in, // optional mask for w, unused if NULL + const GrB_Vector mask, // optional mask for w, unused if NULL const GrB_BinaryOp accum, // optional accum for z=accum(w,t) const GrB_Vector u, // first input: vector u - const GrB_Index *I, // row indices - GrB_Index ni, // number of row indices - const GrB_Descriptor desc // descriptor for w and M + const uint64_t *I, // row indices (64-bit) + uint64_t ni, // number of row indices + const GrB_Descriptor desc // descriptor for w and mask ) { @@ -26,13 +26,15 @@ GrB_Info GrB_Vector_extract // w = accum (w, u(I)) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_extract (w, M, accum, u, I, ni, desc)") ; + GB_WHERE3 (w, mask, u, + "GrB_Vector_extract (w, M, accum, u, I, ni, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_extract") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + ASSERT (GB_VECTOR_OK (w)) ; - ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; ASSERT (GB_VECTOR_OK (u)) ; // get the descriptor @@ -40,7 +42,7 @@ GrB_Info GrB_Vector_extract // w = accum (w, u(I)) xx1, xx2, xx3, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- // extract entries @@ -62,8 +64,8 @@ GrB_Info GrB_Vector_extract // w = accum (w, u(I)) M, Mask_comp, Mask_struct, // mask and its descriptor accum, // optional accum for z=accum(w,t) (GrB_Matrix) u, false, // u as matrix; never transposed - I, ni, // row indices I and length ni - GrB_ALL, 1, // all columns + I, false, ni, // row indices I and length ni (64-bit) + GrB_ALL, false, 1, // all columns (64-bit) Werk) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/extract/GxB_Col_extract_Vector.c b/GraphBLAS/Source/extract/GxB_Col_extract_Vector.c new file mode 100644 index 0000000000..fcd56c6142 --- /dev/null +++ b/GraphBLAS/Source/extract/GxB_Col_extract_Vector.c @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// GxB_Col_extract_Vector: w = accum (w, A(I,j)) or A(j,I)' +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Extract a single row or column from a matrix. Note that in the +// GraphBLAS spec, row and column vectors are indistinguishable. In this +// implementation, both are the same as an n-by-1 GrB_Matrix, except with +// restrictions on the matrix operations that can be performed on them. + +#include "extract/GB_extract.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Col_extract_Vector // w = accum (w, A(I,j)) +( + GrB_Vector w, // input/output matrix for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + uint64_t j, // column index + const GrB_Descriptor desc // descriptor for w, mask, and A +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, mask, A, I_vector, + "GxB_Col_extract_Vector (w, M, accum, A, I, j, desc)") ; + GB_BURBLE_START ("GrB_extract") ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (GB_IMPLIES (mask != NULL, GB_VECTOR_OK (mask))) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_transpose, xx1, xx2, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + uint64_t ancols = (A_transpose ? GB_NROWS (A) : GB_NCOLS (A)) ; + if (j >= ancols) + { + GB_ERROR (GrB_INVALID_INDEX, + "Column index j=" GBu " out of bounds; must be < " GBu , + j, ancols) ; + } + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // extract the jth column (or jth row if A is transposed) using GB_extract + //-------------------------------------------------------------------------- + + // construct the column index list J = [ j ] of length nj = 1 + uint64_t J [1] ; + J [0] = j ; + + //-------------------------------------------------------------------------- + // do the work in GB_extract + //-------------------------------------------------------------------------- + + GB_OK (GB_extract ( + (GrB_Matrix) w, C_replace, // w as a matrix, and descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // optional accum for z=accum(w,t) + A, A_transpose, // A and its descriptor + I, I_is_32, ni, // row indices + J, false, 1, // one column index, nj = 1 (64-bit) + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/extract/GxB_Matrix_extract_Vector.c b/GraphBLAS/Source/extract/GxB_Matrix_extract_Vector.c new file mode 100644 index 0000000000..62c3082f0e --- /dev/null +++ b/GraphBLAS/Source/extract/GxB_Matrix_extract_Vector.c @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_extract_Vector: C = accum (C, A(I,J)) or A(J,I)' +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "extract/GB_extract.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; \ + if (J_size > 0) GB_FREE_MEMORY (&J, J_size) ; + +GrB_Info GxB_Matrix_extract_Vector // C = accum (C, A(I,J)) +( + GrB_Matrix C, // input/output matrix for results + const GrB_Matrix Mask, // optional mask for C, unused if NULL + const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) + const GrB_Matrix A, // first input: matrix A + const GrB_Vector I_vector, // row indices + const GrB_Vector J_vector, // column indices + const GrB_Descriptor desc // descriptor for C, M, and A +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE5 (C, Mask, A, I_vector, J_vector, + "GxB_Matrix_extract_Vector (C, M, accum, A, I, J, desc)") ; + GB_BURBLE_START ("GrB_extract") ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + A_transpose, xx1, xx2, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vectors + //-------------------------------------------------------------------------- + + void *I = NULL, *J = NULL ; + size_t I_size = 0, J_size = 0 ; + int64_t ni = 0, nj = 0 ; + GrB_Type I_type = NULL, J_type = NULL ; + GB_OK (GB_ijxvector (I_vector, false, 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + GB_OK (GB_ijxvector (J_vector, false, 1, desc, false, + &J, &nj, &J_size, &J_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + bool J_is_32 = (J_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // do the work in GB_extract + //-------------------------------------------------------------------------- + + GB_OK (GB_extract ( + C, C_replace, // output matrix C and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // optional accum for Z=accum(C,T) + A, A_transpose, // A and its descriptor + I, I_is_32, ni, // row indices + J, J_is_32, nj, // column indices + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/extract/GxB_Vector_extract_Vector.c b/GraphBLAS/Source/extract/GxB_Vector_extract_Vector.c new file mode 100644 index 0000000000..59dff5c3e4 --- /dev/null +++ b/GraphBLAS/Source/extract/GxB_Vector_extract_Vector.c @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_extract_Vector: w = accum (w, u(I)) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "extract/GB_extract.h" +#include "mask/GB_get_mask.h" +#include "ij/GB_ij.h" +#define GB_FREE_ALL \ + if (I_size > 0) GB_FREE_MEMORY (&I, I_size) ; + +GrB_Info GxB_Vector_extract_Vector // w = accum (w, u(I)) +( + GrB_Vector w, // input/output vector for results + const GrB_Vector mask, // optional mask for w, unused if NULL + const GrB_BinaryOp accum, // optional accum for z=accum(w,t) + const GrB_Vector u, // first input: vector u + const GrB_Vector I_vector, // row indices + const GrB_Descriptor desc // descriptor for w and mask +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, mask, u, I_vector, + "GxB_Vector_extract_Vector (w, M, accum, u, I, desc)") ; + GB_BURBLE_START ("GrB_extract") ; + + ASSERT (GB_VECTOR_OK (w)) ; + ASSERT (mask == NULL || GB_VECTOR_OK (mask)) ; + ASSERT (GB_VECTOR_OK (u)) ; + + // get the descriptor + GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, + xx1, xx2, xx3, xx7) ; + + // get the mask + GrB_Matrix M = GB_get_mask ((GrB_Matrix) mask, &Mask_comp, &Mask_struct) ; + + //-------------------------------------------------------------------------- + // get the index vector + //-------------------------------------------------------------------------- + + void *I = NULL ; + size_t I_size = 0 ; + int64_t ni = 0 ; + GrB_Type I_type = NULL ; + GB_OK (GB_ijxvector (I_vector, (w == I_vector), 0, desc, false, + &I, &ni, &I_size, &I_type, Werk)) ; + bool I_is_32 = (I_type == GrB_UINT32) ; + + //-------------------------------------------------------------------------- + // do the work in GB_extract + //-------------------------------------------------------------------------- + + GB_OK (GB_extract ( + (GrB_Matrix) w, C_replace, // w as a matrix, and its descriptor + M, Mask_comp, Mask_struct, // mask and its descriptor + accum, // optional accum for z=accum(w,t) + (GrB_Matrix) u, false, // u as matrix; never transposed + I, I_is_32, ni, // row indices + GrB_ALL, false, 1, // all columns (64-bit) + Werk)) ; + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + + diff --git a/GraphBLAS/Source/extract/include/GB_subref_method.h b/GraphBLAS/Source/extract/include/GB_subref_method.h index c4d639b0ef..9d06cf9f23 100644 --- a/GraphBLAS/Source/extract/include/GB_subref_method.h +++ b/GraphBLAS/Source/extract/include/GB_subref_method.h @@ -2,7 +2,7 @@ // GB_subref_method.h: definitions of GB_subref_method and GB_subref_work //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/extract/template/GB_bitmap_subref_template.c b/GraphBLAS/Source/extract/template/GB_bitmap_subref_template.c index 9f90f467c9..319d444872 100644 --- a/GraphBLAS/Source/extract/template/GB_bitmap_subref_template.c +++ b/GraphBLAS/Source/extract/template/GB_bitmap_subref_template.c @@ -2,7 +2,7 @@ // GB_bitmap_subref_template: C = A(I,J) where A is bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,12 +11,13 @@ { - int64_t cnvals = 0 ; //-------------------------------------------------------------------------- // C = A(I,J) //-------------------------------------------------------------------------- + int64_t cnvals = 0 ; + if (GB_C_IS_BITMAP) { diff --git a/GraphBLAS/Source/extract/template/GB_subref_template.c b/GraphBLAS/Source/extract/template/GB_subref_template.c index 4040981d8d..442ba67ad6 100644 --- a/GraphBLAS/Source/extract/template/GB_subref_template.c +++ b/GraphBLAS/Source/extract/template/GB_subref_template.c @@ -2,7 +2,7 @@ // GB_subref_template: C = A(I,J) where C and A are sparse/hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,25 +12,16 @@ // constructs the pattern and values of C. There are 3 kinds of subref: // // symbolic: C(i,j) is the position of A(I(i),J(j)) in the matrix A, -// in this case, A can have zombies +// in this case, A can have zombies. +// C never has zombies, even if A does. // iso: C = A(I,J), extracting the pattern only, not the values -// numeric: C = A(I,J), extracting the pattern and values, - -#if defined ( GB_SYMBOLIC ) - - // symbolic method must tolerate zombies - #define GB_Ai(p) GBI_UNZOMBIE (Ai, p, avlen) - -#else - - // iso and non-iso numeric methods will not see any zombies - #define GB_Ai(p) GBI_A (Ai, p, avlen) - -#endif +// numeric: C = A(I,J), extracting the pattern and values // to iterate across all entries in a bucket: -#define GB_for_each_index_in_bucket(inew,i) \ - for (int64_t inew = Mark [i] - 1 ; inew >= 0 ; inew = Inext [inew]) +#define GB_for_each_index_in_bucket(inew,i,nI,Ihead,Inext) \ + for (uint64_t inew = GB_IGET (Ihead, i) ; \ + inew < nI ; \ + inew = GB_IGET (Inext, inew)) //------------------------------------------------------------------------------ @@ -40,7 +31,7 @@ // get A and I //-------------------------------------------------------------------------- - const int64_t *restrict Ai = A->i ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int64_t avlen = A->vlen ; // these values are ignored if GB_I_KIND == GB_LIST @@ -51,6 +42,10 @@ int64_t iend = Icolon [GxB_END ] ; #endif + #ifndef GB_JIT_KERNEL + #define GB_Ai_IS_32 Ai_is_32 + #endif + //-------------------------------------------------------------------------- // phase1: count entries in each C(:,kC); phase2: compute C //-------------------------------------------------------------------------- @@ -78,8 +73,6 @@ int64_t pI_end = nI ; int64_t ilen = nI ; - ASSERT (0 <= kfirst && kfirst <= klast && klast < Cnvec) ; - //---------------------------------------------------------------------- // compute all vectors C(:,kfirst:klast) for this task //---------------------------------------------------------------------- @@ -91,6 +84,8 @@ // get C(:,kC) //------------------------------------------------------------------ + int64_t pA, pA_end ; + #if defined ( GB_ANALYSIS_PHASE ) // phase1 simply counts the # of entries in C(*,kC). int64_t clen = 0 ; @@ -103,14 +98,16 @@ // A fine task computes a slice of C(:,kC) pC = TaskList [taskid ].pC ; pC_end = TaskList [taskid+1].pC ; - ASSERT (Cp [kC] <= pC && pC <= pC_end && pC_end <= Cp [kC+1]) ; + ASSERT (GB_IGET (Cp, kC) <= pC) ; + ASSERT (pC <= pC_end) ; + ASSERT (pC_end <= GB_IGET (Cp, kC+1)) ; } else { // The vectors of C are never sliced for a coarse task, so this // task computes all of C(:,kC). - pC = Cp [kC] ; - pC_end = Cp [kC+1] ; + pC = GB_IGET (Cp, kC) ; + pC_end = GB_IGET (Cp, kC+1) ; } int64_t clen = pC_end - pC ; if (clen == 0) continue ; @@ -120,8 +117,6 @@ // get A(:,kA) //------------------------------------------------------------------ - int64_t pA, pA_end ; - if (fine_task) { // a fine task computes a slice of a single vector C(:,kC). @@ -138,12 +133,27 @@ // accesses all of A(imin:imax,kA), for most methods, or all of // A(:,kA) for methods 1 and 2. The vector A(*,kA) appears in // Ai,Ax [pA:pA_end-1]. - pA = Ap_start [kC] ; - pA_end = Ap_end [kC] ; + pA = GB_IGET (Ap_start, kC) ; + pA_end = GB_IGET (Ap_end , kC) ; } int64_t alen = pA_end - pA ; - if (alen == 0) continue ; + if (alen == 0) + { + #if defined ( GB_ANALYSIS_PHASE ) + if (fine_task) + { + // this fine task has no entries in A(:,kC) to access + TaskList [taskid].pC = 0 ; + } + else + { + // this course task has found that C(:,kC) is entirely empty + Cwork [kC] = 0 ; + } + #endif + continue ; + } //------------------------------------------------------------------ // get I @@ -175,7 +185,7 @@ { // determine the method based on A(*,kA) and I method = GB_subref_method (alen, avlen, GB_I_KIND, nI, - (Mark != NULL), GB_NEED_QSORT, iinc, GB_I_HAS_DUPLICATES) ; + (Ihead != NULL), GB_NEED_QSORT, iinc, GB_I_HAS_DUPLICATES) ; } //------------------------------------------------------------------ @@ -191,8 +201,8 @@ // A (:,kA) has not been sliced ASSERT (GB_I_KIND == GB_ALL) ; - ASSERT (pA == Ap_start [kC]) ; - ASSERT (pA_end == Ap_end [kC]) ; + ASSERT (pA == GB_IGET (Ap_start, kC)) ; + ASSERT (pA_end == GB_IGET (Ap_end , kC)) ; // copy the entire vector and construct indices #if defined ( GB_ANALYSIS_PHASE ) clen = ilen ; @@ -200,9 +210,13 @@ for (int64_t k = 0 ; k < ilen ; k++) { int64_t inew = k + pI ; - ASSERT (inew == GB_ijlist (I, inew, GB_I_KIND, Icolon)); - ASSERT (inew == GB_Ai (pA + inew)) ; - Ci [pC + k] = inew ; + ASSERT (inew == GB_IJLIST (I, inew, GB_I_KIND, Icolon)); + #ifdef GB_DEBUG + int64_t iA = GB_IGET (Ai, pA + inew) ; + iA = GB_UNZOMBIE (iA) ; + ASSERT (inew == iA) ; + #endif + GB_ISET (Ci, pC + k, inew) ; // Ci [pC + k] = inew ; } GB_COPY_RANGE (pC, pA + pI, ilen) ; #endif @@ -214,8 +228,8 @@ // This method handles any kind of list I, but A(:,kA) // must be dense. A(:,kA) has not been sliced. - ASSERT (pA == Ap_start [kC]) ; - ASSERT (pA_end == Ap_end [kC]) ; + ASSERT (pA == GB_IGET (Ap_start, kC)) ; + ASSERT (pA_end == GB_IGET (Ap_end , kC)) ; // scan I and get the entry in A(:,kA) via direct lookup #if defined ( GB_ANALYSIS_PHASE ) clen = ilen ; @@ -224,9 +238,15 @@ { // C(inew,kC) = A(i,kA), and it always exists. int64_t inew = k + pI ; - int64_t i = GB_ijlist (I, inew, GB_I_KIND, Icolon) ; - ASSERT (i == GB_Ai (pA + i)) ; - Ci [pC + k] = inew ; + #if defined ( GB_DEBUG ) || !defined ( GB_ISO_SUBREF ) + int64_t i = GB_IJLIST (I, inew, GB_I_KIND, Icolon) ; + #endif + #ifdef GB_DEBUG + int64_t iA = GB_IGET (Ai, pA + i) ; + iA = GB_UNZOMBIE (iA) ; + ASSERT (i == iA) ; + #endif + GB_ISET (Ci, pC + k, inew) ; // Ci [pC + k] = inew ; GB_COPY_ENTRY (pC + k, pA + i) ; } #endif @@ -243,14 +263,20 @@ // Time: 50x faster + #ifdef GB_DEBUG ASSERT (!fine_task) ; ASSERT (alen == 1) ; ASSERT (nI == 1) ; - ASSERT (GB_Ai (pA) == GB_ijlist (I, 0, GB_I_KIND, Icolon)) ; + int64_t i0 = GB_IJLIST (I, 0, GB_I_KIND, Icolon) ; + int64_t iA = GB_IGET (Ai, pA) ; + iA = GB_UNZOMBIE (iA) ; + ASSERT (iA == i0) ; + #endif + #if defined ( GB_ANALYSIS_PHASE ) clen = 1 ; #else - Ci [pC] = 0 ; + GB_ISET (Ci, pC, 0) ; // Ci [pC] = 0 ; GB_COPY_ENTRY (pC, pA) ; #endif break ; @@ -260,31 +286,36 @@ //-------------------------------------------------------------- // Time: 1x faster but low speedup on the Mac. Why? - // Probably memory bound since it is just memcpy's. ASSERT (GB_I_KIND == GB_ALL && ibegin == 0) ; #if defined ( GB_ANALYSIS_PHASE ) clen = alen ; #else #if defined ( GB_SYMBOLIC ) - if (nzombies == 0) - { - memcpy (Ci + pC, Ai + pA, alen * sizeof (int64_t)) ; - } - else + if (may_see_zombies) { - // with zombies + // with zombies in A for (int64_t k = 0 ; k < alen ; k++) { - // symbolic C(:,kC) = A(:,kA) where A has zombies - int64_t i = GB_Ai (pA + k) ; - ASSERT (i == GB_ijlist (I, i, GB_I_KIND, Icolon)) ; - Ci [pC + k] = i ; + // symbolic C(:,kC) = A(:,kA) where A has zombies; + // zombies in A are not tagged as zombies in C. + int64_t i = GB_IGET (Ai, pA + k) ; + i = GB_UNZOMBIE (i) ; + ASSERT (i == GB_IJLIST (I, i, GB_I_KIND, Icolon)) ; + GB_ISET (Ci, pC + k, i) ; // Ci [pC + k] = i ; } } - #else - memcpy (Ci + pC, Ai + pA, alen * sizeof (int64_t)) ; + else #endif + { + // without zombies in A + for (int64_t k = 0 ; k < alen ; k++) + { + int64_t i = GB_IGET (Ai, pA + k) ; + ASSERT (i == GB_IJLIST (I, i, GB_I_KIND, Icolon)) ; + GB_ISET (Ci, pC + k, i) ; // Ci [pC + k] = i ; + } + } GB_COPY_RANGE (pC, pA, alen) ; #endif break ; @@ -301,10 +332,13 @@ #else for (int64_t k = 0 ; k < alen ; k++) { - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif int64_t inew = i - ibegin ; - ASSERT (i == GB_ijlist (I, inew, GB_I_KIND, Icolon)) ; - Ci [pC + k] = inew ; + ASSERT (i == GB_IJLIST (I, inew, GB_I_KIND, Icolon)) ; + GB_ISET (Ci, pC + k, inew) ; // Ci [pC + k] = inew ; } GB_COPY_RANGE (pC, pA, alen) ; #endif @@ -332,8 +366,8 @@ // sort is needed. // A(:,kA) has not been sliced. - ASSERT (pA == Ap_start [kC]) ; - ASSERT (pA_end == Ap_end [kC]) ; + ASSERT (pA == GB_IGET (Ap_start, kC)) ; + ASSERT (pA_end == GB_IGET (Ap_end , kC)) ; // scan I, in order, and search for the entry in A(:,kA) for (int64_t k = 0 ; k < ilen ; k++) @@ -341,25 +375,30 @@ // C(inew,kC) = A (i,kA), if it exists. // i = I [inew] ; or from a colon expression int64_t inew = k + pI ; - int64_t i = GB_ijlist (I, inew, GB_I_KIND, Icolon) ; + int64_t i = GB_IJLIST (I, inew, GB_I_KIND, Icolon) ; bool found ; int64_t pleft = pA ; int64_t pright = pA_end - 1 ; #if defined ( GB_SYMBOLIC ) bool is_zombie ; - GB_BINARY_SEARCH_ZOMBIE (i, Ai, pleft, pright, found, - nzombies, is_zombie) ; + found = GB_binary_search_zombie (i, Ai, GB_Ai_IS_32, + &pleft, &pright, may_see_zombies, &is_zombie) ; #else - GB_BINARY_SEARCH (i, Ai, pleft, pright, found) ; + found = GB_binary_search (i, Ai, GB_Ai_IS_32, + &pleft, &pright) ; #endif if (found) { - ASSERT (i == GB_Ai (pleft)) ; + #ifdef GB_DEBUG + int64_t iA = GB_IGET (Ai, pleft) ; + iA = GB_UNZOMBIE (iA) ; + ASSERT (i == iA) ; + #endif #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else ASSERT (pC < pC_end) ; - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pleft) ; pC++ ; #endif @@ -382,7 +421,10 @@ for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present; see if it is in ibegin:iinc:iend - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif ASSERT (ibegin <= i && i <= iend) ; i = i - ibegin ; if (i % iinc == 0) @@ -393,7 +435,7 @@ #else int64_t inew = i / iinc ; ASSERT (pC < pC_end) ; - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; #endif @@ -416,7 +458,10 @@ for (int64_t k = alen - 1 ; k >= 0 ; k--) { // A(i,kA) present; see if it is in ibegin:iinc:iend - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif ASSERT (iend <= i && i <= ibegin) ; i = ibegin - i ; if (i % inc == 0) @@ -427,7 +472,7 @@ #else int64_t inew = i / inc ; ASSERT (pC < pC_end) ; - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; #endif @@ -451,10 +496,13 @@ for (int64_t k = alen - 1 ; k >= 0 ; k--) { // A(i,kA) is present - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif int64_t inew = (ibegin - i) ; - ASSERT (i == GB_ijlist (I, inew, GB_I_KIND, Icolon)) ; - Ci [pC] = inew ; + ASSERT (i == GB_IJLIST (I, inew, GB_I_KIND, Icolon)) ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; } @@ -477,17 +525,20 @@ for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif // traverse bucket i for all indices inew where // i == I [inew] or where i is from a colon expression - GB_for_each_index_in_bucket (inew, i) + GB_for_each_index_in_bucket (inew, i, nI, Ihead, Inext) { ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); + ASSERT (i == GB_IJLIST (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; #endif @@ -505,16 +556,9 @@ // the sort can be done now. The sort for vectors // handled by multiple fine tasks must wait until all // task are completed, below in the post sort. - pC = Cp [kC] ; - - #if defined ( GB_ISO_SUBREF ) - // iso numeric subref C=A(I,J) - // just sort the pattern of C(:,kC) - GB_qsort_1 (Ci + pC, clen) ; - #else - // sort the pattern of C(:,kC), and the values + pC = GB_IGET (Cp, kC) ; + // sort C(:,kC) GB_QSORT_1B (Ci, Cx, pC, clen) ; - #endif } #endif break ; @@ -532,17 +576,20 @@ for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif // traverse bucket i for all indices inew where // i == I [inew] or where i is from a colon expression - GB_for_each_index_in_bucket (inew, i) + GB_for_each_index_in_bucket (inew, i, nI, Ihead, Inext) { ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); + ASSERT (i == GB_IJLIST (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; #endif @@ -566,18 +613,20 @@ for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets - int64_t i = GB_Ai (pA + k) ; + int64_t i = GB_IGET (Ai, pA + k) ; + #if defined ( GB_SYMBOLIC ) + i = GB_UNZOMBIE (i) ; + #endif // bucket i has at most one index inew such that // i == I [inew] - int64_t inew = Mark [i] - 1 ; - if (inew >= 0) + uint64_t inew = GB_IGET (Ihead, i) ; + if (inew < nI) { - ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); + ASSERT (i == GB_IJLIST (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else - Ci [pC] = inew ; + GB_ISET (Ci, pC, inew) ; // Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; #endif @@ -605,7 +654,7 @@ } else { - Cp [kC] = clen ; + Cwork [kC] = clen ; } #endif } @@ -630,29 +679,35 @@ // This is the first fine task with method 10 for C(:,kC). // The vector C(:,kC) must be sorted, since method 10 left // it with unsorted indices. - int64_t pC = Cp [kC] ; - int64_t clen = Cp [kC+1] - pC ; - #if defined ( GB_ISO_SUBREF ) - { - // iso numeric subref C=A(I,J) - // just sort the pattern of C(:,kC) - GB_qsort_1 (Ci + pC, clen) ; - } - #else - { - // sort the pattern of C(:,kC), and the values - GB_QSORT_1B (Ci, Cx, pC, clen) ; - } - #endif + int64_t pC = GB_IGET (Cp, kC) ; + int64_t clen = GB_IGET (Cp, kC+1) - pC ; + // sort C(:,kC) + GB_QSORT_1B (Ci, Cx, pC, clen) ; } } } } #endif + //-------------------------------------------------------------------------- + // ensure all of Cwork has been computed + //-------------------------------------------------------------------------- + + #ifdef GB_DEBUG + // In debug mode, GB_subref_phase2 sets Cwork [0:Cnvec] = UINT64_MAX, + // tagging its contents as undefined. It then clears Cwork [kC] for all + // fine tasks. Course tasks set Cwork [kfirst:klast] for all the vectors + // C (:,kfirst:klast). Together, this ensures that all Cwork [0:Cnvec-1] + // has been computed. + #if defined ( GB_ANALYSIS_PHASE ) + for (int64_t kC = 0 ; kC < Cnvec ; kC++) + { + ASSERT (Cwork [kC] != UINT64_MAX) ; + } + #endif + #endif } -#undef GB_Ai #undef GB_for_each_index_in_bucket #undef GB_COPY_RANGE #undef GB_COPY_ENTRY diff --git a/GraphBLAS/Source/extractTuples/GB_extractTuples.c b/GraphBLAS/Source/extractTuples/GB_extractTuples.c index 084f92cf75..f6ee7815df 100644 --- a/GraphBLAS/Source/extractTuples/GB_extractTuples.c +++ b/GraphBLAS/Source/extractTuples/GB_extractTuples.c @@ -2,7 +2,7 @@ // GB_extractTuples: extract all the tuples from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,21 +18,24 @@ // If A is iso and X is not NULL, the iso scalar Ax [0] is expanded into X. +// FUTURE: pass in parameters I_offset and J_offset to add to I and J + #include "GB.h" #include "extractTuples/GB_extractTuples.h" #define GB_FREE_ALL \ { \ - GB_Matrix_free (&T) ; \ - GB_FREE_WORK (&Cp, Cp_size) ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ } GrB_Info GB_extractTuples // extract all tuples from a matrix ( - GrB_Index *I_out, // array for returning row indices of tuples - GrB_Index *J_out, // array for returning col indices of tuples + void *I_out, // array for returning row indices of tuples + bool I_is_32_out, // if true, I is 32-bit; else 64 bit + void *J_out, // array for returning col indices of tuples + bool J_is_32_out, // if true, J is 32-bit; else 64 bit void *X, // array for returning values of tuples - GrB_Index *p_nvals, // I,J,X size on input; # tuples on output + uint64_t *p_nvals, // I,J,X size on input; # tuples on output const GrB_Type xtype, // type of array X const GrB_Matrix A, // matrix to extract tuples from GB_Werk Werk @@ -44,10 +47,7 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix //-------------------------------------------------------------------------- GrB_Info info ; - struct GB_Matrix_opaque T_header ; - GrB_Matrix T = NULL ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - + void *Cp = NULL ; size_t Cp_size = 0 ; ASSERT_MATRIX_OK (A, "A to extract", GB0) ; ASSERT_TYPE_OK (xtype, "xtype to extract", GB0) ; ASSERT (p_nvals != NULL) ; @@ -89,16 +89,21 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix // handle the CSR/CSC format //-------------------------------------------------------------------------- - GrB_Index *I, *J ; + void *I, *J ; + bool I_is_32, J_is_32 ; if (A->is_csc) { I = I_out ; J = J_out ; + I_is_32 = I_is_32_out ; + J_is_32 = J_is_32_out ; } else { I = J_out ; J = I_out ; + I_is_32 = J_is_32_out ; + J_is_32 = I_is_32_out ; } //-------------------------------------------------------------------------- @@ -112,7 +117,9 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix // allocate workspace //---------------------------------------------------------------------- - Cp = GB_MALLOC_WORK (A->vdim+1, int64_t, &Cp_size) ; + bool Cp_is_32 = GB_determine_p_is_32 (true, anz) ; // OK + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Cp = GB_MALLOC_MEMORY (A->vdim+1, cpsize, &Cp_size) ; if (Cp == NULL) { // out of memory @@ -127,8 +134,12 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix // Extract the pattern and the values, typecasting if needed. If A is // iso or X is NULL, GB_convert_b2s only does the symbolic work. - GB_OK (GB_convert_b2s (Cp, (int64_t *) I, (int64_t *) J, - (GB_void *) X, NULL, xtype, A, Werk)) ; + // FUTURE: either extract the tuples directly from the bitmap, without + // the need for Cp, or revise GB_convert_b2s to take in offsets + // to add to I and J. + + GB_OK (GB_convert_b2s (Cp, I, J, (GB_void *) X, NULL, + Cp_is_32, I_is_32, J_is_32, xtype, A, Werk)) ; if (A->iso && X != NULL) { @@ -154,6 +165,7 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix if (I != NULL) { + GB_IDECL (I, , u) ; GB_IPTR (I, I_is_32) ; if (A->i == NULL) { // A is full; construct the row indices @@ -162,12 +174,18 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix #pragma omp parallel for num_threads(nthreads) schedule(static) for (p = 0 ; p < anz ; p++) { - I [p] = (p % avlen) ; + int64_t i = (p % avlen) ; + // I [p] = i ; + GB_ISET (I, p, i) ; } } else { - GB_memcpy (I, A->i, anz * sizeof (int64_t), nthreads) ; + // A is sparse or hypersparse; copy/cast A->i into I + GB_cast_int ( + I, I_is_32 ? GB_UINT32_code : GB_UINT64_code, + A->i, A->i_is_32 ? GB_UINT32_code : GB_UINT64_code, + anz, nthreads_max) ; } } @@ -176,8 +194,8 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix //---------------------------------------------------------------------- if (J != NULL) - { - GB_OK (GB_extract_vector_list ((int64_t *) J, A, Werk)) ; + { + GB_OK (GB_extract_vector_list (J, J_is_32, A, Werk)) ; } //---------------------------------------------------------------------- @@ -211,7 +229,7 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix } //-------------------------------------------------------------------------- - // free workspace and return result + // free workspace and return result //-------------------------------------------------------------------------- *p_nvals = anz ; // number of tuples extracted diff --git a/GraphBLAS/Source/extractTuples/GB_extractTuples.h b/GraphBLAS/Source/extractTuples/GB_extractTuples.h index c7f515f2ac..5fa1749c71 100644 --- a/GraphBLAS/Source/extractTuples/GB_extractTuples.h +++ b/GraphBLAS/Source/extractTuples/GB_extractTuples.h @@ -2,7 +2,7 @@ // GB_extractTuples.h: definitions for GB_extractTuples and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,25 +10,37 @@ #ifndef GB_EXTRACTTUPLES_H #define GB_EXTRACTTUPLES_H -GrB_Info GB_extract_vector_list // extract vector list from a matrix +#include "GB.h" + +GrB_Info GB_extract_vector_list // extract vector list from a matrix ( // output: - int64_t *restrict J, // size nnz(A) or more + void *J, // size nnz(A) or more // input: + bool is_32, // if true, J is 32-bit; else 64-bit const GrB_Matrix A, GB_Werk Werk ) ; GrB_Info GB_extractTuples // extract all tuples from a matrix ( - GrB_Index *I_out, // array for returning row indices of tuples - GrB_Index *J_out, // array for returning col indices of tuples + void *I_out, // array for returning row indices of tuples + bool I_is_32, // if true, I is 32-bit; else 64 bit + void *J_out, // array for returning col indices of tuples + bool J_is_32, // if true, J is 32-bit; else 64 bit void *X, // array for returning values of tuples - GrB_Index *p_nvals, // I,J,X size on input; # tuples on output + uint64_t *p_nvals, // I,J,X size on input; # tuples on output const GrB_Type xtype, // type of array X const GrB_Matrix A, // matrix to extract tuples from GB_Werk Werk ) ; +GrB_Info GB_extractTuples_prep +( + GrB_Vector V, // an output vector for I, J, or X + uint64_t nvals, // # of values V must hold + const GrB_Type vtype // desired type of V +) ; + #endif diff --git a/GraphBLAS/Source/extractTuples/GB_extractTuples_prep.c b/GraphBLAS/Source/extractTuples/GB_extractTuples_prep.c new file mode 100644 index 0000000000..48d0a6f06a --- /dev/null +++ b/GraphBLAS/Source/extractTuples/GB_extractTuples_prep.c @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// GB_extractTuples_prep: prepare an output GrB_Vector for extractTuples +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// GB_extractTuples_prep ensures that an output GrB_Vector for I, J, or X is +// dense, of size nvals-by-1, and the right type. + +#include "GB.h" +#include "extractTuples/GB_extractTuples.h" +#include "container/GB_container.h" + +GrB_Info GB_extractTuples_prep +( + GrB_Vector V, // an output vector for I, J, or X + uint64_t nvals, // # of values V must hold + const GrB_Type vtype // desired type of V +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (V == NULL) + { + // nothing to do; this component is not requested + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // quick return if V already has the right properties + //-------------------------------------------------------------------------- + + uint64_t required_size = nvals * vtype->size ; + if (GB_IS_FULL (V) && V->nvals == nvals && V->vlen == nvals && + V->type == vtype && !(V->x_shallow) && V->x_size >= required_size) + { + // nothing to do; the vector is already in the right format + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // remove V->x and free all other content + //-------------------------------------------------------------------------- + + void *Vx = V->x_shallow ? NULL : V->x ; + size_t Vx_size = V->x_shallow ? 0 : V->x_size ; + V->x = NULL ; + GB_phybix_free ((GrB_Matrix) V) ; + + //-------------------------------------------------------------------------- + // ensure Vx is large enough + //-------------------------------------------------------------------------- + + if (required_size > Vx_size) + { + // If Vx is not large enough, reallocate it. If Vx was initially not + // empty, it means the space is growing incrementally, so add 25% extra + // space for future growth. + GB_FREE_MEMORY (&Vx, Vx_size) ; + int64_t n = nvals + ((Vx_size == 0) ? 0 : (nvals / 4)) ; + Vx = GB_MALLOC_MEMORY (n, vtype->size, &Vx_size) ; + if (Vx == NULL) + { + return (GrB_OUT_OF_MEMORY) ; + } + } + + //-------------------------------------------------------------------------- + // load Vx back, to create V as a dense nvals-by-1 vector of type vtype + //-------------------------------------------------------------------------- + + GB_vector_load (V, &Vx, vtype, nvals, Vx_size, false) ; + ASSERT_VECTOR_OK (V, "V prepped", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/extractTuples/GB_extract_vector_list.c b/GraphBLAS/Source/extractTuples/GB_extract_vector_list.c index d5419834ad..2d5229aab8 100644 --- a/GraphBLAS/Source/extractTuples/GB_extract_vector_list.c +++ b/GraphBLAS/Source/extractTuples/GB_extract_vector_list.c @@ -2,7 +2,7 @@ // GB_extract_vector_list: extract vector indices for all entries in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,9 +11,11 @@ // Constructs a list of vector indices for each entry in a matrix. Creates // the output J for GB_extractTuples, and I for GB_transpose when the qsort -// method is used. +// method is used. The integers of J do not have to match the integers of +// A->h, but they must be at least as large. + +// FUTURE: pass in an offset to add to J -#include "slice/GB_ek_slice.h" #include "extractTuples/GB_extractTuples.h" #define GB_FREE_ALL \ @@ -21,11 +23,12 @@ GB_WERK_POP (A_ek_slicing, int64_t) ; \ } -GrB_Info GB_extract_vector_list // extract vector list from a matrix +GrB_Info GB_extract_vector_list // extract vector list from a matrix ( // output: - int64_t *restrict J, // size nnz(A) or more + void *J, // size nnz(A) or more // input: + bool is_32, // if true, J is 32-bit; else 64-bit const GrB_Matrix A, GB_Werk Werk ) @@ -42,13 +45,15 @@ GrB_Info GB_extract_vector_list // extract vector list from a matrix ASSERT (!GB_IS_BITMAP (A)) ; //-------------------------------------------------------------------------- - // get A + // get A and J //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; const int64_t avlen = A->vlen ; + GB_IDECL (J, , u) ; GB_IPTR (J, is_32) ; + //-------------------------------------------------------------------------- // determine the max number of threads to use //-------------------------------------------------------------------------- @@ -84,9 +89,9 @@ GrB_Info GB_extract_vector_list // extract vector list from a matrix // find the part of A(:,k) to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP (Ap, k, avlen), GBP (Ap, k+1, avlen)) ; + GBp_A (Ap, k, avlen), GBp_A (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // extract vector indices of A(:,j) @@ -94,7 +99,8 @@ GrB_Info GB_extract_vector_list // extract vector list from a matrix for (int64_t p = pA_start ; p < pA_end ; p++) { - J [p] = j ; + // J [p] = j ; + GB_ISET (J, p, j) ; } } } diff --git a/GraphBLAS/Source/extractTuples/GrB_Matrix_extractTuples.c b/GraphBLAS/Source/extractTuples/GrB_Matrix_extractTuples.c index b5c4b41c1b..0e377df981 100644 --- a/GraphBLAS/Source/extractTuples/GrB_Matrix_extractTuples.c +++ b/GraphBLAS/Source/extractTuples/GrB_Matrix_extractTuples.c @@ -2,61 +2,60 @@ // GrB_Matrix_extractTuples: extract all tuples from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Extracts all tuples from a matrix, like [I,J,X] = find (A). If any -// parameter I, J and/or X is NULL, then that component is not extracted. The -// size of the I, J, and X arrays (those that are not NULL) is given by nvals, -// which must be at least as large as GrB_nvals (&nvals, A). The values in the -// matrix are typecasted to the type of X, as needed. +// Extracts all tuples from a matrix, like [I,J,X] = find (A) in MATLAB. If +// any parameter I, J and/or X is NULL, then that component is not extracted. +// The size of the I, J, and X arrays (those that are not NULL) is given by +// nvals, which must be at least as large as GrB_nvals (&nvals, A). The values +// in the matrix are typecasted to the type of X, as needed. // If any parameter I, J, and/or X is NULL, that component is not extracted. -// So to extract just the row and col indices, pass I and J as non-NULL, -// and X as NULL. This is like [I,J,~] = find (A) in MATLAB. +// For example, to extract just the row and col indices, pass I and J as +// non-NULL, and X as NULL. This is like [I,J,~] = find (A) in MATLAB. // If A is iso and X is not NULL, the iso scalar Ax [0] is expanded into X. #include "GB.h" #include "extractTuples/GB_extractTuples.h" -#define GB_EXTRACT(prefix,type,T) \ -GrB_Info GB_EVAL3 (prefix, _Matrix_extractTuples_, T) \ -( \ - GrB_Index *I, /* array for returning row indices of tuples */ \ - GrB_Index *J, /* array for returning col indices of tuples */ \ - type *X, /* array for returning values of tuples */ \ - GrB_Index *p_nvals, /* I,J,X size on input; # tuples on output */ \ - const GrB_Matrix A /* matrix to extract tuples from */ \ -) \ -{ \ - GB_WHERE1 ("GrB_Matrix_extractTuples_" GB_STR(T) " (I, J, X, nvals, A)") ;\ - GB_BURBLE_START ("GrB_Matrix_extractTuples") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ - GB_RETURN_IF_NULL (p_nvals) ; \ - GrB_Info info = GB_extractTuples (I, J, X, p_nvals, prefix ## _ ## T, \ - A, Werk) ; \ - GB_BURBLE_END ; \ - GB_PRAGMA (omp flush) \ - return (info) ; \ +#define GB_EXTRACT_TUPLES(function_name,ctype,xtype) \ +GrB_Info function_name /* extract tuples from a matrix */ \ +( \ + uint64_t *I, /* array for returning row indices of tuples */ \ + uint64_t *J, /* array for returning col indices of tuples */ \ + ctype *X, /* array for returning values of tuples */ \ + uint64_t *p_nvals, /* I,J,X size on input; # tuples on output */ \ + const GrB_Matrix A /* matrix to extract tuples from */ \ +) \ +{ \ + GB_WHERE_1 (A, GB_STR(function_name) " (I, J, X, nvals, A)") ; \ + GB_RETURN_IF_NULL (A) ; \ + GB_RETURN_IF_NULL (p_nvals) ; \ + GB_BURBLE_START (GB_STR(function_name)) ; \ + info = GB_extractTuples (I, false, J, false, X, p_nvals, xtype, A, Werk);\ + GB_BURBLE_END ; \ + GB_PRAGMA (omp flush) \ + return (info) ; \ } -// prefix, C type of X, X type -GB_EXTRACT (GrB, bool , BOOL ) -GB_EXTRACT (GrB, int8_t , INT8 ) -GB_EXTRACT (GrB, uint8_t , UINT8 ) -GB_EXTRACT (GrB, int16_t , INT16 ) -GB_EXTRACT (GrB, uint16_t , UINT16 ) -GB_EXTRACT (GrB, int32_t , INT32 ) -GB_EXTRACT (GrB, uint32_t , UINT32 ) -GB_EXTRACT (GrB, int64_t , INT64 ) -GB_EXTRACT (GrB, uint64_t , UINT64 ) -GB_EXTRACT (GrB, float , FP32 ) -GB_EXTRACT (GrB, double , FP64 ) -GB_EXTRACT (GxB, GxB_FC32_t , FC32 ) -GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) +// with 64-bit I and J arrays +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_BOOL , bool , GrB_BOOL ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_INT8 , int8_t , GrB_INT8 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_INT16 , int16_t , GrB_INT16 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_INT32 , int32_t , GrB_INT32 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_INT64 , int64_t , GrB_INT64 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_UINT8 , uint8_t , GrB_UINT8 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_UINT16, uint16_t , GrB_UINT16) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_UINT32, uint32_t , GrB_UINT32) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_UINT64, uint64_t , GrB_UINT64) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_FP32 , float , GrB_FP32 ) +GB_EXTRACT_TUPLES (GrB_Matrix_extractTuples_FP64 , double , GrB_FP64 ) +GB_EXTRACT_TUPLES (GxB_Matrix_extractTuples_FC32 , GxB_FC32_t , GxB_FC32 ) +GB_EXTRACT_TUPLES (GxB_Matrix_extractTuples_FC64 , GxB_FC64_t , GxB_FC64 ) //------------------------------------------------------------------------------ // GrB_Matrix_extractTuples_UDT: extract from a matrix with user-defined type @@ -64,23 +63,24 @@ GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) GrB_Info GrB_Matrix_extractTuples_UDT ( - GrB_Index *I, // array for returning row indices of tuples - GrB_Index *J, // array for returning col indices of tuples + uint64_t *I, // array for returning row indices of tuples + uint64_t *J, // array for returning col indices of tuples void *X, // array for returning values of tuples - GrB_Index *p_nvals, // I,J,X size on input; # tuples on output + uint64_t *p_nvals, // I,J,X size on input; # tuples on output const GrB_Matrix A // matrix to extract tuples from ) { - GB_WHERE1 ("GrB_Matrix_extractTuples_UDT (I, J, X, nvals, A)") ; - GB_BURBLE_START ("GrB_Matrix_extractTuples") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_WHERE_1 (A, "GrB_Matrix_extractTuples_UDT (I, J, X, nvals, A)") ; + GB_RETURN_IF_NULL (A) ; GB_RETURN_IF_NULL (p_nvals) ; + GB_BURBLE_START ("GrB_Matrix_extractTuples_UDT") ; + if (A->type->code != GB_UDT_code) { // A must have a user-defined type return (GrB_DOMAIN_MISMATCH) ; } - GrB_Info info = GB_extractTuples (I, J, X, p_nvals, A->type, A, Werk) ; + info = GB_extractTuples (I, false, J, false, X, p_nvals, A->type, A, Werk) ; GB_BURBLE_END ; GB_PRAGMA (omp flush) return (info) ; diff --git a/GraphBLAS/Source/extractTuples/GrB_Vector_extractTuples.c b/GraphBLAS/Source/extractTuples/GrB_Vector_extractTuples.c index e2a5ae65fe..2dc9a33ede 100644 --- a/GraphBLAS/Source/extractTuples/GrB_Vector_extractTuples.c +++ b/GraphBLAS/Source/extractTuples/GrB_Vector_extractTuples.c @@ -2,61 +2,61 @@ // GrB_Vector_extractTuples: extract all tuples from a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Extracts all tuples from a column vector, like [I,~,X] = find (v). If any -// parameter I and/or X is NULL, then that component is not extracted. The -// size of the I and X arrays (those that are not NULL) is given by nvals, +// Extracts all tuples from a column vector, like [I,~,X] = find (v) in MATLAB. +// If any parameter I and/or X is NULL, then that component is not extracted. +// The size of the I and X arrays (those that are not NULL) is given by nvals, // which must be at least as large as GrB_nvals (&nvals, v). The values in the // vector are typecasted to the type of X, as needed. -// If any parameter I and/or X is NULL, that component is not extracted. So to -// extract just the row indices, pass I as non-NULL, and X as NULL. This is -// like [I,~,~] = find (v) in MATLAB. +// If any parameter I and/or X is NULL, that component is not extracted. For +// example, to extract just the row indices, pass I as non-NULL, and X as NULL. +// This is like [I,~,~] = find (v) in MATLAB. // If v is iso and X is not NULL, the iso scalar vx [0] is expanded into X. #include "GB.h" #include "extractTuples/GB_extractTuples.h" -#define GB_EXTRACT(prefix,type,T) \ -GrB_Info GB_EVAL3 (prefix, _Vector_extractTuples_, T) \ -( \ - GrB_Index *I, /* array for returning row indices of tuples */ \ - type *X, /* array for returning values of tuples */ \ - GrB_Index *p_nvals, /* I, X size on input; # tuples on output */ \ - const GrB_Vector v /* vector to extract tuples from */ \ -) \ -{ \ - GB_WHERE1 ("GrB_Vector_extractTuples_" GB_STR(T) " (I, X, nvals, v)") ; \ - GB_BURBLE_START ("GrB_Vector_extractTuples") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (v) ; \ - GB_RETURN_IF_NULL (p_nvals) ; \ - ASSERT (GB_VECTOR_OK (v)) ; \ - GrB_Info info = GB_extractTuples (I, NULL, X, p_nvals, prefix ## _ ## T, \ - (GrB_Matrix) v, Werk) ; \ - GB_BURBLE_END ; \ - GB_PRAGMA (omp flush) \ - return (info) ; \ +#define GB_EXTRACT_TUPLES(function_name,ctype,xtype) \ +GrB_Info function_name /* extract tuples from a vector */ \ +( \ + uint64_t *I, /* array for returning row indices of tuples */ \ + ctype *X, /* array for returning values of tuples */ \ + uint64_t *p_nvals, /* I, X size on input; # tuples on output */ \ + const GrB_Vector v /* vector to extract tuples from */ \ +) \ +{ \ + GB_WHERE_1 (v, GB_STR(function_name) " (I, X, nvals, v)") ; \ + GB_RETURN_IF_NULL (v) ; \ + GB_RETURN_IF_NULL (p_nvals) ; \ + GB_BURBLE_START (GB_STR(function_name)) ; \ + ASSERT (GB_VECTOR_OK (v)) ; \ + info = GB_extractTuples (I, false, NULL, false, X, p_nvals, xtype, \ + (GrB_Matrix) v, Werk) ; \ + GB_BURBLE_END ; \ + GB_PRAGMA (omp flush) \ + return (info) ; \ } -// prefix, C type of X, X type -GB_EXTRACT (GrB, bool , BOOL ) -GB_EXTRACT (GrB, int8_t , INT8 ) -GB_EXTRACT (GrB, uint8_t , UINT8 ) -GB_EXTRACT (GrB, int16_t , INT16 ) -GB_EXTRACT (GrB, uint16_t , UINT16 ) -GB_EXTRACT (GrB, int32_t , INT32 ) -GB_EXTRACT (GrB, uint32_t , UINT32 ) -GB_EXTRACT (GrB, int64_t , INT64 ) -GB_EXTRACT (GrB, uint64_t , UINT64 ) -GB_EXTRACT (GrB, float , FP32 ) -GB_EXTRACT (GrB, double , FP64 ) -GB_EXTRACT (GxB, GxB_FC32_t , FC32 ) -GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) +// with 64-bit I array +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_BOOL , bool , GrB_BOOL ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_INT8 , int8_t , GrB_INT8 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_INT16 , int16_t , GrB_INT16 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_INT32 , int32_t , GrB_INT32 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_INT64 , int64_t , GrB_INT64 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_UINT8 , uint8_t , GrB_UINT8 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_UINT16, uint16_t , GrB_UINT16) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_UINT32, uint32_t , GrB_UINT32) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_UINT64, uint64_t , GrB_UINT64) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_FP32 , float , GrB_FP32 ) +GB_EXTRACT_TUPLES (GrB_Vector_extractTuples_FP64 , double , GrB_FP64 ) +GB_EXTRACT_TUPLES (GxB_Vector_extractTuples_FC32 , GxB_FC32_t , GxB_FC32 ) +GB_EXTRACT_TUPLES (GxB_Vector_extractTuples_FC64 , GxB_FC64_t , GxB_FC64 ) //------------------------------------------------------------------------------ // GrB_Vector_extractTuples_UDT: extract from a vector with user-defined type @@ -64,23 +64,24 @@ GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) GrB_Info GrB_Vector_extractTuples_UDT ( - GrB_Index *I, // array for returning row indices of tuples + uint64_t *I, // array for returning row indices of tuples void *X, // array for returning values of tuples - GrB_Index *p_nvals, // I, X size on input; # tuples on output + uint64_t *p_nvals, // I, X size on input; # tuples on output const GrB_Vector v // vector to extract tuples from ) { - GB_WHERE1 ("GrB_Vector_extractTuples_UDT (I, X, nvals, v)") ; - GB_BURBLE_START ("GrB_Vector_extractTuples") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_WHERE_1 (v, "GrB_Vector_extractTuples_UDT (I, X, nvals, v)") ; + GB_RETURN_IF_NULL (v) ; GB_RETURN_IF_NULL (p_nvals) ; + GB_BURBLE_START ("GrB_Vector_extractTuples_UDT") ; + ASSERT (GB_VECTOR_OK (v)) ; if (v->type->code != GB_UDT_code) { // v must have a user-defined type return (GrB_DOMAIN_MISMATCH) ; } - GrB_Info info = GB_extractTuples (I, NULL, X, p_nvals, v->type, + info = GB_extractTuples (I, false, NULL, false, X, p_nvals, v->type, (GrB_Matrix) v, Werk) ; GB_BURBLE_END ; GB_PRAGMA (omp flush) diff --git a/GraphBLAS/Source/extractTuples/GxB_Matrix_extractTuples_Vector.c b/GraphBLAS/Source/extractTuples/GxB_Matrix_extractTuples_Vector.c new file mode 100644 index 0000000000..5a8f7451dc --- /dev/null +++ b/GraphBLAS/Source/extractTuples/GxB_Matrix_extractTuples_Vector.c @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// GxB_Matrix_extractTuples_Vector: extract all tuples from a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Extracts all tuples from a matrix, like [I,J,X] = find (A) in MATLAB. If +// any parameter I, J and/or X is NULL, then that component is not extracted. +// I, J, and X are GrB_Vectors, and on output they are dense vectors of +// length (nvals (A)), with types revised to match the content of A. +// +// X is returned with the same type A. I is returned as GrB_UINT32 if the # of +// rows of A is <= INT32_MAX, or GrB_UINT64 otherwise. J is returned as +// GrB_UINT32 if the # of columns of A is <= INT32_MAX, or GrB_UINT64 +// otherwise. + +// If any parameter I, J, and/or X is NULL, that component is not extracted. +// For example, to extract just the row and col indices, pass I and J as +// non-NULL, and X as NULL. This is like [I,J,~] = find (A) in MATLAB. + +// If A is iso and X is not NULL, the iso scalar Ax [0] is expanded into X. + +#include "GB.h" +#include "extractTuples/GB_extractTuples.h" +#define GB_FREE_ALL ; + +GrB_Info GxB_Matrix_extractTuples_Vector // [I,J,X] = find (A) +( + GrB_Vector I_vector, // row indices + GrB_Vector J_vector, // col indices + GrB_Vector X_vector, // values + const GrB_Matrix A, // matrix to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (I_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (J_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (X_vector) ; + GB_WHERE_4 (I_vector, J_vector, X_vector, A, + "GxB_Matrix_extractTuples_Vector (I, J, X, A, desc)") ; + GB_BURBLE_START ("GxB_Matrix_extractTuples_Vector") ; + ASSERT_MATRIX_OK (A, "A for GxB_Matrix_extractTuples_Vector", GB0) ; + + if ((I_vector != NULL && (I_vector == X_vector || I_vector == J_vector)) || + (J_vector != NULL && (J_vector == X_vector))) + { + return (GrB_NOT_IMPLEMENTED) ; // input vectors cannot be aliased + } + + //-------------------------------------------------------------------------- + // finish any pending work in A + //-------------------------------------------------------------------------- + + GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (A) ; + + //-------------------------------------------------------------------------- + // prepare the I, J, X vectors + //-------------------------------------------------------------------------- + + uint64_t nvals = GB_nnz (A) ; + int64_t nrows = GB_NROWS (A) ; + int64_t ncols = GB_NCOLS (A) ; + bool I_is_32 = (nrows <= INT32_MAX) ; + bool J_is_32 = (ncols <= INT32_MAX) ; + GrB_Type I_type = (I_is_32) ? GrB_UINT32 : GrB_UINT64 ; + GrB_Type J_type = (J_is_32) ? GrB_UINT32 : GrB_UINT64 ; + GrB_Type X_type = A->type ; + + GB_OK (GB_extractTuples_prep (I_vector, nvals, I_type)) ; + GB_OK (GB_extractTuples_prep (J_vector, nvals, J_type)) ; + GB_OK (GB_extractTuples_prep (X_vector, nvals, X_type)) ; + + void *I = (I_vector == NULL) ? NULL : I_vector->x ; + void *J = (J_vector == NULL) ? NULL : J_vector->x ; + void *X = (X_vector == NULL) ? NULL : X_vector->x ; + + //-------------------------------------------------------------------------- + // extract tuples into the I, J, X vectors + //-------------------------------------------------------------------------- + + GB_OK (GB_extractTuples (I, I_is_32, J, J_is_32, X, &nvals, X_type, A, + Werk)) ; + + //-------------------------------------------------------------------------- + // return results + //-------------------------------------------------------------------------- + + ASSERT_VECTOR_OK_OR_NULL (I_vector, "I: Matrix_extractTuples_Vector", GB0) ; + ASSERT_VECTOR_OK_OR_NULL (J_vector, "J: Matrix_extractTuples_Vector", GB0) ; + ASSERT_VECTOR_OK_OR_NULL (X_vector, "X: Matrix_extractTuples_Vector", GB0) ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/extractTuples/GxB_Vector_extractTuples_Vector.c b/GraphBLAS/Source/extractTuples/GxB_Vector_extractTuples_Vector.c new file mode 100644 index 0000000000..b14051c93e --- /dev/null +++ b/GraphBLAS/Source/extractTuples/GxB_Vector_extractTuples_Vector.c @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// GxB_Vector_extractTuples_Vector: extract all tuples from a vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Extracts all tuples from a column vector, like [I,~,X] = find (v) in MATLAB. +// If any parameter I and/or X is NULL, then that component is not extracted. +// I and X are GrB_Vectors, and on output they are dense vectors of +// length (nvals (V)), with types revised to match the content of V. +// +// X is returned with the same type V. I is returned as GrB_UINT32 if the +// length of V is <= INT32_MAX, or GrB_UINT64 otherwise. + +// If any parameter I and/or X is NULL, that component is not extracted. For +// example, to extract just the row indices, pass I as non-NULL, and X as NULL. +// This is like [I,~,~] = find (v) in MATLAB. + +// If v is iso and X is not NULL, the iso scalar vx [0] is expanded into X. + +#include "GB.h" +#include "extractTuples/GB_extractTuples.h" +#define GB_FREE_ALL ; + +GrB_Info GxB_Vector_extractTuples_Vector // [I,~,X] = find (V) +( + GrB_Vector I_vector, // row indices + GrB_Vector X_vector, // values + const GrB_Vector V, // vectors to extract tuples from + const GrB_Descriptor desc // currently unused; for future expansion +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_NULL (V) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (I_vector) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (X_vector) ; + GB_WHERE_3 (I_vector, X_vector, V, + "GxB_Vector_extractTuples_Vector (I, J, X, A, desc)") ; + GB_BURBLE_START ("GxB_Vector_extractTuples_Vector") ; + ASSERT_VECTOR_OK (V, "V for GxB_Vector_extractTuples_Vector", GB0) ; + + if (V == I_vector || V == X_vector || + (I_vector != NULL && I_vector == X_vector)) + { + return (GrB_NOT_IMPLEMENTED) ; // input vectors cannot be aliased + } + + //-------------------------------------------------------------------------- + // finish any pending work in V + //-------------------------------------------------------------------------- + + GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (V) ; + + //-------------------------------------------------------------------------- + // prepare the I, X vectors + //-------------------------------------------------------------------------- + + uint64_t nvals = GB_nnz ((GrB_Matrix) V) ; + int64_t nrows = V->vlen ; + bool I_is_32 = (nrows <= INT32_MAX) ; + GrB_Type I_type = (I_is_32) ? GrB_UINT32 : GrB_UINT64 ; + GrB_Type X_type = V->type ; + + GB_OK (GB_extractTuples_prep (I_vector, nvals, I_type)) ; + GB_OK (GB_extractTuples_prep (X_vector, nvals, X_type)) ; + + void *I = (I_vector == NULL) ? NULL : I_vector->x ; + void *X = (X_vector == NULL) ? NULL : X_vector->x ; + + //-------------------------------------------------------------------------- + // extract tuples into the I, X vectors + //-------------------------------------------------------------------------- + + GB_OK (GB_extractTuples (I, I_is_32, NULL, false, X, &nvals, X_type, + (GrB_Matrix) V, Werk)) ; + + //-------------------------------------------------------------------------- + // return results + //-------------------------------------------------------------------------- + + ASSERT_VECTOR_OK_OR_NULL (I_vector, "I: Vector_extractTuples_Vector", GB0) ; + ASSERT_VECTOR_OK_OR_NULL (X_vector, "X: Vector_extractTuples_Vector", GB0) ; + GB_BURBLE_END ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/gateway/GB_cuda_gateway.h b/GraphBLAS/Source/gateway/GB_cuda_gateway.h index 239b425a5b..764333fcd6 100644 --- a/GraphBLAS/Source/gateway/GB_cuda_gateway.h +++ b/GraphBLAS/Source/gateway/GB_cuda_gateway.h @@ -2,7 +2,7 @@ // GB_cuda_gateway.h: definitions for interface to GB_cuda_* functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2019, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -74,7 +74,7 @@ static inline int GB_ngpus_to_use else if (gpu_hack == 1) { // always use all available GPU(s) - // fixme for CUDA: allow 1 to gpu_count to be requested + // Fixme for CUDA: allow 1 to gpu_count to be requested return (gpu_count) ; } else @@ -210,9 +210,7 @@ bool GB_cuda_select_branch GrB_Info GB_cuda_select_bitmap ( - int8_t *Cb, - int64_t *cnvals, - const bool C_iso, + GrB_Matrix C, const GrB_Matrix A, const bool flipij, const GB_void *ythunk, @@ -226,7 +224,9 @@ GrB_Info GB_cuda_select_sparse const GrB_IndexUnaryOp op, const bool flipij, const GrB_Matrix A, - const GB_void *ythunk + const GB_void *athunk, + const GB_void *ythunk, + GB_Werk Werk ) ; bool GB_cuda_type_branch // return true if the type is OK on GPU diff --git a/GraphBLAS/Source/generic/GB_generic.h b/GraphBLAS/Source/generic/GB_generic.h index 0352fcd339..ee3403d456 100644 --- a/GraphBLAS/Source/generic/GB_generic.h +++ b/GraphBLAS/Source/generic/GB_generic.h @@ -2,7 +2,7 @@ // GB_generic.h: definitions for all generic methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_Descriptor_get.c b/GraphBLAS/Source/get_set/GB_Descriptor_get.c index a080b0a930..09bb354b2a 100644 --- a/GraphBLAS/Source/get_set/GB_Descriptor_get.c +++ b/GraphBLAS/Source/get_set/GB_Descriptor_get.c @@ -2,7 +2,7 @@ // GB_Descriptor_get: get the status of a descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,7 @@ GrB_Info GB_Descriptor_get // get the contents of a descriptor bool *Mask_struct, // if true use the structure of M bool *In0_transpose, // if true transpose first input bool *In1_transpose, // if true transpose second input - GrB_Desc_Value *AxB_method, // method for C=A*B + int *AxB_method, // method for C=A*B int *do_sort // if nonzero, sort in GrB_mxm ) { @@ -96,11 +96,11 @@ GrB_Info GB_Descriptor_get // get the contents of a descriptor //-------------------------------------------------------------------------- // default values if descriptor is NULL - GrB_Desc_Value C_desc = GxB_DEFAULT ; - GrB_Desc_Value Mask_desc = GxB_DEFAULT ; - GrB_Desc_Value In0_desc = GxB_DEFAULT ; - GrB_Desc_Value In1_desc = GxB_DEFAULT ; - GrB_Desc_Value AxB_desc = GxB_DEFAULT ; + int C_desc = GxB_DEFAULT ; + int Mask_desc = GxB_DEFAULT ; + int In0_desc = GxB_DEFAULT ; + int In1_desc = GxB_DEFAULT ; + int AxB_desc = GxB_DEFAULT ; int do_sort_desc = GxB_DEFAULT ; diff --git a/GraphBLAS/Source/get_set/GB_Descriptor_get.h b/GraphBLAS/Source/get_set/GB_Descriptor_get.h index a9c4545540..23ade3c911 100644 --- a/GraphBLAS/Source/get_set/GB_Descriptor_get.h +++ b/GraphBLAS/Source/get_set/GB_Descriptor_get.h @@ -2,7 +2,7 @@ // GB_Descriptor_get.h: definitions for GB_Descriptor_get //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ GrB_Info GB_Descriptor_get // get the contents of a descriptor bool *Mask_struct, // if true use the structure of M bool *In0_transpose, // if true transpose first input bool *In1_transpose, // if true transpose second input - GrB_Desc_Value *AxB_method, // method for C=A*B + int *AxB_method, // method for C=A*B int *do_sort // if nonzero, sort in GrB_mxm ) ; diff --git a/GraphBLAS/Source/get_set/GB_code_name_get.c b/GraphBLAS/Source/get_set/GB_code_name_get.c index 106aaaf6f3..65df796910 100644 --- a/GraphBLAS/Source/get_set/GB_code_name_get.c +++ b/GraphBLAS/Source/get_set/GB_code_name_get.c @@ -2,7 +2,7 @@ // GB_code_name_get: get the user_name of a type, from a code //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_desc_name_get.c b/GraphBLAS/Source/get_set/GB_desc_name_get.c index c40c222cd9..45ee762e7b 100644 --- a/GraphBLAS/Source/get_set/GB_desc_name_get.c +++ b/GraphBLAS/Source/get_set/GB_desc_name_get.c @@ -2,7 +2,7 @@ // GB_desc_name_get: get the name of a descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_get_set.h b/GraphBLAS/Source/get_set/GB_get_set.h index f60040a3c0..de7f520cec 100644 --- a/GraphBLAS/Source/get_set/GB_get_set.h +++ b/GraphBLAS/Source/get_set/GB_get_set.h @@ -2,7 +2,7 @@ // GB_get_set.h: definitions for GrB_get/set methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ struct GB_Global_opaque size_t header_size ; } ; -GrB_Type_Code GB_type_code_get // return the GrB_Type_Code for the code +int GB_type_code_get // return the GrB_Type_Code for the code ( const GB_Type_code code // type code to convert ) ; @@ -41,14 +41,14 @@ GrB_Info GB_matvec_set GB_Werk Werk ) ; -GrB_Info GB_op_enum_get (GB_Operator op, int32_t * value, GrB_Field field) ; -GrB_Info GB_op_scalar_get (GB_Operator op, GrB_Scalar value, GrB_Field field, +GrB_Info GB_op_enum_get (GB_Operator op, int32_t * value, int field) ; +GrB_Info GB_op_scalar_get (GB_Operator op, GrB_Scalar scalar, int field, GB_Werk Werk) ; -GrB_Info GB_op_string_get (GB_Operator op, char * value, GrB_Field field) ; -GrB_Info GB_op_size_get (GB_Operator op, size_t * value, GrB_Field field) ; +GrB_Info GB_op_string_get (GB_Operator op, char * value, int field) ; +GrB_Info GB_op_size_get (GB_Operator op, size_t * value, int field) ; const char *GB_op_name_get (GB_Operator op) ; -GrB_Info GB_op_string_set (GB_Operator op, char * value, GrB_Field field) ; +GrB_Info GB_op_string_set (GB_Operator op, char * value, int field) ; const char *GB_monoid_name_get (GrB_Monoid monoid) ; const char *GB_semiring_name_get (GrB_Semiring semiring) ; @@ -73,8 +73,8 @@ GrB_Info GB_op_or_type_string_set GrB_Info GB_monoid_get ( GrB_Monoid monoid, - GrB_Scalar value, - GrB_Field field, + GrB_Scalar scalar, + int field, GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/get_set/GB_matvec_enum_get.c b/GraphBLAS/Source/get_set/GB_matvec_enum_get.c index 2e9470e77e..5f03809691 100644 --- a/GraphBLAS/Source/get_set/GB_matvec_enum_get.c +++ b/GraphBLAS/Source/get_set/GB_matvec_enum_get.c @@ -2,7 +2,7 @@ // GB_matvec_enum_get: get an enum field from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,6 +33,16 @@ GrB_Info GB_matvec_enum_get (GrB_Matrix A, int32_t *value, int field) (*value) = GB_sparsity (A) ; break ; + case GxB_IS_READONLY : + + (*value) = GB_is_shallow (A) ; + break ; + + case GxB_ISO : + + (*value) = A->iso ; + break ; + case GxB_HYPER_HASH : (*value) = !(A->no_hyper_hash) ; @@ -43,6 +53,41 @@ GrB_Info GB_matvec_enum_get (GrB_Matrix A, int32_t *value, int field) (*value) = (A->is_csc) ? GxB_BY_COL : GxB_BY_ROW ; break ; + case GxB_OFFSET_INTEGER_HINT : + + (*value) = A->p_control ; + break ; + + case GxB_OFFSET_INTEGER_BITS : + + (*value) = (A->p_is_32) ? 32 : 64 ; + break ; + + case GxB_COLINDEX_INTEGER_HINT : + + (*value) = (A->is_csc) ? A->j_control : A->i_control ; + break ; + + case GxB_COLINDEX_INTEGER_BITS : + + (*value) = ((A->is_csc) ? A->j_is_32 : A->i_is_32) ? 32 : 64 ; + break ; + + case GxB_ROWINDEX_INTEGER_HINT : + + (*value) = (A->is_csc) ? A->i_control : A->j_control ; + break ; + + case GxB_ROWINDEX_INTEGER_BITS : + + (*value) = ((A->is_csc) ? A->i_is_32 : A->j_is_32) ? 32 : 64 ; + break ; + + case GxB_WILL_WAIT : + + (*value) = GB_ANY_PENDING_WORK (A) || GB_hyper_hash_need (A) ; + break ; + default : return (GrB_INVALID_VALUE) ; } diff --git a/GraphBLAS/Source/get_set/GB_matvec_name_get.c b/GraphBLAS/Source/get_set/GB_matvec_name_get.c index aba111807d..d0c9a99602 100644 --- a/GraphBLAS/Source/get_set/GB_matvec_name_get.c +++ b/GraphBLAS/Source/get_set/GB_matvec_name_get.c @@ -2,7 +2,7 @@ // GB_matvec_name_get: get a name of a matrix or its type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_matvec_name_set.c b/GraphBLAS/Source/get_set/GB_matvec_name_set.c index 4a89bef29b..9529ee1a91 100644 --- a/GraphBLAS/Source/get_set/GB_matvec_name_set.c +++ b/GraphBLAS/Source/get_set/GB_matvec_name_set.c @@ -2,7 +2,7 @@ // GB_matvec_name_set: set the user_name of a matrix/vector/scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_matvec_name_size_get.c b/GraphBLAS/Source/get_set/GB_matvec_name_size_get.c index e2febc941c..ed00c3bf48 100644 --- a/GraphBLAS/Source/get_set/GB_matvec_name_size_get.c +++ b/GraphBLAS/Source/get_set/GB_matvec_name_size_get.c @@ -2,7 +2,7 @@ // GB_matvec_name_size_get: get max size of a matrix/vector/scalar name or type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_matvec_set.c b/GraphBLAS/Source/get_set/GB_matvec_set.c index 5aac944c1b..9474131d32 100644 --- a/GraphBLAS/Source/get_set/GB_matvec_set.c +++ b/GraphBLAS/Source/get_set/GB_matvec_set.c @@ -2,7 +2,7 @@ // GB_matvec_set: set a field in a matrix or vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,126 @@ #include "transpose/GB_transpose.h" #define GB_FREE_ALL ; +//------------------------------------------------------------------------------ +// GB_set_format: set A->is_csc and transpose if needed +//------------------------------------------------------------------------------ + +// This does nothing if (A->is_csc == new_csc) holds + +static GrB_Info GB_set_format +( + GrB_Matrix A, + bool is_vector, + int format, + GB_Werk Werk +) +{ + GrB_Info info ; + if (is_vector) + { + // the hint is ignored + return (GrB_SUCCESS) ; + } + if (! (format == GxB_BY_ROW || format == GxB_BY_COL)) + { + return (GrB_INVALID_VALUE) ; + } + bool new_csc = (format != GxB_BY_ROW) ; + GB_OK (GB_transpose_in_place (A, new_csc, Werk)) ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_set_p_control: set A->p_control and convert integers if needed +//------------------------------------------------------------------------------ + +static GrB_Info GB_set_p_control +( + GrB_Matrix A, + int ivalue +) +{ + GrB_Info info ; + if (!(ivalue == 0 || ivalue == 32 || ivalue == 64)) + { + return (GrB_INVALID_VALUE) ; + } + if (ivalue == 32 && !A->p_is_32) + { + // A->p is currently 64-bit; convert to 32-bit if possible + GB_OK (GB_convert_int (A, true, A->j_is_32, A->i_is_32, true)) ; + } + else if (ivalue == 64 && A->p_is_32) + { + // A->p is currently 32-bit; convert to 64-bit + GB_OK (GB_convert_int (A, false, A->j_is_32, A->i_is_32, true)) ; + } + A->p_control = ivalue ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_set_j_control: set A->j_control and convert integers if needed +//------------------------------------------------------------------------------ + +static GrB_Info GB_set_j_control +( + GrB_Matrix A, + int ivalue +) +{ + GrB_Info info ; + if (!(ivalue == 0 || ivalue == 32 || ivalue == 64)) + { + return (GrB_INVALID_VALUE) ; + } + if (ivalue == 32 && !A->j_is_32) + { + // A->h is currently 64-bit; convert to 32-bit if possible + GB_OK (GB_convert_int (A, A->p_is_32, true, A->i_is_32, true)) ; + } + else if (ivalue == 64 && A->j_is_32) + { + // A->h is currently 32-bit; convert to 64-bit + GB_OK (GB_convert_int (A, A->p_is_32, false, A->i_is_32, true)) ; + } + A->j_control = ivalue ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_set_i_control: set A->i_control and convert integers if needed +//------------------------------------------------------------------------------ + +static GrB_Info GB_set_i_control +( + GrB_Matrix A, + int ivalue +) +{ + GrB_Info info ; + if (!(ivalue == 0 || ivalue == 32 || ivalue == 64)) + { + return (GrB_INVALID_VALUE) ; + } + if (ivalue == 32 && !A->i_is_32) + { + // A->i is currently 64-bit; convert to 32-bit if possible + GB_OK (GB_convert_int (A, A->p_is_32, A->j_is_32, true, true)) ; + } + else if (ivalue == 64 && A->i_is_32) + { + // A->i is currently 32-bit; convert to 64-bit + GB_OK (GB_convert_int (A, A->p_is_32, A->j_is_32, false, true)) ; + } + A->i_control = ivalue ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_matvec_set +//------------------------------------------------------------------------------ + GrB_Info GB_matvec_set ( GrB_Matrix A, @@ -24,6 +144,8 @@ GrB_Info GB_matvec_set GrB_Info info ; GB_BURBLE_START ("GrB_set") ; + ASSERT_MATRIX_OK (A, "A before set", GB0) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; int format = ivalue ; @@ -54,6 +176,30 @@ GrB_Info GB_matvec_set A->sparsity_control = GB_sparsity_control (ivalue, (int64_t) (-1)) ; break ; + case GxB_ISO : + + if (ivalue) + { + // try to make the matrix iso-valued + if (!A->iso && GB_all_entries_are_iso (A)) + { + // All entries in A are the same; convert A to iso + GBURBLE ("(set iso) ") ; + A->iso = true ; + GB_OK (GB_convert_any_to_iso (A, NULL)) ; + } + } + else + { + // make the matrix non-iso-valued + if (A->iso) + { + GBURBLE ("(set non-iso) ") ; + GB_OK (GB_convert_any_to_non_iso (A, true)) ; + } + } + break ; + case GrB_STORAGE_ORIENTATION_HINT : format = (ivalue == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; @@ -61,28 +207,28 @@ GrB_Info GB_matvec_set case GxB_FORMAT : - if (is_vector) - { - // the hint is ignored - return (GrB_SUCCESS) ; - } - if (! (format == GxB_BY_ROW || format == GxB_BY_COL)) - { - return (GrB_INVALID_VALUE) ; - } - bool new_csc = (format != GxB_BY_ROW) ; - // conform the matrix to the new by-row/by-col format - if (A->is_csc != new_csc) - { - // A = A', done in-place, and change to the new format. - GB_BURBLE_N (GB_nnz (A), "(transpose) ") ; - GB_OK (GB_transpose_in_place (A, new_csc, Werk)) ; - ASSERT (A->is_csc == new_csc) ; - ASSERT (GB_JUMBLED_OK (A)) ; - } + GB_OK (GB_set_format (A, is_vector, format, Werk)) ; + break ; + + case GxB_OFFSET_INTEGER_HINT : + + GB_OK (GB_set_p_control (A, ivalue)) ; + break ; + + case GxB_COLINDEX_INTEGER_HINT : + + GB_OK (A->is_csc ? GB_set_j_control (A, ivalue) : + GB_set_i_control (A, ivalue)) ; + break ; + + case GxB_ROWINDEX_INTEGER_HINT : + + GB_OK (A->is_csc ? GB_set_i_control (A, ivalue) : + GB_set_j_control (A, ivalue)) ; break ; default : + return (GrB_INVALID_VALUE) ; } diff --git a/GraphBLAS/Source/get_set/GB_monoid_get.c b/GraphBLAS/Source/get_set/GB_monoid_get.c index 876fe293e3..8ed5cc99d3 100644 --- a/GraphBLAS/Source/get_set/GB_monoid_get.c +++ b/GraphBLAS/Source/get_set/GB_monoid_get.c @@ -2,7 +2,7 @@ // GB_monoid_get: get a field in a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,8 +12,8 @@ GrB_Info GB_monoid_get ( GrB_Monoid monoid, - GrB_Scalar value, - GrB_Field field, + GrB_Scalar scalar, + int field, GB_Werk Werk ) { @@ -28,22 +28,22 @@ GrB_Info GB_monoid_get case GrB_INP1_TYPE_CODE : case GrB_OUTP_TYPE_CODE : - return (GB_op_scalar_get ((GB_Operator) monoid->op, value, field, + return (GB_op_scalar_get ((GB_Operator) monoid->op, scalar, field, Werk)) ; case GxB_MONOID_IDENTITY : - if (value->type != monoid->op->ztype) + if (scalar->type != monoid->op->ztype) { // scalar type must match the monoid type return (GrB_DOMAIN_MISMATCH) ; } - return (GB_setElement ((GrB_Matrix) value, NULL, + return (GB_setElement ((GrB_Matrix) scalar, NULL, monoid->identity, 0, 0, monoid->op->ztype->code, Werk)) ; case GxB_MONOID_TERMINAL : - if (value->type != monoid->op->ztype) + if (scalar->type != monoid->op->ztype) { // scalar type must match the monoid type return (GrB_DOMAIN_MISMATCH) ; @@ -52,12 +52,12 @@ GrB_Info GB_monoid_get { // monoid is not terminal: clear the output scalar. // This is not an error - return (GB_clear ((GrB_Matrix) value, Werk)) ; + return (GB_clear ((GrB_Matrix) scalar, Werk)) ; } else { - // monoid is terminal: return the terminal value. - return (GB_setElement ((GrB_Matrix) value, NULL, + // monoid is terminal: return the terminal scalar. + return (GB_setElement ((GrB_Matrix) scalar, NULL, monoid->terminal, 0, 0, monoid->op->ztype->code, Werk)) ; } diff --git a/GraphBLAS/Source/get_set/GB_monoid_name_get.c b/GraphBLAS/Source/get_set/GB_monoid_name_get.c index 7201e4e3bb..c39db975ac 100644 --- a/GraphBLAS/Source/get_set/GB_monoid_name_get.c +++ b/GraphBLAS/Source/get_set/GB_monoid_name_get.c @@ -2,7 +2,7 @@ // GB_monoid_name_get: get the name of a built-in monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_op_enum_get.c b/GraphBLAS/Source/get_set/GB_op_enum_get.c index 6381af6478..0f71746ebe 100644 --- a/GraphBLAS/Source/get_set/GB_op_enum_get.c +++ b/GraphBLAS/Source/get_set/GB_op_enum_get.c @@ -2,7 +2,7 @@ // GB_op_enum_get: get a field in an op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GB_op_enum_get ( GB_Operator op, int32_t * value, - GrB_Field field + int field ) { diff --git a/GraphBLAS/Source/get_set/GB_op_name_get.c b/GraphBLAS/Source/get_set/GB_op_name_get.c index aec0bfbaa1..54f3772c07 100644 --- a/GraphBLAS/Source/get_set/GB_op_name_get.c +++ b/GraphBLAS/Source/get_set/GB_op_name_get.c @@ -2,7 +2,7 @@ // GB_op_name_get: get the user_name of any operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_op_or_type_string_set.c b/GraphBLAS/Source/get_set/GB_op_or_type_string_set.c index c06de4664f..610900b3cf 100644 --- a/GraphBLAS/Source/get_set/GB_op_or_type_string_set.c +++ b/GraphBLAS/Source/get_set/GB_op_or_type_string_set.c @@ -2,7 +2,7 @@ // GB_op_or_type_string_set: set the name or defn of a user-defined type or op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -83,7 +83,7 @@ GrB_Info GB_op_or_type_string_set } // allocate space for the definition - (*defn) = GB_MALLOC (len+1, char, defn_size) ; + (*defn) = GB_MALLOC_MEMORY (len+1, sizeof (char), defn_size) ; if ((*defn) == NULL) { // out of memory diff --git a/GraphBLAS/Source/get_set/GB_op_scalar_get.c b/GraphBLAS/Source/get_set/GB_op_scalar_get.c index 3efe061242..77755d82a7 100644 --- a/GraphBLAS/Source/get_set/GB_op_scalar_get.c +++ b/GraphBLAS/Source/get_set/GB_op_scalar_get.c @@ -2,7 +2,7 @@ // GB_op_scalar_get: get a field in an op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,8 +12,8 @@ GrB_Info GB_op_scalar_get ( GB_Operator op, - GrB_Scalar value, - GrB_Field field, + GrB_Scalar scalar, + int field, GB_Werk Werk ) { @@ -27,25 +27,25 @@ GrB_Info GB_op_scalar_get // get theta from an index binary op, or a binary op created from one if (op->theta == NULL) { - // this op does not have a theta value + // this op does not have a theta scalar return (GrB_INVALID_VALUE) ; } - else if (value->type != op->theta_type) + else if (scalar->type != op->theta_type) { // scalar type must match the theta type return (GrB_DOMAIN_MISMATCH) ; } - return (GB_setElement ((GrB_Matrix) value, NULL, op->theta, 0, 0, + return (GB_setElement ((GrB_Matrix) scalar, NULL, op->theta, 0, 0, op->theta_type->code, Werk)) ; } else { - // get an integer (enum) value from any op + // get an integer (enum) scalar from any op int i ; GrB_Info info = GB_op_enum_get (op, &i, field) ; if (info == GrB_SUCCESS) { - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } return (info) ; diff --git a/GraphBLAS/Source/get_set/GB_op_size_get.c b/GraphBLAS/Source/get_set/GB_op_size_get.c index f7a0c01f16..e3065c0eaa 100644 --- a/GraphBLAS/Source/get_set/GB_op_size_get.c +++ b/GraphBLAS/Source/get_set/GB_op_size_get.c @@ -2,7 +2,7 @@ // GB_op_size_get: get the size of a string in an op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GB_op_size_get ( GB_Operator op, size_t * value, - GrB_Field field + int field ) { diff --git a/GraphBLAS/Source/get_set/GB_op_string_get.c b/GraphBLAS/Source/get_set/GB_op_string_get.c index 703554faf4..ad9f651371 100644 --- a/GraphBLAS/Source/get_set/GB_op_string_get.c +++ b/GraphBLAS/Source/get_set/GB_op_string_get.c @@ -2,7 +2,7 @@ // GB_op_string_get: get a field in an op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GB_op_string_get ( GB_Operator op, char * value, - GrB_Field field + int field ) { diff --git a/GraphBLAS/Source/get_set/GB_op_string_set.c b/GraphBLAS/Source/get_set/GB_op_string_set.c index b7ca4cdf89..2fff894212 100644 --- a/GraphBLAS/Source/get_set/GB_op_string_set.c +++ b/GraphBLAS/Source/get_set/GB_op_string_set.c @@ -2,7 +2,7 @@ // GB_op_string_set: set the name or defn of an operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GB_op_string_set ( GB_Operator op, char * value, - GrB_Field field + int field ) { diff --git a/GraphBLAS/Source/get_set/GB_semiring_name_get.c b/GraphBLAS/Source/get_set/GB_semiring_name_get.c index d816baf228..7b411aab73 100644 --- a/GraphBLAS/Source/get_set/GB_semiring_name_get.c +++ b/GraphBLAS/Source/get_set/GB_semiring_name_get.c @@ -2,7 +2,7 @@ // GB_semiring_name_get: get the name of a built-in semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_type_code_get.c b/GraphBLAS/Source/get_set/GB_type_code_get.c index 29386d1a44..49f5bea601 100644 --- a/GraphBLAS/Source/get_set/GB_type_code_get.c +++ b/GraphBLAS/Source/get_set/GB_type_code_get.c @@ -2,14 +2,14 @@ // GB_type_code_get: convert a GB_Type_code to a GrB_Type_Code //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "get_set/GB_get_set.h" -GrB_Type_Code GB_type_code_get // return the GrB_Type_Code for the code +int GB_type_code_get // return the GrB_Type_Code for the code ( const GB_Type_code code // type code to convert ) diff --git a/GraphBLAS/Source/get_set/GB_type_name_get.c b/GraphBLAS/Source/get_set/GB_type_name_get.c index 7d70f29e77..ed5df27393 100644 --- a/GraphBLAS/Source/get_set/GB_type_name_get.c +++ b/GraphBLAS/Source/get_set/GB_type_name_get.c @@ -2,7 +2,7 @@ // GB_type_name_get: get the user_name of a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/get_set/GB_user_name_set.c b/GraphBLAS/Source/get_set/GB_user_name_set.c index 5626178303..0830c97ca2 100644 --- a/GraphBLAS/Source/get_set/GB_user_name_set.c +++ b/GraphBLAS/Source/get_set/GB_user_name_set.c @@ -2,7 +2,7 @@ // GB_user_name_set: set the user_name of an object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ GrB_Info GB_user_name_set } // free the object user_name, if it already exists - GB_FREE (object_user_name, (*object_user_name_size)) ; + GB_FREE_MEMORY (object_user_name, (*object_user_name_size)) ; (*object_user_name_size) = 0 ; // get the length of the new name @@ -42,7 +42,8 @@ GrB_Info GB_user_name_set // allocate the new name size_t user_name_size ; - char *user_name = GB_MALLOC (len + 1, char, &user_name_size) ; + char *user_name = GB_MALLOC_MEMORY (len + 1, sizeof (char), + &user_name_size) ; if (user_name == NULL) { // out of memory diff --git a/GraphBLAS/Source/get_set/GrB_BinaryOp_get.c b/GraphBLAS/Source/get_set/GrB_BinaryOp_get.c index 7dc791946d..6e068652ae 100644 --- a/GraphBLAS/Source/get_set/GrB_BinaryOp_get.c +++ b/GraphBLAS/Source/get_set/GrB_BinaryOp_get.c @@ -2,7 +2,7 @@ // GrB_BinaryOp_get_*: get a field in a binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_BinaryOp_get_Scalar ( GrB_BinaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,19 +25,20 @@ GrB_Info GrB_BinaryOp_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_get_Scalar (op, value, field)") ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_BinaryOp_get_Scalar (op, scalar, field)") ; + if (op != GxB_IGNORE_DUP) { GB_RETURN_IF_NULL_OR_FAULTY (op) ; ASSERT_BINARYOP_OK (op, "binaryop for get", GB0) ; } - GB_RETURN_IF_NULL_OR_FAULTY (value) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; + return (GB_op_scalar_get ((GB_Operator) op, scalar, field, Werk)) ; } //------------------------------------------------------------------------------ @@ -48,7 +49,7 @@ GrB_Info GrB_BinaryOp_get_String ( GrB_BinaryOp op, char * value, - GrB_Field field + int field ) { @@ -56,7 +57,7 @@ GrB_Info GrB_BinaryOp_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_get_String (op, value, field)") ; + GB_CHECK_INIT ; if (op != GxB_IGNORE_DUP) { GB_RETURN_IF_NULL_OR_FAULTY (op) ; @@ -79,7 +80,7 @@ GrB_Info GrB_BinaryOp_get_INT32 ( GrB_BinaryOp op, int32_t * value, - GrB_Field field + int field ) { @@ -87,7 +88,7 @@ GrB_Info GrB_BinaryOp_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_get_INT32 (op, value, field)") ; + GB_CHECK_INIT ; if (op != GxB_IGNORE_DUP) { GB_RETURN_IF_NULL_OR_FAULTY (op) ; @@ -110,7 +111,7 @@ GrB_Info GrB_BinaryOp_get_SIZE ( GrB_BinaryOp op, size_t * value, - GrB_Field field + int field ) { @@ -118,7 +119,7 @@ GrB_Info GrB_BinaryOp_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_get_SIZE (op, value, field)") ; + GB_CHECK_INIT ; if (op != GxB_IGNORE_DUP) { GB_RETURN_IF_NULL_OR_FAULTY (op) ; @@ -141,7 +142,7 @@ GrB_Info GrB_BinaryOp_get_VOID ( GrB_BinaryOp op, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_BinaryOp_set.c b/GraphBLAS/Source/get_set/GrB_BinaryOp_set.c index cf0d7efed0..ad3c884c89 100644 --- a/GraphBLAS/Source/get_set/GrB_BinaryOp_set.c +++ b/GraphBLAS/Source/get_set/GrB_BinaryOp_set.c @@ -2,7 +2,7 @@ // GrB_BinaryOp_set_*: set a field in a binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_BinaryOp_set_Scalar ( GrB_BinaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_BinaryOp_set_String ( GrB_BinaryOp op, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_BinaryOp_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_set_String (op, value, field)") ; + GB_CHECK_INIT if (op != GxB_IGNORE_DUP) { GB_RETURN_IF_NULL_OR_FAULTY (op) ; @@ -62,7 +62,7 @@ GrB_Info GrB_BinaryOp_set_INT32 ( GrB_BinaryOp op, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -76,7 +76,7 @@ GrB_Info GrB_BinaryOp_set_VOID ( GrB_BinaryOp op, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Descriptor_get2.c b/GraphBLAS/Source/get_set/GrB_Descriptor_get.c similarity index 82% rename from GraphBLAS/Source/get_set/GrB_Descriptor_get2.c rename to GraphBLAS/Source/get_set/GrB_Descriptor_get.c index a4f882c660..4aca8d3220 100644 --- a/GraphBLAS/Source/get_set/GrB_Descriptor_get2.c +++ b/GraphBLAS/Source/get_set/GrB_Descriptor_get.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GrB_Descriptor_get_*: get a field in a descriptor +// GrB_Descriptor_get*: get a field in a descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,18 @@ static GrB_Info GB_desc_get ( GrB_Descriptor desc, // descriptor to query; NULL is ok int32_t *value, // return value of the descriptor - int field // parameter to query + int field ) { + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_RETURN_IF_FAULTY (desc) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; + //-------------------------------------------------------------------------- // get the parameter //-------------------------------------------------------------------------- @@ -58,7 +66,7 @@ static GrB_Info GB_desc_get case GxB_COMPRESSION : (*value) = (int32_t) ((desc == NULL) ? - GrB_DEFAULT : desc->compression) ; + GrB_DEFAULT : desc->compression) ; break ; case GxB_IMPORT : @@ -67,6 +75,24 @@ static GrB_Info GB_desc_get if ((*value) != GrB_DEFAULT) (*value) = GxB_SECURE_IMPORT ; break ; + case GxB_ROWINDEX_LIST : + + (*value) = (int32_t) ((desc == NULL) ? + GrB_DEFAULT : desc->row_list) ; + break ; + + case GxB_COLINDEX_LIST : + + (*value) = (int32_t) ((desc == NULL) ? + GrB_DEFAULT : desc->col_list) ; + break ; + + case GxB_VALUE_LIST : + + (*value) = (int32_t) ((desc == NULL) ? + GrB_DEFAULT : desc->val_list) ; + break ; + default : return (GrB_INVALID_VALUE) ; @@ -83,8 +109,8 @@ static GrB_Info GB_desc_get GrB_Info GrB_Descriptor_get_Scalar ( GrB_Descriptor desc, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -92,20 +118,18 @@ GrB_Info GrB_Descriptor_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_get_Scalar (desc, value, field)") ; - GB_RETURN_IF_FAULTY (desc) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; - ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; + GB_WHERE_1 (scalar, "GrB_Descriptor_get_Scalar (desc, scalar, field)") ; + GB_RETURN_IF_NULL (scalar) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- int32_t i ; - GrB_Info info = GB_desc_get (desc, &i, field) ; + info = GB_desc_get (desc, &i, field) ; if (info == GrB_SUCCESS) { - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } return (info) ; @@ -119,7 +143,7 @@ GrB_Info GrB_Descriptor_get_String ( GrB_Descriptor desc, char * value, - GrB_Field field + int field ) { @@ -127,7 +151,7 @@ GrB_Info GrB_Descriptor_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_get_String (desc, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_FAULTY (desc) ; GB_RETURN_IF_NULL (value) ; ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; @@ -139,7 +163,7 @@ GrB_Info GrB_Descriptor_get_String (*value) = '\0' ; const char *dname = GB_desc_name_get (desc) ; if (dname != NULL) - { + { strcpy (value, dname) ; } @@ -155,7 +179,7 @@ GrB_Info GrB_Descriptor_get_INT32 ( GrB_Descriptor desc, int32_t * value, - GrB_Field field + int field ) { @@ -163,10 +187,7 @@ GrB_Info GrB_Descriptor_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_get_INT32 (desc, value, field)") ; - GB_RETURN_IF_FAULTY (desc) ; - GB_RETURN_IF_NULL (value) ; - ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // get the field @@ -183,7 +204,7 @@ GrB_Info GrB_Descriptor_get_SIZE ( GrB_Descriptor desc, size_t * value, - GrB_Field field + int field ) { @@ -191,7 +212,7 @@ GrB_Info GrB_Descriptor_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_get_SIZE (desc, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_FAULTY (desc) ; GB_RETURN_IF_NULL (value) ; ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc for get", GB0) ; @@ -210,7 +231,7 @@ GrB_Info GrB_Descriptor_get_SIZE (*value) = desc->user_name_size ; } else - { + { (*value) = GxB_MAX_NAME_LEN ; } return (GrB_SUCCESS) ; @@ -224,7 +245,7 @@ GrB_Info GrB_Descriptor_get_VOID ( GrB_Descriptor desc, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_Descriptor_set.c b/GraphBLAS/Source/get_set/GrB_Descriptor_set.c index 9509d544a5..828bfb2066 100644 --- a/GraphBLAS/Source/get_set/GrB_Descriptor_set.c +++ b/GraphBLAS/Source/get_set/GrB_Descriptor_set.c @@ -1,147 +1,319 @@ //------------------------------------------------------------------------------ -// GrB_Descriptor_set: set a field in a descriptor +// GrB_Descriptor_set*: set a field in a descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#include "GB.h" +#include "get_set/GB_get_set.h" -GrB_Info GrB_Descriptor_set // set a parameter in a descriptor +//------------------------------------------------------------------------------ +// GB_desc_set +//------------------------------------------------------------------------------ + +static GrB_Info GB_desc_set ( GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change - GrB_Desc_Value value // value to change it to + int32_t value, // value to change it to + int field, + GB_Werk Werk ) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc != NULL && desc->header_size == 0) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GrB_Descriptor_set (desc, field, value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - //-------------------------------------------------------------------------- // set the parameter //-------------------------------------------------------------------------- + int mask = (int) desc->mask ; + switch (field) { - case GrB_OUTP : + case GrB_OUTP : // same as GrB_OUTP_FIELD - if (! (value == GxB_DEFAULT || value == GrB_REPLACE)) + if (! (value == GrB_DEFAULT || value == GrB_REPLACE)) { GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_OUTP field;\n" - "must be GxB_DEFAULT [%d] or GrB_REPLACE [%d]", - (int) value, (int) GxB_DEFAULT, (int) GrB_REPLACE) ; + "invalid descriptor value [%d] for GrB_OUTP field;\n" + "must be GrB_DEFAULT [%d] or GrB_REPLACE [%d]", + value, (int) GrB_DEFAULT, (int) GrB_REPLACE) ; } - desc->out = value ; + desc->out = (GrB_Desc_Value) value ; break ; - case GrB_MASK : - { + case GrB_MASK : // same as GrB_MASK_FIELD - if (! (value == GxB_DEFAULT || + if (! (value == GrB_DEFAULT || value == GrB_COMP || value == GrB_STRUCTURE || value == (GrB_COMP + GrB_STRUCTURE))) { GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_MASK field;\n" - "must be GxB_DEFAULT [%d], GrB_COMP [%d],\n" - "GrB_STRUCTURE [%d], or GrB_COMP+GrB_STRUCTURE [%d]", - (int) value, (int) GxB_DEFAULT, (int) GrB_COMP, - (int) GrB_STRUCTURE, - (int) (GrB_COMP + GrB_STRUCTURE)) ; + "invalid descriptor value [%d] for GrB_MASK field;\n" + "must be GrB_DEFAULT [%d], GrB_COMP [%d],\n" + "GrB_STRUCTURE [%d], or GrB_COMP+GrB_STRUCTURE [%d]", + value, (int) GrB_DEFAULT, (int) GrB_COMP, + (int) GrB_STRUCTURE, + (int) (GrB_COMP + GrB_STRUCTURE)) ; } - int mask = (int) desc->mask ; switch (value) { case GrB_COMP : mask |= GrB_COMP ; break ; case GrB_STRUCTURE : mask |= GrB_STRUCTURE ; break ; - default : mask = (int) value ; break ; + default : mask = value ; break ; } desc->mask = (GrB_Desc_Value) mask ; - } - break ; + break ; - case GrB_INP0 : + case GrB_INP0 : // same as GrB_INP0_FIELD - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) + if (! (value == GrB_DEFAULT || value == GrB_TRAN)) { GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP0 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - (int) value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; + "invalid descriptor value [%d] for GrB_INP0 field;\n" + "must be GrB_DEFAULT [%d] or GrB_TRAN [%d]", + value, (int) GrB_DEFAULT, (int) GrB_TRAN) ; } - desc->in0 = value ; + desc->in0 = (GrB_Desc_Value) value ; break ; - case GrB_INP1 : + case GrB_INP1 : // same as GrB_INP1_FIELD - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) + if (! (value == GrB_DEFAULT || value == GrB_TRAN)) { GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP1 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - (int) value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; + "invalid descriptor value [%d] for GrB_INP1 field;\n" + "must be GrB_DEFAULT [%d] or GrB_TRAN [%d]", + value, (int) GrB_DEFAULT, (int) GrB_TRAN) ; } - desc->in1 = value ; + desc->in1 = (GrB_Desc_Value) value ; break ; case GxB_AxB_METHOD : - if (! (value == GxB_DEFAULT || value == GxB_AxB_GUSTAVSON + if (! (value == GrB_DEFAULT || value == GxB_AxB_GUSTAVSON || value == GxB_AxB_DOT || value == GxB_AxB_HASH || value == GxB_AxB_SAXPY)) { GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_AxB_METHOD field;\n" - "must be GxB_DEFAULT [%d], GxB_AxB_GUSTAVSON [%d]\n" - "GxB_AxB_DOT [%d], GxB_AxB_HASH [%d] or GxB_AxB_SAXPY [%d]", - (int) value, (int) GxB_DEFAULT, (int) GxB_AxB_GUSTAVSON, - (int) GxB_AxB_DOT, - (int) GxB_AxB_HASH, (int) GxB_AxB_SAXPY) ; + "invalid descriptor value [%d] for GrB_AxB_METHOD" + " field;\nmust be GrB_DEFAULT [%d], GxB_AxB_GUSTAVSON" + " [%d]\nGxB_AxB_DOT [%d]" + " GxB_AxB_HASH [%d] or GxB_AxB_SAXPY [%d]", + value, (int) GrB_DEFAULT, (int) GxB_AxB_GUSTAVSON, + (int) GxB_AxB_DOT, + (int) GxB_AxB_HASH, (int) GxB_AxB_SAXPY) ; } - desc->axb = value ; + desc->axb = (GrB_Desc_Value) value ; + break ; + + case GxB_SORT : + + desc->do_sort = value ; + break ; + + case GxB_COMPRESSION : + + desc->compression = value ; break ; case GxB_IMPORT : - // The user application might not check the error return value of - // this method, so do not return an error if the value is something - // other that GxB_FAST_IMPORT (equal to GxB_DEFAULT) or - // GxB_SERCURE_IMPORT. Instead, default to slower but secure - // import/deserialization, if the GxB_IMPORT setting is made. - // Only use the fast import/deserialize if the value is GxB_DEFAULT - // or GxB_FAST_IMPORT; otherwise use the slower secure method. + // In case the user application does not check the return value + // of this method, an error condition is never returned. desc->import = - (value == GxB_DEFAULT) ? GxB_FAST_IMPORT : GxB_SECURE_IMPORT ; + (value == GrB_DEFAULT) ? GxB_FAST_IMPORT : GxB_SECURE_IMPORT ; break ; - default : + case GxB_ROWINDEX_LIST : + + if (! (value == GrB_DEFAULT || value == GxB_USE_VALUES + || value == GxB_USE_INDICES || value == GxB_IS_STRIDE)) + { + GB_ERROR (GrB_INVALID_VALUE, + "invalid descriptor value [%d] for GxB_ROWINDEX_LIST " + "field;\nmust be GrB_DEFAULT [%d], GxB_USE_VALUES [%d]\n" + "GxB_USE_INDICES [%d], or GxB_IS_STRIDE [%d]", + (int) value, (int) GrB_DEFAULT, (int) GxB_USE_VALUES, + (int) GxB_USE_INDICES, (int) GxB_IS_STRIDE) ; + } + desc->row_list = (int) value ; + break ; + + case GxB_COLINDEX_LIST : + + if (! (value == GrB_DEFAULT || value == GxB_USE_VALUES + || value == GxB_USE_INDICES || value == GxB_IS_STRIDE)) + { + GB_ERROR (GrB_INVALID_VALUE, + "invalid descriptor value [%d] for GxB_COLINDEX_LIST " + "field;\nmust be GrB_DEFAULT [%d], GxB_USE_VALUES [%d]\n" + "GxB_USE_INDICES [%d], or GxB_IS_STRIDE [%d]", + (int) value, (int) GrB_DEFAULT, (int) GxB_USE_VALUES, + (int) GxB_USE_INDICES, (int) GxB_IS_STRIDE) ; + } + desc->col_list = (int) value ; + break ; + + case GxB_VALUE_LIST : + + if (! (value == GrB_DEFAULT || value == GxB_USE_VALUES + || value == GxB_USE_INDICES)) + { + GB_ERROR (GrB_INVALID_VALUE, + "invalid descriptor value [%d] for GxB_VALUE_LIST " + "field;\nmust be GrB_DEFAULT [%d], GxB_USE_VALUES [%d]\n" + "or GxB_USE_INDICES [%d]", + (int) value, (int) GrB_DEFAULT, (int) GxB_USE_VALUES, + (int) GxB_USE_INDICES) ; + } + desc->val_list = (int) value ; + break ; - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor field [%d], must be one of:\n" - "GrB_OUTP [%d], GrB_MASK [%d], GrB_INP0 [%d], GrB_INP1 [%d], " - "GxB_AxB_METHOD [%d] or GxB_IMPORT [%d] (use GxB_Desc_set " - "for other descriptor settings)", (int) field, (int) GrB_OUTP, - (int) GrB_MASK, (int) GrB_INP0, (int) GrB_INP1, - (int) GxB_AxB_METHOD, (int) GxB_IMPORT) ; + default : + return (GrB_INVALID_VALUE) ; } + #pragma omp flush return (GrB_SUCCESS) ; } +//------------------------------------------------------------------------------ +// GrB_Descriptor_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_set_Scalar +( + GrB_Descriptor desc, + GrB_Scalar scalar, + int field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (desc == NULL || desc->header_size == 0) + { + // built-in descriptors may not be modified + return (GrB_INVALID_VALUE) ; + } + + GrB_Info info ; + GB_RETURN_IF_NULL_OR_INVALID (scalar) ; + GB_WHERE_DESC (desc, "GrB_Descriptor_set_Scalar (desc, scalar, field)") ; + + ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + int32_t i ; + info = GrB_Scalar_extractElement_INT32 (&i, scalar) ; + if (info != GrB_SUCCESS) + { + return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; + } + return (GB_desc_set (desc, i, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_set_String +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_set_String +( + GrB_Descriptor desc, + char * value, + int field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (desc == NULL || desc->header_size == 0 || field != GrB_NAME) + { + // built-in descriptors may not be modified + return (GrB_INVALID_VALUE) ; + } + + GB_RETURN_IF_NULL (value) ; + GB_WHERE_DESC (desc, "GrB_Descriptor_set_String (desc, value, field)") ; + + ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_user_name_set (&(desc->user_name), &(desc->user_name_size), + value, false)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_set_INT32 +( + GrB_Descriptor desc, + int32_t value, + int field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (desc == NULL || desc->header_size == 0) + { + // built-in descriptors may not be modified + return (GrB_INVALID_VALUE) ; + } + + GB_WHERE_DESC (desc, "GrB_Descriptor_set_INT32 (desc, value, field)") ; + ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_desc_set (desc, value, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_set_VOID +( + GrB_Descriptor desc, + void * value, + int field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GrB_Descriptor_set: historical method +//------------------------------------------------------------------------------ + +GrB_Info GrB_Descriptor_set // set a parameter in a descriptor +( + GrB_Descriptor desc, // descriptor to modify + int field, // parameter to change + int value // value to change it to +) +{ + return (GrB_Descriptor_set_INT32 (desc, value, field)) ; +} + diff --git a/GraphBLAS/Source/get_set/GrB_Descriptor_set2.c b/GraphBLAS/Source/get_set/GrB_Descriptor_set2.c deleted file mode 100644 index e84de0d280..0000000000 --- a/GraphBLAS/Source/get_set/GrB_Descriptor_set2.c +++ /dev/null @@ -1,260 +0,0 @@ -//------------------------------------------------------------------------------ -// GrB_Descriptor_set_*: set a field in a descriptor -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "get_set/GB_get_set.h" - -//------------------------------------------------------------------------------ -// GB_desc_set -//------------------------------------------------------------------------------ - -static GrB_Info GB_desc_set -( - GrB_Descriptor desc, // descriptor to modify - int32_t value, // value to change it to - int field, // parameter to change - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // set the parameter - //-------------------------------------------------------------------------- - - int mask = (int) desc->mask ; - - switch (field) - { - - case GrB_OUTP : // same as GrB_OUTP_FIELD - - if (! (value == GrB_DEFAULT || value == GrB_REPLACE)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_OUTP field;\n" - "must be GrB_DEFAULT [%d] or GrB_REPLACE [%d]", - value, (int) GrB_DEFAULT, (int) GrB_REPLACE) ; - } - desc->out = (GrB_Desc_Value) value ; - break ; - - case GrB_MASK : // same as GrB_MASK_FIELD - - if (! (value == GrB_DEFAULT || - value == GrB_COMP || - value == GrB_STRUCTURE || - value == (GrB_COMP + GrB_STRUCTURE))) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_MASK field;\n" - "must be GrB_DEFAULT [%d], GrB_COMP [%d],\n" - "GrB_STRUCTURE [%d], or GrB_COMP+GrB_STRUCTURE [%d]", - value, (int) GrB_DEFAULT, (int) GrB_COMP, - (int) GrB_STRUCTURE, - (int) (GrB_COMP + GrB_STRUCTURE)) ; - } - switch (value) - { - case GrB_COMP : mask |= GrB_COMP ; break ; - case GrB_STRUCTURE : mask |= GrB_STRUCTURE ; break ; - default : mask = value ; break ; - } - desc->mask = (GrB_Desc_Value) mask ; - break ; - - case GrB_INP0 : // same as GrB_INP0_FIELD - - if (! (value == GrB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP0 field;\n" - "must be GrB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GrB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in0 = (GrB_Desc_Value) value ; - break ; - - case GrB_INP1 : // same as GrB_INP1_FIELD - - if (! (value == GrB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP1 field;\n" - "must be GrB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GrB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in1 = (GrB_Desc_Value) value ; - break ; - - case GxB_AxB_METHOD : - - if (! (value == GrB_DEFAULT || value == GxB_AxB_GUSTAVSON - || value == GxB_AxB_DOT - || value == GxB_AxB_HASH || value == GxB_AxB_SAXPY)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_AxB_METHOD" - " field;\nmust be GrB_DEFAULT [%d], GxB_AxB_GUSTAVSON" - " [%d]\nGxB_AxB_DOT [%d]" - " GxB_AxB_HASH [%d] or GxB_AxB_SAXPY [%d]", - value, (int) GrB_DEFAULT, (int) GxB_AxB_GUSTAVSON, - (int) GxB_AxB_DOT, - (int) GxB_AxB_HASH, (int) GxB_AxB_SAXPY) ; - } - desc->axb = (GrB_Desc_Value) value ; - break ; - - case GxB_SORT : - - desc->do_sort = value ; - break ; - - case GxB_COMPRESSION : - - desc->compression = value ; - break ; - - case GxB_IMPORT : - - // In case the user application does not check the return value - // of this method, an error condition is never returned. - desc->import = - (value == GrB_DEFAULT) ? GxB_FAST_IMPORT : GxB_SECURE_IMPORT ; - break ; - - default : - return (GrB_INVALID_VALUE) ; - } - - #pragma omp flush - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// GrB_Descriptor_set_Scalar -//------------------------------------------------------------------------------ - -GrB_Info GrB_Descriptor_set_Scalar -( - GrB_Descriptor desc, - GrB_Scalar value, - GrB_Field field -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc == NULL || desc->header_size == 0) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GrB_Descriptor_set_Scalar (desc, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - - //-------------------------------------------------------------------------- - // set the field - //-------------------------------------------------------------------------- - - int32_t i ; - GrB_Info info = GrB_Scalar_extractElement_INT32 (&i, value) ; - if (info != GrB_SUCCESS) - { - return ((info == GrB_NO_VALUE) ? GrB_EMPTY_OBJECT : info) ; - } - return (GB_desc_set (desc, i, field, Werk)) ; -} - -//------------------------------------------------------------------------------ -// GrB_Descriptor_set_String -//------------------------------------------------------------------------------ - -GrB_Info GrB_Descriptor_set_String -( - GrB_Descriptor desc, - char * value, - GrB_Field field -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc == NULL || desc->header_size == 0 || field != GrB_NAME) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GrB_Descriptor_set_String (desc, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - GB_RETURN_IF_NULL (value) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - - //-------------------------------------------------------------------------- - // set the field - //-------------------------------------------------------------------------- - - return (GB_user_name_set (&(desc->user_name), &(desc->user_name_size), - value, false)) ; -} - -//------------------------------------------------------------------------------ -// GrB_Descriptor_set_INT32 -//------------------------------------------------------------------------------ - -GrB_Info GrB_Descriptor_set_INT32 -( - GrB_Descriptor desc, - int32_t value, - GrB_Field field -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc == NULL || desc->header_size == 0) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GrB_Descriptor_set_INT32 (desc, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - - //-------------------------------------------------------------------------- - // set the field - //-------------------------------------------------------------------------- - - return (GB_desc_set (desc, value, field, Werk)) ; -} - -//------------------------------------------------------------------------------ -// GrB_Descriptor_set_VOID -//------------------------------------------------------------------------------ - -GrB_Info GrB_Descriptor_set_VOID -( - GrB_Descriptor desc, - void * value, - GrB_Field field, - size_t size -) -{ - return (GrB_INVALID_VALUE) ; -} - diff --git a/GraphBLAS/Source/get_set/GrB_Global_get.c b/GraphBLAS/Source/get_set/GrB_Global_get.c index 75ac49d15c..2077d3e34c 100644 --- a/GraphBLAS/Source/get_set/GrB_Global_get.c +++ b/GraphBLAS/Source/get_set/GrB_Global_get.c @@ -2,7 +2,7 @@ // GrB_Global_get_*: get a global option //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -88,6 +88,25 @@ static GrB_Info GB_global_enum_get (int32_t *value, int field) GxB_BY_COL : GxB_BY_ROW ; break ; + case GxB_OFFSET_INTEGER_HINT : + + (*value) = (int) GB_Global_p_control_get ( ) ; + break ; + + case GxB_COLINDEX_INTEGER_HINT : + + (*value) = (int) (GB_Global_is_csc_get ( ) ? + GB_Global_j_control_get ( ) : + GB_Global_i_control_get ( )) ; + break ; + + case GxB_ROWINDEX_INTEGER_HINT : + + (*value) = (int) (GB_Global_is_csc_get ( ) ? + GB_Global_i_control_get ( ) : + GB_Global_j_control_get ( )) ; + break ; + case GxB_GLOBAL_NTHREADS : // same as GxB_NTHREADS (*value) = (int) GB_Context_nthreads_max_get (NULL) ; @@ -117,6 +136,11 @@ static GrB_Info GB_global_enum_get (int32_t *value, int field) (*value) = (int) GB_Global_print_one_based_get ( ) ; break ; + case GxB_INCLUDE_READONLY_STATISTICS : + + (*value) = (int) GB_Global_stats_mem_shallow_get ( ) ; + break ; + case GxB_JIT_C_CONTROL : (*value) = (int) GB_jitifyer_get_control ( ) ; @@ -143,8 +167,8 @@ static GrB_Info GB_global_enum_get (int32_t *value, int field) GrB_Info GrB_Global_get_Scalar ( GrB_Global g, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -152,15 +176,16 @@ GrB_Info GrB_Global_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_get_Scalar (g, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (g) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (g) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_Global_get_Scalar (g, scalar, field)") ; + ASSERT_SCALAR_OK (scalar, "input Scalar for GrB_Global_get_Scalar", GB0) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - GrB_Info info = GrB_NO_VALUE ; + info = GrB_NO_VALUE ; #pragma omp critical (GB_global_get_set) { @@ -169,20 +194,20 @@ GrB_Info GrB_Global_get_Scalar if (info == GrB_SUCCESS) { // field specifies an int: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } else { double x ; - int64_t i64 ; + int64_t i64 ; switch ((int) field) { case GxB_HYPER_SWITCH : x = (double) GB_Global_hyper_switch_get ( ) ; - info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &x, 0, 0, GB_FP64_code, Werk) ; break ; @@ -190,14 +215,14 @@ GrB_Info GrB_Global_get_Scalar case GxB_GLOBAL_CHUNK : // same as GxB_CHUNK x = GB_Context_chunk_get (NULL) ; - info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &x, 0, 0, GB_FP64_code, Werk) ; break ; case GxB_HYPER_HASH : i64 = GB_Global_hyper_hash_get ( ) ; - info = GB_setElement ((GrB_Matrix) value, NULL, &i64, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i64, 0, 0, GB_INT64_code, Werk) ; break ; @@ -208,6 +233,7 @@ GrB_Info GrB_Global_get_Scalar } } + ASSERT_SCALAR_OK (scalar, "output Scalar for GrB_Global_get_Scalar", GB0) ; return (info) ; } @@ -342,7 +368,7 @@ GrB_Info GrB_Global_get_String ( GrB_Global g, char * value, - GrB_Field field + int field ) { @@ -350,7 +376,7 @@ GrB_Info GrB_Global_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_get_String (g, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; GB_RETURN_IF_NULL (value) ; (*value) = '\0' ; @@ -383,7 +409,7 @@ GrB_Info GrB_Global_get_INT32 ( GrB_Global g, int32_t * value, - GrB_Field field + int field ) { @@ -391,7 +417,7 @@ GrB_Info GrB_Global_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_get_INT32 (g, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; GB_RETURN_IF_NULL (value) ; @@ -417,7 +443,7 @@ GrB_Info GrB_Global_get_SIZE ( GrB_Global g, size_t * value, - GrB_Field field + int field ) { @@ -425,7 +451,7 @@ GrB_Info GrB_Global_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_get_SIZE (g, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; GB_RETURN_IF_NULL (value) ; (*value) = 0 ; @@ -489,7 +515,7 @@ GrB_Info GrB_Global_get_VOID ( GrB_Global g, void * value, - GrB_Field field + int field ) { @@ -497,7 +523,7 @@ GrB_Info GrB_Global_get_VOID // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_get_VOID (g, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; GB_RETURN_IF_NULL (value) ; diff --git a/GraphBLAS/Source/get_set/GrB_Global_set.c b/GraphBLAS/Source/get_set/GrB_Global_set.c index 21c3806db0..cb7ee378de 100644 --- a/GraphBLAS/Source/get_set/GrB_Global_set.c +++ b/GraphBLAS/Source/get_set/GrB_Global_set.c @@ -2,7 +2,7 @@ // GrB_Global_set_*: set a global option //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,48 @@ static GrB_Info GB_global_enum_set (int32_t value, int field) { return (GrB_INVALID_VALUE) ; } - GB_Global_is_csc_set (value != (int) GxB_BY_ROW) ; + GB_Global_is_csc_set (value != (int) GxB_BY_ROW) ; + break ; + + case GxB_OFFSET_INTEGER_HINT : + + if (!(value == 32 || value == 64)) + { + return (GrB_INVALID_VALUE) ; + } + GB_Global_p_control_set (value) ; + break ; + + case GxB_COLINDEX_INTEGER_HINT : + + if (!(value == 32 || value == 64)) + { + return (GrB_INVALID_VALUE) ; + } + if (GB_Global_is_csc_get ( )) + { + GB_Global_j_control_set (value) ; + } + else + { + GB_Global_i_control_set (value) ; + } + break ; + + case GxB_ROWINDEX_INTEGER_HINT : + + if (!(value == 32 || value == 64)) + { + return (GrB_INVALID_VALUE) ; + } + if (GB_Global_is_csc_get ( )) + { + GB_Global_i_control_set (value) ; + } + else + { + GB_Global_j_control_set (value) ; + } break ; case GxB_GLOBAL_NTHREADS : // same as GxB_NTHREADS @@ -61,6 +102,11 @@ static GrB_Info GB_global_enum_set (int32_t value, int field) GB_Global_print_one_based_set ((bool) value) ; break ; + case GxB_INCLUDE_READONLY_STATISTICS : + + GB_Global_stats_mem_shallow_set ((bool) value) ; + break ; + case GxB_JIT_USE_CMAKE : GB_jitifyer_set_use_cmake ((bool) value) ; @@ -86,8 +132,8 @@ static GrB_Info GB_global_enum_set (int32_t value, int field) GrB_Info GrB_Global_set_Scalar ( GrB_Global g, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -95,16 +141,15 @@ GrB_Info GrB_Global_set_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_set_Scalar (g, value, field)") ; + GrB_Info info = GrB_NO_VALUE ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL_OR_INVALID (scalar) ; //-------------------------------------------------------------------------- // set the field //-------------------------------------------------------------------------- - GrB_Info info = GrB_NO_VALUE ; - #pragma omp critical (GB_global_get_set) { double dvalue = 0 ; @@ -115,7 +160,7 @@ GrB_Info GrB_Global_set_Scalar case GxB_HYPER_SWITCH : - info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + info = GrB_Scalar_extractElement_FP64 (&dvalue, scalar) ; if (info == GrB_SUCCESS) { GB_Global_hyper_switch_set ((float) dvalue) ; @@ -124,7 +169,7 @@ GrB_Info GrB_Global_set_Scalar case GxB_GLOBAL_CHUNK : // same as GxB_CHUNK - info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + info = GrB_Scalar_extractElement_FP64 (&dvalue, scalar) ; if (info == GrB_SUCCESS) { GB_Context_chunk_set (NULL, dvalue) ; @@ -133,7 +178,7 @@ GrB_Info GrB_Global_set_Scalar case GxB_HYPER_HASH : - info = GrB_Scalar_extractElement_INT64 (&i64value, value) ; + info = GrB_Scalar_extractElement_INT64 (&i64value, scalar) ; if (info == GrB_SUCCESS) { GB_Global_hyper_hash_set (i64value) ; @@ -142,7 +187,7 @@ GrB_Info GrB_Global_set_Scalar default : - info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + info = GrB_Scalar_extractElement_INT32 (&ivalue, scalar) ; if (info == GrB_SUCCESS) { info = GB_global_enum_set (ivalue, field) ; @@ -162,7 +207,7 @@ GrB_Info GrB_Global_set_String ( GrB_Global g, char * value, - GrB_Field field + int field ) { @@ -170,7 +215,8 @@ GrB_Info GrB_Global_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_set_String (g, value, field)") ; + GrB_Info info = GrB_NO_VALUE ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; GB_RETURN_IF_NULL (value) ; @@ -178,8 +224,6 @@ GrB_Info GrB_Global_set_String // get the field //-------------------------------------------------------------------------- - GrB_Info info = GrB_NO_VALUE ; - #pragma omp critical (GB_global_get_set) { switch ((int) field) @@ -248,7 +292,7 @@ GrB_Info GrB_Global_set_INT32 ( GrB_Global g, int32_t value, - GrB_Field field + int field ) { @@ -256,15 +300,14 @@ GrB_Info GrB_Global_set_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_set_INT32 (g, value, field)") ; + GrB_Info info = GrB_NO_VALUE ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; //-------------------------------------------------------------------------- // set the field //-------------------------------------------------------------------------- - GrB_Info info = GrB_NO_VALUE ; - #pragma omp critical (GB_global_get_set) { info = GB_global_enum_set (value, field) ; @@ -277,11 +320,13 @@ GrB_Info GrB_Global_set_INT32 // GrB_Global_set_VOID //------------------------------------------------------------------------------ +#include "include/GB_pedantic_disable.h" + GrB_Info GrB_Global_set_VOID ( GrB_Global g, void * value, - GrB_Field field, + int field, size_t size ) { @@ -290,15 +335,14 @@ GrB_Info GrB_Global_set_VOID // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Global_set_VOID (g, value, field, size)") ; + GrB_Info info = GrB_SUCCESS ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (g) ; //-------------------------------------------------------------------------- // set the field //-------------------------------------------------------------------------- - GrB_Info info = GrB_SUCCESS ; - #pragma omp critical (GB_global_get_set) { switch ((int) field) diff --git a/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_get.c b/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_get.c index b36db229b7..c640cc2981 100644 --- a/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_get.c +++ b/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_get.c @@ -2,7 +2,7 @@ // GrB_IndexUnaryOp_get_*: get a field in a idxunop //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_IndexUnaryOp_get_Scalar ( GrB_IndexUnaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,16 +25,18 @@ GrB_Info GrB_IndexUnaryOp_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_get_Scalar (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_IndexUnaryOp_get_Scalar (op, scalar, field)") ; + ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; + return (GB_op_scalar_get ((GB_Operator) op, scalar, field, Werk)) ; } //------------------------------------------------------------------------------ @@ -45,7 +47,7 @@ GrB_Info GrB_IndexUnaryOp_get_String ( GrB_IndexUnaryOp op, char * value, - GrB_Field field + int field ) { @@ -53,7 +55,7 @@ GrB_Info GrB_IndexUnaryOp_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_get_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; @@ -73,7 +75,7 @@ GrB_Info GrB_IndexUnaryOp_get_INT32 ( GrB_IndexUnaryOp op, int32_t * value, - GrB_Field field + int field ) { @@ -81,7 +83,7 @@ GrB_Info GrB_IndexUnaryOp_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_get_INT32 (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; @@ -101,7 +103,7 @@ GrB_Info GrB_IndexUnaryOp_get_SIZE ( GrB_IndexUnaryOp op, size_t * value, - GrB_Field field + int field ) { @@ -109,7 +111,7 @@ GrB_Info GrB_IndexUnaryOp_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_get_SIZE (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for get", GB0) ; @@ -129,7 +131,7 @@ GrB_Info GrB_IndexUnaryOp_get_VOID ( GrB_IndexUnaryOp op, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_set.c b/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_set.c index 2759b206de..052a4f0006 100644 --- a/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_set.c +++ b/GraphBLAS/Source/get_set/GrB_IndexUnaryOp_set.c @@ -2,7 +2,7 @@ // GrB_IndexUnaryOp_set_*: set a field in a unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_IndexUnaryOp_set_Scalar ( GrB_IndexUnaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_IndexUnaryOp_set_String ( GrB_IndexUnaryOp op, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_IndexUnaryOp_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_set_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for set", GB0) ; @@ -59,7 +59,7 @@ GrB_Info GrB_IndexUnaryOp_set_INT32 ( GrB_IndexUnaryOp op, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -73,7 +73,7 @@ GrB_Info GrB_IndexUnaryOp_set_VOID ( GrB_IndexUnaryOp op, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Matrix_get.c b/GraphBLAS/Source/get_set/GrB_Matrix_get.c index 15bb6484cb..9ec2b2d25b 100644 --- a/GraphBLAS/Source/get_set/GrB_Matrix_get.c +++ b/GraphBLAS/Source/get_set/GrB_Matrix_get.c @@ -2,7 +2,7 @@ // GrB_Matrix_get_*: get a field in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Matrix_get_Scalar ( GrB_Matrix A, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GrB_Matrix_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_get_Scalar (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_2 (A, scalar, "GrB_Matrix_get_Scalar (A, scalar, field)") ; + ASSERT_MATRIX_OK (A, "A to get option", GB0) ; //-------------------------------------------------------------------------- @@ -35,11 +36,11 @@ GrB_Info GrB_Matrix_get_Scalar //-------------------------------------------------------------------------- int32_t i ; - GrB_Info info = GB_matvec_enum_get (A, &i, field) ; + info = GB_matvec_enum_get (A, &i, field) ; if (info == GrB_SUCCESS) { // field specifies an int: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } else @@ -59,7 +60,7 @@ GrB_Info GrB_Matrix_get_Scalar return (GrB_INVALID_VALUE) ; } // field specifies a double: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &x, 0, 0, GB_FP64_code, Werk) ; } @@ -74,7 +75,7 @@ GrB_Info GrB_Matrix_get_String ( GrB_Matrix A, char * value, - GrB_Field field + int field ) { @@ -82,8 +83,9 @@ GrB_Info GrB_Matrix_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_get_String (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (value) ; ASSERT_MATRIX_OK (A, "A to get option", GB0) ; @@ -102,7 +104,7 @@ GrB_Info GrB_Matrix_get_INT32 ( GrB_Matrix A, int32_t * value, - GrB_Field field + int field ) { @@ -110,8 +112,9 @@ GrB_Info GrB_Matrix_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_get_INT32 (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (value) ; ASSERT_MATRIX_OK (A, "A to get option", GB0) ; @@ -130,7 +133,7 @@ GrB_Info GrB_Matrix_get_SIZE ( GrB_Matrix A, size_t * value, - GrB_Field field + int field ) { @@ -138,8 +141,9 @@ GrB_Info GrB_Matrix_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_get_SIZE (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (value) ; ASSERT_MATRIX_OK (A, "A to get option", GB0) ; @@ -158,7 +162,7 @@ GrB_Info GrB_Matrix_get_VOID ( GrB_Matrix A, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_Matrix_set.c b/GraphBLAS/Source/get_set/GrB_Matrix_set.c index 2fa8c28631..a9a9564afc 100644 --- a/GraphBLAS/Source/get_set/GrB_Matrix_set.c +++ b/GraphBLAS/Source/get_set/GrB_Matrix_set.c @@ -2,7 +2,7 @@ // GrB_Matrix_set_*: set a field in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Matrix_set_Scalar ( GrB_Matrix A, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,11 @@ GrB_Info GrB_Matrix_set_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_set_Scalar (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_2 (A, scalar, "GrB_Matrix_set_Scalar (A, scalar, field)") ; + + ASSERT_MATRIX_OK (A, "GrB: A to set Scalar option", GB0) ; //-------------------------------------------------------------------------- // set the field @@ -35,7 +37,6 @@ GrB_Info GrB_Matrix_set_Scalar double dvalue = 0 ; int32_t ivalue = 0 ; - GrB_Info info ; switch ((int) field) { @@ -43,12 +44,12 @@ GrB_Info GrB_Matrix_set_Scalar case GxB_HYPER_SWITCH : case GxB_BITMAP_SWITCH : - info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + info = GrB_Scalar_extractElement_FP64 (&dvalue, scalar) ; break ; default : - info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + info = GrB_Scalar_extractElement_INT32 (&ivalue, scalar) ; break ; } @@ -68,7 +69,7 @@ GrB_Info GrB_Matrix_set_String ( GrB_Matrix A, char * value, - GrB_Field field + int field ) { @@ -76,10 +77,11 @@ GrB_Info GrB_Matrix_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_set_String (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (value) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; + ASSERT_MATRIX_OK (A, "GrB: A to set String option", GB0) ; //-------------------------------------------------------------------------- // set the field @@ -96,7 +98,7 @@ GrB_Info GrB_Matrix_set_INT32 ( GrB_Matrix A, int32_t value, - GrB_Field field + int field ) { @@ -104,9 +106,10 @@ GrB_Info GrB_Matrix_set_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_set_INT32 (A, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE1 (A, "GrB_Matrix_set_INT32 (A, value, field)") ; + + ASSERT_MATRIX_OK (A, "GrB: A to set int32 option", GB0) ; //-------------------------------------------------------------------------- // set the field @@ -123,7 +126,7 @@ GrB_Info GrB_Matrix_set_VOID ( GrB_Matrix A, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Monoid_get.c b/GraphBLAS/Source/get_set/GrB_Monoid_get.c index a3b40adba1..a700bb6cb2 100644 --- a/GraphBLAS/Source/get_set/GrB_Monoid_get.c +++ b/GraphBLAS/Source/get_set/GrB_Monoid_get.c @@ -2,7 +2,7 @@ // GrB_Monoid_get_*: get a field in a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Monoid_get_Scalar ( GrB_Monoid monoid, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,16 +25,17 @@ GrB_Info GrB_Monoid_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_get_Scalar (monoid, value, field)") ; + GB_RETURN_IF_NULL (scalar) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_WHERE_1 (scalar, "GrB_Monoid_get_Scalar (monoid, scalar, field)") ; + ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - return (GB_monoid_get (monoid, value, field, Werk)) ; + return (GB_monoid_get (monoid, scalar, field, Werk)) ; } //------------------------------------------------------------------------------ @@ -45,7 +46,7 @@ GrB_Info GrB_Monoid_get_String ( GrB_Monoid monoid, char * value, - GrB_Field field + int field ) { @@ -53,7 +54,7 @@ GrB_Info GrB_Monoid_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_get_String (monoid, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; GB_RETURN_IF_NULL (value) ; ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; @@ -97,7 +98,7 @@ GrB_Info GrB_Monoid_get_INT32 ( GrB_Monoid monoid, int32_t * value, - GrB_Field field + int field ) { @@ -105,7 +106,7 @@ GrB_Info GrB_Monoid_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_get_INT32 (monoid, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; GB_RETURN_IF_NULL (value) ; ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; @@ -125,7 +126,7 @@ GrB_Info GrB_Monoid_get_SIZE ( GrB_Monoid monoid, size_t * value, - GrB_Field field + int field ) { @@ -133,7 +134,7 @@ GrB_Info GrB_Monoid_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_get_SIZE (monoid, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; GB_RETURN_IF_NULL (value) ; ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; @@ -180,7 +181,7 @@ GrB_Info GrB_Monoid_get_VOID ( GrB_Monoid monoid, void * value, - GrB_Field field + int field ) { @@ -188,7 +189,7 @@ GrB_Info GrB_Monoid_get_VOID // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_get_VOID (monoid, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; GB_RETURN_IF_NULL (value) ; ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; diff --git a/GraphBLAS/Source/get_set/GrB_Monoid_set.c b/GraphBLAS/Source/get_set/GrB_Monoid_set.c index bf2adcbf23..9e5d3f89b2 100644 --- a/GraphBLAS/Source/get_set/GrB_Monoid_set.c +++ b/GraphBLAS/Source/get_set/GrB_Monoid_set.c @@ -2,7 +2,7 @@ // GrB_Monoid_set_*: set a field in a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Monoid_set_Scalar ( GrB_Monoid monoid, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_Monoid_set_String ( GrB_Monoid monoid, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_Monoid_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_set_String (monoid, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; GB_RETURN_IF_NULL (value) ; ASSERT_MONOID_OK (monoid, "monoid to get option", GB0) ; @@ -66,7 +66,7 @@ GrB_Info GrB_Monoid_set_INT32 ( GrB_Monoid monoid, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -80,7 +80,7 @@ GrB_Info GrB_Monoid_set_VOID ( GrB_Monoid monoid, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Scalar_get.c b/GraphBLAS/Source/get_set/GrB_Scalar_get.c index 37dff04bbd..3016c0a642 100644 --- a/GraphBLAS/Source/get_set/GrB_Scalar_get.c +++ b/GraphBLAS/Source/get_set/GrB_Scalar_get.c @@ -2,7 +2,7 @@ // GrB_Scalar_get_*: get a field in a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Scalar_get_Scalar ( GrB_Scalar s, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GrB_Scalar_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_get_Scalar (s, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (s) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE2 (s, scalar, "GrB_Scalar_get_Scalar (s, scalar, field)") ; + ASSERT_SCALAR_OK (s, "s to get option", GB0) ; //-------------------------------------------------------------------------- @@ -35,11 +36,11 @@ GrB_Info GrB_Scalar_get_Scalar //-------------------------------------------------------------------------- int32_t i ; - GrB_Info info = GB_matvec_enum_get ((GrB_Matrix) s, &i, field) ; + info = GB_matvec_enum_get ((GrB_Matrix) s, &i, field) ; if (info == GrB_SUCCESS) { // field specifies an int32_t: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } return (info) ; @@ -53,7 +54,7 @@ GrB_Info GrB_Scalar_get_String ( GrB_Scalar s, char * value, - GrB_Field field + int field ) { @@ -61,8 +62,9 @@ GrB_Info GrB_Scalar_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_get_String (s, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; GB_RETURN_IF_NULL (value) ; ASSERT_SCALAR_OK (s, "s to get option", GB0) ; @@ -81,7 +83,7 @@ GrB_Info GrB_Scalar_get_INT32 ( GrB_Scalar s, int32_t * value, - GrB_Field field + int field ) { @@ -89,8 +91,9 @@ GrB_Info GrB_Scalar_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_get_INT32 (s, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; GB_RETURN_IF_NULL (value) ; ASSERT_SCALAR_OK (s, "s to get option", GB0) ; @@ -109,7 +112,7 @@ GrB_Info GrB_Scalar_get_SIZE ( GrB_Scalar s, size_t * value, - GrB_Field field + int field ) { @@ -117,8 +120,9 @@ GrB_Info GrB_Scalar_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_get_SIZE (s, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; GB_RETURN_IF_NULL (value) ; ASSERT_SCALAR_OK (s, "s to get option", GB0) ; @@ -137,7 +141,7 @@ GrB_Info GrB_Scalar_get_VOID ( GrB_Scalar s, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_Scalar_set.c b/GraphBLAS/Source/get_set/GrB_Scalar_set.c index 0ca6231600..4ed8771912 100644 --- a/GraphBLAS/Source/get_set/GrB_Scalar_set.c +++ b/GraphBLAS/Source/get_set/GrB_Scalar_set.c @@ -2,7 +2,7 @@ // GrB_Scalar_set_*: set a field in a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Scalar_set_Scalar ( GrB_Scalar s, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { // all settings are ignored @@ -33,7 +33,7 @@ GrB_Info GrB_Scalar_set_String ( GrB_Scalar s, char * value, - GrB_Field field + int field ) { @@ -41,8 +41,9 @@ GrB_Info GrB_Scalar_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_set_String (s, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; GB_RETURN_IF_NULL (value) ; ASSERT_SCALAR_OK (s, "s to set option", GB0) ; @@ -61,7 +62,7 @@ GrB_Info GrB_Scalar_set_INT32 ( GrB_Scalar s, int32_t value, - GrB_Field field + int field ) { // all settings are ignored @@ -77,7 +78,7 @@ GrB_Info GrB_Scalar_set_VOID ( GrB_Scalar s, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Semiring_get.c b/GraphBLAS/Source/get_set/GrB_Semiring_get.c index a9428f5408..fdbac6ccc6 100644 --- a/GraphBLAS/Source/get_set/GrB_Semiring_get.c +++ b/GraphBLAS/Source/get_set/GrB_Semiring_get.c @@ -2,7 +2,7 @@ // GrB_Semiring_get_*: get a field in a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Semiring_get_Scalar ( GrB_Semiring semiring, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GrB_Semiring_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_get_Scalar (semiring, value, field)") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_Semiring_get_Scalar (semiring, scalar, field)") ; + ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; //-------------------------------------------------------------------------- @@ -38,10 +39,10 @@ GrB_Info GrB_Semiring_get_Scalar { case GxB_MONOID_IDENTITY : case GxB_MONOID_TERMINAL : - return (GB_monoid_get (semiring->add, value, field, Werk)) ; + return (GB_monoid_get (semiring->add, scalar, field, Werk)) ; default : return (GB_op_scalar_get ((GB_Operator) (semiring->multiply), - value, field, Werk)) ; + scalar, field, Werk)) ; } } @@ -53,7 +54,7 @@ GrB_Info GrB_Semiring_get_String ( GrB_Semiring semiring, char * value, - GrB_Field field + int field ) { @@ -61,7 +62,7 @@ GrB_Info GrB_Semiring_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_get_String (semiring, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; GB_RETURN_IF_NULL (value) ; ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; @@ -106,7 +107,7 @@ GrB_Info GrB_Semiring_get_INT32 ( GrB_Semiring semiring, int32_t * value, - GrB_Field field + int field ) { @@ -114,7 +115,7 @@ GrB_Info GrB_Semiring_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_get_INT32 (semiring, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; GB_RETURN_IF_NULL (value) ; ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; @@ -134,7 +135,7 @@ GrB_Info GrB_Semiring_get_SIZE ( GrB_Semiring semiring, size_t * value, - GrB_Field field + int field ) { @@ -142,7 +143,7 @@ GrB_Info GrB_Semiring_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_get_SIZE (semiring, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; GB_RETURN_IF_NULL (value) ; ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; @@ -204,7 +205,7 @@ GrB_Info GrB_Semiring_get_VOID ( GrB_Semiring semiring, void * value, - GrB_Field field + int field ) { @@ -212,7 +213,7 @@ GrB_Info GrB_Semiring_get_VOID // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_get_VOID (semiring, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; GB_RETURN_IF_NULL (value) ; ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; diff --git a/GraphBLAS/Source/get_set/GrB_Semiring_set.c b/GraphBLAS/Source/get_set/GrB_Semiring_set.c index 5c87c85a5e..85a8e4b36f 100644 --- a/GraphBLAS/Source/get_set/GrB_Semiring_set.c +++ b/GraphBLAS/Source/get_set/GrB_Semiring_set.c @@ -2,7 +2,7 @@ // GrB_Semiring_set_*: set a field in a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Semiring_set_Scalar ( GrB_Semiring semiring, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_Semiring_set_String ( GrB_Semiring semiring, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_Semiring_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_set_String (semiring, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; GB_RETURN_IF_NULL (value) ; ASSERT_SEMIRING_OK (semiring, "semiring to get option", GB0) ; @@ -66,7 +66,7 @@ GrB_Info GrB_Semiring_set_INT32 ( GrB_Semiring semiring, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -80,7 +80,7 @@ GrB_Info GrB_Semiring_set_VOID ( GrB_Semiring semiring, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Type_get.c b/GraphBLAS/Source/get_set/GrB_Type_get.c index 5c9ef4eb5c..98cbda430b 100644 --- a/GraphBLAS/Source/get_set/GrB_Type_get.c +++ b/GraphBLAS/Source/get_set/GrB_Type_get.c @@ -2,7 +2,7 @@ // GrB_Type_get_*: get a field in a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Type_get_Scalar ( GrB_Type type, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GrB_Type_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_get_Scalar (type, value, field)") ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_Type_get_Scalar (type, scalar, field)") ; + ASSERT_TYPE_OK (type, "type for get", GB0) ; //-------------------------------------------------------------------------- @@ -41,13 +42,13 @@ GrB_Info GrB_Type_get_Scalar { case GrB_EL_TYPE_CODE : i = (int32_t) GB_type_code_get (type->code) ; - return (GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + return (GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk)) ; break ; case GrB_SIZE : u = (uint64_t) type->size ; - return (GB_setElement ((GrB_Matrix) value, NULL, &u, 0, 0, + return (GB_setElement ((GrB_Matrix) scalar, NULL, &u, 0, 0, GB_UINT64_code, Werk)) ; break ; @@ -64,7 +65,7 @@ GrB_Info GrB_Type_get_String ( GrB_Type type, char * value, - GrB_Field field + int field ) { @@ -72,7 +73,7 @@ GrB_Info GrB_Type_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_get_String (type, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; GB_RETURN_IF_NULL (value) ; ASSERT_TYPE_OK (type, "type for get", GB0) ; @@ -126,7 +127,7 @@ GrB_Info GrB_Type_get_INT32 ( GrB_Type type, int32_t * value, - GrB_Field field + int field ) { @@ -134,7 +135,7 @@ GrB_Info GrB_Type_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_get_INT32 (type, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; GB_RETURN_IF_NULL (value) ; ASSERT_TYPE_OK (type, "type for get", GB0) ; @@ -167,7 +168,7 @@ GrB_Info GrB_Type_get_SIZE ( GrB_Type type, size_t * value, - GrB_Field field + int field ) { @@ -175,7 +176,7 @@ GrB_Info GrB_Type_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_get_SIZE (type, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; GB_RETURN_IF_NULL (value) ; ASSERT_TYPE_OK (type, "type for get", GB0) ; @@ -227,7 +228,7 @@ GrB_Info GrB_Type_get_VOID ( GrB_Type type, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_Type_set.c b/GraphBLAS/Source/get_set/GrB_Type_set.c index bef8fc659c..f9b41dac55 100644 --- a/GraphBLAS/Source/get_set/GrB_Type_set.c +++ b/GraphBLAS/Source/get_set/GrB_Type_set.c @@ -2,7 +2,7 @@ // GrB_Type_set_*: set a field in a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Type_set_Scalar ( GrB_Type type, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_Type_set_String ( GrB_Type type, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_Type_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_set_String (type, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; GB_RETURN_IF_NULL (value) ; ASSERT_TYPE_OK (type, "unaryop for get", GB0) ; @@ -64,7 +64,7 @@ GrB_Info GrB_Type_set_INT32 ( GrB_Type type, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -78,7 +78,7 @@ GrB_Info GrB_Type_set_VOID ( GrB_Type type, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_UnaryOp_get.c b/GraphBLAS/Source/get_set/GrB_UnaryOp_get.c index 3aca01c81e..a75fcf23ca 100644 --- a/GraphBLAS/Source/get_set/GrB_UnaryOp_get.c +++ b/GraphBLAS/Source/get_set/GrB_UnaryOp_get.c @@ -2,7 +2,7 @@ // GrB_UnaryOp_get_*: get a field in a unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_UnaryOp_get_Scalar ( GrB_UnaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,16 +25,17 @@ GrB_Info GrB_UnaryOp_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_get_Scalar (op, value, field)") ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GrB_UnaryOp_get_Scalar (op, scalar, field)") ; + ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; + return (GB_op_scalar_get ((GB_Operator) op, scalar, field, Werk)) ; } //------------------------------------------------------------------------------ @@ -45,7 +46,7 @@ GrB_Info GrB_UnaryOp_get_String ( GrB_UnaryOp op, char * value, - GrB_Field field + int field ) { @@ -53,7 +54,7 @@ GrB_Info GrB_UnaryOp_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_get_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; @@ -73,7 +74,7 @@ GrB_Info GrB_UnaryOp_get_INT32 ( GrB_UnaryOp op, int32_t * value, - GrB_Field field + int field ) { @@ -81,7 +82,7 @@ GrB_Info GrB_UnaryOp_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_get_INT32 (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; @@ -101,7 +102,7 @@ GrB_Info GrB_UnaryOp_get_SIZE ( GrB_UnaryOp op, size_t * value, - GrB_Field field + int field ) { @@ -109,7 +110,7 @@ GrB_Info GrB_UnaryOp_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_get_SIZE (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_UNARYOP_OK (op, "unaryop for get", GB0) ; @@ -129,7 +130,7 @@ GrB_Info GrB_UnaryOp_get_VOID ( GrB_UnaryOp op, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_UnaryOp_set.c b/GraphBLAS/Source/get_set/GrB_UnaryOp_set.c index 08f35bc370..c0d4df3ea0 100644 --- a/GraphBLAS/Source/get_set/GrB_UnaryOp_set.c +++ b/GraphBLAS/Source/get_set/GrB_UnaryOp_set.c @@ -2,7 +2,7 @@ // GrB_UnaryOp_set_*: set a field in a unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_UnaryOp_set_Scalar ( GrB_UnaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GrB_UnaryOp_set_String ( GrB_UnaryOp op, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GrB_UnaryOp_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_set_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_UNARYOP_OK (op, "unaryop for set", GB0) ; @@ -59,7 +59,7 @@ GrB_Info GrB_UnaryOp_set_INT32 ( GrB_UnaryOp op, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -73,7 +73,7 @@ GrB_Info GrB_UnaryOp_set_VOID ( GrB_UnaryOp op, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GrB_Vector_get.c b/GraphBLAS/Source/get_set/GrB_Vector_get.c index 8c4d2281fe..1231092c32 100644 --- a/GraphBLAS/Source/get_set/GrB_Vector_get.c +++ b/GraphBLAS/Source/get_set/GrB_Vector_get.c @@ -2,7 +2,7 @@ // GrB_Vector_get_*: get a field in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Vector_get_Scalar ( GrB_Vector v, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GrB_Vector_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_get_Scalar (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE2 (v, scalar, "GrB_Vector_get_Scalar (v, scalar, field)") ; + ASSERT_VECTOR_OK (v, "v to get option", GB0) ; //-------------------------------------------------------------------------- @@ -35,11 +36,11 @@ GrB_Info GrB_Vector_get_Scalar //-------------------------------------------------------------------------- int32_t i ; - GrB_Info info = GB_matvec_enum_get ((GrB_Matrix) v, &i, field) ; + info = GB_matvec_enum_get ((GrB_Matrix) v, &i, field) ; if (info == GrB_SUCCESS) { // field specifies an int32_t: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &i, 0, 0, GB_INT32_code, Werk) ; } else @@ -55,7 +56,7 @@ GrB_Info GrB_Vector_get_Scalar return (GrB_INVALID_VALUE) ; } // field specifies a double: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &x, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &x, 0, 0, GB_FP64_code, Werk) ; } @@ -70,7 +71,7 @@ GrB_Info GrB_Vector_get_String ( GrB_Vector v, char * value, - GrB_Field field + int field ) { @@ -78,8 +79,9 @@ GrB_Info GrB_Vector_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_get_String (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; GB_RETURN_IF_NULL (value) ; ASSERT_VECTOR_OK (v, "v to get option", GB0) ; @@ -98,7 +100,7 @@ GrB_Info GrB_Vector_get_INT32 ( GrB_Vector v, int32_t * value, - GrB_Field field + int field ) { @@ -106,8 +108,9 @@ GrB_Info GrB_Vector_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_get_INT32 (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; GB_RETURN_IF_NULL (value) ; ASSERT_VECTOR_OK (v, "v to get option", GB0) ; @@ -126,7 +129,7 @@ GrB_Info GrB_Vector_get_SIZE ( GrB_Vector v, size_t * value, - GrB_Field field + int field ) { @@ -134,8 +137,9 @@ GrB_Info GrB_Vector_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_get_SIZE (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; GB_RETURN_IF_NULL (value) ; ASSERT_VECTOR_OK (v, "v to get option", GB0) ; @@ -154,7 +158,7 @@ GrB_Info GrB_Vector_get_VOID ( GrB_Vector v, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GrB_Vector_set.c b/GraphBLAS/Source/get_set/GrB_Vector_set.c index 9d8a4109f2..4d32c28891 100644 --- a/GraphBLAS/Source/get_set/GrB_Vector_set.c +++ b/GraphBLAS/Source/get_set/GrB_Vector_set.c @@ -2,7 +2,7 @@ // GrB_Vector_set_*: set a field in a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GrB_Vector_set_Scalar ( GrB_Vector v, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,8 +25,10 @@ GrB_Info GrB_Vector_set_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_set_Scalar (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE2 (v, scalar, "GrB_Vector_set_Scalar (v, scalar, field)") ; + ASSERT_VECTOR_OK (v, "v to set option", GB0) ; //-------------------------------------------------------------------------- @@ -35,15 +37,14 @@ GrB_Info GrB_Vector_set_Scalar double dvalue = 0 ; int32_t ivalue = 0 ; - GrB_Info info ; switch ((int) field) { case GxB_BITMAP_SWITCH : - info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + info = GrB_Scalar_extractElement_FP64 (&dvalue, scalar) ; break ; default : - info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + info = GrB_Scalar_extractElement_INT32 (&ivalue, scalar) ; break ; } @@ -62,7 +63,7 @@ GrB_Info GrB_Vector_set_String ( GrB_Vector v, char * value, - GrB_Field field + int field ) { @@ -70,8 +71,9 @@ GrB_Info GrB_Vector_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_set_String (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; GB_RETURN_IF_NULL (value) ; ASSERT_VECTOR_OK (v, "v to set option", GB0) ; @@ -90,7 +92,7 @@ GrB_Info GrB_Vector_set_INT32 ( GrB_Vector v, int32_t value, - GrB_Field field + int field ) { @@ -98,8 +100,9 @@ GrB_Info GrB_Vector_set_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_set_INT32 (v, value, field)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE_1 (v, "GrB_Vector_set_INT32 (v, value, field)") ; + ASSERT_VECTOR_OK (v, "v to set option", GB0) ; //-------------------------------------------------------------------------- @@ -117,7 +120,7 @@ GrB_Info GrB_Vector_set_VOID ( GrB_Vector v, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GxB_Context_get.c b/GraphBLAS/Source/get_set/GxB_Context_get.c index 927325bd7b..0b0bf74d71 100644 --- a/GraphBLAS/Source/get_set/GxB_Context_get.c +++ b/GraphBLAS/Source/get_set/GxB_Context_get.c @@ -2,7 +2,7 @@ // GxB_Context_get: get a field of Context (HISTORICAL; do not use for new code) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GxB_Context_get_INT32 // get a parameter of a Context ( GxB_Context Context, // Context to query - GxB_Context_Field field, // parameter to query + int field, // parameter to query int32_t *value // return value from the Context ) { @@ -25,7 +25,7 @@ GrB_Info GxB_Context_get_INT32 // get a parameter of a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_INT32 (Context, field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; @@ -62,7 +62,7 @@ GrB_Info GxB_Context_get_INT32 // get a parameter of a Context GrB_Info GxB_Context_get_FP64 // get a parameter in a Context ( GxB_Context Context, // Context to query - GxB_Context_Field field, // parameter to query + int field, // parameter to query double *value // return value from the Context ) { @@ -71,7 +71,7 @@ GrB_Info GxB_Context_get_FP64 // get a parameter in a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_FP64 (Context, field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; @@ -103,7 +103,7 @@ GrB_Info GxB_Context_get_FP64 // get a parameter in a Context GrB_Info GxB_Context_get // get a parameter in a Context ( GxB_Context Context, // Context to query - GxB_Context_Field field, // parameter to query + int field, // parameter to query ... // return value of the descriptor ) { @@ -112,7 +112,7 @@ GrB_Info GxB_Context_get // get a parameter in a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get (desc, field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/get_set/GxB_Context_get2.c b/GraphBLAS/Source/get_set/GxB_Context_get2.c index aca4701468..32eab3d48f 100644 --- a/GraphBLAS/Source/get_set/GxB_Context_get2.c +++ b/GraphBLAS/Source/get_set/GxB_Context_get2.c @@ -2,7 +2,7 @@ // GxB_Context_get_*: get a field in a context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GxB_Context_get_Scalar ( GxB_Context Context, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,9 +25,10 @@ GrB_Info GxB_Context_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_Scalar (Context, value, field)") ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GxB_Context_get_Scalar (Context, scalar, field)") ; + ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; //-------------------------------------------------------------------------- @@ -36,7 +37,6 @@ GrB_Info GxB_Context_get_Scalar double dvalue = 0 ; int32_t ivalue = 0 ; - GrB_Info info ; switch ((int) field) { @@ -66,12 +66,12 @@ GrB_Info GxB_Context_get_Scalar case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK - info = GB_setElement ((GrB_Matrix) value, NULL, &dvalue, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &dvalue, 0, 0, GB_FP64_code, Werk) ; break ; default : - info = GB_setElement ((GrB_Matrix) value, NULL, &ivalue, 0, 0, + info = GB_setElement ((GrB_Matrix) scalar, NULL, &ivalue, 0, 0, GB_INT32_code, Werk) ; break ; } @@ -87,7 +87,7 @@ GrB_Info GxB_Context_get_String ( GxB_Context Context, char * value, - GrB_Field field + int field ) { @@ -95,7 +95,7 @@ GrB_Info GxB_Context_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_String (Context, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; @@ -133,7 +133,7 @@ GrB_Info GxB_Context_get_INT ( GxB_Context Context, int32_t * value, - GrB_Field field + int field ) { @@ -141,7 +141,7 @@ GrB_Info GxB_Context_get_INT // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_INT (Context, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; @@ -180,7 +180,7 @@ GrB_Info GxB_Context_get_SIZE ( GxB_Context Context, size_t * value, - GrB_Field field + int field ) { @@ -188,7 +188,7 @@ GrB_Info GxB_Context_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_get_SIZE (Context, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; ASSERT_CONTEXT_OK (Context, "context for get", GB0) ; @@ -221,7 +221,7 @@ GrB_Info GxB_Context_get_VOID ( GxB_Context Context, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GxB_Context_set.c b/GraphBLAS/Source/get_set/GxB_Context_set.c index ece98c8ee8..dfc29c48a5 100644 --- a/GraphBLAS/Source/get_set/GxB_Context_set.c +++ b/GraphBLAS/Source/get_set/GxB_Context_set.c @@ -2,7 +2,7 @@ // GxB_Context_set: set a field in Context (HISTORICAL; do not use for new code) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GxB_Context_set_INT32 // set a parameter in a Context ( GxB_Context Context, // Context to modify - GxB_Context_Field field, // parameter to change + int field, // parameter to change int32_t value // value to change it to ) { @@ -25,7 +25,7 @@ GrB_Info GxB_Context_set_INT32 // set a parameter in a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set_INT32 (Context, field, value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; //-------------------------------------------------------------------------- @@ -60,7 +60,7 @@ GrB_Info GxB_Context_set_INT32 // set a parameter in a Context GrB_Info GxB_Context_set_FP64 // set a parameter in a Context ( GxB_Context Context, // Context to modify - GxB_Context_Field field, // parameter to change + int field, // parameter to change double value // value to change it to ) { @@ -69,7 +69,7 @@ GrB_Info GxB_Context_set_FP64 // set a parameter in a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set_FP64 (Context, field, value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; //-------------------------------------------------------------------------- @@ -99,7 +99,7 @@ GrB_Info GxB_Context_set_FP64 // set a parameter in a Context GrB_Info GxB_Context_set // set a parameter in a Context ( GxB_Context Context, // Context to modify - GxB_Context_Field field, // parameter to change + int field, // parameter to change ... // value to change it to ) { @@ -108,7 +108,7 @@ GrB_Info GxB_Context_set // set a parameter in a Context // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set (Context, field, value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/get_set/GxB_Context_set2.c b/GraphBLAS/Source/get_set/GxB_Context_set2.c index 3eff66b0b9..e6f13b4873 100644 --- a/GraphBLAS/Source/get_set/GxB_Context_set2.c +++ b/GraphBLAS/Source/get_set/GxB_Context_set2.c @@ -2,7 +2,7 @@ // GxB_Context_set_*: set a field in a Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GxB_Context_set_Scalar ( GxB_Context Context, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,16 +25,16 @@ GrB_Info GxB_Context_set_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set_Scalar (Context, value, field)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL_OR_INVALID (scalar) ; ASSERT_CONTEXT_OK (Context, "Context to set", GB0) ; //-------------------------------------------------------------------------- // set the field //-------------------------------------------------------------------------- - GrB_Info info ; int32_t ivalue = 0 ; double dvalue = 0 ; @@ -43,11 +43,11 @@ GrB_Info GxB_Context_set_Scalar case GxB_CONTEXT_NTHREADS : // same as GxB_NTHREADS case GxB_CONTEXT_GPU_ID : // same as GxB_GPU_ID - info = GrB_Scalar_extractElement_INT32 (&ivalue, value) ; + info = GrB_Scalar_extractElement_INT32 (&ivalue, scalar) ; break ; case GxB_CONTEXT_CHUNK : // same as GxB_CHUNK - info = GrB_Scalar_extractElement_FP64 (&dvalue, value) ; + info = GrB_Scalar_extractElement_FP64 (&dvalue, scalar) ; break ; default : @@ -91,7 +91,7 @@ GrB_Info GxB_Context_set_String ( GxB_Context Context, char * value, - GrB_Field field + int field ) { @@ -99,7 +99,7 @@ GrB_Info GxB_Context_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set_String (Context, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; GB_RETURN_IF_NULL (value) ; ASSERT_CONTEXT_OK (Context, "Context to get option", GB0) ; @@ -126,7 +126,7 @@ GrB_Info GxB_Context_set_INT ( GxB_Context Context, int32_t value, - GrB_Field field + int field ) { @@ -134,7 +134,7 @@ GrB_Info GxB_Context_set_INT // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_set_INT (Context, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; ASSERT_CONTEXT_OK (Context, "Context to set", GB0) ; @@ -170,7 +170,7 @@ GrB_Info GxB_Context_set_VOID ( GxB_Context Context, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GxB_Desc_get.c b/GraphBLAS/Source/get_set/GxB_Desc_get.c index 1904dec7a6..637f43452d 100644 --- a/GraphBLAS/Source/get_set/GxB_Desc_get.c +++ b/GraphBLAS/Source/get_set/GxB_Desc_get.c @@ -1,19 +1,12 @@ //------------------------------------------------------------------------------ -// GxB_Desc_get: get a field in a descriptor +// GxB_Desc*_get: get a field in a descriptor (historical methods) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// GxB_Desc_get is a single va_arg-based method for any descriptor option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Desc_get_INT32 int32_t scalars -// GxB_Desc_get_FP64 double scalars - #include "GB.h" //------------------------------------------------------------------------------ @@ -23,74 +16,11 @@ GrB_Info GxB_Desc_get_INT32 // get a parameter from a descriptor ( GrB_Descriptor desc, // descriptor to query; NULL is ok - GrB_Desc_Field field, // parameter to query + int field, // parameter to query int32_t *value // return value of the descriptor ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Desc_get_INT32 (desc, field, &value)") ; - GB_RETURN_IF_FAULTY (desc) ; - GB_RETURN_IF_NULL (value) ; - - //-------------------------------------------------------------------------- - // get the parameter - //-------------------------------------------------------------------------- - - switch (field) - { - case GrB_OUTP : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->out) ; - break ; - - case GrB_MASK : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->mask) ; - break ; - - case GrB_INP0 : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->in0) ; - break ; - - case GrB_INP1 : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->in1) ; - break ; - - case GxB_AxB_METHOD : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->axb) ; - break ; - - case GxB_SORT : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->do_sort); - break ; - - case GxB_COMPRESSION : - - (*value) = (int32_t) ((desc == NULL) ? - GxB_DEFAULT : desc->compression) ; - break ; - - case GxB_IMPORT : - - (*value) = (int32_t) ((desc == NULL) ? GxB_DEFAULT : desc->import) ; - if ((*value) != GxB_DEFAULT) (*value) = GxB_SECURE_IMPORT ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - #pragma omp flush - return (GrB_SUCCESS) ; +{ + return (GrB_Descriptor_get_INT32 (desc, value, field)) ; } //------------------------------------------------------------------------------ @@ -100,10 +30,10 @@ GrB_Info GxB_Desc_get_INT32 // get a parameter from a descriptor GrB_Info GxB_Desc_get_FP64 // get a parameter from a descriptor ( GrB_Descriptor desc, // descriptor to query; NULL is ok - GrB_Desc_Field field, // parameter to query + int field, // parameter to query double *value // return value of the descriptor ) -{ +{ // no longer any double parameters in the descriptor return (GrB_INVALID_VALUE) ; } @@ -115,124 +45,28 @@ GrB_Info GxB_Desc_get_FP64 // get a parameter from a descriptor GrB_Info GxB_Desc_get // get a parameter from a descriptor ( GrB_Descriptor desc, // descriptor to query; NULL is ok - GrB_Desc_Field field, // parameter to query + int field, // parameter to query ... // return value of the descriptor ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Desc_get (desc, field, &value)") ; - GB_RETURN_IF_FAULTY (desc) ; - - //-------------------------------------------------------------------------- - // get the parameter - //-------------------------------------------------------------------------- - +{ va_list ap ; + va_start (ap, field) ; + int32_t *value = va_arg (ap, int32_t *) ; + va_end (ap) ; + return (GrB_Descriptor_get_INT32 (desc, value, field)) ; +} - switch (field) - { - case GrB_OUTP : - - { - va_start (ap, field) ; - GrB_Desc_Value *value = va_arg (ap, GrB_Desc_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (value) ; - (*value) = (desc == NULL) ? GxB_DEFAULT : desc->out ; - } - break ; - - case GrB_MASK : - - { - va_start (ap, field) ; - GrB_Desc_Value *value = va_arg (ap, GrB_Desc_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (value) ; - (*value) = (desc == NULL) ? GxB_DEFAULT : desc->mask ; - } - break ; - - case GrB_INP0 : - - { - va_start (ap, field) ; - GrB_Desc_Value *value = va_arg (ap, GrB_Desc_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (value) ; - (*value) = (desc == NULL) ? GxB_DEFAULT : desc->in0 ; - } - break ; - - case GrB_INP1 : - - { - va_start (ap, field) ; - GrB_Desc_Value *value = va_arg (ap, GrB_Desc_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (value) ; - (*value) = (desc == NULL) ? GxB_DEFAULT : desc->in1 ; - } - break ; - - case GxB_AxB_METHOD : - - { - va_start (ap, field) ; - GrB_Desc_Value *value = va_arg (ap, GrB_Desc_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (value) ; - (*value) = (desc == NULL) ? GxB_DEFAULT : desc->axb ; - } - break ; - - case GxB_SORT : - - { - va_start (ap, field) ; - int *do_sort = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (do_sort) ; - int s = (desc == NULL) ? GxB_DEFAULT : desc->do_sort ; - (*do_sort) = s ; - } - break ; - - case GxB_COMPRESSION : - - { - va_start (ap, field) ; - int *compression = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (compression) ; - int s = (desc == NULL) ? GxB_DEFAULT : desc->compression ; - (*compression) = s ; - } - break ; - - case GxB_IMPORT : - - { - va_start (ap, field) ; - int *method = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (method) ; - int s = (desc == NULL) ? GxB_DEFAULT : desc->import ; - if (s != GxB_DEFAULT) s = GxB_SECURE_IMPORT ; - (*method) = s ; - } - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } +//------------------------------------------------------------------------------ +// GxB_Descriptor_get: get a field in a descriptor (historical) +//------------------------------------------------------------------------------ - #pragma omp flush - return (GrB_SUCCESS) ; +GrB_Info GxB_Descriptor_get // get a parameter from a descriptor +( + int32_t *value, // value of the parameter + GrB_Descriptor desc, // descriptor to query; NULL is ok + int field // parameter to query +) +{ + return (GrB_Descriptor_get_INT32 (desc, value, field)) ; } diff --git a/GraphBLAS/Source/get_set/GxB_Desc_set.c b/GraphBLAS/Source/get_set/GxB_Desc_set.c index 05b4355c1f..6b9626330c 100644 --- a/GraphBLAS/Source/get_set/GxB_Desc_set.c +++ b/GraphBLAS/Source/get_set/GxB_Desc_set.c @@ -1,24 +1,12 @@ //------------------------------------------------------------------------------ -// GxB_Desc_set: set a field in a descriptor +// GxB_Desc_set: set a field in a descriptor (historical methods) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// This is identical to GrB_Descriptor_set, except that the last argument is a -// pointer whose type depends on the field. For the four descriptor fields -// in the spec, the type is the same as GrB_Descriptor_set (a scalar of -// type GrB_Desc_Value). - -// GxB_Desc_set is a single va_arg-based method for any descriptor option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Desc_set_INT32 int32_t scalars -// GxB_Desc_set_FP64 double scalars - #include "GB.h" //------------------------------------------------------------------------------ @@ -28,136 +16,11 @@ GrB_Info GxB_Desc_set_INT32 // set a parameter in a descriptor ( GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change + int field, // parameter to change int32_t value // value to change it to ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc != NULL && desc->header_size == 0) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GxB_Desc_set_INT32 (desc, field, value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - - //-------------------------------------------------------------------------- - // set the parameter - //-------------------------------------------------------------------------- - - int mask = (int) desc->mask ; - - switch (field) - { - - case GrB_OUTP : - - if (! (value == GxB_DEFAULT || value == GrB_REPLACE)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_OUTP field;\n" - "must be GxB_DEFAULT [%d] or GrB_REPLACE [%d]", - value, (int) GxB_DEFAULT, (int) GrB_REPLACE) ; - } - desc->out = (GrB_Desc_Value) value ; - break ; - - case GrB_MASK : - - if (! (value == GxB_DEFAULT || - value == GrB_COMP || - value == GrB_STRUCTURE || - value == (GrB_COMP + GrB_STRUCTURE))) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_MASK field;\n" - "must be GxB_DEFAULT [%d], GrB_COMP [%d],\n" - "GrB_STRUCTURE [%d], or GrB_COMP+GrB_STRUCTURE [%d]", - value, (int) GxB_DEFAULT, (int) GrB_COMP, - (int) GrB_STRUCTURE, - (int) (GrB_COMP + GrB_STRUCTURE)) ; - } - switch (value) - { - case GrB_COMP : mask |= GrB_COMP ; break ; - case GrB_STRUCTURE : mask |= GrB_STRUCTURE ; break ; - default : mask = value ; break ; - } - desc->mask = (GrB_Desc_Value) mask ; - break ; - - case GrB_INP0 : - - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP0 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in0 = (GrB_Desc_Value) value ; - break ; - - case GrB_INP1 : - - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP1 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in1 = (GrB_Desc_Value) value ; - break ; - - case GxB_AxB_METHOD : - - if (! (value == GxB_DEFAULT || value == GxB_AxB_GUSTAVSON - || value == GxB_AxB_DOT - || value == GxB_AxB_HASH || value == GxB_AxB_SAXPY)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_AxB_METHOD" - " field;\nmust be GxB_DEFAULT [%d], GxB_AxB_GUSTAVSON" - " [%d]\nGxB_AxB_DOT [%d]" - " GxB_AxB_HASH [%d] or GxB_AxB_SAXPY [%d]", - value, (int) GxB_DEFAULT, (int) GxB_AxB_GUSTAVSON, - (int) GxB_AxB_DOT, - (int) GxB_AxB_HASH, (int) GxB_AxB_SAXPY) ; - } - desc->axb = (GrB_Desc_Value) value ; - break ; - - case GxB_SORT : - - desc->do_sort = value ; - break ; - - case GxB_COMPRESSION : - - desc->compression = value ; - break ; - - case GxB_IMPORT : - - // In case the user application does not check the return value - // of this method, an error condition is never returned. - desc->import = - (value == GxB_DEFAULT) ? GxB_FAST_IMPORT : GxB_SECURE_IMPORT ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - return (GrB_SUCCESS) ; +{ + return (GrB_Descriptor_set_INT32 (desc, value, field)) ; } //------------------------------------------------------------------------------ @@ -167,10 +30,10 @@ GrB_Info GxB_Desc_set_INT32 // set a parameter in a descriptor GrB_Info GxB_Desc_set_FP64 // set a parameter in a descriptor ( GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change + int field, // parameter to change double value // value to change it to ) -{ +{ // no longer any settings for this method return (GrB_INVALID_VALUE) ; } @@ -182,181 +45,14 @@ GrB_Info GxB_Desc_set_FP64 // set a parameter in a descriptor GrB_Info GxB_Desc_set // set a parameter in a descriptor ( GrB_Descriptor desc, // descriptor to modify - GrB_Desc_Field field, // parameter to change + int field, // parameter to change ... // value to change it to ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (desc != NULL && desc->header_size == 0) - { - // built-in descriptors may not be modified - return (GrB_INVALID_VALUE) ; - } - - GB_WHERE (desc, "GxB_Desc_set (desc, field, value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (desc) ; - ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ; - - //-------------------------------------------------------------------------- - // set the parameter - //-------------------------------------------------------------------------- - +{ va_list ap ; - - switch (field) - { - - case GrB_OUTP : - - { - va_start (ap, field) ; - int value = va_arg (ap, int) ; - va_end (ap) ; - if (! (value == GxB_DEFAULT || value == GrB_REPLACE)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_OUTP field;\n" - "must be GxB_DEFAULT [%d] or GrB_REPLACE [%d]", - value, (int) GxB_DEFAULT, (int) GrB_REPLACE) ; - } - desc->out = (GrB_Desc_Value) value ; - } - break ; - - case GrB_MASK : - - { - va_start (ap, field) ; - int value = va_arg (ap, int) ; - va_end (ap) ; - if (! (value == GxB_DEFAULT || - value == GrB_COMP || - value == GrB_STRUCTURE || - value == (GrB_COMP + GrB_STRUCTURE))) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_MASK field;\n" - "must be GxB_DEFAULT [%d], GrB_COMP [%d],\n" - "GrB_STRUCTURE [%d], or GrB_COMP+GrB_STRUCTURE [%d]", - value, (int) GxB_DEFAULT, (int) GrB_COMP, - (int) GrB_STRUCTURE, - (int) (GrB_COMP + GrB_STRUCTURE)) ; - } - int mask = (int) desc->mask ; - switch (value) - { - case GrB_COMP : mask |= GrB_COMP ; break ; - case GrB_STRUCTURE : mask |= GrB_STRUCTURE ; break ; - default : mask = value ; break ; - } - desc->mask = (GrB_Desc_Value) mask ; - } - break ; - - case GrB_INP0 : - - { - va_start (ap, field) ; - int value = va_arg (ap, int) ; - va_end (ap) ; - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP0 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in0 = (GrB_Desc_Value) value ; - } - break ; - - case GrB_INP1 : - - { - va_start (ap, field) ; - int value = va_arg (ap, int) ; - va_end (ap) ; - if (! (value == GxB_DEFAULT || value == GrB_TRAN)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_INP1 field;\n" - "must be GxB_DEFAULT [%d] or GrB_TRAN [%d]", - value, (int) GxB_DEFAULT, (int) GrB_TRAN) ; - } - desc->in1 = (GrB_Desc_Value) value ; - } - break ; - - case GxB_AxB_METHOD : - - { - va_start (ap, field) ; - int value = va_arg (ap, int) ; - va_end (ap) ; - if (! (value == GxB_DEFAULT || value == GxB_AxB_GUSTAVSON - || value == GxB_AxB_DOT - || value == GxB_AxB_HASH || value == GxB_AxB_SAXPY)) - { - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor value [%d] for GrB_AxB_METHOD" - " field;\nmust be GxB_DEFAULT [%d], GxB_AxB_GUSTAVSON" - " [%d]\nGxB_AxB_DOT [%d]" - " GxB_AxB_HASH [%d] or GxB_AxB_SAXPY [%d]", - value, (int) GxB_DEFAULT, (int) GxB_AxB_GUSTAVSON, - (int) GxB_AxB_DOT, - (int) GxB_AxB_HASH, (int) GxB_AxB_SAXPY) ; - } - desc->axb = (GrB_Desc_Value) value ; - } - break ; - - case GxB_SORT : - - { - va_start (ap, field) ; - desc->do_sort = va_arg (ap, int) ; - va_end (ap) ; - } - break ; - - case GxB_COMPRESSION : - - { - va_start (ap, field) ; - desc->compression = va_arg (ap, int) ; - va_end (ap) ; - } - break ; - - case GxB_IMPORT : - - { - // In case the user application does not check the return value - // of this method, an error condition is never returned. - va_start (ap, field) ; - int s = va_arg (ap, int) ; - va_end (ap) ; - desc->import = - (s == GxB_DEFAULT) ? GxB_FAST_IMPORT : GxB_SECURE_IMPORT ; - } - break ; - - default : - - GB_ERROR (GrB_INVALID_VALUE, - "invalid descriptor field [%d], must be one of:\n" - "GrB_OUTP [%d], GrB_MASK [%d], GrB_INP0 [%d], GrB_INP1 [%d]\n" - "GxB_NTHREADS [%d], GxB_CHUNK [%d], GxB_AxB_METHOD [%d]\n" - "GxB_SORT [%d], or GxB_COMPRESSION [%d]\n", - (int) field, (int) GrB_OUTP, (int) GrB_MASK, (int) GrB_INP0, - (int) GrB_INP1, (int) GxB_NTHREADS, (int) GxB_CHUNK, - (int) GxB_AxB_METHOD, (int) GxB_SORT, (int) GxB_COMPRESSION) ; - } - - return (GrB_SUCCESS) ; + va_start (ap, field) ; + int value = va_arg (ap, int) ; + va_end (ap) ; + return (GrB_Descriptor_set_INT32 (desc, value, field)) ; } diff --git a/GraphBLAS/Source/get_set/GxB_Descriptor_get.c b/GraphBLAS/Source/get_set/GxB_Descriptor_get.c deleted file mode 100644 index e7920424a3..0000000000 --- a/GraphBLAS/Source/get_set/GxB_Descriptor_get.c +++ /dev/null @@ -1,64 +0,0 @@ -//------------------------------------------------------------------------------ -// GxB_Descriptor_get: get a field in a descriptor -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Use GxB_Desc_get instead; this is kept for backward compatibility. - -#include "GB.h" - -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 is ok - GrB_Desc_Field field // parameter to query -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Descriptor_get (&value, desc, field)") ; - GB_RETURN_IF_NULL (val) ; - GB_RETURN_IF_FAULTY (desc) ; - - //-------------------------------------------------------------------------- - // get the parameter - //-------------------------------------------------------------------------- - - switch (field) - { - case GrB_OUTP : - - (*val) = (desc == NULL) ? GxB_DEFAULT : desc->out ; break ; - - case GrB_MASK : - - (*val) = (desc == NULL) ? GxB_DEFAULT : desc->mask ; break ; - - case GrB_INP0 : - - (*val) = (desc == NULL) ? GxB_DEFAULT : desc->in0 ; break ; - - case GrB_INP1 : - - (*val) = (desc == NULL) ? GxB_DEFAULT : desc->in1 ; break ; - - case GxB_AxB_METHOD : - - (*val) = (desc == NULL) ? GxB_DEFAULT : desc->axb ; break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - #pragma omp flush - return (GrB_SUCCESS) ; -} - diff --git a/GraphBLAS/Source/get_set/GxB_Global_Option_get.c b/GraphBLAS/Source/get_set/GxB_Global_Option_get.c index 08e44cb813..98e771637d 100644 --- a/GraphBLAS/Source/get_set/GxB_Global_Option_get.c +++ b/GraphBLAS/Source/get_set/GxB_Global_Option_get.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GxB_Global_Option_get: get a global default option for all future matrices +// GxB_Global_Option_get: get a global default option //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,7 @@ GrB_Info GxB_Global_Option_get_INT32 // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query int32_t *value // return value of the global option ) { @@ -35,7 +35,7 @@ GrB_Info GxB_Global_Option_get_INT32 // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get_INT32 (field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (value) ; //-------------------------------------------------------------------------- @@ -131,7 +131,7 @@ GrB_Info GxB_Global_Option_get_INT32 // gets the current global option GrB_Info GxB_Global_Option_get_FP64 // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query double *value // return value of the global option ) { @@ -140,7 +140,7 @@ GrB_Info GxB_Global_Option_get_FP64 // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get_FP64 (field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (value) ; //-------------------------------------------------------------------------- @@ -183,7 +183,7 @@ GrB_Info GxB_Global_Option_get_FP64 // gets the current global option GrB_Info GxB_Global_Option_get_INT64 // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query int64_t *value // return value of the global option ) { @@ -192,7 +192,7 @@ GrB_Info GxB_Global_Option_get_INT64 // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get_INT64 (field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (value) ; //-------------------------------------------------------------------------- @@ -226,7 +226,7 @@ GrB_Info GxB_Global_Option_get_INT64 // gets the current global option GrB_Info GxB_Global_Option_get_CHAR // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query const char **value // return value of the global option ) { @@ -235,7 +235,7 @@ GrB_Info GxB_Global_Option_get_CHAR // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get_CHAR (field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (value) ; //-------------------------------------------------------------------------- @@ -362,9 +362,11 @@ GrB_Info GxB_Global_Option_get_CHAR // gets the current global option // GxB_Global_Option_get_FUNCTION: get global options (function pointers) //------------------------------------------------------------------------------ +#include "include/GB_pedantic_disable.h" + GrB_Info GxB_Global_Option_get_FUNCTION // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query void **value // return value of the global option ) { @@ -373,7 +375,7 @@ GrB_Info GxB_Global_Option_get_FUNCTION // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get_FUNCTION (field, &value)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (value) ; //-------------------------------------------------------------------------- @@ -426,10 +428,9 @@ GrB_Info GxB_Global_Option_get_FUNCTION // gets the current global option // GxB_Global_Option_get: based on va_arg //------------------------------------------------------------------------------ - GrB_Info GxB_Global_Option_get // gets the current global option ( - GxB_Option_Field field, // option to query + int field, // option to query ... // return value of the global option ) { @@ -438,7 +439,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_get (field, &value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // get the option @@ -483,7 +484,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option { va_start (ap, field) ; - GxB_Format_Value *format = va_arg (ap, GxB_Format_Value *) ; + int *format = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (format) ; (*format) = (GB_Global_is_csc_get ( )) ? @@ -499,7 +500,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option { va_start (ap, field) ; - GrB_Mode *mode = va_arg (ap, GrB_Mode *) ; + int *mode = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (mode) ; (*mode) = GB_Global_mode_get ( ) ; @@ -517,7 +518,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option int *nthreads_max = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (nthreads_max) ; - (*nthreads_max) = GB_Context_nthreads_max_get (NULL) ; + (*nthreads_max) = GB_Context_nthreads_max_get (NULL) ; } break ; @@ -528,7 +529,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option int *value = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (value) ; - (*value) = GB_Context_gpu_id_get (NULL) ; + (*value) = GB_Context_gpu_id_get (NULL) ; } break ; @@ -544,10 +545,10 @@ GrB_Info GxB_Global_Option_get // gets the current global option break ; //---------------------------------------------------------------------- - // memory pool control + // memory pool control: no longer used //---------------------------------------------------------------------- - case GxB_MEMORY_POOL : + case GxB_MEMORY_POOL : // no longer used // no longer used: return all zeros { @@ -682,7 +683,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option int *api_version = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (api_version) ; - api_version [0] = GxB_SPEC_MAJOR ; + api_version [0] = GxB_SPEC_MAJOR ; api_version [1] = GxB_SPEC_MINOR ; api_version [2] = GxB_SPEC_SUB ; } @@ -732,7 +733,7 @@ GrB_Info GxB_Global_Option_get // gets the current global option int *compiler_version = va_arg (ap, int *) ; va_end (ap) ; GB_RETURN_IF_NULL (compiler_version) ; - compiler_version [0] = GB_COMPILER_MAJOR ; + compiler_version [0] = GB_COMPILER_MAJOR ; compiler_version [1] = GB_COMPILER_MINOR ; compiler_version [2] = GB_COMPILER_SUB ; } diff --git a/GraphBLAS/Source/get_set/GxB_Global_Option_set.c b/GraphBLAS/Source/get_set/GxB_Global_Option_set.c index d4365a319c..3b73cf34cc 100644 --- a/GraphBLAS/Source/get_set/GxB_Global_Option_set.c +++ b/GraphBLAS/Source/get_set/GxB_Global_Option_set.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GxB_Global_Option_set: set a global default option for all future matrices +// GxB_Global_Option_set: set a global default option //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,7 +27,7 @@ GrB_Info GxB_Global_Option_set_INT32 // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change int32_t value // value to change it to ) { @@ -36,7 +36,7 @@ GrB_Info GxB_Global_Option_set_INT32 // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_INT32 (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -51,7 +51,7 @@ GrB_Info GxB_Global_Option_set_INT32 // set a global default option { return (GrB_INVALID_VALUE) ; } - GB_Global_is_csc_set (value != (int) GxB_BY_ROW) ; + GB_Global_is_csc_set (value != (int) GxB_BY_ROW) ; break ; case GxB_GLOBAL_NTHREADS : // same as GxB_NTHREADS @@ -98,7 +98,7 @@ GrB_Info GxB_Global_Option_set_INT32 // set a global default option GrB_Info GxB_Global_Option_set_FP64 // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change double value // value to change it to ) { @@ -107,7 +107,7 @@ GrB_Info GxB_Global_Option_set_FP64 // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_FP64 (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -140,7 +140,7 @@ GrB_Info GxB_Global_Option_set_FP64 // set a global default option GrB_Info GxB_Global_Option_set_FP64_ARRAY // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change double *value // value to change it to ) { @@ -149,7 +149,7 @@ GrB_Info GxB_Global_Option_set_FP64_ARRAY // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_FP64_ARRAY (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -188,7 +188,7 @@ GrB_Info GxB_Global_Option_set_FP64_ARRAY // set a global default option GrB_Info GxB_Global_Option_set_INT64_ARRAY // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change int64_t *value // value to change it to ) { @@ -197,7 +197,7 @@ GrB_Info GxB_Global_Option_set_INT64_ARRAY // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_INT64_ARRAY (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -225,7 +225,7 @@ GrB_Info GxB_Global_Option_set_INT64_ARRAY // set a global default option GrB_Info GxB_Global_Option_set_CHAR // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change const char *value // value to change it to ) { @@ -234,7 +234,7 @@ GrB_Info GxB_Global_Option_set_CHAR // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_CHAR (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -289,9 +289,11 @@ GrB_Info GxB_Global_Option_set_CHAR // set a global default option // GxB_Global_Option_set_FUNCTION: set a global option (function pointer) //------------------------------------------------------------------------------ +#include "include/GB_pedantic_disable.h" + GrB_Info GxB_Global_Option_set_FUNCTION // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change void *value // value to change it to ) { @@ -300,7 +302,7 @@ GrB_Info GxB_Global_Option_set_FUNCTION // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set_FUNCTION (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -333,7 +335,7 @@ GrB_Info GxB_Global_Option_set_FUNCTION // set a global default option GrB_Info GxB_Global_Option_set // set a global default option ( - GxB_Option_Field field, // option to change + int field, // option to change ... // value to change it to ) { @@ -342,7 +344,7 @@ GrB_Info GxB_Global_Option_set // set a global default option // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Global_Option_set (field, value)") ; + GB_CHECK_INIT ; //-------------------------------------------------------------------------- // set the global option @@ -399,7 +401,7 @@ GrB_Info GxB_Global_Option_set // set a global default option { return (GrB_INVALID_VALUE) ; } - GB_Global_is_csc_set (format != (int) GxB_BY_ROW) ; + GB_Global_is_csc_set (format != (int) GxB_BY_ROW) ; } break ; @@ -438,10 +440,10 @@ GrB_Info GxB_Global_Option_set // set a global default option break ; //---------------------------------------------------------------------- - // memory pool control + // memory pool control: no longer used //---------------------------------------------------------------------- - case GxB_MEMORY_POOL : + case GxB_MEMORY_POOL : // no longer used // nothing to do: no longer used break ; diff --git a/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_get.c b/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_get.c index 933f8b8e56..373458b915 100644 --- a/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_get.c +++ b/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_get.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_get_*: get a field in a index binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GxB_IndexBinaryOp_get_Scalar ( GxB_IndexBinaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { @@ -25,16 +25,17 @@ GrB_Info GxB_IndexBinaryOp_get_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_get_Scalar (op, value, field)") ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; + GB_RETURN_IF_NULL (scalar) ; + GB_WHERE_1 (scalar, "GxB_IndexBinaryOp_get_Scalar (op, scalar, field)") ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; + return (GB_op_scalar_get ((GB_Operator) op, scalar, field, Werk)) ; } //------------------------------------------------------------------------------ @@ -45,7 +46,7 @@ GrB_Info GxB_IndexBinaryOp_get_String ( GxB_IndexBinaryOp op, char * value, - GrB_Field field + int field ) { @@ -53,7 +54,7 @@ GrB_Info GxB_IndexBinaryOp_get_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_get_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; @@ -73,7 +74,7 @@ GrB_Info GxB_IndexBinaryOp_get_INT32 ( GxB_IndexBinaryOp op, int32_t * value, - GrB_Field field + int field ) { @@ -81,7 +82,7 @@ GrB_Info GxB_IndexBinaryOp_get_INT32 // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_get_INT32 (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; @@ -101,7 +102,7 @@ GrB_Info GxB_IndexBinaryOp_get_SIZE ( GxB_IndexBinaryOp op, size_t * value, - GrB_Field field + int field ) { @@ -109,7 +110,7 @@ GrB_Info GxB_IndexBinaryOp_get_SIZE // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_get_SIZE (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; @@ -129,7 +130,7 @@ GrB_Info GxB_IndexBinaryOp_get_VOID ( GxB_IndexBinaryOp op, void * value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; diff --git a/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_set.c b/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_set.c index be494e0a2f..9773bdb9c7 100644 --- a/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_set.c +++ b/GraphBLAS/Source/get_set/GxB_IndexBinaryOp_set.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_set_*: set a field in a index binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,8 @@ GrB_Info GxB_IndexBinaryOp_set_Scalar ( GxB_IndexBinaryOp op, - GrB_Scalar value, - GrB_Field field + GrB_Scalar scalar, + int field ) { return (GrB_INVALID_VALUE) ; @@ -31,7 +31,7 @@ GrB_Info GxB_IndexBinaryOp_set_String ( GxB_IndexBinaryOp op, char * value, - GrB_Field field + int field ) { @@ -39,7 +39,7 @@ GrB_Info GxB_IndexBinaryOp_set_String // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_set_String (op, value, field)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_NULL (value) ; ASSERT_INDEXBINARYOP_OK (op, "idxbinop for set", GB0) ; @@ -59,7 +59,7 @@ GrB_Info GxB_IndexBinaryOp_set_INT32 ( GxB_IndexBinaryOp op, int32_t value, - GrB_Field field + int field ) { return (GrB_INVALID_VALUE) ; @@ -73,7 +73,7 @@ GrB_Info GxB_IndexBinaryOp_set_VOID ( GxB_IndexBinaryOp op, void * value, - GrB_Field field, + int field, size_t size ) { diff --git a/GraphBLAS/Source/get_set/GxB_Matrix_Option_get.c b/GraphBLAS/Source/get_set/GxB_Matrix_Option_get.c index 1bf31531a3..1a007bc318 100644 --- a/GraphBLAS/Source/get_set/GxB_Matrix_Option_get.c +++ b/GraphBLAS/Source/get_set/GxB_Matrix_Option_get.c @@ -1,19 +1,12 @@ //------------------------------------------------------------------------------ -// GxB_Matrix_Option_get: get an option in a matrix +// GxB_Matrix_Option_get: get an option in a matrix: historical methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// GxB_Matrix_Option_get is a single va_arg-based method for any matrix option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Matrix_Option_get_INT32 int32_t scalars -// GxB_Matrix_Option_get_FP64 double scalars - #include "GB.h" //------------------------------------------------------------------------------ @@ -23,98 +16,37 @@ GrB_Info GxB_Matrix_Option_get_INT32 // gets the current option of a matrix ( GrB_Matrix A, // matrix to query - GxB_Option_Field field, // option to query + int field, // option to query int32_t *value // return value of the matrix option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Matrix_Option_get_INT32 (A, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to get option", GB0) ; - GB_RETURN_IF_NULL (value) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_SPARSITY_CONTROL : - - (*value) = A->sparsity_control ; - break ; - - case GxB_SPARSITY_STATUS : - - (*value) = GB_sparsity (A) ; - break ; - - case GxB_FORMAT : - - (*value) = (int32_t) ((A->is_csc) ? GxB_BY_COL : GxB_BY_ROW) ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - #pragma omp flush - return (GrB_SUCCESS) ; +{ + return (GrB_Matrix_get_INT32 (A, value, field)) ; } //------------------------------------------------------------------------------ // GxB_Matrix_Option_get_FP64: get matrix options (double scalars) //------------------------------------------------------------------------------ +#define GB_FREE_ALL GrB_Scalar_free (&scalar) ; + GrB_Info GxB_Matrix_Option_get_FP64 // gets the current option of a matrix ( GrB_Matrix A, // matrix to query - GxB_Option_Field field, // option to query + int field, // option to query double *value // return value of the matrix option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Matrix_Option_get_FP64 (A, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to get option", GB0) ; - GB_RETURN_IF_NULL (value) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_HYPER_SWITCH : - - (*value) = (double) A->hyper_switch ; - break ; - - case GxB_BITMAP_SWITCH : - - (*value) = (double) A->bitmap_switch ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - #pragma omp flush +{ + GrB_Info info ; + GrB_Scalar scalar = NULL ; + GB_OK (GrB_Scalar_new (&scalar, GrB_FP64)) ; + GB_OK (GrB_Matrix_get_Scalar (A, scalar, field)) ; + GB_OK (GrB_Scalar_extractElement_FP64 (value, scalar)) ; + GB_FREE_ALL ; return (GrB_SUCCESS) ; } +#undef GB_FREE_ALL + //------------------------------------------------------------------------------ // GxB_Matrix_Option_get: based on va_arg //------------------------------------------------------------------------------ @@ -122,100 +54,40 @@ GrB_Info GxB_Matrix_Option_get_FP64 // gets the current option of a matrix GrB_Info GxB_Matrix_Option_get // gets the current option of a matrix ( GrB_Matrix A, // matrix to query - GxB_Option_Field field, // option to query + int field, // option to query ... // return value of the matrix option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Matrix_Option_get (A, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to get option", GB0) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - +{ va_list ap ; - switch (field) { - case GxB_HYPER_SWITCH : - - { - va_start (ap, field) ; - double *hyper_switch = va_arg (ap, double *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (hyper_switch) ; - (*hyper_switch) = (double) A->hyper_switch ; - } - break ; - case GxB_BITMAP_SWITCH : - - { - va_start (ap, field) ; - double *bitmap_switch = va_arg (ap, double *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (bitmap_switch) ; - (*bitmap_switch) = (double) A->bitmap_switch ; - } - break ; - - case GxB_SPARSITY_CONTROL : - - { - va_start (ap, field) ; - int *sparsity_control = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (sparsity_control) ; - (*sparsity_control) = A->sparsity_control ; - } - break ; - - case GxB_SPARSITY_STATUS : - - { - va_start (ap, field) ; - int *sparsity = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (sparsity) ; - (*sparsity) = GB_sparsity (A) ; - } - break ; - - case GxB_FORMAT : - - { - va_start (ap, field) ; - GxB_Format_Value *format = va_arg (ap, GxB_Format_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (format) ; - (*format) = (A->is_csc) ? GxB_BY_COL : GxB_BY_ROW ; - } - break ; - - case GxB_IS_HYPER : // historical; use GxB_SPARSITY_STATUS instead - - { - va_start (ap, field) ; - bool *A_is_hyper = va_arg (ap, bool *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (A_is_hyper) ; - (*A_is_hyper) = (GB_sparsity (A) == GxB_HYPERSPARSE) ; - } - break ; + { + va_start (ap, field) ; + double *value = va_arg (ap, double *) ; + va_end (ap) ; + return (GxB_Matrix_Option_get_FP64 (A, field, value)) ; + } + + case GxB_IS_HYPER : + { + va_start (ap, field) ; + bool *value = va_arg (ap, bool *) ; + va_end (ap) ; + GB_RETURN_IF_NULL (value) ; + (*value) = (GB_sparsity (A) == GxB_HYPERSPARSE) ; + #pragma omp flush + return (GrB_SUCCESS) ; + } default : - - return (GrB_INVALID_VALUE) ; + { + va_start (ap, field) ; + int *value = va_arg (ap, int *) ; + va_end (ap) ; + return (GxB_Matrix_Option_get_INT32 (A, field, value)) ; + } } - - #pragma omp flush - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/get_set/GxB_Matrix_Option_set.c b/GraphBLAS/Source/get_set/GxB_Matrix_Option_set.c index 230c541058..f65e062096 100644 --- a/GraphBLAS/Source/get_set/GxB_Matrix_Option_set.c +++ b/GraphBLAS/Source/get_set/GxB_Matrix_Option_set.c @@ -1,24 +1,13 @@ //------------------------------------------------------------------------------ -// GxB_Matrix_Option_set: set an option in a matrix +// GxB_Matrix_Option_set: set an option in a matrix: historical methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#include "transpose/GB_transpose.h" - -#define GB_FREE_ALL ; - -//------------------------------------------------------------------------------ - -// GxB_Matrix_Option_set is a single va_arg-based method for any matrix option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Matrix_Option_set_INT32 int32_t scalars -// GxB_Matrix_Option_set_FP64 double scalars +#include "GB.h" //------------------------------------------------------------------------------ // GxB_Matrix_Option_set_INT32: set matrix options (int32_t scalars) @@ -27,124 +16,37 @@ GrB_Info GxB_Matrix_Option_set_INT32 // set an option in a matrix ( GrB_Matrix A, // matrix to modify - GxB_Option_Field field, // option to change + int field, // option to change int32_t value // value to change it to ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; - GB_WHERE (A, "GxB_Matrix_Option_set_INT32 (A, field, value)") ; - GB_BURBLE_START ("GxB_set") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the matrix option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_SPARSITY_CONTROL : - - A->sparsity_control = GB_sparsity_control (value, (int64_t) (-1)) ; - break ; - - case GxB_FORMAT : - - if (! (value == GxB_BY_ROW || value == GxB_BY_COL)) - { - return (GrB_INVALID_VALUE) ; - } - // the value is normally GxB_BY_ROW (0) or GxB_BY_COL (1), but - // any nonzero value results in GxB_BY_COL. - bool new_csc = (value != GxB_BY_ROW) ; - // conform the matrix to the new by-row/by-col format - if (A->is_csc != new_csc) - { - // A = A', done in-place, and change to the new format. - GB_BURBLE_N (GB_nnz (A), "(transpose) ") ; - GB_OK (GB_transpose_in_place (A, new_csc, Werk)) ; - ASSERT (A->is_csc == new_csc) ; - ASSERT (GB_JUMBLED_OK (A)) ; - } - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - //-------------------------------------------------------------------------- - // conform the matrix to its new desired sparsity structure - //-------------------------------------------------------------------------- - - ASSERT_MATRIX_OK (A, "A set before conform", GB0) ; - GB_OK (GB_conform (A, Werk)) ; - GB_BURBLE_END ; - ASSERT_MATRIX_OK (A, "A set after conform", GB0) ; - return (GrB_SUCCESS) ; +{ + return (GrB_Matrix_set_INT32 (A, value, field)) ; } //------------------------------------------------------------------------------ // GxB_Matrix_Option_set_FP64: set matrix options (double scalars) //------------------------------------------------------------------------------ +#define GB_FREE_ALL GrB_Scalar_free (&scalar) ; + GrB_Info GxB_Matrix_Option_set_FP64 // set an option in a matrix ( GrB_Matrix A, // matrix to modify - GxB_Option_Field field, // option to change + int field, // option to change double value // value to change it to ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - +{ GrB_Info info ; - GB_WHERE (A, "GxB_Matrix_Option_set_FP64 (A, field, value)") ; - GB_BURBLE_START ("GxB_set") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the matrix option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_HYPER_SWITCH : - - A->hyper_switch = (float) value ; - break ; - - case GxB_BITMAP_SWITCH : - - A->bitmap_switch = (float) value ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - //-------------------------------------------------------------------------- - // conform the matrix to its new desired sparsity structure - //-------------------------------------------------------------------------- - - ASSERT_MATRIX_OK (A, "A set before conform", GB0) ; - GB_OK (GB_conform (A, Werk)) ; - GB_BURBLE_END ; - ASSERT_MATRIX_OK (A, "A set after conform", GB0) ; + GrB_Scalar scalar = NULL ; + GB_OK (GrB_Scalar_new (&scalar, GrB_FP64)) ; + GB_OK (GrB_Scalar_setElement_FP64 (scalar, value)) ; + GB_OK (GrB_Matrix_set_Scalar (A, scalar, field)) ; + GB_FREE_ALL return (GrB_SUCCESS) ; } +#undef GB_FREE_ALL + //------------------------------------------------------------------------------ // GxB_Matrix_Option_set: based on va_arg //------------------------------------------------------------------------------ @@ -152,99 +54,29 @@ GrB_Info GxB_Matrix_Option_set_FP64 // set an option in a matrix GrB_Info GxB_Matrix_Option_set // set an option in a matrix ( GrB_Matrix A, // matrix to modify - GxB_Option_Field field, // option to change + int field, // option to change ... // value to change it to ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; - GB_WHERE (A, "GxB_Matrix_Option_set (A, field, value)") ; - GB_BURBLE_START ("GxB_set") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (A, "A to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the matrix option - //-------------------------------------------------------------------------- - +{ va_list ap ; - switch (field) { - case GxB_HYPER_SWITCH : - - { - va_start (ap, field) ; - double hyper_switch = va_arg (ap, double) ; - va_end (ap) ; - A->hyper_switch = (float) hyper_switch ; - } - break ; - case GxB_BITMAP_SWITCH : - - { - va_start (ap, field) ; - double bitmap_switch = va_arg (ap, double) ; - va_end (ap) ; - A->bitmap_switch = (float) bitmap_switch ; - } - break ; - - case GxB_SPARSITY_CONTROL : - - { - va_start (ap, field) ; - int sparsity_control = va_arg (ap, int) ; - va_end (ap) ; - A->sparsity_control = - GB_sparsity_control (sparsity_control, (int64_t) (-1)) ; - } - break ; - - case GxB_FORMAT : - - { - va_start (ap, field) ; - int format = va_arg (ap, int) ; - va_end (ap) ; - if (! (format == GxB_BY_ROW || format == GxB_BY_COL)) - { - return (GrB_INVALID_VALUE) ; - } - // the value is normally GxB_BY_ROW (0) or GxB_BY_COL (1), but - // any nonzero value results in GxB_BY_COL. - bool new_csc = (format != GxB_BY_ROW) ; - // conform the matrix to the new by-row/by-col format - if (A->is_csc != new_csc) - { - // A = A', done in-place, and change to the new format. - GB_BURBLE_N (GB_nnz (A), "(transpose) ") ; - GB_OK (GB_transpose_in_place (A, new_csc, Werk)) ; - ASSERT (A->is_csc == new_csc) ; - ASSERT (GB_JUMBLED_OK (A)) ; - } - } - break ; + { + va_start (ap, field) ; + double value = va_arg (ap, double) ; + va_end (ap) ; + return (GxB_Matrix_Option_set_FP64 (A, field, value)) ; + } default : - - return (GrB_INVALID_VALUE) ; + { + va_start (ap, field) ; + int value = va_arg (ap, int) ; + va_end (ap) ; + return (GxB_Matrix_Option_set_INT32 (A, field, value)) ; + } } - - //-------------------------------------------------------------------------- - // conform the matrix to its new desired sparsity structure - //-------------------------------------------------------------------------- - - ASSERT_MATRIX_OK (A, "A set before conform", GB0) ; - GB_OK (GB_conform (A, Werk)) ; - GB_BURBLE_END ; - ASSERT_MATRIX_OK (A, "A set after conform", GB0) ; - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/get_set/GxB_Serialized_get.c b/GraphBLAS/Source/get_set/GxB_Serialized_get.c index 0863432585..3a7e722b8c 100644 --- a/GraphBLAS/Source/get_set/GxB_Serialized_get.c +++ b/GraphBLAS/Source/get_set/GxB_Serialized_get.c @@ -2,13 +2,14 @@ // GxB_Serialized_get_*: query the contents of a serialized blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "get_set/GB_get_set.h" #include "serialize/GB_serialize.h" +#define GB_FREE_ALL ; //------------------------------------------------------------------------------ // GB_blob_header_get: get all properties of the blob @@ -27,10 +28,18 @@ static GrB_Info GB_blob_header_get int32_t *storage, // GrB_COLMAJOR or GrB_ROWMAJOR char **user_name, // GrB_NAME of the blob char **eltype_string, // GrB_EL_TYPE_STRING of the type of the blob + bool *is_csc, + bool *p_is_32, // if true, A->p is 32 bit; else 64 + bool *j_is_32, // if true, A->h and A->Y are 32 bit; else 64 + bool *i_is_32, // if true, A->i is 32 bit; else 64 + int8_t *p_control, + int8_t *j_control, + int8_t *i_control, + bool *iso, // input, not modified: const GB_void *blob, // the blob - GrB_Index blob_size // size of the blob + uint64_t blob_size // size of the blob ) { @@ -47,13 +56,32 @@ static GrB_Info GB_blob_header_get } GB_BLOB_READ (blob_size2, uint64_t) ; - GB_BLOB_READ (typecode, int32_t) ; + +// was in v9.4.2 and earlier:: +// GB_BLOB_READ (typecode, int32_t) ; +// now in GrB v10.0.0: + GB_BLOB_READ (encoding, uint32_t) ; + uint32_t Cp_is_32 = GB_RSHIFT (encoding, 12, 4) ; // C->p_is_32 + uint32_t Cj_is_32 = GB_RSHIFT (encoding, 8, 4) ; // C->j_is_32 + uint32_t Ci_is_32 = GB_RSHIFT (encoding, 4, 4) ; // C->i_is_32 + uint32_t typecode = GB_RSHIFT (encoding, 0, 4) ; // 4 bit typecode + + // GrB 10.0.0 reserves 4 bits each for Cp_is_32, Cj_is_32, and Ci_is_32, + // for future expansion. This way, if a future GraphBLAS version needs + // more bits to create a serialized blob, then GrB 10.0.0 will gracefully + // fail if it attempts to deserialize the blob. + uint64_t blob_size1 = (uint64_t) blob_size ; + // GrB v9.4.2 has the same test below, so it will safely declare the blob + // invalid if it sees any encoding with a 1 in bit position 4 or 5. if (blob_size1 != blob_size2 || typecode < GB_BOOL_code || typecode > GB_UDT_code || (typecode == GB_UDT_code && - blob_size < GB_BLOB_HEADER_SIZE + GxB_MAX_NAME_LEN)) + blob_size < GB_BLOB_HEADER_SIZE + GxB_MAX_NAME_LEN) + // GrB v10.0.0 adds the following check, since it only supports the + // values of 0 and 1, denoting 64-bit and 32-bit integers respectively: + || (Cp_is_32 > 1) || (Cj_is_32 > 1) || (Ci_is_32 > 1)) { // blob is invalid return (GrB_INVALID_OBJECT) ; @@ -73,7 +101,19 @@ static GrB_Info GB_blob_header_get GB_BLOB_READ (Cx_len, int64_t) ; GB_BLOB_READ (hyper_switch, float) ; GB_BLOB_READ (bitmap_switch, float) ; - GB_BLOB_READ (sparsity_control, int32_t) ; + +// was in v9.4.2 and earlier:: +// GB_BLOB_READ (sparsity_control, int32_t) ; +// now in GrB v10.0.0: + GB_BLOB_READ (control_encoding, uint32_t) ; + uint32_t p_encoding = GB_RSHIFT (control_encoding, 16, 4) ; + uint32_t j_encoding = GB_RSHIFT (control_encoding, 12, 4) ; + uint32_t i_encoding = GB_RSHIFT (control_encoding, 8, 4) ; + (*p_control) = GB_pji_control_decoding (p_encoding) ; + (*j_control) = GB_pji_control_decoding (j_encoding) ; + (*i_control) = GB_pji_control_decoding (i_encoding) ; + uint32_t sparsity_control = GB_RSHIFT (control_encoding, 0, 8) ; + GB_BLOB_READ (sparsity_iso_csc, int32_t) ; GB_BLOB_READ (Cp_nblocks, int32_t) ; GB_BLOB_READ (Cp_method, int32_t) ; GB_BLOB_READ (Ch_nblocks, int32_t) ; GB_BLOB_READ (Ch_method, int32_t) ; @@ -82,12 +122,18 @@ static GrB_Info GB_blob_header_get GB_BLOB_READ (Cx_nblocks, int32_t) ; GB_BLOB_READ (Cx_method, int32_t) ; (*sparsity_status) = sparsity_iso_csc / 4 ; - bool iso = ((sparsity_iso_csc & 2) == 2) ; - bool is_csc = ((sparsity_iso_csc & 1) == 1) ; + (*iso) = ((sparsity_iso_csc & 2) == 2) ; + (*is_csc) = ((sparsity_iso_csc & 1) == 1) ; + + //-------------------------------------------------------------------------- + (*sparsity_ctrl) = sparsity_control ; (*hyper_sw) = (double) hyper_switch ; (*bitmap_sw) = (double) bitmap_switch ; - (*storage) = (is_csc) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + (*storage) = (*is_csc) ? GrB_COLMAJOR : GrB_ROWMAJOR ; + (*p_is_32) = Cp_is_32 ; + (*j_is_32) = Cj_is_32 ; + (*i_is_32) = Ci_is_32 ; //-------------------------------------------------------------------------- // determine the matrix type_code and C type_name @@ -199,197 +245,225 @@ static GrB_Info GB_blob_header_get } //------------------------------------------------------------------------------ -// GxB_Serialized_get_Scalar +// GB_Serialized_get: get an int, double, or string from a serialized blob //------------------------------------------------------------------------------ -GrB_Info GxB_Serialized_get_Scalar +static GrB_Info GB_Serialized_get ( const void * blob, - GrB_Scalar value, - GrB_Field field, + int field, + int32_t *ivalue, + double *dvalue, + char *cvalue, + bool *is_double, + bool *is_char, size_t blob_size ) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Serialized_get_Scalar (blob, value, field, blobsize)") ; - GB_RETURN_IF_NULL (blob) ; - GB_RETURN_IF_NULL_OR_FAULTY (value) ; - //-------------------------------------------------------------------------- // read the blob //-------------------------------------------------------------------------- + GrB_Info info ; + (*ivalue) = 0 ; + (*dvalue) = 0 ; + (*cvalue) = '\0' ; + (*is_double) = false ; + (*is_char) = false ; + char type_name [GxB_MAX_NAME_LEN], *user_name, *eltype_string ; int32_t sparsity_status, sparsity_ctrl, type_code, storage ; double hyper_sw, bitmap_sw ; + bool is_csc, p_is_32, j_is_32, i_is_32, iso ; + int8_t p_control, j_control, i_control ; - GrB_Info info = GB_blob_header_get (type_name, &type_code, &sparsity_status, - &sparsity_ctrl, &hyper_sw, &bitmap_sw, &storage, - &user_name, &eltype_string, blob, blob_size) ; + GB_OK (GB_blob_header_get (type_name, &type_code, + &sparsity_status, &sparsity_ctrl, &hyper_sw, &bitmap_sw, &storage, + &user_name, &eltype_string, &is_csc, &p_is_32, &j_is_32, &i_is_32, + &p_control, &j_control, &i_control, &iso, blob, blob_size)) ; //-------------------------------------------------------------------------- // get the field //-------------------------------------------------------------------------- - double dvalue = 0 ; - int32_t ivalue = 0 ; - bool is_double = false ; - - if (info == GrB_SUCCESS) + switch ((int) field) { - switch ((int) field) - { - case GrB_STORAGE_ORIENTATION_HINT : + case GrB_STORAGE_ORIENTATION_HINT : + + (*ivalue) = storage ; + break ; - ivalue = storage ; - break ; + case GrB_EL_TYPE_CODE : - case GrB_EL_TYPE_CODE : + (*ivalue) = type_code ; + break ; - ivalue = type_code ; - break ; + case GxB_SPARSITY_CONTROL : - case GxB_SPARSITY_CONTROL : + (*ivalue) = sparsity_ctrl ; + break ; - ivalue = sparsity_ctrl ; - break ; + case GxB_SPARSITY_STATUS : - case GxB_SPARSITY_STATUS : + (*ivalue) = sparsity_status ; + break ; - ivalue = sparsity_status ; - break ; + case GxB_ISO : - case GxB_FORMAT : + (*ivalue) = iso ; + break ; - ivalue = (storage == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; - break ; + case GxB_FORMAT : - case GxB_HYPER_SWITCH : - dvalue = hyper_sw ; - is_double = true ; - break ; + (*ivalue) = (storage == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; + break ; - case GxB_BITMAP_SWITCH : - dvalue = bitmap_sw ; - is_double = true ; - break ; + case GxB_OFFSET_INTEGER_HINT : - default : - return (GrB_INVALID_VALUE) ; - } + (*ivalue) = p_control ; + break ; - if (is_double) - { - // field specifies a double: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &dvalue, 0, 0, - GB_FP64_code, Werk) ; - } - else - { - // field specifies an int32_t: assign it to the scalar - info = GB_setElement ((GrB_Matrix) value, NULL, &ivalue, 0, 0, - GB_INT32_code, Werk) ; - } + case GxB_OFFSET_INTEGER_BITS : + + (*ivalue) = (p_is_32) ? 32 : 64 ; + break ; + + case GxB_COLINDEX_INTEGER_HINT : + + (*ivalue) = (is_csc) ? j_control : i_control ; + break ; + + case GxB_COLINDEX_INTEGER_BITS : + + (*ivalue) = ((is_csc) ? j_is_32 : i_is_32) ? 32 : 64 ; + break ; + + case GxB_ROWINDEX_INTEGER_HINT : + + (*ivalue) = (is_csc) ? i_control : j_control ; + break ; + + case GxB_ROWINDEX_INTEGER_BITS : + + (*ivalue) = ((is_csc) ? i_is_32 : j_is_32) ? 32 : 64 ; + break ; + + case GxB_HYPER_SWITCH : + + (*dvalue) = hyper_sw ; + (*is_double) = true ; + break ; + + case GxB_BITMAP_SWITCH : + + (*dvalue) = bitmap_sw ; + (*is_double) = true ; + break ; + + case GrB_NAME : + + if (user_name != NULL) + { + strcpy (cvalue, user_name) ; + } + (*is_char) = true ; + break ; + + case GxB_JIT_C_NAME : + + strcpy (cvalue, type_name) ; + (*is_char) = true ; + break ; + + case GrB_EL_TYPE_STRING : + + if (eltype_string != NULL) + { + strcpy (cvalue, eltype_string) ; + } + (*is_char) = true ; + break ; + + default : + + return (GrB_INVALID_VALUE) ; } - #pragma omp flush - return (info) ; + return (GrB_SUCCESS) ; } //------------------------------------------------------------------------------ -// GxB_Serialized_get_String +// GxB_Serialized_get_Scalar //------------------------------------------------------------------------------ -GrB_Info GxB_Serialized_get_String +GrB_Info GxB_Serialized_get_Scalar ( const void * blob, - char * value, - GrB_Field field, + GrB_Scalar scalar, + int field, size_t blob_size ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Serialized_get_String (blob, value, field, blobsize)") ; + GB_WHERE_1 (scalar, "GxB_Serialized_get_Scalar (blob, scalar, field," + " blob_size)") ; GB_RETURN_IF_NULL (blob) ; - GB_RETURN_IF_NULL (value) ; + GB_RETURN_IF_NULL (scalar) ; //-------------------------------------------------------------------------- // read the blob //-------------------------------------------------------------------------- - char type_name [GxB_MAX_NAME_LEN], *user_name, *eltype_string ; - int32_t sparsity_status, sparsity_ctrl, type_code, storage ; - double hyper_sw, bitmap_sw ; - - GrB_Info info = GB_blob_header_get (type_name, &type_code, &sparsity_status, - &sparsity_ctrl, &hyper_sw, &bitmap_sw, &storage, - &user_name, &eltype_string, blob, blob_size) ; - - //-------------------------------------------------------------------------- - // get the field - //-------------------------------------------------------------------------- - - (*value) = '\0' ; - const char *name ; + int32_t ivalue ; + double dvalue ; + char cvalue [GxB_MAX_NAME_LEN] ; + bool is_double, is_char ; - if (info == GrB_SUCCESS) - { - switch (field) - { + GB_OK (GB_Serialized_get (blob, field, &ivalue, &dvalue, cvalue, + &is_double, &is_char, blob_size)) ; - case GrB_NAME : - if (user_name != NULL) - { - strcpy (value, user_name) ; - } - break ; - - case GxB_JIT_C_NAME : - strcpy (value, type_name) ; - break ; - - case GrB_EL_TYPE_STRING : - if (eltype_string != NULL) - { - strcpy (value, eltype_string) ; - } - break ; - - default : - return (GrB_INVALID_VALUE) ; - } + if (is_char) + { + return (GrB_INVALID_VALUE) ; + } + else if (is_double) + { + // field specifies a double: assign it to the scalar + return (GB_setElement ((GrB_Matrix) scalar, NULL, &dvalue, 0, 0, + GB_FP64_code, Werk)) ; + } + else + { + // field specifies an int32_t: assign it to the scalar + return (GB_setElement ((GrB_Matrix) scalar, NULL, &ivalue, 0, 0, + GB_INT32_code, Werk)) ; } - - #pragma omp flush - return (info) ; } //------------------------------------------------------------------------------ -// GxB_Serialized_get_INT32 +// GxB_Serialized_get_String //------------------------------------------------------------------------------ -GrB_Info GxB_Serialized_get_INT32 +GrB_Info GxB_Serialized_get_String ( const void * blob, - int32_t * value, - GrB_Field field, + char * value, + int field, size_t blob_size ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Serialized_get_INT32 (blob, value, field, blobsize)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (value) ; @@ -397,54 +471,66 @@ GrB_Info GxB_Serialized_get_INT32 // read the blob //-------------------------------------------------------------------------- - char type_name [GxB_MAX_NAME_LEN], *user_name, *eltype_string ; - int32_t sparsity_status, sparsity_ctrl, type_code, storage ; - double hyper_sw, bitmap_sw ; - - GrB_Info info = GB_blob_header_get (type_name, &type_code, &sparsity_status, - &sparsity_ctrl, &hyper_sw, &bitmap_sw, &storage, - &user_name, &eltype_string, blob, blob_size) ; - - //-------------------------------------------------------------------------- - // get the field - //-------------------------------------------------------------------------- - - if (info == GrB_SUCCESS) - { - switch ((int) field) - { - case GrB_STORAGE_ORIENTATION_HINT : + int32_t ivalue ; + double dvalue ; + bool is_double, is_char ; - (*value) = storage ; - break ; + GB_OK (GB_Serialized_get (blob, field, &ivalue, &dvalue, value, + &is_double, &is_char, blob_size)) ; - case GrB_EL_TYPE_CODE : + if (is_char) + { + #pragma omp flush + return (GrB_SUCCESS) ; + } + else + { + return (GrB_INVALID_VALUE) ; + } +} - (*value) = type_code ; - break ; +//------------------------------------------------------------------------------ +// GxB_Serialized_get_INT32 +//------------------------------------------------------------------------------ - case GxB_SPARSITY_CONTROL : +GrB_Info GxB_Serialized_get_INT32 +( + const void * blob, + int32_t * value, + int field, + size_t blob_size +) +{ - (*value) = sparsity_ctrl ; - break ; + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- - case GxB_SPARSITY_STATUS : + GrB_Info info ; + double dvalue ; + bool is_double, is_char ; + char cvalue [GxB_MAX_NAME_LEN] ; - (*value) = sparsity_status ; - break ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL (blob) ; + GB_RETURN_IF_NULL (value) ; - case GxB_FORMAT : + //-------------------------------------------------------------------------- + // read the blob (must be an integer value) + //-------------------------------------------------------------------------- - (*value) = (storage == GrB_COLMAJOR) ? GxB_BY_COL : GxB_BY_ROW ; - break ; + GB_OK (GB_Serialized_get (blob, field, value, &dvalue, cvalue, + &is_double, &is_char, blob_size)) ; - default : - return (GrB_INVALID_VALUE) ; - } + if (is_double || is_char) + { + return (GrB_INVALID_VALUE) ; + } + else + { + #pragma omp flush + return (GrB_SUCCESS) ; } - - #pragma omp flush - return (info) ; } //------------------------------------------------------------------------------ @@ -455,16 +541,22 @@ GrB_Info GxB_Serialized_get_SIZE ( const void * blob, size_t * value, - GrB_Field field, + int field, size_t blob_size ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Serialized_get_SIZE (blob, value, field, blobsize)") ; + GrB_Info info ; + int32_t ivalue ; + double dvalue ; + bool is_double, is_char ; + char cvalue [GxB_MAX_NAME_LEN] ; + + GB_CHECK_INIT ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (value) ; @@ -472,44 +564,19 @@ GrB_Info GxB_Serialized_get_SIZE // read the blob //-------------------------------------------------------------------------- - char type_name [GxB_MAX_NAME_LEN], *user_name, *eltype_string ; - int32_t sparsity_status, sparsity_ctrl, type_code, storage ; - double hyper_sw, bitmap_sw ; - - GrB_Info info = GB_blob_header_get (type_name, &type_code, &sparsity_status, - &sparsity_ctrl, &hyper_sw, &bitmap_sw, &storage, - &user_name, &eltype_string, blob, blob_size) ; - - //-------------------------------------------------------------------------- - // get the field - //-------------------------------------------------------------------------- - - const char *name ; - - if (info == GrB_SUCCESS) - { - switch (field) - { - - case GrB_NAME : - (*value) = (user_name == NULL) ? 1 : (strlen (user_name) + 1) ; - break ; - - case GxB_JIT_C_NAME : - (*value) = strlen (type_name) + 1 ; - break ; - - case GrB_EL_TYPE_STRING : - (*value) = (eltype_string == NULL) ? - 1 : (strlen (eltype_string) + 1) ; - break ; + GB_OK (GB_Serialized_get (blob, field, &ivalue, &dvalue, cvalue, + &is_double, &is_char, blob_size)) ; - default : - return (GrB_INVALID_VALUE) ; - } + if (is_char) + { + (*value) = strlen (cvalue) + 1 ; + #pragma omp flush + return (GrB_SUCCESS) ; + } + else + { + return (GrB_INVALID_VALUE) ; } - #pragma omp flush - return (info) ; } //------------------------------------------------------------------------------ @@ -520,7 +587,7 @@ GrB_Info GxB_Serialized_get_VOID ( const void * blob, void * value, - GrB_Field field, + int field, size_t blob_size ) { diff --git a/GraphBLAS/Source/get_set/GxB_Vector_Option_get.c b/GraphBLAS/Source/get_set/GxB_Vector_Option_get.c index 77037fa0a8..e9561c1630 100644 --- a/GraphBLAS/Source/get_set/GxB_Vector_Option_get.c +++ b/GraphBLAS/Source/get_set/GxB_Vector_Option_get.c @@ -1,23 +1,14 @@ //------------------------------------------------------------------------------ -// GxB_Vector_Option_get: get an option in a vector +// GxB_Vector_Option_get: get an option in a vector: historical methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB.h" -//------------------------------------------------------------------------------ - -// GxB_Vector_Option_get is a single va_arg-based method for any vector option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Vector_Option_get_INT32 int32_t scalars -// GxB_Vector_Option_get_FP64 double scalars - //------------------------------------------------------------------------------ // GxB_Vector_Option_get_INT32: get vector options (int32_t scalars) //------------------------------------------------------------------------------ @@ -25,96 +16,37 @@ GrB_Info GxB_Vector_Option_get_INT32 // gets the current option of a vector ( GrB_Vector v, // vector to query - GxB_Option_Field field, // option to query + int field, // option to query int32_t *value // return value of the vector option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Vector_Option_get_INT32 (v, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to get option", GB0) ; - GB_RETURN_IF_NULL (value) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_SPARSITY_CONTROL : - - (*value) = v->sparsity_control ; - break ; - - case GxB_SPARSITY_STATUS : - - (*value) = GB_sparsity ((GrB_Matrix) v) ; - break ; - - case GxB_FORMAT : - - // a GrB_Vector is always stored by-column - (*value) = (int32_t) GxB_BY_COL ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - - } - - #pragma omp flush - return (GrB_SUCCESS) ; +{ + return (GrB_Vector_get_INT32 (v, value, field)) ; } //------------------------------------------------------------------------------ // GxB_Vector_Option_get_FP64: get vector options (double scalars) //------------------------------------------------------------------------------ +#define GB_FREE_ALL GrB_Scalar_free (&scalar) ; + GrB_Info GxB_Vector_Option_get_FP64 // gets the current option of a vector ( GrB_Vector v, // vector to query - GxB_Option_Field field, // option to query + int field, // option to query double *value // return value of the vector option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Vector_Option_get_FP64 (v, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to get option", GB0) ; - GB_RETURN_IF_NULL (value) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_BITMAP_SWITCH : - - (*value) = (double) v->bitmap_switch ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - - } - - #pragma omp flush +{ + GrB_Info info ; + GrB_Scalar scalar = NULL ; + GB_OK (GrB_Scalar_new (&scalar, GrB_FP64)) ; + GB_OK (GrB_Vector_get_Scalar (v, scalar, field)) ; + GB_OK (GrB_Scalar_extractElement_FP64 (value, scalar)) ; + GB_FREE_ALL ; return (GrB_SUCCESS) ; } +#undef GB_FREE_ALL + //------------------------------------------------------------------------------ // GxB_Vector_Option_get: based on va_arg //------------------------------------------------------------------------------ @@ -122,92 +54,39 @@ GrB_Info GxB_Vector_Option_get_FP64 // gets the current option of a vector GrB_Info GxB_Vector_Option_get // gets the current option of a vector ( GrB_Vector v, // vector to query - GxB_Option_Field field, // option to query + int field, // option to query ... // return value of the vector option ) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Vector_Option_get (v, field, &value)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to get option", GB0) ; - - //-------------------------------------------------------------------------- - // get the option - //-------------------------------------------------------------------------- - +{ va_list ap ; - switch (field) { + case GxB_IS_HYPER : + { + va_start (ap, field) ; + bool *value = va_arg (ap, bool *) ; + va_end (ap) ; + (*value) = false ; + #pragma omp flush + return (GrB_SUCCESS) ; + } case GxB_BITMAP_SWITCH : - - { - va_start (ap, field) ; - double *bitmap_switch = va_arg (ap, double *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (bitmap_switch) ; - (*bitmap_switch) = (double) v->bitmap_switch ; - } - break ; - - case GxB_SPARSITY_CONTROL : - - { - va_start (ap, field) ; - int *sparsity_control = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (sparsity_control) ; - (*sparsity_control) = v->sparsity_control ; - } - break ; - - case GxB_SPARSITY_STATUS : - - { - va_start (ap, field) ; - int *sparsity = va_arg (ap, int *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (sparsity) ; - (*sparsity) = GB_sparsity ((GrB_Matrix) v) ; - } - break ; - - case GxB_FORMAT : - - { - // a GrB_Vector is always stored by-column - va_start (ap, field) ; - GxB_Format_Value *format = va_arg (ap, GxB_Format_Value *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (format) ; - (*format) = GxB_BY_COL ; - } - break ; - - case GxB_IS_HYPER : // historical; use GxB_SPARSITY_STATUS instead - - { - // a GrB_Vector is never hypersparse - va_start (ap, field) ; - bool *v_is_hyper = va_arg (ap, bool *) ; - va_end (ap) ; - GB_RETURN_IF_NULL (v_is_hyper) ; - (*v_is_hyper) = false ; - } - break ; + case GxB_HYPER_SWITCH : + { + va_start (ap, field) ; + double *value = va_arg (ap, double *) ; + va_end (ap) ; + return (GxB_Vector_Option_get_FP64 (v, field, value)) ; + } default : - - return (GrB_INVALID_VALUE) ; - + { + va_start (ap, field) ; + int *value = va_arg (ap, int *) ; + va_end (ap) ; + return (GxB_Vector_Option_get_INT32 (v, field, value)) ; + } } - - #pragma omp flush - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/get_set/GxB_Vector_Option_set.c b/GraphBLAS/Source/get_set/GxB_Vector_Option_set.c index e8f4b47ae0..f39419e946 100644 --- a/GraphBLAS/Source/get_set/GxB_Vector_Option_set.c +++ b/GraphBLAS/Source/get_set/GxB_Vector_Option_set.c @@ -1,24 +1,13 @@ //------------------------------------------------------------------------------ -// GxB_Vector_Option_set: set an option in a vector +// GxB_Vector_Option_set: set an option in a vector: historical methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#include "transpose/GB_transpose.h" - -#define GB_FREE_ALL ; - -//------------------------------------------------------------------------------ - -// GxB_Vector_Option_set is a single va_arg-based method for any vector option, -// of any type. The following functions are non-va_arg-based methods -// (useful for compilers and interfaces that do not support va_arg): -// -// GxB_Vector_Option_set_INT32 int32_t scalars -// GxB_Vector_Option_set_FP64 double scalars +#include "GB.h" //------------------------------------------------------------------------------ // GxB_Vector_Option_set_INT32: set vector options (int32_t scalars) @@ -27,97 +16,37 @@ GrB_Info GxB_Vector_Option_set_INT32 // set an option in a vector ( GrB_Vector v, // vector to modify - GxB_Option_Field field, // option to change + int field, // option to change int32_t value // value to change it to ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info = GrB_SUCCESS ; - GB_WHERE (v, "GxB_Vector_Option_set_INT32 (v, field, value)") ; - GB_BURBLE_START ("GxB_set (vector option)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the vector option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_SPARSITY_CONTROL : - - v->sparsity_control = GB_sparsity_control (value, (int64_t) (-1)) ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - //-------------------------------------------------------------------------- - // conform the vector to its new desired sparsity structure - //-------------------------------------------------------------------------- - - GB_OK (GB_conform ((GrB_Matrix) v, Werk)) ; - GB_BURBLE_END ; - ASSERT_VECTOR_OK (v, "v set", GB0) ; - return (info) ; + return (GrB_Vector_set_INT32 (v, value, field)) ; } //------------------------------------------------------------------------------ // GxB_Vector_Option_set_FP64: set vector options (double scalars) //------------------------------------------------------------------------------ +#define GB_FREE_ALL GrB_Scalar_free (&scalar) ; + GrB_Info GxB_Vector_Option_set_FP64 // set an option in a vector ( GrB_Vector v, // vector to modify - GxB_Option_Field field, // option to change + int field, // option to change double value // value to change it to ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info = GrB_SUCCESS ; - GB_WHERE (v, "GxB_Vector_Option_set_FP64 (v, field, value)") ; - GB_BURBLE_START ("GxB_set (vector option)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the vector option - //-------------------------------------------------------------------------- - - switch (field) - { - - case GxB_BITMAP_SWITCH : - - v->bitmap_switch = (float) value ; - break ; - - default : - - return (GrB_INVALID_VALUE) ; - } - - //-------------------------------------------------------------------------- - // conform the vector to its new desired sparsity structure - //-------------------------------------------------------------------------- - - GB_OK (GB_conform ((GrB_Matrix) v, Werk)) ; - GB_BURBLE_END ; - ASSERT_VECTOR_OK (v, "v set", GB0) ; - return (info) ; + GrB_Info info ; + GrB_Scalar scalar = NULL ; + GB_OK (GrB_Scalar_new (&scalar, GrB_FP64)) ; + GB_OK (GrB_Scalar_setElement_FP64 (scalar, value)) ; + GB_OK (GrB_Vector_set_Scalar (v, scalar, field)) ; + GB_FREE_ALL + return (GrB_SUCCESS) ; } +#undef GB_FREE_ALL + //------------------------------------------------------------------------------ // GxB_Vector_Option_set: based on va_arg //------------------------------------------------------------------------------ @@ -125,63 +54,29 @@ GrB_Info GxB_Vector_Option_set_FP64 // set an option in a vector GrB_Info GxB_Vector_Option_set // set an option in a vector ( GrB_Vector v, // vector to modify - GxB_Option_Field field, // option to change + int field, // option to change ... // value to change it to ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info = GrB_SUCCESS ; - GB_WHERE (v, "GxB_Vector_Option_set (v, field, value)") ; - GB_BURBLE_START ("GxB_set (vector option)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - ASSERT_VECTOR_OK (v, "v to set option", GB0) ; - - //-------------------------------------------------------------------------- - // set the vector option - //-------------------------------------------------------------------------- - va_list ap ; - switch (field) { - case GxB_BITMAP_SWITCH : - - { - va_start (ap, field) ; - double bitmap_switch = va_arg (ap, double) ; - va_end (ap) ; - v->bitmap_switch = (float) bitmap_switch ; - } - break ; - - case GxB_SPARSITY_CONTROL : - - { - va_start (ap, field) ; - int sparsity_control = va_arg (ap, int) ; - va_end (ap) ; - v->sparsity_control = - GB_sparsity_control (sparsity_control, (int64_t) (-1)) ; - } - break ; + case GxB_HYPER_SWITCH : + { + va_start (ap, field) ; + double value = va_arg (ap, double) ; + va_end (ap) ; + return (GxB_Vector_Option_set_FP64 (v, field, value)) ; + } default : - - return (GrB_INVALID_VALUE) ; + { + va_start (ap, field) ; + int value = va_arg (ap, int) ; + va_end (ap) ; + return (GxB_Vector_Option_set_INT32 (v, field, value)) ; + } } - - //-------------------------------------------------------------------------- - // conform the vector to its new desired sparsity structure - //-------------------------------------------------------------------------- - - GB_OK (GB_conform ((GrB_Matrix) v, Werk)) ; - GB_BURBLE_END ; - ASSERT_VECTOR_OK (v, "v set", GB0) ; - return (info) ; } diff --git a/GraphBLAS/Source/global/GB_Global.c b/GraphBLAS/Source/global/GB_Global.c index e4ed111b34..27db605d04 100644 --- a/GraphBLAS/Source/global/GB_Global.c +++ b/GraphBLAS/Source/global/GB_Global.c @@ -2,7 +2,7 @@ // GB_Global: global values in GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,6 +14,7 @@ // global matrix options, and other settings. #include "GB.h" +#include "include/GB_unused.h" #include "cpu/GB_cpu_features.h" //------------------------------------------------------------------------------ @@ -27,7 +28,7 @@ typedef struct // blocking/non-blocking mode, set by GrB_init //-------------------------------------------------------------------------- - GrB_Mode mode ; // GrB_NONBLOCKING, GrB_BLOCKING + int mode ; // GrB_NONBLOCKING, GrB_BLOCKING // GxB_NONBLOCKING_GPU, or GxB_BLOCKING_GPU bool init_called ; // true if GrB_init already called @@ -96,17 +97,18 @@ typedef struct // for testing and development //-------------------------------------------------------------------------- - int64_t hack [4] ; // settings for testing/development only + int64_t hack [8] ; // settings for testing/development only //-------------------------------------------------------------------------- // diagnostic output //-------------------------------------------------------------------------- - bool burble ; // controls GBURBLE output - GB_printf_function_t printf_func ; // pointer to printf - GB_flush_function_t flush_func ; // pointer to flush + bool burble ; // controls GBURBLE output + GB_printf_function_t printf_func ; // pointer to printf_style function + GB_flush_function_t flush_func ; // pointer to flush_style function bool print_one_based ; // if true, print 1-based indices - bool print_mem_shallow ; // if true, print # shallow bytes + bool stats_mem_shallow ; // if true, include shallow bytes in + // memory usage statistics //-------------------------------------------------------------------------- // timing: for code development only @@ -132,6 +134,14 @@ typedef struct bool cpu_features_avx2 ; // x86_64 with AVX2 bool cpu_features_avx512f ; // x86_64 with AVX512f + //-------------------------------------------------------------------------- + // integer control + //-------------------------------------------------------------------------- + + int8_t p_control ; // controls A->p + int8_t j_control ; // controls A->h and A->Y->[pix] + int8_t i_control ; // controls A->i + //-------------------------------------------------------------------------- // CUDA (DRAFT: in progress): //-------------------------------------------------------------------------- @@ -196,16 +206,17 @@ static GB_Global_struct GB_Global = .malloc_debug = false, // do not test memory handling .malloc_debug_count = 0, // counter for testing memory handling - // for testing and development only - .hack = {0, 0, 0, 0}, + // for testing and development only; not used in production + .hack = {0, 0, 0, 0, 0, 0, 0, 0}, // diagnostics .burble = false, .printf_func = NULL, .flush_func = NULL, .print_one_based = false, // if true, print 1-based indices - .print_mem_shallow = false, // for @GrB interface only + .stats_mem_shallow = false, // if true, include shallow bytes in stats + // timing is for testing and development only; not used in production .timing = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -216,6 +227,11 @@ static GB_Global_struct GB_Global = .cpu_features_avx2 = false, // x86_64 with AVX2 .cpu_features_avx512f = false, // x86_64 with AVX512f + // integer control + .p_control = (int8_t) 32, + .j_control = (int8_t) 32, + .i_control = (int8_t) 32, + // CUDA environment (DRAFT: in progress) .gpu_count = 0, // # of GPUs in the system @@ -229,12 +245,12 @@ static GB_Global_struct GB_Global = // mode //------------------------------------------------------------------------------ -void GB_Global_mode_set (GrB_Mode mode) +void GB_Global_mode_set (int mode) { GB_Global.mode = mode ; } -GrB_Mode GB_Global_mode_get (void) +int GB_Global_mode_get (void) { return (GB_Global.mode) ; } @@ -253,6 +269,40 @@ bool GB_Global_GrB_init_called_get (void) return (GB_Global.init_called) ; } +//------------------------------------------------------------------------------ +// integer control +//------------------------------------------------------------------------------ + +void GB_Global_p_control_set (int8_t p_control) +{ + GB_Global.p_control = p_control ; +} + +int8_t GB_Global_p_control_get (void) +{ + return (GB_Global.p_control) ; +} + +void GB_Global_j_control_set (int8_t j_control) +{ + GB_Global.j_control = j_control ; +} + +int8_t GB_Global_j_control_get (void) +{ + return (GB_Global.j_control) ; +} + +void GB_Global_i_control_set (int8_t i_control) +{ + GB_Global.i_control = i_control ; +} + +int8_t GB_Global_i_control_get (void) +{ + return (GB_Global.i_control) ; +} + //------------------------------------------------------------------------------ // cpu features //------------------------------------------------------------------------------ @@ -439,12 +489,12 @@ void GB_Global_abort (void) void GB_Global_memtable_dump (void) { - #ifdef GB_DEBUG - printf ("\nmemtable dump: %d nmalloc " GBd "\n", // MEMDUMP + #if defined (GB_DEBUG) && defined (GB_MEMDUMP) + GBMDUMP ("\nmemtable dump: %d nmalloc " GBd "\n", GB_Global.nmemtable, GB_Global.nmalloc) ; for (int k = 0 ; k < GB_Global.nmemtable ; k++) { - printf (" %4d: %12p : %ld\n", k, // MEMDUMP + GBMDUMP (" %4d: %12p : %ld\n", k, GB_Global.memtable_p [k], GB_Global.memtable_s [k]) ; } @@ -473,9 +523,7 @@ void GB_Global_memtable_add (void *p, size_t size) #ifdef GB_DEBUG bool fail = false ; - #ifdef GB_MEMDUMP - printf ("memtable add %p size %ld\n", p, size) ; // MEMDUMP - #endif + GBMDUMP ("memtable add %p size %ld\n", p, size) ; #pragma omp critical(GB_memtable) { int n = GB_Global.nmemtable ; @@ -486,8 +534,7 @@ void GB_Global_memtable_add (void *p, size_t size) { if (p == GB_Global.memtable_p [i]) { - printf ("\nadd duplicate %p size %ld\n", // MEMDUMP - p, size) ; + GBDUMP ("\nFAIL add duplicate %p size %ld\n", p, size) ; GB_Global_memtable_dump ( ) ; fail = true ; break ; @@ -502,11 +549,8 @@ void GB_Global_memtable_add (void *p, size_t size) } } ASSERT (!fail) ; - #ifdef GB_MEMDUMP GB_Global_memtable_dump ( ) ; #endif - #endif - } // get the size of a malloc'd block @@ -532,7 +576,7 @@ size_t GB_Global_memtable_size (void *p) } if (!found) { - printf ("\nFAIL: %p not found\n", p) ; // MEMDUMP + GBDUMP ("\nFAIL: %p not found\n", p) ; GB_Global_memtable_dump ( ) ; ASSERT (0) ; } @@ -577,9 +621,7 @@ void GB_Global_memtable_remove (void *p) #ifdef GB_DEBUG bool found = false ; - #ifdef GB_MEMDUMP - printf ("memtable remove %p ", p) ; // MEMDUMP - #endif + GBMDUMP ("memtable remove %p ", p) ; #pragma omp critical(GB_memtable) { int n = GB_Global.nmemtable ; @@ -598,14 +640,12 @@ void GB_Global_memtable_remove (void *p) } if (!found) { - printf ("remove %p NOT FOUND\n", p) ; // MEMDUMP + GBDUMP ("remove %p NOT FOUND\n", p) ; GB_Global_memtable_dump ( ) ; + ASSERT (0) ; } - ASSERT (found) ; - #ifdef GB_MEMDUMP GB_Global_memtable_dump ( ) ; #endif - #endif } @@ -613,6 +653,8 @@ void GB_Global_memtable_remove (void *p) // malloc_function //------------------------------------------------------------------------------ +#include "include/GB_pedantic_disable.h" + void GB_Global_malloc_function_set (void * (* malloc_function) (size_t)) { GB_Global.malloc_function = malloc_function ; @@ -741,12 +783,17 @@ void * GB_Global_persistent_malloc (size_t size) { // malloc persistent memory void *p = GB_Global.malloc_function (size) ; + GB_Global_make_persistent (p) ; + return (p) ; +} + +void GB_Global_make_persistent (void *p) +{ if (p != NULL && GB_Global.persistent_function != NULL) { // tell MATLAB to make this memory persistent GB_Global.persistent_function (p) ; } - return (p) ; } void GB_Global_persistent_set (void (* persistent_function) (void *)) @@ -913,17 +960,17 @@ bool GB_Global_print_one_based_get (void) } //------------------------------------------------------------------------------ -// for printing matrix in @GrB interface +// for memory usage statistics //------------------------------------------------------------------------------ -void GB_Global_print_mem_shallow_set (bool mem_shallow) +void GB_Global_stats_mem_shallow_set (bool mem_shallow) { - GB_Global.print_mem_shallow = mem_shallow ; + GB_Global.stats_mem_shallow = mem_shallow ; } -bool GB_Global_print_mem_shallow_get (void) +bool GB_Global_stats_mem_shallow_get (void) { - return (GB_Global.print_mem_shallow) ; + return (GB_Global.stats_mem_shallow) ; } //------------------------------------------------------------------------------ @@ -1045,12 +1092,3 @@ double GB_Global_timing_get (int k) return (GB_Global.timing [k]) ; } -//------------------------------------------------------------------------------ -// get_wtime: return current wallclock time -//------------------------------------------------------------------------------ - -double GB_Global_get_wtime (void) -{ - return (GB_OPENMP_GET_WTIME) ; -} - diff --git a/GraphBLAS/Source/global/GB_Global.h b/GraphBLAS/Source/global/GB_Global.h index 0f42b8767c..47a77897e9 100644 --- a/GraphBLAS/Source/global/GB_Global.h +++ b/GraphBLAS/Source/global/GB_Global.h @@ -2,7 +2,7 @@ // GB_Global.h: definitions for global data //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,8 +18,8 @@ void GB_Global_cpu_features_query (void) ; bool GB_Global_cpu_features_avx2 (void) ; bool GB_Global_cpu_features_avx512f (void) ; -void GB_Global_mode_set (GrB_Mode mode) ; -GrB_Mode GB_Global_mode_get (void) ; +void GB_Global_mode_set (int mode) ; +int GB_Global_mode_get (void) ; void GB_Global_sort_set (int sort) ; int GB_Global_sort_get (void) ; @@ -75,6 +75,7 @@ void GB_Global_malloc_debug_count_set (int64_t malloc_debug_count) ; bool GB_Global_malloc_debug_count_decrement (void) ; void * GB_Global_persistent_malloc (size_t size) ; +void GB_Global_make_persistent (void *p) ; void GB_Global_persistent_set (void (* persistent_function) (void *)) ; void GB_Global_persistent_free (void **p) ; @@ -87,8 +88,8 @@ bool GB_Global_burble_get (void) ; void GB_Global_print_one_based_set (bool onebased) ; bool GB_Global_print_one_based_get (void) ; -void GB_Global_print_mem_shallow_set (bool mem_shallow) ; -bool GB_Global_print_mem_shallow_get (void) ; +void GB_Global_stats_mem_shallow_set (bool mem_shallow) ; +bool GB_Global_stats_mem_shallow_get (void) ; bool GB_Global_gpu_count_set (bool enable_cuda) ; int GB_Global_gpu_count_get (void) ; @@ -123,11 +124,16 @@ void GB_Global_printf_set (GB_printf_function_t p) ; GB_flush_function_t GB_Global_flush_get (void) ; void GB_Global_flush_set (GB_flush_function_t p) ; -double GB_Global_get_wtime (void) ; - void * GB_Global_malloc_function_get (void) ; void * GB_Global_calloc_function_get (void) ; void * GB_Global_realloc_function_get (void) ; void * GB_Global_free_function_get (void) ; + +void GB_Global_p_control_set (int8_t p_control) ; +int8_t GB_Global_p_control_get (void) ; +void GB_Global_j_control_set (int8_t j_control) ; +int8_t GB_Global_j_control_get (void) ; +void GB_Global_i_control_set (int8_t i_control) ; +int8_t GB_Global_i_control_get (void) ; #endif diff --git a/GraphBLAS/Source/helper/GB_factory.h b/GraphBLAS/Source/helper/GB_factory.h index 01cff84146..f28a6aa5f0 100644 --- a/GraphBLAS/Source/helper/GB_factory.h +++ b/GraphBLAS/Source/helper/GB_factory.h @@ -2,7 +2,7 @@ // GB_factory.h: for testing factory kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/helper/GB_helper.c b/GraphBLAS/Source/helper/GB_helper.c index 503a6e13b8..4f4d258447 100644 --- a/GraphBLAS/Source/helper/GB_helper.c +++ b/GraphBLAS/Source/helper/GB_helper.c @@ -2,7 +2,7 @@ // GB_helper.c: helper functions for @GrB interface //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,8 @@ bool GB_factory_kernels_enabled = true ; #define GB_ALLOCATE_WORK(work_type) \ size_t Work_size ; \ - work_type *Work = GB_MALLOC_WORK (nthreads, work_type, &Work_size) ; \ + work_type *Work = GB_MALLOC_MEMORY (nthreads, sizeof (work_type), \ + &Work_size) ; \ if (Work == NULL) return (false) ; //------------------------------------------------------------------------------ @@ -37,224 +38,26 @@ bool GB_factory_kernels_enabled = true ; //------------------------------------------------------------------------------ #define GB_FREE_WORKSPACE \ - GB_FREE_WORK (&Work, Work_size) ; - -//------------------------------------------------------------------------------ -// GB_helper0: get the current wall-clock time from OpenMP -//------------------------------------------------------------------------------ - -double GB_helper0 (void) -{ - return (GB_OPENMP_GET_WTIME) ; -} - -//------------------------------------------------------------------------------ -// GB_helper1: convert 0-based indices to 1-based for gbextracttuples -//------------------------------------------------------------------------------ - -void GB_helper1 // convert zero-based indices to one-based -( - double *restrict I_double, // output array - const GrB_Index *restrict I, // input array - int64_t nvals // size of input and output arrays -) -{ - - GB_NTHREADS_HELPER (nvals) ; - - int64_t k ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (k = 0 ; k < nvals ; k++) - { - I_double [k] = (double) (I [k] + 1) ; - } -} - -//------------------------------------------------------------------------------ -// GB_helper1i: convert 0-based indices to 1-based for gbextracttuples -//------------------------------------------------------------------------------ - -void GB_helper1i // convert zero-based indices to one-based -( - int64_t *restrict I, // input/output array - int64_t nvals // size of input/output array -) -{ - - GB_NTHREADS_HELPER (nvals) ; - - int64_t k ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (k = 0 ; k < nvals ; k++) - { - I [k] ++ ; - } -} - -//------------------------------------------------------------------------------ -// GB_helper3: convert 1-based indices to 0-based for gb_mxarray_to_list -//------------------------------------------------------------------------------ - -bool GB_helper3 // return true if OK, false on error -( - int64_t *restrict List, // size len, output array - const double *restrict List_double, // size len, input array - int64_t len, - int64_t *List_max // also compute the max entry in the list (1-based) -) -{ - - GB_NTHREADS_HELPER (len) ; - - ASSERT (List != NULL) ; - ASSERT (List_double != NULL) ; - ASSERT (List_max != NULL) ; - - bool ok = true ; - int64_t listmax = -1 ; - - GB_ALLOCATE_WORK (int64_t) ; - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - bool my_ok = true ; - int64_t k1, k2, my_listmax = -1 ; - GB_PARTITION (k1, k2, len, tid, nthreads) ; - for (int64_t k = k1 ; k < k2 ; k++) - { - double x = List_double [k] ; - int64_t i = (int64_t) x ; - my_ok = my_ok && (x == (double) i) ; - my_listmax = GB_IMAX (my_listmax, i) ; - List [k] = i - 1 ; - } - // rather than create a separate per-thread boolean workspace, just - // use a sentinal value of INT64_MIN if non-integer indices appear - // in List_double. - Work [tid] = my_ok ? my_listmax : INT64_MIN ; - } - - // wrapup - for (tid = 0 ; tid < nthreads ; tid++) - { - listmax = GB_IMAX (listmax, Work [tid]) ; - ok = ok && (Work [tid] != INT64_MIN) ; - } - - GB_FREE_WORKSPACE ; - - (*List_max) = listmax ; - return (ok) ; -} - -//------------------------------------------------------------------------------ -// GB_helper3i: convert 1-based indices to 0-based for gb_mxarray_to_list -//------------------------------------------------------------------------------ - -bool GB_helper3i // return true if OK, false on error -( - int64_t *restrict List, // size len, output array - const int64_t *restrict List_int64, // size len, input array - int64_t len, - int64_t *List_max // also compute the max entry in the list (1-based) -) -{ - - GB_NTHREADS_HELPER (len) ; - - int64_t listmax = -1 ; - - GB_ALLOCATE_WORK (int64_t) ; - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - int64_t k1, k2, my_listmax = -1 ; - GB_PARTITION (k1, k2, len, tid, nthreads) ; - for (int64_t k = k1 ; k < k2 ; k++) - { - int64_t i = List_int64 [k] ; - my_listmax = GB_IMAX (my_listmax, i) ; - List [k] = i - 1 ; - } - Work [tid] = my_listmax ; - } - - // wrapup - for (tid = 0 ; tid < nthreads ; tid++) - { - listmax = GB_IMAX (listmax, Work [tid]) ; - } - - GB_FREE_WORKSPACE ; - - (*List_max) = listmax ; - return (true) ; -} - -//------------------------------------------------------------------------------ -// GB_helper4: find the max entry in a list of type GrB_Index -//------------------------------------------------------------------------------ - -bool GB_helper4 // return true if OK, false on error -( - const GrB_Index *restrict I, // array of size len - const int64_t len, - GrB_Index *List_max // also compute the max entry in the list (1-based, - // which is max(I)+1) -) -{ - - GB_NTHREADS_HELPER (len) ; - - GrB_Index listmax = 0 ; - - GB_ALLOCATE_WORK (GrB_Index) ; - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - int64_t k1, k2 ; - GrB_Index my_listmax = 0 ; - GB_PARTITION (k1, k2, len, tid, nthreads) ; - for (int64_t k = k1 ; k < k2 ; k++) - { - my_listmax = GB_IMAX (my_listmax, I [k]) ; - } - Work [tid] = my_listmax ; - } - - // wrapup - for (tid = 0 ; tid < nthreads ; tid++) - { - listmax = GB_IMAX (listmax, Work [tid]) ; - } - - GB_FREE_WORKSPACE ; - - if (len > 0) listmax++ ; - (*List_max) = listmax ; - return (true) ; -} + GB_FREE_MEMORY (&Work, Work_size) ; //------------------------------------------------------------------------------ // GB_helper5: construct pattern of S for gblogassign //------------------------------------------------------------------------------ -void GB_helper5 // construct pattern of S +void GB_helper5 // construct pattern of S ( - GrB_Index *restrict Si, // array of size anz - GrB_Index *restrict Sj, // array of size anz - const GrB_Index *restrict Mi, // array of size mnz, M->i, may be NULL - const GrB_Index *restrict Mj, // array of size mnz, + // output: + uint64_t *restrict Si, // array of size anz + uint64_t *restrict Sj, // array of size anz + // input: + const void *Mi, // array of size mnz, M->i, may be NULL + const bool Mi_is_32, // if true, M->i is 32-bit; else 64-bit + const uint64_t *restrict Mj, // array of size mnz const int64_t mvlen, // M->vlen - GrB_Index *restrict Ai, // array of size anz, A->i, may be NULL - const int64_t avlen, // M->vlen - const GrB_Index anz + const void *Ai, // array of size anz, A->i, may be NULL + const bool Ai_is_32, // if true, A->i is 32-bit; else 64-bit + const int64_t avlen, // A->vlen + const uint64_t anz ) { @@ -263,12 +66,15 @@ void GB_helper5 // construct pattern of S ASSERT (Si != NULL) ; ASSERT (Sj != NULL) ; + GB_IDECL (Ai, const, u) ; GB_IPTR (Ai, Ai_is_32) ; + GB_IDECL (Mi, const, u) ; GB_IPTR (Mi, Mi_is_32) ; + int64_t k ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < anz ; k++) { - int64_t i = GBI (Ai, k, avlen) ; - Si [k] = GBI (Mi, i, mvlen) ; + int64_t i = GBi_A (Ai, k, avlen) ; + Si [k] = GBi_M (Mi, i, mvlen) ; Sj [k] = Mj [i] ; } } @@ -281,8 +87,8 @@ void GB_helper5 // construct pattern of S void GB_helper7 // Kx = uint64 (0:mnz-1) ( - uint64_t *restrict Kx, // array of size mnz - const GrB_Index mnz + uint64_t *restrict Kx, // array of size mnz + const uint64_t mnz ) { @@ -296,32 +102,6 @@ void GB_helper7 // Kx = uint64 (0:mnz-1) } } -//------------------------------------------------------------------------------ -// GB_helper8: expand a scalar into an array for gbbuild -//------------------------------------------------------------------------------ - -// TODO: use GrB_assign instead - -void GB_helper8 -( - GB_void *C, // output array of size nvals * s - GB_void *A, // input scalar of size s - GrB_Index nvals, // size of C - size_t s // size of each scalar -) -{ - - GB_NTHREADS_HELPER (nvals) ; - - int64_t k ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (k = 0 ; k < nvals ; k++) - { - // C [k] = A [0] - memcpy (C + k * s, A, s) ; - } -} - //------------------------------------------------------------------------------ // GB_helper10: compute norm (x-y,p) of two dense FP32 or FP64 vectors //------------------------------------------------------------------------------ @@ -342,7 +122,7 @@ double GB_helper10 // norm (x-y,p), or -1 on error bool y_iso, // true if x is iso GrB_Type type, // GrB_FP32 or GrB_FP64 int64_t p, // 0, 1, 2, INT64_MIN, or INT64_MAX - GrB_Index n + uint64_t n ) { @@ -637,26 +417,69 @@ double GB_helper10 // norm (x-y,p), or -1 on error } //------------------------------------------------------------------------------ -// GB_make_shallow.c: force a matrix to have purely shallow components +// persistent Container //------------------------------------------------------------------------------ -void GB_make_shallow (GrB_Matrix A) +static GxB_Container Container = NULL ; + +static GrB_Vector GB_helper_component (void) +{ + size_t s = sizeof (struct GB_Vector_opaque) ; + GrB_Vector p = GB_Global_persistent_malloc (s) ; + if (p != NULL) + { + memset (p, 0, s) ; + p->header_size = s ; + p->type = GrB_BOOL ; + p->is_csc = true ; + p->plen = -1 ; + p->vdim = 1 ; + p->nvec = 1 ; + p->sparsity_control = GxB_FULL ; + p->magic = GB_MAGIC ; + } + ASSERT_VECTOR_OK (p, "container component", GB0) ; + return (p) ; +} + +GxB_Container GB_helper_container (void) // return the global Container +{ + return (Container) ; +} + +void GB_helper_container_new (void) // allocate the global Container +{ + // free any existing Container + GB_helper_container_free ( ) ; + + // allocate a new Container + size_t s = sizeof (struct GxB_Container_struct) ; + Container = GB_Global_persistent_malloc (s) ; + if (Container != NULL) + { + memset (Container, 0, s) ; + Container->p = GB_helper_component ( ) ; + Container->h = GB_helper_component ( ) ; + Container->b = GB_helper_component ( ) ; + Container->i = GB_helper_component ( ) ; + Container->x = GB_helper_component ( ) ; + + // clear the Container scalars + Container->nrows_nonempty = -1 ; + Container->ncols_nonempty = -1 ; + Container->format = GxB_FULL ; + Container->orientation = GrB_ROWMAJOR ; + } +} + +void GB_helper_container_free (void) // free the global Container { - if (A == NULL) return ; - A->p_shallow = (A->p != NULL) ; - A->h_shallow = (A->h != NULL) ; - A->b_shallow = (A->b != NULL) ; - A->i_shallow = (A->i != NULL) ; - A->x_shallow = (A->x != NULL) ; - #ifdef GB_MEMDUMP - printf ("remove from memtable: Ap:%p Ah:%p Ab:%p Ai:%p Ax:%p\n", // MEMDUMP - A->p, A->h, A->b, A->i, A->x) ; - #endif - if (A->p != NULL) GB_Global_memtable_remove (A->p) ; - if (A->h != NULL) GB_Global_memtable_remove (A->h) ; - if (A->b != NULL) GB_Global_memtable_remove (A->b) ; - if (A->i != NULL) GB_Global_memtable_remove (A->i) ; - if (A->x != NULL) GB_Global_memtable_remove (A->x) ; - GB_make_shallow (A->Y) ; + if (Container == NULL) return ; + GB_Global_persistent_free ((void **) &(Container->p)) ; + GB_Global_persistent_free ((void **) &(Container->h)) ; + GB_Global_persistent_free ((void **) &(Container->b)) ; + GB_Global_persistent_free ((void **) &(Container->i)) ; + GB_Global_persistent_free ((void **) &(Container->x)) ; + GB_Global_persistent_free ((void **) &(Container)) ; } diff --git a/GraphBLAS/Source/helper/GB_helper.h b/GraphBLAS/Source/helper/GB_helper.h index 9e59c4865b..d5035dadb7 100644 --- a/GraphBLAS/Source/helper/GB_helper.h +++ b/GraphBLAS/Source/helper/GB_helper.h @@ -2,12 +2,12 @@ // GB_helper.h: helper functions for @GrB interface //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// These functions are only used by the @GrB interface for +// These functions are only used by the @GrB MATLAB/Octave interface for // SuiteSparse:GraphBLAS. #ifndef GB_HELPER_H @@ -16,68 +16,26 @@ #include "GB.h" #include "math/GB_math.h" -double GB_helper0 (void) ; - -void GB_helper1 // convert zero-based indices to one-based -( - double *restrict I_double, // output array - const GrB_Index *restrict I, // input array - int64_t nvals // size of input and output arrays -) ; - -void GB_helper1i // convert zero-based indices to one-based -( - int64_t *restrict I, // input/output array - int64_t nvals // size of input/output array -) ; - -bool GB_helper3 // return true if OK, false on error -( - int64_t *restrict List, // size len, output array - const double *restrict List_double, // size len, input array - int64_t len, - int64_t *List_max // also compute the max entry in the list -) ; - -bool GB_helper3i // return true if OK, false on error +void GB_helper5 // construct pattern of S ( - int64_t *restrict List, // size len, output array - const int64_t *restrict List_int64, // size len, input array - int64_t len, - int64_t *List_max // also compute the max entry in the list -) ; - -bool GB_helper4 // return true if OK, false on error -( - const GrB_Index *restrict I, // array of size len - const int64_t len, - GrB_Index *List_max // find max (I) + 1 -) ; - -void GB_helper5 // construct pattern of S -( - GrB_Index *restrict Si, // array of size anz - GrB_Index *restrict Sj, // array of size anz - const GrB_Index *restrict Mi, // array of size mnz, M->i - const GrB_Index *restrict Mj, // array of size mnz - const int64_t mvlen, // M->vlen - GrB_Index *restrict Ai, // array of size anz, A->i - const int64_t avlen, // M->vlen - const GrB_Index anz + // output: + uint64_t *restrict Si, // array of size anz + uint64_t *restrict Sj, // array of size anz + // input: + const void *Mi, // array of size mnz, M->i, may be NULL + const bool Mi_is_32, // if true, M->i is 32-bit; else 64-bit + const uint64_t *restrict Mj, // array of size mnz + const int64_t mvlen, // M->vlen + const void *Ai, // array of size anz, A->i, may be NULL + const bool Ai_is_32, // if true, A->i is 32-bit; else 64-bit + const int64_t avlen, // A->vlen + const uint64_t anz ) ; void GB_helper7 // Kx = uint64 (0:mnz-1) ( - uint64_t *restrict Kx, // array of size mnz - const GrB_Index mnz -) ; - -void GB_helper8 -( - GB_void *C, // output array of size nvals * s - GB_void *A, // input scalar of size s - GrB_Index nvals, // size of C - size_t s // size of each scalar + uint64_t *restrict Kx, // array of size mnz + const uint64_t mnz ) ; double GB_helper10 // norm (x-y,p), or -1 on error @@ -88,10 +46,12 @@ double GB_helper10 // norm (x-y,p), or -1 on error bool y_iso, // true if x is iso GrB_Type type, // GrB_FP32 or GrB_FP64 int64_t p, // 0, 1, 2, INT64_MIN, or INT64_MAX - GrB_Index n + uint64_t n ) ; -void GB_make_shallow (GrB_Matrix A) ; +GxB_Container GB_helper_container (void) ; // return the global Container +void GB_helper_container_new (void) ; // allocate the global Container +void GB_helper_container_free (void) ; // free the global Container #endif diff --git a/GraphBLAS/Source/hyper/GB_hyper.h b/GraphBLAS/Source/hyper/GB_hyper.h index 507824b746..65b87cd2f7 100644 --- a/GraphBLAS/Source/hyper/GB_hyper.h +++ b/GraphBLAS/Source/hyper/GB_hyper.h @@ -2,7 +2,7 @@ // GB_hyper.h: definitions for hypersparse matrices and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,53 @@ int64_t GB_nvec_nonempty // return # of non-empty vectors const GrB_Matrix A // input matrix to examine ) ; +static inline int64_t GB_nvec_nonempty_get +( + GrB_Matrix A +) +{ + int64_t nvec_nonempty = 0 ; + if (A != NULL) + { + GB_ATOMIC_READ + nvec_nonempty = A->nvec_nonempty ; + } + return (nvec_nonempty) ; +} + +static inline void GB_nvec_nonempty_set +( + GrB_Matrix A, + int64_t nvec_nonempty +) +{ + if (A != NULL) + { + GB_ATOMIC_WRITE + A->nvec_nonempty = nvec_nonempty ; + } +} + +static inline int64_t GB_nvec_nonempty_update +( + GrB_Matrix A +) +{ + int64_t nvec_nonempty = 0 ; + if (A != NULL) + { + // get the current value of A->nvec_nonempty + nvec_nonempty = GB_nvec_nonempty_get (A) ; + if (nvec_nonempty < 0) + { + // compute A->nvec_nonempty and then update it atomically + nvec_nonempty = GB_nvec_nonempty (A) ; + GB_nvec_nonempty_set (A, nvec_nonempty) ; + } + } + return (nvec_nonempty) ; +} + GrB_Info GB_hyper_realloc ( GrB_Matrix A, // matrix with hyperlist to reallocate @@ -23,20 +70,6 @@ GrB_Info GB_hyper_realloc ) ; GrB_Info GB_hyper_prune -( - // output, not allocated on input: - int64_t *restrict *p_Ap, size_t *p_Ap_size, // size plen+1 - int64_t *restrict *p_Ah, size_t *p_Ah_size, // size plen - int64_t *p_nvec, // # of vectors, all nonempty - int64_t *p_plen, // size of Ap and Ah - // input, not modified - const int64_t *Ap_old, // size nvec_old+1 - const int64_t *Ah_old, // size nvec_old - const int64_t nvec_old, // original number of vectors - GB_Werk Werk -) ; - -GrB_Info GB_hypermatrix_prune ( GrB_Matrix A, // matrix to prune GB_Werk Werk @@ -47,72 +80,11 @@ bool GB_hyper_hash_need // return true if A needs a hyper hash GrB_Matrix A ) ; -//------------------------------------------------------------------------------ -// GB_lookup: find k so that j == Ah [k], without using the A->Y hyper_hash -//------------------------------------------------------------------------------ - -#ifdef GB_DEBUG - -// For a sparse, bitmap, or full matrix j == k. -// For a hypersparse matrix, find k so that j == Ah [k], if it -// appears in the list. - -// k is not needed by the caller, just pstart, pend, pleft, and found. - -// Once k is found, find pstart and pend, the start and end of the vector. -// pstart and pend are defined for all sparsity structures: hypersparse, -// sparse, bitmap, or full. - -// With the introduction of the hyper_hash, this is used only for debugging. - -static inline bool GB_lookup // find j = Ah [k] +GrB_Matrix GB_hyper_shallow // return C ( - // input: - const bool A_is_hyper, // true if A is hypersparse - const int64_t *restrict Ah, // A->h [0..A->nvec-1]: list of vectors - const int64_t *restrict Ap, // A->p [0..A->nvec ]: pointers to vectors - const int64_t avlen, // A->vlen - // input/output: - int64_t *restrict pleft, // on input: look in A->h [pleft..pright]. - // on output: pleft == k if found. - // input: - int64_t pright, // normally A->nvec-1, but can be trimmed - const int64_t j, // vector to find, as j = Ah [k] - // output: - int64_t *restrict pstart, // start of vector: Ap [k] - int64_t *restrict pend // end of vector: Ap [k+1] -) -{ - if (A_is_hyper) - { - // binary search of Ah [pleft...pright] for the value j - bool found ; - GB_BINARY_SEARCH (j, Ah, (*pleft), pright, found) ; // ok (historical) - if (found) - { - // j appears in the hyperlist at Ah [pleft] - // k = (*pleft) - (*pstart) = Ap [(*pleft)] ; - (*pend) = Ap [(*pleft)+1] ; - } - else - { - // j does not appear in the hyperlist Ah - // k = -1 - (*pstart) = -1 ; - (*pend) = -1 ; - } - return (found) ; - } - else - { - // A is sparse, bitmap, or full; j always appears - // k = j - (*pstart) = GBP (Ap, j, avlen) ; - (*pend) = GBP (Ap, j+1, avlen) ; - return (true) ; - } -} -#endif + GrB_Matrix C, // output matrix + const GrB_Matrix A // input matrix +) ; + #endif diff --git a/GraphBLAS/Source/hyper/GB_hyper_hash_build.c b/GraphBLAS/Source/hyper/GB_hyper_hash_build.c index e6969ef53b..27ea882213 100644 --- a/GraphBLAS/Source/hyper/GB_hyper_hash_build.c +++ b/GraphBLAS/Source/hyper/GB_hyper_hash_build.c @@ -2,16 +2,16 @@ // GB_hyper_hash_build: construct A->Y for a hypersparse matrix A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #define GB_FREE_WORKSPACE \ { \ - GB_FREE (&I_work, I_work_size) ; \ - GB_FREE (&J_work, J_work_size) ; \ - GB_FREE (&X_work, X_work_size) ; \ + GB_FREE_MEMORY (&I_work, I_work_size) ; \ + GB_FREE_MEMORY (&J_work, J_work_size) ; \ + GB_FREE_MEMORY (&X_work, X_work_size) ; \ } #define GB_FREE_ALL \ @@ -37,9 +37,9 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) } GrB_Info info ; - int64_t *restrict I_work = NULL ; size_t I_work_size = 0 ; - int64_t *restrict J_work = NULL ; size_t J_work_size = 0 ; - uint64_t *restrict X_work = NULL ; size_t X_work_size = 0 ; + GB_MDECL (I_work, , u) ; size_t I_work_size = 0 ; + GB_MDECL (J_work, , u) ; size_t J_work_size = 0 ; + GB_MDECL (X_work, , u) ; size_t X_work_size = 0 ; ASSERT_MATRIX_OK (A, "A for hyper_hash", GB0) ; GB_BURBLE_MATRIX (A, "(build hyper hash) ") ; @@ -51,7 +51,9 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) // A->Y is (A->vdim)-by-(hash table size for A->h), with one vector per // hash bucket. - const int64_t *restrict Ah = A->h ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + ASSERT (Ah != NULL) ; + int64_t anvec = A->nvec ; // this ensures a load factor of 0.5 to 1: int64_t yvdim = ((uint64_t) 1) << (GB_FLOOR_LOG2 (anvec) + 1) ; @@ -60,19 +62,21 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) yvdim = GB_IMAX (yvdim, 4) ; int64_t yvlen = A->vdim ; int64_t hash_bits = (yvdim - 1) ; // yvdim is always a power of 2 + bool Aj_is_32 = A->j_is_32 ; GB_OK (GB_new (&(A->Y), // new dynamic header, do not allocate any content - GrB_UINT64, yvlen, yvdim, GB_Ap_null, true, GxB_SPARSE, - -1, 0)) ; + GrB_UINT64, yvlen, yvdim, GB_ph_null, true, GxB_SPARSE, -1, 0, + Aj_is_32, Aj_is_32, Aj_is_32)) ; GrB_Matrix Y = A->Y ; //-------------------------------------------------------------------------- // create the tuples for A->Y //-------------------------------------------------------------------------- - I_work = GB_MALLOC (anvec, int64_t, &I_work_size) ; - J_work = GB_MALLOC (anvec, int64_t, &J_work_size) ; - X_work = GB_MALLOC (anvec, uint64_t, &X_work_size) ; + size_t jsize = (Aj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + I_work = GB_MALLOC_MEMORY (anvec, jsize, &I_work_size) ; + J_work = GB_MALLOC_MEMORY (anvec, jsize, &J_work_size) ; + X_work = GB_MALLOC_MEMORY (anvec, jsize, &X_work_size) ; if (I_work == NULL || J_work == NULL || X_work == NULL) { // out of memory @@ -80,6 +84,10 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (I_work, Aj_is_32) ; + GB_IPTR (J_work, Aj_is_32) ; + GB_IPTR (X_work, Aj_is_32) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; int nthreads = GB_nthreads (anvec, chunk, nthreads_max) ; @@ -88,25 +96,31 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < anvec ; k++) { - int64_t j = Ah [k] ; - I_work [k] = j ; - J_work [k] = GB_HASHF2 (j, hash_bits) ; // in range 0 to yvdim-1 - X_work [k] = (uint64_t) k ; + uint64_t j = GB_IGET (Ah, k) ; + uint64_t hash = GB_HASHF2 (j, hash_bits) ; // in range 0 to yvdim-1 + // J_work [k] = hash ; + GB_ISET (J_work, k, hash) ; + // I_work [k] = j ; + GB_ISET (I_work, k, j) ; + // X_work [k] = k ; + GB_ISET (X_work, k, k) ; } //-------------------------------------------------------------------------- // build A->Y, initially hypersparse //-------------------------------------------------------------------------- + GrB_Type ytype = (Aj_is_32) ? GrB_UINT32 : GrB_UINT64 ; + GB_OK (GB_builder ( Y, // create Y using a dynamic header - GrB_UINT64, // Y->type + ytype, // Y->type yvlen, // Y->vlen yvdim, // Y->vdim true, // Y->is_csc - (int64_t **) &I_work, // row indices + &I_work, // row indices &I_work_size, - (int64_t **) &J_work, // column indices + &J_work, // column indices &J_work_size, (GB_void **) &X_work, // values &X_work_size, @@ -119,9 +133,11 @@ GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) false, // Y is never iso anvec, // # of tuples NULL, // no duplicates, so dup is NUL - GrB_UINT64, // the type of X_work + ytype, // the type of X_work false, // no burble (already burbled above) - Werk + Werk, + Aj_is_32, Aj_is_32, // if true, [IJ]_work 32-bit, else 64-bit + Aj_is_32, Aj_is_32, Aj_is_32 // integer size of A->Y->[pix] )) ; Y->hyper_switch = -1 ; // never make Y hypersparse diff --git a/GraphBLAS/Source/hyper/GB_hyper_hash_need.c b/GraphBLAS/Source/hyper/GB_hyper_hash_need.c index 3f296f1637..1c5bd7b6eb 100644 --- a/GraphBLAS/Source/hyper/GB_hyper_hash_need.c +++ b/GraphBLAS/Source/hyper/GB_hyper_hash_need.c @@ -2,7 +2,7 @@ // GB_hyper_hash_need: determine if a matrix needs its hyper_hash built //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,11 +39,7 @@ bool GB_hyper_hash_need // A is hypersparse, and has no hyper_hash. Check how many non-empty // vectors it has. A->Y should be built if A has a significant number of // non-empty vectors. - - // FUTURE: make this also a per-matrix parameter for GrB_get/set - int64_t hyper_hash = GB_Global_hyper_hash_get ( ) ; - return (A->nvec > hyper_hash) ; } diff --git a/GraphBLAS/Source/hyper/GB_hyper_prune.c b/GraphBLAS/Source/hyper/GB_hyper_prune.c index 953066c39a..e7b079e858 100644 --- a/GraphBLAS/Source/hyper/GB_hyper_prune.c +++ b/GraphBLAS/Source/hyper/GB_hyper_prune.c @@ -1,30 +1,24 @@ //------------------------------------------------------------------------------ -// GB_hyper_prune: remove empty vectors from a hypersparse Ap, Ah list +// GB_hyper_prune: prune empty vectors from a hypersparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Removes empty vectors from a hypersparse list. On input, *Ap and *Ah are -// assumed to be NULL. The input arrays Ap_old and Ah_old are not modified, -// and thus can be shallow content from another matrix. New hyperlists Ap and -// Ah are allocated, for nvec vectors, all nonempty. +// On input, A->p and A->h may be shallow. If modified, new arrays A->p and +// A->h are created, which are not shallow, and any existing hyper hash is +// freed. If these arrays are not modified, and are shallow on input, then +// they remain shallow on output. If new A->p and A->h arrays are constructed, +// the existing A->Y hyper_hash is freed. A->p_is_32, A->j_is_32, and +// A->i_is_32 are unchanged in all cases. #include "GB.h" GrB_Info GB_hyper_prune ( - // output, not allocated on input: - int64_t *restrict *p_Ap, size_t *p_Ap_size, // size plen+1 - int64_t *restrict *p_Ah, size_t *p_Ah_size, // size plen - int64_t *p_nvec, // # of vectors, all nonempty - int64_t *p_plen, // size of Ap and Ah - // input, not modified - const int64_t *Ap_old, // size nvec_old+1 - const int64_t *Ah_old, // size nvec_old - const int64_t nvec_old, // original number of vectors + GrB_Matrix A, // matrix to prune GB_Werk Werk ) { @@ -33,19 +27,48 @@ GrB_Info GB_hyper_prune // check inputs //-------------------------------------------------------------------------- - ASSERT (p_Ap != NULL) ; - ASSERT (p_Ah != NULL) ; - ASSERT (p_nvec != NULL) ; - ASSERT (Ap_old != NULL) ; - ASSERT (Ah_old != NULL) ; - ASSERT (nvec_old >= 0) ; - (*p_Ap) = NULL ; (*p_Ap_size) = 0 ; - (*p_Ah) = NULL ; (*p_Ah_size) = 0 ; - (*p_nvec) = -1 ; + ASSERT (A != NULL) ; + ASSERT (GB_ZOMBIES_OK (A)) ; // pattern not accessed + ASSERT (GB_JUMBLED_OK (A)) ; + ASSERT_MATRIX_OK (A, "A before hyper_prune", GB0) ; - int64_t *restrict W = NULL ; size_t W_size = 0 ; - int64_t *restrict Ap = NULL ; size_t Ap_size = 0 ; - int64_t *restrict Ah = NULL ; size_t Ah_size = 0 ; + if (!GB_IS_HYPERSPARSE (A)) + { + // nothing to do + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // count # of empty vectors and check if pruning is needed + //-------------------------------------------------------------------------- + + // A->nvec_nonempty is needed to prune the hyperlist + int64_t nvec_nonempty = GB_nvec_nonempty_update (A) ; + if (nvec_nonempty == A->nvec) + { + // nothing to prune + return (GrB_SUCCESS) ; + } + #ifdef GB_DEBUG + int64_t nvec_save = nvec_nonempty ; + #endif + + //-------------------------------------------------------------------------- + // prune empty vectors + //-------------------------------------------------------------------------- + + GB_Ap_DECLARE (Ap_old, const) ; GB_Ap_PTR (Ap_old, A) ; + GB_Ah_DECLARE (Ah_old, const) ; GB_Ah_PTR (Ah_old, A) ; + + GB_Ap_DECLARE (Ap_new, ) ; size_t Ap_new_size = 0 ; + GB_Ah_DECLARE (Ah_new, ) ; size_t Ah_new_size = 0 ; + + GB_MDECL (W, , u) ; size_t W_size = 0 ; + + int64_t nvec_old = A->nvec ; + + size_t psize = (A->p_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = (A->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; //-------------------------------------------------------------------------- // determine the # of threads to use @@ -59,15 +82,16 @@ GrB_Info GB_hyper_prune // allocate workspace //-------------------------------------------------------------------------- - W = GB_MALLOC_WORK (nvec_old+1, int64_t, &W_size) ; + W = GB_MALLOC_MEMORY (nvec_old+1, jsize, &W_size) ; if (W == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (W, A->j_is_32) ; //-------------------------------------------------------------------------- - // count the # of nonempty vectors + // count the # of nonempty vectors and mark their locations in W //-------------------------------------------------------------------------- int64_t k ; @@ -75,54 +99,77 @@ GrB_Info GB_hyper_prune for (k = 0 ; k < nvec_old ; k++) { // W [k] = 1 if the kth vector is nonempty; 0 if empty - W [k] = (Ap_old [k] < Ap_old [k+1]) ; + int nonempty = (GB_IGET (Ap_old, k) < GB_IGET (Ap_old, k+1)) ; + // W [k] = nonempty ; + GB_ISET (W, k, nonempty) ; } - int64_t nvec ; - GB_cumsum (W, nvec_old, &nvec, nthreads, Werk) ; + int64_t nvec_new ; + GB_cumsum (W, A->j_is_32, nvec_old, &nvec_new, nthreads, Werk) ; //-------------------------------------------------------------------------- // allocate the result //-------------------------------------------------------------------------- - int64_t plen = GB_IMAX (1, nvec) ; - Ap = GB_MALLOC (plen+1, int64_t, &Ap_size) ; - Ah = GB_MALLOC (plen , int64_t, &Ah_size) ; - if (Ap == NULL || Ah == NULL) + int64_t plen_new = GB_IMAX (1, nvec_new) ; + Ap_new = GB_MALLOC_MEMORY (plen_new+1, psize, &Ap_new_size) ; + Ah_new = GB_MALLOC_MEMORY (plen_new , jsize, &Ah_new_size) ; + if (Ap_new == NULL || Ah_new == NULL) { // out of memory - GB_FREE_WORK (&W, W_size) ; - GB_FREE (&Ap, Ap_size) ; - GB_FREE (&Ah, Ah_size) ; + GB_FREE_MEMORY (&W, W_size) ; + GB_FREE_MEMORY (&Ap_new, Ap_new_size) ; + GB_FREE_MEMORY (&Ah_new, Ah_new_size) ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Ap_new, A->p_is_32) ; + GB_IPTR (Ah_new, A->j_is_32) ; //-------------------------------------------------------------------------- - // create the Ap and Ah result + // create the Ap_new and Ah_new result //-------------------------------------------------------------------------- #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < nvec_old ; k++) { - if (Ap_old [k] < Ap_old [k+1]) + uint64_t p = GB_IGET (Ap_old, k) ; + if (p < GB_IGET (Ap_old, k+1)) { - int64_t knew = W [k] ; - Ap [knew] = Ap_old [k] ; - Ah [knew] = Ah_old [k] ; + uint64_t j = GB_IGET (Ah_old, k) ; + uint64_t knew = GB_IGET (W, k) ; + // Ap_new [knew] = p ; + GB_ISET (Ap_new, knew, p) ; + // Ah_new [knew] = j ; + GB_ISET (Ah_new, knew, j) ; } } - Ap [nvec] = Ap_old [nvec_old] ; + // Ap_new [nvec_new] = Ap_old [nvec_old] ; + uint64_t nvals = A->nvals ; + ASSERT (nvals == GB_IGET (Ap_old, nvec_old)) ; + GB_ISET (Ap_new, nvec_new, nvals) ; //-------------------------------------------------------------------------- - // free workspace and return result + // free workspace and old matrix components, including the A->Y hyper_hash //-------------------------------------------------------------------------- - GB_FREE_WORK (&W, W_size) ; - (*p_Ap) = Ap ; (*p_Ap_size) = Ap_size ; - (*p_Ah) = Ah ; (*p_Ah_size) = Ah_size ; - (*p_nvec) = nvec ; - (*p_plen) = plen ; + GB_FREE_MEMORY (&W, W_size) ; + GB_phy_free (A) ; + + //-------------------------------------------------------------------------- + // transplant the new hyperlist into A + //-------------------------------------------------------------------------- + + A->p = Ap_new ; A->p_size = Ap_new_size ; + A->h = Ah_new ; A->h_size = Ah_new_size ; + A->nvec = nvec_new ; + A->plen = plen_new ; + ASSERT (nvec_new == nvec_save) ; + GB_nvec_nonempty_set (A, nvec_new) ; + A->nvals = nvals ; + A->magic = GB_MAGIC ; + + ASSERT_MATRIX_OK (A, "A after hyper_prune", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/hyper/GB_hyper_realloc.c b/GraphBLAS/Source/hyper/GB_hyper_realloc.c index 78ac0320d5..c1edac7fb7 100644 --- a/GraphBLAS/Source/hyper/GB_hyper_realloc.c +++ b/GraphBLAS/Source/hyper/GB_hyper_realloc.c @@ -2,7 +2,7 @@ // GB_hyper_realloc: reallocate a matrix hyperlist //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,9 +10,9 @@ // Change the size of the A->h and A->p hyperlist. // No change is made if A is not hypersparse. // No change is made to A->Y. +// A->p_is_32, A->j_is_32, and A->i_is_32 are unchanged. #include "GB.h" -#include "include/GB_unused.h" GrB_Info GB_hyper_realloc ( @@ -40,14 +40,17 @@ GrB_Info GB_hyper_realloc ASSERT (!A->p_shallow) ; ASSERT (!A->h_shallow) ; - // old size of A->p and A->h - int64_t plen_old = A->plen ; - plen_new = GB_IMAX (1, plen_new) ; + #ifdef GB_DEBUG + int64_t plen_old = A->plen ; // old size of A->p and A->h + #endif + plen_new = GB_IMAX (1, plen_new) ; // new size of A->p and A->h + size_t psize = (A->p_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = (A->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; // change the size of A->h and A->p bool ok1 = true, ok2 = true ; - GB_REALLOC (A->p, plen_new+1, int64_t, &(A->p_size), &ok1) ; - GB_REALLOC (A->h, plen_new, int64_t, &(A->h_size), &ok2) ; + GB_REALLOC_MEMORY (A->p, plen_new+1, psize, &(A->p_size), &ok1) ; + GB_REALLOC_MEMORY (A->h, plen_new , jsize, &(A->h_size), &ok2) ; bool ok = ok1 && ok2 ; // always succeeds if the space shrinks diff --git a/GraphBLAS/Source/hyper/GB_hyper_shallow.c b/GraphBLAS/Source/hyper/GB_hyper_shallow.c index e413a9f528..30a3b64edd 100644 --- a/GraphBLAS/Source/hyper/GB_hyper_shallow.c +++ b/GraphBLAS/Source/hyper/GB_hyper_shallow.c @@ -2,15 +2,14 @@ // GB_hyper_shallow: create a sparse shallow version of a hypersparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // On input C must exist but the content of the C header is uninitialized -// except for C->static_header and C->header_size. No memory is allocated to -// construct C as the hyper_shallow version of A. C is purely shallow. If A -// is iso then so is C. +// except for C->header_size. No memory is allocated to construct C as the +// hyper_shallow version of A. C is purely shallow. If A is iso then so is C. #include "GB.h" #include "convert/GB_convert.h" @@ -27,7 +26,7 @@ GrB_Matrix GB_hyper_shallow // return C //-------------------------------------------------------------------------- ASSERT_MATRIX_OK (A, "hyper_shallow input", GB0) ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT (GB_IS_HYPERSPARSE (A)) ; //-------------------------------------------------------------------------- @@ -35,14 +34,12 @@ GrB_Matrix GB_hyper_shallow // return C //-------------------------------------------------------------------------- // save the C header status - bool C_static_header = C->static_header ; bool C_header_size = C->header_size ; // copy the header memcpy (C, A, sizeof (struct GB_Matrix_opaque)) ; // restore the C header status - C->static_header = C_static_header ; C->header_size = C_header_size ; // remove the user_name @@ -64,7 +61,8 @@ GrB_Matrix GB_hyper_shallow // return C // C reduces in dimension to the # of vectors in A C->vdim = C->nvec ; C->plen = C->nvec ; - C->nvec_nonempty = C->nvec ; +// C->nvec_nonempty = C->nvec ; + GB_nvec_nonempty_set (C, C->nvec) ; //-------------------------------------------------------------------------- // return result diff --git a/GraphBLAS/Source/hyper/GB_hypermatrix_prune.c b/GraphBLAS/Source/hyper/GB_hypermatrix_prune.c deleted file mode 100644 index 60345501ea..0000000000 --- a/GraphBLAS/Source/hyper/GB_hypermatrix_prune.c +++ /dev/null @@ -1,88 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_hypermatrix_prune: prune empty vectors from a hypersparse matrix -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// On input, A->p and A->h may be shallow. If modified, new arrays A->p and -// A->h are created, which are not shallow. If these arrays are not modified, -// and are shallow on input, then they remain shallow on output. - -#include "GB.h" - -GrB_Info GB_hypermatrix_prune -( - GrB_Matrix A, // matrix to prune - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - ASSERT (A != NULL) ; - ASSERT (GB_ZOMBIES_OK (A)) ; // pattern not accessed - ASSERT (GB_JUMBLED_OK (A)) ; - ASSERT_MATRIX_OK (A, "A before hypermatrix_prune", GB0) ; - - if (!GB_IS_HYPERSPARSE (A)) - { - // nothing to do - return (GrB_SUCCESS) ; - } - - //-------------------------------------------------------------------------- - // count # of empty vectors - //-------------------------------------------------------------------------- - - if (A->nvec_nonempty < 0) - { - // A->nvec_nonempty is needed to prune the hyperlist - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } - - //-------------------------------------------------------------------------- - // prune empty vectors - //-------------------------------------------------------------------------- - - if (A->nvec_nonempty < A->nvec) // A->nvec_nonempty used here - { - // create new Ap_new and Ah_new arrays, with no empty vectors - int64_t *restrict Ap_new = NULL ; size_t Ap_new_size = 0 ; - int64_t *restrict Ah_new = NULL ; size_t Ah_new_size = 0 ; - int64_t nvec_new, plen_new ; - int64_t anz = A->nvals ; - ASSERT (anz == A->p [A->nvec]) ; - GrB_Info info = GB_hyper_prune (&Ap_new, &Ap_new_size, - &Ah_new, &Ah_new_size, &nvec_new, &plen_new, - A->p, A->h, A->nvec, Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory - return (info) ; - } - // free the old A->p, A->h, and A->Y - GB_phy_free (A) ; - // A->p, A->h, A->Y are now NULL and thus not shallow - ASSERT (!A->p_shallow) ; - ASSERT (!A->h_shallow) ; - ASSERT (!A->Y_shallow) ; - // transplant the new hyperlist into A - A->p = Ap_new ; A->p_size = Ap_new_size ; - A->h = Ah_new ; A->h_size = Ah_new_size ; - A->nvec = nvec_new ; - A->plen = plen_new ; - A->nvec_nonempty = nvec_new ; - A->nvals = anz ; - ASSERT (anz == A->p [A->nvec]) ; - A->magic = GB_MAGIC ; - } - - ASSERT_MATRIX_OK (A, "A after hypermatrix_prune", GB0) ; - return (GrB_SUCCESS) ; -} - diff --git a/GraphBLAS/Source/hyper/GB_nvec_nonempty.c b/GraphBLAS/Source/hyper/GB_nvec_nonempty.c index 6f1d4a2b0e..7faebb2513 100644 --- a/GraphBLAS/Source/hyper/GB_nvec_nonempty.c +++ b/GraphBLAS/Source/hyper/GB_nvec_nonempty.c @@ -2,7 +2,7 @@ // GB_nvec_nonempty: count the number of non-empty vectors //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -57,14 +57,27 @@ int64_t GB_nvec_nonempty // return # of non-empty vectors //-------------------------------------------------------------------------- int64_t nvec_nonempty = 0 ; - const int64_t *restrict Ap = A->p ; - int64_t k ; - #pragma omp parallel for num_threads(nthreads) schedule(static) \ - reduction(+:nvec_nonempty) - for (k = 0 ; k < anvec ; k++) - { - if (Ap [k] < Ap [k+1]) nvec_nonempty++ ; + + if (A->p_is_32) + { + const uint32_t *restrict Ap = A->p ; + #pragma omp parallel for num_threads(nthreads) schedule(static) \ + reduction(+:nvec_nonempty) + for (k = 0 ; k < anvec ; k++) + { + if (Ap [k] < Ap [k+1]) nvec_nonempty++ ; + } + } + else + { + const uint64_t *restrict Ap = A->p ; + #pragma omp parallel for num_threads(nthreads) schedule(static) \ + reduction(+:nvec_nonempty) + for (k = 0 ; k < anvec ; k++) + { + if (Ap [k] < Ap [k+1]) nvec_nonempty++ ; + } } ASSERT (nvec_nonempty >= 0 && nvec_nonempty <= A->vdim) ; diff --git a/GraphBLAS/Source/hyper/factory/GB_lookup_debug.h b/GraphBLAS/Source/hyper/factory/GB_lookup_debug.h new file mode 100644 index 0000000000..9cbff8eb7a --- /dev/null +++ b/GraphBLAS/Source/hyper/factory/GB_lookup_debug.h @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// GB_lookup_debug: find k where j == Ah [k], without using the A->Y hyper_hash +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_LOOKUP_DEBUG_H +#define GB_LOOKUP_DEBUG_H + +// For a sparse, bitmap, or full matrix j == k. +// For a hypersparse matrix, find k so that j == Ah [k], if it +// appears in the list. + +// k is not needed by the caller, just pstart, pend, pleft, and found. + +// Once k is found, find pstart and pend, the start and end of the vector. +// pstart and pend are defined for all sparsity structures: hypersparse, +// sparse, bitmap, or full. + +// With the introduction of the hyper_hash, this is used only for debugging. + +#ifdef GB_DEBUG + +#define GB_PTYPE uint32_t +#define GB_JTYPE uint32_t +#define GB_lookup_debug_T GB_lookup_debug_32_32 +#define GB_binary_search_T GB_binary_search_32 +#include "hyper/factory/GB_lookup_debug_template.h" + +#define GB_PTYPE uint32_t +#define GB_JTYPE uint64_t +#define GB_lookup_debug_T GB_lookup_debug_32_64 +#define GB_binary_search_T GB_binary_search_64 +#include "hyper/factory/GB_lookup_debug_template.h" + +#define GB_PTYPE uint64_t +#define GB_JTYPE uint32_t +#define GB_lookup_debug_T GB_lookup_debug_64_32 +#define GB_binary_search_T GB_binary_search_32 +#include "hyper/factory/GB_lookup_debug_template.h" + +#define GB_PTYPE uint64_t +#define GB_JTYPE uint64_t +#define GB_lookup_debug_T GB_lookup_debug_64_64 +#define GB_binary_search_T GB_binary_search_64 +#include "hyper/factory/GB_lookup_debug_template.h" + +static inline bool GB_lookup_debug // find j = Ah [k] +( + // input: + const bool Ap_is_32, // if true, Ap is 32-bit; else 64-bit + const bool Aj_is_32, // if true, Ah, Y->[pix] are 32-bit; else 64 + const bool A_is_hyper, // true if A is hypersparse + const void *Ah, // A->h [0..A->nvec-1]: list of vectors + const void *Ap, // A->p [0..A->nvec ]: pointers to vectors + const int64_t avlen, // A->vlen + // input/output: + int64_t *restrict pleft, // on input: look in A->h [pleft..pright]. + // on output: pleft == k if found. + // input: + int64_t pright, // normally A->nvec-1, but can be trimmed + const int64_t j, // vector to find, as j = Ah [k] + // output: + int64_t *restrict pstart, // start of vector: Ap [k] + int64_t *restrict pend // end of vector: Ap [k+1] +) +{ + if (Ap_is_32) + { + if (Aj_is_32) + { + // Ap is 32-bit; Ah is 32 bit + return (GB_lookup_debug_32_32 (A_is_hyper, Ah, Ap, avlen, + pleft, pright, j, pstart, pend)) ; + } + else + { + // Ap is 32-bit; Ah is 64-bit + return (GB_lookup_debug_32_64 (A_is_hyper, Ah, Ap, avlen, + pleft, pright, j, pstart, pend)) ; + } + } + else + { + if (Aj_is_32) + { + // Ap is 64-bit; Ah is 32-bit + return (GB_lookup_debug_64_32 (A_is_hyper, Ah, Ap, avlen, + pleft, pright, j, pstart, pend)) ; + } + else + { + // Ap is 64-bit; Ah is 64-bit + return (GB_lookup_debug_64_64 (A_is_hyper, Ah, Ap, avlen, + pleft, pright, j, pstart, pend)) ; + } + } +} + +#endif +#endif + diff --git a/GraphBLAS/Source/hyper/factory/GB_lookup_debug_template.h b/GraphBLAS/Source/hyper/factory/GB_lookup_debug_template.h new file mode 100644 index 0000000000..7ee7695c58 --- /dev/null +++ b/GraphBLAS/Source/hyper/factory/GB_lookup_debug_template.h @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// GB_lookup_debug_template: find k where j == Ah [k], no hyper_hash +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// For debugging only. + +static inline bool GB_lookup_debug_T // find j = Ah [k] +( + // input: + const bool A_is_hyper, // true if A is hypersparse + const GB_JTYPE *restrict Ah, // A->h [0..A->nvec-1]: list of vectors + const GB_PTYPE *restrict Ap, // A->p [0..A->nvec ]: pointers to vectors + const int64_t avlen, // A->vlen + // input/output: + int64_t *restrict pleft, // on input: look in A->h [pleft..pright]. + // on output: pleft == k if found. + // input: + int64_t pright_in, // normally A->nvec-1, but can be trimmed + const int64_t j, // vector to find, as j = Ah [k] + // output: + int64_t *restrict pstart, // start of vector: Ap [k] + int64_t *restrict pend // end of vector: Ap [k+1] +) +{ + if (A_is_hyper) + { + // binary search of Ah [pleft...pright] for the value j + bool found ; + int64_t pright = pright_in ; + found = GB_binary_search_T (j, Ah, pleft, &pright) ; + if (found) + { + // j appears in the hyperlist at Ah [pleft] + // k = (*pleft) + (*pstart) = Ap [(*pleft)] ; // OK + (*pend) = Ap [(*pleft)+1] ; // OK + } + else + { + // j does not appear in the hyperlist Ah + // k = -1 + (*pstart) = -1 ; + (*pend) = -1 ; + } + return (found) ; + } + else + { + // A is sparse, bitmap, or full; j always appears + // k = j + #define GBP(Ap,k,avlen) ((Ap) ? Ap [k] : ((k) * (avlen))) + (*pstart) = GBP (Ap, j, avlen) ; + (*pend) = GBP (Ap, j+1, avlen) ; + #undef GBP + return (true) ; + } +} + +#undef GB_PTYPE +#undef GB_JTYPE +#undef GB_lookup_debug_T +#undef GB_binary_search_T + diff --git a/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup.h b/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup.h index 0a1b5fc173..d36818f9cc 100644 --- a/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup.h +++ b/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup.h @@ -2,7 +2,7 @@ // GB_hyper_hash_lookup: find k so that j == Ah [k], using the A->Y hyper_hash //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,122 +10,82 @@ #ifndef GB_HYPER_HASH_LOOKUP_H #define GB_HYPER_HASH_LOOKUP_H -// Let j = Ah [k] -// k = A->Y (j, hash(j)), if present, or k=-1 if not found. - -GB_STATIC_INLINE int64_t GB_hyper_hash_lookup // k if j==Ah[k]; -1 if not found +#define GB_PTYPE uint32_t +#define GB_JTYPE uint32_t +#define GB_hyper_hash_lookup_T GB_hyper_hash_lookup_32_32 +#define GB_binary_search_T GB_binary_search_32 +#include "include/GB_hyper_hash_lookup_template.h" + +#define GB_PTYPE uint32_t +#define GB_JTYPE uint64_t +#define GB_hyper_hash_lookup_T GB_hyper_hash_lookup_32_64 +#define GB_binary_search_T GB_binary_search_64 +#include "include/GB_hyper_hash_lookup_template.h" + +#define GB_PTYPE uint64_t +#define GB_JTYPE uint32_t +#define GB_hyper_hash_lookup_T GB_hyper_hash_lookup_64_32 +#define GB_binary_search_T GB_binary_search_32 +#include "include/GB_hyper_hash_lookup_template.h" + +#define GB_PTYPE uint64_t +#define GB_JTYPE uint64_t +#define GB_hyper_hash_lookup_T GB_hyper_hash_lookup_64_64 +#define GB_binary_search_T GB_binary_search_64 +#include "include/GB_hyper_hash_lookup_template.h" + +GB_STATIC_INLINE int64_t GB_hyper_hash_lookup // k if j==Ah[k]; -1 if not found ( - // new inputs, not modified - const int64_t *restrict Ah, // A->h [0..A->nvec-1]: list of vectors + // inputs, not modified: + const bool Ap_is_32, // if true, Ap is 32-bit; else 64-bit + const bool Aj_is_32, // if true, Ah, Y->[pix] are 32-bit; else 64 + const void *Ah, // A->h [0..A->nvec-1]: list of vectors const int64_t anvec, - // input, not modified - const int64_t *restrict Ap, // A->p [0..A->nvec]: pointers to vectors - const int64_t *restrict Yp, // A->Y->p - const int64_t *restrict Yi, // A->Y->i - const int64_t *restrict Yx, // A->Y->x - const int64_t hash_bits, // A->Y->vdim-1, which is hash table size-1 + const void *Ap, // A->p [0..A->nvec]: pointers to vectors + const void *A_Yp, // A->Y->p + const void *A_Yi, // A->Y->i + const void *A_Yx, // A->Y->x + const uint64_t hash_bits, // A->Y->vdim-1, which is hash table size-1 const int64_t j, // find j in Ah [0..anvec-1], using A->Y -// const bool no_hyper_hash, // A->no_hyper_hash - // output + // outputs: int64_t *restrict pstart, // start of vector: Ap [k] int64_t *restrict pend // end of vector: Ap [k+1] ) { - - bool found = false ; - int64_t k ; - - if (Yp == NULL) - { - - //---------------------------------------------------------------------- - // no hyper_hash constructed - //---------------------------------------------------------------------- - -// if (no_hyper_hash) - { - // the hyper_hash is disabled. Quick lookup for j == Ah [j]. - if (j < anvec && Ah [j] == j) - { - // found j == Ah [j], so return k = j - k = j ; - found = true ; - } + if (Ap_is_32) + { + if (Aj_is_32) + { + // Ap is 32-bit; Ah, A_Y[pix] are 32-bit + return (GB_hyper_hash_lookup_32_32 ((uint32_t *) Ah, anvec, + (uint32_t *) Ap, (uint32_t *) A_Yp, (uint32_t *) A_Yi, + (uint32_t *) A_Yx, hash_bits, j, pstart, pend)) ; } - - // binary search of Ah [0...A->nvec-1] for the value j - if (!found) - { - k = 0 ; - int64_t pright = anvec - 1 ; - GB_BINARY_SEARCH (j, Ah, k, pright, found) ; + else + { + // Ap is 32-bit; Ah, A_Y[pix] are 64-bit + return (GB_hyper_hash_lookup_32_64 ((uint64_t *) Ah, anvec, + (uint32_t *) Ap, (uint64_t *) A_Yp, (uint64_t *) A_Yi, + (uint64_t *) A_Yx, hash_bits, j, pstart, pend)) ; } - } else { - - //---------------------------------------------------------------------- - // using the hyper_hash - //---------------------------------------------------------------------- - - // determine the hash bucket that would contain vector j - const int64_t jhash = GB_HASHF2 (j, hash_bits) ; - - //---------------------------------------------------------------------- - // search for j in the jhash bucket: Yi [Yp [jhash] ... Yp [jhash+1]-1] - //---------------------------------------------------------------------- - - const int64_t ypstart = Yp [jhash] ; - const int64_t ypend = Yp [jhash+1] ; - k = -1 ; - if ((ypend - ypstart) > 256) - { - // The hash bucket jhash has over 256 entries, which is a very high - // number of collisions. The load factor of the hash table ranges - // from 2 to 4. Do a binary search as a fallback. - int64_t p = ypstart ; - int64_t pright = ypend - 1 ; - GB_BINARY_SEARCH (j, Yi, p, pright, found) ; - if (found) - { - k = Yx [p] ; - } + if (Aj_is_32) + { + // Ap is 64-bit; Ah, A_Y[pix] are 32-bit + return (GB_hyper_hash_lookup_64_32 ((uint32_t *) Ah, anvec, + (uint64_t *) Ap, (uint32_t *) A_Yp, (uint32_t *) A_Yi, + (uint32_t *) A_Yx, hash_bits, j, pstart, pend)) ; } else - { - // Linear-time search for j in the jhash bucket. - for (int64_t p = ypstart ; p < ypend ; p++) - { - if (j == Yi [p]) - { - // found: j = Ah [k] where k is given by k = Yx [p] - k = Yx [p] ; - break ; - } - } - found = (k >= 0) ; + { + // Ap is 64-bit; Ah, A_Y[pix] are 64-bit + return (GB_hyper_hash_lookup_64_64 ((uint64_t *) Ah, anvec, + (uint64_t *) Ap, (uint64_t *) A_Yp, (uint64_t *) A_Yi, + (uint64_t *) A_Yx, hash_bits, j, pstart, pend)) ; } } - - //-------------------------------------------------------------------------- - // if found, return the start and end of A(:,j) - //-------------------------------------------------------------------------- - - if (found) - { - // found: j == Ah [k], get the vector A(:,j) - (*pstart) = Ap [k] ; - (*pend ) = Ap [k+1] ; - } - else - { - // not found: j is not in the hyperlist Ah [0..anvec-1] - k = -1 ; - (*pstart) = -1 ; - (*pend ) = -1 ; - } - return (k) ; } #endif diff --git a/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup_template.h b/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup_template.h new file mode 100644 index 0000000000..4ef5e17a3b --- /dev/null +++ b/GraphBLAS/Source/hyper/include/GB_hyper_hash_lookup_template.h @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// GB_hyper_hash_lookup_template: find k so that j == Ah [k], using hyper_hash +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Let j = Ah [k] +// k = A->Y (j, hash(j)), if present, or k=-1 if not found. + +GB_STATIC_INLINE int64_t GB_hyper_hash_lookup_T // k if j==Ah[k]; -1 not found +( + // inputs, not modified: + const GB_JTYPE *restrict Ah, // A->h [0..A->nvec-1]: list of vectors + const int64_t anvec, + const GB_PTYPE *restrict Ap, // A->p [0..A->nvec]: pointers to vectors + const GB_JTYPE *restrict A_Yp, // A->Y->p + const GB_JTYPE *restrict A_Yi, // A->Y->i + const GB_JTYPE *restrict A_Yx, // A->Y->x + const uint64_t hash_bits, // A->Y->vdim-1, which is hash table size-1 + const int64_t j, // find j in Ah [0..anvec-1], using A->Y + // outputs: + int64_t *restrict pstart, // start of vector: Ap [k] + int64_t *restrict pend // end of vector: Ap [k+1] +) +{ + + bool found = false ; + int64_t k ; + + if (A_Yp == NULL) + { + + //---------------------------------------------------------------------- + // no hyper_hash constructed + //---------------------------------------------------------------------- + + // the hyper_hash is disabled. Quick lookup for j == Ah [j]. + if (j < anvec && Ah [j] == j) + { + // found j == Ah [j], so return k = j + k = j ; + found = true ; + } + + // binary search of Ah [0...A->nvec-1] for the value j + if (!found) + { + k = 0 ; + int64_t pright = anvec - 1 ; + found = GB_binary_search_T (j, Ah, &k, &pright) ; + } + + } + else + { + + //---------------------------------------------------------------------- + // using the hyper_hash + //---------------------------------------------------------------------- + + // determine the hash bucket that would contain vector j + const int64_t jhash = GB_HASHF2 (j, hash_bits) ; + + //---------------------------------------------------------------------- + // search for j in jhash bucket: A_Yi [A_Yp [jhash] : A_Yp [jhash+1]-1] + //---------------------------------------------------------------------- + + const int64_t ypstart = A_Yp [jhash] ; + const int64_t ypend = A_Yp [jhash+1] ; + k = -1 ; + if ((ypend - ypstart) > 256) + { + // The hash bucket jhash has over 256 entries, which is a very high + // number of collisions. The load factor of the hash table ranges + // from 2 to 4. Do a binary search as a fallback. + int64_t p = ypstart ; + int64_t pright = ypend - 1 ; + found = GB_binary_search_T (j, A_Yi, &p, &pright) ; + if (found) + { + k = A_Yx [p] ; + } + } + else + { + // Linear-time search for j in the jhash bucket. + for (int64_t p = ypstart ; p < ypend ; p++) + { + if (j == A_Yi [p]) + { + // found: j = Ah [k] where k is given by k = A_Yx [p] + k = A_Yx [p] ; + break ; + } + } + found = (k >= 0) ; + } + } + + //-------------------------------------------------------------------------- + // if found, return the start and end of A(:,j) + //-------------------------------------------------------------------------- + + if (found) + { + // found: j == Ah [k], get the vector A(:,j) + (*pstart) = Ap [k] ; + (*pend ) = Ap [k+1] ; + } + else + { + // not found: j is not in the hyperlist Ah [0..anvec-1] + k = -1 ; + (*pstart) = -1 ; + (*pend ) = -1 ; + } + return (k) ; +} + +#undef GB_PTYPE +#undef GB_JTYPE +#undef GB_hyper_hash_lookup_T +#undef GB_binary_search_T diff --git a/GraphBLAS/Source/ij/GB_ij.h b/GraphBLAS/Source/ij/GB_ij.h index a258867140..715d0ccf31 100644 --- a/GraphBLAS/Source/ij/GB_ij.h +++ b/GraphBLAS/Source/ij/GB_ij.h @@ -2,7 +2,7 @@ // GB_ij.h: definitions for I and J index lists //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,8 @@ void GB_ijlength // get the length and kind of an index list I ( - const GrB_Index *I, // list of indices (actual or implicit) + const void *I, // list of indices (actual or implicit) + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length I, or special const int64_t limit, // indices must be in the range 0 to limit-1 int64_t *nI, // actual length of I @@ -25,7 +26,8 @@ void GB_ijlength // get the length and kind of an index list I GrB_Info GB_ijproperties // check I and determine its properties ( // input: - const GrB_Index *I, // list of indices, or special + const void *I, // list of indices, or special + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length I, or special const int64_t nI, // actual length from GB_ijlength const int64_t limit, // I must be in the range 0 to limit-1 @@ -44,19 +46,58 @@ GrB_Info GB_ijproperties // check I and determine its properties GrB_Info GB_ijsort ( - const GrB_Index *restrict I, // size ni, where ni > 1 always holds - int64_t *restrict p_ni, // : size of I, output: # of indices in I2 - GrB_Index *restrict *p_I2, // size ni2, where I2 [0..ni2-1] - // contains the sorted indices with duplicates removed. + // input: + const void *I, // size ni, where ni > 1 always holds + const bool I_is_32, + const int64_t ni, // length I + const int64_t imax, // maximum value in I + // output: + int64_t *p_ni2, // # of indices in I2 + void **p_I2, // size ni2, where I2 [0..ni2-1] contains the + // sorted indices with duplicates removed. + bool *I2_is_32_handle, // if I2_is_32 true, I2 is 32 bits; else 64 bits size_t *I2_size_handle, - GrB_Index *restrict *p_I2k, // output array of size ni2 - size_t *I2k_size_handle + void **p_I2k, // output array of size ni2 + bool *I2k_is_32_handle, // if I2k_is_32 true, I2 is 32 bits; else 64 + size_t *I2k_size_handle, + GB_Werk Werk +) ; + +GrB_Info GB_ijxvector +( + // input: + GrB_Vector List, // defines the list of integers, either from + // List->x or List-i. If List is NULL, it defines + // I = GrB_ALL. + bool need_copy, // if true, I must be allocated + int which, // 0: I list, 1: J list, 2: X list + const GrB_Descriptor desc, // row_list, col_list, val_list descriptors + bool is_build, // if true, method is GrB_build; otherwise, it is + // assign, subassign, or extract + // output: + void **I_handle, // the list I; may be GrB_ALL + int64_t *ni_handle, // the length of I, or special (GxB_RANGE) + size_t *I_size_handle, // if > 0, I has been allocated by this + // method. Otherwise, it is a shallow pointer into + // List->x or List->i. + GrB_Type *I_type_handle, // the type of I: GrB_UINT32 or GrB_UINT64 for + // assign, subassign, extract, or for build with + // the descriptor uses the indices. For build, + // this is List->type when using the values. + GB_Werk Werk ) ; -// given i and I, return true there is a k so that i is the kth item in I +//------------------------------------------------------------------------------ +// GB_ij_is_in_list: determine if i is in list I +//------------------------------------------------------------------------------ + +// Given i and I, return true if there is a k so that i is the kth item in I. +// The value of k is not returned. + static inline bool GB_ij_is_in_list // determine if i is in the list I ( - const GrB_Index *I, // list of indices for GB_LIST + const void *I, // list of indices for GB_LIST + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t nI, // length of I if Ikind is GB_LIST int64_t i, // find i = I [k] in the list const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST @@ -132,8 +173,8 @@ static inline bool GB_ij_is_in_list // determine if i is in the list I int64_t pleft = 0 ; int64_t pright = nI-1 ; if (i < 0) return (false) ; - GrB_Index ui = (GrB_Index) i ; - GB_BINARY_SEARCH (ui, I, pleft, pright, found) ; + uint64_t ui = (uint64_t) i ; + found = GB_binary_search (ui, I, I_is_32, &pleft, &pright) ; return (found) ; } } diff --git a/GraphBLAS/Source/ij/GB_ijlength.c b/GraphBLAS/Source/ij/GB_ijlength.c index b56ad01b4a..b4f9b00590 100644 --- a/GraphBLAS/Source/ij/GB_ijlength.c +++ b/GraphBLAS/Source/ij/GB_ijlength.c @@ -2,7 +2,7 @@ // GB_ijlength: get the length and kind of an index list I //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,8 @@ void GB_ijlength // get the length and kind of an index list I ( - const GrB_Index *I, // list of indices (actual or implicit) + const void *I, // list of indices (actual or implicit) + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length I, or special const int64_t limit, // indices must be in the range 0 to limit-1 int64_t *nI, // actual length of I @@ -34,6 +35,8 @@ void GB_ijlength // get the length and kind of an index list I ASSERT (limit >= 0) ; ASSERT (limit <= GB_NMAX) ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + //-------------------------------------------------------------------------- // determine the length of I //-------------------------------------------------------------------------- @@ -65,8 +68,10 @@ void GB_ijlength // get the length and kind of an index list I // the array I must have size at least 2 - int64_t ibegin = GB_LIMIT (I [GxB_BEGIN]) ; - int64_t iend = GB_LIMIT (I [GxB_END ]) ; + int64_t ibegin = GB_IGET (I, GxB_BEGIN) ; + int64_t iend = GB_IGET (I, GxB_END ) ; + ibegin = GB_LIMIT (ibegin) ; + iend = GB_LIMIT (iend) ; ASSERT (ibegin >= 0) ; @@ -104,9 +109,12 @@ void GB_ijlength // get the length and kind of an index list I // The array I must have size at least 3. It is an unsigned uint64_t // array, so integers must be positive. - int64_t ibegin = GB_LIMIT (I [GxB_BEGIN]) ; - int64_t iinc = GB_LIMIT (I [GxB_INC ]) ; - int64_t iend = GB_LIMIT (I [GxB_END ]) ; + int64_t ibegin = GB_IGET (I, GxB_BEGIN) ; + int64_t iinc = GB_IGET (I, GxB_INC ) ; + int64_t iend = GB_IGET (I, GxB_END ) ; + ibegin = GB_LIMIT (ibegin) ; + iinc = GB_LIMIT (iinc ) ; + iend = GB_LIMIT (iend ) ; ASSERT (ibegin >= 0) ; ASSERT (iinc >= 0) ; @@ -162,9 +170,12 @@ void GB_ijlength // get the length and kind of an index list I // The array I must have size at least 3. It is an unsigned uint64_t // array, so integers must be positive. - int64_t ibegin = GB_LIMIT (I [GxB_BEGIN]) ; - int64_t iinc = GB_LIMIT (I [GxB_INC ]) ; - int64_t iend = GB_LIMIT (I [GxB_END ]) ; + int64_t ibegin = GB_IGET (I, GxB_BEGIN) ; + int64_t iinc = GB_IGET (I, GxB_INC ) ; + int64_t iend = GB_IGET (I, GxB_END ) ; + ibegin = GB_LIMIT (ibegin) ; + iinc = GB_LIMIT (iinc ) ; + iend = GB_LIMIT (iend ) ; ASSERT (iinc >= 0) ; diff --git a/GraphBLAS/Source/ij/GB_ijproperties.c b/GraphBLAS/Source/ij/GB_ijproperties.c index 9153257109..d1bf0ce020 100644 --- a/GraphBLAS/Source/ij/GB_ijproperties.c +++ b/GraphBLAS/Source/ij/GB_ijproperties.c @@ -2,7 +2,7 @@ // GB_ijproperties: check I and determine its properties //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,6 @@ #include "ij/GB_ij.h" -// FUTURE:: if limit=0, print a different message. see also setEl, extractEl. #define GB_ICHECK(i,limit) \ { \ if ((i) < 0 || (i) >= (limit)) \ @@ -24,7 +23,8 @@ GrB_Info GB_ijproperties // check I and determine its properties ( // input: - const GrB_Index *I, // list of indices, or special + const void *I, // list of indices, or special + const bool I_is_32, // if true, I is 32-bit; else 64-bit const int64_t ni, // length I, or special const int64_t nI, // actual length from GB_ijlength const int64_t limit, // I must be in the range 0 to limit-1 @@ -132,6 +132,8 @@ GrB_Info GB_ijproperties // check I and determine its properties // if iinc == 1 on input, the kind has been changed to GB_RANGE ASSERT (iinc != 1) ; + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + if (iinc == 0) { // stride is zero: list is empty, contiguous, and sorted @@ -141,14 +143,14 @@ GrB_Info GB_ijproperties // check I and determine its properties else if (iinc > 0) { // stride is positive, get the first and last indices - imin = GB_ijlist (I, 0, GB_STRIDE, Icolon) ; - imax = GB_ijlist (I, nI-1, GB_STRIDE, Icolon) ; + imin = GB_IJLIST (I, 0, GB_STRIDE, Icolon) ; + imax = GB_IJLIST (I, nI-1, GB_STRIDE, Icolon) ; } else { // stride is negative, get the first and last indices - imin = GB_ijlist (I, nI-1, GB_STRIDE, Icolon) ; - imax = GB_ijlist (I, 0, GB_STRIDE, Icolon) ; + imin = GB_IJLIST (I, nI-1, GB_STRIDE, Icolon) ; + imax = GB_IJLIST (I, 0, GB_STRIDE, Icolon) ; } if (imin > imax) @@ -196,6 +198,8 @@ GrB_Info GB_ijproperties // check I and determine its properties // scan I to find imin and imax, and validate the list. Also determine // if it is sorted or not, and contiguous or not. + GB_IDECL (I, const, u) ; GB_IPTR (I, I_is_32) ; + imin = limit ; imax = -1 ; @@ -222,10 +226,10 @@ GrB_Info GB_ijproperties // check I and determine its properties int64_t my_imax = -1 ; int64_t istart, iend ; GB_PARTITION (istart, iend, ni, tid, ntasks) ; - int64_t ilast = (istart == 0) ? -1 : I [istart-1] ; + int64_t ilast = (istart == 0) ? -1 : GB_IGET (I, istart-1) ; for (int64_t inew = istart ; inew < iend ; inew++) { - int64_t i = I [inew] ; + int64_t i = GB_IGET (I, inew) ; if (inew > 0) { if (i < ilast) @@ -280,7 +284,7 @@ GrB_Info GB_ijproperties // check I and determine its properties int64_t ilast = -1 ; for (int64_t inew = 0 ; inew < ni ; inew++) { - int64_t i = I [inew] ; + int64_t i = GB_IGET (I, inew) ; if (inew > 0) { if (i < ilast) I_unsorted2 = true ; @@ -309,8 +313,8 @@ GrB_Info GB_ijproperties // check I and determine its properties if (ni == 1) { // a single entry does not need to be sorted - ASSERT (I [0] == imin) ; - ASSERT (I [0] == imax) ; + ASSERT (GB_IGET (I, 0) == imin) ; + ASSERT (GB_IGET (I, 0) == imax) ; ASSERT (I_unsorted == false) ; ASSERT (I_contig == true) ; } diff --git a/GraphBLAS/Source/ij/GB_ijsort.c b/GraphBLAS/Source/ij/GB_ijsort.c index 8321f5100e..0c6d2d051d 100644 --- a/GraphBLAS/Source/ij/GB_ijsort.c +++ b/GraphBLAS/Source/ij/GB_ijsort.c @@ -2,7 +2,7 @@ // GB_ijsort: sort an index array I and remove duplicates //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,18 +21,35 @@ #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&Work, Work_size) ; \ + GB_FREE_MEMORY (&I1, I1_size) ; \ + GB_FREE_MEMORY (&I1k, I1k_size) ; \ + GB_WERK_POP (W, uint64_t) ; \ +} + +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORKSPACE ; \ + GB_FREE_MEMORY (&I2, I2_size) ; \ + GB_FREE_MEMORY (&I2k, I2k_size) ; \ } GrB_Info GB_ijsort ( - const GrB_Index *restrict I, // size ni, where ni > 1 always holds - int64_t *restrict p_ni, // : size of I, output: # of indices in I2 - GrB_Index *restrict *p_I2, // size ni2, where I2 [0..ni2-1] - // contains the sorted indices with duplicates removed. + // input: + const void *I, // size ni, where ni > 1 always holds + const bool I_is_32, + const int64_t ni, // length I + const int64_t imax, // maximum value in I + // output: + int64_t *p_ni2, // # of indices in I2 and I2k + void **p_I2, // size ni2, where I2 [0..ni2-1] contains the + // sorted indices with duplicates removed. + bool *I2_is_32_handle, // if I2_is_32 true, I2 is 32 bits; else 64 bits size_t *I2_size_handle, - GrB_Index *restrict *p_I2k, // output array of size ni2 - size_t *I2k_size_handle + void **p_I2k, // output array of size ni2 + bool *I2k_is_32_handle, // if I2k_is_32 true, I2 is 32 bits; else 64 + size_t *I2k_size_handle, + GB_Werk Werk ) { @@ -42,18 +59,24 @@ GrB_Info GB_ijsort GrB_Info info ; ASSERT (I != NULL) ; - ASSERT (p_ni != NULL) ; + ASSERT (p_ni2 != NULL) ; ASSERT (p_I2 != NULL) ; ASSERT (p_I2k != NULL) ; + ASSERT (I2_is_32_handle != NULL) ; + ASSERT (I2_size_handle != NULL) ; + ASSERT (I2k_is_32_handle != NULL) ; + ASSERT (I2k_size_handle != NULL) ; //-------------------------------------------------------------------------- - // get inputs + // declare workspace and get inputs //-------------------------------------------------------------------------- - GrB_Index *Work = NULL ; size_t Work_size = 0 ; - GrB_Index *restrict I2 = NULL ; size_t I2_size = 0 ; - GrB_Index *restrict I2k = NULL ; size_t I2k_size = 0 ; - int64_t ni = *p_ni ; + GB_MDECL (I2 , , u) ; size_t I2_size = 0 ; + GB_MDECL (I2k, , u) ; size_t I2k_size = 0 ; + GB_MDECL (I1 , , u) ; size_t I1_size = 0 ; + GB_MDECL (I1k, , u) ; size_t I1k_size = 0 ; + GB_WERK_DECLARE (W, uint64_t) ; + ASSERT (ni > 1) ; int ntasks = 0 ; @@ -77,44 +100,48 @@ GrB_Info GB_ijsort // allocate workspace //-------------------------------------------------------------------------- - Work = GB_MALLOC_WORK (2*ni + ntasks + 1, GrB_Index, &Work_size) ; - if (Work == NULL) + GB_WERK_PUSH (W, ntasks+1, uint64_t) ; + + bool I1_is_32 = (imax <= UINT32_MAX) ; + bool I1k_is_32 = (ni <= UINT32_MAX) ; + size_t i1size = (I1_is_32 ) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t i1ksize = (I1k_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + I1 = GB_MALLOC_MEMORY (ni, i1size , &I1_size) ; + I1k = GB_MALLOC_MEMORY (ni, i1ksize, &I1k_size) ; + GB_IPTR (I1 , I1_is_32) ; + GB_IPTR (I1k, I1k_is_32) ; + if (W == NULL || I1 == NULL || I1k == NULL) { // out of memory + GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GrB_Index *restrict I1 = Work ; // size ni - GrB_Index *restrict I1k = Work + ni ; // size ni - int64_t *restrict Count = (int64_t *) (Work + 2*ni) ; // size ntasks+1 - //-------------------------------------------------------------------------- // copy I into I1 and construct I1k //-------------------------------------------------------------------------- - GB_memcpy (I1, I, ni * sizeof (GrB_Index), nthreads) ; + GB_Type_code i1code = (I1_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code icode = (I_is_32 ) ? GB_UINT32_code : GB_UINT64_code ; + + GB_cast_int (I1, i1code, I, icode, ni, nthreads_max) ; int64_t k ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < ni ; k++) { - // the key is selected so that the last duplicate entry comes first in - // the sorted result. It must be adjusted later, so that the kth entry - // has a key equal to k. - I1k [k] = (ni-k) ; + // the key nik is selected so that the last duplicate entry comes first + // in the sorted result. It must be adjusted later, so that the kth + // entry has a key equal to k. + int64_t nik = ni - k ; + GB_ISET (I1k, k, nik) ; // I1k [k] = nik ; } //-------------------------------------------------------------------------- // sort [I1 I1k] //-------------------------------------------------------------------------- - info = GB_msort_2 ((int64_t *) I1, (int64_t *) I1k, ni, nthreads) ; - if (info != GrB_SUCCESS) - { - // out of memory - GB_FREE_WORKSPACE ; - return (GrB_OUT_OF_MEMORY) ; - } + GB_OK (GB_msort_2 (I1, I1_is_32, I1k, I1k_is_32, ni, nthreads)) ; //-------------------------------------------------------------------------- // count unique entries in I1 @@ -124,36 +151,42 @@ GrB_Info GB_ijsort #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) for (tid = 0 ; tid < ntasks ; tid++) { - int64_t kfirst, klast, my_count = (tid == 0) ? 1 : 0 ; + int64_t kfirst, klast, my_count = 0 ; GB_PARTITION (kfirst, klast, ni, tid, ntasks) ; - for (int64_t k = GB_IMAX (kfirst,1) ; k < klast ; k++) + int64_t iprev = (kfirst == 0) ? (-1) : GB_IGET (I1, kfirst-1) ; + for (int64_t k = kfirst ; k < klast ; k++) { - if (I1 [k-1] != I1 [k]) + int64_t i = GB_IGET (I1, k) ; + if (iprev != i) { my_count++ ; } + iprev = i ; } - Count [tid] = my_count ; + W [tid] = my_count ; } - GB_cumsum1 (Count, ntasks) ; - int64_t ni2 = Count [ntasks] ; + GB_cumsum1_64 (W, ntasks) ; + int64_t ni2 = W [ntasks] ; //-------------------------------------------------------------------------- - // allocate the result I2 + // allocate the result I2 and I2k //-------------------------------------------------------------------------- - I2 = GB_MALLOC_WORK (ni2, GrB_Index, &I2_size) ; - I2k = GB_MALLOC_WORK (ni2, GrB_Index, &I2k_size) ; + const bool I2_is_32 = I1_is_32 ; + const bool I2k_is_32 = I1k_is_32 ; + I2 = GB_MALLOC_MEMORY (ni2, i1size , &I2_size) ; + I2k = GB_MALLOC_MEMORY (ni2, i1ksize, &I2k_size) ; if (I2 == NULL || I2k == NULL) { // out of memory - GB_FREE_WORKSPACE ; - GB_FREE_WORK (&I2, I2_size) ; - GB_FREE_WORK (&I2k, I2k_size) ; + GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (I2, I2_is_32 ) ; + GB_IPTR (I2k, I2k_is_32) ; + //-------------------------------------------------------------------------- // construct the new list I2 from I1, removing duplicates //-------------------------------------------------------------------------- @@ -161,23 +194,20 @@ GrB_Info GB_ijsort #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) for (tid = 0 ; tid < ntasks ; tid++) { - int64_t kfirst, klast, k2 = Count [tid] ; + int64_t kfirst, klast, k2 = W [tid] ; GB_PARTITION (kfirst, klast, ni, tid, ntasks) ; - if (tid == 0) - { - // the first entry in I1 is never a duplicate - I2 [k2] = I1 [0] ; - I2k [k2] = (ni - I1k [0]) ; - k2++ ; - } - for (int64_t k = GB_IMAX (kfirst,1) ; k < klast ; k++) + int64_t iprev = (kfirst == 0) ? (-1) : GB_IGET (I1, kfirst-1) ; + for (int64_t k = kfirst ; k < klast ; k++) { - if (I1 [k-1] != I1 [k]) + int64_t i = GB_IGET (I1, k) ; + if (iprev != i) { - I2 [k2] = I1 [k] ; - I2k [k2] = ni - I1k [k] ; + int64_t nik = ni - GB_IGET (I1k, k) ; + GB_ISET (I2, k2, i) ; // I2 [k2] = i + GB_ISET (I2k, k2, nik) ; // I2k [k2] = nik k2++ ; } + iprev = i ; } } @@ -187,34 +217,43 @@ GrB_Info GB_ijsort #ifdef GB_DEBUG { + // compute the result sequentally in-place, in I1 and I1k, and compare + // with the output I2 and I2k. int64_t ni1 = 1 ; - I1k [0] = ni - I1k [0] ; + int64_t nik = ni - GB_IGET (I1k, 0) ; // nik = ni - I1k [0] + GB_ISET (I1k, 0, nik) ; // I1k [0] = nik for (int64_t k = 1 ; k < ni ; k++) { - if (I1 [ni1-1] != I1 [k]) + if (GB_IGET (I1, ni1-1) != GB_IGET (I1, k)) { - I1 [ni1] = I1 [k] ; - I1k [ni1] = ni - I1k [k] ; + int64_t i = GB_IGET (I1, k) ; // i = I1 [k] + GB_ISET (I1, ni1, i) ; // I1 [ni1] = i + int64_t nik = ni - GB_IGET (I1k, k) ; // nik = ni - I1k [k] + GB_ISET (I1k, ni1, nik) ; // I1k [ni1] = nik ni1++ ; } } ASSERT (ni1 == ni2) ; for (int64_t k = 0 ; k < ni1 ; k++) { - ASSERT (I1 [k] == I2 [k]) ; - ASSERT (I1k [k] == I2k [k]) ; + ASSERT (GB_IGET (I1 , k) == GB_IGET (I2 , k)) ; + ASSERT (GB_IGET (I1k, k) == GB_IGET (I2k, k)) ; } } #endif //-------------------------------------------------------------------------- - // free workspace and return the new sorted list + // free workspace and return the new sorted lists //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - *(p_I2 ) = (GrB_Index *) I2 ; (*I2_size_handle ) = I2_size ; - *(p_I2k) = (GrB_Index *) I2k ; (*I2k_size_handle) = I2k_size ; - *(p_ni ) = (int64_t ) ni2 ; + (*p_ni2) = ni2 ; + (*p_I2 ) = I2 ; + (*I2_size_handle ) = I2_size ; + (*I2_is_32_handle) = I2_is_32 ; + (*p_I2k) = I2k ; + (*I2k_size_handle) = I2k_size ; + (*I2k_is_32_handle) = I2k_is_32 ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/ij/GB_ijxvector.c b/GraphBLAS/Source/ij/GB_ijxvector.c new file mode 100644 index 0000000000..a3a15b75f6 --- /dev/null +++ b/GraphBLAS/Source/ij/GB_ijxvector.c @@ -0,0 +1,514 @@ +//------------------------------------------------------------------------------ +// GB_ijxvector: extract a list of indices or values from a GrB_Vector +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// The input vector List describes a list of integers or values to be used by +// GrB_assign, GxB_subassign, GrB_extract, or GrB_build, as I, J, or X. +// +// Descriptor settings: for I and J lists passed to GrB_assign, +// GxB_subassign and GrB_extract, and for I,J,X lists passed to GrB_build: +// +// default: use List->x as GxB_LIST of indices +// use indices: use List->i as GxB_LIST of indices +// stride: use List->x for Icolon [3] (signed integers); +// List->x must have exactly 3 entries (lo:inc:hi), +// and is typecast to Icolon of type int64_t. +// becomes GxB_STRIDE. +// +// If the List vector is NULL, it is treated as GrB_ALL; no need for the +// descriptor. Since the List vector can contain signed integers, there is no +// need for a RANGE or BACKWARDS descriptor. +// +// Descriptor fields that control the interpretation of the List: +// +// GxB_ROWINDEX_LIST how to interpret the GrB_Vector I +// GxB_COLINDEX_LIST how to interpret the GrB_Vector J +// GxB_VALUE_LIST how to interpret the GrB_Vector X for GrB_build +// +// values they can be set to: +// +// GrB_DEFAULT (0) use List->x +// GxB_USE_VALUES (0) use List->x (same as GrB_DEFAULT) +// GxB_USE_INDICES (7060) use List->i +// GxB_IS_STRIDE (7061) use List->x, size 3, for Icolon +// +// GrB_build does not allow GxB_IS_STRIDE for I, J, or X. +// +// GrB_extractTuples, with indices returned in GrB_Vectors I, J, and X will use +// none of these settings. It will always return its results in List->x. It +// does not use this method and ignores the descriptor settings above. + +#include "GB_ij.h" +#include "container/GB_container.h" + +#define GB_FREE_ALL \ +{ \ + GB_FREE_MEMORY (&I2, I2_size) ; \ + if (I != NULL && I_size > 0) \ + { \ + GB_FREE_MEMORY (&I, I_size) ; \ + } \ + GB_Matrix_free (&T) ; \ +} + +//------------------------------------------------------------------------------ +// GB_stride: create a stride, I = begin:inc:end +//------------------------------------------------------------------------------ + +// GrB_assign, GxB_subassign, and GrB_extract all expect a list of unsigned +// integers for their list I. The stride can be negative, which is handled by +// setting ni to one of 3 special values: +// +// GxB_RANGE I = [begin, end, 1] +// GxB_BACKWARDS I = [begin, end, -stride] +// GxB_STRIDE I = [begin, end, +stride] +// +// Tyis method is not used for GrB_build. + +static inline GrB_Info GB_stride +( + // input: + int64_t stride_begin, + int64_t stride_inc, + int64_t stride_end, + // output: + void **I_handle, // the list I; may be GrB_ALL + int64_t *ni_handle, // the length of I, or special (GxB_RANGE) + size_t *I_size_handle, // if > 0, I has been allocated by this + GrB_Type *I_type_handle // the type of I: always GrB_UINT64 +) +{ + ASSERT ((*I_handle) == NULL) ; + ASSERT ((*I_size_handle) == 0) ; + (*I_handle) = GB_CALLOC_MEMORY (3, sizeof (uint64_t), I_size_handle) ; + if ((*I_handle) == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + uint64_t *U64 = (uint64_t *) (*I_handle) ; + U64 [GxB_BEGIN] = (uint64_t) stride_begin ; + U64 [GxB_END ] = (uint64_t) stride_end ; + if (stride_inc == 1) + { + // in MATLAB notation: begin:1:end + U64 [GxB_INC] = 1 ; + (*ni_handle) = GxB_RANGE ; + } + else if (stride_inc < 0) + { + // in MATLAB notation: begin:stride:end, where stride < 0 + U64 [GxB_INC] = (uint64_t) (-stride_inc) ; + (*ni_handle) = GxB_BACKWARDS ; + } + else + { + // in MATLAB notation: begin:stride:end, where stride > 1 + U64 [GxB_INC] = (uint64_t) stride_inc ; + (*ni_handle) = GxB_STRIDE ; + } + (*I_type_handle) = GrB_UINT64 ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_ijxvector: intrepret the List +//------------------------------------------------------------------------------ + +GrB_Info GB_ijxvector +( + // input: + GrB_Vector List, // defines the list, either from List->x or List-i. + // If List is NULL, it defines I = GrB_ALL. + bool need_copy, // if true, I must be allocated + int which, // 0: I list, 1: J list, 2: X list + const GrB_Descriptor desc, // row_list, col_list, val_list descriptors + bool is_build, // if true, method is GrB_build; otherwise, it is + // assign, subassign, or extract + // output: + void **I_handle, // the list I; may be GrB_ALL + int64_t *ni_handle, // the length of I, or special (GxB_RANGE) + size_t *I_size_handle, // if > 0, I has been allocated by this + // method. Otherwise, it is a shallow pointer into + // List->x or List->i, or is equal to GrB_ALL. + GrB_Type *I_type_handle, // the type of I: GrB_UINT32 or GrB_UINT64 for + // assign, subassign, extract, or for build when + // descriptor is GxB_USE_INDICES. For build, + // this is List->type when the descriptor is + // GxB_USE_VALUES. + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GrB_Info info ; + ASSERT (I_handle != NULL) ; + ASSERT (ni_handle != NULL) ; + ASSERT (I_size_handle != NULL) ; + ASSERT (I_type_handle != NULL) ; + ASSERT_VECTOR_OK_OR_NULL (List, "List", GB0) ; + + (*I_handle) = NULL ; + (*ni_handle) = 0 ; + (*I_size_handle) = 0 ; + (*I_type_handle) = NULL ; + + struct GB_Matrix_opaque T_header ; + GrB_Matrix T = NULL ; + size_t I_size = 0, I2_size = 0 ; + void *I = NULL, *I2 = NULL ; + + //-------------------------------------------------------------------------- + // quick return if List is NULL + //-------------------------------------------------------------------------- + + if (List == NULL) + { + // GrB_build will not call this method with List == NULL + ASSERT (!is_build) ; + // List of NULL denotes GrB_ALL, or ":"; descriptor is ignored + (*I_handle) = (uint64_t *) GrB_ALL ; + (*I_type_handle) = GrB_UINT64 ; + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // finish any pending work in the List + //-------------------------------------------------------------------------- + + GB_MATRIX_WAIT (List) ; + + //-------------------------------------------------------------------------- + // get the descriptor + //-------------------------------------------------------------------------- + + // GrB_DEFAULT (0) use List->x + // GxB_USE_VALUES (0) use List->x (same as GrB_DEFAULT) + // GxB_USE_INDICES (7060) use List->i + // GxB_IS_STRIDE (7061) use List->x, size 3, for Icolon + + int list_descriptor = GrB_DEFAULT ; + if (desc != NULL) + { + switch (which) + { + default: + case 0 : list_descriptor = desc->row_list ; break ; + case 1 : list_descriptor = desc->col_list ; break ; + case 2 : list_descriptor = desc->val_list ; break ; + } + } + + bool list_is_stride = (list_descriptor == GxB_IS_STRIDE) ; + int64_t ni = GB_nnz ((GrB_Matrix) List) ; + if (list_is_stride && (ni != 3 || is_build)) + { + // List must have exactly 3 items (lo,hi,stride) for GxB_IS_STRIDE + // for assign, subassign, and extract. GrB_build does not allow + // GxB_IS_STRIDE. + return (GrB_INVALID_VALUE) ; + } + + bool use_values = (list_descriptor != GxB_USE_INDICES) ; + + //-------------------------------------------------------------------------- + // quick return if List is empty + //-------------------------------------------------------------------------- + + if (ni == 0) + { + // List is not NULL, but has no entries (nvals (List) == 0) + (*I_handle) = GB_CALLOC_MEMORY (1, sizeof (uint64_t), I_size_handle) ; + if ((*I_handle) == NULL) + { + return (GrB_OUT_OF_MEMORY) ; + } + (*I_type_handle) = GrB_UINT64 ; + return (GrB_SUCCESS) ; + } + + //-------------------------------------------------------------------------- + // extract the list of integers from the List vector + //-------------------------------------------------------------------------- + + int List_sparsity = GB_sparsity ((GrB_Matrix) List) ; + GrB_Type I_type = NULL ; + bool iso = false ; + + if (List_sparsity == GxB_SPARSE) + { + + //---------------------------------------------------------------------- + // List is sparse + //---------------------------------------------------------------------- + + if (use_values) + { + I = List->x ; + I_type = List->type ; + iso = List->iso ; + } + else + { + I = List->i ; + I_type = (List->i_is_32) ? GrB_UINT32 : GrB_UINT64 ; + } + + } + else if (List_sparsity == GxB_BITMAP) + { + + //---------------------------------------------------------------------- + // List is bitmap + //---------------------------------------------------------------------- + + uint64_t Cp [2] ; + if (use_values) + { + if (List->iso) + { + // get the iso value; it is expanded below + I = List->x ; + iso = true ; + } + else + { + // extract the values from the bitmap vector + I = GB_MALLOC_MEMORY (ni, List->type->size, &I_size) ; + if (I == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + GB_OK (GB_convert_b2s (Cp, NULL, NULL, /* Cx: */ I, NULL, + false, false, false, List->type, (GrB_Matrix) List, Werk)) ; + } + I_type = List->type ; + } + else + { + // extract the indices from the bitmap vector + I_type = (ni <= UINT32_MAX) ? GrB_UINT32 : GrB_UINT64 ; + I = GB_MALLOC_MEMORY (ni, I_type->size, &I_size) ; + if (I == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + GB_OK (GB_convert_b2s (Cp, /* Ci: */ I, NULL, NULL, NULL, + false, I_type == GrB_UINT32, false, List->type, + (GrB_Matrix) List, Werk)) ; + } + + } + else // List_sparsity == GxB_FULL + { + + //---------------------------------------------------------------------- + // List is full + //---------------------------------------------------------------------- + + if (use_values) + { + // if the List is iso, it is expanded below + I = List->x ; + I_type = List->type ; + iso = List->iso ; + } + else + { + // create I = 0:1:(length(List)-1) with quick return + int64_t n = List->vlen ; + if (is_build) + { + // build an explicit list for GrB_build + I_type = (n <= UINT32_MAX) ? GrB_UINT32 : GrB_UINT64 ; + (*I_handle) = GB_MALLOC_MEMORY (n, I_type->size, I_size_handle); + if ((*I_handle) == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + int nthreads = GB_nthreads (n, chunk, nthreads_max) ; + int64_t k ; + if (I_type == GrB_UINT32) + { + uint32_t *I = (uint32_t *) (*I_handle) ; + #pragma omp parallel for num_threads(nthreads) \ + schedule(static) + for (k = 0 ; k < n ; k++) + { + I [k] = k ; + } + } + else + { + uint64_t *I = (uint64_t *) (*I_handle) ; + #pragma omp parallel for num_threads(nthreads) \ + schedule(static) + for (k = 0 ; k < n ; k++) + { + I [k] = k ; + } + } + (*ni_handle) = n ; + (*I_type_handle) = I_type ; + return (GrB_SUCCESS) ; + } + else + { + // use I = [0, n-1, 1] and GxB_STRIDE + return (GB_stride (0, 1, n-1, + I_handle, ni_handle, I_size_handle, I_type_handle)) ; + } + } + } + + //-------------------------------------------------------------------------- + // expand I if it is iso-valued + //-------------------------------------------------------------------------- + + if (iso) + { + // I has not been allocted; it is a shallow copy of List->x + ASSERT (I == List->x) ; + ASSERT (I_size == 0) ; + I2 = GB_MALLOC_MEMORY (ni, I_type->size, &I2_size) ; + if (I2 == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + GB_OK (GB_iso_expand (I2, ni, I, I_type)) ; + // replace I with the newly-allocated and expanded I2 + I = I2 ; + I_size = I2_size ; + I2 = NULL ; + I2_size = 0 ; + // the list I is no longer iso + iso = false ; + } + + //-------------------------------------------------------------------------- + // determine the final output type for I + //-------------------------------------------------------------------------- + + GrB_Type I_target_type = NULL ; + if (is_build && which == 2) + { + // List remains as-is for the values for build + I_target_type = I_type ; + } + else if (list_is_stride) + { + // ensure the List is typecast to int64_t + I_target_type = GrB_INT64 ; + } + else if (I_type == GrB_INT32 || I_type == GrB_UINT32) + { + // implicit typecast of int32_t to uint32_t (I does not change) + I_type = GrB_UINT32 ; + I_target_type = GrB_UINT32 ; + } + else if (I_type == GrB_INT64 || I_type == GrB_UINT64) + { + // implicit typecast of int64_t to uint64_t (I does not change) + I_type = GrB_UINT64 ; + I_target_type = GrB_UINT64 ; + } + else + { + // I_type is not a 32/64 bit integer; typecast it to GrB_UINT64 + I_target_type = GrB_UINT64 ; + } + + //-------------------------------------------------------------------------- + // copy/typecast the indices if needed + //-------------------------------------------------------------------------- + + if ((need_copy && I_size == 0) || I_type != I_target_type) + { + // Create an ni-by-1 matrix T containing the values of I + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; + GB_OK (GB_new (&T, // static header + I_type, ni, 1, GB_ph_null, true, GxB_FULL, 0, 0, + false, false, false)) ; + GB_vector_load ((GrB_Vector) T, &I, I_type, ni, I_size, true) ; + ASSERT_MATRIX_OK (T, "T for typecast to I", GB0) ; + + // I2 = (uint64_t) T->x or (int64_t) T->x + I2 = GB_MALLOC_MEMORY (ni, sizeof (uint64_t), &I2_size) ; + if (I2 == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + int nthreads_max = GB_Context_nthreads_max ( ) ; + GB_OK (GB_cast_array (I2, I_target_type->code, T, nthreads_max)) ; + GB_Matrix_free (&T) ; + + // free the old I and replace it with I2 + if (I_size > 0) + { + GB_FREE_MEMORY (&I, I_size) ; + } + I = I2 ; + I_size = I2_size ; + I2 = NULL ; + I2_size = 0 ; + I_type = I_target_type ; + } + + ASSERT (I_type == I_target_type) ; + ASSERT (GB_IMPLIES (need_copy, I_size > 0)) ; + + //-------------------------------------------------------------------------- + // create the stride or return the list I + //-------------------------------------------------------------------------- + + if (list_is_stride) + { + // I currently has type int64_t, so it can handle negative strides, + // but it must be converted to uint64_t to become Icolon. + ASSERT (I_type == GrB_INT64) ; + ASSERT (!is_build) ; + int64_t *I64 = (int64_t *) I ; + int64_t stride_begin = I64 [GxB_BEGIN] ; + int64_t stride_inc = I64 [GxB_INC ] ; + int64_t stride_end = I64 [GxB_END ] ; + // create the stride + GB_OK (GB_stride (stride_begin, stride_inc, stride_end, + I_handle, ni_handle, I_size_handle, I_type_handle)) ; + } + else + { + // return I as-is + ASSERT (I_type == GrB_UINT32 || I_type == GrB_UINT64 || + (is_build && I_type == List->type)) ; + (*I_handle) = I ; + (*ni_handle) = ni ; + (*I_size_handle) = I_size ; + (*I_type_handle) = I_type ; + I = NULL ; + } + + //-------------------------------------------------------------------------- + // free workspace return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/ij/include/GB_ijlist.h b/GraphBLAS/Source/ij/include/GB_ijlist.h index c1b4e0676b..64ced349fc 100644 --- a/GraphBLAS/Source/ij/include/GB_ijlist.h +++ b/GraphBLAS/Source/ij/include/GB_ijlist.h @@ -2,7 +2,7 @@ // GB_ijlist.h: return kth item, i = I [k], in an index list //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,38 +10,31 @@ #ifndef GB_IJLIST_H #define GB_IJLIST_H -// given k, return the kth item i = I [k] in the list -static inline int64_t GB_ijlist // get the kth item in a list of indices -( - const GrB_Index *I, // list of indices - const int64_t k, // return i = I [k], the kth item in the list - const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST - const int64_t Icolon [3] // begin:inc:end for all but GB_LIST +//------------------------------------------------------------------------------ +// kind of index list, Ikind and Jkind, and assign variations +//------------------------------------------------------------------------------ + +#define GB_ALL 0 +#define GB_RANGE 1 +#define GB_STRIDE 2 +#define GB_LIST 3 + +#define GB_ASSIGN 0 +#define GB_SUBASSIGN 1 +#define GB_ROW_ASSIGN 2 +#define GB_COL_ASSIGN 3 + +//------------------------------------------------------------------------------ +// GB_IJLIST: given k, return the kth item i = I [k] in the list (32/64 bit) +//------------------------------------------------------------------------------ + +#define GB_IJLIST(I,k,Ikind,Icolon) \ +( \ + (Ikind == GB_ALL) ? (k) : \ + ((Ikind == GB_RANGE) ? (Icolon [GxB_BEGIN] + (k)) : \ + ((Ikind == GB_STRIDE) ? (Icolon [GxB_BEGIN] + (k) * Icolon [GxB_INC]) : \ + /* else GB_LIST */ (GB_IGET (I, k)))) \ ) -{ - if (Ikind == GB_ALL) - { - // I is ":" - return (k) ; - } - else if (Ikind == GB_RANGE) - { - // I is begin:end - return (Icolon [GxB_BEGIN] + k) ; - } - else if (Ikind == GB_STRIDE) - { - // I is begin:inc:end - // note that iinc can be negative or even zero - return (Icolon [GxB_BEGIN] + k * Icolon [GxB_INC]) ; - } - else // Ikind == GB_LIST - { - // ASSERT (Ikind == GB_LIST) ; - // ASSERT (I != NULL) ; - return (I [k]) ; - } -} #endif diff --git a/GraphBLAS/Source/import_export/GB_export.c b/GraphBLAS/Source/import_export/GB_export.c index 5ebe2a8e7f..dc69d89eb7 100644 --- a/GraphBLAS/Source/import_export/GB_export.c +++ b/GraphBLAS/Source/import_export/GB_export.c @@ -2,53 +2,56 @@ // GB_export: export a matrix or vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// No conversion is done, except to convert to non-iso if requested. The -// matrix is exported in its current sparsity structure and by-row/by-col -// format. +// No conversion is done, except to convert to non-iso if requested, and all +// integers are converted to 64-bits. The matrix is exported in its current +// sparsity structure and by-row/by-col format. #include "import_export/GB_export.h" #define GB_FREE_ALL \ { \ - GB_FREE (&Ap_new, Ap_new_size) ; \ - GB_FREE (&Ah_new, Ah_new_size) ; \ + GB_FREE_MEMORY (&Ap_new, Ap_new_size) ; \ + GB_FREE_MEMORY (&Ah_new, Ah_new_size) ; \ } GrB_Info GB_export // export/unpack a matrix in any format ( - bool unpacking, // unpack if true, export and free if false + bool unpacking, // unpack if true, export and free if false. + // The false case is historical; GxB*unpack sets this + // flag to true, and GrB*export does not use this + // method. GrB_Matrix *A, // handle of matrix to export and free, or unpack GrB_Type *type, // type of matrix to export - GrB_Index *vlen, // vector length - GrB_Index *vdim, // vector dimension + uint64_t *vlen, // vector length + uint64_t *vdim, // vector dimension bool is_sparse_vector, // true if A is a sparse GrB_Vector // the 5 arrays: - GrB_Index **Ap, // pointers - GrB_Index *Ap_size, // size of Ap in bytes + uint64_t **Ap, // pointers + uint64_t *Ap_size, // size of Ap in bytes - GrB_Index **Ah, // vector indices - GrB_Index *Ah_size, // size of Ah in bytes + uint64_t **Ah, // vector indices + uint64_t *Ah_size, // size of Ah in bytes int8_t **Ab, // bitmap - GrB_Index *Ab_size, // size of Ab in bytes + uint64_t *Ab_size, // size of Ab in bytes - GrB_Index **Ai, // indices - GrB_Index *Ai_size, // size of Ai in bytes + uint64_t **Ai, // indices + uint64_t *Ai_size, // size of Ai in bytes void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes // additional information for specific formats: - GrB_Index *nvals, // # of entries for bitmap format. + uint64_t *nvals, // # of entries for bitmap format. bool *jumbled, // if true, sparse/hypersparse may be jumbled. - GrB_Index *nvec, // size of Ah for hypersparse format. + uint64_t *nvec, // size of Ah for hypersparse format. // information for all formats: int *sparsity, // hypersparse, sparse, bitmap, or full @@ -64,10 +67,15 @@ GrB_Info GB_export // export/unpack a matrix in any format //-------------------------------------------------------------------------- GrB_Info info ; - int64_t *Ap_new = NULL ; size_t Ap_new_size = 0 ; - int64_t *Ah_new = NULL ; size_t Ah_new_size = 0 ; + int64_t *Ap_new = NULL ; size_t Ap_new_size = 0 ; // OK; only 64-bit + int64_t *Ah_new = NULL ; size_t Ah_new_size = 0 ; // OK; only 64-bit ASSERT (A != NULL) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_RETURN_IF_NULL (*A) ; + + // ensure the matrix is all-64-bit + GB_OK (GB_convert_int (*A, false, false, false, false)) ; + + GB_RETURN_IF_NULL_OR_INVALID (*A) ; ASSERT_MATRIX_OK (*A, "A to export", GB0) ; ASSERT (!GB_ZOMBIES (*A)) ; ASSERT (GB_JUMBLED_OK (*A)) ; @@ -121,11 +129,13 @@ GrB_Info GB_export // export/unpack a matrix in any format { plen_new = (avdim == 0) ? 0 : 1 ; nvec_new = (avdim == 1) ? 1 : 0 ; - Ap_new = GB_CALLOC (plen_new+1, int64_t, &(Ap_new_size)) ; + Ap_new = GB_CALLOC_MEMORY (plen_new+1, sizeof (int64_t), + &(Ap_new_size)) ; if (avdim > 1) { // A is sparse if avdim <= 1, hypersparse if avdim > 1 - Ah_new = GB_CALLOC (1, int64_t, &(Ah_new_size)) ; + Ah_new = GB_CALLOC_MEMORY (1, sizeof (int64_t), + &(Ah_new_size)) ; } if (Ap_new == NULL || (avdim > 1 && Ah_new == NULL)) { @@ -142,7 +152,6 @@ GrB_Info GB_export // export/unpack a matrix in any format if (iso == NULL) { // ensure A is non-iso - // set A->iso = false OK if ((*A)->iso) { GBURBLE ("(iso to non-iso export) ") ; @@ -169,9 +178,7 @@ GrB_Info GB_export // export/unpack a matrix in any format (*vdim) = avdim ; // export A->x - #ifdef GB_MEMDUMP - printf ("export A->x from memtable: %p\n", (*A)->x) ; // MEMDUMP - #endif + GBMDUMP ("export A->x from memtable: %p\n", (*A)->x) ; GB_Global_memtable_remove ((*A)->x) ; (*Ax) = (*A)->x ; (*A)->x = NULL ; (*Ax_size) = (*A)->x_size ; @@ -182,11 +189,9 @@ GrB_Info GB_export // export/unpack a matrix in any format (*nvec) = (*A)->nvec ; // export A->h - #ifdef GB_MEMDUMP - printf ("export A->h from memtable: %p\n", (*A)->h) ; // MEMDUMP - #endif + GBMDUMP ("export A->h from memtable: %p\n", (*A)->h) ; GB_Global_memtable_remove ((*A)->h) ; - (*Ah) = (GrB_Index *) ((*A)->h) ; (*A)->h = NULL ; + (*Ah) = (uint64_t *) ((*A)->h) ; (*A)->h = NULL ; (*Ah_size) = (*A)->h_size ; // fall through to the sparse case @@ -199,24 +204,21 @@ GrB_Info GB_export // export/unpack a matrix in any format // export A->p, unless A is a sparse vector in CSC format if (is_sparse_vector) { - (*nvals) = (*A)->p [1] ; + uint64_t *restrict Ap = (*A)->p ; // OK; 64-bit only + (*nvals) = Ap [1] ; } else { - #ifdef GB_MEMDUMP - printf ("export A->p from memtable: %p\n", (*A)->p) ; // MEMDUMP - #endif + GBMDUMP ("export A->p from memtable: %p\n", (*A)->p) ; GB_Global_memtable_remove ((*A)->p) ; - (*Ap) = (GrB_Index *) ((*A)->p) ; (*A)->p = NULL ; + (*Ap) = (uint64_t *) ((*A)->p) ; (*A)->p = NULL ; (*Ap_size) = (*A)->p_size ; } // export A->i - #ifdef GB_MEMDUMP - printf ("export A->i from memtable: %p\n", (*A)->i) ; // MEMDUMP - #endif + GBMDUMP ("export A->i from memtable: %p\n", (*A)->i) ; GB_Global_memtable_remove ((*A)->i) ; - (*Ai) = (GrB_Index *) ((*A)->i) ; (*A)->i = NULL ; + (*Ai) = (uint64_t *) ((*A)->i) ; (*A)->i = NULL ; (*Ai_size) = (*A)->i_size ; break ; @@ -224,9 +226,7 @@ GrB_Info GB_export // export/unpack a matrix in any format (*nvals) = (*A)->nvals ; // export A->b - #ifdef GB_MEMDUMP - printf ("export A->b from memtable: %p\n", (*A)->b) ; // MEMDUMP - #endif + GBMDUMP ("export A->b from memtable: %p\n", (*A)->b) ; GB_Global_memtable_remove ((*A)->b) ; (*Ab) = (*A)->b ; (*A)->b = NULL ; (*Ab_size) = (*A)->b_size ; @@ -261,11 +261,15 @@ GrB_Info GB_export // export/unpack a matrix in any format (*A)->p = Ap_new ; (*A)->p_size = Ap_new_size ; (*A)->h = Ah_new ; (*A)->h_size = Ah_new_size ; (*A)->magic = GB_MAGIC ; + (*A)->p_is_32 = false ; + (*A)->j_is_32 = false ; + (*A)->i_is_32 = false ; ASSERT_MATRIX_OK (*A, "A unpacked", GB0) ; } else { - // export: free the header of A, and A->p if A is a sparse GrB_Vector + // GxB_export: free the header of A, and A->p if A is a sparse + // GrB_Vector. This method is historical. GB_Matrix_free (A) ; ASSERT ((*A) == NULL) ; } diff --git a/GraphBLAS/Source/import_export/GB_export.h b/GraphBLAS/Source/import_export/GB_export.h index 4c89e3aa80..befec3296e 100644 --- a/GraphBLAS/Source/import_export/GB_export.h +++ b/GraphBLAS/Source/import_export/GB_export.h @@ -2,7 +2,7 @@ // GB_export.h: definitions for import/export //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,31 +18,31 @@ GrB_Info GB_import // import/pack a matrix in any format GrB_Matrix *A, // handle of matrix to create, or pack GrB_Type type, // type of matrix to create - GrB_Index vlen, // vector length - GrB_Index vdim, // vector dimension + uint64_t vlen, // vector length + uint64_t vdim, // vector dimension bool is_sparse_vector, // true if A is a sparse GrB_Vector // the 5 arrays: - GrB_Index **Ap, // pointers, for sparse and hypersparse formats. - GrB_Index Ap_size, // size of Ap in bytes + uint64_t **Ap, // pointers, for sparse and hypersparse formats. + uint64_t Ap_size, // size of Ap in bytes - GrB_Index **Ah, // vector indices for hypersparse matrices - GrB_Index Ah_size, // size of Ah in bytes + uint64_t **Ah, // vector indices for hypersparse matrices + uint64_t Ah_size, // size of Ah in bytes int8_t **Ab, // bitmap, for bitmap format only. - GrB_Index Ab_size, // size of Ab in bytes + uint64_t Ab_size, // size of Ab in bytes - GrB_Index **Ai, // indices for hyper and sparse formats - GrB_Index Ai_size, // size of Ai in bytes + uint64_t **Ai, // indices for hyper and sparse formats + uint64_t Ai_size, // size of Ai in bytes void **Ax, // values - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes // additional information for specific formats: - GrB_Index nvals, // # of entries for bitmap format, or for a vector + uint64_t nvals, // # of entries for bitmap format, or for a vector // in CSC format. bool jumbled, // if true, sparse/hypersparse may be jumbled. - GrB_Index nvec, // size of Ah for hypersparse format. + uint64_t nvec, // size of Ah for hypersparse format. // information for all formats: int sparsity, // hypersparse, sparse, bitmap, or full @@ -62,30 +62,30 @@ GrB_Info GB_export // export/unpack a matrix in any format GrB_Matrix *A, // handle of matrix to export and free, or unpack GrB_Type *type, // type of matrix to export - GrB_Index *vlen, // vector length - GrB_Index *vdim, // vector dimension + uint64_t *vlen, // vector length + uint64_t *vdim, // vector dimension bool is_sparse_vector, // true if A is a sparse GrB_Vector // the 5 arrays: - GrB_Index **Ap, // pointers - GrB_Index *Ap_size, // size of Ap in bytes + uint64_t **Ap, // pointers + uint64_t *Ap_size, // size of Ap in bytes - GrB_Index **Ah, // vector indices - GrB_Index *Ah_size, // size of Ah in bytes + uint64_t **Ah, // vector indices + uint64_t *Ah_size, // size of Ah in bytes int8_t **Ab, // bitmap - GrB_Index *Ab_size, // size of Ab in bytes + uint64_t *Ab_size, // size of Ab in bytes - GrB_Index **Ai, // indices - GrB_Index *Ai_size, // size of Ai in bytes + uint64_t **Ai, // indices + uint64_t *Ai_size, // size of Ai in bytes void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes // additional information for specific formats: - GrB_Index *nvals, // # of entries for bitmap format. + uint64_t *nvals, // # of entries for bitmap format. bool *jumbled, // if true, sparse/hypersparse may be jumbled. - GrB_Index *nvec, // size of Ah for hypersparse format. + uint64_t *nvec, // size of Ah for hypersparse format. // information for all formats: int *sparsity, // hypersparse, sparse, bitmap, or full diff --git a/GraphBLAS/Source/import_export/GB_import.c b/GraphBLAS/Source/import_export/GB_import.c index 6f86ff5139..d053fb6134 100644 --- a/GraphBLAS/Source/import_export/GB_import.c +++ b/GraphBLAS/Source/import_export/GB_import.c @@ -2,7 +2,7 @@ // GB_import: import a matrix in any format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,35 +16,35 @@ GrB_Info GB_import // import/pack a matrix in any format ( - bool packing, // pack if true, create and import false + bool packing, // pack if true; create and import if false. GrB_Matrix *A, // handle of matrix to create, or pack GrB_Type type, // type of matrix to create - GrB_Index vlen, // vector length - GrB_Index vdim, // vector dimension + uint64_t vlen, // vector length + uint64_t vdim, // vector dimension bool is_sparse_vector, // true if A is a sparse GrB_Vector // the 5 arrays: - GrB_Index **Ap, // pointers, for sparse and hypersparse formats. - GrB_Index Ap_size, // size of Ap in bytes + uint64_t **Ap, // pointers, for sparse and hypersparse formats. + uint64_t Ap_size, // size of Ap in bytes - GrB_Index **Ah, // vector indices for hypersparse matrices - GrB_Index Ah_size, // size of Ah in bytes + uint64_t **Ah, // vector indices for hypersparse matrices + uint64_t Ah_size, // size of Ah in bytes int8_t **Ab, // bitmap, for bitmap format only. - GrB_Index Ab_size, // size of Ab in bytes + uint64_t Ab_size, // size of Ab in bytes - GrB_Index **Ai, // indices for hyper and sparse formats - GrB_Index Ai_size, // size of Ai in bytes + uint64_t **Ai, // indices for hyper and sparse formats + uint64_t Ai_size, // size of Ai in bytes void **Ax, // values - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes // additional information for specific formats: - GrB_Index nvals, // # of entries for bitmap format, or for a vector + uint64_t nvals, // # of entries for bitmap format, or for a vector // in CSC format. bool jumbled, // if true, sparse/hypersparse may be jumbled. - GrB_Index nvec, // size of Ah for hypersparse format. + uint64_t nvec, // size of Ah for hypersparse format. // information for all formats: int sparsity, // hypersparse, sparse, bitmap, or full @@ -67,11 +67,13 @@ GrB_Info GB_import // import/pack a matrix in any format if (!packing) { + // GxB*import and GrB*import: A is created by this method, including + // the header. The GxB methods for packing == false are deprecated. (*A) = NULL ; } GB_RETURN_IF_NULL_OR_FAULTY (type) ; - if (vlen > GB_NMAX || vdim > GB_NMAX || nvals > GB_NMAX || nvec > GB_NMAX + if (vlen > GB_NMAX || vdim > GB_NMAX || nvals > GB_NMAX || nvec > GB_NMAX || Ap_size > GB_NMAX || Ah_size > GB_NMAX || Ab_size > GB_NMAX || Ai_size > GB_NMAX || Ax_size > GB_NMAX) { @@ -89,7 +91,7 @@ GrB_Info GB_import // import/pack a matrix in any format int64_t full_size = 0, Ax_size_for_non_iso ; if (sparsity == GxB_BITMAP || sparsity == GxB_FULL) { - ok = GB_int64_multiply ((GrB_Index *) (&full_size), vlen, vdim) ; + ok = GB_int64_multiply ((uint64_t *) (&full_size), vlen, vdim) ; if (!ok) full_size = INT64_MAX ; } @@ -98,7 +100,7 @@ GrB_Info GB_import // import/pack a matrix in any format case GxB_HYPERSPARSE : // check Ap and get nvals if (nvec > vdim) return (GrB_INVALID_VALUE) ; - if (Ap_size < (((vdim == 1) ? 1 : nvec)+1) * sizeof (int64_t)) + if (Ap_size < (((vdim == 1) ? 1 : nvec)+1) * sizeof (uint64_t)) { return (GrB_INVALID_VALUE) ; } @@ -108,7 +110,7 @@ GrB_Info GB_import // import/pack a matrix in any format // check Ah GB_RETURN_IF_NULL (Ah) ; GB_RETURN_IF_NULL (*Ah) ; - if (Ah_size < nvec * sizeof (int64_t)) + if (Ah_size < nvec * sizeof (uint64_t)) { return (GrB_INVALID_VALUE) ; } @@ -118,7 +120,7 @@ GrB_Info GB_import // import/pack a matrix in any format GB_RETURN_IF_NULL (Ai) ; GB_RETURN_IF_NULL (*Ai) ; } - if (Ai_size < nvals * sizeof (int64_t)) + if (Ai_size < nvals * sizeof (uint64_t)) { return (GrB_INVALID_VALUE) ; } @@ -132,7 +134,7 @@ GrB_Info GB_import // import/pack a matrix in any format // GxB_Vector_import_CSC passes in Ap as a NULL, and nvals as // the # of entries in the vector. All other uses of GB_import // pass in Ap for the sparse case - if (Ap_size < (vdim+1) * sizeof (int64_t)) + if (Ap_size < (vdim+1) * sizeof (uint64_t)) { return (GrB_INVALID_VALUE) ; } @@ -146,7 +148,7 @@ GrB_Info GB_import // import/pack a matrix in any format GB_RETURN_IF_NULL (Ai) ; GB_RETURN_IF_NULL (*Ai) ; } - if (Ai_size < nvals * sizeof (int64_t)) + if (Ai_size < nvals * sizeof (uint64_t)) { return (GrB_INVALID_VALUE) ; } @@ -202,13 +204,14 @@ GrB_Info GB_import // import/pack a matrix in any format { // clear the content and reuse the header GB_phybix_free (*A) ; - ASSERT (!((*A)->static_header)) ; + ASSERT (!((*A)->header_size == 0)) ; } // also create A->p if this is a sparse GrB_Vector GrB_Info info = GB_new (A, // any sparsity, new or existing user header - type, vlen, vdim, is_sparse_vector ? GB_Ap_calloc : GB_Ap_null, - is_csc, sparsity, GB_Global_hyper_switch_get ( ), nvec) ; + type, vlen, vdim, is_sparse_vector ? GB_ph_calloc : GB_ph_null, + is_csc, sparsity, GB_Global_hyper_switch_get ( ), nvec, + /* OK, import as all-64-bit: */ false, false, false) ; if (info != GrB_SUCCESS) { // out of memory @@ -216,7 +219,7 @@ GrB_Info GB_import // import/pack a matrix in any format } // A never has a static header - ASSERT (!((*A)->static_header)) ; + ASSERT (!((*A)->header_size == 0)) ; //-------------------------------------------------------------------------- // import the matrix @@ -232,54 +235,49 @@ GrB_Info GB_import // import/pack a matrix in any format (*A)->nvec = nvec ; // import A->h, then fall through to sparse case - (*A)->h = (int64_t *) (*Ah) ; (*Ah) = NULL ; + (*A)->h = (*Ah) ; (*Ah) = NULL ; (*A)->h_size = Ah_size ; if (add_to_memtable) { // for debugging only - #ifdef GB_MEMDUMP - printf ("import A->h to memtable: %p\n", (*A)->h) ; // MEMDUMP - #endif + GBMDUMP ("import A->h to memtable: %p\n", (*A)->h) ; GB_Global_memtable_add ((*A)->h, (*A)->h_size) ; } // fall through to the sparse case case GxB_SPARSE : (*A)->jumbled = jumbled ; // import jumbled status - (*A)->nvec_nonempty = -1 ; // not computed; delay until required +// (*A)->nvec_nonempty = -1 ; // not computed; delay until required + GB_nvec_nonempty_set (*A, -1) ; // not computed until required + (*A)->nvals = nvals ; if (is_sparse_vector) { // GxB_Vector_import_CSC passes in Ap as NULL - (*A)->p [1] = nvals ; + uint64_t *restrict Ap = (*A)->p ; // OK; 64-bit only + Ap [1] = nvals ; } else { // import A->p, unless already created for a sparse CSC vector - (*A)->p = (int64_t *) (*Ap) ; (*Ap) = NULL ; + (*A)->p = (*Ap) ; (*Ap) = NULL ; // OK; 64-bit only (*A)->p_size = Ap_size ; if (add_to_memtable) { // for debugging only - #ifdef GB_MEMDUMP - printf ("import A->p to memtable: %p\n", // MEMDUMP - (*A)->p) ; - #endif + GBMDUMP ("import A->p to memtable: %p\n", (*A)->p) ; GB_Global_memtable_add ((*A)->p, (*A)->p_size) ; } } // import A->i - (*A)->i = (int64_t *) (*Ai) ; (*Ai) = NULL ; + (*A)->i = (*Ai) ; (*Ai) = NULL ; // OK; 64-bit only (*A)->i_size = Ai_size ; if (add_to_memtable) { // for debugging only - #ifdef GB_MEMDUMP - printf ("import A->i to memtable: %p\n", // MEMDUMP - (*A)->i) ; - #endif + GBMDUMP ("import A->i to memtable: %p\n", (*A)->i) ; GB_Global_memtable_add ((*A)->i, (*A)->i_size) ; } break ; @@ -293,10 +291,7 @@ GrB_Info GB_import // import/pack a matrix in any format if (add_to_memtable) { // for debugging only - #ifdef GB_MEMDUMP - printf ("import A->b to memtable: %p\n", // MEMDUMP - (*A)->b) ; - #endif + GBMDUMP ("import A->b to memtable: %p\n", (*A)->b) ; GB_Global_memtable_add ((*A)->b, (*A)->b_size) ; } break ; @@ -315,10 +310,7 @@ GrB_Info GB_import // import/pack a matrix in any format if (add_to_memtable) { // for debugging only - #ifdef GB_MEMDUMP - printf ("import A->x to memtable: %p size: %lu\n", // MEMDUMP - (*A)->x, Ax_size) ; - #endif + GBMDUMP ("import A->x to memtable: %p\n", (*A)->x) ; GB_Global_memtable_add ((*A)->x, (*A)->x_size) ; } } diff --git a/GraphBLAS/Source/import_export/GrB_Matrix_export.c b/GraphBLAS/Source/import_export/GrB_Matrix_export.c index f51854a132..6c63a9d9a1 100644 --- a/GraphBLAS/Source/import_export/GrB_Matrix_export.c +++ b/GraphBLAS/Source/import_export/GrB_Matrix_export.c @@ -2,7 +2,7 @@ // GrB_Matrix_export: export a matrix in CSR, CSC, FullC, FullR, or COO format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,13 +37,13 @@ static GrB_Info GB_export_worker // export a matrix ( - GrB_Index *Ap, // pointers for CSR, CSC, row indices for COO - GrB_Index *Ai, // row indices for CSR, CSC, col indices for COO + uint64_t *Ap, // pointers for CSR, CSC, row indices for COO + uint64_t *Ai, // row indices for CSR, CSC, col indices for COO void *Ax, // values (must match the type of A_input) - GrB_Index *Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index *Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index *Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // export format + uint64_t *Ap_len, // number of entries in Ap (not # of bytes) + uint64_t *Ai_len, // number of entries in Ai (not # of bytes) + uint64_t *Ax_len, // number of entries in Ax (not # of bytes) + int format, // export format GrB_Matrix A_input, // matrix to export GB_Werk Werk ) @@ -131,7 +131,7 @@ static GrB_Info GB_export_worker // export a matrix if (make_copy) { - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; if (is_csc != csc_requested) { // T = A' @@ -166,8 +166,10 @@ static GrB_Info GB_export_worker // export a matrix int nthreads_max = GB_Context_nthreads_max ( ) ; - GrB_Index nvals = GB_nnz (A) ; + uint64_t nvals = GB_nnz (A) ; int64_t plen = A->vdim+1 ; + GB_Type_code apcode = (A->p_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code aicode = (A->i_is_32) ? GB_UINT32_code : GB_UINT64_code ; switch (format) { @@ -178,8 +180,10 @@ static GrB_Info GB_export_worker // export a matrix GB_FREE_ALL ; return (GrB_INSUFFICIENT_SPACE) ; } - GB_memcpy (Ap, A->p, plen * sizeof (GrB_Index), nthreads_max) ; - GB_memcpy (Ai, A->i, nvals * sizeof (GrB_Index), nthreads_max) ; +// GB_memcpy (Ap, A->p, plen * sizeof (uint64_t), nthreads_max) ; + GB_cast_int (Ap, GB_UINT64_code, A->p, apcode, plen, nthreads_max) ; +// GB_memcpy (Ai, A->i, nvals * sizeof (uint64_t), nthreads_max) ; + GB_cast_int (Ai, GB_UINT64_code, A->i, aicode, nvals, nthreads_max); (*Ap_len) = plen ; (*Ai_len) = nvals ; @@ -211,7 +215,10 @@ static GrB_Info GB_export_worker // export a matrix GB_FREE_ALL ; return (GrB_INSUFFICIENT_SPACE) ; } - GB_OK (GB_extractTuples (Ap, Ai, Ax, &nvals, A->type, A, Werk)) ; + GB_OK (GB_extractTuples ( + Ap, /* OK; 64-bit only: */ false, + Ai, /* OK; 64-bit only: */ false, + Ax, &nvals, A->type, A, Werk)) ; (*Ap_len) = nvals ; (*Ai_len) = nvals ; (*Ax_len) = nvals ; @@ -237,24 +244,22 @@ static GrB_Info GB_export_worker // export a matrix #define GB_EXPORT(prefix,ctype,Type,acode) \ GrB_Info GB_EVAL3 (prefix, _Matrix_export_, Type) /* export a matrix */ \ ( \ - GrB_Index *Ap, /* pointers for CSR, CSC, row indices for COO */\ - GrB_Index *Ai, /* row indices for CSR, CSC, col indices for COO */\ + uint64_t *Ap, /* pointers for CSR, CSC, row indices for COO */\ + uint64_t *Ai, /* row indices for CSR, CSC, col indices for COO */\ ctype *Ax, /* values (must match the type of A) */\ - GrB_Index *Ap_len, /* number of entries in Ap (not # of bytes) */\ - GrB_Index *Ai_len, /* number of entries in Ai (not # of bytes) */\ - GrB_Index *Ax_len, /* number of entries in Ax (not # of bytes) */\ - GrB_Format format, /* export format */\ + uint64_t *Ap_len, /* number of entries in Ap (not # of bytes) */\ + uint64_t *Ai_len, /* number of entries in Ai (not # of bytes) */\ + uint64_t *Ax_len, /* number of entries in Ax (not # of bytes) */\ + int format, /* export format */\ GrB_Matrix A /* matrix to export */\ ) \ { \ - GB_WHERE1 (GB_STR(prefix) "_Matrix_export_" GB_STR(Type) \ + GB_WHERE_1 (A, GB_STR(prefix) "_Matrix_export_" GB_STR(Type) \ " (Ap, Ai, Ax, &Ap_len, &Ai_len, &Ax_len, format, A)") ; \ -/* GB_BURBLE_START (GB_STR(prefix) "_Matrix_export_" GB_STR(Type)) ; */ \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ + GB_RETURN_IF_NULL (A) ; \ if (A->type->code != acode) return (GrB_DOMAIN_MISMATCH) ; \ - GrB_Info info = GB_export_worker (Ap, Ai, (void *) Ax, \ + info = GB_export_worker (Ap, Ai, (void *) Ax, \ Ap_len, Ai_len, Ax_len, format, A, Werk) ; \ -/* GB_BURBLE_END ; */ \ return (info) ; \ } diff --git a/GraphBLAS/Source/import_export/GrB_Matrix_exportHint.c b/GraphBLAS/Source/import_export/GrB_Matrix_exportHint.c index a3ddab6273..bf1e4da051 100644 --- a/GraphBLAS/Source/import_export/GrB_Matrix_exportHint.c +++ b/GraphBLAS/Source/import_export/GrB_Matrix_exportHint.c @@ -2,7 +2,7 @@ // GrB_Matrix_exportHint: determine sizes of arrays for GrB_Matrix_export //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format ( - GrB_Format *format, // export format + int *format, // export format GrB_Matrix A // matrix to export ) { @@ -21,10 +21,9 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_exportHint (&format, A)") ; - // GB_BURBLE_START ("GrB_Matrix_exportHint") ; GB_RETURN_IF_NULL (format) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_exportHint (&format, A)") ; // finish any pending work since this can change the sparsity of A GB_MATRIX_WAIT (A) ; @@ -63,7 +62,6 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format break ; } - // GB_BURBLE_END ; #pragma omp flush return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/import_export/GrB_Matrix_exportSize.c b/GraphBLAS/Source/import_export/GrB_Matrix_exportSize.c index 49731b21dc..cc868392a0 100644 --- a/GraphBLAS/Source/import_export/GrB_Matrix_exportSize.c +++ b/GraphBLAS/Source/import_export/GrB_Matrix_exportSize.c @@ -2,7 +2,7 @@ // GrB_Matrix_exportSize: determine sizes of arrays for GrB_Matrix_export //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,10 +12,10 @@ GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export ( - GrB_Index *Ap_len, // # of entries required for Ap (not # of bytes) - GrB_Index *Ai_len, // # of entries required for Ai (not # of bytes) - GrB_Index *Ax_len, // # of entries required for Ax (not # of bytes) - GrB_Format format, // export format + uint64_t *Ap_len, // # of entries required for Ap (not # of bytes) + uint64_t *Ai_len, // # of entries required for Ai (not # of bytes) + uint64_t *Ax_len, // # of entries required for Ax (not # of bytes) + int format, // export format GrB_Matrix A // matrix to export ) { @@ -24,14 +24,14 @@ GrB_Info GrB_Matrix_exportSize // determine sizes of user arrays for export // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_exportSize (&Ap_len, &Ai_len, &Ax_len, format, A)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_WHERE_1 (A, "GrB_Matrix_exportSize " + "(&Ap_len, &Ai_len, &Ax_len, format, A)") ; + GB_RETURN_IF_NULL (A) ; GB_RETURN_IF_NULL (Ap_len) ; GB_RETURN_IF_NULL (Ai_len) ; GB_RETURN_IF_NULL (Ax_len) ; - GrB_Info info ; - GrB_Index nvals ; + uint64_t nvals ; GB_OK (GB_nvals (&nvals, A, Werk)) ; (*Ax_len) = nvals ; diff --git a/GraphBLAS/Source/import_export/GrB_Matrix_import.c b/GraphBLAS/Source/import_export/GrB_Matrix_import.c index 5d3b331269..cf106db10b 100644 --- a/GraphBLAS/Source/import_export/GrB_Matrix_import.c +++ b/GraphBLAS/Source/import_export/GrB_Matrix_import.c @@ -2,7 +2,7 @@ // GrB_Matrix_import: import a matrix in CSR, CSC, FullC, FullR, or COO format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,9 +16,9 @@ #define GB_FREE_ALL \ { \ GB_Matrix_free (A) ; \ - GB_FREE (&Ap_copy, Ap_size) ; \ - GB_FREE (&Ai_copy, Ai_size) ; \ - GB_FREE (&Ax_copy, Ax_size) ; \ + GB_FREE_MEMORY (&Ap_copy, Ap_size) ; \ + GB_FREE_MEMORY (&Ai_copy, Ai_size) ; \ + GB_FREE_MEMORY (&Ax_copy, Ax_size) ; \ } //------------------------------------------------------------------------------ @@ -29,15 +29,15 @@ static GrB_Info GB_import_worker // import a matrix of any type ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - const GrB_Index *Ap, // pointers for CSR, CSC, row indices for COO - const GrB_Index *Ai, // row indices for CSR, CSC, col indices for COO + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix + const uint64_t *Ap, // pointers for CSR, CSC, row indices for COO + const uint64_t *Ai, // row indices for CSR, CSC, col indices for COO const void *Ax, // values (must match the GrB_Type type parameter) - GrB_Index Ap_len, // number of entries in Ap (not # of bytes) - GrB_Index Ai_len, // number of entries in Ai (not # of bytes) - GrB_Index Ax_len, // number of entries in Ax (not # of bytes) - GrB_Format format, // import format + uint64_t Ap_len, // number of entries in Ap (not # of bytes) + uint64_t Ai_len, // number of entries in Ai (not # of bytes) + uint64_t Ax_len, // number of entries in Ax (not # of bytes) + int format, // import format GB_Werk Werk ) { @@ -62,7 +62,7 @@ static GrB_Info GB_import_worker // import a matrix of any type return (GrB_INVALID_VALUE) ; } - GrB_Index nvals = 0 ; + uint64_t nvals = 0 ; bool ok = true ; int64_t plen = (format == GrB_CSR_FORMAT) ? (nrows+1) : (ncols+1) ; @@ -120,12 +120,12 @@ static GrB_Info GB_import_worker // import a matrix of any type // allocate copies of Ap, Ai, and Ax to be imported //-------------------------------------------------------------------------- - GrB_Index *Ap_copy = NULL ; size_t Ap_size = 0 ; - GrB_Index *Ai_copy = NULL ; size_t Ai_size = 0 ; - GB_void *Ax_copy = NULL ; size_t Ax_size = 0 ; + uint64_t *Ap_copy = NULL ; size_t Ap_size = 0 ; + uint64_t *Ai_copy = NULL ; size_t Ai_size = 0 ; + GB_void *Ax_copy = NULL ; size_t Ax_size = 0 ; size_t typesize = type->size ; - // Ap_copy, Ai_copy, Ax_copy are GB_MALLOC'ed so they are already in the + // Ap_copy, Ai_copy, Ax_copy are malloc'ed so they are already in the // debug memtable. Thus, GB_import does not add them again to the // memtable (with add_to_memtable set to false). @@ -133,15 +133,15 @@ static GrB_Info GB_import_worker // import a matrix of any type { case GrB_CSR_FORMAT : case GrB_CSC_FORMAT : - Ap_copy = GB_MALLOC (plen, GrB_Index, &Ap_size) ; - Ai_copy = GB_MALLOC (nvals, GrB_Index, &Ai_size) ; - Ax_copy = GB_MALLOC (nvals*typesize, GB_void, &Ax_size) ; // x:OK + Ap_copy = GB_MALLOC_MEMORY (plen, sizeof (uint64_t), &Ap_size) ; + Ai_copy = GB_MALLOC_MEMORY (nvals, sizeof (uint64_t), &Ai_size) ; + Ax_copy = GB_MALLOC_MEMORY (nvals, typesize, &Ax_size) ; ok = (Ap_copy != NULL && Ai_copy != NULL && Ax_copy != NULL) ; break ; // case GrB_DENSE_ROW_FORMAT : // case GrB_DENSE_COL_FORMAT : -// Ax_copy = GB_MALLOC (nvals*typesize, GB_void, &Ax_size) ; // x:OK +// Ax_copy = GB_MALLOC_MEMORY (nvals, typesize, &Ax_size) ; // ok = (Ax_copy != NULL) ; // break ; @@ -170,8 +170,8 @@ static GrB_Info GB_import_worker // import a matrix of any type { case GrB_CSR_FORMAT : case GrB_CSC_FORMAT : - GB_memcpy (Ap_copy, Ap, plen * sizeof (GrB_Index), nthreads_max) ; - GB_memcpy (Ai_copy, Ai, nvals * sizeof (GrB_Index), nthreads_max) ; + GB_memcpy (Ap_copy, Ap, plen * sizeof (uint64_t), nthreads_max) ; + GB_memcpy (Ai_copy, Ai, nvals * sizeof (uint64_t), nthreads_max) ; // case GrB_DENSE_ROW_FORMAT : // case GrB_DENSE_COL_FORMAT : GB_memcpy (Ax_copy, Ax, nvals * typesize , nthreads_max) ; @@ -258,8 +258,8 @@ static GrB_Info GB_import_worker // import a matrix of any type default : // GrB_COO_FORMAT { // build A as hypersparse by row or by column - int64_t *no_I_work = NULL ; size_t I_work_size = 0 ; - int64_t *no_J_work = NULL ; size_t J_work_size = 0 ; + void *no_I_work = NULL ; size_t I_work_size = 0 ; + void *no_J_work = NULL ; size_t J_work_size = 0 ; GB_void *no_X_work = NULL ; size_t X_work_size = 0 ; bool is_csc = GB_Global_is_csc_get ( ) ; int64_t vlen = is_csc ? nrows : ncols ; @@ -267,8 +267,9 @@ static GrB_Info GB_import_worker // import a matrix of any type // allocate the header for A GB_OK (GB_new (A, // new header - type, vlen, vdim, GB_Ap_null, is_csc, GxB_AUTO_SPARSITY, - GB_Global_hyper_switch_get ( ), 0)) ; + type, vlen, vdim, GB_ph_null, is_csc, GxB_AUTO_SPARSITY, + GB_Global_hyper_switch_get ( ), 0, + /* OK; 64-bit only: */ false, false, false)) ; // build A from the input triplets GB_OK (GB_builder ( @@ -287,15 +288,16 @@ static GrB_Info GB_import_worker // import a matrix of any type false, // known_no_duplicates: not yet known 0, // I_work, J_work, and X_work not used here true, // A is a GrB_Matrix - (int64_t *) (is_csc ? Ap : Ai), // row/col indices - (int64_t *) (is_csc ? Ai : Ap), // col/row indices + is_csc ? Ap : Ai, // row/col indices + is_csc ? Ai : Ap, // col/row indices (const GB_void *) Ax, // values false, // matrix is not iso nvals, // number of tuples NULL, // implicit SECOND operator for duplicates type, // type of the X array true, // burble is allowed - Werk + Werk, + false, false, false, false, false // OK; 64-bit only )) ; } break ; @@ -312,7 +314,7 @@ static GrB_Info GB_import_worker // import a matrix of any type // All entries in A are the same; convert A to iso GBURBLE ("(import post iso) ") ; (*A)->iso = true ; - GB_OK (GB_convert_any_to_iso (*A, NULL)) ; + GB_OK (GB_convert_any_to_iso (*A, NULL)) ; // OK } //-------------------------------------------------------------------------- @@ -333,25 +335,23 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_import_, T) /* import a matrix */ \ ( \ GrB_Matrix *A, /* handle of matrix to create */\ GrB_Type type, /* type of matrix to create */\ - GrB_Index nrows, /* number of rows of the matrix */\ - GrB_Index ncols, /* number of columns of the matrix */\ - const GrB_Index *Ap, /* pointers for CSR, CSC, row indices for COO */\ - const GrB_Index *Ai, /* row indices for CSR, CSC, col indices for COO */\ + uint64_t nrows, /* number of rows of the matrix */\ + uint64_t ncols, /* number of columns of the matrix */\ + const uint64_t *Ap, /* pointers for CSR, CSC, row indices for COO */\ + const uint64_t *Ai, /* row indices for CSR, CSC, col indices for COO */\ const ctype *Ax, /* values (must match GrB_Type type parameter) */\ - GrB_Index Ap_len, /* number of entries in Ap (not # of bytes) */\ - GrB_Index Ai_len, /* number of entries in Ai (not # of bytes) */\ - GrB_Index Ax_len, /* number of entries in Ax (not # of bytes) */\ - GrB_Format format /* import format */\ + uint64_t Ap_len, /* number of entries in Ap (not # of bytes) */\ + uint64_t Ai_len, /* number of entries in Ai (not # of bytes) */\ + uint64_t Ax_len, /* number of entries in Ax (not # of bytes) */\ + int format /* import format */\ ) \ { \ - GB_WHERE1 (GB_STR(prefix) "_Matrix_import_" GB_STR(T) " (&A, type, nrows," \ + GB_WHERE0 (GB_STR(prefix) "_Matrix_import_" GB_STR(T) " (&A, type, nrows," \ " ncols, Ap, Ai, Ax, Ap_len, Ai_len, Ax_len, format)") ; \ -/* GB_BURBLE_START (GB_STR(prefix) "_Matrix_import_" GB_STR(T)) ; */ \ GB_RETURN_IF_NULL_OR_FAULTY (type) ; \ if (type->code != acode) return (GrB_DOMAIN_MISMATCH) ; \ - GrB_Info info = GB_import_worker (A, type, nrows, ncols, Ap, Ai, \ + info = GB_import_worker (A, type, nrows, ncols, Ap, Ai, \ (const void *) Ax, Ap_len, Ai_len, Ax_len, format, Werk) ; \ -/* GB_BURBLE_END ; */ \ return (info) ; \ } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapC.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapC.c index 825f987cb1..070905d298 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapC.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_BitmapC: export a bitmap matrix, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,16 +15,16 @@ GrB_Info GxB_Matrix_export_BitmapC // export and free a bitmap matrix, by col ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix int8_t **Ab, // bitmap void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ab_size, // size of Ab in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -33,11 +33,11 @@ GrB_Info GxB_Matrix_export_BitmapC // export and free a bitmap matrix, by col // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_BitmapC (&A, &type, &nrows, &ncols, " - "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_BitmapC") ; GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_BitmapC (&A, &type, &nrows, &ncols, " + "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; + GB_RETURN_IF_NULL (*A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -48,7 +48,6 @@ GrB_Info GxB_Matrix_export_BitmapC // export and free a bitmap matrix, by col if (!((*A)->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, true, Werk)) ; } @@ -82,7 +81,6 @@ GrB_Info GxB_Matrix_export_BitmapC // export and free a bitmap matrix, by col ASSERT (sparsity == GxB_BITMAP) ; ASSERT (is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapR.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapR.c index acfbbc5e43..2de6c34a4d 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_BitmapR.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_BitmapR: export a bitmap matrix, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,16 +15,16 @@ GrB_Info GxB_Matrix_export_BitmapR // export and free a bitmap matrix, by row ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix int8_t **Ab, // bitmap void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ab_size, // size of Ab in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -33,11 +33,10 @@ GrB_Info GxB_Matrix_export_BitmapR // export and free a bitmap matrix, by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_BitmapR (&A, &type, &nrows, &ncols, " - "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_BitmapR") ; GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_BitmapR (&A, &type, &nrows, &ncols, " + "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; + GB_RETURN_IF_NULL (*A) ; GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -48,7 +47,6 @@ GrB_Info GxB_Matrix_export_BitmapR // export and free a bitmap matrix, by row if ((*A)->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, false, Werk)) ; } @@ -82,7 +80,6 @@ GrB_Info GxB_Matrix_export_BitmapR // export and free a bitmap matrix, by row ASSERT (sparsity == GxB_BITMAP) ; ASSERT (!is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_CSC.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_CSC.c index 53afe49e20..037438ada9 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_CSC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_CSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_CSC: export a matrix in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,15 +15,15 @@ GrB_Info GxB_Matrix_export_CSC // export and free a CSC matrix ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ai_size, // size of Ai in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso bool *jumbled, // if true, indices in each column may be unsorted @@ -35,12 +35,12 @@ GrB_Info GxB_Matrix_export_CSC // export and free a CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_CSC (&A, &type, &nrows, &ncols, " + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_CSC (&A, &type, &nrows, &ncols, " "&Ap, &Ai, &Ax, &Ap_size, &Ai_size, &Ax_size, &iso, " "&jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_CSC") ; - GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; ASSERT_MATRIX_OK (*A, "A to export as by-col", GB0) ; @@ -51,7 +51,6 @@ GrB_Info GxB_Matrix_export_CSC // export and free a CSC matrix if (!((*A)->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, true, Werk)) ; } @@ -104,7 +103,6 @@ GrB_Info GxB_Matrix_export_CSC // export and free a CSC matrix ASSERT (sparsity == GxB_SPARSE) ; ASSERT (is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_CSR.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_CSR.c index edb919d0ca..e41978b5ca 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_CSR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_CSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_CSR: export a matrix in CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,15 +15,15 @@ GrB_Info GxB_Matrix_export_CSR // export and free a CSR matrix ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Aj_size, // size of Aj in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso bool *jumbled, // if true, indices in each row may be unsorted @@ -35,12 +35,12 @@ GrB_Info GxB_Matrix_export_CSR // export and free a CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_CSR (&A, &type, &nrows, &ncols, " + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_CSR (&A, &type, &nrows, &ncols, " "&Ap, &Aj, &Ax, &Ap_size, &Aj_size, &Ax_size, &iso, " "&jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_CSR") ; - GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; ASSERT_MATRIX_OK (*A, "A to export as CSR", GB0) ; @@ -51,7 +51,6 @@ GrB_Info GxB_Matrix_export_CSR // export and free a CSR matrix if ((*A)->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, false, Werk)) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_FullC.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_FullC.c index 43e8443032..6343892573 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_FullC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_FullC.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_FullC: export a full matrix, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,11 +15,11 @@ GrB_Info GxB_Matrix_export_FullC // export and free a full matrix, by column ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso const GrB_Descriptor desc @@ -30,11 +30,11 @@ GrB_Info GxB_Matrix_export_FullC // export and free a full matrix, by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_FullC (&A, &type, &nrows, &ncols, " - "&Ax, &Ax_size, &iso, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_FullC") ; GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_FullC (&A, &type, &nrows, &ncols, " + "&Ax, &Ax_size, &iso, desc)") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -56,7 +56,6 @@ GrB_Info GxB_Matrix_export_FullC // export and free a full matrix, by column if (!((*A)->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, true, Werk)) ; GB_MATRIX_WAIT (*A) ; } @@ -91,7 +90,6 @@ GrB_Info GxB_Matrix_export_FullC // export and free a full matrix, by column ASSERT (sparsity == GxB_FULL) ; ASSERT (is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_FullR.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_FullR.c index 93579b6aff..4a071da589 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_FullR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_FullR.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_FullR: export a full matrix, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,11 +15,11 @@ GrB_Info GxB_Matrix_export_FullR // export and free a full matrix, by row ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso const GrB_Descriptor desc @@ -30,11 +30,11 @@ GrB_Info GxB_Matrix_export_FullR // export and free a full matrix, by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_FullR (&A, &type, &nrows, &ncols, " - "&Ax, &Ax_size, &iso, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_FullR") ; GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_FullR (&A, &type, &nrows, &ncols, " + "&Ax, &Ax_size, &iso, desc)") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -56,7 +56,6 @@ GrB_Info GxB_Matrix_export_FullR // export and free a full matrix, by row if ((*A)->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, false, Werk)) ; GB_MATRIX_WAIT (*A) ; } @@ -91,7 +90,6 @@ GrB_Info GxB_Matrix_export_FullR // export and free a full matrix, by row ASSERT (sparsity == GxB_FULL) ; ASSERT (!is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSC.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSC.c index bb81925dbc..79f8aa9508 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_HyperCSC: export a matrix in hypersparse CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,20 +15,20 @@ GrB_Info GxB_Matrix_export_HyperCSC // export and free a hypersparse CSC matrix ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ah, // column indices + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ah_size, // size of Ah in bytes + uint64_t *Ai_size, // size of Ai in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah + uint64_t *nvec, // number of columns that appear in Ah bool *jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc ) @@ -38,12 +38,12 @@ GrB_Info GxB_Matrix_export_HyperCSC // export and free a hypersparse CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_HyperCSC (&A, &type, &nrows, &ncols, " + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_HyperCSC (&A, &type, &nrows, &ncols, " "&Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, " "&iso, &nvec, &jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_HyperCSC") ; - GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -53,7 +53,6 @@ GrB_Info GxB_Matrix_export_HyperCSC // export and free a hypersparse CSC matrix if (!((*A)->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, true, Werk)) ; } @@ -106,7 +105,6 @@ GrB_Info GxB_Matrix_export_HyperCSC // export and free a hypersparse CSC matrix ASSERT (sparsity == GxB_HYPERSPARSE) ; ASSERT (is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSR.c b/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSR.c index 4b0556e826..46e5eb0283 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_export_HyperCSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_export_HyperCSR: export a matrix in hypersparse CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,20 +15,20 @@ GrB_Info GxB_Matrix_export_HyperCSR // export and free a hypersparse CSR matrix ( GrB_Matrix *A, // handle of matrix to export and free GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix + uint64_t *nrows, // number of rows of the matrix + uint64_t *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Ah, // row indices + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ah_size, // size of Ah in bytes + uint64_t *Aj_size, // size of Aj in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah + uint64_t *nvec, // number of rows that appear in Ah bool *jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc ) @@ -38,12 +38,12 @@ GrB_Info GxB_Matrix_export_HyperCSR // export and free a hypersparse CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_export_HyperCSR (&A, &type, &nrows, &ncols, " + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (*A) ; + GB_WHERE_1 (*A, "GxB_Matrix_export_HyperCSR (&A, &type, &nrows, &ncols, " "&Ap, &Ah, &Aj, &Ax, &Ap_size, &Ah_size, &Aj_size, &Ax_size, " "&iso, &nvec, &jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_export_HyperCSR") ; - GB_RETURN_IF_NULL (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (*A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -53,7 +53,6 @@ GrB_Info GxB_Matrix_export_HyperCSR // export and free a hypersparse CSR matrix if ((*A)->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(export transpose) ") ; GB_OK (GB_transpose_in_place (*A, false, Werk)) ; } @@ -106,7 +105,6 @@ GrB_Info GxB_Matrix_export_HyperCSR // export and free a hypersparse CSR matrix ASSERT (sparsity == GxB_HYPERSPARSE) ; ASSERT (!is_csc) ; } - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapC.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapC.c index e2edabd3e0..039d9b988e 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapC.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_BitmapC: import a matrix in bitmap format, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,16 +13,16 @@ GrB_Info GxB_Matrix_import_BitmapC // import a bitmap matrix, held by column ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix int8_t **Ab, // bitmap void **Ax, // values - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ab_size, // size of Ab in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -31,9 +31,9 @@ GrB_Info GxB_Matrix_import_BitmapC // import a bitmap matrix, held by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_BitmapC (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_BitmapC (&A, type, nrows, ncols, " "&Ab, &Ax, Ab_size, Ax_size, iso, nvals, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_BitmapC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -51,7 +51,6 @@ GrB_Info GxB_Matrix_import_BitmapC // import a bitmap matrix, held by column GxB_BITMAP, true, // bitmap by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapR.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapR.c index 07c139ba2b..787fdfb086 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_BitmapR.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_BitmapR: import a matrix in bitmap format, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,16 +13,16 @@ GrB_Info GxB_Matrix_import_BitmapR // import a bitmap matrix, held by row ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix int8_t **Ab, // bitmap void **Ax, // values - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ab_size, // size of Ab in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -31,9 +31,9 @@ GrB_Info GxB_Matrix_import_BitmapR // import a bitmap matrix, held by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_BitmapR (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_BitmapR (&A, type, nrows, ncols, " "&Ab, &Ax, Ab_size, Ax_size, iso, nvals, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_BitmapR") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -51,7 +51,6 @@ GrB_Info GxB_Matrix_import_BitmapR // import a bitmap matrix, held by row GxB_BITMAP, false, // bitmap by row iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_CSC.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_CSC.c index 1e61780ab2..06e6fe9d64 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_CSC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_CSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_CSC: import a matrix in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,15 +13,15 @@ GrB_Info GxB_Matrix_import_CSC // import a CSC matrix ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ai_size, // size of Ai in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso bool jumbled, // if true, indices in each column may be unsorted @@ -33,10 +33,10 @@ GrB_Info GxB_Matrix_import_CSC // import a CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_CSC (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_CSC (&A, type, nrows, ncols, " "&Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, iso, " "jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_CSC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -54,7 +54,6 @@ GrB_Info GxB_Matrix_import_CSC // import a CSC matrix GxB_SPARSE, true, // sparse by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_CSR.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_CSR.c index 48ada1482c..3523e877ca 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_CSR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_CSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_CSR: import a matrix in CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,15 +13,15 @@ GrB_Info GxB_Matrix_import_CSR // import a CSR matrix ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Aj_size, // size of Aj in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso bool jumbled, // if true, indices in each row may be unsorted @@ -33,10 +33,10 @@ GrB_Info GxB_Matrix_import_CSR // import a CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_CSR (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_CSR (&A, type, nrows, ncols, " "&Ap, &Aj, &Ax, Ap_size, Aj_size, Ax_size, iso, " "jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_CSR") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -54,7 +54,6 @@ GrB_Info GxB_Matrix_import_CSR // import a CSR matrix GxB_SPARSE, false, // sparse by row iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_FullC.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_FullC.c index 8fb7324123..73a8e3f294 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_FullC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_FullC.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_FullC: import a matrix in full format, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,11 +13,11 @@ GrB_Info GxB_Matrix_import_FullC // import a full matrix, held by column ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix void **Ax, // values - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso const GrB_Descriptor desc @@ -28,9 +28,9 @@ GrB_Info GxB_Matrix_import_FullC // import a full matrix, held by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_FullC (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_FullC (&A, type, nrows, ncols, " "&Ax, Ax_size, iso, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_FullC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -48,7 +48,6 @@ GrB_Info GxB_Matrix_import_FullC // import a full matrix, held by column GxB_FULL, true, // full by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_FullR.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_FullR.c index 03ac96b7f3..e2d607abec 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_FullR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_FullR.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_FullR: import a matrix in full format, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,11 +13,11 @@ GrB_Info GxB_Matrix_import_FullR // import a full matrix, held by row ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix void **Ax, // values - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso const GrB_Descriptor desc @@ -28,9 +28,9 @@ GrB_Info GxB_Matrix_import_FullR // import a full matrix, held by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_FullR (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_FullR (&A, type, nrows, ncols, " "&Ax, Ax_size, iso, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_FullR") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -48,7 +48,6 @@ GrB_Info GxB_Matrix_import_FullR // import a full matrix, held by row GxB_FULL, false, // full by row iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSC.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSC.c index 18e673d8b7..8def79c6ee 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSC.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_HyperCSC: import a matrix in hypersparse CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,20 +13,20 @@ GrB_Info GxB_Matrix_import_HyperCSC // import a hypersparse CSC matrix ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ah, // column indices + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ah_size, // size of Ah in bytes + uint64_t Ai_size, // size of Ai in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah + uint64_t nvec, // number of columns that appear in Ah bool jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc ) @@ -36,10 +36,10 @@ GrB_Info GxB_Matrix_import_HyperCSC // import a hypersparse CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_HyperCSC (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_HyperCSC (&A, type, nrows, ncols, " "&Ap, &Ah, &Ai, &Ax, Ap_size, Ah_size, Ai_size, Ax_size, iso, " "nvec, jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_HyperCSC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -57,7 +57,6 @@ GrB_Info GxB_Matrix_import_HyperCSC // import a hypersparse CSC matrix GxB_HYPERSPARSE, true, // hypersparse by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSR.c b/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSR.c index b98626ad35..69b7af8de0 100644 --- a/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSR.c +++ b/GraphBLAS/Source/import_export/GxB_Matrix_import_HyperCSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_import_HyperCSR: import a matrix in hypersparse CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,20 +13,20 @@ GrB_Info GxB_Matrix_import_HyperCSR // import a hypersparse CSR matrix ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix + uint64_t nrows, // number of rows of the matrix + uint64_t ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Ah, // row indices + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ah_size, // size of Ah in bytes + uint64_t Aj_size, // size of Aj in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah + uint64_t nvec, // number of rows that appear in Ah bool jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc ) @@ -36,10 +36,10 @@ GrB_Info GxB_Matrix_import_HyperCSR // import a hypersparse CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_import_HyperCSR (&A, type, nrows, ncols, " + GB_WHERE0 ("GxB_Matrix_import_HyperCSR (&A, type, nrows, ncols, " "&Ap, &Ah, &Aj, &Ax, Ap_size, Ah_size, Aj_size, Ax_size, iso, " "nvec, jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Matrix_import_HyperCSR") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -57,7 +57,6 @@ GrB_Info GxB_Matrix_import_HyperCSR // import a hypersparse CSR matrix GxB_HYPERSPARSE, false, // hypersparse by row iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_export_Bitmap.c b/GraphBLAS/Source/import_export/GxB_Vector_export_Bitmap.c index 9cf21e386c..8b83f017e6 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_export_Bitmap.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_export_Bitmap.c @@ -2,7 +2,7 @@ // GxB_Vector_export_Bitmap: export a bitmap vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,15 +15,15 @@ GrB_Info GxB_Vector_export_Bitmap // export and free a bitmap vector ( GrB_Vector *v, // handle of vector to export and free GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector + uint64_t *n, // length of the vector int8_t **vb, // bitmap void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes + uint64_t *vb_size, // size of vb in bytes + uint64_t *vx_size, // size of vx in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -32,11 +32,11 @@ GrB_Info GxB_Vector_export_Bitmap // export and free a bitmap vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_export_Bitmap (&v, &type, &n, " - "&vb, &vx, &vb_size, &vx_size, &iso, &nvals, desc)") ; - // GB_BURBLE_START ("GxB_Vector_export_Bitmap") ; GB_RETURN_IF_NULL (v) ; - GB_RETURN_IF_NULL_OR_FAULTY (*v) ; + GB_RETURN_IF_NULL (*v) ; + GB_WHERE_1 (*v, "GxB_Vector_export_Bitmap (&v, &type, &n, " + "&vb, &vx, &vb_size, &vx_size, &iso, &nvals, desc)") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -64,7 +64,7 @@ GrB_Info GxB_Vector_export_Bitmap // export and free a bitmap vector int sparsity ; bool is_csc ; - GrB_Index vdim ; + uint64_t vdim ; info = GB_export (false, (GrB_Matrix *) v, type, n, &vdim, false, NULL, NULL, // Ap @@ -82,7 +82,7 @@ GrB_Info GxB_Vector_export_Bitmap // export and free a bitmap vector ASSERT (is_csc) ; ASSERT (vdim == 1) ; } - // GB_BURBLE_END ; + return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_export_CSC.c b/GraphBLAS/Source/import_export/GxB_Vector_export_CSC.c index a005791ae2..4bbfed9778 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_export_CSC.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_export_CSC.c @@ -2,7 +2,7 @@ // GxB_Vector_export_CSC: export a vector in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,15 +15,15 @@ GrB_Info GxB_Vector_export_CSC // export and free a CSC vector ( GrB_Vector *v, // handle of vector to export and free GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector + uint64_t *n, // length of the vector - GrB_Index **vi, // indices + uint64_t **vi, // indices void **vx, // values - GrB_Index *vi_size, // size of Ai in bytes - GrB_Index *vx_size, // size of Ax in bytes + uint64_t *vi_size, // size of Ai in bytes + uint64_t *vx_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in vector + uint64_t *nvals, // # of entries in vector bool *jumbled, // if true, indices may be unsorted const GrB_Descriptor desc ) @@ -33,12 +33,12 @@ GrB_Info GxB_Vector_export_CSC // export and free a CSC vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_export_CSC (&v, &type, &n, " + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_NULL (*v) ; + GB_WHERE_1 (*v, "GxB_Vector_export_CSC (&v, &type, &n, " "&vi, &vx, &vi_size, &vx_size, &iso, &nvals, &jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Vector_export_CSC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; - GB_RETURN_IF_NULL (v) ; - GB_RETURN_IF_NULL_OR_FAULTY (*v) ; GB_RETURN_IF_NULL (nvals) ; ASSERT_VECTOR_OK (*v, "v to export", GB0) ; @@ -75,7 +75,7 @@ GrB_Info GxB_Vector_export_CSC // export and free a CSC vector int sparsity ; bool is_csc ; - GrB_Index vdim ; + uint64_t vdim ; info = GB_export (false, (GrB_Matrix *) v, type, n, &vdim, true, NULL, NULL, // Ap @@ -93,7 +93,7 @@ GrB_Info GxB_Vector_export_CSC // export and free a CSC vector ASSERT (is_csc) ; ASSERT (vdim == 1) ; } - // GB_BURBLE_END ; + return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_export_Full.c b/GraphBLAS/Source/import_export/GxB_Vector_export_Full.c index 4e03075f0e..60fc9007d6 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_export_Full.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_export_Full.c @@ -2,7 +2,7 @@ // GxB_Vector_export_Full: export a full vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,10 @@ GrB_Info GxB_Vector_export_Full // export and free a full vector ( GrB_Vector *v, // handle of vector to export and free GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector + uint64_t *n, // length of the vector void **vx, // values - GrB_Index *vx_size, // size of vx in bytes + uint64_t *vx_size, // size of vx in bytes bool *iso, // if true, v is iso const GrB_Descriptor desc @@ -29,11 +29,11 @@ GrB_Info GxB_Vector_export_Full // export and free a full vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_export_Full (&v, &type, &n, " - "&vx, &vx_size, &iso, desc)") ; - // GB_BURBLE_START ("GxB_Vector_export_Full") ; GB_RETURN_IF_NULL (v) ; - GB_RETURN_IF_NULL_OR_FAULTY (*v) ; + GB_RETURN_IF_NULL (*v) ; + GB_WHERE_1 (*v, "GxB_Vector_export_Full (&v, &type, &n, " + "&vx, &vx_size, &iso, desc)") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -66,7 +66,7 @@ GrB_Info GxB_Vector_export_Full // export and free a full vector int sparsity ; bool is_csc ; - GrB_Index vdim ; + uint64_t vdim ; info = GB_export (false, (GrB_Matrix *) v, type, n, &vdim, false, NULL, NULL, // Ap @@ -84,7 +84,7 @@ GrB_Info GxB_Vector_export_Full // export and free a full vector ASSERT (is_csc) ; ASSERT (vdim == 1) ; } - // GB_BURBLE_END ; + return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_import_Bitmap.c b/GraphBLAS/Source/import_export/GxB_Vector_import_Bitmap.c index 35ce480873..02eb0db144 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_import_Bitmap.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_import_Bitmap.c @@ -2,7 +2,7 @@ // GxB_Vector_import_Bitmap: import a vector in bitmap format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,15 +13,15 @@ GrB_Info GxB_Vector_import_Bitmap // import a bitmap vector ( GrB_Vector *v, // handle of vector to create GrB_Type type, // type of vector to create - GrB_Index n, // vector length + uint64_t n, // vector length int8_t **vb, // bitmap void **vx, // values - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes + uint64_t vb_size, // size of vb in bytes + uint64_t vx_size, // size of vx in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -30,9 +30,9 @@ GrB_Info GxB_Vector_import_Bitmap // import a bitmap vector // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_import_Bitmap (&v, type, n, " + GB_WHERE0 ("GxB_Vector_import_Bitmap (&v, type, n, " "&vb, &vx, vb_size, vx_size, iso, nvals, desc)") ; - // GB_BURBLE_START ("GxB_Vector_import_Bitmap") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -50,7 +50,6 @@ GrB_Info GxB_Vector_import_Bitmap // import a bitmap vector GxB_BITMAP, true, // bitmap by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_import_CSC.c b/GraphBLAS/Source/import_export/GxB_Vector_import_CSC.c index fff56672ee..4e6a814809 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_import_CSC.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_import_CSC.c @@ -2,7 +2,7 @@ // GxB_Vector_import_CSC: import a vector in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,15 +13,15 @@ GrB_Info GxB_Vector_import_CSC // import a vector in CSC format ( GrB_Vector *v, // handle of vector to create GrB_Type type, // type of vector to create - GrB_Index n, // vector length + uint64_t n, // vector length - GrB_Index **vi, // indices + uint64_t **vi, // indices void **vx, // values - GrB_Index vi_size, // size of Ai in bytes - GrB_Index vx_size, // size of Ax in bytes + uint64_t vi_size, // size of Ai in bytes + uint64_t vx_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in vector + uint64_t nvals, // # of entries in vector bool jumbled, // if true, indices may be unsorted const GrB_Descriptor desc ) @@ -31,9 +31,9 @@ GrB_Info GxB_Vector_import_CSC // import a vector in CSC format // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_import_CSC (&v, type, n, " + GB_WHERE0 ("GxB_Vector_import_CSC (&v, type, n, " "&vi, &vx, vi_size, vx_size, iso, nvals, jumbled, desc)") ; - // GB_BURBLE_START ("GxB_Vector_import_CSC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -51,7 +51,6 @@ GrB_Info GxB_Vector_import_CSC // import a vector in CSC format GxB_SPARSE, true, // sparse by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/import_export/GxB_Vector_import_Full.c b/GraphBLAS/Source/import_export/GxB_Vector_import_Full.c index 7d8a5ebaf4..d59ca750ed 100644 --- a/GraphBLAS/Source/import_export/GxB_Vector_import_Full.c +++ b/GraphBLAS/Source/import_export/GxB_Vector_import_Full.c @@ -2,7 +2,7 @@ // GxB_Vector_import_Full: import a vector in full format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,10 +13,10 @@ GrB_Info GxB_Vector_import_Full // import a full vector ( GrB_Vector *v, // handle of vector to create GrB_Type type, // type of vector to create - GrB_Index n, // vector length + uint64_t n, // vector length void **vx, // values - GrB_Index vx_size, // size of vx in bytes + uint64_t vx_size, // size of vx in bytes bool iso, // if true, v is iso const GrB_Descriptor desc @@ -27,9 +27,9 @@ GrB_Info GxB_Vector_import_Full // import a full vector // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_import_Full (&v, type, n, " + GB_WHERE0 ("GxB_Vector_import_Full (&v, type, n, " "&vx, vx_size, iso, desc)") ; - // GB_BURBLE_START ("GxB_Vector_import_Full") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; @@ -47,7 +47,6 @@ GrB_Info GxB_Vector_import_Full // import a full vector GxB_FULL, true, // full by col iso, fast_import, true, Werk) ; - // GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/include/GB_abort.h b/GraphBLAS/Source/include/GB_abort.h new file mode 100644 index 0000000000..691db89817 --- /dev/null +++ b/GraphBLAS/Source/include/GB_abort.h @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// GB_abort.h: assertions for all of GraphBLAS, including JIT kernels +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_ABORT_H +#define GB_ABORT_H + +typedef void (*GB_abort_f) (const char *file, int line) ; + +#ifdef GB_JIT_RUNTIME + + // JIT kernels call GB_abort via a callback function pointer + static GB_abort_f GB_abort = (GB_abort_f) NULL ; + +#else + + // primary functions in the GraphBLAS library, including PreJIT kernels, + // call GB_abort as a compile-time function, not a function pointer. + void GB_abort (const char *file, int line) ; + +#endif + +// this assertion is always enabled +#define GB_assert(X) \ +{ \ + if (!(X)) \ + { \ + GB_abort (__FILE__, __LINE__) ; \ + } \ +} + +#ifdef GB_DEBUG + // assert X is true + #define ASSERT(X) GB_assert (X) +#else + // debugging disabled + #define ASSERT(X) +#endif + +#define GB_IMPLIES(p,q) (!(p) || (q)) + +#endif + diff --git a/GraphBLAS/Source/include/GB_compiler.h b/GraphBLAS/Source/include/GB_compiler.h index ecccdc96a1..85f3d1ff2f 100644 --- a/GraphBLAS/Source/include/GB_compiler.h +++ b/GraphBLAS/Source/include/GB_compiler.h @@ -2,7 +2,7 @@ // GB_compiler.h: handle compiler variations //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/include/GB_coverage.h b/GraphBLAS/Source/include/GB_coverage.h index 212609683f..28adb77af9 100644 --- a/GraphBLAS/Source/include/GB_coverage.h +++ b/GraphBLAS/Source/include/GB_coverage.h @@ -2,7 +2,7 @@ // GB_coverage.h: for coverage tests in Tcov //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/include/GB_defaults.h b/GraphBLAS/Source/include/GB_defaults.h index 277d3fc792..8f6610a39e 100644 --- a/GraphBLAS/Source/include/GB_defaults.h +++ b/GraphBLAS/Source/include/GB_defaults.h @@ -2,7 +2,7 @@ // GB_defaults.h: default parameter settings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/include/GB_dev.h b/GraphBLAS/Source/include/GB_dev.h index be4469d9ad..748c0aca7e 100644 --- a/GraphBLAS/Source/include/GB_dev.h +++ b/GraphBLAS/Source/include/GB_dev.h @@ -2,7 +2,7 @@ // GB_dev.h: definitions for code development //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ //------------------------------------------------------------------------------ // to turn on Debug for a single file of GraphBLAS, add '#define GB_DEBUG' -// just before the statement '#include "GB.h"' +// at the top of the file, before any other #include statements. // to turn on Debug for all of GraphBLAS, uncomment this line: // (GraphBLAS will be exceedingly slow; this is for development only) diff --git a/GraphBLAS/Source/include/GB_include.h b/GraphBLAS/Source/include/GB_include.h index 1052ea93f5..9bc6669556 100644 --- a/GraphBLAS/Source/include/GB_include.h +++ b/GraphBLAS/Source/include/GB_include.h @@ -2,13 +2,13 @@ // GB_include.h: internal definitions for GraphBLAS, including JIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#ifndef GB_TEMPLATE_H -#define GB_TEMPLATE_H +#ifndef GB_INCLUDE_H +#define GB_INCLUDE_H //------------------------------------------------------------------------------ // definitions that modify GraphBLAS.h @@ -19,6 +19,14 @@ #include "include/GB_warnings.h" #include "include/GB_coverage.h" +#if defined ( GB_JIT_KERNEL ) || defined ( GBCOMPACT ) +// Because of the JIT code generation, the kernels often have unused variables, +// parameters, and functions. These warnings are disabled here. They may also +// generate warnings with -Wpedantic, so those are disabled as well. +#include "include/GB_unused.h" +#include "include/GB_pedantic_disable.h" +#endif + //------------------------------------------------------------------------------ // user-visible GraphBLAS.h //------------------------------------------------------------------------------ @@ -50,6 +58,7 @@ // internal #include files //------------------------------------------------------------------------------ +#include "include/GB_abort.h" #include "include/GB_prefix.h" #include "include/GB_defaults.h" #include "include/GB_rand.h" @@ -63,30 +72,30 @@ // Placed in the SuiteSparse/GrB(version)/src/include folder by GrB_init, // via the JITPackage. These files are used by the CPU JIT kernels (via // this file) and the CUDA JIT kernels (CUDA/include/GB_cuda_kernel.cuh): + #include "include/GB_opaque.h" + #include "include/GB_math_macros.h" #include "include/GB_bytes.h" #include "include/GB_pun.h" #include "include/GB_partition.h" - #include "include/GB_binary_search.h" #include "include/GB_zombie.h" + #include "include/GB_binary_search.h" #include "include/GB_int64_mult.h" #include "include/GB_index.h" #include "include/GB_hash.h" #include "include/GB_complex.h" #include "include/GB_iceil.h" - #include "include/GB_math_macros.h" #include "include/GB_memory_macros.h" #include "include/GB_printf_kernels.h" - #include "include/GB_opaque.h" - #include "include/GB_static_header.h" + #include "include/GB_clear_matrix_header.h" #include "include/GB_werk.h" #include "include/GB_task_struct.h" #include "include/GB_callback_proto.h" #include "include/GB_saxpy3task_struct.h" #include "include/GB_callback.h" #include "include/GB_hyper_hash_lookup.h" + #include "include/GB_ok.h" // not used by CUDA - #include "include/GB_ok.h" #include "include/GB_ijlist.h" #include "include/GB_atomics.h" #include "include/GB_assert_kernels.h" @@ -104,33 +113,32 @@ // include files for the GraphBLAS libary //-------------------------------------------------------------------------- - // Original location in the GraphBLAS/Source folder, for compiling // the GraphBLAS library, including PreJIT kernels: + #include "builtin/include/GB_opaque.h" + #include "math/include/GB_math_macros.h" #include "type/include/GB_bytes.h" #include "type/include/GB_pun.h" #include "slice/include/GB_partition.h" - #include "math/include/GB_binary_search.h" #include "math/include/GB_zombie.h" + #include "math/include/GB_binary_search.h" #include "math/include/GB_int64_mult.h" - #include "assign/include/GB_index.h" + #include "matrix/include/GB_index.h" #include "math/include/GB_hash.h" #include "math/include/GB_complex.h" #include "math/include/GB_iceil.h" - #include "math/include/GB_math_macros.h" #include "memory/include/GB_memory_macros.h" #include "print/include/GB_printf_kernels.h" - #include "builtin/include/GB_opaque.h" - #include "matrix/include/GB_static_header.h" + #include "matrix/include/GB_clear_matrix_header.h" #include "werk/include/GB_werk.h" #include "slice/include/GB_task_struct.h" #include "callback/include/GB_callback_proto.h" #include "mxm/include/GB_saxpy3task_struct.h" #include "callback/include/GB_callback.h" #include "hyper/include/GB_hyper_hash_lookup.h" + #include "ok/include/GB_ok.h" // not used by CUDA - #include "ok/include/GB_ok.h" #include "ij/include/GB_ijlist.h" #include "omp/include/GB_atomics.h" #include "ok/include/GB_assert_kernels.h" diff --git a/GraphBLAS/Source/include/GB_pedantic_disable.h b/GraphBLAS/Source/include/GB_pedantic_disable.h new file mode 100644 index 0000000000..d2308de288 --- /dev/null +++ b/GraphBLAS/Source/include/GB_pedantic_disable.h @@ -0,0 +1,14 @@ +//------------------------------------------------------------------------------ +// GB_pedantic_disable.h: disable -Wpedantic +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#if GB_COMPILER_GCC +#pragma GCC diagnostic ignored "-Wpedantic" +// #pragma GCC diagnostic ignored "-pedantic" +#endif + diff --git a/GraphBLAS/Source/include/GB_prefix.h b/GraphBLAS/Source/include/GB_prefix.h index d4cfeb25d2..fdd6e82054 100644 --- a/GraphBLAS/Source/include/GB_prefix.h +++ b/GraphBLAS/Source/include/GB_prefix.h @@ -2,7 +2,7 @@ // GB_prefix.h: GraphBLAS naming prefix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/include/GB_rand.h b/GraphBLAS/Source/include/GB_rand.h index 0e41856dff..11da688347 100644 --- a/GraphBLAS/Source/include/GB_rand.h +++ b/GraphBLAS/Source/include/GB_rand.h @@ -2,7 +2,7 @@ // GB_rand.h: random number generator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,15 +10,13 @@ #ifndef GB_RAND_H #define GB_RAND_H -#define GB_BASECASE (64 * 1024) - //------------------------------------------------------------------------------ // random number generator for quicksort //------------------------------------------------------------------------------ // https://en.wikipedia.org/wiki/Xorshift -GB_STATIC_INLINE uint64_t GB_rand (uint64_t *state) +static inline uint64_t GB_rand (uint64_t *state) { uint64_t x = (*state) ; x ^= x << 7 ; diff --git a/GraphBLAS/Source/include/GB_unused.h b/GraphBLAS/Source/include/GB_unused.h index 1870c2cf45..6cb03c97ad 100644 --- a/GraphBLAS/Source/include/GB_unused.h +++ b/GraphBLAS/Source/include/GB_unused.h @@ -2,7 +2,7 @@ // GB_unused.h: pragmas to disable compiler warnings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,11 +26,15 @@ #elif GB_COMPILER_GCC // disable gcc -Wall -Wextra -Wpedantic warnings - #if (__GNUC__ > 4) #pragma GCC diagnostic ignored "-Wunused-but-set-variable" - #endif + #pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" - #pragma GCC diagnostic ignored "-Wuninitialized" + #pragma GCC diagnostic ignored "-Wunused-function" + #pragma GCC diagnostic ignored "-Wunused-parameter" + +#elif defined ( __clang__ ) + + #pragma clang diagnostic ignored "-Wunused-variable" #endif diff --git a/GraphBLAS/Source/include/GB_warnings.h b/GraphBLAS/Source/include/GB_warnings.h index 6d081c7c36..5725eb8891 100644 --- a/GraphBLAS/Source/include/GB_warnings.h +++ b/GraphBLAS/Source/include/GB_warnings.h @@ -2,7 +2,7 @@ // GB_warnings.h: turn off compiler warnings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,12 +43,15 @@ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wtype-limits" // enable these warnings as errors + #ifndef GB_JIT_KERNEL #pragma GCC diagnostic error "-Wmisleading-indentation" #endif + #endif // disable warnings from -Wall -Wextra -Wpendantic #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wsign-compare" + #pragma GCC diagnostic ignored "-Wstrict-aliasing" #if defined ( __cplusplus ) #pragma GCC diagnostic ignored "-Wwrite-strings" #else @@ -57,15 +60,19 @@ // enable these warnings as errors #pragma GCC diagnostic error "-Wswitch-default" - #if !defined ( __cplusplus ) + #pragma GCC diagnostic error "-Wreturn-type" + #if !defined ( __cplusplus ) && !defined ( GB_JIT_KERNEL ) + #pragma GCC diagnostic error "-Wpointer-sign" #pragma GCC diagnostic error "-Wmissing-prototypes" #endif #elif GB_COMPILER_CLANG // disable warnings for clang - #pragma clang diagnostic ignored "-Wpointer-sign" #pragma clang diagnostic ignored "-Wpass-failed" + #ifndef GB_JIT_KERNEL + #pragma clang diagnostic error "-Wpointer-sign" + #endif #elif GB_COMPILER_MSC diff --git a/GraphBLAS/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c b/GraphBLAS/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c index 7155869541..73e1854ec3 100644 --- a/GraphBLAS/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c +++ b/GraphBLAS/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_new_IndexOp: create a new user-defined binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,17 +22,16 @@ GrB_Info GxB_BinaryOp_new_IndexOp // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_BinaryOp_new_IndexOp (&binop, idxbinop, theta)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (binop_handle) ; (*binop_handle) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (idxbinop) ; - GB_RETURN_IF_NULL_OR_FAULTY (theta) ; + GB_RETURN_IF_NULL_OR_INVALID (theta) ; if (!GB_Type_compatible (idxbinop->theta_type, theta->type)) { - GB_ERROR (GrB_DOMAIN_MISMATCH, - "Scalar of type [%s] cannot be typecast to type [%s]\n", - theta->type->name, idxbinop->theta_type->name) ; + return (GrB_DOMAIN_MISMATCH) ; } //-------------------------------------------------------------------------- @@ -40,7 +39,9 @@ GrB_Info GxB_BinaryOp_new_IndexOp //-------------------------------------------------------------------------- size_t header_size ; - GrB_BinaryOp binop = GB_CALLOC (1, struct GB_BinaryOp_opaque, &header_size); + GrB_BinaryOp + binop = GB_CALLOC_MEMORY (1, sizeof (struct GB_BinaryOp_opaque), + &header_size) ; if (binop == NULL) { // out of memory @@ -63,7 +64,7 @@ GrB_Info GxB_BinaryOp_new_IndexOp bool jitable = (idxbinop->hash != UINT64_MAX) ; - GrB_Info info = GB_op_name_and_defn ( + info = GB_op_name_and_defn ( // output: binop->name, &(binop->name_len), &(binop->hash), &(binop->defn), &(binop->defn_size), @@ -72,7 +73,7 @@ GrB_Info GxB_BinaryOp_new_IndexOp if (info != GrB_SUCCESS) { // out of memory - GB_FREE (&binop, header_size) ; + GB_FREE_MEMORY (&binop, header_size) ; return (info) ; } @@ -80,7 +81,7 @@ GrB_Info GxB_BinaryOp_new_IndexOp // copy theta into the new binary op //-------------------------------------------------------------------------- - binop->theta = GB_MALLOC (binop->theta_type->size, GB_void, + binop->theta = GB_MALLOC_MEMORY (1, binop->theta_type->size, &(binop->theta_size)) ; if (binop->theta == NULL) { diff --git a/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_free.c b/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_free.c index 82e9bc175a..86494ddc10 100644 --- a/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_free.c +++ b/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_free.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_free: free an index_binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_new.c b/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_new.c index 8b61325931..ea6cae5a55 100644 --- a/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_new.c +++ b/GraphBLAS/Source/indexbinaryop/GxB_IndexBinaryOp_new.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_new: create a new user-defined index_binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,8 +40,7 @@ GrB_Info GxB_IndexBinaryOp_new // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_new (op, function, ztype, xtype, ytype" - ", theta_type, name, defn)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (op_handle) ; (*op_handle) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (ztype) ; @@ -54,8 +53,9 @@ GrB_Info GxB_IndexBinaryOp_new //-------------------------------------------------------------------------- size_t header_size ; - GxB_IndexBinaryOp op = GB_CALLOC (1, struct GB_IndexBinaryOp_opaque, - &header_size) ; + GxB_IndexBinaryOp + op = GB_CALLOC_MEMORY (1, sizeof (struct GB_IndexBinaryOp_opaque), + &header_size) ; if (op == NULL) { // out of memory @@ -79,6 +79,8 @@ GrB_Info GxB_IndexBinaryOp_new op->idxunop_function = NULL ; op->binop_function = NULL ; op->idxbinop_function = function ; + op->theta = NULL ; + op->theta_size = 0 ; op->opcode = GB_USER_idxbinop_code ; @@ -101,7 +103,7 @@ GrB_Info GxB_IndexBinaryOp_new if (info != GrB_SUCCESS) { // out of memory - GB_FREE (&op, header_size) ; + GB_FREE_MEMORY (&op, header_size) ; return (info) ; } @@ -123,6 +125,7 @@ GrB_Info GxB_IndexBinaryOp_new // and cannot be compiled by the JIT). return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } + #include "include/GB_pedantic_disable.h" op->idxbinop_function = (GxB_index_binary_function) user_function ; GB_BURBLE_END ; } diff --git a/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_free.c b/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_free.c index 2a64556806..7a545a006a 100644 --- a/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_free.c +++ b/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_free.c @@ -2,7 +2,7 @@ // GrB_IndexUnaryOp_free: free an index_unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_new.c b/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_new.c index 04409be64c..e9d9acf7a6 100644 --- a/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_new.c +++ b/GraphBLAS/Source/indexunaryop/GrB_IndexUnaryOp_new.c @@ -2,7 +2,7 @@ // GrB_IndexUnaryOp_new: create a new user-defined index_unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_new.c b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_new.c index 8e5d38dfc6..d16ab8037d 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_new.c +++ b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_new.c @@ -2,7 +2,7 @@ // GxB_IndexUnaryOp_new: create a new user-defined index_unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,8 +36,7 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexUnaryOp_new (op, function, ztype, xtype, ytype" - ", name, defn)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (op_handle) ; (*op_handle) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (ztype) ; @@ -49,8 +48,9 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp //-------------------------------------------------------------------------- size_t header_size ; - GrB_IndexUnaryOp op = GB_CALLOC (1, struct GB_IndexUnaryOp_opaque, - &header_size) ; + GrB_IndexUnaryOp + op = GB_CALLOC_MEMORY (1, sizeof (struct GB_IndexUnaryOp_opaque), + &header_size) ; if (op == NULL) { // out of memory @@ -72,6 +72,10 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp op->unop_function = NULL ; op->idxunop_function = function ; op->binop_function = NULL ; + op->idxbinop_function = NULL ; + op->theta_type = NULL ; + op->theta = NULL ; + op->theta_size = 0 ; op->opcode = GB_USER_idxunop_code ; @@ -93,7 +97,7 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp if (info != GrB_SUCCESS) { // out of memory - GB_FREE (&op, header_size) ; + GB_FREE_MEMORY (&op, header_size) ; return (info) ; } @@ -115,6 +119,7 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp // and cannot be compiled by the JIT). return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } + #include "include/GB_pedantic_disable.h" op->idxunop_function = (GxB_index_unary_function) user_function ; GB_BURBLE_END ; } diff --git a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_xtype_name.c b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_xtype_name.c index bb8ef7c6c1..b8e1027f35 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_xtype_name.c +++ b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_xtype_name.c @@ -2,7 +2,7 @@ // GxB_IndexUnaryOp_xtype_name: return the type_name of x for z=f(x,i,j,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_IndexUnaryOp_xtype_name // return the name of the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexUnaryOp_xtype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; ASSERT_INDEXUNARYOP_OK (op, "op for xtype_name", GB0) ; diff --git a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ytype_name.c b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ytype_name.c index ba9373f944..24eace19db 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ytype_name.c +++ b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ytype_name.c @@ -2,7 +2,7 @@ // GxB_IndexUnaryOp_ytype_name: return the type_name of y for z=f(x,i,j,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_IndexUnaryOp_ytype_name // return name of type of scalar y // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexUnaryOp_ytype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; ASSERT_INDEXUNARYOP_OK (op, "op for ytype_name", GB0) ; diff --git a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ztype_name.c b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ztype_name.c index 141261c5c7..aebbfc4f92 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ztype_name.c +++ b/GraphBLAS/Source/indexunaryop/GxB_IndexUnaryOp_ztype_name.c @@ -2,7 +2,7 @@ // GxB_IndexUnaryOp_ztype_name: return the type_name of z for z=f(x,i,j,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_IndexUnaryOp_ztype_name // return the name of the type of z // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexUnaryOp_ztype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; ASSERT_INDEXUNARYOP_OK (op, "op for ztype_name", GB0) ; diff --git a/GraphBLAS/Source/indexunaryop/GxB_SelectOp_ttype.c b/GraphBLAS/Source/indexunaryop/GxB_SelectOp_ttype.c index fb5f54b9d1..93ae7f3546 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_SelectOp_ttype.c +++ b/GraphBLAS/Source/indexunaryop/GxB_SelectOp_ttype.c @@ -2,7 +2,7 @@ // GxB_SelectOp_ttype: return the type of thunk for z=f(x,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_SelectOp_ttype // return type of thunk or NULL if generic // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_SelectOp_ttype (&ttype, selectop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (ttype) ; GB_RETURN_IF_NULL_OR_FAULTY (selectop) ; ASSERT_SELECTOP_OK (selectop, "selectop for ttype", GB0) ; diff --git a/GraphBLAS/Source/indexunaryop/GxB_SelectOp_xtype.c b/GraphBLAS/Source/indexunaryop/GxB_SelectOp_xtype.c index 38d8446267..0f1497b1c4 100644 --- a/GraphBLAS/Source/indexunaryop/GxB_SelectOp_xtype.c +++ b/GraphBLAS/Source/indexunaryop/GxB_SelectOp_xtype.c @@ -2,7 +2,7 @@ // GxB_SelectOp_xtype: return the type of x for z=f(x,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_SelectOp_xtype // return the type of x or NULL if generic // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_SelectOp_xtype (&xtype, selectop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (xtype) ; GB_RETURN_IF_NULL_OR_FAULTY (selectop) ; ASSERT_SELECTOP_OK (selectop, "selectop for xtype", GB0) ; diff --git a/GraphBLAS/Source/init/GB_init.c b/GraphBLAS/Source/init/GB_init.c index bf51eb6a18..825d3990bf 100644 --- a/GraphBLAS/Source/init/GB_init.c +++ b/GraphBLAS/Source/init/GB_init.c @@ -2,7 +2,7 @@ // GB_init: initialize GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,7 +45,7 @@ GrB_Info GB_init // start up GraphBLAS ( - GrB_Mode mode, // blocking or non-blocking mode + int mode, // blocking or non-blocking mode // pointers to memory management functions. void * (* malloc_function ) (size_t), // required @@ -153,9 +153,7 @@ GrB_Info GB_init // start up GraphBLAS if (mode == GxB_BLOCKING_GPU || mode == GxB_NONBLOCKING_GPU) { // initialize the GPUs - info = GB_cuda_init ( ) ; - printf ("GB_cuda_init: %d\n", info) ; - GB_OK (info) ; + GB_OK (GB_cuda_init ( )) ; } else #endif diff --git a/GraphBLAS/Source/init/GB_init.h b/GraphBLAS/Source/init/GB_init.h index 8664293dc3..9c56d16a41 100644 --- a/GraphBLAS/Source/init/GB_init.h +++ b/GraphBLAS/Source/init/GB_init.h @@ -2,7 +2,7 @@ // GB_init.h: definitions for GB_init //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ GrB_Info GB_init // start up GraphBLAS ( - GrB_Mode mode, // blocking or non-blocking mode + int mode, // blocking or non-blocking mode // pointers to memory management functions. void * (* malloc_function ) (size_t), // required diff --git a/GraphBLAS/Source/init/GrB_error.c b/GraphBLAS/Source/init/GrB_error.c index 1bb5e3a18b..10e287547e 100644 --- a/GraphBLAS/Source/init/GrB_error.c +++ b/GraphBLAS/Source/init/GrB_error.c @@ -2,7 +2,7 @@ // GrB_error: return an error string describing the last error //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -69,9 +69,10 @@ GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring semiring) GrB_Info GrB_Scalar_error (const char **error, const GrB_Scalar s) { + GrB_Info info ; GB_RETURN_IF_NULL (error) ; (*error) = empty ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; if (s->logger == NULL) return (GrB_SUCCESS) ; (*error) = s->logger ; return (GrB_SUCCESS) ; @@ -85,9 +86,10 @@ GrB_Info GxB_Scalar_error (const char **error, const GrB_Scalar s) GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) { + GrB_Info info ; GB_RETURN_IF_NULL (error) ; (*error) = empty ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; if (v->logger == NULL) return (GrB_SUCCESS) ; (*error) = v->logger ; return (GrB_SUCCESS) ; @@ -95,21 +97,22 @@ GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) GrB_Info GrB_Matrix_error (const char **error, const GrB_Matrix A) { + GrB_Info info ; GB_RETURN_IF_NULL (error) ; (*error) = empty ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; if (A->logger == NULL) return (GrB_SUCCESS) ; (*error) = A->logger ; return (GrB_SUCCESS) ; } -GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor d) +GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor desc) { GB_RETURN_IF_NULL (error) ; (*error) = empty ; - GB_RETURN_IF_NULL_OR_FAULTY (d) ; - if (d->logger == NULL) return (GrB_SUCCESS) ; - (*error) = d->logger ; + GB_RETURN_IF_NULL_OR_FAULTY (desc) ; + if (desc->logger == NULL) return (GrB_SUCCESS) ; + (*error) = desc->logger ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/init/GrB_finalize.c b/GraphBLAS/Source/init/GrB_finalize.c index 5690f1181f..7e60ad1c66 100644 --- a/GraphBLAS/Source/init/GrB_finalize.c +++ b/GraphBLAS/Source/init/GrB_finalize.c @@ -2,7 +2,7 @@ // GrB_finalize: finalize GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/init/GrB_getVersion.c b/GraphBLAS/Source/init/GrB_getVersion.c index 6bfd2a2373..aec47e1f2f 100644 --- a/GraphBLAS/Source/init/GrB_getVersion.c +++ b/GraphBLAS/Source/init/GrB_getVersion.c @@ -2,7 +2,7 @@ // GrB_getVersion: get the version number of the GraphBLAS C API standard //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/init/GrB_init.c b/GraphBLAS/Source/init/GrB_init.c index a8d45c3ebc..8a3498faa0 100644 --- a/GraphBLAS/Source/init/GrB_init.c +++ b/GraphBLAS/Source/init/GrB_init.c @@ -2,7 +2,7 @@ // GrB_init: initialize GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ GrB_Info GrB_init // start up GraphBLAS ( - GrB_Mode mode // blocking or non-blocking mode + int mode // blocking or non-blocking mode ) { diff --git a/GraphBLAS/Source/init/GxB_init.c b/GraphBLAS/Source/init/GxB_init.c index d08a7dafac..aae876bf57 100644 --- a/GraphBLAS/Source/init/GxB_init.c +++ b/GraphBLAS/Source/init/GxB_init.c @@ -2,7 +2,7 @@ // GxB_init: initialize GraphBLAS and declare malloc/calloc/realloc/free to use //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -53,7 +53,7 @@ GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc ( - GrB_Mode mode, // blocking or non-blocking mode + int mode, // blocking or non-blocking mode // pointers to memory management functions void * (* user_malloc_function ) (size_t), // required diff --git a/GraphBLAS/Source/iso/GB_all_entries_are_iso.c b/GraphBLAS/Source/iso/GB_all_entries_are_iso.c index 693ee572f7..45f8801045 100644 --- a/GraphBLAS/Source/iso/GB_all_entries_are_iso.c +++ b/GraphBLAS/Source/iso/GB_all_entries_are_iso.c @@ -2,7 +2,7 @@ // GB_all_entries_are_iso: check if all entries in a matrix are identical //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iso/GB_is_nonzero.h b/GraphBLAS/Source/iso/GB_is_nonzero.h index 218bde8d0a..0483d1b53b 100644 --- a/GraphBLAS/Source/iso/GB_is_nonzero.h +++ b/GraphBLAS/Source/iso/GB_is_nonzero.h @@ -2,7 +2,7 @@ // GB_is_nonzero.h: determine if a scalar is zero //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iso/GB_iso.h b/GraphBLAS/Source/iso/GB_iso.h index fa7221e22f..8d9857d95a 100644 --- a/GraphBLAS/Source/iso/GB_iso.h +++ b/GraphBLAS/Source/iso/GB_iso.h @@ -2,7 +2,7 @@ // GB_iso.h: definitions for iso methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,18 +41,6 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) GrB_Scalar scalar // input scalar ) ; -GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso -( - GrB_Matrix A, // input/output matrix - bool initialize // if true, copy the iso value to all of A->x -) ; - -GrB_Info GB_convert_any_to_iso // convert non-iso matrix to iso -( - GrB_Matrix A, // input/output matrix - GB_void *scalar // scalar value, of size A->type->size, or NULL -) ; - GrB_Info GB_iso_expand // expand an iso scalar into an entire array ( void *restrict X, // output array to expand into diff --git a/GraphBLAS/Source/iso/GB_iso_expand.c b/GraphBLAS/Source/iso/GB_iso_expand.c index ad40822ab7..ee1affb91a 100644 --- a/GraphBLAS/Source/iso/GB_iso_expand.c +++ b/GraphBLAS/Source/iso/GB_iso_expand.c @@ -2,7 +2,7 @@ // GB_iso_expand: expand a scalar into an entire array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iso/GB_unop_code_iso.c b/GraphBLAS/Source/iso/GB_unop_code_iso.c index 2792a7117f..539f917e24 100644 --- a/GraphBLAS/Source/iso/GB_unop_code_iso.c +++ b/GraphBLAS/Source/iso/GB_unop_code_iso.c @@ -2,7 +2,7 @@ // GB_unop_code_iso: determine if C = A, C = unop(A), or C = binop(A) is iso //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iso/GB_unop_iso.c b/GraphBLAS/Source/iso/GB_unop_iso.c index d12bf6b265..f11a7c960c 100644 --- a/GraphBLAS/Source/iso/GB_unop_iso.c +++ b/GraphBLAS/Source/iso/GB_unop_iso.c @@ -2,7 +2,7 @@ // GB_unop_iso: apply a unary or binary op (with scalar) with an iso result //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,6 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) ASSERT (Cx != NULL) ; GrB_Type stype = (scalar != NULL) ? scalar->type : GrB_BOOL ; -// const size_t csize = ctype->size ; const size_t asize = A->type->size ; const size_t ssize = stype->size ; const GB_Type_code ccode = ctype->code ; diff --git a/GraphBLAS/Source/iso/GxB_Matrix_iso.c b/GraphBLAS/Source/iso/GxB_Matrix_iso.c index e15bce064d..84987296c5 100644 --- a/GraphBLAS/Source/iso/GxB_Matrix_iso.c +++ b/GraphBLAS/Source/iso/GxB_Matrix_iso.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GxB_Matrix_iso: report if a matrix is iso-valued or not +// GxB_Matrix_iso: report if a matrix is iso-valued or not (historical) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,10 @@ GrB_Info GxB_Matrix_iso // return iso status of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_iso (&iso, A)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (iso) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; //-------------------------------------------------------------------------- // return the iso status of a matrix diff --git a/GraphBLAS/Source/iso/GxB_Vector_iso.c b/GraphBLAS/Source/iso/GxB_Vector_iso.c index ef3b25e69d..616f8d8834 100644 --- a/GraphBLAS/Source/iso/GxB_Vector_iso.c +++ b/GraphBLAS/Source/iso/GxB_Vector_iso.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GxB_Vector_iso: report if a vector is iso-valued or not +// GxB_Vector_iso: report if a vector is iso-valued or not (historical) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,10 @@ GrB_Info GxB_Vector_iso // return iso status of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_iso (&iso, v)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (iso) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; ASSERT (GB_VECTOR_OK (v)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/iso/factory/GB_all_entries_are_iso_template.c b/GraphBLAS/Source/iso/factory/GB_all_entries_are_iso_template.c index 2f4e1bb5a7..1fafc7e25c 100644 --- a/GraphBLAS/Source/iso/factory/GB_all_entries_are_iso_template.c +++ b/GraphBLAS/Source/iso/factory/GB_all_entries_are_iso_template.c @@ -2,7 +2,7 @@ // GB_all_entries_are_iso_template: check if all entries in A are identical //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iterator/GB_Iterator_attach.c b/GraphBLAS/Source/iterator/GB_Iterator_attach.c index 33746f9a57..1976eb3565 100644 --- a/GraphBLAS/Source/iterator/GB_Iterator_attach.c +++ b/GraphBLAS/Source/iterator/GB_Iterator_attach.c @@ -2,7 +2,7 @@ // GB_Iterator_attach: attach an iterator to matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,10 +13,10 @@ GrB_Info GB_Iterator_attach ( // input/output: - GxB_Iterator iterator, // iterator to attach to the matrix A + GxB_Iterator iterator, // iterator to attach to the matrix A // input - GrB_Matrix A, // matrix to attach - GxB_Format_Value format, // by row, by col, or by entry (GxB_NO_FORMAT) + GrB_Matrix A, // matrix to attach + int format, // by row, by col, or by entry (GxB_NO_FORMAT) GrB_Descriptor desc ) { @@ -25,8 +25,9 @@ GrB_Info GB_Iterator_attach // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; GB_RETURN_IF_NULL (iterator) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; if ((format == GxB_BY_ROW && A->is_csc) || (format == GxB_BY_COL && !A->is_csc)) @@ -62,10 +63,13 @@ GrB_Info GB_Iterator_attach iterator->avlen = A->vlen ; iterator->avdim = A->vdim ; iterator->anvec = A->nvec ; - iterator->Ap = A->p ; - iterator->Ah = A->h ; + iterator->Ap32 = (A->p_is_32) ? A->p : NULL ; + iterator->Ap64 = (A->p_is_32) ? NULL : A->p ; + iterator->Ah32 = (A->j_is_32) ? A->h : NULL ; + iterator->Ah64 = (A->j_is_32) ? NULL : A->h ; + iterator->Ai32 = (A->i_is_32) ? A->i : NULL ; + iterator->Ai64 = (A->i_is_32) ? NULL : A->i ; iterator->Ab = A->b ; - iterator->Ai = A->i ; iterator->Ax = A->x ; iterator->type_size = A->type->size ; iterator->A_sparsity = GB_sparsity (A) ; diff --git a/GraphBLAS/Source/iterator/GB_Iterator_rc_bitmap_next.c b/GraphBLAS/Source/iterator/GB_Iterator_rc_bitmap_next.c index 25bed4e947..bfef4a7cdd 100644 --- a/GraphBLAS/Source/iterator/GB_Iterator_rc_bitmap_next.c +++ b/GraphBLAS/Source/iterator/GB_Iterator_rc_bitmap_next.c @@ -2,7 +2,7 @@ // GB_Iterator_rc_bitmap_next: move a row/col iterator to next entry in bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iterator/GB_Iterator_rc_seek.c b/GraphBLAS/Source/iterator/GB_Iterator_rc_seek.c index 79e25922ce..ec18d41497 100644 --- a/GraphBLAS/Source/iterator/GB_Iterator_rc_seek.c +++ b/GraphBLAS/Source/iterator/GB_Iterator_rc_seek.c @@ -2,7 +2,7 @@ // GB_Iterator_rc_seek: seek a row/col iterator to A(:,j) or to jth vector of A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ GrB_Info GB_Iterator_rc_seek ( GxB_Iterator iterator, - GrB_Index j_input, + uint64_t j_input, bool jth_vector ) { @@ -47,8 +47,8 @@ GrB_Info GB_Iterator_rc_seek case GxB_SPARSE : { // attach to A(:,j), which is also the jth vector of A - iterator->pstart = iterator->Ap [j] ; - iterator->pend = iterator->Ap [j+1] ; + iterator->pstart = GB_IGET (iterator->Ap, j) ; + iterator->pend = GB_IGET (iterator->Ap, j+1) ; iterator->p = iterator->pstart ; iterator->k = j ; } @@ -62,8 +62,8 @@ GrB_Info GB_Iterator_rc_seek // attach to the jth vector of A; this is much faster than // searching Ah for the value j, to attach to A(:,j) k = j ; - iterator->pstart = iterator->Ap [k] ; - iterator->pend = iterator->Ap [k+1] ; + iterator->pstart = GB_IGET (iterator->Ap, k) ; + iterator->pend = GB_IGET (iterator->Ap, k+1) ; iterator->p = iterator->pstart ; iterator->k = k ; } @@ -72,12 +72,19 @@ GrB_Info GB_Iterator_rc_seek // find k so that j = Ah [k], or if not found, return k as the // smallest value so that j < Ah [k]. k = 0 ; - const int64_t *restrict Ah = iterator->Ah ; if (j > 0) { - bool found ; int64_t pright = iterator->anvec-1 ; - GB_SPLIT_BINARY_SEARCH (j, Ah, k, pright, found) ; + if (iterator->Ah32 != NULL) + { + GB_split_binary_search_32 (j, iterator->Ah32, + &k, &pright) ; + } + else + { + GB_split_binary_search_64 (j, iterator->Ah64, + &k, &pright) ; + } } } // If j is found, A(:,j) is the kth vector in the Ah hyperlist. @@ -95,8 +102,8 @@ GrB_Info GB_Iterator_rc_seek else { // the kth vector exists - iterator->pstart = iterator->Ap [k] ; - iterator->pend = iterator->Ap [k+1] ; + iterator->pstart = GB_IGET (iterator->Ap, k) ; + iterator->pend = GB_IGET (iterator->Ap, k+1) ; iterator->p = iterator->pstart ; iterator->k = k ; } diff --git a/GraphBLAS/Source/iterator/GxB_Iterator_free.c b/GraphBLAS/Source/iterator/GxB_Iterator_free.c index 5a357c02e6..1fe130c4c2 100644 --- a/GraphBLAS/Source/iterator/GxB_Iterator_free.c +++ b/GraphBLAS/Source/iterator/GxB_Iterator_free.c @@ -2,7 +2,7 @@ // GxB_Iterator_free: free an iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,13 +11,13 @@ GrB_Info GxB_Iterator_free (GxB_Iterator *iterator) { - if (iterator != NULL) + if (iterator != NULL && (*iterator) != NULL) { size_t header_size = (*iterator)->header_size ; if (header_size > 0) { (*iterator)->header_size = 0 ; - GB_FREE (iterator, header_size) ; + GB_FREE_MEMORY (iterator, header_size) ; } } return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/iterator/GxB_Iterator_get.c b/GraphBLAS/Source/iterator/GxB_Iterator_get.c index b6476da394..73c8fc2bc8 100644 --- a/GraphBLAS/Source/iterator/GxB_Iterator_get.c +++ b/GraphBLAS/Source/iterator/GxB_Iterator_get.c @@ -2,7 +2,7 @@ // GxB_Iterator_get_TYPE: get value of the current entry for any iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/iterator/GxB_Iterator_new.c b/GraphBLAS/Source/iterator/GxB_Iterator_new.c index e494ee63d0..1129d64d3a 100644 --- a/GraphBLAS/Source/iterator/GxB_Iterator_new.c +++ b/GraphBLAS/Source/iterator/GxB_Iterator_new.c @@ -2,7 +2,7 @@ // GxB_Iterator_new: allocate an iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,10 +11,11 @@ GrB_Info GxB_Iterator_new (GxB_Iterator *iterator) { - GB_WHERE1 ("GxB_Iterator_new (&iterator)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (iterator) ; size_t header_size ; - (*iterator) = GB_CALLOC (1, struct GB_Iterator_opaque, &header_size) ; + (*iterator) = GB_CALLOC_MEMORY (1, sizeof (struct GB_Iterator_opaque), + &header_size) ; if (*iterator == NULL) { // out of memory diff --git a/GraphBLAS/Source/iterator/GxB_Matrix_Iterator.c b/GraphBLAS/Source/iterator/GxB_Matrix_Iterator.c index 7f315bbba9..42f15e44ca 100644 --- a/GraphBLAS/Source/iterator/GxB_Matrix_Iterator.c +++ b/GraphBLAS/Source/iterator/GxB_Matrix_Iterator.c @@ -2,9 +2,11 @@ // GxB_Matrix_Iterator: seek to a specific entry for a matrix iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +//------------------------------------------------------------------------------ + #include "GB.h" #include "slice/include/GB_search_for_vector.h" @@ -51,7 +53,7 @@ GrB_Info GxB_Matrix_Iterator_attach // to nvals(A). For an m-by-n bitmap matrix, pmax=m*n, or pmax=0 if the // matrix has no entries. -GrB_Index GxB_Matrix_Iterator_getpmax (GxB_Iterator iterator) +uint64_t GxB_Matrix_Iterator_getpmax (GxB_Iterator iterator) { return (iterator->pmax) ; } @@ -86,14 +88,28 @@ static inline GrB_Info GB_check_for_end_of_vector (GxB_Iterator iterator) // the kth vector is done; move to the next non-empty vector iterator->pstart = iterator->pend ; iterator->k++ ; - while (iterator->Ap [iterator->k+1] == iterator->pend) - { - // iterator->k is an empty vector; move to the next one - iterator->k++ ; - ASSERT (iterator->k < iterator->anvec) ; + if (iterator->Ap32 != NULL) + { + while (iterator->Ap32 [iterator->k+1] == iterator->pend) + { + // iterator->k is an empty vector; move to the next one + iterator->k++ ; + ASSERT (iterator->k < iterator->anvec) ; + } + // iterator->k is now the next non-empty vector + iterator->pend = iterator->Ap32 [iterator->k+1] ; + } + else + { + while (iterator->Ap64 [iterator->k+1] == iterator->pend) + { + // iterator->k is an empty vector; move to the next one + iterator->k++ ; + ASSERT (iterator->k < iterator->anvec) ; + } + // iterator->k is now the next non-empty vector + iterator->pend = iterator->Ap64 [iterator->k+1] ; } - // iterator->k is now the next non-empty vector - iterator->pend = iterator->Ap [iterator->k+1] ; return (GrB_SUCCESS) ; } } @@ -161,7 +177,7 @@ GrB_Info GxB_Matrix_Iterator_next (GxB_Iterator iterator) GrB_Info GxB_Matrix_Iterator_seek ( GxB_Iterator iterator, - GrB_Index p_input + uint64_t p_input ) { int64_t p = (int64_t) p_input ; @@ -175,8 +191,7 @@ GrB_Info GxB_Matrix_Iterator_seek { // seek to the first entry of the first vector A(:,0) iterator->pstart = 0 ; - iterator->pend = (iterator->Ap != NULL) ? - iterator->Ap [1] : iterator->avlen ; + iterator->pend = GBp (iterator->Ap, 1, iterator->avlen) ; iterator->p = 0 ; iterator->k = 0 ; // move to the next non-empty vector if A(:,0) is empty @@ -193,10 +208,20 @@ GrB_Info GxB_Matrix_Iterator_seek case GxB_HYPERSPARSE : { // find the vector k that contains position p - iterator->k = GB_search_for_vector (p, iterator->Ap, - 0, iterator->anvec, iterator->avlen) ; - iterator->pstart = iterator->Ap [iterator->k] ; - iterator->pend = iterator->Ap [iterator->k+1] ; + if (iterator->Ap32 != NULL) + { + iterator->k = GB_search_for_vector_32 (iterator->Ap32, + p, 0, iterator->anvec, iterator->avlen) ; + iterator->pstart = iterator->Ap32 [iterator->k] ; + iterator->pend = iterator->Ap32 [iterator->k+1] ; + } + else + { + iterator->k = GB_search_for_vector_64 (iterator->Ap64, + p, 0, iterator->anvec, iterator->avlen) ; + iterator->pstart = iterator->Ap64 [iterator->k] ; + iterator->pend = iterator->Ap64 [iterator->k+1] ; + } } break ; case GxB_BITMAP : @@ -233,7 +258,7 @@ GrB_Info GxB_Matrix_Iterator_seek // GxB_Matrix_Iterator_next. Results are undefined if these conditions are not // met. -GrB_Index GxB_Matrix_Iterator_getp (GxB_Iterator iterator) +uint64_t GxB_Matrix_Iterator_getp (GxB_Iterator iterator) { return (iterator->p) ; } @@ -251,59 +276,42 @@ GrB_Index GxB_Matrix_Iterator_getp (GxB_Iterator iterator) void GxB_Matrix_Iterator_getIndex ( GxB_Iterator iterator, - GrB_Index *row, - GrB_Index *col + uint64_t *row, + uint64_t *col ) { + uint64_t i, j ; + // get row and column index of current entry, for matrix iterator switch (iterator->A_sparsity) { default: case GxB_SPARSE : - { - if (iterator->by_col) - { - (*row) = (GrB_Index) (iterator->Ai [iterator->p]) ; - (*col) = (GrB_Index) (iterator->k) ; - } - else - { - (*row) = (GrB_Index) (iterator->k) ; - (*col) = (GrB_Index) (iterator->Ai [iterator->p]) ; - } - } + i = GB_IGET (iterator->Ai, iterator->p) ; + j = iterator->k ; break ; case GxB_HYPERSPARSE : - { - if (iterator->by_col) - { - (*row) = (GrB_Index) (iterator->Ai [iterator->p]) ; - (*col) = (GrB_Index) (iterator->Ah [iterator->k]) ; - } - else - { - (*row) = (GrB_Index) (iterator->Ah [iterator->k]) ; - (*col) = (GrB_Index) (iterator->Ai [iterator->p]) ; - } - } + i = GB_IGET (iterator->Ai, iterator->p) ; + j = GB_IGET (iterator->Ah, iterator->k) ; break ; case GxB_BITMAP : case GxB_FULL : - { - if (iterator->by_col) - { - (*row) = (GrB_Index) (iterator->p - iterator->pstart) ; - (*col) = (GrB_Index) (iterator->k) ; - } - else - { - (*row) = (GrB_Index) (iterator->k) ; - (*col) = (GrB_Index) (iterator->p - iterator->pstart) ; - } - } + i = iterator->p - iterator->pstart ; + j = iterator->k ; break ; } + + if (iterator->by_col) + { + (*row) = i ; + (*col) = j ; + } + else + { + (*row) = j ; + (*col) = i ; + } } diff --git a/GraphBLAS/Source/iterator/GxB_Vector_Iterator.c b/GraphBLAS/Source/iterator/GxB_Vector_Iterator.c index 2cf80f9add..42cc8f42fc 100644 --- a/GraphBLAS/Source/iterator/GxB_Vector_Iterator.c +++ b/GraphBLAS/Source/iterator/GxB_Vector_Iterator.c @@ -2,7 +2,7 @@ // GxB_Vector_Iterator: iterate over the entries of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,7 @@ GrB_Info GxB_Vector_Iterator_attach GrB_Info GB_Vector_Iterator_bitmap_seek ( - GxB_Iterator iterator, - GrB_Index unused // note: unused parameter to be removed in v8.x + GxB_Iterator iterator ) { for ( ; iterator->p < iterator->pmax ; iterator->p++) @@ -45,13 +44,13 @@ GrB_Info GB_Vector_Iterator_bitmap_seek return (GxB_EXHAUSTED) ; } -GrB_Index GxB_Vector_Iterator_getpmax (GxB_Iterator iterator) +uint64_t GxB_Vector_Iterator_getpmax (GxB_Iterator iterator) { // return the range of the vector iterator return (iterator->pmax) ; } -GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, GrB_Index p) +GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator, uint64_t p) { // seek to a specific entry in the vector return (GB_Vector_Iterator_seek (iterator, p)) ; @@ -63,15 +62,17 @@ GrB_Info GxB_Vector_Iterator_next (GxB_Iterator iterator) return (GB_Vector_Iterator_next (iterator)) ; } -GrB_Index GxB_Vector_Iterator_getp (GxB_Iterator iterator) +uint64_t GxB_Vector_Iterator_getp (GxB_Iterator iterator) { // get the current position of a vector iterator return (iterator->p) ; } -GrB_Index GxB_Vector_Iterator_getIndex (GxB_Iterator iterator) +uint64_t GxB_Vector_Iterator_getIndex (GxB_Iterator iterator) { // get the index of a vector entry - return ((iterator->Ai != NULL) ? iterator->Ai [iterator->p] : iterator->p) ; + return ( + iterator->Ai32 ? iterator->Ai32 [iterator->p] : + (iterator->Ai64 ? iterator->Ai64 [iterator->p] : iterator->p)) ; } diff --git a/GraphBLAS/Source/iterator/GxB_colIterator.c b/GraphBLAS/Source/iterator/GxB_colIterator.c index ccedf15d49..3fc84f85fc 100644 --- a/GraphBLAS/Source/iterator/GxB_colIterator.c +++ b/GraphBLAS/Source/iterator/GxB_colIterator.c @@ -2,7 +2,7 @@ // GxB_colIterator_*: iterate over columns of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,20 +33,20 @@ GrB_Info GxB_colIterator_attach return (GB_Iterator_attach (iterator, A, GxB_BY_COL, desc)) ; } -GrB_Index GxB_colIterator_kount (GxB_Iterator iterator) +uint64_t GxB_colIterator_kount (GxB_Iterator iterator) { // return # of nonempty columns of the matrix return (iterator->anvec) ; } -GrB_Info GxB_colIterator_seekCol (GxB_Iterator iterator, GrB_Index col) +GrB_Info GxB_colIterator_seekCol (GxB_Iterator iterator, uint64_t col) { // move a column iterator that is already attached to A, to the first // entry of A(:,col) return (GB_Iterator_rc_seek (iterator, col, false)) ; } -GrB_Info GxB_colIterator_kseek (GxB_Iterator iterator, GrB_Index k) +GrB_Info GxB_colIterator_kseek (GxB_Iterator iterator, uint64_t k) { // move a column iterator that is already attached to A, to the first // entry of the kth non-empty column of A @@ -65,13 +65,13 @@ GrB_Info GxB_colIterator_nextRow (GxB_Iterator iterator) return (GB_Iterator_rc_inext (iterator)) ; } -GrB_Index GxB_colIterator_getColIndex (GxB_Iterator iterator) +uint64_t GxB_colIterator_getColIndex (GxB_Iterator iterator) { // return the column index of the current entry for a column iterator return (GB_Iterator_rc_getj (iterator)) ; } -GrB_Index GxB_colIterator_getRowIndex (GxB_Iterator iterator) +uint64_t GxB_colIterator_getRowIndex (GxB_Iterator iterator) { // return the row index of the current entry for a column iterator return (GB_Iterator_rc_geti (iterator)) ; diff --git a/GraphBLAS/Source/iterator/GxB_rowIterator.c b/GraphBLAS/Source/iterator/GxB_rowIterator.c index b2e7d654ac..2b188a3d5f 100644 --- a/GraphBLAS/Source/iterator/GxB_rowIterator.c +++ b/GraphBLAS/Source/iterator/GxB_rowIterator.c @@ -2,7 +2,7 @@ // GxB_rowIterator_*: iterate over the rows of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -65,7 +65,7 @@ GrB_Info GxB_rowIterator_attach // kount == m. If A is hypersparse, kount is the # of vectors held in the data // structure for the matrix, some of which may be empty, and kount <= m. -GrB_Index GxB_rowIterator_kount (GxB_Iterator iterator) +uint64_t GxB_rowIterator_kount (GxB_Iterator iterator) { return (iterator->anvec) ; } @@ -97,7 +97,7 @@ GrB_Index GxB_rowIterator_kount (GxB_Iterator iterator) // the first entry in A(row,:), and GxB_Iterator_get* can // return its value. -GrB_Info GxB_rowIterator_seekRow (GxB_Iterator iterator, GrB_Index row) +GrB_Info GxB_rowIterator_seekRow (GxB_Iterator iterator, uint64_t row) { return (GB_Iterator_rc_seek (iterator, row, false)) ; } @@ -114,7 +114,7 @@ GrB_Info GxB_rowIterator_seekRow (GxB_Iterator iterator, GrB_Index row) // More precisely, k is in the range 0 to kount-1, where kount is the value // returned by GxB_rowIterator_kount. -GrB_Info GxB_rowIterator_kseek (GxB_Iterator iterator, GrB_Index k) +GrB_Info GxB_rowIterator_kseek (GxB_Iterator iterator, uint64_t k) { return (GB_Iterator_rc_seek (iterator, k, true)) ; } @@ -173,7 +173,7 @@ GrB_Info GxB_rowIterator_nextCol (GxB_Iterator iterator) // GxB_rowIterator_*seek* has not been called, but this does not mean the // iterator is positioned at row zero. -GrB_Index GxB_rowIterator_getRowIndex (GxB_Iterator iterator) +uint64_t GxB_rowIterator_getRowIndex (GxB_Iterator iterator) { return (GB_Iterator_rc_getj (iterator)) ; } @@ -188,7 +188,7 @@ GrB_Index GxB_rowIterator_getRowIndex (GxB_Iterator iterator) // GxB_rowIterator_*seek* or GxB_rowIterator_*next*, must have returned // GrB_SUCCESS. Results are undefined if this condition is not met. -GrB_Index GxB_rowIterator_getColIndex (GxB_Iterator iterator) +uint64_t GxB_rowIterator_getColIndex (GxB_Iterator iterator) { return (GB_Iterator_rc_geti (iterator)) ; } diff --git a/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel.h b/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel.h index a030a05551..e66b6f301c 100644 --- a/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel.h +++ b/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel.h @@ -2,12 +2,13 @@ // GB_jit_kernel.h: JIT kernel #include for all kernels (both CPU and CUDA) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// This file is #include'd into all JIT kernels on the CPU and the GPU. +// This file is #include'd into all JIT and PreJIT kernels on the CPU and the +// GPU. It is not used outside of the JIT and PreJIT kernels. #ifndef GB_JIT_KERNEL_H #define GB_JIT_KERNEL_H @@ -15,14 +16,15 @@ #define GB_JIT_KERNEL #ifndef GB_CUDA_KERNEL - // for CPU JIT kernels: + // for CPU JIT and PreJIT kernels: #include "include/GB_include.h" #else - // for CUDA JIT kernels: + // for CUDA JIT and PreJIT kernels: #include "include/GB_cuda_kernel.cuh" #endif -// for all JIT kernels +// for all JIT kernels: the GB_jit_kernel and GB_jit_query functions must be +// exported so that GB_jitifyer can find the symbols when loading the kernels. #include "include/GB_jit_kernel_proto.h" #if defined (_MSC_VER) && !(defined (__INTEL_COMPILER) || defined(__INTEL_CLANG_COMPILER)) #define GB_JIT_GLOBAL extern __declspec ( dllexport ) @@ -30,76 +32,13 @@ #define GB_JIT_GLOBAL #endif +// Runtime JIT kernels are compiled with -DGB_JIT_RUNTIME, which PreJIT +// kernels do not have. PreJIT kernels do not use callback function pointers, +// so they require the constant function declarations in GB_callbacks.h. #ifndef GB_JIT_RUNTIME // for PreJIT kernels (CPU and CUDA) #include "callback/GB_callbacks.h" #endif -// these macros are redefined by the JIT kernels to specialize them for each -// specific matrix format. - -// accessing the C matrix -#undef GBP_C -#undef GBH_C -#undef GBI_C -#undef GBB_C -#undef GBX_C -#undef GB_C_NVALS -#undef GB_C_NHELD - -// accessing the A matrix -#undef GBP_A -#undef GBH_A -#undef GBI_A -#undef GBB_A -#undef GBX_A -#undef GB_A_NVALS -#undef GB_A_NHELD - -// accessing the B matrix -#undef GBP_B -#undef GBH_B -#undef GBI_B -#undef GBB_B -#undef GBX_B -#undef GB_B_NVALS -#undef GB_B_NHELD - -// accessing the M matrix -#undef GBP_M -#undef GBH_M -#undef GBI_M -#undef GBB_M -#undef GBX_M -#undef GB_M_NVALS -#undef GB_M_NHELD - -#undef GB_M_TYPE -#undef GB_MCAST - -// accessing the S matrix for assign methods -#undef GBP_S -#undef GBH_S -#undef GBI_S -#undef GBB_S - -// accessing the Z matrix for masker methods -#undef GBP_Z -#undef GBH_Z -#undef GBI_Z -#undef GBB_Z -#undef GBX_Z -#undef GB_Z_NVALS -#undef GB_Z_NHELD - -// accessing the R matrix for masker methods -#undef GBP_R -#undef GBH_R -#undef GBI_R -#undef GBB_R -#undef GBX_R -#undef GB_R_NVALS -#undef GB_R_NHELD - #endif diff --git a/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel_proto.h b/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel_proto.h index b74e60c6b5..c98a417187 100644 --- a/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel_proto.h +++ b/GraphBLAS/Source/jit_kernels/include/GB_jit_kernel_proto.h @@ -2,7 +2,7 @@ // GB_jit_kernel_proto.h: prototypes for all JIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -49,7 +49,8 @@ GrB_Info GB_jit_kernel_add \ const int B_ntasks, \ const bool M_is_A, \ const bool M_is_B, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_APPLY_BIND1ST_PROTO(GB_jit_kernel_apply_bind1st) \ @@ -60,7 +61,8 @@ GrB_Info GB_jit_kernel_apply_bind1st \ const GB_void *Bx_input, \ const int8_t *restrict Bb, \ const int64_t bnz, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_APPLY_BIND2ND_PROTO(GB_jit_kernel_apply_bind2nd) \ @@ -71,7 +73,8 @@ GrB_Info GB_jit_kernel_apply_bind2nd \ const GB_void *y_input, \ const int8_t *restrict Ab, \ const int64_t anz, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_APPLY_UNOP_PROTO(GB_jit_kernel_apply_unop) \ @@ -82,7 +85,8 @@ GrB_Info GB_jit_kernel_apply_unop \ const void *ythunk, /* for idx unops (op->ytype scalar) */ \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_DOT2_PROTO(GB_jit_kernel_AxB_dot2) \ @@ -97,7 +101,8 @@ GrB_Info GB_jit_kernel_AxB_dot2 \ const int nthreads, \ const int naslice, \ const int nbslice, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_DOT2N_PROTO(GB_jit_kernel_AxB_dot2n) \ @@ -112,7 +117,8 @@ GrB_Info GB_jit_kernel_AxB_dot2n \ const int nthreads, \ const int naslice, \ const int nbslice, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_DOT3_PROTO(GB_jit_kernel_AxB_dot3) \ @@ -125,7 +131,8 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ const GB_task_struct *restrict TaskList, \ const int ntasks, \ const int nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_DOT4_PROTO(GB_jit_kernel_AxB_dot4) \ @@ -140,8 +147,8 @@ GrB_Info GB_jit_kernel_AxB_dot4 \ const int nbslice, \ const int nthreads, \ GB_Werk Werk, \ - const GB_callback_struct *restrict my_callback, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_SAXBIT_PROTO(GB_jit_kernel_AxB_saxbit) \ @@ -165,8 +172,8 @@ GrB_Info GB_jit_kernel_AxB_saxbit \ int8_t *restrict Wf, \ const int nthreads_max, \ double chunk, \ - const GB_callback_struct *restrict my_callback, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_SAXPY3_PROTO(GB_jit_kernel_AxB_saxpy3) \ @@ -185,8 +192,8 @@ GrB_Info GB_jit_kernel_AxB_saxpy3 \ const int nthreads_max, \ double chunk, \ GB_Werk Werk, \ - const GB_callback_struct *restrict my_callback, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_SAXPY4_PROTO(GB_jit_kernel_AxB_saxpy4) \ @@ -204,7 +211,8 @@ GrB_Info GB_jit_kernel_AxB_saxpy4 \ const int64_t *restrict H_slice, \ GB_void *restrict Wcx, \ int8_t *restrict Wf, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_AXB_SAXPY5_PROTO(GB_jit_kernel_AxB_saxpy5) \ @@ -218,22 +226,24 @@ GrB_Info GB_jit_kernel_AxB_saxpy5 \ const int64_t *restrict B_slice, \ bool cpu_has_avx2, \ bool cpu_has_avx512f, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_BUILD_PROTO(GB_jit_kernel_build) \ GrB_Info GB_jit_kernel_build \ ( \ GB_void *restrict Tx_void, \ - int64_t *restrict Ti, \ + void *restrict Ti_void, \ const GB_void *restrict Sx_void, \ const int64_t nvals, \ - const int64_t ndupl, \ - const int64_t *restrict I_work, \ - const int64_t *restrict K_work, \ + const void *restrict I_work_void, \ + const void *restrict K_work_void, \ + const int64_t duplicate_entry_input, \ const int64_t *restrict tstart_slice, \ const int64_t *restrict tnz_slice, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_COLSCALE_PROTO(GB_jit_kernel_colscale) \ @@ -244,7 +254,8 @@ GrB_Info GB_jit_kernel_colscale \ const GrB_Matrix D, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_CONCAT_BITMAP_PROTO(GB_jit_kernel_concat_bitmap) \ @@ -267,7 +278,8 @@ GrB_Info GB_jit_kernel_concat_full \ const int64_t cistart, \ const int64_t cvstart, \ const GrB_Matrix A, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_CONCAT_SPARSE_PROTO(GB_jit_kernel_concat_sparse) \ @@ -276,10 +288,11 @@ GrB_Info GB_jit_kernel_concat_sparse \ GrB_Matrix C, \ const int64_t cistart, \ const GrB_Matrix A, \ - int64_t *restrict W, \ + const void *W_parameter, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_CONVERT_S2B_PROTO(GB_jit_kernel_convert_s2b) \ @@ -290,7 +303,8 @@ GrB_Info GB_jit_kernel_convert_s2b \ const GrB_Matrix A, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EMULT_02_PROTO(GB_jit_kernel_emult_02) \ @@ -302,11 +316,12 @@ GrB_Info GB_jit_kernel_emult_02 \ const bool Mask_comp, \ const GrB_Matrix A, \ const GrB_Matrix B, \ - const int64_t *restrict Cp_kfirst, \ + const uint64_t *restrict Cp_kfirst, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ const int A_nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EMULT_03_PROTO(GB_jit_kernel_emult_03) \ @@ -318,11 +333,12 @@ GrB_Info GB_jit_kernel_emult_03 \ const bool Mask_comp, \ const GrB_Matrix A, \ const GrB_Matrix B, \ - const int64_t *restrict Cp_kfirst, \ + const uint64_t *restrict Cp_kfirst, \ const int64_t *B_ek_slicing, \ const int B_ntasks, \ const int B_nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EMULT_04_PROTO(GB_jit_kernel_emult_04) \ @@ -333,11 +349,12 @@ GrB_Info GB_jit_kernel_emult_04 \ const bool Mask_struct, \ const GrB_Matrix A, \ const GrB_Matrix B, \ - const int64_t *restrict Cp_kfirst, \ + const uint64_t *restrict Cp_kfirst, \ const int64_t *M_ek_slicing, \ const int M_ntasks, \ const int M_nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EMULT_08_PROTO(GB_jit_kernel_emult_08) \ @@ -355,7 +372,8 @@ GrB_Info GB_jit_kernel_emult_08 \ const GB_task_struct *restrict TaskList, \ const int C_ntasks, \ const int C_nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EMULT_BITMAP_PROTO(GB_jit_kernel_emult_bitmap) \ @@ -371,8 +389,8 @@ GrB_Info GB_jit_kernel_emult_bitmap \ const int M_ntasks, \ const int M_nthreads, \ const int C_nthreads, \ - const GB_callback_struct *restrict my_callback, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EWISE_FULLA_PROTO(GB_jit_kernel_ewise_fulla) \ @@ -382,7 +400,8 @@ GrB_Info GB_jit_kernel_ewise_fulla \ const GrB_Matrix A, \ const GrB_Matrix B, \ const int nthreads, \ - const bool A_is_B \ + const bool A_is_B, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_EWISE_FULLN_PROTO(GB_jit_kernel_ewise_fulln) \ @@ -391,7 +410,8 @@ GrB_Info GB_jit_kernel_ewise_fulln \ GrB_Matrix C, \ const GrB_Matrix A, \ const GrB_Matrix B, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_REDUCE_PROTO(GB_jit_kernel_reduce) \ @@ -402,7 +422,8 @@ GrB_Info GB_jit_kernel_reduce \ GB_void *restrict Workspace, \ bool *restrict F, \ const int ntasks, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_ROWSCALE_PROTO(GB_jit_kernel_rowscale) \ @@ -411,25 +432,26 @@ GrB_Info GB_jit_kernel_rowscale \ GrB_Matrix C, \ const GrB_Matrix D, \ const GrB_Matrix B, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SELECT_BITMAP_PROTO(GB_jit_kernel_select_bitmap) \ GrB_Info GB_jit_kernel_select_bitmap \ ( \ - int8_t *Cb, \ - int64_t *cnvals_handle, \ + GrB_Matrix C, \ GrB_Matrix A, \ const GB_void *restrict ythunk, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SELECT_PHASE1_PROTO(GB_jit_kernel_select_phase1) \ GrB_Info GB_jit_kernel_select_phase1 \ ( \ - int64_t *restrict Cp, \ - int64_t *restrict Wfirst, \ - int64_t *restrict Wlast, \ + GrB_Matrix C, \ + uint64_t *restrict Wfirst, \ + uint64_t *restrict Wlast, \ const GrB_Matrix A, \ const GB_void *restrict ythunk, \ const int64_t *A_ek_slicing, \ @@ -441,15 +463,14 @@ GrB_Info GB_jit_kernel_select_phase1 \ #define GB_JIT_KERNEL_SELECT_PHASE2_PROTO(GB_jit_kernel_select_phase2) \ GrB_Info GB_jit_kernel_select_phase2 \ ( \ - int64_t *restrict Ci, \ - GB_void *restrict Cx_out, \ - const int64_t *restrict Cp, \ - const int64_t *restrict Cp_kfirst, \ + GrB_Matrix C, \ + const uint64_t *restrict Cp_kfirst, \ const GrB_Matrix A, \ const GB_void *restrict ythunk, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SPLIT_BITMAP_PROTO(GB_jit_kernel_split_bitmap) \ @@ -459,7 +480,8 @@ GrB_Info GB_jit_kernel_split_bitmap \ GrB_Matrix A, \ const int64_t avstart, \ const int64_t aistart, \ - const int C_nthreads \ + const int C_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SPLIT_FULL_PROTO(GB_jit_kernel_split_full) \ @@ -469,7 +491,8 @@ GrB_Info GB_jit_kernel_split_full \ GrB_Matrix A, \ const int64_t avstart, \ const int64_t aistart, \ - const int C_nthreads \ + const int C_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SPLIT_SPARSE_PROTO(GB_jit_kernel_split_sparse) \ @@ -479,10 +502,11 @@ GrB_Info GB_jit_kernel_split_sparse \ GrB_Matrix A, \ const int64_t akstart, \ const int64_t aistart, \ - int64_t *restrict Wp, \ + const void *Wp_workspace, \ const int64_t *C_ek_slicing, \ const int C_ntasks, \ - const int C_nthreads \ + const int C_nthreads, \ + const GB_callback_struct *restrict my_callback \ ) // used for all subassign kernels: @@ -491,12 +515,12 @@ GrB_Info GB_jit_kernel_subassign_any \ ( \ GrB_Matrix C, \ const bool C_replace, \ - const GrB_Index *I, \ + const void *I_input, \ const int64_t ni, \ const int64_t nI, \ const int Ikind, \ const int64_t Icolon [3], \ - const GrB_Index *J, \ + const void *J_input, \ const int64_t nj, \ const int64_t nJ, \ const int Jkind, \ @@ -522,10 +546,11 @@ GrB_Info GB_jit_kernel_trans_bind1st \ GrB_Matrix C, \ const GB_void *x_input, \ const GrB_Matrix A, \ - int64_t *restrict *Workspaces, \ + void **Workspaces, \ const int64_t *restrict A_slice, \ const int nworkspaces, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_TRANS_BIND2ND_PROTO(GB_jit_kernel_trans_bind2nd) \ @@ -534,10 +559,11 @@ GrB_Info GB_jit_kernel_trans_bind2nd \ GrB_Matrix C, \ const GrB_Matrix A, \ const GB_void *y_input, \ - int64_t *restrict *Workspaces, \ + void **Workspaces, \ const int64_t *restrict A_slice, \ const int nworkspaces, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_TRANS_UNOP_PROTO(GB_jit_kernel_trans_unop) \ @@ -545,10 +571,11 @@ GrB_Info GB_jit_kernel_trans_unop \ ( \ GrB_Matrix C, \ const GrB_Matrix A, \ - int64_t *restrict *Workspaces, \ + void **Workspaces, \ const int64_t *restrict A_slice, \ const int nworkspaces, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_UNION_PROTO(GB_jit_kernel_union) \ @@ -578,19 +605,20 @@ GrB_Info GB_jit_kernel_union \ const int B_ntasks, \ const bool M_is_A, \ const bool M_is_B, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_MASKER_PHASE1_PROTO(GB_jit_kernel_masker1) \ GrB_Info GB_jit_kernel_masker1 \ ( \ - int64_t *Rp, \ + void *Rp_parameter, \ int64_t *Rnvec_nonempty, \ GB_task_struct *restrict TaskList, \ const int R_ntasks, \ const int R_nthreads, \ const int64_t Rnvec, \ - const int64_t *restrict Rh, \ + const void *Rh_parameter, \ const int64_t *restrict R_to_M, \ const int64_t *restrict R_to_C, \ const int64_t *restrict R_to_Z, \ @@ -598,7 +626,8 @@ GrB_Info GB_jit_kernel_masker1 \ const bool Mask_comp, \ const bool Mask_struct, \ const GrB_Matrix C, \ - const GrB_Matrix Z \ + const GrB_Matrix Z, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_MASKER_PHASE2_PROTO(GB_jit_kernel_masker2) \ @@ -621,7 +650,8 @@ GrB_Info GB_jit_kernel_masker2 \ const int C_ntasks, \ const int64_t *restrict M_ek_slicing, \ const int M_nthreads, \ - const int M_ntasks \ + const int M_ntasks, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SUBREF_SPARSE_PROTO(GB_jit_kernel_subref_sparse) \ @@ -632,14 +662,14 @@ GrB_Info GB_jit_kernel_subref_sparse \ const int ntasks, \ const int nthreads, \ const bool post_sort, \ - const int64_t *Mark, \ - const int64_t *Inext, \ - const int64_t *restrict Ap_start, \ - const int64_t *restrict Ap_end, \ + const void *Ihead_input, \ + const void *Inext_input, \ + const void *Ap_start_input, \ + const void *Ap_end_input, \ const int64_t nI, \ const int64_t Icolon [3], \ const GrB_Matrix A, \ - const GrB_Index *I, \ + const void *I_input, \ const GB_callback_struct *restrict my_callback \ ) @@ -648,13 +678,11 @@ GrB_Info GB_jit_kernel_bitmap_subref \ ( \ GrB_Matrix C, \ GrB_Matrix A, \ - const GrB_Index *I, \ + const void *I_input, \ const int64_t nI, \ - const int Ikind, \ const int64_t Icolon [3], \ - const GrB_Index *J, \ + const void *J_input, \ const int64_t nJ, \ - const int Jkind, \ const int64_t Jcolon [3], \ GB_Werk Werk, \ const int nthreads_max, \ @@ -668,7 +696,8 @@ GrB_Info GB_jit_kernel_iso_expand \ void *restrict X, \ const int64_t n, \ const void *restrict scalar, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_UNJUMBLE_PROTO(GB_jit_kernel_unjumble) \ @@ -677,19 +706,21 @@ GrB_Info GB_jit_kernel_unjumble \ const GrB_Matrix A, \ const int64_t *A_slice, \ const int ntasks, \ - const int nthreads \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_CONVERT_B2S_PROTO(GB_jit_kernel_convert_b2s) \ GrB_Info GB_jit_kernel_convert_b2s \ ( \ - const int64_t *restrict Cp, \ - int64_t *restrict Ci, \ - int64_t *restrict Cj, \ - GB_void *restrict Cx_new, \ + const void *Cp_input, \ + void *Ci_input, \ + void *Cj_input, \ + void *Cx_new, \ const GrB_Matrix A, \ - const int64_t *restrict W, \ - const int nthreads \ + const void *W_input, \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_KRONER_PROTO(GB_jit_kernel_kroner) \ @@ -699,7 +730,8 @@ GrB_Info GB_jit_kernel_kroner \ const GrB_Matrix A, \ const GrB_Matrix B, \ const int nthreads, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_KERNEL_SORT_PROTO(GB_jit_kernel_sort) \ @@ -723,7 +755,8 @@ GrB_Info GB_jit_kernel_reduce \ const GrB_Matrix A, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_CUDA_KERNEL_ROWSCALE_PROTO(GB_jit_kernel_rowscale) \ @@ -734,7 +767,8 @@ GrB_Info GB_jit_kernel_rowscale \ GrB_Matrix B, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_CUDA_KERNEL_COLSCALE_PROTO(GB_jit_kernel_colscale) \ @@ -745,7 +779,8 @@ GrB_Info GB_jit_kernel_colscale \ GrB_Matrix D, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) #define GB_JIT_CUDA_KERNEL_APPLY_BIND1ST_PROTO(GB_jit_kernel_apply_bind1st) \ @@ -756,7 +791,8 @@ GrB_Info GB_jit_kernel_apply_bind1st \ GrB_Matrix B, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) \ #define GB_JIT_CUDA_KERNEL_APPLY_BIND2ND_PROTO(GB_jit_kernel_apply_bind2nd) \ @@ -767,7 +803,8 @@ GrB_Info GB_jit_kernel_apply_bind2nd \ const GB_void *scalarx, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) \ #define GB_JIT_CUDA_KERNEL_APPLY_UNOP_PROTO(GB_jit_kernel_apply_unop) \ @@ -778,19 +815,20 @@ GrB_Info GB_jit_kernel_apply_unop \ const GB_void *ythunk, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) \ #define GB_JIT_CUDA_KERNEL_SELECT_BITMAP_PROTO(GB_jit_kernel_select_bitmap) \ GrB_Info GB_jit_kernel_select_bitmap \ ( \ - int8_t *Cb, \ - uint64_t *cnvals, \ + GrB_Matrix C, \ GrB_Matrix A, \ const GB_void *ythunk, \ cudaStream_t stream, \ int32_t gridsz, \ - int32_t blocksz \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ ) \ #define GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO(GB_jit_kernel_select_sparse) \ @@ -815,8 +853,8 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ cudaStream_t stream, \ int device, \ int number_of_sms, \ - const GB_callback_struct *restrict my_callback, \ - const void *theta \ + const void *theta, \ + const GB_callback_struct *restrict my_callback \ ) //------------------------------------------------------------------------------ @@ -888,10 +926,13 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ #undef GB_GET_CALLBACK #ifdef GB_JIT_RUNTIME // JIT kernels (CPU and CUDA) require the function pointers + #define GB_GET_CALLBACKS \ + GB_abort = my_callback->GB_abort_func #define GB_GET_CALLBACK(function) \ - function ## _f function = my_callback->function ## _func ; + function ## _f function = my_callback->function ## _func #else // PreJIT kernels link against -lgraphblas and do not need function pointers + #define GB_GET_CALLBACKS #define GB_GET_CALLBACK(function) #endif diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2.c index d01fffcf6a..c9e7c79065 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_dot2.c: JIT kernel for C<#M>=A'*B dot2 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT2_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT2_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_AxB_dot2_meta.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2n.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2n.c index df6f5db20d..0a1c364188 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2n.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot2n.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_dot2n.c: JIT kernel for C<#M>=A*B dot2n method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT2N_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT2N_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_A_NOT_TRANSPOSED #include "template/GB_AxB_dot2_meta.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot3.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot3.c index 2998e6b049..c32852fb3d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot3.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot3.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_dot3.c: JIT kernel for C=A'*B dot3 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT3_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT3_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_AxB_dot3_meta.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c index 30378d226e..6d87a02e48 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_dot4.c: JIT kernel for C+=A'*B dot4 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT4_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT4_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c index 9286e68f3e..5a141a0ee6 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_saxbit.c: saxbit matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXBIT_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXBIT_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; #include "template/GB_AxB_saxbit_template.c" diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c index ac1caa6c37..d4ef9f80ec 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c @@ -2,11 +2,15 @@ // GB_jit_kernel_AxB_saxpy3.c: saxpy3 matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// create the qsort kernel +#define GB_A0_t GB_Ci_TYPE +#include "include/GB_qsort_1_kernel.h" + #define Mask_comp GB_MASK_COMP #define Mask_struct GB_MASK_STRUCT #include "include/GB_AxB_saxpy3_template.h" @@ -14,10 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY3_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY3_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_AxB_saxpy3_cumsum) ; GB_GET_CALLBACK (GB_bix_alloc) ; - GB_GET_CALLBACK (GB_qsort_1) ; ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; #include "template/GB_AxB_saxpy3_template.c" diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy4.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy4.c index 5b9a09e075..602ea6d223 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy4.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy4.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_saxpy4.c: JIT kernel for C+=A*B saxpy4 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,6 +14,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY4_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY4_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_AxB_saxpy4_meta.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy5.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy5.c index 4b3acc6653..36838a8363 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy5.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy5.c @@ -2,7 +2,7 @@ // GB_jit_kernel_AxB_saxpy5: C+=A*B, C is full, A bitmap/full, B sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -118,6 +118,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY5_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY5_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #if GB_A_IS_PATTERN || GB_A_ISO { diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_add.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_add.c index ebce5d982e..930aef9e57 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_add.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_add.c @@ -2,7 +2,7 @@ // GB_jit_kernel_add.c: C=A+B, C<#M>=A+B, for eWiseAdd //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_ADD_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_ADD_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_IS_EWISEUNION 0 #include "template/GB_add_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind1st.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind1st.c index 32324415d2..db89ff5d98 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind1st.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind1st.c @@ -2,7 +2,7 @@ // GB_jit_kernel_apply_bind1st.c: Cx = op (x,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_BIND1ST_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_BIND1ST_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_apply_bind1st_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind2nd.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind2nd.c index 01a874bc84..698a497e06 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind2nd.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_bind2nd.c @@ -2,7 +2,7 @@ // GB_jit_kernel_apply_bind2nd.c: Cx = op (A,y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_BIND2ND_PROTO(GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_BIND2ND_PROTO(GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_apply_bind2nd_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_unop.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_unop.c index 7d06c0d915..f21acd24f5 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_unop.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_apply_unop.c @@ -2,7 +2,7 @@ // GB_jit_kernel_apply_unop.c: Cx = op (A) for unary or index unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,25 +12,24 @@ // cij = op (aij) #define GB_APPLY_OP(pC,pA) \ { \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBi_A (Ai, pA, avlen) ; \ GB_UNOP (Cx, pC, Ax, pA, A_iso, i, j, y) ; \ } #else // cij = op (aij) - #define GB_APPLY_OP(pC,pA) GB_UNOP (Cx, pC, Ax, pC, A_iso, i, j, y) + #define GB_APPLY_OP(pC,pA) GB_UNOP (Cx, pC, Ax, pA, A_iso, i, j, y) #endif GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_UNOP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_UNOP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; GB_C_TYPE *Cx = (GB_C_TYPE *) Cx_out ; GB_A_TYPE *Ax = (GB_A_TYPE *) A->x ; - #if GB_A_IS_BITMAP int8_t *restrict Ab = A->b ; - #endif GB_A_NHELD (anz) ; // int64_t anz = GB_nnz_held (A) ; #if GB_DEPENDS_ON_Y GB_Y_TYPE y = (*((GB_Y_TYPE *) ythunk)) ; @@ -38,17 +37,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_APPLY_UNOP_PROTO (GB_jit_kernel) #if GB_DEPENDS_ON_J { - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; int64_t avlen = A->vlen ; - #include "template/GB_apply_unop_ijp.c" + #include "template/GB_apply_unop_ijp_template.c" } #else { - #include "template/GB_apply_unop_ip.c" + #include "template/GB_apply_unop_ip_template.c" } - #endif return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c index 63c8ee01dd..1417ea04e3 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_1.c: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_1_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c index efade273f8..cdf3f55ba6 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_1_whole.c: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c index e1c5bde4c0..0a5236346c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_2.c: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_2_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c index 15845918fd..75ae4c6942 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_2_whole.c: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_memset) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c index a565c6cf2c..a5355f9543 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_3.c: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_3_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c index 6d8712b1d8..5a45d9c665 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_3_whole.c: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c index 7d74fd4bc7..d9bb7c32c0 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_4.c: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_4_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c index 441a863f88..b656b84d40 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_4_whole.c: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c index 829f330748..cc8e9f05a9 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_5.c: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_5_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c index eece762172..9a651a7a77 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_5_whole.c: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c index e04a2013f1..b8d2da77d8 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_6.c: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_memset) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_6_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c index 7252b4a77b..1fc3ab5aed 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_6b_whole.c: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_memset) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c index 19eecc840e..be25bc5c3b 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_7.c: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_memset) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_7_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c index cef93fc999..d730f1f37c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_7_whole.c: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c index e7061484e6..2cf71e74c3 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_8.c: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_memset) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_bitmap_assign_8_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c index ac9c69f318..bddd60c83d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c @@ -2,7 +2,7 @@ // GB_jit_kernel_bitmap_assign_8_whole.c: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_free_memory) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_build.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_build.c index 0a6434eccb..246479b9c9 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_build.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_build.c @@ -2,7 +2,7 @@ // GB_jit_kernel_build.c: kernel for GB_build //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,10 +10,14 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_BUILD_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_BUILD_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; GB_Tx_TYPE *restrict Tx = (GB_Tx_TYPE *) Tx_void ; const GB_Sx_TYPE *restrict Sx = (GB_Sx_TYPE *) Sx_void ; + GB_Ti_TYPE *restrict Ti = Ti_void ; + const GB_I_TYPE *restrict I_work = I_work_void ; + const GB_K_TYPE *restrict K_work = K_work_void ; + const GB_I_TYPE duplicate_entry = duplicate_entry_input ; #include "template/GB_bld_template.c" return (GrB_SUCCESS) ; } - diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_colscale.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_colscale.c index 3417f6ecb2..b1dd654f1a 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_colscale.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_colscale.c @@ -2,7 +2,7 @@ // GB_jit_kernel_colscale.c: C=A*D matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_COLSCALE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_COLSCALE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_colscale_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c index 7dc9270202..35a9b5fe51 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c @@ -2,7 +2,7 @@ // GB_jit_kernel_concat_bitmap: concatenate A into a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_BITMAP_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_ek_slice) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_full.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_full.c index 231e44de00..36aa446865 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_full.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_full.c @@ -2,7 +2,7 @@ // GB_jit_kernel_concat_full: concatenate a full A into a full matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_FULL_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_FULL_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_concat_full_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_sparse.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_sparse.c index 36a7becb0b..6a313c7acf 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_sparse.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_concat_sparse.c @@ -2,7 +2,7 @@ // GB_jit_kernel_concat_sparse: concatenate A into a sparse matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_SPARSE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_SPARSE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_concat_sparse_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c index 904fe480a2..8d6da735e4 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c @@ -2,7 +2,7 @@ // GB_jit_kernel_convert_b2s.c: convert sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_B2S_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_B2S_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_convert_b2s_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c index 9144bddeb3..2740d64bf3 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c @@ -2,7 +2,7 @@ // GB_jit_kernel_convert_s2b.c: convert sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_S2B_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_S2B_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_convert_s2b_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_02.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_02.c index 4f9699479d..b034916ab9 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_02.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_02.c @@ -2,7 +2,7 @@ // GB_jit_kernel_emult_02.c: C<#M>=A.*B, for emult_02 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_02_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_02_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_emult_02_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_03.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_03.c index e029403939..5a49d88b9a 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_03.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_03.c @@ -2,7 +2,7 @@ // GB_jit_kernel_emult_03.c: C<#M>=A.*B, for emult_03 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_03_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_03_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_emult_03_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_04.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_04.c index 63e4a8d7e5..ece418605f 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_04.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_04.c @@ -2,7 +2,7 @@ // GB_jit_kernel_emult_04.c: C<#M>=A.*B, for emult_04 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_04_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_04_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_emult_04_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_08.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_08.c index 948f05dc15..95504cfabd 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_08.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_08.c @@ -2,7 +2,7 @@ // GB_jit_kernel_emult_08.c: C<#M>=A.*B, for emult_08 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_08_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_08_PROTO (GB_jit_kernel) { - #include "template/GB_emult_08_meta.c" + GB_GET_CALLBACKS ; + #include "template/GB_emult_08_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c index 88d7b81746..c0a10b9a90 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c @@ -2,7 +2,7 @@ // GB_jit_kernel_emult_bitmap.c: C<#M>=A.*B, for emult_bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_BITMAP_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; #include "template/GB_emult_bitmap_template.c" diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulla.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulla.c index 85715b2fae..472fb9e7f2 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulla.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulla.c @@ -2,7 +2,7 @@ // GB_jit_kernel_ewise_fulla.c: C += A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EWISE_FULLA_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EWISE_FULLA_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_ewise_fulla_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulln.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulln.c index 988931ac68..bb1ee3ff72 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulln.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_ewise_fulln.c @@ -2,7 +2,7 @@ // GB_jit_kernel_ewise_fulln.c: C = A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EWISE_FULLN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EWISE_FULLN_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_ewise_fulln_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c index e38f00b68c..57244207a2 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c @@ -2,7 +2,7 @@ // GB_jit_kernel_iso_expand.c: expand an iso scalar into an array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_ISO_EXPAND_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_ISO_EXPAND_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; GB_A_TYPE *restrict Z = (GB_A_TYPE *) X ; GB_A_TYPE x = (* ((GB_A_TYPE *) scalar)) ; int64_t p ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_kroner.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_kroner.c index 1fb0f0af82..02845f85ea 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_kroner.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_kroner.c @@ -2,7 +2,7 @@ // GB_jit_kernel_kroner.c: kronecker product //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_KRONER_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_KRONER_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_kroner_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c index 4f7ea116f0..3f3892c38d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c @@ -2,7 +2,7 @@ // GB_jit_kernel_masker_phase1.c: count # of entries in R for R = masker(C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE1_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE1_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_PHASE_1_OF_2 #include "template/GB_masker_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c index 1f418f1723..251f0d7859 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c @@ -2,7 +2,7 @@ // GB_jit_kernel_masker_phase2.c: R = masker(C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE2_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE2_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_PHASE_2_OF_2 #include "template/GB_masker_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_reduce.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_reduce.c index 538df780f7..66e285aa63 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_reduce.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_reduce.c @@ -2,7 +2,7 @@ // GB_jit_kernel_reduce.c: JIT kernel for reduction to scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,7 +31,7 @@ //-------------------------------------------------------------------------- // GB_jit__reduce__14bb2.c //-------------------------------------------------------------------------- - // SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, + // SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -67,10 +67,10 @@ #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 1 #define GB_A_IS_FULL 0 - #define GBP_A(Ap,k,vlen) ((k) * (vlen)) - #define GBH_A(Ah,k) (k) - #define GBI_A(Ai,p,vlen) ((p) % (vlen)) - #define GBB_A(Ab,p) Ab [p] + #define GBp_A(Ap,k,vlen) ((k) * (vlen)) + #define GBh_A(Ah,k) (k) + #define GBi_A(Ai,p,vlen) ((p) % (vlen)) + #define GBb_A(Ab,p) Ab [p] #define GB_A_NVALS(e) int64_t e = A->nvals #define GB_A_NHELD(e) int64_t e = (A->vlen * A->vdim) #define GB_A_HAS_ZOMBIES 0 @@ -79,6 +79,8 @@ #define GB_A2TYPE double #define GB_DECLAREA(a) double a #define GB_GETA(a,Ax,p,iso) a = Ax [p] + #define GB_Ap_BITS 64 + #define GB_Ai_BITS 64 // panel size for reduction: #define GB_PANEL 32 @@ -93,7 +95,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x753d2d93e48ef09e ; - v [0] = 9 ; v [1] = 4 ; v [2] = 1 ; + v [0] = 10 ; v [1] = 0 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = NULL ; defn [2] = NULL ; @@ -117,18 +119,19 @@ // GB_JIT_KERNEL_REDUCE_PROTO, defined in // Source/jit_kernels/include/GB_jit_kernel_proto.h: -/* - #define GB_JIT_KERNEL_REDUCE_PROTO(GB_jit_kernel_reduce) \ - GrB_Info GB_jit_kernel_reduce \ - ( \ - GB_void *result, \ - const GrB_Matrix A, \ - GB_void *restrict Workspace, \ - bool *restrict F, \ - const int ntasks, \ - const int nthreads \ - ) -*/ +#if 0 +#define GB_JIT_KERNEL_REDUCE_PROTO(GB_jit_kernel_reduce) \ +GrB_Info GB_jit_kernel_reduce \ +( \ + GB_void *result, \ + const GrB_Matrix A, \ + GB_void *restrict Workspace, \ + bool *restrict F, \ + const int ntasks, \ + const int nthreads, \ + const GB_callback_struct *restrict my_callback \ +) +#endif // This macro is used because the identical prototype must appear in many // places, but with different function names. For example, if this kernel is @@ -139,6 +142,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_REDUCE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_REDUCE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; + GB_Z_TYPE z = (* ((GB_Z_TYPE *) result)) ; GB_Z_TYPE *W = (GB_Z_TYPE *) Workspace ; // The two templates below use the F and Workspace arrays to reduce A to diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_rowscale.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_rowscale.c index f106d70197..6c3a9923ff 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_rowscale.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_rowscale.c @@ -2,7 +2,7 @@ // GB_jit_kernel_rowscale.c: C=D*B matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_ROWSCALE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_ROWSCALE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_rowscale_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_bitmap.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_bitmap.c index 5a179e549d..1cd9a87089 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_bitmap.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_bitmap.c @@ -2,7 +2,7 @@ // GB_jit_kernel_select_bitmap: select bitmap JIT kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_BITMAP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #if GB_DEPENDS_ON_Y GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #endif diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c index b6d60dbe5c..b6bd7afecd 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c @@ -2,7 +2,7 @@ // GB_jit_kernel_select_phase1: select phase 1 JIT kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,9 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE1_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE1_PROTO (GB_jit_kernel) { - // get callback functions - GB_GET_CALLBACK (GB_ek_slice_merge1) ; - + GB_GET_CALLBACKS ; #if GB_DEPENDS_ON_Y GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #endif diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c index 53998a2d05..ca132d5e86 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c @@ -2,7 +2,7 @@ // GB_jit_kernel_select_phase2: select phase 2 JIT kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE2_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE2_PROTO (GB_jit_kernel) { - GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; + GB_GET_CALLBACKS ; #if GB_DEPENDS_ON_Y GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #endif diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_sort.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_sort.c index c3cfbf3b53..b58b2b3350 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_sort.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_sort.c @@ -2,7 +2,7 @@ // GB_jit_kernel_sort.c: JIT kernel to sort a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ #define GB_SORT(func) GB_jit_kernel_sort_ ## func #define GB_SORT_UDT 0 #define GB_ADDR(A,i) ((A) + (i)) -#define GB_GET(x,A,i) GB_DECLAREC (x) ; GB_GETC (x, A, i, ) +#define GB_GETX(x,A,i) GB_DECLAREC (x) ; GB_GETC (x, A, i, ) #define GB_COPY(A,i,B,j) A [i] = B [j] #define GB_SIZE sizeof (GB_C_TYPE) #define GB_SWAP(A,i,j) { GB_C_TYPE t = A [i] ; A [i] = A [j] ; A [j] = t ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_bitmap.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_bitmap.c index fab9474875..a27a1c8d2c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_bitmap.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_bitmap.c @@ -2,7 +2,7 @@ // GB_jit_kernel_split_bitmap: split bitmap A into a bitmap tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_BITMAP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_split_bitmap_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_full.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_full.c index c8be6a81be..35234c2f5c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_full.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_full.c @@ -2,7 +2,7 @@ // GB_jit_kernel_split_full: split full A into a full tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_FULL_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_FULL_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_split_full_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_sparse.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_sparse.c index 5b01600ac7..dc9d86c440 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_sparse.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_split_sparse.c @@ -2,7 +2,7 @@ // GB_jit_kernel_split_sparse: split sparse A into a sparse tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_SPARSE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SPLIT_SPARSE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_split_sparse_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c index 3c2cd0dab1..da986b0fbd 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_01.c: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_01_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c index eccaba4f3a..083a889426 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_02.c: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -19,6 +19,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_02_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c index b2400fc2b3..c285de3132 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_03.c: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,16 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_03_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c index 21804b6811..f98750f6c1 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_04.c: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -19,6 +19,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_04_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c index 938c791edf..5b3be57496 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_05.c: C(I,J) = scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_one_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_05_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c index ad5f5389e7..8c4b37a32c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_05d.c: C = scalar, when C is dense //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; GB_GET_CALLBACK (GB_ek_slice) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c index 12f317b64e..d0132b252a 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_06d.c: C = scalar, when C is dense //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; GB_GET_CALLBACK (GB_ek_slice) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c index 60d514eb3e..1437d11185 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_06n.c: C(I,J) = A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_one_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_06n_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c index b43b55d649..c99b657278 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_06s.c: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -20,6 +20,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_06s_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c index 381bbb92e8..396e73734c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_07.c: C(I,J) += scalar ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_one_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_07_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c index 4eb6085534..86ceaa4dc3 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_08n.c: C(I,J) += A ; no S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_Pending_ensure) ; GB_GET_CALLBACK (GB_subassign_08n_slice) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_08n_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c index 245b5557e8..0bdbfc8a88 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_08s.c: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -20,6 +20,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_08s_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c index bee6c2cd29..b680203a58 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_09.c: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -19,6 +19,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_09_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c index d653801ca4..d2ae2b51fb 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_10.c: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -20,6 +20,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_10_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c index 6a9aeaf8bb..bf53010b3c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_11.c: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -19,6 +19,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_11_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c index b5e00d1737..33fbbff0da 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_12.c: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -20,6 +20,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_12_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c index 989aaf0646..52bd7c9eb0 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_13.c: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_13_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c index d25a9f157d..2d52e994e6 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_15.c: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_15_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c index d52acf2479..a8017bdd96 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_17.c: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_17_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c index 144c59fe27..e38b33e9f8 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_19.c: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_werk_pop) ; GB_GET_CALLBACK (GB_werk_push) ; @@ -18,6 +18,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; GB_GET_CALLBACK (GB_Pending_ensure) ; + const GB_I_TYPE *I = I_input ; + const GB_J_TYPE *J = J_input ; + #include "template/GB_subassign_19_template.c" } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c index 3a8fe8505c..276497ac6a 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_22.c: C += y where C is dense, y is a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; GB_GET_CALLBACK (GB_ek_slice) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c index 5ecf70ae11..c2ebec6506 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_23.c: C += A where C is dense, A is sparse or dense //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; GB_GET_CALLBACK (GB_ek_slice) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c index 1c76a0fe34..7df3fbcb0c 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subassign_25.c: C(:,:) = A ; M struct, A bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_malloc_memory) ; GB_GET_CALLBACK (GB_ek_slice) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c index 308675baf2..ee31ba43aa 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c @@ -2,7 +2,7 @@ // GB_jit_kernel_subref_bitmap.c: A = C(I,J) where C and A are bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,24 +12,19 @@ #undef GB_FREE_ALL #define GB_FREE_ALL \ { \ - GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; \ + GB_FREE_MEMORY (&TaskList_IxJ, TaskList_IxJ_size) ; \ } GB_JIT_GLOBAL GB_JIT_KERNEL_BITMAP_SUBREF_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_BITMAP_SUBREF_PROTO (GB_jit_kernel) { - - //-------------------------------------------------------------------------- - // get callback functions, C, and A, and declare workspace - //-------------------------------------------------------------------------- - - GrB_Info info = GrB_SUCCESS ; - // get callback functions + GB_GET_CALLBACKS ; GB_GET_CALLBACK (GB_free_memory) ; GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; // declare the TaskList_IxJ workspace + GrB_Info info = GrB_SUCCESS ; GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; int ntasks_IxJ = 0, nthreads_IxJ = 0 ; @@ -43,16 +38,10 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_BITMAP_SUBREF_PROTO (GB_jit_kernel) const GB_C_TYPE *restrict Ax = (GB_C_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; - //-------------------------------------------------------------------------- - // C = A(I,J) where C and A are bitmap/full - //-------------------------------------------------------------------------- + const GB_I_TYPE *restrict I = I_input ; + const GB_J_TYPE *restrict J = J_input ; #include "template/GB_bitmap_subref_template.c" - - //-------------------------------------------------------------------------- - // free workspace and return result - //-------------------------------------------------------------------------- - GB_FREE_ALL ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c index 6ebecde644..845bc4a36e 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c @@ -2,21 +2,27 @@ // GB_jit_kernel_subref_sparse.c: C = A(I,J) where C and A are sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "include/GB_subref_method.h" + +// create the qsort kernel: +#define GB_A0_t GB_Ci_TYPE +#define GB_A1_t GB_C_TYPE #include "include/GB_qsort_1b_kernel.h" GB_JIT_GLOBAL GB_JIT_KERNEL_SUBREF_SPARSE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBREF_SPARSE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; // get C and A - const int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE_U (Ci, ) ; GB_Ci_PTR (Ci, C) ; + #define GB_COPY_RANGE(pC,pA,len) \ memcpy (Cx + (pC), Ax + (pA), (len) * sizeof (GB_C_TYPE)) ; #define GB_COPY_ENTRY(pC,pA) Cx [pC] = Ax [pA] ; @@ -24,10 +30,23 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SUBREF_SPARSE_PROTO (GB_jit_kernel) GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #define GB_QSORT_1B(Ci,Cx,pC,clen) GB_qsort_1b_kernel (Ci+pC, Cx+pC, clen) - // C = A(I,J) where C and A are sparse/hyper + // get Ap_start and Ap_end + const GB_Ap_TYPE *restrict Ap_start = Ap_start_input ; + const GB_Ap_TYPE *restrict Ap_end = Ap_end_input ; + + // get I + const GB_I_TYPE *restrict I = I_input ; + + // get I inverse lists + const GB_IHEAD_TYPE *restrict Ihead = Ihead_input ; + const GB_IHEAD_TYPE *restrict Inext = Inext_input ; + + #ifndef GB_Ai_IS_32 + #define GB_Ai_IS_32 (GB_Ai_BITS == 32) + #endif + #define GB_PHASE_2_OF_2 #include "template/GB_subref_template.c" - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind1st.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind1st.c index 7ad57d9cb2..9c6bdf1a7d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind1st.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind1st.c @@ -2,7 +2,7 @@ // GB_jit_kernel_trans_bind1st.c: Cx = op (x,A') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,6 +18,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_BIND1ST_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_BIND1ST_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_BIND_1ST GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; #include "template/GB_transpose_template.c" diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind2nd.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind2nd.c index ee54e5af91..8d879482d6 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind2nd.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_bind2nd.c @@ -2,7 +2,7 @@ // GB_jit_kernel_trans_bind2nd.c: Cx = op (A',x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,6 +19,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_BIND2ND_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_BIND2ND_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; #include "template/GB_transpose_template.c" return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_unop.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_unop.c index 3f9ca663a6..aa53ad0b0f 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_unop.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_trans_unop.c @@ -2,7 +2,7 @@ // GB_jit_kernel_trans_unop.c: C = op (A') for unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_UNOP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_TRANS_UNOP_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #include "template/GB_transpose_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_union.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_union.c index dc33a9cb04..51affb342d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_union.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_union.c @@ -2,7 +2,7 @@ // GB_jit_kernel_union.c: C=A+B, C<#M>=A+B, for eWiseUnion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_UNION_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_UNION_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; #define GB_IS_EWISEUNION 1 GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_unjumble.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_unjumble.c index 9a48d95c12..27a388985d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_unjumble.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_unjumble.c @@ -2,22 +2,30 @@ // GB_jit_kernel_unjumble.c: sort the vectors of a sparse/hyper matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// create the qsort kernel: +#if GB_Ai_IS_32 +#define GB_A0_t uint32_t +#else +#define GB_A0_t uint64_t +#endif +#define GB_A1_t GB_A_TYPE #include "include/GB_qsort_1b_kernel.h" GB_JIT_GLOBAL GB_JIT_KERNEL_UNJUMBLE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_UNJUMBLE_PROTO (GB_jit_kernel) { + GB_GET_CALLBACKS ; // get A - const int64_t *restrict Ap = A->p ; - int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE_U (Ai, ) ; GB_Ai_PTR (Ai, A) ; GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; // sort its vectors - #define GB_QSORT GB_qsort_1b_kernel (Ai+pA_start, Ax+pA_start, aknz) + #define GB_QSORT GB_qsort_1b_kernel (Ai+p, Ax+p, n) #include "template/GB_unjumbled_template.c" return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_op.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_op.c index 8fc52cdd4c..c9552597ce 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_op.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_op.c @@ -2,7 +2,7 @@ // GB_jit_kernel_user_op.c: JIT kernel for a user-defined operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_type.c b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_type.c index 9f7dfaf763..87a5075d0d 100644 --- a/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_type.c +++ b/GraphBLAS/Source/jit_kernels/template/GB_jit_kernel_user_type.c @@ -2,7 +2,7 @@ // GB_jit_kernel_user_type.c: JIT kernel for a user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2_jit.c index 710ab350ce..3e79c6d4e6 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2_jit.c @@ -2,7 +2,7 @@ // GB_AxB_dot2_jit: C=A'*B dot2 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,6 +41,7 @@ GrB_Info GB_AxB_dot2_jit // C=A'*B, dot2 method, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_DOT2, C->iso, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, M, Mask_struct, Mask_comp, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -58,8 +59,9 @@ GrB_Info GB_AxB_dot2_jit // C=A'*B, dot2 method, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, A_slice, B, B_slice, nthreads, naslice, - nbslice, semiring->multiply->theta)) ; + nbslice, semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2n_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2n_jit.c index 32bc8c0946..fc3c62e933 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2n_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot2n_jit.c @@ -2,7 +2,7 @@ // GB_AxB_dot2n_jit: C=A'*B dot2n method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,6 +41,7 @@ GrB_Info GB_AxB_dot2n_jit // C=A*B, dot2n method, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_DOT2N, C->iso, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, M, Mask_struct, Mask_comp, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -58,8 +59,9 @@ GrB_Info GB_AxB_dot2n_jit // C=A*B, dot2n method, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, A_slice, B, B_slice, nthreads, naslice, - nbslice, semiring->multiply->theta)) ; + nbslice, semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot3_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot3_jit.c index 8b474a195f..34457269bf 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot3_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot3_jit.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_jit: C=A'*B dot 3 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,6 +37,7 @@ GrB_Info GB_AxB_dot3_jit // C=A'B, dot3, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_DOT3, C->iso, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, M, Mask_struct, false, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -54,8 +55,9 @@ GrB_Info GB_AxB_dot3_jit // C=A'B, dot3, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, TaskList, ntasks, nthreads, - semiring->multiply->theta)) ; + semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot4_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot4_jit.c index 051297113b..149255fd6e 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_dot4_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_dot4_jit.c @@ -2,7 +2,7 @@ // GB_AxB_dot4_jit: C+=A'*B dot4 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,6 +40,7 @@ GrB_Info GB_AxB_dot4_jit // C+=A'*B, dot4 method, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_DOT4, false, C_in_iso, GxB_FULL, C->type, + /* OK, C is full: */ false, false, false, NULL, true, false, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -57,8 +58,9 @@ GrB_Info GB_AxB_dot4_jit // C+=A'*B, dot4 method, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, A_slice, B_slice, naslice, nbslice, - nthreads, Werk, &GB_callback, semiring->multiply->theta)) ; + nthreads, Werk, semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxbit_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxbit_jit.c index 56cabbf6ae..542f4cd7ff 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxbit_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxbit_jit.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_jit: C=A*B saxbit method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,6 +48,7 @@ GrB_Info GB_AxB_saxbit_jit // C=A*B, saxbit, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_SAXBIT, false, false, GxB_BITMAP, C->type, + /* OK, C is bitmap: */ false, false, false, M, Mask_struct, Mask_comp, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -68,10 +69,11 @@ GrB_Info GB_AxB_saxbit_jit // C=A*B, saxbit, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, use_atomics, M_ek_slicing, M_nthreads, M_ntasks, A_slice, H_slice, Wcx, Wf, - nthreads_max, chunk, &GB_callback, semiring->multiply->theta)) ; + nthreads_max, chunk, semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy3_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy3_jit.c index 55f5246318..4d698b0975 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy3_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy3_jit.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_jit: C=A*B saxpy3 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,6 +43,7 @@ GrB_Info GB_AxB_saxpy3_jit // C=A*B, saxpy3, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_SAXPY3, C->iso, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, M, Mask_struct, Mask_comp, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -63,9 +64,10 @@ GrB_Info GB_AxB_saxpy3_jit // C=A*B, saxpy3, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, M_in_place, A, B, (GB_saxpy3task_struct *) SaxpyTasks, ntasks, nfine, nthreads, do_sort, - nthreads_max, chunk, Werk, &GB_callback, semiring->multiply->theta)) ; + nthreads_max, chunk, Werk, semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy4_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy4_jit.c index 8800c6d6a7..70ad6e0cb6 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy4_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy4_jit.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4_jit: C+=A*B saxpy4 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,6 +44,7 @@ GrB_Info GB_AxB_saxpy4_jit // C+=A*B, saxpy4 method, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_SAXPY4, false, false, GxB_FULL, C->type, + /* OK, C is full: */ false, false, false, NULL, true, false, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -61,9 +62,10 @@ GrB_Info GB_AxB_saxpy4_jit // C+=A*B, saxpy4 method, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, use_atomics, A_slice, H_slice, Wcx, Wf, - semiring->multiply->theta)) ; + semiring->multiply->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy5_jit.c b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy5_jit.c index 6cbde0170f..0682e99752 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy5_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_AxB_saxpy5_jit.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5_jit: C+=A*B saxpy5 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,6 +38,7 @@ GrB_Info GB_AxB_saxpy5_jit // C+=A*B, saxpy5 method, via the JIT uint64_t hash = GB_encodify_mxm (&encoding, &suffix, GB_JIT_KERNEL_AXB_SAXPY5, false, false, GxB_FULL, C->type, + /* OK, C is full: */ false, false, false, NULL, true, false, semiring, flipxy, A, B) ; //-------------------------------------------------------------------------- @@ -57,8 +58,10 @@ GrB_Info GB_AxB_saxpy5_jit // C+=A*B, saxpy5 method, via the JIT bool cpu_has_avx2 = GB_Global_cpu_features_avx2 ( ) ; bool cpu_has_avx512f = GB_Global_cpu_features_avx512f ( ) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, ntasks, nthreads, B_slice, - cpu_has_avx2, cpu_has_avx512f, semiring->multiply->theta)) ; + cpu_has_avx2, cpu_has_avx512f, semiring->multiply->theta, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_add_jit.c b/GraphBLAS/Source/jit_wrappers/GB_add_jit.c index 36dab767a2..b8598461a4 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_add_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_add_jit.c @@ -2,7 +2,7 @@ // GB_add_jit: C=A+B, C<#M>=A+B add method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,8 +52,8 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_ADD, false, - false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -74,11 +74,12 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, A_ek_slicing, A_nthreads, A_ntasks, B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B, - binaryop->theta)) ; + binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_apply_bind1st_jit.c b/GraphBLAS/Source/jit_wrappers/GB_apply_bind1st_jit.c index ae59c08b80..991cba9979 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_apply_bind1st_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_apply_bind1st_jit.c @@ -2,7 +2,7 @@ // GB_apply_bind1st_jit: Cx=op(x,B) apply bind1st method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,9 +32,11 @@ GrB_Info GB_apply_bind1st_jit // Cx = op (x,B), apply bind1st via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_KERNEL_APPLYBIND1, false, - false, false, GxB_FULL, ctype, NULL, false, false, - binaryop, false, false, NULL, B) ; + GB_JIT_KERNEL_APPLYBIND1, /* is_eWiseMult: */ false, + /* C_iso: */ false, /* C_in_iso: */ false, GxB_FULL, ctype, + /* pji is_32: ignored; there is no C matrix: */ false, false, false, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, + binaryop, /* flipij: */ false, /* flipxy: */ false, /* A: */ NULL, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,8 +53,9 @@ GrB_Info GB_apply_bind1st_jit // Cx = op (x,B), apply bind1st via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (Cx, xscalar, B->x, B->b, GB_nnz_held (B), - nthreads)) ; + nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_apply_bind2nd_jit.c b/GraphBLAS/Source/jit_wrappers/GB_apply_bind2nd_jit.c index 040af3528c..b97bdf8b5a 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_apply_bind2nd_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_apply_bind2nd_jit.c @@ -2,7 +2,7 @@ // GB_apply_bind2nd_jit: Cx=op(A,y) apply bind2nd method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,9 +32,11 @@ GrB_Info GB_apply_bind2nd_jit // Cx = op (x,B), apply bind2nd via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_KERNEL_APPLYBIND2, false, - false, false, GxB_FULL, ctype, NULL, false, false, - binaryop, false, false, A, NULL) ; + GB_JIT_KERNEL_APPLYBIND2, /* is_eWiseMult: */ false, + /* C_iso: */ false, /* C_in_iso: */ false, GxB_FULL, ctype, + /* pji is_32: ignored; there is no C matrix: */ false, false, false, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, + binaryop, /* flipij: */ false, /* flipxy: */ false, A, /* B: */ NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,8 +53,9 @@ GrB_Info GB_apply_bind2nd_jit // Cx = op (x,B), apply bind2nd via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (Cx, A->x, yscalar, A->b, GB_nnz_held (A), - nthreads)) ; + nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_apply_unop_jit.c b/GraphBLAS/Source/jit_wrappers/GB_apply_unop_jit.c index 787a04696e..68d16163ee 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_apply_unop_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_apply_unop_jit.c @@ -2,7 +2,7 @@ // GB_apply_unop_jit: Cx=op(A) apply unop method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,8 +35,11 @@ GrB_Info GB_apply_unop_jit // Cx = op (A), apply unop via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, + /* pji_is_32: ignored; no matrix C: */ false, false, false, + op, flipij, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, + A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -53,7 +56,9 @@ GrB_Info GB_apply_unop_jit // Cx = op (A), apply unop via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cx, A, ythunk, A_ek_slicing, A_ntasks, A_nthreads)) ; + return (GB_jit_kernel (Cx, A, ythunk, A_ek_slicing, A_ntasks, A_nthreads, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_build_jit.c b/GraphBLAS/Source/jit_wrappers/GB_build_jit.c index 83225f73ca..89aeff1285 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_build_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_build_jit.c @@ -2,7 +2,7 @@ // GB_build_jit: JIT for GB_builder //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,16 +16,21 @@ GrB_Info GB_build_jit // GB_builder JIT kernel ( // output: GB_void *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, // input: + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t const GB_void *restrict Sx, const GrB_Type ttype, // type of Tx const GrB_Type stype, // type of Sx const GrB_BinaryOp dup, // operator for summing duplicates const int64_t nvals, // number of tuples const int64_t ndupl, // number of duplicates - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, // if true, I_work is uint32_t else uint64_t + const void *restrict K_work, + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + const int64_t duplicate_entry, // row index of duplicate entries const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -39,7 +44,8 @@ GrB_Info GB_build_jit // GB_builder JIT kernel GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_build (&encoding, &suffix, - GB_JIT_KERNEL_BUILD, dup, ttype, stype) ; + GB_JIT_KERNEL_BUILD, dup, ttype, stype, Ti_is_32, I_is_32, K_is_32, + K_is_null, ndupl == 0) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -56,8 +62,9 @@ GrB_Info GB_build_jit // GB_builder JIT kernel // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Tx, Ti, Sx, nvals, ndupl, I_work, K_work, - tstart_slice, tnz_slice, nthreads)) ; + return (GB_jit_kernel (Tx, Ti, Sx, nvals, I_work, K_work, + duplicate_entry, tstart_slice, tnz_slice, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_colscale_jit.c b/GraphBLAS/Source/jit_wrappers/GB_colscale_jit.c index 8b18b06316..4802c56a11 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_colscale_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_colscale_jit.c @@ -2,7 +2,7 @@ // GB_colscale_jit: C=A*D colscale method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,9 @@ GrB_Info GB_colscale_jit // C=A*D, colscale, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_COLSCALE, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, + /* C_iso: */ false, /* C_in_iso: */ false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + /* M: */ NULL, /* Mask_struct: */ false, /* Mask_comp: */ false, binaryop, false, flipxy, A, D) ; //-------------------------------------------------------------------------- @@ -53,7 +55,9 @@ GrB_Info GB_colscale_jit // C=A*D, colscale, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, D, A_ek_slicing, A_ntasks, A_nthreads)) ; + return (GB_jit_kernel (C, A, D, A_ek_slicing, A_ntasks, A_nthreads, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_concat_bitmap_jit.c b/GraphBLAS/Source/jit_wrappers/GB_concat_bitmap_jit.c index 5179df9410..b93fa94f1e 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_concat_bitmap_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_concat_bitmap_jit.c @@ -2,7 +2,7 @@ // GB_concat_bitmap_jit: concat A into a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,10 @@ GrB_Info GB_concat_bitmap_jit // concatenate A into a bitmap matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_BITMAP, GxB_BITMAP, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_CONCAT_BITMAP, GxB_BITMAP, true, C->type, + /* C is bitmap, is_32 is false: */ false, false, false, + op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -53,6 +55,7 @@ GrB_Info GB_concat_bitmap_jit // concatenate A into a bitmap matrix C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, cistart, cvstart, A, nthreads_max, chunk, Werk, &GB_callback)) ; diff --git a/GraphBLAS/Source/jit_wrappers/GB_concat_full_jit.c b/GraphBLAS/Source/jit_wrappers/GB_concat_full_jit.c index 45bb6f17c3..4f03fba30f 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_concat_full_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_concat_full_jit.c @@ -2,7 +2,7 @@ // GB_concat_full_jit: concat A into a full matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,9 @@ GrB_Info GB_concat_full_jit // concatenate A into a full matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_FULL, GxB_FULL, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_CONCAT_FULL, GxB_FULL, true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -50,7 +51,8 @@ GrB_Info GB_concat_full_jit // concatenate A into a full matrix C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, cistart, cvstart, A, A_nthreads)) ; + return (GB_jit_kernel (C, cistart, cvstart, A, A_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_concat_sparse_jit.c b/GraphBLAS/Source/jit_wrappers/GB_concat_sparse_jit.c index 777663460b..43099c4ae1 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_concat_sparse_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_concat_sparse_jit.c @@ -2,7 +2,7 @@ // GB_concat_sparse_jit: concat A into Ci, Cx where C is sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C int64_t cistart, const GB_Operator op, const GrB_Matrix A, - int64_t *restrict W, + void *W, // integer type matches C->p const int64_t *restrict A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -34,8 +34,9 @@ GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_SPARSE, GxB_SPARSE, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_CONCAT_SPARSE, GxB_SPARSE, true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -52,8 +53,9 @@ GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, cistart, A, W, A_ek_slicing, A_ntasks, - A_nthreads)) ; + A_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_convert_b2s_jit.c b/GraphBLAS/Source/jit_wrappers/GB_convert_b2s_jit.c index fbb6955dee..efd161e8ff 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_convert_b2s_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_convert_b2s_jit.c @@ -2,7 +2,7 @@ // GB_convert_b2s_jit: JIT kernel to convert bitmap to sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,16 +15,19 @@ typedef GB_JIT_KERNEL_CONVERT_B2S_PROTO ((*GB_jit_dl_function)) ; GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap ( // input: - const int64_t *restrict Cp, // vector pointers for CSC/CSR form + const void *Cp, // vector pointers for CSC/CSR form // outputs: - int64_t *restrict Ci, // indices for CSC/CSR or triplet form - int64_t *restrict Cj, // vector indices for triplet form + void *Ci, // indices for CSC/CSR or triplet form + void *Cj, // vector indices for triplet form GB_void *restrict Cx, // values for CSC/CSR or triplet form // inputs: not modified + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t, else uint64_t const GrB_Type ctype, // type of Cx GB_Operator op, const GrB_Matrix A, // matrix to extract; not modified - const int64_t *restrict W, // workspace + const void *W, // workspace int nthreads // # of threads to use ) { @@ -36,8 +39,9 @@ GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONVERT_B2S, GxB_SPARSE, false, ctype, op, false, - GxB_BITMAP, true, A->type, A->iso, 0) ; + GB_JIT_KERNEL_CONVERT_B2S, GxB_SPARSE, false, ctype, Cp_is_32, + Ci_is_32, Cj_is_32, op, false, GxB_BITMAP, true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, 0) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -54,7 +58,8 @@ GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cp, Ci, Cj, Cx, A, W, nthreads)) ; + return (GB_jit_kernel (Cp, Ci, Cj, Cx, A, W, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_convert_s2b_jit.c b/GraphBLAS/Source/jit_wrappers/GB_convert_s2b_jit.c index 981313b70e..9ca4b445ec 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_convert_s2b_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_convert_s2b_jit.c @@ -2,7 +2,7 @@ // GB_convert_s2b_jit: JIT kernel to convert sparse to bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,8 +36,9 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONVERT_S2B, GxB_FULL, false, A->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_CONVERT_S2B, GxB_FULL, false, A->type, false, false, + false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -54,7 +55,9 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cx, Cb, A, A_ek_slicing, A_ntasks, A_nthreads)) ; + return (GB_jit_kernel (Cx, Cb, A, A_ek_slicing, A_ntasks, A_nthreads, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_emult_02_jit.c b/GraphBLAS/Source/jit_wrappers/GB_emult_02_jit.c index 6ef8a8b8a2..7a1f6ae721 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_emult_02_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_emult_02_jit.c @@ -2,7 +2,7 @@ // GB_emult_02_jit: C<#M>=A.*B emult_02 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -40,8 +40,8 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT2, true, - false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -58,8 +58,10 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, - Cp_kfirst, A_ek_slicing, A_ntasks, A_nthreads, binaryop->theta)) ; + Cp_kfirst, A_ek_slicing, A_ntasks, A_nthreads, binaryop->theta, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_emult_03_jit.c b/GraphBLAS/Source/jit_wrappers/GB_emult_03_jit.c index d3f97aace6..ed9bdc87d6 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_emult_03_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_emult_03_jit.c @@ -2,7 +2,7 @@ // GB_emult_03_jit: C<#M>=A.*B emult_03 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -40,8 +40,8 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT3, true, - false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -58,8 +58,9 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, Cp_kfirst, - B_ek_slicing, B_ntasks, B_nthreads, binaryop->theta)) ; + B_ek_slicing, B_ntasks, B_nthreads, binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_emult_04_jit.c b/GraphBLAS/Source/jit_wrappers/GB_emult_04_jit.c index e957f66e80..0364a7428d 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_emult_04_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_emult_04_jit.c @@ -2,7 +2,7 @@ // GB_emult_04_jit: C=A.*B emult_04 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,7 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -39,8 +39,8 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT4, true, - false, false, C_sparsity, C->type, M, Mask_struct, false, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, false, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -57,8 +57,9 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, A, B, Cp_kfirst, M_ek_slicing, - M_ntasks, M_nthreads, binaryop->theta)) ; + M_ntasks, M_nthreads, binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_emult_08_jit.c b/GraphBLAS/Source/jit_wrappers/GB_emult_08_jit.c index 6aefe8aea7..2c72533b1c 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_emult_08_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_emult_08_jit.c @@ -2,7 +2,7 @@ // GB_emult_08_jit: C<#M>=A.*B emult_08 method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,8 +42,8 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT8, true, - false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -60,8 +60,10 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, C_to_M, C_to_A, - C_to_B, TaskList, C_ntasks, C_nthreads, binaryop->theta)) ; + C_to_B, TaskList, C_ntasks, C_nthreads, binaryop->theta, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_emult_bitmap_jit.c b/GraphBLAS/Source/jit_wrappers/GB_emult_bitmap_jit.c index e27f1105af..811198b9bd 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_emult_bitmap_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_emult_bitmap_jit.c @@ -2,7 +2,7 @@ // GB_emult_bitmap_jit: C<#M>=A.*B emult_bitmap method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,8 +39,8 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT_BITMAP, true, - false, false, GxB_BITMAP, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, GxB_BITMAP, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -57,8 +57,9 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, M_ek_slicing, - M_ntasks, M_nthreads, C_nthreads, &GB_callback, binaryop->theta)) ; + M_ntasks, M_nthreads, C_nthreads, binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_ewise_fulla_jit.c b/GraphBLAS/Source/jit_wrappers/GB_ewise_fulla_jit.c index 5b41489553..3002c8b5b2 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_ewise_fulla_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_ewise_fulla_jit.c @@ -2,7 +2,7 @@ // GB_ewise_fulla_jit: C+=A+B via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,9 +31,11 @@ GrB_Info GB_ewise_fulla_jit // C+=A+B via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_KERNEL_EWISEFA, false, - false, false, GxB_FULL, C->type, NULL, false, false, - binaryop, false, false, A, B) ; + GB_JIT_KERNEL_EWISEFA, /* is_eWiseMult: */ false, + /* C_iso: */ false, false, GxB_FULL, C->type, + /* is_32: */ false, false, false, + /* M: */ NULL, false, false, binaryop, + /* flipij: */ false, /* flipxy: */ false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,7 +53,8 @@ GrB_Info GB_ewise_fulla_jit // C+=A+B via the JIT //-------------------------------------------------------------------------- bool A_is_B = GB_all_aliased (A, B) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, B, nthreads, A_is_B)) ; + return (GB_jit_kernel (C, A, B, nthreads, A_is_B, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_ewise_fulln_jit.c b/GraphBLAS/Source/jit_wrappers/GB_ewise_fulln_jit.c index dbbcf7b011..44664aa48b 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_ewise_fulln_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_ewise_fulln_jit.c @@ -2,7 +2,7 @@ // GB_ewise_fulln_jit: C=A+B via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,9 +31,11 @@ GrB_Info GB_ewise_fulln_jit // C=A+B via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_KERNEL_EWISEFN, false, - false, false, GxB_FULL, C->type, NULL, false, false, - binaryop, false, false, A, B) ; + GB_JIT_KERNEL_EWISEFN, /* is_eWiseMult: */ false, + /* C_iso: */ false, false, GxB_FULL, C->type, + /* is_32: */ false, false, false, + /* M: */ NULL, false, false, binaryop, + /* flipij: */ false, /* flipxy: */ false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -50,7 +52,8 @@ GrB_Info GB_ewise_fulln_jit // C=A+B via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, B, nthreads)) ; + return (GB_jit_kernel (C, A, B, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_iso_expand_jit.c b/GraphBLAS/Source/jit_wrappers/GB_iso_expand_jit.c index 98a8a72401..72ec855f67 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_iso_expand_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_iso_expand_jit.c @@ -2,7 +2,7 @@ // GB_iso_expand_jit: JIT kernel to expand an iso scalar into an array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,11 @@ GrB_Info GB_iso_expand_jit // expand an iso scalar into an entire array GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_ISO_EXPAND, GxB_FULL, false, xtype, op, false, - GxB_FULL, false, xtype, true, 0) ; + GB_JIT_KERNEL_ISO_EXPAND, /* C sparsity: */ GxB_FULL, false, xtype, + /* C is_32: */ false, false, false, + op, /* flipij: */ false, /* A sparsity: */ GxB_FULL, false, xtype, + /* A is_32: */ false, false, false, /* A_iso: */ true, + /* nzombies: */ 0) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -48,7 +51,8 @@ GrB_Info GB_iso_expand_jit // expand an iso scalar into an entire array // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (X, n, scalar, nthreads)) ; + return (GB_jit_kernel (X, n, scalar, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_kroner_jit.c b/GraphBLAS/Source/jit_wrappers/GB_kroner_jit.c index 06ca2a5e86..174ec0e37e 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_kroner_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_kroner_jit.c @@ -2,7 +2,7 @@ // GB_kroner_jit: kronecker product //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,8 +39,9 @@ GrB_Info GB_kroner_jit char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_KRONER, /* is_ewisemult: */ false, /* C_iso: */ C->iso, - /* C_in_iso: */ false, C_sparsity, C->type, /* M: */ NULL, true, false, - binaryop, flipij, false, A, B) ; + /* C_in_iso: */ false, C_sparsity, C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + /* M: */ NULL, true, false, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -57,7 +58,8 @@ GrB_Info GB_kroner_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, B, nthreads, binaryop->theta)) ; + return (GB_jit_kernel (C, A, B, nthreads, binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_masker_phase1_jit.c b/GraphBLAS/Source/jit_wrappers/GB_masker_phase1_jit.c index 46e28212d1..f43fe6b915 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_masker_phase1_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_masker_phase1_jit.c @@ -2,7 +2,7 @@ // GB_masker_phase1_jit: find # of entries in R = masker (C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ typedef GB_JIT_KERNEL_MASKER_PHASE1_PROTO ((*GB_jit_dl_function)) ; GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) ( // computed by phase1: - int64_t *Rp, // output of size Rnvec+1 + void *Rp, // output of size Rnvec+1; 32/64 bit int64_t *Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: GB_task_struct *restrict TaskList, // array of structs @@ -23,10 +23,12 @@ GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - const int64_t *restrict Rh, + const void *Rh, // size Rnvec, 32/64 bit const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, // if true, Rp is 32-bit; else 64-bit + const bool Rj_is_32, // if true, Rh is 32-bit; else 64-bit // original input: const GrB_Matrix M, // required mask const bool Mask_comp, // if true, then M is complemented @@ -43,7 +45,8 @@ GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_masker (&encoding, &suffix, - GB_JIT_KERNEL_MASKER_PHASE1, NULL, M, Mask_struct, Mask_comp, C, Z) ; + GB_JIT_KERNEL_MASKER_PHASE1, NULL, Rp_is_32, Rj_is_32, false, + M, Mask_struct, Mask_comp, C, Z) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -59,8 +62,10 @@ GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (Rp, Rnvec_nonempty, TaskList, R_ntasks, R_nthreads, - Rnvec, Rh, R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z)) ; + Rnvec, Rh, R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_masker_phase2_jit.c b/GraphBLAS/Source/jit_wrappers/GB_masker_phase2_jit.c index 05ca83ba22..c014467352 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_masker_phase2_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_masker_phase2_jit.c @@ -2,7 +2,7 @@ // GB_masker_phase2_jit: construct R = masker (C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,7 +45,8 @@ GrB_Info GB_masker_phase2_jit // phase2 for R = masker (C,M,Z) GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_masker (&encoding, &suffix, - GB_JIT_KERNEL_MASKER_PHASE2, R, M, Mask_struct, Mask_comp, C, Z) ; + GB_JIT_KERNEL_MASKER_PHASE2, R, R->p_is_32, R->j_is_32, R->i_is_32, + M, Mask_struct, Mask_comp, C, Z) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -61,10 +62,11 @@ GrB_Info GB_masker_phase2_jit // phase2 for R = masker (C,M,Z) // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (R, TaskList, R_ntasks, R_nthreads, R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z, C_ek_slicing, C_ntasks, C_nthreads, - M_ek_slicing, M_ntasks, M_nthreads)) ; + M_ek_slicing, M_ntasks, M_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_reduce_to_scalar_jit.c b/GraphBLAS/Source/jit_wrappers/GB_reduce_to_scalar_jit.c index e544f5d1c1..3396e2f115 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_reduce_to_scalar_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_reduce_to_scalar_jit.c @@ -2,7 +2,7 @@ // GB_reduce_to_scalar_jit: reduce a matrix to a scalar, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -50,7 +50,8 @@ GrB_Info GB_reduce_to_scalar_jit // z = reduce_to_scalar (A) via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (z, A, W, F, ntasks, nthreads)) ; + return (GB_jit_kernel (z, A, W, F, ntasks, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_rowscale_jit.c b/GraphBLAS/Source/jit_wrappers/GB_rowscale_jit.c index 17a47cdac2..0d71861ba4 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_rowscale_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_rowscale_jit.c @@ -2,7 +2,7 @@ // GB_rowscale_jit: C=D*B rowscale method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,7 +33,9 @@ GrB_Info GB_rowscale_jit // C=D*B, rowscale, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_ROWSCALE, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, + /* C_iso: */ false, /* C_in_iso: */ false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, binaryop, false, flipxy, D, B) ; //-------------------------------------------------------------------------- @@ -51,7 +53,8 @@ GrB_Info GB_rowscale_jit // C=D*B, rowscale, via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, D, B, nthreads)) ; + return (GB_jit_kernel (C, D, B, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_select_bitmap_jit.c b/GraphBLAS/Source/jit_wrappers/GB_select_bitmap_jit.c index aff835b136..37f268c973 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_select_bitmap_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_select_bitmap_jit.c @@ -2,7 +2,7 @@ // GB_select_bitmap_jit: select phase 2 for the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,11 +14,9 @@ typedef GB_JIT_KERNEL_SELECT_BITMAP_PROTO ((*GB_jit_dl_function)) ; GrB_Info GB_select_bitmap_jit // select bitmap ( - // output: - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed // input: - const bool C_iso, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -34,7 +32,7 @@ GrB_Info GB_select_bitmap_jit // select bitmap GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_select (&encoding, &suffix, - GB_JIT_KERNEL_SELECT_BITMAP, C_iso, false, op, flipij, A) ; + GB_JIT_KERNEL_SELECT_BITMAP, C, op, flipij, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,7 +49,8 @@ GrB_Info GB_select_bitmap_jit // select bitmap // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cb, cnvals_handle, A, ythunk, nthreads)) ; + return (GB_jit_kernel (C, A, ythunk, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_select_phase1_jit.c b/GraphBLAS/Source/jit_wrappers/GB_select_phase1_jit.c index c812e9a1c6..8c10f6b576 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_select_phase1_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_select_phase1_jit.c @@ -2,7 +2,7 @@ // GB_select_phase1_jit: select phase 1 for the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,15 +12,13 @@ typedef GB_JIT_KERNEL_SELECT_PHASE1_PROTO ((*GB_jit_dl_function)) ; -GrB_Info GB_select_phase1_jit // select phase1 +GrB_Info GB_select_phase1_jit // select phase1 ( // output: - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, // C->p computed, with counts + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, // input: - const bool C_iso, - const bool in_place_A, const GrB_Matrix A, const GB_void *restrict ythunk, const GrB_IndexUnaryOp op, @@ -29,7 +27,7 @@ GrB_Info GB_select_phase1_jit // select phase1 const int A_ntasks, const int A_nthreads ) -{ +{ //-------------------------------------------------------------------------- // encodify the problem @@ -38,7 +36,7 @@ GrB_Info GB_select_phase1_jit // select phase1 GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_select (&encoding, &suffix, - GB_JIT_KERNEL_SELECT1, C_iso, in_place_A, op, flipij, A) ; + GB_JIT_KERNEL_SELECT1, C, op, flipij, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -55,8 +53,9 @@ GrB_Info GB_select_phase1_jit // select phase1 // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Cp, Wfirst, Wlast, A, ythunk, A_ek_slicing, + return (GB_jit_kernel (C, Wfirst, Wlast, A, ythunk, A_ek_slicing, A_ntasks, A_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_select_phase2_jit.c b/GraphBLAS/Source/jit_wrappers/GB_select_phase2_jit.c index bd05baf6e7..12ec15e23c 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_select_phase2_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_select_phase2_jit.c @@ -2,7 +2,7 @@ // GB_select_phase2_jit: select phase 2 for the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,14 +14,10 @@ typedef GB_JIT_KERNEL_SELECT_PHASE2_PROTO ((*GB_jit_dl_function)) ; GrB_Info GB_select_phase2_jit // select phase2 ( - // output: - int64_t *restrict Ci, - GB_void *restrict Cx, // NULL if C is iso-valued + // input/output: + GrB_Matrix C, // input: Cp; output: Ci, Cx // input: - const int64_t *restrict Cp, - const bool C_iso, - const bool in_place_A, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -39,7 +35,7 @@ GrB_Info GB_select_phase2_jit // select phase2 GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_select (&encoding, &suffix, - GB_JIT_KERNEL_SELECT2, C_iso, in_place_A, op, flipij, A) ; + GB_JIT_KERNEL_SELECT2, C, op, flipij, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -56,8 +52,9 @@ GrB_Info GB_select_phase2_jit // select phase2 // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Ci, Cx, Cp, Cp_kfirst, A, ythunk, A_ek_slicing, - A_ntasks, A_nthreads)) ; + return (GB_jit_kernel (C, Cp_kfirst, A, ythunk, A_ek_slicing, A_ntasks, + A_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_sort_jit.c b/GraphBLAS/Source/jit_wrappers/GB_sort_jit.c index 9a71f7b4a0..2143f231c6 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_sort_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_sort_jit.c @@ -2,7 +2,7 @@ // GB_sort_jit: sort a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,6 +47,7 @@ GrB_Info GB_sort_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, nthreads, Werk, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_split_bitmap_jit.c b/GraphBLAS/Source/jit_wrappers/GB_split_bitmap_jit.c index 4960ed5545..c1469b09fb 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_split_bitmap_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_split_bitmap_jit.c @@ -2,7 +2,7 @@ // GB_split_bitmap_jit: split A into a bitmap tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,9 @@ GrB_Info GB_split_bitmap_jit // split A into a bitmap tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_BITMAP, GxB_BITMAP, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_SPLIT_BITMAP, GxB_BITMAP, true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -50,7 +51,8 @@ GrB_Info GB_split_bitmap_jit // split A into a bitmap tile C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, avstart, aistart, C_nthreads)) ; + return (GB_jit_kernel (C, A, avstart, aistart, C_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_split_full_jit.c b/GraphBLAS/Source/jit_wrappers/GB_split_full_jit.c index a094ea3cc1..9607123393 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_split_full_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_split_full_jit.c @@ -2,7 +2,7 @@ // GB_split_full_jit: split A into a full tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,9 @@ GrB_Info GB_split_full_jit // split A into a full tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_FULL, GxB_FULL, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_SPLIT_FULL, GxB_FULL, true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -50,7 +51,8 @@ GrB_Info GB_split_full_jit // split A into a full tile C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, avstart, aistart, C_nthreads)) ; + return (GB_jit_kernel (C, A, avstart, aistart, C_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_split_sparse_jit.c b/GraphBLAS/Source/jit_wrappers/GB_split_sparse_jit.c index fb29aab8dc..94e4fd3498 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_split_sparse_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_split_sparse_jit.c @@ -2,7 +2,7 @@ // GB_split_sparse_jit: split A into a sparse tile C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ typedef GB_JIT_KERNEL_SPLIT_SPARSE_PROTO ((*GB_jit_dl_function)) ; -GrB_Info GB_split_sparse_jit // split A into a sparse tile C +GrB_Info GB_split_sparse_jit // split A into a sparse tile C ( // input/output GrB_Matrix C, @@ -21,7 +21,7 @@ GrB_Info GB_split_sparse_jit // split A into a sparse tile C const GrB_Matrix A, int64_t akstart, int64_t aistart, - int64_t *restrict Wp, + const void *Wp, // 32/64 bit, depending on A->p_is_32 const int64_t *restrict C_ek_slicing, const int C_ntasks, const int C_nthreads @@ -35,8 +35,9 @@ GrB_Info GB_split_sparse_jit // split A into a sparse tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_SPARSE, GxB_SPARSE, true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_SPLIT_SPARSE, GxB_SPARSE, true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -53,8 +54,9 @@ GrB_Info GB_split_sparse_jit // split A into a sparse tile C // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, akstart, aistart, Wp, C_ek_slicing, C_ntasks, - C_nthreads)) ; + C_nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_subassign_jit.c b/GraphBLAS/Source/jit_wrappers/GB_subassign_jit.c index 7d9d8c625e..5bbba1d211 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_subassign_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_subassign_jit.c @@ -2,7 +2,7 @@ // GB_subassign_jit: interface to JIT kernels for all assign/subassign methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,13 +19,15 @@ GrB_Info GB_subassign_jit // input: const bool C_replace, // I: - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], // J: - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -45,7 +47,7 @@ GrB_Info GB_subassign_jit // kind and kernel: const int assign_kind, // row assign, col assign, assign, or subassign const int assign_kernel, // GB_JIT_KERNEL_SUBASSIGN_01, ... etc - const char *kname, // kernel base name + const char *kname, // kernel name GB_Werk Werk ) { @@ -57,8 +59,8 @@ GrB_Info GB_subassign_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_assign (&encoding, &suffix, assign_kernel, - C, C_replace, Ikind, Jkind, M, Mask_comp, Mask_struct, accum, - A, scalar_type, S, assign_kind) ; + C, C_replace, I_is_32, J_is_32, Ikind, Jkind, M, Mask_comp, + Mask_struct, accum, A, scalar_type, S, assign_kind) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -80,6 +82,7 @@ GrB_Info GB_subassign_jit double chunk = GB_Context_chunk ( ) ; int nthreads_max = GB_Context_nthreads_max ( ) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, C_replace, I, ni, nI, Ikind, Icolon, diff --git a/GraphBLAS/Source/jit_wrappers/GB_subref_bitmap_jit.c b/GraphBLAS/Source/jit_wrappers/GB_subref_bitmap_jit.c index c23180def6..bb851ec25f 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_subref_bitmap_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_subref_bitmap_jit.c @@ -2,7 +2,7 @@ // GB_subref_bitmap_jit: JIT kernel for GB_bitmap_subref, C=A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,12 +19,14 @@ GrB_Info GB_subref_bitmap_jit // input: GrB_Matrix A, // I: - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3], // J: - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -39,7 +41,8 @@ GrB_Info GB_subref_bitmap_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_subref (&encoding, &suffix, - GB_JIT_KERNEL_BITMAP_SUBREF, C, Ikind, Jkind, false, false, A) ; + GB_JIT_KERNEL_BITMAP_SUBREF, C, I_is_32, J_is_32, + Ikind, Jkind, false, false, false, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -59,8 +62,9 @@ GrB_Info GB_subref_bitmap_jit double chunk = GB_Context_chunk ( ) ; int nthreads_max = GB_Context_nthreads_max ( ) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + return (GB_jit_kernel (C, A, I, nI, Icolon, J, nJ, Jcolon, Werk, nthreads_max, chunk, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_subref_sparse_jit.c b/GraphBLAS/Source/jit_wrappers/GB_subref_sparse_jit.c index 1d1c7c17ea..56d29ce426 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_subref_sparse_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_subref_sparse_jit.c @@ -2,7 +2,7 @@ // GB_subref_sparse_jit: C=A(I,J) when C and A are sparse/hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,19 +21,21 @@ GrB_Info GB_subref_sparse_jit const int ntasks, // # of tasks const int nthreads, // # of threads to use const bool post_sort, // true if post-sort needed - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates // from phase0: - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const bool need_qsort, const int Ikind, const int64_t nI, const int64_t Icolon [3], // original input: const GrB_Matrix A, - const GrB_Index *I + const void *I, + const bool I_is_32 ) { @@ -44,8 +46,8 @@ GrB_Info GB_subref_sparse_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_subref (&encoding, &suffix, - GB_JIT_KERNEL_SUBREF_SPARSE, C, Ikind, 0, - need_qsort, I_has_duplicates, A) ; + GB_JIT_KERNEL_SUBREF_SPARSE, C, I_is_32, false, Ikind, 0, + need_qsort, Ihead_is_32, I_has_duplicates, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -62,8 +64,9 @@ GrB_Info GB_subref_sparse_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, TaskList, ntasks, nthreads, post_sort, Mark, + return (GB_jit_kernel (C, TaskList, ntasks, nthreads, post_sort, Ihead, Inext, Ap_start, Ap_end, nI, Icolon, A, I, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_transpose_bind1st_jit.c b/GraphBLAS/Source/jit_wrappers/GB_transpose_bind1st_jit.c index 776c7065f4..faef1adaba 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_transpose_bind1st_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_transpose_bind1st_jit.c @@ -2,7 +2,7 @@ // GB_transpose_bind1st_jit: C=op(x,A') via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GB_transpose_bind1st_jit const GrB_BinaryOp binaryop, const GB_void *xscalar, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35,8 +35,9 @@ GrB_Info GB_transpose_bind1st_jit char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_TRANSBIND1, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, false, false, NULL, A) ; + false, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + NULL, false, false, binaryop, false, false, NULL, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -53,8 +54,9 @@ GrB_Info GB_transpose_bind1st_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, xscalar, A, Workspaces, A_slice, nworkspaces, - nthreads)) ; + nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_transpose_bind2nd_jit.c b/GraphBLAS/Source/jit_wrappers/GB_transpose_bind2nd_jit.c index 501d9e07c9..78f2c0eff5 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_transpose_bind2nd_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_transpose_bind2nd_jit.c @@ -2,7 +2,7 @@ // GB_transpose_bind2nd_jit: C=op(x,A') via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GB_transpose_bind2nd_jit const GrB_BinaryOp binaryop, const GrB_Matrix A, const GB_void *yscalar, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -35,8 +35,9 @@ GrB_Info GB_transpose_bind2nd_jit char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_TRANSBIND2, false, - false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, false, false, A, NULL) ; + false, false, GB_sparsity (C), C->type, + C->p_is_32, C->j_is_32, C->i_is_32, + NULL, false, false, binaryop, false, false, A, NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -53,8 +54,9 @@ GrB_Info GB_transpose_bind2nd_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, yscalar, Workspaces, A_slice, nworkspaces, - nthreads)) ; + nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_transpose_unop_jit.c b/GraphBLAS/Source/jit_wrappers/GB_transpose_unop_jit.c index 0372c27229..35a866895f 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_transpose_unop_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_transpose_unop_jit.c @@ -2,7 +2,7 @@ // GB_transpose_unop_jit: C=op(A) transpose unop method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ GrB_Info GB_transpose_unop_jit // C = op (A'), transpose unop via the JIT // input: GB_Operator op, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -33,8 +33,9 @@ GrB_Info GB_transpose_unop_jit // C = op (A'), transpose unop via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_TRANSUNOP, GB_sparsity (C), true, C->type, op, false, - GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; + GB_JIT_KERNEL_TRANSUNOP, GB_sparsity (C), true, C->type, C->p_is_32, + C->i_is_32, false, op, false, GB_sparsity (A), true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,7 +52,9 @@ GrB_Info GB_transpose_unop_jit // C = op (A'), transpose unop via the JIT // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, A, Workspaces, A_slice, nworkspaces, nthreads)) ; + return (GB_jit_kernel (C, A, Workspaces, A_slice, nworkspaces, nthreads, + &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_union_jit.c b/GraphBLAS/Source/jit_wrappers/GB_union_jit.c index 838549bb50..ef04ad89ee 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_union_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_union_jit.c @@ -2,7 +2,7 @@ // GB_union_jit: C=A+B, C<#M>=A+B eWiseUnion method, via the JIT //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -54,8 +54,8 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_UNION, false, - false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, flipij, false, A, B) ; + false, false, C_sparsity, C->type, C->p_is_32, C->j_is_32, C->i_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -76,11 +76,12 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, alpha_scalar_in, beta_scalar_in, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, A_ek_slicing, A_nthreads, A_ntasks, B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B, - binaryop->theta)) ; + binaryop->theta, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_unjumble_jit.c b/GraphBLAS/Source/jit_wrappers/GB_unjumble_jit.c index 6b7fc552fe..4d32c43b0d 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_unjumble_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_unjumble_jit.c @@ -2,7 +2,7 @@ // GB_unjumble_jit: JIT kernel to sort the vectors of a sparse/hyper matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,9 @@ GrB_Info GB_unjumble_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_UNJUMBLE, GxB_FULL, false, A->type, op, false, - GxB_SPARSE, true, A->type, false, 0) ; + GB_JIT_KERNEL_UNJUMBLE, GxB_FULL, false, A->type, false, false, false, + op, false, GxB_SPARSE, true, A->type, + A->p_is_32, A->j_is_32, A->i_is_32, false, 0) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -48,7 +49,8 @@ GrB_Info GB_unjumble_jit // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (A, A_slice, ntasks, nthreads)) ; + return (GB_jit_kernel (A, A_slice, ntasks, nthreads, &GB_callback)) ; } diff --git a/GraphBLAS/Source/jit_wrappers/GB_user_op_jit.c b/GraphBLAS/Source/jit_wrappers/GB_user_op_jit.c index 3817ae9a0e..1f1bec5328 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_user_op_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_user_op_jit.c @@ -2,7 +2,7 @@ // GB_user_op_jit: construct a user operator in its own JIT kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,6 +44,7 @@ GrB_Info GB_user_op_jit // construct a user operator in a JIT kernel // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; char *ignore ; return (GB_jit_kernel (user_function, &ignore)) ; diff --git a/GraphBLAS/Source/jit_wrappers/GB_user_type_jit.c b/GraphBLAS/Source/jit_wrappers/GB_user_type_jit.c index ec340a3a4e..a9d2db340d 100644 --- a/GraphBLAS/Source/jit_wrappers/GB_user_type_jit.c +++ b/GraphBLAS/Source/jit_wrappers/GB_user_type_jit.c @@ -2,7 +2,7 @@ // GB_user_type_jit: construct a user type in its own JIT kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,6 +44,7 @@ GrB_Info GB_user_type_jit // construct a user type in a JIT kernel // call the jit kernel and return result //-------------------------------------------------------------------------- + #include "include/GB_pedantic_disable.h" GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; char *ignore ; return (GB_jit_kernel (user_type_size, &ignore)) ; diff --git a/GraphBLAS/Source/jitifyer/GB_demacrofy_name.c b/GraphBLAS/Source/jitifyer/GB_demacrofy_name.c index 9eab764006..65c5e837d9 100644 --- a/GraphBLAS/Source/jitifyer/GB_demacrofy_name.c +++ b/GraphBLAS/Source/jitifyer/GB_demacrofy_name.c @@ -2,7 +2,7 @@ // GB_demacrofy_name: parse a kernel name for its kname, method_code, and suffix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -67,7 +67,7 @@ GrB_Info GB_demacrofy_name if (len < 4 || len > GB_KLEN) { // kernel_name is invalid; ignore this kernel - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // name invalid; ignore this PreJIT kernel } int ndouble = 0 ; @@ -109,7 +109,7 @@ GrB_Info GB_demacrofy_name { // didn't find 2 pairs of double underscores // kernel_name is invalid; ignore this kernel - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // name invald; ignore this PreJIT kernel } //-------------------------------------------------------------------------- @@ -120,7 +120,7 @@ GrB_Info GB_demacrofy_name if (sscanf (method_code_string, "%" SCNx64, &method_code_result) != 1) { // didn't find method_code: kernel_name is invalid; ignore this kernel - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // name invald; ignore this PreJIT kernel } (*method_code) = method_code_result ; diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_apply.c b/GraphBLAS/Source/jitifyer/GB_encodify_apply.c index 5f470b6fe7..3b561d21c1 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_apply.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_apply.c @@ -2,7 +2,7 @@ // GB_encodify_apply: encode an apply problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,14 +22,19 @@ uint64_t GB_encodify_apply // encode an apply problem const int C_sparsity, const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t, else uint64_t // operator: const GB_Operator op, // not JIT'd if NULL const bool flipij, // A matrix: -// const GrB_Matrix A const int A_sparsity, const bool A_is_matrix, const GrB_Type atype, + const bool Ap_is_32, // if true, Ap is uint32_t, else uint64_t + const bool Aj_is_32, // if true, Ah is uint32_t, else uint64_t + const bool Ai_is_32, // if true, Ai is uint32_t, else uint64_t const bool A_iso, const int64_t A_nzombies ) @@ -52,8 +57,9 @@ uint64_t GB_encodify_apply // encode an apply problem //-------------------------------------------------------------------------- encoding->kcode = kcode ; - GB_enumify_apply (&encoding->code, C_sparsity, C_is_matrix, ctype, op, - flipij, A_sparsity, A_is_matrix, atype, A_iso, A_nzombies) ; + GB_enumify_apply (&encoding->code, C_sparsity, C_is_matrix, ctype, + Cp_is_32, Ci_is_32, Cj_is_32, op, flipij, A_sparsity, A_is_matrix, + atype, Ap_is_32, Aj_is_32, Ai_is_32, A_iso, A_nzombies) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_assign.c b/GraphBLAS/Source/jitifyer/GB_encodify_assign.c index 6c520aaa17..9d8ebd8229 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_assign.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_assign.c @@ -2,7 +2,7 @@ // GB_encodify_assign: encode an assign problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,6 +22,8 @@ uint64_t GB_encodify_assign // encode an assign problem GrB_Matrix C, bool C_replace, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto // M matrix: @@ -57,8 +59,9 @@ uint64_t GB_encodify_assign // encode an assign problem //-------------------------------------------------------------------------- encoding->kcode = kcode ; - GB_enumify_assign (&encoding->code, C, C_replace, Ikind, Jkind, - M, Mask_comp, Mask_struct, accum, A, scalar_type, S, assign_kind) ; + GB_enumify_assign (&encoding->code, C, C_replace, I_is_32, J_is_32, + Ikind, Jkind, M, Mask_comp, Mask_struct, accum, A, scalar_type, + S, assign_kind) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_build.c b/GraphBLAS/Source/jitifyer/GB_encodify_build.c index 3bc0a145d2..0e0d2ba590 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_build.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_build.c @@ -2,7 +2,7 @@ // GB_encodify_build: encode a build problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,12 @@ uint64_t GB_encodify_build // encode an build problem const GB_jit_kcode kcode, // kernel to encode const GrB_BinaryOp dup, // operator for summing up duplicates const GrB_Type ttype, // type of Tx array - const GrB_Type stype // type of Sx array + const GrB_Type stype, // type of Sx array + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t + bool I_is_32, // if true, I_work is uint32_t else uint64_t + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + bool no_duplicates // if true, no duplicates appear ) { @@ -41,7 +46,8 @@ uint64_t GB_encodify_build // encode an build problem //-------------------------------------------------------------------------- encoding->kcode = kcode ; - GB_enumify_build (&encoding->code, dup, ttype, stype) ; + GB_enumify_build (&encoding->code, dup, ttype, stype, + Ti_is_32, I_is_32, K_is_32, K_is_null, no_duplicates) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_ewise.c b/GraphBLAS/Source/jitifyer/GB_encodify_ewise.c index 70e94d06ea..c0d25fe7f8 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_ewise.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_ewise.c @@ -2,7 +2,7 @@ // GB_encodify_ewise: encode a ewise problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,16 +19,23 @@ uint64_t GB_encodify_ewise // encode an ewise problem // input: const GB_jit_kcode kcode, // kernel to encode const bool is_eWiseMult, // if true, method is emult + // C matrix: const bool C_iso, const bool C_in_iso, const int C_sparsity, const GrB_Type ctype, + const bool Cp_is_32, + const bool Cj_is_32, + const bool Ci_is_32, + // M matrix: const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, + // operator: const GrB_BinaryOp binaryop, const bool flipij, const bool flipxy, + // A and B: const GrB_Matrix A, // NULL for apply bind1st const GrB_Matrix B // NULL for apply bind2nd ) @@ -56,8 +63,9 @@ uint64_t GB_encodify_ewise // encode an ewise problem encoding->kcode = kcode ; GB_enumify_ewise (&encoding->code, is_eWiseMult, is_eWiseUnion, is_kron, - is_eWiseAdd, C_iso, C_in_iso, C_sparsity, ctype, M, Mask_struct, - Mask_comp, binaryop, flipij, flipxy, A, B) ; + is_eWiseAdd, C_iso, C_in_iso, C_sparsity, ctype, + Cp_is_32, Cj_is_32, Ci_is_32, + M, Mask_struct, Mask_comp, binaryop, flipij, flipxy, A, B) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_masker.c b/GraphBLAS/Source/jitifyer/GB_encodify_masker.c index 0eb8003864..86de480d9a 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_masker.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_masker.c @@ -2,7 +2,7 @@ // GB_encodify_masker: encode a masker problem, including types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,10 @@ uint64_t GB_encodify_masker // encode a masker problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode - const GrB_Matrix R, + const GrB_Matrix R, // may be NULL, for phase1 + const bool Rp_is_32, // if true, R->p is 32 bit; else 64 bit + const bool Rj_is_32, // if true, R->h is 32 bit; else 64 bit + const bool Ri_is_32, // if true, R->i is 32 bit; else 64 bit const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, @@ -47,7 +50,8 @@ uint64_t GB_encodify_masker // encode a masker problem //-------------------------------------------------------------------------- encoding->kcode = kcode ; - GB_enumify_masker (&encoding->code, R, M, Mask_struct, Mask_comp, C, Z) ; + GB_enumify_masker (&encoding->code, R, Rp_is_32, Rj_is_32, Ri_is_32, + M, Mask_struct, Mask_comp, C, Z) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_mxm.c b/GraphBLAS/Source/jitifyer/GB_encodify_mxm.c index d6be0f223a..1cbf52300d 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_mxm.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_mxm.c @@ -2,7 +2,7 @@ // GB_encodify_mxm: encode a GrB_mxm problem, including types and ops //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,15 +18,22 @@ uint64_t GB_encodify_mxm // encode a GrB_mxm problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode + // C matrix: const bool C_iso, const bool C_in_iso, const int C_sparsity, const GrB_Type ctype, + bool Cp_is_32, // if true, C->p is 32-bit; else 64 + bool Cj_is_32, // if true, C->h is 32-bit; else 64 + bool Ci_is_32, // if true, C->i is 32-bit; else 64 + // M matrix: const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, + // semiring: const GrB_Semiring semiring, const bool flipxy, + // A and B: const GrB_Matrix A, const GrB_Matrix B ) @@ -50,7 +57,8 @@ uint64_t GB_encodify_mxm // encode a GrB_mxm problem encoding->kcode = kcode ; GB_enumify_mxm (&encoding->code, C_iso, C_in_iso, C_sparsity, ctype, - M, Mask_struct, Mask_comp, semiring, flipxy, A, B) ; + Cp_is_32, Cj_is_32, Ci_is_32, M, Mask_struct, Mask_comp, semiring, + flipxy, A, B) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_reduce.c b/GraphBLAS/Source/jitifyer/GB_encodify_reduce.c index 79301d3a41..76d85fa1ed 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_reduce.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_reduce.c @@ -2,7 +2,7 @@ // GB_encodify_reduce: encode a GrB_reduce problem, including types and ops //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_select.c b/GraphBLAS/Source/jitifyer/GB_encodify_select.c index 4f180ddb7a..ad39e21ee0 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_select.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_select.c @@ -2,7 +2,7 @@ // GB_encodify_select: encode a select problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,8 +18,7 @@ uint64_t GB_encodify_select // encode an select problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode - const bool C_iso, - const bool in_place_A, + const GrB_Matrix C, const GrB_IndexUnaryOp op, const bool flipij, const GrB_Matrix A @@ -43,7 +42,7 @@ uint64_t GB_encodify_select // encode an select problem //-------------------------------------------------------------------------- encoding->kcode = kcode ; - GB_enumify_select (&encoding->code, C_iso, in_place_A, op, flipij, A) ; + GB_enumify_select (&encoding->code, C, op, flipij, A) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_sort.c b/GraphBLAS/Source/jitifyer/GB_encodify_sort.c index fa12dd2139..55562b2704 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_sort.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_sort.c @@ -2,7 +2,7 @@ // GB_encodify_sort: encode a sort problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_subref.c b/GraphBLAS/Source/jitifyer/GB_encodify_subref.c index 6d91292fdd..3317e64b13 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_subref.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_subref.c @@ -2,7 +2,7 @@ // GB_encodify_subref: encode a subref problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,9 +21,12 @@ uint64_t GB_encodify_subref // encode an subref problem // C matrix: GrB_Matrix C, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 (0 if not used) int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto, or 0 if not used bool need_qsort, // true if qsort needs to be called + bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 bool I_has_duplicates, // true if I has duplicate entries // A matrix: GrB_Matrix A @@ -48,7 +51,8 @@ uint64_t GB_encodify_subref // encode an subref problem encoding->kcode = kcode ; GB_enumify_subref (&encoding->code, - C, Ikind, Jkind, need_qsort, I_has_duplicates, A) ; + C, I_is_32, J_is_32, Ikind, Jkind, need_qsort, Ihead_is_32, + I_has_duplicates, A) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_user_op.c b/GraphBLAS/Source/jitifyer/GB_encodify_user_op.c index 1bda7c7d93..8e9310fba7 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_user_op.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_user_op.c @@ -2,7 +2,7 @@ // GB_encodify_user_op: encode a user op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_encodify_user_type.c b/GraphBLAS/Source/jitifyer/GB_encodify_user_type.c index ba394530dd..863e03b9ef 100644 --- a/GraphBLAS/Source/jitifyer/GB_encodify_user_type.c +++ b/GraphBLAS/Source/jitifyer/GB_encodify_user_type.c @@ -2,7 +2,7 @@ // GB_encodify_user_type: encode a user type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_apply.c b/GraphBLAS/Source/jitifyer/GB_enumify_apply.c index 80811ad0a6..0c0f2bbaa2 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_apply.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_apply.c @@ -2,7 +2,7 @@ // GB_enumify_apply: enumerate a GrB_apply problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,14 +26,19 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem // C is sparse, hyper, or full. const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, // C=((ctype) T) is the final typecast + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t, else uint64_t // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop const bool flipij, // if true, flip i,j for user idxunop // A matrix: -// const GrB_Matrix A // input matrix const int A_sparsity, const bool A_is_matrix, const GrB_Type atype, + const bool Ap_is_32, // if true, A->p is uint32_t, else uint64_t + const bool Aj_is_32, // if true, A->h is uint32_t, else uint64_t + const bool Ai_is_32, // if true, A->i is uint32_t, else uint64_t const bool A_iso, const int64_t A_nzombies ) @@ -92,16 +97,28 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem int A_mat = (A_is_matrix) ? 1 : 0 ; int A_iso_code = (A_iso) ? 1 : 0 ; int A_zombies = (A_nzombies > 0) ? 1 : 0 ; + int cp_is_32 = (Cp_is_32) ? 1 : 0 ; + int ci_is_32 = (Ci_is_32) ? 1 : 0 ; + int cj_is_32 = (Cj_is_32) ? 1 : 0 ; + int ap_is_32 = (Ap_is_32) ? 1 : 0 ; + int aj_is_32 = (Aj_is_32) ? 1 : 0 ; + int ai_is_32 = (Ai_is_32) ? 1 : 0 ; //-------------------------------------------------------------------------- // construct the apply method_code //-------------------------------------------------------------------------- - // total method_code bits: 39 bits (10 hex digits) + // total method_code bits: 45 bits (12 hex digits) (*method_code) = // range bits - // A properties (1 hex digit) + // C and A properties (3 hex digits) + GB_LSHIFT (cp_is_32 , 44) | // 0 or 1 1 + GB_LSHIFT (ci_is_32 , 43) | // 0 or 1 1 + GB_LSHIFT (cj_is_32 , 42) | // 0 or 1 1 + GB_LSHIFT (ap_is_32 , 41) | // 0 or 1 1 + GB_LSHIFT (aj_is_32 , 40) | // 0 or 1 1 + GB_LSHIFT (ai_is_32 , 39) | // 0 or 1 1 GB_LSHIFT (A_mat , 38) | // 0 or 1 1 GB_LSHIFT (A_zombies , 37) | // 0 or 1 1 GB_LSHIFT (A_iso_code , 36) | // 0 or 1 1 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_assign.c b/GraphBLAS/Source/jitifyer/GB_enumify_assign.c index 427d4bd4be..ebac16afad 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_assign.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_assign.c @@ -2,7 +2,7 @@ // GB_enumify_assign: enumerate a GrB_assign problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,6 +31,8 @@ void GB_enumify_assign // enumerate a GrB_assign problem GrB_Matrix C, bool C_replace, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto // M matrix: @@ -43,7 +45,7 @@ void GB_enumify_assign // enumerate a GrB_assign problem GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, // S matrix: - GrB_Matrix S, // may be MULL + GrB_Matrix S, // may be NULL, or of type GrB_UINT32 or GrB_UINT64 int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) { @@ -55,7 +57,9 @@ void GB_enumify_assign // enumerate a GrB_assign problem GrB_Type ctype = C->type ; GrB_Type mtype = (M == NULL) ? NULL : M->type ; GrB_Type atype = (A == NULL) ? scalar_type : A->type ; + GrB_Type stype = (S == NULL) ? GrB_UINT64 : S->type ; ASSERT (atype != NULL) ; + ASSERT (stype == GrB_UINT32 || stype == GrB_UINT64) ; //-------------------------------------------------------------------------- // enumify the accum operator, if present, and get the types of x,y,z @@ -118,7 +122,7 @@ void GB_enumify_assign // enumerate a GrB_assign problem int M_sparsity = (M == NULL) ? 0 : GB_sparsity (M) ; int A_sparsity = (A == NULL) ? 0 : GB_sparsity (A) ; int S_sparsity = (S == NULL) ? 0 : GB_sparsity (S) ; - int S_present = (S != NULL) ; + int S_present = (S != NULL) ? 1 : 0 ; int csparsity, msparsity, asparsity, ssparsity ; GB_enumify_sparsity (&csparsity, C_sparsity) ; @@ -128,15 +132,56 @@ void GB_enumify_assign // enumerate a GrB_assign problem int C_repl = (C_replace) ? 1 : 0 ; + int i_is_32 = (I_is_32) ? 1 : 0 ; + int j_is_32 = (J_is_32) ? 1 : 0 ; + + int cp_is_32 = (C->p_is_32) ? 1 : 0 ; + int cj_is_32 = (C->j_is_32) ? 1 : 0 ; + int ci_is_32 = (C->i_is_32) ? 1 : 0 ; + + int mp_is_32 = (M != NULL && M->p_is_32) ? 1 : 0 ; + int mj_is_32 = (M != NULL && M->j_is_32) ? 1 : 0 ; + int mi_is_32 = (M != NULL && M->i_is_32) ? 1 : 0 ; + + int ap_is_32 = (A != NULL && A->p_is_32) ? 1 : 0 ; + int aj_is_32 = (A != NULL && A->j_is_32) ? 1 : 0 ; + int ai_is_32 = (A != NULL && A->i_is_32) ? 1 : 0 ; + + int sp_is_32 = (S != NULL && S->p_is_32) ? 1 : 0 ; + int sj_is_32 = (S != NULL && S->j_is_32) ? 1 : 0 ; + int si_is_32 = (S != NULL && S->i_is_32) ? 1 : 0 ; + int sx_is_32 = (stype == GrB_UINT32) ? 1 : 0 ; + //-------------------------------------------------------------------------- - // construct the assign method_code, + // construct the assign method_code //-------------------------------------------------------------------------- - // total method_code bits: 48 (12 hex digits) + // total method_code bits: 63 (16 hex digits): 1 bit to sparse (*method_code) = // range bits + // S, C, M, A, I, J integer types (4 hex digits) + GB_LSHIFT (sp_is_32 , 62) | // 0 to 1 1 + GB_LSHIFT (sj_is_32 , 61) | // 0 to 1 1 + GB_LSHIFT (si_is_32 , 60) | // 0 to 1 1 + GB_LSHIFT (sx_is_32 , 59) | // 0 to 1 1 + + GB_LSHIFT (cp_is_32 , 58) | // 0 to 1 1 + GB_LSHIFT (cj_is_32 , 57) | // 0 to 1 1 + GB_LSHIFT (ci_is_32 , 56) | // 0 to 1 1 + + GB_LSHIFT (mp_is_32 , 55) | // 0 to 1 1 + GB_LSHIFT (mj_is_32 , 54) | // 0 to 1 1 + GB_LSHIFT (mi_is_32 , 53) | // 0 to 1 1 + + GB_LSHIFT (ap_is_32 , 52) | // 0 to 1 1 + GB_LSHIFT (aj_is_32 , 51) | // 0 to 1 1 + GB_LSHIFT (ai_is_32 , 50) | // 0 to 1 1 + + GB_LSHIFT (i_is_32 , 49) | // 0 to 1 1 + GB_LSHIFT (j_is_32 , 48) | // 0 to 1 1 + // C_replace, S present, scalar assign, A iso (1 hex digit) GB_LSHIFT (C_repl , 47) | // 0 to 1 1 GB_LSHIFT (S_present , 46) | // 0 to 1 1 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_binop.c b/GraphBLAS/Source/jitifyer/GB_enumify_binop.c index cf8fa8f790..fdeca0e12b 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_binop.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_binop.c @@ -2,7 +2,7 @@ // GB_enumify_binop: convert binary opcode and xcode into a single enum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_build.c b/GraphBLAS/Source/jitifyer/GB_enumify_build.c index de1db91369..59ba059acb 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_build.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_build.c @@ -2,7 +2,7 @@ // GB_enumify_build: enumerate a GB_build problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,16 +12,21 @@ #include "GB.h" #include "jitifyer/GB_stringify.h" -void GB_enumify_build // enumerate a GB_build problem +void GB_enumify_build // enumerate a GB_build problem ( // output: - uint64_t *method_code, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: - GrB_BinaryOp dup, // operator for duplicates - GrB_Type ttype, // type of Tx - GrB_Type stype // type of Sx + GrB_BinaryOp dup, // operator for duplicates + GrB_Type ttype, // type of Tx + GrB_Type stype, // type of Sx + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t + bool I_is_32, // if true, I_work is uint32_t else uint64_t + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + bool no_duplicates // if true, no duplicates appear ) -{ +{ //-------------------------------------------------------------------------- // get the types of X, Y, Z, S, and T @@ -40,6 +45,12 @@ void GB_enumify_build // enumerate a GB_build problem dup_opcode = GB_boolean_rename (dup_opcode) ; } + int ti_is_32 = (Ti_is_32) ? 1 : 0 ; + int i_is_32 = (I_is_32) ? 1 : 0 ; + int k_is_32 = (K_is_32) ? 1 : 0 ; + int k_is_null = (K_is_null) ? 1 : 0 ; + int no_dupl = (no_duplicates) ? 1 : 0 ; + //-------------------------------------------------------------------------- // enumify the dup binary operator //-------------------------------------------------------------------------- @@ -50,11 +61,19 @@ void GB_enumify_build // enumerate a GB_build problem // construct the method_code //-------------------------------------------------------------------------- - // total method_code bits: 26 (7 hex digits) + // total method_code bits: 31 (8 hex digits) (*method_code) = // range bits - // dup, z = f(x,y) (5 hex digits) + // 32/64 bit (1 hex digit) + GB_LSHIFT (ti_is_32 , 31) | // 0 to 1 1 + GB_LSHIFT (i_is_32 , 30) | // 0 to 1 1 + GB_LSHIFT (k_is_32 , 29) | // 0 to 1 1 + GB_LSHIFT (k_is_null , 28) | // 0 to 1 1 + + // dup, z = f(x,y) (6 hex digits) + GB_LSHIFT (no_dupl , 27) | // 0 to 1 1 + // 1 bit unused here GB_LSHIFT (dup_code , 20) | // 0 to 52 6 GB_LSHIFT (zcode , 16) | // 0 to 14 4 GB_LSHIFT (xcode , 12) | // 0 to 14 4 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_cuda_atomic.c b/GraphBLAS/Source/jitifyer/GB_enumify_cuda_atomic.c index 8e0c302741..b217893333 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_cuda_atomic.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_cuda_atomic.c @@ -2,7 +2,7 @@ // GB_enumify_cuda_atomic: enumify the CUDA atomic for a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_ewise.c b/GraphBLAS/Source/jitifyer/GB_enumify_ewise.c index cefe831c96..8b2cdcb6bf 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_ewise.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_ewise.c @@ -2,14 +2,14 @@ // GB_enumify_ewise: enumerate a GrB_eWise* problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Enumify an ewise operation: eWiseAdd, eWiseMult, eWiseUnion, -// rowscale, colscale, apply with bind 1st and 2nd, transpose apply with -// bind 1st and 2nd, etc. +// Enumify an ewise operation: eWiseAdd, eWiseMult, eWiseUnion, rowscale, +// colscale, apply with bind 1st and 2nd, transpose apply with bind 1st and +// 2nd, etc. #include "GB.h" #include "jitifyer/GB_stringify.h" @@ -31,6 +31,9 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem bool C_in_iso, // if true, C is iso on input int C_sparsity, // sparse, hyper, bitmap, or full GrB_Type ctype, // C=((ctype) T) is the final typecast + bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + bool Cj_is_32, // if true, Cj is 32-bit; else 64-bit + bool Ci_is_32, // if true, Ci is 32-bit; else 64-bit // M matrix: GrB_Matrix M, // may be NULL bool Mask_struct, // mask is structural @@ -166,15 +169,49 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem GB_enumify_sparsity (&asparsity, A_sparsity) ; GB_enumify_sparsity (&bsparsity, B_sparsity) ; + int cp_is_32 = (Cp_is_32) ? 1 : 0 ; + int cj_is_32 = (Cj_is_32) ? 1 : 0 ; + int ci_is_32 = (Ci_is_32) ? 1 : 0 ; + + int mp_is_32 = (M == NULL) ? 0 : (M->p_is_32) ? 1 : 0 ; + int mj_is_32 = (M == NULL) ? 0 : (M->j_is_32) ? 1 : 0 ; + int mi_is_32 = (M == NULL) ? 0 : (M->i_is_32) ? 1 : 0 ; + + int ap_is_32 = (A == NULL) ? 0 : (A->p_is_32) ? 1 : 0 ; + int aj_is_32 = (A == NULL) ? 0 : (A->j_is_32) ? 1 : 0 ; + int ai_is_32 = (A == NULL) ? 0 : (A->i_is_32) ? 1 : 0 ; + + int bp_is_32 = (B == NULL) ? 0 : (B->p_is_32) ? 1 : 0 ; + int bj_is_32 = (B == NULL) ? 0 : (B->j_is_32) ? 1 : 0 ; + int bi_is_32 = (B == NULL) ? 0 : (B->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // construct the ewise method_code //-------------------------------------------------------------------------- - // total method_code bits: 47 (12 hex digits); 17 bits to spare. + // total method_code bits: 59 (15 hex digits); 5 bits to spare. (*method_code) = // range bits + // C, M, A, B: 32/64 (12 bits) (3 hex digits) + GB_LSHIFT (cp_is_32 , 59) | // 0 or 1 1 + GB_LSHIFT (cj_is_32 , 58) | // 0 or 1 1 + GB_LSHIFT (ci_is_32 , 57) | // 0 or 1 1 + + GB_LSHIFT (mp_is_32 , 56) | // 0 or 1 1 + GB_LSHIFT (mj_is_32 , 55) | // 0 or 1 1 + GB_LSHIFT (mi_is_32 , 54) | // 0 or 1 1 + + GB_LSHIFT (ap_is_32 , 53) | // 0 or 1 1 + GB_LSHIFT (aj_is_32 , 52) | // 0 or 1 1 + GB_LSHIFT (ai_is_32 , 51) | // 0 or 1 1 + + GB_LSHIFT (bp_is_32 , 50) | // 0 or 1 1 + GB_LSHIFT (bj_is_32 , 49) | // 0 or 1 1 + GB_LSHIFT (bi_is_32 , 48) | // 0 or 1 1 + // C in, A and B iso properites (3 bits) (1 hex digit) + // one bit unused here GB_LSHIFT (C_in_iso_cd, 46) | // 0 or 1 1 GB_LSHIFT (A_iso_code , 45) | // 0 or 1 1 GB_LSHIFT (B_iso_code , 44) | // 0 or 1 1 @@ -200,6 +237,5 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem GB_LSHIFT (msparsity , 4) | // 0 to 3 2 GB_LSHIFT (asparsity , 2) | // 0 to 3 2 GB_LSHIFT (bsparsity , 0) ; // 0 to 3 2 - } diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_identity.c b/GraphBLAS/Source/jitifyer/GB_enumify_identity.c index c42df666bb..703cacdc77 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_identity.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_identity.c @@ -2,7 +2,7 @@ // GB_enumify_identity: return ecode for identity value of an op of a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_mask.c b/GraphBLAS/Source/jitifyer/GB_enumify_mask.c index b991a31c55..e9efc7ed78 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_mask.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_mask.c @@ -2,7 +2,7 @@ // GB_enumify_mask: return mask_ecode to define mask macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_masker.c b/GraphBLAS/Source/jitifyer/GB_enumify_masker.c index 3d04029428..2f87cce1bd 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_masker.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_masker.c @@ -2,7 +2,7 @@ // GB_enumify_masker: enumerate a masker problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,15 @@ #include "GB.h" #include "jitifyer/GB_stringify.h" -void GB_enumify_masker // enumify a masker problem +void GB_enumify_masker // enumify a masker problem ( // output: uint64_t *method_code, // unique encoding of the entire operation // input: const GrB_Matrix R, // NULL for phase 1 + const bool Rp_is_32, // if true, R->p is 32-bit; else 64-bit + const bool Rj_is_32, // if true, R->h is 32-bit; else 64-bit + const bool Ri_is_32, // if true, R->i is 32-bit; else 64-bit const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, @@ -49,29 +52,64 @@ void GB_enumify_masker // enumify a masker problem GB_enumify_mask (&mask_ecode, mtype_code, Mask_struct, Mask_comp) ; //-------------------------------------------------------------------------- - // enumify the sparsity structures of R, M, C, and Z + // enumify the sparsity structures of R, C, M, and Z //-------------------------------------------------------------------------- int R_sparsity = GB_sparsity (R) ; - int M_sparsity = GB_sparsity (M) ; int C_sparsity = GB_sparsity (C) ; + int M_sparsity = GB_sparsity (M) ; int Z_sparsity = GB_sparsity (Z) ; - int rsparsity, msparsity, csparsity, zsparsity ; + int rsparsity, csparsity, msparsity, zsparsity ; GB_enumify_sparsity (&rsparsity, R_sparsity) ; - GB_enumify_sparsity (&msparsity, M_sparsity) ; GB_enumify_sparsity (&csparsity, C_sparsity) ; + GB_enumify_sparsity (&msparsity, M_sparsity) ; GB_enumify_sparsity (&zsparsity, Z_sparsity) ; + int rp_is_32 = (Rp_is_32 ) ? 1 : 0 ; + int rj_is_32 = (Rj_is_32 ) ? 1 : 0 ; + int ri_is_32 = (Ri_is_32 ) ? 1 : 0 ; + + int cp_is_32 = (C->p_is_32) ? 1 : 0 ; + int cj_is_32 = (C->j_is_32) ? 1 : 0 ; + int ci_is_32 = (C->i_is_32) ? 1 : 0 ; + + int mp_is_32 = (M->p_is_32) ? 1 : 0 ; + int mj_is_32 = (M->j_is_32) ? 1 : 0 ; + int mi_is_32 = (M->i_is_32) ? 1 : 0 ; + + int zp_is_32 = (Z->p_is_32) ? 1 : 0 ; + int zj_is_32 = (Z->j_is_32) ? 1 : 0 ; + int zi_is_32 = (Z->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // construct the masker method_code //-------------------------------------------------------------------------- - // total method_code bits: 18 (5 hex digits) + // total method_code bits: 30 (8 hex digits) (*method_code) = // range bits + + // R, C, M, Z: 32/64 bits (12 bits, 3 hex digits) + GB_LSHIFT (rp_is_32 , 31) | // 0 or 1 1 + GB_LSHIFT (rj_is_32 , 30) | // 0 or 1 1 + GB_LSHIFT (ri_is_32 , 29) | // 0 or 1 1 + + GB_LSHIFT (cp_is_32 , 28) | // 0 or 1 1 + GB_LSHIFT (cj_is_32 , 27) | // 0 or 1 1 + GB_LSHIFT (ci_is_32 , 26) | // 0 or 1 1 + + GB_LSHIFT (mp_is_32 , 25) | // 0 or 1 1 + GB_LSHIFT (mj_is_32 , 24) | // 0 or 1 1 + GB_LSHIFT (mi_is_32 , 23) | // 0 or 1 1 + + GB_LSHIFT (zp_is_32 , 22) | // 0 or 1 1 + GB_LSHIFT (zj_is_32 , 21) | // 0 or 1 1 + GB_LSHIFT (zi_is_32 , 20) | // 0 or 1 1 + // C and Z iso properites (1 hex digit) + // unused: 2 bits GB_LSHIFT (C_iso_code , 17) | // 0 or 1 1 GB_LSHIFT (Z_iso_code , 16) | // 0 or 1 1 @@ -83,9 +121,8 @@ void GB_enumify_masker // enumify a masker problem // sparsity structures of R, M, C, and Z (2 hex digits) GB_LSHIFT (rsparsity , 6) | // 0 to 3 2 - GB_LSHIFT (msparsity , 4) | // 0 to 3 2 - GB_LSHIFT (csparsity , 2) | // 0 to 3 2 + GB_LSHIFT (csparsity , 4) | // 0 to 3 2 + GB_LSHIFT (msparsity , 2) | // 0 to 3 2 GB_LSHIFT (zsparsity , 0) ; // 0 to 3 2 - } diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_mxm.c b/GraphBLAS/Source/jitifyer/GB_enumify_mxm.c index 7f5d0b85c6..1313f96699 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_mxm.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_mxm.c @@ -2,7 +2,7 @@ // GB_enumify_mxm: enumerate a GrB_mxm problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,6 +30,9 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem bool C_in_iso, // C input iso status int C_sparsity, // sparse, hyper, bitmap, or full GrB_Type ctype, // C=((ctype) T) is the final typecast + bool Cp_is_32, // if true, C->p is 32-bit; else 64 + bool Cj_is_32, // if true, C->h is 32-bit; else 64 + bool Ci_is_32, // if true, C->i is 32-bit; else 64 // M matrix: GrB_Matrix M, // may be NULL bool Mask_struct, // mask is structural @@ -168,14 +171,47 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem GB_enumify_sparsity (&asparsity, A_sparsity) ; GB_enumify_sparsity (&bsparsity, B_sparsity) ; + int cp_is_32 = (Cp_is_32) ? 1 : 0 ; + int cj_is_32 = (Cj_is_32) ? 1 : 0 ; + int ci_is_32 = (Ci_is_32) ? 1 : 0 ; + + int mp_is_32 = (M == NULL) ? 0 : (M->p_is_32) ? 1 : 0 ; + int mj_is_32 = (M == NULL) ? 0 : (M->j_is_32) ? 1 : 0 ; + int mi_is_32 = (M == NULL) ? 0 : (M->i_is_32) ? 1 : 0 ; + + int ap_is_32 = (A->p_is_32) ? 1 : 0 ; + int aj_is_32 = (A->j_is_32) ? 1 : 0 ; + int ai_is_32 = (A->i_is_32) ? 1 : 0 ; + + int bp_is_32 = (B->p_is_32) ? 1 : 0 ; + int bj_is_32 = (B->j_is_32) ? 1 : 0 ; + int bi_is_32 = (B->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // construct the semiring method_code //-------------------------------------------------------------------------- - // total method_code bits: 50 (13 hex digits): 14 bits to spare. + // total method_code bits: 62 (16 hex digits): 2 bits to spare. (*method_code) = // range bits + // C, M, A, B: 32/64 (12 bits) (3 hex digits) + GB_LSHIFT (cp_is_32 , 63) | // 0 or 1 1 + GB_LSHIFT (cj_is_32 , 62) | // 0 or 1 1 + GB_LSHIFT (ci_is_32 , 61) | // 0 or 1 1 + + GB_LSHIFT (mp_is_32 , 60) | // 0 or 1 1 + GB_LSHIFT (mj_is_32 , 59) | // 0 or 1 1 + GB_LSHIFT (mi_is_32 , 58) | // 0 or 1 1 + + GB_LSHIFT (ap_is_32 , 57) | // 0 or 1 1 + GB_LSHIFT (aj_is_32 , 56) | // 0 or 1 1 + GB_LSHIFT (ai_is_32 , 55) | // 0 or 1 1 + + GB_LSHIFT (bp_is_32 , 54) | // 0 or 1 1 + GB_LSHIFT (bj_is_32 , 53) | // 0 or 1 1 + GB_LSHIFT (bi_is_32 , 52) | // 0 or 1 1 + // monoid (4 bits, 1 hex digit) GB_LSHIFT (add_code , 48) | // 0 to 13 4 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_reduce.c b/GraphBLAS/Source/jitifyer/GB_enumify_reduce.c index bea680a459..28b2078d04 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_reduce.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_reduce.c @@ -2,7 +2,7 @@ // GB_enumify_reduce: enumerate a GrB_reduce problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,17 +39,6 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem //-------------------------------------------------------------------------- // consider z = op(x,y) where both x and y are boolean: - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE - GB_Type_code zcode = ztype->code ; if (zcode == GB_BOOL_code) { @@ -81,6 +70,9 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem GB_enumify_sparsity (&asparsity, GB_sparsity (A)) ; int azombies = (A->nzombies > 0) ? 1 : 0 ; + // the reduce methods do not access A->p or A->h + int ai_is_32 = (A->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // construct the reduction method_code //-------------------------------------------------------------------------- @@ -99,11 +91,9 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem // type of A: 1 hex digit GB_LSHIFT (acode , 4) | // 0 to 14 4 - // sparsity structure and zombies: 1 hex digit - // unused bit 3 1 - // zombies + // sparsity structure, 32/64 bit, and zombies: 1 hex digit + GB_LSHIFT (ai_is_32 , 3) | // 0 to 1 1 GB_LSHIFT (azombies , 2) | // 0 to 1 1 - // sparsity structure of A GB_LSHIFT (asparsity , 0) ; // 0 to 3 2 } diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_select.c b/GraphBLAS/Source/jitifyer/GB_enumify_select.c index 6309e279c5..a9cc17120c 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_select.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_select.c @@ -2,7 +2,7 @@ // GB_enumify_select: enumerate a GrB_select problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,13 +18,10 @@ void GB_enumify_select // enumerate a GrB_selectproblem // output: uint64_t *method_code, // unique encoding of the entire operation // input: - bool C_iso, - bool in_place_A, - // operator: - GrB_IndexUnaryOp op, // the index unary operator to enumify - bool flipij, // if true, flip i and j - // A matrix: - GrB_Matrix A + const GrB_Matrix C, + const GrB_IndexUnaryOp op, // the index unary operator to enumify + const bool flipij, // if true, flip i and j + const GrB_Matrix A ) { @@ -35,93 +32,69 @@ void GB_enumify_select // enumerate a GrB_selectproblem GrB_Type atype = A->type ; GB_Opcode opcode = op->opcode ; GB_Type_code zcode = op->ztype->code ; - GB_Type_code xcode = (op->xtype == NULL) ? 0 : op->xtype->code ; + GB_Type_code xcode = ((op->xtype == NULL) ? 0 : op->xtype->code) ; GB_Type_code ycode = op->ytype->code ; + ASSERT (A->type == C->type) ; //-------------------------------------------------------------------------- // enumify the idxunop operator //-------------------------------------------------------------------------- - bool depends_on_x, depends_on_i, depends_on_j, depends_on_y ; - int idxop_ecode ; - GB_enumify_unop (&idxop_ecode, &depends_on_x, &depends_on_i, - &depends_on_j, &depends_on_y, flipij, opcode, xcode) ; - - ASSERT (idxop_ecode >= 231 && idxop_ecode <= 254) ; - - if (!depends_on_x) - { - // VALUE* ops and user-defined index unary ops depend on x. The - // positional ops (tril, triu, row*, col*, diag*) do not. - xcode = 0 ; - } - - if (!depends_on_y) - { - // All index unary ops depend on y except for NONZOMBIE - ycode = 0 ; - } - - int i_dep = (depends_on_i) ? 1 : 0 ; - int j_dep = (depends_on_j) ? 1 : 0 ; + ASSERT (opcode >= GB_ROWINDEX_idxunop_code) ; + ASSERT (opcode <= GB_USER_idxunop_code) ; + int idxop_code = opcode - GB_ROWINDEX_idxunop_code ; //-------------------------------------------------------------------------- // enumify the types //-------------------------------------------------------------------------- int acode = atype->code ; // 1 to 14 - int ccode = acode ; // this may change in the future int A_iso_code = (A->iso) ? 1 : 0 ; - int C_iso_code = (C_iso) ? 1 : 0 ; + int C_iso_code = (C->iso) ? 1 : 0 ; //-------------------------------------------------------------------------- - // enumify the sparsity structure of A + // enumify the sparsity structure of A and C //-------------------------------------------------------------------------- - int A_sparsity = GB_sparsity (A) ; - int C_sparsity ; - - if (opcode == GB_DIAG_idxunop_code) - { - C_sparsity = (A_sparsity == GxB_FULL) ? GxB_SPARSE : A_sparsity ; - } - else - { - C_sparsity = (A_sparsity == GxB_FULL) ? GxB_BITMAP : A_sparsity ; - } - int asparsity, csparsity ; - GB_enumify_sparsity (&csparsity, C_sparsity) ; - GB_enumify_sparsity (&asparsity, A_sparsity) ; + GB_enumify_sparsity (&csparsity, GB_sparsity (C)) ; + GB_enumify_sparsity (&asparsity, GB_sparsity (A)) ; + + int cp_is_32 = (C->p_is_32) ? 1 : 0 ; + int cj_is_32 = (C->j_is_32) ? 1 : 0 ; + int ci_is_32 = (C->i_is_32) ? 1 : 0 ; - int inplace = (in_place_A) ? 1 : 0 ; + int ap_is_32 = (A->p_is_32) ? 1 : 0 ; + int aj_is_32 = (A->j_is_32) ? 1 : 0 ; + int ai_is_32 = (A->i_is_32) ? 1 : 0 ; //-------------------------------------------------------------------------- // construct the select method_code //-------------------------------------------------------------------------- - // total method_code bits: 38 (10 hex digits) + // total method_code bits: 34 (9 hex digits) (*method_code) = // range bits - // iso of A aand C (2 bits) - GB_LSHIFT (C_iso_code , 37) | // 0 or 1 1 - GB_LSHIFT (A_iso_code , 36) | // 0 or 1 1 - - // inplace, i/j dependency and flipij (1 hex digit) - GB_LSHIFT (inplace , 35) | // 0 or 1 1 - GB_LSHIFT (i_dep , 34) | // 0 or 1 1 - GB_LSHIFT (j_dep , 33) | // 0 or 1 1 - GB_LSHIFT (flipij , 32) | // 0 or 1 1 - - // op, z = f(x,i,j,y) (5 hex digits) - GB_LSHIFT (idxop_ecode, 24) | // 231 to 254 8 - GB_LSHIFT (zcode , 20) | // 0 to 14 4 - GB_LSHIFT (xcode , 16) | // 0 to 14 4 - GB_LSHIFT (ycode , 12) | // 0 to 14 4 - - // types of C and A (2 hex digits) - GB_LSHIFT (ccode , 8) | // 0 to 15 4 + // C, A: 32/64 (2 hex digits) + GB_LSHIFT (cp_is_32 , 33) | // 0 or 1 1 + GB_LSHIFT (cj_is_32 , 32) | // 0 or 1 1 + GB_LSHIFT (ci_is_32 , 31) | // 0 or 1 1 + + GB_LSHIFT (ap_is_32 , 30) | // 0 or 1 1 + GB_LSHIFT (aj_is_32 , 29) | // 0 or 1 1 + GB_LSHIFT (ai_is_32 , 28) | // 0 or 1 1 + + // op, z = f(x,i,j,y), flipij, and iso codes (5 hex digits) + GB_LSHIFT (C_iso_code , 27) | // 0 or 1 1 + GB_LSHIFT (A_iso_code , 26) | // 0 or 1 1 + GB_LSHIFT (flipij , 25) | // 0 or 1 1 + GB_LSHIFT (idxop_code , 20) | // 0 to 19 5 + GB_LSHIFT (zcode , 16) | // 0 to 14 4 + GB_LSHIFT (xcode , 12) | // 0 to 14 4 + GB_LSHIFT (ycode , 8) | // 0 to 14 4 + + // type of (1 hex digit) GB_LSHIFT (acode , 4) | // 0 to 15 4 // sparsity structures of C and A (1 hex digit) diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_sort.c b/GraphBLAS/Source/jitifyer/GB_enumify_sort.c index d230bf2a9d..096c667205 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_sort.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_sort.c @@ -2,7 +2,7 @@ // GB_enumify_sort: enumerate a GxB_sort problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,6 +31,10 @@ void GB_enumify_sort // enumerate a GxB_sort problem GrB_Type ctype = C->type ; int ccode = ctype->code ; // 1 to 14 + int cp_is_32 = (C->p_is_32) ? 1 : 0 ; + int cj_is_32 = (C->j_is_32) ? 1 : 0 ; + int ci_is_32 = (C->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // get the type of X and the opcode //-------------------------------------------------------------------------- @@ -61,13 +65,16 @@ void GB_enumify_sort // enumerate a GxB_sort problem // construct the sort method_code //-------------------------------------------------------------------------- - // total method_code bits: 14 (4 hex digits) + // total method_code bits: 17 (5 hex digits) (*method_code) = // range bits - // binaryop, z = f(x,y) (3 hex digits) - GB_LSHIFT (binop_code , 12) | // 0 to 52 6 - GB_LSHIFT (xcode , 8) | // 1 to 14 4 + // binaryop, z = f(x,y), and integers of C (4 hex digits) + GB_LSHIFT (cp_is_32 , 16) | // 0 to 1 1 + GB_LSHIFT (cj_is_32 , 15) | // 0 to 1 1 + GB_LSHIFT (ci_is_32 , 14) | // 0 to 1 1 + GB_LSHIFT (binop_code , 8) | // 0 to 52 6 + GB_LSHIFT (xcode , 4) | // 1 to 14 4 // type of C (1 hex digit) GB_LSHIFT (ccode , 0) ; // 1 to 14 4 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_sparsity.c b/GraphBLAS/Source/jitifyer/GB_enumify_sparsity.c index 97c386c3d3..015a0a0516 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_sparsity.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_sparsity.c @@ -2,7 +2,7 @@ // GB_enumify_sparsity: enumerate the sparsity structure of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_subref.c b/GraphBLAS/Source/jitifyer/GB_enumify_subref.c index 357f01d1b0..7cc51f38c0 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_subref.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_subref.c @@ -2,7 +2,7 @@ // GB_enumify_subref: enumerate a GrB_extract problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,9 +19,12 @@ void GB_enumify_subref // enumerate a GrB_extract problem // C matrix: GrB_Matrix C, // index types: + bool I_is_32, // if true, I is 32-bit; else 64-bit + bool J_is_32, // if true, J is 32-bit; else 64-bit (bitmap only) int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto, or 0 if not used bool need_qsort, // true if qsort needs to be called + bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 bool I_has_duplicates, // true if I has duplicate entries // A matrix: GrB_Matrix A @@ -49,15 +52,41 @@ void GB_enumify_subref // enumerate a GrB_extract problem int needqsort = (need_qsort) ? 1 : 0 ; int ihasdupl = (I_has_duplicates) ? 1 : 0 ; + int i_is_32 = (I_is_32) ? 1 : 0 ; + int j_is_32 = (J_is_32) ? 1 : 0 ; + + int cp_is_32 = (C->p_is_32) ? 1 : 0 ; + int cj_is_32 = (C->j_is_32) ? 1 : 0 ; + int ci_is_32 = (C->i_is_32) ? 1 : 0 ; + + int ap_is_32 = (A->p_is_32) ? 1 : 0 ; + int aj_is_32 = (A->j_is_32) ? 1 : 0 ; + int ai_is_32 = (A->i_is_32) ? 1 : 0 ; + + int ihead_is_32 = (Ihead_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // construct the subref method_code //-------------------------------------------------------------------------- - // total method_code bits: 14 (4 hex digits) + // total method_code bits: 23 (6 hex digits) (*method_code) = // range bits - /// need_qsort, I_has_duplicates (1 hex digit) + // C, A integer sizes (2 hex digits) + GB_LSHIFT (ihead_is_32, 22) | // 0 to 1 1 + + GB_LSHIFT (cp_is_32 , 21) | // 0 to 1 1 + GB_LSHIFT (cj_is_32 , 20) | // 0 to 1 1 + GB_LSHIFT (ci_is_32 , 19) | // 0 to 1 1 + + GB_LSHIFT (ap_is_32 , 18) | // 0 to 1 1 + GB_LSHIFT (aj_is_32 , 17) | // 0 to 1 1 + GB_LSHIFT (ai_is_32 , 16) | // 0 to 1 1 + + // need_qsort, I_has_duplicates, I and J bits (1 hex digit) + GB_LSHIFT (i_is_32 , 15) | // 0 to 1 1 + GB_LSHIFT (j_is_32 , 14) | // 0 to 1 1 GB_LSHIFT (ihasdupl , 13) | // 0 to 1 1 GB_LSHIFT (needqsort , 12) | // 0 to 1 1 diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_terminal.c b/GraphBLAS/Source/jitifyer/GB_enumify_terminal.c index f5fa56b7d0..799db38ed0 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_terminal.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_terminal.c @@ -2,7 +2,7 @@ // GB_enumify_terminal: return enum of terminal value //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_enumify_unop.c b/GraphBLAS/Source/jitifyer/GB_enumify_unop.c index 93999689cd..76fcc109ab 100644 --- a/GraphBLAS/Source/jitifyer/GB_enumify_unop.c +++ b/GraphBLAS/Source/jitifyer/GB_enumify_unop.c @@ -2,7 +2,7 @@ // GB_enumify_unop: convert unary or idxunary opcode and xcode into a enum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_file.c b/GraphBLAS/Source/jitifyer/GB_file.c index a76d7c73db..e5550a5e96 100644 --- a/GraphBLAS/Source/jitifyer/GB_file.c +++ b/GraphBLAS/Source/jitifyer/GB_file.c @@ -2,7 +2,7 @@ // GB_file.c: portable file I/O //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_file.h b/GraphBLAS/Source/jitifyer/GB_file.h index e0158da9b9..f7470c345d 100644 --- a/GraphBLAS/Source/jitifyer/GB_file.h +++ b/GraphBLAS/Source/jitifyer/GB_file.h @@ -2,7 +2,7 @@ // GB_file.h: portable file I/O //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_jitifyer.c b/GraphBLAS/Source/jitifyer/GB_jitifyer.c index 716a9c59a7..9f43ab72a1 100644 --- a/GraphBLAS/Source/jitifyer/GB_jitifyer.c +++ b/GraphBLAS/Source/jitifyer/GB_jitifyer.c @@ -2,7 +2,7 @@ // GB_jitifyer.c: CPU / CUDA jitifyer //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -96,7 +96,7 @@ static size_t GB_jit_temp_allocated = 0 ; #define GB_JIT_C_CONTROL_INIT GxB_JIT_ON #endif -static GxB_JIT_Control GB_jit_control = GB_JIT_C_CONTROL_INIT ; +static int GB_jit_control = GB_JIT_C_CONTROL_INIT ; //------------------------------------------------------------------------------ // check_table: check if the hash table is OK @@ -113,8 +113,6 @@ static void check_table (void) GB_jit_entry *e = &(GB_jit_table [k]) ; if (e->dl_function != NULL) { - uint64_t hash = e->hash ; - uint64_t k2 = (hash & GB_jit_table_bits) ; populated++ ; } } @@ -151,16 +149,16 @@ static void check_table (void) #define GB_MALLOC_PERSISTENT(X,siz) \ { \ X = GB_Global_persistent_malloc (siz) ; \ - printf ("persistent malloc (%4d): %p size %g\n", /* MEMDUMP */ \ - __LINE__, X, (double) siz) ; \ + GBMDUMP ("persistent malloc (%4d): %p size %g\n", \ + __LINE__, (void *) X, (double) siz) ; \ } #define GB_FREE_PERSISTENT(X) \ { \ if (X != NULL) \ { \ - printf ("persistent free (%4d): %p\n", /* MEMDUMP */ \ - __LINE__, X) ; \ + GBMDUMP ("persistent free (%4d): %p\n", \ + __LINE__, (void *) X) ; \ } \ GB_Global_persistent_free ((void **) &(X)) ; \ } @@ -174,7 +172,7 @@ static void check_table (void) #define GB_FREE_PERSISTENT(X) \ { \ - GB_Global_persistent_free ((void **) &X) ; \ + GB_Global_persistent_free ((void **) &(X)) ; \ } #endif @@ -297,7 +295,7 @@ GrB_Info GB_jitifyer_init (void) // can be used. control = GB_IMIN (control, (int) GxB_JIT_RUN) ; #endif - GB_jit_control = (GxB_JIT_Control) control ; + GB_jit_control = control ; GB_jitifyer_finalize ( ) ; @@ -417,7 +415,9 @@ GrB_Info GB_jitifyer_init (void) //---------------------------------------------------------------------- void *dl_function = Kernels [k] ; - GB_jit_query_func dl_query = (GB_jit_query_func) Queries [k] ; + +// GB_jit_query_func dl_query = (GB_jit_query_func) Queries [k] ; + GB_jit_query_func dl_query = GB_jitifyer_get_query (Queries [k]) ; ASSERT (dl_function != NULL && dl_query != NULL && Names [k] != NULL) ; char kernel_name [GB_KLEN+1] ; strncpy (kernel_name, Names [k], GB_KLEN) ; @@ -841,9 +841,9 @@ GrB_Info GB_jitifyer_extract_JITpackage (GrB_Info error_condition) // GB_jitifyer_get_control: get the JIT control //------------------------------------------------------------------------------ -GxB_JIT_Control GB_jitifyer_get_control (void) +int GB_jitifyer_get_control (void) { - GxB_JIT_Control control ; + int control ; #pragma omp critical (GB_jitifyer_worker) { control = GB_jit_control ; @@ -868,7 +868,7 @@ void GB_jitifyer_set_control (int control) // used. No JIT kernels can be loaded or compiled. control = GB_IMIN (control, (int) GxB_JIT_RUN) ; #endif - GB_jit_control = (GxB_JIT_Control) control ; + GB_jit_control = control ; if (GB_jit_control == GxB_JIT_OFF) { // free all loaded JIT kernels but do not free the JIT hash table, @@ -1563,8 +1563,10 @@ bool GB_jitifyer_query // Returns GrB_SUCCESS if kernel is found (already loaded, or just now loaded, // or just now compiled and loaded). -// Returns GrB_NO_VALUE if the kernel is not found and cannot be loaded or -// compiled. This tells the caller that a generic method must be used. +// Returns GrB_NO_VALUE only if the kernel intentionally cannot be loaded, run, +// or compiled. This tells the caller that a generic method must be used. + +// Returns GxB_JIT_ERROR if the JIT should succeed, but fails. GrB_Info GB_jitifyer_load ( @@ -1595,7 +1597,7 @@ GrB_Info GB_jitifyer_load { // the JIT can be disabled for testing, to test error handling GBURBLE ("(jit: test error handling) ") ; - return (GrB_NOT_IMPLEMENTED) ; + return (GrB_NOT_IMPLEMENTED) ; // only to test error handling in MATLAB } #endif @@ -1606,14 +1608,14 @@ GrB_Info GB_jitifyer_load // This is not a JIT failure. It is an expected error if the strings // (name & defn) are NULL, so always fallback to the generic case. GBURBLE ("(jit: undefined) ") ; - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // no hash code (no strings given) } if ((GB_jit_control == GxB_JIT_OFF) || (GB_jit_control == GxB_JIT_PAUSE)) { // The JIT control has disabled all JIT kernels. Punt to generic. // This is not a JIT failure. - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // JIT is off or paused } //-------------------------------------------------------------------------- @@ -1648,7 +1650,7 @@ GrB_Info GB_jitifyer_load // This is not a JIT failure since the JIT control is already // set to 'run', and the kernel is not already loaded. So always // fallback to the generic kernel. - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // JIT set to 'run'; but kernel not loaded } } @@ -1712,7 +1714,8 @@ GrB_Info GB_jitifyer_load2_worker char **Names = NULL ; int32_t nkernels = 0 ; GB_prejit (&nkernels, &Kernels, &Queries, &Names) ; - GB_jit_query_func dl_query = (GB_jit_query_func) Queries [k1] ; +// GB_jit_query_func dl_query = (GB_jit_query_func) Queries [k1] ; + GB_jit_query_func dl_query = GB_jitifyer_get_query (Queries [k1]) ; bool builtin = (encoding->suffix_len == 0) ; bool ok = GB_jitifyer_query (dl_query, builtin, hash, semiring, monoid, op, type1, type2, type3) ; @@ -1735,7 +1738,9 @@ GrB_Info GB_jitifyer_load2_worker else if (family == GB_jit_user_op_family) { // user-defined operator; check it now - GB_user_op_f GB_user_op = (GB_user_op_f) (*dl_function) ; +// GB_user_op_f GB_user_op = (GB_user_op_f) (*dl_function) ; + GB_user_op_f GB_user_op = GB_jitifyer_get_user_op (*dl_function) ; + void *ignore ; char *defn ; GB_user_op (&ignore, &defn) ; @@ -1754,7 +1759,10 @@ GrB_Info GB_jitifyer_load2_worker else if (family == GB_jit_user_type_family) { // user-defined type; check it now - GB_user_type_f GB_user_type = (GB_user_type_f) (*dl_function) ; +// GB_user_type_f GB_user_type = (GB_user_type_f) (*dl_function) ; + GB_user_type_f GB_user_type = + GB_jitifyer_get_user_type (*dl_function) ; + size_t ignore ; char *defn ; GB_user_type (&ignore, &defn) ; @@ -1791,7 +1799,7 @@ GrB_Info GB_jitifyer_load2_worker // This is not a JIT failure since the JIT control is already // set to 'run', and the kernel is not already loaded. So always // fallback to the generic kernel. - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // JIT set to 'run'; but kernel not loaded } //-------------------------------------------------------------------------- @@ -1807,29 +1815,29 @@ GrB_Info GB_jitifyer_load2_worker { case GB_jit_apply_family : op1 = op ; - method_code_digits = 10 ; + method_code_digits = 12 ; break ; case GB_jit_assign_family : op1 = op ; - method_code_digits = 12 ; + method_code_digits = 16 ; break ; case GB_jit_build_family : op1 = op ; - method_code_digits = 7 ; + method_code_digits = 8 ; break ; case GB_jit_ewise_family : op1 = op ; - method_code_digits = 12 ; + method_code_digits = 15 ; break ; case GB_jit_mxm_family : monoid = semiring->add ; op1 = (GB_Operator) semiring->add->op ; op2 = (GB_Operator) semiring->multiply ; - method_code_digits = 13 ; + method_code_digits = 16 ; break ; case GB_jit_reduce_family : @@ -1839,7 +1847,7 @@ GrB_Info GB_jitifyer_load2_worker case GB_jit_select_family : op1 = op ; - method_code_digits = 10 ; + method_code_digits = 9 ; break ; case GB_jit_user_type_family : @@ -1852,15 +1860,15 @@ GrB_Info GB_jitifyer_load2_worker break ; case GB_jit_masker_family : - method_code_digits = 5 ; + method_code_digits = 8 ; break ; case GB_jit_subref_family : - method_code_digits = 4 ; + method_code_digits = 6 ; break ; case GB_jit_sort_family : - method_code_digits = 4 ; + method_code_digits = 5 ; break ; default: ; @@ -1960,8 +1968,10 @@ GrB_Info GB_jitifyer_load_worker if (dl_handle != NULL) { // library is loaded but make sure the defn match - GB_jit_query_func dl_query = (GB_jit_query_func) - GB_file_dlsym (dl_handle, "GB_jit_query") ; +// GB_jit_query_func dl_query = (GB_jit_query_func) +// GB_file_dlsym (dl_handle, "GB_jit_query") ; + GB_jit_query_func dl_query = GB_jitifyer_get_query ( + GB_file_dlsym (dl_handle, "GB_jit_query")) ; bool ok = (dl_query != NULL) ; if (ok) { @@ -1996,7 +2006,7 @@ GrB_Info GB_jitifyer_load_worker // a JIT failure. It is an expected condition because of the JIT // control, so always allow a fallback to the generic kernel. GBURBLE ("(jit: not compiled) ") ; - return (GrB_NO_VALUE) ; + return (GrB_NO_VALUE) ; // JIT not on; compiler disabled } //---------------------------------------------------------------------- @@ -2413,6 +2423,9 @@ void GB_jitifyer_table_free (bool freeall) // if fast user-defined kernels are required, they can be used with the PreJIT // mechanism; see the GraphBLAS User Guide for details. +// The return result is unused. +#include "include/GB_unused.h" + static void GB_jitifyer_command (char *command) { #ifndef NJIT @@ -2439,7 +2452,7 @@ void GB_jitifyer_cmake_compile (char *kernel_name, uint64_t hash) #ifndef NJIT uint32_t bucket = hash & 0xFF ; - GBURBLE ("(jit: %s)\n", "cmake") ; + GBURBLE ("(jit compile with cmake)\n") ; char *burble_stdout = GB_Global_burble_get ( ) ? "" : GB_DEV_NULL ; bool have_log = (GB_STRLEN (GB_jit_error_log) > 0) ; char *err_redirect = have_log ? " 2>> " : " 2>&1 " ; @@ -2576,7 +2589,7 @@ void GB_jitifyer_nvcc_compile (char *kernel_name, uint32_t bucket) char *err_redirect = have_log ? " 2>> " : " 2>&1 " ; char *log_quote = have_log ? "'" : "" ; - GBURBLE ("(jit compiling cuda with nvcc: %s/c/%02x/%s.cu) ", + GBURBLE ("(jit compiling cuda kernel: %s/c/%02x/%s.cu) ", GB_jit_cache_path, bucket, kernel_name) ; snprintf (GB_jit_temp, GB_jit_temp_allocated, @@ -2632,7 +2645,7 @@ void GB_jitifyer_nvcc_compile (char *kernel_name, uint32_t bucket) err_redirect, log_quote, GB_jit_error_log, log_quote) ; // error log file // compile the library and return result - GBURBLE ("\n(jit: %s) ", GB_jit_temp) ; + GBURBLE ("(jit compile cuda:)\n%s\n", GB_jit_temp) ; GB_jitifyer_command (GB_jit_temp) ; // OK: see security comment above // remove the *.o file @@ -2715,7 +2728,7 @@ void GB_jitifyer_direct_compile (char *kernel_name, uint32_t bucket) err_redirect, log_quote, GB_jit_error_log, log_quote) ; // error log file // compile the library and return result - GBURBLE ("(jit: %s) ", GB_jit_temp) ; + GBURBLE ("(jit compile:)\n%s\n", GB_jit_temp) ; GB_jitifyer_command (GB_jit_temp) ; // OK: see security comment above // remove the *.o file diff --git a/GraphBLAS/Source/jitifyer/GB_jitifyer.h b/GraphBLAS/Source/jitifyer/GB_jitifyer.h index cd563169a5..55bd9306d0 100644 --- a/GraphBLAS/Source/jitifyer/GB_jitifyer.h +++ b/GraphBLAS/Source/jitifyer/GB_jitifyer.h @@ -2,7 +2,7 @@ // GB_jitifyer.h: definitions for the CPU and CUDA jitifyer //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,9 @@ #include "jit_kernels/include/GB_jit_kernel_proto.h" +typedef GB_JIT_KERNEL_USER_OP_PROTO ((*GB_user_op_f)) ; +typedef GB_JIT_KERNEL_USER_TYPE_PROTO ((*GB_user_type_f)) ; + //------------------------------------------------------------------------------ // get list of PreJIT kernels: function pointers and names //------------------------------------------------------------------------------ @@ -366,7 +369,7 @@ GrB_Info GB_jitifyer_alloc_space (void) ; GrB_Info GB_jitifyer_include (void) ; void GB_jitifyer_set_control (int control) ; -GxB_JIT_Control GB_jitifyer_get_control (void) ; +int GB_jitifyer_get_control (void) ; const char *GB_jitifyer_get_cache_path (void) ; GrB_Info GB_jitifyer_set_cache_path (const char *new_cache_path) ; @@ -409,5 +412,9 @@ void GB_jitifyer_set_use_cmake (bool use_cmake) ; void GB_jitifyer_sanitize (char *string, size_t len) ; +GB_jit_query_func GB_jitifyer_get_query (void *p) ; +GB_user_op_f GB_jitifyer_get_user_op (void *p) ; +GB_user_type_f GB_jitifyer_get_user_type (void *p) ; + #endif diff --git a/GraphBLAS/Source/jitifyer/GB_jitifyer_get_function.c b/GraphBLAS/Source/jitifyer/GB_jitifyer_get_function.c new file mode 100644 index 0000000000..d3817db5a7 --- /dev/null +++ b/GraphBLAS/Source/jitifyer/GB_jitifyer_get_function.c @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// GB_jitifyer_get_function.c: get a function pointer from a (void *) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_jitifyer.h" +#include "include/GB_pedantic_disable.h" + +GB_jit_query_func GB_jitifyer_get_query (void *p) +{ + return ((GB_jit_query_func) p) ; +} + +GB_user_op_f GB_jitifyer_get_user_op (void *p) +{ + return ((GB_user_op_f) p) ; +} + +GB_user_type_f GB_jitifyer_get_user_type (void *p) +{ + return ((GB_user_type_f) p) ; +} + diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_apply.c b/GraphBLAS/Source/jitifyer/GB_macrofy_apply.c index 67bbb032a1..3f87eeaf02 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_apply.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_apply.c @@ -2,7 +2,7 @@ // GB_macrofy_apply: construct all macros for apply methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,10 +27,16 @@ void GB_macrofy_apply // construct all macros for GrB_apply // extract the apply method_code //-------------------------------------------------------------------------- - // A properties (3 bits, 1 digit) + // C and A properties (3 hex digits) + bool Cp_is_32 = GB_RSHIFT (method_code, 44, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 43, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 42, 1) ; + bool Ap_is_32 = GB_RSHIFT (method_code, 41, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 40, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 39, 1) ; int A_mat = GB_RSHIFT (method_code, 38, 1) ; int A_zombies = GB_RSHIFT (method_code, 37, 1) ; - int A_iso = GB_RSHIFT (method_code, 36, 1) ; + bool A_iso = GB_RSHIFT (method_code, 36, 1) ; // C kind, i/j dependency and flipij (4 bits) int C_mat = GB_RSHIFT (method_code, 35, 1) ; @@ -172,7 +178,7 @@ void GB_macrofy_apply // construct all macros for GrB_apply { // C = op(A) where C is a matrix GB_macrofy_output (fp, "c", "C", "C", ctype, ztype, csparsity, false, - false) ; + false, Cp_is_32, Cj_is_32, Ci_is_32) ; } else { @@ -180,6 +186,7 @@ void GB_macrofy_apply // construct all macros for GrB_apply ASSERT (ctype == ztype) ; fprintf (fp, "\n// C type:\n") ; GB_macrofy_type (fp, "C", "_", ctype->name) ; + GB_macrofy_bits (fp, "C", Cp_is_32, Cj_is_32, Ci_is_32) ; } //-------------------------------------------------------------------------- @@ -190,7 +197,8 @@ void GB_macrofy_apply // construct all macros for GrB_apply { // C or Cx = op(A) for a matrix A GB_macrofy_input (fp, "a", "A", "A", true, xtype, - atype, asparsity, acode, A_iso, A_zombies) ; + atype, asparsity, acode, A_iso, A_zombies, + Ap_is_32, Aj_is_32, Ai_is_32) ; } else { diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_assign.c b/GraphBLAS/Source/jitifyer/GB_macrofy_assign.c index 6dc3fec942..2be6290e2c 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_assign.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_assign.c @@ -2,7 +2,7 @@ // GB_macrofy_assign: construct all macros for assign methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,11 +26,32 @@ void GB_macrofy_assign // construct all macros for GrB_assign // extract the assign method_code //-------------------------------------------------------------------------- + // S, C, M, A, I, J integer types (4 hex digits) + bool Sp_is_32 = GB_RSHIFT (method_code, 62, 1) ; + bool Sj_is_32 = GB_RSHIFT (method_code, 61, 1) ; + bool Si_is_32 = GB_RSHIFT (method_code, 60, 1) ; + bool Sx_is_32 = GB_RSHIFT (method_code, 59, 1) ; + + bool Cp_is_32 = GB_RSHIFT (method_code, 58, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 57, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 56, 1) ; + + bool Mp_is_32 = GB_RSHIFT (method_code, 55, 1) ; + bool Mj_is_32 = GB_RSHIFT (method_code, 54, 1) ; + bool Mi_is_32 = GB_RSHIFT (method_code, 53, 1) ; + + bool Ap_is_32 = GB_RSHIFT (method_code, 52, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 51, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 50, 1) ; + + bool I_is_32 = GB_RSHIFT (method_code, 49, 1) ; + bool J_is_32 = GB_RSHIFT (method_code, 48, 1) ; + // C_replace, S present, scalar assign, A iso (1 hex digit) int C_replace = GB_RSHIFT (method_code, 47, 1) ; int S_present = GB_RSHIFT (method_code, 46, 1) ; bool s_assign = GB_RSHIFT (method_code, 45, 1) ; - int A_iso = GB_RSHIFT (method_code, 44, 1) ; + bool A_iso = GB_RSHIFT (method_code, 44, 1) ; // Ikind, Jkind (1 hex digit) int Ikind = GB_RSHIFT (method_code, 42, 2) ; @@ -122,6 +143,11 @@ void GB_macrofy_assign // construct all macros for GrB_assign default:; } + fprintf (fp, "#define GB_I_TYPE uint%d_t\n", I_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_J_TYPE uint%d_t\n", J_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_I_IS_32 %d\n", I_is_32 ? 1 : 0) ; + fprintf (fp, "#define GB_J_IS_32 %d\n", J_is_32 ? 1 : 0) ; + fprintf (fp, "#define GB_C_REPLACE %d\n", C_replace) ; //-------------------------------------------------------------------------- @@ -323,13 +349,13 @@ void GB_macrofy_assign // construct all macros for GrB_assign { // C(i,j) = (ctype) cwork, no typecasting GB_macrofy_output (fp, "cwork", "C", "C", ctype, ctype, csparsity, - C_iso, C_iso) ; + C_iso, C_iso, Cp_is_32, Cj_is_32, Ci_is_32) ; } else { // C(i,j) = (ctype) zwork, with possible typecasting GB_macrofy_output (fp, "zwork", "C", "C", ctype, ztype, csparsity, - C_iso, C_iso) ; + C_iso, C_iso, Cp_is_32, Cj_is_32, Ci_is_32) ; } fprintf (fp, "#define GB_DECLAREC(cwork) %s cwork\n", ctype->name) ; @@ -394,7 +420,8 @@ void GB_macrofy_assign // construct all macros for GrB_assign // construct the macros to access the mask (if any), and its name //-------------------------------------------------------------------------- - GB_macrofy_mask (fp, mask_ecode, "M", msparsity) ; + GB_macrofy_mask (fp, mask_ecode, "M", msparsity, + Mp_is_32, Mj_is_32, Mi_is_32) ; //-------------------------------------------------------------------------- // construct the macros for A or the scalar, including typecast to Y type @@ -419,12 +446,13 @@ void GB_macrofy_assign // construct all macros for GrB_assign GB_macrofy_sparsity (fp, "A", -1) ; // unused macros fprintf (fp, "#define GB_A_NVALS(e) int64_t e = 1 ; /* unused */\n") ; fprintf (fp, "#define GB_A_NHELD(e) int64_t e = 1 ; /* unused */\n") ; + GB_macrofy_bits (fp, "A", false, false, false) ; } else { // matrix assignment GB_macrofy_input (fp, "a", "A", "A", true, ytype, atype, asparsity, - acode, A_iso, -1) ; + acode, A_iso, -1, Ap_is_32, Aj_is_32, Ai_is_32) ; if (accum != NULL) { // accum is present @@ -455,6 +483,9 @@ void GB_macrofy_assign // construct all macros for GrB_assign { GB_macrofy_sparsity (fp, "S", ssparsity) ; fprintf (fp, "#define GB_S_CONSTRUCTED 1\n") ; + GB_macrofy_bits (fp, "S", Sp_is_32, Sj_is_32, Si_is_32) ; + fprintf (fp, "#define GB_Sx_BITS %d\n", Sx_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_Sx_TYPE uint%d_t\n", Sx_is_32 ? 32 : 64) ; } else { diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_binop.c b/GraphBLAS/Source/jitifyer/GB_macrofy_binop.c index 3890e25e9b..f31dccc4b6 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_binop.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_binop.c @@ -2,7 +2,7 @@ // GB_macrofy_binop: construct the macro and defn for a binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -91,8 +91,8 @@ void GB_macrofy_binop } else if (flipxy) { - // flipped multiplicative operator (flip both xy and ij) - ASSERT (!is_ewise) ; + // flipped multiplicative operator (flip both xy and ij), + // for mxm (including rowscale and colscale) only fprintf (fp, "#define %s(z,y,x,j%s,i) ", macro_name, karg) ; } else if (flipij) diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_bits.c b/GraphBLAS/Source/jitifyer/GB_macrofy_bits.c new file mode 100644 index 0000000000..8e072af1e1 --- /dev/null +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_bits.c @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// GB_macrofy_bits: construct macros for 32/64 bit integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_macrofy_bits +( + FILE *fp, + // input: + const char *Aname, // name of the matrix + int p_is_32, // if true, Ap is 32-bit, else 64-bit + int j_is_32, // if true, Ah is 32-bit, else 64-bit + int i_is_32 // if true, Ai is 32-bit, else 64-bit +) +{ + fprintf (fp, "#define GB_%sp_TYPE uint%d_t\n", Aname, p_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_%sj_TYPE uint%d_t\n", Aname, j_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_%si_TYPE uint%d_t\n", Aname, i_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_%si_SIGNED_TYPE int%d_t\n", + Aname, i_is_32 ? 32 : 64) ; + + fprintf (fp, "#define GB_%sp_BITS %d\n", Aname, p_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_%sj_BITS %d\n", Aname, j_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_%si_BITS %d\n", Aname, i_is_32 ? 32 : 64) ; +} + diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_build.c b/GraphBLAS/Source/jitifyer/GB_macrofy_build.c index d53934b4d5..0cf33abf2d 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_build.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_build.c @@ -2,7 +2,7 @@ // GB_macrofy_build: construct all macros for GB_build methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,14 @@ void GB_macrofy_build // construct all macros for GB_build // extract the method_code //-------------------------------------------------------------------------- - // dup, z = f(x,y) (5 hex digits) + // 32/64 bit (4 bits, 1 hex digit) + int Ti_is_32 = GB_RSHIFT (method_code, 31, 1) ; + int I_is_32 = GB_RSHIFT (method_code, 30, 1) ; + int K_is_32 = GB_RSHIFT (method_code, 29, 1) ; + int K_is_null = GB_RSHIFT (method_code, 28, 1) ; + + // dup, z = f(x,y) (6 hex digits) + int no_dupl = GB_RSHIFT (method_code, 27, 1) ; // int dup_code = GB_RSHIFT (method_code, 20, 6) ; // int zcode = GB_RSHIFT (method_code, 16, 4) ; int xcode = GB_RSHIFT (method_code, 12, 4) ; @@ -97,6 +104,11 @@ void GB_macrofy_build // construct all macros for GB_build GB_macrofy_binop (fp, "GB_DUP", false, false, true, false, false, dup_ecode, false, dup, NULL, NULL, NULL) ; + if (dup_opcode == GB_FIRST_binop_code) + { + fprintf (fp, "#define GB_DUP_IS_FIRST\n") ; + } + fprintf (fp, "\n// build copy/dup methods:\n") ; // no typecasting if all 5 types are the same @@ -214,6 +226,19 @@ void GB_macrofy_build // construct all macros for GB_build fprintf (fp, " ;\n") ; } + //-------------------------------------------------------------------------- + // 32/64 integer arrays + //-------------------------------------------------------------------------- + + fprintf (fp, "\n// 32/64 integer types:\n") ; + fprintf (fp, "#define GB_Ti_TYPE %s\n", Ti_is_32 ? "int32_t" : "int64_t") ; + fprintf (fp, "#define GB_Ti_BITS %d\n", Ti_is_32 ? 32 : 64) ; + fprintf (fp, "#define GB_I_TYPE %s\n", I_is_32 ? "uint32_t":"uint64_t") ; + fprintf (fp, "#define GB_K_TYPE %s\n", K_is_32 ? "uint32_t":"uint64_t") ; + fprintf (fp, "#define GB_K_WORK(k) %s\n", K_is_null ? "k" : "K_work [k]") ; + fprintf (fp, "#define GB_K_IS_NULL %d\n", K_is_null) ; + fprintf (fp, "#define GB_NO_DUPLICATES %d\n", no_dupl) ; + //-------------------------------------------------------------------------- // include the final default definitions //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_bytes.c b/GraphBLAS/Source/jitifyer/GB_macrofy_bytes.c index fb377e5e6d..4fb74b2556 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_bytes.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_bytes.c @@ -2,7 +2,7 @@ // GB_macrofy_bytes: create a single scalar from an array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_copy.c b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_copy.c index 9ac2bbe845..6d32f87f88 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_copy.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_copy.c @@ -2,7 +2,7 @@ // GB_macrofy_cast_copy: construct a macro for copying input to output //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_expression.c b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_expression.c index af5164f856..c197cde2d0 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_expression.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_expression.c @@ -2,7 +2,7 @@ // GB_macrofy_cast_expression: construct a typecasting string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_input.c b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_input.c index c78b73fdb4..74e92a529b 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_input.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_input.c @@ -2,7 +2,7 @@ // GB_macrofy_cast_input: construct a macro and defn for typecasting from input //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_output.c b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_output.c index a8d36b6000..144ea150e1 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_cast_output.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_cast_output.c @@ -2,7 +2,7 @@ // GB_macrofy_cast_output: construct a macro and defn for typecasting to output //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_defn.c b/GraphBLAS/Source/jitifyer/GB_macrofy_defn.c index f246ee1cf6..4d6c2f21d5 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_defn.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_defn.c @@ -2,7 +2,7 @@ // GB_macrofy_defn: construct defn for an operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_ewise.c b/GraphBLAS/Source/jitifyer/GB_macrofy_ewise.c index 67096df427..8d965d7a64 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_ewise.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_ewise.c @@ -2,7 +2,7 @@ // GB_macrofy_ewise: construct all macros for ewise methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,15 +28,34 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise // extract the ewise method_code //-------------------------------------------------------------------------- + // C, M, A, B: 32/64 (3 hex digits) + bool Cp_is_32 = GB_RSHIFT (method_code, 59, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 58, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 57, 1) ; + + bool Mp_is_32 = GB_RSHIFT (method_code, 56, 1) ; + bool Mj_is_32 = GB_RSHIFT (method_code, 55, 1) ; + bool Mi_is_32 = GB_RSHIFT (method_code, 54, 1) ; + + bool Ap_is_32 = GB_RSHIFT (method_code, 53, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 52, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 51, 1) ; + + bool Bp_is_32 = GB_RSHIFT (method_code, 50, 1) ; + bool Bj_is_32 = GB_RSHIFT (method_code, 49, 1) ; + bool Bi_is_32 = GB_RSHIFT (method_code, 48, 1) ; + // C in, A, and B iso-valued (1 hex digit) bool C_in_iso = GB_RSHIFT (method_code, 46, 1) ; - int A_iso_code = GB_RSHIFT (method_code, 45, 1) ; - int B_iso_code = GB_RSHIFT (method_code, 44, 1) ; + bool A_iso = GB_RSHIFT (method_code, 45, 1) ; + bool B_iso = GB_RSHIFT (method_code, 44, 1) ; // binary operator (5 hex digits) bool flipxy = GB_RSHIFT (method_code, 43, 1) ; bool flipij = GB_RSHIFT (method_code, 42, 1) ; + #ifdef GB_DEBUG int binop_code = GB_RSHIFT (method_code, 36, 6) ; + #endif // int zcode = GB_RSHIFT (method_code, 32, 4) ; int xcode = GB_RSHIFT (method_code, 28, 4) ; int ycode = GB_RSHIFT (method_code, 24, 4) ; @@ -161,17 +180,17 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise } GB_macrofy_cast_copy (fp, "C", "A", (C_iso || !is_eadd) ? NULL : ctype, - (acode == 0 || acode == 15) ? NULL : atype, A_iso_code) ; + (acode == 0 || acode == 15) ? NULL : atype, A_iso) ; GB_macrofy_cast_copy (fp, "C", "B", (C_iso || !is_eadd) ? NULL : ctype, - (bcode == 0 || bcode == 15) ? NULL : btype, B_iso_code) ; + (bcode == 0 || bcode == 15) ? NULL : btype, B_iso) ; //-------------------------------------------------------------------------- // macros for the C matrix //-------------------------------------------------------------------------- GB_macrofy_output (fp, "c", "C", "C", ctype, ztype, csparsity, C_iso, - C_in_iso) ; + C_in_iso, Cp_is_32, Cj_is_32, Ci_is_32) ; if (is_kron) { @@ -212,7 +231,8 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise // construct the macros to access the mask (if any), and its name //-------------------------------------------------------------------------- - GB_macrofy_mask (fp, mask_ecode, "M", msparsity) ; + GB_macrofy_mask (fp, mask_ecode, "M", msparsity, + Mp_is_32, Mj_is_32, Mi_is_32) ; //-------------------------------------------------------------------------- // construct the macros for A and B @@ -240,10 +260,10 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise } GB_macrofy_input (fp, "a", "A", "A", true, flipxy ? ytype : xtype, - atype, asparsity, acode, A_iso_code, -1) ; + atype, asparsity, acode, A_iso, -1, Ap_is_32, Aj_is_32, Ai_is_32) ; GB_macrofy_input (fp, "b", "B", "B", true, flipxy ? xtype : ytype, - btype, bsparsity, bcode, B_iso_code, -1) ; + btype, bsparsity, bcode, B_iso, -1, Bp_is_32, Bj_is_32, Bi_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_family.c b/GraphBLAS/Source/jitifyer/GB_macrofy_family.c index 2e918e2b57..2fac695af7 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_family.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_family.c @@ -2,7 +2,7 @@ // GB_macrofy_family: construct all macros for all methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,16 +35,18 @@ void GB_macrofy_family break ; case GB_jit_assign_family : - GB_macrofy_assign (fp, method_code, (GrB_BinaryOp) op, type1, type2) ; + GB_macrofy_assign (fp, method_code, (GrB_BinaryOp) op, + type1, type2) ; break ; case GB_jit_build_family : - GB_macrofy_build (fp, method_code, (GrB_BinaryOp) op, type1, type2) ; + GB_macrofy_build (fp, method_code, (GrB_BinaryOp) op, + type1, type2) ; break ; case GB_jit_ewise_family : - GB_macrofy_ewise (fp, method_code, kcode, (GrB_BinaryOp) op, type1, type2, - type3) ; + GB_macrofy_ewise (fp, method_code, kcode, (GrB_BinaryOp) op, + type1, type2, type3) ; break ; case GB_jit_mxm_family : @@ -76,7 +78,7 @@ void GB_macrofy_family break ; case GB_jit_sort_family : - GB_macrofy_sort (fp, method_code, op, type1) ; + GB_macrofy_sort (fp, method_code, (GrB_BinaryOp) op, type1) ; break ; default: ; diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_id.c b/GraphBLAS/Source/jitifyer/GB_macrofy_id.c index fc8520dc36..6bc1e5ce4a 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_id.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_id.c @@ -2,7 +2,7 @@ // GB_macrofy_id: string for identity/terminal value //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_input.c b/GraphBLAS/Source/jitifyer/GB_macrofy_input.c index fa66136874..ee8b71ffc6 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_input.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_input.c @@ -2,7 +2,7 @@ // GB_macrofy_input: construct a macro to load values from an input matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ void GB_macrofy_input FILE *fp, // input: const char *aname, // name of the scalar aij = ... - const char *Amacro, // name of the macro is GB_GET*(Amacro) + const char *Amacro, // name of the macro is GB_GETA, if Amacro is 'A' const char *Aname, // name of the input matrix (typically A or B) bool do_matrix_macros, // if true, do the matrix macros GrB_Type a2type, // type of aij after casting to x or y of f(x,y) @@ -25,9 +25,12 @@ void GB_macrofy_input int asparsity, // sparsity format of the input matrix int acode, // type code of the input (0 if pattern, // 15 if A is NULL) - int A_iso_code, // 1 if A is iso - int azombies // 1 if A has zombies, 0 if A has no zombies; + bool A_iso, // true if A is iso + int azombies, // 1 if A has zombies, 0 if A has no zombies; // -1 if the macro should not be created. + int p_is_32, // if true, Ap is 32-bit, else 64-bit + int j_is_32, // if true, Ah is 32-bit, else 64-bit + int i_is_32 // if true, Ai is 32-bit, else 64-bit ) { @@ -46,7 +49,7 @@ void GB_macrofy_input if (do_matrix_macros) { GB_macrofy_sparsity (fp, Aname, asparsity) ; - GB_macrofy_nvals (fp, Aname, asparsity, A_iso_code) ; + GB_macrofy_nvals (fp, Aname, asparsity, A_iso) ; if (azombies >= 0) { // if negative, do not create the macro at all. Typically this @@ -56,7 +59,7 @@ void GB_macrofy_input } } - fprintf (fp, "#define GB_%s_ISO %d\n", Aname, A_iso_code) ; + fprintf (fp, "#define GB_%s_ISO %d\n", Aname, A_iso ? 1 : 0) ; if (A_is_pattern) { // values of A are not accessed @@ -138,8 +141,15 @@ void GB_macrofy_input char macro_name [SLEN+1], xargs [SLEN+1], xexpr [SLEN+1] ; snprintf (macro_name, SLEN, "GB_GET%s", Amacro) ; snprintf (xargs, SLEN, "%sx,p,iso", Aname) ; - snprintf (xexpr, SLEN, A_iso_code ? "%sx [0]" : "%sx [p]", Aname) ; + snprintf (xexpr, SLEN, A_iso ? "%sx [0]" : "%sx [p]", Aname) ; GB_macrofy_cast_input (fp, macro_name, aname, xargs, xexpr, a2type, atype) ; } + + //-------------------------------------------------------------------------- + // construct macros for 32/64 integer types + //-------------------------------------------------------------------------- + + GB_macrofy_bits (fp, Aname, p_is_32, j_is_32, i_is_32) ; } + diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_mask.c b/GraphBLAS/Source/jitifyer/GB_macrofy_mask.c index b53238a5af..520dce4905 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_mask.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_mask.c @@ -2,7 +2,7 @@ // GB_macrofy_mask: return string to define mask macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,14 +19,16 @@ void GB_macrofy_mask // input: int mask_ecode, // enumified mask char *Mname, // name of the mask - int msparsity // sparsity of the mask + int msparsity, // sparsity of the mask + bool Mp_is_32, + bool Mj_is_32, + bool Mi_is_32 ) { if (mask_ecode >= 2) { GB_macrofy_sparsity (fp, Mname, msparsity) ; - GB_macrofy_nvals (fp, Mname, msparsity, false) ; } switch (mask_ecode) @@ -67,8 +69,7 @@ void GB_macrofy_mask "#define GB_MCAST(Mx,p,msize) 1\n" "#define GB_MASK_STRUCT 1\n" "#define GB_MASK_COMP 0\n" - "#define GB_NO_MASK 0\n" - ) ; + "#define GB_NO_MASK 0\n") ; if (msparsity == 1) { // Mask is present, sparse, not complemented, and structural @@ -79,14 +80,12 @@ void GB_macrofy_mask case 3 : // mask complemented, type: structural - fprintf (fp, - "// structural mask (complemented):\n" + fprintf (fp, "// structural mask (complemented):\n" "#define GB_M_TYPE void\n" "#define GB_MCAST(Mx,p,msize) 1\n" "#define GB_MASK_STRUCT 1\n" "#define GB_MASK_COMP 1\n" - "#define GB_NO_MASK 0\n" - ) ; + "#define GB_NO_MASK 0\n") ; break ; //---------------------------------------------------------------------- @@ -95,20 +94,17 @@ void GB_macrofy_mask case 4 : // mask not complemented, type: bool, int8, uint8 - fprintf (fp, - "// valued mask (1 byte):\n" + fprintf (fp, "// valued mask (1 byte):\n" "#define GB_M_TYPE uint8_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" "#define GB_MASK_COMP 0\n" - "#define GB_NO_MASK 0\n" - ) ; + "#define GB_NO_MASK 0\n") ; break ; case 5 : // mask complemented, type: bool, int8, uint8 - fprintf (fp, - "// valued mask (1 byte, complemented):\n" + fprintf (fp, "// valued mask (1 byte, complemented):\n" "#define GB_M_TYPE uint8_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -122,8 +118,7 @@ void GB_macrofy_mask case 6 : // mask not complemented, type: int16, uint16 - fprintf (fp, - "// valued mask (2 bytes):\n" + fprintf (fp, "// valued mask (2 bytes):\n" "#define GB_M_TYPE uint16_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -133,8 +128,7 @@ void GB_macrofy_mask case 7 : // mask complemented, type: int16, uint16 - fprintf (fp, - "// valued mask (2 bytes, complemented):\n" + fprintf (fp, "// valued mask (2 bytes, complemented):\n" "#define GB_M_TYPE uint16_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -148,8 +142,7 @@ void GB_macrofy_mask case 8 : // mask not complemented, type: float, int32, uint32 - fprintf (fp, - "// valued mask (4 bytes):\n" + fprintf (fp, "// valued mask (4 bytes):\n" "#define GB_M_TYPE uint32_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -159,8 +152,7 @@ void GB_macrofy_mask case 9 : // mask complemented, type: float, int32, uint32 - fprintf (fp, - "// valued mask (4 bytes, complemented):\n" + fprintf (fp, "// valued mask 4 bytes, complemented):\n" "#define GB_M_TYPE uint32_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -174,8 +166,7 @@ void GB_macrofy_mask case 10 : // mask not complemented, type: double, float complex, int64, uint64 - fprintf (fp, - "// valued mask (8 bytes):\n" + fprintf (fp, "// valued mask (8 bytes):\n" "#define GB_M_TYPE uint64_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -185,8 +176,7 @@ void GB_macrofy_mask case 11 : // mask complemented, type: double, float complex, int64, uint64 - fprintf (fp, - "// valued mask (8 bytes, complemented):\n" + fprintf (fp, "// valued mask (8 bytes, complemented):\n" "#define GB_M_TYPE uint64_t\n" "#define GB_MCAST(Mx,p,msize) (Mx [p] != 0)\n" "#define GB_MASK_STRUCT 0\n" @@ -200,8 +190,7 @@ void GB_macrofy_mask case 12 : // mask not complemented, type: double complex - fprintf (fp, - "// valued mask (16 bytes):\n" + fprintf (fp, "// valued mask (16 bytes):\n" "#define GB_M_TYPE uint64_t\n" "#define GB_MCAST(Mx,p,msize) " "(Mx [2*(p)] != 0 || Mx [2*(p)+1] != 0)\n" @@ -212,8 +201,7 @@ void GB_macrofy_mask case 13 : // mask complemented, type: double complex - fprintf (fp, - "// valued mask (16 bytes, complemented):\n" + fprintf (fp, "// valued mask (16 bytes, complemented):\n" "#define GB_M_TYPE uint64_t\n" "#define GB_MCAST(Mx,p,msize) " "(Mx [2*(p)] != 0 || Mx [2*(p)+1] != 0)\n" @@ -230,5 +218,11 @@ void GB_macrofy_mask fprintf (fp, "#error undefined mask behavior\n") ; break ; } + + if (mask_ecode >= 2) + { + GB_macrofy_nvals (fp, Mname, msparsity, false) ; + } + GB_macrofy_bits (fp, Mname, Mp_is_32, Mj_is_32, Mi_is_32) ; } diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_masker.c b/GraphBLAS/Source/jitifyer/GB_macrofy_masker.c index ee3cc659f0..5e42d53d76 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_masker.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_masker.c @@ -2,7 +2,7 @@ // GB_macrofy_masker: construct all macros for masker methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,25 @@ void GB_macrofy_masker // construct all macros for GrB_eWise // extract the masker method_code //-------------------------------------------------------------------------- + // R, C, M, Z: 32/64 bits (3 hex digits) + bool Rp_is_32 = GB_RSHIFT (method_code, 31, 1) ; + bool Rj_is_32 = GB_RSHIFT (method_code, 30, 1) ; + bool Ri_is_32 = GB_RSHIFT (method_code, 29, 1) ; + + bool Cp_is_32 = GB_RSHIFT (method_code, 28, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 27, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 26, 1) ; + + bool Mp_is_32 = GB_RSHIFT (method_code, 25, 1) ; + bool Mj_is_32 = GB_RSHIFT (method_code, 24, 1) ; + bool Mi_is_32 = GB_RSHIFT (method_code, 23, 1) ; + + bool Zp_is_32 = GB_RSHIFT (method_code, 22, 1) ; + bool Zj_is_32 = GB_RSHIFT (method_code, 21, 1) ; + bool Zi_is_32 = GB_RSHIFT (method_code, 20, 1) ; + // C and Z iso properties (1 hex digit) + // unused: 2 bits int C_iso = GB_RSHIFT (method_code, 17, 1) ; int Z_iso = GB_RSHIFT (method_code, 16, 1) ; @@ -32,12 +50,12 @@ void GB_macrofy_masker // construct all macros for GrB_eWise int mask_ecode = GB_RSHIFT (method_code, 12, 4) ; // type of R (1 hex digit) - int rcode = GB_RSHIFT (method_code, 8, 4) ; +// int rcode = GB_RSHIFT (method_code, 8, 4) ; // formats of R, M, C, and Z (2 hex digits) int rsparsity = GB_RSHIFT (method_code, 6, 2) ; - int msparsity = GB_RSHIFT (method_code, 4, 2) ; - int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int csparsity = GB_RSHIFT (method_code, 4, 2) ; + int msparsity = GB_RSHIFT (method_code, 2, 2) ; int zsparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- @@ -111,6 +129,7 @@ void GB_macrofy_masker // construct all macros for GrB_eWise GB_macrofy_sparsity (fp, "R", rsparsity) ; GB_macrofy_nvals (fp, "R", rsparsity, false) ; fprintf (fp, "#define GB_R_ISO 0\n") ; + GB_macrofy_bits (fp, "R", Rp_is_32, Rj_is_32, Ri_is_32) ; //-------------------------------------------------------------------------- // construct the macros for C, M, and Z @@ -119,12 +138,15 @@ void GB_macrofy_masker // construct all macros for GrB_eWise GB_macrofy_sparsity (fp, "C", csparsity) ; GB_macrofy_nvals (fp, "C", csparsity, C_iso) ; fprintf (fp, "#define GB_C_ISO %d\n", C_iso) ; + GB_macrofy_bits (fp, "C", Cp_is_32, Cj_is_32, Ci_is_32) ; - GB_macrofy_mask (fp, mask_ecode, "M", msparsity) ; + GB_macrofy_mask (fp, mask_ecode, "M", msparsity, + Mp_is_32, Mj_is_32, Mi_is_32) ; GB_macrofy_sparsity (fp, "Z", zsparsity) ; GB_macrofy_nvals (fp, "Z", zsparsity, Z_iso) ; fprintf (fp, "#define GB_Z_ISO %d\n", Z_iso) ; + GB_macrofy_bits (fp, "Z", Zp_is_32, Zj_is_32, Zi_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_monoid.c b/GraphBLAS/Source/jitifyer/GB_macrofy_monoid.c index 9299670765..f19ead440d 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_monoid.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_monoid.c @@ -2,7 +2,7 @@ // GB_macrofy_monoid: build macros for a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_multadd.c b/GraphBLAS/Source/jitifyer/GB_macrofy_multadd.c index bb7549c1ed..cfce9af45a 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_multadd.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_multadd.c @@ -2,7 +2,7 @@ // GB_macrofy_multadd: create a fused multiply-add operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_mxm.c b/GraphBLAS/Source/jitifyer/GB_macrofy_mxm.c index fed38c8548..39470c3c6f 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_mxm.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_mxm.c @@ -2,7 +2,7 @@ // GB_macrofy_mxm: construct all macros for a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,13 +31,30 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // extract the semiring method_code //-------------------------------------------------------------------------- + // C, M, A, B: 32/64 (3 hex digits) + bool Cp_is_32 = GB_RSHIFT (method_code, 63, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 62, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 61, 1) ; + + bool Mp_is_32 = GB_RSHIFT (method_code, 60, 1) ; + bool Mj_is_32 = GB_RSHIFT (method_code, 59, 1) ; + bool Mi_is_32 = GB_RSHIFT (method_code, 58, 1) ; + + bool Ap_is_32 = GB_RSHIFT (method_code, 57, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 56, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 55, 1) ; + + bool Bp_is_32 = GB_RSHIFT (method_code, 54, 1) ; + bool Bj_is_32 = GB_RSHIFT (method_code, 53, 1) ; + bool Bi_is_32 = GB_RSHIFT (method_code, 52, 1) ; + // monoid (4 bits, 1 hex digit) // int add_code = GB_RSHIFT (method_code, 48, 5) ; // C in, A, B iso-valued and flipxy (one hex digit) bool C_in_iso = GB_RSHIFT (method_code, 47, 1) ; - int A_iso_code = GB_RSHIFT (method_code, 46, 1) ; - int B_iso_code = GB_RSHIFT (method_code, 45, 1) ; + bool A_iso = GB_RSHIFT (method_code, 46, 1) ; + bool B_iso = GB_RSHIFT (method_code, 45, 1) ; bool flipxy = GB_RSHIFT (method_code, 44, 1) ; // multiplier (5 hex digits) @@ -364,13 +381,14 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm //-------------------------------------------------------------------------- GB_macrofy_output (fp, "c", "C", "C", ctype, ztype, csparsity, C_iso, - C_in_iso) ; + C_in_iso, Cp_is_32, Cj_is_32, Ci_is_32) ; //-------------------------------------------------------------------------- // construct the macros to access the mask (if any), and its name //-------------------------------------------------------------------------- - GB_macrofy_mask (fp, mask_ecode, "M", msparsity) ; + GB_macrofy_mask (fp, mask_ecode, "M", msparsity, + Mp_is_32, Mj_is_32, Mi_is_32) ; //-------------------------------------------------------------------------- // construct the macros for A and B @@ -381,11 +399,11 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm GB_macrofy_input (fp, "a", "A", "A", true, flipxy ? ytype : xtype, - atype, asparsity, acode, A_iso_code, -1) ; + atype, asparsity, acode, A_iso, -1, Ap_is_32, Aj_is_32, Ai_is_32) ; GB_macrofy_input (fp, "b", "B", "B", true, flipxy ? xtype : ytype, - btype, bsparsity, bcode, B_iso_code, -1) ; + btype, bsparsity, bcode, B_iso, -1, Bp_is_32, Bj_is_32, Bi_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_name.c b/GraphBLAS/Source/jitifyer/GB_macrofy_name.c index 11a96cdd0c..3ebaa7e7f6 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_name.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_name.c @@ -2,7 +2,7 @@ // GB_macrofy_name: construct the name for a kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_nvals.c b/GraphBLAS/Source/jitifyer/GB_macrofy_nvals.c index 638e3dc44d..e5536ff813 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_nvals.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_nvals.c @@ -2,7 +2,7 @@ // GB_macrofy_nvals: construct macros to return # of entries in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_output.c b/GraphBLAS/Source/jitifyer/GB_macrofy_output.c index 71f60b7d6b..185b681393 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_output.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_output.c @@ -2,7 +2,7 @@ // GB_macrofy_output: construct a macro to store values to an output matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,10 @@ void GB_macrofy_output GrB_Type ztype, // type of cij scalar to cast to ctype write to C int csparsity, // sparsity format of the output matrix bool C_iso, // true if C is iso on output - bool C_in_iso // true if C is iso on input + bool C_in_iso, // true if C is iso on input + int p_is_32, // if true, Cp is 32-bit, else 64-bit + int j_is_32, // if true, Ch is 32-bit, else 64-bit + int i_is_32 // if true, Ci is 32-bit, else 64-bit ) { @@ -84,5 +87,11 @@ void GB_macrofy_output GB_macrofy_cast_output (fp, macro_name, cname, xargs, xexpr, ztype, ctype) ; } + + //-------------------------------------------------------------------------- + // construct macros for 32/64 integer types + //-------------------------------------------------------------------------- + + GB_macrofy_bits (fp, Cname, p_is_32, j_is_32, i_is_32) ; } diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_preface.c b/GraphBLAS/Source/jitifyer/GB_macrofy_preface.c index 3246024fae..1e70640f11 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_preface.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_preface.c @@ -2,7 +2,7 @@ // GB_macrofy_preface: print the kernel preface //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_query.c b/GraphBLAS/Source/jitifyer/GB_macrofy_query.c index 8b56d1fea4..5bedab05e2 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_query.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_query.c @@ -2,7 +2,7 @@ // GB_macrofy_query: construct GB_jit_query function for a kernel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_reduce.c b/GraphBLAS/Source/jitifyer/GB_macrofy_reduce.c index 0fb5d172eb..53811dd68b 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_reduce.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_reduce.c @@ -2,7 +2,7 @@ // GB_macrofy_reduce: construct all macros for a reduction to scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,6 +34,9 @@ void GB_macrofy_reduce // construct all macros for GrB_reduce to scalar // type of A int acode = GB_RSHIFT (rcode, 4, 4) ; + // Ai: 32/64 bit + bool Ai_is_32 = GB_RSHIFT (rcode, 3, 1) ; + // zombies int azombies = GB_RSHIFT (rcode, 2, 1) ; @@ -89,8 +92,12 @@ void GB_macrofy_reduce // construct all macros for GrB_reduce to scalar // monoid operator. No JIT kernel is ever required to reduce an iso matrix // to a scalar, even for user-defined types and monoids. + bool Ap_is_32 = false ; // OK: may be 32-bit but A->p is not accessed + bool Aj_is_32 = false ; // OK: may be 32-bit but A->h is not accessed + GB_macrofy_input (fp, "a", "A", "A", true, monoid->op->ztype, - atype, asparsity, acode, false, azombies) ; + atype, asparsity, acode, /* A_iso: */ false, azombies, + Ap_is_32, Aj_is_32, Ai_is_32) ; //-------------------------------------------------------------------------- // reduction method @@ -102,9 +109,9 @@ void GB_macrofy_reduce // construct all macros for GrB_reduce to scalar GB_Opcode opcode = monoid->op->opcode ; - if (opcode == GB_ANY_binop_code) + if (opcode == GB_ANY_binop_code || azombies) { - // ANY monoid: do not use panel reduction method + // ANY monoid, or zombies: do not use panel reduction method panel = 1 ; } else if (zcode == GB_BOOL_code) diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_select.c b/GraphBLAS/Source/jitifyer/GB_macrofy_select.c index db5860468b..124192a227 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_select.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_select.c @@ -2,7 +2,7 @@ // GB_macrofy_select: construct all macros for select methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,38 +18,59 @@ void GB_macrofy_select // construct all macros for GrB_select uint64_t method_code, // operator: const GrB_IndexUnaryOp op, - GrB_Type atype -) + GrB_Type atype // also the type of C +) { //-------------------------------------------------------------------------- // extract the select method_code //-------------------------------------------------------------------------- - // iso of A and C (2 bits) - bool C_iso = GB_RSHIFT (method_code, 37, 1) ; - bool A_iso = GB_RSHIFT (method_code, 36, 1) ; + // C, A: 32/64 (2 hex digits) + bool Cp_is_32 = GB_RSHIFT (method_code, 33, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 32, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 31, 1) ; - // inplace, i/j dependency and flipij (4 bits) -// int inplace = GB_RSHIFT (method_code, 35, 1) ; - int i_dep = GB_RSHIFT (method_code, 34, 1) ; - int j_dep = GB_RSHIFT (method_code, 33, 1) ; - bool flipij = GB_RSHIFT (method_code, 32, 1) ; + bool Ap_is_32 = GB_RSHIFT (method_code, 30, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 29, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 28, 1) ; - // op, z = f(x,i,j,y) (5 hex digits) - int idxop_ecode = GB_RSHIFT (method_code, 24, 8) ; - int zcode = GB_RSHIFT (method_code, 20, 4) ; - int xcode = GB_RSHIFT (method_code, 16, 4) ; - int ycode = GB_RSHIFT (method_code, 12, 4) ; + // op, z = f(x,i,j,y), flipij, and iso codes (5 hex digits) + bool C_iso = GB_RSHIFT (method_code, 27, 1) ; + bool A_iso = GB_RSHIFT (method_code, 26, 1) ; + bool flipij = GB_RSHIFT (method_code, 25, 1) ; + #ifdef GB_DEBUG + int idxop_code = GB_RSHIFT (method_code, 20, 5) ; + #endif + int zcode = GB_RSHIFT (method_code, 16, 4) ; + int xcode = GB_RSHIFT (method_code, 12, 4) ; + int ycode = GB_RSHIFT (method_code, 8, 4) ; - // types of C and A (2 hex digits) -// int ccode = GB_RSHIFT (method_code, 8, 4) ; + // type of A (1 hex digit) int acode = GB_RSHIFT (method_code, 4, 4) ; // sparsity structures of C and A (1 hex digit) -// int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int csparsity = GB_RSHIFT (method_code, 2, 2) ; int asparsity = GB_RSHIFT (method_code, 0, 2) ; + //-------------------------------------------------------------------------- + // enumify the operator + //-------------------------------------------------------------------------- + + int idxop_ecode ; + bool x_dep, i_dep, j_dep, y_dep ; + + ASSERT (zcode == op->ztype->code) ; + ASSERT (xcode == ((op->xtype == NULL) ? 0 : op->xtype->code)) ; + ASSERT (ycode == op->ytype->code) ; + + GB_enumify_unop (&idxop_ecode, &x_dep, &i_dep, &j_dep, &y_dep, + flipij, op->opcode, xcode) ; + if (!x_dep) xcode = 0 ; + if (!y_dep) ycode = 0 ; + + ASSERT (idxop_code == op->opcode - GB_ROWINDEX_idxunop_code) ; + //-------------------------------------------------------------------------- // describe the operator //-------------------------------------------------------------------------- @@ -82,10 +103,7 @@ void GB_macrofy_select // construct all macros for GrB_select // construct the typedefs //-------------------------------------------------------------------------- - GrB_Type ctype = atype ; // this may change in the future - - GB_macrofy_typedefs (fp, ctype, atype, NULL, - xtype, ytype, ztype) ; + GB_macrofy_typedefs (fp, NULL, atype, NULL, xtype, ytype, ztype) ; fprintf (fp, "// unary operator types:\n") ; GB_macrofy_type (fp, "Z", "_", ztype_name) ; @@ -100,10 +118,10 @@ void GB_macrofy_select // construct all macros for GrB_select flipij ? " (flipped ij)" : "") ; GB_macrofy_unop (fp, "GB_IDXUNOP", flipij, idxop_ecode, (GB_Operator) op) ; - fprintf (fp, "#define GB_DEPENDS_ON_X %d\n", (xtype != NULL) ? 1 : 0) ; - fprintf (fp, "#define GB_DEPENDS_ON_I %d\n", i_dep) ; - fprintf (fp, "#define GB_DEPENDS_ON_J %d\n", j_dep) ; - fprintf (fp, "#define GB_DEPENDS_ON_Y %d\n", (ycode == 0) ? 0 : 1) ; + fprintf (fp, "#define GB_DEPENDS_ON_X %d\n", x_dep ? 1 : 0) ; + fprintf (fp, "#define GB_DEPENDS_ON_I %d\n", i_dep ? 1 : 0) ; + fprintf (fp, "#define GB_DEPENDS_ON_J %d\n", j_dep ? 1 : 0) ; + fprintf (fp, "#define GB_DEPENDS_ON_Y %d\n", y_dep ? 1 : 0) ; char *kind ; switch (op->opcode) @@ -211,19 +229,19 @@ void GB_macrofy_select // construct all macros for GrB_select } //-------------------------------------------------------------------------- - // macros for the Cx array + // construct the macros for C //-------------------------------------------------------------------------- - // Cx has the same type as A for now - fprintf (fp, "\n// C type:\n") ; - GB_macrofy_type (fp, "C", "_", ctype->name) ; + // C has the same type as A + GB_macrofy_output (fp, "c", "C", "C", atype, atype, + csparsity, C_iso, C_iso, Cp_is_32, Cj_is_32, Ci_is_32) ; //-------------------------------------------------------------------------- // construct the macros for A //-------------------------------------------------------------------------- GB_macrofy_input (fp, "a", "A", "A", true, xtype, - atype, asparsity, acode, 0, -1) ; + atype, asparsity, acode, A_iso, -1, Ap_is_32, Aj_is_32, Ai_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_sort.c b/GraphBLAS/Source/jitifyer/GB_macrofy_sort.c index 0f59821b8c..dfc328336b 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_sort.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_sort.c @@ -2,7 +2,7 @@ // GB_macrofy_sort: construct all macros for sort methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,9 +25,14 @@ void GB_macrofy_sort // construct all macros for GxB_sort // extract the binaryop method_code //-------------------------------------------------------------------------- - // binary operator (14 bits, 3 hex digits) -// int binop_code = GB_RSHIFT (method_code, 12, 6) ; - int xcode = GB_RSHIFT (method_code, 8, 4) ; + // integers of C + bool Cp_is_32 = GB_RSHIFT (method_code, 16, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 15, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 14, 1) ; + + // binary operator +// int binop_code = GB_RSHIFT (method_code, 8, 6) ; + int xcode = GB_RSHIFT (method_code, 4, 4) ; // type of C (1 hex digit) int ccode = GB_RSHIFT (method_code, 0, 4) ; // 1 to 14, C is not iso @@ -73,7 +78,8 @@ void GB_macrofy_sort // construct all macros for GxB_sort // macros for the C matrix //-------------------------------------------------------------------------- - GB_macrofy_input (fp, "c", "C", "C", true, xtype, ctype, 1, ccode, 0, -1) ; + GB_macrofy_input (fp, "c", "C", "C", true, xtype, ctype, 1, ccode, + /* C_iso: */ false, -1, Cp_is_32, Cj_is_32, Ci_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_sparsity.c b/GraphBLAS/Source/jitifyer/GB_macrofy_sparsity.c index 4f0f0b8d43..8b896028c6 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_sparsity.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_sparsity.c @@ -2,7 +2,7 @@ // GB_macrofy_sparsity: define macro for the sparsity structure of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,15 +29,17 @@ void GB_macrofy_sparsity // construct macros for sparsity structure "#define GB_%s_IS_HYPER 1\n" "#define GB_%s_IS_SPARSE 0\n" "#define GB_%s_IS_BITMAP 0\n" - "#define GB_%s_IS_FULL 0\n" - "#define GBP_%s(%sp,k,vlen) %sp [k]\n" - "#define GBH_%s(%sh,k) %sh [k]\n" - "#define GBI_%s(%si,p,vlen) %si [p]\n" - "#define GBB_%s(%sb,p) 1\n", - matrix_name, matrix_name, matrix_name, matrix_name, + "#define GB_%s_IS_FULL 0\n", + matrix_name, matrix_name, matrix_name, matrix_name) ; + fprintf (fp, + "#define GBp_%s(%sp,k,vlen) %sp [k]\n" + "#define GBh_%s(%sh,k) %sh [k]\n" + "#define GBi_%s(%si,p,vlen) %si [p]\n" + "#define GBb_%s(%sb,p) 1\n", matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; case 1 : // sparse @@ -45,15 +47,17 @@ void GB_macrofy_sparsity // construct macros for sparsity structure "#define GB_%s_IS_HYPER 0\n" "#define GB_%s_IS_SPARSE 1\n" "#define GB_%s_IS_BITMAP 0\n" - "#define GB_%s_IS_FULL 0\n" - "#define GBP_%s(%sp,k,vlen) %sp [k]\n" - "#define GBH_%s(%sh,k) (k)\n" - "#define GBI_%s(%si,p,vlen) %si [p]\n" - "#define GBB_%s(%sb,p) 1\n", - matrix_name, matrix_name, matrix_name, matrix_name, + "#define GB_%s_IS_FULL 0\n", + matrix_name, matrix_name, matrix_name, matrix_name) ; + fprintf (fp, + "#define GBp_%s(%sp,k,vlen) %sp [k]\n" + "#define GBh_%s(%sh,k) (k)\n" + "#define GBi_%s(%si,p,vlen) %si [p]\n" + "#define GBb_%s(%sb,p) 1\n", matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; case 2 : // bitmap @@ -61,15 +65,17 @@ void GB_macrofy_sparsity // construct macros for sparsity structure "#define GB_%s_IS_HYPER 0\n" "#define GB_%s_IS_SPARSE 0\n" "#define GB_%s_IS_BITMAP 1\n" - "#define GB_%s_IS_FULL 0\n" - "#define GBP_%s(%sp,k,vlen) ((k) * (vlen))\n" - "#define GBH_%s(%sh,k) (k)\n" - "#define GBI_%s(%si,p,vlen) ((p) %% (vlen))\n" - "#define GBB_%s(%sb,p) %sb [p]\n", - matrix_name, matrix_name, matrix_name, matrix_name, + "#define GB_%s_IS_FULL 0\n", + matrix_name, matrix_name, matrix_name, matrix_name) ; + fprintf (fp, + "#define GBp_%s(%sp,k,vlen) ((k) * (vlen))\n" + "#define GBh_%s(%sh,k) (k)\n" + "#define GBi_%s(%si,p,vlen) ((p) %% (vlen))\n" + "#define GBb_%s(%sb,p) %sb [p]\n", matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; case 3 : // full @@ -77,14 +83,16 @@ void GB_macrofy_sparsity // construct macros for sparsity structure "#define GB_%s_IS_HYPER 0\n" "#define GB_%s_IS_SPARSE 0\n" "#define GB_%s_IS_BITMAP 0\n" - "#define GB_%s_IS_FULL 1\n" - "#define GBP_%s(%sp,k,vlen) ((k) * (vlen))\n" - "#define GBH_%s(%sh,k) (k)\n" - "#define GBI_%s(%si,p,vlen) ((p) %% (vlen))\n" - "#define GBB_%s(%sb,p) 1\n", - matrix_name, matrix_name, matrix_name, matrix_name, + "#define GB_%s_IS_FULL 1\n", + matrix_name, matrix_name, matrix_name, matrix_name) ; + fprintf (fp, + "#define GBp_%s(%sp,k,vlen) ((k) * (vlen))\n" + "#define GBh_%s(%sh,k) (k)\n" + "#define GBi_%s(%si,p,vlen) ((p) %% (vlen))\n" + "#define GBb_%s(%sb,p) 1\n", matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; default : // unused @@ -92,14 +100,16 @@ void GB_macrofy_sparsity // construct macros for sparsity structure "#define GB_%s_IS_HYPER 0\n" "#define GB_%s_IS_SPARSE 0\n" "#define GB_%s_IS_BITMAP 0\n" - "#define GB_%s_IS_FULL 1\n" - "#define GBP_%s(%sp,k,vlen) 0\n" - "#define GBH_%s(%sh,k) (k)\n" - "#define GBI_%s(%si,p,vlen) 0\n" - "#define GBB_%s(%sb,p) 1\n", - matrix_name, matrix_name, matrix_name, matrix_name, + "#define GB_%s_IS_FULL 1\n", + matrix_name, matrix_name, matrix_name, matrix_name) ; + fprintf (fp, + "#define GBp_%s(%sp,k,vlen) 0\n" + "#define GBh_%s(%sh,k) (k)\n" + "#define GBi_%s(%si,p,vlen) 0\n" + "#define GBb_%s(%sb,p) 1\n", matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; } diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_string.c b/GraphBLAS/Source/jitifyer/GB_macrofy_string.c index a3ac62725f..ebefce41b6 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_string.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_string.c @@ -2,7 +2,7 @@ // GB_macrofy_string: construct the string for a user-defined type or operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_subref.c b/GraphBLAS/Source/jitifyer/GB_macrofy_subref.c index 482f17227e..4620a011e9 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_subref.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_subref.c @@ -2,7 +2,7 @@ // GB_macrofy_subref: construct all macros for subref methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,20 +24,33 @@ void GB_macrofy_subref // construct all macros for GrB_extract // extract the subref method_code //-------------------------------------------------------------------------- - // need_qsort, I_has_duplicates (1 hex digit) - int ihasdupl = GB_RSHIFT (method_code, 13, 1) ; - int needqsort = GB_RSHIFT (method_code, 12, 1) ; + // C, A integer sizes (2 hex digits) + bool Ihead_is_32 = GB_RSHIFT (method_code, 22, 1) ; + + bool Cp_is_32 = GB_RSHIFT (method_code, 21, 1) ; + bool Cj_is_32 = GB_RSHIFT (method_code, 20, 1) ; + bool Ci_is_32 = GB_RSHIFT (method_code, 19, 1) ; + + bool Ap_is_32 = GB_RSHIFT (method_code, 18, 1) ; + bool Aj_is_32 = GB_RSHIFT (method_code, 17, 1) ; + bool Ai_is_32 = GB_RSHIFT (method_code, 16, 1) ; + + // need_qsort, I_has_duplicates, I and J bits (1 hex digit) + bool I_is_32 = GB_RSHIFT (method_code, 15, 1) ; + bool J_is_32 = GB_RSHIFT (method_code, 14, 1) ; + int ihasdupl = GB_RSHIFT (method_code, 13, 1) ; + int needqsort = GB_RSHIFT (method_code, 12, 1) ; // Ikind, Jkind (1 hex digit) - int Ikind = GB_RSHIFT (method_code, 10, 2) ; - int Jkind = GB_RSHIFT (method_code, 8, 2) ; + int Ikind = GB_RSHIFT (method_code, 10, 2) ; + int Jkind = GB_RSHIFT (method_code, 8, 2) ; // type of C and A (1 hex digit) - int ccode = GB_RSHIFT (method_code, 4, 4) ; +// int ccode = GB_RSHIFT (method_code, 4, 4) ; // sparsity structures of C and A (1 hex digit) - int csparsity = GB_RSHIFT (method_code, 2, 2) ; - int asparsity = GB_RSHIFT (method_code, 0, 2) ; + int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int asparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- // describe the subref @@ -55,6 +68,7 @@ void GB_macrofy_subref // construct all macros for GrB_extract case GB_LIST : fprintf (fp, "GB_LIST\n" ) ; break ; default:; } + fprintf (fp, "#define GB_I_TYPE uint%d_t\n", I_is_32 ? 32 : 64) ; if (asparsity <= 1) { // C and A are sparse/hypersparse @@ -75,8 +89,11 @@ void GB_macrofy_subref // construct all macros for GrB_extract case GB_LIST : fprintf (fp, "GB_LIST\n" ) ; break ; default:; } + fprintf (fp, "#define GB_J_TYPE uint%d_t\n", J_is_32 ? 32 : 64) ; } + fprintf (fp, "#define GB_IHEAD_TYPE uint%d_t\n", Ihead_is_32 ? 32 : 64) ; + //-------------------------------------------------------------------------- // construct the typedefs //-------------------------------------------------------------------------- @@ -90,11 +107,13 @@ void GB_macrofy_subref // construct all macros for GrB_extract GB_macrofy_sparsity (fp, "C", csparsity) ; GB_macrofy_nvals (fp, "C", csparsity, false) ; GB_macrofy_type (fp, "C", "_", ctype->name) ; + GB_macrofy_bits (fp, "C", Cp_is_32, Cj_is_32, Ci_is_32) ; GrB_Type atype = ctype ; // C and A have the same type GB_macrofy_sparsity (fp, "A", asparsity) ; GB_macrofy_nvals (fp, "A", asparsity, false) ; GB_macrofy_type (fp, "A", "_", atype->name) ; + GB_macrofy_bits (fp, "A", Ap_is_32, Aj_is_32, Ai_is_32) ; //-------------------------------------------------------------------------- // include the final default definitions diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_type.c b/GraphBLAS/Source/jitifyer/GB_macrofy_type.c index 1763fbee75..7a284ead0d 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_type.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_type.c @@ -2,7 +2,7 @@ // GB_macrofy_type: construct macros for a type name //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_typedefs.c b/GraphBLAS/Source/jitifyer/GB_macrofy_typedefs.c index a20b02df01..24d2a57539 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_typedefs.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_typedefs.c @@ -2,7 +2,7 @@ // GB_macrofy_typedefs: construct typedefs for up to 6 types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_unop.c b/GraphBLAS/Source/jitifyer/GB_macrofy_unop.c index 6d1909264e..3aab3d379e 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_unop.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_unop.c @@ -2,7 +2,7 @@ // GB_macrofy_unop: construct the macro and defn for a unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_user_op.c b/GraphBLAS/Source/jitifyer/GB_macrofy_user_op.c index 83960ff41d..3d3c6a4e0e 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_user_op.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_user_op.c @@ -2,7 +2,7 @@ // GB_macrofy_user_op: construct a user defined operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_macrofy_user_type.c b/GraphBLAS/Source/jitifyer/GB_macrofy_user_type.c index f117ef7f38..6a9a777c40 100644 --- a/GraphBLAS/Source/jitifyer/GB_macrofy_user_type.c +++ b/GraphBLAS/Source/jitifyer/GB_macrofy_user_type.c @@ -2,7 +2,7 @@ // GB_macrofy_user_type: construct a user defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/jitifyer/GB_stringify.h b/GraphBLAS/Source/jitifyer/GB_stringify.h index 15b6522327..dfccc3d735 100644 --- a/GraphBLAS/Source/jitifyer/GB_stringify.h +++ b/GraphBLAS/Source/jitifyer/GB_stringify.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_stringify.h: prototype definitions construction of *.h definitions +// GB_stringify.h: encodify / enumify / macrofy and *_jit definitions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,13 +27,6 @@ void GB_macrofy_preface GB_jit_kcode kcode ) ; -//------------------------------------------------------------------------------ -// left and right shift -//------------------------------------------------------------------------------ - -#define GB_LSHIFT(x,k) (((uint64_t) x) << k) -#define GB_RSHIFT(x,k,b) ((x >> k) & ((((uint64_t)0x00000001) << b) -1)) - //------------------------------------------------------------------------------ // GB_macrofy_name: create the kernel name //------------------------------------------------------------------------------ @@ -115,8 +108,6 @@ GrB_Info GB_reduce_to_scalar_jit // z = reduce_to_scalar (A) via the JIT // GrB_eWiseAdd, GrB_eWiseMult, GxB_eWiseUnion //------------------------------------------------------------------------------ -// FUTURE: add accumulator for eWise operations? - uint64_t GB_encodify_ewise // encode an ewise problem ( // output: @@ -126,18 +117,25 @@ uint64_t GB_encodify_ewise // encode an ewise problem // input: const GB_jit_kcode kcode, // kernel to encode const bool is_eWiseMult, // if true, method is emult + // C matrix: const bool C_iso, const bool C_in_iso, const int C_sparsity, const GrB_Type ctype, + const bool Cp_is_32, + const bool Cj_is_32, + const bool Ci_is_32, + // M matrix: const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, + // operator: const GrB_BinaryOp binaryop, const bool flipij, const bool flipxy, - const GrB_Matrix A, - const GrB_Matrix B + // A and B: + const GrB_Matrix A, // NULL for apply bind1st + const GrB_Matrix B // NULL for apply bind2nd ) ; void GB_enumify_ewise // enumerate a GrB_eWise problem @@ -154,6 +152,9 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem bool C_in_iso, // if true, C is iso on input int C_sparsity, // sparse, hyper, bitmap, or full GrB_Type ctype, // C=((ctype) T) is the final typecast + bool Cp_is_32, // if true, Cp is 32-bit; else 64-bit + bool Cj_is_32, // if true, Ch is 32-bit; else 64-bit + bool Ci_is_32, // if true, Ci is 32-bit; else 64-bit // M matrix: GrB_Matrix M, // may be NULL bool Mask_struct, // mask is structural @@ -278,7 +279,7 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -297,7 +298,7 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *B_ek_slicing, const int B_ntasks, const int B_nthreads @@ -315,7 +316,7 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT const bool flipij, const GrB_Matrix A, const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads @@ -391,8 +392,6 @@ GrB_Info GB_colscale_jit // C=A*D, colscale, via the JIT // GrB_mxm //------------------------------------------------------------------------------ -// FUTURE: add accumulator for mxm? - uint64_t GB_encodify_mxm // encode a GrB_mxm problem ( // output: @@ -401,15 +400,22 @@ uint64_t GB_encodify_mxm // encode a GrB_mxm problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode + // C matrix: const bool C_iso, const bool C_in_iso, const int C_sparsity, const GrB_Type ctype, + bool Cp_is_32, // if true, C->p is 32-bit; else 64 + bool Cj_is_32, // if true, C->h is 32-bit; else 64 + bool Ci_is_32, // if true, C->i is 32-bit; else 64 + // M matrix: const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, + // semiring: const GrB_Semiring semiring, const bool flipxy, + // A and B: const GrB_Matrix A, const GrB_Matrix B ) ; @@ -424,6 +430,9 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem bool C_in_iso, // C input iso status int C_sparsity, // sparse, hyper, bitmap, or full GrB_Type ctype, // C=((ctype) T) is the final typecast + bool Cp_is_32, // if true, C->p is 32-bit; else 64 + bool Cj_is_32, // if true, C->h is 32-bit; else 64 + bool Ci_is_32, // if true, C->i is 32-bit; else 64 // M matrix: GrB_Matrix M, // may be NULL bool Mask_struct, // mask is structural @@ -629,7 +638,10 @@ void GB_macrofy_mask // input: int mask_ecode, // enumified mask char *Mname, // name of the mask - int msparsity // sparsity of the mask + int msparsity, // sparsity of the mask + bool Mp_is_32, + bool Mj_is_32, + bool Mi_is_32 ) ; //------------------------------------------------------------------------------ @@ -786,16 +798,20 @@ void GB_macrofy_input FILE *fp, // input: const char *aname, // name of the scalar aij = ... - const char *Amacro, // name of the macro is GB_GET*(Amacro) - const char *Aname, // name of the input matrix + const char *Amacro, // name of the macro is GB_GETA, if Amacro is 'A' + const char *Aname, // name of the input matrix (typically A or B) bool do_matrix_macros, // if true, do the matrix macros - GrB_Type xtype, // type of aij + GrB_Type a2type, // type of aij after casting to x or y of f(x,y) GrB_Type atype, // type of the input matrix int asparsity, // sparsity format of the input matrix - int acode, // type code of the input (0 if pattern) - int A_iso_code, // 1 if A is iso - int azombies // 1 if A has zombies, 0 if A has no zombies, - // -1 if A can never have zombies + int acode, // type code of the input (0 if pattern, + // 15 if A is NULL) + bool A_iso, // true if A is iso + int azombies, // 1 if A has zombies, 0 if A has no zombies; + // -1 if the macro should not be created. + int p_is_32, // if true, Ap is 32-bit, else 64-bit + int j_is_32, // if true, Ah is 32-bit, else 64-bit + int i_is_32 // if true, Ai is 32-bit, else 64-bit ) ; void GB_macrofy_output @@ -809,7 +825,20 @@ void GB_macrofy_output GrB_Type ztype, // type of cij scalar to cast to ctype write to C int csparsity, // sparsity format of the output matrix bool C_iso, // true if C is iso on output - bool C_in_iso // true if C is iso on input + bool C_in_iso, // true if C is iso on input + int p_is_32, // if true, Cp is 32-bit, else 64-bit + int j_is_32, // if true, Ch is 32-bit, else 64-bit + int i_is_32 // if true, Ci is 32-bit, else 64-bit +) ; + +void GB_macrofy_bits +( + FILE *fp, + // input: + const char *Aname, // name of the matrix + int p_is_32, // if true, Ap is 32-bit, else 64-bit + int j_is_32, // if true, Ah is 32-bit, else 64-bit + int i_is_32 // if true, Ai is 32-bit, else 64-bit ) ; //------------------------------------------------------------------------------ @@ -928,14 +957,19 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem // C is sparse, hyper, or full. const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, // C=((ctype) T) is the final typecast + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t, else uint64_t // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop const bool flipij, // if true, flip i,j for user idxunop // A matrix: -// const GrB_Matrix A // input matrix const int A_sparsity, const bool A_is_matrix, const GrB_Type atype, + const bool Ap_is_32, // if true, A->p is uint32_t, else uint64_t + const bool Aj_is_32, // if true, A->h is uint32_t, else uint64_t + const bool Ai_is_32, // if true, A->i is uint32_t, else uint64_t const bool A_iso, const int64_t A_nzombies ) ; @@ -988,14 +1022,19 @@ uint64_t GB_encodify_apply // encode an apply problem const int C_sparsity, const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Ci is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cj is uint32_t, else uint64_t // operator: const GB_Operator op, // not JIT'd if NULL const bool flipij, // A matrix: -// const GrB_Matrix A const int A_sparsity, const bool A_is_matrix, const GrB_Type atype, + const bool Ap_is_32, // if true, Ap is uint32_t, else uint64_t + const bool Aj_is_32, // if true, Ah is uint32_t, else uint64_t + const bool Ai_is_32, // if true, Ai is uint32_t, else uint64_t const bool A_iso, const int64_t A_nzombies ) ; @@ -1047,7 +1086,7 @@ GrB_Info GB_transpose_bind1st_jit const GrB_BinaryOp binaryop, const GB_void *xscalar, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1061,7 +1100,7 @@ GrB_Info GB_transpose_bind2nd_jit const GrB_BinaryOp binaryop, const GrB_Matrix A, const GB_void *yscalar, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1074,7 +1113,7 @@ GrB_Info GB_transpose_unop_jit // C = op (A'), transpose unop via the JIT // input: GB_Operator op, const GrB_Matrix A, - int64_t *restrict *Workspaces, + void **Workspaces, const int64_t *restrict A_slice, int nworkspaces, int nthreads @@ -1096,16 +1135,19 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap ( // input: - const int64_t *restrict Cp, // vector pointers for CSC/CSR form + const void *Cp, // vector pointers for CSC/CSR form // outputs: - int64_t *restrict Ci, // indices for CSC/CSR or triplet form - int64_t *restrict Cj, // vector indices for triplet form + void *Ci, // indices for CSC/CSR or triplet form + void *Cj, // vector indices for triplet form GB_void *restrict Cx, // values for CSC/CSR or triplet form // inputs: not modified + const bool Cp_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Ci_is_32, // if true, Cp is uint32_t, else uint64_t + const bool Cj_is_32, // if true, Cp is uint32_t, else uint64_t const GrB_Type ctype, // type of Cx GB_Operator op, const GrB_Matrix A, // matrix to extract; not modified - const int64_t *restrict W, // workspace + const void *W, // workspace int nthreads // # of threads to use ) ; @@ -1117,7 +1159,7 @@ GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C int64_t cistart, const GB_Operator op, const GrB_Matrix A, - int64_t *restrict W, + void *W, // integer type matches C->p const int64_t *restrict A_ek_slicing, const int A_ntasks, const int A_nthreads @@ -1147,7 +1189,7 @@ GrB_Info GB_concat_bitmap_jit // concatenate A into a bitmap matrix C GB_Werk Werk ) ; -GrB_Info GB_split_sparse_jit // split A into a sparse tile C +GrB_Info GB_split_sparse_jit // split A into a sparse tile C ( // input/output GrB_Matrix C, @@ -1156,7 +1198,7 @@ GrB_Info GB_split_sparse_jit // split A into a sparse tile C const GrB_Matrix A, int64_t akstart, int64_t aistart, - int64_t *restrict Wp, + const void *Wp, // 32/64 bit, depending on A->p_is_32 const int64_t *restrict C_ek_slicing, const int C_ntasks, const int C_nthreads @@ -1200,17 +1242,27 @@ uint64_t GB_encodify_build // encode an build problem const GB_jit_kcode kcode, // kernel to encode const GrB_BinaryOp dup, // operator for summing up duplicates const GrB_Type ttype, // type of Tx array - const GrB_Type stype // type of Sx array + const GrB_Type stype, // type of Sx array + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t + bool I_is_32, // if true, I_work is uint32_t else uint64_t + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + bool no_duplicates // if true, no duplicates appear ) ; -void GB_enumify_build // enumerate a GB_build problem +void GB_enumify_build // enumerate a GB_build problem ( // output: - uint64_t *method_code, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: - GrB_BinaryOp dup, // operator for duplicates - GrB_Type ttype, // type of Tx - GrB_Type stype // type of Sx + GrB_BinaryOp dup, // operator for duplicates + GrB_Type ttype, // type of Tx + GrB_Type stype, // type of Sx + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t + bool I_is_32, // if true, I_work is uint32_t else uint64_t + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + bool no_duplicates // if true, no duplicates appear ) ; void GB_macrofy_build // construct all macros for GB_build @@ -1228,16 +1280,21 @@ GrB_Info GB_build_jit // GB_builder JIT kernel ( // output: GB_void *restrict Tx, - int64_t *restrict Ti, + void *restrict Ti, // input: + bool Ti_is_32, // if true, Ti is uint32_t, else uint64_t const GB_void *restrict Sx, const GrB_Type ttype, // type of Tx const GrB_Type stype, // type of Sx const GrB_BinaryOp dup, // operator for summing duplicates const int64_t nvals, // number of tuples const int64_t ndupl, // number of duplicates - const int64_t *restrict I_work, - const int64_t *restrict K_work, + const void *restrict I_work, + bool I_is_32, // if true, I_work is uint32_t else uint64_t + const void *restrict K_work, + bool K_is_32, // if true, K_work is uint32_t else uint64_t + bool K_is_null, // if true, K_work is NULL + const int64_t duplicate_entry, // row index of duplicate entries const int64_t *restrict tstart_slice, const int64_t *restrict tnz_slice, int nthreads @@ -1255,8 +1312,7 @@ uint64_t GB_encodify_select // encode an select problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode - const bool C_iso, - const bool in_place_A, + const GrB_Matrix C, const GrB_IndexUnaryOp op, const bool flipij, const GrB_Matrix A @@ -1267,13 +1323,10 @@ void GB_enumify_select // enumerate a GrB_selectproblem // output: uint64_t *method_code, // unique encoding of the entire operation // input: - bool C_iso, - bool in_place_A, - // operator: - GrB_IndexUnaryOp op, // the index unary operator to enumify - bool flipij, // if true, flip i and j - // A matrix: - GrB_Matrix A + const GrB_Matrix C, + const GrB_IndexUnaryOp op, // the index unary operator to enumify + const bool flipij, // if true, flip i and j + const GrB_Matrix A ) ; void GB_macrofy_select // construct all macros for GrB_select @@ -1284,16 +1337,14 @@ void GB_macrofy_select // construct all macros for GrB_select uint64_t method_code, // operator: const GrB_IndexUnaryOp op, - GrB_Type atype + GrB_Type atype // also the type of C ) ; GrB_Info GB_select_bitmap_jit // select bitmap ( - // output: - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed // input: - const bool C_iso, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -1301,15 +1352,13 @@ GrB_Info GB_select_bitmap_jit // select bitmap const int nthreads ) ; -GrB_Info GB_select_phase1_jit // select phase1 +GrB_Info GB_select_phase1_jit // select phase1 ( // output: - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, // C->p computed, with counts + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, // input: - const bool C_iso, - const bool in_place_A, const GrB_Matrix A, const GB_void *restrict ythunk, const GrB_IndexUnaryOp op, @@ -1321,14 +1370,10 @@ GrB_Info GB_select_phase1_jit // select phase1 GrB_Info GB_select_phase2_jit // select phase2 ( - // output: - int64_t *restrict Ci, - GB_void *restrict Cx, // NULL if C is iso-valued + // input/output: + GrB_Matrix C, // input: Cp; output: Ci, Cx // input: - const int64_t *restrict Cp, - const bool C_iso, - const bool in_place_A, - const int64_t *restrict Cp_kfirst, + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -1342,15 +1387,20 @@ GrB_Info GB_select_phase2_jit // select phase2 // assign/subassign kernel //------------------------------------------------------------------------------ -void GB_enumify_assign // enumerate a GrB_assign problem +uint64_t GB_encodify_assign // encode an assign problem ( // output: - uint64_t *method_code, // unique encoding of the entire operation + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel // input: + const GB_jit_kcode kcode, // kernel to encode // C matrix: GrB_Matrix C, bool C_replace, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto // M matrix: @@ -1363,33 +1413,21 @@ void GB_enumify_assign // enumerate a GrB_assign problem GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, // S matrix: - GrB_Matrix S, // may be MULL + GrB_Matrix S, // may be NULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) ; -void GB_macrofy_assign // construct all macros for GrB_assign -( - // output: - FILE *fp, // target file to write, already open - // input: - uint64_t method_code, - GrB_BinaryOp accum, // accum operator to macrofy - GrB_Type ctype, - GrB_Type atype // matrix or scalar type -) ; - -uint64_t GB_encodify_assign // encode an assign problem +void GB_enumify_assign // enumerate a GrB_assign problem ( // output: - GB_jit_encoding *encoding, // unique encoding of the entire problem, - // except for the suffix - char **suffix, // suffix for user-defined kernel + uint64_t *method_code, // unique encoding of the entire operation // input: - const GB_jit_kcode kcode, // kernel to encode // C matrix: GrB_Matrix C, bool C_replace, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto // M matrix: @@ -1402,10 +1440,21 @@ uint64_t GB_encodify_assign // encode an assign problem GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, // S matrix: - GrB_Matrix S, // may be NULL + GrB_Matrix S, // may be MULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) ; +void GB_macrofy_assign // construct all macros for GrB_assign +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_BinaryOp accum, // accum operator to macrofy + GrB_Type ctype, + GrB_Type atype // matrix or scalar type +) ; + GrB_Info GB_subassign_jit ( // input/output: @@ -1413,13 +1462,15 @@ GrB_Info GB_subassign_jit // input: const bool C_replace, // I: - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], // J: - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nj, const int64_t nJ, const int Jkind, @@ -1506,7 +1557,7 @@ GrB_Info GB_user_type_jit // construct a user type in a JIT kernel GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) ( // computed by phase1: - int64_t *Rp, // output of size Rnvec+1 + void *Rp, // output of size Rnvec+1; 32/64 bit int64_t *Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: GB_task_struct *restrict TaskList, // array of structs @@ -1514,10 +1565,12 @@ GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - const int64_t *restrict Rh, + const void *Rh, // size Rnvec, 32/64 bit const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, // if true, Rp is 32-bit; else 64-bit + const bool Rj_is_32, // if true, Rh is 32-bit; else 64-bit // original input: const GrB_Matrix M, // required mask const bool Mask_comp, // if true, then M is complemented @@ -1559,7 +1612,10 @@ uint64_t GB_encodify_masker // encode a masker problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode - const GrB_Matrix R, + const GrB_Matrix R, // may be NULL, for phase1 + const bool Rp_is_32, // if true, R->p is 32 bit; else 64 bit + const bool Rj_is_32, // if true, R->h is 32 bit; else 64 bit + const bool Ri_is_32, // if true, R->i is 32 bit; else 64 bit const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, @@ -1567,12 +1623,15 @@ uint64_t GB_encodify_masker // encode a masker problem const GrB_Matrix Z ) ; -void GB_enumify_masker // enumify a masker problem +void GB_enumify_masker // enumify a masker problem ( // output: uint64_t *method_code, // unique encoding of the entire operation // input: - const GrB_Matrix R, + const GrB_Matrix R, // NULL for phase 1 + const bool Rp_is_32, // if true, R->p is 32-bit; else 64-bit + const bool Rj_is_32, // if true, R->h is 32-bit; else 64-bit + const bool Ri_is_32, // if true, R->i is 32-bit; else 64-bit const GrB_Matrix M, const bool Mask_struct, const bool Mask_comp, @@ -1604,9 +1663,12 @@ uint64_t GB_encodify_subref // encode an subref problem // C matrix: GrB_Matrix C, // index types: + bool I_is_32, // if true, I is 32-bits; else 64 + bool J_is_32, // if true, J is 32-bits; else 64 (0 if not used) int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto, or 0 if not used bool need_qsort, // true if qsort needs to be called + bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 bool I_has_duplicates, // true if I has duplicate entries // A matrix: GrB_Matrix A @@ -1619,9 +1681,12 @@ void GB_enumify_subref // enumerate a GrB_extract problem // C matrix: GrB_Matrix C, // index types: + bool I_is_32, // if true, I is 32-bit; else 64-bit + bool J_is_32, // if true, J is 32-bit; else 64-bit (bitmap only) int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list int Jkind, // ditto, or 0 if not used bool need_qsort, // true if qsort needs to be called + bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 bool I_has_duplicates, // true if I has duplicate entries // A matrix: GrB_Matrix A @@ -1645,19 +1710,21 @@ GrB_Info GB_subref_sparse_jit const int ntasks, // # of tasks const int nthreads, // # of threads to use const bool post_sort, // true if post-sort needed - const int64_t *Mark, // for I inverse buckets, size A->vlen - const int64_t *Inext, // for I inverse buckets, size nI + const void *Ihead, // for I inverse buckets, size A->vlen + const void *Inext, // for I inverse buckets, size nI + const bool Ihead_is_32, // if true, Ihead/Inext 32-bit; else 64 const bool I_has_duplicates, // true if I has duplicates // from phase0: - const int64_t *restrict Ap_start, - const int64_t *restrict Ap_end, + const void *Ap_start, + const void *Ap_end, const bool need_qsort, const int Ikind, const int64_t nI, const int64_t Icolon [3], // original input: const GrB_Matrix A, - const GrB_Index *I + const void *I, + const bool I_is_32 ) ; GrB_Info GB_subref_bitmap_jit @@ -1667,12 +1734,14 @@ GrB_Info GB_subref_bitmap_jit // input: GrB_Matrix A, // I: - const GrB_Index *I, + const void *I, + const bool I_is_32, const int64_t nI, const int Ikind, const int64_t Icolon [3], // J: - const GrB_Index *J, + const void *J, + const bool J_is_32, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], diff --git a/GraphBLAS/Source/kronecker/GB_kron.c b/GraphBLAS/Source/kronecker/GB_kron.c index 5c6aaadb80..5c462da512 100644 --- a/GraphBLAS/Source/kronecker/GB_kron.c +++ b/GraphBLAS/Source/kronecker/GB_kron.c @@ -2,7 +2,7 @@ // GB_kron: C = accum (C, kron(A,B)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,10 +56,6 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) GrB_Matrix T = NULL, AT = NULL, BT = NULL ; GrB_BinaryOp op = op_in ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (B) ; - GB_RETURN_IF_FAULTY (M) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; @@ -89,7 +85,7 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) int64_t ancols = (A_transpose) ? GB_NROWS (A) : GB_NCOLS (A) ; int64_t bnrows = (B_transpose) ? GB_NCOLS (B) : GB_NROWS (B) ; int64_t bncols = (B_transpose) ? GB_NROWS (B) : GB_NCOLS (B) ; - GrB_Index cnrows, cncols, cnz = 0 ; + uint64_t cnrows, cncols, cnz = 0 ; bool ok = GB_int64_multiply (&cnrows, anrows, bnrows) ; ok = ok && GB_int64_multiply (&cncols, ancols, bncols) ; ok = ok && GB_int64_multiply (&cnz, GB_nnz (A), GB_nnz (B)) ; @@ -134,7 +130,7 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) { // AT = A' and typecast to op->xtype GBURBLE ("(A transpose) ") ; - GB_CLEAR_STATIC_HEADER (AT, &AT_header) ; + GB_CLEAR_MATRIX_HEADER (AT, &AT_header) ; GB_OK (GB_transpose_cast (AT, op->xtype, T_is_csc, A, A_is_pattern, Werk)) ; ASSERT_MATRIX_OK (AT, "AT kron", GB0) ; @@ -144,7 +140,7 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) { // BT = B' and typecast to op->ytype GBURBLE ("(B transpose) ") ; - GB_CLEAR_STATIC_HEADER (BT, &BT_header) ; + GB_CLEAR_MATRIX_HEADER (BT, &BT_header) ; GB_OK (GB_transpose_cast (BT, op->ytype, T_is_csc, B, B_is_pattern, Werk)) ; ASSERT_MATRIX_OK (BT, "BT kron", GB0) ; @@ -154,7 +150,7 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) // T = kron(A,B) //-------------------------------------------------------------------------- - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; GB_OK (GB_kroner (T, T_is_csc, op, flipij, A_transpose ? AT : A, A_is_pattern, B_transpose ? BT : B, B_is_pattern, Werk)) ; diff --git a/GraphBLAS/Source/kronecker/GB_kron.h b/GraphBLAS/Source/kronecker/GB_kron.h index 35000f4b40..a6c1a3f3ae 100644 --- a/GraphBLAS/Source/kronecker/GB_kron.h +++ b/GraphBLAS/Source/kronecker/GB_kron.h @@ -2,7 +2,7 @@ // GB_kron.h: definitions for GB_kron //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/kronecker/GB_kroner.c b/GraphBLAS/Source/kronecker/GB_kroner.c index 2033e78171..afbb655ee4 100644 --- a/GraphBLAS/Source/kronecker/GB_kroner.c +++ b/GraphBLAS/Source/kronecker/GB_kroner.c @@ -2,7 +2,7 @@ // GB_kroner: Kronecker product, C = kron (A,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ GrB_Info GB_kroner // C = kron (A,B) //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; struct GB_Matrix_opaque Awork_header, Bwork_header ; GrB_Matrix Awork = NULL, Bwork = NULL ; @@ -72,8 +72,7 @@ GrB_Info GB_kroner // C = kron (A,B) if (GB_IS_BITMAP (A)) { GBURBLE ("A:") ; - // set Awork->iso = A->iso OK: no need for burble - GB_CLEAR_STATIC_HEADER (Awork, &Awork_header) ; + GB_CLEAR_MATRIX_HEADER (Awork, &Awork_header) ; GB_OK (GB_dup_worker (&Awork, A->iso, A, true, NULL)) ; ASSERT_MATRIX_OK (Awork, "dup Awork for kron (A,B)", GB0) ; GB_OK (GB_convert_bitmap_to_sparse (Awork, Werk)) ; @@ -85,8 +84,7 @@ GrB_Info GB_kroner // C = kron (A,B) if (GB_IS_BITMAP (B)) { GBURBLE ("B:") ; - // set Bwork->iso = B->iso OK: no need for burble - GB_CLEAR_STATIC_HEADER (Bwork, &Bwork_header) ; + GB_CLEAR_MATRIX_HEADER (Bwork, &Bwork_header) ; GB_OK (GB_dup_worker (&Bwork, B->iso, B, true, NULL)) ; ASSERT_MATRIX_OK (Bwork, "dup Bwork for kron (A,B)", GB0) ; GB_OK (GB_convert_bitmap_to_sparse (Bwork, Werk)) ; @@ -98,17 +96,17 @@ GrB_Info GB_kroner // C = kron (A,B) // get inputs //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + const int64_t avlen = A->vlen ; const int64_t avdim = A->vdim ; const int64_t anvec = A->nvec ; const int64_t anz = GB_nnz (A) ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + const int64_t bvlen = B->vlen ; const int64_t bvdim = B->vdim ; const int64_t bnvec = B->nvec ; @@ -140,8 +138,7 @@ GrB_Info GB_kroner // C = kron (A,B) // C has the same type as z for the multiply operator, z=op(x,y) - GrB_Index cvlen, cvdim, cnzmax, cnvec ; - + uint64_t cvlen, cvdim, cnzmax, cnvec ; bool ok = GB_int64_multiply (&cvlen, avlen, bvlen) ; ok = ok & GB_int64_multiply (&cvdim, avdim, bvdim) ; ok = ok & GB_int64_multiply (&cnzmax, anz, bnz) ; @@ -162,17 +159,24 @@ GrB_Info GB_kroner // C = kron (A,B) int C_sparsity = C_is_full ? GxB_FULL : ((C_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE) ; - // set C->iso = C_iso OK + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + C_sparsity, cnzmax, (int64_t) cvlen, (int64_t) cvdim, Werk) ; + GB_OK (GB_new_bix (&C, // full, sparse, or hyper; existing header - ctype, (int64_t) cvlen, (int64_t) cvdim, GB_Ap_malloc, C_is_csc, - C_sparsity, true, B->hyper_switch, cnvec, cnzmax, true, C_iso)) ; + ctype, (int64_t) cvlen, (int64_t) cvdim, GB_ph_malloc, C_is_csc, + C_sparsity, true, B->hyper_switch, cnvec, cnzmax, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32)) ; //-------------------------------------------------------------------------- // compute the column counts of C: Cp and Ch if C is hypersparse //-------------------------------------------------------------------------- - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, ) ; GB_Ch_PTR (Ch, C) ; + #define GB_Cp_IS_32 Cp_is_32 if (!C_is_full) { @@ -184,22 +188,28 @@ GrB_Info GB_kroner // C = kron (A,B) const int64_t kA = kC / bnvec ; const int64_t kB = kC % bnvec ; // get A(:,jA), the (kA)th vector of A - const int64_t jA = GBH (Ah, kA) ; - const int64_t aknz = (Ap == NULL) ? avlen : (Ap [kA+1] - Ap [kA]) ; + const int64_t jA = GBh_A (Ah, kA) ; + const int64_t aknz = (Ap == NULL) ? avlen : + (GB_IGET (Ap, kA+1) - GB_IGET (Ap, kA)) ; // get B(:,jB), the (kB)th vector of B - const int64_t jB = GBH (Bh, kB) ; - const int64_t bknz = (Bp == NULL) ? bvlen : (Bp [kB+1] - Bp [kB]) ; + const int64_t jB = GBh_B (Bh, kB) ; + const int64_t bknz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kB+1) - GB_IGET (Bp, kB)) ; // determine # entries in C(:,jC), the (kC)th vector of C // int64_t kC = kA * bnvec + kB ; - Cp [kC] = aknz * bknz ; + // Cp [kC] = aknz * bknz ; + GB_ISET (Cp, kC, aknz * bknz) ; if (C_is_hyper) { - Ch [kC] = jA * bvdim + jB ; + // Ch [kC] = jA * bvdim + jB ; + GB_ISET (Ch, kC, jA * bvdim + jB) ; } } - GB_cumsum (Cp, cnvec, &(C->nvec_nonempty), nthreads, Werk) ; - C->nvals = Cp [cnvec] ; + int64_t nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, cnvec, &nvec_nonempty, nthreads, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + C->nvals = GB_IGET (Cp, cnvec) ; if (C_is_hyper) C->nvec = cnvec ; } @@ -323,14 +333,14 @@ GrB_Info GB_kroner // C = kron (A,B) if (info == GrB_SUCCESS) { - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; + ASSERT_MATRIX_OK (C, "C=kron(A,B)", GB0) ; } //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- - ASSERT_MATRIX_OK (C, "C=kron(A,B)", GB0) ; GB_FREE_WORKSPACE ; return (info) ; } diff --git a/GraphBLAS/Source/kronecker/GrB_kronecker.c b/GraphBLAS/Source/kronecker/GrB_kronecker.c index ba14efd270..00d5a1f380 100644 --- a/GraphBLAS/Source/kronecker/GrB_kronecker.c +++ b/GraphBLAS/Source/kronecker/GrB_kronecker.c @@ -2,7 +2,7 @@ // GrB_kronecker: Kronecker product //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix Mask, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_BinaryOp op, // defines '*' for T=kron(A,B) const GrB_Matrix A, // first input: matrix A @@ -30,7 +30,12 @@ GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_kronecker_BinaryOp (C, M, accum, op, A, B, desc)"); + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (B) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, Mask, A, B, "GrB_Matrix_kronecker (C, M, accum, op, A, B, " + "desc)") ; GB_BURBLE_START ("GrB_kronecker") ; // get the descriptor @@ -38,7 +43,7 @@ GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) A_tran, B_tran, xx, xx7) ; // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; + GrB_Matrix M = GB_get_mask (Mask, &Mask_comp, &Mask_struct) ; //-------------------------------------------------------------------------- // C = kron(A,B) @@ -65,7 +70,7 @@ GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Monoid monoid, // defines '*' for T=kron(A,B) const GrB_Matrix A, // first input: matrix A @@ -73,39 +78,9 @@ GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_kronecker_Monoid " - "(C, M, accum, op, monoid, B, desc)"); - GB_BURBLE_START ("GrB_kronecker") ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - A_tran, B_tran, xx, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; - - //-------------------------------------------------------------------------- - // C = kron(A,B) - //-------------------------------------------------------------------------- - - // C = accum (C,T) where T = kron(A,B), or with A' and/or B' - info = GB_kron ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - accum, // for accum (C,T) - monoid->op, // operator that defines T=kron(A,B) - A, A_tran, // A matrix and its descriptor - B, B_tran, // B matrix and its descriptor - Werk) ; - - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = monoid->op ; + return (GrB_Matrix_kronecker_BinaryOp (C, M, accum, op, A, B, desc)) ; } //------------------------------------------------------------------------------ @@ -115,7 +90,7 @@ GrB_Info GrB_Matrix_kronecker_Monoid // C = accum (C, kron(A,B)) GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) ( GrB_Matrix C, // input/output matrix for results - const GrB_Matrix M_in, // optional mask for C, unused if NULL + const GrB_Matrix M, // optional mask for C, unused if NULL const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_Semiring semiring, // defines '*' for T=kron(A,B) const GrB_Matrix A, // first input: matrix A @@ -123,39 +98,9 @@ GrB_Info GrB_Matrix_kronecker_Semiring // C = accum (C, kron(A,B)) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE (C, "GrB_Matrix_kronecker_Semiring " - "(C, M, accum, semiring, A, B, desc)") ; - GB_BURBLE_START ("GrB_kronecker") ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; - - // get the descriptor - GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, - A_tran, B_tran, xx, xx7) ; - - // get the mask - GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; - - //-------------------------------------------------------------------------- - // C = kron(A,B) - //-------------------------------------------------------------------------- - - // C = accum (C,T) where T = kron(A,B), or with A' and/or B' - info = GB_kron ( - C, C_replace, // C matrix and its descriptor - M, Mask_comp, Mask_struct, // mask matrix and its descriptor - accum, // for accum (C,T) - semiring->multiply, // operator that defines T=kron(A,B) - A, A_tran, // A matrix and its descriptor - B, B_tran, // B matrix and its descriptor - Werk) ; - - GB_BURBLE_END ; - return (info) ; + GrB_BinaryOp op = semiring->multiply ; + return (GrB_Matrix_kronecker_BinaryOp (C, M, accum, op, A, B, desc)) ; } //------------------------------------------------------------------------------ @@ -173,7 +118,6 @@ GrB_Info GxB_kron // C = accum (C, kron(A,B)) const GrB_Descriptor desc // descriptor for C, M, A, and B ) { - // call the new GrB_kronecker (the binary op version) return (GrB_Matrix_kronecker_BinaryOp (C, M, accum, op, A, B, desc)) ; } diff --git a/GraphBLAS/Source/kronecker/template/GB_kroner_template.c b/GraphBLAS/Source/kronecker/template/GB_kroner_template.c index db2d2943ca..bdc76990c0 100644 --- a/GraphBLAS/Source/kronecker/template/GB_kroner_template.c +++ b/GraphBLAS/Source/kronecker/template/GB_kroner_template.c @@ -2,7 +2,7 @@ // GB_kroner_template: Kronecker product, C = kron (A,B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,22 +20,25 @@ //-------------------------------------------------------------------------- #ifdef GB_JIT_KERNEL - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; const int64_t avlen = A->vlen ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; const int64_t bvlen = B->vlen ; const int64_t bnvec = B->nvec ; + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; GB_C_NVALS (cnz) ; - const int64_t *restrict Cp = C->p ; const int64_t cnvec = C->nvec ; const int64_t cvlen = C->vlen ; #endif - int64_t *restrict Ci = C->i ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; const GB_B_TYPE *restrict Bx = (GB_A_TYPE *) B->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; @@ -72,8 +75,9 @@ GB_PARTITION (pC, pC_end, cnz, tid, nthreads) ; // find where this task starts in C - int64_t kC_task = GB_search_for_vector (pC, Cp, 0, cnvec, cvlen) ; - int64_t pC_delta = pC - GBP_C (Cp, kC_task, cvlen) ; + int64_t kC_task = GB_search_for_vector (Cp, GB_Cp_IS_32, pC, 0, cnvec, + cvlen) ; + int64_t pC_delta = pC - GBp_C (Cp, kC_task, cvlen) ; //---------------------------------------------------------------------- // compute C(:,kC) for all vectors kC in this task @@ -87,19 +91,19 @@ //------------------------------------------------------------------ // C(:,jC) = kron (A(:,jA), B(:,jB), the (kC)th vector of C, - // where jC = GBH_C (Ch, kC) + // where jC = GBh_C (Ch, kC) int64_t kA = kC / bnvec ; int64_t kB = kC % bnvec ; // get A(:,jA), the (kA)th vector of A - int64_t jA = GBH_A (Ah, kA) ; - int64_t pA_start = GBP_A (Ap, kA, avlen) ; - int64_t pA_end = GBP_A (Ap, kA+1, avlen) ; + int64_t jA = GBh_A (Ah, kA) ; + int64_t pA_start = GBp_A (Ap, kA, avlen) ; + int64_t pA_end = GBp_A (Ap, kA+1, avlen) ; // get B(:,jB), the (kB)th vector of B - int64_t jB = GBH_B (Bh, kB) ; - int64_t pB_start = GBP_B (Bp, kB, bvlen) ; - int64_t pB_end = GBP_B (Bp, kB+1, bvlen) ; + int64_t jB = GBh_B (Bh, kB) ; + int64_t pB_start = GBp_B (Bp, kB, bvlen) ; + int64_t pB_end = GBp_B (Bp, kB+1, bvlen) ; int64_t bknz = pB_end - pB_start ; // shift into the middle of A(:,jA) and B(:,jB) for the first @@ -125,7 +129,7 @@ // a = A(iA,jA), typecasted to op->xtype //-------------------------------------------------------------- - int64_t iA = GBI_A (Ai, pA, avlen) ; + int64_t iA = GBi_A (Ai, pA, avlen) ; int64_t iAblock = iA * bvlen ; if (!GB_A_ISO) { @@ -147,7 +151,7 @@ // b = B(iB,jB), typecasted to op->ytype //---------------------------------------------------------- - int64_t iB = GBI_B (Bi, pB, bvlen) ; + int64_t iB = GBi_B (Bi, pB, bvlen) ; if (!GB_B_ISO) { GB_GETB (b, Bx, pB, false) ; @@ -160,7 +164,8 @@ if (!GB_C_IS_FULL) { // save the row index iC - Ci [pC] = iAblock + iB ; + // Ci [pC] = iAblock + iB ; + GB_ISET (Ci, pC, iAblock + iB) ; } // Cx [pC] = op (a, b) if (!GB_C_ISO) diff --git a/GraphBLAS/Source/lz4_wrapper/GB_lz4.c b/GraphBLAS/Source/lz4_wrapper/GB_lz4.c index 44d40c9107..fa3b84357c 100644 --- a/GraphBLAS/Source/lz4_wrapper/GB_lz4.c +++ b/GraphBLAS/Source/lz4_wrapper/GB_lz4.c @@ -2,7 +2,7 @@ // GB_lz4: wrapper for the LZ4 compression library //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/lz4_wrapper/GB_lz4.h b/GraphBLAS/Source/lz4_wrapper/GB_lz4.h index 88c86e6520..bc76c60487 100644 --- a/GraphBLAS/Source/lz4_wrapper/GB_lz4.h +++ b/GraphBLAS/Source/lz4_wrapper/GB_lz4.h @@ -2,7 +2,7 @@ // GB_lz4.h: definitions for a wrapper for the LZ4 compression library //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mask/GB_accum_mask.c b/GraphBLAS/Source/mask/GB_accum_mask.c index 0d2db4b83b..bdc2149ed8 100644 --- a/GraphBLAS/Source/mask/GB_accum_mask.c +++ b/GraphBLAS/Source/mask/GB_accum_mask.c @@ -2,7 +2,7 @@ // GB_accum_mask: accumulate results via the mask and accum operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,6 +44,7 @@ // The descriptor affects how C and M are handled. If the descriptor is // NULL, defaults are used. +#include "ok/include/GB_ok.h" #define GB_FREE_ALL \ { \ GB_Matrix_free (Thandle) ; \ @@ -57,7 +58,6 @@ #include "transpose/GB_transpose.h" #include "mask/GB_accum_mask.h" #include "assign/GB_bitmap_assign.h" -#include "include/GB_unused.h" /* ----------------------------------------------------------------------------- @@ -191,10 +191,8 @@ GrB_Info GB_accum_mask // C = accum (C,T) if (C->is_csc != T->is_csc) { // T can be jumbled. - ASSERT (GB_JUMBLED_OK (T)) ; GB_OK (GB_transpose_in_place (T, C->is_csc, Werk)) ; T_transposed = true ; - ASSERT (GB_JUMBLED_OK (T)) ; ASSERT_MATRIX_OK (T, "[T = transposed]", GB0) ; } @@ -209,10 +207,10 @@ GrB_Info GB_accum_mask // C = accum (C,T) // remove zombies and pending tuples from M. M can be jumbled. GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (M) ; ASSERT (GB_JUMBLED_OK (M)) ; - GB_CLEAR_STATIC_HEADER (MT, &MT_header) ; + GB_CLEAR_MATRIX_HEADER (MT, &MT_header) ; GB_OK (GB_transpose_cast (MT, GrB_BOOL, C->is_csc, M, Mask_struct, Werk)) ; - ASSERT (MT->static_header || GBNSTATIC) ; + ASSERT (MT->header_size == 0 || GBNSTATIC) ; // use the transpose mask M = MT ; ASSERT (GB_JUMBLED_OK (M)) ; @@ -338,8 +336,13 @@ GrB_Info GB_accum_mask // C = accum (C,T) //---------------------------------------------------------------------- GB_OK (GB_subassign (C, C_replace, M, Mask_comp, Mask_struct, - false, accum, T, false, GrB_ALL, 0, GrB_ALL, 0, - false, NULL, GB_ignore_code, Werk)) ; + /* M_transpose: */ false, accum, + /* A: */ T, /* A_transpose: */ false, + /* Rows: */ GrB_ALL, false, 0, + /* Cols: */ GrB_ALL, false, 0, + /* scalar_expansion: */ false, /* scalar: */ NULL, + /* scalar type code: */ GB_ignore_code, + Werk)) ; } else @@ -352,7 +355,7 @@ GrB_Info GB_accum_mask // C = accum (C,T) // see GB_spec_accum.m for a description of this step. If C is empty, // then the accumulator can be ignored. - GB_CLEAR_STATIC_HEADER (Z, &Z_header) ; + GB_CLEAR_MATRIX_HEADER (Z, &Z_header) ; if (use_transplant) { @@ -365,10 +368,10 @@ GrB_Info GB_accum_mask // C = accum (C,T) // allocated by the transplant if needed. Z has the same // hypersparsity as T. - info = GB_new (&Z, // sparse or hyper, existing header - C->type, C->vlen, C->vdim, GB_Ap_null, C->is_csc, - GB_sparsity (T), T->hyper_switch, T->plen) ; - GB_OK (info) ; + GB_OK (GB_new (&Z, // sparse or hyper, existing header + C->type, C->vlen, C->vdim, GB_ph_null, C->is_csc, + GB_sparsity (T), T->hyper_switch, T->plen, + T->p_is_32, T->j_is_32, T->i_is_32)) ; // Transplant T into Z, typecasting if needed, and free T. This // may need to do a deep copy if T is shallow. T is always freed @@ -391,8 +394,8 @@ GrB_Info GB_accum_mask // C = accum (C,T) GB_MATRIX_WAIT (T) ; bool apply_mask ; - int Z_sparsity = GB_add_sparsity (&apply_mask, M, Mask_struct, - Mask_comp, C, T) ; + // int Z_sparsity = + GB_add_sparsity (&apply_mask, M, Mask_struct, Mask_comp, C, T) ; // whether or not GB_add chooses to exploit the mask, it must still // be used in GB_mask, below. So ignore the mask_applied return @@ -406,7 +409,7 @@ GrB_Info GB_accum_mask // C = accum (C,T) // T has been transplanted into Z or freed after Z=C+T ASSERT (*Thandle == NULL || - (*Thandle != NULL && ((*Thandle)->static_header || GBNSTATIC))) ; + (*Thandle != NULL && ((*Thandle)->header_size == 0 || GBNSTATIC))) ; // C and Z have the same type ASSERT_MATRIX_OK (Z, "Z in accum_mask", GB0) ; diff --git a/GraphBLAS/Source/mask/GB_accum_mask.h b/GraphBLAS/Source/mask/GB_accum_mask.h index c51cde813f..46b1da04b1 100644 --- a/GraphBLAS/Source/mask/GB_accum_mask.h +++ b/GraphBLAS/Source/mask/GB_accum_mask.h @@ -2,7 +2,7 @@ // GB_accum_mask.h: definitions for GB_accum_mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mask/GB_get_mask.h b/GraphBLAS/Source/mask/GB_get_mask.h index 0aefc5d026..b8b9e5ed07 100644 --- a/GraphBLAS/Source/mask/GB_get_mask.h +++ b/GraphBLAS/Source/mask/GB_get_mask.h @@ -2,7 +2,7 @@ // GB_get_mask.h: get the user's mask and handle M->iso //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mask/GB_mask.c b/GraphBLAS/Source/mask/GB_mask.c index e985b74f52..81e34f1a13 100644 --- a/GraphBLAS/Source/mask/GB_mask.c +++ b/GraphBLAS/Source/mask/GB_mask.c @@ -2,7 +2,7 @@ // GB_mask: apply a mask: C = Z //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -137,7 +137,7 @@ GrB_Info GB_mask // C = Z // C_result may be aliased with M ASSERT_MATRIX_OK (C_result, "C_result for GB_mask", GB0) ; - ASSERT (!C_result->static_header) ; + ASSERT (!(C_result->header_size == 0)) ; // C may be cleared anyway, without the need for finishing it ASSERT (GB_ZOMBIES_OK (C_result)) ; ASSERT (GB_JUMBLED_OK (C_result)) ; @@ -265,14 +265,16 @@ GrB_Info GB_mask // C = Z // created, which is what C_result would look like if cleared. // C_result is left unchanged since changing it would change M. // The C0 matrix is created as hypersparse. - // set C0->iso = false OK - GB_CLEAR_STATIC_HEADER (C0, &C0_header) ; + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_HYPERSPARSE, 1, vlen, vdim, Werk) ; + GB_CLEAR_MATRIX_HEADER (C0, &C0_header) ; GB_OK (GB_new_bix (&C0, // sparse or hyper, existing header - C_result->type, vlen, vdim, GB_Ap_calloc, R_is_csc, + C_result->type, vlen, vdim, GB_ph_calloc, R_is_csc, GxB_HYPERSPARSE, true, C_result->hyper_switch, 0, 0, - true, false)) ; + true, false, Cp_is_32, Cj_is_32, Ci_is_32)) ; C = C0 ; - ASSERT (C->static_header || GBNSTATIC) ; + ASSERT (C->header_size == 0 || GBNSTATIC) ; } else { @@ -283,7 +285,7 @@ GrB_Info GB_mask // C = Z GB_OK (GB_clear (C_result, Werk)) ; C_result->sparsity_control = save ; // restore control C = C_result ; // C must have a dynamic header - ASSERT (!C->static_header) ; + ASSERT (!(C->header_size == 0)) ; } // C has been cleared, so it has no zombies or pending tuples } @@ -292,7 +294,7 @@ GrB_Info GB_mask // C = Z // C has already been finished if C_replace is false, via the // GB_MATRIX_WAIT (C) in GB_accum_mask. C = C_result ; - ASSERT (!C->static_header) ; + ASSERT (!(C->header_size == 0)) ; } // C cannot be bitmap or full for GB_masker @@ -314,9 +316,8 @@ GrB_Info GB_mask // C = Z // R = masker (C, M, Z): compute C=Z, placing results in R //---------------------------------------------------------------------- - GB_CLEAR_STATIC_HEADER (R, &R_header) ; - GB_OK (GB_masker (R, R_is_csc, M, Mask_comp, Mask_struct, C, Z, - Werk)) ; + GB_CLEAR_MATRIX_HEADER (R, &R_header) ; + GB_OK (GB_masker (R, R_is_csc, M, Mask_comp, Mask_struct, C, Z, Werk)) ; //---------------------------------------------------------------------- // free temporary matrices Z and C0 diff --git a/GraphBLAS/Source/mask/GB_mask.h b/GraphBLAS/Source/mask/GB_mask.h index 44dfee5c17..a5286fc665 100644 --- a/GraphBLAS/Source/mask/GB_mask.h +++ b/GraphBLAS/Source/mask/GB_mask.h @@ -2,7 +2,7 @@ // GB_mask: definitions for GB_mask and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ GrB_Info GB_masker // R = masker (C, M, Z) GrB_Info GB_masker_phase1 // count nnz in each R(:,j) ( // computed by phase1: - int64_t **Rp_handle, // output of size Rnvec+1 + void **Rp_handle, // vector pointers for R size_t *Rp_size_handle, int64_t *Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: @@ -48,10 +48,12 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - const int64_t *restrict Rh, + const void *Rh, const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, + const bool Rj_is_32, // original input: const GrB_Matrix M, // required mask const bool Mask_comp, // if true, then M is complemented @@ -66,20 +68,23 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) GrB_Matrix R, // output matrix, static header const bool R_is_csc, // format of output matrix R // from phase1: - int64_t **Rp_handle, // vector pointers for R + void **Rp_handle, // vector pointers for R size_t Rp_size, const int64_t Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: const GB_task_struct *restrict TaskList, // array of structs - const int R_ntasks, // # of tasks - const int R_nthreads, // # of threads to use + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - int64_t **Rh_handle, + void **Rh_handle, // R->h hyperlist size_t Rh_size, const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, + const bool Rj_is_32, + const bool Ri_is_32, const int R_sparsity, // original input: const GrB_Matrix M, // required mask diff --git a/GraphBLAS/Source/mask/GB_mask_very_sparse.h b/GraphBLAS/Source/mask/GB_mask_very_sparse.h index 185473f97c..9c8a5e0507 100644 --- a/GraphBLAS/Source/mask/GB_mask_very_sparse.h +++ b/GraphBLAS/Source/mask/GB_mask_very_sparse.h @@ -2,7 +2,7 @@ // GB_mask_very_sparse.h: determine if a mask is very sparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mask/GB_masker.c b/GraphBLAS/Source/mask/GB_masker.c index 7c5aec5049..8fe8cc2d79 100644 --- a/GraphBLAS/Source/mask/GB_masker.c +++ b/GraphBLAS/Source/mask/GB_masker.c @@ -2,7 +2,7 @@ // GB_masker: R = masker (C, M, Z) constructs R for C=Z //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,9 +15,8 @@ // GB_accum_mask. // Let R be the result of the mask. In the caller, R is written back into the -// final C matrix, but in GB_masker, C is a read-only matrix. Consider the -// following table, where "add" is the result of C+Z, an "emult" is the result -// of C.*Z. +// final C matrix, but C is not modified in GB_masker. Consider the following +// table, where "add" is the result of C+Z, an "emult" is the result of C.*Z. // R = masker (C,M,Z) @@ -84,7 +83,7 @@ GrB_Info GB_masker // R = masker (C, M, Z) GrB_Info info ; - ASSERT (R != NULL && (R->static_header || GBNSTATIC)) ; + ASSERT (R != NULL && (R->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (M, "M for masker", GB0) ; ASSERT (!GB_PENDING (M)) ; @@ -118,15 +117,17 @@ GrB_Info GB_masker // R = masker (C, M, Z) // initializations //-------------------------------------------------------------------------- - int64_t Rnvec, Rnvec_nonempty ; - int64_t *Rp = NULL ; size_t Rp_size = 0 ; - int64_t *Rh = NULL ; size_t Rh_size = 0 ; + int64_t Rnvec, Rnvec_nonempty = 0 ; + void *Rp = NULL ; size_t Rp_size = 0 ; + void *Rh = NULL ; size_t Rh_size = 0 ; + int64_t *R_to_M = NULL ; size_t R_to_M_size = 0 ; int64_t *R_to_C = NULL ; size_t R_to_C_size = 0 ; int64_t *R_to_Z = NULL ; size_t R_to_Z_size = 0 ; - int R_ntasks = 0, R_nthreads ; - size_t TaskList_size = 0 ; - GB_task_struct *TaskList = NULL ; + + int R_ntasks = 0 ; + size_t TaskList_size = 0 ; GB_task_struct *TaskList = NULL ; + bool Rp_is_32, Rj_is_32, Ri_is_32 ; //-------------------------------------------------------------------------- // phase0: finalize the sparsity structure of R and the vectors of R @@ -135,19 +136,17 @@ GrB_Info GB_masker // R = masker (C, M, Z) // This phase is identical to phase0 of GB_add, except that Ch is never a // deep or shallow copy of Mh. R_sparsity may change to hypersparse. - info = GB_add_phase0 ( - // computed by by phase0: + GB_OK (GB_add_phase0 ( + // computed by phase0: &Rnvec, &Rh, &Rh_size, &R_to_M, &R_to_M_size, &R_to_C, &R_to_C_size, - &R_to_Z, &R_to_Z_size, NULL, &R_sparsity, + &R_to_Z, &R_to_Z_size, /* Rh_is_Mh is false: */ NULL, + &Rp_is_32, &Rj_is_32, &Ri_is_32, + // input/output to phase0: + &R_sparsity, // original input: - M, C, Z, Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory - return (info) ; - } + M, C, Z, Werk)) ; GBURBLE ("masker:(%s:%s%s%s%s%s=%s) ", GB_sparsity_char (R_sparsity), @@ -162,11 +161,26 @@ GrB_Info GB_masker // R = masker (C, M, Z) // phase1: split R into tasks, and count entries in each vector of R //-------------------------------------------------------------------------- + double work = M->vlen * M->vdim ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + int R_nthreads = GB_nthreads (work, chunk, nthreads_max) ; + if (R_sparsity == GxB_SPARSE || R_sparsity == GxB_HYPERSPARSE) { //---------------------------------------------------------------------- - // R is sparse or hypersparse: slice and analyze the R matrix + // R is sparse or hypersparse: but double-check + //---------------------------------------------------------------------- + + // This assertion fails on AppleClang 16.0.0 with -O3, even though the + // assertion exactly matches the enclosing if condition. Optimization + // is not critical for this file, so it is turned off when using any + // clang compiler. + GB_assert (R_sparsity == GxB_SPARSE || R_sparsity == GxB_HYPERSPARSE) ; + + //---------------------------------------------------------------------- + // slice and analyze the R matrix //---------------------------------------------------------------------- // phase1a: split R into tasks @@ -174,16 +188,16 @@ GrB_Info GB_masker // R = masker (C, M, Z) // computed by phase1a &TaskList, &TaskList_size, &R_ntasks, &R_nthreads, // computed by phase0: - Rnvec, Rh, R_to_M, R_to_C, R_to_Z, false, + Rnvec, Rh, Rj_is_32, R_to_M, R_to_C, R_to_Z, /* Rh_is_Mh: */ false, // original input: M, C, Z, Werk) ; if (info != GrB_SUCCESS) { // out of memory; free everything allocated by GB_add_phase0 - GB_FREE (&Rh, Rh_size) ; - GB_FREE_WORK (&R_to_M, R_to_M_size) ; - GB_FREE_WORK (&R_to_C, R_to_C_size) ; - GB_FREE_WORK (&R_to_Z, R_to_Z_size) ; + GB_FREE_MEMORY (&Rh, Rh_size) ; + GB_FREE_MEMORY (&R_to_M, R_to_M_size) ; + GB_FREE_MEMORY (&R_to_C, R_to_C_size) ; + GB_FREE_MEMORY (&R_to_Z, R_to_Z_size) ; return (info) ; } @@ -194,32 +208,21 @@ GrB_Info GB_masker // R = masker (C, M, Z) // from phase1a: TaskList, R_ntasks, R_nthreads, // from phase0: - Rnvec, Rh, R_to_M, R_to_C, R_to_Z, + Rnvec, Rh, R_to_M, R_to_C, R_to_Z, Rp_is_32, Rj_is_32, // original input: M, Mask_comp, Mask_struct, C, Z, Werk) ; if (info != GrB_SUCCESS) { // out of memory; free everything allocated by GB_add_phase0 - GB_FREE_WORK (&TaskList, TaskList_size) ; - GB_FREE (&Rh, Rh_size) ; - GB_FREE_WORK (&R_to_M, R_to_M_size) ; - GB_FREE_WORK (&R_to_C, R_to_C_size) ; - GB_FREE_WORK (&R_to_Z, R_to_Z_size) ; + GB_FREE_MEMORY (&TaskList, TaskList_size) ; + GB_FREE_MEMORY (&Rh, Rh_size) ; + GB_FREE_MEMORY (&R_to_M, R_to_M_size) ; + GB_FREE_MEMORY (&R_to_C, R_to_C_size) ; + GB_FREE_MEMORY (&R_to_Z, R_to_Z_size) ; return (info) ; } } - else - { - - //---------------------------------------------------------------------- - // R is bitmap or full: only determine how many threads to use - //---------------------------------------------------------------------- - - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - R_nthreads = GB_nthreads (M->vlen * M->vdim, chunk, nthreads_max) ; - } //-------------------------------------------------------------------------- // phase2: compute the entries (indices and values) in each vector of R @@ -236,17 +239,18 @@ GrB_Info GB_masker // R = masker (C, M, Z) // from phase1a: TaskList, R_ntasks, R_nthreads, // from phase0: - Rnvec, &Rh, Rh_size, R_to_M, R_to_C, R_to_Z, R_sparsity, + Rnvec, &Rh, Rh_size, R_to_M, R_to_C, R_to_Z, + Rp_is_32, Rj_is_32, Ri_is_32, R_sparsity, // original input: M, Mask_comp, Mask_struct, C, Z, Werk) ; // if successful, Rh and Rp must not be freed; they are now R->h and R->p // free workspace - GB_FREE_WORK (&TaskList, TaskList_size) ; - GB_FREE_WORK (&R_to_M, R_to_M_size) ; - GB_FREE_WORK (&R_to_C, R_to_C_size) ; - GB_FREE_WORK (&R_to_Z, R_to_Z_size) ; + GB_FREE_MEMORY (&TaskList, TaskList_size) ; + GB_FREE_MEMORY (&R_to_M, R_to_M_size) ; + GB_FREE_MEMORY (&R_to_C, R_to_C_size) ; + GB_FREE_MEMORY (&R_to_Z, R_to_Z_size) ; if (info != GrB_SUCCESS) { diff --git a/GraphBLAS/Source/mask/GB_masker_phase1.c b/GraphBLAS/Source/mask/GB_masker_phase1.c index 570fef8e25..5e23d999b5 100644 --- a/GraphBLAS/Source/mask/GB_masker_phase1.c +++ b/GraphBLAS/Source/mask/GB_masker_phase1.c @@ -2,7 +2,7 @@ // GB_masker_phase1: find # of entries in R = masker (C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,16 +20,15 @@ // Rp is either freed by phase2, or transplanted into R. #include "mask/GB_mask.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #include "include/GB_masker_shared_definitions.h" -#define GB_FREE_ALL GB_FREE (&Rp, Rp_size) ; +#define GB_FREE_ALL GB_FREE_MEMORY (&Rp, Rp_size) ; GrB_Info GB_masker_phase1 // count nnz in each R(:,j) ( // computed by phase1: - int64_t **Rp_handle, // output of size Rnvec+1 + void **Rp_handle, // vector pointers for R size_t *Rp_size_handle, int64_t *Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: @@ -38,10 +37,12 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - const int64_t *restrict Rh, + const void *Rh, const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, + const bool Rj_is_32, // original input: const GrB_Matrix M, // required mask const bool Mask_comp, // if true, then M is complemented @@ -56,8 +57,6 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) // check inputs //-------------------------------------------------------------------------- - int64_t *restrict Rp = NULL ; size_t Rp_size = 0 ; - ASSERT (Rp_handle != NULL) ; ASSERT (Rp_size_handle != NULL) ; ASSERT (Rnvec_nonempty != NULL) ; @@ -82,13 +81,14 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) ASSERT (C->vdim == Z->vdim && C->vlen == Z->vlen) ; ASSERT (C->vdim == M->vdim && C->vlen == M->vlen) ; - (*Rp_handle) = NULL ; - //-------------------------------------------------------------------------- // allocate the result //-------------------------------------------------------------------------- - Rp = GB_CALLOC (GB_IMAX (2, Rnvec+1), int64_t, &Rp_size) ; + (*Rp_handle) = NULL ; + void *Rp = NULL ; size_t Rp_size = 0 ; + size_t rpsize = (Rp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Rp = GB_CALLOC_MEMORY (GB_IMAX (2, Rnvec+1), rpsize, &Rp_size) ; if (Rp == NULL) { // out of memory @@ -109,18 +109,9 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) R_ntasks, // # of tasks R_nthreads, // # of threads to use // analysis from phase0: - Rnvec, - Rh, - R_to_M, - R_to_C, - R_to_Z, + Rnvec, Rh, R_to_M, R_to_C, R_to_Z, Rp_is_32, Rj_is_32, // original input: - M, // required mask - Mask_comp, // if true, then M is complemented - Mask_struct, // if true, use the only structure of M - C, - Z - ) ; + M, Mask_comp, Mask_struct, C, Z) ; if (info == GrB_NO_VALUE) { @@ -137,8 +128,8 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) // cumulative sum of Rp and fine tasks in TaskList //-------------------------------------------------------------------------- - GB_task_cumsum (Rp, Rnvec, Rnvec_nonempty, TaskList, R_ntasks, R_nthreads, - Werk) ; + GB_task_cumsum (Rp, Rp_is_32, Rnvec, Rnvec_nonempty, TaskList, R_ntasks, + R_nthreads, Werk) ; //-------------------------------------------------------------------------- // return the result diff --git a/GraphBLAS/Source/mask/GB_masker_phase2.c b/GraphBLAS/Source/mask/GB_masker_phase2.c index 31cee2e602..f7b2e4b93e 100644 --- a/GraphBLAS/Source/mask/GB_masker_phase2.c +++ b/GraphBLAS/Source/mask/GB_masker_phase2.c @@ -2,7 +2,7 @@ // GB_masker_phase2: phase2 for R = masker (C,M,Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,8 +26,6 @@ // R is iso if both C and Z are iso and zij == cij. #include "mask/GB_mask.h" -#include "slice/GB_ek_slice.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #include "include/GB_masker_shared_definitions.h" @@ -50,20 +48,23 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) GrB_Matrix R, // output matrix, static header const bool R_is_csc, // format of output matrix R // from phase1: - int64_t **Rp_handle, // vector pointers for R + void **Rp_handle, // vector pointers for R size_t Rp_size, const int64_t Rnvec_nonempty, // # of non-empty vectors in R // tasks from phase1a: const GB_task_struct *restrict TaskList, // array of structs - const int R_ntasks, // # of tasks - const int R_nthreads, // # of threads to use + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use // analysis from phase0: const int64_t Rnvec, - int64_t **Rh_handle, + void **Rh_handle, // R->h hyperlist size_t Rh_size, const int64_t *restrict R_to_M, const int64_t *restrict R_to_C, const int64_t *restrict R_to_Z, + const bool Rp_is_32, + const bool Rj_is_32, + const bool Ri_is_32, const int R_sparsity, // original input: const GrB_Matrix M, // required mask @@ -105,12 +106,16 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) ASSERT (C->vdim == M->vdim && C->vlen == M->vlen) ; ASSERT (C->type == Z->type) ; - ASSERT (R != NULL && (R->static_header || GBNSTATIC)) ; + ASSERT (R != NULL && (R->header_size == 0 || GBNSTATIC)) ; ASSERT (Rp_handle != NULL) ; ASSERT (Rh_handle != NULL) ; - int64_t *Rp = (*Rp_handle) ; - int64_t *Rh = (*Rh_handle) ; + + GB_MDECL (Rp, , u) ; + Rp = (*Rp_handle) ; + GB_IPTR (Rp, Rp_is_32) ; + + void *Rh = (*Rh_handle) ; //-------------------------------------------------------------------------- // allocate the output matrix R @@ -121,7 +126,8 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) ASSERT (R_is_sparse_or_hyper == (Rp != NULL)) ; ASSERT (R_is_hyper == (Rh != NULL)) ; - int64_t rnz = (R_is_sparse_or_hyper) ? Rp [Rnvec] : C->vlen*C->vdim ; + int64_t rnz = (R_is_sparse_or_hyper) ? + GB_IGET (Rp, Rnvec) : (C->vlen * C->vdim) ; size_t czsize = Z->type->size ; bool R_iso ; @@ -145,23 +151,28 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) } // allocate the result R (but do not allocate R->p or R->h) - // set R->iso = R_iso OK GrB_Info info = GB_new_bix (&R, // any sparsity, existing header - C->type, C->vlen, C->vdim, GB_Ap_null, R_is_csc, - R_sparsity, true, C->hyper_switch, Rnvec, rnz, true, R_iso) ; + C->type, C->vlen, C->vdim, GB_ph_null, R_is_csc, + R_sparsity, true, C->hyper_switch, Rnvec, rnz, true, R_iso, + Rp_is_32, Rj_is_32, Ri_is_32) ; if (info != GrB_SUCCESS) { // out of memory; caller must free R_to_M, R_to_C, R_to_Z - GB_FREE (Rp_handle, Rp_size) ; - GB_FREE (Rh_handle, Rh_size) ; + GB_FREE_MEMORY (Rp_handle, Rp_size) ; + GB_FREE_MEMORY (Rh_handle, Rh_size) ; return (info) ; } + ASSERT (R->p_is_32 == Rp_is_32) ; + ASSERT (R->j_is_32 == Rj_is_32) ; + ASSERT (R->i_is_32 == Ri_is_32) ; + // add Rp as the vector pointers for R, from GB_masker_phase1 if (R_is_sparse_or_hyper) { - R->nvec_nonempty = Rnvec_nonempty ; - R->p = (int64_t *) Rp ; R->p_size = Rp_size ; +// R->nvec_nonempty = Rnvec_nonempty ; + GB_nvec_nonempty_set (R, Rnvec_nonempty) ; + R->p = Rp ; R->p_size = Rp_size ; R->nvals = rnz ; (*Rp_handle) = NULL ; } @@ -169,7 +180,7 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) // add Rh as the hypersparse list for R, from GB_add_phase0 if (R_is_hyper) { - R->h = (int64_t *) Rh ; R->h_size = Rh_size ; + R->h = Rh ; R->h_size = Rh_size ; R->nvec = Rnvec ; (*Rh_handle) = NULL ; } @@ -188,11 +199,11 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; int64_t C_nnz_held = GB_nnz_held (C) ; - GB_SLICE_MATRIX_WORK (C, 8, C_nnz_held + C->nvec, C_nnz_held) ; + GB_SLICE_MATRIX_WORK2 (C, 8, C_nnz_held + C->nvec, C_nnz_held) ; if (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) { int64_t M_nnz_held = GB_nnz_held (M) ; - GB_SLICE_MATRIX_WORK (M, 8, M_nnz_held + M->nvec, M_nnz_held) ; + GB_SLICE_MATRIX_WORK2 (M, 8, M_nnz_held + M->nvec, M_nnz_held) ; } } @@ -254,7 +265,7 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) // prune empty vectors from Rh //-------------------------------------------------------------------------- - GB_OK (GB_hypermatrix_prune (R, Werk)) ; + GB_OK (GB_hyper_prune (R, Werk)) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/mask/GB_masker_sparsity.c b/GraphBLAS/Source/mask/GB_masker_sparsity.c index b99c8a45de..9ace1c7a6b 100644 --- a/GraphBLAS/Source/mask/GB_masker_sparsity.c +++ b/GraphBLAS/Source/mask/GB_masker_sparsity.c @@ -2,7 +2,7 @@ // GB_masker_sparsity: determine the sparsity structure for C=Z //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ // as called by GB_masker. // C is sparse or hypersparse on input. It is never bitmap or full; that case -// is handled by GB_subassign and GB_bitmap_assing instead. R can be +// is handled by GB_subassign and GB_bitmap_assign instead. R can be // constructed as sparse, hypersparse, or bitmap (not full). M and Z can have // any sparsity pattern. diff --git a/GraphBLAS/Source/mask/include/GB_masker_shared_definitions.h b/GraphBLAS/Source/mask/include/GB_masker_shared_definitions.h index 7630e182a1..51a8aabf70 100644 --- a/GraphBLAS/Source/mask/include/GB_masker_shared_definitions.h +++ b/GraphBLAS/Source/mask/include/GB_masker_shared_definitions.h @@ -2,7 +2,7 @@ // GB_masker_shared_definitions.h: common macros for masker kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -99,47 +99,16 @@ #define GB_R_IS_HYPER (R_sparsity == GxB_HYPERSPARSE) #endif -#ifndef GB_C_IS_BITMAP -#define GB_C_IS_BITMAP C_is_bitmap -#endif -#ifndef GB_C_IS_FULL -#define GB_C_IS_FULL C_is_full -#endif -#ifndef GB_C_IS_SPARSE -#define GB_C_IS_SPARSE C_is_sparse -#endif -#ifndef GB_C_IS_HYPER -#define GB_C_IS_HYPER C_is_hyper -#endif #ifndef GB_C_ISO #define GB_C_ISO C_iso #endif -#ifndef GB_M_IS_BITMAP -#define GB_M_IS_BITMAP M_is_bitmap -#endif -#ifndef GB_M_IS_FULL -#define GB_M_IS_FULL M_is_full -#endif -#ifndef GB_M_IS_SPARSE -#define GB_M_IS_SPARSE M_is_sparse -#endif -#ifndef GB_M_IS_HYPER -#define GB_M_IS_HYPER M_is_hyper -#endif - #ifndef GB_Z_IS_BITMAP #define GB_Z_IS_BITMAP Z_is_bitmap #endif #ifndef GB_Z_IS_FULL #define GB_Z_IS_FULL Z_is_full #endif -#ifndef GB_Z_IS_SPARSE -#define GB_Z_IS_SPARSE Z_is_sparse -#endif -#ifndef GB_Z_IS_HYPER -#define GB_Z_IS_HYPER Z_is_hyper -#endif #ifndef GB_Z_ISO #define GB_Z_ISO Z_iso #endif diff --git a/GraphBLAS/Source/mask/template/GB_bitmap_masker_template.c b/GraphBLAS/Source/mask/template/GB_bitmap_masker_template.c index eaac6fb5c0..695be0875b 100644 --- a/GraphBLAS/Source/mask/template/GB_bitmap_masker_template.c +++ b/GraphBLAS/Source/mask/template/GB_bitmap_masker_template.c @@ -2,7 +2,7 @@ // GB_bitmap_masker_template: phase2 for R = masker (C, M, Z), R is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,13 +43,16 @@ // FUTURE:: add special cases for C==Z, C==M, and Z==M aliases { + GB_R_NHELD (rnz) ; int64_t p, rnvals = 0 ; ASSERT (GB_R_IS_BITMAP) ; - ASSERT (GB_C_IS_SPARSE || GB_C_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; ASSERT (GB_Z_IS_BITMAP || GB_Z_IS_FULL) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + //-------------------------------------------------------------------------- // scatter C into the R bitmap //-------------------------------------------------------------------------- @@ -67,20 +70,19 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of C(:,k) for this task - int64_t j = GBH_C (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; GB_GET_PA (pC_start, pC_end, taskid, k,kfirst,klast, pstart_Cslice, - Cp [k], Cp [k+1]) ; + GB_IGET (Cp, k), GB_IGET (Cp, k+1)) ; int64_t pR_start = j * vlen ; // traverse over C(:,j), the kth vector of C for (int64_t pC = pC_start ; pC < pC_end ; pC++) { // R(i,j) = C(i,j) - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; int64_t pR = pR_start + i ; Rb [pR] = 1 ; rnvals++ ; #ifndef GB_ISO_MASKER -// memcpy (Rx + (pR)*rsize, Cx + (C_iso? 0:(pC)*rsize), rsize) ; GB_COPY_C_TO_R (Rx, pR, Cx, pC, C_iso, rsize) ; #endif } @@ -93,6 +95,11 @@ // R=Z or R=Z //-------------------------------------------------------------------------- + #ifndef GB_JIT_KERNEL + #define GB_M_IS_SPARSE GB_IS_SPARSE (M) + #define GB_M_IS_HYPER GB_IS_HYPERSPARSE (M) + #endif + if (GB_M_IS_SPARSE || GB_M_IS_HYPER) { @@ -108,6 +115,7 @@ // sparse sparse full bitmap ASSERT (GB_MASK_COMP) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; //---------------------------------------------------------------------- // scatter M into the R bitmap @@ -125,9 +133,9 @@ for (int64_t k = kfirst ; k <= klast ; k++) { // find the part of M(:,k) for this task - int64_t j = GBH_M (Mh, k) ; + int64_t j = GBh_M (Mh, k) ; GB_GET_PA (pM_start, pM_end, taskid, k, kfirst, klast, - pstart_Mslice, Mp [k], Mp [k+1]) ; + pstart_Mslice, GB_IGET (Mp, k), GB_IGET (Mp, k+1)) ; int64_t pR_start = j * vlen ; // traverse over M(:,j), the kth vector of M for (int64_t pM = pM_start ; pM < pM_end ; pM++) @@ -136,7 +144,7 @@ bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t p = pR_start + i ; Rb [p] += 2 ; } @@ -172,7 +180,7 @@ for (p = 0 ; p < rnz ; p++) { int8_t r = Rb [p] ; - int8_t z = GBB_Z (Zb, p) ; + int8_t z = GBb_Z (Zb, p) ; switch (r) { case 0 : // R(i,j) not present, M(i,j) false @@ -180,7 +188,6 @@ { // R(i,j) = Z(i,j), insert new value #ifndef GB_ISO_MASKER -// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif Rb [p] = 1 ; @@ -193,7 +200,6 @@ { // R(i,j) = Z(i,j), update prior value #ifndef GB_ISO_MASKER -// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif } @@ -261,11 +267,11 @@ reduction(+:rnvals) for (p = 0 ; p < rnz ; p++) { - bool mij = GBB_M (Mb, p) && GB_MCAST (Mx, p, msize) ; + bool mij = GBb_M (Mb, p) && GB_MCAST (Mx, p, msize) ; if (GB_MASK_COMP) mij = !mij ; if (mij) { - int8_t z = GBB_Z (Zb, p) ; + int8_t z = GBb_Z (Zb, p) ; int8_t r = Rb [p] ; if (r) { @@ -273,7 +279,6 @@ { // R(i,j) = Z(i,j), update, no change to rnvals #ifndef GB_ISO_MASKER -// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif } @@ -288,7 +293,6 @@ { // R(i,j) = Z(i,j), new entry #ifndef GB_ISO_MASKER -// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize) ; GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif Rb [p] = 1 ; diff --git a/GraphBLAS/Source/mask/template/GB_masker_template.c b/GraphBLAS/Source/mask/template/GB_masker_template.c index 7a8b067d4d..15e1d3d2d5 100644 --- a/GraphBLAS/Source/mask/template/GB_masker_template.c +++ b/GraphBLAS/Source/mask/template/GB_masker_template.c @@ -2,7 +2,7 @@ // GB_masker_template: R = masker (C, M, Z) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,78 +23,78 @@ { //-------------------------------------------------------------------------- - // get C, Z, M, and R + // get inputs //-------------------------------------------------------------------------- int taskid ; - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ch = C->h ; - const int8_t *restrict Cb = C->b ; - const int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, const) ; GB_Ci_PTR (Ci, C) ; const int64_t vlen = C->vlen ; #ifndef GB_JIT_KERNEL - const bool C_is_hyper = GB_IS_HYPERSPARSE (C) ; - const bool C_is_sparse = GB_IS_SPARSE (C) ; - const bool C_is_bitmap = GB_IS_BITMAP (C) ; - const bool C_is_full = GB_IS_FULL (C) ; + const bool Ci_is_32 = C->i_is_32 ; + #define GB_Ci_IS_32 Ci_is_32 #endif - const int64_t *restrict Zp = Z->p ; - const int64_t *restrict Zh = Z->h ; - const int8_t *restrict Zb = Z->b ; - const int64_t *restrict Zi = Z->i ; + GB_Zp_DECLARE (Zp, const) ; GB_Zp_PTR (Zp, Z) ; + GB_Zi_DECLARE (Zi, const) ; GB_Zi_PTR (Zi, Z) ; + const int8_t *restrict Zb = Z->b ; #ifndef GB_JIT_KERNEL - const bool Z_is_hyper = GB_IS_HYPERSPARSE (Z) ; - const bool Z_is_sparse = GB_IS_SPARSE (Z) ; const bool Z_is_bitmap = GB_IS_BITMAP (Z) ; const bool Z_is_full = GB_IS_FULL (Z) ; + const bool Zi_is_32 = Z->i_is_32 ; + #define GB_Zi_IS_32 Zi_is_32 #endif - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; - const int8_t *restrict Mb = NULL ; - const int64_t *restrict Mi = NULL ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = NULL ; const GB_M_TYPE *restrict Mx = NULL ; #ifndef GB_JIT_KERNEL - const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; - const bool M_is_sparse = GB_IS_SPARSE (M) ; - const bool M_is_bitmap = GB_IS_BITMAP (M) ; - const bool M_is_full = GB_IS_FULL (M) ; + const bool Mi_is_32 = M->i_is_32 ; + #define GB_Mi_IS_32 Mi_is_32 #endif size_t msize = 0 ; if (M != NULL) { - Mp = M->p ; - Mh = M->h ; Mb = M->b ; - Mi = M->i ; Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; msize = M->type->size ; } #if defined ( GB_PHASE_2_OF_2 ) - #ifndef GB_JIT_KERNEL - const bool Z_iso = Z->iso ; - const bool C_iso = C->iso ; - #endif - #ifndef GB_ISO_MASKER - const GB_R_TYPE *restrict Cx = (GB_R_TYPE *) C->x ; - const GB_R_TYPE *restrict Zx = (GB_R_TYPE *) Z->x ; - GB_R_TYPE *restrict Rx = (GB_R_TYPE *) R->x ; - #endif - const int64_t *restrict Rp = R->p ; - const int64_t *restrict Rh = R->h ; - int8_t *restrict Rb = R->b ; - int64_t *restrict Ri = R->i ; - size_t rsize = R->type->size ; - // when R is bitmap or full: -// const int64_t rnz = GB_nnz_held (R) ; - GB_R_NHELD (rnz) ; + + // phase 2 + #ifndef GB_ISO_MASKER + #ifndef GB_JIT_KERNEL + const bool Z_iso = Z->iso ; + const bool C_iso = C->iso ; + #endif + const GB_R_TYPE *restrict Cx = (GB_R_TYPE *) C->x ; + const GB_R_TYPE *restrict Zx = (GB_R_TYPE *) Z->x ; + GB_R_TYPE *restrict Rx = (GB_R_TYPE *) R->x ; + size_t rsize = R->type->size ; + #endif + GB_Rp_DECLARE (Rp, const) ; GB_Rp_PTR (Rp, R) ; + GB_Rh_DECLARE (Rh, const) ; GB_Rh_PTR (Rh, R) ; + GB_Ri_DECLARE (Ri, ) ; GB_Ri_PTR (Ri, R) ; + int8_t *restrict Rb = R->b ; + + #else + + // phase 1 + #ifdef GB_JIT_KERNEL + GB_Rp_TYPE *Rp = ( GB_Rp_TYPE *) Rp_parameter ; + const GB_Rj_TYPE *Rh = (const GB_Rj_TYPE *) Rh_parameter ; + #else + GB_IDECL (Rp, , u) ; GB_IPTR (Rp, Rp_is_32) ; // OK + GB_IDECL (Rh, const, u) ; GB_IPTR (Rh, Rj_is_32) ; // OK + #endif + #endif //-------------------------------------------------------------------------- - // + // C<#M>=Z, returnng the result in R //-------------------------------------------------------------------------- #if defined ( GB_PHASE_1_OF_2 ) diff --git a/GraphBLAS/Source/mask/template/GB_sparse_masker_template.c b/GraphBLAS/Source/mask/template/GB_sparse_masker_template.c index 7bcf1e86db..1b7ca0301c 100644 --- a/GraphBLAS/Source/mask/template/GB_sparse_masker_template.c +++ b/GraphBLAS/Source/mask/template/GB_sparse_masker_template.c @@ -2,7 +2,7 @@ // GB_sparse_masker_template: R = masker (C, M, Z) where R is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,21 +47,20 @@ #undef GB_COPY_Z #if defined ( GB_PHASE_1_OF_2 ) - #define GB_COPY_Z \ + #define GB_COPY_Z(i) \ { \ rjnz++ ; \ } #elif defined ( GB_ISO_MASKER ) - #define GB_COPY_Z \ + #define GB_COPY_Z(i) \ { \ - Ri [pR] = i ; \ + GB_ISET (Ri, pR, i) ; \ pR++ ; \ } #else - #define GB_COPY_Z \ + #define GB_COPY_Z(i) \ { \ - Ri [pR] = i ; \ - /* memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; */ \ + GB_ISET (Ri, pR, i) ; \ GB_COPY_Z_TO_R (Rx, pR, Zx, pZ, Z_iso, rsize) ; \ pR++ ; \ } @@ -75,15 +74,15 @@ #if defined ( GB_PHASE_1_OF_2 ) #define GB_COPY_Z_BITMAP_OR_FULL \ { \ - rjnz += GBB_Z (Zb, pZ_start + i - iZ_first) ; \ + rjnz += GBb_Z (Zb, pZ_start + i - iZ_first) ; \ } #elif defined ( GB_ISO_MASKER ) #define GB_COPY_Z_BITMAP_OR_FULL \ { \ int64_t pZ = pZ_start + i - iZ_first ; \ - if (GBB_Z (Zb, pZ)) \ + if (GBb_Z (Zb, pZ)) \ { \ - Ri [pR] = i ; \ + GB_ISET (Ri, pR, i) ; \ pR++ ; \ } \ } @@ -91,11 +90,10 @@ #define GB_COPY_Z_BITMAP_OR_FULL \ { \ int64_t pZ = pZ_start + i - iZ_first ; \ - if (GBB_Z (Zb, pZ)) \ + if (GBb_Z (Zb, pZ)) \ { \ - Ri [pR] = i ; \ - /* memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; */ \ - GB_COPY_Z_TO_R (Rx, pR, Zx, pZ, Z_iso, rsize) ; \ + GB_ISET (Ri, pR, i) ; \ + GB_COPY_Z_TO_R (Rx, pR, Zx, pZ, Z_iso, rsize) ; \ pR++ ; \ } \ } @@ -107,21 +105,20 @@ #undef GB_COPY_C #if defined ( GB_PHASE_1_OF_2 ) - #define GB_COPY_C \ + #define GB_COPY_C(i) \ { \ rjnz++ ; \ } #elif defined ( GB_ISO_MASKER ) - #define GB_COPY_C \ + #define GB_COPY_C(i) \ { \ - Ri [pR] = i ; \ + GB_ISET (Ri, pR, i) ; \ pR++ ; \ } #else - #define GB_COPY_C \ + #define GB_COPY_C(i) \ { \ - Ri [pR] = i ; \ - /* memcpy (Rx +(pR)*rsize, Cx +(C_iso ? 0:(pC)*rsize), rsize) ; */ \ + GB_ISET (Ri, pR, i) ; \ GB_COPY_C_TO_R (Rx, pR, Cx, pC, C_iso, rsize) ; \ pR++ ; \ } @@ -138,7 +135,7 @@ // phase2: compute C //-------------------------------------------------------------------------- - ASSERT (GB_C_IS_SPARSE || GB_C_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; #pragma omp parallel for num_threads(R_nthreads) schedule(dynamic,1) for (taskid = 0 ; taskid < R_ntasks ; taskid++) @@ -175,7 +172,7 @@ // get j, the kth vector of R //------------------------------------------------------------------ - int64_t j = GBH_R (Rh, k) ; + int64_t j = GBh_R (Rh, k) ; #if defined ( GB_PHASE_1_OF_2 ) int64_t rjnz = 0 ; @@ -186,13 +183,15 @@ // A fine task computes a slice of R(:,j) pR = TaskList [taskid ].pC ; pR_end = TaskList [taskid+1].pC ; - ASSERT (Rp [k] <= pR && pR <= pR_end && pR_end <= Rp [k+1]) ; + ASSERT (GB_IGET (Rp, k) <= pR) ; + ASSERT (pR <= pR_end) ; + ASSERT (pR_end <= GB_IGET (Rp, k+1)) ; } else { // The vectors of R are never sliced for a coarse task. - pR = Rp [k] ; - pR_end = Rp [k+1] ; + pR = GB_IGET (Rp, k) ; + pR_end = GB_IGET (Rp, k+1) ; } int64_t rjnz = pR_end - pR ; if (rjnz == 0) @@ -219,8 +218,8 @@ int64_t kC = (R_to_C == NULL) ? j : R_to_C [k] ; if (kC >= 0) { - pC = Cp [kC] ; - pC_end = Cp [kC+1] ; + pC = GB_IGET (Cp, kC) ; + pC_end = GB_IGET (Cp, kC+1) ; } } @@ -230,12 +229,12 @@ #if defined ( GB_PHASE_2_OF_2 ) || defined ( GB_DEBUG ) // get the first index in C(:,j) for this vector int64_t iC_first = -1 ; - if (cjnz > 0) iC_first = Ci [pC] ; + if (cjnz > 0) iC_first = GB_IGET (Ci, pC) ; #endif #ifdef GB_DEBUG int64_t iC_last = -1 ; - if (cjnz > 0) iC_last = Ci [pC_end-1] ; + if (cjnz > 0) iC_last = GB_IGET (Ci, pC_end-1) ; #endif //------------------------------------------------------------------ @@ -256,8 +255,8 @@ int64_t kZ = (R_to_Z == NULL) ? j : R_to_Z [k] ; if (kZ >= 0) { - pZ = GBP_Z (Zp, kZ, vlen) ; - pZ_end = GBP_Z (Zp, kZ+1, vlen) ; + pZ = GBp_Z (Zp, kZ, vlen) ; + pZ_end = GBp_Z (Zp, kZ+1, vlen) ; } } @@ -265,11 +264,16 @@ int64_t pZ_start = pZ ; bool zdense = (zjnz == len) && (zjnz > 0) ; - int64_t iZ_first = -1, iZ_last = -1 ; + int64_t iZ_first = -1 ; + #ifdef GB_DEBUG + int64_t iZ_last = -1 ; + #endif if (zjnz > 0) { - iZ_first = GBI_Z (Zi, pZ, vlen) ; - iZ_last = GBI_Z (Zi, pZ_end-1, vlen) ; + iZ_first = GBi_Z (Zi, pZ, vlen) ; + #ifdef GB_DEBUG + iZ_last = GBi_Z (Zi, pZ_end-1, vlen) ; + #endif } //------------------------------------------------------------------ @@ -290,8 +294,8 @@ int64_t kM = (R_to_M == NULL) ? j : R_to_M [k] ; if (kM >= 0) { - pM = GBP_M (Mp, kM, vlen) ; - pM_end = GBP_M (Mp, kM+1, vlen) ; + pM = GBp_M (Mp, kM, vlen) ; + pM_end = GBp_M (Mp, kM+1, vlen) ; } } @@ -301,7 +305,7 @@ // get the first index in M(:,j) for this vector int64_t iM_first = -1 ; int64_t pM_first = pM ; - if (mjnz > 0) iM_first = GBI_M (Mi, pM_first, vlen) ; + if (mjnz > 0) iM_first = GBi_M (Mi, pM_first, vlen) ; //------------------------------------------------------------------ // R(:,j) = masker (C (:,j), M (:,j), Z (:,j)) @@ -325,7 +329,7 @@ // Otherwise, R is bitmap and not computed here, but in // GB_bitmap_masker_template instead. - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; ASSERT (!GB_MASK_COMP) ; // 2-way merge of C(:,j) and M(:,j) and direct lookup of Z @@ -333,15 +337,14 @@ while (pC < pC_end && pM < pM_end) { - int64_t iC = Ci [pC] ; - int64_t iM = Mi [pM] ; + int64_t iC = GB_IGET (Ci, pC) ; + int64_t iM = GB_IGET (Mi, pM) ; if (iC < iM) { // C(i,j) is present but M(i,j) is not // R(i,j) = C(i,j) - int64_t i = iC ; - GB_COPY_C ; + GB_COPY_C (iC) ; pC++ ; } else if (iC > iM) @@ -369,7 +372,7 @@ else { // R(i,j) = C(i,j) - GB_COPY_C ; + GB_COPY_C (i) ; } pC++ ; pM++ ; @@ -383,8 +386,8 @@ for ( ; pC < pC_end ; pC++) { // C(i,j) is present but M(i,j) is not - int64_t i = Ci [pC] ; - GB_COPY_C ; + int64_t i = GB_IGET (Ci, pC) ; + GB_COPY_C (i) ; } #endif @@ -392,7 +395,7 @@ for ( ; pM < pM_end ; pM++) { // M(i,j) is present but C(i,j) is not - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; bool mij = GB_MCAST (Mx, pM, msize) ; if (mij) { @@ -422,7 +425,7 @@ // sparse sparse sparse sparse // Z must be sparse or hypersparse - ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (Z) || GB_IS_HYPERSPARSE (Z)) ; if (!GB_MASK_COMP) { @@ -436,20 +439,13 @@ rjnz = cjnz ; #else ASSERT (rjnz == cjnz) ; - memcpy (Ri +(pR), Ci +(pC), cjnz * sizeof (int64_t)) ; + for (int64_t k = 0 ; k < cjnz ; k++) + { + int64_t i = GB_IGET (Ci, pC + k) ; + GB_ISET (Ri, pR + k, i) ; + } #ifndef GB_ISO_MASKER GB_COPY_C_TO_R_RANGE (Rx, pR, Cx, pC, C_iso, rsize, cjnz) ; -// if (C_iso) -// { -// for (int64_t k = 0 ; k < cjnz ; k++) -// { -// memcpy (Rx +(pR+k)*rsize, Cx, rsize) ; -// } -// } -// else -// { -// memcpy (Rx +(pR)*rsize, Cx +(pC)*rsize, cjnz*rsize) ; -// } #endif #endif @@ -466,21 +462,13 @@ rjnz = zjnz ; #else ASSERT (rjnz == zjnz) ; - memcpy (Ri +(pR), Zi +(pZ), zjnz * sizeof (int64_t)) ; + for (int64_t k = 0 ; k < zjnz ; k++) + { + int64_t i = GB_IGET (Zi, pZ + k) ; + GB_ISET (Ri, pR + k, i) ; + } #ifndef GB_ISO_MASKER GB_COPY_Z_TO_R_RANGE (Rx, pR, Zx, pZ, Z_iso, rsize, zjnz) ; -// if (Z_iso) -// { -// for (int64_t k = 0 ; k < zjnz ; k++) -// { -// memcpy (Rx +(pR+k)*rsize, Zx, rsize) ; -// } -// } -// else -// { -// memcpy (Rx +(pR)*rsize, Zx +(pZ)*rsize, zjnz*rsize) ; -// } - #endif #endif } @@ -513,7 +501,7 @@ // present), but both C and Z are stored in a sparse or // hypersparse sparsity structure. M has any sparsity. - ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (Z) || GB_IS_HYPERSPARSE (Z)) ; ASSERT (cjnz == zjnz) ; ASSERT (iC_first == iZ_first) ; @@ -525,12 +513,12 @@ for (int64_t p = 0 ; p < cjnz ; p++) { int64_t i = p + iC_first ; - Ri [pR + p] = i ; - int64_t iM = (pM < pM_end) ? GBI_M (Mi,pM,vlen) : INT64_MAX; + GB_ISET (Ri, pR + p, i) ; // Ri [pR + p] = i ; + int64_t iM = (pM < pM_end) ? GBi_M (Mi,pM,vlen) : INT64_MAX; bool mij = false ; if (i == iM) { - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; } if (GB_MASK_COMP) mij = !mij ; @@ -538,15 +526,11 @@ if (mij) { // R(i,j) = Z (i,j) -// memcpy (Rx +(pR+p)*rsize, Zx +(Z_iso? 0:(pZ+p)*rsize), -// rsize) ; GB_COPY_Z_TO_R (Rx, pR+p, Zx, pZ+p, Z_iso, rsize) ; } else { // R(i,j) = C (i,j) -// memcpy (Rx +(pR+p)*rsize, Cx +(C_iso? 0:(pC+p)*rsize), -// rsize) ; GB_COPY_C_TO_R (Rx, pR+p, Cx, pC+p, C_iso, rsize) ; } #endif @@ -562,7 +546,7 @@ //-------------------------------------------------------------- // Z is sparse or hypersparse; M has any sparsity structure - ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (Z) || GB_IS_HYPERSPARSE (Z)) ; //-------------------------------------------------------------- // Z is sparse or hypersparse, M has any sparsity @@ -591,8 +575,8 @@ // get the next i for R(:,j) //---------------------------------------------------------- - int64_t iC = Ci [pC] ; - int64_t iZ = Zi [pZ] ; + int64_t iC = GB_IGET (Ci, pC) ; + int64_t iZ = GB_IGET (Zi, pZ) ; int64_t i = GB_IMIN (iC, iZ) ; //---------------------------------------------------------- @@ -615,8 +599,8 @@ // let pM = pM_first + delta // then delta = i - iM_first pM = pM_first + (i - iM_first) ; - ASSERT (i == GBI_M (Mi, pM, vlen)) ; - mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + ASSERT (i == GBi_M (Mi, pM, vlen)) ; + mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; // increment pM for the wrapup phase below pM++ ; @@ -628,15 +612,16 @@ // Method04b: M(:,j) is sparse //------------------------------------------------------ - // Use GB_SPLIT_BINARY_SEARCH so that pM can be used in + // Use GB_split_binary_search so that pM can be used in // the for loop with index pM in the wrapup phase. - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; int64_t pright = pM_end - 1 ; bool found ; - GB_SPLIT_BINARY_SEARCH (i, Mi, pM, pright, found) ; + found = GB_split_binary_search (i, Mi, GB_Mi_IS_32, + &pM, &pright) ; if (found) { - ASSERT (i == Mi [pM]) ; + ASSERT (i == GB_IGET (Mi, pM)) ; mij = GB_MCAST (Mx, pM, msize) ; // increment pM for the wrapup phase below pM++ ; @@ -652,26 +637,25 @@ if (iC < iZ) { // C(i,j) is present but Z(i,j) is not - if (!mij) GB_COPY_C ; + if (!mij) GB_COPY_C (i) ; pC++ ; } else if (iC > iZ) { // Z(i,j) is present but C(i,j) is not - if (mij) GB_COPY_Z ; + if (mij) GB_COPY_Z (i) ; pZ++ ; } else { // both C(i,j) and Z(i,j) are present - int64_t i = iC ; if (mij) { - GB_COPY_Z ; + GB_COPY_Z (iC) ; } else { - GB_COPY_C ; + GB_COPY_C (iC) ; } pC++ ; pZ++ ; @@ -709,13 +693,13 @@ for ( ; pZ < pZ_end ; pZ++) { - int64_t i = Zi [pZ] ; + int64_t i = GB_IGET (Zi, pZ) ; // mask is dense, lookup M(i,j) pM = pM_first + (i - iM_first) ; - ASSERT (i == GBI_M (Mi, pM, vlen)) ; - bool mij = GBB_M (Mb, pM) && + ASSERT (i == GBi_M (Mi, pM, vlen)) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) GB_COPY_Z ; + if (mij) GB_COPY_Z (i) ; } } @@ -729,16 +713,17 @@ // This loop requires pM to start at the first // entry in M(:,j) that has not yet been handled. - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pM < pM_end ; pM++) { if (GB_MCAST (Mx, pM, msize)) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t pright = pZ_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Zi, pZ, pright, found); - if (found) GB_COPY_Z ; + found = GB_binary_search (i, Zi,GB_Zi_IS_32, + &pZ, &pright) ; + if (found) GB_COPY_Z (i) ; } } @@ -750,18 +735,19 @@ // Method04e: M(:,j) is much denser than Z(:,j) //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pZ < pZ_end ; pZ++) { // wrapup, C now empty, M(:,j) much denser than // Z(:,j); C, M and Z all sparse - int64_t i = Zi [pZ] ; + int64_t i = GB_IGET (Zi, pZ) ; bool mij = false ; int64_t pright = pM_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Mi, pM, pright,found) ; + found = GB_binary_search (i, Mi, GB_Mi_IS_32, + &pM, &pright) ; if (found) mij = GB_MCAST (Mx, pM, msize) ; - if (mij) GB_COPY_Z ; + if (mij) GB_COPY_Z (i) ; } } @@ -772,11 +758,11 @@ // Method04f: M(:,j) and Z(:,j) about same # entries //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; while (pM < pM_end && pZ < pZ_end) { - int64_t iM = Mi [pM] ; - int64_t i = Zi [pZ] ; + int64_t iM = GB_IGET (Mi, pM) ; + int64_t i = GB_IGET (Zi, pZ) ; if (iM < i) { // M(i,j) exists but not Z(i,j) @@ -790,7 +776,7 @@ else { // both M(i,j) and Z(i,j) exist - if (GB_MCAST (Mx, pM, msize)) GB_COPY_Z ; + if (GB_MCAST (Mx, pM, msize)) GB_COPY_Z (i); pM++ ; pZ++ ; } @@ -814,13 +800,13 @@ for ( ; pZ < pZ_end ; pZ++) { - int64_t i = Zi [pZ] ; + int64_t i = GB_IGET (Zi, pZ) ; // mask is dense, lookup M(i,j) pM = pM_first + (i - iM_first) ; - ASSERT (i == GBI_M (Mi, pM, vlen)) ; - bool mij = GBB_M (Mb, pM) && + ASSERT (i == GBi_M (Mi, pM, vlen)) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (!mij) GB_COPY_Z ; // mask is complemented + if (!mij) GB_COPY_Z (i) ; // mask complemented } } else @@ -830,16 +816,17 @@ // Method04h: M(:,j) is sparse //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pZ < pZ_end ; pZ++) { - int64_t i = Zi [pZ] ; + int64_t i = GB_IGET (Zi, pZ) ; bool mij = false ; int64_t pright = pM_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Mi, pM, pright, found) ; + found = GB_binary_search (i, Mi, GB_Mi_IS_32, + &pM, &pright) ; if (found) mij = GB_MCAST (Mx, pM, msize) ; - if (!mij) GB_COPY_Z ; // mask is complemented + if (!mij) GB_COPY_Z (i) ; // mask complemented } } } @@ -868,13 +855,13 @@ for ( ; pC < pC_end ; pC++) { - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; // mask is dense, lookup M(i,j) pM = pM_first + (i - iM_first) ; - ASSERT (i == GBI_M (Mi, pM, vlen)) ; - bool mij = GBB_M (Mb, pM) && + ASSERT (i == GBi_M (Mi, pM, vlen)) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) GB_COPY_C ; + if (mij) GB_COPY_C (i) ; } } @@ -885,16 +872,17 @@ // Method04j: C(:,j) is much denser than M(:,j) //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pM < pM_end ; pM++) { if (GB_MCAST (Mx, pM, msize)) { - int64_t i = Mi [pM] ; + int64_t i = GB_IGET (Mi, pM) ; int64_t pright = pC_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Ci, pC, pright, found); - if (found) GB_COPY_C ; + found = GB_binary_search (i, Ci,GB_Ci_IS_32, + &pC, &pright) ; + if (found) GB_COPY_C (i) ; } } @@ -906,16 +894,17 @@ // Method04k: M(:,j) is much denser than C(:,j) //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pC < pC_end ; pC++) { - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; bool mij = false ; int64_t pright = pM_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Mi, pM, pright, found); + found = GB_binary_search (i, Mi, GB_Mi_IS_32, + &pM, &pright) ; if (found) mij = GB_MCAST (Mx, pM, msize) ; - if (mij) GB_COPY_C ; + if (mij) GB_COPY_C (i) ; } } @@ -926,11 +915,11 @@ // Method04l: M(:,j) and C(:,j) about same # entries //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; while (pM < pM_end && pC < pC_end) { - int64_t iM = Mi [pM] ; - int64_t i = Ci [pC] ; + int64_t iM = GB_IGET (Mi, pM) ; + int64_t i = GB_IGET (Ci, pC) ; if (iM < i) { // M(i,j) exists but not C(i,j) @@ -944,7 +933,7 @@ else { // both M(i,j) and C(i,j) exist - if (GB_MCAST (Mx, pM, msize)) GB_COPY_C ; + if (GB_MCAST (Mx, pM, msize)) GB_COPY_C (i); pM++ ; pC++ ; } @@ -968,13 +957,13 @@ for ( ; pC < pC_end ; pC++) { - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; // mask is dense, lookup M(i,j) pM = pM_first + (i - iM_first) ; - ASSERT (i == GBI_M (Mi, pM, vlen)) ; - bool mij = GBB_M (Mb, pM) && + ASSERT (i == GBi_M (Mi, pM, vlen)) ; + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (!mij) GB_COPY_C ; + if (!mij) GB_COPY_C (i) ; } } else @@ -984,17 +973,18 @@ // Method04n: M(:,j) is sparse //-------------------------------------------------- - ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; for ( ; pC < pC_end ; pC++) { - int64_t i = Ci [pC] ; + int64_t i = GB_IGET (Ci, pC) ; // M(i,j) false if not present bool mij = false ; int64_t pright = pM_end - 1 ; bool found ; - GB_BINARY_SEARCH (i, Mi, pM, pright, found) ; + found = GB_binary_search (i, Mi, GB_Mi_IS_32, + &pM, &pright) ; if (found) mij = GB_MCAST (Mx, pM, msize) ; - if (!mij) GB_COPY_C ; + if (!mij) GB_COPY_C (i) ; } } } @@ -1016,7 +1006,7 @@ } else { - Rp [k] = rjnz ; + GB_ISET (Rp, k, rjnz) ; // Rp [k] = rjnz ; } #endif } diff --git a/GraphBLAS/Source/math/GB_bitwise.c b/GraphBLAS/Source/math/GB_bitwise.c index e6061b8d74..50ed520b99 100644 --- a/GraphBLAS/Source/math/GB_bitwise.c +++ b/GraphBLAS/Source/math/GB_bitwise.c @@ -2,7 +2,7 @@ // GB_bitwise.c: declaring functions from GB_bitwise.h //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/GB_bitwise.h b/GraphBLAS/Source/math/GB_bitwise.h index b27cfb9dca..c61f616ed3 100644 --- a/GraphBLAS/Source/math/GB_bitwise.h +++ b/GraphBLAS/Source/math/GB_bitwise.h @@ -2,7 +2,7 @@ // GB_bitwise.h: definitions for bitwise operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/GB_int64_multiply.h b/GraphBLAS/Source/math/GB_int64_multiply.h index 20cb2d676e..ac4ebed70b 100644 --- a/GraphBLAS/Source/math/GB_int64_multiply.h +++ b/GraphBLAS/Source/math/GB_int64_multiply.h @@ -2,12 +2,12 @@ // GB_int64_multiply: multiply two integers and guard against overflow //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// c = a*b where c is GrB_Index (uint64_t), and a and b are int64_t. +// c = a*b where c is uint64_t, and a and b are int64_t. // Check for overflow. Requires a >= 0 and b >= 0. #ifndef GB_INT64_MULTIPLY_H diff --git a/GraphBLAS/Source/math/GB_math.c b/GraphBLAS/Source/math/GB_math.c index 189ad68540..aaab1f2e91 100644 --- a/GraphBLAS/Source/math/GB_math.c +++ b/GraphBLAS/Source/math/GB_math.c @@ -2,7 +2,7 @@ // GB_math.c: declaring functions from GB_math.h //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/GB_math.h b/GraphBLAS/Source/math/GB_math.h index a743a9fc6f..ef687b6b09 100644 --- a/GraphBLAS/Source/math/GB_math.h +++ b/GraphBLAS/Source/math/GB_math.h @@ -2,7 +2,7 @@ // GB_math.h: definitions for complex types, and mathematical operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/GB_size_t_multiply.h b/GraphBLAS/Source/math/GB_size_t_multiply.h index 48b0ea9610..0668db0633 100644 --- a/GraphBLAS/Source/math/GB_size_t_multiply.h +++ b/GraphBLAS/Source/math/GB_size_t_multiply.h @@ -2,7 +2,7 @@ // GB_size_t_multiply: multiply two size_t and guard against overflow //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/GB_uint64_multiply.h b/GraphBLAS/Source/math/GB_uint64_multiply.h index 440630c0ce..95bbe5c7bd 100644 --- a/GraphBLAS/Source/math/GB_uint64_multiply.h +++ b/GraphBLAS/Source/math/GB_uint64_multiply.h @@ -2,7 +2,7 @@ // GB_uint64_multiply: multiply two uint64_t and guard against overflow //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,7 @@ GB_STATIC_INLINE bool GB_uint64_multiply // c = a*b, return true if ok if (t0 >= GB_TWO_TO_THE_30 || t1 >= GB_TWO_TO_THE_30) { - // t >= 2^31, so t * 2^30 might overflow. This is also slightly + // t >= 2^30, so t * 2^30 might overflow. This is also slightly // pessimistic, but good enough for the usage of this function. (*c) = UINT64_MAX ; return (false) ; diff --git a/GraphBLAS/Source/math/include/GB_binary_search.h b/GraphBLAS/Source/math/include/GB_binary_search.h index 93a76e4645..d4e5f8528c 100644 --- a/GraphBLAS/Source/math/include/GB_binary_search.h +++ b/GraphBLAS/Source/math/include/GB_binary_search.h @@ -2,69 +2,122 @@ // GB_binary_search.h: binary search in a sorted list //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// These methods are used for all kernels, include CUDA kernels, which is why +// GB_STATIC_INLINE is used. It becomes "static inline" on the CPU, and +// "static __device__ inline" on the GPU. + #ifndef GB_BINARY_SEARCH_H #define GB_BINARY_SEARCH_H //------------------------------------------------------------------------------ -// GB_TRIM_BINARY_SEARCH: simple binary search +// GB_trim_binary_search: simple binary search //------------------------------------------------------------------------------ // search for integer i in the list X [pleft...pright]; no zombies. // The list X [pleft ... pright] is in ascending order. It may have // duplicates. -#ifdef GB_CUDA_KERNEL - - // binary search on the GPU, with fewer branches - #define GB_TRIM_BINARY_SEARCH(i,X,pleft,pright) \ - { \ - /* binary search of X [pleft ... pright] for integer i */ \ - while (pleft < pright) \ - { \ - int64_t pmiddle = (pleft + pright) >> 1 ; \ - bool less = (X [pmiddle] < i) ; \ - pleft = less ? (pmiddle+1) : pleft ; \ - pright = less ? pright : pmiddle ; \ - } \ - /* binary search is narrowed down to a single item */ \ - /* or it has found the list is empty */ \ - /* ASSERT (pleft == pright || pleft == pright + 1) ; */ \ - } - -#else - - // binary search on the CPU - #define GB_TRIM_BINARY_SEARCH(i,X,pleft,pright) \ - { \ - /* binary search of X [pleft ... pright] for integer i */ \ - while (pleft < pright) \ - { \ - int64_t pmiddle = (pleft + pright) / 2 ; \ - if (X [pmiddle] < i) \ - { \ - /* if in the list, it appears in [pmiddle+1..pright] */ \ - pleft = pmiddle + 1 ; \ - } \ - else \ - { \ - /* if in the list, it appears in [pleft..pmiddle] */ \ - pright = pmiddle ; \ - } \ - } \ - /* binary search is narrowed down to a single item */ \ - /* or it has found the list is empty */ \ - /* ASSERT (pleft == pright || pleft == pright + 1) ; */ \ +GB_STATIC_INLINE void GB_trim_binary_search_32 +( + const uint32_t i, // item to look for + const uint32_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + // binary search of X [pleft ... pright] for the integer i + while (*pleft < *pright) + { + // Both of following methods work on both the GPU and CPU, but the + // first method works fastest on the GPU, while the 2nd works fastest + // on the CPU. + #ifdef GB_CUDA_KERNEL + // binary search on the GPU + int64_t pmiddle = (*pleft + *pright) >> 1 ; + bool less = (X [pmiddle] < i) ; + *pleft = less ? (pmiddle+1) : *pleft ; + *pright = less ? *pright : pmiddle ; + #else + // binary search on the CPU + int64_t pmiddle = (*pleft + *pright) / 2 ; + if (X [pmiddle] < i) + { + // if in the list, it appears in [pmiddle+1..pright] + *pleft = pmiddle + 1 ; + } + else + { + // if in the list, it appears in [pleft..pmiddle] + *pright = pmiddle ; + } + #endif } + // binary search is narrowed down to a single item + // or it has found the list is empty + ASSERT (*pleft == *pright || *pleft == *pright + 1) ; +} -#endif +GB_STATIC_INLINE void GB_trim_binary_search_64 +( + const uint64_t i, // item to look for + const uint64_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + // binary search of X [pleft ... pright] for the integer i + while (*pleft < *pright) + { + #ifdef GB_CUDA_KERNEL + int64_t pmiddle = (*pleft + *pright) >> 1 ; + bool less = (X [pmiddle] < i) ; + *pleft = less ? (pmiddle+1) : *pleft ; + *pright = less ? *pright : pmiddle ; + #else + int64_t pmiddle = (*pleft + *pright) / 2 ; + if (X [pmiddle] < i) + { + // if in the list, it appears in [pmiddle+1..pright] + *pleft = pmiddle + 1 ; + } + else + { + // if in the list, it appears in [pleft..pmiddle] + *pright = pmiddle ; + } + #endif + } + // binary search is narrowed down to a single item + // or it has found the list is empty + ASSERT (*pleft == *pright || *pleft == *pright + 1) ; +} + +GB_STATIC_INLINE void GB_trim_binary_search +( + const uint64_t i, // item to look for + const void *X, // array to search; no zombies + const bool X_is_32, // if true, X is 32-bit, else 64 + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + if (X_is_32) + { + GB_trim_binary_search_32 (i, (const uint32_t *) X, pleft, pright) ; + } + else + { + GB_trim_binary_search_64 (i, (const uint64_t *) X, pleft, pright) ; + } +} //------------------------------------------------------------------------------ -// GB_BINARY_SEARCH: binary search and check if found +// GB_binary_search: binary search and check if found //------------------------------------------------------------------------------ // If found is true then X [pleft == pright] == i. If duplicates appear then @@ -73,14 +126,52 @@ // X [original_pleft ... pleft-1] < i and // X [pleft+1 ... original_pright] > i holds. // The value X [pleft] may be either < or > i. -#define GB_BINARY_SEARCH(i,X,pleft,pright,found) \ -{ \ - GB_TRIM_BINARY_SEARCH (i, X, pleft, pright) ; \ - found = (pleft == pright && X [pleft] == i) ; \ + +GB_STATIC_INLINE bool GB_binary_search_32 +( + const uint32_t i, // item to look for + const uint32_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + GB_trim_binary_search_32 (i, X, pleft, pright) ; + return (*pleft == *pright && X [*pleft] == i) ; +} + +GB_STATIC_INLINE bool GB_binary_search_64 +( + const uint64_t i, // item to look for + const uint64_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + GB_trim_binary_search_64 (i, X, pleft, pright) ; + return (*pleft == *pright && X [*pleft] == i) ; +} + +GB_STATIC_INLINE bool GB_binary_search +( + const uint64_t i, // item to look for + const void *X, // array to search; no zombies + const bool X_is_32, // if true, X is 32-bit, else 64 + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + if (X_is_32) + { + return (GB_binary_search_32 (i, (const uint32_t *) X, pleft, pright)) ; + } + else + { + return (GB_binary_search_64 (i, (const uint64_t *) X, pleft, pright)) ; + } } //------------------------------------------------------------------------------ -// GB_SPLIT_BINARY_SEARCH: binary search, and then partition the list +// GB_split_binary_search: binary search, and then partition the list //------------------------------------------------------------------------------ // If found is true then X [pleft] == i. If duplicates appear then X [pleft] @@ -91,115 +182,352 @@ // If X has no duplicates, then whether or not i is found, // X [original_pleft ... pleft-1] < i and // X [pleft ... original_pright] >= i holds. -#define GB_SPLIT_BINARY_SEARCH(i,X,pleft,pright,found) \ -{ \ - GB_BINARY_SEARCH (i, X, pleft, pright, found) \ - if (!found && (pleft == pright)) \ - { \ - if (i > X [pleft]) \ - { \ - pleft++ ; \ - } \ - else \ - { \ - pright++ ; \ - } \ - } \ + +GB_STATIC_INLINE bool GB_split_binary_search_32 +( + const uint32_t i, // item to look for + const uint32_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + bool found = GB_binary_search_32 (i, X, pleft, pright) ; + if (!found && (*pleft == *pright)) + { + if (i > X [*pleft]) + { + (*pleft)++ ; + } + else + { + (*pright)++ ; + } + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_split_binary_search_64 +( + const uint64_t i, // item to look for + const uint64_t *restrict X, // array to search; no zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + bool found = GB_binary_search_64 (i, X, pleft, pright) ; + if (!found && (*pleft == *pright)) + { + if (i > X [*pleft]) + { + (*pleft)++ ; + } + else + { + (*pright)++ ; + } + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_split_binary_search +( + const uint64_t i, // item to look for + const void *X, // array to search; no zombies + const bool X_is_32, // if true, X is 32-bit, else 64 + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + if (X_is_32) + { + return (GB_split_binary_search_32 (i, (const uint32_t *) X, + pleft, pright)) ; + } + else + { + return (GB_split_binary_search_64 (i, (const uint64_t *) X, + pleft, pright)) ; + } } //------------------------------------------------------------------------------ -// GB_TRIM_BINARY_SEARCH_ZOMBIE: binary search in the presence of zombies +// GB_trim_binary_search_zombie: binary search in the presence of zombies //------------------------------------------------------------------------------ -#define GB_TRIM_BINARY_SEARCH_ZOMBIE(i,X,pleft,pright) \ -{ \ - /* binary search of X [pleft ... pright] for integer i */ \ - while (pleft < pright) \ - { \ - int64_t pmiddle = (pleft + pright) / 2 ; \ - if (i > GB_UNZOMBIE (X [pmiddle])) \ - { \ - /* if in the list, it appears in [pmiddle+1..pright] */ \ - pleft = pmiddle + 1 ; \ - } \ - else \ - { \ - /* if in the list, it appears in [pleft..pmiddle] */ \ - pright = pmiddle ; \ - } \ - } \ - /* binary search is narrowed down to a single item */ \ - /* or it has found the list is empty */ \ - /* ASSERT (pleft == pright || pleft == pright + 1) ; */ \ +GB_STATIC_INLINE void GB_trim_binary_search_zombie_32 +( + const uint32_t i, // item to look for + const int32_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + // binary search of X [pleft ... pright] for the integer i + while (*pleft < *pright) + { + #ifdef GB_CUDA_KERNEL + int64_t pmiddle = (*pleft + *pright) >> 1 ; + int64_t ix = X [pmiddle] ; + ix = GB_UNZOMBIE (ix) ; + bool less = (ix < i) ; + *pleft = less ? (pmiddle+1) : *pleft ; + *pright = less ? *pright : pmiddle ; + #else + int64_t pmiddle = (*pleft + *pright) / 2 ; + int64_t ix = X [pmiddle] ; + ix = GB_UNZOMBIE (ix) ; + if (ix < i) + { + // if in the list, it appears in [pmiddle+1..pright] + *pleft = pmiddle + 1 ; + } + else + { + // if in the list, it appears in [pleft..pmiddle] + *pright = pmiddle ; + } + #endif + } + // binary search is narrowed down to a single item + // or it has found the list is empty + ASSERT (*pleft == *pright || *pleft == *pright + 1) ; +} + +GB_STATIC_INLINE void GB_trim_binary_search_zombie_64 +( + const uint64_t i, // item to look for + const int64_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright +) +{ + // binary search of X [pleft ... pright] for the integer i + while (*pleft < *pright) + { + #ifdef GB_CUDA_KERNEL + int64_t pmiddle = (*pleft + *pright) >> 1 ; + int64_t ix = X [pmiddle] ; + ix = GB_UNZOMBIE (ix) ; + bool less = (ix < i) ; + *pleft = less ? (pmiddle+1) : *pleft ; + *pright = less ? *pright : pmiddle ; + #else + int64_t pmiddle = (*pleft + *pright) / 2 ; + int64_t ix = X [pmiddle] ; + ix = GB_UNZOMBIE (ix) ; + if (ix < i) + { + // if in the list, it appears in [pmiddle+1..pright] + *pleft = pmiddle + 1 ; + } + else + { + // if in the list, it appears in [pleft..pmiddle] + *pright = pmiddle ; + } + #endif + } + // binary search is narrowed down to a single item + // or it has found the list is empty + ASSERT (*pleft == *pright || *pleft == *pright + 1) ; } //------------------------------------------------------------------------------ -// GB_BINARY_SEARCH_ZOMBIE: binary search with zombies; check if found +// GB_binary_search_zombie: binary search with zombies; check if found //------------------------------------------------------------------------------ -#define GB_BINARY_SEARCH_ZOMBIE(i,X,pleft,pright,found,nzombies,is_zombie) \ -{ \ - if (nzombies > 0) \ - { \ - GB_TRIM_BINARY_SEARCH_ZOMBIE (i, X, pleft, pright) ; \ - found = false ; \ - is_zombie = false ; \ - if (pleft == pright) \ - { \ - int64_t i2 = X [pleft] ; \ - is_zombie = GB_IS_ZOMBIE (i2) ; \ - if (is_zombie) \ - { \ - i2 = GB_DEZOMBIE (i2) ; \ - } \ - found = (i == i2) ; \ - } \ - } \ - else \ - { \ - is_zombie = false ; \ - GB_BINARY_SEARCH(i,X,pleft,pright,found) \ - } \ +GB_STATIC_INLINE bool GB_binary_search_zombie_32 +( + const uint32_t i, // item to look for + const int32_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + bool found = false ; + *is_zombie = false ; + if (may_see_zombies) + { + GB_trim_binary_search_zombie_32 (i, X, pleft, pright) ; + if (*pleft == *pright) + { + int64_t i2 = X [*pleft] ; + *is_zombie = GB_IS_ZOMBIE (i2) ; + if (*is_zombie) i2 = GB_DEZOMBIE (i2) ; + found = (i == i2) ; + } + } + else + { + found = GB_binary_search_32 (i, (const uint32_t *) X, pleft, pright) ; + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_binary_search_zombie_64 +( + const uint64_t i, // item to look for + const int64_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + bool found = false ; + *is_zombie = false ; + if (may_see_zombies) + { + GB_trim_binary_search_zombie_64 (i, X, pleft, pright) ; + if (*pleft == *pright) + { + int64_t i2 = X [*pleft] ; + *is_zombie = GB_IS_ZOMBIE (i2) ; + if (*is_zombie) i2 = GB_DEZOMBIE (i2) ; + found = (i == i2) ; + } + } + else + { + found = GB_binary_search_64 (i, (const uint64_t *) X, pleft, pright) ; + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_binary_search_zombie +( + const uint64_t i, // item to look for + const void *X, // array to search; with zombies + const bool X_is_32, // if true, X is 32-bit, else 64 + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + if (X_is_32) + { + return (GB_binary_search_zombie_32 (i, (const int32_t *) X, + pleft, pright, may_see_zombies, is_zombie)) ; + } + else + { + return (GB_binary_search_zombie_64 (i, (const int64_t *) X, + pleft, pright, may_see_zombies, is_zombie)) ; + } } //------------------------------------------------------------------------------ -// GB_SPLIT_BINARY_SEARCH_ZOMBIE: binary search with zombies; then partition +// GB_split_binary_search_zombie: binary search with zombies; then partition //------------------------------------------------------------------------------ -#define GB_SPLIT_BINARY_SEARCH_ZOMBIE(i,X,pleft,pright,found,nzom,is_zombie) \ -{ \ - if (nzom > 0) \ - { \ - GB_TRIM_BINARY_SEARCH_ZOMBIE (i, X, pleft, pright) ; \ - found = false ; \ - is_zombie = false ; \ - if (pleft == pright) \ - { \ - int64_t i2 = X [pleft] ; \ - is_zombie = GB_IS_ZOMBIE (i2) ; \ - if (is_zombie) \ - { \ - i2 = GB_DEZOMBIE (i2) ; \ - } \ - found = (i == i2) ; \ - if (!found) \ - { \ - if (i > i2) \ - { \ - pleft++ ; \ - } \ - else \ - { \ - pright++ ; \ - } \ - } \ - } \ - } \ - else \ - { \ - is_zombie = false ; \ - GB_SPLIT_BINARY_SEARCH(i,X,pleft,pright,found) \ - } \ +GB_STATIC_INLINE bool GB_split_binary_search_zombie_32 +( + const uint32_t i, // item to look for + const int32_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + bool found = false ; + *is_zombie = false ; + if (may_see_zombies) + { + GB_trim_binary_search_zombie_32 (i, X, pleft, pright) ; + if (*pleft == *pright) + { + int64_t i2 = X [*pleft] ; + *is_zombie = GB_IS_ZOMBIE (i2) ; + if (*is_zombie) i2 = GB_DEZOMBIE (i2) ; + found = (i == i2) ; + if (!found) + { + if (i > i2) + { + (*pleft)++ ; + } + else + { + (*pright)++ ; + } + } + } + } + else + { + found = GB_split_binary_search_32 (i, (const uint32_t *) X, + pleft, pright) ; + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_split_binary_search_zombie_64 +( + const uint64_t i, // item to look for + const int64_t *restrict X, // array to search; with zombies + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + bool found = false ; + *is_zombie = false ; + if (may_see_zombies) + { + GB_trim_binary_search_zombie_64 (i, X, pleft, pright) ; + if (*pleft == *pright) + { + int64_t i2 = X [*pleft] ; + *is_zombie = GB_IS_ZOMBIE (i2) ; + if (*is_zombie) i2 = GB_DEZOMBIE (i2) ; + found = (i == i2) ; + if (!found) + { + if (i > i2) + { + (*pleft)++ ; + } + else + { + (*pright)++ ; + } + } + } + } + else + { + found = GB_split_binary_search_64 (i, (const uint64_t *) X, + pleft, pright) ; + } + return (found) ; +} + +GB_STATIC_INLINE bool GB_split_binary_search_zombie +( + const uint64_t i, // item to look for + const void *X, // array to search; with zombies + const bool X_is_32, // if true, X is 32-bit, else 64 + int64_t *pleft, // look in X [pleft:pright] + int64_t *pright, + const bool may_see_zombies, + bool *is_zombie +) +{ + if (X_is_32) + { + return (GB_split_binary_search_zombie_32 (i, (const int32_t *) X, + pleft, pright, may_see_zombies, is_zombie)) ; + } + else + { + return (GB_split_binary_search_zombie_64 (i, (const int64_t *) X, + pleft, pright, may_see_zombies, is_zombie)) ; + } } #endif diff --git a/GraphBLAS/Source/math/include/GB_complex.h b/GraphBLAS/Source/math/include/GB_complex.h index 331b4acc53..5746445e95 100644 --- a/GraphBLAS/Source/math/include/GB_complex.h +++ b/GraphBLAS/Source/math/include/GB_complex.h @@ -2,7 +2,7 @@ // GB_complex.h: definitions for complex types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/include/GB_hash.h b/GraphBLAS/Source/math/include/GB_hash.h index e3d029f2d6..a4d0529db1 100644 --- a/GraphBLAS/Source/math/include/GB_hash.h +++ b/GraphBLAS/Source/math/include/GB_hash.h @@ -2,7 +2,7 @@ // GB_hash.h: definitions for hashing //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/include/GB_iceil.h b/GraphBLAS/Source/math/include/GB_iceil.h index cd72b269a6..ee46a5a4ed 100644 --- a/GraphBLAS/Source/math/include/GB_iceil.h +++ b/GraphBLAS/Source/math/include/GB_iceil.h @@ -2,7 +2,7 @@ // GB_iceil.h: definitions for ceiling (a/b) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/include/GB_int64_mult.h b/GraphBLAS/Source/math/include/GB_int64_mult.h index b4ab53f01c..2fc6c29eca 100644 --- a/GraphBLAS/Source/math/include/GB_int64_mult.h +++ b/GraphBLAS/Source/math/include/GB_int64_mult.h @@ -2,7 +2,7 @@ // GB_int64_mult: multiplying two integer values safely; result z is int64_t //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/include/GB_log2.h b/GraphBLAS/Source/math/include/GB_log2.h index a1344df5a2..075d08c6a4 100644 --- a/GraphBLAS/Source/math/include/GB_log2.h +++ b/GraphBLAS/Source/math/include/GB_log2.h @@ -2,7 +2,7 @@ // GB_log2.h: integer log2 and check if power of 2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/math/include/GB_math_macros.h b/GraphBLAS/Source/math/include/GB_math_macros.h index afd2d9b6b1..17b786b246 100644 --- a/GraphBLAS/Source/math/include/GB_math_macros.h +++ b/GraphBLAS/Source/math/include/GB_math_macros.h @@ -2,7 +2,7 @@ // GB_math_macros.h: simple math macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,5 +37,12 @@ #define GB_IMAX(x,y) (((x) > (y)) ? (x) : (y)) #define GB_IMIN(x,y) (((x) < (y)) ? (x) : (y)) +//------------------------------------------------------------------------------ +// left and right shift +//------------------------------------------------------------------------------ + +#define GB_LSHIFT(x,k) (((uint64_t) (x)) << k) +#define GB_RSHIFT(x,k,b) (((x) >> (k)) & ((((uint64_t) 0x1) << (b)) - 1)) + #endif diff --git a/GraphBLAS/Source/math/include/GB_zombie.h b/GraphBLAS/Source/math/include/GB_zombie.h index 1cbc0316d8..c3255397b5 100644 --- a/GraphBLAS/Source/math/include/GB_zombie.h +++ b/GraphBLAS/Source/math/include/GB_zombie.h @@ -2,7 +2,7 @@ // GB_zombie.h: definitions for zombies //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,6 @@ #ifndef GB_ZOMBIE_H #define GB_ZOMBIE_H -// GB_ZOMBIE is a kind of "negation" about (-1) of a zero-based index. -// If i >= 0 then it is not a zombie. -// If i < 0 then it has been marked as a zombie. -// Like negation, GB_ZOMBIE is its own inverse: GB_ZOMBIE (GB_ZOMBIE (i)) == i. -// The "nil" value, -1, doesn't change: GB_ZOMBIE (-1) = -1. -// GB_UNZOMBIE(i) is like taking an absolute value, undoing any GB_ZOMBIE(i). - // An entry A(i,j) in a matrix can be marked as a "zombie". A zombie is an // entry that has been marked for deletion, but hasn't been deleted yet because // it's more efficient to delete all zombies all at once, instead of one at a @@ -29,38 +22,122 @@ // Zombies can be restored as regular entries by GrB_*assign. If an assignment // C(I,J)=A finds an entry in A that is a zombie in C, the zombie becomes a -// regular entry, taking on the value from A. The row index is 'dezombied' +// regular entry, taking on the value from A. The row index is 'dezombied'. // Zombies are deleted and pending tuples are added into the matrix all at // once, by GB_wait. -/* OLD: -#define GB_FLIP(i) (-(i)-2) -#define GB_IS_FLIPPED(i) ((i) < 0) -#define GB_IS_ZOMBIE(i) ((i) < 0) -#define GB_IS_NOT_FLIPPED(i) ((i) >= 0) -#define GB_UNFLIP(i) (((i) < 0) ? GB_FLIP(i) : (i)) -#define GBI_UNFLIP(Ai,p,avlen) \ - ((Ai == NULL) ? ((p) % (avlen)) : GB_UNFLIP (Ai [p])) -*/ - -// NEW: -// replace GB_FLIP with GB_ZOMBIE. -// add GB_DEZOMBIE (same as GB_FLIP and GB_ZOMBIE). -// no change to GB_IS_ZOMBIE. -// delete GB_IS_FLIPPED and GB_IS_NOT_FLIPPED. -// replace GB_UNFLIP with GB_UNZOMBIE. -// replace GBI_UNFLIP with GBI_UNZOMBIE. - -#define GB_ZOMBIE(i) (-(i)-2) -#define GB_DEZOMBIE(i) (-(i)-2) +// For GraphBLAS 10.0.0 and later, the zombie function has changed to allow for +// a larger range of valid indices when using 32-bit integers, where now +// GB_ZOMBIE([0 1 2 3 ... INT32_MAX]) = [-1 -2 -3 ... INT32_MIN]. The zombie +// function is zombie (i) = -i-1 or simply ~i, the one's complement of i. This +// allows the largest index of a 32-bit A->i array to be INT32_MAX, giving a +// maximum matrix dimension of exactly 2^31 when 32-bit indices are used. + +// With this change, there is no neutral element x for which zombie (x) == x, +// but this feature is not required for the + +// Some algorithms need more space than this for their indices, at least +// temporarily. GrB_mxm (saxpy3) on the CPU uses a 4-state finite state +// machine held in the Hf array (not in C->i itself), but this Hf array can +// remain int64_t even when C->i is 32-bit. GrB_mxm (dot3) on the GPU requires +// 4 bits for its buckets; for 32-bit matrices, the bucket assignments need to +// be stored in a separate array; they won't fit in C->i unless the matrix +// dimension is about 2^28 or smaller. + +// The max matrix dimensions for 64-bit integer matrices could be increased to +// to about 2^62 on the CPU. This would still be OK for the Hf [hash] entries +// for the fine Hash method. The GPU currently is using 4 bits for up to 16 +// buckets ... but it is currently only using about 4 buckets, requiring just +// two bits for the bucket index. + +// For the zombie detection to work in the GB_IS_ZOMBIE and GB_UNZOMBIE +// functions, the integer i must be a signed integer, either int32_t or +// int64_t. These functions could be revised to work with unsigned integers, +// but they would differ for 32-bit and 64-bit integers. In addition, the +// typecast of { uint64_t i = Ai [p] ; i = GB_UNZOMBIE (i) ; } would fail if Ai +// is uint32_t since typecasting of unsigned integers does have a sign bit to +// extend. Thus, when zombies are present, the Ai array must be treated as +// int32_t or int64_t, and the temporary index i can then always be int64_t. + +// Thus, if Ai is 32-bit, use the following: +// +// int32_t *Ai = A->i ; +// ... +// int64_t i = Ai [p] ; // extends the sign bit if Ai [p] is a zombie +// i = GB_UNZOMBIE (i) ; // converts i to nonzombie +// +// If Ai is 64-bit, use the following: +// +// int64_t *Ai = A->i ; +// ... +// int64_t i = Ai [p] ; // extends the sign bit if Ai [p] is a zombie +// i = GB_UNZOMBIE (i) ; // converts i to nonzombie + +// Note in the above two snippets of code, the 2nd two statemnts are identical. +// This facilitates the construction of code that handles both 32-bit and +// 64-bit integers for A->i. Thus, for handling 32/64 bit integers for A->i: +// +// GB_Ai_DECLARE (Ai, ) ; // void *Ai ; int32_t *Ai32 ; int64_t *Ai64 +// GB_Ai_PTR (Ai, A) ; // Ai32 = A->i or Ai64 = A->i +// ... +// int64_t i = GB_IGET (Ai, p) ; // i = Ai32 [p] or Ai64 [p] +// i = GB_UNZOMBIE (i) ; // converts i to nonzombie + +// In a JIT kernel, when Ai is 64-bit the above code becomes the following, +// after specialization of all the macros: +// +// int64_t *restrict Ai = NULL ; +// Ai = (A) ? A->i : NULL ; +// ... +// int64_t i = Ai [p] ; +// i = (i < 0) ? (~i) : i ; +// +// when Ai is 32-bit, the JIT kernel code becomes: +// +// int32_t *restrict Ai = NULL ; +// Ai = (A) ? A->i : NULL ; +// ... +// int64_t i = Ai [p] ; // note the typecast +// i = (i < 0) ? (~i) : i ; + +// Outside of a JIT kernel, the code is a little more complex, becoming: +// +// void *Ai = NULL ; +// int32_t *Ai32 = NULL ; +// int64_t *Ai64 = NULL ; +// Ai = (A) ? A->i : NULL ; +// Ai32 = (A) ? (A->i_is_32 ? Ai : NULL) : NULL ; +// Ai64 = (A) ? (A->i_is_32 ? NULL : Ai) : NULL ; +// ... +// int64_t i = (Ai32 ? Ai32 [k] : Ai64 [k]) ; +// i = (i < 0) ? (~i) : i ; + +// In the above examples, the "..." separates the pointer initialization, which +// happens just once, and the access of each entry, which can happen many +// times. In code outside of a JIT kernel, the hardware branch predictor will +// help with the Ai32 ternary expression, since Ai32 typically does not change. +// It seems to be fast enough in practice. + +// To ensure the ternary expression appears just once, to help clarify the +// effect of the typecast from the int32_t array Ai to int64_t scalar i, and to +// ensure the correct 32/64 bit pointer is used for Ai, all zombie functions +// should be applied only to temporary scalars, as i = GB_UNZOMBIE (i) or +// GB_IS_ZOMBIE (i), not i = GB_UNZOMBIE (Ai [p]) or GB_IS_ZOMBIE (Ai [p]). +#define GB_ZOMBIE(i) (~(i)) +#define GB_DEZOMBIE(i) GB_ZOMBIE (i) #define GB_IS_ZOMBIE(i) ((i) < 0) +#define GB_UNZOMBIE(i) (GB_IS_ZOMBIE (i) ? GB_DEZOMBIE (i) : (i)) -#define GB_UNZOMBIE(i) (((i) < 0) ? GB_ZOMBIE(i) : (i)) +// Note that GB_ZOMBIE and GB_DEZOMBIE are identical. GB_ZOMBIE (i) is used +// when i is known to not be a zombie, and the result of the function is the +// zombie index for i. GB_DEZOMBIE is used when i is known to be a zombified +// index, and the result is the non-zombie index for that entry. The existence +// of the two function names is only for code clarity. -#define GBI_UNZOMBIE(Ai,p,avlen) \ - ((Ai == NULL) ? ((p) % (avlen)) : GB_UNZOMBIE (Ai [p])) +// GB_UNZOMBIE (i) is used when the index i may or may not be a zombie, and +// the result of the function is the non-zombie index for i. #endif diff --git a/GraphBLAS/Source/math/include/GxB_complex.h b/GraphBLAS/Source/math/include/GxB_complex.h deleted file mode 100644 index 0767ab0aaa..0000000000 --- a/GraphBLAS/Source/math/include/GxB_complex.h +++ /dev/null @@ -1,14 +0,0 @@ -//------------------------------------------------------------------------------ -// GxB_complex.h: definitions for the GraphBLAS complex types (no longer needed) -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// This file is no longer needed, but remains in case it is referenced by a -// user-defined type or operator from earlier versions of GraphBLAS. Its -// contents have been moved to GraphBLAS.h, which is #include'd when compiling -// any JIT kernel with a user-defined type or operator. - diff --git a/GraphBLAS/Source/matrix/GB_Matrix_free.c b/GraphBLAS/Source/matrix/GB_Matrix_free.c index c1ffd917cf..fa29db232e 100644 --- a/GraphBLAS/Source/matrix/GB_Matrix_free.c +++ b/GraphBLAS/Source/matrix/GB_Matrix_free.c @@ -2,7 +2,7 @@ // GB_Matrix_free: free a GrB_Matrix or GrB_Vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,14 +24,14 @@ void GB_Matrix_free // free a matrix if (A != NULL && (A->magic == GB_MAGIC || A->magic == GB_MAGIC2)) { // free all content of A - GB_FREE (&(A->user_name), A->user_name_size) ; + GB_FREE_MEMORY (&(A->user_name), A->user_name_size) ; size_t header_size = A->header_size ; GB_phybix_free (A) ; - if (!(A->static_header)) + if (!(A->header_size == 0)) { // free the header of A itself, unless it is static A->magic = GB_FREED ; // to help detect dangling pointers - GB_FREE (Ahandle, header_size) ; + GB_FREE_MEMORY (Ahandle, header_size) ; (*Ahandle) = NULL ; } } diff --git a/GraphBLAS/Source/matrix/GB_Matrix_new.c b/GraphBLAS/Source/matrix/GB_Matrix_new.c index 7a6bc752f9..9dd32f6844 100644 --- a/GraphBLAS/Source/matrix/GB_Matrix_new.c +++ b/GraphBLAS/Source/matrix/GB_Matrix_new.c @@ -2,7 +2,7 @@ // GB_Matrix_new: create a new matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,43 @@ // an empty matrix is hypersparse CSC: A->p is size 2 and all zero, A->h is // size 1, A->plen is 1, and contents A->x and A->i are NULL. If this method // fails, *A is set to NULL. +// +// A->p: row/column 'pointers' (offsets). If 32 bit, the nvals(A) < UINT32_MAX +// is required. If 64 bit, nvals(A) < UINT64_MAX. +// +// A->i, A->h, and A->Y: indices. Let N = max(m,n). If 32-bit, then +// N < INT32_MAX is required. Otherwise N < 2^60. +// +// For Ap and Ai, independently: +// +// Global settings: no matrix is converted if this is changed +// ---------------- +// +// 32 : use 32 (or 64 if required) for new or recomputed +// matrices; any prior 64 ok (will be the default; but use +// 64-bit for now) +// +// 64 : use 64 by default (this is the default for now) +// +// per-matrix settings: +// ------------------- +// +// 0: default : rely on the global settings +// +// 32 : use 32 bits if possible, but allow 64 bit if needed. +// +// 64 : use 64 bits, convert now is already 32 bits. +// Sometimes the matrix may become 32-bit in the future, +// if data is transplanted from a matrix with 32-bit +// content. +// +// Changing the global settings has no impact on the block/non-blocking status +// of any existing matrix. If the per-matrix setting is changed, it may cause +// future pending work that will be finalized by GrB_wait on that matrix. If +// GrB_wait is called to materialize the matrix, and the matrix is not modified +// afterwards, it remains materialized and is not changed. + +#define GB_FREE_ALL GB_Matrix_free (A) #include "GB.h" @@ -18,8 +55,8 @@ GrB_Info GB_Matrix_new // create a new matrix with no entries ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols + uint64_t nrows, // matrix dimension is nrows-by-ncols + uint64_t ncols ) { @@ -27,6 +64,8 @@ GrB_Info GB_Matrix_new // create a new matrix with no entries // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (A) ; (*A) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; @@ -55,7 +94,7 @@ GrB_Info GB_Matrix_new // create a new matrix with no entries } else { - // m-by-n (including 0-by-0) with m != and n != use the global setting + // m-by-n (including 0-by-0) with m != 1 or n != 1 use global setting A_is_csc = GB_Global_is_csc_get ( ) ; } @@ -70,8 +109,16 @@ GrB_Info GB_Matrix_new // create a new matrix with no entries vdim = (int64_t) nrows ; } - return (GB_new (A, // auto sparsity, new header - type, vlen, vdim, GB_Ap_calloc, A_is_csc, GxB_AUTO_SPARSITY, - GB_Global_hyper_switch_get ( ), 1)) ; + // determine the p_is_32, j_is_32 and i_is_32 settings for the new matrix + bool Ap_is_32, Aj_is_32, Ai_is_32 ; + GB_determine_pji_is_32 (&Ap_is_32, &Aj_is_32, &Ai_is_32, + GxB_AUTO_SPARSITY, 1, vlen, vdim, NULL) ; + + // create the matrix + GB_OK (GB_new (A, // auto sparsity (sparse/hyper), new header + type, vlen, vdim, GB_ph_calloc, A_is_csc, GxB_AUTO_SPARSITY, + GB_Global_hyper_switch_get ( ), 1, Ap_is_32, Aj_is_32, Ai_is_32)) ; + + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/matrix/GB_bix_alloc.c b/GraphBLAS/Source/matrix/GB_bix_alloc.c index 4ec5d7f8b8..2c6b802a45 100644 --- a/GraphBLAS/Source/matrix/GB_bix_alloc.c +++ b/GraphBLAS/Source/matrix/GB_bix_alloc.c @@ -2,21 +2,36 @@ // GB_bix_alloc: allocate a matrix to hold a given number of entries //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Does not modify A->p or A->h. Frees A->b, A->x, -// and A->i and reallocates them to the requested size. Frees any pending -// tuples and deletes all entries (including zombies, if any). If numeric is -// false, then A->x is freed but not reallocated. +// Does not modify A->p or A->h. Frees A->b, A->x, and A->i and reallocates +// them to the requested size. Frees any pending tuples and deletes all +// entries (including zombies, if any). If numeric is false, then A->x is +// freed but not reallocated. -// If this method fails, A->b, A->i, and A->x are NULL, -// but A->p and A->h are not modified. +// If A->p_is_32, A->j_is_32, or A->i_is_32 are invalid, GrB_INVALID_VALUE is +// returned and the allocation fails. If this method fails, A->b, A->i, and +// A->x are NULL (having been freed if already present), but A->p and A->h are +// not modified. #include "GB.h" +// The prototype is in Source/callback: +// +// GrB_Info GB_bix_alloc // allocate A->b, A->i, and A->x in a matrix +// ( +// GrB_Matrix A, // matrix to allocate space for +// const uint64_t nzmax, // number of entries the matrix can hold +// // ignored if A is iso and full +// const int sparsity, // sparse (=hyper/auto) / bitmap / full +// const bool bitmap_calloc, // if true, calloc A->b, else use malloc +// const bool numeric, // if true, allocate A->x, else A->x is NULL +// const bool A_iso // if true, allocate A as iso +// ) + GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) { @@ -25,6 +40,8 @@ GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) //-------------------------------------------------------------------------- ASSERT (A != NULL) ; + ASSERT (GB_IMPLIES (sparsity == GxB_FULL || sparsity == GxB_BITMAP, + !(A->p_is_32) && !(A->j_is_32) && !(A->i_is_32))) ; //-------------------------------------------------------------------------- // allocate the A->b, A->x, and A->i content of the matrix @@ -33,7 +50,7 @@ GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) // Free the existing A->b, A->x, and A->i content, if any. // Leave A->p and A->h unchanged. GB_bix_free (A) ; - A->iso = A_iso ; // OK: see caller for iso burble + A->iso = A_iso ; bool ok = true ; if (sparsity == GxB_BITMAP) @@ -41,29 +58,35 @@ GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) if (bitmap_calloc) { // content is fully defined - A->b = GB_CALLOC (nzmax, int8_t, &(A->b_size)) ; + A->b = GB_CALLOC_MEMORY (nzmax, sizeof (int8_t), &(A->b_size)) ; A->magic = GB_MAGIC ; } else { // bitmap is not defined and will be computed by the caller - A->b = GB_MALLOC (nzmax, int8_t, &(A->b_size)) ; + A->b = GB_MALLOC_MEMORY (nzmax, sizeof (int8_t), &(A->b_size)) ; } ok = (A->b != NULL) ; } else if (sparsity != GxB_FULL) - { - // sparsity: sparse / hyper / auto - A->i = GB_MALLOC (nzmax, int64_t, &(A->i_size)) ; + { + // sparsity: sparse or hypersparse + if (!GB_valid_pji_is_32 (A->p_is_32, A->j_is_32, A->i_is_32, + nzmax, A->vlen, A->vdim)) + { + // matrix is too large for its requested integer settings + return (GrB_INVALID_VALUE) ; + } + size_t isize = A->i_is_32 ? sizeof (int32_t) : sizeof (int64_t) ; + A->i = GB_MALLOC_MEMORY (nzmax, isize, &(A->i_size)) ; ok = (A->i != NULL) ; - if (ok) A->i [0] = 0 ; } if (numeric) { // calloc the space if A is bitmap - A->x = GB_XALLOC (sparsity == GxB_BITMAP, A_iso, // x:OK - nzmax, A->type->size, &(A->x_size)) ; + A->x = GB_XALLOC_MEMORY (sparsity == GxB_BITMAP, A_iso, nzmax, + A->type->size, &(A->x_size)) ; ok = ok && (A->x != NULL) ; } diff --git a/GraphBLAS/Source/matrix/GB_bix_free.c b/GraphBLAS/Source/matrix/GB_bix_free.c index 3d56d3fbd2..62a67d4d54 100644 --- a/GraphBLAS/Source/matrix/GB_bix_free.c +++ b/GraphBLAS/Source/matrix/GB_bix_free.c @@ -2,7 +2,7 @@ // GB_bix_free: free A->(b,i,x) pending tuples, zombies; A->p, A->h unchanged //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,8 @@ // Since A->p and A->h are unchanged, the matrix is still valid (unless it was // invalid on input). nnz(A) would report zero, and so would GrB_Matrix_nvals. +// A->p_is_32, A->j_is_32, and A->i_is_32 are unchanged. + #include "pending/GB_Pending.h" void GB_bix_free // free A->b, A->i, and A->x of a matrix @@ -40,7 +42,7 @@ void GB_bix_free // free A->b, A->i, and A->x of a matrix // free A->b unless it is shallow if (!A->b_shallow) { - GB_FREE (&(A->b), A->b_size) ; + GB_FREE_MEMORY (&(A->b), A->b_size) ; } A->b = NULL ; A->b_size = 0 ; @@ -49,7 +51,7 @@ void GB_bix_free // free A->b, A->i, and A->x of a matrix // free A->i unless it is shallow if (!A->i_shallow) { - GB_FREE (&(A->i), A->i_size) ; + GB_FREE_MEMORY (&(A->i), A->i_size) ; } A->i = NULL ; A->i_size = 0 ; @@ -58,12 +60,12 @@ void GB_bix_free // free A->b, A->i, and A->x of a matrix // free A->x unless it is shallow if (!A->x_shallow) { - GB_FREE (&(A->x), A->x_size) ; + GB_FREE_MEMORY (&(A->x), A->x_size) ; } A->x = NULL ; // GB_nnz_max (A) will report zero A->x_size = 0 ; A->x_shallow = false ; - A->iso = false ; // OK: all components are freed; no longer iso + A->iso = false ; A->nvals = 0 ; diff --git a/GraphBLAS/Source/matrix/GB_hy_free.c b/GraphBLAS/Source/matrix/GB_hy_free.c new file mode 100644 index 0000000000..d781c97aea --- /dev/null +++ b/GraphBLAS/Source/matrix/GB_hy_free.c @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// GB_hy_free: free A->h and A->Y +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" + +void GB_hy_free // free A-h and A->Y of a matrix +( + GrB_Matrix A // matrix with content to free +) +{ + + if (A != NULL) + { + // free A->h unless it is shallow + if (!A->h_shallow) + { + GB_FREE_MEMORY (&(A->h), A->h_size) ; + } + A->h = NULL ; + A->h_size = 0 ; + A->h_shallow = false ; + GB_hyper_hash_free (A) ; + } +} + diff --git a/GraphBLAS/Source/matrix/GB_hyper_hash_free.c b/GraphBLAS/Source/matrix/GB_hyper_hash_free.c index 61107bf7cc..0c5e1908fc 100644 --- a/GraphBLAS/Source/matrix/GB_hyper_hash_free.c +++ b/GraphBLAS/Source/matrix/GB_hyper_hash_free.c @@ -2,7 +2,7 @@ // GB_hyper_hash_free: free the A->Y hyper_hash of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/matrix/GB_ix_realloc.c b/GraphBLAS/Source/matrix/GB_ix_realloc.c index 0043e6bfe9..85950d22dc 100644 --- a/GraphBLAS/Source/matrix/GB_ix_realloc.c +++ b/GraphBLAS/Source/matrix/GB_ix_realloc.c @@ -2,14 +2,26 @@ // GB_ix_realloc: reallocate a sparse/hyper matrix to hold a given # of entries //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Does not modify A->p. Reallocates A->x and A->i to the requested size, -// preserving the existing content of A->x and A->i. Preserves pending tuples -// and zombies, if any. +// Reallocates A->x and A->i to the requested size, preserving the existing +// content of A->x and A->i. Preserves pending tuples and zombies, if any. +// A->j_is_32 and A->i_is_32 are unchanged since the matrix dimensions do not +// change, and thus A->Y is not modified. + +// If nzmax_new is too large for the current value of A->p_is_32, then A->p +// is converted to 64-bit integers and A->p_is_32 is set true. The content of +// A->p is preserved. + +// Thus, this method typically changes the A->x and A->i pointers, and may +// change A->p if needed. + +// If this method runs out of memory, the matrix is unchanged. + +#define GB_FREE_ALL ; #include "GB.h" @@ -24,9 +36,9 @@ GrB_Info GB_ix_realloc // reallocate space in a matrix // check inputs //-------------------------------------------------------------------------- - // This method is used only by GB_ix_resize, which itself is used only by - // GB_wait. Full and bitmap matrices never have pending work, so + // Full and bitmap matrices never have pending work, so // this function is only called for hypersparse and sparse matrices. + GrB_Info info ; ASSERT (!GB_IS_FULL (A)) ; ASSERT (!GB_IS_BITMAP (A)) ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; @@ -49,27 +61,49 @@ GrB_Info GB_ix_realloc // reallocate space in a matrix } //-------------------------------------------------------------------------- - // reallocate the space + // change A->p_is_32 and reallocate A->p if required + //-------------------------------------------------------------------------- + + if (!GB_valid_p_is_32 (A->p_is_32, nzmax_new)) + { + // convert A->p to 64-bit; do not change A->j_is_32 or A->i_is_32; note + // that GB_convert_int does not validate the new integer settings, + // since the # of entries in A is changing. + GB_OK (GB_convert_int (A, false, A->j_is_32, A->i_is_32, false)) ; + } + + //-------------------------------------------------------------------------- + // reallocate A->i (does not change A->i_is_32) //-------------------------------------------------------------------------- size_t nzmax_new1 = GB_IMAX (nzmax_new, 1) ; bool ok1 = true, ok2 = true ; - GB_REALLOC (A->i, nzmax_new1, int64_t, &(A->i_size), &ok1) ; + size_t isize = A->i_is_32 ? sizeof (int32_t) : sizeof (int64_t) ; + GB_REALLOC_MEMORY (A->i, nzmax_new1, isize, &(A->i_size), &ok1) ; + + //-------------------------------------------------------------------------- + // reallocate A->x + //-------------------------------------------------------------------------- + size_t asize = A->type->size ; if (A->iso) { // shrink A->x so it holds a single entry - GB_REALLOC (A->x, asize, GB_void, &(A->x_size), &ok2) ; + GB_REALLOC_MEMORY (A->x, 1, asize, &(A->x_size), &ok2) ; } else { // reallocate A->x from its current size to nzmax_new1 entries - GB_REALLOC (A->x, nzmax_new1*asize, GB_void, &(A->x_size), &ok2) ; + GB_REALLOC_MEMORY (A->x, nzmax_new1, asize, &(A->x_size), &ok2) ; } bool ok = ok1 && ok2 ; + //-------------------------------------------------------------------------- + // check and return result + //-------------------------------------------------------------------------- + // The matrix is always left in a valid state. If the reallocation fails - // it just won't have the requested size (and ok is false in this case). + // it just won't have the requested size. if (!ok) { return (GrB_OUT_OF_MEMORY) ; diff --git a/GraphBLAS/Source/matrix/GB_new.h b/GraphBLAS/Source/matrix/GB_matrix.h similarity index 64% rename from GraphBLAS/Source/matrix/GB_new.h rename to GraphBLAS/Source/matrix/GB_matrix.h index cfa9351efa..3e36d74066 100644 --- a/GraphBLAS/Source/matrix/GB_new.h +++ b/GraphBLAS/Source/matrix/GB_matrix.h @@ -1,29 +1,29 @@ //------------------------------------------------------------------------------ -// GB_new.h: definitions for GB_new and related methods +// GB_matrix.h: definitions for basic methods for the GrB_Matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -#ifndef GB_NEW_H -#define GB_NEW_H +#ifndef GB_MATRIX_H +#define GB_MATRIX_H typedef enum // input parameter to GB_new and GB_new_bix { - GB_Ap_calloc, // 0: calloc A->p, malloc A->h if hypersparse - GB_Ap_malloc, // 1: malloc A->p, malloc A->h if hypersparse - GB_Ap_null // 2: do not allocate A->p or A->h + GB_ph_calloc, // 0: calloc A->p, malloc A->h if hypersparse + GB_ph_malloc, // 1: malloc A->p, malloc A->h if hypersparse + GB_ph_null // 2: do not allocate A->p or A->h } -GB_Ap_code ; +GB_ph_code ; GrB_Info GB_Matrix_new // create a new matrix with no entries ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols + uint64_t nrows, // matrix dimension is nrows-by-ncols + uint64_t ncols ) ; GrB_Info GB_new // create matrix, except for indices & values @@ -32,13 +32,15 @@ GrB_Info GB_new // create matrix, except for indices & values const GrB_Type type, // matrix type const int64_t vlen, // length of each vector const int64_t vdim, // number of vectors - const GB_Ap_code Ap_option, // allocate A->p and A->h, or leave NULL + const GB_ph_code Ap_option, // allocate A->p and A->h, or leave NULL const bool is_csc, // true if CSC, false if CSR - const int sparsity, // hyper, sparse, bitmap, full, or - // auto (hyper + sparse) - const float hyper_switch, // A->hyper_switch, ignored if auto - const int64_t plen // size of A->p and A->h, if A hypersparse. + const int sparsity, // hyper, sparse, bitmap, full, or auto + const float hyper_switch, // A->hyper_switch + const int64_t plen, // size of A->p and A->h, if A hypersparse. // Ignored if A is not hypersparse. + bool p_is_32, // if true, A->p is 32 bit; 64 bit otherwise + bool j_is_32, // if true, A->h and A->Y are 32 bit; else 64 + bool i_is_32 // if true, A->i is 32 bit; 64 bit otherwise ) ; GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x @@ -47,7 +49,7 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x const GrB_Type type, // type of output matrix const int64_t vlen, // length of each vector const int64_t vdim, // number of vectors - const GB_Ap_code Ap_option, // allocate A->p and A->h, or leave NULL + const GB_ph_code Ap_option, // allocate A->p and A->h, or leave NULL const bool is_csc, // true if CSC, false if CSR const int sparsity, // hyper, sparse, bitmap, full, or auto const bool bitmap_calloc, // if true, calloc A->b, otherwise use malloc @@ -56,7 +58,10 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x const int64_t nzmax, // number of nonzeros the matrix must hold; // ignored if A is iso and full const bool numeric, // if true, allocate A->x, else A->x is NULL - const bool iso // if true, allocate A as iso + const bool A_iso, // if true, allocate A as iso + bool p_is_32, // if true, A->p is 32 bit; 64 bit otherwise + bool j_is_32, // if true, A->h and A->Y are 32 bit; else 64 + bool i_is_32 // if true, A->i is 32 bit; 64 bit otherwise ) ; GrB_Info GB_ix_realloc // reallocate space in a matrix @@ -75,6 +80,11 @@ void GB_phy_free // free A->p, A->h, and A->Y of a matrix GrB_Matrix A // matrix with content to free ) ; +void GB_hy_free // free A-h and A->Y of a matrix +( + GrB_Matrix A // matrix with content to free +) ; + void GB_hyper_hash_free // free the A->Y hyper_hash of a matrix ( GrB_Matrix A // matrix with content to free @@ -90,5 +100,13 @@ void GB_Matrix_free // free a matrix GrB_Matrix *Ahandle // handle of matrix to free ) ; +GrB_Info GB_shallow_copy // create a purely shallow matrix +( + GrB_Matrix C, // output matrix C, with a static header + const bool C_is_csc, // desired CSR/CSC format of C + const GrB_Matrix A, // input matrix + GB_Werk Werk +) ; + #endif diff --git a/GraphBLAS/Source/matrix/GB_new.c b/GraphBLAS/Source/matrix/GB_new.c index 8b807c1bcb..df81689409 100644 --- a/GraphBLAS/Source/matrix/GB_new.c +++ b/GraphBLAS/Source/matrix/GB_new.c @@ -2,7 +2,7 @@ // GB_new: create a new GraphBLAS matrix, but do not allocate A->{b,i,x} //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ // Creates a new matrix but does not allocate space for A->b, A->i, and A->x. // See GB_new_bix instead. -// If the Ap_option is GB_Ap_calloc, the A->p and A->h are allocated and +// If the Ap_option is GB_ph_calloc, the A->p and A->h are allocated and // initialized, and A->magic is set to GB_MAGIC to denote a valid matrix. // Otherwise, the matrix has not yet been completely initialized, and A->magic // is set to GB_MAGIC2 to denote this. This case only occurs internally in @@ -39,12 +39,15 @@ GrB_Info GB_new // create matrix, except for indices & values const GrB_Type type, // matrix type const int64_t vlen, // length of each vector const int64_t vdim, // number of vectors - const GB_Ap_code Ap_option, // allocate A->p and A->h, or leave NULL + const GB_ph_code Ap_option, // allocate A->p and A->h, or leave NULL const bool is_csc, // true if CSC, false if CSR const int sparsity, // hyper, sparse, bitmap, full, or auto const float hyper_switch, // A->hyper_switch - const int64_t plen // size of A->p and A->h, if A hypersparse. + const int64_t plen, // size of A->p and A->h, if A hypersparse. // Ignored if A is not hypersparse. + bool p_is_32, // if true, A->p is 32 bit; 64 bit otherwise + bool j_is_32, // if true, A->h and A->Y are 32 bit; else 64 + bool i_is_32 // if true, A->i is 32 bit; 64 bit otherwise ) { @@ -57,6 +60,19 @@ GrB_Info GB_new // create matrix, except for indices & values ASSERT (vlen >= 0 && vlen <= GB_NMAX) ASSERT (vdim >= 0 && vdim <= GB_NMAX) ; + if (sparsity == GxB_FULL || sparsity == GxB_BITMAP) + { + // full/bitmap matrices ignore the A->[pji]_is_32 flags + p_is_32 = false ; // OK: bitmap/full always has p_is_32 = false + j_is_32 = false ; // OK: bitmap/full always has j_is_32 = false + i_is_32 = false ; // OK: bitmap/full always has i_is_32 = false + } + else if (!GB_valid_pji_is_32 (p_is_32, j_is_32, i_is_32, 1, vlen, vdim)) + { + // sparse/hyper matrix is too large for its requested integer settings + return (GrB_INVALID_VALUE) ; + } + //-------------------------------------------------------------------------- // allocate the matrix header, if not already allocated on input //-------------------------------------------------------------------------- @@ -65,21 +81,22 @@ GrB_Info GB_new // create matrix, except for indices & values if ((*Ahandle) == NULL) { size_t header_size ; - (*Ahandle) = GB_MALLOC (1, struct GB_Matrix_opaque, &header_size) ; + (*Ahandle) = GB_CALLOC_MEMORY (1, sizeof (struct GB_Matrix_opaque), + &header_size) ; if (*Ahandle == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; } allocated_header = true ; - (*Ahandle)->static_header = false ; // header of A has been malloc'd (*Ahandle)->header_size = header_size ; } // else -// { +// { // // the header of A has been provided on input. It may already be -// // malloc'd, or it might be statically allocated in the caller. -// // (*Ahandle)->static_header is not modified. +// // malloc'd, or it might be statically allocated in the caller. In the +// // latter case, the header_size is zero. Thus, +// // (*Ahandle)->header_size is not modified. // } GrB_Matrix A = *Ahandle ; @@ -99,7 +116,7 @@ GrB_Info GB_new // create matrix, except for indices & values // CSR/CSC format A->is_csc = is_csc ; - // initial sparsity format + // sparsity format bool A_is_hyper ; bool A_is_full_or_bitmap = false ; A->hyper_switch = hyper_switch ; @@ -138,21 +155,25 @@ GrB_Info GB_new // create matrix, except for indices & values A->plen = -1 ; A->nvec = vdim ; // all vectors present, unless matrix has a zero dimension - A->nvec_nonempty = (vlen > 0) ? vdim : 0 ; +// A->nvec_nonempty = (vlen > 0) ? vdim : 0 ; + GB_nvec_nonempty_set (A, (vlen > 0) ? vdim : 0) ; + } else if (A_is_hyper) { // A is hypersparse A->plen = (vdim == 1) ? 1 : GB_IMIN (plen, vdim) ; A->nvec = 0 ; // no vectors present - A->nvec_nonempty = 0 ; +// A->nvec_nonempty = 0 ; + GB_nvec_nonempty_set (A, 0) ; } else { // A is sparse A->plen = vdim ; A->nvec = vdim ; // all vectors present - A->nvec_nonempty = 0 ; +// A->nvec_nonempty = 0 ; + GB_nvec_nonempty_set (A, 0) ; } // no content yet @@ -167,14 +188,24 @@ GrB_Info GB_new // create matrix, except for indices & values A->nzombies = 0 ; A->jumbled = false ; A->Pending = NULL ; - A->iso = false ; // OK: if iso, burble in the caller + A->iso = false ; + A->p_is_32 = p_is_32 ; + A->j_is_32 = j_is_32 ; + A->i_is_32 = i_is_32 ; + A->p_control = 0 ; + A->j_control = 0 ; + A->i_control = 0 ; //-------------------------------------------------------------------------- // Allocate A->p and A->h if requested //-------------------------------------------------------------------------- + size_t psize = p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; +// size_t isize = i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + bool ok ; - if (A_is_full_or_bitmap || Ap_option == GB_Ap_null) + if (A_is_full_or_bitmap || Ap_option == GB_ph_null) { // A is not initialized yet; A->p and A->h are both NULL. A->magic = GB_MAGIC2 ; @@ -182,33 +213,31 @@ GrB_Info GB_new // create matrix, except for indices & values A->h = NULL ; ok = true ; } - else if (Ap_option == GB_Ap_calloc) + else if (Ap_option == GB_ph_calloc) { // Sets the vector pointers to zero, which defines all vectors as empty A->magic = GB_MAGIC ; - A->p = GB_CALLOC (A->plen+1, int64_t, &(A->p_size)) ; - ASSERT (A->p_size == GB_Global_memtable_size (A->p)) ; + A->p = GB_CALLOC_MEMORY (A->plen+1, psize, &(A->p_size)) ; ok = (A->p != NULL) ; if (A_is_hyper) { // since nvec is zero, there is never any need to initialize A->h - A->h = GB_MALLOC (A->plen, int64_t, &(A->h_size)) ; + A->h = GB_MALLOC_MEMORY (A->plen, jsize, &(A->h_size)) ; ok = ok && (A->h != NULL) ; } } - else // Ap_option == GB_Ap_malloc + else // Ap_option == GB_ph_malloc { // This is faster but can only be used internally by GraphBLAS since // the matrix is allocated but not yet completely initialized. The // caller must set A->p [0..plen] and then set A->magic to GB_MAGIC, // before returning the matrix to the user application. A->magic = GB_MAGIC2 ; - A->p = GB_MALLOC (A->plen+1, int64_t, &(A->p_size)) ; - ASSERT (A->p_size == GB_Global_memtable_size (A->p)) ; + A->p = GB_MALLOC_MEMORY (A->plen+1, psize, &(A->p_size)) ; ok = (A->p != NULL) ; if (A_is_hyper) { - A->h = GB_MALLOC (A->plen, int64_t, &(A->h_size)) ; + A->h = GB_MALLOC_MEMORY (A->plen, jsize, &(A->h_size)) ; ok = ok && (A->h != NULL) ; } } @@ -233,7 +262,8 @@ GrB_Info GB_new // create matrix, except for indices & values // return result //-------------------------------------------------------------------------- - // The vector pointers A->p are initialized only if Ap_calloc is true + // The vector pointers A->p are initialized only if Ap_option is + // GB_ph_calloc if (A->magic == GB_MAGIC) { ASSERT_MATRIX_OK (A, "new matrix from GB_new", GB0) ; diff --git a/GraphBLAS/Source/matrix/GB_new_bix.c b/GraphBLAS/Source/matrix/GB_new_bix.c index 4fd02392c2..0b12ec9f50 100644 --- a/GraphBLAS/Source/matrix/GB_new_bix.c +++ b/GraphBLAS/Source/matrix/GB_new_bix.c @@ -2,7 +2,7 @@ // GB_new_bix: create a matrix and allocate space //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,8 +17,8 @@ // A new, dynamically allocated header for the matrix A is allocated. If // successful, *Ahandle points to the new handle, and its contents, on // output. If an out-of-memory condition occurs, the header is freed and -// *Ahandle is NULL on output. If successful, (*Ahandle)->static_header -// will always be false on output. +// *Ahandle is NULL on output. If successful, (*Ahandle)->header_size +// will always be nonzero on output. // If *Ahandle is not NULL on input: @@ -26,7 +26,7 @@ // modified on output, either on success or failure. If successful, the // content of A has been created. If an out-of-memory condition occurs, // the preexisting header is not freed and *Ahandle is unmodified on -// output. (*Ahandle)->static_header is unchanged. +// output. (*Ahandle)->header_size is unchanged. #include "GB.h" @@ -36,7 +36,7 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x const GrB_Type type, // type of output matrix const int64_t vlen, // length of each vector const int64_t vdim, // number of vectors - const GB_Ap_code Ap_option, // allocate A->p and A->h, or leave NULL + const GB_ph_code Ap_option, // allocate A->p and A->h, or leave NULL const bool is_csc, // true if CSC, false if CSR const int sparsity, // hyper, sparse, bitmap, full, or auto const bool bitmap_calloc, // if true, calloc A->b, otherwise use malloc @@ -45,7 +45,10 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x const int64_t nzmax, // number of nonzeros the matrix must hold; // ignored if A is iso and full const bool numeric, // if true, allocate A->x, else A->x is NULL - const bool A_iso // if true, allocate A as iso + const bool A_iso, // if true, allocate A as iso + bool p_is_32, // if true, A->p is 32 bit; 64 bit otherwise + bool j_is_32, // if true, A->h and A->Y are 32 bit; else 64 + bool i_is_32 // if true, A->i is 32 bit; 64 bit otherwise ) { @@ -55,13 +58,21 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x ASSERT (Ahandle != NULL) ; + if ((!(sparsity == GxB_FULL || sparsity == GxB_BITMAP)) && + !GB_valid_pji_is_32 (p_is_32, j_is_32, i_is_32, nzmax, vlen, vdim)) + { + // sparse/hyper matrix is too large for its requested integer settings + return (GrB_INVALID_VALUE) ; + } + //-------------------------------------------------------------------------- // allocate the header and the vector pointers //-------------------------------------------------------------------------- bool preexisting_header = (*Ahandle != NULL) ; GrB_Info info = GB_new (Ahandle, type, vlen, vdim, - Ap_option, is_csc, sparsity, hyper_switch, plen) ; + Ap_option, is_csc, sparsity, hyper_switch, plen, + p_is_32, j_is_32, i_is_32) ; if (info != GrB_SUCCESS) { // out of memory. @@ -76,7 +87,6 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x // allocate the bitmap (A->b), indices (A->i), and values (A->x) //-------------------------------------------------------------------------- - // set A->iso = A_iso OK: burble in the caller info = GB_bix_alloc (A, nzmax, sparsity, bitmap_calloc, numeric, A_iso) ; if (info != GrB_SUCCESS) { diff --git a/GraphBLAS/Source/matrix/GB_phy_free.c b/GraphBLAS/Source/matrix/GB_phy_free.c index 387685db83..a75970b611 100644 --- a/GraphBLAS/Source/matrix/GB_phy_free.c +++ b/GraphBLAS/Source/matrix/GB_phy_free.c @@ -2,7 +2,7 @@ // GB_phy_free: free the A->p, A->h, and A->Y content of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,8 @@ // invalid, and would generate a GrB_INVALID_OBJECT error if passed to a // user-callable GraphBLAS function. +// A->p_is_32, A->j_is_32, and A->i_is_32 are unchanged. + #include "GB.h" void GB_phy_free // free A->p, A->h, and A->Y of a matrix @@ -35,27 +37,20 @@ void GB_phy_free // free A->p, A->h, and A->Y of a matrix // free A->p unless it is shallow if (!A->p_shallow) { - GB_FREE (&(A->p), A->p_size) ; + GB_FREE_MEMORY (&(A->p), A->p_size) ; } A->p = NULL ; A->p_size = 0 ; A->p_shallow = false ; - // free A->h unless it is shallow - if (!A->h_shallow) - { - GB_FREE (&(A->h), A->h_size) ; - } - A->h = NULL ; - A->h_size = 0 ; - A->h_shallow = false ; + // free A->h and A->Y + GB_hy_free (A) ; A->plen = 0 ; A->nvec = 0 ; A->nvals = 0 ; - A->nvec_nonempty = 0 ; - - GB_hyper_hash_free (A) ; +// A->nvec_nonempty = 0 ; + GB_nvec_nonempty_set (A, 0) ; //-------------------------------------------------------------------------- // set the status to invalid diff --git a/GraphBLAS/Source/matrix/GB_phybix_free.c b/GraphBLAS/Source/matrix/GB_phybix_free.c index 739a1ef28f..275a404b12 100644 --- a/GraphBLAS/Source/matrix/GB_phybix_free.c +++ b/GraphBLAS/Source/matrix/GB_phybix_free.c @@ -2,7 +2,7 @@ // GB_phybix_free: free all content of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ void GB_phybix_free // free all content of a matrix { GB_phy_free (A) ; // free A->p, A->h, and A->Y GB_bix_free (A) ; // free A->b, A->i, and A->x - GB_FREE (&(A->logger), A->logger_size) ; // free the error logger + GB_FREE_MEMORY (&(A->logger), A->logger_size) ; // free the error logger } } diff --git a/GraphBLAS/Source/matrix/GB_shallow_copy.c b/GraphBLAS/Source/matrix/GB_shallow_copy.c index 2e93ea0231..15983c49ed 100644 --- a/GraphBLAS/Source/matrix/GB_shallow_copy.c +++ b/GraphBLAS/Source/matrix/GB_shallow_copy.c @@ -2,7 +2,7 @@ // GB_shallow_copy: create a shallow copy of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,7 @@ // Compare this function with GB_shallow_op.c. -#include "transpose/GB_transpose.h" -#include "include/GB_unused.h" +#include "GB.h" #define GB_FREE_ALL ; @@ -39,7 +38,7 @@ GrB_Info GB_shallow_copy // create a purely shallow matrix // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for shallow copy", GB0) ; GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (A) ; ASSERT (!GB_PENDING (A)) ; @@ -52,10 +51,13 @@ GrB_Info GB_shallow_copy // create a purely shallow matrix // allocate the struct for C, but do not allocate C->[p,h,b,i,x]. // C has the exact same sparsity structure as A. - GrB_Info info ; - info = GB_new (&C, // sparse or hyper, existing header - A->type, A->vlen, A->vdim, GB_Ap_null, C_is_csc, - GB_sparsity (A), A->hyper_switch, 0) ; + #ifdef GB_DEBUG + GrB_Info info = + #endif + GB_new (&C, // sparse or hyper, existing header + A->type, A->vlen, A->vdim, GB_ph_null, C_is_csc, + GB_sparsity (A), A->hyper_switch, 0, + A->p_is_32, A->j_is_32, A->i_is_32) ; ASSERT (info == GrB_SUCCESS) ; //-------------------------------------------------------------------------- @@ -67,15 +69,19 @@ GrB_Info GB_shallow_copy // create a purely shallow matrix C->h_shallow = (A->h != NULL) ; // C->h not freed when freeing C C->p = A->p ; // C->p is of size A->plen + 1 C->h = A->h ; // C->h is of size A->plen + C->p_is_32 = A->p_is_32 ; + C->j_is_32 = A->j_is_32 ; + C->i_is_32 = A->i_is_32 ; C->p_size = A->p_size ; C->h_size = A->h_size ; C->plen = A->plen ; // C and A have the same hyperlist size C->nvec = A->nvec ; - C->nvec_nonempty = A->nvec_nonempty ; +// C->nvec_nonempty = A->nvec_nonempty ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty_get (A)) ; C->jumbled = A->jumbled ; // C is jumbled if A is jumbled C->nvals = A->nvals ; C->magic = GB_MAGIC ; - C->iso = A->iso ; // OK: C has the same iso property as A + C->iso = A->iso ; // C has the same iso property as A if (A->iso) { GB_BURBLE_MATRIX (A, "(iso copy) ") ; diff --git a/GraphBLAS/Source/matrix/GrB_Matrix_free.c b/GraphBLAS/Source/matrix/GrB_Matrix_free.c index 6a6480cf35..aa4e3eeee8 100644 --- a/GraphBLAS/Source/matrix/GrB_Matrix_free.c +++ b/GraphBLAS/Source/matrix/GrB_Matrix_free.c @@ -2,13 +2,14 @@ // GrB_Matrix_free: free a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // free all the content of a matrix. After GrB_Matrix_free (&A), A is set -// to NULL +// to NULL. A may have readonly-content; it is simple removed from A and not +// modified. See also GrB_Matrix_clear. #include "GB.h" diff --git a/GraphBLAS/Source/matrix/GrB_Matrix_ncols.c b/GraphBLAS/Source/matrix/GrB_Matrix_ncols.c index d6e5d9b488..cd28511075 100644 --- a/GraphBLAS/Source/matrix/GrB_Matrix_ncols.c +++ b/GraphBLAS/Source/matrix/GrB_Matrix_ncols.c @@ -2,7 +2,7 @@ // GrB_Matrix_ncols: number of columns of a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix ( - GrB_Index *ncols, // matrix has ncols columns + uint64_t *ncols, // matrix has ncols columns const GrB_Matrix A // matrix to query ) { @@ -20,9 +20,10 @@ GrB_Info GrB_Matrix_ncols // get the number of columns of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_ncols (&ncols, A)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (ncols) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; //-------------------------------------------------------------------------- // return the number of columns diff --git a/GraphBLAS/Source/matrix/GrB_Matrix_new.c b/GraphBLAS/Source/matrix/GrB_Matrix_new.c index d555bf3738..4209ba23e9 100644 --- a/GraphBLAS/Source/matrix/GrB_Matrix_new.c +++ b/GraphBLAS/Source/matrix/GrB_Matrix_new.c @@ -2,7 +2,7 @@ // GrB_Matrix_new: create a new matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,11 +15,10 @@ GrB_Info GrB_Matrix_new // create a new matrix with no entries ( GrB_Matrix *A, // handle of matrix to create GrB_Type type, // type of matrix to create - GrB_Index nrows, // matrix dimension is nrows-by-ncols - GrB_Index ncols + uint64_t nrows, // matrix dimension is nrows-by-ncols + uint64_t ncols ) { - GB_WHERE1 ("GrB_Matrix_new (&A, type, nrows, ncols)") ; return (GB_Matrix_new (A, type, nrows, ncols)) ; } diff --git a/GraphBLAS/Source/matrix/GrB_Matrix_nrows.c b/GraphBLAS/Source/matrix/GrB_Matrix_nrows.c index dc7d379725..5ddd2f108a 100644 --- a/GraphBLAS/Source/matrix/GrB_Matrix_nrows.c +++ b/GraphBLAS/Source/matrix/GrB_Matrix_nrows.c @@ -2,7 +2,7 @@ // GrB_Matrix_nrows: number of rows of a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix ( - GrB_Index *nrows, // matrix has nrows rows + uint64_t *nrows, // matrix has nrows rows const GrB_Matrix A // matrix to query ) { @@ -20,9 +20,10 @@ GrB_Info GrB_Matrix_nrows // get the number of rows of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_nrows (&nrows, A)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (nrows) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; //-------------------------------------------------------------------------- // get the number of rows diff --git a/GraphBLAS/Source/matrix/include/GB_static_header.h b/GraphBLAS/Source/matrix/include/GB_clear_matrix_header.h similarity index 74% rename from GraphBLAS/Source/matrix/include/GB_static_header.h rename to GraphBLAS/Source/matrix/include/GB_clear_matrix_header.h index 107edeba4d..5ee32c415a 100644 --- a/GraphBLAS/Source/matrix/include/GB_static_header.h +++ b/GraphBLAS/Source/matrix/include/GB_clear_matrix_header.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_static_header.h: macros for allocating static headers +// GB_clear_matrix_header.h: macros for allocating static headers //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,9 +15,6 @@ // (required for CUDA). Leave static headers enabled by default by leaving // this commented out or setting GBNSTATIC to 0. -// #undef GBNSTATIC -// #define GBNSTATIC 1 - #ifndef GBNSTATIC #if defined ( GRAPHBLAS_HAS_CUDA ) #define GBNSTATIC 1 @@ -26,21 +23,21 @@ #endif #endif -#undef GB_CLEAR_STATIC_HEADER +#undef GB_CLEAR_MATRIX_HEADER #if GBNSTATIC // do not use any static headers - #define GB_CLEAR_STATIC_HEADER(XX,XX_header_handle) \ + #define GB_CLEAR_MATRIX_HEADER(XX,XX_header_handle) \ { \ size_t XX_size ; \ - XX = GB_CALLOC (1, struct GB_Matrix_opaque, &XX_size) ; \ + XX = GB_CALLOC_MEMORY (1, sizeof (struct GB_Matrix_opaque), \ + &XX_size) ; \ if (XX == NULL) \ { \ GB_FREE_ALL ; \ return (GrB_OUT_OF_MEMORY) ; \ } \ - XX->static_header = false ; \ XX->header_size = XX_size ; \ XX->magic = GB_MAGIC2 ; \ } @@ -48,23 +45,22 @@ #else // use static headers - #define GB_CLEAR_STATIC_HEADER(XX,XX_header_handle) \ + #define GB_CLEAR_MATRIX_HEADER(XX,XX_header_handle) \ { \ - XX = GB_clear_static_header (XX_header_handle) ; \ + XX = GB_clear_matrix_header (XX_header_handle) ; \ } #endif -#ifndef GB_STATIC_HEADER_H -#define GB_STATIC_HEADER_H +#ifndef GB_CLEAR_MATRIX_HEADER_H +#define GB_CLEAR_MATRIX_HEADER_H -static inline GrB_Matrix GB_clear_static_header // clear a static header +static inline GrB_Matrix GB_clear_matrix_header // clear a static header ( GrB_Matrix C // static header to clear ) { memset (C, 0, sizeof (struct GB_Matrix_opaque)) ; - C->static_header = true ; return (C) ; } diff --git a/GraphBLAS/Source/matrix/include/GB_index.h b/GraphBLAS/Source/matrix/include/GB_index.h new file mode 100644 index 0000000000..4de4de17e6 --- /dev/null +++ b/GraphBLAS/Source/matrix/include/GB_index.h @@ -0,0 +1,198 @@ +//------------------------------------------------------------------------------ +// GB_index.h: definitions for matrix indices and integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_INDEX_H +#define GB_INDEX_H + +//------------------------------------------------------------------------------ +// maximum matrix or vector dimension +//------------------------------------------------------------------------------ + +// GB_NMAX: max dimension when A->i or A->h are 64-bit +// GB_NMAX32: max dimension when A->i or A->h are 32-bit +#define GB_NMAX ((uint64_t) (1ULL << 60)) +#define GB_NMAX32 ((uint64_t) (1ULL << 31)) + +//------------------------------------------------------------------------------ +// GB_determine_p_is_32: returns a revised p_is_32, based on nvals_max +//------------------------------------------------------------------------------ + +static inline bool GB_determine_p_is_32 +( + bool p_is_32, // if true, requesting 32-bit offsets + int64_t nvals_max // max # of entries in the matrix +) +{ + if (p_is_32 && nvals_max > UINT32_MAX) + { + // A->p is requested too small; make it 64-bit + p_is_32 = false ; + } + return (p_is_32) ; +} + +//------------------------------------------------------------------------------ +// GB_determine_j_is_32: returns a revised j_is_32, based on vdim dimension +//------------------------------------------------------------------------------ + +static inline bool GB_determine_j_is_32 +( + bool j_is_32, // if true, requesting 32-bit indices + int64_t vdim // vector dimension of the matrix +) +{ + if (j_is_32 && vdim > GB_NMAX32) + { + // A->h, A->Y is requested too small; make it 64-bit + j_is_32 = false ; + } + return (j_is_32) ; +} + +//------------------------------------------------------------------------------ +// GB_determine_i_is_32: returns a revised i_is_32, based on vlen dimension +//------------------------------------------------------------------------------ + +static inline bool GB_determine_i_is_32 +( + bool i_is_32, // if true, requesting 32-bit indices + int64_t vlen // vector length of the matrix +) +{ + if (i_is_32 && vlen > GB_NMAX32) + { + // A->i is requested too small; make it 64-bit + i_is_32 = false ; + } + return (i_is_32) ; +} + +//------------------------------------------------------------------------------ +// GB_pji_control: return effective p_control, j_control, or i_control +//------------------------------------------------------------------------------ + +static inline int8_t GB_pji_control +( + int8_t matrix_pji_control, + int8_t global_pji_control +) +{ + if (matrix_pji_control == 0) + { + // default: matrix control defers to the global control + return (global_pji_control) ; + } + else + { + // use the matrix-specific cisontrol + return (matrix_pji_control) ; + } +} + +//------------------------------------------------------------------------------ +// GB_valid_[pji]_is_32: returns true if [pji] settings are OK +//------------------------------------------------------------------------------ + +// returns true if the pi settings are OK for this matrix. +// returns false if the matrix is too large for its pi settings + +static inline bool GB_valid_p_is_32 +( + bool p_is_32, // if true, A->p is 32-bit; else 64-bit + int64_t nvals // # of entries in the matrix +) +{ + // matrix is valid if A->p is 64 bit, or nvals is small enough + return (!p_is_32 || nvals < UINT32_MAX) ; +} + +static inline bool GB_valid_j_is_32 +( + bool j_is_32, // if true, A->h and A->Y are 32-bit; else 64-bit + int64_t vdim // matrix dimension (# of vectors) +) +{ + // matrix is valid if A->h and A->Y are 64 bit, or vdim is small enough + return (!j_is_32 || vdim <= GB_NMAX32) ; +} + +static inline bool GB_valid_i_is_32 +( + bool i_is_32, // if true, A->i is 32-bit; else 64-bit + int64_t vlen // matrix dimension (length of each vector) +) +{ + // matrix is valid if A->i is 64 bit, or vlen is small enough + return (!i_is_32 || vlen <= GB_NMAX32) ; +} + +static inline bool GB_valid_pji_is_32 +( + bool p_is_32, // if true, A->p is 32-bit; else 64-bit + bool j_is_32, // if true, A->h and A->Y are 32-bit; else 64-bit + bool i_is_32, // if true, A->i is 32-bit; else 64-bit + int64_t nvals, // # of entries in the matrix + int64_t vlen, // matrix dimensions + int64_t vdim +) +{ + // matrix is valid if A->p is 64 bit, or nvals is small enough, and + // if A->i is 64 bit, or the dimensions are small enough. + return (GB_valid_p_is_32 (p_is_32, nvals) && + GB_valid_j_is_32 (j_is_32, vdim) && + GB_valid_i_is_32 (i_is_32, vlen)) ; +} + +//------------------------------------------------------------------------------ +// GB_valid_matrix: check if a matrix is valid +//------------------------------------------------------------------------------ + +static inline GrB_Info GB_valid_matrix // returns GrB_SUCCESS, or error +( + GrB_Matrix A // matrix to validate +) +{ + + // a NULL matrix is always valid so far (it may be an optional argument) + if (A == NULL) + { + return (GrB_SUCCESS) ; + } + + // check the magic status + if (A->magic != GB_MAGIC) + { + if (A->magic == GB_MAGIC2) + { + return (GrB_INVALID_OBJECT) ; + } + else + { + return (GrB_UNINITIALIZED_OBJECT) ; + } + } + + // a full or bitmap matrix has no integers + if (A->p == NULL && A->h == NULL && A->i == NULL && A->Y == NULL) + { + return (GrB_SUCCESS) ; + } + + // ensure that the matrix status is large enough for its content + if (!GB_valid_pji_is_32 (A->p_is_32, A->j_is_32, A->i_is_32, + A->nvals, A->vlen, A->vdim)) + { + return (GrB_INVALID_OBJECT) ; + } + + return (GrB_SUCCESS) ; +} + +#endif + diff --git a/GraphBLAS/Source/memory/GB_calloc_memory.c b/GraphBLAS/Source/memory/GB_calloc_memory.c index e65f016fbb..d44a731bf1 100644 --- a/GraphBLAS/Source/memory/GB_calloc_memory.c +++ b/GraphBLAS/Source/memory/GB_calloc_memory.c @@ -2,7 +2,7 @@ // GB_calloc_memory: wrapper for calloc (actually uses malloc and memset) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ static inline void *GB_calloc_helper p = GB_Global_malloc_function (*size) ; #ifdef GB_MEMDUMP - printf ("hard calloc %p %ld\n", p, *size) ; // MEMDUMP + GBMDUMP ("calloc %p %8ld: ", p, *size) ; GB_Global_memtable_dump ( ) ; #endif diff --git a/GraphBLAS/Source/memory/GB_free_memory.c b/GraphBLAS/Source/memory/GB_free_memory.c index 0e9ff6e4c0..61303f6438 100644 --- a/GraphBLAS/Source/memory/GB_free_memory.c +++ b/GraphBLAS/Source/memory/GB_free_memory.c @@ -2,7 +2,7 @@ // GB_free_memory: wrapper for free //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,9 +19,6 @@ GB_CALLBACK_FREE_MEMORY_PROTO (GB_free_memory) if (p != NULL && (*p) != NULL) { ASSERT (size_allocated == GB_Global_memtable_size (*p)) ; - #ifdef GB_MEMDUMP - printf ("\nhard free %p %ld\n", *p, size_allocated) ; // MEMDUMP - #endif GB_Global_free_function (*p) ; #ifdef GB_MEMDUMP GB_Global_memtable_dump ( ) ; diff --git a/GraphBLAS/Source/memory/GB_malloc_memory.c b/GraphBLAS/Source/memory/GB_malloc_memory.c index 8aa638c40b..2555b20803 100644 --- a/GraphBLAS/Source/memory/GB_malloc_memory.c +++ b/GraphBLAS/Source/memory/GB_malloc_memory.c @@ -2,7 +2,7 @@ // GB_malloc_memory: wrapper for malloc //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ static inline void *GB_malloc_helper p = GB_Global_malloc_function (*size) ; #ifdef GB_MEMDUMP - printf ("hard malloc %p %ld\n", p, *size) ; // MEMDUMP + GBMDUMP ("malloc %p %8ld: ", p, *size) ; GB_Global_memtable_dump ( ) ; #endif @@ -41,6 +41,16 @@ static inline void *GB_malloc_helper // GB_malloc_memory //------------------------------------------------------------------------------ +#if 0 +void *GB_malloc_memory // pointer to allocated block of memory +( + size_t nitems, // number of items to allocate + size_t size_of_item, // sizeof each item + // output: + size_t *size_allocated // # of bytes actually allocated +) +#endif + GB_CALLBACK_MALLOC_MEMORY_PROTO (GB_malloc_memory) { diff --git a/GraphBLAS/Source/memory/GB_memcpy.c b/GraphBLAS/Source/memory/GB_memcpy.c index c1ff100e20..ff075f9579 100644 --- a/GraphBLAS/Source/memory/GB_memcpy.c +++ b/GraphBLAS/Source/memory/GB_memcpy.c @@ -2,7 +2,7 @@ // GB_memcpy: parallel memcpy //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/memory/GB_memory.h b/GraphBLAS/Source/memory/GB_memory.h index 5d37b46684..0a42482876 100644 --- a/GraphBLAS/Source/memory/GB_memory.h +++ b/GraphBLAS/Source/memory/GB_memory.h @@ -2,7 +2,7 @@ // GB_memory.h: memory allocation //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/memory/GB_memoryUsage.c b/GraphBLAS/Source/memory/GB_memoryUsage.c index ba7b0a5203..daedea0ed9 100644 --- a/GraphBLAS/Source/memory/GB_memoryUsage.c +++ b/GraphBLAS/Source/memory/GB_memoryUsage.c @@ -2,7 +2,7 @@ // GB_memoryUsage: # of bytes used for a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,7 +45,7 @@ void GB_memoryUsage // count # allocated blocks and their sizes GB_Pending Pending = A->Pending ; - if (!A->static_header) + if (!(A->header_size == 0)) { (*nallocs)++ ; (*mem_deep) += A->header_size ; diff --git a/GraphBLAS/Source/memory/GB_memset.c b/GraphBLAS/Source/memory/GB_memset.c index a5d69909df..0fcd20e0b1 100644 --- a/GraphBLAS/Source/memory/GB_memset.c +++ b/GraphBLAS/Source/memory/GB_memset.c @@ -2,7 +2,7 @@ // GB_memset: parallel memset //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,16 @@ #define GB_MEM_CHUNK (1024*1024) +#if 0 + void GB_memset // parallel memset + ( + void *dest, // destination + const int c, // value to to set + size_t n, // # of bytes to set + int nthreads // max # of threads to use + ) +#endif + GB_CALLBACK_MEMSET_PROTO (GB_memset) { if (nthreads <= 1 || n <= GB_MEM_CHUNK) diff --git a/GraphBLAS/Source/memory/GB_realloc_memory.c b/GraphBLAS/Source/memory/GB_realloc_memory.c index a32339e486..498ba881a5 100644 --- a/GraphBLAS/Source/memory/GB_realloc_memory.c +++ b/GraphBLAS/Source/memory/GB_realloc_memory.c @@ -2,7 +2,7 @@ // GB_realloc_memory: wrapper for realloc //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -59,7 +59,7 @@ void *GB_realloc_memory // pointer to reallocated block of memory, or if (p == NULL) { - p = GB_malloc_memory (nitems_new, size_of_item, size_allocated) ; + p = GB_MALLOC_MEMORY (nitems_new, size_of_item, size_allocated) ; (*ok) = (p != NULL) ; return (p) ; } @@ -119,7 +119,7 @@ void *GB_realloc_memory // pointer to reallocated block of memory, or //---------------------------------------------------------------------- // allocate the new space - pnew = GB_malloc_memory (nitems_new, size_of_item, &newsize_allocated) ; + pnew = GB_MALLOC_MEMORY (nitems_new, size_of_item, &newsize_allocated) ; // copy over the data from the old block to the new block if (pnew != NULL) { @@ -144,10 +144,8 @@ void *GB_realloc_memory // pointer to reallocated block of memory, or } if (!pretend_to_fail) { - #ifdef GB_MEMDUMP - printf ("hard realloc %p oldsize %ld newsize %ld\n", // MEMDUMP + GBMDUMP ("realloc %p oldsize %8ld newsize %8ld: ", p, oldsize_allocated, newsize_allocated) ; - #endif pnew = GB_Global_realloc_function (p, newsize_allocated) ; #ifdef GB_MEMDUMP GB_Global_memtable_dump ( ) ; diff --git a/GraphBLAS/Source/memory/GB_xalloc_memory.c b/GraphBLAS/Source/memory/GB_xalloc_memory.c index 01956206ba..18cf49163c 100644 --- a/GraphBLAS/Source/memory/GB_xalloc_memory.c +++ b/GraphBLAS/Source/memory/GB_xalloc_memory.c @@ -2,7 +2,7 @@ // GB_xalloc_memory: allocate an array for n entries, or 1 if iso //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,18 +21,20 @@ void *GB_xalloc_memory // return the newly-allocated space ) { void *p ; + n = GB_IMAX (n, 1) ; + GBMDUMP ("xalloc : ") ; if (iso) { // always calloc the iso entry - p = GB_CALLOC (type_size, GB_void, size) ; + p = GB_calloc_memory (1, type_size, size) ; } else if (use_calloc) { - p = GB_CALLOC (n * type_size, GB_void, size) ; + p = GB_calloc_memory (n, type_size, size) ; } else { - p = GB_MALLOC (n * type_size, GB_void, size) ; + p = GB_malloc_memory (n, type_size, size) ; } return (p) ; } diff --git a/GraphBLAS/Source/memory/GxB_Matrix_memoryUsage.c b/GraphBLAS/Source/memory/GxB_Matrix_memoryUsage.c index ccdfc71a01..6927355c0d 100644 --- a/GraphBLAS/Source/memory/GxB_Matrix_memoryUsage.c +++ b/GraphBLAS/Source/memory/GxB_Matrix_memoryUsage.c @@ -2,7 +2,7 @@ // GxB_Matrix_memoryUsage: # of bytes used for a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,10 @@ GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_memoryUsage (&size, A)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (size) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; //-------------------------------------------------------------------------- // get the memory size taken by the matrix @@ -31,6 +32,10 @@ GrB_Info GxB_Matrix_memoryUsage // return # of bytes used for a matrix int64_t nallocs ; size_t mem_shallow ; GB_memoryUsage (&nallocs, size, &mem_shallow, A, true) ; + if (GB_Global_stats_mem_shallow_get ( )) + { + (*size) += mem_shallow ; + } return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/memory/GxB_Scalar_memoryUsage.c b/GraphBLAS/Source/memory/GxB_Scalar_memoryUsage.c index f9d19d56d4..85a0a7a3be 100644 --- a/GraphBLAS/Source/memory/GxB_Scalar_memoryUsage.c +++ b/GraphBLAS/Source/memory/GxB_Scalar_memoryUsage.c @@ -2,7 +2,7 @@ // GxB_Scalar_memoryUsage: # of bytes used for a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,10 @@ GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Scalar_memoryUsage (&size, s)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (size) ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL_OR_INVALID (s) ; //-------------------------------------------------------------------------- // get the memory size taken by the scalar @@ -31,6 +32,10 @@ GrB_Info GxB_Scalar_memoryUsage // return # of bytes used for a scalar int64_t nallocs ; size_t mem_shallow ; GB_memoryUsage (&nallocs, size, &mem_shallow, (GrB_Matrix) s, false) ; + if (GB_Global_stats_mem_shallow_get ( )) + { + (*size) += mem_shallow ; + } return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/memory/GxB_Vector_memoryUsage.c b/GraphBLAS/Source/memory/GxB_Vector_memoryUsage.c index d03bb7a7c8..c40aadca0a 100644 --- a/GraphBLAS/Source/memory/GxB_Vector_memoryUsage.c +++ b/GraphBLAS/Source/memory/GxB_Vector_memoryUsage.c @@ -2,7 +2,7 @@ // GxB_Vector_memoryUsage: # of bytes used for a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,9 +20,10 @@ GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_memoryUsage (&size, v)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (size) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; ASSERT (GB_VECTOR_OK (v)) ; //-------------------------------------------------------------------------- @@ -32,6 +33,10 @@ GrB_Info GxB_Vector_memoryUsage // return # of bytes used for a vector int64_t nallocs ; size_t mem_shallow ; GB_memoryUsage (&nallocs, size, &mem_shallow, (GrB_Matrix) v, false) ; + if (GB_Global_stats_mem_shallow_get ( )) + { + (*size) += mem_shallow ; + } return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/memory/include/GB_memory_macros.h b/GraphBLAS/Source/memory/include/GB_memory_macros.h index ceb05a4e3c..031ce7c6e7 100644 --- a/GraphBLAS/Source/memory/include/GB_memory_macros.h +++ b/GraphBLAS/Source/memory/include/GB_memory_macros.h @@ -2,7 +2,7 @@ // GB_memory_macros.h: memory allocation macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,70 +16,59 @@ #ifdef GB_MEMDUMP - #define GB_FREE(p,s) \ - { \ - if (p != NULL && (*(p)) != NULL) \ - { \ - printf ("free (%s, line %d): %p size %lu\n", /* MEMDUMP */ \ - __FILE__, __LINE__, (*p), s) ; \ - } \ - GB_free_memory ((void **) p, s) ; \ + #define GBMDUMP(...) GBDUMP (__VA_ARGS__) + + #define GB_FREE_MEMORY(p,s) \ + { \ + if (p != NULL && (*(p)) != NULL) \ + { \ + GBMDUMP ("free %p %8ld: (%s, line %d)\n", \ + (void *) (*p), s, __FILE__, __LINE__) ; \ + } \ + GB_free_memory ((void **) p, s) ; \ } - #define GB_CALLOC(n,type,s) \ - (type *) GB_calloc_memory (n, sizeof (type), s) ; \ - ; printf ("calloc (%s, line %d): size %lu\n", /* MEMDUMP */ \ - __FILE__, __LINE__, *(s)) ; + #define GB_MALLOC_MEMORY(n,sizeof_type,s) \ + GB_malloc_memory (n, sizeof_type, s) ; \ + GBMDUMP ("did malloc: (%s, line %d)\n", __FILE__, __LINE__) - #define GB_MALLOC(n,type,s) \ - (type *) GB_malloc_memory (n, sizeof (type), s) ; \ - ; printf ("malloc (%s, line %d): size %lu\n", /* MEMDUMP */ \ - __FILE__, __LINE__, *(s)) ; + #define GB_CALLOC_MEMORY(n,sizeof_type,s) \ + GB_calloc_memory (n, sizeof_type, s) ; \ + GBMDUMP ("did calloc: (%s, line %d)\n", __FILE__, __LINE__) - #define GB_REALLOC(p,nnew,type,s,ok) \ - p = (type *) GB_realloc_memory (nnew, sizeof (type), \ - (void *) p, s, ok) ; \ - ; printf ("realloc (%s, line %d): size %lu\n", /* MEMDUMP */ \ - __FILE__, __LINE__, *(s)) ; + #define GB_REALLOC_MEMORY(p,nnew,sizeof_type,s,ok) \ + { \ + p = GB_realloc_memory (nnew, sizeof_type, \ + (void *) p, s, ok) ; \ + GBMDUMP ("did realloc (%s, line %d)\n", __FILE__, __LINE__) ; \ + } - #define GB_XALLOC(use_calloc,iso,n,type_size,s) \ - GB_xalloc_memory (use_calloc, iso, n, type_size, s) ; \ - ; printf ("xalloc (%s, line %d): size %lu\n", /* MEMDUMP */ \ - __FILE__, __LINE__, *(s)) ; + #define GB_XALLOC_MEMORY(use_calloc,iso,n,sizeof_type,s) \ + GB_xalloc_memory (use_calloc, iso, n, sizeof_type, s) ; \ + GBMDUMP ("did xalloc (%s, line %d)\n", __FILE__, __LINE__) #else - #define GB_FREE(p,s) \ + #define GBMDUMP(...) + + #define GB_FREE_MEMORY(p,s) \ GB_free_memory ((void **) p, s) - #define GB_CALLOC(n,type,s) \ - (type *) GB_calloc_memory (n, sizeof (type), s) + #define GB_MALLOC_MEMORY(n,sizeof_type,s) \ + GB_malloc_memory (n, sizeof_type, s) - #define GB_MALLOC(n,type,s) \ - (type *) GB_malloc_memory (n, sizeof (type), s) + #define GB_CALLOC_MEMORY(n,sizeof_type,s) \ + GB_calloc_memory (n, sizeof_type, s) - #define GB_REALLOC(p,nnew,type,s,ok) \ - p = (type *) GB_realloc_memory (nnew, sizeof (type), \ - (void *) p, s, ok) + #define GB_REALLOC_MEMORY(p,nnew,sizeof_type,s,ok) \ + { \ + p = GB_realloc_memory (nnew, sizeof_type, (void *) p, s, ok) ; \ + } - #define GB_XALLOC(use_calloc,iso,n,type_size,s) \ - GB_xalloc_memory (use_calloc, iso, n, type_size, s) + #define GB_XALLOC_MEMORY(use_calloc,iso,n,sizeof_type,s) \ + GB_xalloc_memory (use_calloc, iso, n, sizeof_type, s) #endif -//------------------------------------------------------------------------------ -// malloc/calloc/realloc/free: for workspace -//------------------------------------------------------------------------------ - -// These macros currently do the same thing as the 4 macros above, but that may -// change in the future. Even if they always do the same thing, it's useful to -// tag the source code for the allocation of workspace differently from the -// allocation of permament space for a GraphBLAS object, such as a GrB_Matrix. - -#define GB_CALLOC_WORK(n,type,s) GB_CALLOC(n,type,s) -#define GB_MALLOC_WORK(n,type,s) GB_MALLOC(n,type,s) -#define GB_REALLOC_WORK(p,nnew,type,s,ok) GB_REALLOC(p,nnew,type,s,ok) -#define GB_FREE_WORK(p,s) GB_FREE(p,s) - #endif diff --git a/GraphBLAS/Source/monoid/GB_Monoid_new.c b/GraphBLAS/Source/monoid/GB_Monoid_new.c index f83ed1a7d7..d365873952 100644 --- a/GraphBLAS/Source/monoid/GB_Monoid_new.c +++ b/GraphBLAS/Source/monoid/GB_Monoid_new.c @@ -2,7 +2,7 @@ // GB_Monoid_new: create a GrB_Monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -89,7 +89,8 @@ GrB_Info GB_Monoid_new // create a monoid // allocate the monoid size_t header_size ; - (*monoid) = GB_MALLOC (1, struct GB_Monoid_opaque, &header_size) ; + (*monoid) = GB_MALLOC_MEMORY (1, sizeof (struct GB_Monoid_opaque), + &header_size) ; if (*monoid == NULL) { // out of memory @@ -118,12 +119,12 @@ GrB_Info GB_Monoid_new // create a monoid // allocate the identity value #define GB_ALLOC_IDENTITY \ { \ - mon->identity = GB_MALLOC (zsize, GB_void, &(mon->identity_size)) ; \ + mon->identity = GB_MALLOC_MEMORY (1, zsize, &(mon->identity_size)) ; \ if (mon->identity == NULL) \ { \ /* out of memory */ \ - GB_FREE (&(mon->terminal), mon->terminal_size) ; \ - GB_FREE (monoid, header_size) ; \ + GB_FREE_MEMORY (&(mon->terminal), mon->terminal_size) ; \ + GB_FREE_MEMORY (monoid, header_size) ; \ return (GrB_OUT_OF_MEMORY) ; \ } \ } @@ -131,12 +132,12 @@ GrB_Info GB_Monoid_new // create a monoid // allocate the terminal value #define GB_ALLOC_TERMINAL \ { \ - mon->terminal = GB_MALLOC (zsize, GB_void, &(mon->terminal_size)) ; \ + mon->terminal = GB_MALLOC_MEMORY (1, zsize, &(mon->terminal_size)) ; \ if (mon->terminal == NULL) \ { \ /* out of memory */ \ - GB_FREE (&(mon->identity), mon->identity_size) ; \ - GB_FREE (monoid, header_size) ; \ + GB_FREE_MEMORY (&(mon->identity), mon->identity_size) ; \ + GB_FREE_MEMORY (monoid, header_size) ; \ return (GrB_OUT_OF_MEMORY) ; \ } \ } diff --git a/GraphBLAS/Source/monoid/GB_Monoid_new.h b/GraphBLAS/Source/monoid/GB_Monoid_new.h index e9734eb2d0..672287d70b 100644 --- a/GraphBLAS/Source/monoid/GB_Monoid_new.h +++ b/GraphBLAS/Source/monoid/GB_Monoid_new.h @@ -2,7 +2,7 @@ // GB_Monoid_new.h: definitions for GB_Monoid_new //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/monoid/GrB_Monoid_free.c b/GraphBLAS/Source/monoid/GrB_Monoid_free.c index 45a36f4adc..dc187e822d 100644 --- a/GraphBLAS/Source/monoid/GrB_Monoid_free.c +++ b/GraphBLAS/Source/monoid/GrB_Monoid_free.c @@ -2,7 +2,7 @@ // GrB_Monoid_free: free a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,14 +23,14 @@ GrB_Info GrB_Monoid_free // free a user-created monoid { size_t header_size = mon->header_size ; // free the monoid user_name - GB_FREE (&(mon->user_name), mon->user_name_size) ; + GB_FREE_MEMORY (&(mon->user_name), mon->user_name_size) ; if (header_size > 0) { mon->magic = GB_FREED ; // to help detect dangling pointers mon->header_size = 0 ; - GB_FREE (&(mon->identity), mon->identity_size) ; - GB_FREE (&(mon->terminal), mon->terminal_size) ; - GB_FREE (monoid, header_size) ; + GB_FREE_MEMORY (&(mon->identity), mon->identity_size) ; + GB_FREE_MEMORY (&(mon->terminal), mon->terminal_size) ; + GB_FREE_MEMORY (monoid, header_size) ; } } } diff --git a/GraphBLAS/Source/monoid/GrB_Monoid_new.c b/GraphBLAS/Source/monoid/GrB_Monoid_new.c index eb031ff4c4..bb892b287a 100644 --- a/GraphBLAS/Source/monoid/GrB_Monoid_new.c +++ b/GraphBLAS/Source/monoid/GrB_Monoid_new.c @@ -2,7 +2,7 @@ // GrB_Monoid_new: create a new monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,10 +22,11 @@ GrB_Info GB_EVAL3 (prefix, _Monoid_new_, T) /* create a new monoid */ \ type identity /* identity value of the monoid */ \ ) \ { \ - GB_WHERE1 ("GrB_Monoid_new_" GB_STR(T) " (&monoid, op, identity)") ; \ + GB_CHECK_INIT ; \ + GB_WERK ("GrB_Monoid_new_" GB_STR(T) " (&monoid, op, identity)") ; \ type id = identity ; \ return (GB_Monoid_new (monoid, op, &id, NULL, GB_ ## T ## _code, \ - Werk)) ; \ + Werk)) ; \ } GB_MONOID_NEW (GrB, bool , BOOL ) @@ -49,7 +50,8 @@ GrB_Info GrB_Monoid_new_UDT // create a monoid with a user-defined type void *identity // identity value of monoid ) { - GB_WHERE1 ("GrB_Monoid_new_UDT (&monoid, op, identity)") ; + GB_CHECK_INIT ; + GB_WERK ("GrB_Monoid_new_UDT (&monoid, op, identity)") ; return (GB_Monoid_new (monoid, op, identity, NULL, GB_UDT_code, Werk)) ; } diff --git a/GraphBLAS/Source/monoid/GxB_Monoid_identity.c b/GraphBLAS/Source/monoid/GxB_Monoid_identity.c index 1c83be5bf3..7eee2cf143 100644 --- a/GraphBLAS/Source/monoid/GxB_Monoid_identity.c +++ b/GraphBLAS/Source/monoid/GxB_Monoid_identity.c @@ -2,7 +2,7 @@ // GxB_Monoid_identity: return the identity of a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GxB_Monoid_identity // return the monoid identity // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Monoid_identity (&identity, monoid)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (identity) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; ASSERT_MONOID_OK (monoid, "monoid for identity", GB0) ; diff --git a/GraphBLAS/Source/monoid/GxB_Monoid_operator.c b/GraphBLAS/Source/monoid/GxB_Monoid_operator.c index 7a12718883..390be0f736 100644 --- a/GraphBLAS/Source/monoid/GxB_Monoid_operator.c +++ b/GraphBLAS/Source/monoid/GxB_Monoid_operator.c @@ -2,7 +2,7 @@ // GxB_Monoid_operator: return the op of a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GxB_Monoid_operator // return the monoid operator // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Monoid_operator (&op, monoid)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (op) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; ASSERT_MONOID_OK (monoid, "monoid for op", GB0) ; diff --git a/GraphBLAS/Source/monoid/GxB_Monoid_terminal.c b/GraphBLAS/Source/monoid/GxB_Monoid_terminal.c index 534f219618..b42b4398e4 100644 --- a/GraphBLAS/Source/monoid/GxB_Monoid_terminal.c +++ b/GraphBLAS/Source/monoid/GxB_Monoid_terminal.c @@ -2,7 +2,7 @@ // GxB_Monoid_terminal: return the terminal of a monoid (if any) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_Monoid_terminal // return the monoid terminal // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Monoid_terminal (&has_terminal, &terminal, monoid)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (has_terminal) ; GB_RETURN_IF_NULL (terminal) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; diff --git a/GraphBLAS/Source/monoid/GxB_Monoid_terminal_new.c b/GraphBLAS/Source/monoid/GxB_Monoid_terminal_new.c index 112c504353..2fc87310c1 100644 --- a/GraphBLAS/Source/monoid/GxB_Monoid_terminal_new.c +++ b/GraphBLAS/Source/monoid/GxB_Monoid_terminal_new.c @@ -2,7 +2,7 @@ // GxB_Monoid_terminal_new: create a new monoid with a terminal value //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,7 +23,8 @@ GrB_Info GB_EVAL2 (GXB (Monoid_terminal_new_), T) /* create a new monoid */ \ type terminal /* terminal value of the monoid */ \ ) \ { \ - GB_WHERE1 ("GxB_Monoid_terminal_new" GB_STR(T) \ + GB_CHECK_INIT ; \ + GB_WERK ("GxB_Monoid_terminal_new" GB_STR(T) \ " (&monoid, op, identity, terminal)") ; \ type id = identity ; \ type tr = terminal ; \ @@ -52,7 +53,8 @@ GrB_Info GxB_Monoid_terminal_new_UDT // create a monoid with a user type void *terminal // terminal value of the monoid ) { - GB_WHERE1 ("GxB_Monoid_terminal_new_UDT " + GB_CHECK_INIT ; + GB_WERK ("GxB_Monoid_terminal_new_UDT " "(&monoid, op, identity, terminal)") ; GB_RETURN_IF_NULL (terminal) ; return (GB_Monoid_new (monoid, op, identity, terminal, GB_UDT_code, diff --git a/GraphBLAS/Source/monoid/include/GB_monoid_shared_definitions.h b/GraphBLAS/Source/monoid/include/GB_monoid_shared_definitions.h index 2cc223afd7..d2b7aa608c 100644 --- a/GraphBLAS/Source/monoid/include/GB_monoid_shared_definitions.h +++ b/GraphBLAS/Source/monoid/include/GB_monoid_shared_definitions.h @@ -2,7 +2,7 @@ // GB_monoid_shared_definitions.h: common macros for monoids //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB__any_pair_iso.c b/GraphBLAS/Source/mxm/GB_AxB__any_pair_iso.c index fac978f59f..2db885c426 100644 --- a/GraphBLAS/Source/mxm/GB_AxB__any_pair_iso.c +++ b/GraphBLAS/Source/mxm/GB_AxB__any_pair_iso.c @@ -2,7 +2,7 @@ // GB_AxB__any_pair_iso.c: matrix multiply for a single semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,6 @@ #if GB_TYPE_ENABLED #include "GB.h" #include "mxm/GB_AxB_saxpy.h" -#include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" #include "mxm/GB_AxB__include1.h" @@ -352,5 +351,7 @@ GrB_Info GB (_Asaxpy3B__any_pair_iso) #endif +#else +GB_EMPTY_PLACEHOLDER #endif diff --git a/GraphBLAS/Source/mxm/GB_AxB__include1.h b/GraphBLAS/Source/mxm/GB_AxB__include1.h index 6d246c7f9a..2dd2999ab2 100644 --- a/GraphBLAS/Source/mxm/GB_AxB__include1.h +++ b/GraphBLAS/Source/mxm/GB_AxB__include1.h @@ -2,7 +2,7 @@ // GB_AxB__include1.h: definitions for GB_AxB__*.c methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This file has been automatically generated from Generator/GB_AxB.h diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot.c b/GraphBLAS/Source/mxm/GB_AxB_dot.c index 10d4cbc8df..9b988c834e 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot.c @@ -2,14 +2,14 @@ // GB_AxB_dot: C=A'*B using dot products //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Parallel matrix-matrix multiply, A'*B, with optional mask M. This -// method is used by GrB_mxm, GrB_vxm, and GrB_mxv. For both of the latter two -// methods, B on input will be an nrows-by-1 column vxector. +// Parallel matrix-matrix multiply, A'*B, with optional mask M. This method is +// used by GrB_mxm, GrB_vxm, and GrB_mxv. For both of the latter two methods, +// B on input will be an nrows-by-1 column vxector. // This function, and the matrices C, M, A, and B are all CSR/CSC agnostic. // For this discussion, suppose they are CSC, with vlen = # of rows, and vdim = @@ -26,7 +26,8 @@ // very large matrices C. GB_AxB_dot4 computes C+=A'*B when C is full. // The output matrix C has not been allocated. It is an uninitialzed static -// header on input. The mask M is optional. +// header on input. The mask M is optional. The type of C (ctype) always +// matches the ztype of the monoid, and also the accumulator for GB_AxB_dot4. // If the result is computed in-place, then the C parameter is ignored, and the // result is computed in C_in instead. This case requires the accum operator @@ -67,7 +68,7 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for dot A'*B", GB0) ; ASSERT (!GB_PENDING (M)) ; @@ -113,8 +114,9 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) (*mask_applied) = false ; // set C->iso = true OK info = GB_new_bix (&C, // existing header - ztype, A->vdim, B->vdim, GB_Ap_null, true, GxB_FULL, false, - GB_HYPER_SWITCH_DEFAULT, -1, 1, true, true) ; + ztype, A->vdim, B->vdim, GB_ph_null, true, GxB_FULL, false, + GB_HYPER_SWITCH_DEFAULT, -1, 1, true, true, + /* OK: */ false, false, false) ; if (info == GrB_SUCCESS) { C->magic = GB_MAGIC ; @@ -134,7 +136,9 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) { // C_in must be full on input. M must be NULL and not // complemented. the C iso case is not handled (where C is iso on - // output), but C_in might be iso on input. + // output), but C_in might be iso on input. Its type must match + // the monoid. + ASSERT (C_in->type == semiring->add->op->ztype) ; (*mask_applied) = false ; // no mask to apply info = GB_AxB_dot4 (C_in, A, B, semiring, flipxy, done_in_place, Werk) ; @@ -152,12 +156,20 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) if (A->vlen == 0) { + // no work to do; C is an empty matrix, normally hypersparse + + // determine the p_is_32, j_is_32, and i_is_32 settings for the new + // matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, 1, A->vdim, B->vdim, Werk) ; + GBURBLE ("(empty dot) ") ; if (C_in != NULL) return (GrB_SUCCESS) ; return (GB_new (&C, // auto sparsity, existing header - ztype, A->vdim, B->vdim, GB_Ap_calloc, true, GxB_AUTO_SPARSITY, - GB_Global_hyper_switch_get ( ), 1)) ; + ztype, A->vdim, B->vdim, GB_ph_calloc, true, GxB_AUTO_SPARSITY, + GB_Global_hyper_switch_get ( ), 1, Cp_is_32, Cj_is_32, Ci_is_32)) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot2.c b/GraphBLAS/Source/mxm/GB_AxB_dot2.c index b60cd2d630..916064a211 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot2.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot2.c @@ -2,7 +2,7 @@ // GB_AxB_dot2: compute C<#M>=A'*B or C<#M>=A*B, where C is bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,6 @@ #include "mxm/GB_mxm.h" #include "extract/GB_subref.h" -#include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "jitifyer/GB_stringify.h" #include "mxm/GB_AxB__include1.h" @@ -72,7 +71,7 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M_in, "M for dot A'*B", GB0) ; ASSERT_MATRIX_OK (A_in, "A for dot A'*B", GB0) ; ASSERT_MATRIX_OK (B_in, "B for dot A'*B", GB0) ; @@ -125,13 +124,13 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method bool A_is_hyper = GB_IS_HYPERSPARSE (A_in) ; bool B_is_hyper = GB_IS_HYPERSPARSE (B_in) ; bool A_or_B_hyper = A_is_hyper || B_is_hyper ; - GrB_Index *restrict Ah = (GrB_Index *) A_in->h ; - GrB_Index *restrict Bh = (GrB_Index *) B_in->h ; + void *Ah = A_in->h ; + void *Bh = B_in->h ; if (A_is_hyper) { // A = hypershallow version of A_in - GB_CLEAR_STATIC_HEADER (Awork, &Awork_header) ; + GB_CLEAR_MATRIX_HEADER (Awork, &Awork_header) ; A = GB_hyper_shallow (Awork, A_in) ; } else @@ -143,7 +142,7 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method if (B_is_hyper) { // B = hypershallow version of B_in - GB_CLEAR_STATIC_HEADER (Bwork, &Bwork_header) ; + GB_CLEAR_MATRIX_HEADER (Bwork, &Bwork_header) ; B = GB_hyper_shallow (Bwork, B_in) ; } else @@ -167,7 +166,7 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method int64_t cvdim = B->vdim ; int64_t cnz ; - bool ok = GB_int64_multiply ((GrB_Index *) (&cnz), cvlen, cvdim) ; + bool ok = GB_int64_multiply ((uint64_t *) (&cnz), cvlen, cvdim) ; //-------------------------------------------------------------------------- // extract the submask if A or B are hypersparse @@ -177,10 +176,11 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method { // Mwork = M_in (Ah, Bh), where Mwork has a static header // if Mask_struct then Mwork is extracted as iso - GB_CLEAR_STATIC_HEADER (Mwork, &Mwork_header) ; + GB_CLEAR_MATRIX_HEADER (Mwork, &Mwork_header) ; GB_OK (GB_subref (Mwork, Mask_struct, M_in->is_csc, M_in, - (A_is_hyper) ? Ah : GrB_ALL, cvlen, - (B_is_hyper) ? Bh : GrB_ALL, cvdim, false, Werk)) ; + (A_is_hyper) ? Ah : GrB_ALL, A->j_is_32, cvlen, + (B_is_hyper) ? Bh : GrB_ALL, B->j_is_32, cvdim, + false, Werk)) ; M = Mwork ; ASSERT_MATRIX_OK_OR_NULL (M, "M submask dot A'*B", GB0) ; } @@ -296,8 +296,8 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, A->p, anvec, naslice, false) ; - GB_p_slice (B_slice, B->p, bnvec, nbslice, false) ; + GB_p_slice (A_slice, A->p, A->p_is_32, anvec, naslice, false) ; + GB_p_slice (B_slice, B->p, B->p_is_32, bnvec, nbslice, false) ; //-------------------------------------------------------------------------- // allocate C @@ -322,24 +322,17 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method else if (A_is_full && B_is_sparse) { // C = A*B or A'*B, where A is full and B sparse - if (B->nvec_nonempty < 0) - { - B->nvec_nonempty = GB_nvec_nonempty (B) ; - } + int64_t B_nvec_nonempty = GB_nvec_nonempty_update (B) ; // C is full if all vectors of B are present - C_sparsity = (B->nvec_nonempty == B->vdim) ? + C_sparsity = (B_nvec_nonempty == B->vdim) ? GxB_FULL : GxB_BITMAP ; } else if (A_is_sparse && B_is_full) { // C = A'*B, where A is sparse and B is full - if (A->nvec_nonempty < 0) - { - // A->nvec_nonempty is used to select the method - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + int64_t A_nvec_nonempty = GB_nvec_nonempty_update (A) ; // C is full if all vectors of A are present - C_sparsity = (A->nvec_nonempty == A->vdim) ? + C_sparsity = (A_nvec_nonempty == A->vdim) ? GxB_FULL : GxB_BITMAP ; } } @@ -365,10 +358,15 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method GB_sparsity_char_matrix (B_in)) ; } - // set C->iso = C_iso + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + C_sparsity, cnz, cvlen, cvdim, Werk) ; + GB_OK (GB_new_bix (&C, // bitmap/full, existing header - ctype, cvlen, cvdim, GB_Ap_malloc, true, C_sparsity, - M_is_sparse_or_hyper, B->hyper_switch, cnvec, cnz, true, C_iso)) ; + ctype, cvlen, cvdim, GB_ph_malloc, true, C_sparsity, + M_is_sparse_or_hyper, B->hyper_switch, cnvec, cnz, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32)) ; //-------------------------------------------------------------------------- // if M is sparse/hyper, scatter it into the C bitmap @@ -495,12 +493,7 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method } } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //-------------------------------------------------------------------------- // free workspace @@ -529,7 +522,7 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method ASSERT (GB_ZOMBIES_OK (C)) ; ASSERT (!GB_JUMBLED (C)) ; ASSERT (!GB_PENDING (C)) ; - ASSERT (C->nvec_nonempty >= 0) ; + ASSERT (GB_nvec_nonempty_get (C) >= 0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot2_control.c b/GraphBLAS/Source/mxm/GB_AxB_dot2_control.c index 0ec921de87..3cc805c548 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot2_control.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot2_control.c @@ -2,7 +2,7 @@ // GB_AxB_dot2_control.c: determine when to use GB_AxB_dot2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,19 +40,9 @@ bool GB_AxB_dot2_control // true: use dot2, false: use saxpy double anz = GB_nnz (A) ; // # of entries in A double bnz = GB_nnz (B) ; // # of entries in B - if (A->nvec_nonempty < 0) - { - // A->nvec_nonempty is used to select the method - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } - if (B->nvec_nonempty < 0) - { - // B->nvec_nonempty is used to select the method - B->nvec_nonempty = GB_nvec_nonempty (B) ; - } - - double anvec = A->nvec_nonempty ; - double bnvec = B->nvec_nonempty ; + // A->nvec_nonempty and B->nvec_nonempty are used to select the method + double anvec = GB_nvec_nonempty_update (A) ; + double bnvec = GB_nvec_nonempty_update (B) ; double avlen = A->vlen ; ASSERT (avlen == B->vlen) ; double cnz = (anvec * bnvec) ; // size of the C bitmap diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot3.c b/GraphBLAS/Source/mxm/GB_AxB_dot3.c index f81bf7da11..ae39382062 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot3.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot3.c @@ -2,7 +2,7 @@ // GB_AxB_dot3: compute C = A'*B in parallel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,11 +20,11 @@ #include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif -#include "include/GB_unused.h" #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&Cwork, Cwork_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } #define GB_FREE_ALL \ @@ -53,7 +53,7 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (M, "M for dot3 A'*B", GB0) ; ASSERT_MATRIX_OK (A, "A for dot3 A'*B", GB0) ; @@ -76,6 +76,7 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method int ntasks, nthreads ; GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; + float *Cwork = NULL ; size_t Cwork_size = 0 ; //-------------------------------------------------------------------------- // get the semiring operators @@ -116,9 +117,8 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method // get M, A, and B //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; const size_t msize = M->type->size ; const int64_t mvlen = M->vlen ; @@ -127,32 +127,38 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method const int64_t mnvec = M->nvec ; const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_sparse = GB_IS_SPARSE (M) ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + void *Ah = A->h ; const int64_t vlen = A->vlen ; const int64_t anvec = A->nvec ; const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_is_bitmap = GB_IS_BITMAP (A) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + void *Bh = B->h ; const int64_t bnvec = B->nvec ; const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; const bool B_is_sparse = GB_IS_SPARSE (B) ; const bool B_is_bitmap = GB_IS_BITMAP (B) ; + const bool Bp_is_32 = B->p_is_32 ; + const bool Bj_is_32 = B->j_is_32 ; ASSERT (A->vlen == B->vlen) ; ASSERT (vlen > 0) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - const int64_t *restrict B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *restrict B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *restrict B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; + const void *B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; + const void *B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; + const void *B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; //-------------------------------------------------------------------------- @@ -166,17 +172,35 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method int64_t cnvec = mnvec ; int C_sparsity = (M_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE ; + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + C_sparsity, cnz, cvlen, cvdim, Werk) ; + // C is sparse or hypersparse, not full or bitmap - // set C->iso = C_iso OK - GB_OK (GB_new_bix (&C, // sparse or hyper (from M), existing header - ctype, cvlen, cvdim, GB_Ap_malloc, true, - C_sparsity, true, M->hyper_switch, cnvec, - cnz+1, // add one to cnz for GB_cumsum of Cwork in GB_AxB_dot3_slice - true, C_iso)) ; + GB_OK (GB_new (&C, // sparse or hyper (from M), existing header + ctype, cvlen, cvdim, GB_ph_malloc, true, + C_sparsity, M->hyper_switch, cnvec, + Cp_is_32, Cj_is_32, Ci_is_32)) ; + + GB_Ch_DECLARE (Ch, ) ; GB_Ch_PTR (Ch, C) ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; - int64_t *restrict Cwork = C->i ; // use C->i as workspace + // C->i and C->x are allocated later + + //-------------------------------------------------------------------------- + // allocate workspace + //-------------------------------------------------------------------------- + + // This workspace is large, of size cnz+1, so the logic below may allow it + // to be resused as C->i and C->x, which have not yet been allocated. + + Cwork = GB_MALLOC_MEMORY (cnz+1, sizeof (float), &Cwork_size) ; + if (Cwork == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } //-------------------------------------------------------------------------- // determine the # of threads to use @@ -192,13 +216,23 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method // M is sparse or hypersparse; C is the same as M nthreads = GB_nthreads (cnvec, chunk, nthreads_max) ; - // TODO: try this with Cp and Ch shallow - GB_memcpy (Cp, Mp, (cnvec+1) * sizeof (int64_t), nthreads) ; + GB_Type_code cpcode = (Cp_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code cjcode = (Cj_is_32) ? GB_UINT32_code : GB_UINT64_code ; + + GB_Type_code mpcode = (Mp_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code mjcode = (Mj_is_32) ? GB_UINT32_code : GB_UINT64_code ; + + // TODO: if integer types of Cp,Ch match Mp,Mh then they could be shallow +// GB_memcpy (Cp, Mp, (cnvec+1) * sizeof (int64_t), nthreads) ; + GB_cast_int (C->p, cpcode, Mp, mpcode, cnvec+1, nthreads) ; + if (M_is_hyper) { - GB_memcpy (Ch, Mh, cnvec * sizeof (int64_t), nthreads) ; +// GB_memcpy (Ch, Mh, cnvec * sizeof (int64_t), nthreads) ; + GB_cast_int (Ch, cjcode, M->h, mjcode, cnvec, nthreads) ; } - C->nvec_nonempty = M->nvec_nonempty ; +// C->nvec_nonempty = M->nvec_nonempty ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty_get (M)) ; C->nvec = M->nvec ; C->nvals = M->nvals ; C->magic = GB_MAGIC ; @@ -244,14 +278,59 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method // free the current tasks and construct the tasks for the second phase //-------------------------------------------------------------------------- - GB_FREE_WORK (&TaskList, TaskList_size) ; + GB_FREE_MEMORY (&TaskList, TaskList_size) ; GB_OK (GB_AxB_dot3_slice (&TaskList, &TaskList_size, &ntasks, &nthreads, - C, Werk)) ; + C, Cwork, cnz, Werk)) ; GBURBLE ("nthreads %d ntasks %d ", nthreads, ntasks) ; //-------------------------------------------------------------------------- - // C = A'*B, via masked dot product method and built-in semiring + // free workspace and allocate C->i and C->x + //-------------------------------------------------------------------------- + + size_t cisize = (Ci_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + + if (sizeof (float) == sizeof (uint32_t) && Ci_is_32) + { + // transplant Cwork as C->i, and allocate just C->x + C->i = (void *) Cwork ; + C->i_size = Cwork_size ; + Cwork = NULL ; + Cwork_size = 0 ; + C->x = GB_XALLOC_MEMORY (false, C_iso, cnz+1, C->type->size, + &(C->x_size)) ; + } + else if (sizeof (float) == C->type->size && !C_iso) + { + // transplant Cwork as C->x, and allocate just C->i + C->i = GB_MALLOC_MEMORY (cnz+1, cisize, &(C->i_size)) ; + C->x = (void *) Cwork ; + C->x_size = Cwork_size ; + Cwork = NULL ; + Cwork_size = 0 ; + } + else + { + // otherwise, free Cwork and allocate both C->i and C->x + GB_FREE_MEMORY (&Cwork, Cwork_size) ; + C->i = GB_MALLOC_MEMORY (cnz+1, cisize, &(C->i_size)) ; + C->x = GB_XALLOC_MEMORY (false, C_iso, cnz+1, C->type->size, + &(C->x_size)) ; + } + + // Cwork has either been transplanted into C as C->i or C->x, or it has + // been freed. + ASSERT (Cwork == NULL) ; + + if (C->i == NULL || C->x == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + + //-------------------------------------------------------------------------- + // phase2: C = A'*B, via masked dot product method and built-in semiring //-------------------------------------------------------------------------- if (C_iso) @@ -335,12 +414,7 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method } } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //-------------------------------------------------------------------------- // free workspace and return result diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot3_one_slice.c b/GraphBLAS/Source/mxm/GB_AxB_dot3_one_slice.c index 9673fdc749..969b960c02 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot3_one_slice.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot3_one_slice.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_one_slice: slice the entries and vectors of a single matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } #include "mxm/GB_mxm.h" @@ -78,10 +78,11 @@ GrB_Info GB_AxB_dot3_one_slice // get M //-------------------------------------------------------------------------- - const int64_t *restrict Mp = M->p ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; const int64_t mnz = GB_nnz_held (M) ; const int64_t mnvec = M->nvec ; const int64_t mvlen = M->vlen ; + const bool Mp_is_32 = M->p_is_32 ; //-------------------------------------------------------------------------- // allocate the initial TaskList @@ -132,7 +133,7 @@ GrB_Info GB_AxB_dot3_one_slice GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Mp, mnvec, ntasks1, false) ; + GB_p_slice (Coarse, Mp, Mp_is_32, mnvec, ntasks1, false) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine @@ -204,7 +205,8 @@ GrB_Info GB_AxB_dot3_one_slice // determine the # of fine-grain tasks to create for vector k //------------------------------------------------------------------ - int64_t mknz = (Mp == NULL) ? mvlen : (Mp [k+1] - Mp [k]) ; + int64_t mknz = (Mp == NULL) ? mvlen : + (GB_IGET (Mp, k+1) - GB_IGET (Mp, k)) ; int nfine = ((double) mknz) / target_task_size ; nfine = GB_IMAX (nfine, 1) ; @@ -246,7 +248,7 @@ GrB_Info GB_AxB_dot3_one_slice // slice M(:,k) for this task int64_t p1, p2 ; GB_PARTITION (p1, p2, mknz, tfine, nfine) ; - int64_t pM_start = GBP (Mp, k, mvlen) ; + int64_t pM_start = GB_IGET (Mp, k) ; int64_t pM = pM_start + p1 ; int64_t pM_end = pM_start + p2 ; TaskList [ntasks].pM = pM ; diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot3_slice.c b/GraphBLAS/Source/mxm/GB_AxB_dot3_slice.c index 2683e1c590..d3f6a1cca3 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot3_slice.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot3_slice.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_slice: slice the entries and vectors for C=A'*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,7 +31,7 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } #include "mxm/GB_mxm.h" @@ -49,7 +49,9 @@ GrB_Info GB_AxB_dot3_slice int *p_ntasks, // # of tasks constructed int *p_nthreads, // # of threads to use // input: - const GrB_Matrix C, // matrix to slice + const GrB_Matrix C, // matrix to slice (only C->p, C->h present) + float *Cwork, // workspace of size cnz+1 + int64_t cnz, // # entries that will appear in C GB_Werk Werk ) { @@ -62,13 +64,6 @@ GrB_Info GB_AxB_dot3_slice ASSERT (p_TaskList_size != NULL) ; ASSERT (p_ntasks != NULL) ; ASSERT (p_nthreads != NULL) ; - // ASSERT_MATRIX_OK (C, ...) cannot be done since C->i is the work need to - // compute the entry, not the row index itself. - - // C is always constructed as sparse or hypersparse, not full, since it - // must accomodate zombies - ASSERT (!GB_IS_FULL (C)) ; - ASSERT (!GB_IS_BITMAP (C)) ; (*p_TaskList ) = NULL ; (*p_TaskList_size) = 0 ; @@ -86,20 +81,18 @@ GrB_Info GB_AxB_dot3_slice // get C //-------------------------------------------------------------------------- - const int64_t *restrict Cp = C->p ; - int64_t *restrict Cwork = C->i ; + const void *Cp = C->p ; + bool Cp_is_32 = C->p_is_32 ; + const int64_t cnvec = C->nvec ; const int64_t cvlen = C->vlen ; - const int64_t cnz = GB_nnz_held (C) ; //-------------------------------------------------------------------------- // compute the cumulative sum of the work //-------------------------------------------------------------------------- - // FUTURE:: handle possible int64_t overflow - int nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; - GB_cumsum (Cwork, cnz, NULL, nthreads, Werk) ; + GB_cumsum_float (Cwork, cnz, nthreads, Werk) ; double total_work = (double) Cwork [cnz] ; //-------------------------------------------------------------------------- @@ -154,7 +147,7 @@ GrB_Info GB_AxB_dot3_slice GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Cwork, cnz, ntasks1, false) ; + GB_p_slice_float (Coarse, Cwork, cnz, ntasks1) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine @@ -174,13 +167,13 @@ GrB_Info GB_AxB_dot3_slice { // find the first vector of the slice for task taskid: the // vector that owns the entry Ci [pfirst] and Cx [pfirst]. - int64_t kfirst = GB_search_for_vector (pfirst, Cp, 0, cnvec, - cvlen) ; + int64_t kfirst = GB_search_for_vector (Cp, Cp_is_32, pfirst, 0, + cnvec, cvlen) ; // find the last vector of the slice for task taskid: the // vector that owns the entry Ci [plast] and Cx [plast]. - int64_t klast = GB_search_for_vector (plast, Cp, kfirst, cnvec, - cvlen) ; + int64_t klast = GB_search_for_vector (Cp, Cp_is_32, plast, + kfirst, cnvec, cvlen) ; // construct a coarse task that computes Ci,Cx [pfirst:plast]. // These entries appear in C(:,kfirst:klast), but this task does diff --git a/GraphBLAS/Source/mxm/GB_AxB_dot4.c b/GraphBLAS/Source/mxm/GB_AxB_dot4.c index 97a2efaa9a..ba31a7d7a7 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_dot4.c +++ b/GraphBLAS/Source/mxm/GB_AxB_dot4.c @@ -2,7 +2,7 @@ // GB_AxB_dot4: compute C+=A'*B in-place //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,6 @@ #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" @@ -86,9 +85,8 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method //-------------------------------------------------------------------------- GrB_BinaryOp mult = semiring->multiply ; - GrB_Monoid add = semiring->add ; - ASSERT (mult->ztype == add->op->ztype) ; - ASSERT (C->type == add->op->ztype) ; + ASSERT (mult->ztype == semiring->add->op->ztype) ; + ASSERT (C->type == semiring->add->op->ztype) ; bool op_is_first = mult->opcode == GB_FIRST_binop_code ; bool op_is_second = mult->opcode == GB_SECOND_binop_code ; @@ -154,7 +152,6 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method // C is always as-if-full. int64_t anvec = A->nvec ; - int64_t vlen = A->vlen ; int64_t bnvec = B->nvec ; int naslice, nbslice ; @@ -205,8 +202,8 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method GB_FREE_WORKSPACE ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, A->p, anvec, naslice, false) ; - GB_p_slice (B_slice, B->p, bnvec, nbslice, false) ; + GB_p_slice (A_slice, A->p, A->p_is_32, anvec, naslice, false) ; + GB_p_slice (B_slice, B->p, B->p_is_32, bnvec, nbslice, false) ; //-------------------------------------------------------------------------- // convert C to non-iso @@ -249,7 +246,10 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method // disabled the ANY monoid #define GB_NO_ANY_MONOID - #include "mxm/factory/GB_AxB_factory.c" + if (builtin_semiring) + { + #include "mxm/factory/GB_AxB_factory.c" + } } #endif diff --git a/GraphBLAS/Source/mxm/GB_AxB_iso.c b/GraphBLAS/Source/mxm/GB_AxB_iso.c index 47d14cdc52..9770f2af6b 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_iso.c +++ b/GraphBLAS/Source/mxm/GB_AxB_iso.c @@ -2,7 +2,7 @@ // GB_AxB_iso: check for iso result for C=A*B and compute the iso scalar for C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -146,8 +146,6 @@ bool GB_AxB_iso // C = A*B, return true if C is iso if (xcode == GB_BOOL_code) { // rename a boolean multiply op: - // DIV becomes FIRST, RDIV becomes SECOND; all other renaming has no - // effect on this method. mult_binop_code = GB_boolean_rename (mult_binop_code) ; } diff --git a/GraphBLAS/Source/mxm/GB_AxB_meta.c b/GraphBLAS/Source/mxm/GB_AxB_meta.c index 133effe227..58c3567c35 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_meta.c +++ b/GraphBLAS/Source/mxm/GB_AxB_meta.c @@ -2,7 +2,7 @@ // GB_AxB_meta: C=A*B meta algorithm //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -58,7 +58,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, mask was applied bool *done_in_place, // if true, C was computed in-place - GrB_Desc_Value AxB_method, // for auto vs user selection of methods + int AxB_method, // for auto vs user selection of methods const int do_sort, // if nonzero, try to return C unjumbled GB_Werk Werk ) @@ -88,8 +88,8 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm ASSERT_SEMIRING_OK (semiring_in, "semiring_in for numeric A*B", GB0) ; ASSERT (mask_applied != NULL) ; - ASSERT (C != NULL && ( C->static_header || GBNSTATIC)) ; - ASSERT (MT != NULL && (MT->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && ( C->header_size == 0 || GBNSTATIC)) ; + ASSERT (MT != NULL && (MT->header_size == 0 || GBNSTATIC)) ; //-------------------------------------------------------------------------- // declare workspace @@ -116,8 +116,8 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm (op_is_first || op_is_second)) || GB_IS_INDEXBINARYOP_CODE (opcode)) { // GB_rowscale and GB_colscale do not handle the implicit FIRST - // operator for GB_reduce_to_vector (where all function pointers are - // NULL). They do handle builtin index binary operator (FIRSTI, + // operator for GB_reduce_to_vector, where all function pointers are + // NULL. They do handle builtin index binary operator (FIRSTI, // FIRSTJ, SECONDI, SECONDJ, etc), by converting the operation into // GB_apply_op with a built-in unary POSITION* op. They do not handle // any user-defined index binary operators. @@ -584,7 +584,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm // This is currently unused, since C=A'*B' and C'=A'*B' are always // converted to C=(B*A)' and C=B*A, respectively. It is left here // in case the swap_rule changes. - GB_CLEAR_STATIC_HEADER (BT, &BT_header) ; + GB_CLEAR_MATRIX_HEADER (BT, &BT_header) ; GB_OK (GB_transpose_cast (BT, btype_cast, true, B, B_is_pattern, Werk)) ; B = BT ; @@ -605,7 +605,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm if (axb_method == GB_USE_COLSCALE || axb_method == GB_USE_SAXPY) { // AT = A', or AT=one(A') if only the pattern is needed. - GB_CLEAR_STATIC_HEADER (AT, &AT_header) ; + GB_CLEAR_MATRIX_HEADER (AT, &AT_header) ; GB_OK (GB_transpose_cast (AT, atype_cast, true, A, A_is_pattern, Werk)) ; // do not use colscale if AT is now bitmap @@ -686,7 +686,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm if (axb_method != GB_USE_COLSCALE) { // BT = B', or BT=one(B') if only the pattern of B is needed - GB_CLEAR_STATIC_HEADER (BT, &BT_header) ; + GB_CLEAR_MATRIX_HEADER (BT, &BT_header) ; GB_OK (GB_transpose_cast (BT, btype_cast, true, B, B_is_pattern, Werk)) ; // do not use rowscale if BT is now bitmap @@ -718,7 +718,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm // C=A*B' via dot product, or C_in+=A*B' if in-place GBURBLE ("C%s=A*B', dot_product (transposed %s) " "(transposed %s) ", M_str, A_str, B_str) ; - GB_CLEAR_STATIC_HEADER (AT, &AT_header) ; + GB_CLEAR_MATRIX_HEADER (AT, &AT_header) ; GB_OK (GB_transpose_cast (AT, atype_cast, true, A, A_is_pattern, Werk)) ; GB_OK (GB_AxB_dot (C, can_do_in_place ? C_in : NULL, M, @@ -822,7 +822,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm // C=A*B via dot product, or C_in+=A*B if in-place. GBURBLE ("C%s=A*B', dot_product (transposed %s) ", M_str, A_str) ; - GB_CLEAR_STATIC_HEADER (AT, &AT_header) ; + GB_CLEAR_MATRIX_HEADER (AT, &AT_header) ; GB_OK (GB_transpose_cast (AT, atype_cast, true, A, A_is_pattern, Werk)) ; GB_OK (GB_AxB_dot (C, can_do_in_place ? C_in : NULL, M, diff --git a/GraphBLAS/Source/mxm/GB_AxB_meta_adotb_control.c b/GraphBLAS/Source/mxm/GB_AxB_meta_adotb_control.c index 51c1f5fca1..9064f75f7a 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_meta_adotb_control.c +++ b/GraphBLAS/Source/mxm/GB_AxB_meta_adotb_control.c @@ -2,7 +2,7 @@ // GB_AxB_meta_adotb_control: determine method for computing C=A'*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ void GB_AxB_meta_adotb_control bool can_do_in_place, bool allow_scale, bool B_is_diagonal, - GrB_Desc_Value AxB_method + int AxB_method ) { diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit.c index 14986c6894..c765b61a2d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit.c @@ -2,15 +2,15 @@ // GB_AxB_saxbit: compute C=A*B, C=A*B, or C=A*B; C bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&Wf, Wf_size) ; \ - GB_FREE_WORK (&Wcx, Wcx_size) ; \ + GB_FREE_MEMORY (&Wf, Wf_size) ; \ + GB_FREE_MEMORY (&Wcx, Wcx_size) ; \ GB_WERK_POP (H_slice, int64_t) ; \ GB_WERK_POP (A_slice, int64_t) ; \ GB_WERK_POP (M_ek_slicing, int64_t) ; \ @@ -23,11 +23,9 @@ } #include "mxm/GB_mxm.h" -#include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #include "mxm/GB_AxB_saxpy.h" #include "binaryop/GB_binop.h" -#include "slice/GB_ek_slice.h" #include "mxm/GB_AxB_saxpy_generic.h" #include "mxm/GB_AxB__include1.h" #ifndef GBCOMPACT @@ -64,7 +62,7 @@ GrB_Info GB_AxB_saxbit // C = A*B where C is bitmap GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for bitmap saxpy A*B", GB0) ; ASSERT (!GB_PENDING (M)) ; @@ -118,11 +116,11 @@ GrB_Info GB_AxB_saxbit // C = A*B where C is bitmap GrB_Type ctype = semiring->add->op->ztype ; int64_t cnzmax = 1 ; - (void) GB_int64_multiply ((GrB_Index *) (&cnzmax), A->vlen, B->vdim) ; - // set C->iso = C_iso OK + (void) GB_int64_multiply ((uint64_t *) (&cnzmax), A->vlen, B->vdim) ; GB_OK (GB_new_bix (&C, // existing header - ctype, A->vlen, B->vdim, GB_Ap_null, true, GxB_BITMAP, true, - GB_HYPER_SWITCH_DEFAULT, -1, cnzmax, true, C_iso)) ; + ctype, A->vlen, B->vdim, GB_ph_null, true, GxB_BITMAP, true, + GB_HYPER_SWITCH_DEFAULT, -1, cnzmax, true, C_iso, + /* OK: */ false, false, false)) ; C->magic = GB_MAGIC ; //-------------------------------------------------------------------------- @@ -140,7 +138,7 @@ GrB_Info GB_AxB_saxbit // C = A*B where C is bitmap if (M != NULL) { - GB_SLICE_MATRIX (M, 8) ; + GB_SLICE_MATRIX2 (M, 8) ; } //-------------------------------------------------------------------------- @@ -167,7 +165,8 @@ GrB_Info GB_AxB_saxbit // C = A*B where C is bitmap GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, A->p, A->nvec, nfine_tasks_per_vector, true) ; + GB_p_slice (A_slice, A->p, A->p_is_32, A->nvec, + nfine_tasks_per_vector, true) ; } //---------------------------------------------------------------------- @@ -229,8 +228,8 @@ GrB_Info GB_AxB_saxbit // C = A*B where C is bitmap //------------------------------------------------------------------ size_t csize = (C_iso) ? 0 : C->type->size ; - Wf = GB_MALLOC_WORK (wspace, int8_t, &Wf_size) ; - Wcx = GB_MALLOC_WORK (wspace * csize, GB_void, &Wcx_size) ; + Wf = GB_MALLOC_MEMORY (wspace, sizeof (int8_t), &Wf_size) ; + Wcx = GB_MALLOC_MEMORY (wspace, csize, &Wcx_size) ; if (Wf == NULL || Wcx == NULL) { // out of memory diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_first.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_first.c index 8ae91b954b..221cd77f5d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_first.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_first.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_first.c: C=A*B, C bitmap/full, FIRST multiplier //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_flipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_flipped.c index 002a60b693..865edf4543 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_flipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_flipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_flipped.c: C=A*B, C bitmap/full, flipped mult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c index 0706ded70d..1117a556ec 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_idx_flipped.c: C=A*B, C bitmap/full, flipped idx mult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c index 34c4c8a780..d1ecb4df3d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_idx_unflipped.c: C=A*B, C bitmap/full, unflipped idx //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_second.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_second.c index 13579f2293..f8fe9884ce 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_second.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_second.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_second.c: C=A*B, C bitmap/full, SECOND mult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_unflipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_unflipped.c index 1212f19a28..252011ebdb 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_unflipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxbit_generic_unflipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_generic_unflipped.c: C=A*B, C bitmap/full, unflipped mult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy.c index fa3c3f012d..e339191c03 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy: compute C=A*B, C=A*B, or C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,8 @@ // TODO: allow bitmap multiply to work in-place as well +#define GB_FREE_ALL ; + GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap ( GrB_Matrix C, // output, static header @@ -27,7 +29,7 @@ GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, then mask was applied bool *done_in_place, // if true, C was computed in-place - const GrB_Desc_Value AxB_method, + const int AxB_method, const int do_sort, // if nonzero, try to sort in saxpy3 GB_Werk Werk ) @@ -39,7 +41,7 @@ GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap GrB_Info info ; (*mask_applied) = false ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for saxpy A*B", GB0) ; ASSERT (!GB_PENDING (M)) ; @@ -180,8 +182,9 @@ GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap ASSERT (C_sparsity == GxB_FULL) ; // set C->iso = true OK info = GB_new_bix (&C, // existing header - ztype, A->vlen, B->vdim, GB_Ap_null, true, GxB_FULL, false, - GB_HYPER_SWITCH_DEFAULT, -1, 1, true, true) ; + ztype, A->vlen, B->vdim, GB_ph_null, true, GxB_FULL, false, + GB_HYPER_SWITCH_DEFAULT, -1, 1, true, true, + /* OK: */ false, false, false) ; if (info == GrB_SUCCESS) { C->magic = GB_MAGIC ; @@ -239,13 +242,14 @@ GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap { // C<#M> = A*B via dot products, where A is bitmap or full and B is // sparse or hypersparse, using the dot2 method with A not - // explicitly transposed. + // explicitly transposed. A and B must not be jumbled. + GB_MATRIX_WAIT (A) ; + GB_MATRIX_WAIT (B) ; info = GB_AxB_dot2 (C, C_iso, cscalar, M, Mask_comp, Mask_struct, true, A, B, semiring, flipxy, Werk) ; } else { - // C<#M> = A*B via bitmap saxpy method info = GB_AxB_saxbit (C, C_iso, cscalar, M, Mask_comp, Mask_struct, A, B, semiring, flipxy, Werk) ; diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy.h b/GraphBLAS/Source/mxm/GB_AxB_saxpy.h index 50e37f6a31..e9c169d80e 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy.h +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy.h @@ -2,7 +2,7 @@ // GB_AxB_saxpy.h: definitions for GB_AxB_saxpy and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,7 +31,7 @@ GrB_Info GB_AxB_saxpy // C = A*B using Gustavson/Hash/Bitmap const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, then mask was applied bool *done_in_place, // if true, C was computed in-place - const GrB_Desc_Value AxB_method, + const int AxB_method, const int do_sort, // if nonzero, try to sort in saxpy3 GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3.c index 0ef8434228..c949b4a513 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3: compute C=A*B, C=A*B, or C=A*B in parallel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -63,11 +63,11 @@ // table size for the task, and C is m-by-n (assuming all matrices are CSC; if // CSR, then m is replaced with n). // -// fine Gustavson task (shared): int8_t Hf [m] ; ctype Hx [m] ; -// fine hash task (shared): int64_t Hf [s] ; ctype Hx [s] ; -// coarse Gustavson task: int64_t Hf [m] ; ctype Hx [m] ; -// coarse hash task: int64_t Hf [s] ; ctype Hx [s] ; -// int64_t Hi [s] ; +// fine Gustavson task (shared): int8_t Hf [m] ; ctype Hx [m] ; +// fine hash task (shared): uint64_t Hf [s] ; ctype Hx [s] ; +// coarse Gustavson task: uint64_t Hf [m] ; ctype Hx [m] ; +// coarse hash task: uint64_t Hf [s] ; ctype Hx [s] ; +// uint64_t Hi [s] ; // // Note that the Hi array is needed only for the coarse hash task. Additional // workspace is allocated to construct the list of tasks, but this is freed @@ -95,14 +95,13 @@ #include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif -#include "include/GB_unused.h" #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&SaxpyTasks, SaxpyTasks_size) ; \ - GB_FREE_WORK (&Hi_all, Hi_all_size) ; \ - GB_FREE_WORK (&Hf_all, Hf_all_size) ; \ - GB_FREE_WORK (&Hx_all, Hx_all_size) ; \ + GB_FREE_MEMORY (&SaxpyTasks, SaxpyTasks_size) ; \ + GB_FREE_MEMORY (&Hi_all, Hi_all_size) ; \ + GB_FREE_MEMORY (&Hf_all, Hf_all_size) ; \ + GB_FREE_MEMORY (&Hx_all, Hx_all_size) ; \ } #define GB_FREE_ALL \ @@ -129,7 +128,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash const GrB_Semiring semiring, // semiring that defines C=A*B const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, then mask was applied - GrB_Desc_Value AxB_method, // Default, Gustavson, or Hash + int AxB_method, // Default, Gustavson, or Hash const int do_sort, // if nonzero, try to sort in saxpy3 GB_Werk Werk ) @@ -147,7 +146,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash (*mask_applied) = false ; bool apply_mask = false ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for saxpy3 A*B", GB0) ; ASSERT (!GB_PENDING (M)) ; @@ -180,9 +179,9 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash // define workspace //-------------------------------------------------------------------------- - int64_t *restrict Hi_all = NULL ; size_t Hi_all_size = 0 ; - int64_t *restrict Hf_all = NULL ; size_t Hf_all_size = 0 ; - GB_void *restrict Hx_all = NULL ; size_t Hx_all_size = 0 ; + uint64_t *restrict Hi_all = NULL ; size_t Hi_all_size = 0 ; + uint64_t *restrict Hf_all = NULL ; size_t Hf_all_size = 0 ; + GB_void *restrict Hx_all = NULL ; size_t Hx_all_size = 0 ; GB_saxpy3task_struct *SaxpyTasks = NULL ; size_t SaxpyTasks_size = 0 ; //-------------------------------------------------------------------------- @@ -208,57 +207,40 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash B_is_pattern, semiring, flipxy, &mult_binop_code, &add_binop_code, &xcode, &ycode, &zcode) ; - //-------------------------------------------------------------------------- - // get A, and B - //-------------------------------------------------------------------------- - - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t avlen = A->vlen ; - const int64_t anvec = A->nvec ; - const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; - const int64_t bvdim = B->vdim ; - const int64_t bnz = GB_nnz_held (B) ; - const int64_t bnvec = B->nvec ; - const int64_t bvlen = B->vlen ; - const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; - //-------------------------------------------------------------------------- // allocate C (just C->p and C->h, but not C->i or C->x) //-------------------------------------------------------------------------- GrB_Type ctype = add->op->ztype ; size_t csize = ctype->size ; - int64_t cvlen = avlen ; - int64_t cvdim = bvdim ; - int64_t cnvec = bnvec ; - - info = GB_new (&C, // sparse or hyper, existing header - ctype, cvlen, cvdim, GB_Ap_malloc, true, - C_sparsity, B->hyper_switch, cnvec) ; - if (info != GrB_SUCCESS) - { - // out of memory - GB_FREE_ALL ; - return (info) ; - } + int64_t cvlen = A->vlen ; + int64_t cvdim = B->vdim ; + int64_t cnvec = B->nvec ; + + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix; + // select Cp_is_32 by assuming any given column could see arbitrary fillin, + // where nnz(C(:,j)) <= cvlen. Later on, Cp may need to be resized by + // GB_AxB_saxpy3_cumsum if nnz(C) > UINT32_MAX. + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + C_sparsity, cvlen, cvlen, cvdim, Werk) ; + + GB_OK (GB_new (&C, // sparse or hyper, existing header + ctype, cvlen, cvdim, GB_ph_malloc, true, + C_sparsity, B->hyper_switch, cnvec, Cp_is_32, Cj_is_32, Ci_is_32)) ; + + C->iso = C_iso ; - C->iso = C_iso ; // OK + GB_Type_code cjcode = (Cj_is_32 ) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code bjcode = (B->j_is_32) ? GB_UINT32_code : GB_UINT64_code ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; - if (B_is_hyper) + if (GB_IS_HYPERSPARSE (B)) { // B and C are both hypersparse ASSERT (C_sparsity == GxB_HYPERSPARSE) ; int nth = GB_nthreads (cnvec, chunk, nthreads_max) ; - GB_memcpy (Ch, Bh, cnvec * sizeof (int64_t), nth) ; - C->nvec = bnvec ; + GB_cast_int (C->h, cjcode, B->h, bjcode, cnvec, nth) ; + C->nvec = B->nvec ; } else { @@ -336,7 +318,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash // Hx [i] is the value of C(i,j) during the numeric phase. // // Gustavson's method is used if the hash_size for the Hash method - // is a significant fraction of cvlen. + // is a significant fraction of cvlen. // // If the Hash method is used (coarse tasks): // @@ -374,7 +356,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash if (taskid == SaxpyTasks [taskid].leader) { hx_pad = GB_ICEIL (64, csize) ; - hi_pad = 64 / sizeof (int64_t) ; + hi_pad = 64 / sizeof (uint64_t) ; break ; } } @@ -390,14 +372,13 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash int nfine_hash = 0 ; int nfine_gus = 0 ; int ncoarse_hash = 0 ; - int ncoarse_1hash = 0 ; int ncoarse_gus = 0 ; for (int taskid = 0 ; taskid < ntasks ; taskid++) { // get the task type and its hash size - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; int64_t k = SaxpyTasks [taskid].vector ; bool is_fine = (k >= 0) ; bool use_Gustavson = (hash_size == cvlen) ; @@ -438,8 +419,8 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash continue ; } - int64_t hi_size = GB_IMAX (hash_size, 8) ; - int64_t hx_size = hi_size ; + uint64_t hi_size = GB_IMAX (hash_size, 8) ; + uint64_t hx_size = hi_size ; if (!GB_IS_POWER_OF_TWO (hi_size)) { hi_size += hi_pad ; @@ -448,13 +429,13 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash if (is_fine && use_Gustavson) { // Hf is int8_t for the fine Gustavson tasks, but round up - // to the nearest number of int64_t values. - int64_t hi_size2 = GB_IMAX (hi_size, 64) ; - Hf_size_total += GB_ICEIL (hi_size2, sizeof (int64_t)) ; + // to the nearest number of uint64_t values. + uint64_t hi_size2 = GB_IMAX (hi_size, 64) ; + Hf_size_total += GB_ICEIL (hi_size2, sizeof (uint64_t)) ; } else { - // Hf is int64_t for all other methods + // Hf is uint64_t for all other methods Hf_size_total += hi_size ; } if (!is_fine && !use_Gustavson) @@ -483,20 +464,22 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash if (Hi_size_total > 0) { - Hi_all = GB_MALLOC_WORK (Hi_size_total, int64_t, &Hi_all_size) ; + Hi_all = GB_MALLOC_MEMORY (Hi_size_total, sizeof (uint64_t), + &Hi_all_size) ; } if (Hf_size_total > 0) { - // Hf must be calloc'd to initialize all entries as empty - Hf_all = GB_CALLOC_WORK (Hf_size_total, int64_t, &Hf_all_size) ; + // Hf must be calloc'd to initialize all entries as empty + Hf_all = GB_CALLOC_MEMORY (Hf_size_total, sizeof (uint64_t), + &Hf_all_size) ; } if (Hx_size_total > 0) { - Hx_all = GB_MALLOC_WORK (Hx_size_total * csize, GB_void, &Hx_all_size) ; + Hx_all = GB_MALLOC_MEMORY (Hx_size_total, csize, &Hx_all_size) ; } if ((Hi_size_total > 0 && Hi_all == NULL) || - (Hf_size_total > 0 && Hf_all == NULL) || + (Hf_size_total > 0 && Hf_all == NULL) || (Hx_size_total > 0 && Hx_all == NULL)) { // out of memory @@ -508,8 +491,8 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash // split the space into separate hash tables //-------------------------------------------------------------------------- - int64_t *restrict Hi_part = Hi_all ; - int64_t *restrict Hf_part = Hf_all ; + uint64_t *restrict Hi_part = Hi_all ; + uint64_t *restrict Hf_part = Hf_all ; GB_void *restrict Hx_part = Hx_all ; for (int taskid = 0 ; taskid < ntasks ; taskid++) @@ -522,7 +505,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash continue ; } - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; int64_t k = SaxpyTasks [taskid].vector ; bool is_fine = (k >= 0) ; bool use_Gustavson = (hash_size == cvlen) ; @@ -531,8 +514,8 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash SaxpyTasks [taskid].Hf = (GB_void *) Hf_part ; SaxpyTasks [taskid].Hx = Hx_part ; - int64_t hi_size = GB_IMAX (hash_size, 8) ; - int64_t hx_size = hi_size ; + uint64_t hi_size = GB_IMAX (hash_size, 8) ; + uint64_t hx_size = hi_size ; if (!GB_IS_POWER_OF_TWO (hi_size)) { hi_size += hi_pad ; @@ -541,13 +524,13 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash if (is_fine && use_Gustavson) { // Hf is int8_t for the fine Gustavson tasks, but round up - // to the nearest number of int64_t values. - int64_t hi_size2 = GB_IMAX (hi_size, 64) ; - Hf_part += GB_ICEIL (hi_size2, sizeof (int64_t)) ; + // to the nearest number of uint64_t values. + uint64_t hi_size2 = GB_IMAX (hi_size, 64) ; + Hf_part += GB_ICEIL (hi_size2, sizeof (uint64_t)) ; } else { - // Hf is int64_t for all other methods + // Hf is uint64_t for all other methods Hf_part += hi_size ; } if (!is_fine && !use_Gustavson) @@ -583,8 +566,6 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash //========================================================================== // TODO constructing the tasks (the work above) can take a lot of time. - // See the web graph, where it takes a total of 3.03 sec for 64 trials, vs - // a total of 5.9 second for phase 7 (the numerical work below). // Figure out a faster method. GB_AxB_saxpy3_symbolic (C, M, Mask_comp, Mask_struct, M_in_place, @@ -677,12 +658,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash } } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //-------------------------------------------------------------------------- // prune empty vectors, free workspace, and return result @@ -690,7 +666,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash C->magic = GB_MAGIC ; GB_FREE_WORKSPACE ; - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; ASSERT_MATRIX_OK (C, "saxpy3: output", GB0) ; ASSERT (!GB_ZOMBIES (C)) ; ASSERT (!GB_PENDING (C)) ; diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3.h b/GraphBLAS/Source/mxm/GB_AxB_saxpy3.h index 6ef721e278..532eefc315 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3.h +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3.h @@ -2,7 +2,7 @@ // GB_AxB_saxpy3.h: definitions for C=A*B saxpy3 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,7 @@ #include "GB.h" #include "math/GB_math.h" +#include "sort/GB_sort.h" GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash ( @@ -30,7 +31,7 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash const GrB_Semiring semiring, // semiring that defines C=A*B const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, then mask was applied - GrB_Desc_Value AxB_method, // Default, Gustavson, or Hash + int AxB_method, // Default, Gustavson, or Hash const int do_sort, // if nonzero, try to sort in saxpy3 GB_Werk Werk ) ; @@ -42,14 +43,14 @@ GrB_Info GB_AxB_saxpy3 // C = A*B using Gustavson+Hash // A coarse task computes C(:,j1:j2) = A*B(:,j1:j2), for a contiguous set of // vectors j1:j2. A coarse taskid is denoted by SaxpyTasks [taskid].vector == // -1, kfirst = SaxpyTasks [taskid].start, and klast = SaxpyTasks [taskid].end, -// and where j1 = GBH (Bh, kstart) and likewise for j2. No summation is needed -// for the final result of each coarse task. +// and where j1 = GBh_B (Bh, kstart) and likewise for j2. No summation is +// needed for the final result of each coarse task. // A fine taskid computes A*B(k1:k2,j) for a single vector C(:,j), for a // contiguous range k1:k2, where kk = Tasklist[taskid].vector (which is >= 0), // k1 = Bi [SaxpyTasks [taskid].start], k2 = Bi [SaxpyTasks [taskid].end]. It // sums its computations in a hash table shared by all fine tasks that compute -// C(:,j), via atomics. The vector index j is GBH (Bh, kk). +// C(:,j), via atomics. The vector index j is GBh_B (Bh, kk). // Both tasks use a hash table allocated uniquely for the task, in Hi, Hf, and // Hx. The size of the hash table is determined by the maximum # of flops @@ -89,7 +90,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced const bool Mask_comp, // if true, use !M const GrB_Matrix A, // input matrix A const GrB_Matrix B, // input matrix B - GrB_Desc_Value AxB_method, // Default, Gustavson, or Hash + int AxB_method, // Default, Gustavson, or Hash bool builtin_semiring, // if true, semiring is builtin // outputs GB_saxpy3task_struct **SaxpyTasks_handle, diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_cumsum.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_cumsum.c index 55dc3452c3..becab45386 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_cumsum.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_cumsum.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_cumsum: finalize nnz(C(:,j)) and find cumulative sum of Cp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,6 @@ // phase4: cumulative sum of C->p #include "GB.h" -#include "include/GB_unused.h" GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) { @@ -22,9 +21,11 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; - int64_t *restrict Cp = C->p ; + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; const int64_t cvlen = C->vlen ; const int64_t cnvec = C->nvec ; + const bool Cp_is_32 = C->p_is_32 ; ASSERT (Cp != NULL) ; //========================================================================== @@ -41,7 +42,7 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) //---------------------------------------------------------------------- // int64_t kk = SaxpyTasks [taskid].vector ; - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; bool use_Gustavson = (hash_size == cvlen) ; int team_size = SaxpyTasks [taskid].team_size ; int leader = SaxpyTasks [taskid].leader ; @@ -80,10 +81,10 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) // (Hf [hash] & 3) == 2 if C(i,j) is an entry in C(:,j), // and the index i of the entry is (Hf [hash] >> 2) - 1. - int64_t *restrict Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; - int64_t mystart, myend ; + uint64_t *restrict Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf; + uint64_t mystart, myend ; GB_PARTITION (mystart, myend, hash_size, my_teamid, team_size) ; - for (int64_t hash = mystart ; hash < myend ; hash++) + for (uint64_t hash = mystart ; hash < myend ; hash++) { if ((Hf [hash] & 3) == 2) { @@ -109,14 +110,14 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) for (taskid = 0 ; taskid < nfine ; taskid++) { int64_t kk = SaxpyTasks [taskid].vector ; - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; } for (taskid = 0 ; taskid < nfine ; taskid++) { int64_t kk = SaxpyTasks [taskid].vector ; int64_t my_cjnz = SaxpyTasks [taskid].my_cjnz ; - Cp [kk] += my_cjnz ; + GB_IINC (Cp, kk, my_cjnz) ; // Cp [kk] += my_cjnz ; ASSERT (my_cjnz <= cvlen) ; } @@ -125,10 +126,84 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) //-------------------------------------------------------------------------- // Cp [kk] is now nnz (C (:,j)), for all vectors j, whether computed by - // fine tasks or coarse tasks, and where j == GBH (Bh, kk) + // fine tasks or coarse tasks, and where j == GBh_B (Bh, kk) + + #ifdef GBCOVER + // tell GB_cumsum to fake a failure and return ok as false: + if (GB_Global_hack_get (4)) GB_Global_hack_set (5, 1) ; + #endif int nth = GB_nthreads (cnvec, chunk, nthreads) ; - GB_cumsum (Cp, cnvec, &(C->nvec_nonempty), nth, Werk) ; + int64_t nvec_nonempty ; + bool ok = GB_cumsum (Cp, Cp_is_32, cnvec, &nvec_nonempty, nth, Werk) ; + if (ok) + { + GB_nvec_nonempty_set (C, nvec_nonempty) ; + } + + #ifdef GBCOVER + // restore the hack (for test coverage only) + if (GB_Global_hack_get (4)) GB_Global_hack_set (5, 0) ; + #endif + + #ifdef GB_DEBUG + int64_t cnz1 = 0, cnz2 = 0 ; + if (Cp_is_32) + { + uint32_t *Cp_debug = C->p ; + if (ok) cnz1 = Cp_debug [cnvec] ; + for (int k = 0 ; k <= cnvec ; k++) + { + if (!ok && k < cnvec) cnz1 += Cp_debug [k] ; + } + } + else + { + uint64_t *Cp_debug = C->p ; + if (ok) cnz1 = Cp_debug [cnvec] ; + for (int k = 0 ; k <= cnvec ; k++) + { + if (!ok && k < cnvec) cnz1 += Cp_debug [k] ; + } + } + #endif + + if (!ok) + { + // convert Cp to uint64_t and redo the cumulative sum + ASSERT (Cp_is_32) ; + ASSERT (!C->p_shallow) ; + void *Cp_new = NULL ; + size_t Cp_new_size = 0 ; + Cp_new = GB_MALLOC_MEMORY (cnvec+1, sizeof (uint64_t), &Cp_new_size) ; + if (Cp_new == NULL) + { + return (GrB_OUT_OF_MEMORY) ; + } + // Cp_new = (uint64_t) Cp, casting from 32-bit to 64-bit + GB_cast_int (Cp_new, GB_UINT64_code, Cp, GB_UINT32_code, cnvec+1, nth) ; + GB_FREE_MEMORY (&Cp, C->p_size) ; + C->p = Cp_new ; + C->p_size = Cp_new_size ; + C->p_is_32 = false ; + // redo the cumsum (this will always succeed) + GB_cumsum (C->p, false, cnvec, &nvec_nonempty, nth, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + } + + #ifdef GB_DEBUG + if (C->p_is_32) + { + uint32_t *Cp_debug = C->p ; + cnz2 = Cp_debug [cnvec] ; + } + else + { + uint64_t *Cp_debug = C->p ; + cnz2 = Cp_debug [cnvec] ; + } + ASSERT (cnz1 == cnz2) ; + #endif //-------------------------------------------------------------------------- // cumulative sum of nnz (C (:,j)) for each team of fine tasks @@ -138,20 +213,14 @@ GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) for (taskid = 0 ; taskid < nfine ; taskid++) { if (taskid == SaxpyTasks [taskid].leader) - { + { cjnz_sum = 0 ; - // also find the max (C (:,j)) for any fine hash tasks - int64_t hash_size = SaxpyTasks [taskid].hsize ; - bool use_Gustavson = (hash_size == cvlen) ; - if (!use_Gustavson) - { - int64_t kk = SaxpyTasks [taskid].vector ; - int64_t cjnz = Cp [kk+1] - Cp [kk] ; - } } int64_t my_cjnz = SaxpyTasks [taskid].my_cjnz ; SaxpyTasks [taskid].my_cjnz = cjnz_sum ; cjnz_sum += my_cjnz ; } + + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_flopcount.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_flopcount.c index 59cc31b282..8e72dfa3f1 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_flopcount.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_flopcount.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_flopcount: compute flops for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -69,13 +69,11 @@ */ #include "mxm/GB_mxm.h" -#include "slice/GB_ek_slice.h" #include "mxm/GB_AxB_saxpy3.h" -#include "include/GB_unused.h" #define GB_FREE_ALL \ { \ - GB_WERK_POP (Work, int64_t) ; \ + GB_WERK_POP (Work, uint64_t) ; \ GB_WERK_POP (B_ek_slicing, int64_t) ; \ } @@ -123,7 +121,6 @@ GrB_Info GB_AxB_saxpy3_flopcount int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; - // clear Bflops GB_memset (Bflops, 0, (bnvec+1) * sizeof (int64_t), nthreads_max) ; //-------------------------------------------------------------------------- @@ -131,20 +128,24 @@ GrB_Info GB_AxB_saxpy3_flopcount //-------------------------------------------------------------------------- bool mask_is_M = (M != NULL && !Mask_comp) ; - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; - const int64_t *restrict M_Yp = NULL ; - const int64_t *restrict M_Yi = NULL ; - const int64_t *restrict M_Yx = NULL ; + + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + void *Mh = NULL ; + const void *M_Yp = NULL ; + const void *M_Yi = NULL ; + const void *M_Yx = NULL ; int64_t mnvec = 0 ; int64_t mvlen = 0 ; int64_t M_hash_bits = 0 ; bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; bool M_is_dense = false ; + bool Mp_is_32 = false ; + bool Mj_is_32 = false ; if (M != NULL) { Mh = M->h ; - Mp = M->p ; + Mp_is_32 = M->p_is_32 ; + Mj_is_32 = M->j_is_32 ; mnvec = M->nvec ; mvlen = M->vlen ; M_is_dense = GB_IS_BITMAP (M) || GB_as_if_full (M) ; @@ -163,33 +164,30 @@ GrB_Info GB_AxB_saxpy3_flopcount // get A and B: any sparsity structure //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + void *Ah = A->h ; const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE_U (Bi, const) ; GB_Bi_PTR (Bi, B) ; const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; - const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; - const bool B_is_bitmap = GB_IS_BITMAP (B) ; - const bool B_is_sparse_or_hyper = B_is_hyper || GB_IS_SPARSE (B) ; const int64_t bvlen = B->vlen ; //-------------------------------------------------------------------------- // declare workspace //-------------------------------------------------------------------------- - GB_WERK_DECLARE (Work, int64_t) ; + GB_WERK_DECLARE (Work, uint64_t) ; GB_WERK_DECLARE (B_ek_slicing, int64_t) ; - int64_t *restrict Wfirst = NULL ; - int64_t *restrict Wlast = NULL ; //-------------------------------------------------------------------------- // construct the parallel tasks @@ -202,15 +200,15 @@ GrB_Info GB_AxB_saxpy3_flopcount // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Work, 2*B_ntasks, int64_t) ; + GB_WERK_PUSH (Work, 2*B_ntasks, uint64_t) ; if (Work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - Wfirst = Work ; - Wlast = Work + B_ntasks ; + uint64_t *restrict Wfirst = Work ; + uint64_t *restrict Wlast = Work + B_ntasks ; //-------------------------------------------------------------------------- // compute flop counts for C=A*B, C=A*B, or C=A*B @@ -241,7 +239,8 @@ GrB_Info GB_AxB_saxpy3_flopcount { // nnz (B (:,j)), for all tasks - int64_t bjnz = (Bp == NULL) ? bvlen : (Bp [kk+1] - Bp [kk]) ; + int64_t bjnz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kk+1) - GB_IGET (Bp, kk)) ; // C(:,j) is empty if the entire vector B(:,j) is empty if (bjnz == 0) continue ; @@ -250,9 +249,9 @@ GrB_Info GB_AxB_saxpy3_flopcount //------------------------------------------------------------------ GB_GET_PA (pB, pB_end, taskid, kk, kfirst, klast, pstart_Bslice, - GBP (Bp, kk, bvlen), GBP (Bp, kk+1, bvlen)) ; + GBp_B (Bp, kk, bvlen), GBp_B (Bp, kk+1, bvlen)) ; int64_t my_bjnz = pB_end - pB ; - int64_t j = GBH (Bh, kk) ; + int64_t j = GBh_B (Bh, kk) ; //------------------------------------------------------------------ // see if M(:,j) is present and non-empty @@ -270,14 +269,15 @@ GrB_Info GB_AxB_saxpy3_flopcount if (M_is_hyper) { // M is hypersparse: find M(:,j) in the M->Y hyper_hash - GB_hyper_hash_lookup (Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, - M_hash_bits, j, &pM, &pM_end) ; + GB_hyper_hash_lookup (Mp_is_32, Mj_is_32, + Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, + j, &pM, &pM_end) ; } else { // M is sparse - pM = Mp [j] ; - pM_end = Mp [j+1] ; + pM = GB_IGET (Mp, j) ; + pM_end = GB_IGET (Mp, j+1) ; } mjnz = pM_end - pM ; // If M not complemented: C(:,j) is empty if M(:,j) is empty. @@ -285,7 +285,7 @@ GrB_Info GB_AxB_saxpy3_flopcount if (mjnz > 0) { // M(:,j) not empty - if (pB == GBP (Bp, kk, bvlen)) + if (pB == GBp_B (Bp, kk, bvlen)) { // this task owns the top part of B(:,j), so it can // account for the work to access M(:,j), without the @@ -310,8 +310,8 @@ GrB_Info GB_AxB_saxpy3_flopcount for ( ; pB < pB_end ; pB++) { // get B(k,j) - int64_t k = GBI (Bi, pB, bvlen) ; - if (!GBB (Bb, pB)) continue ; + uint64_t k = GBi_B (Bi, pB, bvlen) ; + if (!GBb_B (Bb, pB)) continue ; // B(k,j) is nonzero @@ -320,14 +320,15 @@ GrB_Info GB_AxB_saxpy3_flopcount if (A_is_hyper) { // A is hypersparse: find A(:,k) in the A->Y hyper_hash - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, k, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + k, &pA, &pA_end) ; } else { // A is sparse, bitmap, or full - pA = GBP (Ap, k , avlen) ; - pA_end = GBP (Ap, k+1, avlen) ; + pA = GBp_A (Ap, k , avlen) ; + pA_end = GBp_A (Ap, k+1, avlen) ; } // skip if A(:,k) empty @@ -405,7 +406,7 @@ GrB_Info GB_AxB_saxpy3_flopcount if (kfirst <= klast) { int64_t pB = pstart_Bslice [taskid] ; - int64_t pB_end = GBP (Bp, kfirst+1, bvlen) ; + int64_t pB_end = GBp_B (Bp, kfirst+1, bvlen) ; pB_end = GB_IMIN (pB_end, pstart_Bslice [taskid+1]) ; if (pB < pB_end) { @@ -430,7 +431,7 @@ GrB_Info GB_AxB_saxpy3_flopcount if (kfirst < klast) { - int64_t pB = GBP (Bp, klast, bvlen) ; + int64_t pB = GBp_B (Bp, klast, bvlen) ; int64_t pB_end = pstart_Bslice [taskid+1] ; if (pB < pB_end) { @@ -462,7 +463,7 @@ GrB_Info GB_AxB_saxpy3_flopcount // Bflops = cumsum ([0 Bflops]) ; ASSERT (Bflops [bnvec] == 0) ; - GB_cumsum (Bflops, bnvec, NULL, B_nthreads, Werk) ; + GB_cumsum (Bflops, false, bnvec, NULL, B_nthreads, Werk) ; // Bflops [bnvec] is now the total flop count, including the time to // compute A*B and to handle the mask. total_Mwork is part of this total // flop count, but is also returned separtely. diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_first.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_first.c index 2a8b7699dd..a104475823 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_first.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_first.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_first.c: C=A*B, C sparse/hyper, FIRST multiplier //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_flipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_flipped.c index 65c3157211..6a07633573 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_flipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_flipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_flipped.c: C=A*B, C sparse/hyper, flipped multiplier //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c index d7f15b4a71..208b521906 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_idx_flipped.c: C=A*B, C sparse/hyper, flipped idx //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c index d8bcdbdb72..42cfd4f4d1 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_idx_unflipped.c: C=A*B, C sparse/hyper, unflipped idx //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_second.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_second.c index 90c3e90c1c..a63daa1c67 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_second.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_second.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_second.c: C=A*B, C sparse/hyper, SECOND multiplier //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c index a4e23aeda0..d142078262 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_generic_unflipped.c: C=A*B, C sparse/hyper, unflipped mult //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_balanced.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_balanced.c index 148856389c..21b17e34dc 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_balanced.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_balanced.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_slice_balanced: construct balanced tasks for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,6 @@ // GrB_NO_VALUE, to indicate that the analysis was terminated early. #include "mxm/GB_AxB_saxpy3.h" -#include "include/GB_unused.h" // control parameters for generating parallel tasks #define GB_NTASKS_PER_THREAD 2 @@ -24,6 +23,7 @@ #define GB_FREE_WORKSPACE \ { \ + GB_FREE_MEMORY (&Bflops, Bflops_size) ; \ GB_WERK_POP (Fine_fl, int64_t) ; \ GB_WERK_POP (Fine_slice, int64_t) ; \ GB_WERK_POP (Coarse_Work, int64_t) ; \ @@ -33,7 +33,7 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&SaxpyTasks, SaxpyTasks_size) ; \ + GB_FREE_MEMORY (&SaxpyTasks, SaxpyTasks_size) ; \ } //------------------------------------------------------------------------------ @@ -53,14 +53,14 @@ // either of those methods. However, if Hash is selected but the hash table // equals or exceeds cvlen, then Gustavson's method is used instead. -static inline int64_t GB_hash_table_size +static inline uint64_t GB_hash_table_size ( int64_t flmax, // max flop count for any vector computed by this task int64_t cvlen, // vector length of C - const GrB_Desc_Value AxB_method // Default, Gustavson, or Hash + const int AxB_method // Default, Gustavson, or Hash ) { - int64_t hash_size ; + uint64_t hash_size ; if (AxB_method == GxB_AxB_GUSTAVSON || flmax >= cvlen/2) { @@ -119,12 +119,12 @@ static inline void GB_create_coarse_task int64_t klast, GB_saxpy3task_struct *SaxpyTasks, int taskid, // taskid for this coarse task - int64_t *Bflops, // size bnvec; cum sum of flop counts for vectors of B + int64_t *Bflops, // size bnvec; cumsum of flop counts for vectors of B int64_t cvlen, // vector length of B and C double chunk, int nthreads_max, int64_t *Coarse_Work, // workspace for parallel reduction for flop count - const GrB_Desc_Value AxB_method // Default, Gustavson, or Hash + const int AxB_method // Default, Gustavson, or Hash ) { @@ -180,7 +180,7 @@ static inline void GB_create_coarse_task SaxpyTasks [taskid].Hi = NULL ; // assigned later SaxpyTasks [taskid].Hf = NULL ; // assigned later SaxpyTasks [taskid].Hx = NULL ; // assigned later - SaxpyTasks [taskid].my_cjnz = 0 ; // for fine tasks only + SaxpyTasks [taskid].my_cjnz = 0 ; // for fine tasks only SaxpyTasks [taskid].leader = taskid ; SaxpyTasks [taskid].team_size = 1 ; } @@ -197,7 +197,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced const bool Mask_comp, // if true, use !M const GrB_Matrix A, // input matrix A const GrB_Matrix B, // input matrix B - GrB_Desc_Value AxB_method, // Default, Gustavson, or Hash + int AxB_method, // Default, Gustavson, or Hash bool builtin_semiring, // if true, semiring is builtin // outputs GB_saxpy3task_struct **SaxpyTasks_handle, @@ -267,25 +267,25 @@ GrB_Info GB_AxB_saxpy3_slice_balanced // get A, and B //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + void *Ah = A->h ; const int64_t avlen = A->vlen ; const int64_t anvec = A->nvec ; const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bi_DECLARE_U (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; const int64_t bvdim = B->vdim ; const int64_t bnz = GB_nnz_held (B) ; const int64_t bnvec = B->nvec ; const int64_t bvlen = B->vlen ; - const bool B_is_hyper = GB_IS_HYPERSPARSE (B) ; int64_t cvlen = avlen ; int64_t cvdim = bvdim ; @@ -295,7 +295,16 @@ GrB_Info GB_AxB_saxpy3_slice_balanced //-------------------------------------------------------------------------- int64_t Mwork = 0 ; - int64_t *restrict Bflops = C->p ; // use C->p as workspace for Bflops + + int64_t *restrict Bflops = NULL ; size_t Bflops_size = 0 ; + // allocate Bflops workspace + Bflops = GB_MALLOC_MEMORY (bnvec+1, sizeof (uint64_t), &Bflops_size) ; + if (Bflops == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + GB_OK (GB_AxB_saxpy3_flopcount (&Mwork, Bflops, M, Mask_comp, A, B, Werk)) ; double total_flops = (double) Bflops [bnvec] ; double axbflops = total_flops - Mwork ; @@ -310,7 +319,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced { //---------------------------------------------------------------------- - // M is not present + // M is not present //---------------------------------------------------------------------- (*apply_mask) = false ; @@ -484,7 +493,8 @@ GrB_Info GB_AxB_saxpy3_slice_balanced GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse_initial, Bflops, bnvec, ntasks_initial, true) ; + GB_p_slice (Coarse_initial, Bflops, false, bnvec, ntasks_initial, + /* perfectly_balanced: */ true) ; //---------------------------------------------------------------------- // split the work into coarse and fine tasks @@ -514,10 +524,11 @@ GrB_Info GB_AxB_saxpy3_slice_balanced for (int64_t kk = kfirst ; kk < klast ; kk++) { // jflops = # of flops to compute a single vector A*B(:,j) - // where j == GBH (Bh, kk) + // where j == GBh_B (Bh, kk) double jflops = Bflops [kk+1] - Bflops [kk] ; // bjnz = nnz (B (:,j)) - int64_t bjnz = (Bp == NULL) ? bvlen : (Bp [kk+1] - Bp [kk]); + int64_t bjnz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kk+1) - GB_IGET (Bp, kk)) ; if (jflops > GB_COSTLY * target_task_size && bjnz > 1) { @@ -575,7 +586,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced // allocate the tasks, and workspace to construct fine tasks //-------------------------------------------------------------------------- - SaxpyTasks = GB_MALLOC_WORK ((*ntasks), GB_saxpy3task_struct, + SaxpyTasks = GB_MALLOC_MEMORY ((*ntasks), sizeof (GB_saxpy3task_struct), &SaxpyTasks_size) ; GB_WERK_PUSH (Coarse_Work, nthreads_max, int64_t) ; if (max_bjnz > 0) @@ -639,7 +650,8 @@ GrB_Info GB_AxB_saxpy3_slice_balanced // jflops = # of flops to compute a single vector A*B(:,j) double jflops = Bflops [kk+1] - Bflops [kk] ; // bjnz = nnz (B (:,j)) - int64_t bjnz = (Bp == NULL) ? bvlen : (Bp [kk+1] - Bp [kk]); + int64_t bjnz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kk+1) - GB_IGET (Bp, kk)) ; if (jflops > GB_COSTLY * target_task_size && bjnz > 1) { @@ -659,7 +671,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced // count the work for each entry B(k,j). Do not // include the work to scan M(:,j), since that will // be evenly divided between all tasks in this team. - int64_t pB_start = GBP (Bp, kk, bvlen) ; + int64_t pB_start = GBp_B (Bp, kk, bvlen) ; int nth = GB_nthreads (bjnz, chunk, nthreads_max) ; int64_t s ; #pragma omp parallel for num_threads(nth) \ @@ -669,8 +681,8 @@ GrB_Info GB_AxB_saxpy3_slice_balanced // get B(k,j) Fine_fl [s] = 1 ; int64_t pB = pB_start + s ; - if (!GBB (Bb, pB)) continue ; - int64_t k = GBI (Bi, pB, bvlen) ; + if (!GBb_B (Bb, pB)) continue ; + uint64_t k = GBi_B (Bi, pB, bvlen) ; // fl = flop count for just A(:,k)*B(k,j) // find A(:,k) @@ -678,14 +690,15 @@ GrB_Info GB_AxB_saxpy3_slice_balanced if (A_is_hyper) { // A is hypersparse: find A(:,k) in hyper_hash - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, - A_Yi, A_Yx, A_hash_bits, k, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, + A_hash_bits, k, &pA, &pA_end) ; } else { // A is sparse, bitmap, or full - pA = GBP (Ap, k , avlen) ; - pA_end = GBP (Ap, k+1, avlen) ; + pA = GBp_A (Ap, k , avlen) ; + pA_end = GBp_A (Ap, k+1, avlen) ; } int64_t fl = pA_end - pA ; @@ -694,16 +707,16 @@ GrB_Info GB_AxB_saxpy3_slice_balanced } // cumulative sum of flops to compute A*B(:,j) - GB_cumsum (Fine_fl, bjnz, NULL, nth, Werk) ; + GB_cumsum (Fine_fl, false, bjnz, NULL, nth, Werk) ; // slice B(:,j) into fine tasks int team_size = ceil (jflops / target_fine_size) ; ASSERT (Fine_slice != NULL) ; - GB_p_slice (Fine_slice, Fine_fl, bjnz, team_size, - false); + GB_p_slice (Fine_slice, Fine_fl, false, bjnz, + team_size, false) ; // shared hash table for all fine tasks for A*B(:,j) - int64_t hsize = + uint64_t hsize = GB_hash_table_size (jflops, cvlen, AxB_method) ; // construct the fine tasks for C(:,j)=A*B(:,j) @@ -712,7 +725,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced { int64_t pstart = Fine_slice [fid] ; int64_t pend = Fine_slice [fid+1] ; - int64_t fl = Fine_fl [pend] - Fine_fl [pstart] ; +// int64_t fl = Fine_fl [pend] - Fine_fl [pstart] ; SaxpyTasks [nf].start = pB_start + pstart ; SaxpyTasks [nf].end = pB_start + pend - 1 ; SaxpyTasks [nf].vector = kk ; @@ -759,7 +772,7 @@ GrB_Info GB_AxB_saxpy3_slice_balanced GB_create_coarse_task (0, bnvec-1, SaxpyTasks, 0, Bflops, cvlen, 1, 1, Coarse_Work, AxB_method) ; - int64_t hash_size = SaxpyTasks [0].hsize ; + uint64_t hash_size = SaxpyTasks [0].hsize ; bool use_Gustavson = (hash_size == cvlen) ; if (bnvec == 1 && !use_Gustavson) { diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_quick.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_quick.c index 35cf3e5cd5..5fb6e97a3b 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_quick.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_slice_quick.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_slice_quick: construct a single task for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,8 +43,9 @@ GrB_Info GB_AxB_saxpy3_slice_quick //-------------------------------------------------------------------------- size_t SaxpyTasks_size = 0 ; - GB_saxpy3task_struct *SaxpyTasks = GB_MALLOC_WORK (1, GB_saxpy3task_struct, - &SaxpyTasks_size) ; + GB_saxpy3task_struct + *SaxpyTasks = GB_MALLOC_MEMORY (1, sizeof (GB_saxpy3task_struct), + &SaxpyTasks_size) ; if (SaxpyTasks == NULL) { // out of memory diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bh.c index e369e3b82b..b9f9da1398 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_bh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bs.c index b420fae473..647f15f810 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_bs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_bs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fh.c index c497418f1c..c642a3cbfa 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_fh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fs.c index 3a435525ec..e7b5d7c160 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_fs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_fs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hb.c index ad4c3bdf03..35b1eaee06 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_hb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hf.c index ec1544f352..9cb72565a3 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_hf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hh.c index 3517a50307..9bd82b81be 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_hh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hs.c index db9191c9dd..ff3835a6c3 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_hs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_hs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbb.c index a84ce80578..e3966ac5d4 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mbb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbf.c index 46df7f020e..d5830b1406 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mbf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbh.c index c310077c1c..b6c854ef05 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mbh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbs.c index b2191f563e..2d2c3b6536 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mbs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mbs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfb.c index cd0dacd1a4..b8bc88df69 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mfb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mff.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mff.c index 7fd8667bbe..d28cd16468 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mff.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mff.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mff: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfh.c index da5f78c3f3..98f9012979 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mfh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfs.c index a44d7c0a82..e4f8a44d8d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mfs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mfs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhb.c index de13de44bb..503a11fd66 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mhb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhf.c index 8e9014e659..83258a691d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mhf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhh.c index da5ecb2146..69b0bdc104 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mhh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhs.c index 56676f40c3..1781fc04f8 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mhs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mhs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msb.c index d08bddf4e8..144524fe4f 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_msb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msf.c index b6f2f7e3d0..ec8f379e18 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_msf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msh.c index b0e99281fa..c822a2fe7c 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_msh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_msh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mss.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mss.c index ae8d004392..cf11100edd 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mss.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_mss.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_mss: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbh.c index 85dfb5378f..9b3974c53f 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nbh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbs.c index cac3197bd4..c11ccf5ce6 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nbs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nbs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfh.c index 6dfccea274..9b1c665e0d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nfh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfs.c index 18d605a52f..c39e9c4806 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nfs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nfs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhb.c index e8383b2a38..7beb50f4d6 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nhb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhf.c index 988f15c748..641537b691 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nhf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhh.c index 87f62c4f61..8260fb171b 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nhh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhs.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhs.c index aa015d2c05..c0186b1d29 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhs.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nhs.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nhs: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsb.c index 41e1b9be22..6799e40302 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nsb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsf.c index 2964ad4012..ce4471166c 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nsf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsh.c index 0d73e2b331..8416e7e8c6 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nsh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nsh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nss.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nss.c index 7fff84fb48..f73a278aa7 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nss.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_nss.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_nss: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sb.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sb.c index 85d178311e..95495b8535 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sb.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sb.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_sb: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sf.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sf.c index 8dfe24c184..96fa938dca 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sf.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sf.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_sf: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sh.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sh.c index 92147eceea..d33cc4fff0 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sh.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_sh.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_sh: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_ss.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_ss.c index caf35e676a..6299e40f55 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_ss.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_sym_ss.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_sym_ss: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_symbolic.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_symbolic.c index 08a58e2e10..52bc4a3980 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy3_symbolic.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy3_symbolic.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_symbolic: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy4.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy4.c index e5f7afafc8..f4e27fde26 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy4.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy4.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4: compute C+=A*B: C full, A sparse/hyper, B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,8 +29,8 @@ { \ GB_WERK_POP (A_slice, int64_t) ; \ GB_WERK_POP (H_slice, int64_t) ; \ - GB_FREE_WORK (&Wf, Wf_size) ; \ - GB_FREE_WORK (&Wcx, Wcx_size) ; \ + GB_FREE_MEMORY (&Wf, Wf_size) ; \ + GB_FREE_MEMORY (&Wcx, Wcx_size) ; \ } #define GB_FREE_ALL \ @@ -188,7 +188,8 @@ GrB_Info GB_AxB_saxpy4 // C += A*B GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, A->p, A->nvec, nfine_tasks_per_vector, true) ; + GB_p_slice (A_slice, A->p, A->p_is_32, A->nvec, nfine_tasks_per_vector, + /* perfectly_balanced: */ true) ; if (!use_atomics) { @@ -207,7 +208,8 @@ GrB_Info GB_AxB_saxpy4 // C += A*B // complex types (FC32 and FC64) requires a critical section for // each C(i,j) scalar. User-defined monoids for JIT kernels also // require this mutex. - Wf = GB_CALLOC_WORK (C->vlen * C->vdim, int8_t, &Wf_size) ; + Wf = GB_CALLOC_MEMORY (C->vlen * C->vdim, sizeof (int8_t), + &Wf_size) ; if (Wf == NULL) { // out of memory @@ -219,7 +221,7 @@ GrB_Info GB_AxB_saxpy4 // C += A*B if (wspace > 0) { - Wcx = GB_MALLOC_WORK (wspace, GB_void, &Wcx_size) ; + Wcx = GB_MALLOC_MEMORY (wspace, sizeof (GB_void), &Wcx_size) ; if (Wcx == NULL) { // out of memory diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy4_tasks.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy4_tasks.c index 209b824b65..3bf6beed2d 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy4_tasks.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy4_tasks.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4_tasks: construct tasks for saxpy4 and bitmap_saxpy //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy5.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy5.c index 8f059eb40b..d2f052312f 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy5.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5: compute C+=A*B where A is bitmap/full and B is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -151,7 +151,7 @@ GrB_Info GB_AxB_saxpy5 // C += A*B GB_FREE_WORKSPACE ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (B_slice, B->p, bnvec, ntasks, false) ; + GB_p_slice (B_slice, B->p, B->p_is_32, bnvec, ntasks, false) ; //-------------------------------------------------------------------------- // via the factory kernel @@ -194,8 +194,8 @@ GrB_Info GB_AxB_saxpy5 // C += A*B if (info == GrB_NO_VALUE) { - info = GB_AxB_saxpy5_jit (C, A, B, semiring, flipxy, - ntasks, nthreads, B_slice) ; + info = GB_AxB_saxpy5_jit (C, A, B, semiring, flipxy, ntasks, nthreads, + B_slice) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.c index 2ed2314ccf..1306c4c306 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy_generic: compute C=A*B, C=A*B, or C=A*B in parallel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.h b/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.h index 40e1c7f93a..0443e0fe4c 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.h +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy_generic.h @@ -2,7 +2,7 @@ // GB_AxB_saxpy_generic.h: definitions for GB_AxB_saxpy_generic //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/GB_AxB_saxpy_sparsity.c b/GraphBLAS/Source/mxm/GB_AxB_saxpy_sparsity.c index b394ccc424..a8dc4ebc39 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_saxpy_sparsity.c +++ b/GraphBLAS/Source/mxm/GB_AxB_saxpy_sparsity.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy_sparsity: determine the sparsity structure for C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,12 +35,8 @@ void GB_AxB_saxpy_sparsity // determine C_sparsity and method to use // determine the sparsity of C //-------------------------------------------------------------------------- - if (B->nvec_nonempty < 0) - { - // B->nvec_nonempty is used to select the method - B->nvec_nonempty = GB_nvec_nonempty (B) ; - } - double bnvec = B->nvec_nonempty ; + // B->nvec_nonempty is used to select the method + double bnvec = GB_nvec_nonempty_update (B) ; double m = (double) A->vlen ; double n = (double) B->vdim ; diff --git a/GraphBLAS/Source/mxm/GB_AxB_semiring_builtin.c b/GraphBLAS/Source/mxm/GB_AxB_semiring_builtin.c index 6a7ac1ccac..8c169dbbb0 100644 --- a/GraphBLAS/Source/mxm/GB_AxB_semiring_builtin.c +++ b/GraphBLAS/Source/mxm/GB_AxB_semiring_builtin.c @@ -2,17 +2,14 @@ // GB_AxB_semiring_builtin: determine if semiring is built-in //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Determine if A*B uses a built-in semiring, and if so, determine the -// opcodes and type codes of the semiring. - -// This function is not used by the CUDA jitified kernels, since they can -// typecast the entries in the matrices A and B to the types of x and y of the -// operator, as needed. +// Determine if A*B uses a built-in semiring and matches the types of its +// inputs A and B. Returns the opcodes and type codoes of the semiring. If +// this method returns true, the semiring is a candidate for a switch factory. #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" diff --git a/GraphBLAS/Source/mxm/GB_bitmap_expand_to_hyper.c b/GraphBLAS/Source/mxm/GB_bitmap_expand_to_hyper.c index 4ff18baf89..eae91fc7b0 100644 --- a/GraphBLAS/Source/mxm/GB_bitmap_expand_to_hyper.c +++ b/GraphBLAS/Source/mxm/GB_bitmap_expand_to_hyper.c @@ -2,7 +2,7 @@ // GB_bitmap_expand_to_hyper: expand a compact bitmap C to hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,9 +10,9 @@ #define GB_FREE_ALL \ { \ GB_phybix_free (C) ; \ - GB_FREE (&Cp, Cp_size) ; \ - GB_FREE (&Ch, Ch_size) ; \ - GB_FREE (&Ci, Ci_size) ; \ + GB_FREE_MEMORY (&Cp, Cp_size) ; \ + GB_FREE_MEMORY (&Ch, Ch_size) ; \ + GB_FREE_MEMORY (&Ci, Ci_size) ; \ } #include "mxm/GB_mxm.h" @@ -41,6 +41,8 @@ GrB_Info GB_bitmap_expand_to_hyper ASSERT_MATRIX_OK (A, "A for expand C from bitmap/full to hyper", GB0) ; ASSERT_MATRIX_OK (B, "B for expand C from bitmap/full to hyper", GB0) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + int64_t cvlen = C->vlen ; int64_t cvdim = C->vdim ; int64_t cnz = cvlen * cvdim ; @@ -52,21 +54,32 @@ GrB_Info GB_bitmap_expand_to_hyper // bitmap, and expanded in size to be cvlen_final by cvdim_final (A->vdim // by B->vdim for C=A'*B, or A->vlen by B->vdim for C=A*B). - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- // allocate the sparse/hypersparse structure of the final C - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- + + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_HYPERSPARSE, cnz, cvlen_final, cvdim_final, Werk) ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - int64_t *restrict Ch = NULL ; size_t Ch_size = 0 ; - int64_t *restrict Ci = NULL ; size_t Ci_size = 0 ; + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t cjsize = (Cj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t cisize = (Ci_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; - Cp = GB_MALLOC (cvdim+1, int64_t, &Cp_size) ; - Ch = NULL ; + GB_Type_code cjcode = (Cj_is_32 ) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code bjcode = (B->j_is_32) ? GB_UINT32_code : GB_UINT64_code ; + + GB_MDECL (Cp, , u) ; size_t Cp_size = 0 ; + GB_MDECL (Ci, , u) ; size_t Ci_size = 0 ; + void *Ch = NULL ; size_t Ch_size = 0 ; + + Cp = GB_MALLOC_MEMORY (cvdim+1, cpsize, &Cp_size) ; if (B_is_hyper) { - Ch = GB_MALLOC (cvdim, int64_t, &Ch_size) ; + Ch = GB_MALLOC_MEMORY (cvdim, cjsize, &Ch_size) ; } - Ci = GB_MALLOC (cnz, int64_t, &Ci_size) ; + Ci = GB_MALLOC_MEMORY (cnz, cisize, &Ci_size) ; if (Cp == NULL || (B_is_hyper && Ch == NULL) || Ci == NULL) { // out of memory @@ -74,9 +87,12 @@ GrB_Info GB_bitmap_expand_to_hyper return (GrB_OUT_OF_MEMORY) ; } - //---------------------------------------------------------------------- + GB_IPTR (Cp, Cp_is_32) ; + GB_IPTR (Ci, Ci_is_32) ; + + //-------------------------------------------------------------------------- // construct the hyperlist of C, if B is hypersparse - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; @@ -85,23 +101,25 @@ GrB_Info GB_bitmap_expand_to_hyper { // C becomes hypersparse ASSERT (cvdim == B->nvec) ; - GB_memcpy (Ch, B->h, cvdim * sizeof (int64_t), nthreads) ; +// GB_memcpy (Ch, B->h, cvdim * sizeof (int64_t), nthreads) ; + GB_cast_int (Ch, cjcode, B->h, bjcode, cvdim, nthreads) ; } - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- // construct the vector pointers of C - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- int64_t pC ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (pC = 0 ; pC < cvdim+1 ; pC++) { - Cp [pC] = pC * cvlen ; + int64_t p = pC * cvlen ; + GB_ISET (Cp, pC, p) ; // Cp [pC] = p } - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- // construct the pattern of C from its bitmap - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- // C(i,j) becomes a zombie if not present in the bitmap nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; @@ -114,13 +132,13 @@ GrB_Info GB_bitmap_expand_to_hyper if (A_is_hyper) { // only for C=A'*B - GrB_Index *restrict Ah = (GrB_Index *) A->h ; ASSERT (cvlen == A->nvec) ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (pC = 0 ; pC < cnz ; pC++) { - int64_t i = Ah [pC % cvlen] ; - Ci [pC] = (Cb [pC]) ? i : GB_ZOMBIE (i) ; + int64_t i = GB_IGET (Ah, pC % cvlen) ; + i = (Cb [pC]) ? i : GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } else @@ -131,7 +149,8 @@ GrB_Info GB_bitmap_expand_to_hyper for (pC = 0 ; pC < cnz ; pC++) { int64_t i = pC % cvlen ; - Ci [pC] = (Cb [pC]) ? i : GB_ZOMBIE (i) ; + i = (Cb [pC]) ? i : GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } } @@ -141,13 +160,12 @@ GrB_Info GB_bitmap_expand_to_hyper if (A_is_hyper) { // only for C=A'*B - GrB_Index *restrict Ah = (GrB_Index *) A->h ; ASSERT (cvlen == A->nvec) ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (pC = 0 ; pC < cnz ; pC++) { - int64_t i = Ah [pC % cvlen] ; - Ci [pC] = i ; + int64_t i = GB_IGET (Ah, pC % cvlen) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } else @@ -158,14 +176,14 @@ GrB_Info GB_bitmap_expand_to_hyper for (pC = 0 ; pC < cnz ; pC++) { int64_t i = pC % cvlen ; - Ci [pC] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; } } } - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- // transplant the new content and finalize C - //---------------------------------------------------------------------- + //-------------------------------------------------------------------------- C->p = Cp ; Cp = NULL ; C->p_size = Cp_size ; C->h = Ch ; Ch = NULL ; C->h_size = Ch_size ; @@ -176,10 +194,14 @@ GrB_Info GB_bitmap_expand_to_hyper C->nvals = cnz ; C->nvec = cvdim ; C->plen = cvdim ; - C->nvec_nonempty = (cvlen == 0) ? 0 : cvdim ; +// C->nvec_nonempty = (cvlen == 0) ? 0 : cvdim ; + GB_nvec_nonempty_set (C, (cvlen == 0) ? 0 : cvdim) ; + C->p_is_32 = Cp_is_32 ; + C->j_is_32 = Cj_is_32 ; + C->i_is_32 = Ci_is_32 ; // free the bitmap, if present - GB_FREE ((&C->b), C->b_size) ; + GB_FREE_MEMORY ((&C->b), C->b_size) ; // C is now sparse or hypersparse ASSERT_MATRIX_OK (C, "C expanded from bitmap/full to hyper", GB0) ; diff --git a/GraphBLAS/Source/mxm/GB_colscale.c b/GraphBLAS/Source/mxm/GB_colscale.c index f34e7298f8..afa6e741b4 100644 --- a/GraphBLAS/Source/mxm/GB_colscale.c +++ b/GraphBLAS/Source/mxm/GB_colscale.c @@ -2,7 +2,7 @@ // GB_colscale: C = A*D where D is diagonal //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,13 +10,11 @@ #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" #include "apply/GB_apply.h" -#include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT #include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif -#include "include/GB_unused.h" #define GB_FREE_WORKSPACE \ { \ @@ -46,7 +44,7 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (A, "A for colscale A*D", GB0) ; ASSERT_MATRIX_OK (D, "D for colscale A*D", GB0) ; ASSERT (!GB_ZOMBIES (A)) ; @@ -99,7 +97,6 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D //-------------------------------------------------------------------------- // allocate C->x but do not initialize it - // set C->iso = C_iso OK GB_OK (GB_dup_worker (&C, C_iso, A, false, ztype)) ; info = GrB_NO_VALUE ; ASSERT (C->type == ztype) ; @@ -232,7 +229,7 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D //---------------------------------------------------------------------- int A_nthreads, A_ntasks ; - GB_SLICE_MATRIX (A, 32) ; + GB_SLICE_MATRIX2 (A, 32) ; //---------------------------------------------------------------------- // via the factory kernel diff --git a/GraphBLAS/Source/mxm/GB_is_diagonal.c b/GraphBLAS/Source/mxm/GB_is_diagonal.c index 4f8ee0de99..f0ff87bd9e 100644 --- a/GraphBLAS/Source/mxm/GB_is_diagonal.c +++ b/GraphBLAS/Source/mxm/GB_is_diagonal.c @@ -2,7 +2,7 @@ // GB_is_diagonal: check if A is a diagonal matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -83,8 +83,8 @@ bool GB_is_diagonal // true if A is diagonal // examine each vector of A //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; int diagonal = true ; @@ -112,14 +112,14 @@ bool GB_is_diagonal // true if A is diagonal GB_PARTITION (jstart, jend, n, tid, ntasks) ; for (int64_t j = jstart ; diag && j < jend ; j++) { - int64_t p = Ap [j] ; - int64_t ajnz = Ap [j+1] - p ; + int64_t p = GB_IGET (Ap, j) ; + int64_t ajnz = GB_IGET (Ap, j+1) - p ; if (ajnz != 1) { // A(:,j) must have exactly one entry diag = false ; } - int64_t i = Ai [p] ; + int64_t i = GB_IGET (Ai, p) ; if (i != j) { // the single entry must be A(i,i) diff --git a/GraphBLAS/Source/mxm/GB_mxm.c b/GraphBLAS/Source/mxm/GB_mxm.c index 6e293a892a..5f0c367f27 100644 --- a/GraphBLAS/Source/mxm/GB_mxm.c +++ b/GraphBLAS/Source/mxm/GB_mxm.c @@ -2,7 +2,7 @@ // GB_mxm: matrix-matrix multiply for GrB_mxm, GrB_mxv, and GrB_vxm //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ GrB_Info GB_mxm // C = A*B const GrB_Matrix B, // input matrix const bool B_transpose, // if true, use B' instead of B const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) - const GrB_Desc_Value AxB_method,// for auto vs user selection of methods + const int AxB_method, // for auto vs user selection of methods const int do_sort, // if nonzero, try to return C unjumbled GB_Werk Werk ) @@ -135,8 +135,8 @@ GrB_Info GB_mxm // C = A*B // semiring->add->ztype if accum is not present. To compute in-place, // C must also not be transposed, and it cannot be aliased with M, A, or B. - GB_CLEAR_STATIC_HEADER (MT, &MT_header) ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (MT, &MT_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; bool mask_applied = false ; bool done_in_place = false ; @@ -151,7 +151,8 @@ GrB_Info GB_mxm // C = A*B // C has been computed in-place; no more work to do GB_FREE_ALL ; GB_OK (GB_conform (C, Werk)) ; - ASSERT_MATRIX_OK (C, "C from GB_mxm (in-place)", GB0) ; + ASSERT_MATRIX_OK (C, "C from GB_mxm (in-place), final", GB0) ; + GB_OK (GB_valid_matrix (C)) ; return (info) ; } diff --git a/GraphBLAS/Source/mxm/GB_mxm.h b/GraphBLAS/Source/mxm/GB_mxm.h index 5fd9f83d7f..252902ddda 100644 --- a/GraphBLAS/Source/mxm/GB_mxm.h +++ b/GraphBLAS/Source/mxm/GB_mxm.h @@ -2,7 +2,7 @@ // GB_mxm.h: definitions for C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ GrB_Info GB_mxm // C = A*B const GrB_Matrix B, // input matrix const bool B_transpose, // if true, use B' instead of B const bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) - const GrB_Desc_Value AxB_method,// for auto vs user selection of methods + const int AxB_method, // for auto vs user selection of methods const int do_sort, // if nonzero, try to return C unjumbled GB_Werk Werk ) ; @@ -70,7 +70,7 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm bool flipxy, // if true, do z=fmult(b,a) vs fmult(a,b) bool *mask_applied, // if true, mask was applied bool *done_in_place, // if true, C was computed in-place - GrB_Desc_Value AxB_method, // for auto vs user selection of methods + int AxB_method, // for auto vs user selection of methods const int do_sort, // if nonzero, try to return C unjumbled GB_Werk Werk ) ; @@ -152,12 +152,14 @@ GrB_Info GB_AxB_dot3 // C = A'*B using dot product method GrB_Info GB_AxB_dot3_slice ( // output: - GB_task_struct **p_TaskList, // array of structs, of size max_ntasks + GB_task_struct **p_TaskList, // array of structs size_t *p_TaskList_size, // size of TaskList int *p_ntasks, // # of tasks constructed int *p_nthreads, // # of threads to use // input: - const GrB_Matrix C, // matrix to slice + const GrB_Matrix C, // matrix to slice (only C->p, C->h present) + float *Cwork, // workspace of size cnz+1 + int64_t cnz, // # entries that will appear in C GB_Werk Werk ) ; @@ -290,7 +292,7 @@ void GB_AxB_meta_adotb_control bool can_do_in_place, bool allow_scale, bool B_is_diagonal, - GrB_Desc_Value AxB_method + int AxB_method ) ; // return value of axb_method from GB_AxB_meta_adotb_control diff --git a/GraphBLAS/Source/mxm/GB_rowscale.c b/GraphBLAS/Source/mxm/GB_rowscale.c index 27880a8af6..150c061253 100644 --- a/GraphBLAS/Source/mxm/GB_rowscale.c +++ b/GraphBLAS/Source/mxm/GB_rowscale.c @@ -2,7 +2,7 @@ // GB_rowscale: C = D*B, row scale with diagonal matrix D //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D //-------------------------------------------------------------------------- GrB_Info info ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_MATRIX_OK (D, "D for rowscale D*B", GB0) ; ASSERT_MATRIX_OK (B, "B for rowscale D*B", GB0) ; ASSERT (!GB_ZOMBIES (D)) ; @@ -86,7 +86,6 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D //-------------------------------------------------------------------------- // allocate C->x but do not initialize it - // set C->iso = C_iso OK GB_OK (GB_dup_worker (&C, C_iso, B, false, ztype)) ; info = GrB_NO_VALUE ; ASSERT (C->type == ztype) ; diff --git a/GraphBLAS/Source/mxm/GrB_mxm.c b/GraphBLAS/Source/mxm/GrB_mxm.c index c74b783b46..58f55db44b 100644 --- a/GraphBLAS/Source/mxm/GrB_mxm.c +++ b/GraphBLAS/Source/mxm/GrB_mxm.c @@ -2,7 +2,7 @@ // GrB_mxm: matrix-matrix multiply //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,12 +32,12 @@ GrB_Info GrB_mxm // C = accum (C, A*B) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_mxm (C, M, accum, semiring, A, B, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (B) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, M_in, A, B, "GrB_mxm (C, M, accum, semiring, A, B, desc)") ; GB_BURBLE_START ("GrB_mxm") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (B) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, diff --git a/GraphBLAS/Source/mxm/GrB_mxv.c b/GraphBLAS/Source/mxm/GrB_mxv.c index 092b68cab6..70ad024da2 100644 --- a/GraphBLAS/Source/mxm/GrB_mxv.c +++ b/GraphBLAS/Source/mxm/GrB_mxv.c @@ -2,7 +2,7 @@ // GrB_mxv: matrix-vector multiply //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,12 +32,13 @@ GrB_Info GrB_mxv // w = accum (w, A*u) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_mxv (w, M, accum, semiring, A, u, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, M_in, A, u, "GrB_mxv (w, M, accum, semiring, A, u, desc)") ; GB_BURBLE_START ("GrB_mxv") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; ASSERT (GB_VECTOR_OK (u)) ; diff --git a/GraphBLAS/Source/mxm/GrB_vxm.c b/GraphBLAS/Source/mxm/GrB_vxm.c index c49f91e1c4..ece3cd0bc3 100644 --- a/GraphBLAS/Source/mxm/GrB_vxm.c +++ b/GraphBLAS/Source/mxm/GrB_vxm.c @@ -2,7 +2,7 @@ // GrB_vxm: vector-matrix multiply //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,12 +32,13 @@ GrB_Info GrB_vxm // w' = accum (w', u'*A) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_vxm (w, M, accum, semiring, u, A, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, M_in, u, A, "GrB_vxm (w, M, accum, semiring, u, A, desc)") ; GB_BURBLE_START ("GrB_vxm") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + ASSERT (GB_VECTOR_OK (w)) ; ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ; ASSERT (GB_VECTOR_OK (u)) ; diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_bitwise_factory.c b/GraphBLAS/Source/mxm/factory/GB_AxB_bitwise_factory.c index 9b01eba229..b59670e5f0 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_bitwise_factory.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_bitwise_factory.c @@ -2,7 +2,7 @@ // GB_AxB_bitwise_factory.c: switch factory for C=A*B (bitwise monoids) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_compare_factory.c b/GraphBLAS/Source/mxm/factory/GB_AxB_compare_factory.c index 452addf35b..3de7c3b920 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_compare_factory.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_compare_factory.c @@ -2,7 +2,7 @@ // GB_AxB_compare_factory.c: switch factory for C=A*B with comparator ops //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_phase1_template.c b/GraphBLAS/Source/mxm/factory/GB_AxB_dot3_phase1_template.c similarity index 77% rename from GraphBLAS/Source/mxm/template/GB_AxB_dot3_phase1_template.c rename to GraphBLAS/Source/mxm/factory/GB_AxB_dot3_phase1_template.c index ad764d8413..9cdc7f766b 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_phase1_template.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_dot3_phase1_template.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_phase1_template: analysis phase for dot3; C = A'*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,10 +45,22 @@ const int64_t j = k ; #else // M and C are either both sparse or both hypersparse - const int64_t j = GBH_C (Ch, k) ; + const int64_t j = GBh_C (Ch, k) ; #endif - GB_GET_VECTOR_M (pM, pM_end, pM, pM_end, Mp, k, mvlen) ; + int64_t pM, pM_end ; + if (fine_task) + { + // A fine task operates on a slice of M(:,k) + pM = TaskList [taskid].pM ; + pM_end = TaskList [taskid].pM_end ; + } + else + { + // vectors are never sliced for a coarse task + pM = GBp_M (Mp, k, mvlen) ; + pM_end = GBp_M (Mp, k+1, mvlen) ; + } //------------------------------------------------------------------ // get B(:,j) @@ -57,12 +69,13 @@ #if GB_B_IS_HYPER // B is hyper: find B(:,j) using the B->Y hyper hash int64_t pB_start, pB_end ; - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, - B_hash_bits, j, &pB_start, &pB_end) ; + GB_hyper_hash_lookup (Bp_is_32, Bj_is_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB_start, &pB_end) ; #elif GB_B_IS_SPARSE // B is sparse - const int64_t pB_start = Bp [j] ; - const int64_t pB_end = Bp [j+1] ; + const int64_t pB_start = GB_IGET (Bp, j) ; + const int64_t pB_end = GB_IGET (Bp, j+1) ; #else // B is bitmap or full const int64_t pB_start = j * vlen ; @@ -96,24 +109,26 @@ { for ( ; pM < pM_end ; pM++) { - int64_t work = 1 ; + float work = 1 ; #if !defined ( GB_MASK_SPARSE_STRUCTURAL_AND_NOT_COMPLEMENTED ) // if M is structural, no need to check its values if (GB_MCAST (Mx, pM, msize)) #endif { - const int64_t i = Mi [pM] ; #if GB_A_IS_HYPER // A is hyper: find A(:,i) using the A->Y hyper hash + const int64_t i = GB_IGET (Mi, pM) ; int64_t pA, pA_end ; - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, i, &pA, &pA_end) ; + GB_hyper_hash_lookup (Ap_is_32, Aj_is_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + i, &pA, &pA_end) ; const int64_t ainz = pA_end - pA ; work += GB_IMIN (ainz, bjnz) ; #elif GB_A_IS_SPARSE // A is sparse - const int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + const int64_t i = GB_IGET (Mi, pM) ; + const int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; const int64_t ainz = pA_end - pA ; work += GB_IMIN (ainz, bjnz) ; #else @@ -122,6 +137,7 @@ #endif } Cwork [pM] = work ; + } } } diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_dot_generic.c b/GraphBLAS/Source/mxm/factory/GB_AxB_dot_generic.c index 8550e0fb7b..c893418667 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_dot_generic.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_dot_generic.c @@ -2,7 +2,7 @@ // GB_AxB_dot_generic: generic template for all dot-product methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,13 +29,15 @@ GxB_index_binary_function fmult_idx = mult->idxbinop_function ; GxB_binary_function fadd = add->op->binop_function ; GB_Opcode opcode = mult->opcode ; - bool op_is_builtin_positional = - GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; +// bool op_is_builtin_positional = +// GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + ASSERT (C->type == add->op->ztype) ; size_t csize = C->type->size ; size_t asize = A_is_pattern ? 0 : A->type->size ; size_t bsize = B_is_pattern ? 0 : B->type->size ; + size_t zsize = csize ; // C->type always matches add->op->ztype size_t xsize = mult->xtype->size ; size_t ysize = mult->ytype->size ; @@ -90,32 +92,35 @@ #define GB_GETB(bkj,Bx,pB,B_iso) \ if (!B_is_pattern) cast_B (bkj, Bx +((B_iso) ? 0:(pB)*bsize), bsize) + // instead of GB_DECLARE_TERMINAL_CONST (zterminal): + GB_void *restrict zterminal = (GB_void *) add->terminal ; + GB_void *restrict zidentity = (GB_void *) add->identity ; + // define cij for each task - #undef GB_CIJ_DECLARE - #define GB_CIJ_DECLARE(cij) GB_void cij [GB_VLA(csize)] + #undef GB_DECLARE_IDENTITY + #define GB_DECLARE_IDENTITY(cij) \ + GB_void cij [GB_VLA(zsize)] ; \ + memcpy (cij, zidentity, zsize) - // Cx [p] = cij + // Cx [p] = cij (note csize == zsize) #undef GB_PUTC #define GB_PUTC(cij,Cx,p) memcpy (Cx +((p)*csize), cij, csize) - // instead of GB_DECLARE_TERMINAL_CONST (zterminal): - GB_void *restrict zterminal = (GB_void *) add->terminal ; - // break if cij reaches the terminal value #undef GB_IF_TERMINAL_BREAK #define GB_IF_TERMINAL_BREAK(z,zterminal) \ - if (is_terminal && memcmp (z, zterminal, csize) == 0) \ + if (is_terminal && memcmp (z, zterminal, zsize) == 0) \ { \ break ; \ } #undef GB_TERMINAL_CONDITION #define GB_TERMINAL_CONDITION(z,zterminal) \ - (is_terminal && memcmp (z, zterminal, csize) == 0) + (is_terminal && memcmp (z, zterminal, zsize) == 0) // C(i,j) += (A')(i,k) * B(k,j) #undef GB_MULTADD #define GB_MULTADD(cij, aki, bkj, i, k, j) \ - GB_void zwork [GB_VLA(csize)] ; \ + GB_void zwork [GB_VLA(zsize)] ; \ GB_MULT (zwork, aki, bkj, i, k, j) ; \ fadd (cij, cij, zwork) @@ -133,7 +138,7 @@ ASSERT (!flipxy) ; ASSERT (B_is_pattern) ; #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, csize) + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, zsize) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) @@ -147,7 +152,7 @@ ASSERT (!flipxy) ; ASSERT (A_is_pattern) ; #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, csize) + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, zsize) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_factory.c b/GraphBLAS/Source/mxm/factory/GB_AxB_factory.c index a65049d3c5..8351d10c51 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_factory.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_factory.c @@ -2,7 +2,7 @@ // GB_AxB_factory: switch factory for C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_positional_factory.c b/GraphBLAS/Source/mxm/factory/GB_AxB_positional_factory.c index bac7a97187..ce371af533 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_positional_factory.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_positional_factory.c @@ -2,7 +2,7 @@ // GB_AxB_positional_factory.c: switch factory for C=A*B for positional ops //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy3_symbolic_template.c b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy3_symbolic_template.c index 77f93a8d36..17517cabf6 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy3_symbolic_template.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy3_symbolic_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_symbolic_template: symbolic analysis for GB_AxB_saxpy3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,13 +48,13 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // get M, A, B, and C //-------------------------------------------------------------------------- - int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; const int64_t cvlen = C->vlen ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE_U (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; const int64_t bvlen = B->vlen ; ASSERT (GB_B_IS_SPARSE == GB_IS_SPARSE (B)) ; @@ -62,10 +62,10 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) ASSERT (GB_B_IS_BITMAP == GB_IS_BITMAP (B)) ; ASSERT (GB_B_IS_FULL == GB_IS_FULL (B)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE_U (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; const bool A_jumbled = A->jumbled ; @@ -74,19 +74,25 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) ASSERT (GB_A_IS_HYPER == GB_IS_HYPERSPARSE (A)) ; ASSERT (GB_A_IS_BITMAP == GB_IS_BITMAP (A)) ; ASSERT (GB_A_IS_FULL == GB_IS_FULL (A)) ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ai_IS_32 Ai_is_32 #if GB_A_IS_HYPER - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; + #define GB_Ap_IS_32 Ap_is_32 + #define GB_Aj_IS_32 Aj_is_32 #endif #if ( !GB_NO_MASK ) - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE_U (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; size_t msize = M->type->size ; int64_t mnvec = M->nvec ; @@ -95,10 +101,14 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) const bool M_is_bitmap = GB_IS_BITMAP (M) ; const bool M_jumbled = GB_JUMBLED (M) ; // get the M hyper_hash - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; + #define GB_Mp_IS_32 Mp_is_32 + #define GB_Mj_IS_32 Mj_is_32 #endif //========================================================================== @@ -117,7 +127,7 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // get the task descriptor //---------------------------------------------------------------------- - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; bool use_Gustavson = (hash_size == cvlen) ; if (taskid < nfine) @@ -135,7 +145,8 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) //-------------------------------------------------------------- int64_t kk = SaxpyTasks [taskid].vector ; - int64_t bjnz = (Bp == NULL) ? bvlen : (Bp [kk+1] - Bp [kk]) ; + int64_t bjnz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kk+1) - GB_IGET (Bp, kk)) ; // no work to do if B(:,j) is empty if (bjnz == 0) continue ; @@ -192,23 +203,23 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // h == 0, f == 0: unoccupied and unlocked // h == i+1, f == 1: occupied with M(i,j)=1 - int64_t *restrict - Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; - int64_t hash_bits = (hash_size-1) ; + uint64_t *restrict + Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf ; + uint64_t hash_bits = (hash_size-1) ; // scan this task's M(:,j) for (int64_t pM = mystart ; pM < myend ; pM++) { GB_GET_M_ij (pM) ; // get M(i,j) if (!mij) continue ; // skip if M(i,j)=0 - int64_t i = GBI_M (Mi, pM, mvlen) ; - int64_t i_mine = ((i+1) << 2) + 1 ; // ((i+1),1) + uint64_t i = GBi_M (Mi, pM, mvlen) ; + uint64_t i_mine = ((i+1) << 2) + 1 ; // ((i+1),1) for (GB_HASH (i)) { - int64_t hf ; + uint64_t hf ; // swap this task's hash entry into the hash table; // does the following using an atomic capture: // { hf = Hf [hash] ; Hf [hash] = i_mine ; } - GB_ATOMIC_CAPTURE_INT64 (hf, Hf [hash], i_mine) ; + GB_ATOMIC_CAPTURE_UINT64 (hf, Hf [hash], i_mine) ; if (hf == 0) break ; // success // i_mine has been inserted, but a prior entry was // already there. It needs to be replaced, so take @@ -229,11 +240,11 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // coarse tasks: compute nnz in each vector of A*B(:,kfirst:klast) //------------------------------------------------------------------ - int64_t *restrict - Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; + uint64_t *restrict + Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf ; int64_t kfirst = SaxpyTasks [taskid].start ; int64_t klast = SaxpyTasks [taskid].end ; - int64_t mark = 0 ; + uint64_t mark = 0 ; if (use_Gustavson) { @@ -267,8 +278,8 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // phase1: coarse hash task //-------------------------------------------------------------- - int64_t *restrict Hi = SaxpyTasks [taskid].Hi ; - int64_t hash_bits = (hash_size-1) ; + uint64_t *restrict Hi = SaxpyTasks [taskid].Hi ; + uint64_t hash_bits = (hash_size-1) ; #if ( GB_NO_MASK ) { @@ -446,10 +457,11 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) { int64_t kk = SaxpyTasks [taskid].vector ; ASSERT (kk >= 0 && kk < B->nvec) ; - int64_t bjnz = (Bp == NULL) ? bvlen : (Bp [kk+1] - Bp [kk]) ; + int64_t bjnz = (Bp == NULL) ? bvlen : + (GB_IGET (Bp, kk+1) - GB_IGET (Bp, kk)) ; // no work to do if B(:,j) is empty if (bjnz == 0) continue ; - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; bool use_Gustavson = (hash_size == cvlen) ; int leader = SaxpyTasks [taskid].leader ; if (leader != taskid) continue ; @@ -470,7 +482,7 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) for (int64_t pM = pM_start ; pM < pM_end ; pM++) { GB_GET_M_ij (pM) ; // get M(i,j) - int64_t i = GBI_M (Mi, pM, mvlen) ; + uint64_t i = GBi_M (Mi, pM, mvlen) ; ASSERT (Hf [i] == mij) ; } for (int64_t i = 0 ; i < cvlen ; i++) @@ -485,19 +497,19 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) // phase1: fine hash task, C=A*B or C=A*B // h == 0, f == 0: unoccupied and unlocked // h == i+1, f == 1: occupied with M(i,j)=1 - int64_t *restrict - Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; - int64_t hash_bits = (hash_size-1) ; + uint64_t *restrict + Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf ; + uint64_t hash_bits = (hash_size-1) ; for (int64_t pM = pM_start ; pM < pM_end ; pM++) { GB_GET_M_ij (pM) ; // get M(i,j) if (!mij) continue ; // skip if M(i,j)=0 - int64_t i = GBI_M (Mi, pM, mvlen) ; - int64_t i_mine = ((i+1) << 2) + 1 ; // ((i+1),1) + uint64_t i = GBi_M (Mi, pM, mvlen) ; + uint64_t i_mine = ((i+1) << 2) + 1 ; // ((i+1),1) int64_t probe = 0 ; for (GB_HASH (i)) { - int64_t hf = Hf [hash] ; + uint64_t hf = Hf [hash] ; if (hf == i_mine) { mjcount2++ ; @@ -510,11 +522,11 @@ void GB_EVAL2 (GB (AxB_saxpy3_sym), GB_MASK_A_B_SUFFIX) } ASSERT (mjcount == mjcount2) ; mjcount2 = 0 ; - for (int64_t hash = 0 ; hash < hash_size ; hash++) + for (uint64_t hash = 0 ; hash < hash_size ; hash++) { - int64_t hf = Hf [hash] ; - int64_t h = (hf >> 2) ; // empty (0), or a 1-based - int64_t f = (hf & 3) ; // 0 if empty or 1 if occupied + uint64_t hf = Hf [hash] ; + uint64_t h = (hf >> 2) ; // empty (0), or a 1-based index + uint64_t f = (hf & 3) ; // 0 if empty or 1 if occupied if (f == 1) ASSERT (h >= 1 && h <= cvlen) ; ASSERT (hf == 0 || f == 1) ; if (f == 1) mjcount2++ ; diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy5_meta.c b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy5_meta.c index 9a48d43859..cd4851405f 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy5_meta.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy5_meta.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5_meta.c: C+=A*B when C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_method.c b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_method.c index 97542855dc..45a3bf264b 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_method.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_method.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy_generic_method: C=A*B, C=A*B, or C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,7 +45,6 @@ //------------------------------------------------------------------------------ #include "mxm/GB_AxB_saxpy.h" -#include "slice/GB_ek_slice.h" #include "binaryop/GB_binop.h" #include "assign/GB_bitmap_assign_methods.h" #include "mxm/include/GB_mxm_shared_definitions.h" diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_template.c b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_template.c index a67965b82d..9efab4b261 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_template.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_saxpy_generic_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy_generic_template: C=A*B, C=A*B, or C=A*B via saxpy method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/factory/GB_AxB_type_factory.c b/GraphBLAS/Source/mxm/factory/GB_AxB_type_factory.c index 68e988eaa4..9b500d31bc 100644 --- a/GraphBLAS/Source/mxm/factory/GB_AxB_type_factory.c +++ b/GraphBLAS/Source/mxm/factory/GB_AxB_type_factory.c @@ -2,7 +2,7 @@ // GB_AxB_type_factory.c: switch factory for C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/include/GB_AxB_dot_cij.h b/GraphBLAS/Source/mxm/include/GB_AxB_dot_cij.h index e9bb1b28fd..9cd47903fc 100644 --- a/GraphBLAS/Source/mxm/include/GB_AxB_dot_cij.h +++ b/GraphBLAS/Source/mxm/include/GB_AxB_dot_cij.h @@ -2,7 +2,7 @@ // GB_AxB_dot_cij.h: definitions for GB_AxB_dot*_cij.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/include/GB_AxB_macros.h b/GraphBLAS/Source/mxm/include/GB_AxB_macros.h index 9c9a3a728b..be966b39bb 100644 --- a/GraphBLAS/Source/mxm/include/GB_AxB_macros.h +++ b/GraphBLAS/Source/mxm/include/GB_AxB_macros.h @@ -2,7 +2,7 @@ // GB_AxB_macros.h: macros for GB_AxB_saxpy and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/include/GB_AxB_saxpy3_template.h b/GraphBLAS/Source/mxm/include/GB_AxB_saxpy3_template.h index c70fc1247e..d1e22ba411 100644 --- a/GraphBLAS/Source/mxm/include/GB_AxB_saxpy3_template.h +++ b/GraphBLAS/Source/mxm/include/GB_AxB_saxpy3_template.h @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_template.h: C=A*B, C=A*B, or C=A*B via saxpy3 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,15 +24,16 @@ if (M_is_hyper) \ { \ /* M is hypersparse: find M(:,j) in the M->Y hyper_hash */ \ - GB_hyper_hash_lookup (Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, \ - GBH_B (Bh, kk), &pM_start, &pM_end) ; \ + GB_hyper_hash_lookup (GB_Mp_IS_32, GB_Mj_IS_32, \ + Mh, mnvec, Mp, M_Yp, M_Yi, M_Yx, M_hash_bits, \ + GBh_B (Bh, kk), &pM_start, &pM_end) ; \ } \ else \ { \ /* A is sparse, bitmap, or full */ \ - int64_t j = GBH_B (Bh, kk) ; \ - pM_start = GBP_M (Mp, j , mvlen) ; \ - pM_end = GBP_M (Mp, j+1, mvlen) ; \ + int64_t j = GBh_B (Bh, kk) ; \ + pM_start = GBp_M (Mp, j , mvlen) ; \ + pM_end = GBp_M (Mp, j+1, mvlen) ; \ } \ const int64_t mjnz = pM_end - pM_start @@ -59,7 +60,7 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* if (M (i,j) == 1) mark Hf [i] */ \ - if (Mb [pM] && Mxx [pM]) Hf [GBI_M (Mi, pM, mvlen)] = mark ;\ + if (Mb [pM] && Mxx [pM]) Hf [GBi_M (Mi, pM, mvlen)] = mark ;\ } \ } \ else \ @@ -68,7 +69,7 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* if (M (i,j) == 1) mark Hf [i] */ \ - if (Mxx [pM]) Hf [GBI_M (Mi, pM, mvlen)] = mark ; \ + if (Mxx [pM]) Hf [GBi_M (Mi, pM, mvlen)] = mark ; \ } \ } \ } \ @@ -87,9 +88,9 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* if (M (i,j) is present) mark Hf [i] */ \ - if (GBB_M (Mb,pM) && GB_MCAST (Mx,pM,)) \ + if (GBb_M (Mb,pM) && GB_MCAST (Mx,pM,)) \ { \ - Hf [GBI_M (Mi, pM, mvlen)] = mark ; \ + Hf [GBi_M (Mi, pM, mvlen)] = mark ; \ } \ } @@ -106,7 +107,7 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* if (M (i,j) is present) mark Hf [i] */ \ - if (Mb [pM]) Hf [GBI_M (Mi, pM, mvlen)] = mark ; \ + if (Mb [pM]) Hf [GBi_M (Mi, pM, mvlen)] = mark ; \ } \ } \ else \ @@ -115,7 +116,7 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* mark Hf [i] */ \ - Hf [GBI_M (Mi, pM, mvlen)] = mark ; \ + Hf [GBi_M (Mi, pM, mvlen)] = mark ; \ } \ } \ } \ @@ -139,11 +140,11 @@ for (int64_t pM = pMstart ; pM < pMend ; pM++) \ { \ /* if (M (i,j) == 1) mark Hf [i] */ \ - if (!GBB_M (Mb, pM)) continue ; \ + if (!GBb_M (Mb, pM)) continue ; \ if (Mxx [2*pM] || Mxx [2*pM+1]) \ { \ /* Hf [i] = M(i,j) */ \ - Hf [GBI_M (Mi, pM, mvlen)] = mark ; \ + Hf [GBi_M (Mi, pM, mvlen)] = mark ; \ } \ } \ } \ @@ -162,7 +163,7 @@ { \ GB_GET_M_ij (pM) ; /* get M(i,j) */ \ if (!mij) continue ; /* skip if M(i,j)=0 */ \ - const int64_t i = GBI_M (Mi, pM, mvlen) ; \ + const uint64_t i = GBi_M (Mi, pM, mvlen) ; \ for (GB_HASH (i)) /* find i in hash */ \ { \ if (Hf [hash] < mark) \ @@ -191,13 +192,14 @@ //------------------------------------------------------------------------------ // prepare to iterate over the vector B(:,j), the (kk)th vector in B, where -// j == GBH_B (Bh, kk). This macro works regardless of the sparsity of A and B. +// j == GBh_B (Bh, kk). This macro works regardless of the sparsity of A and B. #define GB_GET_B_j_FOR_ALL_FORMATS(A_is_hyper,B_is_sparse,B_is_hyper) \ - const int64_t j = (B_is_hyper) ? Bh [kk] : kk ; \ + const int64_t j = (B_is_hyper) ? GB_IGET (Bh, kk) : kk ; \ GB_GET_T_FOR_SECONDJ ; /* t = j for SECONDJ, or j+1 for SECONDJ1 */ \ - int64_t pB = (B_is_sparse || B_is_hyper) ? Bp [kk] : (kk * bvlen) ; \ + int64_t pB = (B_is_sparse || B_is_hyper) ? \ + GB_IGET (Bp, kk) : (kk * bvlen) ; \ const int64_t pB_end = \ - (B_is_sparse || B_is_hyper) ? Bp [kk+1] : (pB+bvlen) ; \ + (B_is_sparse || B_is_hyper) ? GB_IGET (Bp, kk+1) : (pB+bvlen) ; \ const int64_t bjnz = pB_end - pB ; /* nnz (B (:,j) */ //------------------------------------------------------------------------------ @@ -229,14 +231,15 @@ if (A_is_hyper) \ { \ /* A is hypersparse: find A(:,k) in the A->Y hyper_hash */ \ - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, \ + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, \ + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, \ k, &pA_start, &pA_end) ; \ } \ else \ { \ /* A is sparse, bitmap, or full */ \ - pA_start = GBP_A (Ap, k , avlen) ; \ - pA_end = GBP_A (Ap, k+1, avlen) ; \ + pA_start = GBp_A (Ap, k , avlen) ; \ + pA_end = GBp_A (Ap, k+1, avlen) ; \ } \ const int64_t aknz = pA_end - pA_start @@ -246,7 +249,7 @@ #define GB_GET_M_ij(pM) \ /* get M(i,j), at Mi [pM] and Mx [pM] */ \ - bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) + bool mij = GBb_M (Mb, pM) && GB_MCAST (Mx, pM, msize) //------------------------------------------------------------------------------ // GB_MULT_A_ik_B_kj: declare t and compute t = A(i,k) * B(k,j) @@ -291,7 +294,8 @@ { \ if (Hf [i] == mark) \ { \ - Ci [pC++] = i ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + pC++ ; \ } \ } @@ -304,7 +308,8 @@ if (Hf [i] == mark) \ { \ GB_CIJ_GATHER (pC, i) ; /* Cx [pC] = Hx [i] */ \ - Ci [pC++] = i ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + pC++ ; \ } \ } @@ -317,11 +322,25 @@ // Only coarse tasks do the optional sort. Fine hash tasks always leave C // jumbled. +#ifdef GB_JIT_KERNEL + #define GB_QSORT_1(Ci,p,cjnz) GB_qsort_1_kernel (Ci + p, cjnz) ; +#else + #define GB_QSORT_1(Ci,p,cjnz) \ + if (Ci_is_32) \ + { \ + GB_qsort_1_32 (Ci32 + p, cjnz) ; \ + } \ + else \ + { \ + GB_qsort_1_64 (Ci64 + p, cjnz) ; \ + } +#endif + #define GB_SORT_C_j_PATTERN \ if (do_sort) \ { \ /* sort the pattern of C(:,j) (non-default) */ \ - GB_qsort_1 (Ci + Cp [kk], cjnz) ; \ + GB_QSORT_1 (Ci, pC_start, cjnz) ; \ } \ else \ { \ @@ -344,13 +363,15 @@ // typical semiring #define GB_SORT_AND_GATHER_C_j \ + { \ GB_SORT_C_j_PATTERN ; \ /* gather the values into C(:,j) */ \ - for (int64_t pC = Cp [kk] ; pC < Cp [kk+1] ; pC++) \ + for (int64_t pC = pC_start ; pC < pC_end ; pC++) \ { \ - const int64_t i = Ci [pC] ; \ + const int64_t i = GB_IGET (Ci, pC) ; \ GB_CIJ_GATHER (pC, i) ; /* Cx [pC] = Hx [i] */ \ - } + } \ + } #endif @@ -368,10 +389,11 @@ // gather the values of C(:,j) for a coarse hash task #define GB_SORT_AND_GATHER_HASHED_C_j(hash_mark) \ + { \ GB_SORT_C_j_PATTERN ; \ - for (int64_t pC = Cp [kk] ; pC < Cp [kk+1] ; pC++) \ + for (int64_t pC = pC_start ; pC < pC_end ; pC++) \ { \ - const int64_t i = Ci [pC] ; \ + const uint64_t i = GB_IGET (Ci, pC) ; \ for (GB_HASH (i)) /* find i in hash table */ \ { \ if (Hf [hash] == (hash_mark) && (Hi [hash] == i)) \ @@ -382,8 +404,8 @@ break ; \ } \ } \ - } - + } \ + } #endif //------------------------------------------------------------------------------ @@ -579,13 +601,13 @@ // which expands into the following, where f(i) is the GB_HASHF(i) hash // function: // -// for (int64_t hash = f(i) ; ; hash = (hash+1)&(hash_size-1)) +// for (uint64_t hash = f(i) ; ; hash = (hash+1)&(hash_size-1)) // { // ... // } #define GB_HASH(i) \ - int64_t hash = GB_HASHF (i,hash_bits) ; ; GB_REHASH (hash,i,hash_bits) + uint64_t hash = GB_HASHF (i,hash_bits) ; ; GB_REHASH (hash,i,hash_bits) //------------------------------------------------------------------------------ // define macros for any sparsity of A and B diff --git a/GraphBLAS/Source/mxm/include/GB_meta16_definitions.h b/GraphBLAS/Source/mxm/include/GB_meta16_definitions.h index f6e3c9ee23..a87cb22cc0 100644 --- a/GraphBLAS/Source/mxm/include/GB_meta16_definitions.h +++ b/GraphBLAS/Source/mxm/include/GB_meta16_definitions.h @@ -2,7 +2,7 @@ // GB_meta16_definitions.h: methods that depend on the sparsity of A and B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,9 +30,9 @@ // B is sparse #define GB_GET_B_j \ - const int64_t j = kk ; \ - int64_t pB = Bp [kk] ; \ - const int64_t pB_end = Bp [kk+1] ; \ + const uint64_t j = kk ; \ + int64_t pB = GB_IGET (Bp, kk) ; \ + const int64_t pB_end = GB_IGET (Bp, kk+1) ; \ const int64_t bjnz = pB_end - pB ; \ GB_GET_T_FOR_SECONDJ @@ -40,7 +40,7 @@ // B is bitmap or full #define GB_GET_B_j \ - const int64_t j = kk ; \ + const uint64_t j = kk ; \ int64_t pB = kk * bvlen ; \ const int64_t pB_end = pB + bvlen ; \ const int64_t bjnz = bvlen ; \ @@ -70,20 +70,20 @@ // B is hyper or sparse #define GB_GET_B_kj_INDEX \ - const int64_t k = Bi [pB] + const uint64_t k = GB_IGET (Bi, pB) #elif ( GB_B_IS_BITMAP ) // B is bitmap #define GB_GET_B_kj_INDEX \ if (!Bb [pB]) continue ; \ - const int64_t k = pB % bvlen + const uint64_t k = pB % bvlen #else // B is full #define GB_GET_B_kj_INDEX \ - const int64_t k = pB % bvlen + const uint64_t k = pB % bvlen #endif @@ -91,8 +91,8 @@ // for any format of B #define GB_GET_B_kj_INDEX \ - if (!GBB_B (Bb, pB)) continue ; \ - const int64_t k = GBI_B (Bi, pB, bvlen) + if (!GBb_B (Bb, pB)) continue ; \ + const uint64_t k = GBi_B (Bi, pB, bvlen) #endif @@ -113,8 +113,8 @@ // A is sparse #define GB_GET_A_k \ - const int64_t pA_start = Ap [k] ; \ - const int64_t pA_end = Ap [k+1] ; \ + const int64_t pA_start = GB_IGET (Ap, k) ; \ + const int64_t pA_end = GB_IGET (Ap, k+1) ; \ const int64_t aknz = pA_end - pA_start #else @@ -146,20 +146,20 @@ // A is hyper or sparse #define GB_GET_A_ik_INDEX \ - const int64_t i = Ai [pA] + const uint64_t i = GB_IGET (Ai, pA) #elif ( GB_A_IS_BITMAP ) // A is bitmap #define GB_GET_A_ik_INDEX \ if (!Ab [pA]) continue ; \ - const int64_t i = pA % avlen + const uint64_t i = pA % avlen #else // A is full #define GB_GET_A_ik_INDEX \ - const int64_t i = pA % avlen + const uint64_t i = pA % avlen #endif @@ -167,8 +167,8 @@ // for any format of A #define GB_GET_A_ik_INDEX \ - if (!GBB_A (Ab, pA)) continue ; \ - const int64_t i = GBI_A (Ai, pA, avlen) + if (!GBb_A (Ab, pA)) continue ; \ + const uint64_t i = GBi_A (Ai, pA, avlen) #endif @@ -184,12 +184,16 @@ #if GB_IS_ANY_PAIR_SEMIRING // ANY_PAIR: result is purely symbolic; no numeric work to do - #define GB_COMPUTE_C_j_WHEN_NNZ_B_j_IS_ONE \ - ASSERT (A_is_sparse || A_is_hyper) ; \ - GB_GET_B_kj_INDEX ; /* get index k of B(k,j) */ \ - GB_GET_A_k ; /* get A(:,k) */ \ - memcpy (Ci + pC, Ai + pA_start, aknz * sizeof (int64_t)) ; \ - /* C becomes jumbled if A is jumbled */ \ + #define GB_COMPUTE_C_j_WHEN_NNZ_B_j_IS_ONE \ + ASSERT (A_is_sparse || A_is_hyper) ; \ + GB_GET_B_kj_INDEX ; /* get index k of B(k,j) */ \ + GB_GET_A_k ; /* get A(:,k) */ \ + for (int64_t kk = 0 ; kk < aknz ; kk++) \ + { \ + uint64_t i = GB_IGET (Ai, pA_start + kk) ; \ + GB_ISET (Ci, pC + kk, i) ; \ + } \ + /* C becomes jumbled if A is jumbled */ \ task_C_jumbled = task_C_jumbled || A_jumbled ; #else @@ -204,9 +208,10 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) \ { \ GB_GET_A_ik_INDEX ; /* get index i of A(i,k) */ \ - GB_MULT_A_ik_B_kj ; /* t = A(i,k)*B(k,j) */ \ - GB_CIJ_WRITE (pC, t) ; /* Cx [pC] = t */ \ - Ci [pC++] = i ; \ + GB_MULT_A_ik_B_kj ; /* t = A(i,k)*B(k,j) */ \ + GB_CIJ_WRITE (pC, t) ; /* Cx [pC] = t */ \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + pC++ ; \ } \ /* C becomes jumbled if A is jumbled */ \ task_C_jumbled = task_C_jumbled || A_jumbled ; @@ -229,7 +234,7 @@ #define GB_COMPUTE_DENSE_C_j \ for (int64_t i = 0 ; i < cvlen ; i++) \ { \ - Ci [pC + i] = i ; \ + GB_ISET (Ci, pC + i, i) ; /* Ci [pC + i] = i */ \ } #else @@ -238,7 +243,7 @@ #define GB_COMPUTE_DENSE_C_j \ for (int64_t i = 0 ; i < cvlen ; i++) \ { \ - Ci [pC + i] = i ; \ + GB_ISET (Ci, pC + i, i) ; /* Ci [pC + i] = i */ \ GB_CIJ_WRITE (pC + i, zidentity) ; /* C(i,j)=0 */ \ } \ for ( ; pB < pB_end ; pB++) /* scan B(:,j) */ \ @@ -278,16 +283,16 @@ { \ GB_GET_M_ij (pM) ; /* get M(i,j) */ \ if (!mij) continue ; /* skip if M(i,j)=0 */ \ - int64_t i = Mi [pM] ; \ + uint64_t i = GB_IGET (Mi, pM) ; \ bool found ; /* search for A(i,k) */ \ if (M_jumbled) pA = pA_start ; \ int64_t apright = pA_end - 1 ; \ - GB_BINARY_SEARCH (i, Ai, pA, apright, found) ; \ + found = GB_binary_search (i, Ai, GB_Ai_IS_32, &pA, &apright) ; \ if (found) \ { \ /* C(i,j) += A(i,k) * B(k,j) for this method. */ \ /* M(i,j) is always 1, as given in the hash table */ \ - GB_IKJ ; \ + GB_UPDATE_IKJ ; \ } \ } \ } \ @@ -301,7 +306,7 @@ GB_GET_A_ik_INDEX ; /* get index i of A(i,j) */ \ /* do C(i,j) += A(i,k) * B(k,j) for this method */ \ /* M(i,j) may be 0 or 1, as given in the hash table */ \ - GB_IKJ ; \ + GB_UPDATE_IKJ ; \ } \ } \ } diff --git a/GraphBLAS/Source/mxm/include/GB_mxm_shared_definitions.h b/GraphBLAS/Source/mxm/include/GB_mxm_shared_definitions.h index 5b530993c6..8ed47b3f83 100644 --- a/GraphBLAS/Source/mxm/include/GB_mxm_shared_definitions.h +++ b/GraphBLAS/Source/mxm/include/GB_mxm_shared_definitions.h @@ -2,7 +2,7 @@ // GB_mxm_shared_definitions.h: common macros for A*B kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/include/GB_saxpy3task_struct.h b/GraphBLAS/Source/mxm/include/GB_saxpy3task_struct.h index ac11efbe30..c5de769b98 100644 --- a/GraphBLAS/Source/mxm/include/GB_saxpy3task_struct.h +++ b/GraphBLAS/Source/mxm/include/GB_saxpy3task_struct.h @@ -2,7 +2,7 @@ // GB_saxpy3task_struct.h: definitions for C=A*B saxpy3 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,9 +17,9 @@ typedef struct int64_t start ; // starting vector for coarse task, p for fine task int64_t end ; // ending vector for coarse task, p for fine task int64_t vector ; // -1 for coarse task, vector j for fine task - int64_t hsize ; // size of hash table - int64_t *Hi ; // Hi array for hash table (coarse hash tasks only) - GB_void *Hf ; // Hf array for hash table (int8_t or int64_t) + uint64_t hsize ; // size of hash table + uint64_t *Hi ; // Hi array for hash table (coarse hash tasks only) + GB_void *Hf ; // Hf array for hash table (int8_t or uint64_t) GB_void *Hx ; // Hx array for hash table int64_t my_cjnz ; // # entries in C(:,j) found by this fine task int leader ; // leader fine task for the vector C(:,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot2_meta.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot2_meta.c index 32532da4fa..ee74fc8f57 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot2_meta.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot2_meta.c @@ -2,7 +2,7 @@ // GB_AxB_dot2_meta: C=A'*B, C=A'*B or C=A'*B via dot products //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,14 +29,14 @@ int8_t *restrict Cb = C->b ; const int64_t cvlen = C->vlen ; #ifdef GB_JIT_KERNEL - #define C_is_full GB_C_IS_FULL + #define C_is_full GB_C_IS_FULL #else const bool C_is_full = (Cb == NULL) ; #endif - const int64_t *restrict Bp = B->p ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; #ifdef GB_JIT_KERNEL #define B_is_bitmap GB_B_IS_BITMAP #define B_is_sparse GB_B_IS_SPARSE @@ -47,14 +47,15 @@ const bool B_is_sparse = GB_IS_SPARSE (B) ; const bool B_is_full = GB_IS_FULL (B) ; const bool B_iso = B->iso ; + const bool Bi_is_32 = B->i_is_32 ; + #define GB_Bi_IS_32 Bi_is_32 #endif ASSERT (!GB_IS_HYPERSPARSE (B)) ; #define B_is_hyper false - const int64_t *restrict Ap = A->p ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; - #ifdef GB_JIT_KERNEL #define A_is_bitmap GB_A_IS_BITMAP #define A_is_sparse GB_A_IS_SPARSE @@ -65,6 +66,8 @@ const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_is_full = GB_IS_FULL (A) ; const bool A_iso = A->iso ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ai_IS_32 Ai_is_32 #endif ASSERT (!GB_IS_HYPERSPARSE (A)) ; #define A_is_hyper false diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot2_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot2_template.c index c8616e197d..6ae42567de 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot2_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot2_template.c @@ -2,7 +2,7 @@ // GB_AxB_dot2_template: C<#M>=A'*B, or C<#M>=A*B via dot products //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -105,8 +105,8 @@ #if GB_B_IS_SPARSE // B is sparse (never hypersparse) - const int64_t pB_start = Bp [j] ; - const int64_t pB_end = Bp [j+1] ; + const int64_t pB_start = GB_IGET (Bp, j) ; + const int64_t pB_end = GB_IGET (Bp, j+1) ; const int64_t bjnz = pB_end - pB_start ; if (bjnz == 0) { @@ -116,8 +116,8 @@ } #if GB_A_IS_SPARSE // Both A and B are sparse; get first and last in B(:,j) - const int64_t ib_first = Bi [pB_start] ; - const int64_t ib_last = Bi [pB_end-1] ; + const int64_t ib_first = GB_IGET (Bi, pB_start) ; + const int64_t ib_last = GB_IGET (Bi, pB_end-1) ; #endif #else // B is bitmap or full @@ -189,8 +189,8 @@ #if GB_A_IS_SPARSE // A is sparse - int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; const int64_t ainz = pA_end - pA ; #if (!GB_C_IS_FULL) if (ainz > 0) // skip this test if C is full @@ -208,10 +208,7 @@ { // C(i,j) = A(:,i)'*B(:,j) or A(i,:)*B(:,j) bool cij_exists = false ; - GB_CIJ_DECLARE (cij) ; - #if GB_IS_PLUS_PAIR_REAL_SEMIRING - cij = 0 ; - #endif + GB_DECLARE_IDENTITY (cij) ; #include "template/GB_AxB_dot_cij.c" } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_meta.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot3_meta.c index 2d3a832356..7e55927d8f 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_meta.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot3_meta.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_meta: C=A'*B via dot products, where C is sparse/hypersparse //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,34 +21,34 @@ // GB_DOT_ALWAYS_SAVE_CIJ: C(i,j) = cij #if GB_CIJ_CHECK - #define GB_DOT_ALWAYS_SAVE_CIJ \ - { \ - cij_exists = true ; \ - /* Cx [pC] = cij */ \ - GB_PUTC (cij, Cx, pC) ; \ - Ci [pC] = i ; \ + #define GB_DOT_ALWAYS_SAVE_CIJ \ + { \ + cij_exists = true ; \ + /* Cx [pC] = cij */ \ + GB_PUTC (cij, Cx, pC) ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ } #else - #define GB_DOT_ALWAYS_SAVE_CIJ \ - { \ - /* Cx [pC] = cij */ \ - GB_PUTC (cij, Cx, pC) ; \ - Ci [pC] = i ; \ + #define GB_DOT_ALWAYS_SAVE_CIJ \ + { \ + /* Cx [pC] = cij */ \ + GB_PUTC (cij, Cx, pC) ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ } #endif // GB_DOT_SAVE_CIJ: C(i,j) = cij, if it exists -#define GB_DOT_SAVE_CIJ \ -{ \ - if (GB_CIJ_EXISTS) \ - { \ - /* Cx [pC] = cij */ \ - GB_PUTC (cij, Cx, pC) ; \ - Ci [pC] = i ; \ - } \ +#define GB_DOT_SAVE_CIJ \ +{ \ + if (GB_CIJ_EXISTS) \ + { \ + /* Cx [pC] = cij */ \ + GB_PUTC (cij, Cx, pC) ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + } \ } { @@ -63,15 +63,16 @@ int64_t nzombies = 0 ; ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; - const int64_t *restrict Cp = C->p ; - const int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; + + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, const) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; const int64_t cvlen = C->vlen ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; const int64_t bnvec = B->nvec ; #ifdef GB_JIT_KERNEL @@ -85,12 +86,18 @@ const bool B_is_bitmap = GB_IS_BITMAP (B) ; const bool B_is_sparse = GB_IS_SPARSE (B) ; const bool B_iso = B->iso ; + const bool Bp_is_32 = B->p_is_32 ; + const bool Bj_is_32 = B->j_is_32 ; + const bool Bi_is_32 = B->i_is_32 ; + #define GB_Bp_IS_32 Bp_is_32 + #define GB_Bj_IS_32 Bj_is_32 + #define GB_Bi_IS_32 Bi_is_32 #endif - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; const int64_t anvec = A->nvec ; #ifdef GB_JIT_KERNEL @@ -104,16 +111,22 @@ const bool A_is_bitmap = GB_IS_BITMAP (A) ; const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_iso = A->iso ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ap_IS_32 Ap_is_32 + #define GB_Aj_IS_32 Aj_is_32 + #define GB_Ai_IS_32 Ai_is_32 #endif - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - const int64_t *restrict B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; - const int64_t *restrict B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; - const int64_t *restrict B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; + const void *B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; + const void *B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; + const void *B_Yx = (B->Y == NULL) ? NULL : B->Y->x ; const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; #if !GB_A_IS_PATTERN @@ -133,7 +146,7 @@ #define Mask_struct GB_MASK_STRUCT #endif - const int64_t *restrict Mi = M->i ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; const size_t mvlen = M->vlen ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot3_template.c index bb6d7a82dc..7ec3f91f9a 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot3_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot3_template.c @@ -2,7 +2,7 @@ // GB_AxB_dot3_template: C=A'*B via dot products, where C is sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,11 +44,11 @@ const int64_t j = k ; #else // M and C are either both sparse or both hypersparse - const int64_t j = GBH_C (Ch, k) ; + const int64_t j = GBh_C (Ch, k) ; #endif - int64_t pC_start = Cp [k] ; - int64_t pC_end = Cp [k+1] ; + int64_t pC_start = GB_IGET (Cp, k) ; + int64_t pC_end = GB_IGET (Cp, k+1) ; if (k == kfirst) { // First vector for task; may only be partially owned. @@ -72,12 +72,13 @@ #if GB_B_IS_HYPER // B is hyper: find B(:,j) using the B->Y hyper hash int64_t pB_start, pB_end ; - GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, - B_hash_bits, j, &pB_start, &pB_end) ; + GB_hyper_hash_lookup (GB_Bp_IS_32, GB_Bj_IS_32, + Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB_start, &pB_end) ; #elif GB_B_IS_SPARSE // B is sparse - const int64_t pB_start = Bp [j] ; - const int64_t pB_end = Bp [j+1] ; + const int64_t pB_start = GB_IGET (Bp, j) ; + const int64_t pB_end = GB_IGET (Bp, j+1) ; #else // B is bitmap or full const int64_t pB_start = j * vlen ; @@ -92,15 +93,16 @@ for (int64_t pC = pC_start ; pC < pC_end ; pC++) { // C(i,j) is a zombie - int64_t i = Mi [pC] ; - Ci [pC] = GB_ZOMBIE (i) ; + int64_t i = GB_IGET (Mi, pC) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i } continue ; } #if (GB_A_IS_SPARSE || GB_A_IS_HYPER) // Both A and B are sparse; get first and last in B(:,j) - const int64_t ib_first = Bi [pB_start] ; - const int64_t ib_last = Bi [pB_end-1] ; + const int64_t ib_first = GB_IGET (Bi, pB_start) ; + const int64_t ib_last = GB_IGET (Bi, pB_end-1) ; #endif #endif @@ -116,13 +118,10 @@ //-------------------------------------------------------------- bool cij_exists = false ; - GB_CIJ_DECLARE (cij) ; - #if GB_IS_PLUS_PAIR_REAL_SEMIRING - cij = 0 ; - #endif + GB_DECLARE_IDENTITY (cij) ; // get the value of M(i,j) - int64_t i = Mi [pC] ; + int64_t i = GB_IGET (Mi, pC) ; #if !defined ( GB_MASK_SPARSE_STRUCTURAL_AND_NOT_COMPLEMENTED ) // if M is structural, no need to check its values if (GB_MCAST (Mx, pC, msize)) @@ -136,14 +135,15 @@ #if GB_A_IS_HYPER // A is hyper: find A(:,i) using the A->Y hyper hash int64_t pA, pA_end ; - GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, - A_hash_bits, i, &pA, &pA_end) ; + GB_hyper_hash_lookup (GB_Ap_IS_32, GB_Aj_IS_32, + Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + i, &pA, &pA_end) ; const int64_t ainz = pA_end - pA ; if (ainz > 0) #elif GB_A_IS_SPARSE // A is sparse - int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; const int64_t ainz = pA_end - pA ; if (ainz > 0) #else @@ -160,7 +160,8 @@ { // C(i,j) is a zombie task_nzombies++ ; - Ci [pC] = GB_ZOMBIE (i) ; + i = GB_ZOMBIE (i) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i } } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_cij.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_cij.c index bf1f717e1e..6b1501c526 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_cij.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_cij.c @@ -2,7 +2,7 @@ // GB_AxB_dot4_cij.c: C(i,j) += A(:,i)'*B(:,j) for dot4 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -68,7 +68,7 @@ // MIN_FIRSTJ semiring: take the 1st entry in A(:,i) if (ainz > 0) { - int64_t k = Ai [pA] + GB_OFFSET ; + int64_t k = GB_IGET (Ai, pA) + GB_OFFSET ; cij = GB_IMIN (cij, k) ; } } @@ -77,7 +77,7 @@ // MAX_FIRSTJ semiring: take last entry in A(:,i) if (ainz > 0) { - int64_t k = Ai [pA_end-1] + GB_OFFSET ; + int64_t k = GB_IGET (Ai, pA_end-1) + GB_OFFSET ; cij = GB_IMAX (cij, k) ; } } @@ -86,7 +86,7 @@ GB_PRAGMA_SIMD_REDUCTION_MONOID (cij) for (int64_t p = pA ; p < pA_end ; p++) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; GB_DOT (k, p, pB+k) ; // cij += A(k,i)*B(k,j) } } @@ -105,7 +105,7 @@ // MIN_FIRSTJ semiring: take the first entry for (int64_t p = pA ; p < pA_end ; p++) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { cij = GB_IMIN (cij, k + GB_OFFSET) ; @@ -118,7 +118,7 @@ // MAX_FIRSTJ semiring: take the last entry for (int64_t p = pA_end-1 ; p >= pA ; p--) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { cij = GB_IMAX (cij, k + GB_OFFSET) ; @@ -131,7 +131,7 @@ GB_PRAGMA_SIMD_REDUCTION_MONOID (cij) for (int64_t p = pA ; p < pA_end ; p++) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { GB_DOT (k, p, pB+k) ; // cij+=A(k,i)*B(k,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_meta.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_meta.c index b6b535f422..fe081ea507 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_meta.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_meta.c @@ -2,7 +2,7 @@ // GB_AxB_dot4_meta: C+=A'*B via dot products, where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,10 +43,10 @@ const int64_t cvlen = C->vlen ; - const int64_t *restrict Bp = B->p ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; const int64_t vlen = B->vlen ; const int64_t bvdim = B->vdim ; @@ -60,12 +60,14 @@ const bool B_is_bitmap = GB_IS_BITMAP (B) ; const bool B_is_sparse = GB_IS_SPARSE (B) ; const bool B_iso = B->iso ; + const bool Bi_is_32 = B->i_is_32 ; + #define GB_Bi_IS_32 Bi_is_32 #endif - const int64_t *restrict Ap = A->p ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; const int64_t avdim = A->vdim ; ASSERT (A->vlen == B->vlen) ; ASSERT (A->vdim == C->vlen) ; @@ -80,6 +82,8 @@ const bool A_is_bitmap = GB_IS_BITMAP (A) ; const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_iso = A->iso ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ai_IS_32 Ai_is_32 #endif #if GB_IS_ANY_MONOID diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_template.c index 9eef0f0a6a..3be7c3bce9 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot4_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot4_template.c @@ -2,7 +2,7 @@ // GB_AxB_dot4_template: C+=A'*B via dot products, where C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -382,12 +382,12 @@ { // get A(:,i) #if GB_A_IS_HYPER - const int64_t i = Ah [kA] ; + const int64_t i = GB_IGET (Ah, kA) ; #else const int64_t i = kA ; #endif - int64_t pA = Ap [kA] ; - const int64_t pA_end = Ap [kA+1] ; + int64_t pA = GB_IGET (Ap, kA) ; + const int64_t pA_end = GB_IGET (Ap, kA+1) ; const int64_t ainz = pA_end - pA ; // C(i) += A(:,i)'*B(:,0) #include "template/GB_AxB_dot4_cij.c" @@ -408,12 +408,12 @@ { // get A(:,i) #if GB_A_IS_HYPER - const int64_t i = Ah [kA] ; + const int64_t i = GB_IGET (Ah, kA) ; #else const int64_t i = kA ; #endif - int64_t pA = Ap [kA] ; - const int64_t pA_end = Ap [kA+1] ; + int64_t pA = GB_IGET (Ap, kA) ; + const int64_t pA_end = GB_IGET (Ap, kA+1) ; const int64_t ainz = pA_end - pA ; // C(i,:) += A(:,i)'*B for (int64_t j = 0 ; j < bvdim ; j++) @@ -440,7 +440,7 @@ GB_B2TYPE *restrict W = NULL ; if (bvdim > 1) { - W = GB_MALLOC_WORK (wp * vlen, GB_B2TYPE, &W_size) ; + W = GB_MALLOC_MEMORY (wp * vlen, sizeof (GB_B2TYPE), &W_size) ; if (W == NULL) { // out of memory @@ -479,8 +479,8 @@ for (int64_t i = kA_start ; i < kA_end ; i++) { // get A(:,i) - const int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + const int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; // cx [0] = C(i,j1) GB_C_TYPE cx [1] ; GB_GET4C (cx [0], i + j1*cvlen) ; @@ -488,7 +488,7 @@ for (int64_t p = pA ; p < pA_end ; p++) { // aki = A(k,i) - const int64_t k = Ai [p] ; + const int64_t k = GB_IGET (Ai, p) ; GB_DECLAREA (aki) ; GB_GETA (aki, Ax, p, A_iso) ; GB_DECLAREB (bkj) ; @@ -537,8 +537,8 @@ for (int64_t i = kA_start ; i < kA_end ; i++) { // get A(:,i) - const int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + const int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; // cx [0:1] = C(i,j1:j1+1) GB_C_TYPE cx [2] ; GB_GET4C (cx [0], i + (j1 )*cvlen) ; @@ -547,7 +547,7 @@ for (int64_t p = pA ; p < pA_end ; p++) { // aki = A(k,i) - const int64_t k = Ai [p] ; + const int64_t k = GB_IGET (Ai, p) ; GB_DECLAREA (aki) ; GB_GETA (aki, Ax, p, A_iso) ; const int64_t k2 = k << 1 ; @@ -598,8 +598,8 @@ for (int64_t i = kA_start ; i < kA_end ; i++) { // get A(:,i) - const int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + const int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; // cx [0:2] = C(i,j1:j1+2) GB_C_TYPE cx [3] ; GB_GET4C (cx [0], i + (j1 )*cvlen) ; @@ -609,7 +609,7 @@ for (int64_t p = pA ; p < pA_end ; p++) { // aki = A(k,i) - const int64_t k = Ai [p] ; + const int64_t k = GB_IGET (Ai, p) ; GB_DECLAREA (aki) ; GB_GETA (aki, Ax, p, A_iso) ; const int64_t k3 = k * 3 ; @@ -664,8 +664,8 @@ for (int64_t i = kA_start ; i < kA_end ; i++) { // get A(:,i) - const int64_t pA = Ap [i] ; - const int64_t pA_end = Ap [i+1] ; + const int64_t pA = GB_IGET (Ap, i) ; + const int64_t pA_end = GB_IGET (Ap, i+1) ; // cx [0:3] = C(i,j1:j1+3) GB_C_TYPE cx [4] ; GB_GET4C (cx [0], i + (j1 )*cvlen) ; @@ -676,7 +676,7 @@ for (int64_t p = pA ; p < pA_end ; p++) { // aki = A(k,i) - const int64_t k = Ai [p] ; + const int64_t k = GB_IGET (Ai, p) ; GB_DECLAREA (aki) ; GB_GETA (aki, Ax, p, A_iso) ; const int64_t k4 = k << 2 ; @@ -699,7 +699,7 @@ } // free workspace - GB_FREE_WORK (&W, W_size) ; + GB_FREE_MEMORY (&W, W_size) ; } #endif @@ -733,13 +733,13 @@ //------------------------------------------------------------------ #if GB_B_IS_HYPER - const int64_t j = Bh [kB] ; + const int64_t j = GB_IGET (Bh, kB) ; #else const int64_t j = kB ; #endif const int64_t pC_start = j * cvlen ; - const int64_t pB_start = Bp [kB] ; - const int64_t pB_end = Bp [kB+1] ; + const int64_t pB_start = GB_IGET (Bp, kB) ; + const int64_t pB_end = GB_IGET (Bp, kB+1) ; const int64_t bjnz = pB_end - pB_start ; //------------------------------------------------------------------ @@ -813,7 +813,7 @@ // MIN_FIRSTJ semiring: take the first entry in B(:,j) if (bjnz > 0) { - int64_t k = Bi [pB] + GB_OFFSET ; + int64_t k = GB_IGET (Bi, pB) + GB_OFFSET ; cij = GB_IMIN (cij, k) ; } } @@ -822,7 +822,7 @@ // MAX_FIRSTJ semiring: take the last entry in B(:,j) if (bjnz > 0) { - int64_t k = Bi [pB_end-1] + GB_OFFSET ; + int64_t k = GB_IGET (Bi, pB_end-1) + GB_OFFSET ; cij = GB_IMAX (cij, k) ; } } @@ -831,7 +831,7 @@ GB_PRAGMA_SIMD_REDUCTION_MONOID (cij) for (int64_t p = pB ; p < pB_end ; p++) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; GB_DOT (k, pA+k, p) ; // cij += A(k,i)*B(k,j) } } @@ -850,7 +850,7 @@ // MIN_FIRSTJ semiring: take the first entry for (int64_t p = pB ; p < pB_end ; p++) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [pA+k]) { cij = GB_IMIN (cij, k + GB_OFFSET) ; @@ -863,7 +863,7 @@ // MAX_FIRSTJ semiring: take the last entry for (int64_t p = pB_end-1 ; p >= pB ; p--) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [pA+k]) { cij = GB_IMAX (cij, k + GB_OFFSET) ; @@ -876,7 +876,7 @@ GB_PRAGMA_SIMD_REDUCTION_MONOID (cij) for (int64_t p = pB ; p < pB_end ; p++) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [pA+k]) { GB_DOT (k, pA+k, p) ; // cij += A(k,i)*B(k,j) @@ -932,13 +932,13 @@ //------------------------------------------------------------------ #if GB_B_IS_HYPER - const int64_t j = Bh [kB] ; + const int64_t j = GB_IGET (Bh, kB) ; #else const int64_t j = kB ; #endif const int64_t pC_start = j * cvlen ; - const int64_t pB_start = Bp [kB] ; - const int64_t pB_end = Bp [kB+1] ; + const int64_t pB_start = GB_IGET (Bp, kB) ; + const int64_t pB_end = GB_IGET (Bp, kB+1) ; const int64_t bjnz = pB_end - pB_start ; //------------------------------------------------------------------ @@ -953,12 +953,12 @@ //-------------------------------------------------------------- #if GB_A_IS_HYPER - const int64_t i = Ah [kA] ; + const int64_t i = GB_IGET (Ah, kA) ; #else const int64_t i = kA ; #endif - int64_t pA = Ap [kA] ; - const int64_t pA_end = Ap [kA+1] ; + int64_t pA = GB_IGET (Ap, kA) ; + const int64_t pA_end = GB_IGET (Ap, kA+1) ; const int64_t ainz = pA_end - pA ; //-------------------------------------------------------------- @@ -985,8 +985,8 @@ // B(:,j). if (ainz == 0 || bjnz == 0 || - Ai [pA_end-1] < Bi [pB_start] || - Bi [pB_end-1] < Ai [pA]) + GB_IGET (Ai, pA_end-1) < GB_IGET (Bi, pB_start) || + GB_IGET (Bi, pB_end-1) < GB_IGET (Ai, pA)) { //------------------------------------------------------ @@ -1003,15 +1003,16 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) // discard all entries A(ia:ib-1,i) int64_t pleft = pA + 1 ; int64_t pright = pA_end - 1 ; - GB_TRIM_BINARY_SEARCH (ib, Ai, pleft, pright) ; + GB_trim_binary_search (ib, Ai, GB_Ai_IS_32, + &pleft, &pright) ; ASSERT (pleft > pA) ; pA = pleft ; } @@ -1042,8 +1043,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) @@ -1055,7 +1056,8 @@ // discard all entries B(ib:ia-1,j) int64_t pleft = pB + 1 ; int64_t pright = pB_end - 1 ; - GB_TRIM_BINARY_SEARCH (ia, Bi, pleft, pright) ; + GB_trim_binary_search (ia, Bi, GB_Bi_IS_32, + &pleft, &pright) ; ASSERT (pleft > pB) ; pB = pleft ; } @@ -1081,8 +1083,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_dot_cij.c b/GraphBLAS/Source/mxm/template/GB_AxB_dot_cij.c index 078635f8b2..f13ff841e9 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_dot_cij.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_dot_cij.c @@ -2,7 +2,7 @@ // GB_AxB_dot_cij: compute C(i,j) = A(:,i)'*B(:,j) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -217,16 +217,16 @@ #elif GB_IS_MIN_FIRSTJ_SEMIRING { // MIN_FIRSTJ semiring: take the first entry in B(:,j) - cij = Bi [pB] + GB_OFFSET ; + cij = GB_IGET (Bi, pB) + GB_OFFSET ; } #elif GB_IS_MAX_FIRSTJ_SEMIRING { // MAX_FIRSTJ semiring: take the last entry in B(:,j) - cij = Bi [pB_end-1] + GB_OFFSET ; + cij = GB_IGET (Bi, pB_end-1) + GB_OFFSET ; } #else { - int64_t k = Bi [pB] ; // first row index of B(:,j) + int64_t k = GB_IGET (Bi, pB) ; // first row index of B(:,j) // cij = (A(k,i) or A(i,k)) * B(k,j) GB_DECLAREA (aki) ; GB_GETA (aki, Ax, GB_A_INDEX(k), A_iso) ; // aki = A(k,i) or A(i,k) @@ -238,7 +238,7 @@ { // break if cij terminal GB_IF_TERMINAL_BREAK (cij, zterminal) ; - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; // cij += (A(k,i) or A(i,k)) * B(k,j) GB_GETA (aki, Ax, GB_A_INDEX(k), A_iso) ; //aki=A(k,i) or A(i,k) GB_GETB (bkj, Bx, p, B_iso) ; // bkj = B(k,j) @@ -355,7 +355,7 @@ // MIN_FIRSTJ semiring: take the first entry for (int64_t p = pB ; p < pB_end ; p++) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [GB_A_INDEX (k)]) { cij_exists = true ; @@ -369,7 +369,7 @@ // MAX_FIRSTJ semiring: take the last entry for (int64_t p = pB_end-1 ; p >= pB ; p--) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [GB_A_INDEX (k)]) { cij_exists = true ; @@ -382,7 +382,7 @@ { for (int64_t p = pB ; p < pB_end ; p++) { - int64_t k = Bi [p] ; + int64_t k = GB_IGET (Bi, p) ; if (Ab [GB_A_INDEX (k)]) { GB_DOT (k, GB_A_INDEX (k), p) ; @@ -434,16 +434,16 @@ #elif GB_IS_MIN_FIRSTJ_SEMIRING { // MIN_FIRSTJ semiring: take the first entry in A(:,i) - cij = Ai [pA] + GB_OFFSET ; + cij = GB_IGET (Ai, pA) + GB_OFFSET ; } #elif GB_IS_MAX_FIRSTJ_SEMIRING { // MAX_FIRSTJ semiring: take the last entry in A(:,i) - cij = Ai [pA_end-1] + GB_OFFSET ; + cij = GB_IGET (Ai, pA_end-1) + GB_OFFSET ; } #else { - int64_t k = Ai [pA] ; // first row index of A(:,i) + int64_t k = GB_IGET (Ai, pA) ; // first row index of A(:,i) // cij = A(k,i) * B(k,j) GB_DECLAREA (aki) ; GB_GETA (aki, Ax, pA , A_iso) ; // aki = A(k,i) @@ -455,7 +455,7 @@ { // break if cij terminal GB_IF_TERMINAL_BREAK (cij, zterminal) ; - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; // cij += A(k,i) * B(k,j) GB_GETA (aki, Ax, p , A_iso) ; // aki = A(k,i) GB_GETB (bkj, Bx, pB+k, B_iso) ; // bkj = B(k,j) @@ -478,7 +478,7 @@ // MIN_FIRSTJ semiring: take the first entry for (int64_t p = pA ; p < pA_end ; p++) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { cij_exists = true ; @@ -492,7 +492,7 @@ // MAX_FIRSTJ semiring: take the last entry for (int64_t p = pA_end-1 ; p >= pA ; p--) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { cij_exists = true ; @@ -505,7 +505,7 @@ { for (int64_t p = pA ; p < pA_end ; p++) { - int64_t k = Ai [p] ; + int64_t k = GB_IGET (Ai, p) ; if (Bb [pB+k]) { GB_DOT (k, p, pB+k) ; @@ -528,7 +528,7 @@ // specially here. They could be done with a backwards traversal of // the sparse vectors A(:,i) and B(:,j). - if (Ai [pA_end-1] < ib_first || ib_last < Ai [pA]) + if (GB_IGET (Ai, pA_end-1) < ib_first || ib_last < GB_IGET (Ai, pA)) { //------------------------------------------------------------------ @@ -547,15 +547,16 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) // discard all entries A(ia:ib-1,i) int64_t pleft = pA + 1 ; int64_t pright = pA_end - 1 ; - GB_TRIM_BINARY_SEARCH (ib, Ai, pleft, pright) ; + GB_trim_binary_search (ib, Ai, GB_Ai_IS_32, + &pleft, &pright) ; ASSERT (pleft > pA) ; pA = pleft ; } @@ -587,8 +588,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) @@ -600,7 +601,8 @@ // discard all entries B(ib:ia-1,j) int64_t pleft = pB + 1 ; int64_t pright = pB_end - 1 ; - GB_TRIM_BINARY_SEARCH (ia, Bi, pleft, pright) ; + GB_trim_binary_search (ia, Bi, GB_Bi_IS_32, + &pleft, &pright) ; ASSERT (pleft > pB) ; pB = pleft ; } @@ -627,8 +629,8 @@ while (pA < pA_end && pB < pB_end) { - int64_t ia = Ai [pA] ; - int64_t ib = Bi [pB] ; + int64_t ia = GB_IGET (Ai, pA) ; + int64_t ib = GB_IGET (Bi, pB) ; if (ia < ib) { // A(ia,i) appears before B(ib,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_bitmap_B_bitmap_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_bitmap_B_bitmap_template.c index bfcdc99c69..420d9517ac 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_bitmap_B_bitmap_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_bitmap_B_bitmap_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_A_bitmap_B_bitmap: C<#M>+=A*B, C bitmap, M any format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -132,7 +132,7 @@ for (int64_t i = istart ; i < iend ; i++) { int64_t pA = i + k * avlen ; - int8_t ab = GBB_A (Ab, pA) ; + int8_t ab = GBb_A (Ab, pA) ; i_local = i - istart ; k_local = k - kstart ; Ab_cache [i_local * GB_KTILE_SIZE ... @@ -256,8 +256,8 @@ { int64_t pA = i + k * avlen ; // pointer to A(i,k) int64_t pB = k + j * bvlen ; // pointer to B(k,j) - if (!GBB_A (Ab, pA)) continue ; - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_A (Ab, pA)) continue ; + if (!GBb_B (Bb, pB)) continue ; GB_GET_B_kj ; // get B(k,j) GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) if (cb == 0) @@ -288,8 +288,8 @@ { int64_t pA = i + k * avlen ; // pointer to A(i,k) int64_t pB = k + j * bvlen ; // pointer to B(k,j) - if (!GBB_A (Ab, pA)) continue ; - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_A (Ab, pA)) continue ; + if (!GBb_B (Bb, pB)) continue ; GB_GET_B_kj ; // get B(k,j) GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) // C(i,j) += A(i,k) * B(k,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_sparse_B_bitmap_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_sparse_B_bitmap_template.c index 568af03873..f1a85e762a 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_sparse_B_bitmap_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_A_sparse_B_bitmap_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_A_sparse_B_bitmap: C<#M>=A*B, C bitmap, M anything //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,6 +24,10 @@ #define GB_C_SIZE sizeof (GB_C_TYPE) #endif +#ifndef GB_C_ISO +#define GB_C_ISO 0 +#endif + { if (use_coarse_tasks) @@ -55,7 +59,7 @@ // Hf and Hx workspace to compute the panel of C int8_t *restrict Hf = Wf + (H_slice [tid] * cvlen) ; - #if ( !GB_IS_ANY_PAIR_SEMIRING ) + #if !GB_C_ISO GB_C_TYPE *restrict Hx = (GB_C_TYPE *) (Wcx + H_slice [tid] * cvlen * GB_C_SIZE) ; #endif @@ -85,7 +89,7 @@ //-------------------------------------------------------------- int8_t *restrict Gb = (int8_t *) (Bb + (j1 * bvlen)) ; - #if ( !GB_IS_ANY_PAIR_SEMIRING ) + #if !GB_B_IS_PATTERN GB_B_TYPE *restrict Gx = (GB_B_TYPE *) (((GB_void *) (B->x)) + (B_iso ? 0 : ((j1 * bvlen) * GB_B_SIZE))) ; @@ -255,7 +259,7 @@ int64_t task_cnvals = 0 ; // for Hx Gustavason workspace: use C(:,j) in-place: - #if ( !GB_IS_ANY_PAIR_SEMIRING ) + #if !GB_C_ISO GB_C_TYPE *restrict Hx = (GB_C_TYPE *) (((GB_void *) Cx) + (pC_start * GB_C_SIZE)) ; #endif @@ -278,13 +282,13 @@ // C<#M>(:,j) += A(:,k) * B(k,j) //-------------------------------------------------------------- - int64_t k = GBH_A (Ah, kk) ; // k in range k1:k2 + int64_t k = GBh_A (Ah, kk) ; // k in range k1:k2 int64_t pB = pB_start + k ; // get pointer to B(k,j) #if GB_B_IS_BITMAP - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_B (Bb, pB)) continue ; #endif - int64_t pA = Ap [kk] ; - int64_t pA_end = Ap [kk+1] ; + int64_t pA = GB_IGET (Ap, kk) ; + int64_t pA_end = GB_IGET (Ap, kk+1) ; GB_GET_B_kj ; // bkj = B(k,j) for ( ; pA < pA_end ; pA++) @@ -294,7 +298,7 @@ // get A(i,k) and C(i,j) //---------------------------------------------------------- - int64_t i = Ai [pA] ; // get A(i,k) index + int64_t i = GB_IGET (Ai, pA) ; // get A(i,k) index int64_t pC = pC_start + i ; // get C(i,j) pointer //---------------------------------------------------------- @@ -480,7 +484,7 @@ // for Hf and Hx Gustavason workspace: use W(:,tid): int8_t *restrict Hf = Wf + pW_start ; - #if ( !GB_IS_ANY_PAIR_SEMIRING ) + #if !GB_C_ISO GB_C_TYPE *restrict Hx = (GB_C_TYPE *) (Wcx + (pW_start * GB_C_SIZE)) ; #endif @@ -509,13 +513,13 @@ // W<#M>(:,tid) += A(:,k) * B(k,j) //-------------------------------------------------------------- - int64_t k = GBH_A (Ah, kk) ; // k in range k1:k2 + int64_t k = GBh_A (Ah, kk) ; // k in range k1:k2 int64_t pB = pB_start + k ; // get pointer to B(k,j) #if GB_B_IS_BITMAP - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_B (Bb, pB)) continue ; #endif - int64_t pA = Ap [kk] ; - int64_t pA_end = Ap [kk+1] ; + int64_t pA = GB_IGET (Ap, kk) ; + int64_t pA_end = GB_IGET (Ap, kk+1) ; GB_GET_B_kj ; // bkj = B(k,j) for ( ; pA < pA_end ; pA++) @@ -525,7 +529,7 @@ // get A(i,k) //---------------------------------------------------------- - int64_t i = Ai [pA] ; // get A(i,k) index + int64_t i = GB_IGET (Ai, pA) ; // get A(i,k) index //---------------------------------------------------------- // check M(i,j) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_template.c index ecb3b8ac1d..dbad2bc0dc 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxbit_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxbit_template.c: C<#M>=A*B when C is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -53,10 +53,10 @@ ASSERT (!GB_IS_SPARSE (B)) ; ASSERT (!GB_IS_HYPERSPARSE (B)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; const int64_t avdim = A->vdim ; @@ -77,10 +77,10 @@ const bool A_is_sparse_or_hyper = A_is_sparse || A_is_hyper ; #endif - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mh = NULL ; - const int8_t *restrict Mb = NULL ; - const int64_t *restrict Mi = NULL ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = NULL ; const GB_M_TYPE *restrict Mx = NULL ; size_t msize = 0 ; int64_t mnvec = 0 ; @@ -120,10 +120,7 @@ { ASSERT (C->vlen == M->vlen) ; ASSERT (C->vdim == M->vdim) ; - Mp = M->p ; - Mh = M->h ; Mb = M->b ; - Mi = M->i ; Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; msize = M->type->size ; mnvec = M->nvec ; diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase1.c index 43e6b30785..805a72191e 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_M_phase1: symbolic coarse Gustavson, with M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { GB_GET_B_j ; // get B(:,j) - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; //---------------------------------------------------------------------- // special case when B(:,j) is empty @@ -35,8 +35,8 @@ if (mjnz == 0) continue ; GB_GET_M_j_RANGE (64) ; mark += 2 ; - const int64_t f0 = mark ; - const int64_t f1 = mark+1 ; + const uint64_t f0 = mark ; + const uint64_t f1 = mark+1 ; GB_SCATTER_M_j (pM_start, pM_end, f0) ; // scatter M(:,j) //---------------------------------------------------------------------- @@ -49,7 +49,7 @@ GB_GET_B_kj_INDEX ; // get k of B(k,j) GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ if (Hf [i] == f0) /* if true, M(i,j) is 1 */ \ { \ @@ -59,9 +59,10 @@ } GB_SCAN_M_j_OR_A_k (((GB_A_IS_SPARSE || GB_A_IS_HYPER) && !A_jumbled)) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } - Cp [kk] = cjnz ; // count the entries in C(:,j) + // count the entries in C(:,j): + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase5.c index a36c789ac8..89c29144d8 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_M_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_M_phase5: C=A*B, coarse Gustavson, phase5 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,14 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // nothing to do GB_GET_B_j ; // get B(:,j) @@ -38,7 +44,7 @@ GB_GET_M_j ; // get M(:,j) GB_GET_M_j_RANGE (64) ; // get first and last in M(:,j) mark += 2 ; - int64_t mark1 = mark+1 ; + uint64_t mark1 = mark+1 ; // scatter M(:,j) into the Gustavson workspace GB_SCATTER_M_j (pM_start, pM_end, mark) ; @@ -56,9 +62,9 @@ GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; GB_GET_B_kj ; // bkj = B(k,j) - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ - int64_t hf = Hf [i] ; \ + uint64_t hf = Hf [i] ; \ if (hf == mark) \ { \ /* C(i,j) = A(i,k) * B(k,j) */ \ @@ -74,7 +80,7 @@ } \ } GB_SCAN_M_j_OR_A_k (A_ok_for_binary_search) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } GB_GATHER_ALL_C_j(mark1) ; // gather into C(:,j) @@ -92,16 +98,17 @@ GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; GB_GET_B_kj ; // bkj = B(k,j) - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ - int64_t hf = Hf [i] ; \ + uint64_t hf = Hf [i] ; \ if (hf == mark) \ { \ /* C(i,j) = A(i,k) * B(k,j) */ \ Hf [i] = mark1 ; /* mark as seen */ \ GB_MULT_A_ik_B_kj ; /* t = aik*bkj */ \ GB_HX_WRITE (i, t) ; /* Hx [i] = t */ \ - Ci [pC++] = i ; /* C(:,j) pattern */ \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + pC++ ; \ } \ else if (hf == mark1) \ { \ @@ -111,7 +118,7 @@ } \ } GB_SCAN_M_j_OR_A_k (A_ok_for_binary_search) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } GB_SORT_AND_GATHER_C_j ; // gather into C(:,j) } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase1.c index 06f1d8ee65..3a427e5db9 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_noM_phase1: symbolic coarse Gustavson, no mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,8 @@ #if ( GB_B_IS_SPARSE || GB_B_IS_HYPER ) if (bjnz == 0) { - Cp [kk] = 0 ; // C(:,j) is empty + // C(:,j) is empty + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 continue ; } #if ( GB_A_IS_SPARSE ) @@ -30,7 +31,8 @@ { GB_GET_B_kj_INDEX ; // get index k of entry B(k,j) GB_GET_A_k ; // get A(:,k) - Cp [kk] = aknz ; // nnz (C (:,j)) = nnz (A (:,k)) + GB_ISET (Cp, kk, aknz) ; // Cp [kk] = aknz ; + // nnz (C (:,j)) = nnz (A (:,k)) continue ; } #endif @@ -40,7 +42,7 @@ // count nnz in C(:,j), terminating early if C(:,j) becomes dense //---------------------------------------------------------------------- - const int64_t f = (++mark) ; + const uint64_t f = (++mark) ; int64_t cjnz = 0 ; for ( ; pB < pB_end && cjnz < cvlen ; pB++) // scan B(:,j) { @@ -57,7 +59,8 @@ } } } - Cp [kk] = cjnz ; // save count of entries in C(:,j) + // save count of entries in C(:,j): + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase5.c index 4f7de1953b..c07e235dfb 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_noM_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_noM_phase5: numeric coarse Gustavson, no mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,8 +15,14 @@ // get C(:,j) and B(:,j) //---------------------------------------------------------------------- - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // no work to do if C(:,j) empty GB_GET_B_j ; @@ -105,7 +111,8 @@ // C(i,j) = A(i,k) * B(k,j) Hf [i] = mark ; GB_HX_WRITE (i, t) ; // Hx [i] = t - Ci [pC++] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; + pC++ ; } else { diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase1.c index 19aa6432f7..ce3c6eedcd 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_notM_phase1: symbolic coarse Gustavson, with !M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { GB_GET_B_j ; // get B(:,j) - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; //---------------------------------------------------------------------- // special case when B(:,j) is empty @@ -33,8 +33,8 @@ GB_GET_M_j ; // get M(:,j) mark += 2 ; - const int64_t f0 = mark ; - const int64_t f1 = mark+1 ; + const uint64_t f0 = mark ; + const uint64_t f1 = mark+1 ; GB_SCATTER_M_j (pM_start, pM_end, f0) ; // scatter M(:,j) //---------------------------------------------------------------------- @@ -57,7 +57,8 @@ } } } - Cp [kk] = cjnz ; // count the entries in C(:,j) + // count the entries in C(:,j): + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase5.c index 225f0d2d12..b2f4b9f2dc 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseGus_notM_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseGus_notM_phase5: C=A*B, coarse Gustavson, phase5 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,8 +20,14 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // nothing to do GB_GET_B_j ; // get B(:,j) #ifndef GB_GENERIC @@ -34,7 +40,7 @@ #endif GB_GET_M_j ; // get M(:,j) mark += 2 ; - int64_t mark1 = mark+1 ; + uint64_t mark1 = mark+1 ; // scatter M(:,j) into the Gustavson workspace GB_SCATTER_M_j (pM_start, pM_end, mark) ; @@ -56,7 +62,7 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) { GB_GET_A_ik_INDEX ; // get i of A(i,k) - int64_t hf = Hf [i] ; + uint64_t hf = Hf [i] ; if (hf < mark) { // C(i,j) = A(i,k) * B(k,j) @@ -92,14 +98,15 @@ for (int64_t pA = pA_start ; pA < pA_end ; pA++) { GB_GET_A_ik_INDEX ; // get i of A(i,k) - int64_t hf = Hf [i] ; + uint64_t hf = Hf [i] ; if (hf < mark) { // C(i,j) = A(i,k) * B(k,j) Hf [i] = mark1 ; // mark as seen GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) GB_HX_WRITE (i, t) ; // Hx [i] = t - Ci [pC++] = i ; // create C(:,j) pattern + GB_ISET (Ci, pC, i) ; // Ci [pC] = i + pC++ ; } else if (hf == mark1) { diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase1.c index bb890b233e..86b59313e2 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_M_phase1: symbolic coarse hash method, with M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { GB_GET_B_j ; // get B(:,j) - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; //---------------------------------------------------------------------- // special case when B(:,j) is empty @@ -37,8 +37,8 @@ if (mjnz == 0) continue ; GB_GET_M_j_RANGE (64) ; mark += 2 ; - const int64_t f0 = mark ; - const int64_t f1 = mark+1 ; + const uint64_t f0 = mark ; + const uint64_t f1 = mark+1 ; GB_HASH_M_j ; // hash M(:,j) //---------------------------------------------------------------------- @@ -51,11 +51,11 @@ GB_GET_B_kj_INDEX ; // get k of B(k,j) GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ for (GB_HASH (i)) /* find i in hash */ \ { \ - int64_t f = Hf [hash] ; \ + uint64_t f = Hf [hash] ; \ if (f < f0) break ; /* M(i,j)=0; ignore */ \ if (Hi [hash] == i) /* if true, i found */ \ { \ @@ -70,9 +70,10 @@ } GB_SCAN_M_j_OR_A_k (((GB_A_IS_SPARSE || GB_A_IS_HYPER) && !A_jumbled)) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } - Cp [kk] = cjnz ; // count the entries in C(:,j) + // count the entries in C(:,j) + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase5.c index 93b6ebcc07..4cad4162a2 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_M_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_M_phase5: C=A*B, coarse Hash, phase 5 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,13 +24,19 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // nothing to do GB_GET_M_j ; // get M(:,j) GB_GET_M_j_RANGE (64) ; // get 1st & last in M(:,j) mark += 2 ; - int64_t mark1 = mark+1 ; + uint64_t mark1 = mark+1 ; GB_HASH_M_j ; // hash M(:,j) GB_GET_B_j ; // get B(:,j) for ( ; pB < pB_end ; pB++) // scan B(:,j) @@ -39,11 +45,11 @@ GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; GB_GET_B_kj ; // bkj = B(k,j) - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ for (GB_HASH (i)) /* find i in hash */ \ { \ - int64_t f = Hf [hash] ; \ + uint64_t f = Hf [hash] ; \ if (f < mark) break ; /* M(i,j)=0, ignore*/ \ if (Hi [hash] == i) \ { \ @@ -53,7 +59,8 @@ /* C(i,j) is new */ \ Hf [hash] = mark1 ; /* mark seen */ \ GB_HX_WRITE (hash, t) ; /* Hx[hash] = t */ \ - Ci [pC++] = i ; \ + GB_ISET (Ci, pC, i) ; /* Ci [pC] = i */ \ + pC++ ; \ } \ else \ { \ @@ -65,7 +72,7 @@ } \ } GB_SCAN_M_j_OR_A_k (A_ok_for_binary_search) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } GB_SORT_AND_GATHER_HASHED_C_j (mark1) ; } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase1.c index 64427a509c..d01246538f 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_notM_phase1: symbolic coarse hash method, with !M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { GB_GET_B_j ; // get B(:,j) - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; //---------------------------------------------------------------------- // special case when B(:,j) is empty @@ -34,7 +34,7 @@ GB_GET_M_j ; // get M(:,j) mark += 2 ; - int64_t mark1 = mark+1 ; + uint64_t mark1 = mark+1 ; GB_HASH_M_j ; // hash M(:,j) //---------------------------------------------------------------------- @@ -63,7 +63,8 @@ } } } - Cp [kk] = cjnz ; // count the entries in C(:,j) + // count the entries in C(:,j) + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase5.c index 0567c65e7c..611719cd34 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_notM_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_notM_phase5: C=A*B, coarse Hash, phase 5 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,12 +24,18 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // nothing to do GB_GET_M_j ; // get M(:,j) mark += 2 ; - int64_t mark1 = mark+1 ; + uint64_t mark1 = mark+1 ; GB_HASH_M_j ; // hash M(:,j) GB_GET_B_j ; // get B(:,j) for ( ; pB < pB_end ; pB++) // scan B(:,j) @@ -44,7 +50,7 @@ GB_GET_A_ik_INDEX ; // get index i of A(i,k) for (GB_HASH (i)) // find i in hash { - int64_t f = Hf [hash] ; + uint64_t f = Hf [hash] ; if (f < mark) // if true, i is new { // C(i,j) is new @@ -52,7 +58,8 @@ Hi [hash] = i ; GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) GB_HX_WRITE (hash, t) ; // Hx [hash] = t - Ci [pC++] = i ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i + pC++ ; break ; } if (Hi [hash] == i) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase1.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase1.c index f509552b53..4144b2915b 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase1.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase1.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_phase1: symbolic coarse Hash, optional dense mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { GB_GET_B_j ; // get B(:,j) - Cp [kk] = 0 ; + GB_ISET (Cp, kk, 0) ; // Cp [kk] = 0 ; //---------------------------------------------------------------------- // special case when B(:,j) is empty @@ -56,7 +56,7 @@ { GB_GET_B_kj_INDEX ; // get index k of B(k,j) GB_GET_A_k ; // get A(:,k) - Cp [kk] = aknz ; + GB_ISET (Cp, kk, aknz) ; // Cp [kk] = aknz continue ; } #endif @@ -83,7 +83,7 @@ // the mask GB_CHECK_MASK_ij ; #endif - int64_t hash ; + uint64_t hash ; bool marked = false ; bool done = false ; for (hash = GB_HASHF (i, hash_bits) ; ; @@ -109,7 +109,8 @@ } } } - Cp [kk] = cjnz ; // count the entries in C(:,j) + // count the entries in C(:,j) + GB_ISET (Cp, kk, cjnz) ; // Cp [kk] = cjnz ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase5.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase5.c index d6dd127e45..0c4f0339c2 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase5.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_coarseHash_phase5.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_coarseHash_phase5: C=A*B for coarse hash method, phase 5 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,14 @@ for (int64_t kk = kfirst ; kk <= klast ; kk++) { - int64_t pC = Cp [kk] ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + int64_t pC = pC_start ; + int64_t cjnz = pC_end - pC ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + if (cjnz == 0) continue ; // nothing to do GB_GET_B_j ; // get B(:,j) @@ -82,8 +88,9 @@ // hash entry is not occupied Hf [hash] = mark ; Hi [hash] = i ; - GB_HX_WRITE (hash, t) ;// Hx[hash]=t - Ci [pC++] = i ; + GB_HX_WRITE (hash, t) ; // Hx [hash] = t + GB_ISET (Ci, pC, i) ; // Ci [pC] = i + pC++ ; break ; } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_M_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_M_phase2.c index 2af3142cd3..3dee648c74 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_M_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_M_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineGus_M_phase2: C=A*B, fine Gustavson, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,7 @@ // the double complex ANY monoid cannot use this method - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ int8_t f ; \ GB_ATOMIC_READ \ f = Hf [i] ; /* grab the entry */ \ @@ -54,7 +54,7 @@ // C(i,j) += A(i,k)*B(k,j) ; all other monoids //------------------------------------------------------------------ - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ GB_MULT_A_ik_B_kj ; /* t = A(i,k) * B(k,j) */ \ int8_t f ; \ @@ -90,7 +90,7 @@ #endif GB_SCAN_M_j_OR_A_k (A_ok_for_binary_search) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_notM_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_notM_phase2.c index 7de0139cd1..fa0e7791bd 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_notM_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_notM_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineGus_notM_phase2: C=A*B, fine Gustavson, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_phase2.c index 6175e0ec35..568504a099 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineGus_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineGus_phase2: C=A*B, saxpy3 method, fine Gustavson, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_M_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_M_phase2.c index 77b29b246a..7fffa9bf9b 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_M_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_M_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineHash_M_phase2: C=A*B, fine Hash, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,14 +36,14 @@ GB_GET_A_k ; // get A(:,k) if (aknz == 0) continue ; GB_GET_B_kj ; // bkj = B(k,j) - #define GB_IKJ \ + #define GB_UPDATE_IKJ \ { \ GB_MULT_A_ik_B_kj ; /* t = A(i,k) * B(k,j) */ \ - int64_t i1 = i + 1 ; /* i1 = one-based index */ \ - int64_t i_unlocked = (i1 << 2) + 2 ; /* (i+1,2) */ \ + uint64_t i1 = i + 1 ; /* i1 = one-based index */ \ + uint64_t i_unlocked = (i1 << 2) + 2 ; /* (i+1,2) */ \ for (GB_HASH (i)) /* find i in hash table */ \ { \ - int64_t hf ; \ + uint64_t hf ; \ GB_ATOMIC_READ \ hf = Hf [hash] ; /* grab the entry */ \ if (GB_Z_HAS_ATOMIC_UPDATE && (hf == i_unlocked)) \ @@ -59,7 +59,7 @@ { \ /* do this atomically: */ \ /* { hf = Hf [hash] ; Hf [hash] |= 3 ; }*/ \ - GB_ATOMIC_CAPTURE_INT64_OR (hf, Hf [hash], 3) ; \ + GB_ATOMIC_CAPTURE_UINT64_OR (hf, Hf [hash], 3) ; \ } while ((hf & 3) == 3) ; /* own: f=1,2 */ \ if ((hf & 3) == 1) /* f == 1 */ \ { \ @@ -78,7 +78,7 @@ } \ } GB_SCAN_M_j_OR_A_k (A_ok_for_binary_search) ; - #undef GB_IKJ + #undef GB_UPDATE_IKJ } } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_notM_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_notM_phase2.c index 619ab01ac3..4a6a3925e5 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_notM_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_notM_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineHash_notM_phase2: C=A*B, fine Hash, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,12 +42,12 @@ { GB_GET_A_ik_INDEX ; // get index i of A(i,k) GB_MULT_A_ik_B_kj ; // t = A(i,k) * B(k,j) - int64_t i1 = i + 1 ; // i1 = one-based index - int64_t i_unlocked = (i1 << 2) + 2 ; // (i+1,2) - int64_t i_masked = (i1 << 2) + 1 ; // (i+1,1) + uint64_t i1 = i + 1 ; // i1 = one-based index + uint64_t i_unlocked = (i1 << 2) + 2 ; // (i+1,2) + uint64_t i_masked = (i1 << 2) + 1 ; // (i+1,1) for (GB_HASH (i)) // find i in hash table { - int64_t hf ; + uint64_t hf ; GB_ATOMIC_READ hf = Hf [hash] ; // grab the entry #if GB_Z_HAS_ATOMIC_UPDATE @@ -60,7 +60,7 @@ } #endif if (hf == i_masked) break ; // M(i,j)=1; ignore - int64_t h = (hf >> 2) ; + uint64_t h = (hf >> 2) ; if (h == 0 || h == i1) { // h=0: unoccupied, h=i1: occupied by i @@ -68,7 +68,7 @@ { // do this atomically: // { hf = Hf [hash] ; Hf [hash] |= 3 ; } - GB_ATOMIC_CAPTURE_INT64_OR (hf,Hf[hash],3) ; + GB_ATOMIC_CAPTURE_UINT64_OR (hf, Hf [hash], 3) ; } while ((hf & 3) == 3) ; // owner: f=0,1,2 if (hf == 0) // f == 0 { diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_phase2.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_phase2.c index 65be846cbb..4d212ddb03 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_phase2.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_fineHash_phase2.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_fineHash_phase2: C=A*B (or with M in-place), fine Hash, phase2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -55,15 +55,15 @@ GB_CHECK_MASK_ij ; #endif GB_MULT_A_ik_B_kj ; // t = A(i,k) * B(k,j) - int64_t i_unlocked = ((i+1) << 2) + 2 ; // (i+1,2) + uint64_t i_unlocked = ((i+1) << 2) + 2 ; // (i+1,2) // find the entry i in the hash table bool hf_unlocked = false ; // true if i found bool hf_empty = false ; // true if empty slot found - int64_t hash ; + uint64_t hash ; for (hash = GB_HASHF (i, hash_bits) ; ; GB_REHASH (hash,i,hash_bits)) { - int64_t hf = Hf [hash] ; // grab the entry + uint64_t hf = Hf [hash] ; // grab the entry hf_unlocked = (hf == i_unlocked) ; hf_empty = (hf == 0) ; if (hf_unlocked || hf_empty) break ; @@ -107,11 +107,11 @@ GB_CHECK_MASK_ij ; #endif GB_MULT_A_ik_B_kj ; // t = A(i,k) * B(k,j) - int64_t i1 = i + 1 ; // i1 = one-based index - int64_t i_unlocked = (i1 << 2) + 2 ; // (i+1,2) + uint64_t i1 = i + 1 ; // i1 = one-based index + uint64_t i_unlocked = (i1 << 2) + 2 ; // (i+1,2) for (GB_HASH (i)) // find i in hash table { - int64_t hf ; + uint64_t hf ; GB_ATOMIC_READ hf = Hf [hash] ; // grab the entry #if GB_Z_HAS_ATOMIC_UPDATE @@ -121,7 +121,7 @@ break ; // C(i,j) has been updated } #endif - int64_t h = (hf >> 2) ; + uint64_t h = (hf >> 2) ; if (h == 0 || h == i1) { // h=0: unoccupied, h=i1: occupied by i @@ -129,7 +129,7 @@ { // do this atomically: // { hf = Hf [hash] ; Hf [hash] |= 3 ; } - GB_ATOMIC_CAPTURE_INT64_OR (hf, Hf [hash], 3) ; + GB_ATOMIC_CAPTURE_UINT64_OR (hf, Hf [hash], 3) ; } while ((hf & 3) == 3) ; // owner: f=0 or 2 if (hf == 0) // f == 0 diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_template.c index 2efb196f52..8e06a68e0f 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy3_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy3_template: C=A*B, C=A*B, or C=A*B via saxpy3 method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,16 +22,19 @@ // get M, A, B, and C //-------------------------------------------------------------------------- - int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; // shadowed below ASSERT (Cp != NULL) ; - // const int64_t *restrict Ch = C->h ; const int64_t cvlen = C->vlen ; const int64_t cnvec = C->nvec ; + #ifndef GB_JIT_KERNEL + const bool Ci_is_32 = C->i_is_32 ; + #define GB_Ci_IS_32 Ci_is_32 + #endif - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int8_t *restrict Bb = B->b ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE_U (Bi, const) ; GB_Bi_PTR (Bi, B) ; + const int8_t *restrict Bb = B->b ; const int64_t bvlen = B->vlen ; #ifdef GB_JIT_KERNEL #define B_iso GB_B_ISO @@ -47,10 +50,10 @@ const bool B_is_sparse_or_hyper = B_is_sparse || B_is_hyper ; #endif - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE_U (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const int8_t *restrict Ab = A->b ; const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; #ifdef GB_JIT_KERNEL @@ -63,21 +66,27 @@ const bool A_is_sparse = GB_IS_SPARSE (A) ; const bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; const bool A_is_bitmap = GB_IS_BITMAP (A) ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; + const bool Ai_is_32 = A->i_is_32 ; + #define GB_Ap_IS_32 Ap_is_32 + #define GB_Aj_IS_32 Aj_is_32 + #define GB_Ai_IS_32 Ai_is_32 #endif const bool A_jumbled = A->jumbled ; const bool A_ok_for_binary_search = ((A_is_sparse || A_is_hyper) && !A_jumbled) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const void *A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const void *A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const void *A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; #if ( !GB_NO_MASK ) - const int64_t *restrict Mp = M->p ; - const int64_t *restrict Mh = M->h ; - const int8_t *restrict Mb = M->b ; - const int64_t *restrict Mi = M->i ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + GB_Mh_DECLARE (Mh, const) ; GB_Mh_PTR (Mh, M) ; + GB_Mi_DECLARE_U (Mi, const) ; GB_Mi_PTR (Mi, M) ; + const int8_t *restrict Mb = M->b ; const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; #ifdef GB_JIT_KERNEL #define M_is_hyper GB_M_IS_HYPER @@ -85,15 +94,19 @@ #else const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; + const bool Mp_is_32 = M->p_is_32 ; + const bool Mj_is_32 = M->j_is_32 ; + #define GB_Mp_IS_32 Mp_is_32 + #define GB_Mj_IS_32 Mj_is_32 #endif const bool M_jumbled = GB_JUMBLED (M) ; size_t msize = M->type->size ; int64_t mnvec = M->nvec ; int64_t mvlen = M->vlen ; // get the M hyper_hash - const int64_t *restrict M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; - const int64_t *restrict M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; - const int64_t *restrict M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; + const void *M_Yp = (M->Y == NULL) ? NULL : M->Y->p ; + const void *M_Yi = (M->Y == NULL) ? NULL : M->Y->i ; + const void *M_Yx = (M->Y == NULL) ? NULL : M->Y->x ; const int64_t M_hash_bits = (M->Y == NULL) ? 0 : (M->Y->vdim - 1) ; #endif @@ -122,11 +135,11 @@ int64_t kk = SaxpyTasks [taskid].vector ; int team_size = SaxpyTasks [taskid].team_size ; - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; bool use_Gustavson = (hash_size == cvlen) ; int64_t pB = SaxpyTasks [taskid].start ; int64_t pB_end = SaxpyTasks [taskid].end + 1 ; - int64_t j = GBH_B (Bh, kk) ; + int64_t j = GBh_B (Bh, kk) ; GB_GET_T_FOR_SECONDJ ; @@ -218,8 +231,8 @@ // h == (anything), f == 3: locked. - int64_t *restrict Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; - int64_t hash_bits = (hash_size-1) ; + uint64_t *restrict Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf; + uint64_t hash_bits = (hash_size-1) ; #if ( GB_NO_MASK ) { @@ -316,18 +329,41 @@ // phase3/phase4: count nnz(C(:,j)) for fine tasks, cumsum of Cp //========================================================================== - GB_AxB_saxpy3_cumsum (C, SaxpyTasks, nfine, chunk, nthreads, Werk) ; + // C->p may be revised by GB_AxB_saxpy3_cumsum, from 32-bit to 64-bit. + + GrB_Info info ; + info = GB_AxB_saxpy3_cumsum (C, SaxpyTasks, nfine, chunk, nthreads, Werk) ; + if (info != GrB_SUCCESS) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } //========================================================================== // phase5: numeric phase for coarse tasks, gather for fine tasks //========================================================================== +{ + + // Cp may have started as 32-bit but might now be 64-bit, depending on the + // problem size. Use the new C->p for phase5. For the JIT kernel, the + // size of C->p is no longer known at compile time. All kernels (JIT, + // PreJIT, Factory, and generic) must thus use the ternary operator in the + // GB_Cp_IGET macro. The definitions of Cp, Cp32, and Cp64 intentionally + // shadow the definitions above, by GB_Cp_DECLARE (...) ; + + const void *Cp = C->p ; + const uint32_t *restrict Cp32 = C->p_is_32 ? Cp : NULL ; + const uint64_t *restrict Cp64 = C->p_is_32 ? NULL : Cp ; + ASSERT (Cp != NULL) ; + + #define GB_Cp_IGET(k) (Cp32 ? Cp32 [k] : Cp64 [k]) + // C is iso for the ANY_PAIR semiring, and non-iso otherwise - // allocate Ci and Cx - int64_t cnz = Cp [cnvec] ; - // set C->iso = GB_IS_ANY_PAIR_SEMIRING OK - GrB_Info info = GB_bix_alloc (C, cnz, GxB_SPARSE, false, true, + // allocate Ci and Cx + int64_t cnz = GB_Cp_IGET (cnvec) ; + info = GB_bix_alloc (C, cnz, GxB_SPARSE, false, true, GB_IS_ANY_PAIR_SEMIRING) ; if (info != GrB_SUCCESS) { @@ -338,14 +374,22 @@ } C->nvals = cnz ; - int64_t *restrict Ci = C->i ; + for (int64_t kk = 0 ; kk < cnvec ; kk++) + { + int64_t pC_start = GB_Cp_IGET (kk) ; + int64_t pC_end = GB_Cp_IGET (kk+1) ; + ASSERT (pC_start >= 0) ; + ASSERT (pC_start <= pC_end) ; + ASSERT (pC_end <= cnz) ; + } + + GB_Ci_DECLARE_U (Ci, ) ; GB_Ci_PTR (Ci, C) ; #if ( !GB_IS_ANY_PAIR_SEMIRING ) GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif bool C_jumbled = false ; - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(||:C_jumbled) + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) reduction(||:C_jumbled) for (taskid = 0 ; taskid < ntasks ; taskid++) { @@ -356,7 +400,7 @@ #if !GB_IS_ANY_PAIR_SEMIRING GB_C_TYPE *restrict Hx = (GB_C_TYPE *) SaxpyTasks [taskid].Hx ; #endif - int64_t hash_size = SaxpyTasks [taskid].hsize ; + uint64_t hash_size = SaxpyTasks [taskid].hsize ; bool use_Gustavson = (hash_size == cvlen) ; bool task_C_jumbled = false ; @@ -371,7 +415,7 @@ int team_size = SaxpyTasks [taskid].team_size ; int leader = SaxpyTasks [taskid].leader ; int my_teamid = taskid - leader ; - int64_t pC = Cp [kk] ; + int64_t pC = GB_Cp_IGET (kk) ; if (use_Gustavson) { @@ -383,7 +427,7 @@ // Hf [i] == 2 if C(i,j) is an entry in C(:,j) int8_t *restrict Hf = (int8_t *restrict) SaxpyTasks [taskid].Hf ; - int64_t cjnz = Cp [kk+1] - pC ; + int64_t cjnz = GB_Cp_IGET (kk+1) - pC ; int64_t istart, iend ; GB_PARTITION (istart, iend, cvlen, my_teamid, team_size) ; if (cjnz == cvlen) @@ -391,7 +435,7 @@ // C(:,j) is dense for (int64_t i = istart ; i < iend ; i++) { - Ci [pC + i] = i ; + GB_ISET (Ci, pC + i, i) ; // Ci [pC + i] = i ; } // copy Hx [istart:iend-1] into Cx [pC+istart:pC+iend-1] GB_CIJ_MEMCPY (pC + istart, istart, iend - istart) ; @@ -400,12 +444,13 @@ { // C(:,j) is sparse pC += SaxpyTasks [taskid].my_cjnz ; - for (int64_t i = istart ; i < iend ; i++) + for (uint64_t i = istart ; i < iend ; i++) { if (Hf [i] == 2) { - GB_CIJ_GATHER (pC, i) ; // Cx [pC] = Hx [i] - Ci [pC++] = i ; + GB_CIJ_GATHER (pC, i) ; // Cx [pC] = Hx [i] + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; + pC++ ; } } } @@ -421,18 +466,18 @@ // (Hf [hash] & 3) == 2 if C(i,j) is an entry in C(:,j), // and the index i of the entry is (Hf [hash] >> 2) - 1. - int64_t *restrict - Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; + uint64_t *restrict + Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf ; int64_t mystart, myend ; GB_PARTITION (mystart, myend, hash_size, my_teamid, team_size) ; pC += SaxpyTasks [taskid].my_cjnz ; - for (int64_t hash = mystart ; hash < myend ; hash++) + for (uint64_t hash = mystart ; hash < myend ; hash++) { - int64_t hf = Hf [hash] ; + uint64_t hf = Hf [hash] ; if ((hf & 3) == 2) { - int64_t i = (hf >> 2) - 1 ; // found C(i,j) in hash - Ci [pC] = i ; + uint64_t i = (hf >> 2) - 1 ; // found C(i,j) in hash + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; GB_CIJ_GATHER (pC, hash) ; // Cx [pC] = Hx [hash] pC++ ; } @@ -448,12 +493,12 @@ // numeric coarse task: compute C(:,kfirst:klast) //------------------------------------------------------------------ - int64_t *restrict - Hf = (int64_t *restrict) SaxpyTasks [taskid].Hf ; + uint64_t *restrict + Hf = (uint64_t *restrict) SaxpyTasks [taskid].Hf ; int64_t kfirst = SaxpyTasks [taskid].start ; int64_t klast = SaxpyTasks [taskid].end ; int64_t nk = klast - kfirst + 1 ; - int64_t mark = 2*nk + 1 ; + uint64_t mark = 2*nk + 1 ; if (use_Gustavson) { @@ -494,8 +539,8 @@ // phase5: coarse hash task //-------------------------------------------------------------- - int64_t *restrict Hi = SaxpyTasks [taskid].Hi ; - int64_t hash_bits = (hash_size-1) ; + uint64_t *restrict Hi = SaxpyTasks [taskid].Hi ; + uint64_t hash_bits = (hash_size-1) ; #if ( GB_NO_MASK ) { @@ -594,6 +639,7 @@ C->jumbled = C_jumbled ; // C is jumbled if any task left it jumbled } +} #undef GB_NO_MASK #undef GB_MASK_COMP diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_meta.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_meta.c index d581211daa..2115dd9ee7 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_meta.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_meta.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4_meta: C+=A*B, C is full, A is sparse/hyper, B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -53,9 +53,9 @@ ASSERT (GB_IS_BITMAP (B) || GB_IS_FULL (B)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; const int64_t anvec = A->nvec ; const int64_t avlen = A->vlen ; const int64_t avdim = A->vdim ; diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_panel.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_panel.c index 25d4095848..df372ce529 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_panel.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_panel.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4_panel.c: H += A*G or H = A*G for one panel //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ for (int64_t kA = 0 ; kA < anvec ; kA++) { // get A(:,k) - const int64_t k = GBH_A (Ah, kA) ; + const int64_t k = GBh_A (Ah, kA) ; // get B(k,j1:j2-1) #if GB_B_IS_BITMAP const int8_t gb0 = Gb [k ] ; @@ -40,10 +40,10 @@ GB_GETB (gk2, Gx, k + 2*bvlen, B_iso) ; GB_GETB (gk3, Gx, k + 3*bvlen, B_iso) ; // H += A(:,k)*B(k,j1:j2-1) - const int64_t pA_end = Ap [kA+1] ; - for (int64_t pA = Ap [kA] ; pA < pA_end ; pA++) + const int64_t pA_end = GB_IGET (Ap, kA+1) ; + for (int64_t pA = GB_IGET (Ap, kA) ; pA < pA_end ; pA++) { - const int64_t i = Ai [pA] ; + const int64_t i = GB_IGET (Ai, pA) ; const int64_t pH = i * 4 ; GB_DECLAREA (aik) ; GB_GETA (aik, Ax, pA, A_iso) ; @@ -60,7 +60,7 @@ for (int64_t kA = 0 ; kA < anvec ; kA++) { // get A(:,k) - const int64_t k = GBH_A (Ah, kA) ; + const int64_t k = GBh_A (Ah, kA) ; // get B(k,j1:j2-1) #if GB_B_IS_BITMAP const int8_t gb0 = Gb [k ] ; @@ -75,10 +75,10 @@ GB_GETB (gk1, Gx, k + bvlen, B_iso) ; GB_GETB (gk2, Gx, k + 2*bvlen, B_iso) ; // H += A(:,k)*B(k,j1:j2-1) - const int64_t pA_end = Ap [kA+1] ; - for (int64_t pA = Ap [kA] ; pA < pA_end ; pA++) + const int64_t pA_end = GB_IGET (Ap, kA+1) ; + for (int64_t pA = GB_IGET (Ap, kA) ; pA < pA_end ; pA++) { - const int64_t i = Ai [pA] ; + const int64_t i = GB_IGET (Ai, pA) ; const int64_t pH = i * 3 ; GB_DECLAREA (aik) ; GB_GETA (aik, Ax, pA, A_iso) ; @@ -94,7 +94,7 @@ for (int64_t kA = 0 ; kA < anvec ; kA++) { // get A(:,k) - const int64_t k = GBH_A (Ah, kA) ; + const int64_t k = GBh_A (Ah, kA) ; // get B(k,j1:j2-1) #if GB_B_IS_BITMAP const int8_t gb0 = Gb [k ] ; @@ -106,10 +106,10 @@ GB_DECLAREB (gk1) ; GB_GETB (gk0, Gx, k , B_iso) ; GB_GETB (gk1, Gx, k + bvlen, B_iso) ; - const int64_t pA_end = Ap [kA+1] ; - for (int64_t pA = Ap [kA] ; pA < pA_end ; pA++) + const int64_t pA_end = GB_IGET (Ap, kA+1) ; + for (int64_t pA = GB_IGET (Ap, kA) ; pA < pA_end ; pA++) { - const int64_t i = Ai [pA] ; + const int64_t i = GB_IGET (Ai, pA) ; const int64_t pH = i * 2 ; GB_DECLAREA (aik) ; GB_GETA (aik, Ax, pA, A_iso) ; @@ -124,7 +124,7 @@ for (int64_t kA = 0 ; kA < anvec ; kA++) { // get A(:,k) - const int64_t k = GBH_A (Ah, kA) ; + const int64_t k = GBh_A (Ah, kA) ; // get B(k,j1) #if GB_B_IS_BITMAP const int8_t gb0 = Gb [k] ; @@ -133,14 +133,15 @@ // H += A(:,k)*B(k,j1) GB_DECLAREB (gk0) ; GB_GETB (gk0, Gx, k, B_iso) ; - const int64_t pA_end = Ap [kA+1] ; - for (int64_t pA = Ap [kA] ; pA < pA_end ; pA++) + const int64_t pA_end = GB_IGET (Ap, kA+1) ; + for (int64_t pA = GB_IGET (Ap, kA) ; pA < pA_end ; pA++) { // aik = A (i,j) GB_DECLAREA (aik) ; GB_GETA (aik, Ax, pA, A_iso) ; // H (i) += aik * gk0 - GB_HX_COMPUTE (Ai [pA], Ai [pA], gk0, 1, 0) ; + const int64_t i = GB_IGET (Ai, pA) ; + GB_HX_COMPUTE (i, i, gk0, 1, 0) ; } } break ; diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_template.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_template.c index 8e8bcbda21..30ae0a6e64 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_template.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy4_template.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy4_template: C+=A*B, C is full, A is sparse/hyper, B bitmap/full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,6 +23,10 @@ #define GB_C_SIZE sizeof (GB_C_TYPE) #endif +#ifndef GB_C_ISO +#define GB_C_ISO 0 +#endif + { if (use_coarse_tasks) @@ -75,9 +79,11 @@ //-------------------------------------------------------------- int8_t *restrict Gb = (int8_t *) (Bb + (j1 * bvlen)) ; + #if !GB_B_IS_PATTERN GB_B_TYPE *restrict Gx = (GB_B_TYPE *) (((GB_void *) (B->x)) + (B_iso ? 0 : ((j1 * bvlen) * GB_B_SIZE))) ; + #endif //-------------------------------------------------------------- // clear the panel H to compute C(:,j1:j2-1) @@ -225,13 +231,13 @@ // C(:,j) += A(:,k) * B(k,j) //-------------------------------------------------------------- - int64_t k = GBH_A (Ah, kk) ; // k in range k1:k2 + int64_t k = GBh_A (Ah, kk) ; // k in range k1:k2 int64_t pB = pB_start + k ; // get pointer to B(k,j) #if GB_B_IS_BITMAP - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_B (Bb, pB)) continue ; #endif - int64_t pA = Ap [kk] ; - int64_t pA_end = Ap [kk+1] ; + int64_t pA = GB_IGET (Ap, kk) ; + int64_t pA_end = GB_IGET (Ap, kk+1) ; GB_GET_B_kj ; // bkj = B(k,j) for ( ; pA < pA_end ; pA++) @@ -241,7 +247,7 @@ // get A(i,k) //---------------------------------------------------------- - int64_t i = Ai [pA] ; // get A(i,k) index + int64_t i = GB_IGET (Ai, pA) ; // get A(i,k) index //---------------------------------------------------------- // C(i,j) += A(i,k) * B(k,j) @@ -353,18 +359,18 @@ // W(:,k) += A(:,k) * B(k,j) //-------------------------------------------------------------- - int64_t k = GBH_A (Ah, kk) ; // k in range k1:k2 + int64_t k = GBh_A (Ah, kk) ; // k in range k1:k2 int64_t pB = pB_start + k ; // get pointer to B(k,j) #if GB_B_IS_BITMAP - if (!GBB_B (Bb, pB)) continue ; + if (!GBb_B (Bb, pB)) continue ; #endif - int64_t pA = Ap [kk] ; - int64_t pA_end = Ap [kk+1] ; + int64_t pA = GB_IGET (Ap, kk) ; + int64_t pA_end = GB_IGET (Ap, kk+1) ; GB_GET_B_kj ; // bkj = B(k,j) for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; // get A(i,k) index + int64_t i = GB_IGET (Ai, pA) ; // get A(i,k) index // W(i,k) += A(i,k) * B(k,j) GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) GB_HX_UPDATE (i, t) ; // Hx(i) += t diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_bitmap.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_bitmap.c index 31a1b36f71..8ba27e6174 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_bitmap.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_bitmap.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5_A_bitmap.c: C+=A*B when C is full, A bitmap, B sparse/hyper //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,9 +31,9 @@ const int64_t m = C->vlen ; // # of rows of C and A const int8_t *restrict Ab = A->b ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; #ifdef GB_JIT_KERNEL #define B_iso GB_B_ISO #else @@ -60,15 +60,15 @@ for (int64_t jB = jB_start ; jB < jB_end ; jB++) { // get B(:,j) and C(:,j) - const int64_t j = GBH_B (Bh, jB) ; + const int64_t j = GBh_B (Bh, jB) ; const int64_t pC = j * m ; - const int64_t pB_start = Bp [jB] ; - const int64_t pB_end = Bp [jB+1] ; + const int64_t pB_start = GB_IGET (Bp, jB) ; + const int64_t pB_end = GB_IGET (Bp, jB+1) ; // C(:,j) += A*B(:,j) for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // get B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(:,k) diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_iso_or_pattern.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_iso_or_pattern.c index dd9082c4b6..55aa15e453 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_iso_or_pattern.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_A_iso_or_pattern.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5_A_iso_or_pattern.c: C+=A*B; C full, A bitmap/full & iso/pattern //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,9 +32,9 @@ #if GB_A_IS_BITMAP const int8_t *restrict Ab = A->b ; #endif - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; #ifdef GB_JIT_KERNEL #define B_iso GB_B_ISO #else @@ -67,23 +67,20 @@ for (int64_t jB = jB_start ; jB < jB_end ; jB++) { // get B(:,j) and C(:,j) - const int64_t j = GBH_B (Bh, jB) ; + const int64_t j = GBh_B (Bh, jB) ; const int64_t pC = j * m ; - const int64_t pB_start = Bp [jB] ; - const int64_t pB_end = Bp [jB+1] ; + const int64_t pB_start = GB_IGET (Bp, jB) ; + const int64_t pB_end = GB_IGET (Bp, jB+1) ; // C(:,j) += A*B(:,j) for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // get B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; #if GB_A_IS_BITMAP // get A(:,k) const int64_t pA = k * m ; #endif - #if GB_IS_FIRSTI_MULTIPLIER - // s depends on i - #define s (i + GB_OFFSET) - #else + #if !GB_IS_FIRSTI_MULTIPLIER // s = a * bkj, not dependent on i GB_C_TYPE s ; GB_DECLAREB (bkj) ; @@ -96,6 +93,10 @@ #if GB_A_IS_BITMAP if (!Ab [pA + i]) continue ; #endif + #if GB_IS_FIRSTI_MULTIPLIER + // s depends on i + GB_C_TYPE s = (i + GB_OFFSET) ; + #endif // C(i,j) += s ; GB_CIJ_UPDATE (pC + i, s) ; } diff --git a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_unrolled.c b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_unrolled.c index 41a00beb85..24cd102a21 100644 --- a/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_unrolled.c +++ b/GraphBLAS/Source/mxm/template/GB_AxB_saxpy5_unrolled.c @@ -2,7 +2,7 @@ // GB_AxB_saxpy5_unrolled.c: C+=A*B when C is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,9 +31,9 @@ //-------------------------------------------------------------------------- const int64_t m = C->vlen ; // # of rows of C and A - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bh = B->h ; - const int64_t *restrict Bi = B->i ; + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; #ifdef GB_JIT_KERNEL #define B_iso GB_B_ISO #else @@ -91,10 +91,10 @@ for (int64_t jB = jB_start ; jB < jB_end ; jB++) { // get B(:,j) and C(:,j) - const int64_t j = GBH_B (Bh, jB) ; + const int64_t j = GBh_B (Bh, jB) ; GB_C_TYPE *restrict Cxj = Cx + (j * m) ; - const int64_t pB_start = Bp [jB] ; - const int64_t pB_end = Bp [jB+1] ; + const int64_t pB_start = GB_IGET (Bp, jB) ; + const int64_t pB_end = GB_IGET (Bp, jB+1) ; //------------------------------------------------------------------ // C(:,j) += A*B(:,j), on sets of 16 rows of C and A at a time @@ -121,7 +121,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(i,k) @@ -206,7 +206,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-15,k) @@ -285,7 +285,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-14,k) @@ -361,7 +361,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-13,k) @@ -433,7 +433,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-12,k) @@ -501,7 +501,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-11,k) @@ -571,7 +571,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-10,k) @@ -635,7 +635,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-9,k) @@ -697,7 +697,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-8,k) @@ -751,7 +751,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-7,k) @@ -801,7 +801,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-6,k) @@ -848,7 +848,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-5,k) @@ -893,7 +893,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-4,k) @@ -936,7 +936,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-3,k) @@ -979,7 +979,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-2,k) @@ -1015,7 +1015,7 @@ for (int64_t pB = pB_start ; pB < pB_end ; pB++) { // bkj = B(k,j) - const int64_t k = Bi [pB] ; + const int64_t k = GB_IGET (Bi, pB) ; GB_DECLAREB (bkj) ; GB_GETB (bkj, Bx, pB, B_iso) ; // get A(m-1,k) diff --git a/GraphBLAS/Source/mxm/template/GB_colscale_template.c b/GraphBLAS/Source/mxm/template/GB_colscale_template.c index 0e96e9b56b..4f9de4343c 100644 --- a/GraphBLAS/Source/mxm/template/GB_colscale_template.c +++ b/GraphBLAS/Source/mxm/template/GB_colscale_template.c @@ -2,7 +2,7 @@ // GB_colscale_template: C=A*D where D is a square diagonal matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,8 +28,8 @@ // get C, A, and D //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; const GB_B_TYPE *restrict Dx = (GB_B_TYPE *) D->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; @@ -71,9 +71,9 @@ // find the part of A(:,k) and C(:,k) to be operated on by this task //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; + GBp_A (Ap, k, avlen), GBp_A (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // C(:,j) = A(:,j)*D(j,j) diff --git a/GraphBLAS/Source/mxm/template/GB_meta16_factory.c b/GraphBLAS/Source/mxm/template/GB_meta16_factory.c index e1bee825da..d84ea9abf7 100644 --- a/GraphBLAS/Source/mxm/template/GB_meta16_factory.c +++ b/GraphBLAS/Source/mxm/template/GB_meta16_factory.c @@ -2,7 +2,7 @@ // GB_meta16_factory: 16 cases of a method for A and B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/mxm/template/GB_meta16_methods.c b/GraphBLAS/Source/mxm/template/GB_meta16_methods.c index ab2d03f291..883b440514 100644 --- a/GraphBLAS/Source/mxm/template/GB_meta16_methods.c +++ b/GraphBLAS/Source/mxm/template/GB_meta16_methods.c @@ -2,7 +2,7 @@ // GB_meta16_methods: methods for GB_meta16_factory.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ #if defined ( GB_DOT4 ) #include "template/GB_AxB_dot4_template.c" #elif defined ( GB_DOT3_PHASE1 ) - #include "template/GB_AxB_dot3_phase1_template.c" + #include "mxm/factory/GB_AxB_dot3_phase1_template.c" #elif defined ( GB_DOT3_PHASE2 ) #include "template/GB_AxB_dot3_template.c" #elif defined ( GB_DOT2 ) diff --git a/GraphBLAS/Source/mxm/template/GB_rowscale_template.c b/GraphBLAS/Source/mxm/template/GB_rowscale_template.c index fcc849c959..fd262e9c93 100644 --- a/GraphBLAS/Source/mxm/template/GB_rowscale_template.c +++ b/GraphBLAS/Source/mxm/template/GB_rowscale_template.c @@ -2,7 +2,7 @@ // GB_rowscale_template: C=D*B where D is a square diagonal matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ const bool B_iso = B->iso ; #endif - const int64_t *restrict Bi = B->i ; + GB_Bi_DECLARE (Bi, const) ; GB_Bi_PTR (Bi, B) ; GB_B_NVALS (bnz) ; // const int64_t bnz = GB_nnz (B) ; const int64_t bvlen = B->vlen ; @@ -63,7 +63,7 @@ GB_PRAGMA_SIMD_VECTORIZE for (int64_t p = pstart ; p < pend ; p++) { - int64_t i = GBI_B (Bi, p, bvlen) ; // get row index of B(i,j) + int64_t i = GBi_B (Bi, p, bvlen) ; // get row index of B(i,j) GB_DECLAREA (dii) ; GB_GETA (dii, Dx, i, D_iso) ; // dii = D(i,i) GB_DECLAREB (bij) ; diff --git a/GraphBLAS/Source/nvals/GB_nnz.c b/GraphBLAS/Source/nvals/GB_nnz.c index b61841abae..49bf5c2dd2 100644 --- a/GraphBLAS/Source/nvals/GB_nnz.c +++ b/GraphBLAS/Source/nvals/GB_nnz.c @@ -2,7 +2,7 @@ // GB_nnz.c: number of entries in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/nvals/GB_nnz.h b/GraphBLAS/Source/nvals/GB_nnz.h index 17f17d94c7..8007a5234e 100644 --- a/GraphBLAS/Source/nvals/GB_nnz.h +++ b/GraphBLAS/Source/nvals/GB_nnz.h @@ -2,7 +2,7 @@ // GB_nnz.h: number of entries in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/nvals/GB_nnz_full.c b/GraphBLAS/Source/nvals/GB_nnz_full.c index 349ce6fa26..8823844d35 100644 --- a/GraphBLAS/Source/nvals/GB_nnz_full.c +++ b/GraphBLAS/Source/nvals/GB_nnz_full.c @@ -2,7 +2,7 @@ // GB_nnz_full.c: number of entries in a full matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/nvals/GB_nnz_held.c b/GraphBLAS/Source/nvals/GB_nnz_held.c index efc36cf8a0..c125735b87 100644 --- a/GraphBLAS/Source/nvals/GB_nnz_held.c +++ b/GraphBLAS/Source/nvals/GB_nnz_held.c @@ -2,7 +2,7 @@ // GB_nnz_held.c: number of entries held in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/nvals/GB_nnz_max.c b/GraphBLAS/Source/nvals/GB_nnz_max.c index b0cda2feb4..fa5b18eae4 100644 --- a/GraphBLAS/Source/nvals/GB_nnz_max.c +++ b/GraphBLAS/Source/nvals/GB_nnz_max.c @@ -2,7 +2,7 @@ // GB_nnz_max.c: max number of entries that can be held in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,8 @@ int64_t GB_nnz_max if (A->p != NULL) { // A is sparse (p,i,x) or hypersparse (p,h,i,x): - nnz_max = (A->i == NULL) ? 0 : (A->i_size / sizeof (int64_t)) ; + size_t isize = (A->i_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + nnz_max = (A->i == NULL) ? 0 : (A->i_size / isize) ; if (!A->iso) { nnz_max = GB_IMIN (nnz_max, xmax) ; diff --git a/GraphBLAS/Source/nvals/GB_nvals.c b/GraphBLAS/Source/nvals/GB_nvals.c index ab343e998e..89cc7dda3d 100644 --- a/GraphBLAS/Source/nvals/GB_nvals.c +++ b/GraphBLAS/Source/nvals/GB_nvals.c @@ -2,7 +2,7 @@ // GB_nvals: number of entries in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GB_nvals // get the number of entries in a matrix ( - GrB_Index *nvals, // matrix has nvals entries + uint64_t *nvals, // matrix has nvals entries const GrB_Matrix A, // matrix to query GB_Werk Werk ) diff --git a/GraphBLAS/Source/nvals/GB_nvals.h b/GraphBLAS/Source/nvals/GB_nvals.h index de2f959174..d688c73a52 100644 --- a/GraphBLAS/Source/nvals/GB_nvals.h +++ b/GraphBLAS/Source/nvals/GB_nvals.h @@ -2,7 +2,7 @@ // GB_nvals.h: definitions for nrows, ncols, and nvals //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GB_nvals // get the number of entries in a matrix ( - GrB_Index *nvals, // matrix has nvals entries + uint64_t *nvals, // matrix has nvals entries const GrB_Matrix A, // matrix to query GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/nvals/GrB_Matrix_nvals.c b/GraphBLAS/Source/nvals/GrB_Matrix_nvals.c index 29b49705ca..450d7e9f91 100644 --- a/GraphBLAS/Source/nvals/GrB_Matrix_nvals.c +++ b/GraphBLAS/Source/nvals/GrB_Matrix_nvals.c @@ -2,7 +2,7 @@ // GrB_Matrix_nvals: number of entries in a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix ( - GrB_Index *nvals, // matrix has nvals entries + uint64_t *nvals, // matrix has nvals entries const GrB_Matrix A // matrix to query ) { @@ -20,15 +20,16 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_nvals (&nvals, A)") ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_nvals (&nvals, A)") ; + GB_BURBLE_START ("GrB_Matrix_nvals") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; //-------------------------------------------------------------------------- // get the number of entries //-------------------------------------------------------------------------- - GrB_Info info = GB_nvals (nvals, A, Werk) ; + info = GB_nvals (nvals, A, Werk) ; GB_BURBLE_END ; #pragma omp flush return (info) ; diff --git a/GraphBLAS/Source/nvals/GrB_Scalar_nvals.c b/GraphBLAS/Source/nvals/GrB_Scalar_nvals.c index 8811022dc5..d2411b38bf 100644 --- a/GraphBLAS/Source/nvals/GrB_Scalar_nvals.c +++ b/GraphBLAS/Source/nvals/GrB_Scalar_nvals.c @@ -2,7 +2,7 @@ // GrB_Scalar_nvals: number of entries in a sparse GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar ( - GrB_Index *nvals, // number of entries (1 or 0) + uint64_t *nvals, // number of entries (1 or 0) const GrB_Scalar s // GrB_Scalar to query ) { @@ -20,15 +20,16 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_nvals (&nvals, s)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (s) ; + GB_WHERE_1 (s, "GrB_Scalar_nvals (&nvals, s)") ; + ASSERT (GB_SCALAR_OK (s)) ; //-------------------------------------------------------------------------- // get the number of entries //-------------------------------------------------------------------------- - GrB_Info info = GB_nvals (nvals, (GrB_Matrix) s, Werk) ; + info = GB_nvals (nvals, (GrB_Matrix) s, Werk) ; #pragma omp flush return (info) ; } @@ -39,7 +40,7 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar GrB_Info GxB_Scalar_nvals // get the number of entries in a GrB_Scalar ( - GrB_Index *nvals, // number of entries (1 or 0) + uint64_t *nvals, // number of entries (1 or 0) const GrB_Scalar s // GrB_Scalar to query ) { diff --git a/GraphBLAS/Source/nvals/GrB_Vector_nvals.c b/GraphBLAS/Source/nvals/GrB_Vector_nvals.c index bdae73e4b7..886406a28a 100644 --- a/GraphBLAS/Source/nvals/GrB_Vector_nvals.c +++ b/GraphBLAS/Source/nvals/GrB_Vector_nvals.c @@ -2,7 +2,7 @@ // GrB_Vector_nvals: number of entries in a sparse vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector ( - GrB_Index *nvals, // number of entries + uint64_t *nvals, // number of entries const GrB_Vector v // vector to query ) { @@ -20,16 +20,17 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_nvals (&nvals, v)") ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE_1 (v, "GrB_Vector_nvals (&nvals, v)") ; + GB_BURBLE_START ("GrB_Vector_nvals") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; ASSERT (GB_VECTOR_OK (v)) ; //-------------------------------------------------------------------------- // get the number of entries //-------------------------------------------------------------------------- - GrB_Info info = GB_nvals (nvals, (GrB_Matrix) v, Werk) ; + info = GB_nvals (nvals, (GrB_Matrix) v, Werk) ; GB_BURBLE_END ; #pragma omp flush return (info) ; diff --git a/GraphBLAS/Source/ok/GB_abort.c b/GraphBLAS/Source/ok/GB_abort.c new file mode 100644 index 0000000000..14a676ac4f --- /dev/null +++ b/GraphBLAS/Source/ok/GB_abort.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_abort.c: hard assertions for all of GraphBLAS, including JIT kernels +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This function is always active; it is not controlled by #ifdef GB_DEBUG. + +#include "GB.h" + +void GB_abort +( + const char *file, + int line +) +{ + GBDUMP ("\nGraphBLAS assertion failed: [ %s ]: line %d\n", file, line) ; + GB_Global_abort ( ) ; +} + diff --git a/GraphBLAS/Source/ok/GB_assert.h b/GraphBLAS/Source/ok/GB_assert_library.h similarity index 82% rename from GraphBLAS/Source/ok/GB_assert.h rename to GraphBLAS/Source/ok/GB_assert_library.h index 123ca1dc44..e298be02ed 100644 --- a/GraphBLAS/Source/ok/GB_assert.h +++ b/GraphBLAS/Source/ok/GB_assert_library.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_assert.h: assertions for all of GraphBLAS except JIT kernels. +// GB_assert_library.h: assertions for all of GraphBLAS except JIT kernels. //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,25 +14,11 @@ // debugging definitions //------------------------------------------------------------------------------ -#undef GB_ABORT -#define GB_ABORT GB_Global_abort ( ) - -#undef ASSERT #undef ASSERT_OK #undef ASSERT_OK_OR_NULL #ifdef GB_DEBUG - // assert X is true - #define ASSERT(X) \ - { \ - if (!(X)) \ - { \ - GBDUMP ("assertion failed: " __FILE__ " line %d\n", __LINE__) ; \ - GB_ABORT ; \ - } \ - } - // call a GraphBLAS method and assert that it returns GrB_SUCCESS #define ASSERT_OK(X) \ { \ @@ -51,7 +37,6 @@ #else // debugging disabled - #define ASSERT(X) #define ASSERT_OK(X) #define ASSERT_OK_OR_NULL(X) @@ -71,7 +56,7 @@ { \ fprintf (stderr, "\ngotcha: " __FILE__ " line: %d\n", __LINE__) ; \ GBDUMP ("\ngotcha: " __FILE__ " line: %d\n", __LINE__) ; \ - GB_ABORT ; \ + GB_Global_abort ( ) ; \ } #endif @@ -177,3 +162,37 @@ #define ASSERT_CONTEXT_OK_OR_NULL(c,name,pr) \ ASSERT_OK_OR_NULL (GB_Context_check (c, name, pr, NULL)) +#if 0 +// For tracking down 64-bit integers when not expected; +// this is meant for development only. +#undef ASSERT_MATRIX_OK +#undef ASSERT_MATRIX_OK_OR_NULL +#undef ASSERT_VECTOR_OK +#undef ASSERT_VECTOR_OK_OR_NULL + +#define ASSERT_MATRIX_OK(A,name,pr) \ +{ \ + if ((A) != NULL && GB_IS_SPARSE((A))) \ + { \ + if (!((A)->p_is_32) || !((A)->i_is_32)) \ + { \ + printf ("Hey: %s %d: %s (%d,%d)\n", \ + __FILE__, __LINE__, name, (A)->p_is_32, (A)->i_is_32) ; \ + } \ + } \ + else if ((A) != NULL && GB_IS_HYPERSPARSE((A))) \ + { \ + if (!((A)->p_is_32) || !((A)->i_is_32) || !((A)->j_is_32)) \ + { \ + printf ("Hey: %s %d: %s (%d,%d,%d)\n", \ + __FILE__, __LINE__, name, \ + (A)->p_is_32, (A)->j_is_32, (A)->i_is_32) ; \ + } \ + } \ +} + +#define ASSERT_MATRIX_OK_OR_NULL(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#define ASSERT_VECTOR_OK_OR_NULL(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#define ASSERT_VECTOR_OK(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#endif + diff --git a/GraphBLAS/Source/ok/GB_check_inputs.h b/GraphBLAS/Source/ok/GB_check_inputs.h deleted file mode 100644 index 8fae0e5c50..0000000000 --- a/GraphBLAS/Source/ok/GB_check_inputs.h +++ /dev/null @@ -1,128 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_check_inputs.h: macros for checking inputs; return if error occurs -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_CHECK_INPUTS_H -#define GB_CHECK_INPUTS_H - -//------------------------------------------------------------------------------ -// GB_RETURN_*: input guards for user-callable GrB* and GxB* methods -//------------------------------------------------------------------------------ - -// check if a required arg is NULL -#define GB_RETURN_IF_NULL(arg) \ - if ((arg) == NULL) \ - { \ - /* the required arg is NULL */ \ - return (GrB_NULL_POINTER) ; \ - } - -// arg may be NULL, but if non-NULL then it must be initialized -#define GB_RETURN_IF_FAULTY(arg) \ - if ((arg) != NULL && (arg)->magic != GB_MAGIC) \ - { \ - if ((arg)->magic == GB_MAGIC2) \ - { \ - /* optional arg is not NULL, but invalid */ \ - return (GrB_INVALID_OBJECT) ; \ - } \ - else \ - { \ - /* optional arg is not NULL, but not initialized */ \ - return (GrB_UNINITIALIZED_OBJECT) ; \ - } \ - } - -// arg must not be NULL, and it must be initialized -#define GB_RETURN_IF_NULL_OR_FAULTY(arg) \ - GB_RETURN_IF_NULL (arg) ; \ - GB_RETURN_IF_FAULTY (arg) ; - -// positional ops not supported for use as accum operators -#define GB_RETURN_IF_FAULTY_OR_POSITIONAL(accum) \ -{ \ - GB_RETURN_IF_FAULTY (accum) ; \ - if (GB_OP_IS_POSITIONAL (accum)) \ - { \ - GB_ERROR (GrB_DOMAIN_MISMATCH, \ - "Positional op z=%s(x,y) not supported as accum\n", \ - accum->name) ; \ - } \ -} - -// C=Z ignores Z if an empty mask is complemented, or if M is full, -// structural and complemented, so return from the method without computing -// anything. Clear C if replace option is true. -#define GB_RETURN_IF_QUICK_MASK(C, C_replace, M, Mask_comp, Mask_struct) \ - if (Mask_comp && (M == NULL || (GB_IS_FULL (M) && Mask_struct))) \ - { \ - /* C=NULL since result does not depend on computing Z */ \ - return (C_replace ? GB_clear (C, Werk) : GrB_SUCCESS) ; \ - } - -//------------------------------------------------------------------------------ -// GB_GET_DESCRIPTOR*: get the contents of a descriptor -//------------------------------------------------------------------------------ - -// check the descriptor and extract its contents -#define GB_GET_DESCRIPTOR(info,desc,dout,dmc,dms,d0,d1,dalgo,dsort) \ - GrB_Info info ; \ - bool dout, dmc, dms, d0, d1 ; \ - int dsort ; \ - GrB_Desc_Value dalgo ; \ - /* if desc is NULL then defaults are used. This is OK */ \ - info = GB_Descriptor_get (desc, &dout, &dmc, &dms, &d0, &d1, &dalgo, \ - &dsort) ; \ - if (info != GrB_SUCCESS) \ - { \ - /* desc not NULL, but uninitialized or an invalid object */ \ - return (info) ; \ - } - -#define GB_GET_DESCRIPTOR_IMPORT(desc,fast_import) \ - /* default is a fast import, where the data is trusted */ \ - bool fast_import = true ; \ - if (desc != NULL && desc->import != GxB_FAST_IMPORT) \ - { \ - /* input data is not trusted */ \ - fast_import = false ; \ - } - -//------------------------------------------------------------------------------ -// GB_VECTOR_OK, GB_SCALAR_OK: check if typecast from GrB_Matrix is OK -//------------------------------------------------------------------------------ - -// The internal content of a GrB_Matrix and GrB_Vector are identical, and -// inside SuiteSparse:GraphBLAS, they can be typecasted between each other. -// This typecasting feature should not be done in user code, however, since it -// is not supported in the API. All GrB_Vector objects can be safely -// typecasted into a GrB_Matrix, but not the other way around. The GrB_Vector -// object is more restrictive. The GB_VECTOR_OK(v) macro defines the content -// that all GrB_Vector objects must have. - -// GB_VECTOR_OK(v) is used mainly for assertions, but also to determine when it -// is safe to typecast an n-by-1 GrB_Matrix (in standard CSC format) into a -// GrB_Vector. This is not done in the main SuiteSparse:GraphBLAS library, but -// in the GraphBLAS/Test directory only. The macro is also used in -// GB_Vector_check, to ensure the content of a GrB_Vector is valid. - -#define GB_VECTOR_OK(v) \ -( \ - ((v) != NULL) && \ - ((v)->is_csc == true) && \ - ((v)->plen == 1 || (v)->plen == -1) && \ - ((v)->vdim == 1) && \ - ((v)->nvec == 1) && \ - ((v)->h == NULL) \ -) - -// A GxB_Vector is a GrB_Vector of length 1 -#define GB_SCALAR_OK(v) (GB_VECTOR_OK(v) && ((v)->vlen == 1)) - -#endif - diff --git a/GraphBLAS/Source/ok/include/GB_assert_kernels.h b/GraphBLAS/Source/ok/include/GB_assert_kernels.h index 05e64148af..37c7a9b2cf 100644 --- a/GraphBLAS/Source/ok/include/GB_assert_kernels.h +++ b/GraphBLAS/Source/ok/include/GB_assert_kernels.h @@ -2,53 +2,18 @@ // GB_assert_kernels.h: assertions for JIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // These methods are for JIT kernels. -// For outside of JIT kernels, see ok/GB_assert.h. +// For outside of JIT kernels, see ok/GB_assert_library.h. //------------------------------------------------------------------------------ // debugging definitions //------------------------------------------------------------------------------ -// the JIT run time kernels use abort directly from libc: -#undef GB_ABORT -#define GB_ABORT /* abort ( ) */ ; - -#undef ASSERT - -#ifdef GB_DEBUG - - // assert X is true - #define ASSERT(X) \ - { \ - if (!(X)) \ - { \ - GBDUMP ("JIT assertion failed: " __FILE__ " line %d\n", __LINE__) ;\ - GB_ABORT ; \ - } \ - } - -#else - - // debugging disabled - #define ASSERT(X) - -#endif - -// ASSERT_OK* debugging disabled in the JIT kernels -#undef ASSERT_OK -#define ASSERT_OK(X) - -#undef ASSERT_OK_OR_NULL -#define ASSERT_OK_OR_NULL(X) - -#undef GB_IMPLIES -#define GB_IMPLIES(p,q) (!(p) || (q)) - // The JIT kernels do not trigger the 'gotcha'. #undef GB_GOTCHA #define GB_GOTCHA @@ -116,3 +81,36 @@ #define ASSERT_DESCRIPTOR_OK(d,name,pr) #define ASSERT_DESCRIPTOR_OK_OR_NULL(d,name,pr) +#if 0 +// For tracking down 64-bit integers when not expected; +// this is meant for development only. +#undef ASSERT_MATRIX_OK +#undef ASSERT_MATRIX_OK_OR_NULL +#undef ASSERT_VECTOR_OK +#undef ASSERT_VECTOR_OK_OR_NULL + +#define ASSERT_MATRIX_OK(A,name,pr) \ +{ \ + if ((A) != NULL && GB_IS_SPARSE((A))) \ + { \ + if (!((A)->p_is_32) || !((A)->i_is_32)) \ + { \ + printf ("Hey JIT: %s %d: %s (%d,%d)\n", \ + __FILE__, __LINE__, name, (A)->p_is_32, (A)->i_is_32) ; \ + } \ + } \ + else if ((A) != NULL && GB_IS_HYPERSPARSE((A))) \ + { \ + if (!((A)->p_is_32) || !((A)->i_is_32) || !((A)->j_is_32)) \ + { \ + printf ("Hey JIT: %s %d: %s (%d,%d,%d)\n", \ + __FILE__, __LINE__, name, \ + (A)->p_is_32, (A)->j_is_32, (A)->i_is_32) ; \ + } \ + } \ +} + +#define ASSERT_MATRIX_OK_OR_NULL(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#define ASSERT_VECTOR_OK_OR_NULL(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#define ASSERT_VECTOR_OK(A,name,pr) ASSERT_MATRIX_OK (A,name,pr) +#endif diff --git a/GraphBLAS/Source/ok/include/GB_ok.h b/GraphBLAS/Source/ok/include/GB_ok.h index 524bbdd047..299f33a0e2 100644 --- a/GraphBLAS/Source/ok/include/GB_ok.h +++ b/GraphBLAS/Source/ok/include/GB_ok.h @@ -2,7 +2,7 @@ // GB_ok.h: call a GraphBLAS method and return if an error occurs //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ #define GB_OK(method) \ { \ - info = method ; \ + info = (method) ; \ if (info != GrB_SUCCESS) \ { \ GB_FREE_ALL ; \ diff --git a/GraphBLAS/Source/omp/GB_omp.c b/GraphBLAS/Source/omp/GB_omp.c index cae80e8cd9..cb24c3df77 100644 --- a/GraphBLAS/Source/omp/GB_omp.c +++ b/GraphBLAS/Source/omp/GB_omp.c @@ -2,7 +2,7 @@ // GB_omp.c: wrappers for OpenMP functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/omp/GB_omp.h b/GraphBLAS/Source/omp/GB_omp.h index 409e195952..951371c9b5 100644 --- a/GraphBLAS/Source/omp/GB_omp.h +++ b/GraphBLAS/Source/omp/GB_omp.h @@ -2,7 +2,7 @@ // GB_omp.h: definitions using OpenMP in SuiteSparse:GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/omp/include/GB_atomics.h b/GraphBLAS/Source/omp/include/GB_atomics.h index c59078b459..8283a7e9c1 100644 --- a/GraphBLAS/Source/omp/include/GB_atomics.h +++ b/GraphBLAS/Source/omp/include/GB_atomics.h @@ -2,7 +2,7 @@ // GB_atomics.h: definitions for atomic operations //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -200,15 +200,15 @@ #if GB_COMPILER_MSC - #define GB_ATOMIC_CAPTURE_INT64(result, target, value) \ + #define GB_ATOMIC_CAPTURE_UINT64(result, target, value) \ { \ result = _InterlockedExchange64 \ - ((int64_t volatile *) (&(target)), value) ; \ + ((uint64_t volatile *) (&(target)), value) ; \ } #else - #define GB_ATOMIC_CAPTURE_INT64(result, target, value) \ + #define GB_ATOMIC_CAPTURE_UINT64(result, target, value) \ { \ GB_ATOMIC_CAPTURE \ { \ @@ -256,15 +256,15 @@ #if GB_COMPILER_MSC - #define GB_ATOMIC_CAPTURE_INT64_OR(result, target, value) \ + #define GB_ATOMIC_CAPTURE_UINT64_OR(result, target, value) \ { \ result = _InterlockedOr64 \ - ((int64_t volatile *) (&(target)), value) ; \ + ((uint64_t volatile *) (&(target)), value) ; \ } #else - #define GB_ATOMIC_CAPTURE_INT64_OR(result, target, value) \ + #define GB_ATOMIC_CAPTURE_UINT64_OR(result, target, value) \ { \ GB_ATOMIC_CAPTURE \ { \ @@ -279,9 +279,10 @@ // atomic post-increment //-------------------------------------------------------------------------- - // Increment an int64_t value and return the value prior to being - // incremented: + // Increment an int64_t or int32_t value and return the value prior to + // being incremented: // + // int32_t result = target++ ; // int64_t result = target++ ; // // See @@ -289,12 +290,30 @@ // The MS Visual Studio version computes result = ++target, so result must // be decremented by one. + #if GB_COMPILER_MSC + + #define GB_ATOMIC_CAPTURE_INC32(result,target) \ + { \ + result = _InterlockedIncrement ((int32_t volatile *) (&(target))) ;\ + result-- ; \ + } + + #else + + #define GB_ATOMIC_CAPTURE_INC32(result,target) \ + { \ + GB_ATOMIC_CAPTURE \ + result = (target)++ ; \ + } + + #endif + #if GB_COMPILER_MSC #define GB_ATOMIC_CAPTURE_INC64(result,target) \ { \ - result = _InterlockedIncrement64 \ - ((int64_t volatile *) (&(target))) - 1 ; \ + result = _InterlockedIncrement64 ((int64_t volatile *)(&(target)));\ + result-- ; \ } #else diff --git a/GraphBLAS/Source/omp/include/GB_kernel_shared_definitions.h b/GraphBLAS/Source/omp/include/GB_kernel_shared_definitions.h index 9fea24955e..3264bddf1d 100644 --- a/GraphBLAS/Source/omp/include/GB_kernel_shared_definitions.h +++ b/GraphBLAS/Source/omp/include/GB_kernel_shared_definitions.h @@ -2,7 +2,7 @@ // GB_kernel_shared_definitions.h: definitions for all methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,6 @@ // This header is #include'd just before using any templates for any method: // pre-generated kernel, CPU or GPU JIT, or generic. -#include "include/GB_unused.h" #include "include/GB_complex.h" #ifndef GB_KERNEL_SHARED_DEFINITIONS_H diff --git a/GraphBLAS/Source/omp/include/GB_nthreads.h b/GraphBLAS/Source/omp/include/GB_nthreads.h index 9fe4d16ffb..831508153e 100644 --- a/GraphBLAS/Source/omp/include/GB_nthreads.h +++ b/GraphBLAS/Source/omp/include/GB_nthreads.h @@ -2,7 +2,7 @@ // GB_nthreads.h: determine # of threads to use for parallel region //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/omp/include/GB_omp_kernels.h b/GraphBLAS/Source/omp/include/GB_omp_kernels.h index feb2e62329..7f75d01d57 100644 --- a/GraphBLAS/Source/omp/include/GB_omp_kernels.h +++ b/GraphBLAS/Source/omp/include/GB_omp_kernels.h @@ -2,7 +2,7 @@ // GB_omp_kernels.h: definitions using OpenMP in SuiteSparse:GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,6 +39,7 @@ #include #define GB_OPENMP_MAX_THREADS omp_get_max_threads ( ) #define GB_OPENMP_GET_WTIME omp_get_wtime ( ) + #else #define GB_OPENMP_MAX_THREADS (1) #define GB_OPENMP_GET_WTIME (0) diff --git a/GraphBLAS/Source/op/GB_Op_free.c b/GraphBLAS/Source/op/GB_Op_free.c index 1f2db44002..e850eab894 100644 --- a/GraphBLAS/Source/op/GB_Op_free.c +++ b/GraphBLAS/Source/op/GB_Op_free.c @@ -2,7 +2,7 @@ // GB_Op_free: free any operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,23 +21,23 @@ GrB_Info GB_Op_free // free a user-created op GB_Operator op = *op_handle ; if (op != NULL) { - GB_FREE (&(op->user_name), op->user_name_size) ; + GB_FREE_MEMORY (&(op->user_name), op->user_name_size) ; size_t defn_size = op->defn_size ; if (defn_size > 0) { - GB_FREE (&(op->defn), defn_size) ; + GB_FREE_MEMORY (&(op->defn), defn_size) ; } size_t theta_size = op->theta_size ; if (theta_size > 0) { - GB_FREE (&(op->theta), theta_size) ; + GB_FREE_MEMORY (&(op->theta), theta_size) ; } size_t header_size = op->header_size ; if (header_size > 0) { op->magic = GB_FREED ; // to help detect dangling pointers op->header_size = 0 ; - GB_FREE (op_handle, header_size) ; + GB_FREE_MEMORY (op_handle, header_size) ; } } } diff --git a/GraphBLAS/Source/op/GB_op.h b/GraphBLAS/Source/op/GB_op.h index 6b41cc4250..6f69849492 100644 --- a/GraphBLAS/Source/op/GB_op.h +++ b/GraphBLAS/Source/op/GB_op.h @@ -2,7 +2,7 @@ // GB_op.h: definitions for operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/op/GB_op_is_second.c b/GraphBLAS/Source/op/GB_op_is_second.c index 36d92a5be7..7287d50192 100644 --- a/GraphBLAS/Source/op/GB_op_is_second.c +++ b/GraphBLAS/Source/op/GB_op_is_second.c @@ -2,7 +2,7 @@ // GB_op_is_second: return true if op is the SECOND operator of the right type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/op/GB_op_name_and_defn.c b/GraphBLAS/Source/op/GB_op_name_and_defn.c index ff3da2ef50..8d30ee39fc 100644 --- a/GraphBLAS/Source/op/GB_op_name_and_defn.c +++ b/GraphBLAS/Source/op/GB_op_name_and_defn.c @@ -2,7 +2,7 @@ // GB_op_name_and_defn: construct name and defn of a user-defined op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -76,7 +76,7 @@ GrB_Info GB_op_name_and_defn defn_len = strlen (input_defn) ; // allocate space for the definition - defn = GB_MALLOC (defn_len+1, char, &defn_size) ; + defn = GB_MALLOC_MEMORY (defn_len+1, sizeof (char), &defn_size) ; if (defn == NULL) { // out of memory diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapC.c index 5357fbdbe5..e518f7c4e3 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapC.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_BitmapC: pack a matrix in bitmap format, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,10 @@ GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column int8_t **Ab, // bitmap, Ab_size >= nrows*ncols void **Ax, // values, Ax_size >= nrows*ncols * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ab_size, // size of Ab in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -27,10 +27,12 @@ GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_BitmapC (A, " - "&Ab, &Ax, Ab_size, Ax_size, iso, nvals, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_BitmapC (A, &Ab, &Ax, Ab_size, Ax_size," + " iso, nvals, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_BitmapC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapR.c index 774bdd1c71..18cea63503 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_BitmapR.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_BitmapR: pack a matrix in bitmap format, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,10 @@ GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row int8_t **Ab, // bitmap, Ab_size >= nrows*ncols void **Ax, // values, Ax_size >= nrows*ncols * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ab_size, // size of Ab in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -27,10 +27,12 @@ GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_BitmapR (A, " - "&Ab, &Ax, Ab_size, Ax_size, iso, nvals, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_BitmapR (A, &Ab, &Ax, Ab_size, Ax_size," + " iso, nvals, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_BitmapR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSC.c index 6f085a7672..5311879e7b 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_CSC: pack a matrix in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,13 +12,13 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) + uint64_t **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) + uint64_t **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) void **Ax, // values, Ax_size >= nvals(A) * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ai_size, // size of Ai in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso bool jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc @@ -29,11 +29,12 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_CSC (A, " - "&Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, iso, " - "jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_CSC (A, &Ap, &Ai, &Ax, Ap_size, Ai_size," + " Ax_size, iso, jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_CSC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSR.c index 2af50360ca..a582a756bf 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_CSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_CSR: pack a matrix in CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,13 +12,13 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) + uint64_t **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) + uint64_t **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) void **Ax, // values, Ax_size >= nvals(A) * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Aj_size, // size of Aj in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso bool jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc @@ -29,11 +29,12 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_CSR (A, " - "&Ap, &Aj, &Ax, Ap_size, Aj_size, Ax_size, iso, " - "jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_CSR (A, &Ap, &Aj, &Ax, Ap_size, Aj_size," + " Ax_size, iso, jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_CSR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullC.c index f23aadaeeb..18c3ab05c3 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullC.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_FullC: pack a matrix in full format, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) void **Ax, // values, Ax_size >= nrows*ncols * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso const GrB_Descriptor desc ) @@ -24,10 +24,11 @@ GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_FullC (A, " - "&Ax, Ax_size, iso, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_FullC (A, &Ax, Ax_size, iso, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_FullC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullR.c index 9b7a60959f..95fdfdf08b 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_FullR.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_FullR: pack a matrix in full format, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) void **Ax, // values, Ax_size >= nrows*ncols * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso const GrB_Descriptor desc ) @@ -24,10 +24,11 @@ GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_FullR (A, " - "&Ax, Ax_size, iso, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_FullR (A, &Ax, Ax_size, iso, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_FullR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c index d68b72506f..54bc0c3cc7 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_HyperCSC: pack a matrix in hypersparse CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,18 +12,18 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // col "pointers", Ap_size >= (plen+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= plen*sizeof(int64_t) + uint64_t **Ap, // col "pointers", Ap_size >= (plen+1)*sizeof(int64_t) + uint64_t **Ah, // column indices, Ah_size >= plen*sizeof(int64_t) // where plen = 1 if ncols = 1, or nvec otherwise. - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) + uint64_t **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) void **Ax, // values, Ax_size >= nvals(A)*(type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ah_size, // size of Ah in bytes + uint64_t Ai_size, // size of Ai in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah + uint64_t nvec, // number of columns that appear in Ah bool jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc ) @@ -33,11 +33,12 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_HyperCSC (A, " - "&Ap, &Ah, &Ai, &Ax, Ap_size, Ah_size, Ai_size, Ax_size, iso, " - "nvec, jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_HyperCSC (A, &Ap, &Ah, &Ai, &Ax, Ap_size," + " Ah_size, Ai_size, Ax_size, iso, nvec, jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_HyperCSC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSR.c index 93fc7a0b8e..53f050c21a 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_pack_HyperCSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_pack_HyperCSR: pack a matrix in hypersparse CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,18 +12,18 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers", Ap_size >= (plen+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= plen*sizeof(int64_t) + uint64_t **Ap, // row "pointers", Ap_size >= (plen+1)*sizeof(int64_t) + uint64_t **Ah, // row indices, Ah_size >= plen*sizeof(int64_t) // where plen = 1 if nrows = 1, or nvec otherwise. - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) + uint64_t **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) void **Ax, // values, Ax_size >= nvals(A) * (type size) // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes + uint64_t Ap_size, // size of Ap in bytes + uint64_t Ah_size, // size of Ah in bytes + uint64_t Aj_size, // size of Aj in bytes + uint64_t Ax_size, // size of Ax in bytes bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah + uint64_t nvec, // number of rows that appear in Ah bool jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc ) @@ -33,11 +33,12 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_pack_HyperCSR (A, " - "&Ap, &Ah, &Aj, &Ax, Ap_size, Ah_size, Aj_size, Ax_size, iso, " - "nvec, jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_pack_HyperCSR (A, &Ap, &Ah, &Aj, &Ax, Ap_size," + " Ah_size, Aj_size, Ax_size, iso, nvec, jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_pack_HyperCSR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapC.c index 7c51a71860..0d92671530 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapC.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_BitmapC: unpack a bitmap matrix, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,10 +16,10 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) int8_t **Ab, // bitmap void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ab_size, // size of Ab in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -28,10 +28,12 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_BitmapC (A, " - "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_BitmapC (A, Ab, &Ax, &Ab_size, &Ax_size," + " &iso, &nvals, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_BitmapC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -42,7 +44,6 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col if (!(A->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, true, Werk)) ; } @@ -61,7 +62,7 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapR.c index 32660b5d5c..fc157b6a5b 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_BitmapR.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_BitmapR: unpack a bitmap matrix, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,10 +16,10 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) int8_t **Ab, // bitmap void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ab_size, // size of Ab in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -28,10 +28,12 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_BitmapR (A, " - "&Ab, &Ax, &Ab_size, &Ax_size, &iso, &nvals, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_BitmapR (A, &Ab, &Ax, &Ab_size, &Ax_size," + " &iso, &nvals, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_BitmapR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -42,7 +44,6 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row if (A->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, false, Werk)) ; } @@ -61,7 +62,7 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSC.c index c5e35f017a..f8ecca9630 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_CSC: unpack a matrix in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,12 +14,12 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ai_size, // size of Ai in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso bool *jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc @@ -30,11 +30,12 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_CSC (A, " - "&Ap, &Ai, &Ax, &Ap_size, &Ai_size, &Ax_size, &iso, " - "&jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_CSC (A, &Ap, &Ai, &Ax, &Ap_size," + " &Ai_size, &Ax_size, &iso, &jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_CSC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -44,7 +45,6 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix if (!(A->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, true, Werk)) ; } @@ -82,7 +82,7 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, Ap, Ap_size, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSR.c index abbce3687d..171c47bdcd 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_CSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_CSR: unpack a matrix in CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,12 +14,12 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Aj_size, // size of Aj in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso bool *jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc @@ -30,11 +30,12 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_CSR (A, " - "&Ap, &Aj, &Ax, &Ap_size, &Aj_size, &Ax_size, &iso, " - "&jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_CSR (A, &Ap, &Aj, &Ax, &Ap_size," + " &Aj_size, &Ax_size, &iso, &jumbled, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_CSR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -44,7 +45,6 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix if (A->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, false, Werk)) ; } @@ -82,7 +82,7 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, Ap, Ap_size, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullC.c index ab75ffdebd..dd2680e86f 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullC.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_FullC: unpack a full matrix, held by column //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso const GrB_Descriptor desc ) @@ -25,10 +25,11 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_FullC (A, " - "&Ax, &Ax_size, &iso, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_FullC (A, &Ax, &Ax_size, &iso, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_FullC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -50,7 +51,6 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column if (!(A->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, true, Werk)) ; GB_MATRIX_WAIT (A) ; } @@ -70,7 +70,7 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullR.c index dfe2d19940..cc38a736ce 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_FullR.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_FullR: unpack a full matrix, held by row //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso const GrB_Descriptor desc ) @@ -25,10 +25,11 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_FullR (A, " - "&Ax, &Ax_size, &iso, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_FullR (A, &Ax, &Ax_size, &iso, desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_FullR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -50,7 +51,6 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row if (A->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, false, Werk)) ; GB_MATRIX_WAIT (A) ; } @@ -70,7 +70,7 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSC.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSC.c index 1051b7f7a1..23588e8b9e 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSC.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_HyperCSC: unpack a matrix in hypersparse CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,16 +14,16 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices + uint64_t **Ap, // column "pointers" + uint64_t **Ah, // column indices + uint64_t **Ai, // row indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ah_size, // size of Ah in bytes + uint64_t *Ai_size, // size of Ai in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah + uint64_t *nvec, // number of columns that appear in Ah bool *jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc ) @@ -33,11 +33,13 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_HyperCSC (A, " - "&Ap, &Ah, &Ai, &Ax, &Ap_size, &Ah_size, &Ai_size, &Ax_size, " - "&iso, &nvec, &jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_HyperCSC (A, &Ap, &Ah, &Ai, &Ax," + " &Ap_size, &Ah_size, &Ai_size, &Ax_size, &iso, &nvec, &jumbled," + " desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_HyperCSC") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -47,7 +49,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix if (!(A->is_csc)) { // A = A', done in-place, to put A in by-col format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, true, Werk)) ; } @@ -85,7 +86,7 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, Ap, Ap_size, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSR.c b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSR.c index c22e83e76a..ea020a8c1e 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSR.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Matrix_unpack_HyperCSR.c @@ -2,7 +2,7 @@ // GxB_Matrix_unpack_HyperCSR: unpack a matrix in hypersparse CSR format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,16 +14,16 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices + uint64_t **Ap, // row "pointers" + uint64_t **Ah, // row indices + uint64_t **Aj, // column indices void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes + uint64_t *Ap_size, // size of Ap in bytes + uint64_t *Ah_size, // size of Ah in bytes + uint64_t *Aj_size, // size of Aj in bytes + uint64_t *Ax_size, // size of Ax in bytes bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah + uint64_t *nvec, // number of rows that appear in Ah bool *jumbled, // if true, indices in each row may be unsorted const GrB_Descriptor desc ) @@ -33,11 +33,13 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_unpack_HyperCSR (A, " - "&Ap, &Ah, &Aj, &Ax, &Ap_size, &Ah_size, &Aj_size, &Ax_size, " - "&iso, &nvec, &jumbled, desc)") ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_WHERE_1 (A, "GxB_Matrix_unpack_HyperCSR (A, &Ap, &Ah, &Aj, &Ax," + " &Ap_size, &Ah_size, &Aj_size, &Ax_size, &iso, &nvec, &jumbled," + " desc)") ; GB_BURBLE_START ("GxB_Matrix_unpack_HyperCSR") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -47,7 +49,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix if (A->is_csc) { // A = A', done in-place, to put A in by-row format - GBURBLE ("(transpose) ") ; GB_OK (GB_transpose_in_place (A, false, Werk)) ; } @@ -85,7 +86,7 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, &A, &type, &vlen, &vdim, false, Ap, Ap_size, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Bitmap.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Bitmap.c index 92d710c71e..cc8ed1c526 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Bitmap.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Bitmap.c @@ -2,7 +2,7 @@ // GxB_Vector_pack_Bitmap: pack a vector in bitmap format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,10 @@ GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector int8_t **vb, // bitmap, vb_size >= n void **vx, // values, vx_size >= n * (type size) // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes + uint64_t vb_size, // size of vb in bytes + uint64_t vx_size, // size of vx in bytes bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap + uint64_t nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -27,10 +27,12 @@ GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_pack_Bitmap (v, " - "&vb, &vx, vb_size, vx_size, iso, nvals, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_pack_Bitmap (v, &vb, &vx, vb_size, vx_size," + " iso, nvals, desc)") ; GB_BURBLE_START ("GxB_Vector_pack_Bitmap") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_CSC.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_CSC.c index 0f2e7b91d4..88e26ad879 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_CSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_CSC.c @@ -2,7 +2,7 @@ // GxB_Vector_pack_CSC: pack a vector in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,13 +12,13 @@ GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format ( GrB_Vector v, // vector to create (type and length unchanged) - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) + uint64_t **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) void **vx, // values, vx_size >= nvals(v) * (type size) // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes + uint64_t vi_size, // size of vi in bytes + uint64_t vx_size, // size of vx in bytes bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector + uint64_t nvals, // # of entries in vector bool jumbled, // if true, indices may be unsorted const GrB_Descriptor desc ) @@ -28,10 +28,12 @@ GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_pack_CSC (v, " - "&vi, &vx, vi_size, vx_size, iso, nvals, jumbled, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_pack_CSC (v, &vi, &vx, vi_size, vx_size, iso," + " nvals, jumbled, desc)") ; GB_BURBLE_START ("GxB_Vector_pack_CSC") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Full.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Full.c index c357d0d974..87195caee0 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Full.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_pack_Full.c @@ -2,7 +2,7 @@ // GxB_Vector_pack_Full: pack a vector in full format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ GrB_Info GxB_Vector_pack_Full // pack a full vector GrB_Vector v, // vector to create (type and length unchanged) void **vx, // values, vx_size >= nvals(v) * (type size) // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes + uint64_t vx_size, // size of vx in bytes bool iso, // if true, v is iso const GrB_Descriptor desc ) @@ -24,10 +24,11 @@ GrB_Info GxB_Vector_pack_Full // pack a full vector // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_pack_Full (v, " - "&vx, vx_size, iso, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_pack_Full (v, &vx, vx_size, iso, desc)") ; GB_BURBLE_START ("GxB_Vector_pack_Full") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ; diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Bitmap.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Bitmap.c index d38bb1048a..a0f7cd846b 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Bitmap.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Bitmap.c @@ -2,7 +2,7 @@ // GxB_Vector_unpack_Bitmap: unpack a bitmap vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,10 +16,10 @@ GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector GrB_Vector v, // vector to unpack (type and length unchanged) int8_t **vb, // bitmap void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes + uint64_t *vb_size, // size of vb in bytes + uint64_t *vx_size, // size of vx in bytes bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap + uint64_t *nvals, // # of entries in bitmap const GrB_Descriptor desc ) { @@ -28,10 +28,12 @@ GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_unpack_Bitmap (v, " - "&vb, &vx, &vb_size, &vx_size, &iso, &nvals, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_unpack_Bitmap (v, &vb, &vx, &vb_size, &vx_size," + " &iso, &nvals, desc)") ; GB_BURBLE_START ("GxB_Vector_unpack_Bitmap") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -60,7 +62,7 @@ GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, (GrB_Matrix *) (&v), &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_CSC.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_CSC.c index ccf061f89c..6298f6924f 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_CSC.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_CSC.c @@ -2,7 +2,7 @@ // GxB_Vector_unpack_CSC: unpack a vector in CSC format //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,12 +14,12 @@ GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector ( GrB_Vector v, // vector to unpack (type and length unchanged) - GrB_Index **vi, // indices + uint64_t **vi, // indices void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes + uint64_t *vi_size, // size of vi in bytes + uint64_t *vx_size, // size of vx in bytes bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector + uint64_t *nvals, // # of entries in vector bool *jumbled, // if true, indices may be unsorted const GrB_Descriptor desc ) @@ -29,12 +29,14 @@ GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_unpack_CSC (v, " - "&vi, &vx, &vi_size, &vx_size, &iso, &nvals, &jumbled, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_NULL (nvals) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_unpack_CSC (v, &vi, &vx, &vi_size, &vx_size," + " &iso, &nvals, &jumbled, desc)") ; GB_BURBLE_START ("GxB_Vector_unpack_CSC") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; - GB_RETURN_IF_NULL (nvals) ; //-------------------------------------------------------------------------- // finish any pending work @@ -70,7 +72,7 @@ GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, (GrB_Matrix *) (&v), &type, &vlen, &vdim, true, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Full.c b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Full.c index 64b3997c6f..f2be40ff11 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Full.c +++ b/GraphBLAS/Source/pack_unpack/GxB_Vector_unpack_Full.c @@ -2,7 +2,7 @@ // GxB_Vector_unpack_Full: unpack a full vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector ( GrB_Vector v, // vector to unpack (type and length unchanged) void **vx, // values - GrB_Index *vx_size, // size of vx in bytes + uint64_t *vx_size, // size of vx in bytes bool *iso, // if true, v is iso const GrB_Descriptor desc ) @@ -25,10 +25,11 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_unpack_Full (v, " - "&vx, &vx_size, &iso, desc)") ; + GB_RETURN_IF_NULL (v) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (v) ; + GB_WHERE_1 (v, "GxB_Vector_unpack_Full (v, &vx, &vx_size, &iso, desc)") ; GB_BURBLE_START ("GxB_Vector_unpack_Full") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- @@ -62,7 +63,7 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector int sparsity ; bool is_csc ; GrB_Type type ; - GrB_Index vlen, vdim ; + uint64_t vlen, vdim ; info = GB_export (true, (GrB_Matrix *) (&v), &type, &vlen, &vdim, false, NULL, NULL, // Ap diff --git a/GraphBLAS/Source/pack_unpack/GxB_pack_HyperHash.c b/GraphBLAS/Source/pack_unpack/GxB_pack_HyperHash.c index bb1d417fc1..4a61ad5957 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_pack_HyperHash.c +++ b/GraphBLAS/Source/pack_unpack/GxB_pack_HyperHash.c @@ -2,7 +2,7 @@ // GxB_pack_HyperHash: set the A->Y hyper_hash of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -70,11 +70,13 @@ GrB_Info GxB_pack_HyperHash // move Y into A->Y // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_pack_HyperHash (A, &Y, desc)") ; - GB_BURBLE_START ("GxB_pack_HyperHash") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (Y) ; - GB_RETURN_IF_FAULTY (*Y) ; + GB_RETURN_IF_INVALID (*Y) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (*Y) ; //-------------------------------------------------------------------------- // check for quick return @@ -92,12 +94,20 @@ GrB_Info GxB_pack_HyperHash // move Y into A->Y if ((*Y)->vlen != A->vdim || !GB_IS_POWER_OF_TWO ((*Y)->vdim) || (*Y)->nvals != A->nvec || !GB_IS_SPARSE (*Y) || (*Y)->Y != NULL || - (*Y)->type != GrB_UINT64 || !(*Y)->is_csc || GB_ANY_PENDING_WORK (*Y)) + (!((*Y)->type == GrB_UINT64 || (*Y)->type == GrB_UINT32)) || + !(*Y)->is_csc || GB_ANY_PENDING_WORK (*Y)) { // Y is invalid return (GrB_INVALID_OBJECT) ; } + //-------------------------------------------------------------------------- + // ensure Y has the same integers as A->h + //-------------------------------------------------------------------------- + + bool Aj_is_32 = A->j_is_32 ; + GB_OK (GB_convert_int (*Y, Aj_is_32, Aj_is_32, Aj_is_32, false)) ; // OK + //-------------------------------------------------------------------------- // pack the hyper_hash matrix Y into A //-------------------------------------------------------------------------- @@ -106,8 +116,7 @@ GrB_Info GxB_pack_HyperHash // move Y into A->Y (*Y) = NULL ; A->Y_shallow = false ; A->no_hyper_hash = false ; // A now has a hyper_hash matrix A->Y - - GB_BURBLE_END ; + ASSERT_MATRIX_OK (A, "A with new hyperhash", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/pack_unpack/GxB_unpack_HyperHash.c b/GraphBLAS/Source/pack_unpack/GxB_unpack_HyperHash.c index ee01c6f657..fee7f2d818 100644 --- a/GraphBLAS/Source/pack_unpack/GxB_unpack_HyperHash.c +++ b/GraphBLAS/Source/pack_unpack/GxB_unpack_HyperHash.c @@ -2,7 +2,7 @@ // GxB_unpack_HyperHash: unpack the A->Y hyper_hash from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -63,11 +63,13 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y // check inputs and get the descriptor //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_unpack_HyperHash (A, &Y, desc)") ; - GB_BURBLE_START ("GxB_unpack_HyperHash") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GrB_Info info ; + GB_CHECK_INIT ; + GB_RETURN_IF_NULL_OR_INVALID (A) ; GB_RETURN_IF_NULL (Y) ; - GB_RETURN_IF_FAULTY (*Y) ; + GB_RETURN_IF_INVALID (*Y) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (*Y) ; //-------------------------------------------------------------------------- // unpack the hyper_hash matrix Y from A @@ -76,8 +78,6 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y (*Y) = A->Y ; A->Y = NULL ; A->Y_shallow = false ; - - GB_BURBLE_END ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/pending/GB_Pending.h b/GraphBLAS/Source/pending/GB_Pending.h index 041f25c55c..b963a0e1a1 100644 --- a/GraphBLAS/Source/pending/GB_Pending.h +++ b/GraphBLAS/Source/pending/GB_Pending.h @@ -2,7 +2,7 @@ // GB_Pending.h: operations for pending tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,7 @@ #ifndef GB_PENDING_H #define GB_PENDING_H #include "GB.h" +#include "include/GB_unused.h" //------------------------------------------------------------------------------ // GB_Pending functions @@ -17,17 +18,16 @@ bool GB_Pending_alloc // create a list of pending tuples ( - GB_Pending *PHandle, // output + GrB_Matrix C, // matrix to create C->Pending for bool iso, // if true, do not allocate Pending->x GrB_Type type, // type of pending tuples GrB_BinaryOp op, // operator for assembling pending tuples - bool is_matrix, // true if Pending->j must be allocated int64_t nmax // # of pending tuples to hold ) ; bool GB_Pending_realloc // reallocate a list of pending tuples ( - GB_Pending *PHandle, // Pending tuple list to reallocate + GrB_Matrix C, // matrix to reallocate C->Pending for int64_t nnew, // # of new tuples to accomodate GB_Werk Werk ) ; @@ -38,19 +38,17 @@ void GB_Pending_free // free a list of pending tuples ) ; //------------------------------------------------------------------------------ -// GB_Pending_add: add an entry A(i,j) to the list of pending tuples +// GB_Pending_add: add an entry C(i,j) to the list of pending tuples //------------------------------------------------------------------------------ static inline bool GB_Pending_add // add a tuple to the list ( - GB_Pending *PHandle, // Pending tuples to create or append - bool iso, // if true, do not allocate Pending->x + GrB_Matrix C, // matrix to add a pending tuple to const GB_void *scalar, // scalar to add to the pending tuples const GrB_Type type, // scalar type, if list is created const GrB_BinaryOp op, // new Pending->op, if list is created const int64_t i, // index into vector const int64_t j, // vector index - const bool is_matrix, // allocate Pending->j, if list is created GB_Werk Werk ) { @@ -59,35 +57,37 @@ static inline bool GB_Pending_add // add a tuple to the list // check inputs //-------------------------------------------------------------------------- - ASSERT (PHandle != NULL) ; + ASSERT (C != NULL) ; //-------------------------------------------------------------------------- // allocate the Pending tuples, or ensure existing list is large enough //-------------------------------------------------------------------------- - if (!GB_Pending_ensure (PHandle, iso, type, op, is_matrix, 1, Werk)) + bool iso = C->iso ; + if (!GB_Pending_ensure (C, iso, type, op, 1, Werk)) { return (false) ; } - GB_Pending Pending = (*PHandle) ; + GB_Pending Pending = C->Pending ; + ASSERT (Pending != NULL) ; int64_t n = Pending->n ; ASSERT (Pending->type == type) ; ASSERT (Pending->nmax > 0 && n < Pending->nmax) ; ASSERT (Pending->i != NULL) ; - ASSERT ((is_matrix) == (Pending->j != NULL)) ; + ASSERT ((C->vdim > 1) == (Pending->j != NULL)) ; //-------------------------------------------------------------------------- // keep track of whether or not the pending tuples are already sorted //-------------------------------------------------------------------------- - int64_t *restrict Pending_i = Pending->i ; - int64_t *restrict Pending_j = Pending->j ; + GB_CPendingi_DECLARE (Pending_i) ; GB_CPendingi_PTR (Pending_i, C) ; + GB_CPendingj_DECLARE (Pending_j) ; GB_CPendingj_PTR (Pending_j, C) ; if (n > 0 && Pending->sorted) { - int64_t ilast = Pending_i [n-1] ; - int64_t jlast = (Pending_j != NULL) ? Pending_j [n-1] : 0 ; + int64_t ilast = GB_IGET (Pending_i, n-1) ; + int64_t jlast = (Pending_j != NULL) ? GB_IGET (Pending_j, n-1) : 0 ; Pending->sorted = (jlast < j) || (jlast == j && ilast <= i) ; } @@ -95,10 +95,12 @@ static inline bool GB_Pending_add // add a tuple to the list // add the (i,j,scalar) or just (i,scalar) if Pending->j is NULL //-------------------------------------------------------------------------- - Pending_i [n] = i ; + // Pending_i [n] = i ; + GB_ISET (Pending_i, n, i) ; if (Pending_j != NULL) { - Pending_j [n] = j ; + // Pending_j [n] = j ; + GB_ISET (Pending_j, n, j) ; } size_t size = type->size ; GB_void *restrict Pending_x = Pending->x ; diff --git a/GraphBLAS/Source/pending/GB_Pending_alloc.c b/GraphBLAS/Source/pending/GB_Pending_alloc.c index 2c0f374ecd..2f16a5fedb 100644 --- a/GraphBLAS/Source/pending/GB_Pending_alloc.c +++ b/GraphBLAS/Source/pending/GB_Pending_alloc.c @@ -2,7 +2,7 @@ // GB_Pending_alloc: allocate a list of pending tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,11 +11,10 @@ bool GB_Pending_alloc // create a list of pending tuples ( - GB_Pending *PHandle, // output + GrB_Matrix C, // matrix to create C->Pending for bool iso, // if true, do not allocate Pending->x GrB_Type type, // type of pending tuples GrB_BinaryOp op, // operator for assembling pending tuples - bool is_matrix, // true if Pending->j must be allocated int64_t nmax // # of pending tuples to hold ) { @@ -24,15 +23,16 @@ bool GB_Pending_alloc // create a list of pending tuples // check inputs //-------------------------------------------------------------------------- - ASSERT (PHandle != NULL) ; - (*PHandle) = NULL ; + ASSERT (C != NULL) ; + ASSERT (C->Pending == NULL) ; //-------------------------------------------------------------------------- // allocate the Pending header //-------------------------------------------------------------------------- size_t header_size ; - GB_Pending Pending = GB_MALLOC (1, struct GB_Pending_struct, &header_size) ; + GB_Pending Pending = GB_MALLOC_MEMORY (1, sizeof (struct GB_Pending_struct), + &header_size) ; if (Pending == NULL) { // out of memory @@ -55,16 +55,20 @@ bool GB_Pending_alloc // create a list of pending tuples Pending->j_size = 0 ; Pending->x_size = 0 ; - Pending->i = GB_MALLOC (nmax, int64_t, &(Pending->i_size)) ; + bool is_matrix = (C->vdim > 1) ; + size_t jsize = (C->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = (C->i_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Pending->i = GB_MALLOC_MEMORY (nmax, isize, &(Pending->i_size)) ; Pending->j = NULL ; if (is_matrix) { - Pending->j = GB_MALLOC (nmax, int64_t, &(Pending->j_size)) ; + Pending->j = GB_MALLOC_MEMORY (nmax, jsize, &(Pending->j_size)) ; } Pending->x = NULL ; if (!iso) { - Pending->x = GB_MALLOC (nmax * Pending->size, GB_void, // x:OK + Pending->x = GB_MALLOC_MEMORY (nmax, Pending->size, &(Pending->x_size)) ; } @@ -81,7 +85,7 @@ bool GB_Pending_alloc // create a list of pending tuples // return result //-------------------------------------------------------------------------- - (*PHandle) = Pending ; + C->Pending = Pending ; return (true) ; } diff --git a/GraphBLAS/Source/pending/GB_Pending_ensure.c b/GraphBLAS/Source/pending/GB_Pending_ensure.c index 37c54ab9a6..ca55cb1f3b 100644 --- a/GraphBLAS/Source/pending/GB_Pending_ensure.c +++ b/GraphBLAS/Source/pending/GB_Pending_ensure.c @@ -2,7 +2,7 @@ // GB_Pending_ensure: ensure a list of pending tuples is large enough //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,19 +18,19 @@ GB_CALLBACK_PENDING_ENSURE_PROTO (GB_Pending_ensure) // check inputs //-------------------------------------------------------------------------- - ASSERT (PHandle != NULL) ; + ASSERT (C != NULL) ; //-------------------------------------------------------------------------- // ensure the list of pending tuples is large enough //-------------------------------------------------------------------------- - if ((*PHandle) == NULL) + if (C->Pending == NULL) { - return (GB_Pending_alloc (PHandle, iso, type, op, is_matrix, nnew)) ; + return (GB_Pending_alloc (C, iso, type, op, nnew)) ; } else { - return (GB_Pending_realloc (PHandle, nnew, Werk)) ; + return (GB_Pending_realloc (C, nnew, Werk)) ; } } diff --git a/GraphBLAS/Source/pending/GB_Pending_free.c b/GraphBLAS/Source/pending/GB_Pending_free.c index 0395b5e506..ab3a5e6498 100644 --- a/GraphBLAS/Source/pending/GB_Pending_free.c +++ b/GraphBLAS/Source/pending/GB_Pending_free.c @@ -2,7 +2,7 @@ // GB_Pending_free: free a list of pending tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,10 @@ void GB_Pending_free // free a list of pending tuples GB_Pending Pending = (*PHandle) ; if (Pending != NULL) { - GB_FREE (&(Pending->i), Pending->i_size) ; - GB_FREE (&(Pending->j), Pending->j_size) ; - GB_FREE (&(Pending->x), Pending->x_size) ; - GB_FREE (&(Pending), Pending->header_size) ; + GB_FREE_MEMORY (&(Pending->i), Pending->i_size) ; + GB_FREE_MEMORY (&(Pending->j), Pending->j_size) ; + GB_FREE_MEMORY (&(Pending->x), Pending->x_size) ; + GB_FREE_MEMORY (&(Pending), Pending->header_size) ; } (*PHandle) = NULL ; diff --git a/GraphBLAS/Source/pending/GB_Pending_n.c b/GraphBLAS/Source/pending/GB_Pending_n.c index 7a886da129..8e1e5e46cd 100644 --- a/GraphBLAS/Source/pending/GB_Pending_n.c +++ b/GraphBLAS/Source/pending/GB_Pending_n.c @@ -2,7 +2,7 @@ // GB_Pending_n: return the # of pending tuples in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/pending/GB_Pending_n.h b/GraphBLAS/Source/pending/GB_Pending_n.h index 2af1d9e61f..858a45035d 100644 --- a/GraphBLAS/Source/pending/GB_Pending_n.h +++ b/GraphBLAS/Source/pending/GB_Pending_n.h @@ -2,7 +2,7 @@ // GB_Pending_n.h: return the # of pending tuples in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/pending/GB_Pending_realloc.c b/GraphBLAS/Source/pending/GB_Pending_realloc.c index a7ed13a38a..2eb36f7a40 100644 --- a/GraphBLAS/Source/pending/GB_Pending_realloc.c +++ b/GraphBLAS/Source/pending/GB_Pending_realloc.c @@ -2,7 +2,7 @@ // GB_Pending_realloc: reallocate a list of pending tuples //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ bool GB_Pending_realloc // reallocate a list of pending tuples ( - GB_Pending *PHandle, // Pending tuple list to reallocate + GrB_Matrix C, // matrix to reallocate C->Pending for int64_t nnew, // # of new tuples to accomodate GB_Werk Werk ) @@ -23,8 +23,9 @@ bool GB_Pending_realloc // reallocate a list of pending tuples // check inputs //-------------------------------------------------------------------------- - ASSERT (PHandle != NULL) ; - GB_Pending Pending = (*PHandle) ; + ASSERT (C != NULL) ; + GB_Pending Pending = C->Pending ; + ASSERT (Pending != NULL) ; //-------------------------------------------------------------------------- // ensure the list can hold at least nnew more tuples @@ -45,25 +46,30 @@ bool GB_Pending_realloc // reallocate a list of pending tuples // reallocate the i,j,x arrays //---------------------------------------------------------------------- + size_t jsize = (C->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = (C->i_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + bool ok1 = true ; bool ok2 = true ; bool ok3 = true ; - GB_REALLOC (Pending->i, newsize, int64_t, &(Pending->i_size), &ok1) ; + GB_REALLOC_MEMORY (Pending->i, newsize, isize, &(Pending->i_size), + &ok1) ; if (Pending->j != NULL) { - GB_REALLOC (Pending->j, newsize, int64_t, &(Pending->j_size), &ok2); + GB_REALLOC_MEMORY (Pending->j, newsize, jsize, &(Pending->j_size), + &ok2) ; } size_t s = Pending->size ; if (Pending->x != NULL) { - GB_REALLOC (Pending->x, newsize*s, GB_void, &(Pending->x_size), + GB_REALLOC_MEMORY (Pending->x, newsize, s, &(Pending->x_size), &ok3) ; } if (!ok1 || !ok2 || !ok3) { // out of memory - GB_Pending_free (PHandle) ; + GB_Pending_free (&(C->Pending)) ; return (false) ; } diff --git a/GraphBLAS/Source/pji_control/GB_determine_pji_is_32.h b/GraphBLAS/Source/pji_control/GB_determine_pji_is_32.h new file mode 100644 index 0000000000..a36fc16870 --- /dev/null +++ b/GraphBLAS/Source/pji_control/GB_determine_pji_is_32.h @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// GB_determine_pji_is_32: determine [pji]_is_32 for a new matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// The Werk->[pji]_control has been determined from the input matrix and global +// controls. If Werk is NULL, then only the global controls are used. This +// method then determines the final p_is_32, j_is_32, and i_is_32 for a new +// matrix of the requested size. + +#ifndef GB_DETERMINE_PJI_IS_32 +#define GB_DETERMINE_PJI_IS_32 + +static inline void GB_determine_pji_is_32 +( + // output + bool *p_is_32, // if true, Ap will be 32 bits; else 64 + bool *j_is_32, // if true, Ah and A->Y will be 32 bits; else 64 + bool *i_is_32, // if true, Ai will be 32 bits; else 64 + // input + int sparsity, // sparse, hyper, bitmap, full, or auto (sparse/hyper) + int64_t nvals, // upper bound on # of entries in the matrix to create + int64_t vlen, // dimensions of the matrix to create + int64_t vdim, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (p_is_32 != NULL) ; + ASSERT (j_is_32 != NULL) ; + ASSERT (i_is_32 != NULL) ; + + //-------------------------------------------------------------------------- + // determine the 32/64 bit integer sizes for a new matrix + //-------------------------------------------------------------------------- + + if (sparsity == GxB_FULL || sparsity == GxB_BITMAP) + { + + //---------------------------------------------------------------------- + // full/bitmap matrices do not have any integer sizes + //---------------------------------------------------------------------- + + (*p_is_32) = false ; + (*j_is_32) = false ; + (*i_is_32) = false ; + + } + else + { + + //---------------------------------------------------------------------- + // determine the 32/64 integer sizes for a sparse/hypersparse matrix + //---------------------------------------------------------------------- + + int8_t p_control = Werk ? Werk->p_control : GB_Global_p_control_get ( ); + int8_t j_control = Werk ? Werk->j_control : GB_Global_j_control_get ( ); + int8_t i_control = Werk ? Werk->i_control : GB_Global_i_control_get ( ); + + // determine ideal 32/64 sizes for any matrix created by the caller + bool p_prefer_32 = (p_control <= 32) ; + bool j_prefer_32 = (j_control <= 32) ; + bool i_prefer_32 = (i_control <= 32) ; + + // revise them accordering to the matrix content + (*p_is_32) = GB_determine_p_is_32 (p_prefer_32, nvals) ; // OK + (*j_is_32) = GB_determine_j_is_32 (j_prefer_32, vdim) ; // OK + (*i_is_32) = GB_determine_i_is_32 (i_prefer_32, vlen) ; // OK + } +} + +#endif + diff --git a/GraphBLAS/Source/positional/GB_positional.h b/GraphBLAS/Source/positional/GB_positional.h index fb250bd478..f72bd534ad 100644 --- a/GraphBLAS/Source/positional/GB_positional.h +++ b/GraphBLAS/Source/positional/GB_positional.h @@ -2,7 +2,7 @@ // GB_positional.h: positional functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ GrB_IndexUnaryOp GB_positional_idxunop_ijflip // return flipped operator int64_t GB_positional_offset // return the positional thunk ( GB_Opcode opcode, // opcode of positional operator - GrB_Scalar Thunk, // thunk for idxunops, or NULL + GrB_Scalar scalar, // scalar for idxunops, or NULL bool *depends_on_j // if true, the op depends on j ) ; diff --git a/GraphBLAS/Source/positional/GB_positional_binop_ijflip.c b/GraphBLAS/Source/positional/GB_positional_binop_ijflip.c index 1ceefa2c99..c056146445 100644 --- a/GraphBLAS/Source/positional/GB_positional_binop_ijflip.c +++ b/GraphBLAS/Source/positional/GB_positional_binop_ijflip.c @@ -2,7 +2,7 @@ // GB_positional_binop_ijflip: swap i and j in a binary positional op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/positional/GB_positional_idxunop_ijflip.c b/GraphBLAS/Source/positional/GB_positional_idxunop_ijflip.c index 696a53b700..abd709c167 100644 --- a/GraphBLAS/Source/positional/GB_positional_idxunop_ijflip.c +++ b/GraphBLAS/Source/positional/GB_positional_idxunop_ijflip.c @@ -2,7 +2,7 @@ // GB_positional_idxunop_ijflip: swap i and j in an index unary positional op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/positional/GB_positional_offset.c b/GraphBLAS/Source/positional/GB_positional_offset.c index ad4314b2d0..0b54facad4 100644 --- a/GraphBLAS/Source/positional/GB_positional_offset.c +++ b/GraphBLAS/Source/positional/GB_positional_offset.c @@ -2,27 +2,27 @@ // GB_positional_offset: return the offset of a positional operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB.h" -int64_t GB_positional_offset // return the positional thunk +int64_t GB_positional_offset // return the positional scalar is int64_t ( GB_Opcode opcode, // opcode of positional operator - GrB_Scalar Thunk, // thunk for idxunops, or NULL + GrB_Scalar scalar, // scalar for idxunops, or NULL bool *depends_on_j // if true, the op depends on j ) { - int64_t ithunk = 0 ; - if (Thunk != NULL) + int64_t iscalar = 0 ; + if (scalar != NULL) { - // get the value of the thunk, for positional idxunops - GB_cast_scalar (&ithunk, GB_INT64_code, Thunk->x, Thunk->type->code, - Thunk->type->size) ; + // get the value of the scalar, for positional idxunops + GB_cast_scalar (&iscalar, GB_INT64_code, scalar->x, scalar->type->code, + scalar->type->size) ; } bool j_dep = false ; @@ -35,7 +35,7 @@ int64_t GB_positional_offset // return the positional thunk case GB_FIRSTI_binop_code : // z = first_i(A(i,j),y) == i case GB_SECONDI_binop_code : // z = second_i(x,A(i,j)) == i j_dep = false ; - ithunk = 0 ; + iscalar = 0 ; break ; // offset 1, does not depend on j @@ -43,7 +43,7 @@ int64_t GB_positional_offset // return the positional thunk case GB_FIRSTI1_binop_code : // z = first_i1(A(i,j),y) == i+1 case GB_SECONDI1_binop_code : // z = second_i1(x,A(i,j)) == i+1 j_dep = false ; - ithunk = 1 ; + iscalar = 1 ; break ; // offset 0, depends on j @@ -51,7 +51,7 @@ int64_t GB_positional_offset // return the positional thunk case GB_FIRSTJ_binop_code : // z = first_j(A(i,j),y) == j case GB_SECONDJ_binop_code : // z = second_j(x,A(i,j)) == j j_dep = true ; - ithunk = 0 ; + iscalar = 0 ; break ; // offset 1, depends on j @@ -59,26 +59,26 @@ int64_t GB_positional_offset // return the positional thunk case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,j),y) == j+1 case GB_SECONDJ1_binop_code : // z = second_j1(x,A(i,j)) == j+1 j_dep = true ; - ithunk = 1 ; + iscalar = 1 ; break ; // idxunops that do not depend on j - case GB_ROWINDEX_idxunop_code : // (i+thunk): row index - thunk - case GB_ROWLE_idxunop_code : // (i <= thunk): A (0:thunk,:) - case GB_ROWGT_idxunop_code : // (i > thunk): A (thunk+1:nrows-1,:) + case GB_ROWINDEX_idxunop_code : // (i+y): row index - y + case GB_ROWLE_idxunop_code : // (i <= y): A (0:y,:) + case GB_ROWGT_idxunop_code : // (i > y): A (y+1:nrows-1,:) j_dep = false ; break ; // idxunops that depend on j - case GB_COLINDEX_idxunop_code : // (j+thunk): col index - thunk - case GB_DIAGINDEX_idxunop_code : // (j-(i+thunk)): diag index + thunk - case GB_FLIPDIAGINDEX_idxunop_code : // (i-(j+thunk)), internal use - case GB_TRIL_idxunop_code : // (j <= (i+thunk)): tril (A,thunk) - case GB_TRIU_idxunop_code : // (j >= (i+thunk)): triu (A,thunk) - case GB_DIAG_idxunop_code : // (j == (i+thunk)): diag(A,thunk) - case GB_OFFDIAG_idxunop_code : // (j != (i+thunk)): offdiag(A,thunk) - case GB_COLLE_idxunop_code : // (j <= thunk): A (:,0:thunk) - case GB_COLGT_idxunop_code : // (j > thunk): A (:,thunk+1:ncols-1) + case GB_COLINDEX_idxunop_code : // (j+y): col index - y + case GB_DIAGINDEX_idxunop_code : // (j-(i+y)): diag index + y + case GB_FLIPDIAGINDEX_idxunop_code :// (i-(j+y)), internal use + case GB_TRIL_idxunop_code : // (j <= (i+y)): tril (A,y) + case GB_TRIU_idxunop_code : // (j >= (i+y)): triu (A,y) + case GB_DIAG_idxunop_code : // (j == (i+y)): diag(A,y) + case GB_OFFDIAG_idxunop_code : // (j != (i+y)): offdiag(A,y) + case GB_COLLE_idxunop_code : // (j <= y): A (:,0:y) + case GB_COLGT_idxunop_code : // (j > y): A (:,y+1:ncols-1) j_dep = true ; break ; @@ -91,6 +91,6 @@ int64_t GB_positional_offset // return the positional thunk (*depends_on_j) = j_dep ; } - return (ithunk) ; + return (iscalar) ; } diff --git a/GraphBLAS/Source/positional/GB_positional_unop_ijflip.c b/GraphBLAS/Source/positional/GB_positional_unop_ijflip.c index c3338bb2cf..8bfb771709 100644 --- a/GraphBLAS/Source/positional/GB_positional_unop_ijflip.c +++ b/GraphBLAS/Source/positional/GB_positional_unop_ijflip.c @@ -2,7 +2,7 @@ // GB_positional_unop_ijflip: swap i and j in a unary positional op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_BinaryOp_check.c b/GraphBLAS/Source/print/GB_BinaryOp_check.c index 47b780a34c..bf0e704485 100644 --- a/GraphBLAS/Source/print/GB_BinaryOp_check.c +++ b/GraphBLAS/Source/print/GB_BinaryOp_check.c @@ -2,7 +2,7 @@ // GB_BinaryOp_check: check and print a binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,6 +23,7 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator // check inputs //-------------------------------------------------------------------------- + GB_CHECK_INIT ; GBPR0 ("\n GraphBLAS BinaryOp: %s ", ((name != NULL) ? name : "")) ; if (op == NULL) @@ -73,19 +74,25 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator GBPR0 ("(user-defined): z=%s(x,y)\n", op_name) ; } else if (opcode == GB_USER_idxbinop_code) - { + { GBPR0 ("(user-defined index):\n z=%s(x,ix,iy,y,iy,yj,theta)\n", op_name) ; } - else if (opcode == GB_FIRST_binop_code && op->ztype->code == GB_UDT_code) + else if (op_is_first && op->ztype->code == GB_UDT_code) { // FIRST_UDT binary operator created by GB_reduce_to_vector - GBPR0 ("(generated): z=%s(x,y)\n", op_name) ; + GBPR0 ("(generated 1st): z=%s(x,y)\n", op_name) ; + } + else if (op_is_second && op->ztype->code == GB_UDT_code) + { + // SECOND_UDT binary operator created by GB_wait or GB_builder + GBPR0 ("(generated 2nd): z=%s(x,y)\n", op_name) ; } else if (op_is_from_idxbinop) { // built-in index binary operator - GBPR0 ("(built-in index):\n z=%s(x,ix,iy,y,iy,yj,theta)\n", op_name) ; + GBPR0 ("(built-in index):\n z=%s(x,ix,iy,y,iy,yj,theta)\n", + op_name) ; } else { diff --git a/GraphBLAS/Source/print/GB_Context_check.c b/GraphBLAS/Source/print/GB_Context_check.c index 8afcb3d70d..b026b5bf77 100644 --- a/GraphBLAS/Source/print/GB_Context_check.c +++ b/GraphBLAS/Source/print/GB_Context_check.c @@ -2,7 +2,7 @@ // GB_Context_check: check and print a Context //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,6 +22,7 @@ GrB_Info GB_Context_check // check a GraphBLAS Context // check inputs //-------------------------------------------------------------------------- + GB_CHECK_INIT ; GBPR0 ("\n GraphBLAS Context: %s ", ((name != NULL) ? name : "")) ; if (Context == NULL) diff --git a/GraphBLAS/Source/print/GB_Descriptor_check.c b/GraphBLAS/Source/print/GB_Descriptor_check.c index 61c9f4063e..c02814ba27 100644 --- a/GraphBLAS/Source/print/GB_Descriptor_check.c +++ b/GraphBLAS/Source/print/GB_Descriptor_check.c @@ -2,7 +2,7 @@ // GB_Descriptor_check: check and print a Descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,11 +16,11 @@ static GrB_Info GB_dc ( - int kind, // 0, 1, or 2 + int kind, // 0, 1, or 2 const char *field, - const GrB_Desc_Value v, - const GrB_Desc_Value nondefault, // for kind == 0 - int pr, // print level + const int v, + const int nondefault, // for kind == 0 + int pr, // print level FILE *f ) { diff --git a/GraphBLAS/Source/print/GB_IndexBinaryOp_check.c b/GraphBLAS/Source/print/GB_IndexBinaryOp_check.c index 3d4616a407..8a0ffbf8f5 100644 --- a/GraphBLAS/Source/print/GB_IndexBinaryOp_check.c +++ b/GraphBLAS/Source/print/GB_IndexBinaryOp_check.c @@ -2,7 +2,7 @@ // GB_IndexBinaryOp_check: check and print a index_binary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_IndexUnaryOp_check.c b/GraphBLAS/Source/print/GB_IndexUnaryOp_check.c index cc06b3d092..15276f4840 100644 --- a/GraphBLAS/Source/print/GB_IndexUnaryOp_check.c +++ b/GraphBLAS/Source/print/GB_IndexUnaryOp_check.c @@ -2,7 +2,7 @@ // GB_IndexUnaryOp_check: check and print a index_unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Matrix_check.c b/GraphBLAS/Source/print/GB_Matrix_check.c index 280772fe4d..cf5d099c84 100644 --- a/GraphBLAS/Source/print/GB_Matrix_check.c +++ b/GraphBLAS/Source/print/GB_Matrix_check.c @@ -2,7 +2,7 @@ // GB_Matrix_check: print a GraphBLAS matrix and check if it is valid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Monoid_check.c b/GraphBLAS/Source/print/GB_Monoid_check.c index 2adea3490b..3bf6fd6647 100644 --- a/GraphBLAS/Source/print/GB_Monoid_check.c +++ b/GraphBLAS/Source/print/GB_Monoid_check.c @@ -2,7 +2,7 @@ // GB_Monoid_check: check and print a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Operator_check.c b/GraphBLAS/Source/print/GB_Operator_check.c index c3890882ff..d3119f0316 100644 --- a/GraphBLAS/Source/print/GB_Operator_check.c +++ b/GraphBLAS/Source/print/GB_Operator_check.c @@ -2,7 +2,7 @@ // GB_Operator_check: check and print any operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Scalar_check.c b/GraphBLAS/Source/print/GB_Scalar_check.c index ea292995d9..caacd28bd2 100644 --- a/GraphBLAS/Source/print/GB_Scalar_check.c +++ b/GraphBLAS/Source/print/GB_Scalar_check.c @@ -2,7 +2,7 @@ // GB_Scalar_check: print a GraphBLAS GrB_Scalar and check if it is valid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_SelectOp_check.c b/GraphBLAS/Source/print/GB_SelectOp_check.c index 6dd6ceff47..580dfe07e8 100644 --- a/GraphBLAS/Source/print/GB_SelectOp_check.c +++ b/GraphBLAS/Source/print/GB_SelectOp_check.c @@ -2,7 +2,7 @@ // GB_SelectOp_check: check and print a select operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Semiring_check.c b/GraphBLAS/Source/print/GB_Semiring_check.c index b41343e1cf..9eae124b29 100644 --- a/GraphBLAS/Source/print/GB_Semiring_check.c +++ b/GraphBLAS/Source/print/GB_Semiring_check.c @@ -2,7 +2,7 @@ // GB_Semiring_check: check and print a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Type_check.c b/GraphBLAS/Source/print/GB_Type_check.c index 3b588c21eb..fbc0345bec 100644 --- a/GraphBLAS/Source/print/GB_Type_check.c +++ b/GraphBLAS/Source/print/GB_Type_check.c @@ -2,7 +2,7 @@ // GB_Type_check: check and print a built-in or user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_UnaryOp_check.c b/GraphBLAS/Source/print/GB_UnaryOp_check.c index bcba3274b6..512aba0919 100644 --- a/GraphBLAS/Source/print/GB_UnaryOp_check.c +++ b/GraphBLAS/Source/print/GB_UnaryOp_check.c @@ -2,7 +2,7 @@ // GB_UnaryOp_check: check and print a unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_Vector_check.c b/GraphBLAS/Source/print/GB_Vector_check.c index 7466c082ba..614050ad32 100644 --- a/GraphBLAS/Source/print/GB_Vector_check.c +++ b/GraphBLAS/Source/print/GB_Vector_check.c @@ -2,7 +2,7 @@ // GB_Vector_check: print a GraphBLAS GrB_Vector and check if it is valid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_check.h b/GraphBLAS/Source/print/GB_check.h index d17139dc1a..8fdf315c9c 100644 --- a/GraphBLAS/Source/print/GB_check.h +++ b/GraphBLAS/Source/print/GB_check.h @@ -2,7 +2,7 @@ // GB_check.h: check and optionally print an object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,6 +18,14 @@ #define GB4 GxB_SHORT_VERBOSE #define GB5 GxB_COMPLETE_VERBOSE +// as above, but do not check zombie counts +#define GB0_Z 6 +#define GB1_Z 7 +#define GB2_Z 8 +#define GB3_Z 9 +#define GB4_Z 10 +#define GB5_Z 11 + GrB_Info GB_entry_check // print a single value ( const GrB_Type type, // type of value to print @@ -129,8 +137,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector ( const GrB_Matrix A, // GraphBLAS matrix to print and check const char *name, // name of the matrix, optional - int pr, // print level; if negative, ignore nzombie - // conditions and use GB_ZOMBIE(pr) for diagnostics + int pr, // print level FILE *f, // file for output const char *kind // "matrix" or "vector" ) ; diff --git a/GraphBLAS/Source/print/GB_code_check.c b/GraphBLAS/Source/print/GB_code_check.c index fb3084a435..4c668cc9a4 100644 --- a/GraphBLAS/Source/print/GB_code_check.c +++ b/GraphBLAS/Source/print/GB_code_check.c @@ -2,7 +2,7 @@ // GB_code_check: print an entry using a type code //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_entry_check.c b/GraphBLAS/Source/print/GB_entry_check.c index 532de19440..9f377760b8 100644 --- a/GraphBLAS/Source/print/GB_entry_check.c +++ b/GraphBLAS/Source/print/GB_entry_check.c @@ -2,7 +2,7 @@ // GB_entry_check: print a single entry for a built-in type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/print/GB_matvec_check.c b/GraphBLAS/Source/print/GB_matvec_check.c index 3800758b52..57e6b18fd7 100644 --- a/GraphBLAS/Source/print/GB_matvec_check.c +++ b/GraphBLAS/Source/print/GB_matvec_check.c @@ -2,30 +2,27 @@ // GB_matvec_check: print a GraphBLAS matrix and check if it is valid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// for code development only: -#ifdef GRAPHBLAS_HAS_CUDA -// when CUDA kernels enabled: -#define GB_DEVELOPER 0 -#else // in production: turn off developer flag #define GB_DEVELOPER 0 -#endif -#include "pending/GB_Pending.h" +// For development only: +// #undef GB_DEVELOPER +// #define GB_DEVELOPER 1 + #include "GB.h" +#include "pending/GB_Pending.h" #include "get_set/GB_get_set.h" GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector ( const GrB_Matrix A, // GraphBLAS matrix to print and check const char *name, // name of the matrix, optional - int pr, // print level; if negative, ignore nzombie - // conditions and use GB_ZOMBIE(pr) for diagnostics + int pr, // print level (see GB_check.h) FILE *f, // file for output (or stdout if f is NULL) const char *kind // "matrix" or "vector" (only for printing diag.) ) @@ -42,9 +39,9 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector bool is_sparse = GB_IS_SPARSE (A) ; bool ignore_zombies = false ; - if (pr < 0) - { - pr = GB_DEZOMBIE (pr) ; + if (pr > 5) + { + pr = pr - 6 ; ignore_zombies = true ; } pr = GB_IMIN (pr, GxB_COMPLETE_VERBOSE) ; @@ -60,7 +57,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector bool pr_complete = (pr == GxB_COMPLETE || pr == GxB_COMPLETE_VERBOSE) ; bool pr_short = (pr == GxB_SHORT || pr == GxB_SHORT_VERBOSE ) ; bool one_based = GB_Global_print_one_based_get ( ) ; - bool pr_mem_shallow = GB_Global_print_mem_shallow_get ( ) ; + bool pr_mem_shallow = GB_Global_stats_mem_shallow_get ( ) ; int64_t offset = (one_based) ? 1 : 0 ; #if GB_DEVELOPER int pr_developer = pr ; @@ -113,6 +110,15 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GB_CHECK_MAGIC (A) ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + GB_AYp_DECLARE (A_Yp, const) ; GB_AYp_PTR (A_Yp, A) ; + GB_AYi_DECLARE (A_Yi, const) ; GB_AYi_PTR (A_Yi, A) ; + GB_AYx_DECLARE (A_Yx, const) ; GB_AYx_PTR (A_Yx, A) ; + + const int8_t *restrict Ab = A->b ; + //-------------------------------------------------------------------------- // print the header //-------------------------------------------------------------------------- @@ -147,18 +153,30 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector { GBPR0 (" (jumbled)") ; } - GBPR0 (" %s\n", A->is_csc ? "by col" : "by row") ; + GBPR0 (" %s", A->is_csc ? "by col" : "by row") ; + if (is_sparse || is_hyper || GB_DEVELOPER) + { + GBPR0 (", ints: %s/%s/%s", + A->p_is_32 ? "32" : "64", + A->j_is_32 ? "32" : "64", + A->i_is_32 ? "32" : "64") ; + } + GBPR0 ("\n") ; + + int64_t nvec_nonempty = GB_nvec_nonempty_get (A) ; + int64_t actual_nvec_nonempty = GB_nvec_nonempty (A) ; #if GB_DEVELOPER GBPR0 (" max # entries: " GBd "\n", GB_nnz_max (A)) ; GBPR0 (" vlen: " GBd , A->vlen) ; - if (A->nvec_nonempty != -1) + GBPR0 (" vdim: " GBd "\n", A->vlen) ; + if (nvec_nonempty != -1) { - GBPR0 (" nvec_nonempty: " GBd , A->nvec_nonempty) ; + GBPR0 (" nvec_nonempty: " GBd , nvec_nonempty) ; } - GBPR0 (" nvec: " GBd " plen: " GBd " vdim: " GBd "\n hyper_switch %g " + GBPR0 (" nvec: " GBd " plen: " GBd "\n hyper_switch %g " "bitmap_switch %g\n", - A->nvec, A->plen, A->vdim, A->hyper_switch, A->bitmap_switch) ; + A->nvec, A->plen, A->hyper_switch, A->bitmap_switch) ; #endif switch (A->sparsity_control) @@ -258,6 +276,24 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector return (GrB_INVALID_OBJECT) ; } + //-------------------------------------------------------------------------- + // check the 32/64 bit sizes + //-------------------------------------------------------------------------- + + if (is_hyper || is_sparse) + { + #if GB_DEVELOPER + GBPR0 (" p_control: %d, j_control: %d, i_control: %d\n", + A->p_control, A->j_control, A->i_control) ; + #endif + if (!GB_valid_pji_is_32 (A->p_is_32, A->j_is_32, A->i_is_32, + A->nvals, A->vlen, A->vdim)) + { + GBPR0 (" matrix is too large for 32-bit integers\n") ; + return (GrB_INVALID_OBJECT) ; + } + } + //-------------------------------------------------------------------------- // check vector structure //-------------------------------------------------------------------------- @@ -312,13 +348,13 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector #if GB_DEVELOPER if (pr_short || pr_complete) { - if (A->static_header) + if (A->header_size == 0) { GBPR (" static header,") ; } else { - GBPR (" header %p", A) ; + GBPR (" header %p", (void *) A) ; } GBPR (" number of memory blocks: " GBd "\n", nallocs) ; GBPR (" deep: " GBu " shallow: " GBu " total: " GBu "\n", @@ -356,17 +392,21 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GBPR (" ->x: %p shallow: %d size: " GBu "\n", A->x, A->x_shallow, (uint64_t) A->x_size) ; GBPR (" ->Y: %p shallow: %d no_hyper_hash: %d\n", - A->Y, A->Y_shallow, A->no_hyper_hash) ; + (void *) (A->Y), A->Y_shallow, A->no_hyper_hash) ; } #endif - if (A->p != NULL && (A->p_size < (A->plen + 1) * sizeof (int64_t))) + int64_t psize = A->p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + int64_t jsize = A->j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + int64_t isize = A->i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + if (A->p != NULL && (A->p_size < (A->plen + 1) * psize)) { GBPR0 (" A->p is too small!\n") ; return (GrB_INVALID_OBJECT) ; } - if (A->h != NULL && (A->h_size < (A->plen) * sizeof (int64_t))) + if (A->h != NULL && (A->h_size < (A->plen) * jsize)) { GBPR0 (" A->h is too small!\n") ; return (GrB_INVALID_OBJECT) ; @@ -383,17 +423,20 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GBPR0 (" ->p is NULL, invalid %s\n", kind) ; return (GrB_INVALID_OBJECT) ; } - if (A->p [0] != 0) + int64_t p = GBp (Ap, 0, 0) ; + if (p != 0) { - GBPR0 (" ->p [0] = " GBd " invalid\n", A->p [0]) ; + GBPR0 (" ->p [0] = " GBd " invalid\n", p) ; return (GrB_INVALID_OBJECT) ; } - int64_t nzmax = A->i_size / sizeof (int64_t) ; + int64_t nzmax = A->i_size / isize ; for (int64_t j = 0 ; j < A->nvec ; j++) { - if (A->p [j+1] < A->p [j] || A->p [j+1] > nzmax) + int64_t p = GBp (Ap, j, 0) ; + int64_t pend = GBp (Ap, j+1, 0) ; + if (pend < p || pend > nzmax) { - GBPR0 (" ->p [" GBd "] = " GBd " invalid\n", j+1, A->p [j+1]) ; + GBPR0 (" ->p [" GBd "] = " GBd " invalid\n", j+1, pend) ; return (GrB_INVALID_OBJECT) ; } } @@ -413,7 +456,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector int64_t jlast = -1 ; for (int64_t k = 0 ; k < A->nvec ; k++) { - int64_t j = A->h [k] ; + int64_t j = GBh (Ah, k) ; if (jlast >= j || j < 0 || j >= A->vdim) { GBPR0 (" ->h [" GBd "] = " GBd " invalid\n", k, j) ; @@ -486,6 +529,10 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector { if (A->x == NULL || A->x_size < A->type->size) { + #if GB_DEVELOPER + GBPR0 ("A->x %p size %d typesize %d\n", A->x, (int) A->x_size, + (int) A->type->size) ; + #endif GBPR0 (" invalid iso matrix\n") ; return (GrB_INVALID_OBJECT) ; } @@ -555,6 +602,12 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector return (GrB_INVALID_OBJECT) ; } + if (A->jumbled && GB_is_shallow (A)) + { + GBPR0 (" jumbled %s cannot contain readonly components\n", kind) ; + return (GrB_INVALID_OBJECT) ; + } + //-------------------------------------------------------------------------- // check and print the row indices and numerical values //-------------------------------------------------------------------------- @@ -573,9 +626,9 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector for (int64_t k = 0 ; k < A->nvec ; k++) { int64_t ilast = -1 ; - int64_t j = GBH (A->h, k) ; - int64_t p = GBP (A->p, k, A->vlen) ; - int64_t pend = GBP (A->p, k+1, A->vlen) ; + int64_t j = GBh (Ah, k) ; + int64_t p = GBp (Ap, k, A->vlen) ; + int64_t pend = GBp (Ap, k+1, A->vlen) ; // count the entries in A(:,j) int64_t ajnz = pend - p ; @@ -584,7 +637,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector ajnz = 0 ; for (int64_t p2 = p ; p2 < pend ; p2++) { - int8_t ab = A->b [p2] ; + int8_t ab = Ab [p2] ; if (ab < 0 || ab > 1) { // bitmap with value other than 0, 1 @@ -609,11 +662,11 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector // for each entry in A(:,j), the kth vector of A for ( ; p < pend ; p++) { - if (!GBB (A->b, p)) continue ; + if (!GBb (Ab, p)) continue ; anz_actual++ ; icount++ ; - int64_t i = GBI (A->i, p, A->vlen) ; + int64_t i = GBi (Ai, p, A->vlen) ; bool is_zombie = GB_IS_ZOMBIE (i) ; i = GB_UNZOMBIE (i) ; if (is_zombie) nzombies++ ; @@ -736,7 +789,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector #if GB_DEVELOPER if ((pr_short || pr_complete) && (is_sparse || is_hyper)) { - GBPR (" Pending %p\n", Pending) ; + GBPR (" Pending %p\n", (void *) Pending) ; } #endif @@ -747,12 +800,16 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector // A has pending tuples //--------------------------------------------------------------------- + GB_MDECL (Pending_i, , u) ; GB_GET_PENDINGi_PTR (Pending_i, A) ; + GB_MDECL (Pending_j, , u) ; GB_GET_PENDINGj_PTR (Pending_j, A) ; + GB_void *Pending_x = Pending->x ; + #if GB_DEVELOPER if (pr_short || pr_complete) { - GBPR (" Pending->i %p\n", Pending->i) ; - GBPR (" Pending->j %p\n", Pending->j) ; - GBPR (" Pending->x %p\n", Pending->x) ; + GBPR (" Pending_i %p\n", Pending_i) ; + GBPR (" Pending_j %p\n", Pending_j) ; + GBPR (" Pending_x %p\n", Pending_x) ; } #endif @@ -764,10 +821,10 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector } // matrix has tuples, arrays and type must not be NULL - // Pending->x must be NULL if and only if A is iso - // Pending->x must be non-NULL if and only if A is non-iso - if (Pending->i == NULL || ((Pending->x == NULL) != (A->iso)) || - (A->vdim > 1 && Pending->j == NULL)) + // Pending_x must be NULL if and only if A is iso + // Pending_x must be non-NULL if and only if A is non-iso + if (Pending_i == NULL || ((Pending_x == NULL) != (A->iso)) || + (A->vdim > 1 && Pending_j == NULL)) { GBPR0 (" invalid pending tuples\n") ; return (GrB_INVALID_OBJECT) ; @@ -789,8 +846,8 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector for (int64_t k = 0 ; k < Pending->n ; k++) { - int64_t i = Pending->i [k] ; - int64_t j = (A->vdim <= 1) ? 0 : (Pending->j [k]) ; + int64_t i = GB_IGET (Pending_i, k) ; + int64_t j = (A->vdim <= 1) ? 0 : GB_IGET (Pending_j, k) ; int64_t row = (A->is_csc ? i : j) + offset ; int64_t col = (A->is_csc ? j : i) + offset ; @@ -801,7 +858,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector if (!A->iso) { info = GB_entry_check (Pending->type, - Pending->x +(k * Pending->type->size), pr, f) ; + Pending_x +(k * Pending->type->size), pr, f) ; if (info != GrB_SUCCESS) return (info) ; } GBPR ("\n") ; @@ -853,10 +910,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector // when its computation is postponed or not needed. If not -1, however, // the value must be correct. - int64_t actual_nvec_nonempty = GB_nvec_nonempty (A) ; - - if (! ((A->nvec_nonempty == actual_nvec_nonempty) || - (A->nvec_nonempty == -1))) + if (! ((nvec_nonempty == actual_nvec_nonempty) || (nvec_nonempty == -1))) { // invalid nvec_nonempty GBPR0 (" invalid count of non-empty vectors\n") ; @@ -870,7 +924,6 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GrB_Matrix Y = A->Y ; if (Y != NULL) { - if (!is_hyper) { // A->Y is optional, but A must be hypersparse for A->Y to exist @@ -884,30 +937,34 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GBPR0 (" hyper_hash invalid") ; return (info) ; } + GrB_Type ytype = (A->j_is_32) ? GrB_UINT32 : GrB_UINT64 ; if (Y->vlen != A->vdim || !GB_IS_POWER_OF_TWO (Y->vdim) || - Y->nvals != A->nvec || !GB_IS_SPARSE (Y) || Y->type != GrB_UINT64 || - !Y->is_csc || GB_ANY_PENDING_WORK (Y)) + Y->nvals != A->nvec || !GB_IS_SPARSE (Y) || Y->type != ytype || + !Y->is_csc || GB_ANY_PENDING_WORK (Y) || + Y->p_is_32 != A->j_is_32 || Y->i_is_32 != A->j_is_32) { - // Y must be sparse, uint64, held by column, with A->nvec values, - // vector length the same as A->vdim, and with a Y->vdim that is a - // power of 2. It cannot have any pending work. + // Y must be sparse, uint32/uint64 (depending on A->j_is_32), held + // by column, with A->nvec values, vector length the same as + // A->vdim, and with a Y->vdim that is a power of 2. It cannot have + // any pending work. GBPR0 (" hyper_hash invalid") ; return (GrB_INVALID_OBJECT) ; } // ensure that Y is the inverse of A->h int64_t hash_bits = Y->vdim - 1 ; - const int64_t *restrict Yx = (int64_t *) Y->x ; for (int64_t k = 0 ; k < A->nvec ; k++) { // look for j in the hyper_hash; it must be at position k - int64_t j = A->h [k] ; + int64_t j = GBh (Ah, k) ; int64_t jhash = GB_HASHF2 (j, hash_bits) ; bool found = false ; - for (int64_t p = Y->p [jhash] ; p < Y->p [jhash+1] ; p++) + int64_t p = GBp (A_Yp, jhash, 0) ; + int64_t pend = GBp (A_Yp, jhash+1, 0) ; + for ( ; p < pend ; p++) { - if (j == Y->i [p]) + if (j == GBi (A_Yi, p, Y->vlen)) { - if (k != Yx [p]) + if (k != GB_IGET (A_Yx, p)) { // j is found but not with the right value of k GBPR0 (" hyper_hash invalid\n") ; diff --git a/GraphBLAS/Source/print/GB_printf.h b/GraphBLAS/Source/print/GB_printf.h index 1a7a674be0..f147b9d77b 100644 --- a/GraphBLAS/Source/print/GB_printf.h +++ b/GraphBLAS/Source/print/GB_printf.h @@ -2,7 +2,7 @@ // GB_printf.h: definitions for printing from GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,26 +19,26 @@ // all other cases use GB_Global_* #undef GBDUMP -#define GBDUMP(...) \ -{ \ - GB_printf_function_t printf_func = GB_Global_printf_get ( ) ; \ - if (printf_func != NULL) \ - { \ - printf_func (__VA_ARGS__) ; \ - } \ - else \ - { \ - printf (__VA_ARGS__) ; \ - } \ - GB_flush_function_t flush_func = GB_Global_flush_get ( ) ; \ - if (flush_func != NULL) \ - { \ - flush_func ( ) ; \ - } \ - else \ - { \ - fflush (stdout) ; \ - } \ +#define GBDUMP(...) \ +{ \ + GB_printf_function_t printf_func = GB_Global_printf_get ( ) ; \ + if (printf_func != NULL) \ + { \ + printf_func (__VA_ARGS__) ; \ + } \ + else \ + { \ + printf (__VA_ARGS__) ; /* printf_func is NULL; use libc */ \ + } \ + GB_flush_function_t flush_func = GB_Global_flush_get ( ) ; \ + if (flush_func != NULL) \ + { \ + flush_func ( ) ; \ + } \ + else \ + { \ + fflush (stdout) ; /* flush_func is NULL; use libc */ \ + } \ } //------------------------------------------------------------------------------ @@ -62,7 +62,8 @@ } \ else \ { \ - printf_result = printf (__VA_ARGS__) ; \ + printf_result = \ + printf (__VA_ARGS__) ; /* printf_func NULL; use libc */ \ } \ GB_flush_function_t flush_func = GB_Global_flush_get ( ) ; \ if (flush_func != NULL) \ @@ -71,13 +72,13 @@ } \ else \ { \ - fflush (stdout) ; \ + fflush (stdout) ; /* flush_func is NULL; use libc */ \ } \ } \ else \ { \ printf_result = fprintf (f, __VA_ARGS__) ; \ - fflush (f) ; \ + fflush (f) ; /* flush_func is NULL; use libc */ \ } \ if (printf_result < 0) \ { \ @@ -153,13 +154,11 @@ void GB_assign_describe const bool C_replace, // descriptor for C const int Ikind, const int Jkind, -// const GrB_Matrix M, const bool M_is_null, const int M_sparsity, const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here -// const GrB_Matrix A, // input matrix, not transposed const bool A_is_null, const int assign_kind // row assign, col assign, assign, or subassign ) ; @@ -208,36 +207,32 @@ void GB_assign_describe #if defined ( _OPENMP ) // burble with timing - #define GB_BURBLE_START(func) \ - double t_burble = 0 ; \ - { \ - GB_NVTX \ - if (GB_Global_burble_get ( )) \ - { \ - GBURBLE (" [ " func " ") ; \ - t_burble = GB_OPENMP_GET_WTIME ; \ - } \ + #define GB_BURBLE_START(func) \ + double t_burble = 0 ; \ + { \ + GB_NVTX \ + if (GB_Global_burble_get ( )) \ + { \ + GBURBLE (" [ " func " ") ; \ + t_burble = GB_omp_get_wtime ( ) ; \ + } \ } - #define GB_BURBLE_END \ - { \ - GB_NVTX \ - if (GB_Global_burble_get ( )) \ - { \ - t_burble = GB_OPENMP_GET_WTIME - t_burble ; \ - GBURBLE ("\n %.3g sec ]\n", t_burble) ; \ - } \ + #define GB_BURBLE_END \ + { \ + GB_NVTX \ + if (GB_Global_burble_get ( )) \ + { \ + t_burble = GB_omp_get_wtime ( ) - t_burble ; \ + GBURBLE ("\n %.3g sec ]\n", t_burble) ; \ + } \ } #else // burble with no timing - - #define GB_BURBLE_START(func) \ - GBURBLE (" [ " func " ") - - #define GB_BURBLE_END \ - GBURBLE ("]\n") + #define GB_BURBLE_START(func) GBURBLE (" [ " func " ") + #define GB_BURBLE_END GBURBLE ("]\n") #endif diff --git a/GraphBLAS/Source/print/GxB_BinaryOp_fprint.c b/GraphBLAS/Source/print/GxB_BinaryOp_fprint.c index 4d77ee05e3..d1402bf92c 100644 --- a/GraphBLAS/Source/print/GxB_BinaryOp_fprint.c +++ b/GraphBLAS/Source/print/GxB_BinaryOp_fprint.c @@ -2,7 +2,7 @@ // GxB_BinaryOp_fprint: print and check a GrB_BinaryOp object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_BinaryOp_fprint // print and check a GrB_BinaryOp ( GrB_BinaryOp binaryop, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_BinaryOp_fprint (binaryop, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_BinaryOp_check (binaryop, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Context_fprint.c b/GraphBLAS/Source/print/GxB_Context_fprint.c index 41b22e6f37..af3128533d 100644 --- a/GraphBLAS/Source/print/GxB_Context_fprint.c +++ b/GraphBLAS/Source/print/GxB_Context_fprint.c @@ -2,7 +2,7 @@ // GxB_Context_fprint: print and check a GxB_Context object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context ( GxB_Context Context, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Context_fprint (Context, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Context_check (Context, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Descriptor_fprint.c b/GraphBLAS/Source/print/GxB_Descriptor_fprint.c index 50a95cfca8..b27bb26469 100644 --- a/GraphBLAS/Source/print/GxB_Descriptor_fprint.c +++ b/GraphBLAS/Source/print/GxB_Descriptor_fprint.c @@ -2,7 +2,7 @@ // GxB_Descriptor_fprint: print and check a GrB_Descriptor object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Descriptor_fprint // print and check a GrB_Descriptor ( GrB_Descriptor descriptor, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Descriptor_fprint (descriptor, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Descriptor_check (descriptor, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_IndexBinaryOp_fprint.c b/GraphBLAS/Source/print/GxB_IndexBinaryOp_fprint.c index 41c3aad1f1..8027dcb243 100644 --- a/GraphBLAS/Source/print/GxB_IndexBinaryOp_fprint.c +++ b/GraphBLAS/Source/print/GxB_IndexBinaryOp_fprint.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_fprint: print and check a GxB_IndexBinaryOp object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp ( GxB_IndexBinaryOp op, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_IndexBinaryOp_fprint (op, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_IndexBinaryOp_check (op, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_IndexUnaryOp_fprint.c b/GraphBLAS/Source/print/GxB_IndexUnaryOp_fprint.c index 8b5fd42424..c24fe601f2 100644 --- a/GraphBLAS/Source/print/GxB_IndexUnaryOp_fprint.c +++ b/GraphBLAS/Source/print/GxB_IndexUnaryOp_fprint.c @@ -2,7 +2,7 @@ // GxB_IndexUnaryOp_fprint: print and check a GrB_IndexUnaryOp object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp ( GrB_IndexUnaryOp op, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_IndexUnaryOp_fprint (op, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_IndexUnaryOp_check (op, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Matrix_fprint.c b/GraphBLAS/Source/print/GxB_Matrix_fprint.c index 860947ceb3..d3a994e86d 100644 --- a/GraphBLAS/Source/print/GxB_Matrix_fprint.c +++ b/GraphBLAS/Source/print/GxB_Matrix_fprint.c @@ -2,7 +2,7 @@ // GxB_Matrix_fprint: print and check a GrB_Matrix object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,27 +13,12 @@ GrB_Info GxB_Matrix_fprint // print and check a GrB_Matrix ( GrB_Matrix A, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Matrix_fprint (A, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; GrB_Info info = GB_Matrix_check (A, name, pr, f) ; - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - if (info == GrB_INDEX_OUT_OF_BOUNDS) { // indices out of order diff --git a/GraphBLAS/Source/print/GxB_Monoid_fprint.c b/GraphBLAS/Source/print/GxB_Monoid_fprint.c index 67a01ac8fd..2c17c40824 100644 --- a/GraphBLAS/Source/print/GxB_Monoid_fprint.c +++ b/GraphBLAS/Source/print/GxB_Monoid_fprint.c @@ -2,7 +2,7 @@ // GxB_Monoid_fprint: print and check a GrB_Monoid object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid ( GrB_Monoid monoid, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Monoid_fprint (monoid, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Monoid_check (monoid, name, pr, f, false)) ; } diff --git a/GraphBLAS/Source/print/GxB_Scalar_fprint.c b/GraphBLAS/Source/print/GxB_Scalar_fprint.c index b9a604f07c..eedb531095 100644 --- a/GraphBLAS/Source/print/GxB_Scalar_fprint.c +++ b/GraphBLAS/Source/print/GxB_Scalar_fprint.c @@ -2,7 +2,7 @@ // GxB_Scalar_fprint: print and check a GrB_Scalar object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Scalar_fprint // print and check a GrB_Scalar ( GrB_Scalar s, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Scalar_fprint (s, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Scalar_check (s, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_SelectOp_fprint.c b/GraphBLAS/Source/print/GxB_SelectOp_fprint.c index d7c5656632..c0c58a454b 100644 --- a/GraphBLAS/Source/print/GxB_SelectOp_fprint.c +++ b/GraphBLAS/Source/print/GxB_SelectOp_fprint.c @@ -2,7 +2,7 @@ // GxB_SelectOp_fprint: print and check a GxB_SelectOp object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_SelectOp_fprint // print and check a GxB_SelectOp ( GxB_SelectOp selectop, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_SelectOp_fprint (selectop, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_SelectOp_check (selectop, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Semiring_fprint.c b/GraphBLAS/Source/print/GxB_Semiring_fprint.c index ea910d46a6..5e95cf80cc 100644 --- a/GraphBLAS/Source/print/GxB_Semiring_fprint.c +++ b/GraphBLAS/Source/print/GxB_Semiring_fprint.c @@ -2,7 +2,7 @@ // GxB_Semiring_fprint: print and check a GrB_Semiring object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Semiring_fprint // print and check a GrB_Semiring ( GrB_Semiring semiring, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Semiring_fprint (semiring, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Semiring_check (semiring, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Type_fprint.c b/GraphBLAS/Source/print/GxB_Type_fprint.c index a908779a7b..b32afed109 100644 --- a/GraphBLAS/Source/print/GxB_Type_fprint.c +++ b/GraphBLAS/Source/print/GxB_Type_fprint.c @@ -2,7 +2,7 @@ // GxB_Type_fprint: print and check a GrB_Type object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_Type_fprint // print and check a GrB_Type ( GrB_Type type, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Type_fprint (type, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_Type_check (type, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_UnaryOp_fprint.c b/GraphBLAS/Source/print/GxB_UnaryOp_fprint.c index 817e35b85c..84a97c156e 100644 --- a/GraphBLAS/Source/print/GxB_UnaryOp_fprint.c +++ b/GraphBLAS/Source/print/GxB_UnaryOp_fprint.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_fprint: print and check a GrB_UnaryOp object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,21 +13,11 @@ GrB_Info GxB_UnaryOp_fprint // print and check a GrB_UnaryOp ( GrB_UnaryOp unaryop, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_UnaryOp_fprint (unaryop, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; return (GB_UnaryOp_check (unaryop, name, pr, f)) ; } diff --git a/GraphBLAS/Source/print/GxB_Vector_fprint.c b/GraphBLAS/Source/print/GxB_Vector_fprint.c index 31a74e1a83..62855d0f0a 100644 --- a/GraphBLAS/Source/print/GxB_Vector_fprint.c +++ b/GraphBLAS/Source/print/GxB_Vector_fprint.c @@ -2,7 +2,7 @@ // GxB_Vector_fprint: print and check a GrB_Vector object //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,27 +13,12 @@ GrB_Info GxB_Vector_fprint // print and check a GrB_Vector ( GrB_Vector v, // object to print and check const char *name, // name of the object - GxB_Print_Level pr, // print level + int pr, // print level FILE *f // file for output ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GB_WHERE1 ("GxB_Vector_fprint (v, name, pr, f)") ; - - //-------------------------------------------------------------------------- - // print and check the object - //-------------------------------------------------------------------------- - + GB_CHECK_INIT ; GrB_Info info = GB_Vector_check (v, name, pr, f) ; - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - if (info == GrB_INDEX_OUT_OF_BOUNDS) { // indices out of order diff --git a/GraphBLAS/Source/print/include/GB_printf_kernels.h b/GraphBLAS/Source/print/include/GB_printf_kernels.h index aa6d795e7b..8c947d5a25 100644 --- a/GraphBLAS/Source/print/include/GB_printf_kernels.h +++ b/GraphBLAS/Source/print/include/GB_printf_kernels.h @@ -2,7 +2,7 @@ // GB_printf_kernels.h: definitions for printing from GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ #define GB_STRING_MATCH(s,t) (strcmp (s,t) == 0) -// format strings, normally %llu and %lld, for GrB_Index values +// format strings, normally %llu and %lld, for uint64_t and int64_t values #define GBu "%" PRIu64 #define GBd "%" PRId64 @@ -24,14 +24,15 @@ //------------------------------------------------------------------------------ // print to the standard output, and flush the result. No error check is done. -// This function is used for the BURBLE, and for debugging output. +// This function is used for the BURBLE, and for debugging output. JIT kernels +// do not BURBLE, but they can use GBDUMP for debugging. // the JIT run time kernels use printf and flush directly from libc: #undef GBDUMP -#define GBDUMP(...) \ -{ \ - printf (__VA_ARGS__) ; \ - fflush (stdout) ; \ +#define GBDUMP(...) \ +{ \ + printf (__VA_ARGS__) ; /* JIT kernels use libc printf */ \ + fflush (stdout) ; /* JIT kernels use libc fflush */ \ } //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reduce/GB_Scalar_reduce.c b/GraphBLAS/Source/reduce/GB_Scalar_reduce.c index 58df9dc4b8..a14bc00a99 100644 --- a/GraphBLAS/Source/reduce/GB_Scalar_reduce.c +++ b/GraphBLAS/Source/reduce/GB_Scalar_reduce.c @@ -2,7 +2,7 @@ // GB_Scalar_reduce: reduce a matrix to a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ GrB_Info GB_Scalar_reduce // check if A is empty //-------------------------------------------------------------------------- - GrB_Index nvals ; + uint64_t nvals ; GB_OK (GB_nvals (&nvals, A, Werk)) ; if (nvals == 0) { diff --git a/GraphBLAS/Source/reduce/GB_reduce.h b/GraphBLAS/Source/reduce/GB_reduce.h index 83493ad4b2..8e33dbacce 100644 --- a/GraphBLAS/Source/reduce/GB_reduce.h +++ b/GraphBLAS/Source/reduce/GB_reduce.h @@ -2,7 +2,7 @@ // GB_reduce.h: definitions for GB_reduce //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reduce/GB_reduce_to_scalar.c b/GraphBLAS/Source/reduce/GB_reduce_to_scalar.c index da5f61942e..f1eec8bb20 100644 --- a/GraphBLAS/Source/reduce/GB_reduce_to_scalar.c +++ b/GraphBLAS/Source/reduce/GB_reduce_to_scalar.c @@ -2,7 +2,7 @@ // GB_reduce_to_scalar: reduce a matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -279,11 +279,6 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) #define GB_DECLARE_IDENTITY_CONST(z) \ const GB_void *z = monoid->identity ; - // const zterminal = terminal_value - #undef GB_DECLARE_TERMINAL_CONST - #define GB_DECLARE_TERMINAL_CONST(zterminal) \ - const GB_void *zterminal = monoid->terminal ; - #define GB_A_TYPE GB_void // no panel used @@ -366,6 +361,8 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) #undef GB_MONOID_IS_TERMINAL #define GB_MONOID_IS_TERMINAL 0 #undef GB_TERMINAL_CONDITION + #undef GB_DECLARE_TERMINAL_CONST + #define GB_DECLARE_TERMINAL_CONST #define GB_TERMINAL_CONDITION(z,zterminal) 0 #undef GB_IF_TERMINAL_BREAK #define GB_IF_TERMINAL_BREAK @@ -377,6 +374,10 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) #undef GB_MONOID_IS_TERMINAL #define GB_MONOID_IS_TERMINAL 1 #undef GB_TERMINAL_CONDITION + // const zterminal = terminal_value + #undef GB_DECLARE_TERMINAL_CONST + #define GB_DECLARE_TERMINAL_CONST(zterminal) \ + const GB_void *zterminal = monoid->terminal ; #define GB_TERMINAL_CONDITION(z,zterminal) \ (memcmp (z, zterminal, zsize) == 0) #undef GB_IF_TERMINAL_BREAK diff --git a/GraphBLAS/Source/reduce/GB_reduce_to_scalar_iso.c b/GraphBLAS/Source/reduce/GB_reduce_to_scalar_iso.c index 92186b6e5f..b4130f74fa 100644 --- a/GraphBLAS/Source/reduce/GB_reduce_to_scalar_iso.c +++ b/GraphBLAS/Source/reduce/GB_reduce_to_scalar_iso.c @@ -2,7 +2,7 @@ // GB_reduce_to_scalar_iso: reduce an iso matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reduce/GB_reduce_to_vector.c b/GraphBLAS/Source/reduce/GB_reduce_to_vector.c index 2ed85cb1df..6d385c6a32 100644 --- a/GraphBLAS/Source/reduce/GB_reduce_to_vector.c +++ b/GraphBLAS/Source/reduce/GB_reduce_to_vector.c @@ -2,7 +2,7 @@ // GB_reduce_to_vector: reduce a matrix to a vector using a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,19 +38,14 @@ GrB_Info GB_reduce_to_vector // C = accum (C,reduce(A)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; + GB_RETURN_IF_FAULTY (desc) ; + struct GB_Matrix_opaque B_header ; GrB_Matrix B = NULL ; struct GB_Semiring_opaque semiring_header ; GrB_Semiring semiring = NULL ; - // C may be aliased with M and/or A - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; - GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - GB_RETURN_IF_FAULTY (desc) ; - ASSERT_MATRIX_OK (C, "C input for reduce-to-vector", GB0) ; ASSERT_MATRIX_OK_OR_NULL (M_in, "M_in for reduce-to-vector", GB0) ; ASSERT_BINARYOP_OK_OR_NULL (accum, "accum for reduce-to-vector", GB0) ; @@ -61,6 +56,7 @@ GrB_Info GB_reduce_to_vector // C = accum (C,reduce(A)) ASSERT (GB_IMPLIES (M_in != NULL, GB_VECTOR_OK (M_in))) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, do_sort) ; @@ -115,12 +111,13 @@ GrB_Info GB_reduce_to_vector // C = accum (C,reduce(A)) // though it is m-by-1. It contains no dynamically-allocated content and // does not need to be freed. int64_t m = A_transpose ? GB_NROWS (A) : GB_NCOLS (A) ; - GB_CLEAR_STATIC_HEADER (B, &B_header) ; + GB_CLEAR_MATRIX_HEADER (B, &B_header) ; info = GB_new (&B, // full, existing header - ztype, m, 1, GB_Ap_null, true, GxB_FULL, GB_NEVER_HYPER, 1) ; + ztype, m, 1, GB_ph_null, true, GxB_FULL, GB_NEVER_HYPER, 1, + /* OK: */ false, false, false) ; ASSERT (info == GrB_SUCCESS) ; B->magic = GB_MAGIC ; - B->iso = true ; // OK: B is a temporary matrix; no burble + B->iso = true ; size_t zsize = ztype->size ; GB_void bscalar [GB_VLA(zsize)] ; memset (bscalar, 0, zsize) ; @@ -166,12 +163,12 @@ GrB_Info GB_reduce_to_vector // C = accum (C,reduce(A)) // user-defined type and this "reduce_1st" will be a unique name // for the constructed semiring (if "reduce" is the name of the // monoid). In addition, it is not possible for the user to create - // a jitfyable operator with the name "1st", because of the leading - // "1" character in its name. So "reduce_1st" must be unique. + // a jitifyable operator with the name "1st", because of the + // leading "1" character in its name. So "reduce_1st" must be + // unique. op = &op_header ; op->header_size = 0 ; - info = GB_binop_new (op, - NULL, // op->binop_function is NULL for FIRST_UDT + info = GB_binop_new (op, NULL, // op->binop_func. NULL for FIRST_UDT ztype, ztype, ztype, // ztype is user-defined "1st", // a simple name for FIRST_UDT NULL, // no op->defn for the FIRST_UDT operator diff --git a/GraphBLAS/Source/reduce/GB_reduce_worker_iso.c b/GraphBLAS/Source/reduce/GB_reduce_worker_iso.c index 818118e99f..96bf2f6257 100644 --- a/GraphBLAS/Source/reduce/GB_reduce_worker_iso.c +++ b/GraphBLAS/Source/reduce/GB_reduce_worker_iso.c @@ -2,7 +2,7 @@ // GB_reduce_worker_iso: reduce n entries, all equal to a, to the scalar s //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reduce/GrB_Matrix_reduce.c b/GraphBLAS/Source/reduce/GrB_Matrix_reduce.c index a2933e4477..a63b28f91e 100644 --- a/GraphBLAS/Source/reduce/GrB_Matrix_reduce.c +++ b/GraphBLAS/Source/reduce/GrB_Matrix_reduce.c @@ -2,7 +2,7 @@ // GrB_Matrix_reduce: reduce a matrix to a vector or scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,11 +33,12 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_reduce_, T) /* c = accum (c, reduce (A)) */ \ const GrB_Descriptor desc \ ) \ { \ - GB_WHERE1 ("GrB_Matrix_reduce_" GB_STR(T) " (&c, accum, monoid, A, desc)");\ + GB_RETURN_IF_NULL (A) ; \ + GB_WHERE_1 (A, "GrB_Matrix_reduce_" GB_STR(T) \ + " (&c, accum, monoid, A, desc)") ; \ GB_BURBLE_START ("GrB_reduce") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ - GrB_Info info = GB_reduce_to_scalar (c, GB_EVAL3 (prefix, _, T), accum, \ - monoid, A, Werk) ; \ + info = GB_reduce_to_scalar (c, GB_EVAL3 (prefix, _, T), accum, monoid, A, \ + Werk) ; \ GB_BURBLE_END ; \ return (info) ; \ } @@ -65,11 +66,12 @@ GrB_Info GrB_Matrix_reduce_UDT // c = accum (c, reduce_to_scalar (A)) const GrB_Descriptor desc ) { - GB_WHERE1 ("GrB_Matrix_reduce_UDT (&c, accum, monoid, A, desc)") ; - GB_BURBLE_START ("GrB_reduce") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; - GrB_Info info = GB_reduce_to_scalar (c, monoid->op->ztype, accum, + GB_WHERE_1 (A, "GrB_Matrix_reduce_UDT (&c, accum, monoid, A, desc)") ; + GB_BURBLE_START ("GrB_reduce") ; + + info = GB_reduce_to_scalar (c, monoid->op->ztype, accum, monoid, A, Werk) ; GB_BURBLE_END ; return (info) ; @@ -89,10 +91,39 @@ GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) const GrB_Descriptor desc // descriptor for w, M, and A ) { - GB_WHERE (w, "GrB_Matrix_reduce_Monoid (w, M, accum, monoid, A, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE3 (w, M, A, + "GrB_Matrix_reduce_Monoid (w, M, accum, monoid, A, desc)") ; + GB_BURBLE_START ("GrB_reduce") ; + + info = GB_reduce_to_vector ((GrB_Matrix) w, (GrB_Matrix) M, accum, monoid, + A, desc, Werk) ; + GB_BURBLE_END ; + return (info) ; +} + +//------------------------------------------------------------------------------ +// GrB_Matrix_reduce_Monoid_Scalar: reduce a matrix to a GrB_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_reduce_Monoid_Scalar +( + GrB_Scalar S, // result scalar + const GrB_BinaryOp accum, // optional accum for c=accum(c,t) + const GrB_Monoid monoid, // monoid to do the reduction + const GrB_Matrix A, // matrix to reduce + const GrB_Descriptor desc +) +{ + GB_RETURN_IF_NULL (S) ; + GB_WHERE2 (S, A, + "GrB_Matrix_reduce_Monoid_Scalar (s, accum, monoid, A, desc)") ; GB_BURBLE_START ("GrB_reduce") ; - GrB_Info info = GB_reduce_to_vector ((GrB_Matrix) w, (GrB_Matrix) M, - accum, monoid, A, desc, Werk) ; + + info = GB_Scalar_reduce (S, accum, monoid, A, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -102,6 +133,7 @@ GrB_Info GrB_Matrix_reduce_Monoid // w = accum (w,reduce(A)) //------------------------------------------------------------------------------ // Only binary ops that correspond to a known monoid are supported. +// This method is not recommended. GrB_Info GrB_Matrix_reduce_BinaryOp ( @@ -113,44 +145,27 @@ GrB_Info GrB_Matrix_reduce_BinaryOp const GrB_Descriptor desc // descriptor for w, M, and A ) { - GB_WHERE (w, "GrB_Matrix_reduce_BinaryOp (w, M, accum, op, A, desc)") ; - GB_BURBLE_START ("GrB_reduce") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (A) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE3 (w, M, A, "GrB_Matrix_reduce_BinaryOp : DEPRECATED!") ; + GB_BURBLE_START ("GrB_reduce with binary op : DEPRECATED!") ; + + // convert the binary op to its corresponding monoid if (op->ztype != op->xtype || op->ztype != op->ytype) { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Invalid binary operator:" - " z=%s(x,y); all types of x,y,z must be the same\n", op->name) ; + return (GrB_DOMAIN_MISMATCH) ; } - // convert the binary op to its corresponding monoid GrB_Monoid monoid = GB_binop_to_monoid (op) ; if (monoid == NULL) { - GB_ERROR (GrB_NOT_IMPLEMENTED, "Invalid binary operator:" - " z=%s(x,y) has no equivalent monoid\n", op->name) ; + return (GrB_NOT_IMPLEMENTED) ; } - // w = reduce (A) via the monoid - GrB_Info info = GB_reduce_to_vector ((GrB_Matrix) w, (GrB_Matrix) M, - accum, monoid, A, desc, Werk) ; - GB_BURBLE_END ; - return (info) ; -} - -//------------------------------------------------------------------------------ -// GrB_Matrix_reduce_Monoid_Scalar: reduce a matrix to a GrB_Scalar -//------------------------------------------------------------------------------ -GrB_Info GrB_Matrix_reduce_Monoid_Scalar -( - GrB_Scalar S, // result scalar - const GrB_BinaryOp accum, // optional accum for c=accum(c,t) - const GrB_Monoid monoid, // monoid to do the reduction - const GrB_Matrix A, // matrix to reduce - const GrB_Descriptor desc -) -{ - GB_WHERE (S, "GrB_Matrix_reduce_Monoid_Scalar (s, accum, monoid, A, desc)"); - GB_BURBLE_START ("GrB_reduce") ; - GrB_Info info = GB_Scalar_reduce (S, accum, monoid, A, Werk) ; + // w = reduce (A) via the monoid + info = GB_reduce_to_vector ((GrB_Matrix) w, (GrB_Matrix) M, accum, monoid, + A, desc, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -159,6 +174,9 @@ GrB_Info GrB_Matrix_reduce_Monoid_Scalar // GrB_Matrix_reduce_BinaryOp_Scalar: reduce matrix to GrB_Scalar via binary op //------------------------------------------------------------------------------ +// Only binary ops that correspond to a known monoid are supported. +// This method is not recommended. + GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar ( GrB_Scalar S, // result scalar @@ -167,25 +185,25 @@ GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar const GrB_Matrix A, // matrix to reduce const GrB_Descriptor desc ) -{ - GB_WHERE (S, "GrB_Matrix_reduce_BinaryOp_Scalar (s, accum, binaryop, A, " - "desc)") ; - GB_BURBLE_START ("GrB_reduce") ; +{ + GB_RETURN_IF_NULL (S) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_WHERE2 (S, A, "GrB_Matrix_reduce_BinaryOp_Scalar : DEPRECATED!") ; + GB_BURBLE_START ("GrB_reduce with binary op : DEPRECATED!") ; + + // convert the binary op to its corresponding monoid if (op->ztype != op->xtype || op->ztype != op->ytype) { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Invalid binary operator:" - " z=%s(x,y); all types of x,y,z must be the same\n", op->name) ; + return (GrB_DOMAIN_MISMATCH) ; } - // convert the binary op to its corresponding monoid GrB_Monoid monoid = GB_binop_to_monoid (op) ; if (monoid == NULL) { - GB_ERROR (GrB_NOT_IMPLEMENTED, "Invalid binary operator:" - " z=%s(x,y) has no equivalent monoid\n", op->name) ; + return (GrB_NOT_IMPLEMENTED) ; } + // S = reduce (A) via the monoid - GrB_Info info = GB_Scalar_reduce (S, accum, monoid, A, Werk) ; + info = GB_Scalar_reduce (S, accum, monoid, A, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/reduce/GrB_Vector_reduce.c b/GraphBLAS/Source/reduce/GrB_Vector_reduce.c index 86a6aafd39..5c77c6aca1 100644 --- a/GraphBLAS/Source/reduce/GrB_Vector_reduce.c +++ b/GraphBLAS/Source/reduce/GrB_Vector_reduce.c @@ -2,7 +2,7 @@ // GrB_Vector_reduce: reduce a vector to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,12 +33,13 @@ GrB_Info GB_EVAL3 (prefix, _Vector_reduce_, T) /* c = accum (c, reduce (u)) */ const GrB_Descriptor desc \ ) \ { \ - GB_WHERE1 ("GrB_Vector_reduce_" GB_STR(T) " (&c, accum, monoid, u, desc)");\ + GB_RETURN_IF_NULL (u) ; \ + GB_WHERE_1 (u, "GrB_Vector_reduce_" GB_STR(T) \ + " (&c, accum, monoid, u, desc)") ; \ GB_BURBLE_START ("GrB_reduce") ; \ - GB_RETURN_IF_NULL_OR_FAULTY (u) ; \ ASSERT (GB_VECTOR_OK (u)) ; \ - GrB_Info info = GB_reduce_to_scalar (c, GB_EVAL3 (prefix, _, T), accum, \ - monoid, (GrB_Matrix) u, Werk) ; \ + info = GB_reduce_to_scalar (c, GB_EVAL3 (prefix, _, T), accum, monoid, \ + (GrB_Matrix) u, Werk) ; \ GB_BURBLE_END ; \ return (info) ; \ } @@ -66,13 +67,14 @@ GrB_Info GrB_Vector_reduce_UDT // c = accum (c, reduce_to_scalar (u)) const GrB_Descriptor desc ) { - GB_WHERE1 ("GrB_Vector_reduce_UDT (&c, accum, monoid, u, desc)") ; - GB_BURBLE_START ("GrB_reduce") ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + GB_RETURN_IF_NULL (u) ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; + GB_WHERE_1 (u, "GrB_Vector_reduce_UDT (&c, accum, monoid, u, desc)") ; + GB_BURBLE_START ("GrB_reduce") ; + ASSERT (GB_VECTOR_OK (u)) ; - GrB_Info info = GB_reduce_to_scalar (c, monoid->op->ztype, - accum, monoid, (GrB_Matrix) u, Werk) ; + info = GB_reduce_to_scalar (c, monoid->op->ztype, accum, monoid, + (GrB_Matrix) u, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -90,10 +92,12 @@ GrB_Info GrB_Vector_reduce_Monoid_Scalar const GrB_Descriptor desc ) { - GB_WHERE (S, "GrB_Vector_reduce_Monoid_Scalar (s, accum, monoid, u, desc)") ; + GB_RETURN_IF_NULL (S) ; + GB_WHERE2 (S, u, + "GrB_Vector_reduce_Monoid_Scalar (s, accum, monoid, u, desc)") ; GB_BURBLE_START ("GrB_reduce") ; - GrB_Info info = GB_Scalar_reduce (S, accum, monoid, (GrB_Matrix) u, - Werk) ; + + info = GB_Scalar_reduce (S, accum, monoid, (GrB_Matrix) u, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -102,6 +106,9 @@ GrB_Info GrB_Vector_reduce_Monoid_Scalar // GrB_Vector_reduce_BinaryOp_Scalar: reduce vector to GrB_Scalar via binary op //------------------------------------------------------------------------------ +// Only binary ops that correspond to a known monoid are supported. +// This method is not recommended. + GrB_Info GrB_Vector_reduce_BinaryOp_Scalar ( GrB_Scalar S, // result scalar @@ -111,25 +118,24 @@ GrB_Info GrB_Vector_reduce_BinaryOp_Scalar const GrB_Descriptor desc ) { - GB_WHERE (S, "GrB_Vector_reduce_BinaryOp_Scalar (s, accum, binaryop, u, " - "desc)") ; - GB_BURBLE_START ("GrB_reduce") ; + GB_RETURN_IF_NULL (S) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_WHERE2 (S, u, "GrB_Vector_reduce_BinaryOp_Scalar : DEPRECATED!") ; + GB_BURBLE_START ("GrB_reduce with binary op : DEPRECATED!") ; + + // convert the binary op to its corresponding monoid if (op->ztype != op->xtype || op->ztype != op->ytype) { - GB_ERROR (GrB_DOMAIN_MISMATCH, "Invalid binary operator:" - " z=%s(x,y); all types of x,y,z must be the same\n", op->name) ; + return (GrB_DOMAIN_MISMATCH) ; } - // convert the binary op to its corresponding monoid GrB_Monoid monoid = GB_binop_to_monoid (op) ; if (monoid == NULL) { - GB_ERROR (GrB_NOT_IMPLEMENTED, "Invalid binary operator:" - " z=%s(x,y) has no equivalent monoid\n", op->name) ; + return (GrB_NOT_IMPLEMENTED) ; } + // S = reduce (A) via the monoid - GrB_Info info = GB_Scalar_reduce (S, accum, monoid, (GrB_Matrix) u, - Werk) ; + info = GB_Scalar_reduce (S, accum, monoid, (GrB_Matrix) u, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/reduce/factory/GB_red_factory.c b/GraphBLAS/Source/reduce/factory/GB_red_factory.c index ec8afdd674..283ea09f07 100644 --- a/GraphBLAS/Source/reduce/factory/GB_red_factory.c +++ b/GraphBLAS/Source/reduce/factory/GB_red_factory.c @@ -2,7 +2,7 @@ // GB_red_factory.c: switch factory for reduction operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reduce/template/GB_reduce_panel.c b/GraphBLAS/Source/reduce/template/GB_reduce_panel.c index 27c4e7873e..71e1d25c14 100644 --- a/GraphBLAS/Source/reduce/template/GB_reduce_panel.c +++ b/GraphBLAS/Source/reduce/template/GB_reduce_panel.c @@ -2,7 +2,7 @@ // GB_reduce_panel: z=reduce(A), reduce a matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,8 +16,6 @@ // The Panel and W arrays always have the same type as z, GB_Z_TYPE. -#include "include/GB_unused.h" - // default panel size #ifndef GB_PANEL #define GB_PANEL 16 @@ -35,7 +33,9 @@ ASSERT (anz > 0) ; ASSERT (!GB_IS_BITMAP (A)) ; ASSERT (A->nzombies == 0) ; + #if GB_MONOID_IS_TERMINAL GB_DECLARE_TERMINAL_CONST (zterminal) ; + #endif #if GB_IS_ANY_MONOID // the ANY monoid can take any entry, and terminate immediately diff --git a/GraphBLAS/Source/reduce/template/GB_reduce_to_scalar_template.c b/GraphBLAS/Source/reduce/template/GB_reduce_to_scalar_template.c index 4f61c0dc56..5a5f787d81 100644 --- a/GraphBLAS/Source/reduce/template/GB_reduce_to_scalar_template.c +++ b/GraphBLAS/Source/reduce/template/GB_reduce_to_scalar_template.c @@ -2,7 +2,7 @@ // GB_reduce_to_scalar_template: z=reduce(A), reduce a matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,8 +11,6 @@ // No panel is used. The workspace W always has the same type as the ztype // of the monoid, GB_Z_TYPE. -#include "include/GB_unused.h" - // z += W [i], no typecast #ifndef GB_ADD_ARRAY_TO_SCALAR #define GB_ADD_ARRAY_TO_SCALAR(z,W,i) GB_UPDATE (z, W [i]) @@ -29,8 +27,9 @@ // get A //-------------------------------------------------------------------------- - const int8_t *restrict Ab = A->b ; - const int64_t *restrict Ai = A->i ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + + const int8_t *restrict Ab = A->b ; const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_A_NHELD (anz) ; // int64_t anz = GB_nnz_held (A) ; ASSERT (anz > 0) ; @@ -40,7 +39,9 @@ const bool A_has_zombies = (A->nzombies > 0) ; #endif ASSERT (!A->iso) ; + #if GB_MONOID_IS_TERMINAL GB_DECLARE_TERMINAL_CONST (zterminal) ; + #endif //-------------------------------------------------------------------------- // reduce A to a scalar @@ -56,8 +57,12 @@ for (int64_t p = 0 ; p < anz ; p++) { // skip if the entry is a zombie or if not in the bitmap - if (A_has_zombies && GB_IS_ZOMBIE (Ai [p])) continue ; - if (!GBB_A (Ab, p)) continue ; + if (A_has_zombies) + { + int64_t i = GB_IGET (Ai, p) ; + if (GB_IS_ZOMBIE (i)) continue ; + } + if (!GBb_A (Ab, p)) continue ; // z += (ztype) Ax [p] GB_GETA_AND_UPDATE (z, Ax, p) ; #if GB_MONOID_IS_TERMINAL @@ -92,8 +97,12 @@ for (int64_t p = pstart ; p < pend ; p++) { // skip if the entry is a zombie or if not in the bitmap - if (A_has_zombies && GB_IS_ZOMBIE (Ai [p])) continue ; - if (!GBB_A (Ab, p)) continue ; + if (A_has_zombies) + { + int64_t i = GB_IGET (Ai, p) ; + if (GB_IS_ZOMBIE (i)) continue ; + } + if (!GBb_A (Ab, p)) continue ; found = true ; // t += (ztype) Ax [p] GB_GETA_AND_UPDATE (t, Ax, p) ; diff --git a/GraphBLAS/Source/reshape/GB_reshape.c b/GraphBLAS/Source/reshape/GB_reshape.c index 33cba4a1a9..72d44ccf3e 100644 --- a/GraphBLAS/Source/reshape/GB_reshape.c +++ b/GraphBLAS/Source/reshape/GB_reshape.c @@ -2,7 +2,7 @@ // GB_reshape: reshape a matrix into another matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,15 +14,14 @@ #include "GB.h" #include "reshape/GB_reshape.h" #include "transpose/GB_transpose.h" -#include "slice/GB_ek_slice.h" #include "builder/GB_build.h" #define GB_FREE_WORKSPACE \ { \ GB_WERK_POP (T_ek_slicing, int64_t) ; \ - GB_FREE (&I_work, I_work_size) ; \ - GB_FREE (&J_work, J_work_size) ; \ - GB_FREE (&S_work, S_work_size) ; \ + GB_FREE_MEMORY (&I_work, I_work_size) ; \ + GB_FREE_MEMORY (&J_work, J_work_size) ; \ + GB_FREE_MEMORY (&S_work, S_work_size) ; \ if (T != A && T != C) \ { \ GB_Matrix_free (&T) ; \ @@ -63,9 +62,13 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix GrB_Info info ; ASSERT_MATRIX_OK (A, "A for reshape", GB0) ; - int64_t *I_work = NULL, *J_work = NULL ; - GB_void *S_work = NULL, *S_input = NULL ; - size_t I_work_size = 0, J_work_size = 0, S_work_size = 0 ; + GB_MDECL (I_work, , u) ; size_t I_work_size = 0 ; + GB_MDECL (J_work, , u) ; size_t J_work_size = 0 ; + GB_void *S_work = NULL ; size_t S_work_size = 0 ; + GB_void *S_input = NULL ; + bool I_work_is_32 = false ; + bool J_work_is_32 = false ; + GB_WERK_DECLARE (T_ek_slicing, int64_t) ; GrB_Matrix C = NULL, T = NULL ; @@ -75,7 +78,7 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix (*Chandle) = NULL ; } - GrB_Index matrix_size, s ; + uint64_t matrix_size, s ; int64_t nrows_old = GB_NROWS (A) ; int64_t ncols_old = GB_NCOLS (A) ; bool ok = GB_int64_multiply (&matrix_size, nrows_old, ncols_old) ; @@ -113,8 +116,9 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix { // T = A' GB_OK (GB_new (&T, // new header - type, A->vdim, A->vlen, GB_Ap_null, by_col, GxB_AUTO_SPARSITY, - GB_Global_hyper_switch_get ( ), 0)) ; + type, A->vdim, A->vlen, GB_ph_null, by_col, GxB_AUTO_SPARSITY, + GB_Global_hyper_switch_get ( ), 0, + A->p_is_32, A->j_is_32, A->i_is_32)) ; GB_OK (GB_transpose_cast (T, type, by_col, A, false, Werk)) ; // now T can be reshaped in-place to construct C in_place = true ; @@ -151,7 +155,7 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix // C = reshape (T), keeping the same format (by_col) //-------------------------------------------------------------------------- - if (GB_IS_FULL (T) || GB_IS_BITMAP (T)) + if (vlen_new == T->vlen && vdim_new == T->vdim) { //---------------------------------------------------------------------- @@ -169,11 +173,33 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix // copy T into C GB_OK (GB_dup (&C, T, Werk)) ; } + + } + else if (GB_IS_FULL (T) || GB_IS_BITMAP (T)) + { + + //---------------------------------------------------------------------- + // T and C are both full or both bitmap + //---------------------------------------------------------------------- + + if (in_place) + { + // move T into C + C = T ; + T = NULL ; + } + else + { + // copy T into C + GB_OK (GB_dup (&C, T, Werk)) ; + } + // change the size of C C->vlen = vlen_new ; C->vdim = vdim_new ; C->nvec = vdim_new ; - C->nvec_nonempty = (vlen_new == 0) ? 0 : vdim_new ; +// C->nvec_nonempty = (vlen_new == 0) ? 0 : vdim_new ; + GB_nvec_nonempty_set (C, (vlen_new == 0) ? 0 : vdim_new) ; } else @@ -184,9 +210,11 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix //---------------------------------------------------------------------- int64_t nvals = GB_nnz (T) ; - int64_t *Tp = T->p ; - int64_t *Th = T->h ; - int64_t *Ti = T->i ; + + GB_Ap_DECLARE (Tp, const) ; GB_Ap_PTR (Tp, T) ; + GB_Ah_DECLARE (Th, const) ; GB_Ah_PTR (Th, T) ; + GB_Ai_DECLARE (Ti, const) ; GB_Ai_PTR (Ti, T) ; + bool T_iso = T->iso ; int64_t tvlen = T->vlen ; bool T_jumbled = T->jumbled ; @@ -196,10 +224,19 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix int T_nthreads, T_ntasks ; GB_SLICE_MATRIX (T, 1) ; + bool Cp_is_32, Cj_is_32,Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, nvals, vlen_new, vdim_new, Werk) ; + //---------------------------------------------------------------------- // allocate output and workspace //---------------------------------------------------------------------- + I_work_is_32 = (in_place) ? T->i_is_32 : Ci_is_32 ; + J_work_is_32 = (in_place) ? T->j_is_32 : Cj_is_32 ; + size_t jwsize = (J_work_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t iwsize = (I_work_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + if (in_place) { @@ -210,10 +247,10 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix // remove T->i from T; it becomes I_work I_work = T->i ; I_work_size = T->i_size ; T->i = NULL ; T->i_size = 0 ; + // remove T->x from T; it becomes S_work S_work = T->x ; S_work_size = T->x_size ; T->x = NULL ; T->x_size = 0 ; - S_input = NULL ; // move T into C C = T ; @@ -229,24 +266,28 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix // create the output matrix (just the header; no content) GB_OK (GB_new (&C, // new header - type, vlen_new, vdim_new, GB_Ap_null, T_is_csc, - GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 0)) ; + type, vlen_new, vdim_new, GB_ph_null, T_is_csc, + GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 0, + Cp_is_32, Cj_is_32, Ci_is_32)) ; + // allocate new space for the future C->i - I_work = GB_MALLOC (nvals, int64_t, &I_work_size) ; + I_work = GB_MALLOC_MEMORY (nvals, iwsize, &I_work_size) ; if (I_work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } + // use T->x as S_input to GB_builder, which is not modified S_input = T->x ; } + // allocate J_work if (vdim_new > 1) { // J_work is not needed if vdim_new == 1 - J_work = GB_MALLOC (nvals, int64_t, &J_work_size) ; + J_work = GB_MALLOC_MEMORY (nvals, jwsize, &J_work_size) ; if (J_work == NULL) { // out of memory @@ -255,6 +296,9 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix } } + GB_IPTR (I_work, I_work_is_32) ; + GB_IPTR (J_work, J_work_is_32) ; + //---------------------------------------------------------------------- // construct the new indices //---------------------------------------------------------------------- @@ -275,16 +319,16 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix int64_t klast = klast_Tslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t jold = GBH (Th, k) ; + int64_t jold = GBh (Th, k) ; GB_GET_PA (pT_start, pT_end, tid, k, kfirst, klast, - pstart_Tslice, Tp [k], Tp [k+1]) ; + pstart_Tslice, GB_IGET (Tp, k), GB_IGET (Tp, k+1)) ; for (int64_t p = pT_start ; p < pT_end ; p++) { - int64_t iold = Ti [p] ; + int64_t iold = GB_IGET (Ti, p) ; // convert (iold,jold) to a 1D index int64_t index_1d = iold + jold * tvlen ; // save the new 1D index - I_work [p] = index_1d ; + GB_ISET (I_work, p, index_1d) ; // I_work [p] = index_1d } } } @@ -304,20 +348,20 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix int64_t klast = klast_Tslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - int64_t jold = GBH (Th, k) ; + int64_t jold = GBh (Th, k) ; GB_GET_PA (pT_start, pT_end, tid, k, kfirst, klast, - pstart_Tslice, Tp [k], Tp [k+1]) ; + pstart_Tslice, GB_IGET (Tp, k), GB_IGET (Tp, k+1)) ; for (int64_t p = pT_start ; p < pT_end ; p++) { - int64_t iold = Ti [p] ; + int64_t iold = GB_IGET (Ti, p) ; // convert (iold,jold) to a 1D index int64_t index_1d = iold + jold * tvlen ; // convert the 1D index to the 2d index: (inew,jnew) int64_t inew = index_1d % vlen_new ; int64_t jnew = (index_1d - inew) / vlen_new ; // save the new indices - I_work [p] = inew ; - J_work [p] = jnew ; + GB_ISET (I_work, p, inew) ; // I_work [p] = inew ; + GB_ISET (J_work, p, jnew) ; // J_work [p] = jnew ; } } } @@ -342,9 +386,9 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix vlen_new, // new vlen vdim_new, // new vdim T_is_csc, // same format as T - &I_work, // transplanted into C->i + (void **) &I_work, // transplanted into C->i &I_work_size, - &J_work, // freed when done + (void **) &J_work, // freed when done &J_work_size, &S_work, // array of values; transplanted into C->x in-place &S_work_size, @@ -360,7 +404,9 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix NULL, // no dup operator type, // type of S_work and S_input true, // burble is allowed - Werk + Werk, + I_work_is_32, J_work_is_32, // integer sizes of I_work, J_work + Cp_is_32, Cj_is_32, Ci_is_32 // integer sizes of C )) ; ASSERT (I_work == NULL) ; // transplanted into C->i diff --git a/GraphBLAS/Source/reshape/GB_reshape.h b/GraphBLAS/Source/reshape/GB_reshape.h index c0238c8119..642d7219ef 100644 --- a/GraphBLAS/Source/reshape/GB_reshape.h +++ b/GraphBLAS/Source/reshape/GB_reshape.h @@ -2,7 +2,7 @@ // GB_reshape: reshape a matrix into another matrix, or reshape it in-place //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/reshape/GxB_Matrix_reshape.c b/GraphBLAS/Source/reshape/GxB_Matrix_reshape.c index aec259ede2..3d0c565a85 100644 --- a/GraphBLAS/Source/reshape/GxB_Matrix_reshape.c +++ b/GraphBLAS/Source/reshape/GxB_Matrix_reshape.c @@ -2,7 +2,7 @@ // GxB_Matrix_reshape: reshape a matrix in place //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,8 +39,8 @@ GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place GrB_Matrix C, // input/output matrix, reshaped in place // input: bool by_col, // true if reshape by column, false if by row - GrB_Index nrows_new, // new number of rows of C - GrB_Index ncols_new, // new number of columns of C + uint64_t nrows_new, // new number of rows of C + uint64_t ncols_new, // new number of columns of C const GrB_Descriptor desc // to control # of threads used ) { @@ -49,9 +49,11 @@ GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_reshape (C, nrows_new, ncols_new, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE1 (C, "GxB_Matrix_reshape (C, nrows_new, ncols_new, desc)") ; GB_BURBLE_START ("GxB_Matrix_reshape") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/reshape/GxB_Matrix_reshapeDup.c b/GraphBLAS/Source/reshape/GxB_Matrix_reshapeDup.c index 09045a99bd..530bee8c68 100644 --- a/GraphBLAS/Source/reshape/GxB_Matrix_reshapeDup.c +++ b/GraphBLAS/Source/reshape/GxB_Matrix_reshapeDup.c @@ -2,7 +2,7 @@ // GxB_Matrix_reshapeDup: reshape a matrix into another matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,15 +18,15 @@ #include "GB.h" #include "reshape/GB_reshape.h" -GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix +GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix ( // output: GrB_Matrix *C, // newly created output matrix, not in place // input: GrB_Matrix A, // input matrix, not modified bool by_col, // true if reshape by column, false if by row - GrB_Index nrows_new, // number of rows of C - GrB_Index ncols_new, // number of columns of C + uint64_t nrows_new, // number of rows of C + uint64_t ncols_new, // number of columns of C const GrB_Descriptor desc // to control # of threads used ) { @@ -35,10 +35,11 @@ GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_reshapeDup (&C, A, nrows_new, ncols_new, desc)") ; - GB_BURBLE_START ("GxB_Matrix_reshapeDup") ; GB_RETURN_IF_NULL (C) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GxB_Matrix_reshapeDup (&C, A, nrows_new, ncols_new, desc)"); + GB_BURBLE_START ("GxB_Matrix_reshapeDup") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/resize/GB_resize.c b/GraphBLAS/Source/resize/GB_resize.c index 1092bd9809..8b840aadca 100644 --- a/GraphBLAS/Source/resize/GB_resize.c +++ b/GraphBLAS/Source/resize/GB_resize.c @@ -2,7 +2,7 @@ // GB_resize: change the size of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,11 +11,12 @@ #include "scalar/GB_Scalar_wrap.h" #include "resize/GB_resize.h" -#define GB_FREE_ALL \ -{ \ - GB_FREE (&Ax_new, Ax_new_size) ; \ - GB_FREE (&Ab_new, Ab_new_size) ; \ - GB_phybix_free (A) ; \ +#define GB_FREE_ALL \ +{ \ + GB_Matrix_free (&T) ; \ + GB_FREE_MEMORY (&Ax_new, Ax_new_size) ; \ + GB_FREE_MEMORY (&Ab_new, Ab_new_size) ; \ + GB_phybix_free (A) ; \ } //------------------------------------------------------------------------------ @@ -25,8 +26,8 @@ GrB_Info GB_resize // change the size of a matrix ( GrB_Matrix A, // matrix to modify - const GrB_Index nrows_new, // new number of rows in matrix - const GrB_Index ncols_new, // new number of columns in matrix + const uint64_t nrows_new, // new number of rows in matrix + const uint64_t ncols_new, // new number of columns in matrix GB_Werk Werk ) { @@ -40,6 +41,9 @@ GrB_Info GB_resize // change the size of a matrix int8_t *restrict Ab_new = NULL ; size_t Ab_new_size = 0 ; ASSERT_MATRIX_OK (A, "A to resize", GB0) ; + struct GB_Matrix_opaque T_header ; + GrB_Matrix T = NULL ; + //-------------------------------------------------------------------------- // handle the CSR/CSC format //-------------------------------------------------------------------------- @@ -68,19 +72,10 @@ GrB_Info GB_resize // change the size of a matrix // delete any lingering zombies and assemble any pending tuples //-------------------------------------------------------------------------- - // only do so if either dimension is shrinking, or if pending tuples exist - // and vdim_old <= 1 and vdim_new > 1, since in that case, Pending->j has - // not been allocated yet, but would be required in the resized matrix. - // If A is jumbled, it must be sorted. - - if (vdim_new < vdim_old || vlen_new < vlen_old || A->jumbled || - (GB_PENDING (A) && vdim_old <= 1 && vdim_new > 1)) - { - GB_MATRIX_WAIT (A) ; - ASSERT_MATRIX_OK (A, "A to resize, wait", GB0) ; - } - + GB_MATRIX_WAIT (A) ; ASSERT (!GB_JUMBLED (A)) ; + ASSERT (!GB_ZOMBIES (A)) ; + ASSERT (!GB_PENDING (A)) ; ASSERT_MATRIX_OK (A, "Final A to resize", GB0) ; //-------------------------------------------------------------------------- @@ -100,7 +95,7 @@ GrB_Info GB_resize // change the size of a matrix // get the old and new dimensions int64_t anz_new = 1 ; - bool ok = GB_int64_multiply ((GrB_Index *) (&anz_new), + bool ok = GB_int64_multiply ((uint64_t *) (&anz_new), vlen_new, vdim_new) ; if (!ok) anz_new = 1 ; size_t nzmax_new = GB_IMAX (anz_new, 1) ; @@ -118,14 +113,13 @@ GrB_Info GB_resize // change the size of a matrix if (in_place) { // reallocate A->x in-place; no data movement needed - GB_REALLOC (A->x, nzmax_new*asize, GB_void, &(A->x_size), &ok) ; + GB_REALLOC_MEMORY (A->x, nzmax_new, asize, &(A->x_size), &ok) ; } else { // allocate new space for A->x; use calloc to ensure all space // is initialized. - Ax_new = GB_CALLOC (nzmax_new*asize, GB_void, // x:OK:calloc - &Ax_new_size) ; + Ax_new = GB_CALLOC_MEMORY (nzmax_new, asize, &Ax_new_size) ; ok = (Ax_new != NULL) ; } } @@ -137,7 +131,8 @@ GrB_Info GB_resize // change the size of a matrix if (!in_place && A_is_bitmap) { // allocate new space for A->b - Ab_new = GB_MALLOC (nzmax_new*asize, int8_t, &Ab_new_size) ; + Ab_new = GB_MALLOC_MEMORY (nzmax_new, sizeof (int8_t), + &Ab_new_size) ; ok = ok && (Ab_new != NULL) ; } @@ -194,8 +189,9 @@ GrB_Info GB_resize // change the size of a matrix memcpy (pdest, psrc, vlen_new * asize) ; } } - GB_FREE (&Ax_old, A->x_size) ; + GB_FREE_MEMORY (&Ax_old, A->x_size) ; A->x = Ax_new ; A->x_size = Ax_new_size ; + Ax_new = NULL ; } //------------------------------------------------------------------ @@ -219,8 +215,9 @@ GrB_Info GB_resize // change the size of a matrix anvals += ab ; } A->nvals = anvals ; - GB_FREE (&Ab_old, A->b_size) ; + GB_FREE_MEMORY (&Ab_old, A->b_size) ; A->b = Ab_new ; A->b_size = Ab_new_size ; + Ab_new = NULL ; } } @@ -231,9 +228,8 @@ GrB_Info GB_resize // change the size of a matrix A->vdim = vdim_new ; A->vlen = vlen_new ; A->nvec = vdim_new ; - A->nvec_nonempty = (vlen_new == 0) ? 0 : vdim_new ; - ASSERT_MATRIX_OK (A, "A bitmap/full shrunk", GB0) ; - return (GrB_SUCCESS) ; +// A->nvec_nonempty = (vlen_new == 0) ? 0 : vdim_new ; + GB_nvec_nonempty_set (A, (vlen_new == 0) ? 0 : vdim_new) ; } else @@ -252,35 +248,32 @@ GrB_Info GB_resize // change the size of a matrix GB_hyper_hash_free (A) ; // resize the number of sparse vectors - int64_t *restrict Ah = A->h ; - int64_t *restrict Ap = A->p ; - A->vdim = vdim_new ; - - if (vdim_new < A->plen) - { - // reduce the size of A->p and A->h; this cannot fail - info = GB_hyper_realloc (A, vdim_new, Werk) ; - ASSERT (info == GrB_SUCCESS) ; - Ap = A->p ; - Ah = A->h ; - } - + GB_Ap_DECLARE (Ap, ) ; GB_Ap_PTR (Ap, A) ; if (vdim_new < vdim_old) { // descrease A->nvec to delete the vectors outside the range // 0...vdim_new-1. int64_t pleft = 0 ; int64_t pright = GB_IMIN (A->nvec, vdim_new) - 1 ; - bool found ; - GB_SPLIT_BINARY_SEARCH (vdim_new, Ah, pleft, pright, found) ; + GB_split_binary_search (vdim_new, A->h, A->j_is_32, + &pleft, &pright) ; A->nvec = pleft ; - A->nvals = Ap [A->nvec] ; + A->nvals = GB_IGET (Ap, A->nvec) ; // number of vectors is decreasing, need to count the new number of // non-empty vectors: done during pruning or by selector, below. - A->nvec_nonempty = -1 ; // recomputed just below + GB_nvec_nonempty_set (A, -1) ; // recomputed just below + } + + if (vdim_new < A->plen) + { + // reduce the size of A->p and A->h; this cannot fail + info = GB_hyper_realloc (A, vdim_new, Werk) ; + ASSERT (info == GrB_SUCCESS) ; } + ASSERT_MATRIX_OK (A, "A, hyperlist trimmed", GB0) ; + //---------------------------------------------------------------------- // resize the length of each vector //---------------------------------------------------------------------- @@ -288,26 +281,57 @@ GrB_Info GB_resize // change the size of a matrix // if vlen is shrinking, delete entries outside the new matrix if (vlen_new < vlen_old) { - struct GB_Scalar_opaque Thunk_header ; + // A = select (A), keeping entries in rows <= vlen_new-1 + struct GB_Scalar_opaque scalar_header ; int64_t k = vlen_new - 1 ; - GrB_Scalar Thunk = GB_Scalar_wrap (&Thunk_header, GrB_INT64, &k) ; - GB_OK (GB_selector (NULL, GrB_ROWLE, false, A, Thunk, Werk)) ; + GrB_Scalar scalar = GB_Scalar_wrap (&scalar_header, GrB_INT64, &k) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; + GB_OK (GB_selector (T, GrB_ROWLE, false, A, scalar, Werk)) ; + GB_OK (GB_transplant (A, A->type, &T, Werk)) ; } + ASSERT_MATRIX_OK (A, "A rows pruned", GB0) ; + GB_OK (GB_hyper_prune (A, Werk)) ; + //---------------------------------------------------------------------- - // vlen has been resized + // resize the matrix and the integers are valid for the new dimensions //---------------------------------------------------------------------- + ASSERT_MATRIX_OK (A, "A just before resize vlen, vdim", GB0) ; + + A->vdim = vdim_new ; A->vlen = vlen_new ; - ASSERT_MATRIX_OK (A, "A vlen resized", GB0) ; - //---------------------------------------------------------------------- - // conform the matrix to its desired sparsity structure - //---------------------------------------------------------------------- + // At this point, the dimesions just have been changed but the integers + // of Ap, Ah, and Ai have not. The integer sizes may be temporarily + // invalid. They will be valid after the call to GB_convert_int below. + + bool Ap_is_32_new, Aj_is_32_new, Ai_is_32_new ; + GB_determine_pji_is_32 (&Ap_is_32_new, &Aj_is_32_new, &Ai_is_32_new, + GB_sparsity (A), A->nvals, A->vlen, A->vdim, Werk) ; + + if (Ap_is_32_new != A->p_is_32 || + Aj_is_32_new != A->j_is_32 || + Ai_is_32_new != A->i_is_32) + { + // The matrix integers need to change. Do not validate the input + // matrix or the new settings since the existing dimensions may not + // be suitable with the existing integer sizes. They will be valid + // once the integer conversion is done. + GB_OK (GB_convert_int (A, Ap_is_32_new, Aj_is_32_new, Ai_is_32_new, + false)) ; + } - info = GB_conform (A, Werk) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, A->nvec_nonempty >= 0)) ; - return (info) ; + // The matrix and its integer sizes should now be valid. + ASSERT_MATRIX_OK (A, "A integers converted", GB0) ; } + + //-------------------------------------------------------------------------- + // conform the matrix to its desired sparsity structure + //-------------------------------------------------------------------------- + + GB_OK (GB_conform (A, Werk)) ; + ASSERT_MATRIX_OK (A, "A final resized", GB0) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/resize/GB_resize.h b/GraphBLAS/Source/resize/GB_resize.h index ab166e1cb4..a612aae8bf 100644 --- a/GraphBLAS/Source/resize/GB_resize.h +++ b/GraphBLAS/Source/resize/GB_resize.h @@ -2,7 +2,7 @@ // GB_resize.h: definitions for GB_resize //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,8 +13,8 @@ GrB_Info GB_resize // change the size of a matrix ( GrB_Matrix A, // matrix to modify - const GrB_Index nrows_new, // new number of rows in matrix - const GrB_Index ncols_new, // new number of columns in matrix + const uint64_t nrows_new, // new number of rows in matrix + const uint64_t ncols_new, // new number of columns in matrix GB_Werk Werk ) ; diff --git a/GraphBLAS/Source/resize/GrB_Matrix_resize.c b/GraphBLAS/Source/resize/GrB_Matrix_resize.c index 0663b0289e..f58a1c8ea8 100644 --- a/GraphBLAS/Source/resize/GrB_Matrix_resize.c +++ b/GraphBLAS/Source/resize/GrB_Matrix_resize.c @@ -2,7 +2,7 @@ // GrB_Matrix_resize: change the size of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,8 +13,8 @@ GrB_Info GrB_Matrix_resize // change the size of a matrix ( GrB_Matrix C, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix + uint64_t nrows_new, // new number of rows in matrix + uint64_t ncols_new // new number of columns in matrix ) { @@ -22,15 +22,16 @@ GrB_Info GrB_Matrix_resize // change the size of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GrB_Matrix_resize (C, nrows_new, ncols_new)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE1 (C, "GrB_Matrix_resize (C, nrows_new, ncols_new)") ; GB_BURBLE_START ("GrB_Matrix_resize") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; //-------------------------------------------------------------------------- // resize the matrix //-------------------------------------------------------------------------- - GrB_Info info = GB_resize (C, nrows_new, ncols_new, Werk) ; + info = GB_resize (C, nrows_new, ncols_new, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -46,8 +47,8 @@ GrB_Info GrB_Matrix_resize // change the size of a matrix GrB_Info GxB_Matrix_resize // change the size of a matrix ( GrB_Matrix A, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix + uint64_t nrows_new, // new number of rows in matrix + uint64_t ncols_new // new number of columns in matrix ) { return (GrB_Matrix_resize (A, nrows_new, ncols_new)) ; diff --git a/GraphBLAS/Source/resize/GrB_Vector_resize.c b/GraphBLAS/Source/resize/GrB_Vector_resize.c index 73df8a6389..e2f5777e61 100644 --- a/GraphBLAS/Source/resize/GrB_Vector_resize.c +++ b/GraphBLAS/Source/resize/GrB_Vector_resize.c @@ -2,7 +2,7 @@ // GrB_Vector_resize: change the size of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ GrB_Info GrB_Vector_resize // change the size of a vector ( GrB_Vector w, // vector to modify - GrB_Index nrows_new // new number of rows in vector + uint64_t nrows_new // new number of rows in vector ) { @@ -21,15 +21,16 @@ GrB_Info GrB_Vector_resize // change the size of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GrB_Vector_resize (w, nrows_new)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE1 (w, "GrB_Vector_resize (w, nrows_new)") ; GB_BURBLE_START ("GrB_Vector_resize") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; //-------------------------------------------------------------------------- // resize the vector //-------------------------------------------------------------------------- - GrB_Info info = GB_resize ((GrB_Matrix) w, nrows_new, 1, Werk) ; + info = GB_resize ((GrB_Matrix) w, nrows_new, 1, Werk) ; GB_BURBLE_END ; return (info) ; } @@ -45,7 +46,7 @@ GrB_Info GrB_Vector_resize // change the size of a vector GrB_Info GxB_Vector_resize // change the size of a vector ( GrB_Vector u, // vector to modify - GrB_Index nrows_new // new number of rows in vector + uint64_t nrows_new // new number of rows in vector ) { return (GrB_Vector_resize (u, nrows_new)) ; diff --git a/GraphBLAS/Source/scalar/GB_Scalar_wrap.c b/GraphBLAS/Source/scalar/GB_Scalar_wrap.c index 2aeb4eb434..b6436b7518 100644 --- a/GraphBLAS/Source/scalar/GB_Scalar_wrap.c +++ b/GraphBLAS/Source/scalar/GB_Scalar_wrap.c @@ -2,7 +2,7 @@ // GB_Scalar_wrap: wrap a C scalar inside a GraphBLAS scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -47,7 +47,8 @@ GrB_Scalar GB_Scalar_wrap // create a new GrB_Scalar with one entry s->vdim = 1 ; s->nvec = 1 ; - s->nvec_nonempty = 1 ; +// s->nvec_nonempty = 1 ; + GB_nvec_nonempty_set ((GrB_Matrix) s, 1) ; s->p = NULL ; s->p_size = 0 ; s->p_shallow = false ; s->h = NULL ; s->h_size = 0 ; s->h_shallow = false ; @@ -68,11 +69,13 @@ GrB_Scalar GB_Scalar_wrap // create a new GrB_Scalar with one entry s->bitmap_switch = 0.5 ; s->sparsity_control = GxB_FULL ; - s->static_header = true ; - s->is_csc = true ; s->jumbled = false ; - s->iso = true ; // OK: scalar wrap with a single entry + s->iso = true ; + + s->p_is_32 = false ; + s->j_is_32 = false ; + s->i_is_32 = false ; //-------------------------------------------------------------------------- // return result diff --git a/GraphBLAS/Source/scalar/GB_Scalar_wrap.h b/GraphBLAS/Source/scalar/GB_Scalar_wrap.h index 8a0ed4a9c0..fd87ea7724 100644 --- a/GraphBLAS/Source/scalar/GB_Scalar_wrap.h +++ b/GraphBLAS/Source/scalar/GB_Scalar_wrap.h @@ -2,7 +2,7 @@ // GB_Scalar_wrap.h: definitions for GB_Scalar_wrap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/scalar/GrB_Scalar_free.c b/GraphBLAS/Source/scalar/GrB_Scalar_free.c index 626a5281ed..44acff040e 100644 --- a/GraphBLAS/Source/scalar/GrB_Scalar_free.c +++ b/GraphBLAS/Source/scalar/GrB_Scalar_free.c @@ -2,13 +2,14 @@ // GrB_Scalar_free: free a sparse GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // free all the content of a GrB_Scalar. After GrB_Scalar_free (&s), s is set -// to NULL +// to NULL. The scalar may have readonly content; it is simply removed from s +// and not modified. #include "GB.h" diff --git a/GraphBLAS/Source/scalar/GrB_Scalar_new.c b/GraphBLAS/Source/scalar/GrB_Scalar_new.c index fc3895b776..206b9656fe 100644 --- a/GraphBLAS/Source/scalar/GrB_Scalar_new.c +++ b/GraphBLAS/Source/scalar/GrB_Scalar_new.c @@ -2,7 +2,7 @@ // GrB_Scalar_new: create a new GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,8 @@ #include "GB.h" +#define GB_FREE_ALL GB_Matrix_free ((GrB_Matrix *) s) + GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entries ( GrB_Scalar *s, // handle of GrB_Scalar to create @@ -23,7 +25,8 @@ GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entries // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Scalar_new (&s, type)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (s) ; (*s) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; @@ -32,13 +35,16 @@ GrB_Info GrB_Scalar_new // create a new GrB_Scalar with no entries // create the GrB_Scalar //-------------------------------------------------------------------------- - GrB_Info info ; + // determine the p_is_32, j_is_32, and i_is_32 settings for the new scalar + bool Sp_is_32, Sj_is_32, Si_is_32 ; + GB_determine_pji_is_32 (&Sp_is_32, &Sj_is_32, &Si_is_32, + GxB_SPARSE, 1, 1, 1, NULL) ; + + GB_OK (GB_new ((GrB_Matrix *) s, // new user header + type, 1, 1, GB_ph_calloc, true, GxB_SPARSE, + GB_Global_hyper_switch_get ( ), 1, Sp_is_32, Sj_is_32, Si_is_32)) ; - info = GB_new ((GrB_Matrix *) s, // new user header - type, 1, 1, GB_Ap_calloc, true, GxB_SPARSE, - GB_Global_hyper_switch_get ( ), 1) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, GB_SCALAR_OK (*s))) ; - return (info) ; + return (GrB_SUCCESS) ; } //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/select/GB_select.c b/GraphBLAS/Source/select/GB_select.c index 278821dfc0..134c1f053b 100644 --- a/GraphBLAS/Source/select/GB_select.c +++ b/GraphBLAS/Source/select/GB_select.c @@ -2,7 +2,7 @@ // GB_select: apply a select operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,9 +41,10 @@ GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) // C may be aliased with M and/or A + GrB_Info info ; GrB_IndexUnaryOp op = op_in ; GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; - GB_RETURN_IF_NULL_OR_FAULTY (Thunk) ; + GB_RETURN_IF_NULL_OR_INVALID (Thunk) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; ASSERT_MATRIX_OK (C, "C input for GB_select", GB0) ; @@ -57,7 +58,6 @@ GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) GrB_Matrix T = NULL ; // check domains and dimensions for C = accum (C,T) - GrB_Info info ; GB_OK (GB_compatible (C->type, C, M, Mask_struct, accum, A->type, Werk)); GB_Type_code xcode = (op->xtype == NULL) ? GB_ignore_code : op->xtype->code; @@ -367,7 +367,7 @@ GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) // create T //-------------------------------------------------------------------------- - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; if (make_copy) { @@ -376,10 +376,16 @@ GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) } else if (is_empty) { + // get the integer sizes for the new empty matrix T + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_SPARSE, 0, A->vlen, A->vdim, Werk) ; + // T is an empty non-iso matrix GB_OK (GB_new (&T, // auto (sparse or hyper), existing header - A->type, A->vlen, A->vdim, GB_Ap_calloc, A_csc, - GxB_SPARSE + GxB_HYPERSPARSE, GB_Global_hyper_switch_get ( ), 1)) ; + A->type, A->vlen, A->vdim, GB_ph_calloc, A_csc, + GxB_SPARSE + GxB_HYPERSPARSE, GB_Global_hyper_switch_get ( ), 1, + Cp_is_32, Cj_is_32, Ci_is_32)) ; } else { @@ -389,7 +395,6 @@ GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) T->is_csc = A_csc ; ASSERT_MATRIX_OK (T, "T=select(A,Thunk) output", GB0) ; - ASSERT_MATRIX_OK (C, "C for accum; T=select(A,Thunk) output", GB0) ; //-------------------------------------------------------------------------- // C = accum (C,T): accumulate the results into C via the mask diff --git a/GraphBLAS/Source/select/GB_select.h b/GraphBLAS/Source/select/GB_select.h index 2492682c72..07fd941ac6 100644 --- a/GraphBLAS/Source/select/GB_select.h +++ b/GraphBLAS/Source/select/GB_select.h @@ -2,7 +2,7 @@ // GB_select.h: definitions for GrB_select and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,7 @@ #define GB_SELECT_H #include "GB.h" #include "math/GB_math.h" +#include "select/GB_select_iso.h" GrB_Info GB_select // C = accum (C, select(A,k)) or select(A',k) ( @@ -39,14 +40,14 @@ GrB_Info GB_selector GrB_Info GB_select_sparse ( - GrB_Matrix C, - const bool C_iso, + GrB_Matrix C, // output matrix; empty header on input + const bool C_iso, // if true, construct C as iso const GrB_IndexUnaryOp op, - const bool flipij, - const GrB_Matrix A, - const int64_t ithunk, - const GB_void *restrict athunk, - const GB_void *restrict ythunk, + const bool flipij, // if true, flip i and j for the op + const GrB_Matrix A, // input matrix + const int64_t ithunk, // input scalar, cast to int64_t + const GB_void *restrict athunk, // same input scalar, but cast to A->type + const GB_void *restrict ythunk, // same input scalar, but cast to op->ytype GB_Werk Werk ) ; @@ -64,7 +65,6 @@ GrB_Info GB_select_value_iso GrB_Info GB_select_column ( GrB_Matrix C, - const bool C_iso, const GrB_IndexUnaryOp op, GrB_Matrix A, int64_t ithunk, @@ -98,9 +98,11 @@ GrB_Info GB_selectop_to_idxunop GrB_Info GB_select_generic_phase1 ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + // input/output: + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, + // input: const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -112,10 +114,10 @@ GrB_Info GB_select_generic_phase1 GrB_Info GB_select_generic_phase2 ( - int64_t *restrict Ci, - GB_void *restrict Cx, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + // input/output: + GrB_Matrix C, + // input: + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -127,10 +129,13 @@ GrB_Info GB_select_generic_phase2 GrB_Info GB_select_positional_phase1 ( - int64_t *restrict Zp, - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + // input/output: + GrB_Matrix C, + // output: + void *Zp, // if C->p_is_32: 32 bit, else 64-bit + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, + // input: const GrB_Matrix A, const int64_t ithunk, const GrB_IndexUnaryOp op, @@ -141,11 +146,11 @@ GrB_Info GB_select_positional_phase1 GrB_Info GB_select_positional_phase2 ( - int64_t *restrict Ci, - GB_void *restrict Cx, - const int64_t *restrict Zp, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + // input/output: + GrB_Matrix C, + // input: + const void *Zp, // if C->p_is_32: 32 bit, else 64-bit + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const int64_t ithunk, @@ -157,8 +162,9 @@ GrB_Info GB_select_positional_phase2 GrB_Info GB_select_positional_bitmap ( - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed + // input: GrB_Matrix A, const int64_t ithunk, const GrB_IndexUnaryOp op, @@ -167,8 +173,9 @@ GrB_Info GB_select_positional_bitmap GrB_Info GB_select_generic_bitmap ( - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed + // input: GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -176,38 +183,5 @@ GrB_Info GB_select_generic_bitmap const int nthreads ) ; -//------------------------------------------------------------------------------ -// GB_select_iso: assign the iso value of C for GB_*selector -//------------------------------------------------------------------------------ - -static inline void GB_select_iso -( - GB_void *Cx, // output iso value (same type as A) - const GB_Opcode opcode, // selector opcode - const GB_void *athunk, // thunk scalar, of size asize - const GB_void *Ax, // Ax [0] scalar, of size asize - const size_t asize -) -{ - if (opcode == GB_VALUEEQ_idxunop_code) - { - // all entries in C are equal to thunk - memcpy (Cx, athunk, asize) ; - } - else - { - // A and C are both iso - memcpy (Cx, Ax, asize) ; - } -} - -//------------------------------------------------------------------------------ -// compiler diagnostics -//------------------------------------------------------------------------------ - -// Some parameters are unused for some uses of the FactoryKernels/GB_sel_* -// functions -#include "include/GB_unused.h" - #endif diff --git a/GraphBLAS/Source/select/GB_select_bitmap.c b/GraphBLAS/Source/select/GB_select_bitmap.c index ab6ead7e77..0f38cff73f 100644 --- a/GraphBLAS/Source/select/GB_select_bitmap.c +++ b/GraphBLAS/Source/select/GB_select_bitmap.c @@ -2,7 +2,7 @@ // GB_select_bitmap: select entries from a bitmap or full matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ GrB_Info GB_select_bitmap ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; GB_Opcode opcode = op->opcode ; ASSERT (opcode != GB_NONZOMBIE_idxunop_code) ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; //-------------------------------------------------------------------------- // get A @@ -55,11 +55,12 @@ GrB_Info GB_select_bitmap //-------------------------------------------------------------------------- // C->b and C->x are malloc'd, not calloc'd - // set C->iso = C_iso OK GB_OK (GB_new_bix (&C, // always bitmap, existing header - A->type, A->vlen, A->vdim, GB_Ap_calloc, true, - GxB_BITMAP, false, A->hyper_switch, -1, anz, true, C_iso)) ; - int64_t cnvals ; + A->type, A->vlen, A->vdim, GB_ph_calloc, true, + GxB_BITMAP, false, A->hyper_switch, -1, anz, true, C_iso, + /* OK: */ false, false, false)) ; + + ASSERT (GxB_BITMAP == GB_sparsity (C)) ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -98,8 +99,7 @@ GrB_Info GB_select_bitmap #if defined ( GRAPHBLAS_HAS_CUDA ) if (GB_cuda_select_branch (A, op)) { - info = GB_cuda_select_bitmap (C->b, &cnvals, C_iso, A, flipij, ythunk, - op) ; + info = GB_cuda_select_bitmap (C, A, flipij, ythunk, op) ; } #endif @@ -112,8 +112,7 @@ GrB_Info GB_select_bitmap // bitmap selector for positional ops //------------------------------------------------------------------ - info = GB_select_positional_bitmap (C->b, &cnvals, A, ithunk, op, - nthreads) ; + info = GB_select_positional_bitmap (C, A, ithunk, op, nthreads) ; } else { @@ -132,11 +131,10 @@ GrB_Info GB_select_bitmap #define GB_selbit(opname,aname) \ GB (_sel_bitmap_ ## opname ## aname) - #define GB_SEL_WORKER(opname,aname) \ - { \ - info = GB_selbit (opname, aname) (C->b, &cnvals, A, \ - ythunk, nthreads) ; \ - } \ + #define GB_SEL_WORKER(opname,aname) \ + { \ + info = GB_selbit (opname, aname) (C, A, ythunk, nthreads) ;\ + } \ break ; #include "select/factory/GB_select_entry_factory.c" @@ -149,8 +147,8 @@ GrB_Info GB_select_bitmap if (info == GrB_NO_VALUE) { - info = GB_select_bitmap_jit (C->b, &cnvals, C_iso, - A, flipij, ythunk, op, nthreads) ; + info = GB_select_bitmap_jit (C, A, flipij, ythunk, op, + nthreads) ; } //------------------------------------------------------------------ @@ -160,8 +158,8 @@ GrB_Info GB_select_bitmap if (info == GrB_NO_VALUE) { GBURBLE ("(generic select) ") ; - info = GB_select_generic_bitmap (C->b, &cnvals, A, flipij, - ythunk, op, nthreads) ; + info = GB_select_generic_bitmap (C, A, flipij, ythunk, op, + nthreads) ; } } } @@ -170,14 +168,7 @@ GrB_Info GB_select_bitmap // return result //-------------------------------------------------------------------------- - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } - - C->nvals = cnvals ; + GB_OK (info) ; // check for out-of-memory, or other error C->magic = GB_MAGIC ; ASSERT_MATRIX_OK (C, "C from bitmap selector", GB0) ; return (GrB_SUCCESS) ; diff --git a/GraphBLAS/Source/select/GB_select_column.c b/GraphBLAS/Source/select/GB_select_column.c index 18a8d608b7..b832610b55 100644 --- a/GraphBLAS/Source/select/GB_select_column.c +++ b/GraphBLAS/Source/select/GB_select_column.c @@ -2,12 +2,13 @@ // GB_select_column: apply a select COL* operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // The column selectors can be done in a single pass. +// C->iso and A->iso are identical. #include "select/GB_select.h" #include "transpose/GB_transpose.h" @@ -21,7 +22,6 @@ GrB_Info GB_select_column ( GrB_Matrix C, - const bool C_iso, const GrB_IndexUnaryOp op, GrB_Matrix A, int64_t ithunk, @@ -35,23 +35,25 @@ GrB_Info GB_select_column GrB_Info info ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for GB_select_column", GB0) ; - ASSERT_MATRIX_OK (A, "A for select column", GB_ZOMBIE (GB0)) ; + ASSERT_MATRIX_OK (A, "A for select column", GB0_Z) ; GB_Opcode opcode = op->opcode ; ASSERT (opcode == GB_COLINDEX_idxunop_code || opcode == GB_COLLE_idxunop_code || opcode == GB_COLGT_idxunop_code) ; ASSERT (!GB_IS_BITMAP (A)) ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT (GB_JUMBLED_OK (A)) ; + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; //-------------------------------------------------------------------------- // get A //-------------------------------------------------------------------------- - int64_t *restrict Ap = A->p ; size_t Ap_size = A->p_size ; - int64_t *restrict Ah = A->h ; - int64_t *restrict Ai = A->i ; size_t Ai_size = A->i_size ; - GB_void *restrict Ax = (GB_void *) A->x ; size_t Ax_size = A->x_size ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + + const GB_void *restrict Ax = (GB_void *) A->x ; int64_t anvec = A->nvec ; bool A_jumbled = A->jumbled ; bool A_is_hyper = (Ah != NULL) ; @@ -60,6 +62,10 @@ GrB_Info GB_select_column const bool A_iso = A->iso ; const size_t asize = A->type->size ; + GB_Type_code Ap_code = A->p_is_32 ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code Ah_code = A->j_is_32 ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code Ai_code = A->i_is_32 ? GB_INT32_code : GB_INT64_code ; + //-------------------------------------------------------------------------- // determine number of threads to use //-------------------------------------------------------------------------- @@ -93,7 +99,7 @@ GrB_Info GB_select_column // find the column j in the hyperlist of A // future:: use hyper_hash if present int64_t kright = anvec-1 ; - GB_SPLIT_BINARY_SEARCH (j, Ah, k, kright, found) ; + found = GB_split_binary_search (j, Ah, A->j_is_32, &k, &kright) ; // if found is true the Ah [k] == j // if found is false, then Ah [0..k-1] < j and Ah [k..anvec-1] > j } @@ -108,11 +114,12 @@ GrB_Info GB_select_column // determine the # of entries and # of vectors in C //-------------------------------------------------------------------------- - int64_t pstart = Ap [k] ; - int64_t pend = found ? Ap [k+1] : pstart ; + int64_t pstart = GB_IGET (Ap, k) ; + int64_t pend = found ? GB_IGET (Ap, k+1) : pstart ; int64_t ajnz = pend - pstart ; int64_t cnz, cnvec ; - int64_t anz = Ap [anvec] ; + int64_t anz = A->nvals ; + ASSERT (A->nvals == GB_IGET (Ap, anvec)) ; if (opcode == GB_COLINDEX_idxunop_code) { @@ -133,6 +140,11 @@ GrB_Info GB_select_column cnvec = anvec - ((A_is_hyper) ? (found ? (k+1) : k) : 0) ; } + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, cnz, avlen, avdim, Werk) ; + if (cnz == anz) { // C is the same as A: return it a pure shallow copy @@ -142,8 +154,9 @@ GrB_Info GB_select_column { // return C as empty return (GB_new (&C, // auto (sparse or hyper), existing header - A->type, avlen, avdim, GB_Ap_calloc, true, - GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 1)) ; + A->type, avlen, avdim, GB_ph_calloc, true, + GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 1, + Cp_is_32, Cj_is_32, Ci_is_32)) ; } //-------------------------------------------------------------------------- @@ -152,15 +165,30 @@ GrB_Info GB_select_column int csparsity = (A_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE ; GB_OK (GB_new_bix (&C, // sparse or hyper (from A), existing header - A->type, avlen, avdim, GB_Ap_malloc, true, csparsity, false, - A->hyper_switch, cnvec, cnz, true, A_iso)) ; + A->type, avlen, avdim, GB_ph_malloc, true, csparsity, false, + A->hyper_switch, cnvec, cnz, true, A_iso, + Cp_is_32, Cj_is_32, Ci_is_32)) ; + + ASSERT (Cp_is_32 == C->p_is_32) ; + ASSERT (Cj_is_32 == C->j_is_32) ; + ASSERT (Ci_is_32 == C->i_is_32) ; + + Cp_is_32 = C->p_is_32 ; + Cj_is_32 = C->j_is_32 ; + Ci_is_32 = C->i_is_32 ; ASSERT (info == GrB_SUCCESS) ; int nth2 = GB_nthreads (cnvec, chunk, nth) ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, ) ; GB_Ch_PTR (Ch, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + + GB_Type_code Cp_code = Cp_is_32 ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code Ch_code = Cj_is_32 ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code Ci_code = Ci_is_32 ? GB_INT32_code : GB_INT64_code ; + size_t cpsize = Cp_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + GB_void *restrict Cx = (GB_void *) C->x ; int64_t kk ; @@ -184,39 +212,55 @@ GrB_Info GB_select_column if (A_is_hyper) { ASSERT (found) ; + // Cp [0:k-1] = Ap [0:k-1] - GB_memcpy (Cp, Ap, k * sizeof (int64_t), nth) ; + GB_cast_int (Cp, Cp_code, Ap, Ap_code, k, nth) ; + // Cp [k:cnvec] = Ap [k+1:anvec] - ajnz #pragma omp parallel for num_threads(nth2) for (kk = k ; kk <= cnvec ; kk++) { - Cp [kk] = Ap [kk+1] - ajnz ; + // Cp [kk] = Ap [kk+1] - ajnz ; + int64_t p = GB_IGET (Ap, kk+1) - ajnz ; + GB_ISET (Cp, kk, p) ; } + // Ch [0:k-1] = Ah [0:k-1] - GB_memcpy (Ch, Ah, k * sizeof (int64_t), nth) ; + GB_cast_int (Ch, Ch_code, Ah, Ah_code, k, nth) ; + // Ch [k:cnvec-1] = Ah [k+1:anvec-1] - GB_memcpy (Ch + k, Ah + (k+1), (cnvec-k) * sizeof (int64_t), nth) ; + GB_cast_int (GB_IADDR (Ch, k ), Ch_code, + GB_IADDR (Ah, k+1), Ah_code, cnvec - k, nth) ; + } else { + // Cp [0:k] = Ap [0:k] - GB_memcpy (Cp, Ap, (k+1) * sizeof (int64_t), nth) ; + GB_cast_int (Cp, Cp_code, Ap, Ap_code, k+1, nth) ; + // Cp [k+1:anvec] = Ap [k+1:anvec] - ajnz #pragma omp parallel for num_threads(nth2) for (kk = k+1 ; kk <= cnvec ; kk++) { - Cp [kk] = Ap [kk] - ajnz ; + // Cp [kk] = Ap [kk] - ajnz ; + int64_t p = GB_IGET (Ap, kk) - ajnz ; + GB_ISET (Cp, kk, p) ; } } + // Ci [0:pstart-1] = Ai [0:pstart-1] - GB_memcpy (Ci, Ai, pstart * sizeof (int64_t), nth) ; + GB_cast_int (Ci, Ci_code, Ai, Ai_code, pstart, nth) ; + // Ci [pstart:cnz-1] = Ai [pend:anz-1] - GB_memcpy (Ci + pstart, Ai + pend, - (cnz - pstart) * sizeof (int64_t), nth) ; + GB_cast_int (GB_IADDR (Ci, pstart), Ci_code, + GB_IADDR (Ai, pend ), Ai_code, cnz - pstart, nth) ; + if (!A_iso) { // Cx [0:pstart-1] = Ax [0:pstart-1] GB_memcpy (Cx, Ax, pstart * asize, nth) ; + // Cx [pstart:cnz-1] = Ax [pend:anz-1] GB_memcpy (Cx + pstart * asize, Ax + pend * asize, (cnz - pstart) * asize, nth) ; @@ -233,24 +277,29 @@ GrB_Info GB_select_column if (A_is_hyper) { // Cp [0:cnvec] = Ap [0:cnvec] - GB_memcpy (Cp, Ap, (cnvec+1) * sizeof (int64_t), nth) ; + GB_cast_int (Cp, Cp_code, Ap, Ap_code, cnvec+1, nth) ; + // Ch [0:cnvec-1] = Ah [0:cnvec-1] - GB_memcpy (Ch, Ah, (cnvec) * sizeof (int64_t), nth) ; + GB_cast_int (Ch, Ch_code, Ah, Ah_code, cnvec, nth) ; } else { // Cp [0:k+1] = Ap [0:k+1] ASSERT (found) ; - GB_memcpy (Cp, Ap, (k+2) * sizeof (int64_t), nth) ; + GB_cast_int (Cp, Cp_code, Ap, Ap_code, k+2, nth) ; + // Cp [k+2:cnvec] = cnz #pragma omp parallel for num_threads(nth2) for (kk = k+2 ; kk <= cnvec ; kk++) { - Cp [kk] = cnz ; + // Cp [kk] = cnz ; + GB_ISET (Cp, kk, cnz) ; } } + // Ci [0:cnz-1] = Ai [0:cnz-1] - GB_memcpy (Ci, Ai, cnz * sizeof (int64_t), nth) ; + GB_cast_int (Ci, Ci_code, Ai, Ai_code, cnz, nth) ; + if (!A_iso) { // Cx [0:cnz-1] = Ax [0:cnz-1] @@ -271,25 +320,37 @@ GrB_Info GB_select_column #pragma omp parallel for num_threads(nth2) for (kk = 0 ; kk <= cnvec ; kk++) { - Cp [kk] = Ap [kk + k + found] - pend ; + // Cp [kk] = Ap [kk + k + found] - pend ; + int64_t p = GB_IGET (Ap, kk + k + found) - pend ; + GB_ISET (Cp, kk, p) ; } + // Ch [0:cnvec-1] = Ah [k+found:anvec-1] - GB_memcpy (Ch, Ah + k + found, cnvec * sizeof (int64_t), nth) ; + GB_cast_int (Ch, Ch_code, GB_IADDR (Ah, k+found), Ah_code, + cnvec, nth) ; + } else { + ASSERT (found) ; + // Cp [0:k] = 0 - GB_memset (Cp, 0, (k+1) * sizeof (int64_t), nth) ; + GB_memset (Cp, 0, (k+1) * cpsize, nth) ; + // Cp [k+1:cnvec] = Ap [k+1:cnvec] - pend #pragma omp parallel for num_threads(nth2) for (kk = k+1 ; kk <= cnvec ; kk++) { - Cp [kk] = Ap [kk] - pend ; + // Cp [kk] = Ap [kk] - pend ; + int64_t p = GB_IGET (Ap, kk) - pend ; + GB_ISET (Cp, kk, p) ; } } + // Ci [0:cnz-1] = Ai [pend:anz-1] - GB_memcpy (Ci, Ai + pend, cnz * sizeof (int64_t), nth) ; + GB_cast_int (Ci, Ci_code, GB_IADDR (Ai, pend), Ai_code, cnz, nth) ; + if (!A_iso) { // Cx [0:cnz-1] = Ax [pend:anz-1] @@ -304,9 +365,8 @@ GrB_Info GB_select_column C->nvec = cnvec ; C->magic = GB_MAGIC ; C->jumbled = A_jumbled ; // C is jumbled if A is jumbled - C->iso = C_iso ; // OK: burble already done above - C->nvals = Cp [cnvec] ; - C->nvec_nonempty = GB_nvec_nonempty (C) ; + C->nvals = GB_IGET (Cp, cnvec) ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty (C)) ; ASSERT_MATRIX_OK (C, "C output for GB_select_column", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/select/GB_select_generic_bitmap.c b/GraphBLAS/Source/select/GB_select_generic_bitmap.c index a0844c8fa2..7e7a999809 100644 --- a/GraphBLAS/Source/select/GB_select_generic_bitmap.c +++ b/GraphBLAS/Source/select/GB_select_generic_bitmap.c @@ -2,7 +2,7 @@ // GB_select_generic_bitmap.c: C=select(A,thunk) when C is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,13 @@ // A is bitmap or full, C is bitmap #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_generic_bitmap ( - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed + // input: GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -28,14 +29,14 @@ GrB_Info GB_select_generic_bitmap // check inputs //-------------------------------------------------------------------------- - GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; - ASSERT (GB_IS_INDEXUNARYOP_CODE (opcode)) ; - ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; - ASSERT (!(A->iso) || (opcode == GB_USER_idxunop_code)) ; - ASSERT ((opcode >= GB_VALUENE_idxunop_code && - opcode <= GB_VALUELE_idxunop_code) || - (opcode == GB_USER_idxunop_code)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE (op->opcode)) ; + ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (op->opcode)) ; + ASSERT (!(A->iso) || (op->opcode == GB_USER_idxunop_code)) ; + ASSERT ((op->opcode >= GB_VALUENE_idxunop_code && + op->opcode <= GB_VALUELE_idxunop_code) || + (op->opcode == GB_USER_idxunop_code)) ; + ASSERT (GB_IS_BITMAP (C)) ; //-------------------------------------------------------------------------- // generic entry selector when C is bitmap diff --git a/GraphBLAS/Source/select/GB_select_generic_phase1.c b/GraphBLAS/Source/select/GB_select_generic_phase1.c index 285553fe76..e7424b7614 100644 --- a/GraphBLAS/Source/select/GB_select_generic_phase1.c +++ b/GraphBLAS/Source/select/GB_select_generic_phase1.c @@ -2,22 +2,21 @@ // GB_select_generic_phase1.c: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// A is sparse, hypersparse, or full, and the op is not positional. -// C is sparse or hypersparse. +// A and C are sparse or hypersparse #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_generic_phase1 ( - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + GrB_Matrix C, + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, diff --git a/GraphBLAS/Source/select/GB_select_generic_phase2.c b/GraphBLAS/Source/select/GB_select_generic_phase2.c index ada068c3b0..e3b9e9564e 100644 --- a/GraphBLAS/Source/select/GB_select_generic_phase2.c +++ b/GraphBLAS/Source/select/GB_select_generic_phase2.c @@ -2,7 +2,7 @@ // GB_select_generic_phase2.c: C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,14 +11,14 @@ // C is sparse or hypersparse. #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_generic_phase2 ( - int64_t *restrict Ci, - GB_void *restrict Cx, // NULL if C is iso-valued - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + // input/output: + GrB_Matrix C, + // input: + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const GB_void *restrict ythunk, @@ -35,8 +35,7 @@ GrB_Info GB_select_generic_phase2 // The op is either valued, user-defined, or nonzombie. If it is the // nonzombie op, then A is not iso. For the VALUEEQ* operators, C is - // always iso even if A is not iso. In that case, Cx is passed here as - // NULL. + // always iso even if A is not iso. GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; @@ -127,10 +126,10 @@ GrB_Info GB_select_generic_phase2 //---------------------------------------------------------------------- // Cx [pC] = Ax [pA], no typecast - // If Cx is NULL then C is iso-valued. + bool C_iso = C->iso ; #undef GB_SELECT_ENTRY #define GB_SELECT_ENTRY(Cx,pC,Ax,pA) \ - if (Cx != NULL) \ + if (!C_iso) \ { \ memcpy (Cx +((pC)*asize), Ax +((pA)*asize), asize) ; \ } diff --git a/GraphBLAS/Source/select/GB_select_iso.h b/GraphBLAS/Source/select/GB_select_iso.h new file mode 100644 index 0000000000..337bc99316 --- /dev/null +++ b/GraphBLAS/Source/select/GB_select_iso.h @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// GB_select_iso.h: copy the iso value into C for select methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_SELECT_ISO_H +#define GB_SELECT_ISO_H + +//------------------------------------------------------------------------------ +// GB_select_iso: assign the iso value of C for GB_*selector +//------------------------------------------------------------------------------ + +static inline void GB_select_iso +( + GB_void *Cx, // output iso value (same type as A) + const GB_Opcode opcode, // selector opcode + const GB_void *athunk, // thunk scalar, of size asize + const GB_void *Ax, // Ax [0] scalar, of size asize + const size_t asize +) +{ + if (opcode == GB_VALUEEQ_idxunop_code) + { + // all entries in C are equal to thunk + memcpy (Cx, athunk, asize) ; + } + else + { + // A and C are both iso + memcpy (Cx, Ax, asize) ; + } +} + +#endif + diff --git a/GraphBLAS/Source/select/GB_select_positional_bitmap.c b/GraphBLAS/Source/select/GB_select_positional_bitmap.c index 2038e77a63..5b201ea9b0 100644 --- a/GraphBLAS/Source/select/GB_select_positional_bitmap.c +++ b/GraphBLAS/Source/select/GB_select_positional_bitmap.c @@ -2,7 +2,7 @@ // GB_select_positional_bitmap: C=select(A,thunk) when C is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,13 @@ // A is bitmap or as-if-full. C is bitmap #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_positional_bitmap ( - int8_t *Cb, - int64_t *cnvals_handle, + // input/output: + GrB_Matrix C, // C->b and C->nvals are computed + // input: GrB_Matrix A, const int64_t ithunk, const GrB_IndexUnaryOp op, @@ -30,6 +31,7 @@ GrB_Info GB_select_positional_bitmap GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; + ASSERT (GB_IS_BITMAP (C)) ; //-------------------------------------------------------------------------- // positional operators when C is bitmap diff --git a/GraphBLAS/Source/select/GB_select_positional_phase1.c b/GraphBLAS/Source/select/GB_select_positional_phase1.c index f53797b23b..7a972461b0 100644 --- a/GraphBLAS/Source/select/GB_select_positional_phase1.c +++ b/GraphBLAS/Source/select/GB_select_positional_phase1.c @@ -2,24 +2,27 @@ // GB_select_positional_phase1: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// A is sparse or hypersparse +// A is sparse or hypersparse, or can be full if the op is DIAG // JIT: not need: use factory; 3 variants (A sparse, hyper, or full for DIAG) #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_positional_phase1 ( - int64_t *restrict Zp, - int64_t *restrict Cp, - int64_t *restrict Wfirst, - int64_t *restrict Wlast, + // input/output: + GrB_Matrix C, + // output: + void *Zp, // if C->p_is_32: 32 bit, else 64-bit + uint64_t *restrict Wfirst, + uint64_t *restrict Wlast, + // input: const GrB_Matrix A, const int64_t ithunk, const GrB_IndexUnaryOp op, @@ -39,6 +42,28 @@ GrB_Info GB_select_positional_phase1 ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || opcode == GB_NONZOMBIE_idxunop_code) ; ASSERT (!GB_IS_BITMAP (A)) ; + ASSERT (GB_IMPLIES (opcode != GB_NONZOMBIE_idxunop_code, !GB_JUMBLED (A))) ; + ASSERT (GB_IMPLIES (opcode == GB_NONZOMBIE_idxunop_code, GB_JUMBLED_OK(A))); + + //-------------------------------------------------------------------------- + // get A, C, and the slicing of A + //-------------------------------------------------------------------------- + + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; + const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const bool Ai_is_32 = A->i_is_32 ; + + int64_t avlen = A->vlen ; + int64_t anvec = A->nvec ; + + GB_IDECL (Zp, , u) ; GB_IPTR (Zp, C->p_is_32) ; //-------------------------------------------------------------------------- // phase1: positional operators and nonzombie selector diff --git a/GraphBLAS/Source/select/GB_select_positional_phase2.c b/GraphBLAS/Source/select/GB_select_positional_phase2.c index f686c1f441..625f7dd455 100644 --- a/GraphBLAS/Source/select/GB_select_positional_phase2.c +++ b/GraphBLAS/Source/select/GB_select_positional_phase2.c @@ -2,7 +2,7 @@ // GB_select_positional_phase2.c: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,15 +12,15 @@ // JIT: not need: use factory; 3 variants (A sparse, hyper, or full for DIAG) #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" +#include "include/GB_unused.h" GrB_Info GB_select_positional_phase2 ( - int64_t *restrict Ci, - GB_void *restrict Cx, - const int64_t *restrict Zp, - const int64_t *restrict Cp, - const int64_t *restrict Cp_kfirst, + // input/output: + GrB_Matrix C, + // input: + const void *Zp, // if C->p_is_32: 32 bit, else 64-bit + const uint64_t *restrict Cp_kfirst, const GrB_Matrix A, const bool flipij, const int64_t ithunk, @@ -40,11 +40,14 @@ GrB_Info GB_select_positional_phase2 (opcode == GB_DIAG_idxunop_code)) ; ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || (opcode == GB_NONZOMBIE_idxunop_code && A->iso)) ; + ASSERT (!GB_IS_BITMAP (A)) ; //-------------------------------------------------------------------------- // phase1: positional operators and nonzombie iso selector //-------------------------------------------------------------------------- + GB_IDECL (Zp, const, u) ; GB_IPTR (Zp, C->p_is_32) ; + #define GB_A_TYPE GB_void #include "select/include/GB_select_shared_definitions.h" diff --git a/GraphBLAS/Source/select/GB_select_sparse.c b/GraphBLAS/Source/select/GB_select_sparse.c index 56a1ab77ce..b26998511b 100644 --- a/GraphBLAS/Source/select/GB_select_sparse.c +++ b/GraphBLAS/Source/select/GB_select_sparse.c @@ -2,28 +2,24 @@ // GB_select_sparse: select entries from a matrix (C is sparse/hypersparse) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "select/GB_select.h" -#include "slice/GB_ek_slice.h" #ifndef GBCOMPACT #include "FactoryKernels/GB_sel__include.h" #endif #include "scalar/GB_Scalar_wrap.h" #include "jitifyer/GB_stringify.h" +#include "slice/factory/GB_ek_slice_merge.h" #define GB_FREE_WORKSPACE \ { \ - GB_FREE_WORK (&Zp, Zp_size) ; \ - GB_WERK_POP (Work, int64_t) ; \ + GB_FREE_MEMORY (&Zp, Zp_size) ; \ + GB_WERK_POP (Work, uint64_t) ; \ GB_WERK_POP (A_ek_slicing, int64_t) ; \ - GB_FREE (&Cp, Cp_size) ; \ - GB_FREE (&Ch, Ch_size) ; \ - GB_FREE (&Ci, Ci_size) ; \ - GB_FREE (&Cx, Cx_size) ; \ } #define GB_FREE_ALL \ @@ -34,39 +30,45 @@ GrB_Info GB_select_sparse ( - GrB_Matrix C, - const bool C_iso, + GrB_Matrix C, // output matrix; empty header on input + const bool C_iso, // if true, construct C as iso const GrB_IndexUnaryOp op, - const bool flipij, - const GrB_Matrix A, - const int64_t ithunk, - const GB_void *restrict athunk, - const GB_void *restrict ythunk, + const bool flipij, // if true, flip i and j for the op + const GrB_Matrix A, // input matrix + const int64_t ithunk, // input scalar, cast to int64_t + const GB_void *restrict athunk, // same input scalar, but cast to A->type + const GB_void *restrict ythunk, // same input scalar, but cast to op->ytype GB_Werk Werk ) { + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + // C is always an empty header on input. A is never bitmap. It is + // sparse/hypersparse, with one exception: for the DIAG operator, A may be + // sparse, hypersparse, or full. + + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; + ASSERT_MATRIX_OK (A, "A input for GB_select_sparse", GB0) ; + ASSERT_INDEXUNARYOP_OK (op, "op for GB_select_sparse", GB0) ; + ASSERT (!GB_IS_BITMAP (A)) ; + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A) || GB_IS_FULL (A)) ; + ASSERT (GB_IMPLIES (op->opcode != GB_DIAG_idxunop_code, + GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A))) ; + //-------------------------------------------------------------------------- // declare workspace //-------------------------------------------------------------------------- GrB_Info info ; - int64_t *restrict Zp = NULL ; size_t Zp_size = 0 ; - GB_WERK_DECLARE (Work, int64_t) ; - int64_t *restrict Wfirst = NULL ; - int64_t *restrict Wlast = NULL ; - int64_t *restrict Cp_kfirst = NULL ; + void *Zp = NULL ; size_t Zp_size = 0 ; + GB_WERK_DECLARE (Work, uint64_t) ; GB_WERK_DECLARE (A_ek_slicing, int64_t) ; - int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; - int64_t *restrict Ch = NULL ; size_t Ch_size = 0 ; - int64_t *restrict Ci = NULL ; size_t Ci_size = 0 ; - GB_void *restrict Cx = NULL ; size_t Cx_size = 0 ; - GB_Opcode opcode = op->opcode ; - bool in_place_A = (C == NULL) ; // GrB_wait and GB_resize only const bool A_iso = A->iso ; - const size_t asize = A->type->size ; const GB_Type_code acode = A->type->code ; //-------------------------------------------------------------------------- @@ -80,56 +82,81 @@ GrB_Info GB_select_sparse // get A: sparse, hypersparse, or full //-------------------------------------------------------------------------- - // the case when A is bitmap is always handled above by GB_select_bitmap - ASSERT (!GB_IS_BITMAP (A)) ; - - int64_t *restrict Ap = A->p ; size_t Ap_size = A->p_size ; - int64_t *restrict Ah = A->h ; - int64_t *restrict Ai = A->i ; size_t Ai_size = A->i_size ; - GB_void *restrict Ax = (GB_void *) A->x ; size_t Ax_size = A->x_size ; int64_t anvec = A->nvec ; - bool A_jumbled = A->jumbled ; - bool A_is_hyper = (Ah != NULL) ; - int64_t avlen = A->vlen ; - int64_t avdim = A->vdim ; + bool A_is_hyper = GB_IS_HYPERSPARSE (A) ; //-------------------------------------------------------------------------- - // allocate the new vector pointers of C + // create the C matrix //-------------------------------------------------------------------------- - int64_t cnz = 0 ; - int64_t cplen = (avdim == 1) ? 1 : anvec ; + int csparsity = (A_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE ; + int64_t anz = GB_nnz (A) ; - Cp = GB_CALLOC (cplen+1, int64_t, &Cp_size) ; - if (Cp == NULL) + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + csparsity, anz, A->vlen, A->vdim, Werk) ; + + GB_OK (GB_new (&C, // sparse or hyper (from A), existing header + A->type, A->vlen, A->vdim, GB_ph_calloc, A->is_csc, + csparsity, A->hyper_switch, A->plen, Cp_is_32, Cj_is_32, Ci_is_32)) ; + + ASSERT (csparsity == GB_sparsity (C)) ; + ASSERT (Cp_is_32 == C->p_is_32) ; + ASSERT (Cj_is_32 == C->j_is_32) ; + ASSERT (Ci_is_32 == C->i_is_32) ; + + Cp_is_32 = C->p_is_32 ; + Cj_is_32 = C->j_is_32 ; + Ci_is_32 = C->i_is_32 ; + + bool Aj_is_32 = A->j_is_32 ; + + GB_Type_code ajcode = Aj_is_32 ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code cjcode = Cj_is_32 ? GB_UINT32_code : GB_UINT64_code ; + + size_t cpsize = Cp_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + + if (A_is_hyper) { - // out of memory - return (GrB_OUT_OF_MEMORY) ; + // C->h is a deep copy of A->h + GB_cast_int (C->h, cjcode, A->h, ajcode, A->nvec, nthreads_max) ; } + C->nvec = A->nvec ; + C->nvals = 0 ; + C->magic = GB_MAGIC ; + + // C->Y is not yet constructed + ASSERT (C->Y == NULL) ; + ASSERT_MATRIX_OK (C, "C initialized as empty for GB_selector", GB0) ; + ASSERT (C->i == NULL) ; + ASSERT (C->x == NULL) ; + + C->iso = C_iso ; + //-------------------------------------------------------------------------- // slice the entries for each task //-------------------------------------------------------------------------- int A_ntasks, A_nthreads ; - int64_t anz_held = GB_nnz_held (A) ; - double work = 8*anvec + ((opcode == GB_DIAG_idxunop_code) ? 0 : anz_held) ; - GB_SLICE_MATRIX_WORK (A, 8, work, anz_held) ; + double work = 8*anvec + ((opcode == GB_DIAG_idxunop_code) ? 0 : anz) ; + GB_SLICE_MATRIX_WORK2 (A, 8, work, anz) ; //-------------------------------------------------------------------------- // allocate workspace for each task //-------------------------------------------------------------------------- - GB_WERK_PUSH (Work, 3*A_ntasks, int64_t) ; + GB_WERK_PUSH (Work, 3*A_ntasks, uint64_t) ; if (Work == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - Wfirst = Work ; - Wlast = Work + A_ntasks ; - Cp_kfirst = Work + A_ntasks * 2 ; + uint64_t *restrict Wfirst = Work ; + uint64_t *restrict Wlast = Work + A_ntasks ; + uint64_t *restrict Cp_kfirst = Work + A_ntasks * 2 ; //-------------------------------------------------------------------------- // allocate workspace for phase1 @@ -144,7 +171,7 @@ GrB_Info GB_select_sparse if (op_is_positional) { // allocate Zp - Zp = GB_MALLOC_WORK (cplen, int64_t, &Zp_size) ; + Zp = GB_MALLOC_MEMORY (C->plen + 1, cpsize, &Zp_size) ; if (Zp == NULL) { // out of memory @@ -166,8 +193,8 @@ GrB_Info GB_select_sparse //---------------------------------------------------------------------- // no JIT worker needed for these operators - info = GB_select_positional_phase1 (Zp, Cp, Wfirst, Wlast, A, ithunk, - op, A_ek_slicing, A_ntasks, A_nthreads) ; + GB_OK (GB_select_positional_phase1 (C, Zp, Wfirst, Wlast, A, ithunk, + op, A_ek_slicing, A_ntasks, A_nthreads)) ; } else @@ -194,7 +221,7 @@ GrB_Info GB_select_sparse #define GB_sel1(opname,aname) GB (_sel_phase1_ ## opname ## aname) #define GB_SEL_WORKER(opname,aname) \ { \ - info = GB_sel1 (opname, aname) (Cp, Wfirst, Wlast, A, \ + info = GB_sel1 (opname, aname) (C, Wfirst, Wlast, A, \ ythunk, A_ek_slicing, A_ntasks, A_nthreads) ; \ } \ break ; @@ -211,8 +238,8 @@ GrB_Info GB_select_sparse if (info == GrB_NO_VALUE) { - info = GB_select_phase1_jit (Cp, Wfirst, Wlast, C_iso, in_place_A, - A, ythunk, op, flipij, A_ek_slicing, A_ntasks, A_nthreads) ; + info = GB_select_phase1_jit (C, Wfirst, Wlast, A, ythunk, op, + flipij, A_ek_slicing, A_ntasks, A_nthreads) ; } //---------------------------------------------------------------------- @@ -223,45 +250,48 @@ GrB_Info GB_select_sparse { // generic entry selector, phase1 GBURBLE ("(generic select) ") ; - info = GB_select_generic_phase1 (Cp, Wfirst, Wlast, - A, flipij, ythunk, op, A_ek_slicing, A_ntasks, A_nthreads) ; + info = GB_select_generic_phase1 (C, Wfirst, Wlast, A, flipij, + ythunk, op, A_ek_slicing, A_ntasks, A_nthreads) ; } } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; // check for out-of-memory or other failures in phase1 //========================================================================== // phase1b: cumulative sum and allocate C //========================================================================== //-------------------------------------------------------------------------- - // cumulative sum of Cp and compute Cp_kfirst + // finalize Cp, cumulative sum of Cp, and compute Cp_kfirst //-------------------------------------------------------------------------- - int64_t C_nvec_nonempty ; - GB_ek_slice_merge2 (&C_nvec_nonempty, Cp_kfirst, Cp, anvec, - Wfirst, Wlast, A_ek_slicing, A_ntasks, A_nthreads, Werk) ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + + if (!op_is_positional) + { + // GB_select_positional_phase1 finalizes Cp in the + // select/factory/GB_select_positional_phase1_template.c. This phase + // is only needed for entry-style selectors, done by + // select/template/GB_select_entry_phase1_template.c: + GB_ek_slice_merge1 (Cp, Cp_is_32, Wfirst, Wlast, A_ek_slicing, + A_ntasks) ; + } + + int64_t nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, anvec, &nvec_nonempty, A_nthreads, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + GB_ek_slice_merge2 (Cp_kfirst, Cp, Cp_is_32, Wfirst, Wlast, A_ek_slicing, + A_ntasks) ; //-------------------------------------------------------------------------- - // allocate new space for the compacted Ci and Cx + // allocate new space for the compacted C->i and C->x //-------------------------------------------------------------------------- - cnz = Cp [anvec] ; - cnz = GB_IMAX (cnz, 1) ; - Ci = GB_MALLOC (cnz, int64_t, &Ci_size) ; - // use calloc since C is sparse, not bitmap - Cx = (GB_void *) GB_XALLOC (false, C_iso, cnz, asize, &Cx_size) ; // x:OK - if (Ci == NULL || Cx == NULL) - { - // out of memory - GB_FREE_ALL ; - return (GrB_OUT_OF_MEMORY) ; - } + uint64_t cnz = GB_IGET (Cp, anvec) ; + GB_OK (GB_bix_alloc (C, cnz, csparsity, false, true, C_iso)) ; + C->jumbled = A->jumbled ; + C->nvals = cnz ; + ASSERT (C->iso == C_iso) ; //-------------------------------------------------------------------------- // set the iso value of C @@ -270,7 +300,7 @@ GrB_Info GB_select_sparse if (C_iso) { // The pattern of C is computed by the worker below. - GB_select_iso (Cx, opcode, athunk, Ax, asize) ; + GB_select_iso (C->x, opcode, athunk, A->x, A->type->size) ; } //========================================================================== @@ -286,8 +316,8 @@ GrB_Info GB_select_sparse //---------------------------------------------------------------------- // no JIT worker needed for these operators - info = GB_select_positional_phase2 (Ci, Cx, Zp, Cp, Cp_kfirst, A, - flipij, ithunk, op, A_ek_slicing, A_ntasks, A_nthreads) ; + info = GB_select_positional_phase2 (C, Zp, Cp_kfirst, A, flipij, + ithunk, op, A_ek_slicing, A_ntasks, A_nthreads) ; } else @@ -316,8 +346,8 @@ GrB_Info GB_select_sparse #define GB_sel2(opname,aname) GB (_sel_phase2_ ## opname ## aname) #define GB_SEL_WORKER(opname,aname) \ { \ - info = GB_sel2 (opname, aname) (Ci, Cx, Cp, Cp_kfirst, A, \ - ythunk, A_ek_slicing, A_ntasks, A_nthreads) ; \ + info = GB_sel2 (opname, aname) (C, Cp_kfirst, A, ythunk, \ + A_ek_slicing, A_ntasks, A_nthreads) ; \ } \ break ; @@ -332,9 +362,8 @@ GrB_Info GB_select_sparse if (info == GrB_NO_VALUE) { - info = GB_select_phase2_jit (Ci, C_iso ? NULL : Cx, Cp, C_iso, - in_place_A, Cp_kfirst, A, flipij, ythunk, op, A_ek_slicing, - A_ntasks, A_nthreads) ; + info = GB_select_phase2_jit (C, Cp_kfirst, A, flipij, ythunk, op, + A_ek_slicing, A_ntasks, A_nthreads) ; } //---------------------------------------------------------------------- @@ -344,141 +373,21 @@ GrB_Info GB_select_sparse if (info == GrB_NO_VALUE) { // generic entry selector, phase2 - info = GB_select_generic_phase2 (Ci, C_iso ? NULL : Cx, Cp, - Cp_kfirst, A, flipij, ythunk, op, A_ek_slicing, A_ntasks, - A_nthreads) ; + info = GB_select_generic_phase2 (C, Cp_kfirst, A, flipij, ythunk, + op, A_ek_slicing, A_ntasks, A_nthreads) ; } } - if (info != GrB_SUCCESS) - { - // sparse select phase 2 cannot fail but this is here in case it does - // in the future; this block of code thus cannot be tested. - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; // phase2 cannot fail, but check just in case //========================================================================== - // finalize the result + // finalize the result, free workspace, and return result //========================================================================== - if (in_place_A) - { - - //---------------------------------------------------------------------- - // transplant Cp, Ci, Cx back into A - //---------------------------------------------------------------------- - - // TODO: this is not parallel: use GB_hyper_prune - if (A->h != NULL && C_nvec_nonempty < anvec) - { - // prune empty vectors from Ah and Ap - int64_t cnvec = 0 ; - for (int64_t k = 0 ; k < anvec ; k++) - { - if (Cp [k] < Cp [k+1]) - { - Ah [cnvec] = Ah [k] ; - Ap [cnvec] = Cp [k] ; - cnvec++ ; - } - } - Ap [cnvec] = Cp [anvec] ; - A->nvec = cnvec ; - ASSERT (A->nvec == C_nvec_nonempty) ; - GB_FREE (&Cp, Cp_size) ; - // the A->Y hyper_hash is now invalid - GB_hyper_hash_free (A) ; - } - else - { - // free the old A->p and transplant in Cp as the new A->p - GB_FREE (&Ap, Ap_size) ; - A->p = Cp ; Cp = NULL ; A->p_size = Cp_size ; - A->plen = cplen ; - } - - ASSERT (Cp == NULL) ; - - GB_FREE (&Ai, Ai_size) ; - GB_FREE (&Ax, Ax_size) ; - A->i = Ci ; Ci = NULL ; A->i_size = Ci_size ; - A->x = Cx ; Cx = NULL ; A->x_size = Cx_size ; - A->nvec_nonempty = C_nvec_nonempty ; - A->jumbled = A_jumbled ; // A remains jumbled (in-place select) - A->iso = C_iso ; // OK: burble already done above - A->nvals = A->p [A->nvec] ; - - // the NONZOMBIE opcode may have removed all zombies, but A->nzombie - // is still nonzero. It is set to zero in GB_wait. - ASSERT_MATRIX_OK (A, "A output for GB_selector", GB_ZOMBIE (GB0)) ; - - } - else - { - - //---------------------------------------------------------------------- - // create C and transplant Cp, Ch, Ci, Cx into C - //---------------------------------------------------------------------- - - int csparsity = (A_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; - info = GB_new (&C, // sparse or hyper (from A), existing header - A->type, avlen, avdim, GB_Ap_null, true, - csparsity, A->hyper_switch, anvec) ; - ASSERT (info == GrB_SUCCESS) ; - - if (A->h != NULL) - { - - //------------------------------------------------------------------ - // A and C are hypersparse: copy non-empty vectors from Ah to Ch - //------------------------------------------------------------------ - - Ch = GB_MALLOC (anvec, int64_t, &Ch_size) ; - if (Ch == NULL) - { - // out of memory - GB_FREE_ALL ; - return (GrB_OUT_OF_MEMORY) ; - } - - // TODO: do in parallel: use GB_hyper_prune - int64_t cnvec = 0 ; - for (int64_t k = 0 ; k < anvec ; k++) - { - if (Cp [k] < Cp [k+1]) - { - Ch [cnvec] = Ah [k] ; - Cp [cnvec] = Cp [k] ; - cnvec++ ; - } - } - Cp [cnvec] = Cp [anvec] ; - C->nvec = cnvec ; - ASSERT (C->nvec == C_nvec_nonempty) ; - } - - // note that C->Y is not yet constructed - C->p = Cp ; Cp = NULL ; C->p_size = Cp_size ; - C->h = Ch ; Ch = NULL ; C->h_size = Ch_size ; - C->i = Ci ; Ci = NULL ; C->i_size = Ci_size ; - C->x = Cx ; Cx = NULL ; C->x_size = Cx_size ; - C->plen = cplen ; - C->magic = GB_MAGIC ; - C->nvec_nonempty = C_nvec_nonempty ; - C->jumbled = A_jumbled ; // C is jumbled if A is jumbled - C->iso = C_iso ; // OK: burble already done above - C->nvals = C->p [C->nvec] ; - - ASSERT_MATRIX_OK (C, "C output for GB_selector", GB0) ; - } - - //-------------------------------------------------------------------------- - // free workspace and return result - //-------------------------------------------------------------------------- - GB_FREE_WORKSPACE ; + ASSERT_MATRIX_OK (C, "C before hyper_prune for GB_selector", GB0) ; + GB_OK (GB_hyper_prune (C, Werk)) ; + ASSERT_MATRIX_OK (C, "C output for GB_selector", GB0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/select/GB_select_value_iso.c b/GraphBLAS/Source/select/GB_select_value_iso.c index 1ea4d55f5f..004b349b1d 100644 --- a/GraphBLAS/Source/select/GB_select_value_iso.c +++ b/GraphBLAS/Source/select/GB_select_value_iso.c @@ -2,7 +2,7 @@ // GB_select_value_iso: select when A is iso and the op is VALUE* //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,8 @@ // empty matrix. The select factory is not needed, except to check the iso // value via GB_select_bitmap. +// This method takes O(1) time and space. + #define GB_FREE_ALL \ { \ GB_phybix_free (C) ; \ @@ -22,7 +24,6 @@ #include "select/GB_select.h" #include "scalar/GB_Scalar_wrap.h" -#include "transpose/GB_transpose.h" GrB_Info GB_select_value_iso ( @@ -43,7 +44,7 @@ GrB_Info GB_select_value_iso ASSERT (A->iso) ; ASSERT (op->opcode >= GB_VALUENE_idxunop_code && op->opcode <= GB_VALUELE_idxunop_code) - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; //-------------------------------------------------------------------------- // determine if C is empty or a copy of A @@ -77,13 +78,19 @@ GrB_Info GB_select_value_iso // construct C: either an empty matrix, or a copy of A //-------------------------------------------------------------------------- - // check if C has 0 or 1 entry if (C_empty) { - // C is an empty matrix + // C is an empty: create a new empty matrix (not a shallow copy of A) + + // determine the p_is_32, j_is_32, and i_is_32 settings for C + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_AUTO_SPARSITY, 0, A->vlen, A->vdim, Werk) ; + return (GB_new (&C, // existing header - A->type, A->vlen, A->vdim, GB_Ap_calloc, true, - GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 1)) ; + A->type, A->vlen, A->vdim, GB_ph_calloc, true, + GxB_AUTO_SPARSITY, GB_Global_hyper_switch_get ( ), 1, + Cp_is_32, Cj_is_32, Ci_is_32)) ; } else { diff --git a/GraphBLAS/Source/select/GB_selectop_to_idxunop.c b/GraphBLAS/Source/select/GB_selectop_to_idxunop.c index 44e58d4856..33d2a2b655 100644 --- a/GraphBLAS/Source/select/GB_selectop_to_idxunop.c +++ b/GraphBLAS/Source/select/GB_selectop_to_idxunop.c @@ -2,7 +2,7 @@ // GB_selectop_to_idxunop: convert a GxB_SelectOp to a GrB_IndexUnaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,7 +42,6 @@ GrB_Info GB_selectop_to_idxunop GrB_Scalar NewThunk = NULL ; GrB_IndexUnaryOp idxunop = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (selectop) ; - GB_RETURN_IF_FAULTY (Thunk) ; ASSERT (idxunop_handle != NULL) ; ASSERT (NewThunk_handle != NULL) ; @@ -209,8 +208,8 @@ GrB_Info GB_selectop_to_idxunop // allocate the NewThunk as a full scalar GB_OK (GB_new_bix ((GrB_Matrix *) &NewThunk, idxunop->ytype, 1, 1, - GB_Ap_calloc, true, GxB_FULL, false, GB_Global_hyper_switch_get ( ), - 1, 1, true, false)) ; + GB_ph_calloc, true, GxB_FULL, false, GB_Global_hyper_switch_get ( ), + 1, 1, true, false, false, false, false)) ; // NewThunk = 0 memset (NewThunk->x, 0, idxunop->ytype->size) ; diff --git a/GraphBLAS/Source/select/GB_selector.c b/GraphBLAS/Source/select/GB_selector.c index cfe1470b38..4d86498cc9 100644 --- a/GraphBLAS/Source/select/GB_selector.c +++ b/GraphBLAS/Source/select/GB_selector.c @@ -2,7 +2,7 @@ // GB_selector: select entries from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,9 @@ #include "select/GB_select.h" -#define GB_FREE_ALL ; +#define GB_FREE_ALL \ + GB_FREE_MEMORY (&ythunk, ythunk_size) ; \ + GB_FREE_MEMORY (&athunk, athunk_size) ; GrB_Info GB_selector ( @@ -41,16 +43,17 @@ GrB_Info GB_selector GrB_Info info ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for GB_selector", GB0) ; ASSERT_SCALAR_OK (Thunk, "Thunk for GB_selector", GB0) ; - ASSERT_MATRIX_OK (A, "A input for GB_selector", GB_ZOMBIE (GB0)) ; + ASSERT_MATRIX_OK (A, "A input for GB_selector", GB0_Z) ; // positional op (tril, triu, diag, offdiag, resize, rowindex, ...): // can't be jumbled. nonzombie, entry-valued op, user op: jumbled OK GB_Opcode opcode = op->opcode ; ASSERT (GB_IMPLIES (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode), !GB_JUMBLED (A))) ; - ASSERT (C == NULL || (C != NULL && (C->static_header || GBNSTATIC))) ; - bool in_place_A = (C == NULL) ; // GrB_wait and GB_resize only + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; const bool A_iso = A->iso ; + void *ythunk = NULL ; size_t ythunk_size = 0 ; + void *athunk = NULL ; size_t athunk_size = 0 ; //-------------------------------------------------------------------------- // get Thunk @@ -60,10 +63,20 @@ GrB_Info GB_selector ASSERT (GB_nnz ((GrB_Matrix) Thunk) > 0) ; const GB_Type_code tcode = Thunk->type->code ; + // allocate the ythunk and athunk scalars. Use calloc instead of putting + // them on the CPU stack, so the CUDA kernels can access them. + const size_t ysize = op->ytype->size ; + const size_t asize = A->type->size ; + ythunk = GB_CALLOC_MEMORY (1, ysize, &ythunk_size) ; + athunk = GB_CALLOC_MEMORY (1, asize, &athunk_size) ; + if (ythunk == NULL || athunk == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + // ythunk = (op->ytype) Thunk - size_t ysize = op->ytype->size ; - GB_void ythunk [GB_VLA(ysize)] ; - memset (ythunk, 0, ysize) ; GB_cast_scalar (ythunk, op->ytype->code, Thunk->x, tcode, ysize) ; // ithunk = (int64) Thunk, if compatible @@ -75,9 +88,6 @@ GrB_Info GB_selector } // athunk = (A->type) Thunk, for VALUEEQ operator only - const size_t asize = A->type->size ; - GB_void athunk [GB_VLA(asize)] ; - memset (athunk, 0, asize) ; if (opcode == GB_VALUEEQ_idxunop_code) { ASSERT (GB_Type_compatible (A->type, Thunk->type)) ; @@ -102,7 +112,11 @@ GrB_Info GB_selector if (A_iso && opcode >= GB_VALUENE_idxunop_code && opcode <= GB_VALUELE_idxunop_code) { - return (GB_select_value_iso (C, op, A, ithunk, athunk, ythunk, Werk)) ; + // C is either entirely empty, or a completely shallow copy of A. + // This method takes O(1) time and space. + GB_OK (GB_select_value_iso (C, op, A, ithunk, athunk, ythunk, Werk)) ; + GB_FREE_ALL ; + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- @@ -110,11 +124,10 @@ GrB_Info GB_selector //-------------------------------------------------------------------------- bool use_select_bitmap ; - if (opcode == GB_NONZOMBIE_idxunop_code || in_place_A) + if (opcode == GB_NONZOMBIE_idxunop_code) { - // GB_select_bitmap does not support the nonzombie opcode, nor does - // it support operating on A in place. For the NONZOMBIE operator, A - // will never be bitmap. + // GB_select_bitmap does not support the nonzombie opcode. For the + // NONZOMBIE operator, A will never be full or bitmap. use_select_bitmap = false ; } else if (opcode == GB_DIAG_idxunop_code) @@ -122,25 +135,26 @@ GrB_Info GB_selector // GB_select_bitmap supports the DIAG operator, but it is currently // not efficient (GB_select_bitmap should return a sparse diagonal // matrix, not bitmap). So use the sparse case if A is not bitmap, - // since the sparse case below does not support the bitmap case. + // since the sparse case below does not support the bitmap case. For + // this case, GB_select_sparse is used when A is a sparse, hypersparse, + // or full matrix. The full case is not handled in the CUDA kernel + // below, however. use_select_bitmap = GB_IS_BITMAP (A) ; } else { - // For bitmap, full, or as-if-full matrices (sparse/hypersparse with - // all entries present, not jumbled, no zombies, and no pending - // tuples), use the bitmap selector for all other operators (TRIL, - // TRIU, OFFDIAG, NONZERO, EQ*, GT*, GE*, LT*, LE*, and user-defined - // operators). + // For bitmap and full matrices, all other opcodes use GB_select_bitmap use_select_bitmap = GB_IS_BITMAP (A) || GB_IS_FULL (A) ; } if (use_select_bitmap) { + // A is bitmap/full. C is always computed as bitmap. GB_BURBLE_MATRIX (A, "(bitmap select) ") ; - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; - return (GB_select_bitmap (C, C_iso, op, - flipij, A, ithunk, athunk, ythunk, Werk)) ; + GB_OK (GB_select_bitmap (C, C_iso, op, flipij, A, ithunk, athunk, + ythunk, Werk)) ; + GB_FREE_ALL ; + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- @@ -151,37 +165,55 @@ GrB_Info GB_selector opcode == GB_COLLE_idxunop_code || opcode == GB_COLGT_idxunop_code) { - return (GB_select_column (C, C_iso, op, A, ithunk, Werk)) ; + // A is sparse or hypersparse, never bitmap or full. + // COLINDEX: C = A(:,j) + // COLLE: C = A(:,0:j) + // COLGT: C = A(:,j+1:n) + // where j = ithunk. + GB_OK (GB_select_column (C, op, A, ithunk, Werk)) ; + GB_FREE_ALL ; + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- - // sparse/hypersparse general case + // general case: usually sparse/hypersparse, with one exception //-------------------------------------------------------------------------- - info = GrB_NO_VALUE ; + // C is computed as sparse/hypersparse. A is sparse/hypersparse, except + // for a single case: for the DIAG operator, A may be full. See + // use_select_bitmap above. - // FIXME: pass in a T matrix, below, not C: + info = GrB_NO_VALUE ; -#if 0 #if defined ( GRAPHBLAS_HAS_CUDA ) - if (!in_place_A /* Fixme for CUDA: remove this condition, and let the CUDA - kernel handle the in-place-A condition for GB_wait and GB_resize. */ + if ((GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) && GB_cuda_select_branch (A, op)) { - info = GB_cuda_select_sparse (C, C_iso, op, flipij, A, ythunk) ; + // It is possible for non-sparse matrices to use the sparse kernel; see + // the use_select_bitmap test above (the DIAG operator). The CUDA + // select_sparse kernel will not work in this case, so make this go to + // the CPU. + // Fixme CUDA: put the test of sparse(A) or hypersparse(A) in + // GB_cuda_select_branch. + info = GB_cuda_select_sparse (C, C_iso, op, flipij, A, athunk, ythunk, + Werk) ; } #endif -#endif if (info == GrB_NO_VALUE) { info = GB_select_sparse (C, C_iso, op, flipij, A, ithunk, athunk, ythunk, Werk) ; } - - // FIXME: handle in_place_A case here, not in select_sparse: - // transplant from T to either C (not in place) or A (in place) - return (info) ; + GB_OK (info) ; // check for out-of-memory or other failures + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + ASSERT_MATRIX_OK (C, "C output of GB_selector", GB0) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/select/GrB_Matrix_select.c b/GraphBLAS/Source/select/GrB_Matrix_select.c index b7fad2f15f..e063500897 100644 --- a/GraphBLAS/Source/select/GrB_Matrix_select.c +++ b/GraphBLAS/Source/select/GrB_Matrix_select.c @@ -2,7 +2,7 @@ // GrB_Matrix_select: select entries from a matrix using a GrB_IndexUnaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,7 @@ static inline GrB_Info GB_sel // C = accum (C, select(A,k)) or select(A',k) const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Matrix A, // first input: matrix A - const GrB_Scalar Thunk, // optional input for select operator + const GrB_Scalar y, // second input: scalar y const GrB_Descriptor desc, // descriptor for C, M, and A GB_Werk Werk ) @@ -34,12 +34,13 @@ static inline GrB_Info GB_sel // C = accum (C, select(A,k)) or select(A',k) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; GB_BURBLE_START ("GrB_select") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, A_transpose, xx1, xx2, xx7) ; @@ -56,7 +57,7 @@ static inline GrB_Info GB_sel // C = accum (C, select(A,k)) or select(A',k) accum, // optional accum for Z=accum(C,T) op, // operator to select the entries A, // first input: A - Thunk, // optional input for select operator + y, // optional input for select operator A_transpose, // descriptor for A Werk) ; @@ -76,14 +77,14 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_select_, T) \ const GrB_BinaryOp accum, /* optional accum for Z=accum(C,T) */ \ const GrB_IndexUnaryOp op, /* operator to select the entries */ \ const GrB_Matrix A, /* first input: matrix A */ \ - const type thunk, /* optional input for select operator */\ + const type y, /* second input: scalar y */ \ const GrB_Descriptor desc /* descriptor for C, M, and A */ \ ) \ { \ - GB_WHERE (C, GB_STR(prefix) "_Matrix_select_" GB_STR(T) \ - " (C, M, accum, op, A, thunk, desc)") ; \ - GB_SCALAR_WRAP (Thunk, thunk, GB_EVAL3 (prefix, _, T)) ; \ - return (GB_sel (C, M, accum, op, A, Thunk, desc, Werk)) ; \ + GB_WHERE3 (C, M, A, GB_STR(prefix) "_Matrix_select_" GB_STR(T) \ + " (C, M, accum, op, A, y, desc)") ; \ + GB_SCALAR_WRAP (yscalar, y, GB_EVAL3 (prefix, _, T)) ; \ + return (GB_sel (C, M, accum, op, A, yscalar, desc, Werk)) ; \ } GB_SEL (GrB, bool , BOOL ) @@ -101,7 +102,7 @@ GB_SEL (GxB, GxB_FC32_t, FC32 ) GB_SEL (GxB, GxB_FC64_t, FC64 ) //------------------------------------------------------------------------------ -// GrB_Matrix_select_UDT: select entries from matrix (thunk: user-defined type) +// GrB_Matrix_select_UDT: select entries from matrix (y: user-defined type) //------------------------------------------------------------------------------ GrB_Info GrB_Matrix_select_UDT @@ -111,17 +112,18 @@ GrB_Info GrB_Matrix_select_UDT const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Matrix A, // first input: matrix A - const void *thunk, // optional input for select operator + const void *y, // second input: scalar y const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_select_UDT (C, M, accum, op, A, thunk, desc)") ; - GB_SCALAR_WRAP_UDT (Thunk, thunk, (op == NULL) ? NULL : op->ytype) ; - return (GB_sel (C, M, accum, op, A, Thunk, desc, Werk)) ; + GB_WHERE3 (C, M, A, + "GrB_Matrix_select_UDT (C, M, accum, op, A, y, desc)") ; + GB_SCALAR_WRAP_UDT (yscalar, y, (op == NULL) ? NULL : op->ytype) ; + return (GB_sel (C, M, accum, op, A, yscalar, desc, Werk)) ; } //------------------------------------------------------------------------------ -// GrB_Matrix_select_Scalar: select entries from a matrix (thunk is GrB_Scalar) +// GrB_Matrix_select_Scalar: select entries from a matrix (y is GrB_Scalar) //------------------------------------------------------------------------------ GrB_Info GrB_Matrix_select_Scalar @@ -131,11 +133,12 @@ GrB_Info GrB_Matrix_select_Scalar const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Matrix A, // first input: matrix A - const GrB_Scalar Thunk, // optional input for select operator + const GrB_Scalar yscalar, // second input: scalar y const GrB_Descriptor desc // descriptor for C, M, and A ) { - GB_WHERE (C, "GrB_Matrix_select_Scalar (C, M, accum, op, A, thunk, desc)") ; - return (GB_sel (C, M, accum, op, A, Thunk, desc, Werk)) ; + GB_WHERE4 (C, M, A, yscalar, + "GrB_Matrix_select_Scalar (C, M, accum, op, A, y, desc)") ; + return (GB_sel (C, M, accum, op, A, yscalar, desc, Werk)) ; } diff --git a/GraphBLAS/Source/select/GrB_Vector_select.c b/GraphBLAS/Source/select/GrB_Vector_select.c index eddc40b3a6..b7f7aef627 100644 --- a/GraphBLAS/Source/select/GrB_Vector_select.c +++ b/GraphBLAS/Source/select/GrB_Vector_select.c @@ -2,7 +2,7 @@ // GrB_Vector_select: select entries from a vector using a GrB_IndexUnaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ static inline GrB_Info GB_sel // w = accum (w, select(w,k)) const GrB_BinaryOp accum, // optional accum for Z=accum(w,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Vector u, // first input: vector u - const GrB_Scalar Thunk, // optional input for select operator + const GrB_Scalar y, // second input: scalar y const GrB_Descriptor desc, // descriptor for w and M GB_Werk Werk ) @@ -32,12 +32,13 @@ static inline GrB_Info GB_sel // w = accum (w, select(w,k)) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; GB_BURBLE_START ("GrB_select") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; // get the descriptor + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, xx0, xx1, xx2, xx7) ; @@ -54,7 +55,7 @@ static inline GrB_Info GB_sel // w = accum (w, select(w,k)) accum, // optional accum for Z=accum(w,T) op, // operator to select the entries (GrB_Matrix) u, // first input: u - Thunk, // optional input for select operator + y, // second input: scalar y false, // vector u is never transposed Werk) ; @@ -74,14 +75,14 @@ GrB_Info GB_EVAL3 (prefix, _Vector_select_, T) \ const GrB_BinaryOp accum, /* optional accum for Z=accum(w,T) */ \ const GrB_IndexUnaryOp op, /* operator to select the entries */ \ const GrB_Vector u, /* first input: vector u */ \ - const type thunk, /* optional input for select operator */\ + const type y, /* second input: scalary y */ \ const GrB_Descriptor desc /* descriptor for w and M */ \ ) \ { \ - GB_WHERE (w, GB_STR(prefix) "_Vector_select_" GB_STR(T) \ - " (w, M, accum, op, u, thunk, desc)") ; \ - GB_SCALAR_WRAP (Thunk, thunk, GB_EVAL3 (prefix, _, T)) ; \ - return (GB_sel (w, M, accum, op, u, Thunk, desc, Werk)) ; \ + GB_WHERE3 (w, M, u, GB_STR(prefix) "_Vector_select_" GB_STR(T) \ + " (w, M, accum, op, u, y, desc)") ; \ + GB_SCALAR_WRAP (yscalar, y, GB_EVAL3 (prefix, _, T)) ; \ + return (GB_sel (w, M, accum, op, u, yscalar, desc, Werk)) ; \ } GB_SEL (GrB, bool , BOOL ) @@ -99,7 +100,7 @@ GB_SEL (GxB, GxB_FC32_t, FC32 ) GB_SEL (GxB, GxB_FC64_t, FC64 ) //------------------------------------------------------------------------------ -// GrB_Vector_select_UDT: select entries from vector (thunk: user-defined type) +// GrB_Vector_select_UDT: select entries from vector (y: user-defined type) //------------------------------------------------------------------------------ GrB_Info GrB_Vector_select_UDT @@ -109,17 +110,18 @@ GrB_Info GrB_Vector_select_UDT const GrB_BinaryOp accum, // optional accum for Z=accum(w,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Vector u, // first input: vector u - const void *thunk, // optional input for select operator + const void *y, // second input: scalar y const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_select_UDT (w, M, accum, op, u, thunk, desc)") ; - GB_SCALAR_WRAP_UDT (Thunk, thunk, (op == NULL) ? NULL : op->ytype) ; - return (GB_sel (w, M, accum, op, u, Thunk, desc, Werk)) ; + GB_WHERE3 (w, M, u, + "GrB_Vector_select_UDT (w, M, accum, op, u, y, desc)") ; + GB_SCALAR_WRAP_UDT (yscalar, y, (op == NULL) ? NULL : op->ytype) ; + return (GB_sel (w, M, accum, op, u, yscalar, desc, Werk)) ; } //------------------------------------------------------------------------------ -// GrB_Vector_select_Scalar: select entries from a vector (thunk is GrB_Scalar) +// GrB_Vector_select_Scalar: select entries from a vector (y is GrB_Scalar) //------------------------------------------------------------------------------ GrB_Info GrB_Vector_select_Scalar @@ -129,11 +131,12 @@ GrB_Info GrB_Vector_select_Scalar const GrB_BinaryOp accum, // optional accum for Z=accum(w,T) const GrB_IndexUnaryOp op, // operator to select the entries const GrB_Vector u, // first input: vector u - const GrB_Scalar Thunk, // optional input for select operator + const GrB_Scalar y, // second input: scalar y const GrB_Descriptor desc // descriptor for w and M ) { - GB_WHERE (w, "GrB_Vector_select_Scalar (w, M, accum, op, u, thunk, desc)") ; - return (GB_sel (w, M, accum, op, u, Thunk, desc, Werk)) ; + GB_WHERE4 (w, M, u, y, + "GrB_Vector_select_Scalar (w, M, accum, op, u, y, desc)") ; + return (GB_sel (w, M, accum, op, u, y, desc, Werk)) ; } diff --git a/GraphBLAS/Source/select/GxB_Matrix_select.c b/GraphBLAS/Source/select/GxB_Matrix_select.c index 6e2de2c106..39ec0b5cac 100644 --- a/GraphBLAS/Source/select/GxB_Matrix_select.c +++ b/GraphBLAS/Source/select/GxB_Matrix_select.c @@ -2,7 +2,7 @@ // GxB_Matrix_select: select entries from a matrix: deprecated; do not use //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,11 +33,12 @@ GrB_Info GxB_Matrix_select // C = accum (C, select(A,k)) or select(A',k) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (C, "GxB_Matrix_select (C, M, accum, op, A, Thunk, desc)") ; + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE4 (C, M_in, A, Thunk_in, + "GxB_Matrix_select (C, M, accum, op, A, Thunk, desc)") ; GB_BURBLE_START ("GxB_select:DEPRECATED") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, diff --git a/GraphBLAS/Source/select/GxB_Vector_select.c b/GraphBLAS/Source/select/GxB_Vector_select.c index 01c852d3ac..a81b5a7124 100644 --- a/GraphBLAS/Source/select/GxB_Vector_select.c +++ b/GraphBLAS/Source/select/GxB_Vector_select.c @@ -2,13 +2,11 @@ // GxB_Vector_select: select entries from a vector (deprecated; do not use) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// DEPRECATED: use GrB_Vector_select instead. - #define GB_FREE_ALL \ { \ GrB_Scalar_free (&Thunk) ; \ @@ -33,11 +31,12 @@ GrB_Info GxB_Vector_select // w = accum (w, select(u,k)) // check inputs //-------------------------------------------------------------------------- - GB_WHERE (w, "GxB_Vector_select (w, M, accum, op, u, Thunk, desc)") ; + GB_RETURN_IF_NULL (w) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_WHERE4 (w, M_in, u, Thunk_in, + "GxB_Vector_select (w, M, accum, op, u, Thunk, desc)") ; GB_BURBLE_START ("GxB_select:DEPRECATED") ; - GB_RETURN_IF_NULL_OR_FAULTY (w) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, diff --git a/GraphBLAS/Source/select/factory/GB_select_entry_factory.c b/GraphBLAS/Source/select/factory/GB_select_entry_factory.c index 107d7d7c8d..4efd7d6eed 100644 --- a/GraphBLAS/Source/select/factory/GB_select_entry_factory.c +++ b/GraphBLAS/Source/select/factory/GB_select_entry_factory.c @@ -2,7 +2,7 @@ // GB_select_entry_factory: switch factory for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/select/factory/GB_select_positional_phase1_template.c b/GraphBLAS/Source/select/factory/GB_select_positional_phase1_template.c index 15521cc87e..a0e1bf0c2c 100644 --- a/GraphBLAS/Source/select/factory/GB_select_positional_phase1_template.c +++ b/GraphBLAS/Source/select/factory/GB_select_positional_phase1_template.c @@ -2,7 +2,7 @@ // GB_select_positional_phase1_template: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,20 +11,6 @@ { - //-------------------------------------------------------------------------- - // get A and its slicing - //-------------------------------------------------------------------------- - - const int64_t *restrict kfirst_Aslice = A_ek_slicing ; - const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; - const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; - - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; - int64_t avlen = A->vlen ; - int64_t anvec = A->nvec ; - //========================================================================== // positional op (tril, triu, diag, offdiag, row*, but not col*) //========================================================================== @@ -47,8 +33,8 @@ // get A(:,k) //---------------------------------------------------------------------- - int64_t pA_start = GBP_A (Ap, k, avlen) ; - int64_t pA_end = GBP_A (Ap, k+1, avlen) ; + int64_t pA_start = GBp_A (Ap, k, avlen) ; + int64_t pA_end = GBp_A (Ap, k+1, avlen) ; int64_t p = pA_start ; int64_t cjnz = 0 ; int64_t ajnz = pA_end - pA_start ; @@ -61,8 +47,8 @@ // search for the entry A(i,k) //------------------------------------------------------------------ - int64_t ifirst = GBI_A (Ai, pA_start, avlen) ; - int64_t ilast = GBI_A (Ai, pA_end-1, avlen) ; + int64_t ifirst = GBi_A (Ai, pA_start, avlen) ; + int64_t ilast = GBi_A (Ai, pA_end-1, avlen) ; #if defined ( GB_ROWINDEX_SELECTOR ) int64_t i = -ithunk ; @@ -70,7 +56,7 @@ int64_t i = ithunk ; #else // TRIL, TRIU, DIAG, OFFDIAG - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; int64_t i = j-ithunk ; #endif @@ -86,16 +72,17 @@ } else if (ajnz == avlen) { - // A(:,k) is dense + // A(:,k) is dense (either A is full, or has a dense vector) found = true ; p += i ; - ASSERT (GBI_A (Ai, p, avlen) == i) ; + ASSERT (GBi_A (Ai, p, avlen) == i) ; } else { - // binary search for A (i,k) + // binary search in A(:,k) for A (i,k); sparse/hyper case only int64_t pright = pA_end - 1 ; - GB_SPLIT_BINARY_SEARCH (i, Ai, p, pright, found) ; + ASSERT (Ai != NULL) ; + found = GB_split_binary_search (i, Ai, Ai_is_32, &p, &pright) ; } #if defined ( GB_TRIL_SELECTOR ) @@ -159,8 +146,8 @@ // log the result for the kth vector //---------------------------------------------------------------------- - Zp [k] = p ; - Cp [k] = cjnz ; + GB_ISET (Zp, k, p) ; // Zp [k] = p ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } //-------------------------------------------------------------------------- @@ -168,7 +155,7 @@ //-------------------------------------------------------------------------- // Wfirst [0..A_ntasks-1] and Wlast [0..A_ntasks-1] are required for - // constructing Cp_kfirst [0..A_ntasks-1] in GB_selector. + // constructing Cp_kfirst [0..A_ntasks-1] in GB_select_sparse. for (int tid = 0 ; tid < A_ntasks ; tid++) { @@ -182,39 +169,40 @@ if (kfirst <= klast) { int64_t pA_start = pstart_Aslice [tid] ; - int64_t pA_end = GBP_A (Ap, kfirst+1, avlen) ; + int64_t pA_end = GBp_A (Ap, kfirst+1, avlen) ; pA_end = GB_IMIN (pA_end, pstart_Aslice [tid+1]) ; + int64_t pz = GB_IGET (Zp, kfirst) ; if (pA_start < pA_end) { #if defined ( GB_TRIL_SELECTOR ) || \ defined ( GB_ROWGT_SELECTOR ) // keep Zp [kfirst] to pA_end-1 - int64_t p = GB_IMAX (Zp [kfirst], pA_start) ; + int64_t p = GB_IMAX (pz, pA_start) ; Wfirst [tid] = GB_IMAX (0, pA_end - p) ; #elif defined ( GB_TRIU_SELECTOR ) || \ defined ( GB_ROWLE_SELECTOR ) // keep pA_start to Zp [kfirst]-1 - int64_t p = GB_IMIN (Zp [kfirst], pA_end) ; + int64_t p = GB_IMIN (pz, pA_end) ; Wfirst [tid] = GB_IMAX (0, p - pA_start) ; #elif defined ( GB_DIAG_SELECTOR ) // task that owns the diagonal entry does this work - int64_t p = Zp [kfirst] ; + int64_t p = pz ; Wfirst [tid] = (pA_start <= p && p < pA_end) ? 1 : 0 ; #elif defined ( GB_OFFDIAG_SELECTOR ) || \ defined ( GB_ROWINDEX_SELECTOR ) // keep pA_start to Zp [kfirst]-1 - int64_t p = GB_IMIN (Zp [kfirst], pA_end) ; + int64_t p = GB_IMIN (pz, pA_end) ; Wfirst [tid] = GB_IMAX (0, p - pA_start) ; // keep Zp [kfirst]+1 to pA_end-1 - p = GB_IMAX (Zp [kfirst]+1, pA_start) ; + p = GB_IMAX (pz+1, pA_start) ; Wfirst [tid] += GB_IMAX (0, pA_end - p) ; #endif @@ -223,39 +211,40 @@ if (kfirst < klast) { - int64_t pA_start = GBP_A (Ap, klast, avlen) ; + int64_t pA_start = GBp_A (Ap, klast, avlen) ; int64_t pA_end = pstart_Aslice [tid+1] ; + int64_t pz = GB_IGET (Zp, klast) ; if (pA_start < pA_end) { #if defined ( GB_TRIL_SELECTOR ) || \ defined ( GB_ROWGT_SELECTOR ) // keep Zp [klast] to pA_end-1 - int64_t p = GB_IMAX (Zp [klast], pA_start) ; + int64_t p = GB_IMAX (pz, pA_start) ; Wlast [tid] = GB_IMAX (0, pA_end - p) ; #elif defined ( GB_TRIU_SELECTOR ) || \ defined ( GB_ROWLE_SELECTOR ) // keep pA_start to Zp [klast]-1 - int64_t p = GB_IMIN (Zp [klast], pA_end) ; + int64_t p = GB_IMIN (pz, pA_end) ; Wlast [tid] = GB_IMAX (0, p - pA_start) ; #elif defined ( GB_DIAG_SELECTOR ) // task that owns the diagonal entry does this work - int64_t p = Zp [klast] ; + int64_t p = pz ; Wlast [tid] = (pA_start <= p && p < pA_end) ? 1 : 0 ; #elif defined ( GB_OFFDIAG_SELECTOR ) || \ defined ( GB_ROWINDEX_SELECTOR ) // keep pA_start to Zp [klast]-1 - int64_t p = GB_IMIN (Zp [klast], pA_end) ; + int64_t p = GB_IMIN (pz, pA_end) ; Wlast [tid] = GB_IMAX (0, p - pA_start) ; // keep Zp [klast]+1 to pA_end-1 - p = GB_IMAX (Zp [klast]+1, pA_start) ; + p = GB_IMAX (pz+1, pA_start) ; Wlast [tid] += GB_IMAX (0, pA_end - p) ; #endif diff --git a/GraphBLAS/Source/select/include/GB_select_shared_definitions.h b/GraphBLAS/Source/select/include/GB_select_shared_definitions.h index 22a67d872f..c333dd77e1 100644 --- a/GraphBLAS/Source/select/include/GB_select_shared_definitions.h +++ b/GraphBLAS/Source/select/include/GB_select_shared_definitions.h @@ -2,7 +2,7 @@ // GB_select_shared_definitions.h: common macros for select kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,7 @@ // CUDA JIT kernels. #include "include/GB_kernel_shared_definitions.h" +#include "include/GB_unused.h" #ifndef GB_SELECT_SHARED_DEFINITIONS_H #define GB_SELECT_SHARED_DEFINITIONS_H diff --git a/GraphBLAS/Source/select/template/GB_select_bitmap_bitmap_template.c b/GraphBLAS/Source/select/template/GB_select_bitmap_bitmap_template.c index 473bf5c6dc..510c515f65 100644 --- a/GraphBLAS/Source/select/template/GB_select_bitmap_bitmap_template.c +++ b/GraphBLAS/Source/select/template/GB_select_bitmap_bitmap_template.c @@ -2,7 +2,7 @@ // GB_select_bitmap_bitmap_template: C=select(A,thunk) if A is bitmap //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,6 @@ // C and A are bitmap. { - const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; - const int64_t avlen = A->vlen ; - const int64_t avdim = A->vdim ; - const size_t asize = A->type->size ; - const int64_t anz = avlen * avdim ; - int64_t p, cnvals = 0 ; #pragma omp parallel for num_threads(nthreads) schedule(static) \ reduction(+:cnvals) for (p = 0 ; p < anz ; p++) @@ -57,6 +51,5 @@ Cb [p] = cb ; cnvals += cb ; } - (*cnvals_handle) = cnvals ; } diff --git a/GraphBLAS/Source/select/template/GB_select_bitmap_full_template.c b/GraphBLAS/Source/select/template/GB_select_bitmap_full_template.c index 004341fc63..3ce87d0327 100644 --- a/GraphBLAS/Source/select/template/GB_select_bitmap_full_template.c +++ b/GraphBLAS/Source/select/template/GB_select_bitmap_full_template.c @@ -2,7 +2,7 @@ // GB_select_bitmap_full_template: C=select(A,thunk) if A is full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,6 @@ // C is bitmap. A is full. { - const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; - const int64_t avlen = A->vlen ; - const int64_t avdim = A->vdim ; - const size_t asize = A->type->size ; - const int64_t anz = avlen * avdim ; - int64_t p, cnvals = 0 ; #pragma omp parallel for num_threads(nthreads) schedule(static) \ reduction(+:cnvals) for (p = 0 ; p < anz ; p++) @@ -50,6 +44,5 @@ Cb [p] = cb ; cnvals += cb ; } - (*cnvals_handle) = cnvals ; } diff --git a/GraphBLAS/Source/select/template/GB_select_bitmap_template.c b/GraphBLAS/Source/select/template/GB_select_bitmap_template.c index 247f573eab..ccd6502689 100644 --- a/GraphBLAS/Source/select/template/GB_select_bitmap_template.c +++ b/GraphBLAS/Source/select/template/GB_select_bitmap_template.c @@ -2,7 +2,7 @@ // GB_select_bitmap_template: C=select(A,thunk) if A is bitmap or full //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,12 +10,29 @@ // C is bitmap. A is bitmap or full. { + + //-------------------------------------------------------------------------- + // get C and A + //-------------------------------------------------------------------------- + + int8_t *restrict Cb = C->b ; + const int8_t *restrict Ab = A->b ; + + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; + const int64_t avlen = A->vlen ; + const int64_t avdim = A->vdim ; + const int64_t anz = avlen * avdim ; + int64_t p, cnvals = 0 ; + + //-------------------------------------------------------------------------- + // C = select (A) where A is bitmap/full and C is bitmap + //-------------------------------------------------------------------------- + #ifdef GB_JIT_KERNEL { #if GB_A_IS_BITMAP { // A is bitmap - int8_t *Ab = A->b ; #include "template/GB_select_bitmap_bitmap_template.c" } #else @@ -27,7 +44,6 @@ } #else { - int8_t *Ab = A->b ; if (Ab != NULL) { // A is bitmap @@ -40,6 +56,12 @@ } } #endif + + //-------------------------------------------------------------------------- + // update the # of entries in C + //-------------------------------------------------------------------------- + + C->nvals = cnvals ; } #undef GB_TRIL_SELECTOR diff --git a/GraphBLAS/Source/select/template/GB_select_entry_phase1_template.c b/GraphBLAS/Source/select/template/GB_select_entry_phase1_template.c index ce894d9639..1ae6603b50 100644 --- a/GraphBLAS/Source/select/template/GB_select_entry_phase1_template.c +++ b/GraphBLAS/Source/select/template/GB_select_entry_phase1_template.c @@ -2,25 +2,12 @@ // GB_select_entry_phase1_template: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ { - //-------------------------------------------------------------------------- - // get A and its slicing - //-------------------------------------------------------------------------- - - const int64_t *restrict kfirst_Aslice = A_ek_slicing ; - const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; - const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; - - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; - int64_t avlen = A->vlen ; - int64_t anvec = A->nvec ; //========================================================================== // entry selector @@ -37,10 +24,26 @@ // Thread tid+1, and following threads, may also do some of the reduces for // A(:,klast). + // The work to compute Cp for the first and last vector of each phase is + // done by GB_ek_slice_merge1 and GB_ek_slice_merge2, in GB_select_sparse. + //-------------------------------------------------------------------------- - // get A + // get C, A, and its slicing //-------------------------------------------------------------------------- + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; + const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + + int64_t avlen = A->vlen ; + int64_t anvec = A->nvec ; + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; size_t asize = A->type->size ; int64_t avdim = A->vdim ; @@ -75,9 +78,9 @@ // find the part of A(:,k) to be reduced by this thread //------------------------------------------------------------------ - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, - Ap [k], Ap [k+1]) ; + GB_IGET (Ap, k), GB_IGET (Ap, k+1)) ; //------------------------------------------------------------------ // count entries in Ax [pA ... pA_end-1] @@ -86,7 +89,7 @@ int64_t cjnz = 0 ; for ( ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; GB_TEST_VALUE_OF_ENTRY (keep, pA) ; if (keep) cjnz++ ; } @@ -100,15 +103,9 @@ } else { - Cp [k] = cjnz ; + GB_ISET (Cp, k, cjnz) ; // Cp [k] = cjnz ; } } } - - //-------------------------------------------------------------------------- - // reduce the first and last vector of each slice using a single thread - //-------------------------------------------------------------------------- - - GB_ek_slice_merge1 (Cp, Wfirst, Wlast, A_ek_slicing, A_ntasks) ; } diff --git a/GraphBLAS/Source/select/template/GB_select_phase2_template.c b/GraphBLAS/Source/select/template/GB_select_phase2_template.c index c0f09fce53..87e14f3d3d 100644 --- a/GraphBLAS/Source/select/template/GB_select_phase2_template.c +++ b/GraphBLAS/Source/select/template/GB_select_phase2_template.c @@ -2,27 +2,35 @@ // GB_select_phase2: C=select(A,thunk) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// C is sparse or hypersparse, but it is present only as Cp, Ci, and Cx. -// A is never bitmap. It is sparse or hypersparse in most cases. It can also -// by full for DIAG. +// C is sparse or hypersparse. Cp is not modifed but Ci and Cx are. A is +// never bitmap. It is sparse or hypersparse in most cases. It can also be +// full for DIAG. { + //-------------------------------------------------------------------------- - // get A + // get C, A and its slicing //-------------------------------------------------------------------------- - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; + const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; size_t asize = A->type->size ; + int64_t avlen = A->vlen ; int64_t avdim = A->vdim ; + // if A is bitmap, the bitmap selector is always used instead ASSERT (!GB_IS_BITMAP (A)) ; #ifndef GB_DIAG_SELECTOR @@ -30,9 +38,14 @@ ASSERT (!GB_IS_FULL (A)) ; #endif - const int64_t *restrict kfirst_Aslice = A_ek_slicing ; - const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; - const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + GB_Cp_DECLARE (Cp, const) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + + #ifndef GB_C_TYPE + #define GB_C_TYPE GB_A_TYPE + #endif + + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; //-------------------------------------------------------------------------- // C = select (A) @@ -60,7 +73,7 @@ GB_GET_PA_AND_PC (pA_start, pA_end, pC, tid, k, kfirst, klast, pstart_Aslice, Cp_kfirst, - GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen), Cp [k]) ; + GBp_A (Ap, k, avlen), GBp_A (Ap, k+1, avlen), GB_IGET (Cp, k)) ; //------------------------------------------------------------------ // compact Ai and Ax [pA_start ... pA_end-1] into Ci and Cx @@ -68,19 +81,19 @@ #if defined ( GB_ENTRY_SELECTOR ) - int64_t j = GBH_A (Ah, k) ; + int64_t j = GBh_A (Ah, k) ; for (int64_t pA = pA_start ; pA < pA_end ; pA++) { // A is sparse or hypersparse ASSERT (Ai != NULL) ; - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; GB_TEST_VALUE_OF_ENTRY (keep, pA) ; if (keep) { - ASSERT (pC >= Cp [k] && pC < Cp [k+1]) ; - Ci [pC] = i ; - // Cx [pC] = Ax [pA] ; - GB_SELECT_ENTRY (Cx, pC, Ax, pA) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC < GB_IGET (Cp, k+1)) ; + GB_ISET (Ci, pC, i) ; // Ci [pC] = i + GB_SELECT_ENTRY (Cx, pC, Ax, pA) ; // Cx [pC] = Ax [pA] pC++ ; } } @@ -89,15 +102,21 @@ defined ( GB_ROWGT_SELECTOR ) // keep Zp [k] to pA_end-1 - int64_t p = GB_IMAX (Zp [k], pA_start) ; + int64_t pz = GB_IGET (Zp, k) ; + int64_t p = GB_IMAX (pz, pA_start) ; int64_t mynz = pA_end - p ; if (mynz > 0) { // A and C are both sparse or hypersparse ASSERT (pA_start <= p && p + mynz <= pA_end) ; - ASSERT (pC >= Cp [k] && pC + mynz <= Cp [k+1]) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC + mynz <= GB_IGET (Cp, k+1)) ; ASSERT (Ai != NULL) ; - memcpy (Ci +pC, Ai +p, mynz*sizeof (int64_t)) ; + for (int64_t kk = 0 ; kk < mynz ; kk++) + { + int64_t i = GB_IGET (Ai, p+kk) ; // i = Ai [p+kk] + GB_ISET (Ci, pC+kk, i) ; // Ci [pC+kk] = i + } #if !GB_ISO_SELECT memcpy (Cx +pC*asize, Ax +p*asize, mynz*asize) ; #endif @@ -107,14 +126,20 @@ defined ( GB_ROWLE_SELECTOR ) // keep pA_start to Zp[k]-1 - int64_t p = GB_IMIN (Zp [k], pA_end) ; + int64_t pz = GB_IGET (Zp, k) ; + int64_t p = GB_IMIN (pz, pA_end) ; int64_t mynz = p - pA_start ; if (mynz > 0) { // A and C are both sparse or hypersparse - ASSERT (pC >= Cp [k] && pC + mynz <= Cp [k+1]) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC + mynz <= GB_IGET (Cp, k+1)) ; ASSERT (Ai != NULL) ; - memcpy (Ci +pC, Ai +pA_start, mynz*sizeof (int64_t)) ; + for (int64_t kk = 0 ; kk < mynz ; kk++) + { + int64_t i = GB_IGET (Ai, pA_start+kk) ; + GB_ISET (Ci, pC+kk, i) ; // Ci [pC+kk] = i + } #if !GB_ISO_SELECT memcpy (Cx +pC*asize, Ax +pA_start*asize, mynz*asize) ; #endif @@ -124,11 +149,14 @@ // task that owns the diagonal entry does this work // A can be sparse, hypersparse, or full, but not bitmap - int64_t p = Zp [k] ; + int64_t pz = GB_IGET (Zp, k) ; + int64_t p = pz ; if (pA_start <= p && p < pA_end) { - ASSERT (pC >= Cp [k] && pC + 1 <= Cp [k+1]) ; - Ci [pC] = GBI_A (Ai, p, avlen) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC + 1 <= GB_IGET (Cp, k+1)) ; + int64_t i = GBi_A (Ai, p, avlen) ; // i = Ai [p] + GB_ISET (Ci, pC, i) ; // Ci [pC] = i ; #if !GB_ISO_SELECT memcpy (Cx +pC*asize, Ax +p*asize, asize) ; #endif @@ -138,14 +166,20 @@ defined ( GB_ROWINDEX_SELECTOR ) // keep pA_start to Zp[k]-1 - int64_t p = GB_IMIN (Zp [k], pA_end) ; + int64_t pz = GB_IGET (Zp, k) ; + int64_t p = GB_IMIN (pz, pA_end) ; int64_t mynz = p - pA_start ; if (mynz > 0) { // A and C are both sparse or hypersparse - ASSERT (pC >= Cp [k] && pC + mynz <= Cp [k+1]) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC + mynz <= GB_IGET (Cp, k+1)) ; ASSERT (Ai != NULL) ; - memcpy (Ci +pC, Ai +pA_start, mynz*sizeof (int64_t)) ; + for (int64_t kk = 0 ; kk < mynz ; kk++) + { + int64_t i = GB_IGET (Ai, pA_start+kk) ; + GB_ISET (Ci, pC+kk, i) ; // Ci [pC+kk] = i + } #if !GB_ISO_SELECT memcpy (Cx +pC*asize, Ax +pA_start*asize, mynz*asize) ; #endif @@ -153,15 +187,21 @@ } // keep Zp[k]+1 to pA_end-1 - p = GB_IMAX (Zp [k]+1, pA_start) ; + pz = GB_IGET (Zp, k) + 1 ; + p = GB_IMAX (pz, pA_start) ; mynz = pA_end - p ; if (mynz > 0) { // A and C are both sparse or hypersparse ASSERT (pA_start <= p && p < pA_end) ; - ASSERT (pC >= Cp [k] && pC + mynz <= Cp [k+1]) ; + ASSERT (pC >= GB_IGET (Cp, k)) ; + ASSERT (pC + mynz <= GB_IGET (Cp, k+1)) ; ASSERT (Ai != NULL) ; - memcpy (Ci +pC, Ai +p, mynz*sizeof (int64_t)) ; + for (int64_t kk = 0 ; kk < mynz ; kk++) + { + int64_t i = GB_IGET (Ai, p+kk) ; // i = Ai [p+kk] + GB_ISET (Ci, pC+kk, i) ; // Ci [pC+kk] = i + } #if !GB_ISO_SELECT memcpy (Cx +pC*asize, Ax +p*asize, mynz*asize) ; #endif diff --git a/GraphBLAS/Source/semiring/GB_Semiring_new.c b/GraphBLAS/Source/semiring/GB_Semiring_new.c index e31a60387e..aea6f954e7 100644 --- a/GraphBLAS/Source/semiring/GB_Semiring_new.c +++ b/GraphBLAS/Source/semiring/GB_Semiring_new.c @@ -2,7 +2,7 @@ // GB_Semiring_new: create a new semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -63,8 +63,8 @@ GrB_Info GB_Semiring_new // create a semiring size_t add_len = strlen (semiring->add->op->name) ; size_t mult_len = strlen (semiring->multiply->name) ; semiring->name_len = (int32_t) (add_len + mult_len + 1) ; - semiring->name = GB_MALLOC (semiring->name_len + 1, char, - &(semiring->name_size)) ; + semiring->name = GB_MALLOC_MEMORY (semiring->name_len + 1, + sizeof (char), &(semiring->name_size)) ; if (semiring->name == NULL) { // out of memory diff --git a/GraphBLAS/Source/semiring/GB_Semiring_new.h b/GraphBLAS/Source/semiring/GB_Semiring_new.h index 9d30608717..33dcd740fd 100644 --- a/GraphBLAS/Source/semiring/GB_Semiring_new.h +++ b/GraphBLAS/Source/semiring/GB_Semiring_new.h @@ -2,7 +2,7 @@ // GB_Semiring_new.h: definitions for GB_Semiring_new //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/semiring/GrB_Semiring_free.c b/GraphBLAS/Source/semiring/GrB_Semiring_free.c index 2fcbedeb3c..7121b46634 100644 --- a/GraphBLAS/Source/semiring/GrB_Semiring_free.c +++ b/GraphBLAS/Source/semiring/GrB_Semiring_free.c @@ -2,7 +2,7 @@ // GrB_Semiring_free: free a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,16 +22,16 @@ GrB_Info GrB_Semiring_free // free a user-created semiring if (s != NULL) { // free the semiring name - GB_FREE (&(s->name), s->name_size) ; + GB_FREE_MEMORY (&(s->name), s->name_size) ; // free the semiring user_name - GB_FREE (&(s->user_name), s->user_name_size) ; + GB_FREE_MEMORY (&(s->user_name), s->user_name_size) ; // free the semiring header size_t header_size = s->header_size ; if (header_size > 0) { s->magic = GB_FREED ; // to help detect dangling pointers s->header_size = 0 ; - GB_FREE (semiring, header_size) ; + GB_FREE_MEMORY (semiring, header_size) ; } } } diff --git a/GraphBLAS/Source/semiring/GrB_Semiring_new.c b/GraphBLAS/Source/semiring/GrB_Semiring_new.c index 149bca1447..be755e053d 100644 --- a/GraphBLAS/Source/semiring/GrB_Semiring_new.c +++ b/GraphBLAS/Source/semiring/GrB_Semiring_new.c @@ -2,7 +2,7 @@ // GrB_Semiring_new: create a new semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ #define GB_FREE_ALL \ { \ - GB_FREE (semiring, header_size) ; \ + GB_FREE_MEMORY (semiring, header_size) ; \ } GrB_Info GrB_Semiring_new // create a semiring @@ -50,12 +50,10 @@ GrB_Info GrB_Semiring_new // create a semiring // check inputs //-------------------------------------------------------------------------- - GrB_Info info ; - - GB_WHERE1 ("GrB_Semiring_new (&semiring, add, multiply)") ; - + GB_CHECK_INIT ; GB_RETURN_IF_NULL (semiring) ; + GrB_Info info ; (*semiring) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (add) ; GB_RETURN_IF_NULL_OR_FAULTY (multiply) ; @@ -67,7 +65,8 @@ GrB_Info GrB_Semiring_new // create a semiring //-------------------------------------------------------------------------- size_t header_size ; - (*semiring) = GB_MALLOC (1, struct GB_Semiring_opaque, &header_size) ; + (*semiring) = GB_MALLOC_MEMORY (1, sizeof (struct GB_Semiring_opaque), + &header_size) ; if (*semiring == NULL) { // out of memory diff --git a/GraphBLAS/Source/semiring/GxB_Semiring_add.c b/GraphBLAS/Source/semiring/GxB_Semiring_add.c index 8caa2cdb7d..fa4bd4691c 100644 --- a/GraphBLAS/Source/semiring/GxB_Semiring_add.c +++ b/GraphBLAS/Source/semiring/GxB_Semiring_add.c @@ -2,7 +2,7 @@ // GxB_Semiring_add: return the additive monoid of a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GxB_Semiring_add // return the additive monoid of a semiring // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Semiring_add (&add, semiring)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (add) ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; ASSERT_SEMIRING_OK (semiring, "semiring for add", GB0) ; diff --git a/GraphBLAS/Source/semiring/GxB_Semiring_multiply.c b/GraphBLAS/Source/semiring/GxB_Semiring_multiply.c index bcfc9255bb..f7c0b031b2 100644 --- a/GraphBLAS/Source/semiring/GxB_Semiring_multiply.c +++ b/GraphBLAS/Source/semiring/GxB_Semiring_multiply.c @@ -2,7 +2,7 @@ // GxB_Semiring_multiply: return the multiply operator of a semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GxB_Semiring_multiply // return multiply operator of a semiring // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Semiring_multiply (&multiply, semiring)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (multiply) ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; ASSERT_SEMIRING_OK (semiring, "semiring for mult", GB0) ; diff --git a/GraphBLAS/Source/serialize/GB_deserialize.c b/GraphBLAS/Source/serialize/GB_deserialize.c index d1f8dc65a6..1747836352 100644 --- a/GraphBLAS/Source/serialize/GB_deserialize.c +++ b/GraphBLAS/Source/serialize/GB_deserialize.c @@ -2,7 +2,7 @@ // GB_deserialize: decompress and deserialize a blob into a GrB_Matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,13 +52,32 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob } GB_BLOB_READ (blob_size2, uint64_t) ; - GB_BLOB_READ (typecode, int32_t) ; + +// was in v9.4.2 and earlier:: +// GB_BLOB_READ (typecode, int32_t) ; +// now in GrB v10.0.0: + GB_BLOB_READ (encoding, uint32_t) ; + uint32_t Cp_is_32 = GB_RSHIFT (encoding, 12, 4) ; // C->p_is_32 + uint32_t Cj_is_32 = GB_RSHIFT (encoding, 8, 4) ; // C->j_is_32 + uint32_t Ci_is_32 = GB_RSHIFT (encoding, 4, 4) ; // C->i_is_32 + uint32_t typecode = GB_RSHIFT (encoding, 0, 4) ; // 4 bit typecode + + // GrB 10.0.0 reserves 4 bits each for Cp_is_32, Cj_is_32, and Ci_is_32, + // for future expansion. This way, if a future GraphBLAS version needs + // more bits to create a serialized blob, then GrB 10.0.0 will gracefully + // fail if it attempts to deserialize the blob. + uint64_t blob_size1 = (uint64_t) blob_size ; + // GrB v9.4.2 has the same test below, so it will safely declare the blob + // invalid if it sees any encoding with a 1 in bit position 4 or 5. if (blob_size1 != blob_size2 || typecode < GB_BOOL_code || typecode > GB_UDT_code || (typecode == GB_UDT_code && - blob_size < GB_BLOB_HEADER_SIZE + GxB_MAX_NAME_LEN)) + blob_size < GB_BLOB_HEADER_SIZE + GxB_MAX_NAME_LEN) + // GrB v10.0.0 adds the following check, since it only supports the + // values of 0 and 1, denoting 64-bit and 32-bit integers respectively: + || (Cp_is_32 > 1) || (Cj_is_32 > 1) || (Ci_is_32 > 1)) { // blob is invalid return (GrB_INVALID_OBJECT) ; @@ -78,7 +97,20 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob GB_BLOB_READ (Cx_len, int64_t) ; GB_BLOB_READ (hyper_switch, float) ; GB_BLOB_READ (bitmap_switch, float) ; - GB_BLOB_READ (sparsity_control, int32_t) ; + +// was in v9.4.2 and earlier:: +// GB_BLOB_READ (sparsity_control, int32_t) ; +// now in GrB v10.0.0: + GB_BLOB_READ (control_encoding, uint32_t) ; + + uint32_t p_encoding = GB_RSHIFT (control_encoding, 16, 4) ; + uint32_t j_encoding = GB_RSHIFT (control_encoding, 12, 4) ; + uint32_t i_encoding = GB_RSHIFT (control_encoding, 8, 4) ; + int8_t p_control = GB_pji_control_decoding (p_encoding) ; + int8_t j_control = GB_pji_control_decoding (j_encoding) ; + int8_t i_control = GB_pji_control_decoding (i_encoding) ; + uint32_t sparsity_control = GB_RSHIFT (control_encoding, 0, 8) ; + GB_BLOB_READ (sparsity_iso_csc, int32_t) ; GB_BLOB_READ (Cp_nblocks, int32_t) ; GB_BLOB_READ (Cp_method, int32_t) ; GB_BLOB_READ (Ch_nblocks, int32_t) ; GB_BLOB_READ (Ch_method, int32_t) ; @@ -140,20 +172,24 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob // allocate the matrix with info from the header GB_OK (GB_new (&C, // new header (C is NULL on input) - ctype, vlen, vdim, GB_Ap_null, is_csc, - sparsity, hyper_switch, nvec)) ; + ctype, vlen, vdim, GB_ph_null, is_csc, + sparsity, hyper_switch, nvec, Cp_is_32, Cj_is_32, Ci_is_32)) ; C->nvec = nvec ; - C->nvec_nonempty = nvec_nonempty ; - C->nvals = nvals ; // revised below +// C->nvec_nonempty = nvec_nonempty ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + C->nvals = nvals ; // revised below if version <= 7.2.0 C->bitmap_switch = bitmap_switch ; C->sparsity_control = sparsity_control ; C->iso = iso ; - // the matrix has no pending work - ASSERT (C->Pending == NULL) ; - ASSERT (C->nzombies == 0) ; - ASSERT (!C->jumbled) ; + // added for GrB v10.0.0: + C->p_is_32 = Cp_is_32 ; + C->j_is_32 = Cj_is_32 ; + C->i_is_32 = Ci_is_32 ; + C->p_control = p_control ; + C->j_control = j_control ; + C->i_control = i_control ; //-------------------------------------------------------------------------- // decompress each array (Cp, Ch, Cb, Ci, and Cx) @@ -205,17 +241,18 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob GB_OK (GB_deserialize_from_blob ((GB_void **) &(C->x), &(C->x_size), Cx_len, blob, blob_size, Cx_Sblocks, Cx_nblocks, Cx_method, &s)) ; - if (C->p != NULL) - { + if (C->p != NULL && version <= GxB_VERSION (7,2,0)) + { // C is sparse or hypersparse. v7.2.1 and later have the new C->nvals // value inside the blob already. The blob prior to v7.2.1 had nvals // of zero for sparse and hypersparse matrices. Set it here to the // correct value, so that blobs written by v7.2.0 and earlier can be - // read by v7.2.1 and later. For both variants, ignore nvals in the - // blob and use Cp [nvec] when C is sparse or hypersparse. - ASSERT (GB_IMPLIES (version > GxB_VERSION (7,2,0), - C->nvals == C->p [C->nvec])) ; - C->nvals = C->p [C->nvec] ; + // read by v7.2.1 and later. For blobs written by v7.2.0 and earlier, + // get C->nvals from Cp [nvec] when C is sparse or hypersparse. For + // blobs written by v7.2.1 and later, use nvals as read in from the + // blob above. + const uint64_t *restrict Cp = C->p ; // OK; v7.2.0 only had 64-bit Cp + C->nvals = Cp [C->nvec] ; } C->magic = GB_MAGIC ; @@ -224,7 +261,8 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob //-------------------------------------------------------------------------- // v8.1.0 adds two nul-terminated uncompressed strings to the end of the - // blob. If the strings are empty, the nul terminators still appear. + // blob: the user name and the element type name. If the strings are + // empty, the nul terminators still appear. if (version >= GxB_VERSION (8,1,0)) { @@ -234,12 +272,13 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob //---------------------------------------------------------------------- int nfound = 0 ; - size_t ss [2] ; +// size_t ss [2] ; for (size_t p = s ; p < blob_size && nfound < 2 ; p++) { if (blob [p] == 0) - { - ss [nfound++] = p ; + { +// ss [nfound] = p ; + nfound++ ; } } diff --git a/GraphBLAS/Source/serialize/GB_deserialize_from_blob.c b/GraphBLAS/Source/serialize/GB_deserialize_from_blob.c index 6d4f684922..c17f94f856 100644 --- a/GraphBLAS/Source/serialize/GB_deserialize_from_blob.c +++ b/GraphBLAS/Source/serialize/GB_deserialize_from_blob.c @@ -2,7 +2,7 @@ // GB_deserialize_from_blob: uncompress a set of blocks from the blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ #define GB_FREE_ALL \ { \ - GB_FREE (&X, X_size) ; \ + GB_FREE_MEMORY (&X, X_size) ; \ } GrB_Info GB_deserialize_from_blob @@ -32,7 +32,7 @@ GrB_Info GB_deserialize_from_blob int64_t X_len, // size of X in bytes const GB_void *blob, // serialized blob of size blob_size size_t blob_size, - int64_t *Sblocks, // array of size nblocks + uint64_t *Sblocks, // array of size nblocks int32_t nblocks, // # of compressed blocks for this array int32_t method, // compression method used for each block // input/output: @@ -44,7 +44,6 @@ GrB_Info GB_deserialize_from_blob // check inputs //-------------------------------------------------------------------------- -// GrB_Info info ; ASSERT (blob != NULL) ; ASSERT (s_handle != NULL) ; ASSERT (X_handle != NULL) ; @@ -64,7 +63,18 @@ GrB_Info GB_deserialize_from_blob //-------------------------------------------------------------------------- size_t X_size = 0 ; - GB_void *X = GB_MALLOC (X_len, GB_void, &X_size) ; // OK + GB_void *X = NULL ; + if (nblocks == 0) + { + // allocate an "empty" block (of 8 bytes) and set it zero + X = GB_CALLOC_MEMORY (X_len, sizeof (GB_void), &X_size) ; + } + else + { + // allocate a block that is filled below + X = GB_MALLOC_MEMORY (X_len, sizeof (GB_void), &X_size) ; + } + if (X == NULL) { // out of memory @@ -84,14 +94,21 @@ GrB_Info GB_deserialize_from_blob size_t s = (*s_handle) ; bool ok = true ; - if (algo == GxB_COMPRESSION_NONE) + if (nblocks == 0) + { + + // nothing else to do for this array + ; + + } + else if (algo == GxB_COMPRESSION_NONE) { //---------------------------------------------------------------------- // no compression; the array is held in a single block //---------------------------------------------------------------------- - if (nblocks > 1 || Sblocks [0] != X_len || s + X_len > blob_size) + if (nblocks != 1 || Sblocks [0] != X_len || s + X_len > blob_size) { // blob is invalid: guard against an unsafe memcpy ok = false ; diff --git a/GraphBLAS/Source/serialize/GB_serialize.c b/GraphBLAS/Source/serialize/GB_serialize.c index 918bc18e73..6c16dc79ce 100644 --- a/GraphBLAS/Source/serialize/GB_serialize.c +++ b/GraphBLAS/Source/serialize/GB_serialize.c @@ -2,7 +2,7 @@ // GB_serialize: compress and serialize a GrB_Matrix into a blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,11 +19,11 @@ #define GB_FREE_WORKSPACE \ { \ - GB_FREE (&Ap_Sblocks, Ap_Sblocks_size) ; \ - GB_FREE (&Ah_Sblocks, Ah_Sblocks_size) ; \ - GB_FREE (&Ab_Sblocks, Ab_Sblocks_size) ; \ - GB_FREE (&Ai_Sblocks, Ai_Sblocks_size) ; \ - GB_FREE (&Ax_Sblocks, Ax_Sblocks_size) ; \ + GB_FREE_MEMORY (&Ap_Sblocks, Ap_Sblocks_size) ; \ + GB_FREE_MEMORY (&Ah_Sblocks, Ah_Sblocks_size) ; \ + GB_FREE_MEMORY (&Ab_Sblocks, Ab_Sblocks_size) ; \ + GB_FREE_MEMORY (&Ai_Sblocks, Ai_Sblocks_size) ; \ + GB_FREE_MEMORY (&Ax_Sblocks, Ax_Sblocks_size) ; \ GB_serialize_free_blocks (&Ap_Blocks, Ap_Blocks_size, Ap_nblocks) ; \ GB_serialize_free_blocks (&Ah_Blocks, Ah_Blocks_size, Ah_nblocks) ; \ GB_serialize_free_blocks (&Ab_Blocks, Ab_Blocks_size, Ab_nblocks) ; \ @@ -36,7 +36,7 @@ GB_FREE_WORKSPACE ; \ if (!preallocated_blob) \ { \ - GB_FREE (&blob, blob_size_allocated) ; \ + GB_FREE_MEMORY (&blob, blob_size_allocated) ; \ } \ } @@ -63,6 +63,10 @@ GrB_Info GB_serialize // serialize a matrix into a blob ASSERT (blob_size_handle != NULL) ; ASSERT_MATRIX_OK (A, "A for serialize", GB0) ; + int Ap_is_32 = (A->p_is_32) ? 1 : 0 ; + int Aj_is_32 = (A->j_is_32) ? 1 : 0 ; + int Ai_is_32 = (A->i_is_32) ? 1 : 0 ; + //-------------------------------------------------------------------------- // determine what serialization to do //-------------------------------------------------------------------------- @@ -99,11 +103,11 @@ GrB_Info GB_serialize // serialize a matrix into a blob GB_blocks *Ab_Blocks = NULL ; size_t Ab_Blocks_size = 0 ; GB_blocks *Ai_Blocks = NULL ; size_t Ai_Blocks_size = 0 ; GB_blocks *Ax_Blocks = NULL ; size_t Ax_Blocks_size = 0 ; - int64_t *Ap_Sblocks = NULL ; size_t Ap_Sblocks_size = 0 ; - int64_t *Ah_Sblocks = NULL ; size_t Ah_Sblocks_size = 0 ; - int64_t *Ab_Sblocks = NULL ; size_t Ab_Sblocks_size = 0 ; - int64_t *Ai_Sblocks = NULL ; size_t Ai_Sblocks_size = 0 ; - int64_t *Ax_Sblocks = NULL ; size_t Ax_Sblocks_size = 0 ; + uint64_t *Ap_Sblocks = NULL ; size_t Ap_Sblocks_size = 0 ; + uint64_t *Ah_Sblocks = NULL ; size_t Ah_Sblocks_size = 0 ; + uint64_t *Ab_Sblocks = NULL ; size_t Ab_Sblocks_size = 0 ; + uint64_t *Ai_Sblocks = NULL ; size_t Ai_Sblocks_size = 0 ; + uint64_t *Ax_Sblocks = NULL ; size_t Ax_Sblocks_size = 0 ; int32_t Ap_nblocks = 0 ; size_t Ap_compressed_size = 0 ; int32_t Ah_nblocks = 0 ; size_t Ah_compressed_size = 0 ; int32_t Ab_nblocks = 0 ; size_t Ab_compressed_size = 0 ; @@ -115,7 +119,11 @@ GrB_Info GB_serialize // serialize a matrix into a blob //-------------------------------------------------------------------------- GB_OK (GB_wait (A, "A to serialize", Werk)) ; - ASSERT (A->nvec_nonempty >= 0) ; + + // the matrix has no pending work + ASSERT (!GB_PENDING (A)) ; + ASSERT (!GB_ZOMBIES (A)) ; + ASSERT (!GB_JUMBLED (A)) ; //-------------------------------------------------------------------------- // determine maximum # of threads @@ -146,36 +154,41 @@ GrB_Info GB_serialize // serialize a matrix into a blob int64_t vdim = A->vdim ; int64_t nvec = A->nvec ; int64_t nvals = A->nvals ; - int64_t nvec_nonempty = A->nvec_nonempty ; + int64_t nvec_nonempty = GB_nvec_nonempty_get (A) ; + ASSERT (nvec_nonempty >= 0) ; int32_t sparsity = GB_sparsity (A) ; bool iso = A->iso ; float hyper_switch = A->hyper_switch ; float bitmap_switch = A->bitmap_switch ; int32_t sparsity_control = A->sparsity_control ; - // the matrix has no pending work - ASSERT (A->Pending == NULL) ; - ASSERT (A->nzombies == 0) ; - ASSERT (!A->jumbled) ; GrB_Type atype = A->type ; int64_t typesize = atype->size ; int32_t typecode = (int32_t) (atype->code) ; int64_t anz = GB_nnz (A) ; int64_t anz_held = GB_nnz_held (A) ; + //-------------------------------------------------------------------------- // determine the uncompressed sizes of Ap, Ah, Ab, Ai, and Ax + //-------------------------------------------------------------------------- + + size_t apsize = Ap_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t ajsize = Aj_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t aisize = Ai_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + int64_t Ap_len = 0 ; int64_t Ah_len = 0 ; int64_t Ab_len = 0 ; int64_t Ai_len = 0 ; int64_t Ax_len = 0 ; + switch (sparsity) { case GxB_HYPERSPARSE : - Ah_len = sizeof (GrB_Index) * nvec ; + Ah_len = ajsize * nvec ; // fall through to the sparse case case GxB_SPARSE : - Ap_len = sizeof (GrB_Index) * (nvec+1) ; - Ai_len = sizeof (GrB_Index) * anz ; + Ap_len = apsize * (nvec+1) ; + Ai_len = aisize * anz ; Ax_len = typesize * (iso ? 1 : anz) ; break ; case GxB_BITMAP : @@ -229,11 +242,11 @@ GrB_Info GB_serialize // serialize a matrix into a blob // header information GB_BLOB_HEADER_SIZE // Sblocks for each array - + Ap_nblocks * sizeof (int64_t) // Ap_Sblocks [1:Ap_nblocks] - + Ah_nblocks * sizeof (int64_t) // Ah_Sblocks [1:Ah_nblocks] - + Ab_nblocks * sizeof (int64_t) // Ab_Sblocks [1:Ab_nblocks] - + Ai_nblocks * sizeof (int64_t) // Ai_Sblocks [1:Ai_nblocks] - + Ax_nblocks * sizeof (int64_t) // Ax_Sblocks [1:Ax_nblocks] + + Ap_nblocks * sizeof (uint64_t) // Ap_Sblocks [1:Ap_nblocks] + + Ah_nblocks * sizeof (uint64_t) // Ah_Sblocks [1:Ah_nblocks] + + Ab_nblocks * sizeof (uint64_t) // Ab_Sblocks [1:Ab_nblocks] + + Ai_nblocks * sizeof (uint64_t) // Ai_Sblocks [1:Ai_nblocks] + + Ax_nblocks * sizeof (uint64_t) // Ax_Sblocks [1:Ax_nblocks] // type_name for user-defined types + ((typecode == GB_UDT_code) ? GxB_MAX_NAME_LEN : 0) ; @@ -284,10 +297,11 @@ GrB_Info GB_serialize // serialize a matrix into a blob } else { - // GxB_Matrix_serialize: allocate the block. The memory pool may + // GxB_Matrix_serialize: allocate the block. The memory allocator may // increase the blob from size blob_size_required bytes to // blob_size_allocated. - blob = GB_MALLOC (blob_size_required, GB_void, &blob_size_allocated) ; + blob = GB_MALLOC_MEMORY (blob_size_required, sizeof (GB_void), + &blob_size_allocated) ; if (blob == NULL) { // out of memory @@ -312,7 +326,39 @@ GrB_Info GB_serialize // serialize a matrix into a blob uint64_t blob_size_required64 = (uint64_t) blob_size_required ; GB_BLOB_WRITE (blob_size_required64, uint64_t) ; - GB_BLOB_WRITE (typecode, int32_t) ; + // The typecode in GraphBLAS is in range 0 to 14 and requires just 4 bits. + // In GrB v9.4.2 and earlier, an entire int32_t was written to the blob + // holding the typecode. GrB v10.0.0 adds 32/64 bit integers for A->p, + // A->h, and A->i, requiring three bits: A->p_is_32, A->j_is_32, and + // A->i_is_32. These are held as two nibbles (a nibble is 4 bits) to + // handle future extensions. + + // These 2 nibbles are implicitly zero in GrB v9.4.2 and earlier, since + // only 64-bit integers are supported in that version. + + // If GrB v10.0.0 writes a 0 to both nibbles, then GrB v9.4.2 and earlier + // can safely read the blob, since both versions support all-64-bit integer + // matrices. GrB v10.0.0 can also read any blob written by earlier + // versions; they will have zeros in those 2 nibbles, which will be + // interpretted correctly that the blob contains 64-bit integers for A->p, + // A->h, and A->i. + + // If GrB v10.0.0 writes a nonzero value to either nibble, and then GrB + // v9.4.2 attempts to deserialize the blob, it will safely report an + // invalid blob, because it will not recognize the typecode as valid (it + // will be > GB_UDT_code == 14). + +// was the following in GrB v5.2 to v9.4.2: +// GB_BLOB_WRITE (typecode, int32_t) ; +// now in GrB v10.0.0: + typecode &= 0xF ; + uint32_t encoding = + GB_LSHIFT (Ap_is_32, 12) | // bits 12 to 15: Ap_is_32 (3 bits unused) + GB_LSHIFT (Aj_is_32, 8) | // bits 8 to 11: Aj_is_32 (3 bits unused) + GB_LSHIFT (Ai_is_32, 4) | // bits 4 to 7: Ai_is_32 (3 bits unused) + GB_LSHIFT (typecode, 0) ; // bits 0 to 3: typecode + GB_BLOB_WRITE (encoding, uint32_t) ; + GB_BLOB_WRITE (version, int32_t) ; GB_BLOB_WRITE (vlen, int64_t) ; GB_BLOB_WRITE (vdim, int64_t) ; @@ -327,7 +373,23 @@ GrB_Info GB_serialize // serialize a matrix into a blob GB_BLOB_WRITE (Ax_len, int64_t) ; GB_BLOB_WRITE (hyper_switch, float) ; GB_BLOB_WRITE (bitmap_switch, float) ; - GB_BLOB_WRITE (sparsity_control, int32_t) ; + +// was the following in GrB v5.2 to v9.4.2: +// GB_BLOB_WRITE (sparsity_control, int32_t) ; +// now in GrB v10.0.0, with 8 bits reserved for sparsity_control, in case new +// sparsity formats are added in the future: + + uint32_t p_encoding = GB_pji_control_encoding (A->p_control) ; + uint32_t j_encoding = GB_pji_control_encoding (A->j_control) ; + uint32_t i_encoding = GB_pji_control_encoding (A->i_control) ; + sparsity_control &= 0xFF ; + uint32_t control_encoding = + GB_LSHIFT (p_encoding , 16) | // 4 bits + GB_LSHIFT (j_encoding , 12) | // 4 bits + GB_LSHIFT (i_encoding , 8) | // 4 bits + GB_LSHIFT (sparsity_control, 0) ; // 8 bits (only 4 needed for now) + GB_BLOB_WRITE (control_encoding, uint32_t) ; + GB_BLOB_WRITE (sparsity_iso_csc, int32_t); GB_BLOB_WRITE (Ap_nblocks, int32_t) ; GB_BLOB_WRITE (Ap_method, int32_t) ; GB_BLOB_WRITE (Ah_nblocks, int32_t) ; GB_BLOB_WRITE (Ah_method, int32_t) ; @@ -375,6 +437,12 @@ GrB_Info GB_serialize // serialize a matrix into a blob // append the GrB_NAME and GrB_EL_TYPE_STRING to the blob //-------------------------------------------------------------------------- + // GrB v8.1.0 added two optional uncompressed nul-terminated strings: the + // user name and the element-type name. GrB v8.1.0 and later detects if + // the strings are present, and thus it (and the currently GrB version) can + // safely read serialized blobs written by GrB v5.2 and later (the first + // version that included the serialization methods). + if (user_name != NULL) { // write the GrB_NAME of the matrix (including the nul byte) @@ -401,17 +469,15 @@ GrB_Info GB_serialize // serialize a matrix into a blob { // GxB_Matrix_serialize: giving the blob to the user; remove it from // the list of malloc'd blocks - #ifdef GB_MEMDUMP - printf ("removing blob %p size %ld from memtable\n", blob, // MEMDUMP + GBMDUMP ("removing blob %p size %ld from memtable\n", blob, blob_size_allocated) ; - #endif GB_Global_memtable_remove (blob) ; (*blob_handle) = blob ; } // Return the required size of the blob to the user, not the actual // allocated space of the blob. The latter may be larger because of the - // memory pool. + // memory allocator. (*blob_size_handle) = blob_size_required ; GB_FREE_WORKSPACE ; diff --git a/GraphBLAS/Source/serialize/GB_serialize.h b/GraphBLAS/Source/serialize/GB_serialize.h index 95c57d88f3..0438d6137b 100644 --- a/GraphBLAS/Source/serialize/GB_serialize.h +++ b/GraphBLAS/Source/serialize/GB_serialize.h @@ -2,7 +2,7 @@ // GB_serialize.h: definitions for GB_serialize_* and deserialize methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ GrB_Info GB_serialize_array // output: GB_blocks **Blocks_handle, // Blocks: array of size nblocks+1 size_t *Blocks_size_handle, // size of Blocks - int64_t **Sblocks_handle, // Sblocks: array of size nblocks+1 + uint64_t **Sblocks_handle, // Sblocks: array of size nblocks+1 size_t *Sblocks_size_handle, // size of Sblocks int32_t *nblocks_handle, // # of blocks int32_t *method_used, // method used @@ -82,7 +82,7 @@ void GB_serialize_to_blob size_t *s_handle, // location to append into the blob // input: GB_blocks *Blocks, // Blocks: array of size nblocks+1 - int64_t *Sblocks, // array of size nblocks + uint64_t *Sblocks, // array of size nblocks int32_t nblocks, // # of blocks int nthreads_max // # of threads to use ) ; @@ -96,7 +96,7 @@ GrB_Info GB_deserialize_from_blob int64_t X_len, // size of X in bytes const GB_void *blob, // serialized blob of size blob_size size_t blob_size, - int64_t *Sblocks, // array of size nblocks + uint64_t *Sblocks, // array of size nblocks int32_t nblocks, // # of compressed blocks for this array int32_t method_used, // compression method used for each block // input/output: @@ -117,12 +117,13 @@ GrB_Info GB_deserialize_from_blob memcpy (blob + s, &(x), sizeof (type)) ; \ s += sizeof (type) ; -// write an int64_t array to the blob +// write a uint64_t array Sblocks[1:n] to the blob, of size n+1, but do not +// write the first entry (so only n words are written) #define GB_BLOB_WRITES(S,n) \ if (n > 0) \ { \ - memcpy (((GB_void *) blob) + s, S + 1, n * sizeof (int64_t)) ; \ - s += n * sizeof (int64_t) ; \ + memcpy (((GB_void *) blob) + s, S + 1, n * sizeof (uint64_t)) ; \ + s += n * sizeof (uint64_t) ; \ } // read a scalar from the blob @@ -131,10 +132,32 @@ GrB_Info GB_deserialize_from_blob memcpy (&x, ((GB_void *) blob) + s, sizeof (type)) ; \ s += sizeof (type) ; -// get an int64_t pointer to an array in the blob +// get a uint64_t pointer to an array in the blob, of size n #define GB_BLOB_READS(S,n) \ - int64_t *S = (int64_t *) (blob + s) ; \ - s += n * sizeof (int64_t) ; + uint64_t *S = (uint64_t *) (blob + s) ; \ + s += n * sizeof (uint64_t) ; + +static inline uint32_t GB_pji_control_encoding (int8_t control) +{ + switch (control) + { + default: + case 0 : return (0) ; + case 32 : return (1) ; + case 64 : return (2) ; + } +} + +static inline int8_t GB_pji_control_decoding (uint32_t encoding) +{ + switch (encoding) + { + default: + case 0 : return (0) ; + case 1 : return (32) ; + case 2 : return (64) ; + } +} #endif diff --git a/GraphBLAS/Source/serialize/GB_serialize_array.c b/GraphBLAS/Source/serialize/GB_serialize_array.c index a1fba17d52..2db433a09f 100644 --- a/GraphBLAS/Source/serialize/GB_serialize_array.c +++ b/GraphBLAS/Source/serialize/GB_serialize_array.c @@ -2,7 +2,7 @@ // GB_serialize_array: serialize an array, with optional compression //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ #define GB_FREE_ALL \ { \ - GB_FREE (&Sblocks, Sblocks_size) ; \ + GB_FREE_MEMORY (&Sblocks, Sblocks_size) ; \ GB_serialize_free_blocks (&Blocks, Blocks_size, nblocks) ; \ } @@ -27,7 +27,7 @@ GrB_Info GB_serialize_array // output: GB_blocks **Blocks_handle, // Blocks: array of size nblocks+1 size_t *Blocks_size_handle, // size of Blocks - int64_t **Sblocks_handle, // Sblocks: array of size nblocks+1 + uint64_t **Sblocks_handle, // Sblocks: array of size nblocks+1 size_t *Sblocks_size_handle, // size of Sblocks int32_t *nblocks_handle, // # of blocks int32_t *method_used, // method used @@ -58,7 +58,7 @@ GrB_Info GB_serialize_array GB_blocks *Blocks = NULL ; size_t Blocks_size = 0, Sblocks_size = 0 ; int32_t nblocks = 0 ; - int64_t *Sblocks = NULL ; + uint64_t *Sblocks = NULL ; //-------------------------------------------------------------------------- // check for quick return @@ -73,7 +73,7 @@ GrB_Info GB_serialize_array (*compressed_size) = 0 ; if (X == NULL || len == 0) { - // input array is empty + // input array is empty; nothing to write to the blob return (GrB_SUCCESS) ; } @@ -86,8 +86,8 @@ GrB_Info GB_serialize_array // no compression, return result as a single block (plus the sentinel) if (!dryrun) { - Blocks = GB_MALLOC (2, GB_blocks, &Blocks_size) ; - Sblocks = GB_MALLOC (2, int64_t, &Sblocks_size) ; + Blocks = GB_MALLOC_MEMORY (2, sizeof (GB_blocks), &Blocks_size) ; + Sblocks = GB_MALLOC_MEMORY (2, sizeof (uint64_t), &Sblocks_size) ; if (Blocks == NULL || Sblocks == NULL) { // out of memory @@ -147,8 +147,10 @@ GrB_Info GB_serialize_array // allocate the output Blocks: one per block plus the sentinel block if (!dryrun) { - Blocks = GB_CALLOC (nblocks+1, GB_blocks, &Blocks_size) ; - Sblocks = GB_CALLOC (nblocks+1, int64_t, &Sblocks_size) ; + Blocks = GB_CALLOC_MEMORY (nblocks+1, sizeof (GB_blocks), + &Blocks_size) ; + Sblocks = GB_CALLOC_MEMORY (nblocks+1, sizeof (uint64_t), + &Sblocks_size) ; if (Blocks == NULL || Sblocks == NULL) { // out of memory @@ -192,7 +194,8 @@ GrB_Info GB_serialize_array { // allocate the block size_t size_allocated = 0 ; - GB_void *p = GB_MALLOC (s, GB_void, &size_allocated) ; + GB_void *p = GB_MALLOC_MEMORY (s, sizeof (GB_void), + &size_allocated) ; ok = (p != NULL) ; Blocks [blockid].p = p ; Blocks [blockid].p_size_allocated = size_allocated ; @@ -232,7 +235,7 @@ GrB_Info GB_serialize_array size_t dsize = Blocks [blockid].p_size_allocated ; // size of dest int dstCapacity = (int) GB_IMIN (dsize, INT32_MAX) ; int s ; - size_t s64 ; + size_t ss ; switch (algo) { @@ -240,22 +243,22 @@ GrB_Info GB_serialize_array s = LZ4_compress_default (src, dst, srcSize, dstCapacity) ; ok = ok && (s > 0) ; // compressed block is now in dst [0:s-1], of size s - Sblocks [blockid] = (int64_t) s ; + Sblocks [blockid] = (uint64_t) s ; break ; case GxB_COMPRESSION_LZ4HC : s = LZ4_compress_HC (src, dst, srcSize, dstCapacity, level) ; ok = ok && (s > 0) ; // compressed block is now in dst [0:s-1], of size s - Sblocks [blockid] = (int64_t) s ; + Sblocks [blockid] = (uint64_t) s ; break ; default : case GxB_COMPRESSION_ZSTD : - s64 = ZSTD_compress (dst, dstCapacity, src, srcSize, level) ; - ok = ok && (s64 <= dstCapacity) ; - // compressed block is now in dst [0:s64-1], of size s64 - Sblocks [blockid] = (int64_t) s64 ; + ss = ZSTD_compress (dst, dstCapacity, src, srcSize, level) ; + ok = ok && (ss <= dstCapacity) ; + // compressed block is now in dst [0:ss-1], of size ss + Sblocks [blockid] = (uint64_t) ss ; break ; } } @@ -271,7 +274,7 @@ GrB_Info GB_serialize_array // compute cumulative sum of the compressed blocks //-------------------------------------------------------------------------- - GB_cumsum1 (Sblocks, nblocks) ; + GB_cumsum1_64 (Sblocks, nblocks) ; //-------------------------------------------------------------------------- // free workspace return result diff --git a/GraphBLAS/Source/serialize/GB_serialize_free_blocks.c b/GraphBLAS/Source/serialize/GB_serialize_free_blocks.c index eb7896c3cb..3f539ec26b 100644 --- a/GraphBLAS/Source/serialize/GB_serialize_free_blocks.c +++ b/GraphBLAS/Source/serialize/GB_serialize_free_blocks.c @@ -2,7 +2,7 @@ // GB_serialize_free_blocks: free the set of blocks used to compress an array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,11 +32,11 @@ void GB_serialize_free_blocks { // free the block GB_void *p = (GB_void *) Blocks [blockid].p ; - GB_FREE (&p, p_size_allocated) ; + GB_FREE_MEMORY (&p, p_size_allocated) ; } } // free the Blocks array itself - GB_FREE (Blocks_handle, Blocks_size) ; + GB_FREE_MEMORY (Blocks_handle, Blocks_size) ; } } diff --git a/GraphBLAS/Source/serialize/GB_serialize_method.c b/GraphBLAS/Source/serialize/GB_serialize_method.c index 58affe4b0a..aa574cbd8a 100644 --- a/GraphBLAS/Source/serialize/GB_serialize_method.c +++ b/GraphBLAS/Source/serialize/GB_serialize_method.c @@ -2,7 +2,7 @@ // GB_serialize_method: parse the compression method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/serialize/GB_serialize_to_blob.c b/GraphBLAS/Source/serialize/GB_serialize_to_blob.c index 2b3329d0dd..52a6667de9 100644 --- a/GraphBLAS/Source/serialize/GB_serialize_to_blob.c +++ b/GraphBLAS/Source/serialize/GB_serialize_to_blob.c @@ -2,7 +2,7 @@ // GB_serialize_to_blob: copy a set of blocks to the blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ void GB_serialize_to_blob size_t *s_handle, // location to append into the blob // input: GB_blocks *Blocks, // Blocks: array of size nblocks+1 - int64_t *Sblocks, // array of size nblocks + uint64_t *Sblocks, // array of size nblocks int32_t nblocks, // # of blocks int nthreads_max // # of threads to use ) diff --git a/GraphBLAS/Source/serialize/GrB_Matrix_deserialize.c b/GraphBLAS/Source/serialize/GrB_Matrix_deserialize.c index 4bb59529b3..62015a1572 100644 --- a/GraphBLAS/Source/serialize/GrB_Matrix_deserialize.c +++ b/GraphBLAS/Source/serialize/GrB_Matrix_deserialize.c @@ -2,7 +2,7 @@ // GrB_Matrix_deserialize: create a matrix from a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,8 +24,8 @@ GrB_Info GrB_Matrix_deserialize // deserialize blob into a GrB_Matrix // matrix of user-defined type. May be NULL if blob // holds a built-in type; otherwise must match the // type of C. - const void *blob, // the blob - GrB_Index blob_size // size of the blob + const void *blob, // the blob + uint64_t blob_size // size of the blob ) { @@ -33,7 +33,7 @@ GrB_Info GrB_Matrix_deserialize // deserialize blob into a GrB_Matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_deserialize (&C, type, blob, blob_size)") ; + GB_CHECK_INIT ; GB_BURBLE_START ("GrB_Matrix_deserialize") ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (C) ; diff --git a/GraphBLAS/Source/serialize/GrB_Matrix_serialize.c b/GraphBLAS/Source/serialize/GrB_Matrix_serialize.c index 7509761f46..d1d3740b1c 100644 --- a/GraphBLAS/Source/serialize/GrB_Matrix_serialize.c +++ b/GraphBLAS/Source/serialize/GrB_Matrix_serialize.c @@ -2,7 +2,7 @@ // GrB_Matrix_serialize: copy a matrix into a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ /* void *blob = NULL ; - GrB_Index blob_size = 0 ; + uint64_t blob_size = 0 ; GrB_Matrix A, B = NULL ; // construct a matrix A, then serialized it: GrB_Matrix_serializeSize (&blob_size, A) ; // loose upper bound @@ -35,7 +35,7 @@ GrB_Info GrB_Matrix_serialize // serialize a GrB_Matrix to a blob // output: void *blob, // the blob, already allocated in input // input/output: - GrB_Index *blob_size_handle, // size of the blob on input. On output, + uint64_t *blob_size_handle, // size of the blob on input. On output, // the # of bytes used in the blob. // input: GrB_Matrix A // matrix to serialize @@ -46,11 +46,11 @@ GrB_Info GrB_Matrix_serialize // serialize a GrB_Matrix to a blob // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_serialize (blob, &blob_size, A)") ; - GB_BURBLE_START ("GrB_Matrix_serialize") ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (blob_size_handle) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_serialize (blob, &blob_size, A)") ; + GB_BURBLE_START ("GrB_Matrix_serialize") ; // no descriptor, so assume the default method int method = GxB_DEFAULT ; @@ -63,11 +63,10 @@ GrB_Info GrB_Matrix_serialize // serialize a GrB_Matrix to a blob //-------------------------------------------------------------------------- size_t blob_size = (size_t) (*blob_size_handle) ; - GrB_Info info = GB_serialize ((GB_void **) &blob, &blob_size, A, method, - Werk) ; + info = GB_serialize ((GB_void **) &blob, &blob_size, A, method, Werk) ; if (info == GrB_SUCCESS) { - (*blob_size_handle) = (GrB_Index) blob_size ; + (*blob_size_handle) = (uint64_t) blob_size ; } GB_BURBLE_END ; #pragma omp flush diff --git a/GraphBLAS/Source/serialize/GrB_Matrix_serializeSize.c b/GraphBLAS/Source/serialize/GrB_Matrix_serializeSize.c index aa6c57ef1b..1d03eea086 100644 --- a/GraphBLAS/Source/serialize/GrB_Matrix_serializeSize.c +++ b/GraphBLAS/Source/serialize/GrB_Matrix_serializeSize.c @@ -2,7 +2,7 @@ // GrB_Matrix_serializeSize: return an upper bound on the blob size //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ GrB_Info GrB_Matrix_serializeSize // estimate the size of a blob ( // output: - GrB_Index *blob_size_handle, // upper bound on the required size of the + uint64_t *blob_size_handle, // upper bound on the required size of the // blob on output. // input: GrB_Matrix A // matrix to serialize @@ -29,10 +29,10 @@ GrB_Info GrB_Matrix_serializeSize // estimate the size of a blob // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Matrix_serializeSize (&blob_size, A)") ; - GB_BURBLE_START ("GrB_Matrix_serialize") ; GB_RETURN_IF_NULL (blob_size_handle) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GrB_Matrix_serializeSize (&blob_size, A)") ; + GB_BURBLE_START ("GrB_Matrix_serialize") ; // no descriptor, so assume the default method int method = GxB_DEFAULT ; @@ -45,8 +45,8 @@ GrB_Info GrB_Matrix_serializeSize // estimate the size of a blob //-------------------------------------------------------------------------- size_t blob_size ; - GrB_Info info = GB_serialize (NULL, &blob_size, A, method, Werk) ; - (*blob_size_handle) = (GrB_Index) blob_size ; + info = GB_serialize (NULL, &blob_size, A, method, Werk) ; + (*blob_size_handle) = (uint64_t) blob_size ; GB_BURBLE_END ; #pragma omp flush return (info) ; diff --git a/GraphBLAS/Source/serialize/GxB_Matrix_deserialize.c b/GraphBLAS/Source/serialize/GxB_Matrix_deserialize.c index 11856d0058..b93918546d 100644 --- a/GraphBLAS/Source/serialize/GxB_Matrix_deserialize.c +++ b/GraphBLAS/Source/serialize/GxB_Matrix_deserialize.c @@ -2,7 +2,7 @@ // GxB_Matrix_deserialize: create a matrix from a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,8 +24,8 @@ GrB_Info GxB_Matrix_deserialize // deserialize blob into a GrB_Matrix // matrix of user-defined type. May be NULL if blob // holds a built-in type; otherwise must match the // type of C. - const void *blob, // the blob - GrB_Index blob_size, // size of the blob + const void *blob, // the blob + uint64_t blob_size, // size of the blob const GrB_Descriptor desc // to control # of threads used ) { @@ -34,10 +34,12 @@ GrB_Info GxB_Matrix_deserialize // deserialize blob into a GrB_Matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_deserialize (&C, type, blob, blob_size, desc)") ; - GB_BURBLE_START ("GxB_Matrix_deserialize") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (C) ; + GB_BURBLE_START ("GxB_Matrix_deserialize") ; + + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/serialize/GxB_Matrix_serialize.c b/GraphBLAS/Source/serialize/GxB_Matrix_serialize.c index e9f3dcdb4d..b578014add 100644 --- a/GraphBLAS/Source/serialize/GxB_Matrix_serialize.c +++ b/GraphBLAS/Source/serialize/GxB_Matrix_serialize.c @@ -2,7 +2,7 @@ // GxB_Matrix_serialize: copy a matrix into a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ /* void *blob = NULL ; - GrB_Index blob_size = 0 ; + uint64_t blob_size = 0 ; GrB_Matrix A, B = NULL ; // construct a matrix A, then serialized it: GxB_Matrix_serialize (&blob, &blob_size, A, NULL) ; // GxB mallocs the blob @@ -37,7 +37,7 @@ GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob ( // output: void **blob_handle, // the blob, allocated on output - GrB_Index *blob_size_handle, // size of the blob on output + uint64_t *blob_size_handle, // size of the blob on output // input: GrB_Matrix A, // matrix to serialize const GrB_Descriptor desc // descriptor to select compression method @@ -49,11 +49,12 @@ GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_serialize (&blob, &blob_size, A, desc)") ; - GB_BURBLE_START ("GxB_Matrix_serialize") ; GB_RETURN_IF_NULL (blob_handle) ; GB_RETURN_IF_NULL (blob_size_handle) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GxB_Matrix_serialize (&blob, &blob_size, A, desc)") ; + GB_BURBLE_START ("GxB_Matrix_serialize") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; // get the compression method from the descriptor @@ -67,7 +68,7 @@ GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob size_t blob_size = 0 ; info = GB_serialize ((GB_void **) blob_handle, &blob_size, A, method, Werk) ; - (*blob_size_handle) = (GrB_Index) blob_size ; + (*blob_size_handle) = (uint64_t) blob_size ; GB_BURBLE_END ; #pragma omp flush return (info) ; diff --git a/GraphBLAS/Source/serialize/GxB_Vector_deserialize.c b/GraphBLAS/Source/serialize/GxB_Vector_deserialize.c index 5e0a8c08af..39667d0dc8 100644 --- a/GraphBLAS/Source/serialize/GxB_Vector_deserialize.c +++ b/GraphBLAS/Source/serialize/GxB_Vector_deserialize.c @@ -2,7 +2,7 @@ // GxB_Vector_deserialize: create a vector from a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,8 +24,8 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector // vector of user-defined type. May be NULL if blob // holds a built-in type; otherwise must match the // type of w. - const void *blob, // the blob - GrB_Index blob_size, // size of the blob + const void *blob, // the blob + uint64_t blob_size, // size of the blob const GrB_Descriptor desc // to control # of threads used ) { @@ -34,10 +34,12 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_deserialize (&w, type, blob, blob_size, desc)") ; - GB_BURBLE_START ("GxB_Vector_deserialize") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (blob) ; GB_RETURN_IF_NULL (w) ; + GB_BURBLE_START ("GxB_Vector_deserialize") ; + + GrB_Info info ; GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/serialize/GxB_Vector_serialize.c b/GraphBLAS/Source/serialize/GxB_Vector_serialize.c index 3b9deb4b4c..1077d8db8d 100644 --- a/GraphBLAS/Source/serialize/GxB_Vector_serialize.c +++ b/GraphBLAS/Source/serialize/GxB_Vector_serialize.c @@ -2,7 +2,7 @@ // GxB_Vector_serialize: copy a vector into a serialized array of bytes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ /* void *blob = NULL ; - GrB_Index blob_size = 0 ; + uint64_t blob_size = 0 ; GrB_Vector u, B = NULL ; // construct a vector u, then serialized it: GxB_Vector_serialize (&blob, &blob_size, u, NULL) ; // GxB mallocs the blob @@ -37,7 +37,7 @@ GrB_Info GxB_Vector_serialize // serialize a GrB_Vector to a blob ( // output: void **blob_handle, // the blob, allocated on output - GrB_Index *blob_size_handle, // size of the blob on output + uint64_t *blob_size_handle, // size of the blob on output // input: GrB_Vector u, // vector to serialize const GrB_Descriptor desc // descriptor to select compression method @@ -49,11 +49,12 @@ GrB_Info GxB_Vector_serialize // serialize a GrB_Vector to a blob // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_serialize (&blob, &blob_size, u, desc)") ; - GB_BURBLE_START ("GxB_Vector_serialize") ; GB_RETURN_IF_NULL (blob_handle) ; GB_RETURN_IF_NULL (blob_size_handle) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + GB_RETURN_IF_NULL (u) ; + GB_WHERE_1 (u, "GxB_Vector_serialize (&blob, &blob_size, u, desc)") ; + GB_BURBLE_START ("GxB_Vector_serialize") ; + GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; // get the compression method from the descriptor @@ -67,7 +68,7 @@ GrB_Info GxB_Vector_serialize // serialize a GrB_Vector to a blob size_t blob_size = 0 ; info = GB_serialize ((GB_void **) blob_handle, &blob_size, (GrB_Matrix) u, method, Werk) ; - (*blob_size_handle) = (GrB_Index) blob_size ; + (*blob_size_handle) = (uint64_t) blob_size ; GB_BURBLE_END ; #pragma omp flush return (info) ; diff --git a/GraphBLAS/Source/serialize/GxB_deserialize_type_name.c b/GraphBLAS/Source/serialize/GxB_deserialize_type_name.c index e06f41d47b..4bbaa01a8d 100644 --- a/GraphBLAS/Source/serialize/GxB_deserialize_type_name.c +++ b/GraphBLAS/Source/serialize/GxB_deserialize_type_name.c @@ -2,7 +2,7 @@ // GxB_deserialize_type_name: return the JIT C name of the type of a blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,7 +28,7 @@ GrB_Info GxB_deserialize_type_name // return the type name of a blob // GxB_MAX_NAME_LEN, owned by the user application). // input, not modified: const void *blob, // the blob - GrB_Index blob_size // size of the blob + uint64_t blob_size // size of the blob ) { @@ -36,7 +36,7 @@ GrB_Info GxB_deserialize_type_name // return the type name of a blob // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_deserialize_type_name (type_name, blob, blob_size)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL (blob) ; @@ -52,7 +52,8 @@ GrB_Info GxB_deserialize_type_name // return the type name of a blob size_t s = 0 ; GB_BLOB_READ (blob_size2, uint64_t) ; - GB_BLOB_READ (typecode, int32_t) ; + GB_BLOB_READ (encoding, int32_t) ; + int typecode = encoding & 0xF ; if (blob_size2 != blob_size) { diff --git a/GraphBLAS/Source/slice/GB_ek_slice.c b/GraphBLAS/Source/slice/GB_ek_slice.c index 97cbd7858a..8db010dfba 100644 --- a/GraphBLAS/Source/slice/GB_ek_slice.c +++ b/GraphBLAS/Source/slice/GB_ek_slice.c @@ -2,12 +2,12 @@ // GB_ek_slice: slice the entries and vectors of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Slice the entries of a matrix or vector into ntasks slices. +// Slice the entries of a matrix or vector into A_ntasks slices. // The function is called GB_ek_slice because it first partitions the e entries // into chunks of identical sizes, and then finds the first and last vector @@ -17,71 +17,39 @@ // vectors kfirst_slice [t] to klast_slice [t]. The first and last vectors // may be shared with prior slices and subsequent slices. -// On input, ntasks is the # of tasks requested. +// On input, A_ntasks is the # of tasks requested. // A can have any sparsity structure (sparse, hyper, bitmap, or full). // A may be jumbled. -#include "slice/GB_ek_slice.h" +#include "GB.h" #include "slice/include/GB_search_for_vector.h" //------------------------------------------------------------------------------ // GB_ek_slice_search: find the first and last vectors in a slice //------------------------------------------------------------------------------ -static inline void GB_ek_slice_search -( - // input: - int taskid, - int ntasks, - const int64_t *restrict pstart_slice, // size ntasks+1 - const int64_t *restrict Ap, // size anvec - int64_t anvec, // # of vectors in A - int64_t avlen, // vector length of A - // output: - int64_t *restrict kfirst_slice, // size ntasks - int64_t *restrict klast_slice // size ntasks -) -{ - int64_t pfirst = pstart_slice [taskid] ; - int64_t plast = pstart_slice [taskid+1] - 1 ; +#define GB_ek_slice_search_TYPE GB_ek_slice_search_32 +#define GB_search_for_vector_TYPE GB_search_for_vector_32 +#include "slice/factory/GB_ek_slice_search_template.c" - // find the first vector of the slice for task taskid: the - // vector that owns the entry Ai [pfirst] and Ax [pfirst]. - int64_t kfirst ; - if (taskid == 0) - { - kfirst = 0 ; - } - else - { - kfirst = GB_search_for_vector (pfirst, Ap, 0, anvec, avlen) ; - } - - // find the last vector of the slice for task taskid: the - // vector that owns the entry Ai [plast] and Ax [plast]. - int64_t klast ; - if (taskid == ntasks-1) - { - klast = anvec - 1 ; - } - else if (pfirst > plast) - { - // this task does no work - klast = kfirst ; - } - else - { - klast = GB_search_for_vector (plast, Ap, kfirst, anvec, avlen) ; - } - kfirst_slice [taskid] = kfirst ; - klast_slice [taskid] = klast ; -} +#define GB_ek_slice_search_TYPE GB_ek_slice_search_64 +#define GB_search_for_vector_TYPE GB_search_for_vector_64 +#include "slice/factory/GB_ek_slice_search_template.c" //------------------------------------------------------------------------------ // GB_ek_slice: slice the entries and vectors of a matrix //------------------------------------------------------------------------------ +// void GB_ek_slice // slice a matrix +// ( +// // output: +// int64_t *restrict A_ek_slicing, // size 3*A_ntasks+1 +// // input: +// GrB_Matrix A, // matrix to slice +// int A_ntasks // # of tasks +// ) ; + GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) { @@ -90,7 +58,7 @@ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) //-------------------------------------------------------------------------- ASSERT (A_ek_slicing != NULL) ; - ASSERT (ntasks >= 1) ; + ASSERT (A_ntasks >= 1) ; //-------------------------------------------------------------------------- // get A @@ -101,18 +69,19 @@ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) int64_t anvec = A->nvec ; int64_t avlen = A->vlen ; int64_t anz = GB_nnz_held (A) ; - const int64_t *Ap = A->p ; // NULL if bitmap or full + const void *Ap = A->p ; // NULL if bitmap or full + bool Ap_is_32 = A->p_is_32 ; //-------------------------------------------------------------------------- // allocate result //-------------------------------------------------------------------------- - // kfirst_slice and klast_slice are size ntasks. - // pstart_slice is size ntasks+1 + // kfirst_slice and klast_slice are size A_ntasks. + // pstart_slice is size A_ntasks+1 int64_t *restrict kfirst_slice = A_ek_slicing ; - int64_t *restrict klast_slice = A_ek_slicing + ntasks ; - int64_t *restrict pstart_slice = A_ek_slicing + ntasks * 2 ; + int64_t *restrict klast_slice = A_ek_slicing + A_ntasks ; + int64_t *restrict pstart_slice = A_ek_slicing + A_ntasks * 2 ; //-------------------------------------------------------------------------- // quick return for empty matrices @@ -121,7 +90,7 @@ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) if (anz == 0) { // construct a single empty task - ASSERT (ntasks == 1) ; + ASSERT (A_ntasks == 1) ; pstart_slice [0] = 0 ; pstart_slice [1] = 0 ; kfirst_slice [0] = -1 ; @@ -134,7 +103,7 @@ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) //-------------------------------------------------------------------------- // FUTURE: this can be done in parallel if there are many tasks - GB_e_slice (pstart_slice, anz, ntasks) ; + GB_e_slice (pstart_slice, anz, A_ntasks) ; //-------------------------------------------------------------------------- // find the first and last vectors in each slice @@ -149,13 +118,26 @@ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) // is vector is k = klast_slice [taskid]. // FUTURE: this can be done in parallel if there are many tasks - for (int taskid = 0 ; taskid < ntasks ; taskid++) - { - GB_ek_slice_search (taskid, ntasks, pstart_slice, Ap, anvec, avlen, - kfirst_slice, klast_slice) ; + if (Ap_is_32) + { + for (int taskid = 0 ; taskid < A_ntasks ; taskid++) + { + // using GB_search_for_vector_32 (...): + GB_ek_slice_search_32 (taskid, A_ntasks, pstart_slice, Ap, + anvec, avlen, kfirst_slice, klast_slice) ; + } + } + else + { + for (int taskid = 0 ; taskid < A_ntasks ; taskid++) + { + // using GB_search_for_vector_64 (...): + GB_ek_slice_search_64 (taskid, A_ntasks, pstart_slice, Ap, + anvec, avlen, kfirst_slice, klast_slice) ; + } } ASSERT (kfirst_slice [0] == 0) ; - ASSERT (klast_slice [ntasks-1] == anvec-1) ; + ASSERT (klast_slice [A_ntasks-1] == anvec-1) ; } diff --git a/GraphBLAS/Source/slice/GB_ek_slice.h b/GraphBLAS/Source/slice/GB_ek_slice.h deleted file mode 100644 index 28d8f9ec64..0000000000 --- a/GraphBLAS/Source/slice/GB_ek_slice.h +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ek_slice.h: slice the entries and vectors of a matrix -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_EK_SLICE_H -#define GB_EK_SLICE_H - -#include "GB.h" - -//------------------------------------------------------------------------------ -// GB_ek_slice prototypes -//------------------------------------------------------------------------------ - -// Slice the entries of a matrix or vector into ntasks slices. - -// Task t does entries pstart_slice [t] to pstart_slice [t+1]-1 and -// vectors kfirst_slice [t] to klast_slice [t]. The first and last vectors -// may be shared with prior slices and subsequent slices. - -// On input, ntasks must be <= nnz (A), unless nnz (A) is zero. In that -// case, ntasks must be 1. - -void GB_ek_slice_merge2 // merge final results for matrix C -( - // output - int64_t *C_nvec_nonempty, // # of non-empty vectors in C - int64_t *restrict Cp_kfirst, // size ntasks - // input/output - int64_t *restrict Cp, // size cnvec+1 - // input - const int64_t cnvec, - const int64_t *restrict Wfirst, // size ntasks - const int64_t *restrict Wlast, // size ntasks - const int64_t *A_ek_slicing, // size 3*ntasks+1 - const int ntasks, // # of tasks used to construct C - const int nthreads, // # of threads to use - GB_Werk Werk -) ; - -#endif diff --git a/GraphBLAS/Source/slice/GB_ek_slice_merge1.c b/GraphBLAS/Source/slice/GB_ek_slice_merge1.c deleted file mode 100644 index ca8a2e8a30..0000000000 --- a/GraphBLAS/Source/slice/GB_ek_slice_merge1.c +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ek_slice_merge1: merge column counts for a matrix -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// The input matrix A has been sliced via GB_ek_slice, and scanned to compute -// the counts of entries in each vector of C in Cp, Wfirst, and Wlast. This -// phase finalizes the column counts, Cp, merging the results of each task. - -// On input, Cp [k] has been partially computed. Task tid operators on vector -// kfirst = kfirst_Aslice [tid] to klast = klast_Aslice [tid]. If kfirst < k < -// klast, then Cp [k] is the total count of entries in C(:,k). Otherwise, the -// counts are held in Wfirst and Wlast, and Cp [k] is zero (or uninititalized). -// Wfirst [tid] is the number of entries in C(:,kfirst) constructed by task -// tid, and Wlast [tid] is the number of entries in C(:,klast) constructed by -// task tid. - -// This function sums up the entries computed for C(:,k) by all tasks, so that -// on output, Cp [k] is the total count of entries in C(:,k). - -#include "slice/GB_ek_slice.h" - -GB_CALLBACK_EK_SLICE_MERGE1_PROTO (GB_ek_slice_merge1) -{ - const int64_t *restrict kfirst_Aslice = A_ek_slicing ; - const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; - - int64_t kprior = -1 ; - - for (int tid = 0 ; tid < A_ntasks ; tid++) - { - - //---------------------------------------------------------------------- - // sum up the partial result that thread tid computed for kfirst - //---------------------------------------------------------------------- - - int64_t kfirst = kfirst_Aslice [tid] ; - int64_t klast = klast_Aslice [tid] ; - - if (kfirst <= klast) - { - if (kprior < kfirst) - { - // This thread is the first one that did work on - // A(:,kfirst), so use it to start the reduction. - Cp [kfirst] = Wfirst [tid] ; - } - else - { - Cp [kfirst] += Wfirst [tid] ; - } - kprior = kfirst ; - } - - //---------------------------------------------------------------------- - // sum up the partial result that thread tid computed for klast - //---------------------------------------------------------------------- - - if (kfirst < klast) - { - ASSERT (kprior < klast) ; - // This thread is the first one that did work on - // A(:,klast), so use it to start the reduction. - Cp [klast] = Wlast [tid] ; - kprior = klast ; - } - } -} - diff --git a/GraphBLAS/Source/slice/GB_ek_slice_merge2.c b/GraphBLAS/Source/slice/GB_ek_slice_merge2.c deleted file mode 100644 index dde979d414..0000000000 --- a/GraphBLAS/Source/slice/GB_ek_slice_merge2.c +++ /dev/null @@ -1,101 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ek_slice_merge2: merge final results for matrix C -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Prior to calling this function, a method using GB_ek_slice to slice an input -// matrix A has computed the vector counts Cp, where Cp [k] is the number of -// entries in the kth vector of C on input to this function. - -// The input matrix and the matrix C is sliced by kfirst_Aslice and -// klast_Aslice, where kfirst = kfirst_Aslice [tid] is the first vector in A -// and C computed by task tid, and klast = klast_Aslice [tid] is the last -// vector computed by task tid. Tasks tid and tid+1 may cooperate on a single -// vector, however, where klast_Aslice [tid] may be the same as kfirst_Aslice -// [tid]. The method has also computed Wfirst [tid] and Wlast [tid] for each -// task id, tid. Wfirst [tid] is the number of entries task tid contributes to -// C(:,kfirst), and Wlast [tid] is the number of entries task tid contributes -// to C(:,klast). - -// On output, Cp [0:cnvec] is overwritten with its cumulative sum. -// C_nvec_nonempty is the count of how many vectors in C are empty. -// Cp_kfirst [tid] is the position in C where task tid owns entries in -// C(:,kfirst), which is a cumulative sum of the entries computed in C(:,k) for -// all tasks that cooperate to compute that vector, starting at Cp [kfirst]. -// There is no need to compute this for C(:,klast): if kfirst < klast, then -// either task tid fully owns C(:,klast), or it is always the first task to -// operate on C(:,klast). In both cases, task tid starts its computations at -// the top of C(:,klast), which can be found at Cp [klast]. - -#include "slice/GB_ek_slice.h" - -void GB_ek_slice_merge2 // merge final results for matrix C -( - // output - int64_t *C_nvec_nonempty, // # of non-empty vectors in C - int64_t *restrict Cp_kfirst, // size ntasks - // input/output - int64_t *restrict Cp, // size cnvec+1 - // input - const int64_t cnvec, - const int64_t *restrict Wfirst, // size ntasks - const int64_t *restrict Wlast, // size ntasks - const int64_t *A_ek_slicing, // size 3*ntasks+1 - const int ntasks, // # of tasks used to construct C - const int nthreads, // # of threads to use - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // Cp = cumsum (Cp) - //-------------------------------------------------------------------------- - - GB_cumsum (Cp, cnvec, C_nvec_nonempty, nthreads, Werk) ; - - //-------------------------------------------------------------------------- - // determine the slice boundaries in the new C matrix - //-------------------------------------------------------------------------- - - const int64_t *restrict kfirst_Aslice = A_ek_slicing ; - const int64_t *restrict klast_Aslice = A_ek_slicing + ntasks ; -// const int64_t *restrict pstart_Aslice = A_ek_slicing + ntasks * 2 ; - - int64_t kprior = -1 ; - int64_t pC = 0 ; - - for (int tid = 0 ; tid < ntasks ; tid++) - { - int64_t kfirst = kfirst_Aslice [tid] ; - - if (kprior < kfirst) - { - // Task tid is the first one to do work on C(:,kfirst), so it - // starts at Cp [kfirst], and it contributes Wfirst [tid] entries - // to C(:,kfirst). - pC = Cp [kfirst] ; - kprior = kfirst ; - } - - // Task tid contributes Wfirst [tid] entries to C(:,kfirst) - Cp_kfirst [tid] = pC ; - pC += Wfirst [tid] ; - - int64_t klast = klast_Aslice [tid] ; - if (kfirst < klast) - { - // Task tid is the last to contribute to C(:,kfirst). - ASSERT (pC == Cp [kfirst+1]) ; - // Task tid contributes the first Wlast [tid] entries to - // C(:,klast), so the next task tid+1 starts at location Cp [klast] - // + Wlast [tid], if its first vector is klast of this task. - pC = Cp [klast] + Wlast [tid] ; - kprior = klast ; - } - } -} - diff --git a/GraphBLAS/Source/slice/GB_ewise_slice.c b/GraphBLAS/Source/slice/GB_ewise_slice.c index 802c700105..03f71d0c1b 100644 --- a/GraphBLAS/Source/slice/GB_ewise_slice.c +++ b/GraphBLAS/Source/slice/GB_ewise_slice.c @@ -2,7 +2,7 @@ // GB_ewise_slice: slice the entries and vectors for an ewise operation //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,13 +23,13 @@ #define GB_FREE_WORKSPACE \ { \ GB_WERK_POP (Coarse, int64_t) ; \ - GB_FREE_WORK (&Cwork, Cwork_size) ; \ + GB_FREE_MEMORY (&Cwork, Cwork_size) ; \ } #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE_WORK (&TaskList, TaskList_size) ; \ + GB_FREE_MEMORY (&TaskList, TaskList_size) ; \ } #include "GB.h" @@ -38,6 +38,27 @@ // GB_ewise_slice //------------------------------------------------------------------------------ +// GrB_Info GB_ewise_slice +// ( +// // output: +// GB_task_struct **p_TaskList, // array of structs +// size_t *p_TaskList_size, // size of TaskList +// int *p_ntasks, // # of tasks constructed +// int *p_nthreads, // # of threads for eWise operation +// // input: +// const int64_t Cnvec, // # of vectors of C +// const void *Ch, // vectors of C, if hypersparse +// const bool Cj_is_32, // if true, Ch is 32-bit, else 64-bit +// const int64_t *restrict C_to_M, // mapping of C to M +// const int64_t *restrict C_to_A, // mapping of C to A +// const int64_t *restrict C_to_B, // mapping of C to B +// bool Ch_is_Mh, // if true, then Ch == Mh; GB_add only +// const GrB_Matrix M, // mask matrix to slice (optional) +// const GrB_Matrix A, // matrix to slice +// const GrB_Matrix B, // matrix to slice +// GB_Werk Werk +// ) + GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) { @@ -70,7 +91,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) (*p_ntasks ) = 0 ; (*p_nthreads ) = 1 ; - int64_t *restrict Cwork = NULL ; size_t Cwork_size = 0 ; + GB_MDECL (Cwork, , u) ; size_t Cwork_size = 0 ; GB_WERK_DECLARE (Coarse, int64_t) ; // size ntasks1+1 int ntasks1 = 0 ; @@ -119,30 +140,44 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) //-------------------------------------------------------------------------- const int64_t vlen = A->vlen ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ai = A->i ; - const int64_t *restrict Bp = B->p ; - const int64_t *restrict Bi = B->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + #ifdef GB_DEBUG + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Bh_DECLARE (Bh, const) ; GB_Bh_PTR (Bh, B) ; + #endif + GB_Bp_DECLARE (Bp, const) ; GB_Bp_PTR (Bp, B) ; bool Ch_is_Ah = (Ch != NULL && A->h != NULL && Ch == A->h) ; bool Ch_is_Bh = (Ch != NULL && B->h != NULL && Ch == B->h) ; + ASSERT (GB_IMPLIES (Ch_is_Ah, Cj_is_32 == A->j_is_32)) ; + ASSERT (GB_IMPLIES (Ch_is_Bh, Cj_is_32 == B->j_is_32)) ; - const int64_t *restrict Mp = NULL ; - const int64_t *restrict Mi = NULL ; + GB_Mp_DECLARE (Mp, const) ; GB_Mp_PTR (Mp, M) ; + void *Mi = NULL ; bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; + bool Mi_is_32 = false ; if (M != NULL) { - Mp = M->p ; - Mi = M->i ; // Ch_is_Mh is true if either true on input (for GB_add, which denotes // that Ch is a deep copy of M->h), or if Ch is a shallow copy of M->h. + // If Ch is a deep copy, the integer sizes of Ch and Mh can differ. Ch_is_Mh = Ch_is_Mh || (Ch != NULL && M_is_hyper && Ch == M->h) ; + Mi = M->i ; + Mi_is_32 = M->i_is_32 ; } + GB_IDECL (Ch, const, u) ; GB_IPTR (Ch, Cj_is_32) ; + //-------------------------------------------------------------------------- // allocate workspace //-------------------------------------------------------------------------- - Cwork = GB_MALLOC_WORK (Cnvec+1, int64_t, &Cwork_size) ; + int64_t anz = GB_nnz (A) ; + int64_t bnz = GB_nnz (A) ; + int64_t cnzmax = anz + bnz + Cnvec ; + bool Cwork_is_32 = (cnzmax < UINT32_MAX) ; + size_t cwsize = (Cwork_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + + Cwork = GB_MALLOC_MEMORY (Cnvec+1, cwsize, &Cwork_size) ; if (Cwork == NULL) { // out of memory @@ -150,6 +185,8 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) return (GrB_OUT_OF_MEMORY) ; } + GB_IPTR (Cwork, Cwork_is_32) ; + //-------------------------------------------------------------------------- // compute an estimate of the work for each vector of C //-------------------------------------------------------------------------- @@ -165,7 +202,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) // get the C(:,j) vector //---------------------------------------------------------------------- - int64_t j = GBH (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; //---------------------------------------------------------------------- // get the corresponding vector of A @@ -180,7 +217,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (kA >= -1 && kA < A->nvec) ; if (kA >= 0) { - ASSERT (j == GBH (A->h, kA)) ; + ASSERT (j == GBh_A (Ah, kA)) ; } } else if (Ch_is_Ah) @@ -188,7 +225,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) // A is hypersparse, but Ch is a shallow copy of A->h ASSERT (GB_IS_HYPERSPARSE (A)) ; kA = k ; - ASSERT (j == A->h [kA]) ; + ASSERT (j == GB_IGET (Ah, kA)) ; } else { @@ -210,7 +247,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (kB >= -1 && kB < B->nvec) ; if (kB >= 0) { - ASSERT (j == GBH (B->h, kB)) ; + ASSERT (j == GBh_B (Bh, kB)) ; } } else if (Ch_is_Bh) @@ -218,7 +255,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) // B is hypersparse, but Ch is a shallow copy of B->h ASSERT (GB_IS_HYPERSPARSE (B)) ; kB = k ; - ASSERT (j == B->h [kB]) ; + ASSERT (j == GB_IGET (Bh, kB)) ; } else { @@ -234,19 +271,21 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (kA >= -1 && kA < A->nvec) ; ASSERT (kB >= -1 && kB < B->nvec) ; const int64_t aknz = (kA < 0) ? 0 : - ((Ap == NULL) ? vlen : (Ap [kA+1] - Ap [kA])) ; + ((Ap == NULL) ? vlen : (GB_IGET (Ap, kA+1) - GB_IGET (Ap, kA))) ; const int64_t bknz = (kB < 0) ? 0 : - ((Bp == NULL) ? vlen : (Bp [kB+1] - Bp [kB])) ; + ((Bp == NULL) ? vlen : (GB_IGET (Bp, kB+1) - GB_IGET (Bp, kB))) ; - Cwork [k] = aknz + bknz + 1 ; + int64_t ckwork = aknz + bknz + 1 ; + GB_ISET (Cwork, k, ckwork) ; // Cwork [k] = ckwork ; } + GB_ISET (Cwork, Cnvec, 0) ; // Cwork [Cnvec] = 0 ; //-------------------------------------------------------------------------- // replace Cwork with its cumulative sum //-------------------------------------------------------------------------- - GB_cumsum (Cwork, Cnvec, NULL, nthreads_for_Cwork, Werk) ; - double cwork = (double) Cwork [Cnvec] ; + GB_cumsum (Cwork, Cwork_is_32, Cnvec, NULL, nthreads_for_Cwork, Werk) ; + double cwork = (double) GB_IGET (Cwork, Cnvec) ; //-------------------------------------------------------------------------- // determine # of threads and tasks for the eWise operation @@ -271,7 +310,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Cwork, Cnvec, ntasks1, false) ; + GB_p_slice (Coarse, Cwork, Cwork_is_32, Cnvec, ntasks1, false) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine @@ -287,7 +326,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) //---------------------------------------------------------------------- int64_t k = Coarse [t] ; - int64_t klast = Coarse [t+1] - 1 ; + int64_t klast = Coarse [t+1] - 1 ; if (k >= Cnvec) { @@ -345,7 +384,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) // get the vector of C //------------------------------------------------------------------ - int64_t j = GBH (Ch, k) ; + int64_t j = GBh_C (Ch, k) ; //------------------------------------------------------------------ // get the corresponding vector of A @@ -370,8 +409,8 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (!GB_IS_HYPERSPARSE (A)) ; kA = j ; } - int64_t pA_start = (kA < 0) ? (-1) : GBP (Ap, kA, vlen) ; - int64_t pA_end = (kA < 0) ? (-1) : GBP (Ap, kA+1, vlen) ; + int64_t pA_start = (kA < 0) ? (-1) : GBp_A (Ap, kA, vlen) ; + int64_t pA_end = (kA < 0) ? (-1) : GBp_A (Ap, kA+1, vlen) ; bool a_empty = (pA_end == pA_start) ; //------------------------------------------------------------------ @@ -397,8 +436,8 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (!GB_IS_HYPERSPARSE (B)) ; kB = j ; } - int64_t pB_start = (kB < 0) ? (-1) : GBP (Bp, kB, vlen) ; - int64_t pB_end = (kB < 0) ? (-1) : GBP (Bp, kB+1, vlen) ; + int64_t pB_start = (kB < 0) ? (-1) : GBp_B (Bp, kB, vlen) ; + int64_t pB_end = (kB < 0) ? (-1) : GBp_B (Bp, kB+1, vlen) ; bool b_empty = (pB_end == pB_start) ; //------------------------------------------------------------------ @@ -431,8 +470,8 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ASSERT (!GB_IS_HYPERSPARSE (M)) ; kM = j ; } - pM_start = (kM < 0) ? -1 : GBP (Mp, kM, vlen) ; - pM_end = (kM < 0) ? -1 : GBP (Mp, kM+1, vlen) ; + pM_start = (kM < 0) ? -1 : GBp_M (Mp, kM, vlen) ; + pM_end = (kM < 0) ? -1 : GBp_M (Mp, kM+1, vlen) ; } bool m_empty = (pM_end == pM_start) ; @@ -440,7 +479,7 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) // determine the # of fine-grain tasks to create for vector k //------------------------------------------------------------------ - double ckwork = Cwork [k+1] - Cwork [k] ; + double ckwork = GB_IGET (Cwork, k+1) - GB_IGET (Cwork, k) ; int nfine = ckwork / target_task_size ; nfine = GB_IMAX (nfine, 1) ; @@ -486,9 +525,9 @@ GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) double target_work = ((nfine-tfine) * ckwork) / nfine ; int64_t pM, pA, pB ; GB_slice_vector (&i, &pM, &pA, &pB, - pM_start, pM_end, Mi, - pA_start, pA_end, Ai, - pB_start, pB_end, Bi, + pM_start, pM_end, Mi, Mi_is_32, + pA_start, pA_end, A->i, A->i_is_32, + pB_start, pB_end, B->i, B->i_is_32, vlen, target_work) ; // prior task ends at pM-1, pA-1, and pB-1 diff --git a/GraphBLAS/Source/slice/GB_p_slice.c b/GraphBLAS/Source/slice/GB_p_slice.c index 939e548bc6..1a8816b02a 100644 --- a/GraphBLAS/Source/slice/GB_p_slice.c +++ b/GraphBLAS/Source/slice/GB_p_slice.c @@ -1,118 +1,68 @@ //------------------------------------------------------------------------------ -// GB_p_slice: partition Ap for a set of tasks +// GB_p_slice: partition Work for a set of tasks //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Ap [0..n] is an array with monotonically increasing entries. This function -// slices Ap so that each chunk has the same number of total values of its -// entries. Ap can be A->p for a matrix and then n = A->nvec. Or it can be -// the work needed for computing each vector of a matrix (see GB_ewise_slice -// and GB_subref_slice, for example). +// Work [0..n] is an array with monotonically increasing entries, of type +// uint32_t, uint64_t, or float. This function slices Work so that each chunk +// has the same number of total values of its entries. Work can be A->p for a +// matrix and then n = A->nvec. Or it can be the work needed for computing n +// tasks, where Work [p] is the work for task p. -// If Ap is NULL then the matrix A (not provided here) is full or bitmap, -// which this function handles (Ap is implicit). +// If Work is NULL then the matrix A (not provided here) is full or bitmap, +// which this function handles (Work is implicit). #include "GB.h" //------------------------------------------------------------------------------ -// GB_p_slice_worker: partition Ap for a set of tasks +// GB_p_slice_32 and GB_p_slice_64: for Work as uint32_t or uint64_t //------------------------------------------------------------------------------ -static void GB_p_slice_worker -( - int64_t *restrict Slice, // size ntasks+1 - const int64_t *restrict Ap, // array size n+1 - int tlo, // assign to Slice [(tlo+1):(thi-1)] - int thi -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - #ifdef GB_DEBUG - ASSERT (Ap != NULL) ; - ASSERT (Slice != NULL) ; - ASSERT (0 <= tlo && tlo < thi - 1) ; - for (int t = tlo+1 ; t <= thi-1 ; t++) - { - ASSERT (Slice [t] == -1) ; - } - #endif - - //-------------------------------------------------------------------------- - // assign work to Slice [(tlo+1):(thi-1)] - //-------------------------------------------------------------------------- - - // klo = Slice [tlo] and khi = Slice [thi] are defined on input, where - // tlo < thi - 1. This determines the task boundaries for tasks - // tlo+1 to thi-1, which defines Slice [(tlo+1):(thi-1)]. - - int64_t klo = Slice [tlo] ; - int64_t khi = Slice [thi] ; ASSERT (0 <= klo && klo <= khi) ; - int64_t p1 = Ap [klo] ; - int64_t p2 = Ap [khi] ; ASSERT (p1 <= p2) ; - - if (p1 == p2 || klo == khi) - { - - //---------------------------------------------------------------------- - // no work is left so simply fill in with empty tasks - //---------------------------------------------------------------------- - - int64_t k = klo ; - for (int64_t t = tlo+1 ; t <= thi-1 ; t++) - { - Slice [t] = k ; - } - - } - else // p1 < p2 && klo < khi - { - - //---------------------------------------------------------------------- - // find task t that evenly partitions the work p1:p2 to tasks tlo:thi - //---------------------------------------------------------------------- +#define GB_ENABLE_PERFECT_BALANCE +#define GB_Work_TYPE uint32_t +#define GB_p_slice_TYPE GB_p_slice_32 +#define GB_p_slice_worker_TYPE GB_p_slice_worker_32 +#define GB_trim_binary_search_TYPE GB_trim_binary_search_32 +#include "slice/factory/GB_p_slice_template.c" - int64_t k = (klo + khi) / 2 ; ASSERT (klo <= k && k <= khi) ; - int64_t p = Ap [k] ; ASSERT (p1 <= p && p <= p2) ; - double ntasks = thi - tlo ; - double ratio = (((double) (p - p1)) / ((double) (p2 - p1))) ; - int t = tlo + (int) floor (ratio * ntasks) ; - t = GB_IMAX (t, tlo+1) ; - t = GB_IMIN (t, thi-1) ; ASSERT (tlo < t && t < thi) ; +#define GB_Work_TYPE uint64_t +#define GB_p_slice_TYPE GB_p_slice_64 +#define GB_p_slice_worker_TYPE GB_p_slice_worker_64 +#define GB_trim_binary_search_TYPE GB_trim_binary_search_64 +#include "slice/factory/GB_p_slice_template.c" - //---------------------------------------------------------------------- - // assign work to task t - //---------------------------------------------------------------------- - - ASSERT (Slice [t] == -1) ; - Slice [t] = k ; +//------------------------------------------------------------------------------ +// GB_p_slice_float: for Work as float +//------------------------------------------------------------------------------ - //---------------------------------------------------------------------- - // recursively partition for tasks (tlo+1):(t-1) and (t+1):(thi-1) - //---------------------------------------------------------------------- +// no perfect balance when Work is float - if (tlo < t-1) - { - GB_p_slice_worker (Slice, Ap, tlo, t) ; - } - if (t < thi-1) - { - GB_p_slice_worker (Slice, Ap, t, thi) ; - } - } -} +#undef GB_ENABLE_PERFECT_BALANCE +#define GB_Work_TYPE float +#define GB_p_slice_TYPE GB_p_slice_float +#define GB_p_slice_worker_TYPE GB_p_slice_worker_float +#include "slice/factory/GB_p_slice_template.c" //------------------------------------------------------------------------------ -// GB_p_slice: partition Ap for a set of tasks +// GB_p_slice: partition Work for a set of tasks (uint32_t or uint64_t only) //------------------------------------------------------------------------------ +// void GB_p_slice // slice Work, 32-bit or 64-bit +// ( +// // output: +// int64_t *restrict Slice, // size ntasks+1 +// // input: +// const void *Work, // array size n+1 (full/bitmap: NULL) +// bool Work_is_32, // if true, Work is uint32_t, else uint64_t +// const int64_t n, +// const int ntasks, // # of tasks +// const bool perfectly_balanced +// ) + GB_CALLBACK_P_SLICE_PROTO (GB_p_slice) { @@ -121,84 +71,29 @@ GB_CALLBACK_P_SLICE_PROTO (GB_p_slice) //-------------------------------------------------------------------------- ASSERT (Slice != NULL) ; - #ifdef GB_DEBUG - for (int taskid = 0 ; taskid <= ntasks ; taskid++) - { - Slice [taskid] = -1 ; - } - #endif //-------------------------------------------------------------------------- // slice the work //-------------------------------------------------------------------------- - if (Ap == NULL) + if (Work == NULL) { - - //---------------------------------------------------------------------- // A is full or bitmap: slice 0:n equally for all tasks - //---------------------------------------------------------------------- - GB_e_slice (Slice, n, ntasks) ; - } else { - - //---------------------------------------------------------------------- // A is sparse or hypersparse - //---------------------------------------------------------------------- - - if (n == 0 || ntasks <= 1 || Ap [n] == 0) + if (Work_is_32) { - // matrix is empty, or a single thread is used - memset ((void *) Slice, 0, ntasks * sizeof (int64_t)) ; - Slice [ntasks] = n ; + // Work is uint32_t + GB_p_slice_32 (Slice, Work, n, ntasks, perfectly_balanced) ; } else - { - // slice Ap by # of entries - Slice [0] = 0 ; - Slice [ntasks] = n ; - if (perfectly_balanced) - { - // this method is costly, and should only be used if the - // work is to be perfectly balanced (in particular, when there - // is just one task per thread, with static scheduling) - const double work = (double) (Ap [n]) ; - int64_t k = 0 ; - for (int taskid = 1 ; taskid < ntasks ; taskid++) - { - // binary search to find k so that Ap [k] == (taskid*work) / - // ntasks. The exact value will not typically not be found; - // just pick what the binary search comes up with. - int64_t wtask = (int64_t) GB_PART (taskid, work, ntasks) ; - int64_t pright = n ; - GB_TRIM_BINARY_SEARCH (wtask, Ap, k, pright) ; - Slice [taskid] = k ; - } - } - else - { - // this is much faster, and results in good load balancing if - // there is more than one task per thread, and dynamic - // scheduling is used. - GB_p_slice_worker (Slice, Ap, 0, ntasks) ; - } + { + // Work is uint64_t + GB_p_slice_64 (Slice, Work, n, ntasks, perfectly_balanced) ; } } - - //-------------------------------------------------------------------------- - // check result - //-------------------------------------------------------------------------- - - #ifdef GB_DEBUG - ASSERT (Slice [0] == 0) ; - ASSERT (Slice [ntasks] == n) ; - for (int taskid = 0 ; taskid < ntasks ; taskid++) - { - ASSERT (Slice [taskid] <= Slice [taskid+1]) ; - } - #endif } diff --git a/GraphBLAS/Source/slice/GB_slice_vector.c b/GraphBLAS/Source/slice/GB_slice_vector.c index 1b050110ac..fade80d51e 100644 --- a/GraphBLAS/Source/slice/GB_slice_vector.c +++ b/GraphBLAS/Source/slice/GB_slice_vector.c @@ -2,7 +2,7 @@ // GB_slice_vector: slice a vector for GB_add, GB_emult, and GB_mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -54,24 +54,33 @@ void GB_slice_vector // input: const int64_t pM_start, // M(:,kM) starts at pM_start in Mi,Mx const int64_t pM_end, // M(:,kM) ends at pM_end-1 in Mi,Mx - const int64_t *restrict Mi, // indices of M (or NULL) + const void *Mi, // indices of M (or NULL) + const bool Mi_is_32, // if true, Mi is 32-bit; else 64 bit const int64_t pA_start, // A(:,kA) starts at pA_start in Ai,Ax const int64_t pA_end, // A(:,kA) ends at pA_end-1 in Ai,Ax - const int64_t *restrict Ai, // indices of A (or NULL) + const void *Ai, // indices of A (or NULL) + const bool Ai_is_32, // if true, Ai is 32-bit; else 64 bit const int64_t pB_start, // B(:,kB) starts at pB_start in Bi,Bx const int64_t pB_end, // B(:,kB) ends at pB_end-1 in Bi,Bx - const int64_t *restrict Bi, // indices of B (or NULL) + const void *Bi, // indices of B (or NULL) + const bool Bi_is_32, // if true, Bi is 32-bit; else 64 bit const int64_t vlen, // A->vlen and B->vlen const double target_work // target work ) { //-------------------------------------------------------------------------- - // check inputs + // get inputs //-------------------------------------------------------------------------- ASSERT (p_pA != NULL && p_pB != NULL) ; + #ifdef GB_DEBUG + GB_IDECL (Mi, const, u) ; GB_IPTR (Mi, Mi_is_32) ; + GB_IDECL (Ai, const, u) ; GB_IPTR (Ai, Ai_is_32) ; + GB_IDECL (Bi, const, u) ; GB_IPTR (Bi, Bi_is_32) ; + #endif + //-------------------------------------------------------------------------- // find i, pA, and pB for the start of this task //-------------------------------------------------------------------------- @@ -116,24 +125,27 @@ void GB_slice_vector // A(:,kA) is dense (bitmap, full, or all entries present) // no need for a binary search pA = pA_start + i ; - ASSERT (GBI (Ai, pA, vlen) == i) ; + ASSERT (GBi_A (Ai, pA, vlen) == i) ; } else { // Ai is an explicit integer list, Ai [pA_start:pA_end-1] ASSERT (aknz > 0) ; + ASSERT (Ai != NULL) ; pA = pA_start ; - bool afound ; int64_t apright = pA_end - 1 ; - GB_SPLIT_BINARY_SEARCH (i, Ai, pA, apright, afound) ; - ASSERT (GB_IMPLIES (afound, GBI (Ai, pA, vlen) == i)) ; + #ifdef GB_DEBUG + bool afound = + #endif + GB_split_binary_search (i, Ai, Ai_is_32, &pA, &apright) ; + ASSERT (GB_IMPLIES (afound, GBi_A (Ai, pA, vlen) == i)) ; ASSERT (pA_start <= pA && pA <= pA_end) ; } ASSERT (GB_IMPLIES (pA > pA_start && pA < pA_end, - (GBI (Ai, pA-1, vlen) < i))) ; + (GBi_A (Ai, pA-1, vlen) < i))) ; ASSERT (GB_IMPLIES (pA >= pA_start && pA < pA_end, - (GBI (Ai, pA, vlen) >= i ))) ; + (GBi_A (Ai, pA, vlen) >= i ))) ; // Ai has been split. If afound is false: // Ai [pA_start : pA-1] < i @@ -161,7 +173,7 @@ void GB_slice_vector // B(:,kB) is dense (bitmap, full, or all entries present) // no need for a binary search pB = pB_start + i ; - ASSERT (GBI (Bi, pB, vlen) == i) ; + ASSERT (GBi_B (Bi, pB, vlen) == i) ; } else { @@ -169,20 +181,19 @@ void GB_slice_vector ASSERT (bknz > 0) ; ASSERT (Bi != NULL) ; pB = pB_start ; - bool bfound ; int64_t bpright = pB_end - 1 ; - GB_SPLIT_BINARY_SEARCH (i, Bi, pB, bpright, bfound) ; + GB_split_binary_search (i, Bi, Bi_is_32, &pB, &bpright) ; ASSERT (pB_start <= pB && pB <= pB_end) ; } ASSERT (GB_IMPLIES (pB > pB_start && pB < pB_end, - (GBI (Bi, pB-1, vlen) < i))) ; + (GBi_B (Bi, pB-1, vlen) < i))) ; ASSERT (GB_IMPLIES (pB >= pB_start && pB < pB_end, - (GBI (Bi, pB, vlen) >= i ))) ; + (GBi_B (Bi, pB, vlen) >= i ))) ; - // Bi has been split. If bfound is false: + // Bi has been split. If i is not found in Bi [...]: // Bi [pB_start : pB-1] < i // Bi [pB : pB_end-1] > i - // If bfound is true: + // If i is found: // Bi [pB_start : pB-1] < i // Bi [pB : pB_end-1] >= i // @@ -252,7 +263,7 @@ void GB_slice_vector // M(:,kM) is dense (bitmap, full, or all entries present) // no need for a binary search pM = pM_start + i ; - ASSERT (GBI (Mi, pM, vlen) == i) ; + ASSERT (GBi_M (Mi, pM, vlen) == i) ; } else { @@ -260,9 +271,8 @@ void GB_slice_vector ASSERT (mknz > 0) ; ASSERT (Mi != NULL) ; pM = pM_start ; - bool mfound ; int64_t mpright = pM_end - 1 ; - GB_SPLIT_BINARY_SEARCH (i, Mi, pM, mpright, mfound) ; + GB_split_binary_search (i, Mi, Mi_is_32, &pM, &mpright) ; } //-------------------------------------------------------------------------- @@ -273,17 +283,17 @@ void GB_slice_vector // or if any vector is empty, their p* pointer is -1. ASSERT (GB_IMPLIES ((pM > pM_start && pM < pM_end), - GBI (Mi, pM-1, vlen) < i)) ; + GBi_M (Mi, pM-1, vlen) < i)) ; ASSERT (GB_IMPLIES ((pM >= pM_start && pM < pM_end), - GBI (Mi, pM, vlen) >= i)) ; + GBi_M (Mi, pM, vlen) >= i)) ; ASSERT (GB_IMPLIES ((pA > pA_start && pA < pA_end), - GBI (Ai, pA-1, vlen) < i)) ; + GBi_A (Ai, pA-1, vlen) < i)) ; ASSERT (GB_IMPLIES ((pA >= pA_start && pA < pA_end), - GBI (Ai, pA, vlen) >= i)) ; + GBi_A (Ai, pA, vlen) >= i)) ; ASSERT (GB_IMPLIES ((pB > pB_start && pB < pB_end), - GBI (Bi, pB-1, vlen) < i)) ; + GBi_B (Bi, pB-1, vlen) < i)) ; ASSERT (GB_IMPLIES ((pB >= pB_start && pB < pB_end), - GBI (Bi, pB, vlen) >= i)) ; + GBi_B (Bi, pB, vlen) >= i)) ; if (p_i != NULL) { diff --git a/GraphBLAS/Source/slice/GB_task_cumsum.c b/GraphBLAS/Source/slice/GB_task_cumsum.c index 54c93c1f4f..43ae32f8df 100644 --- a/GraphBLAS/Source/slice/GB_task_cumsum.c +++ b/GraphBLAS/Source/slice/GB_task_cumsum.c @@ -2,7 +2,7 @@ // GB_task_cumsum: cumulative sum of Cp and fine tasks in TaskList //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,8 @@ void GB_task_cumsum ( - int64_t *Cp, // size Cnvec+1 + void *Cp, // size Cnvec+1 + const bool Cp_is_32, // if true, Cp is 32-bit, else 64-bit const int64_t Cnvec, int64_t *Cnvec_nonempty, // # of non-empty vectors in C GB_task_struct *restrict TaskList, // array of structs @@ -24,7 +25,7 @@ void GB_task_cumsum { //-------------------------------------------------------------------------- - // check inputs + // get inputs //-------------------------------------------------------------------------- ASSERT (Cp != NULL) ; @@ -34,6 +35,8 @@ void GB_task_cumsum ASSERT (ntasks >= 0) ; ASSERT (nthreads >= 1) ; + GB_IDECL (Cp, , u) ; GB_IPTR (Cp, Cp_is_32) ; + //-------------------------------------------------------------------------- // local cumulative sum of the fine tasks //-------------------------------------------------------------------------- @@ -52,8 +55,9 @@ void GB_task_cumsum // Cp [k] has not been cumsum'd across all of Cp. It is just the // count of the entries in C(:,k). The final Cp [k] is added to // each fine task below, after the GB_cumsum of Cp. - int64_t pC = Cp [k] ; - Cp [k] += TaskList [taskid].pC ; + int64_t pC = GB_IGET (Cp, k) ; + int64_t cpk = pC + TaskList [taskid].pC ; + GB_ISET (Cp, k, cpk) ; // Cp [k] = cpk ; TaskList [taskid].pC = pC ; } } @@ -62,7 +66,7 @@ void GB_task_cumsum // replace Cp with its cumulative sum //-------------------------------------------------------------------------- - GB_cumsum (Cp, Cnvec, Cnvec_nonempty, nthreads, Werk) ; + GB_cumsum (Cp, Cp_is_32, Cnvec, Cnvec_nonempty, nthreads, Werk) ; //-------------------------------------------------------------------------- // shift the cumulative sum of the fine tasks @@ -79,7 +83,7 @@ void GB_task_cumsum // computed by the first task, and so on. Cp [k] needs to be added // to all offsets to get the final starting position for each fine // task in C. - TaskList [taskid].pC += Cp [k] ; + TaskList [taskid].pC += GB_IGET (Cp, k) ; } else { @@ -90,24 +94,24 @@ void GB_task_cumsum // also given TaskList [taskid].pC = Cp [k], then taskid-1 will // always know its pC_end, which is TaskList [taskid].pC, // regardless of whether taskid is a fine or coarse task. - TaskList [taskid].pC = Cp [k] ; + TaskList [taskid].pC = GB_IGET (Cp, k) ; } } // The last task is ntasks-1. It may be a fine task, in which case it // computes the entries in C from TaskList [ntasks-1].pC to // TaskList [ntasks].pC-1, inclusive. - TaskList [ntasks].pC = Cp [Cnvec] ; + TaskList [ntasks].pC = GB_IGET (Cp, Cnvec) ; //-------------------------------------------------------------------------- // check result //-------------------------------------------------------------------------- #ifdef GB_DEBUG - // nthreads, ntasks, Cnvec) ; for (int t = 0 ; t < ntasks ; t++) { int64_t k = TaskList [t].kfirst ; + ASSERT (k >= 0 && k < Cnvec) ; int64_t klast = TaskList [t].klast ; if (klast < 0) { @@ -120,7 +124,6 @@ void GB_task_cumsum int64_t pC_end = TaskList [t+1].pC ; int64_t pM = TaskList [t].pM ; int64_t pM_end = TaskList [t].pM_end ; - ASSERT (k >= 0 && k < Cnvec) ; // pA:(pA_end-1) must reside inside A(:,j), and pB:(pB_end-1) must // reside inside B(:,j), but these cannot be checked here since A // and B are not available. These basic checks can be done: @@ -129,12 +132,13 @@ void GB_task_cumsum ASSERT (pM == -1 || (0 <= pM && pM <= pM_end)) ; // pC and pC_end can be checked exactly. This task t computes // entries pC:(pC_end-1) of C, inclusive. - ASSERT (Cp [k] <= pC && pC <= pC_end && pC_end <= Cp [k+1]) ; + ASSERT (GB_IGET (Cp, k) <= pC) ; + ASSERT (pC <= pC_end) ; + ASSERT (pC_end <= GB_IGET (Cp, k+1)) ; } else { // this is a coarse task for vectors k:klast, inclusive - ASSERT (k >= 0 && k < Cnvec) ; ASSERT (klast >= 0 && klast <= Cnvec) ; ASSERT (k <= klast) ; } diff --git a/GraphBLAS/Source/slice/GB_task_methods.h b/GraphBLAS/Source/slice/GB_task_methods.h index b3abbe0459..769c5b53fa 100644 --- a/GraphBLAS/Source/slice/GB_task_methods.h +++ b/GraphBLAS/Source/slice/GB_task_methods.h @@ -2,7 +2,7 @@ // GB_task_methods.h: parallel task descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,7 +41,8 @@ bool ok ; \ int nold = (max_ntasks == 0) ? 0 : (max_ntasks + 1) ; \ int nnew = 2 * (ntasks) + 1 ; \ - GB_REALLOC_WORK (TaskList, nnew, GB_task_struct, &TaskList_size, &ok) ;\ + GB_REALLOC_MEMORY (TaskList, nnew, sizeof (GB_task_struct), \ + &TaskList_size, &ok) ; \ if (!ok) \ { \ /* out of memory */ \ @@ -77,20 +78,24 @@ void GB_slice_vector // input: const int64_t pM_start, // M(:,kM) starts at pM_start in Mi,Mx const int64_t pM_end, // M(:,kM) ends at pM_end-1 in Mi,Mx - const int64_t *restrict Mi, // indices of M (or NULL) + const void *Mi, // indices of M (or NULL) + const bool Mi_is_32, // if true, Mi is 32-bit; else 64 bit const int64_t pA_start, // A(:,kA) starts at pA_start in Ai,Ax const int64_t pA_end, // A(:,kA) ends at pA_end-1 in Ai,Ax - const int64_t *restrict Ai, // indices of A + const void *Ai, // indices of A (or NULL) + const bool Ai_is_32, // if true, Ai is 32-bit; else 64 bit const int64_t pB_start, // B(:,kB) starts at pB_start in Bi,Bx const int64_t pB_end, // B(:,kB) ends at pB_end-1 in Bi,Bx - const int64_t *restrict Bi, // indices of B + const void *Bi, // indices of B (or NULL) + const bool Bi_is_32, // if true, Bi is 32-bit; else 64 bit const int64_t vlen, // A->vlen and B->vlen const double target_work // target work ) ; void GB_task_cumsum ( - int64_t *Cp, // size Cnvec+1 + void *Cp, // size Cnvec+1 + const bool Cp_is_32, // if true, Cp is 32-bit, else 64-bit const int64_t Cnvec, int64_t *Cnvec_nonempty, // # of non-empty vectors in C GB_task_struct *restrict TaskList, // array of structs @@ -99,5 +104,37 @@ void GB_task_cumsum GB_Werk Werk ) ; +void GB_p_slice_32 // slice Work, 32-bit +( + // output: + int64_t *restrict Slice, // size ntasks+1 + // input: + const uint32_t *Work, // array size n+1 + const int64_t n, + const int ntasks, // # of tasks + const bool perfectly_balanced +) ; + +void GB_p_slice_64 // slice Work, 64-bit +( + // output: + int64_t *restrict Slice, // size ntasks+1 + // input: + const uint64_t *Work, // array size n+1 + const int64_t n, + const int ntasks, // # of tasks + const bool perfectly_balanced +) ; + +void GB_p_slice_float // slice Work, float +( + // output: + int64_t *restrict Slice, // size ntasks+1 + // input: + const float *Work, // array size n+1 + const int64_t n, + const int ntasks // # of tasks +) ; + #endif diff --git a/GraphBLAS/Source/slice/factory/GB_ek_slice_merge.h b/GraphBLAS/Source/slice/factory/GB_ek_slice_merge.h new file mode 100644 index 0000000000..04605e9dde --- /dev/null +++ b/GraphBLAS/Source/slice/factory/GB_ek_slice_merge.h @@ -0,0 +1,222 @@ +//------------------------------------------------------------------------------ +// GB_ek_slice_merge.h: slice the entries and vectors of a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_EK_SLICE_MERGE_H +#define GB_EK_SLICE_MERGE_H + +//------------------------------------------------------------------------------ +// GB_ek_slice_merge* methods +//------------------------------------------------------------------------------ + +// GB_ek_slice slices the entries of a matrix or vector into A_ntasks slices. +// Its prototype is in Source/callback: + +// void GB_ek_slice // slice a matrix +// ( +// // output: +// int64_t *restrict A_ek_slicing, // size 3*A_ntasks+1 +// // input: +// GrB_Matrix A, // matrix to slice +// int A_ntasks // # of tasks +// ) ; + +// Task t does entries pstart_slice [t] to pstart_slice [t+1]-1 and +// vectors kfirst_slice [t] to klast_slice [t]. The first and last vectors +// may be shared with prior slices and subsequent slices. + +// On input, A_ntasks must be <= nnz (A), unless nnz (A) is zero. In that +// case, A_ntasks must be 1. + +// GB_ek_slice can optionally be followed by GB_ek_slice_merge1 and +// GB_ek_slice_merge2, defined below, to finalize the work on the output matrix +// C->p, for sparse select and emult methods. + +//------------------------------------------------------------------------------ +// GB_ek_slice_merge1: merge column counts for a matrix +//------------------------------------------------------------------------------ + +// The input matrix A has been sliced via GB_ek_slice, and scanned to compute +// the counts of entries in each vector of C in Cp, Wfirst, and Wlast. This +// phase finalizes the column counts, Cp, merging the results of each task. + +// On input, Cp [k] has been partially computed. Task tid operators on vector +// kfirst = kfirst_Aslice [tid] to klast = klast_Aslice [tid]. If kfirst < k < +// klast, then Cp [k] is the total count of entries in C(:,k). Otherwise, the +// counts are held in Wfirst and Wlast, and Cp [k] is zero (or uninititalized). +// Wfirst [tid] is the number of entries in C(:,kfirst) constructed by task +// tid, and Wlast [tid] is the number of entries in C(:,klast) constructed by +// task tid. + +// This function sums up the entries computed for C(:,k) by all tasks, so that +// on output, Cp [k] is the total count of entries in C(:,k). + +static inline void GB_ek_slice_merge1 // merge column counts for the matrix C +( + // input/output: + void *Cp, // column counts + // input: + const bool Cp_is_32, // if true, Cp is 32-bit; else 64 + const uint64_t *restrict Wfirst, // size A_ntasks + const uint64_t *restrict Wlast, // size A_ntasks + const int64_t *A_ek_slicing, // size 3*A_ntasks+1 + const int A_ntasks // # of tasks to slice A +) +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_IDECL (Cp, , u) ; GB_IPTR (Cp, Cp_is_32) ; + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; +// const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + + //-------------------------------------------------------------------------- + // merge column counts + //-------------------------------------------------------------------------- + + int64_t kprior = -1 ; + + for (int tid = 0 ; tid < A_ntasks ; tid++) + { + + //---------------------------------------------------------------------- + // sum up the partial result that thread tid computed for kfirst + //---------------------------------------------------------------------- + + int64_t kfirst = kfirst_Aslice [tid] ; + int64_t klast = klast_Aslice [tid] ; + + if (kfirst <= klast) + { + uint64_t c = Wfirst [tid] ; + if (kprior < kfirst) + { + // This thread is the first one that did work on + // A(:,kfirst), so use it to start the reduction. + // Cp [kfirst] = Wfirst [tid] ; + } + else + { + // Cp [kfirst] += Wfirst [tid] ; + c += GB_IGET (Cp, kfirst) ; + } + // Cp [kfirst] = c ; + GB_ISET (Cp, kfirst, c) ; + kprior = kfirst ; + } + + //---------------------------------------------------------------------- + // sum up the partial result that thread tid computed for klast + //---------------------------------------------------------------------- + + if (kfirst < klast) + { + ASSERT (kprior < klast) ; + // This thread is the first one that did work on + // A(:,klast), so use it to start the reduction. + // Cp [klast] = Wlast [tid] ; + uint64_t c = Wlast [tid] ; + GB_ISET (Cp, klast, c) ; + kprior = klast ; + } + } +} + + +//------------------------------------------------------------------------------ +// GB_ek_slice_merge2: merge final results for matrix C +//------------------------------------------------------------------------------ + +// Prior to calling this function, a method using GB_ek_slice to slice an input +// matrix A has computed the vector counts Cp, where Cp [k] is the number of +// entries in the kth vector of C on input to this function. + +// The input matrix and the matrix C is sliced by kfirst_Aslice and +// klast_Aslice, where kfirst = kfirst_Aslice [tid] is the first vector in A +// and C computed by task tid, and klast = klast_Aslice [tid] is the last +// vector computed by task tid. Tasks tid and tid+1 may cooperate on a single +// vector, however, where klast_Aslice [tid] may be the same as kfirst_Aslice +// [tid]. The method has also computed Wfirst [tid] and Wlast [tid] for each +// task id, tid. Wfirst [tid] is the number of entries task tid contributes to +// C(:,kfirst), and Wlast [tid] is the number of entries task tid contributes +// to C(:,klast). + +// Cp_kfirst [tid] is the position in C where task tid owns entries in +// C(:,kfirst), which is a cumulative sum of the entries computed in C(:,k) for +// all tasks that cooperate to compute that vector, starting at Cp [kfirst]. +// There is no need to compute this for C(:,klast): if kfirst < klast, then +// either task tid fully owns C(:,klast), or it is always the first task to +// operate on C(:,klast). In both cases, task tid starts its computations at +// the top of C(:,klast), which can be found at Cp [klast]. + +static inline void GB_ek_slice_merge2 // merge final results for matrix C +( + // output: + uint64_t *restrict Cp_kfirst, // size A_ntasks + // input: + const void *Cp, // size C->nvec+1 + const bool Cp_is_32, // if true, Cp is 32-bit; else 64 + const uint64_t *restrict Wfirst, // size A_ntasks + const uint64_t *restrict Wlast, // size A_ntasks + const int64_t *A_ek_slicing, // size 3*A_ntasks+1 + const int A_ntasks // # of tasks to slice A and construct C +) +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_IDECL (Cp, const, u) ; GB_IPTR (Cp, Cp_is_32) ; + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; +// const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; + + //-------------------------------------------------------------------------- + // determine the slice boundaries in the new C matrix + //-------------------------------------------------------------------------- + + int64_t kprior = -1 ; + uint64_t pC = 0 ; + + for (int tid = 0 ; tid < A_ntasks ; tid++) + { + int64_t kfirst = kfirst_Aslice [tid] ; + + if (kprior < kfirst) + { + // Task tid is the first one to do work on C(:,kfirst), so it + // starts at Cp [kfirst], and it contributes Wfirst [tid] entries + // to C(:,kfirst). + pC = GB_IGET (Cp, kfirst) ; + kprior = kfirst ; + } + + // Task tid contributes Wfirst [tid] entries to C(:,kfirst) + Cp_kfirst [tid] = pC ; + pC += Wfirst [tid] ; + + int64_t klast = klast_Aslice [tid] ; + if (kfirst < klast) + { + // Task tid is the last to contribute to C(:,kfirst). + ASSERT (pC == GB_IGET (Cp, kfirst+1)) ; + // Task tid contributes the first Wlast [tid] entries to + // C(:,klast), so the next task tid+1 starts at location Cp [klast] + // + Wlast [tid], if its first vector is klast of this task. + pC = GB_IGET (Cp, klast) + Wlast [tid] ; + kprior = klast ; + } + } +} + +#endif + diff --git a/GraphBLAS/Source/slice/factory/GB_ek_slice_search_template.c b/GraphBLAS/Source/slice/factory/GB_ek_slice_search_template.c new file mode 100644 index 0000000000..eb1cb21938 --- /dev/null +++ b/GraphBLAS/Source/slice/factory/GB_ek_slice_search_template.c @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// GB_ek_slice_search: find the first and last vectors in a slice +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// In this templatized method, the _TYPE suffix becomes either _32 or _64. + +//------------------------------------------------------------------------------ +// GB_ek_slice_search_TYPE +//------------------------------------------------------------------------------ + +static inline void GB_ek_slice_search_TYPE +( + // input: + int taskid, + int ntasks, + const int64_t *restrict pstart_slice, // size ntasks+1 + const void *Ap, // size anvec, 32 or 64 bit + int64_t anvec, // # of vectors in A + int64_t avlen, // vector length of A + // output: + int64_t *restrict kfirst_slice, // size ntasks + int64_t *restrict klast_slice // size ntasks +) +{ + int64_t pfirst = pstart_slice [taskid] ; + int64_t plast = pstart_slice [taskid+1] - 1 ; + + // find the first vector of the slice for task taskid: the + // vector that owns the entry Ai [pfirst] and Ax [pfirst]. + int64_t kfirst ; + if (taskid == 0) + { + kfirst = 0 ; + } + else + { + kfirst = GB_search_for_vector_TYPE (Ap, pfirst, 0, anvec, avlen) ; + } + + // find the last vector of the slice for task taskid: the + // vector that owns the entry Ai [plast] and Ax [plast]. + int64_t klast ; + if (taskid == ntasks-1) + { + klast = anvec - 1 ; + } + else if (pfirst > plast) + { + // this task does no work + klast = kfirst ; + } + else + { + klast = GB_search_for_vector_TYPE (Ap, plast, kfirst, anvec, avlen) ; + } + kfirst_slice [taskid] = kfirst ; + klast_slice [taskid] = klast ; +} + +#undef GB_search_for_vector_TYPE +#undef GB_ek_slice_search_TYPE + diff --git a/GraphBLAS/Source/slice/factory/GB_p_slice_template.c b/GraphBLAS/Source/slice/factory/GB_p_slice_template.c new file mode 100644 index 0000000000..19047a3a0e --- /dev/null +++ b/GraphBLAS/Source/slice/factory/GB_p_slice_template.c @@ -0,0 +1,191 @@ +//------------------------------------------------------------------------------ +// GB_p_slice_template: partition Work for a set of tasks +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This is a templatized method where _TYPE is 32 or 64 for uint32_t and +// uint64_t, or float. + +//------------------------------------------------------------------------------ +// GB_p_slice_worker_TYPE: partition Work for a set of tasks +//------------------------------------------------------------------------------ + +static void GB_p_slice_worker_TYPE +( + int64_t *restrict Slice, // size ntasks+1 + const GB_Work_TYPE *restrict Work, // array size n+1 + int tlo, // assign to Slice [(tlo+1):(thi-1)] + int thi +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + #ifdef GB_DEBUG + ASSERT (Work != NULL) ; + ASSERT (Slice != NULL) ; + ASSERT (0 <= tlo && tlo < thi - 1) ; + for (int t = tlo+1 ; t <= thi-1 ; t++) + { + ASSERT (Slice [t] == -1) ; + } + #endif + + //-------------------------------------------------------------------------- + // assign work to Slice [(tlo+1):(thi-1)] + //-------------------------------------------------------------------------- + + // klo = Slice [tlo] and khi = Slice [thi] are defined on input, where + // tlo < thi - 1. This determines the task boundaries for tasks + // tlo+1 to thi-1, which defines Slice [(tlo+1):(thi-1)]. + + int64_t klo = Slice [tlo] ; + int64_t khi = Slice [thi] ; ASSERT (0 <= klo && klo <= khi) ; + GB_Work_TYPE p1 = Work [klo] ; + GB_Work_TYPE p2 = Work [khi] ; ASSERT (p1 <= p2) ; + + if (p1 == p2 || klo == khi) + { + + //---------------------------------------------------------------------- + // no work is left so simply fill in with empty tasks + //---------------------------------------------------------------------- + + int64_t k = klo ; + for (int64_t t = tlo+1 ; t <= thi-1 ; t++) + { + Slice [t] = k ; + } + + } + else // p1 < p2 && klo < khi + { + + //---------------------------------------------------------------------- + // find task t that evenly partitions the work p1:p2 to tasks tlo:thi + //---------------------------------------------------------------------- + + ASSERT (p1 < p2) ; + int64_t k = (klo + khi) / 2 ; ASSERT (klo <= k && k <= khi) ; + GB_Work_TYPE p = Work [k] ; ASSERT (p1 <= p && p <= p2) ; + double ntasks = thi - tlo ; + double ratio = (((double) (p - p1)) / ((double) (p2 - p1))) ; + int t = tlo + (int) floor (ratio * ntasks) ; + t = GB_IMAX (t, tlo+1) ; + t = GB_IMIN (t, thi-1) ; ASSERT (tlo < t && t < thi) ; + + //---------------------------------------------------------------------- + // assign work to task t + //---------------------------------------------------------------------- + + ASSERT (Slice [t] == -1) ; + Slice [t] = k ; + + //---------------------------------------------------------------------- + // recursively partition for tasks (tlo+1):(t-1) and (t+1):(thi-1) + //---------------------------------------------------------------------- + + if (tlo < t-1) + { + GB_p_slice_worker_TYPE (Slice, Work, tlo, t) ; + } + if (t < thi-1) + { + GB_p_slice_worker_TYPE (Slice, Work, t, thi) ; + } + } +} + +//------------------------------------------------------------------------------ +// GB_p_slice_TYPE: partition Work for a set of tasks +//------------------------------------------------------------------------------ + +void GB_p_slice_TYPE // slice Work, uint32_t, uint64_t, or float +( + // output: + int64_t *restrict Slice, // size ntasks+1 + // input: + const GB_Work_TYPE *Work, // array size n+1 + const int64_t n, + const int ntasks // # of tasks + #ifdef GB_ENABLE_PERFECT_BALANCE + , const bool perfectly_balanced + #endif +) +{ + + ASSERT (Work != NULL) ; + + #ifdef GB_DEBUG + for (int taskid = 0 ; taskid <= ntasks ; taskid++) + { + Slice [taskid] = -1 ; + } + #endif + + if (n == 0 || ntasks <= 1 || Work [n] == 0) + { + // matrix is empty, or a single thread is used + memset ((void *) Slice, 0, ntasks * sizeof (int64_t)) ; + Slice [ntasks] = n ; + } + else + { + // slice Work by # of entries + Slice [0] = 0 ; + Slice [ntasks] = n ; + #ifdef GB_ENABLE_PERFECT_BALANCE + if (perfectly_balanced) + { + // this method is costly, and should only be used if the + // work is to be perfectly balanced (in particular, when there + // is just one task per thread, with static scheduling). The Work + // array must be uint32_t or uint64_t. + const double work = (double) (Work [n]) ; + int64_t k = 0 ; + for (int taskid = 1 ; taskid < ntasks ; taskid++) + { + // binary search to find k so that Work [k] == (taskid*work) / + // ntasks. The exact value will not typically not be found; + // just pick what the binary search comes up with. + int64_t wtask = (int64_t) GB_PART (taskid, work, ntasks) ; + int64_t pright = n ; + GB_trim_binary_search_TYPE (wtask, Work, &k, &pright) ; + Slice [taskid] = k ; + } + } + else + #endif + { + // this is much faster, and results in good load balancing if + // there is more than one task per thread, and dynamic + // scheduling is used. + GB_p_slice_worker_TYPE (Slice, Work, 0, ntasks) ; + } + } + + //-------------------------------------------------------------------------- + // check result + //-------------------------------------------------------------------------- + + #ifdef GB_DEBUG + ASSERT (Slice [0] == 0) ; + ASSERT (Slice [ntasks] == n) ; + for (int taskid = 0 ; taskid < ntasks ; taskid++) + { + ASSERT (Slice [taskid] <= Slice [taskid+1]) ; + } + #endif +} + +#undef GB_Work_TYPE +#undef GB_p_slice_TYPE +#undef GB_p_slice_worker_TYPE +#undef GB_trim_binary_search_TYPE + diff --git a/GraphBLAS/Source/slice/include/GB_ek_slice_kernels.h b/GraphBLAS/Source/slice/include/GB_ek_slice_kernels.h index bbbc6ebc4f..b8c59ebf10 100644 --- a/GraphBLAS/Source/slice/include/GB_ek_slice_kernels.h +++ b/GraphBLAS/Source/slice/include/GB_ek_slice_kernels.h @@ -2,7 +2,7 @@ // GB_ek_slice_kernels.h: slice the entries and vectors of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -62,7 +62,7 @@ static inline void GB_ek_slice_ntasks // chunk and nthreads_max must already be defined. -#define GB_SLICE_MATRIX_WORK(X,ntasks_per_thread,work,xnz_held) \ +#define GB_SLICE_MATRIX_WORK2(X,ntasks_per_thread,work,xnz_held) \ GB_ek_slice_ntasks (&(X ## _nthreads), &(X ## _ntasks), xnz_held, \ ntasks_per_thread, work, chunk, nthreads_max) ; \ GB_WERK_PUSH (X ## _ek_slicing, 3*(X ## _ntasks)+1, int64_t) ; \ @@ -72,7 +72,10 @@ static inline void GB_ek_slice_ntasks GB_FREE_ALL ; \ return (GrB_OUT_OF_MEMORY) ; \ } \ - GB_ek_slice (X ## _ek_slicing, X, X ## _ntasks) ; \ + GB_ek_slice (X ## _ek_slicing, X, X ## _ntasks) ; + +#define GB_SLICE_MATRIX_WORK(X,ntasks_per_thread,work,xnz_held) \ + GB_SLICE_MATRIX_WORK2 (X,ntasks_per_thread,work,xnz_held) \ const int64_t *kfirst_ ## X ## slice = X ## _ek_slicing ; \ const int64_t *klast_ ## X ## slice = X ## _ek_slicing + X ## _ntasks ; \ const int64_t *pstart_ ## X ## slice = X ## _ek_slicing + X ## _ntasks*2 ; @@ -82,6 +85,11 @@ static inline void GB_ek_slice_ntasks const double X ## _wrk = X ## _held + X->nvec ; \ GB_SLICE_MATRIX_WORK (X, ntasks_per_thread, X ## _wrk, X ## _held) +#define GB_SLICE_MATRIX2(X,ntasks_per_thread) \ + const int64_t X ## _held = GB_nnz_held (X) ; \ + const double X ## _wrk = X ## _held + X->nvec ; \ + GB_SLICE_MATRIX_WORK2 (X, ntasks_per_thread, X ## _wrk, X ## _held) + //------------------------------------------------------------------------------ // GB_GET_PA_AND_PC: find the part of A(:,k) and C(:,k) for this task //------------------------------------------------------------------------------ @@ -89,9 +97,10 @@ static inline void GB_ek_slice_ntasks // The tasks were generated by GB_ek_slice. // as a macro, where p0, p1, and p2 are first obtained as above: -// p0 = GBP (Ap, k, avlen) ; -// p1 = GBP (Ap, k+1, avlen) ; -// p2 = GBP (Cp, k, cvlen) ; +// p0 = GBp (Ap, k, avlen) ; +// p1 = GBp (Ap, k+1, avlen) ; +// p2 = GBp (Cp, k, cvlen) ; + #define GB_GET_PA_AND_PC(pA_start,pA_end,pC,tid,k,kfirst,klast,pstart_slice,Cp_kfirst,p0,p1,p2) \ int64_t pA_start, pA_end, pC ; \ if (k == kfirst) \ @@ -123,8 +132,9 @@ static inline void GB_ek_slice_ntasks // The tasks were generated by GB_ek_slice. // as a macro, where p0 and p1 are first obtained as above: -// p0 = GBP (Ap, k, avlen) ; -// p1 = GBP (Ap, k+1, avlen) ; +// p0 = GBp (Ap, k, avlen) ; +// p1 = GBp (Ap, k+1, avlen) ; + #define GB_GET_PA(pA_start,pA_end,tid,k,kfirst,klast,pstart_slice,p0,p1) \ int64_t pA_start, pA_end ; \ if (k == kfirst) \ @@ -146,6 +156,5 @@ static inline void GB_ek_slice_ntasks pA_end = p1 ; \ } - #endif diff --git a/GraphBLAS/Source/slice/include/GB_partition.h b/GraphBLAS/Source/slice/include/GB_partition.h index 06b986152f..d8b1e68008 100644 --- a/GraphBLAS/Source/slice/include/GB_partition.h +++ b/GraphBLAS/Source/slice/include/GB_partition.h @@ -2,7 +2,7 @@ // GB_partition.h: definitions for partitioning an index range //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/slice/include/GB_search_for_vector.h b/GraphBLAS/Source/slice/include/GB_search_for_vector.h index 2818360311..d0c9b13019 100644 --- a/GraphBLAS/Source/slice/include/GB_search_for_vector.h +++ b/GraphBLAS/Source/slice/include/GB_search_for_vector.h @@ -2,7 +2,7 @@ // GB_search_for_vector: find the vector k that contains p //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,70 +16,34 @@ #ifndef GB_SEARCH_FOR_VECTOR_H #define GB_SEARCH_FOR_VECTOR_H -#ifdef GB_CUDA_KERNEL -__device__ -#endif -static inline int64_t GB_search_for_vector // return vector k that contains p +#define GB_SV_TYPE uint32_t +#define GB_search_for_vector_TYPE GB_search_for_vector_32 +#define GB_split_binary_search_TYPE GB_split_binary_search_32 +#include "include/GB_search_for_vector_template.h" + +#define GB_SV_TYPE uint64_t +#define GB_search_for_vector_TYPE GB_search_for_vector_64 +#define GB_split_binary_search_TYPE GB_split_binary_search_64 +#include "include/GB_search_for_vector_template.h" + +static inline int64_t GB_search_for_vector // return vector k ( + const void *Ap, // vector pointers to search + const bool Ap_is_32, // if true, Ap is 32-bit, else 64-bit const int64_t p, // search for vector k that contains p - const int64_t *restrict Ap, // vector pointers to search - int64_t kleft, // left-most k to search - int64_t anvec, // Ap is of size anvec+1 - int64_t avlen // A->vlen + const int64_t kleft, // left-most k to search + const int64_t anvec, // Ap is of size anvec+1 + const int64_t avlen // A->vlen ) { - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - if (Ap == NULL) - { - // A is full or bitmap - ASSERT (p >= 0 && p < avlen * anvec) ; - return ((avlen == 0) ? 0 : (p / avlen)) ; - } - - // A is sparse or hypersparse - ASSERT (p >= 0 && p < Ap [anvec]) ; - - //-------------------------------------------------------------------------- - // search for k - //-------------------------------------------------------------------------- - - int64_t k = kleft ; - int64_t kright = anvec ; - bool found ; - GB_SPLIT_BINARY_SEARCH (p, Ap, k, kright, found) ; - if (found) + if (Ap_is_32) { - // Ap [k] == p has been found, but if k is an empty vector, then the - // next vector will also contain the entry p. In that case, k needs to - // be incremented until finding the first non-empty vector for which - // Ap [k] == p. - ASSERT (Ap [k] == p) ; - while (k < anvec-1 && Ap [k+1] == p) - { - k++ ; - } + return (GB_search_for_vector_32 (Ap, p, kleft, anvec, avlen)) ; } else - { - // p has not been found in Ap, so it appears in the middle of Ap [k-1] - // ... Ap [k], as computed by the binary search. This is the range of - // entries for the vector k-1, so k must be decremented. - k-- ; + { + return (GB_search_for_vector_64 (Ap, p, kleft, anvec, avlen)) ; } - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - - // The entry p must reside in a non-empty vector. - ASSERT (k >= 0 && k < anvec) ; - ASSERT (Ap [k] <= p && p < Ap [k+1]) ; - - return (k) ; } #endif diff --git a/GraphBLAS/Source/slice/include/GB_search_for_vector_template.h b/GraphBLAS/Source/slice/include/GB_search_for_vector_template.h new file mode 100644 index 0000000000..cd37eee342 --- /dev/null +++ b/GraphBLAS/Source/slice/include/GB_search_for_vector_template.h @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// GB_search_for_vector_template: find the vector k that contains p +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Given an index p, find k so that Ap [k] <= p && p < Ap [k+1]. The search is +// limited to k in the range Ap [kleft ... anvec]. + +// A->p can come from any matrix: hypersparse, sparse, bitmap, or full. +// For the latter two cases, A->p is NULL. + +//------------------------------------------------------------------------------ +// GB_search_for_vector_32 and GB_search_for_vector_64 +//------------------------------------------------------------------------------ + +static inline int64_t GB_search_for_vector_TYPE // return vector k +( + const GB_SV_TYPE *restrict Ap, // vector pointers to search + const int64_t p, // search for vector k that contains p + const int64_t kleft, // left-most k to search + const int64_t anvec, // Ap is of size anvec+1 + const int64_t avlen // A->vlen +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + if (Ap == NULL) + { + // A is full or bitmap + ASSERT (p >= 0 && p < avlen * anvec) ; + return ((avlen == 0) ? 0 : (p / avlen)) ; + } + + // A is sparse or hypersparse + ASSERT (p >= 0 && p < Ap [anvec]) ; + + //-------------------------------------------------------------------------- + // search for k + //-------------------------------------------------------------------------- + + int64_t k = kleft ; + int64_t kright = anvec ; + bool found ; + found = GB_split_binary_search_TYPE (p, Ap, &k, &kright) ; + if (found) + { + // Ap [k] == p has been found, but if k is an empty vector, then the + // next vector will also contain the entry p. In that case, k needs to + // be incremented until finding the first non-empty vector for which + // Ap [k] == p. + ASSERT (Ap [k] == p) ; + while (k < anvec-1 && Ap [k+1] == p) + { + k++ ; + } + } + else + { + // p has not been found in Ap, so it appears in the middle of Ap [k-1] + // ... Ap [k], as computed by the binary search. This is the range of + // entries for the vector k-1, so k must be decremented. + k-- ; + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + // The entry p must reside in a non-empty vector. + ASSERT (k >= 0 && k < anvec) ; + ASSERT (Ap [k] <= p && p < Ap [k+1]) ; + + return (k) ; +} + +#undef GB_SV_TYPE +#undef GB_search_for_vector_TYPE +#undef GB_split_binary_search_TYPE + diff --git a/GraphBLAS/Source/slice/include/GB_task_struct.h b/GraphBLAS/Source/slice/include/GB_task_struct.h index 31653fa7a5..eb2a01bfc0 100644 --- a/GraphBLAS/Source/slice/include/GB_task_struct.h +++ b/GraphBLAS/Source/slice/include/GB_task_struct.h @@ -2,7 +2,7 @@ // GB_task_struct.h: parallel task descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,43 +44,5 @@ typedef struct // task descriptor } GB_task_struct ; -//------------------------------------------------------------------------------ -// GB_GET_VECTOR: get the content of a vector for a coarse/fine task -//------------------------------------------------------------------------------ - -#if 0 -// General case, but is not optimized for the JIT, and no longer used: -#define GB_GET_VECTOR(pX_start, pX_fini, pX, pX_end, Xp, kX, Xvlen) \ - int64_t pX_start, pX_fini ; \ - if (fine_task) \ - { \ - /* A fine task operates on a slice of X(:,k) */ \ - pX_start = TaskList [taskid].pX ; \ - pX_fini = TaskList [taskid].pX_end ; \ - } \ - else \ - { \ - /* vectors are never sliced for a coarse task */ \ - pX_start = GBP (Xp, kX, Xvlen) ; \ - pX_fini = GBP (Xp, kX+1, Xvlen) ; \ - } -#endif - -// GB_GET_VECTOR_M: optimized for the M matrix -#define GB_GET_VECTOR_M(pM_start, pM_fini, pX, pX_end, Mp, k, Mvlen) \ - int64_t pM_start, pM_fini ; \ - if (fine_task) \ - { \ - /* A fine task operates on a slice of X(:,k) */ \ - pM_start = TaskList [taskid].pX ; \ - pM_fini = TaskList [taskid].pX_end ; \ - } \ - else \ - { \ - /* vectors are never sliced for a coarse task */ \ - pM_start = GBP_M (Mp, k, Mvlen) ; \ - pM_fini = GBP_M (Mp, k+1, Mvlen) ; \ - } - #endif diff --git a/GraphBLAS/Source/sort/GB_msort_1.c b/GraphBLAS/Source/sort/GB_msort_1.c index b2d668322b..292a0b28fb 100644 --- a/GraphBLAS/Source/sort/GB_msort_1.c +++ b/GraphBLAS/Source/sort/GB_msort_1.c @@ -2,291 +2,59 @@ // GB_msort_1: sort a 1-by-n list of integers //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// A parallel mergesort of an array of 1-by-n integers. +// A parallel mergesort of an array of 1-by-n integers. Each key +// is a 32-bit or 64-bit unsigned integer. -#include "sort/GB_msort_1.h" +#include "sort/GB_sort.h" //------------------------------------------------------------------------------ -// GB_msort_1_binary_search: binary search for the pivot +// GB_msort_1_32 //------------------------------------------------------------------------------ -// The Pivot value is Z [pivot], and a binary search for the Pivot is made in -// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on -// input. The return value is pleft, where -// -// X [p_start ... pleft-1] <= Pivot and -// X [pleft ... p_end-1] >= Pivot holds. -// -// pleft is returned in the range p_start to p_end. If pleft is p_start, then -// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left -// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is -// larger than all entries in X [p_start...p_end-1], and the right list X -// [pleft...p_end-1] is empty. +#define GB_A0_t uint32_t +#define GB_msort_1_binary_search GB_msort_1_binary_search_32 +#define GB_msort_1_create_merge_tasks GB_msort_1_create_merge_tasks_32 +#define GB_msort_1_merge GB_msort_1_merge_32 +#define GB_msort_1_method GB_msort_1_32 +#define GB_qsort_1_method GB_qsort_1_32 -static int64_t GB_msort_1_binary_search // return pleft -( - const int64_t *restrict Z_0, // Pivot is Z [pivot] - const int64_t pivot, - const int64_t *restrict X_0, // search in X [p_start..p_end_-1] - const int64_t p_start, - const int64_t p_end -) -{ - - //-------------------------------------------------------------------------- - // find where the Pivot appears in X - //-------------------------------------------------------------------------- - - // binary search of X [p_start...p_end-1] for the Pivot - int64_t pleft = p_start ; - int64_t pright = p_end - 1 ; - while (pleft < pright) - { - int64_t pmiddle = (pleft + pright) >> 1 ; - // less = (X [pmiddle] < Pivot) - bool less = GB_lt_1 (X_0, pmiddle, - Z_0, pivot) ; - pleft = less ? (pmiddle+1) : pleft ; - pright = less ? pright : pmiddle ; - } - - // binary search is narrowed down to a single item - // or it has found the list is empty: - ASSERT (pleft == pright || pleft == pright + 1) ; - - // If found is true then X [pleft == pright] == Pivot. If duplicates - // appear then X [pleft] is any one of the entries equal to the Pivot - // in the list. If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft+1 ... p_end-1] > Pivot holds. - // The value X [pleft] may be either < or > Pivot. - bool found = (pleft == pright) && GB_eq_1 (X_0, pleft, - Z_0, pivot) ; - - // Modify pleft and pright: - if (!found && (pleft == pright)) - { - if (GB_lt_1 (X_0, pleft, - Z_0, pivot)) - { - pleft++ ; - } - else - { -// pright++ ; // (not needed) - } - } - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - - // If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] > Pivot holds, - // and pleft-1 == pright - - // If X has no duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] >= Pivot holds. - - // If X has duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] <= Pivot and - // X [pleft ... p_end-1] >= Pivot holds. - - return (pleft) ; -} - -//------------------------------------------------------------------------------ -// GB_msort_1_create_merge_tasks -//------------------------------------------------------------------------------ - -// Recursively constructs ntasks tasks to merge two arrays, Left and Right, -// into Sresult, where Left is L [pL_start...pL_end-1], Right is R -// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], -// and where total_work is the total size of Left and Right. -// -// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and -// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output -// array S [S_task [tid] ... ]. The task tids created are t0 to -// t0+ntasks-1. - -void GB_msort_1_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t pR_start, - const int64_t pR_end -) -{ - - //-------------------------------------------------------------------------- - // get problem size - //-------------------------------------------------------------------------- - - int64_t nleft = pL_end - pL_start ; // size of Left array - int64_t nright = pR_end - pR_start ; // size of Right array - int64_t total_work = nleft + nright ; // total work to do - ASSERT (ntasks >= 1) ; - ASSERT (total_work > 0) ; - - //-------------------------------------------------------------------------- - // create the tasks - //-------------------------------------------------------------------------- - - if (ntasks == 1) - { - - //---------------------------------------------------------------------- - // a single task will merge all of Left and Right into Sresult - //---------------------------------------------------------------------- - - L_task [t0] = pL_start ; L_len [t0] = nleft ; - R_task [t0] = pR_start ; R_len [t0] = nright ; - S_task [t0] = pS_start ; - - } - else - { - - //---------------------------------------------------------------------- - // partition the Left and Right arrays for multiple merge tasks - //---------------------------------------------------------------------- - - int64_t pleft, pright ; - if (nleft >= nright) - { - // split Left in half, and search for its pivot in Right - pleft = (pL_end + pL_start) >> 1 ; - pright = GB_msort_1_binary_search ( - L_0, pleft, - R_0, pR_start, pR_end) ; - } - else - { - // split Right in half, and search for its pivot in Left - pright = (pR_end + pR_start) >> 1 ; - pleft = GB_msort_1_binary_search ( - R_0, pright, - L_0, pL_start, pL_end) ; - } - - //---------------------------------------------------------------------- - // partition the tasks according to the work of each partition - //---------------------------------------------------------------------- - - // work0 is the total work in the first partition - int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; - int ntasks0 = (int) round ((double) ntasks * - (((double) work0) / ((double) total_work))) ; - - // ensure at least one task is assigned to each partition - ntasks0 = GB_IMAX (ntasks0, 1) ; - ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; - int ntasks1 = ntasks - ntasks0 ; - - //---------------------------------------------------------------------- - // assign ntasks0 to the first half - //---------------------------------------------------------------------- - - // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] - // into the result S [pS_start...work0-1]. - - GB_msort_1_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, - L_0, pL_start, pleft, - R_0, pR_start, pright) ; - - //---------------------------------------------------------------------- - // assign ntasks1 to the second half - //---------------------------------------------------------------------- - - // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] - // into the result S [pS_start+work0...pS_start+total_work]. - - int t1 = t0 + ntasks0 ; // first task id of the second set of tasks - int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S - GB_msort_1_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, - L_0, pleft, pL_end, - R_0, pright, pR_end) ; - } -} +#include "sort/factory/GB_msort_1_template.c" //------------------------------------------------------------------------------ -// GB_msort_1_merge: merge two sorted lists via a single thread +// GB_msort_1_64 //------------------------------------------------------------------------------ -// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] */ - -static void GB_msort_1_merge -( - int64_t *restrict S_0, // output of length nleft + nright - const int64_t *restrict Left_0, // left input of length nleft - const int64_t nleft, - const int64_t *restrict Right_0, // right input of length nright - const int64_t nright -) -{ - int64_t p, pleft, pright ; +#undef GB_A0_t +#undef GB_msort_1_binary_search +#undef GB_msort_1_create_merge_tasks +#undef GB_msort_1_merge +#undef GB_msort_1_method +#undef GB_qsort_1_method - // merge the two inputs, Left and Right, while both inputs exist - for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) - { - if (GB_lt_1 (Left_0, pleft, - Right_0, pright)) - { - // S [p] = Left [pleft++] - S_0 [p] = Left_0 [pleft] ; - pleft++ ; - } - else - { - // S [p] = Right [pright++] - S_0 [p] = Right_0 [pright] ; - pright++ ; - } - } +#define GB_A0_t uint64_t +#define GB_msort_1_binary_search GB_msort_1_binary_search_64 +#define GB_msort_1_create_merge_tasks GB_msort_1_create_merge_tasks_64 +#define GB_msort_1_merge GB_msort_1_merge_64 +#define GB_msort_1_method GB_msort_1_64 +#define GB_qsort_1_method GB_qsort_1_64 - // either input is exhausted; copy the remaining list into S - if (pleft < nleft) - { - int64_t nremaining = (nleft - pleft) ; - memcpy (S_0 + p, Left_0 + pleft, nremaining * sizeof (int64_t)) ; - } - else if (pright < nright) - { - int64_t nremaining = (nright - pright) ; - memcpy (S_0 + p, Right_0 + pright, nremaining * sizeof (int64_t)) ; - } -} +#include "sort/factory/GB_msort_1_template.c" //------------------------------------------------------------------------------ -// GB_msort_1: parallel mergesort +// GB_msort_1 //------------------------------------------------------------------------------ GrB_Info GB_msort_1 // sort array A of size 1-by-n ( - int64_t *restrict A_0, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) { @@ -294,140 +62,25 @@ GrB_Info GB_msort_1 // sort array A of size 1-by-n // handle small problems with a single thread //-------------------------------------------------------------------------- - if (nthreads <= 1 || n <= GB_BASECASE) + int nthreads = GB_nthreads (n, GB_MSORT_BASECASE, nthreads_max) ; + if (nthreads <= 1 || n <= GB_MSORT_BASECASE) { // sequential quicksort - GB_qsort_1 (A_0, n) ; + GB_qsort_1 (A_0, A0_is_32, n) ; return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- - // determine # of tasks - //-------------------------------------------------------------------------- - - // determine the number of levels to create, which must always be an - // even number. The # of levels is chosen to ensure that the # of leaves - // of the task tree is between 4*nthreads and 16*nthreads. - - // 2 to 4 threads: 4 levels, 16 qsort leaves - // 5 to 16 threads: 6 levels, 64 qsort leaves - // 17 to 64 threads: 8 levels, 256 qsort leaves - // 65 to 256 threads: 10 levels, 1024 qsort leaves - // 256 to 1024 threads: 12 levels, 4096 qsort leaves - // ... - - int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; - int ntasks = 1 << k ; - - //-------------------------------------------------------------------------- - // allocate workspace + // call the type-specific GB_msort_1 method //-------------------------------------------------------------------------- - int64_t *restrict W = NULL ; size_t W_size = 0 ; - W = GB_MALLOC_WORK (n + 6*ntasks + 1, int64_t, &W_size) ; - if (W == NULL) + if (A0_is_32) { - // out of memory - return (GrB_OUT_OF_MEMORY) ; + return (GB_msort_1_32 (A_0, n, nthreads)) ; } - - int64_t *T = W ; - int64_t *restrict W_0 = T ; T += n ; - int64_t *restrict L_task = T ; T += ntasks ; - int64_t *restrict L_len = T ; T += ntasks ; - int64_t *restrict R_task = T ; T += ntasks ; - int64_t *restrict R_len = T ; T += ntasks ; - int64_t *restrict S_task = T ; T += ntasks ; - int64_t *restrict Slice = T ; T += (ntasks+1) ; - - //-------------------------------------------------------------------------- - // partition and sort the leaves - //-------------------------------------------------------------------------- - - GB_e_slice (Slice, n, ntasks) ; - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) + else { - int64_t leaf = Slice [tid] ; - int64_t leafsize = Slice [tid+1] - leaf ; - GB_qsort_1 (A_0 + leaf, leafsize) ; - } - - //-------------------------------------------------------------------------- - // merge each level - //-------------------------------------------------------------------------- - - int nt = 1 ; - for ( ; k >= 2 ; k -= 2) - { - - //---------------------------------------------------------------------- - // merge level k into level k-1, from A into W - //---------------------------------------------------------------------- - - // TODO: skip k and k-1 for each group of 4 sublists of A if they are - // already sorted with respect to each other. - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) - { - // create 2*nt tasks to merge two A sublists into one W sublist - GB_msort_1_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - A_0, Slice [tid], Slice [tid+nt], - A_0, Slice [tid+nt], Slice [tid+2*nt]) ; - } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) - { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - - GB_msort_1_merge ( - W_0 + pS, - A_0 + pL, nL, - A_0 + pR, nR) ; - } - nt = 2*nt ; - - //---------------------------------------------------------------------- - // merge level k-1 into level k-2, from W into A - //---------------------------------------------------------------------- - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) - { - // create 2*nt tasks to merge two W sublists into one A sublist - GB_msort_1_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - W_0, Slice [tid], Slice [tid+nt], - W_0, Slice [tid+nt], Slice [tid+2*nt]) ; - } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) - { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - GB_msort_1_merge ( - A_0 + pS, - W_0 + pL, nL, - W_0 + pR, nR) ; - } - nt = 2*nt ; + return (GB_msort_1_64 (A_0, n, nthreads)) ; } - - //-------------------------------------------------------------------------- - // free workspace and return result - //-------------------------------------------------------------------------- - - GB_FREE_WORK (&W, W_size) ; - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/sort/GB_msort_1.h b/GraphBLAS/Source/sort/GB_msort_1.h deleted file mode 100644 index a8109e32ef..0000000000 --- a/GraphBLAS/Source/sort/GB_msort_1.h +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_msort_1.h: definitions for GB_msort_1.c -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// A parallel mergesort of an array of 2-by-n integers. Each key consists -// of two integers. - -#include "sort/GB_sort.h" - -//------------------------------------------------------------------------------ -// prototypes only needed for GB_msort_1 -//------------------------------------------------------------------------------ - -void GB_msort_1_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t pR_start, - const int64_t pR_end -) ; - diff --git a/GraphBLAS/Source/sort/GB_msort_2.c b/GraphBLAS/Source/sort/GB_msort_2.c index c0e5d72515..bb6087f1cc 100644 --- a/GraphBLAS/Source/sort/GB_msort_2.c +++ b/GraphBLAS/Source/sort/GB_msort_2.c @@ -2,304 +2,101 @@ // GB_msort_2: sort a 2-by-n list of integers, using A[0:1][ ] as the key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // A parallel mergesort of an array of 2-by-n integers. Each key -// consists of two integers. +// consists of two 32-bit or 64-bit unsigned integers. -#include "sort/GB_msort_2.h" +#include "sort/GB_sort.h" //------------------------------------------------------------------------------ -// GB_msort_2_binary_search: binary search for the pivot +// GB_msort_2_32_32 //------------------------------------------------------------------------------ -// The Pivot value is Z [pivot], and a binary search for the Pivot is made in -// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on -// input. The return value is pleft, where -// -// X [p_start ... pleft-1] <= Pivot and -// X [pleft ... p_end-1] >= Pivot holds. -// -// pleft is returned in the range p_start to p_end. If pleft is p_start, then -// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left -// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is -// larger than all entries in X [p_start...p_end-1], and the right list X -// [pleft...p_end-1] is empty. +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_msort_2_binary_search GB_msort_2_binary_search_32_32 +#define GB_msort_2_create_merge_tasks GB_msort_2_create_merge_tasks_32_32 +#define GB_msort_2_merge GB_msort_2_merge_32_32 +#define GB_msort_2_method GB_msort_2_32_32 -static int64_t GB_msort_2_binary_search // return pleft -( - const int64_t *restrict Z_0, // Pivot is Z [pivot] - const int64_t *restrict Z_1, - const int64_t pivot, - const int64_t *restrict X_0, // search in X [p_start..p_end_-1] - const int64_t *restrict X_1, - const int64_t p_start, - const int64_t p_end -) -{ - - //-------------------------------------------------------------------------- - // find where the Pivot appears in X - //-------------------------------------------------------------------------- - - // binary search of X [p_start...p_end-1] for the Pivot - int64_t pleft = p_start ; - int64_t pright = p_end - 1 ; - while (pleft < pright) - { - int64_t pmiddle = (pleft + pright) >> 1 ; - // less = (X [pmiddle] < Pivot) - bool less = GB_lt_2 (X_0, X_1, pmiddle, - Z_0, Z_1, pivot) ; - pleft = less ? (pmiddle+1) : pleft ; - pright = less ? pright : pmiddle ; - } - - // binary search is narrowed down to a single item - // or it has found the list is empty: - ASSERT (pleft == pright || pleft == pright + 1) ; - - // If found is true then X [pleft == pright] == Pivot. If duplicates - // appear then X [pleft] is any one of the entries equal to the Pivot - // in the list. If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft+1 ... p_end-1] > Pivot holds. - // The value X [pleft] may be either < or > Pivot. - bool found = (pleft == pright) && GB_eq_2 (X_0, X_1, pleft, - Z_0, Z_1, pivot) ; - - // Modify pleft and pright: - if (!found && (pleft == pright)) - { - if (GB_lt_2 (X_0, X_1, pleft, - Z_0, Z_1, pivot)) - { - pleft++ ; - } - else - { -// pright++ ; // (not needed) - } - } - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - - // If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] > Pivot holds, - // and pleft-1 == pright - - // If X has no duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] >= Pivot holds. - - // If X has duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] <= Pivot and - // X [pleft ... p_end-1] >= Pivot holds. - - return (pleft) ; -} +#include "sort/factory/GB_msort_2_template.c" //------------------------------------------------------------------------------ -// GB_msort_2_create_merge_tasks +// GB_msort_2_32_64 //------------------------------------------------------------------------------ -// Recursively constructs ntasks tasks to merge two arrays, Left and Right, -// into Sresult, where Left is L [pL_start...pL_end-1], Right is R -// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], -// and where total_work is the total size of Left and Right. -// -// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and -// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output -// array S [S_task [tid] ... ]. The task tids created are t0 to -// t0+ntasks-1. - -void GB_msort_2_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, - const int64_t pR_start, - const int64_t pR_end -) -{ - - //-------------------------------------------------------------------------- - // get problem size - //-------------------------------------------------------------------------- - - int64_t nleft = pL_end - pL_start ; // size of Left array - int64_t nright = pR_end - pR_start ; // size of Right array - int64_t total_work = nleft + nright ; // total work to do - ASSERT (ntasks >= 1) ; - ASSERT (total_work > 0) ; - - //-------------------------------------------------------------------------- - // create the tasks - //-------------------------------------------------------------------------- - - if (ntasks == 1) - { - - //---------------------------------------------------------------------- - // a single task will merge all of Left and Right into Sresult - //---------------------------------------------------------------------- - - L_task [t0] = pL_start ; L_len [t0] = nleft ; - R_task [t0] = pR_start ; R_len [t0] = nright ; - S_task [t0] = pS_start ; - - } - else - { - - //---------------------------------------------------------------------- - // partition the Left and Right arrays for multiple merge tasks - //---------------------------------------------------------------------- - - int64_t pleft, pright ; - if (nleft >= nright) - { - // split Left in half, and search for its pivot in Right - pleft = (pL_end + pL_start) >> 1 ; - pright = GB_msort_2_binary_search ( - L_0, L_1, pleft, - R_0, R_1, pR_start, pR_end) ; - } - else - { - // split Right in half, and search for its pivot in Left - pright = (pR_end + pR_start) >> 1 ; - pleft = GB_msort_2_binary_search ( - R_0, R_1, pright, - L_0, L_1, pL_start, pL_end) ; - } - - //---------------------------------------------------------------------- - // partition the tasks according to the work of each partition - //---------------------------------------------------------------------- - - // work0 is the total work in the first partition - int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; - int ntasks0 = (int) round ((double) ntasks * - (((double) work0) / ((double) total_work))) ; - - // ensure at least one task is assigned to each partition - ntasks0 = GB_IMAX (ntasks0, 1) ; - ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; - int ntasks1 = ntasks - ntasks0 ; +#undef GB_A0_t +#undef GB_A1_t +#undef GB_msort_2_binary_search +#undef GB_msort_2_create_merge_tasks +#undef GB_msort_2_merge +#undef GB_msort_2_method - //---------------------------------------------------------------------- - // assign ntasks0 to the first half - //---------------------------------------------------------------------- +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_msort_2_binary_search GB_msort_2_binary_search_32_64 +#define GB_msort_2_create_merge_tasks GB_msort_2_create_merge_tasks_32_64 +#define GB_msort_2_merge GB_msort_2_merge_32_64 +#define GB_msort_2_method GB_msort_2_32_64 - // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] - // into the result S [pS_start...work0-1]. +#include "sort/factory/GB_msort_2_template.c" - GB_msort_2_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, - L_0, L_1, pL_start, pleft, - R_0, R_1, pR_start, pright) ; +//------------------------------------------------------------------------------ +// GB_msort_2_64_32 +//------------------------------------------------------------------------------ - //---------------------------------------------------------------------- - // assign ntasks1 to the second half - //---------------------------------------------------------------------- +#undef GB_A0_t +#undef GB_A1_t +#undef GB_msort_2_binary_search +#undef GB_msort_2_create_merge_tasks +#undef GB_msort_2_merge +#undef GB_msort_2_method - // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] - // into the result S [pS_start+work0...pS_start+total_work]. +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_msort_2_binary_search GB_msort_2_binary_search_64_32 +#define GB_msort_2_create_merge_tasks GB_msort_2_create_merge_tasks_64_32 +#define GB_msort_2_merge GB_msort_2_merge_64_32 +#define GB_msort_2_method GB_msort_2_64_32 - int t1 = t0 + ntasks0 ; // first task id of the second set of tasks - int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S - GB_msort_2_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, - L_0, L_1, pleft, pL_end, - R_0, R_1, pright, pR_end) ; - } -} +#include "sort/factory/GB_msort_2_template.c" //------------------------------------------------------------------------------ -// GB_msort_2_merge: merge two sorted lists via a single thread +// GB_msort_2_64_64 //------------------------------------------------------------------------------ -// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] */ - -static void GB_msort_2_merge -( - int64_t *restrict S_0, // output of length nleft + nright - int64_t *restrict S_1, - const int64_t *restrict Left_0, // left input of length nleft - const int64_t *restrict Left_1, - const int64_t nleft, - const int64_t *restrict Right_0, // right input of length nright - const int64_t *restrict Right_1, - const int64_t nright -) -{ - int64_t p, pleft, pright ; +#undef GB_A0_t +#undef GB_A1_t +#undef GB_msort_2_binary_search +#undef GB_msort_2_create_merge_tasks +#undef GB_msort_2_merge +#undef GB_msort_2_method - // merge the two inputs, Left and Right, while both inputs exist - for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) - { - if (GB_lt_2 (Left_0, Left_1, pleft, - Right_0, Right_1, pright)) - { - // S [p] = Left [pleft++] - S_0 [p] = Left_0 [pleft] ; - S_1 [p] = Left_1 [pleft] ; - pleft++ ; - } - else - { - // S [p] = Right [pright++] - S_0 [p] = Right_0 [pright] ; - S_1 [p] = Right_1 [pright] ; - pright++ ; - } - } +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_msort_2_binary_search GB_msort_2_binary_search_64_64 +#define GB_msort_2_create_merge_tasks GB_msort_2_create_merge_tasks_64_64 +#define GB_msort_2_merge GB_msort_2_merge_64_64 +#define GB_msort_2_method GB_msort_2_64_64 - // either input is exhausted; copy the remaining list into S - if (pleft < nleft) - { - int64_t nremaining = (nleft - pleft) ; - memcpy (S_0 + p, Left_0 + pleft, nremaining * sizeof (int64_t)) ; - memcpy (S_1 + p, Left_1 + pleft, nremaining * sizeof (int64_t)) ; - } - else if (pright < nright) - { - int64_t nremaining = (nright - pright) ; - memcpy (S_0 + p, Right_0 + pright, nremaining * sizeof (int64_t)) ; - memcpy (S_1 + p, Right_1 + pright, nremaining * sizeof (int64_t)) ; - } -} +#include "sort/factory/GB_msort_2_template.c" //------------------------------------------------------------------------------ -// GB_msort_2: parallel mergesort +// GB_msort_2 //------------------------------------------------------------------------------ -GrB_Info GB_msort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) +GrB_Info GB_msort_2 // sort array A of size 2-by-n ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) { @@ -307,141 +104,39 @@ GrB_Info GB_msort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) // handle small problems with a single thread //-------------------------------------------------------------------------- - if (nthreads <= 1 || n <= GB_BASECASE) + int nthreads = GB_nthreads (n, GB_MSORT_BASECASE, nthreads_max) ; + if (nthreads <= 1 || n <= GB_MSORT_BASECASE) { // sequential quicksort - GB_qsort_2 (A_0, A_1, n) ; + GB_qsort_2 (A_0, A0_is_32, A_1, A1_is_32, n) ; return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- - // determine # of tasks - //-------------------------------------------------------------------------- - - // determine the number of levels to create, which must always be an - // even number. The # of levels is chosen to ensure that the # of leaves - // of the task tree is between 4*nthreads and 16*nthreads. - - // 2 to 4 threads: 4 levels, 16 qsort leaves - // 5 to 16 threads: 6 levels, 64 qsort leaves - // 17 to 64 threads: 8 levels, 256 qsort leaves - // 65 to 256 threads: 10 levels, 1024 qsort leaves - // 256 to 1024 threads: 12 levels, 4096 qsort leaves - // ... - - int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; - int ntasks = 1 << k ; - - //-------------------------------------------------------------------------- - // allocate workspace - //-------------------------------------------------------------------------- - - int64_t *restrict W = NULL ; size_t W_size = 0 ; - W = GB_MALLOC_WORK (2*n + 6*ntasks + 1, int64_t, &W_size) ; - if (W == NULL) - { - // out of memory - return (GrB_OUT_OF_MEMORY) ; - } - - int64_t *T = W ; - int64_t *restrict W_0 = T ; T += n ; - int64_t *restrict W_1 = T ; T += n ; - int64_t *restrict L_task = T ; T += ntasks ; - int64_t *restrict L_len = T ; T += ntasks ; - int64_t *restrict R_task = T ; T += ntasks ; - int64_t *restrict R_len = T ; T += ntasks ; - int64_t *restrict S_task = T ; T += ntasks ; - int64_t *restrict Slice = T ; T += (ntasks+1) ; - - //-------------------------------------------------------------------------- - // partition and sort the leaves + // call the type-specific GB_msort_2 method //-------------------------------------------------------------------------- - GB_e_slice (Slice, n, ntasks) ; - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) + if (A0_is_32) { - int64_t leaf = Slice [tid] ; - int64_t leafsize = Slice [tid+1] - leaf ; - GB_qsort_2 (A_0 + leaf, A_1 + leaf, leafsize) ; - } - - //-------------------------------------------------------------------------- - // merge each level - //-------------------------------------------------------------------------- - - int nt = 1 ; - for ( ; k >= 2 ; k -= 2) - { - - //---------------------------------------------------------------------- - // merge level k into level k-1, from A into W - //---------------------------------------------------------------------- - - // TODO: skip k and k-1 for each group of 4 sublists of A if they are - // already sorted with respect to each other. - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + if (A1_is_32) { - // create 2*nt tasks to merge two A sublists into one W sublist - GB_msort_2_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - A_0, A_1, Slice [tid], Slice [tid+nt], - A_0, A_1, Slice [tid+nt], Slice [tid+2*nt]) ; + return (GB_msort_2_32_32 (A_0, A_1, n, nthreads)) ; } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) + else { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - - GB_msort_2_merge ( - W_0 + pS, W_1 + pS, - A_0 + pL, A_1 + pL, nL, - A_0 + pR, A_1 + pR, nR) ; + return (GB_msort_2_32_64 (A_0, A_1, n, nthreads)) ; } - nt = 2*nt ; - - //---------------------------------------------------------------------- - // merge level k-1 into level k-2, from W into A - //---------------------------------------------------------------------- - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + } + else + { + if (A1_is_32) { - // create 2*nt tasks to merge two W sublists into one A sublist - GB_msort_2_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - W_0, W_1, Slice [tid], Slice [tid+nt], - W_0, W_1, Slice [tid+nt], Slice [tid+2*nt]) ; + return (GB_msort_2_64_32 (A_0, A_1, n, nthreads)) ; } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) + else { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - GB_msort_2_merge ( - A_0 + pS, A_1 + pS, - W_0 + pL, W_1 + pL, nL, - W_0 + pR, W_1 + pR, nR) ; + return (GB_msort_2_64_64 (A_0, A_1, n, nthreads)) ; } - nt = 2*nt ; } - - //-------------------------------------------------------------------------- - // free workspace and return result - //-------------------------------------------------------------------------- - - GB_FREE_WORK (&W, W_size) ; - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/sort/GB_msort_2.h b/GraphBLAS/Source/sort/GB_msort_2.h deleted file mode 100644 index ca8ed87bc5..0000000000 --- a/GraphBLAS/Source/sort/GB_msort_2.h +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_msort_2.h: definitions for GB_msort_2.c -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// A parallel mergesort of an array of 2-by-n integers. Each key consists -// of two integers. - -#include "sort/GB_sort.h" - -//------------------------------------------------------------------------------ -// prototypes only needed for GB_msort_2 -//------------------------------------------------------------------------------ - -void GB_msort_2_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, - const int64_t pR_start, - const int64_t pR_end -) ; - diff --git a/GraphBLAS/Source/sort/GB_msort_3.c b/GraphBLAS/Source/sort/GB_msort_3.c index acdf602a7f..f47b755f91 100644 --- a/GraphBLAS/Source/sort/GB_msort_3.c +++ b/GraphBLAS/Source/sort/GB_msort_3.c @@ -2,316 +2,198 @@ // GB_msort_3: sort a 3-by-n list of integers, using A[0:2][ ] as the key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // A parallel mergesort of an array of 3-by-n integers. Each key -// consists of three integers. +// consists of three 32-bit or 64-bit unsigned integers. -#include "sort/GB_msort_3.h" +#include "sort/GB_sort.h" //------------------------------------------------------------------------------ -// GB_msort_3_binary_search: binary search for the pivot +// GB_msort_3_32_32_32 //------------------------------------------------------------------------------ -// The Pivot value is Z [pivot], and a binary search for the Pivot is made in -// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on -// input. The return value is pleft, where -// -// X [p_start ... pleft-1] <= Pivot and -// X [pleft ... p_end-1] >= Pivot holds. -// -// pleft is returned in the range p_start to p_end. If pleft is p_start, then -// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left -// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is -// larger than all entries in X [p_start...p_end-1], and the right list X -// [pleft...p_end-1] is empty. - -static int64_t GB_msort_3_binary_search // return pleft -( - const int64_t *restrict Z_0, // Pivot is Z [pivot] - const int64_t *restrict Z_1, - const int64_t *restrict Z_2, - const int64_t pivot, - const int64_t *restrict X_0, // search in X [p_start..p_end_-1] - const int64_t *restrict X_1, - const int64_t *restrict X_2, - const int64_t p_start, - const int64_t p_end -) -{ +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_A2_t uint32_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_32_32_32 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_32_32_32 +#define GB_msort_3_merge GB_msort_3_merge_32_32_32 +#define GB_msort_3_method GB_msort_3_32_32_32 - //-------------------------------------------------------------------------- - // find where the Pivot appears in X - //-------------------------------------------------------------------------- +#include "sort/factory/GB_msort_3_template.c" - // binary search of X [p_start...p_end-1] for the Pivot - int64_t pleft = p_start ; - int64_t pright = p_end - 1 ; - while (pleft < pright) - { - int64_t pmiddle = (pleft + pright) >> 1 ; - // less = (X [pmiddle] < Pivot) - bool less = GB_lt_3 (X_0, X_1, X_2, pmiddle, - Z_0, Z_1, Z_2, pivot) ; - pleft = less ? (pmiddle+1) : pleft ; - pright = less ? pright : pmiddle ; - } +//------------------------------------------------------------------------------ +// GB_msort_3_32_32_64 +//------------------------------------------------------------------------------ - // binary search is narrowed down to a single item - // or it has found the list is empty: - ASSERT (pleft == pright || pleft == pright + 1) ; - - // If found is true then X [pleft == pright] == Pivot. If duplicates - // appear then X [pleft] is any one of the entries equal to the Pivot - // in the list. If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft+1 ... p_end-1] > Pivot holds. - // The value X [pleft] may be either < or > Pivot. - bool found = (pleft == pright) && GB_eq_3 (X_0, X_1, X_2, pleft, - Z_0, Z_1, Z_2, pivot) ; - - // Modify pleft and pright: - if (!found && (pleft == pright)) - { - if (GB_lt_3 (X_0, X_1, X_2, pleft, - Z_0, Z_1, Z_2, pivot)) - { - pleft++ ; - } - else - { -// pright++ ; // (not needed) - } - } +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_A2_t uint64_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_32_32_64 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_32_32_64 +#define GB_msort_3_merge GB_msort_3_merge_32_32_64 +#define GB_msort_3_method GB_msort_3_32_32_64 + +#include "sort/factory/GB_msort_3_template.c" - // If found is false then - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] > Pivot holds, - // and pleft-1 == pright +//------------------------------------------------------------------------------ +// GB_msort_3_32_64_32 +//------------------------------------------------------------------------------ - // If X has no duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] < Pivot and - // X [pleft ... p_end-1] >= Pivot holds. +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method - // If X has duplicates, then whether or not Pivot is found, - // X [p_start ... pleft-1] <= Pivot and - // X [pleft ... p_end-1] >= Pivot holds. +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_A2_t uint32_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_32_64_32 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_32_64_32 +#define GB_msort_3_merge GB_msort_3_merge_32_64_32 +#define GB_msort_3_method GB_msort_3_32_64_32 - return (pleft) ; -} +#include "sort/factory/GB_msort_3_template.c" //------------------------------------------------------------------------------ -// GB_msort_3_create_merge_tasks +// GB_msort_3_32_64_64 //------------------------------------------------------------------------------ -// Recursively constructs ntasks tasks to merge two arrays, Left and Right, -// into Sresult, where Left is L [pL_start...pL_end-1], Right is R -// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], -// and where total_work is the total size of Left and Right. -// -// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and -// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output -// array S [S_task [tid] ... ]. The task tids created are t0 to -// t0+ntasks-1. - -void GB_msort_3_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, - const int64_t *restrict L_2, - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, - const int64_t *restrict R_2, - const int64_t pR_start, - const int64_t pR_end -) -{ +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method - //-------------------------------------------------------------------------- - // get problem size - //-------------------------------------------------------------------------- +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_A2_t uint64_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_32_64_64 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_32_64_64 +#define GB_msort_3_merge GB_msort_3_merge_32_64_64 +#define GB_msort_3_method GB_msort_3_32_64_64 - int64_t nleft = pL_end - pL_start ; // size of Left array - int64_t nright = pR_end - pR_start ; // size of Right array - int64_t total_work = nleft + nright ; // total work to do - ASSERT (ntasks >= 1) ; - ASSERT (total_work > 0) ; +#include "sort/factory/GB_msort_3_template.c" - //-------------------------------------------------------------------------- - // create the tasks - //-------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// GB_msort_3_64_32_32 +//------------------------------------------------------------------------------ - if (ntasks == 1) - { +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method - //---------------------------------------------------------------------- - // a single task will merge all of Left and Right into Sresult - //---------------------------------------------------------------------- +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_A2_t uint32_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_64_32_32 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_64_32_32 +#define GB_msort_3_merge GB_msort_3_merge_64_32_32 +#define GB_msort_3_method GB_msort_3_64_32_32 - L_task [t0] = pL_start ; L_len [t0] = nleft ; - R_task [t0] = pR_start ; R_len [t0] = nright ; - S_task [t0] = pS_start ; +#include "sort/factory/GB_msort_3_template.c" - } - else - { +//------------------------------------------------------------------------------ +// GB_msort_3_64_32_64 +//------------------------------------------------------------------------------ - //---------------------------------------------------------------------- - // partition the Left and Right arrays for multiple merge tasks - //---------------------------------------------------------------------- +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method - int64_t pleft, pright ; - if (nleft >= nright) - { - // split Left in half, and search for its pivot in Right - pleft = (pL_end + pL_start) >> 1 ; - pright = GB_msort_3_binary_search ( - L_0, L_1, L_2, pleft, - R_0, R_1, R_2, pR_start, pR_end) ; - } - else - { - // split Right in half, and search for its pivot in Left - pright = (pR_end + pR_start) >> 1 ; - pleft = GB_msort_3_binary_search ( - R_0, R_1, R_2, pright, - L_0, L_1, L_2, pL_start, pL_end) ; - } +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_A2_t uint64_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_64_32_64 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_64_32_64 +#define GB_msort_3_merge GB_msort_3_merge_64_32_64 +#define GB_msort_3_method GB_msort_3_64_32_64 - //---------------------------------------------------------------------- - // partition the tasks according to the work of each partition - //---------------------------------------------------------------------- - - // work0 is the total work in the first partition - int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; - int ntasks0 = (int) round ((double) ntasks * - (((double) work0) / ((double) total_work))) ; - - // ensure at least one task is assigned to each partition - ntasks0 = GB_IMAX (ntasks0, 1) ; - ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; - int ntasks1 = ntasks - ntasks0 ; - - //---------------------------------------------------------------------- - // assign ntasks0 to the first half - //---------------------------------------------------------------------- - - // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] - // into the result S [pS_start...work0-1]. - - GB_msort_3_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, - L_0, L_1, L_2, pL_start, pleft, - R_0, R_1, R_2, pR_start, pright) ; - - //---------------------------------------------------------------------- - // assign ntasks1 to the second half - //---------------------------------------------------------------------- - - // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] - // into the result S [pS_start+work0...pS_start+total_work]. - - int t1 = t0 + ntasks0 ; // first task id of the second set of tasks - int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S - GB_msort_3_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, - L_0, L_1, L_2, pleft, pL_end, - R_0, R_1, R_2, pright, pR_end) ; - } -} +#include "sort/factory/GB_msort_3_template.c" //------------------------------------------------------------------------------ -// GB_msort_3_merge: merge two sorted lists via a single thread +// GB_msort_3_64_64_32 //------------------------------------------------------------------------------ -// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] */ +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method -static void GB_msort_3_merge -( - int64_t *restrict S_0, // output of length nleft + nright - int64_t *restrict S_1, - int64_t *restrict S_2, - const int64_t *restrict Left_0, // left input of length nleft - const int64_t *restrict Left_1, - const int64_t *restrict Left_2, - const int64_t nleft, - const int64_t *restrict Right_0, // right input of length nright - const int64_t *restrict Right_1, - const int64_t *restrict Right_2, - const int64_t nright -) -{ - int64_t p, pleft, pright ; +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_A2_t uint32_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_64_64_32 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_64_64_32 +#define GB_msort_3_merge GB_msort_3_merge_64_64_32 +#define GB_msort_3_method GB_msort_3_64_64_32 - // merge the two inputs, Left and Right, while both inputs exist - for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) - { - if (GB_lt_3 (Left_0, Left_1, Left_2, pleft, - Right_0, Right_1, Right_2, pright)) - { - // S [p] = Left [pleft++] - S_0 [p] = Left_0 [pleft] ; - S_1 [p] = Left_1 [pleft] ; - S_2 [p] = Left_2 [pleft] ; - pleft++ ; - } - else - { - // S [p] = Right [pright++] - S_0 [p] = Right_0 [pright] ; - S_1 [p] = Right_1 [pright] ; - S_2 [p] = Right_2 [pright] ; - pright++ ; - } - } +#include "sort/factory/GB_msort_3_template.c" - // either input is exhausted; copy the remaining list into S - if (pleft < nleft) - { - int64_t nremaining = (nleft - pleft) ; - memcpy (S_0 + p, Left_0 + pleft, nremaining * sizeof (int64_t)) ; - memcpy (S_1 + p, Left_1 + pleft, nremaining * sizeof (int64_t)) ; - memcpy (S_2 + p, Left_2 + pleft, nremaining * sizeof (int64_t)) ; - } - else if (pright < nright) - { - int64_t nremaining = (nright - pright) ; - memcpy (S_0 + p, Right_0 + pright, nremaining * sizeof (int64_t)) ; - memcpy (S_1 + p, Right_1 + pright, nremaining * sizeof (int64_t)) ; - memcpy (S_2 + p, Right_2 + pright, nremaining * sizeof (int64_t)) ; - } -} +//------------------------------------------------------------------------------ +// GB_msort_3_64_64_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_msort_3_binary_search +#undef GB_msort_3_create_merge_tasks +#undef GB_msort_3_merge +#undef GB_msort_3_method + +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_A2_t uint64_t +#define GB_msort_3_binary_search GB_msort_3_binary_search_64_64_64 +#define GB_msort_3_create_merge_tasks GB_msort_3_create_merge_tasks_64_64_64 +#define GB_msort_3_merge GB_msort_3_merge_64_64_64 +#define GB_msort_3_method GB_msort_3_64_64_64 + +#include "sort/factory/GB_msort_3_template.c" //------------------------------------------------------------------------------ -// GB_msort_3: parallel mergesort +// GB_msort_3 //------------------------------------------------------------------------------ -GrB_Info GB_msort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) +GrB_Info GB_msort_3 // sort array A of size 3-by-n ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - int64_t *restrict A_2, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, else uint64 + void *restrict A_2, // size n array + bool A2_is_32, // if true: A_2 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) { @@ -319,142 +201,67 @@ GrB_Info GB_msort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) // handle small problems with a single thread //-------------------------------------------------------------------------- - if (nthreads <= 1 || n <= GB_BASECASE) + int nthreads = GB_nthreads (n, GB_MSORT_BASECASE, nthreads_max) ; + if (nthreads <= 1 || n <= GB_MSORT_BASECASE) { // sequential quicksort - GB_qsort_3 (A_0, A_1, A_2, n) ; + GB_qsort_3 (A_0, A0_is_32, A_1, A1_is_32, A_2, A2_is_32, n) ; return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- - // determine # of tasks - //-------------------------------------------------------------------------- - - // determine the number of levels to create, which must always be an - // even number. The # of levels is chosen to ensure that the # of leaves - // of the task tree is between 4*nthreads and 16*nthreads. - - // 2 to 4 threads: 4 levels, 16 qsort leaves - // 5 to 16 threads: 6 levels, 64 qsort leaves - // 17 to 64 threads: 8 levels, 256 qsort leaves - // 65 to 256 threads: 10 levels, 1024 qsort leaves - // 256 to 1024 threads: 12 levels, 4096 qsort leaves - // ... - - int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; - int ntasks = 1 << k ; - - //-------------------------------------------------------------------------- - // allocate workspace - //-------------------------------------------------------------------------- - - int64_t *restrict W = NULL ; size_t W_size = 0 ; - W = GB_MALLOC_WORK (3*n + 6*ntasks + 1, int64_t, &W_size) ; - if (W == NULL) - { - // out of memory - return (GrB_OUT_OF_MEMORY) ; - } - - int64_t *T = W ; - int64_t *restrict W_0 = T ; T += n ; - int64_t *restrict W_1 = T ; T += n ; - int64_t *restrict W_2 = T ; T += n ; - int64_t *restrict L_task = T ; T += ntasks ; - int64_t *restrict L_len = T ; T += ntasks ; - int64_t *restrict R_task = T ; T += ntasks ; - int64_t *restrict R_len = T ; T += ntasks ; - int64_t *restrict S_task = T ; T += ntasks ; - int64_t *restrict Slice = T ; T += (ntasks+1) ; - - //-------------------------------------------------------------------------- - // partition and sort the leaves + // call the type-specific GB_msort_3 method //-------------------------------------------------------------------------- - GB_e_slice (Slice, n, ntasks) ; - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) + if (A0_is_32) { - int64_t leaf = Slice [tid] ; - int64_t leafsize = Slice [tid+1] - leaf ; - GB_qsort_3 (A_0 + leaf, A_1 + leaf, A_2 + leaf, leafsize) ; - } - - //-------------------------------------------------------------------------- - // merge each level - //-------------------------------------------------------------------------- - - int nt = 1 ; - for ( ; k >= 2 ; k -= 2) - { - - //---------------------------------------------------------------------- - // merge level k into level k-1, from A into W - //---------------------------------------------------------------------- - - // TODO: skip k and k-1 for each group of 4 sublists of A if they are - // already sorted with respect to each other. - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + if (A1_is_32) { - // create 2*nt tasks to merge two A sublists into one W sublist - GB_msort_3_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - A_0, A_1, A_2, Slice [tid], Slice [tid+nt], - A_0, A_1, A_2, Slice [tid+nt], Slice [tid+2*nt]) ; + if (A2_is_32) + { + return (GB_msort_3_32_32_32 (A_0, A_1, A_2, n, nthreads)) ; + } + else + { + return (GB_msort_3_32_32_64 (A_0, A_1, A_2, n, nthreads)) ; + } } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) - { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - - GB_msort_3_merge ( - W_0 + pS, W_1 + pS, W_2 + pS, - A_0 + pL, A_1 + pL, A_2 + pL, nL, - A_0 + pR, A_1 + pR, A_2 + pR, nR) ; + else + { + if (A2_is_32) + { + return (GB_msort_3_32_64_32 (A_0, A_1, A_2, n, nthreads)) ; + } + else + { + return (GB_msort_3_32_64_64 (A_0, A_1, A_2, n, nthreads)) ; + } } - nt = 2*nt ; - - //---------------------------------------------------------------------- - // merge level k-1 into level k-2, from W into A - //---------------------------------------------------------------------- - - // this could be done in parallel if ntasks was large - for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + } + else + { + if (A1_is_32) { - // create 2*nt tasks to merge two W sublists into one A sublist - GB_msort_3_create_merge_tasks ( - L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], - W_0, W_1, W_2, Slice [tid], Slice [tid+nt], - W_0, W_1, W_2, Slice [tid+nt], Slice [tid+2*nt]) ; + if (A2_is_32) + { + return (GB_msort_3_64_32_32 (A_0, A_1, A_2, n, nthreads)) ; + } + else + { + return (GB_msort_3_64_32_64 (A_0, A_1, A_2, n, nthreads)) ; + } } - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) - for (tid = 0 ; tid < ntasks ; tid++) - { - // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] - int64_t pL = L_task [tid], nL = L_len [tid] ; - int64_t pR = R_task [tid], nR = R_len [tid] ; - int64_t pS = S_task [tid] ; - GB_msort_3_merge ( - A_0 + pS, A_1 + pS, A_2 + pS, - W_0 + pL, W_1 + pL, W_2 + pL, nL, - W_0 + pR, W_1 + pR, W_2 + pR, nR) ; + else + { + if (A2_is_32) + { + return (GB_msort_3_64_64_32 (A_0, A_1, A_2, n, nthreads)) ; + } + else + { + return (GB_msort_3_64_64_64 (A_0, A_1, A_2, n, nthreads)) ; + } } - nt = 2*nt ; } - - //-------------------------------------------------------------------------- - // free workspace and return result - //-------------------------------------------------------------------------- - - GB_FREE_WORK (&W, W_size) ; - return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/sort/GB_msort_3.h b/GraphBLAS/Source/sort/GB_msort_3.h deleted file mode 100644 index a80abd7669..0000000000 --- a/GraphBLAS/Source/sort/GB_msort_3.h +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_msort_3.h: definitions for GB_msort_3.c -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// A parallel mergesort of an array of 3-by-n integers. Each key consists -// of three integers. - -#include "sort/GB_sort.h" - -//------------------------------------------------------------------------------ -// prototypes only needed for GB_msort_3 -//------------------------------------------------------------------------------ - -void GB_msort_3_create_merge_tasks -( - // output: - int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed - int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed - int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed - int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed - int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed - // input: - const int t0, // first task tid to create - const int ntasks, // # of tasks to create - const int64_t pS_start, // merge into S [pS_start...] - const int64_t *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, - const int64_t *restrict L_2, - const int64_t pL_start, - const int64_t pL_end, - const int64_t *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, - const int64_t *restrict R_2, - const int64_t pR_start, - const int64_t pR_end -) ; - diff --git a/GraphBLAS/Source/sort/GB_qsort_1.c b/GraphBLAS/Source/sort/GB_qsort_1.c index e8d42b08ce..cd0aaadd7e 100644 --- a/GraphBLAS/Source/sort/GB_qsort_1.c +++ b/GraphBLAS/Source/sort/GB_qsort_1.c @@ -2,11 +2,13 @@ // GB_qsort_1: sort an 1-by-n list of integers //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each entry is a single 32-bit or 64-bit unsigned integer. + #include "sort/GB_sort.h" // returns true if A [a] < B [b] @@ -23,7 +25,7 @@ // argument list for defining a function #define GB_args(A) \ - int64_t *restrict A ## _0 + GB_A0_t *restrict A ## _0 // each entry has a single key #define GB_K 1 @@ -31,17 +33,71 @@ // swap A [a] and A [b] #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ +} + +//------------------------------------------------------------------------------ +// GB_qsort_1_32 +//------------------------------------------------------------------------------ + +#define GB_A0_t uint32_t +#define GB_partition GB_partition_1_32 +#define GB_quicksort GB_quicksort_1_32 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_1_32 +( + GB_A0_t *restrict A_0, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (A_0, n, &seed) ; } -#define GB_partition GB_partition_1 -#define GB_quicksort GB_quicksort_1 +//------------------------------------------------------------------------------ +// GB_qsort_1_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1_64 +#define GB_quicksort GB_quicksort_1_64 #include "sort/template/GB_qsort_template.c" -GB_CALLBACK_QSORT_1_PROTO (GB_qsort_1) +void GB_qsort_1_64 +( + GB_A0_t *restrict A_0, // size n array + const int64_t n +) { uint64_t seed = n ; - GB_quicksort (GB_arg (A), n, &seed) ; + GB_quicksort (A_0, n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1: sort an array A of size 1-by-n, 32 or 64 bit +//------------------------------------------------------------------------------ + +void GB_qsort_1 +( + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is 32-bit; else 64-bit + const int64_t n +) +{ + if (A0_is_32) + { + GB_qsort_1_32 ((uint32_t *) A_0, n) ; + } + else + { + GB_qsort_1_64 ((uint64_t *) A_0, n) ; + } } diff --git a/GraphBLAS/Source/sort/GB_qsort_1b.c b/GraphBLAS/Source/sort/GB_qsort_1b.c index 811fc44af7..c6b1b4f4b7 100644 --- a/GraphBLAS/Source/sort/GB_qsort_1b.c +++ b/GraphBLAS/Source/sort/GB_qsort_1b.c @@ -2,7 +2,7 @@ // GB_qsort_1b: sort a 2-by-n list, using A [0][ ] as the sort key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,13 +12,18 @@ // returns true if A [a] < B [b] #define GB_lt(A,a,B,b) GB_lt_1 (A ## _0, a, B ## _0, b) -// each entry has a single key +// Each entry has a single key: a 32-bit or 64-bit unsigned integer #define GB_K 1 //------------------------------------------------------------------------------ -// GB_qsort_1b: generic method for any data type +// GB_qsort_1b_32_generic: generic method for any data type, A0 is 32bit //------------------------------------------------------------------------------ +#define GB_A0_t uint32_t +#define GB_A1_t GB_void +#define GB_partition GB_partition_1b_32_generic +#define GB_quicksort GB_quicksort_1b_32_generic + // argument list for calling a function #define GB_arg(A) \ A ## _0, A ## _1, xsize @@ -29,30 +34,53 @@ // argument list for defining a function #define GB_args(A) \ - int64_t *restrict A ## _0, \ - GB_void *restrict A ## _1, \ + GB_A0_t *restrict A ## _0, \ + GB_A1_t *restrict A ## _1, \ size_t xsize // swap A [a] and A [b] #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ - GB_void t1 [GB_VLA(xsize)] ; \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A1_t t1 [GB_VLA(xsize)] ; \ memcpy (t1, A ## _1 + (a)*xsize, xsize) ; \ memcpy (A ## _1 + (a)*xsize, A ## _1 + (b)*xsize, xsize) ; \ memcpy (A ## _1 + (b)*xsize, t1, xsize) ; \ } -#define GB_partition GB_partition_1b -#define GB_quicksort GB_quicksort_1b +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_1b_32_generic // sort array A of size 2-by-n, using A0: 32 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const size_t xsize, // size of entries in A_1 + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_generic: generic method for any data type, A0 is 64bit +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_generic +#define GB_quicksort GB_quicksort_1b_64_generic #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) +void GB_qsort_1b_64_generic // sort array A of size 2-by-n, using A0: 64 ( - int64_t *restrict A_0, // size n array - GB_void *restrict A_1, // size n array - const size_t xsize, // size of entries in A_1 + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const size_t xsize, // size of entries in A_1 const int64_t n ) { @@ -61,12 +89,18 @@ void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) } //------------------------------------------------------------------------------ -// GB_qsort_1b_size1: quicksort with A_1 of type that has sizeof 1 +// GB_qsort_1b_32_size1: quicksort, A_1 of type that has sizeof 1, A0: 32bit //------------------------------------------------------------------------------ -// for GrB_BOOL, GrB_INT8, GrB_UINT8, and user-defined types with sizeof(...)=1 +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort -#define A1_type uint8_t +#define GB_A0_t uint32_t +#define GB_A1_t uint8_t +#define GB_partition GB_partition_1b_32_size1 +#define GB_quicksort GB_quicksort_1b_32_size1 // argument list for calling a function #undef GB_arg @@ -81,28 +115,48 @@ void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) // argument list for defining a function #undef GB_args #define GB_args(A) \ - int64_t *restrict A ## _0, \ - A1_type *restrict A ## _1 \ + GB_A0_t *restrict A ## _0, \ + GB_A1_t *restrict A ## _1 \ // swap A [a] and A [b] #undef GB_swap #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ - A1_type t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A1_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ } +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_1b_32_size1 // GB_qsort_1b, A_1 with sizeof = 1, A0: 32 bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_size1: quicksort, A_1 of type that has sizeof 1, A0: 64bit +//------------------------------------------------------------------------------ + +#undef GB_A0_t #undef GB_partition -#define GB_partition GB_partition_1b_size1 #undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_size1 + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_size1 +#define GB_quicksort GB_quicksort_1b_64_size1 #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b_size1 // GB_qsort_1b with A_1 with sizeof = 1 +void GB_qsort_1b_64_size1 // GB_qsort_1b with A_1 with sizeof = 1, A0: 64 ( - int64_t *restrict A_0, // size n array - uint8_t *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { @@ -111,24 +165,50 @@ void GB_qsort_1b_size1 // GB_qsort_1b with A_1 with sizeof = 1 } //------------------------------------------------------------------------------ -// GB_qsort_1b_size2: quicksort with A_1 of type that has sizeof 2 +// GB_qsort_1b_32_size2: quicksort: A_1 of type with sizeof 2, A0: 32 bit //------------------------------------------------------------------------------ -// for GrB_INT16, GrB_UINT16, and user-defined types of sizeof(...) = 2 +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint16_t +#define GB_partition GB_partition_1b_32_size2 +#define GB_quicksort GB_quicksort_1b_32_size2 -#undef A1_type -#define A1_type uint16_t +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_1b_32_size2 // GB_qsort_1b, A_1 with sizeof = 2, A0: 32 bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_size2: quicksort: A_1 of type with sizeof 2, A0: 64 bit +//------------------------------------------------------------------------------ + +#undef GB_A0_t #undef GB_partition -#define GB_partition GB_partition_1b_size2 #undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_size2 + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_size2 +#define GB_quicksort GB_quicksort_1b_64_size2 #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b_size2 // GB_qsort_1b with A_1 with sizeof = 2 +void GB_qsort_1b_64_size2 // GB_qsort_1b, A_1 with sizeof = 2, A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint16_t *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { @@ -137,25 +217,50 @@ void GB_qsort_1b_size2 // GB_qsort_1b with A_1 with sizeof = 2 } //------------------------------------------------------------------------------ -// GB_qsort_1b_size4: quicksort with A_1 of type that has sizeof 4 +// GB_qsort_1b_32_size4: quicksort, A_1 of type that has sizeof 4, A0: 32 bit //------------------------------------------------------------------------------ -// for GrB_INT32, GrB_UINT32, GrB_FP32, and user-defined types with -// sizeof(...) = 4. +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_partition GB_partition_1b_32_size4 +#define GB_quicksort GB_quicksort_1b_32_size4 + +#include "sort/template/GB_qsort_template.c" -#undef A1_type -#define A1_type uint32_t +void GB_qsort_1b_32_size4 // GB_qsort_1b A_1 with sizeof = 4, A0: 32 bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_size4: quicksort, A_1 of type that has sizeof 4, A0: 64 bit +//------------------------------------------------------------------------------ + +#undef GB_A0_t #undef GB_partition -#define GB_partition GB_partition_1b_size4 #undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_size4 + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_size4 +#define GB_quicksort GB_quicksort_1b_64_size4 #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b_size4 // GB_qsort_1b with A_1 with sizeof = 4 +void GB_qsort_1b_64_size4 // GB_qsort_1b A_1 with sizeof = 4, A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint32_t *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { @@ -164,25 +269,50 @@ void GB_qsort_1b_size4 // GB_qsort_1b with A_1 with sizeof = 4 } //------------------------------------------------------------------------------ -// GB_qsort_1b_size8: quicksort with A_1 of type that has sizeof 8 +// GB_qsort_1b_32_size8: quicksort, A_1 of type that has sizeof 8, A0: 32 bit //------------------------------------------------------------------------------ -// for GrB_INT64, GrB_UINT64, GrB_FP64, GxB_FC32, and user-defined types -// with sizeof(...) = 8. +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_partition GB_partition_1b_32_size8 +#define GB_quicksort GB_quicksort_1b_32_size8 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_1b_32_size8 // GB_qsort_1b, A_1 with sizeof = 8, A0: 32 bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_size8: quicksort, A_1 of type that has sizeof 8, A0: 64 bit +//------------------------------------------------------------------------------ -#undef A1_type -#define A1_type uint64_t +#undef GB_A0_t #undef GB_partition -#define GB_partition GB_partition_1b_size8 #undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_size8 + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_size8 +#define GB_quicksort GB_quicksort_1b_64_size8 #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b_size8 // GB_qsort_1b with A_1 with sizeof = 8 +void GB_qsort_1b_64_size8 // GB_qsort_1b, A_1 with sizeof = 8, A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint64_t *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { @@ -191,24 +321,50 @@ void GB_qsort_1b_size8 // GB_qsort_1b with A_1 with sizeof = 8 } //------------------------------------------------------------------------------ -// GB_qsort_1b_size16: quicksort with A_1 of type that has sizeof 16 +// GB_qsort_1b_32_size16: quicksort, A_1 of type that has sizeof 16, A0: 32 bit //------------------------------------------------------------------------------ -// for GxB_FC64 and user-defined types with sizeof(...) = 16. +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t GB_blob16 +#define GB_partition GB_partition_1b_32_size16 +#define GB_quicksort GB_quicksort_1b_32_size16 + +#include "sort/template/GB_qsort_template.c" -#undef A1_type -#define A1_type GB_blob16 +void GB_qsort_1b_32_size16 // GB_qsort_1b, A_1 with sizeof = 16, A0: 32 bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_1b_64_size16: quicksort, A_1 of type that has sizeof 16, A0: 64 bit +//------------------------------------------------------------------------------ + +#undef GB_A0_t #undef GB_partition -#define GB_partition GB_partition_1b_size16 #undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_size16 + +#define GB_A0_t uint64_t +#define GB_partition GB_partition_1b_64_size16 +#define GB_quicksort GB_quicksort_1b_64_size16 #include "sort/template/GB_qsort_template.c" -void GB_qsort_1b_size16 // GB_qsort_1b with A_1 with sizeof = 16 +void GB_qsort_1b_64_size16 // GB_qsort_1b, A_1 with sizeof = 16, A0: 64 bit ( - int64_t *restrict A_0, // size n array - GB_blob16 *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { diff --git a/GraphBLAS/Source/sort/GB_qsort_2.c b/GraphBLAS/Source/sort/GB_qsort_2.c index b2418951f1..027c400561 100644 --- a/GraphBLAS/Source/sort/GB_qsort_2.c +++ b/GraphBLAS/Source/sort/GB_qsort_2.c @@ -2,11 +2,13 @@ // GB_qsort_2: sort a 2-by-n list of integers, using A[0:1][ ] as the key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each entry consists of two 32-bit or 64-bit unsigned integers. + #include "sort/GB_sort.h" // returns true if A [a] < B [b] @@ -23,8 +25,8 @@ // argument list for defining a function #define GB_args(A) \ - int64_t *restrict A ## _0, \ - int64_t *restrict A ## _1 + GB_A0_t *restrict A ## _0, \ + GB_A1_t *restrict A ## _1 // each entry has a 2-integer key #define GB_K 2 @@ -32,19 +34,106 @@ // swap A [a] and A [b] #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ - int64_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A1_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ } -#define GB_partition GB_partition_2 -#define GB_quicksort GB_quicksort_2 +//------------------------------------------------------------------------------ +// GB_qsort_2_32_32 +//------------------------------------------------------------------------------ + +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_partition GB_partition_2_32_32 +#define GB_quicksort GB_quicksort_2_32_32 #include "sort/template/GB_qsort_template.c" -void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) +void GB_qsort_2_32_32 // sort A of size 2-by-n, A0: 32bit, A1: 32bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_2_32_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_partition GB_partition_2_32_64 +#define GB_quicksort GB_quicksort_2_32_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_2_32_64 // sort A of size 2-by-n, A0: 32bit, A1: 64bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_2_64_32 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_partition GB_partition_2_64_32 +#define GB_quicksort GB_quicksort_2_64_32 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_2_64_32 // sort A of size 2-by-n, A0: 64bit, A1: 32bit +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_2_64_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_partition GB_partition_2_64_64 +#define GB_quicksort GB_quicksort_2_64_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_2_64_64 // sort A of size 2-by-n, A0: 64bit, A1: 64bit ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { @@ -52,3 +141,44 @@ void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) GB_quicksort (GB_arg (A), n, &seed) ; } +//------------------------------------------------------------------------------ +// GB_qsort_2: for 32/64-bit cases +//------------------------------------------------------------------------------ + +void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) +( + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, false: uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, false: uint64 + const int64_t n +) +{ + if (A0_is_32) + { + if (A1_is_32) + { + // A0: uint32_t, A1: uint32_t + GB_qsort_2_32_32 (A_0, A_1, n) ; + } + else + { + // A0: uint32_t, A1: uint64_t + GB_qsort_2_32_64 (A_0, A_1, n) ; + } + } + else + { + if (A1_is_32) + { + // A0: uint64_t, A1: uint32_t + GB_qsort_2_64_32 (A_0, A_1, n) ; + } + else + { + // A0: uint64_t, A1: uint64_t + GB_qsort_2_64_64 (A_0, A_1, n) ; + } + } +} + diff --git a/GraphBLAS/Source/sort/GB_qsort_3.c b/GraphBLAS/Source/sort/GB_qsort_3.c index 9baf9fd362..1fa171220a 100644 --- a/GraphBLAS/Source/sort/GB_qsort_3.c +++ b/GraphBLAS/Source/sort/GB_qsort_3.c @@ -2,11 +2,13 @@ // GB_qsort_3: sort a 3-by-n list of integers, using A[0:2][] as the key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each entry consists of three 32-bit or 64-bit unsigned integers. + #include "sort/GB_sort.h" // returns true if A [a] < B [b] @@ -23,9 +25,9 @@ // argument list for defining a function #define GB_args(A) \ - int64_t *restrict A ## _0, \ - int64_t *restrict A ## _1, \ - int64_t *restrict A ## _2 + GB_A0_t *restrict A ## _0, \ + GB_A1_t *restrict A ## _1, \ + GB_A2_t *restrict A ## _2 // each entry has a 3-integer key #define GB_K 3 @@ -33,21 +35,238 @@ // swap A [a] and A [b] #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ - int64_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ - int64_t t2 = A ## _2 [a] ; A ## _2 [a] = A ## _2 [b] ; A ## _2 [b] = t2 ; \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A1_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ + GB_A2_t t2 = A ## _2 [a] ; A ## _2 [a] = A ## _2 [b] ; A ## _2 [b] = t2 ; \ } -#define GB_partition GB_partition_3 -#define GB_quicksort GB_quicksort_3 +//------------------------------------------------------------------------------ +// GB_qsort_3_32_32_32 +//------------------------------------------------------------------------------ + +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_A2_t uint32_t +#define GB_partition GB_partition_3_32_32_32 +#define GB_quicksort GB_quicksort_3_32_32_32 #include "sort/template/GB_qsort_template.c" -void GB_qsort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) +void GB_qsort_3_32_32_32 // sort A of size 3-by-n, A0: 32bit, A1: 32bit, A2: 32 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_32_32_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint32_t +#define GB_A2_t uint64_t +#define GB_partition GB_partition_3_32_32_64 +#define GB_quicksort GB_quicksort_3_32_32_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_32_32_64 // sort A of size 3-by-n, A0: 32bit, A1: 32bit, A2: 64 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_32_64_32 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_A2_t uint32_t +#define GB_partition GB_partition_3_32_64_32 +#define GB_quicksort GB_quicksort_3_32_64_32 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_32_64_32 // sort A of size 3-by-n, A0: 32bit, A1: 64, A2: 32 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_32_64_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint32_t +#define GB_A1_t uint64_t +#define GB_A2_t uint64_t +#define GB_partition GB_partition_3_32_64_64 +#define GB_quicksort GB_quicksort_3_32_64_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_32_64_64 // sort A of size 3-by-n, A0: 32bit, A1: 64, A2: 64 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_64_32_32 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_A2_t uint32_t +#define GB_partition GB_partition_3_64_32_32 +#define GB_quicksort GB_quicksort_3_64_32_32 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_64_32_32 // sort A of size 3-by-n, A0: 64bit, A1: 32bit, A2: 32 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_64_32_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint32_t +#define GB_A2_t uint64_t +#define GB_partition GB_partition_3_64_32_64 +#define GB_quicksort GB_quicksort_3_64_32_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_64_32_64 // sort A of size 3-by-n, A0: 64bit, A1: 32bit, A2: 64 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_64_64_32 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_A2_t uint32_t +#define GB_partition GB_partition_3_64_64_32 +#define GB_quicksort GB_quicksort_3_64_64_32 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_64_64_32 // sort A of size 3-by-n, A0: 64bit, A1: 64, A2: 32 +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +//------------------------------------------------------------------------------ +// GB_qsort_3_64_64_64 +//------------------------------------------------------------------------------ + +#undef GB_A0_t +#undef GB_A1_t +#undef GB_A2_t +#undef GB_partition +#undef GB_quicksort + +#define GB_A0_t uint64_t +#define GB_A1_t uint64_t +#define GB_A2_t uint64_t +#define GB_partition GB_partition_3_64_64_64 +#define GB_quicksort GB_quicksort_3_64_64_64 + +#include "sort/template/GB_qsort_template.c" + +void GB_qsort_3_64_64_64 // sort A of size 3-by-n, A0: 64bit, A1: 64, A2: 64 ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - int64_t *restrict A_2, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array const int64_t n ) { @@ -55,3 +274,78 @@ void GB_qsort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) GB_quicksort (GB_arg (A), n, &seed) ; } +//------------------------------------------------------------------------------ +// GB_qsort_3: for 32/64-bit cases +//------------------------------------------------------------------------------ + +void GB_qsort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) +( + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, false: uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, false: uint64 + void *restrict A_2, // size n array + bool A2_is_32, // if true: A_1 is uint32, false: uint64 + const int64_t n +) +{ + if (A0_is_32) + { + if (A1_is_32) + { + if (A2_is_32) + { + // A0: uint32_t, A1: uint32_t, A2: uint32_t + GB_qsort_3_32_32_32 (A_0, A_1, A_2, n) ; + } + else + { + // A0: uint32_t, A1: uint32_t, A2: uint64_t + GB_qsort_3_32_32_64 (A_0, A_1, A_2, n) ; + } + } + else + { + if (A2_is_32) + { + // A0: uint32_t, A1: uint64_t, A2: uint32_t + GB_qsort_3_32_64_32 (A_0, A_1, A_2, n) ; + } + else + { + // A0: uint32_t, A1: uint64_t, A2: uint64_t + GB_qsort_3_32_64_64 (A_0, A_1, A_2, n) ; + } + } + } + else + { + if (A1_is_32) + { + if (A2_is_32) + { + // A0: uint64_t, A1: uint32_t, A2: uint32_t + GB_qsort_3_64_32_32 (A_0, A_1, A_2, n) ; + } + else + { + // A0: uint64_t, A1: uint32_t, A2: uint64_t + GB_qsort_3_64_32_64 (A_0, A_1, A_2, n) ; + } + } + else + { + if (A2_is_32) + { + // A0: uint64_t, A1: uint64_t, A2: uint32_t + GB_qsort_3_64_64_32 (A_0, A_1, A_2, n) ; + } + else + { + // A0: uint64_t, A1: uint64_t, A2: uint64_t + GB_qsort_3_64_64_64 (A_0, A_1, A_2, n) ; + } + } + } +} + diff --git a/GraphBLAS/Source/sort/GB_sort.c b/GraphBLAS/Source/sort/GB_sort.c index 3f06b19302..605fd078fb 100644 --- a/GraphBLAS/Source/sort/GB_sort.c +++ b/GraphBLAS/Source/sort/GB_sort.c @@ -2,26 +2,24 @@ // GB_sort: sort all vectors in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "sort/GB_sort.h" #include "transpose/GB_transpose.h" -#include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" // macros: -// GB_SORT (func) defined as GB_sort_func_TYPE_ascend or _descend, -// GB_msort_ISO_ascend or _descend, -// or GB_msort_func_UDT +// GB_SORT (func) defined as GB_sort_XX_func_TYPE_ascend or _descend, +// or GB_sort_XX_func_UDT where XX = 32 or 64. // GB_C_TYPE bool, int8_, ... or GB_void for UDT - +// GB_Ci_TYPE the type of C->i (uint32_t or uint64_t) // GB_ADDR(A,p) A+p for builtin, A + p * GB_SIZE otherwise // GB_SIZE size of each entry: sizeof (GB_C_TYPE) for built-in -// GB_GET(x,X,i) x = (op->xtype) X [i] +// GB_GETX(x,X,i) x = (op->xtype) X [i] // GB_COPY(A,i,C,k) A [i] = C [k] // GB_SWAP(A,i,k) swap A [i] and A [k] // GB_LT compare two entries, x < y @@ -32,7 +30,7 @@ #define GB_SORT_UDT 0 #define GB_ADDR(A,i) ((A) + (i)) -#define GB_GET(x,A,i) GB_C_TYPE x = A [i] +#define GB_GETX(x,A,i) GB_C_TYPE x = A [i] #define GB_COPY(A,i,B,j) A [i] = B [j] #define GB_SIZE sizeof (GB_C_TYPE) #define GB_SWAP(A,i,j) \ @@ -49,50 +47,100 @@ #define GB_LT(less,a,i,b,j) \ less = (((a) < (b)) ? true : (((a) == (b)) ? ((i) < (j)) : false)) +#define GB_Ci_TYPE uint32_t + #define GB_C_TYPE bool -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_BOOL) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_BOOL) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int8_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT8) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_INT8) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int16_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT16) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_INT16) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int32_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_INT32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int64_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_INT64) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint8_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT8) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_UINT8) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint16_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT16) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_UINT16) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint32_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_UINT32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint64_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_UINT64) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE float -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_FP32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_FP32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE double -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_FP64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _ascend_FP64) +#include "sort/template/GB_sort_template.c" + +#undef GB_Ci_TYPE +#define GB_Ci_TYPE uint64_t + +#define GB_C_TYPE bool +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_BOOL) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int8_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_INT8) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int16_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_INT16) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int32_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_INT32) #include "sort/template/GB_sort_template.c" +#define GB_C_TYPE int64_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_INT64) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint8_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_UINT8) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint16_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_UINT16) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint32_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_UINT32) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint64_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_UINT64) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE float +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_FP32) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE double +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _ascend_FP64) +#include "sort/template/GB_sort_template.c" + + //------------------------------------------------------------------------------ // descending sort for built-in types //------------------------------------------------------------------------------ @@ -101,48 +149,98 @@ #define GB_LT(less,a,i,b,j) \ less = (((a) > (b)) ? true : (((a) == (b)) ? ((i) < (j)) : false)) +#undef GB_Ci_TYPE +#define GB_Ci_TYPE uint32_t + #define GB_C_TYPE bool -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_BOOL) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_BOOL) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int8_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT8) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_INT8) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int16_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT16) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_INT16) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int32_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_INT32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE int64_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_INT64) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint8_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT8) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_UINT8) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint16_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT16) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_UINT16) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint32_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_UINT32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE uint64_t -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_UINT64) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE float -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_FP32) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_FP32) #include "sort/template/GB_sort_template.c" #define GB_C_TYPE double -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_FP64) +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _descend_FP64) +#include "sort/template/GB_sort_template.c" + +#undef GB_Ci_TYPE +#define GB_Ci_TYPE uint64_t + +#define GB_C_TYPE bool +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_BOOL) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int8_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_INT8) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int16_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_INT16) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int32_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_INT32) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE int64_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_INT64) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint8_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_UINT8) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint16_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_UINT16) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint32_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_UINT32) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE uint64_t +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_UINT64) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE float +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_FP32) +#include "sort/template/GB_sort_template.c" + +#define GB_C_TYPE double +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _descend_FP64) #include "sort/template/GB_sort_template.c" //------------------------------------------------------------------------------ @@ -150,18 +248,17 @@ //------------------------------------------------------------------------------ #undef GB_ADDR -#undef GB_GET +#undef GB_GETX #undef GB_COPY #undef GB_SIZE #undef GB_SWAP #undef GB_LT #define GB_ADDR(A,i) ((A) + (i) * csize) -#define GB_GET(x,A,i) GB_void x [GB_VLA(xsize)] ; \ +#define GB_GETX(x,A,i) GB_void x [GB_VLA(xsize)] ; \ fcast (x, GB_ADDR (A, i), csize) #define GB_COPY(A,i,B,j) memcpy (GB_ADDR (A, i), GB_ADDR (B, j), csize) #define GB_SIZE csize -#define GB_C_TYPE GB_void #define GB_SWAP(A,i,j) \ { \ @@ -185,7 +282,17 @@ #undef GB_SORT_UDT #define GB_SORT_UDT 1 -#define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _UDT) + +#undef GB_Ci_TYPE +#define GB_Ci_TYPE uint32_t +#define GB_C_TYPE GB_void +#define GB_SORT(func) GB_EVAL3 (GB(sort_32_), func, _UDT) +#include "sort/template/GB_sort_template.c" + +#undef GB_Ci_TYPE +#define GB_Ci_TYPE uint64_t +#define GB_C_TYPE GB_void +#define GB_SORT(func) GB_EVAL3 (GB(sort_64_), func, _UDT) #include "sort/template/GB_sort_template.c" //------------------------------------------------------------------------------ @@ -244,17 +351,35 @@ GrB_Info GB_sort GrB_Type atype = A->type ; GrB_Type ctype = (C_is_NULL) ? atype : C->type ; - GrB_Type ptype = (P == NULL) ? GrB_INT64 : P->type ; + GrB_Type ptype = (P == NULL) ? NULL : P->type ; + bool ptype_ok = true ; + + if (ptype != NULL) + { + // if present, P must have a int32, uint32, int64, uint64 data type + // that is large enough to hold the row/column indices of C + int64_t n = GB_IMAX (A->vlen, A->vdim) ; + int64_t nmax = -1 ; + switch (ptype->code) + { + case GB_INT32_code : nmax = INT32_MAX ; break ; + case GB_UINT32_code : nmax = UINT32_MAX ; break ; + case GB_INT64_code : nmax = INT64_MAX ; break ; + case GB_UINT64_code : nmax = INT64_MAX ; break ; + default : nmax = -1 ; break ; + } + ptype_ok = (n <= nmax) ; + } if (op->ztype != GrB_BOOL || op->xtype != op->ytype || atype != ctype - || !(ptype == GrB_INT64 || ptype == GrB_UINT64) + || !ptype_ok || !GB_Type_compatible (atype, op->xtype) || GB_IS_INDEXBINARYOP_CODE (op->opcode)) { - // op must return bool, and its inputs x and y must have the same type; - // the types of A and C must match exactly; P must be INT64 or UINT64; - // A and C must be typecasted to the input type of the op. - // Positional ops are not allowed. + // op must return bool, and its inputs x and y must have the same type. + // The types of A and C must match exactly. P must have a valid data + // type if present. A and C must be typecasted to the input type of + // the op. Positional ops are not allowed. return (GrB_DOMAIN_MISMATCH) ; } @@ -271,7 +396,11 @@ GrB_Info GB_sort bool sort_in_place = (A == C) ; // free any prior content of C and P - GB_phybix_free (P) ; + if (A == P) + { + return (GrB_NOT_IMPLEMENTED) ; // A and P cannot be aliased + } + GB_phybix_free (P) ; // this frees A if A == P are aliased if (!sort_in_place) { GB_phybix_free (C) ; @@ -284,7 +413,7 @@ GrB_Info GB_sort if (C_is_NULL) { // C is a temporary matrix, which is freed when done - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; C = T ; } @@ -296,7 +425,7 @@ GrB_Info GB_sort // A is already CSC if (!sort_in_place) { - // A = C + // C = A GB_OK (GB_dup_worker (&C, A_iso, A, true, atype)) ; } } @@ -305,8 +434,8 @@ GrB_Info GB_sort // A is CSR but C must be CSC if (sort_in_place) { - // A = A' - GB_OK (GB_transpose_in_place (A, true, Werk)) ; + // C = C' + GB_OK (GB_transpose_in_place (C, true, Werk)) ; } else { @@ -323,7 +452,7 @@ GrB_Info GB_sort // A is already CSR if (!sort_in_place) { - // A = C + // C = A GB_OK (GB_dup_worker (&C, A_iso, A, true, atype)) ; } } @@ -332,8 +461,8 @@ GrB_Info GB_sort // A is CSC but C must be CSR if (sort_in_place) { - // A = A' - GB_OK (GB_transpose_in_place (A, false, Werk)) ; + // C = C' + GB_OK (GB_transpose_in_place (C, false, Werk)) ; } else { @@ -359,6 +488,8 @@ GrB_Info GB_sort GB_Opcode opcode = op->opcode ; GB_Type_code acode = atype->code ; + ASSERT_MATRIX_OK (C, "C to sort", GB0) ; + if (C->iso || cnz <= 1) { @@ -378,84 +509,166 @@ GrB_Info GB_sort // no typecasting, using built-in < or > operators, builtin types //---------------------------------------------------------------------- - if (opcode == GB_LT_binop_code) + if (opcode == GB_LT_binop_code && C->i_is_32) + { + // ascending sort, 32-bit integers + switch (acode) + { + case GB_BOOL_code : + GB_OK (GB(sort_32_mtx_ascend_BOOL )(C, nthreads, Werk)) ; + break ; + case GB_INT8_code : + GB_OK (GB(sort_32_mtx_ascend_INT8 )(C, nthreads, Werk)) ; + break ; + case GB_INT16_code : + GB_OK (GB(sort_32_mtx_ascend_INT16 )(C, nthreads, Werk)) ; + break ; + case GB_INT32_code : + GB_OK (GB(sort_32_mtx_ascend_INT32 )(C, nthreads, Werk)) ; + break ; + case GB_INT64_code : + GB_OK (GB(sort_32_mtx_ascend_INT64 )(C, nthreads, Werk)) ; + break ; + case GB_UINT8_code : + GB_OK (GB(sort_32_mtx_ascend_UINT8 )(C, nthreads, Werk)) ; + break ; + case GB_UINT16_code : + GB_OK (GB(sort_32_mtx_ascend_UINT16 )(C, nthreads, Werk)) ; + break ; + case GB_UINT32_code : + GB_OK (GB(sort_32_mtx_ascend_UINT32 )(C, nthreads, Werk)) ; + break ; + case GB_UINT64_code : + GB_OK (GB(sort_32_mtx_ascend_UINT64 )(C, nthreads, Werk)) ; + break ; + case GB_FP32_code : + GB_OK (GB(sort_32_mtx_ascend_FP32 )(C, nthreads, Werk)) ; + break ; + case GB_FP64_code : + GB_OK (GB(sort_32_mtx_ascend_FP64 )(C, nthreads, Werk)) ; + break ; + default:; + } + } + else if (opcode == GB_GT_binop_code && C->i_is_32) + { + // descending sort + switch (acode) + { + case GB_BOOL_code : + GB_OK (GB(sort_32_mtx_descend_BOOL )(C, nthreads, Werk)) ; + break ; + case GB_INT8_code : + GB_OK (GB(sort_32_mtx_descend_INT8 )(C, nthreads, Werk)) ; + break ; + case GB_INT16_code : + GB_OK (GB(sort_32_mtx_descend_INT16 )(C, nthreads, Werk)) ; + break ; + case GB_INT32_code : + GB_OK (GB(sort_32_mtx_descend_INT32 )(C, nthreads, Werk)) ; + break ; + case GB_INT64_code : + GB_OK (GB(sort_32_mtx_descend_INT64 )(C, nthreads, Werk)) ; + break ; + case GB_UINT8_code : + GB_OK (GB(sort_32_mtx_descend_UINT8 )(C, nthreads, Werk)) ; + break ; + case GB_UINT16_code : + GB_OK (GB(sort_32_mtx_descend_UINT16)(C, nthreads, Werk)) ; + break ; + case GB_UINT32_code : + GB_OK (GB(sort_32_mtx_descend_UINT32)(C, nthreads, Werk)) ; + break ; + case GB_UINT64_code : + GB_OK (GB(sort_32_mtx_descend_UINT64)(C, nthreads, Werk)) ; + break ; + case GB_FP32_code : + GB_OK (GB(sort_32_mtx_descend_FP32 )(C, nthreads, Werk)) ; + break ; + case GB_FP64_code : + GB_OK (GB(sort_32_mtx_descend_FP64 )(C, nthreads, Werk)) ; + break ; + default:; + } + } + else if (opcode == GB_LT_binop_code && !C->i_is_32) { - // ascending sort + // ascending sort, 64-bit integers switch (acode) { case GB_BOOL_code : - GB_OK (GB(sort_matrix_ascend_BOOL )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_BOOL )(C, nthreads, Werk)) ; break ; case GB_INT8_code : - GB_OK (GB(sort_matrix_ascend_INT8 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_INT8 )(C, nthreads, Werk)) ; break ; case GB_INT16_code : - GB_OK (GB(sort_matrix_ascend_INT16 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_INT16 )(C, nthreads, Werk)) ; break ; case GB_INT32_code : - GB_OK (GB(sort_matrix_ascend_INT32 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_INT32 )(C, nthreads, Werk)) ; break ; case GB_INT64_code : - GB_OK (GB(sort_matrix_ascend_INT64 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_INT64 )(C, nthreads, Werk)) ; break ; case GB_UINT8_code : - GB_OK (GB(sort_matrix_ascend_UINT8 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_UINT8 )(C, nthreads, Werk)) ; break ; case GB_UINT16_code : - GB_OK (GB(sort_matrix_ascend_UINT16 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_UINT16 )(C, nthreads, Werk)) ; break ; case GB_UINT32_code : - GB_OK (GB(sort_matrix_ascend_UINT32 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_UINT32 )(C, nthreads, Werk)) ; break ; case GB_UINT64_code : - GB_OK (GB(sort_matrix_ascend_UINT64 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_UINT64 )(C, nthreads, Werk)) ; break ; case GB_FP32_code : - GB_OK (GB(sort_matrix_ascend_FP32 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_FP32 )(C, nthreads, Werk)) ; break ; case GB_FP64_code : - GB_OK (GB(sort_matrix_ascend_FP64 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_ascend_FP64 )(C, nthreads, Werk)) ; break ; default:; } } - else // opcode == GB_GT_binop_code + else // if (opcode == GB_GT_binop_code && !C->i_is_32) { // descending sort switch (acode) { case GB_BOOL_code : - GB_OK (GB(sort_matrix_descend_BOOL )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_BOOL )(C, nthreads, Werk)) ; break ; case GB_INT8_code : - GB_OK (GB(sort_matrix_descend_INT8 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_INT8 )(C, nthreads, Werk)) ; break ; case GB_INT16_code : - GB_OK (GB(sort_matrix_descend_INT16 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_INT16 )(C, nthreads, Werk)) ; break ; case GB_INT32_code : - GB_OK (GB(sort_matrix_descend_INT32 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_INT32 )(C, nthreads, Werk)) ; break ; case GB_INT64_code : - GB_OK (GB(sort_matrix_descend_INT64 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_INT64 )(C, nthreads, Werk)) ; break ; case GB_UINT8_code : - GB_OK (GB(sort_matrix_descend_UINT8 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_UINT8 )(C, nthreads, Werk)) ; break ; case GB_UINT16_code : - GB_OK (GB(sort_matrix_descend_UINT16)(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_UINT16)(C, nthreads, Werk)) ; break ; case GB_UINT32_code : - GB_OK (GB(sort_matrix_descend_UINT32)(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_UINT32)(C, nthreads, Werk)) ; break ; case GB_UINT64_code : - GB_OK (GB(sort_matrix_descend_UINT64)(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_UINT64)(C, nthreads, Werk)) ; break ; case GB_FP32_code : - GB_OK (GB(sort_matrix_descend_FP32 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_FP32 )(C, nthreads, Werk)) ; break ; case GB_FP64_code : - GB_OK (GB(sort_matrix_descend_FP64 )(C, nthreads, Werk)) ; + GB_OK (GB(sort_64_mtx_descend_FP64 )(C, nthreads, Werk)) ; break ; default:; } @@ -474,8 +687,15 @@ GrB_Info GB_sort // via the generic kernel if (info == GrB_NO_VALUE) - { - info = GB (sort_matrix_UDT) (C, op, nthreads, Werk) ; + { + if (C->i_is_32) + { + info = GB (sort_32_mtx_UDT) (C, op, nthreads, Werk) ; + } + else + { + info = GB (sort_64_mtx_UDT) (C, op, nthreads, Werk) ; + } } GB_OK (info) ; @@ -486,17 +706,21 @@ GrB_Info GB_sort //-------------------------------------------------------------------------- int64_t cnvec = C->nvec ; - int64_t *restrict Ti = NULL ; + GB_MDECL (Ti, ,) ; + bool Ti_is_32 ; if (P == NULL) { // P is not constructed; use C->i to construct the new indices + ASSERT (!C_is_NULL) ; Ti = C->i ; + Ti_is_32 = C->i_is_32 ; } else { // allocate P->i and use it to construct the new indices - P->i = GB_MALLOC (cnz, int64_t, &(P->i_size)) ; + size_t pisize = P->i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + P->i = GB_MALLOC_MEMORY (cnz, pisize, &(P->i_size)) ; if (P->i == NULL) { // out of memory @@ -504,11 +728,15 @@ GrB_Info GB_sort return (GrB_OUT_OF_MEMORY) ; } Ti = P->i ; + Ti_is_32 = P->i_is_32 ; } + GB_IPTR (Ti, Ti_is_32) ; + int C_nthreads, C_ntasks ; GB_SLICE_MATRIX (C, 1) ; - int64_t *restrict Cp = C->p ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + int tid ; #pragma omp parallel for num_threads(C_nthreads) schedule(static,1) for (tid = 0 ; tid < C_ntasks ; tid++) @@ -517,12 +745,13 @@ GrB_Info GB_sort int64_t klast = klast_Cslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - const int64_t pC0 = Cp [k] ; + const int64_t pC0 = GB_IGET (Cp, k) ; GB_GET_PA (pC_start, pC_end, tid, k, kfirst, klast, pstart_Cslice, - pC0, Cp [k+1]) ; + pC0, GB_IGET (Cp, k+1)) ; for (int64_t pC = pC_start ; pC < pC_end ; pC++) { - Ti [pC] = pC - pC0 ; + int64_t i = pC - pC0 ; + GB_ISET (Ti, pC, i) ; // Ti [pC] = i } } } @@ -532,20 +761,38 @@ GrB_Info GB_sort //-------------------------------------------------------------------------- bool C_is_hyper = GB_IS_HYPERSPARSE (C) ; + size_t cisize = (C->i_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + GB_Type_code cpcode = (C->p_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code cjcode = (C->j_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code cicode = (C->i_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code picode, pjcode ; if (P != NULL) { P->is_csc = C->is_csc ; P->nvec = C->nvec ; - P->nvec_nonempty = C->nvec_nonempty ; +// P->nvec_nonempty = C->nvec_nonempty ; + GB_nvec_nonempty_set (P, GB_nvec_nonempty_get (C)) ; P->iso = false ; P->vlen = C->vlen ; P->vdim = C->vdim ; - if (C_is_NULL) + size_t ppsize = (P->p_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t pjsize = (P->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t pxsize = ptype->size ; + GB_Type_code pxcode = ptype->code ; + GB_Type_code ppcode = (P->p_is_32) ? GB_UINT32_code : GB_UINT64_code ; + pjcode = (P->j_is_32) ? GB_UINT32_code : GB_UINT64_code ; + picode = (P->i_is_32) ? GB_UINT32_code : GB_UINT64_code ; + + if (C_is_NULL && pxsize == cisize && + P->p_is_32 == C->p_is_32 && + P->j_is_32 == C->j_is_32 && + P->i_is_32 == C->i_is_32) { - // the values of C are not needed. The indices of C become the - // values of P, Cp becomes Pp, and Ch (if present) becomes Ph. + // C is a temporary matrix T, and its contents are not needed. The + // indices of C become the values of P, Cp becomes Pp, and Ch (if + // present) becomes Ph. P->x = C->i ; C->i = NULL ; P->x_size = C->i_size ; P->p = C->p ; C->p = NULL ; P->p_size = C->p_size ; P->h = C->h ; C->h = NULL ; P->h_size = C->h_size ; @@ -553,17 +800,17 @@ GrB_Info GB_sort } else { - // C is required on output. The indices of C are copied and - // become the values of P. Cp is copied to Pp, and Ch (if present) - // is copied to Ph. + // C is required on output, or it has integers of the wrong size. + // The indices of C are copied and become the values of P. Cp is + // copied to Pp, and Ch (if present) is copied to Ph. int64_t pplen = GB_IMAX (1, cnvec) ; P->plen = pplen ; - P->x = GB_MALLOC (cnz, int64_t, &(P->x_size)) ; // x:OK - P->p = GB_MALLOC (pplen+1, int64_t, &(P->p_size)) ; + P->x = GB_MALLOC_MEMORY (cnz, pxsize, &(P->x_size)) ; + P->p = GB_MALLOC_MEMORY (pplen+1, ppsize, &(P->p_size)) ; P->h = NULL ; if (C_is_hyper) { - P->h = GB_MALLOC (pplen, int64_t, &(P->h_size)) ; + P->h = GB_MALLOC_MEMORY (pplen, pjsize, &(P->h_size)) ; } if (P->x == NULL || P->p == NULL || (C_is_hyper && P->h == NULL)) { @@ -573,11 +820,14 @@ GrB_Info GB_sort } // copy from C to P - GB_memcpy (P->x, C->i, cnz * sizeof (int64_t), nthreads_max) ; - GB_memcpy (P->p, C->p, (cnvec+1) * sizeof (int64_t), nthreads_max) ; +// GB_memcpy (P->x, C->i, cnz * sizeof (int64_t), nthreads_max) ; + GB_cast_int (P->x, pxcode, C->i, cicode, cnz, nthreads_max) ; +// GB_memcpy (P->p, C->p, (cnvec+1) * sizeof (int64_t), nthreads_max) ; + GB_cast_int (P->p, ppcode, C->p, cpcode, cnvec+1, nthreads_max) ; if (C_is_hyper) { - GB_memcpy (P->h, C->h, cnvec * sizeof (int64_t), nthreads_max) ; +// GB_memcpy (P->h, C->h, cnvec * sizeof (int64_t), nthreads_max) ; + GB_cast_int (P->h, pjcode, C->h, cjcode, cnvec, nthreads_max) ; } } @@ -592,7 +842,8 @@ GrB_Info GB_sort if (!C_is_NULL && P != NULL) { // copy P->i into C->i - GB_memcpy (C->i, P->i, cnz * sizeof (int64_t), nthreads_max) ; +// GB_memcpy (C->i, P->i, cnz * sizeof (int64_t), nthreads_max) ; + GB_cast_int (C->i, cicode, P->i, picode, cnz, nthreads_max) ; } //-------------------------------------------------------------------------- @@ -600,15 +851,14 @@ GrB_Info GB_sort //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; + if (!C_is_NULL) { - ASSERT_MATRIX_OK (C, "C output of GB_sort (before conform)", GB0) ; GB_OK (GB_conform (C, Werk)) ; ASSERT_MATRIX_OK (C, "C output of GB_sort", GB0) ; } if (P != NULL) { - ASSERT_MATRIX_OK (P, "P output of GB_sort (before conform)", GB0) ; GB_OK (GB_conform (P, Werk)) ; ASSERT_MATRIX_OK (P, "P output of GB_sort", GB0) ; } diff --git a/GraphBLAS/Source/sort/GB_sort.h b/GraphBLAS/Source/sort/GB_sort.h index 50c6ef4364..ac480134de 100644 --- a/GraphBLAS/Source/sort/GB_sort.h +++ b/GraphBLAS/Source/sort/GB_sort.h @@ -2,7 +2,7 @@ // GB_sort.h: definitions for sorting functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,94 +10,260 @@ // All of the GB_qsort_* functions are single-threaded, by design. The // GB_msort_* functions are parallel. None of these sorting methods are // guaranteed to be stable, but they are always used in GraphBLAS with unique -// keys. +// keys, so they do not have to be stable. #ifndef GB_SORT_H #define GB_SORT_H #include "GB.h" #include "sort/include/GB_sort_kernels.h" +#define GB_MSORT_BASECASE (2*1024) -void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) +void GB_qsort_1b_32_generic // sort array A of size 2-by-n, using A0: 32 bit ( - int64_t *restrict A_0, // size n array + uint32_t *restrict A_0, // size n array GB_void *restrict A_1, // size n array const size_t xsize, // size of entries in A_1 const int64_t n ) ; -void GB_qsort_1b_size1 // GB_qsort_1b with A1 with sizeof = 1 +void GB_qsort_1b_64_generic // sort array A of size 2-by-n, using A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint8_t *restrict A_1, // size n array + uint64_t *restrict A_0, // size n array + GB_void *restrict A_1, // size n array + const size_t xsize, // size of entries in A_1 + const int64_t n +) ; + +void GB_qsort_1b_32_size1 // GB_qsort_1b, A1 with sizeof = 1, A0: 32 bit +( + uint32_t *restrict A_0, // size n array + uint8_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1b_64_size1 // GB_qsort_1b, A1 with sizeof = 1, A0: 64 bit +( + uint64_t *restrict A_0, // size n array + uint8_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1b_32_size2 // GB_qsort_1b, A1 with sizeof = 2, A0: 32 bit +( + uint32_t *restrict A_0, // size n array + uint16_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1b_64_size2 // GB_qsort_1b, A1 with sizeof = 2, A0: 64 bit +( + uint64_t *restrict A_0, // size n array + uint16_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1b_32_size4 // GB_qsort_1b, A1 with sizeof = 4, A0: 32 bit +( + uint32_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array const int64_t n ) ; -void GB_qsort_1b_size2 // GB_qsort_1b with A1 with sizeof = 2 +void GB_qsort_1b_64_size4 // GB_qsort_1b, A1 with sizeof = 4, A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint16_t *restrict A_1, // size n array + uint64_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array const int64_t n ) ; -void GB_qsort_1b_size4 // GB_qsort_1b with A1 with sizeof = 4 +void GB_qsort_1b_32_size8 // GB_qsort_1b, A_1 with sizeof = 8, A0: 32 bit ( - int64_t *restrict A_0, // size n array - uint32_t *restrict A_1, // size n array + uint32_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array const int64_t n ) ; -void GB_qsort_1b_size8 // GB_qsort_1b with A_1 with sizeof = 8 +void GB_qsort_1b_64_size8 // GB_qsort_1b, A_1 with sizeof = 8, A0: 64 bit ( - int64_t *restrict A_0, // size n array - uint64_t *restrict A_1, // size n array + uint64_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array const int64_t n ) ; -void GB_qsort_1b_size16 // GB_qsort_1b with A_1 with sizeof = 16 +void GB_qsort_1b_32_size16 // GB_qsort_1b, A_1 with sizeof = 16, A0: 64 bit ( - int64_t *restrict A_0, // size n array - GB_blob16 *restrict A_1, // size n array + uint32_t *restrict A_0, // size n array + GB_blob16 *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1b_64_size16 // GB_qsort_1b, A_1 with sizeof = 16, A0: 64 bit +( + uint64_t *restrict A_0, // size n array + GB_blob16 *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_1_32 +( + uint32_t *restrict A_0, // size n array + const int64_t n +) ; + +void GB_qsort_1_64 +( + uint64_t *restrict A_0, // size n array + const int64_t n +) ; + +void GB_qsort_1 +( + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is 32-bit; else 64-bit + const int64_t n +) ; + +void GB_qsort_2_64_64 // sort A of size 2-by-n, A0: 64bit, A1: 64bit +( + uint64_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_2_32_64 // sort A of size 2-by-n, A0: 32bit, A1: 64bit +( + uint32_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_2_64_32 // sort A of size 2-by-n, A0: 64bit, A1: 32bit +( + uint64_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array + const int64_t n +) ; + +void GB_qsort_2_32_32 // sort A of size 2-by-n, A0: 32bit, A1: 32bit +( + uint32_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array const int64_t n ) ; void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, false: uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, false: uint64 + const int64_t n +) ; + +void GB_qsort_3_32_32_32 // sort A of size 3-by-n, A0: 32bit, A1: 32, A2: 32 +( + uint32_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array + uint32_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_32_32_64 // sort A of size 3-by-n, A0: 32bit, A1: 32, A2: 64 +( + uint32_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array + uint64_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_32_64_32 // sort A of size 3-by-n, A0: 32bit, A1: 64, A2: 32 +( + uint32_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + uint32_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_32_64_64 // sort A of size 3-by-n, A0: 32bit, A1: 64, A2: 64 +( + uint32_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + uint64_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_64_32_32 // sort A of size 3-by-n, A0: 64bit, A1: 32, A2: 32 +( + uint64_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array + uint32_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_64_32_64 // sort A of size 3-by-n, A0: 64bit, A1: 32, A2: 64 +( + uint64_t *restrict A_0, // size n array + uint32_t *restrict A_1, // size n array + uint64_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_64_64_32 // sort A of size 3-by-n, A0: 64bit, A1: 64, A2: 32 +( + uint64_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + uint32_t *restrict A_2, // size n array + const int64_t n +) ; + +void GB_qsort_3_64_64_64 // sort A of size 3-by-n, A0: 64bit, A1: 64, A2: 64 +( + uint64_t *restrict A_0, // size n array + uint64_t *restrict A_1, // size n array + uint64_t *restrict A_2, // size n array const int64_t n ) ; void GB_qsort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - int64_t *restrict A_2, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, false: uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, false: uint64 + void *restrict A_2, // size n array + bool A2_is_32, // if true: A_1 is uint32, false: uint64 const int64_t n ) ; GrB_Info GB_msort_1 // sort array A of size 1-by-n ( - int64_t *restrict A_0, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) ; -GrB_Info GB_msort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) +GrB_Info GB_msort_2 // sort array A of size 2-by-n ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) ; -GrB_Info GB_msort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) +GrB_Info GB_msort_3 // sort array A of size 3-by-n ( - int64_t *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - int64_t *restrict A_2, // size n array + void *restrict A_0, // size n array + bool A0_is_32, // if true: A_0 is uint32, else uint64 + void *restrict A_1, // size n array + bool A1_is_32, // if true: A_1 is uint32, else uint64 + void *restrict A_2, // size n array + bool A2_is_32, // if true: A_2 is uint32, else uint64 const int64_t n, - int nthreads // # of threads to use + int nthreads_max // max # of threads to use ) ; //------------------------------------------------------------------------------ @@ -118,4 +284,3 @@ GrB_Info GB_sort #endif - diff --git a/GraphBLAS/Source/sort/GxB_Matrix_sort.c b/GraphBLAS/Source/sort/GxB_Matrix_sort.c index b47b66ba1d..3608ba4f9a 100644 --- a/GraphBLAS/Source/sort/GxB_Matrix_sort.c +++ b/GraphBLAS/Source/sort/GxB_Matrix_sort.c @@ -2,7 +2,7 @@ // GxB_Matrix_sort: sort the values in each vector of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,10 +26,12 @@ GrB_Info GxB_Matrix_sort // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_sort (C, P, op, A, desc)") ; - GB_BURBLE_START ("GxB_Matrix_sort") ; + GB_RETURN_IF_NULL (A) ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (P) ; + GB_WHERE_3 (C, P, A, "GxB_Matrix_sort (C, P, op, A, desc)") ; + GB_BURBLE_START ("GxB_Matrix_sort") ; // get the descriptor GB_GET_DESCRIPTOR (info, desc, xx0, xx1, xx2, A_transpose, xx3, xx4, xx5) ; diff --git a/GraphBLAS/Source/sort/GxB_Vector_sort.c b/GraphBLAS/Source/sort/GxB_Vector_sort.c index 593aec9f2c..be6f934913 100644 --- a/GraphBLAS/Source/sort/GxB_Vector_sort.c +++ b/GraphBLAS/Source/sort/GxB_Vector_sort.c @@ -2,7 +2,7 @@ // GxB_Vector_sort: sort the values in a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,17 +26,20 @@ GrB_Info GxB_Vector_sort // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_sort (w, p, op, u, desc)") ; - GB_BURBLE_START ("GxB_Vector_sort") ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; - GB_RETURN_IF_NULL_OR_FAULTY (u) ; + GB_RETURN_IF_NULL (u) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (w) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (p) ; + GB_WHERE_3 (w, p, u, "GxB_Vector_sort (w, p, op, u, desc)") ; + GB_BURBLE_START ("GxB_Vector_sort") ; + ASSERT (GB_VECTOR_OK (u)) ; //-------------------------------------------------------------------------- // sort the vector //-------------------------------------------------------------------------- - GrB_Info info = GB_sort ((GrB_Matrix) w, (GrB_Matrix) p, op, + info = GB_sort ((GrB_Matrix) w, (GrB_Matrix) p, op, (GrB_Matrix) u, true, Werk) ; GB_BURBLE_END ; return (info) ; diff --git a/GraphBLAS/Source/sort/factory/GB_msort_1_template.c b/GraphBLAS/Source/sort/factory/GB_msort_1_template.c new file mode 100644 index 0000000000..6525b317ae --- /dev/null +++ b/GraphBLAS/Source/sort/factory/GB_msort_1_template.c @@ -0,0 +1,420 @@ +//------------------------------------------------------------------------------ +// GB_msort_1_template: sort a 1-by-n list of integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A parallel mergesort of an array of 1-by-n 32-bit or 64-bit unsigned +// integers. + +//------------------------------------------------------------------------------ +// GB_msort_1_binary_search: binary search for the pivot +//------------------------------------------------------------------------------ + +// The Pivot value is Z [pivot], and a binary search for the Pivot is made in +// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on +// input. The return value is pleft, where +// +// X [p_start ... pleft-1] <= Pivot and +// X [pleft ... p_end-1] >= Pivot holds. +// +// pleft is returned in the range p_start to p_end. If pleft is p_start, then +// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left +// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is +// larger than all entries in X [p_start...p_end-1], and the right list X +// [pleft...p_end-1] is empty. + +static int64_t GB_msort_1_binary_search // return pleft +( + const GB_A0_t *restrict Z_0, // Pivot is Z [pivot] + const int64_t pivot, + const GB_A0_t *restrict X_0, // search in X [p_start..p_end_-1] + const int64_t p_start, + const int64_t p_end +) +{ + + //-------------------------------------------------------------------------- + // find where the Pivot appears in X + //-------------------------------------------------------------------------- + + // binary search of X [p_start...p_end-1] for the Pivot + int64_t pleft = p_start ; + int64_t pright = p_end - 1 ; + while (pleft < pright) + { + int64_t pmiddle = (pleft + pright) >> 1 ; + // less = (X [pmiddle] < Pivot) + bool less = GB_lt_1 (X_0, pmiddle, Z_0, pivot) ; + pleft = less ? (pmiddle+1) : pleft ; + pright = less ? pright : pmiddle ; + } + + // binary search is narrowed down to a single item + // or it has found the list is empty: + ASSERT (pleft == pright || pleft == pright + 1) ; + + // If found is true then X [pleft == pright] == Pivot. If duplicates + // appear then X [pleft] is any one of the entries equal to the Pivot + // in the list. If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft+1 ... p_end-1] > Pivot holds. + // The value X [pleft] may be either < or > Pivot. + bool found = (pleft == pright) && GB_eq_1 (X_0, pleft, Z_0, pivot) ; + + // Modify pleft and pright: + if (!found && (pleft == pright)) + { + if (GB_lt_1 (X_0, pleft, Z_0, pivot)) + { + pleft++ ; + } + else + { +// pright++ ; // (not needed) + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + // If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] > Pivot holds, + // and pleft-1 == pright + + // If X has no duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + // If X has duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] <= Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + return (pleft) ; +} + +//------------------------------------------------------------------------------ +// GB_msort_1_create_merge_tasks +//------------------------------------------------------------------------------ + +// Recursively constructs ntasks tasks to merge two arrays, Left and Right, +// into Sresult, where Left is L [pL_start...pL_end-1], Right is R +// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], +// and where total_work is the total size of Left and Right. +// +// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and +// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output +// array S [S_task [tid] ... ]. The task tids created are t0 to +// t0+ntasks-1. + +static void GB_msort_1_create_merge_tasks +( + // output: + int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed + int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed + int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed + int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed + int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed + // input: + const int t0, // first task tid to create + const int ntasks, // # of tasks to create + const int64_t pS_start, // merge into S [pS_start...] + const GB_A0_t *restrict L_0, // Left = L [pL_start...pL_end-1] + const int64_t pL_start, + const int64_t pL_end, + const GB_A0_t *restrict R_0, // Right = R [pR_start...pR_end-1] + const int64_t pR_start, + const int64_t pR_end +) +{ + + //-------------------------------------------------------------------------- + // get problem size + //-------------------------------------------------------------------------- + + int64_t nleft = pL_end - pL_start ; // size of Left array + int64_t nright = pR_end - pR_start ; // size of Right array + int64_t total_work = nleft + nright ; // total work to do + ASSERT (ntasks >= 1) ; + ASSERT (total_work > 0) ; + + //-------------------------------------------------------------------------- + // create the tasks + //-------------------------------------------------------------------------- + + if (ntasks == 1) + { + + //---------------------------------------------------------------------- + // a single task will merge all of Left and Right into Sresult + //---------------------------------------------------------------------- + + L_task [t0] = pL_start ; L_len [t0] = nleft ; + R_task [t0] = pR_start ; R_len [t0] = nright ; + S_task [t0] = pS_start ; + + } + else + { + + //---------------------------------------------------------------------- + // partition the Left and Right arrays for multiple merge tasks + //---------------------------------------------------------------------- + + int64_t pleft, pright ; + if (nleft >= nright) + { + // split Left in half, and search for its pivot in Right + pleft = (pL_end + pL_start) >> 1 ; + pright = GB_msort_1_binary_search ( + L_0, pleft, + R_0, pR_start, pR_end) ; + } + else + { + // split Right in half, and search for its pivot in Left + pright = (pR_end + pR_start) >> 1 ; + pleft = GB_msort_1_binary_search ( + R_0, pright, + L_0, pL_start, pL_end) ; + } + + //---------------------------------------------------------------------- + // partition the tasks according to the work of each partition + //---------------------------------------------------------------------- + + // work0 is the total work in the first partition + int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; + int ntasks0 = (int) round ((double) ntasks * + (((double) work0) / ((double) total_work))) ; + + // ensure at least one task is assigned to each partition + ntasks0 = GB_IMAX (ntasks0, 1) ; + ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; + int ntasks1 = ntasks - ntasks0 ; + + //---------------------------------------------------------------------- + // assign ntasks0 to the first half + //---------------------------------------------------------------------- + + // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] + // into the result S [pS_start...work0-1]. + + GB_msort_1_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, + L_0, pL_start, pleft, + R_0, pR_start, pright) ; + + //---------------------------------------------------------------------- + // assign ntasks1 to the second half + //---------------------------------------------------------------------- + + // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] + // into the result S [pS_start+work0...pS_start+total_work]. + + int t1 = t0 + ntasks0 ; // first task id of the second set of tasks + int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S + GB_msort_1_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, + L_0, pleft, pL_end, + R_0, pright, pR_end) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_1_merge: merge two sorted lists via a single thread +//------------------------------------------------------------------------------ + +// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] + +static void GB_msort_1_merge +( + GB_A0_t *restrict S_0, // output of length nleft + nright + const GB_A0_t *restrict L_0, // left input of length nleft + const int64_t nleft, + const GB_A0_t *restrict R_0, // right input of length nright + const int64_t nright +) +{ + int64_t p, pleft, pright ; + + // merge the two inputs, Left and Right, while both inputs exist + for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) + { + if (GB_lt_1 (L_0, pleft, R_0, pright)) + { + // S [p] = Left [pleft++] + S_0 [p] = L_0 [pleft] ; + pleft++ ; + } + else + { + // S [p] = Right [pright++] + S_0 [p] = R_0 [pright] ; + pright++ ; + } + } + + // either input is exhausted; copy the remaining list into S + if (pleft < nleft) + { + int64_t nremaining = (nleft - pleft) ; + memcpy (S_0 + p, L_0 + pleft, nremaining * sizeof (GB_A0_t)) ; + } + else if (pright < nright) + { + int64_t nremaining = (nright - pright) ; + memcpy (S_0 + p, R_0 + pright, nremaining * sizeof (GB_A0_t)) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_1_method: parallel mergesort +//------------------------------------------------------------------------------ + +static GrB_Info GB_msort_1_method // sort array A of size 1-by-n +( + GB_A0_t *restrict A_0, // size n array + const int64_t n, + int nthreads // # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // determine # of tasks + //-------------------------------------------------------------------------- + + // determine the number of levels to create, which must always be an + // even number. The # of levels is chosen to ensure that the # of leaves + // of the task tree is between 4*nthreads and 16*nthreads. + + // 2 to 4 threads: 4 levels, 16 qsort leaves + // 5 to 16 threads: 6 levels, 64 qsort leaves + // 17 to 64 threads: 8 levels, 256 qsort leaves + // 65 to 256 threads: 10 levels, 1024 qsort leaves + // 256 to 1024 threads: 12 levels, 4096 qsort leaves + // ... + + int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; + int ntasks = 1 << k ; + + //-------------------------------------------------------------------------- + // allocate workspace + //-------------------------------------------------------------------------- + + GB_A0_t *restrict W_0 = NULL ; size_t W_0_size = 0 ; + int64_t *restrict W_T = NULL ; size_t W_T_size = 0 ; + + W_0 = GB_MALLOC_MEMORY (n, sizeof (GB_A0_t), &W_0_size) ; + W_T = GB_MALLOC_MEMORY (6*ntasks + 1, sizeof (int64_t), &W_T_size) ; + + if (W_0 == NULL || W_T == NULL) + { + // out of memory + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_OUT_OF_MEMORY) ; + } + + int64_t *T = W_T ; + int64_t *restrict L_task = T ; T += ntasks ; + int64_t *restrict L_len = T ; T += ntasks ; + int64_t *restrict R_task = T ; T += ntasks ; + int64_t *restrict R_len = T ; T += ntasks ; + int64_t *restrict S_task = T ; T += ntasks ; + int64_t *restrict Slice = T ; T += (ntasks+1) ; + + //-------------------------------------------------------------------------- + // partition and sort the leaves + //-------------------------------------------------------------------------- + + GB_e_slice (Slice, n, ntasks) ; + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + int64_t leaf = Slice [tid] ; + int64_t leafsize = Slice [tid+1] - leaf ; + GB_qsort_1_method (A_0 + leaf, leafsize) ; + } + + //-------------------------------------------------------------------------- + // merge each level + //-------------------------------------------------------------------------- + + int nt = 1 ; + for ( ; k >= 2 ; k -= 2) + { + + //---------------------------------------------------------------------- + // merge level k into level k-1, from A into W + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two A sublists into one W sublist + GB_msort_1_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + A_0, Slice [tid], Slice [tid+nt], + A_0, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + + GB_msort_1_merge ( + W_0 + pS, + A_0 + pL, nL, + A_0 + pR, nR) ; + } + nt = 2*nt ; + + //---------------------------------------------------------------------- + // merge level k-1 into level k-2, from W into A + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two W sublists into one A sublist + GB_msort_1_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + W_0, Slice [tid], Slice [tid+nt], + W_0, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + GB_msort_1_merge ( + A_0 + pS, + W_0 + pL, nL, + W_0 + pR, nR) ; + } + nt = 2*nt ; + } + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/sort/factory/GB_msort_2_template.c b/GraphBLAS/Source/sort/factory/GB_msort_2_template.c new file mode 100644 index 0000000000..1d649dcd0c --- /dev/null +++ b/GraphBLAS/Source/sort/factory/GB_msort_2_template.c @@ -0,0 +1,440 @@ +//------------------------------------------------------------------------------ +// GB_msort_2_template: sort a 2-by-n list of integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A parallel mergesort of an array of 2-by-n 32-bit or 64-bit unsigned +// integers. + +//------------------------------------------------------------------------------ +// GB_msort_2_binary_search: binary search for the pivot +//------------------------------------------------------------------------------ + +// The Pivot value is Z [pivot], and a binary search for the Pivot is made in +// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on +// input. The return value is pleft, where +// +// X [p_start ... pleft-1] <= Pivot and +// X [pleft ... p_end-1] >= Pivot holds. +// +// pleft is returned in the range p_start to p_end. If pleft is p_start, then +// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left +// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is +// larger than all entries in X [p_start...p_end-1], and the right list X +// [pleft...p_end-1] is empty. + +static int64_t GB_msort_2_binary_search // return pleft +( + const GB_A0_t *restrict Z_0, // Pivot is Z [pivot] + const GB_A1_t *restrict Z_1, + const int64_t pivot, + const GB_A0_t *restrict X_0, // search in X [p_start..p_end_-1] + const GB_A1_t *restrict X_1, + const int64_t p_start, + const int64_t p_end +) +{ + + //-------------------------------------------------------------------------- + // find where the Pivot appears in X + //-------------------------------------------------------------------------- + + // binary search of X [p_start...p_end-1] for the Pivot + int64_t pleft = p_start ; + int64_t pright = p_end - 1 ; + while (pleft < pright) + { + int64_t pmiddle = (pleft + pright) >> 1 ; + // less = (X [pmiddle] < Pivot) + bool less = GB_lt_2 (X_0, X_1, pmiddle, Z_0, Z_1, pivot) ; + pleft = less ? (pmiddle+1) : pleft ; + pright = less ? pright : pmiddle ; + } + + // binary search is narrowed down to a single item + // or it has found the list is empty: + ASSERT (pleft == pright || pleft == pright + 1) ; + + // If found is true then X [pleft == pright] == Pivot. If duplicates + // appear then X [pleft] is any one of the entries equal to the Pivot + // in the list. If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft+1 ... p_end-1] > Pivot holds. + // The value X [pleft] may be either < or > Pivot. + bool found = (pleft == pright) && + GB_eq_2 (X_0, X_1, pleft, Z_0, Z_1, pivot) ; + + // Modify pleft and pright: + if (!found && (pleft == pright)) + { + if (GB_lt_2 (X_0, X_1, pleft, Z_0, Z_1, pivot)) + { + pleft++ ; + } + else + { +// pright++ ; // (not needed) + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + // If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] > Pivot holds, + // and pleft-1 == pright + + // If X has no duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + // If X has duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] <= Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + return (pleft) ; +} + +//------------------------------------------------------------------------------ +// GB_msort_2_create_merge_tasks +//------------------------------------------------------------------------------ + +// Recursively constructs ntasks tasks to merge two arrays, Left and Right, +// into Sresult, where Left is L [pL_start...pL_end-1], Right is R +// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], +// and where total_work is the total size of Left and Right. +// +// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and +// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output +// array S [S_task [tid] ... ]. The task tids created are t0 to +// t0+ntasks-1. + +static void GB_msort_2_create_merge_tasks +( + // output: + int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed + int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed + int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed + int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed + int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed + // input: + const int t0, // first task tid to create + const int ntasks, // # of tasks to create + const int64_t pS_start, // merge into S [pS_start...] + const GB_A0_t *restrict L_0, // Left = L [pL_start...pL_end-1] + const GB_A1_t *restrict L_1, + const int64_t pL_start, + const int64_t pL_end, + const GB_A0_t *restrict R_0, // Right = R [pR_start...pR_end-1] + const GB_A1_t *restrict R_1, + const int64_t pR_start, + const int64_t pR_end +) +{ + + //-------------------------------------------------------------------------- + // get problem size + //-------------------------------------------------------------------------- + + int64_t nleft = pL_end - pL_start ; // size of Left array + int64_t nright = pR_end - pR_start ; // size of Right array + int64_t total_work = nleft + nright ; // total work to do + ASSERT (ntasks >= 1) ; + ASSERT (total_work > 0) ; + + //-------------------------------------------------------------------------- + // create the tasks + //-------------------------------------------------------------------------- + + if (ntasks == 1) + { + + //---------------------------------------------------------------------- + // a single task will merge all of Left and Right into Sresult + //---------------------------------------------------------------------- + + L_task [t0] = pL_start ; L_len [t0] = nleft ; + R_task [t0] = pR_start ; R_len [t0] = nright ; + S_task [t0] = pS_start ; + + } + else + { + + //---------------------------------------------------------------------- + // partition the Left and Right arrays for multiple merge tasks + //---------------------------------------------------------------------- + + int64_t pleft, pright ; + if (nleft >= nright) + { + // split Left in half, and search for its pivot in Right + pleft = (pL_end + pL_start) >> 1 ; + pright = GB_msort_2_binary_search ( + L_0, L_1, pleft, + R_0, R_1, pR_start, pR_end) ; + } + else + { + // split Right in half, and search for its pivot in Left + pright = (pR_end + pR_start) >> 1 ; + pleft = GB_msort_2_binary_search ( + R_0, R_1, pright, + L_0, L_1, pL_start, pL_end) ; + } + + //---------------------------------------------------------------------- + // partition the tasks according to the work of each partition + //---------------------------------------------------------------------- + + // work0 is the total work in the first partition + int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; + int ntasks0 = (int) round ((double) ntasks * + (((double) work0) / ((double) total_work))) ; + + // ensure at least one task is assigned to each partition + ntasks0 = GB_IMAX (ntasks0, 1) ; + ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; + int ntasks1 = ntasks - ntasks0 ; + + //---------------------------------------------------------------------- + // assign ntasks0 to the first half + //---------------------------------------------------------------------- + + // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] + // into the result S [pS_start...work0-1]. + + GB_msort_2_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, + L_0, L_1, pL_start, pleft, + R_0, R_1, pR_start, pright) ; + + //---------------------------------------------------------------------- + // assign ntasks1 to the second half + //---------------------------------------------------------------------- + + // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] + // into the result S [pS_start+work0...pS_start+total_work]. + + int t1 = t0 + ntasks0 ; // first task id of the second set of tasks + int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S + GB_msort_2_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, + L_0, L_1, pleft, pL_end, + R_0, R_1, pright, pR_end) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_2_merge: merge two sorted lists via a single thread +//------------------------------------------------------------------------------ + +// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] */ + +static void GB_msort_2_merge +( + GB_A0_t *restrict S_0, // output of length nleft + nright + GB_A1_t *restrict S_1, + const GB_A0_t *restrict L_0, // left input of length nleft + const GB_A1_t *restrict L_1, + const int64_t nleft, + const GB_A0_t *restrict R_0, // right input of length nright + const GB_A1_t *restrict R_1, + const int64_t nright +) +{ + int64_t p, pleft, pright ; + + // merge the two inputs, Left and Right, while both inputs exist + for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) + { + if (GB_lt_2 (L_0, L_1, pleft, R_0, R_1, pright)) + { + // S [p] = Left [pleft++] + S_0 [p] = L_0 [pleft] ; + S_1 [p] = L_1 [pleft] ; + pleft++ ; + } + else + { + // S [p] = Right [pright++] + S_0 [p] = R_0 [pright] ; + S_1 [p] = R_1 [pright] ; + pright++ ; + } + } + + // either input is exhausted; copy the remaining list into S + if (pleft < nleft) + { + int64_t nremaining = (nleft - pleft) ; + memcpy (S_0 + p, L_0 + pleft, nremaining * sizeof (GB_A0_t)) ; + memcpy (S_1 + p, L_1 + pleft, nremaining * sizeof (GB_A1_t)) ; + } + else if (pright < nright) + { + int64_t nremaining = (nright - pright) ; + memcpy (S_0 + p, R_0 + pright, nremaining * sizeof (GB_A0_t)) ; + memcpy (S_1 + p, R_1 + pright, nremaining * sizeof (GB_A1_t)) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_2_method: parallel mergesort +//------------------------------------------------------------------------------ + +static GrB_Info GB_msort_2_method // sort array A of size 2-by-n +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + const int64_t n, + int nthreads // # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // determine # of tasks + //-------------------------------------------------------------------------- + + // determine the number of levels to create, which must always be an + // even number. The # of levels is chosen to ensure that the # of leaves + // of the task tree is between 4*nthreads and 16*nthreads. + + // 2 to 4 threads: 4 levels, 16 qsort leaves + // 5 to 16 threads: 6 levels, 64 qsort leaves + // 17 to 64 threads: 8 levels, 256 qsort leaves + // 65 to 256 threads: 10 levels, 1024 qsort leaves + // 256 to 1024 threads: 12 levels, 4096 qsort leaves + // ... + + int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; + int ntasks = 1 << k ; + + //-------------------------------------------------------------------------- + // allocate workspace + //-------------------------------------------------------------------------- + + GB_A0_t *restrict W_0 = NULL ; size_t W_0_size = 0 ; + GB_A1_t *restrict W_1 = NULL ; size_t W_1_size = 0 ; + int64_t *restrict W_T = NULL ; size_t W_T_size = 0 ; + + W_0 = GB_MALLOC_MEMORY (n, sizeof (GB_A0_t), &W_0_size) ; + W_1 = GB_MALLOC_MEMORY (n, sizeof (GB_A1_t), &W_1_size) ; + W_T = GB_MALLOC_MEMORY (6*ntasks + 1, sizeof (int64_t), &W_T_size) ; + + if (W_0 == NULL || W_1 == NULL || W_T == NULL) + { + // out of memory + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_1, W_1_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_OUT_OF_MEMORY) ; + } + + int64_t *T = W_T ; + int64_t *restrict L_task = T ; T += ntasks ; + int64_t *restrict L_len = T ; T += ntasks ; + int64_t *restrict R_task = T ; T += ntasks ; + int64_t *restrict R_len = T ; T += ntasks ; + int64_t *restrict S_task = T ; T += ntasks ; + int64_t *restrict Slice = T ; T += (ntasks+1) ; + + //-------------------------------------------------------------------------- + // partition and sort the leaves + //-------------------------------------------------------------------------- + + GB_e_slice (Slice, n, ntasks) ; + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + int64_t leaf = Slice [tid] ; + int64_t leafsize = Slice [tid+1] - leaf ; + GB_qsort_2 ( + A_0 + leaf, sizeof (GB_A0_t) == sizeof (uint32_t), + A_1 + leaf, sizeof (GB_A1_t) == sizeof (uint32_t), + leafsize) ; + } + + //-------------------------------------------------------------------------- + // merge each level + //-------------------------------------------------------------------------- + + int nt = 1 ; + for ( ; k >= 2 ; k -= 2) + { + + //---------------------------------------------------------------------- + // merge level k into level k-1, from A into W + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two A sublists into one W sublist + GB_msort_2_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + A_0, A_1, Slice [tid], Slice [tid+nt], + A_0, A_1, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + + GB_msort_2_merge ( + W_0 + pS, W_1 + pS, + A_0 + pL, A_1 + pL, nL, + A_0 + pR, A_1 + pR, nR) ; + } + nt = 2*nt ; + + //---------------------------------------------------------------------- + // merge level k-1 into level k-2, from W into A + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two W sublists into one A sublist + GB_msort_2_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + W_0, W_1, Slice [tid], Slice [tid+nt], + W_0, W_1, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + GB_msort_2_merge ( + A_0 + pS, A_1 + pS, + W_0 + pL, W_1 + pL, nL, + W_0 + pR, W_1 + pR, nR) ; + } + nt = 2*nt ; + } + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_1, W_1_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/sort/factory/GB_msort_3_template.c b/GraphBLAS/Source/sort/factory/GB_msort_3_template.c new file mode 100644 index 0000000000..9d36f15131 --- /dev/null +++ b/GraphBLAS/Source/sort/factory/GB_msort_3_template.c @@ -0,0 +1,457 @@ +//------------------------------------------------------------------------------ +// GB_msort_3_template: sort a 3-by-n list of integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// A parallel mergesort of an array of 3-by-n 32-bit or 64-bit unsigned +// integers. + +//------------------------------------------------------------------------------ +// GB_msort_3_binary_search: binary search for the pivot +//------------------------------------------------------------------------------ + +// The Pivot value is Z [pivot], and a binary search for the Pivot is made in +// the array X [p_pstart...p_end-1], which is sorted in non-decreasing order on +// input. The return value is pleft, where +// +// X [p_start ... pleft-1] <= Pivot and +// X [pleft ... p_end-1] >= Pivot holds. +// +// pleft is returned in the range p_start to p_end. If pleft is p_start, then +// the Pivot is smaller than all entries in X [p_start...p_end-1], and the left +// list X [p_start...pleft-1] is empty. If pleft is p_end, then the Pivot is +// larger than all entries in X [p_start...p_end-1], and the right list X +// [pleft...p_end-1] is empty. + +static int64_t GB_msort_3_binary_search // return pleft +( + const GB_A0_t *restrict Z_0, // Pivot is Z [pivot] + const GB_A1_t *restrict Z_1, + const GB_A2_t *restrict Z_2, + const int64_t pivot, + const GB_A0_t *restrict X_0, // search in X [p_start..p_end_-1] + const GB_A1_t *restrict X_1, + const GB_A2_t *restrict X_2, + const int64_t p_start, + const int64_t p_end +) +{ + + //-------------------------------------------------------------------------- + // find where the Pivot appears in X + //-------------------------------------------------------------------------- + + // binary search of X [p_start...p_end-1] for the Pivot + int64_t pleft = p_start ; + int64_t pright = p_end - 1 ; + while (pleft < pright) + { + int64_t pmiddle = (pleft + pright) >> 1 ; + // less = (X [pmiddle] < Pivot) + bool less = GB_lt_3 (X_0, X_1, X_2, pmiddle, Z_0, Z_1, Z_2, pivot) ; + pleft = less ? (pmiddle+1) : pleft ; + pright = less ? pright : pmiddle ; + } + + // binary search is narrowed down to a single item + // or it has found the list is empty: + ASSERT (pleft == pright || pleft == pright + 1) ; + + // If found is true then X [pleft == pright] == Pivot. If duplicates + // appear then X [pleft] is any one of the entries equal to the Pivot + // in the list. If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft+1 ... p_end-1] > Pivot holds. + // The value X [pleft] may be either < or > Pivot. + bool found = (pleft == pright) && + GB_eq_3 (X_0, X_1, X_2, pleft, Z_0, Z_1, Z_2, pivot) ; + + // Modify pleft and pright: + if (!found && (pleft == pright)) + { + if (GB_lt_3 (X_0, X_1, X_2, pleft, Z_0, Z_1, Z_2, pivot)) + { + pleft++ ; + } + else + { +// pright++ ; // (not needed) + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + // If found is false then + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] > Pivot holds, + // and pleft-1 == pright + + // If X has no duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] < Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + // If X has duplicates, then whether or not Pivot is found, + // X [p_start ... pleft-1] <= Pivot and + // X [pleft ... p_end-1] >= Pivot holds. + + return (pleft) ; +} + +//------------------------------------------------------------------------------ +// GB_msort_3_create_merge_tasks +//------------------------------------------------------------------------------ + +// Recursively constructs ntasks tasks to merge two arrays, Left and Right, +// into Sresult, where Left is L [pL_start...pL_end-1], Right is R +// [pR_start...pR_end-1], and Sresult is S [pS_start...pS_start+total_work-1], +// and where total_work is the total size of Left and Right. +// +// Task tid will merge L [L_task [tid] ... L_task [tid] + L_len [tid] - 1] and +// R [R_task [tid] ... R_task [tid] + R_len [tid] -1] into the merged output +// array S [S_task [tid] ... ]. The task tids created are t0 to +// t0+ntasks-1. + +static void GB_msort_3_create_merge_tasks +( + // output: + int64_t *restrict L_task, // L_task [t0...t0+ntasks-1] computed + int64_t *restrict L_len, // L_len [t0...t0+ntasks-1] computed + int64_t *restrict R_task, // R_task [t0...t0+ntasks-1] computed + int64_t *restrict R_len, // R_len [t0...t0+ntasks-1] computed + int64_t *restrict S_task, // S_task [t0...t0+ntasks-1] computed + // input: + const int t0, // first task tid to create + const int ntasks, // # of tasks to create + const int64_t pS_start, // merge into S [pS_start...] + const GB_A0_t *restrict L_0, // Left = L [pL_start...pL_end-1] + const GB_A1_t *restrict L_1, + const GB_A2_t *restrict L_2, + const int64_t pL_start, + const int64_t pL_end, + const GB_A0_t *restrict R_0, // Right = R [pR_start...pR_end-1] + const GB_A1_t *restrict R_1, + const GB_A2_t *restrict R_2, + const int64_t pR_start, + const int64_t pR_end +) +{ + + //-------------------------------------------------------------------------- + // get problem size + //-------------------------------------------------------------------------- + + int64_t nleft = pL_end - pL_start ; // size of Left array + int64_t nright = pR_end - pR_start ; // size of Right array + int64_t total_work = nleft + nright ; // total work to do + ASSERT (ntasks >= 1) ; + ASSERT (total_work > 0) ; + + //-------------------------------------------------------------------------- + // create the tasks + //-------------------------------------------------------------------------- + + if (ntasks == 1) + { + + //---------------------------------------------------------------------- + // a single task will merge all of Left and Right into Sresult + //---------------------------------------------------------------------- + + L_task [t0] = pL_start ; L_len [t0] = nleft ; + R_task [t0] = pR_start ; R_len [t0] = nright ; + S_task [t0] = pS_start ; + + } + else + { + + //---------------------------------------------------------------------- + // partition the Left and Right arrays for multiple merge tasks + //---------------------------------------------------------------------- + + int64_t pleft, pright ; + if (nleft >= nright) + { + // split Left in half, and search for its pivot in Right + pleft = (pL_end + pL_start) >> 1 ; + pright = GB_msort_3_binary_search ( + L_0, L_1, L_2, pleft, + R_0, R_1, R_2, pR_start, pR_end) ; + } + else + { + // split Right in half, and search for its pivot in Left + pright = (pR_end + pR_start) >> 1 ; + pleft = GB_msort_3_binary_search ( + R_0, R_1, R_2, pright, + L_0, L_1, L_2, pL_start, pL_end) ; + } + + //---------------------------------------------------------------------- + // partition the tasks according to the work of each partition + //---------------------------------------------------------------------- + + // work0 is the total work in the first partition + int64_t work0 = (pleft - pL_start) + (pright - pR_start) ; + int ntasks0 = (int) round ((double) ntasks * + (((double) work0) / ((double) total_work))) ; + + // ensure at least one task is assigned to each partition + ntasks0 = GB_IMAX (ntasks0, 1) ; + ntasks0 = GB_IMIN (ntasks0, ntasks-1) ; + int ntasks1 = ntasks - ntasks0 ; + + //---------------------------------------------------------------------- + // assign ntasks0 to the first half + //---------------------------------------------------------------------- + + // ntasks0 tasks merge L [pL_start...pleft-1] and R [pR_start..pright-1] + // into the result S [pS_start...work0-1]. + + GB_msort_3_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t0, ntasks0, pS_start, + L_0, L_1, L_2, pL_start, pleft, + R_0, R_1, R_2, pR_start, pright) ; + + //---------------------------------------------------------------------- + // assign ntasks1 to the second half + //---------------------------------------------------------------------- + + // ntasks1 tasks merge L [pleft...pL_end-1] and R [pright...pR_end-1] + // into the result S [pS_start+work0...pS_start+total_work]. + + int t1 = t0 + ntasks0 ; // first task id of the second set of tasks + int64_t pS_start1 = pS_start + work0 ; // 2nd set starts here in S + GB_msort_3_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, t1, ntasks1, pS_start1, + L_0, L_1, L_2, pleft, pL_end, + R_0, R_1, R_2, pright, pR_end) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_3_merge: merge two sorted lists via a single thread +//------------------------------------------------------------------------------ + +// merge Left [0..nleft-1] and Right [0..nright-1] into S [0..nleft+nright-1] + +static void GB_msort_3_merge +( + GB_A0_t *restrict S_0, // output of length nleft + nright + GB_A1_t *restrict S_1, + GB_A2_t *restrict S_2, + const GB_A0_t *restrict L_0, // left input of length nleft + const GB_A1_t *restrict L_1, + const GB_A2_t *restrict L_2, + const int64_t nleft, + const GB_A0_t *restrict R_0, // right input of length nright + const GB_A1_t *restrict R_1, + const GB_A2_t *restrict R_2, + const int64_t nright +) +{ + int64_t p, pleft, pright ; + + // merge the two inputs, Left and Right, while both inputs exist + for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) + { + if (GB_lt_3 (L_0, L_1, L_2, pleft, R_0, R_1, R_2, pright)) + { + // S [p] = Left [pleft++] + S_0 [p] = L_0 [pleft] ; + S_1 [p] = L_1 [pleft] ; + S_2 [p] = L_2 [pleft] ; + pleft++ ; + } + else + { + // S [p] = Right [pright++] + S_0 [p] = R_0 [pright] ; + S_1 [p] = R_1 [pright] ; + S_2 [p] = R_2 [pright] ; + pright++ ; + } + } + + // either input is exhausted; copy the remaining list into S + if (pleft < nleft) + { + int64_t nremaining = (nleft - pleft) ; + memcpy (S_0 + p, L_0 + pleft, nremaining * sizeof (GB_A0_t)) ; + memcpy (S_1 + p, L_1 + pleft, nremaining * sizeof (GB_A1_t)) ; + memcpy (S_2 + p, L_2 + pleft, nremaining * sizeof (GB_A2_t)) ; + } + else if (pright < nright) + { + int64_t nremaining = (nright - pright) ; + memcpy (S_0 + p, R_0 + pright, nremaining * sizeof (GB_A0_t)) ; + memcpy (S_1 + p, R_1 + pright, nremaining * sizeof (GB_A1_t)) ; + memcpy (S_2 + p, R_2 + pright, nremaining * sizeof (GB_A2_t)) ; + } +} + +//------------------------------------------------------------------------------ +// GB_msort_3_method: parallel mergesort +//------------------------------------------------------------------------------ + +static GrB_Info GB_msort_3_method // sort array A of size 3-by-n +( + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array + GB_A2_t *restrict A_2, // size n array + const int64_t n, + int nthreads // # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // determine # of tasks + //-------------------------------------------------------------------------- + + // determine the number of levels to create, which must always be an + // even number. The # of levels is chosen to ensure that the # of leaves + // of the task tree is between 4*nthreads and 16*nthreads. + + // 2 to 4 threads: 4 levels, 16 qsort leaves + // 5 to 16 threads: 6 levels, 64 qsort leaves + // 17 to 64 threads: 8 levels, 256 qsort leaves + // 65 to 256 threads: 10 levels, 1024 qsort leaves + // 256 to 1024 threads: 12 levels, 4096 qsort leaves + // ... + + int k = (int) (2 + 2 * ceil (log2 ((double) nthreads) / 2)) ; + int ntasks = 1 << k ; + + //-------------------------------------------------------------------------- + // allocate workspace + //-------------------------------------------------------------------------- + + GB_A0_t *restrict W_0 = NULL ; size_t W_0_size = 0 ; + GB_A1_t *restrict W_1 = NULL ; size_t W_1_size = 0 ; + GB_A2_t *restrict W_2 = NULL ; size_t W_2_size = 0 ; + int64_t *restrict W_T = NULL ; size_t W_T_size = 0 ; + + W_0 = GB_MALLOC_MEMORY (n, sizeof (GB_A0_t), &W_0_size) ; + W_1 = GB_MALLOC_MEMORY (n, sizeof (GB_A1_t), &W_1_size) ; + W_2 = GB_MALLOC_MEMORY (n, sizeof (GB_A2_t), &W_2_size) ; + W_T = GB_MALLOC_MEMORY (6*ntasks + 1, sizeof (int64_t), &W_T_size) ; + + if (W_0 == NULL || W_1 == NULL || W_2 == NULL || W_T == NULL) + { + // out of memory + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_1, W_1_size) ; + GB_FREE_MEMORY (&W_2, W_2_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_OUT_OF_MEMORY) ; + } + + int64_t *T = W_T ; + int64_t *restrict L_task = T ; T += ntasks ; + int64_t *restrict L_len = T ; T += ntasks ; + int64_t *restrict R_task = T ; T += ntasks ; + int64_t *restrict R_len = T ; T += ntasks ; + int64_t *restrict S_task = T ; T += ntasks ; + int64_t *restrict Slice = T ; T += (ntasks+1) ; + + //-------------------------------------------------------------------------- + // partition and sort the leaves + //-------------------------------------------------------------------------- + + GB_e_slice (Slice, n, ntasks) ; + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + int64_t leaf = Slice [tid] ; + int64_t leafsize = Slice [tid+1] - leaf ; + GB_qsort_3 ( + A_0 + leaf, sizeof (GB_A0_t) == sizeof (uint32_t), + A_1 + leaf, sizeof (GB_A1_t) == sizeof (uint32_t), + A_2 + leaf, sizeof (GB_A2_t) == sizeof (uint32_t), + leafsize) ; + } + + //-------------------------------------------------------------------------- + // merge each level + //-------------------------------------------------------------------------- + + int nt = 1 ; + for ( ; k >= 2 ; k -= 2) + { + + //---------------------------------------------------------------------- + // merge level k into level k-1, from A into W + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two A sublists into one W sublist + GB_msort_3_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + A_0, A_1, A_2, Slice [tid], Slice [tid+nt], + A_0, A_1, A_2, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + + GB_msort_3_merge ( + W_0 + pS, W_1 + pS, W_2 + pS, + A_0 + pL, A_1 + pL, A_2 + pL, nL, + A_0 + pR, A_1 + pR, A_2 + pR, nR) ; + } + nt = 2*nt ; + + //---------------------------------------------------------------------- + // merge level k-1 into level k-2, from W into A + //---------------------------------------------------------------------- + + // this could be done in parallel if ntasks was large + for (int tid = 0 ; tid < ntasks ; tid += 2*nt) + { + // create 2*nt tasks to merge two W sublists into one A sublist + GB_msort_3_create_merge_tasks ( + L_task, L_len, R_task, R_len, S_task, tid, 2*nt, Slice [tid], + W_0, W_1, W_2, Slice [tid], Slice [tid+nt], + W_0, W_1, W_2, Slice [tid+nt], Slice [tid+2*nt]) ; + } + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) + for (tid = 0 ; tid < ntasks ; tid++) + { + // merge A [pL...pL+nL-1] and A [pR...pR+nR-1] into W [pS..] + int64_t pL = L_task [tid], nL = L_len [tid] ; + int64_t pR = R_task [tid], nR = R_len [tid] ; + int64_t pS = S_task [tid] ; + GB_msort_3_merge ( + A_0 + pS, A_1 + pS, A_2 + pS, + W_0 + pL, W_1 + pL, W_2 + pL, nL, + W_0 + pR, W_1 + pR, W_2 + pR, nR) ; + } + nt = 2*nt ; + } + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_MEMORY (&W_0, W_0_size) ; + GB_FREE_MEMORY (&W_1, W_1_size) ; + GB_FREE_MEMORY (&W_2, W_2_size) ; + GB_FREE_MEMORY (&W_T, W_T_size) ; + return (GrB_SUCCESS) ; +} + diff --git a/GraphBLAS/Source/sort/include/GB_qsort_1_kernel.h b/GraphBLAS/Source/sort/include/GB_qsort_1_kernel.h new file mode 100644 index 0000000000..b0d4ad0a8d --- /dev/null +++ b/GraphBLAS/Source/sort/include/GB_qsort_1_kernel.h @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// GB_qsort_1_kernel: sort an 1-by-n list of integers +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This inline function is used in JIT/PreJIT kernels only. The JIT kernel +// #define's GB_A0_t as uint32_t or uint64_t. + +//------------------------------------------------------------------------------ + +#ifndef GB_QSORT_1_KERNEL_H +#define GB_QSORT_1_KERNEL_H + +#include "include/GB_sort_kernels.h" + +#define GB_partition GB_partition_1_kernel +#define GB_quicksort GB_quicksort_1_kernel + +// returns true if A [a] < B [b] +#define GB_lt(A,a,B,b) GB_lt_1 (A ## _0, a, B ## _0, b) + +// each entry has a single key +#define GB_K 1 + +// argument list for calling a function +#define GB_arg(A) A ## _0 + +// argument list for calling a function, with offset +#define GB_arg_offset(A,x) A ## _0 + (x) + +// argument list for defining a function +#define GB_args(A) GB_A0_t *restrict A ## _0 + +// swap A [a] and A [b] +#define GB_swap(A,a,b) \ +{ \ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ +} + +#include "template/GB_qsort_template.c" + +//------------------------------------------------------------------------------ +// GB_qsort_1_kernel: with A_0 having templatized type of GB_A0_t +//------------------------------------------------------------------------------ + +static inline void GB_qsort_1_kernel +( + GB_A0_t *restrict A_0, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (A_0, n, &seed) ; +} + +#endif + diff --git a/GraphBLAS/Source/sort/include/GB_qsort_1b_kernel.h b/GraphBLAS/Source/sort/include/GB_qsort_1b_kernel.h index 4994075ef8..e3c513fa15 100644 --- a/GraphBLAS/Source/sort/include/GB_qsort_1b_kernel.h +++ b/GraphBLAS/Source/sort/include/GB_qsort_1b_kernel.h @@ -2,13 +2,13 @@ // GB_qsort_1b_kernel: sort a 2-by-n list, using A [0][ ] as the sort key //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// This inline function can be used in a JIT kernel, where GB_A_TYPE is -// templatized to the given data type. +// This inline function is used in JIT/PreJIT kernels only. The JIT kernel +// #define's GB_A0_t as uint32_t or uint64_t, and GB_A1_t as the type of A_1. //------------------------------------------------------------------------------ @@ -17,6 +17,9 @@ #include "include/GB_sort_kernels.h" +#define GB_partition GB_partition_1b_kernel +#define GB_quicksort GB_quicksort_1b_kernel + // returns true if A [a] < B [b] #define GB_lt(A,a,B,b) GB_lt_1 (A ## _0, a, B ## _0, b) @@ -24,41 +27,31 @@ #define GB_K 1 // argument list for calling a function -#undef GB_arg -#define GB_arg(A) \ - A ## _0, A ## _1 +#define GB_arg(A) A ## _0, A ## _1 // argument list for calling a function, with offset -#undef GB_arg_offset -#define GB_arg_offset(A,x) \ - A ## _0 + (x), A ## _1 + (x) +#define GB_arg_offset(A,x) A ## _0 + (x), A ## _1 + (x) // argument list for defining a function -#undef GB_args -#define GB_args(A) \ - int64_t *restrict A ## _0, \ - GB_A_TYPE *restrict A ## _1 \ +#define GB_args(A) GB_A0_t *restrict A ## _0, GB_A1_t *restrict A ## _1 // swap A [a] and A [b] -#undef GB_swap #define GB_swap(A,a,b) \ { \ - int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ;\ - GB_A_TYPE t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ;\ + GB_A0_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ; \ + GB_A1_t t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ; \ } -#undef GB_partition -#define GB_partition GB_partition_1b_kernel -#undef GB_quicksort -#define GB_quicksort GB_quicksort_1b_kernel - #include "template/GB_qsort_template.c" -// GB_qsort_1b_kernel: with A_1 having a templatized type of GB_A_TYPE +//------------------------------------------------------------------------------ +// GB_qsort_1b_kernel: with A_0, A_1 having templatized types GB_A0_t, GB_A1_t +//------------------------------------------------------------------------------ + static inline void GB_qsort_1b_kernel ( - int64_t *restrict A_0, // size n array - GB_A_TYPE *restrict A_1, // size n array + GB_A0_t *restrict A_0, // size n array + GB_A1_t *restrict A_1, // size n array const int64_t n ) { diff --git a/GraphBLAS/Source/sort/include/GB_sort_kernels.h b/GraphBLAS/Source/sort/include/GB_sort_kernels.h index 5982f78293..e3cf588164 100644 --- a/GraphBLAS/Source/sort/include/GB_sort_kernels.h +++ b/GraphBLAS/Source/sort/include/GB_sort_kernels.h @@ -2,7 +2,7 @@ // GB_sort_kernels.h: definitions for sorting functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ // A [a] and B [b] are keys of one integer. -// GB_lt_1 returns true if A [a] < B [b], for GB_qsort_1b +// GB_lt_1 returns true if A [a] < B [b], for GB_qsort_1* and GB_msort_1* #define GB_lt_1(A_0, a, B_0, b) (A_0 [a] < B_0 [b]) @@ -26,7 +26,7 @@ // A [a] and B [b] are keys of two integers. -// GB_lt_2 returns true if A [a] < B [b], for GB_qsort_2 and GB_msort_2 +// GB_lt_2 returns true if A [a] < B [b], for GB_qsort_2* and GB_msort_2* #define GB_lt_2(A_0, A_1, a, B_0, B_1, b) \ ( \ @@ -54,7 +54,7 @@ // A [a] and B [b] are keys of three integers. -// GB_lt_3 returns true if A [a] < B [b], for GB_qsort_3 and GB_msort_3 +// GB_lt_3 returns true if A [a] < B [b], for GB_qsort_3* and GB_msort_3* #define GB_lt_3(A_0, A_1, A_2, a, B_0, B_1, B_2, b) \ ( \ diff --git a/GraphBLAS/Source/sort/template/GB_qsort_template.c b/GraphBLAS/Source/sort/template/GB_qsort_template.c index f3b6cb0788..ce8ccdae25 100644 --- a/GraphBLAS/Source/sort/template/GB_qsort_template.c +++ b/GraphBLAS/Source/sort/template/GB_qsort_template.c @@ -2,7 +2,7 @@ // GB_qsort_template: quicksort of a K-by-n array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,12 +36,12 @@ static inline int64_t GB_partition uint64_t pivot = GB_rand (seed) % ((uint64_t) n) ; // get the Pivot - int64_t Pivot_0 [1] ; Pivot_0 [0] = A_0 [pivot] ; + GB_A0_t Pivot_0 [1] ; Pivot_0 [0] = A_0 [pivot] ; #if GB_K > 1 - int64_t Pivot_1 [1] ; Pivot_1 [0] = A_1 [pivot] ; + GB_A1_t Pivot_1 [1] ; Pivot_1 [0] = A_1 [pivot] ; #endif #if GB_K > 2 - int64_t Pivot_2 [1] ; Pivot_2 [0] = A_2 [pivot] ; + GB_A2_t Pivot_2 [1] ; Pivot_2 [0] = A_2 [pivot] ; #endif // At the top of the while loop, A [left+1...right-1] is considered, and @@ -95,7 +95,7 @@ static void GB_quicksort // sort A [0:n-1] ) { - if (n < 20) + if (n < 8) { // in-place insertion sort on A [0:n-1], where n is small for (int64_t k = 1 ; k < n ; k++) diff --git a/GraphBLAS/Source/sort/template/GB_sort_template.c b/GraphBLAS/Source/sort/template/GB_sort_template.c index 3573330733..e1d26ad7c5 100644 --- a/GraphBLAS/Source/sort/template/GB_sort_template.c +++ b/GraphBLAS/Source/sort/template/GB_sort_template.c @@ -2,23 +2,27 @@ // GB_sort_template: sort all vectors in a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // macros: // GB_SORT (func) defined as GB_sort_func_TYPE_ascend or _descend, -// GB_msort_ISO_ascend or _descend, -// or GB_msort_func_UDT +// GB_sort_ISO_ascend or _descend, or GB_sort_func_UDT // GB_C_TYPE bool, int8_, ... or GB_void for UDT or ISO +// GB_Ci_TYPE the type of C->i (uint32_t or uint64_t) // GB_ADDR(A,p) A+p for builtin, A + p * GB_SIZE otherwise // GB_SIZE size of each entry: sizeof (GB_C_TYPE) for built-in -// GB_GET(x,X,i) x = X [i] for built-in, memcpy for UDT +// GB_GETX(x,X,i) x = X [i] for built-in, memcpy for UDT // GB_COPY(A,i,C,k) A[i] = C [k] // GB_SWAP(A,i,k) swap A[i] and A[k] // GB_LT compare two entries, x < y, or x > y for descending sort +#ifndef GB_SORT_BASECASE +#define GB_SORT_BASECASE (64 * 1024) +#endif + //------------------------------------------------------------------------------ // GB_SORT (partition): use a pivot to partition an array //------------------------------------------------------------------------------ @@ -29,8 +33,8 @@ static inline int64_t GB_SORT (partition) ( - GB_C_TYPE *restrict A_0, // size n arrays to partition - int64_t *restrict A_1, // size n array + GB_C_TYPE *restrict A_0, // size n arrays to partition + GB_Ci_TYPE *restrict A_1, // size n array (uint32_t or uint64_t) const int64_t n, // size of the array(s) to partition uint64_t *seed // random number seed, modified on output #if GB_SORT_UDT @@ -46,7 +50,7 @@ static inline int64_t GB_SORT (partition) uint64_t pivot = GB_rand (seed) % ((uint64_t) n) ; // Pivot = A [pivot] - GB_GET (Pivot0, A_0, pivot) ; // Pivot0 = A_0 [pivot] + GB_GETX (Pivot0, A_0, pivot) ; // Pivot0 = A_0 [pivot] int64_t Pivot1 = A_1 [pivot] ; // At the top of the while loop, A [left+1...right-1] is considered, and @@ -68,7 +72,7 @@ static inline int64_t GB_SORT (partition) { left++ ; // a0 = A_0 [left] - GB_GET (a0, A_0, left) ; + GB_GETX (a0, A_0, left) ; // less = (a0, A_1 [left]) < (Pivot0, Pivot1) GB_LT (less, a0, A_1 [left], Pivot0, Pivot1) ; } @@ -79,7 +83,7 @@ static inline int64_t GB_SORT (partition) { right-- ; // a0 = A_0 [right] - GB_GET (a1, A_0, right) ; + GB_GETX (a1, A_0, right) ; // less = (Pivot0, Pivot1) < (a1, A_1 [right]) GB_LT (less, Pivot0, Pivot1, a1, A_1 [right]) ; } @@ -112,8 +116,8 @@ static inline int64_t GB_SORT (partition) static void GB_SORT (quicksort) // sort A [0:n-1] ( - GB_C_TYPE *restrict A_0, // size n arrays to sort - int64_t *restrict A_1, // size n array + GB_C_TYPE *restrict A_0, // size n arrays to sort + GB_Ci_TYPE *restrict A_1, // size n array const int64_t n, // size of the array(s) to sort uint64_t *seed // random number seed #if GB_SORT_UDT @@ -125,7 +129,7 @@ static void GB_SORT (quicksort) // sort A [0:n-1] ) { - if (n < 20) + if (n < 8) { // in-place insertion sort on A [0:n-1], where n is small for (int64_t k = 1 ; k < n ; k++) @@ -133,9 +137,9 @@ static void GB_SORT (quicksort) // sort A [0:n-1] for (int64_t j = k ; j > 0 ; j--) { // a0 = A_0 [j] - GB_GET (a0, A_0, j) ; + GB_GETX (a0, A_0, j) ; // a1 = A_0 [j-1] - GB_GET (a1, A_0, j-1) ; + GB_GETX (a1, A_0, j-1) ; // break if A [j] >= A [j-1] bool less ; // less = (a0, A_1 [j]) < (a1, A_1 [j-1]) @@ -193,11 +197,11 @@ static void GB_SORT (quicksort) // sort A [0:n-1] static int64_t GB_SORT (binary_search) // return pleft ( - const GB_C_TYPE *restrict Z_0, // Pivot is Z [pivot] - const int64_t *restrict Z_1, + const GB_C_TYPE *restrict Z_0, // Pivot is Z [pivot] + const GB_Ci_TYPE *restrict Z_1, const int64_t pivot, - const GB_C_TYPE *restrict X_0, // search in X [p_start..p_end_-1] - const int64_t *restrict X_1, + const GB_C_TYPE *restrict X_0, // search in X [p_start..p_end_-1] + const GB_Ci_TYPE *restrict X_1, const int64_t p_start, const int64_t p_end #if GB_SORT_UDT @@ -216,14 +220,14 @@ static int64_t GB_SORT (binary_search) // return pleft // binary search of X [p_start...p_end-1] for the Pivot int64_t pleft = p_start ; int64_t pright = p_end - 1 ; - GB_GET (Pivot0, Z_0, pivot) ; // Pivot0 = Z_0 [pivot] + GB_GETX (Pivot0, Z_0, pivot) ; // Pivot0 = Z_0 [pivot] int64_t Pivot1 = Z_1 [pivot] ; bool less ; while (pleft < pright) { int64_t pmiddle = (pleft + pright) >> 1 ; // x0 = X_0 [pmiddle] - GB_GET (x0, X_0, pmiddle) ; + GB_GETX (x0, X_0, pmiddle) ; // less = (x0, X_1 [pmiddle]) < (Pivot0, Pivot1) GB_LT (less, x0, X_1 [pmiddle], Pivot0, Pivot1) ; pleft = less ? (pmiddle+1) : pleft ; @@ -244,9 +248,9 @@ static int64_t GB_SORT (binary_search) // return pleft // Modify pleft and pright: if (!found && (pleft == pright)) - { + { // x0 = X_0 [pleft] - GB_GET (x0, X_0, pleft) ; + GB_GETX (x0, X_0, pleft) ; // less = (x0, X_1 [pleft]) < (Pivot0, Pivot1) GB_LT (less, x0, X_1 [pleft], Pivot0, Pivot1) ; if (less) @@ -305,12 +309,12 @@ static void GB_SORT (create_merge_tasks) const int t0, // first task tid to create const int ntasks, // # of tasks to create const int64_t pS_start, // merge into S [pS_start...] - const GB_C_TYPE *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, + const GB_C_TYPE *restrict L_0, // Left = L [pL_start...pL_end-1] + const GB_Ci_TYPE *restrict L_1, const int64_t pL_start, const int64_t pL_end, - const GB_C_TYPE *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, + const GB_C_TYPE *restrict R_0, // Right = R [pR_start...pR_end-1] + const GB_Ci_TYPE *restrict R_1, const int64_t pR_start, const int64_t pR_end #if GB_SORT_UDT @@ -439,13 +443,13 @@ static void GB_SORT (create_merge_tasks) static void GB_SORT (merge) ( - GB_C_TYPE *restrict S_0, // output of length nleft + nright - int64_t *restrict S_1, - const GB_C_TYPE *restrict Left_0, // left input of length nleft - const int64_t *restrict Left_1, + GB_C_TYPE *restrict S_0, // output of length nleft + nright + GB_Ci_TYPE *restrict S_1, + const GB_C_TYPE *restrict L_0, // left input of length nleft + const GB_Ci_TYPE *restrict L_1, const int64_t nleft, - const GB_C_TYPE *restrict Right_0, // right input of length nright - const int64_t *restrict Right_1, + const GB_C_TYPE *restrict R_0, // right input of length nright + const GB_Ci_TYPE *restrict R_1, const int64_t nright #if GB_SORT_UDT , size_t csize // size of GB_C_TYPE @@ -460,25 +464,25 @@ static void GB_SORT (merge) // merge the two inputs, Left and Right, while both inputs exist for (p = 0, pleft = 0, pright = 0 ; pleft < nleft && pright < nright ; p++) { - // left0 = Left_0 [pleft] - GB_GET (left0, Left_0, pleft) ; - // right0 = Right_0 [pright] - GB_GET (right0, Right_0, pright) ; + // left0 = L_0 [pleft] + GB_GETX (left0, L_0, pleft) ; + // right0 = R_0 [pright] + GB_GETX (right0, R_0, pright) ; bool less ; - // less = (left0, Left_1 [pleft]) < (right0, Right_1 [pright]) - GB_LT (less, left0, Left_1 [pleft], right0, Right_1 [pright]) ; + // less = (left0, L_1 [pleft]) < (right0, R_1 [pright]) + GB_LT (less, left0, L_1 [pleft], right0, R_1 [pright]) ; if (less) { // S [p] = Left [pleft++] - GB_COPY (S_0, p, Left_0, pleft) ; - S_1 [p] = Left_1 [pleft] ; + GB_COPY (S_0, p, L_0, pleft) ; + S_1 [p] = L_1 [pleft] ; pleft++ ; } else { // S [p] = Right [pright++] - GB_COPY (S_0, p, Right_0, pright) ; - S_1 [p] = Right_1 [pright] ; + GB_COPY (S_0, p, R_0, pright) ; + S_1 [p] = R_1 [pright] ; pright++ ; } } @@ -487,16 +491,14 @@ static void GB_SORT (merge) if (pleft < nleft) { int64_t nremaining = (nleft - pleft) ; - memcpy (GB_ADDR (S_0, p), - GB_ADDR (Left_0, pleft), nremaining * GB_SIZE) ; - memcpy (S_1 + p, Left_1 + pleft, nremaining * sizeof (int64_t)) ; + memcpy (GB_ADDR (S_0, p), GB_ADDR (L_0, pleft), nremaining * GB_SIZE) ; + memcpy (S_1 + p, L_1 + pleft, nremaining * sizeof (GB_Ci_TYPE)) ; } else if (pright < nright) { int64_t nremaining = (nright - pright) ; - memcpy (GB_ADDR (S_0, p), - GB_ADDR (Right_0, pright), nremaining * GB_SIZE) ; - memcpy (S_1 + p, Right_1 + pright, nremaining * sizeof (int64_t)) ; + memcpy (GB_ADDR (S_0, p), GB_ADDR (R_0, pright), nremaining * GB_SIZE) ; + memcpy (S_1 + p, R_1 + pright, nremaining * sizeof (GB_Ci_TYPE)) ; } } @@ -506,10 +508,11 @@ static void GB_SORT (merge) static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 ( - GB_C_TYPE *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - GB_C_TYPE *restrict W_0, // workspace of size n * GB_SIZE bytes - int64_t *restrict W, // int64_t workspace of size n+6*ntasks+1 + GB_C_TYPE *restrict A_0, // size n array + GB_Ci_TYPE *restrict A_1, // size n array + GB_C_TYPE *restrict W_0, // workspace of size n * GB_SIZE bytes + GB_Ci_TYPE *restrict W_1, // workspace of size n (uint32_t or uint64_t) + int64_t *restrict W, // int64_t workspace of size 6*ntasks+1 const int64_t n, const int kk, const int ntasks, @@ -524,18 +527,17 @@ static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 { //-------------------------------------------------------------------------- - // split up workspace + // split up workspace //-------------------------------------------------------------------------- - ASSERT (nthreads > 2 && n >= GB_BASECASE) ; + ASSERT (nthreads > 2 && n >= GB_SORT_BASECASE) ; int64_t *T = W ; - int64_t *restrict W_1 = T ; T += n ; int64_t *restrict L_task = T ; T += ntasks ; int64_t *restrict L_len = T ; T += ntasks ; int64_t *restrict R_task = T ; T += ntasks ; int64_t *restrict R_len = T ; T += ntasks ; int64_t *restrict S_task = T ; T += ntasks ; - int64_t *restrict Slice = T ; T += (ntasks+1) ; + int64_t *restrict Slice = T ; T += (ntasks+1) ; //-------------------------------------------------------------------------- // partition and sort the leaves @@ -568,9 +570,6 @@ static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 // merge level k into level k-1, from A into W //---------------------------------------------------------------------- - // TODO: skip k and k-1 for each group of 4 sublists of A if they are - // already sorted with respect to each other. - // this could be done in parallel if ntasks was large for (tid = 0 ; tid < ntasks ; tid += 2*nt) { @@ -650,16 +649,17 @@ static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 #define GB_FREE_WORKSPACE \ { \ GB_WERK_POP (SortTasks, int64_t) ; \ - GB_FREE_WORK (&C_skipped, C_skipped_size) ; \ - GB_FREE_WORK (&W_0, W_0_size) ; \ - GB_FREE_WORK (&W, W_size) ; \ + GB_FREE_MEMORY (&C_skipped, C_skipped_size) ; \ + GB_FREE_MEMORY (&W_0, W_0_size) ; \ + GB_FREE_MEMORY (&W_1, W_1_size) ; \ + GB_FREE_MEMORY (&W, W_size) ; \ } #ifdef GB_JIT_KERNEL GB_JIT_GLOBAL GB_JIT_KERNEL_SORT_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SORT_PROTO (GB_jit_kernel) #else -static GrB_Info GB_SORT (matrix) +static GrB_Info GB_SORT (mtx) ( GrB_Matrix C, // matrix sorted in-place #if GB_SORT_UDT @@ -671,6 +671,12 @@ static GrB_Info GB_SORT (matrix) #endif { + //-------------------------------------------------------------------------- + // get callback functions (JIT kernels only) + //-------------------------------------------------------------------------- + + GB_GET_CALLBACKS ; + //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- @@ -698,15 +704,15 @@ static GrB_Info GB_SORT (matrix) // get input //-------------------------------------------------------------------------- - GB_C_NVALS (cnz) ; // int64_t cnz = GB_nnz (C) ; int64_t cnvec = C->nvec ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ci = C->i ; - GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_TYPE *restrict Ci = (GB_Ci_TYPE *) C->i ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; // workspace - GB_C_TYPE *restrict W_0 = NULL ; size_t W_0_size = 0 ; - int64_t *restrict W = NULL ; size_t W_size = 0 ; + GB_C_TYPE *restrict W_0 = NULL ; size_t W_0_size = 0 ; + GB_Ci_TYPE *restrict W_1 = NULL ; size_t W_1_size = 0 ; + int64_t *restrict W = NULL ; size_t W_size = 0 ; int64_t *restrict C_skipped = NULL ; size_t C_skipped_size = 0 ; GB_WERK_DECLARE (SortTasks, int64_t) ; @@ -741,7 +747,7 @@ static GrB_Info GB_SORT (matrix) int64_t *restrict C_skip = SortTasks + ntasks ; // size ntasks+1 int64_t *restrict C_slice = SortTasks + 2*ntasks + 1; // size ntasks+1 - GB_p_slice (C_slice, Cp, cnvec, ntasks, false) ; + GB_p_slice (C_slice, Cp, C->p_is_32, cnvec, ntasks, false) ; // sort all short vectors in parallel, one thread per vector int tid ; @@ -755,10 +761,10 @@ static GrB_Info GB_SORT (matrix) for (int64_t k = kfirst ; k < klast ; k++) { // sort the vector C(:,k), unless it is too long - const int64_t pC_start = Cp [k] ; - const int64_t pC_end = Cp [k+1] ; + const int64_t pC_start = GB_IGET (Cp, k) ; + const int64_t pC_end = GB_IGET (Cp, k+1) ; const int64_t cknz = pC_end - pC_start ; - if (cknz <= GB_BASECASE || nthreads == 1) + if (cknz <= GB_SORT_BASECASE || nthreads == 1) { uint64_t seed = k ; GB_SORT (quicksort) (GB_ADDR (Cx, pC_start), Ci + pC_start, @@ -785,7 +791,7 @@ static GrB_Info GB_SORT (matrix) max_length = GB_IMAX (max_length, C_max [tid]) ; } - if (max_length <= GB_BASECASE || nthreads == 1) + if (max_length <= GB_SORT_BASECASE || nthreads == 1) { // all vectors are sorted GB_FREE_WORKSPACE ; @@ -800,10 +806,11 @@ static GrB_Info GB_SORT (matrix) // construct a list of vectors that must still be sorted //-------------------------------------------------------------------------- - GB_cumsum1 (C_skip, ntasks) ; + GB_cumsum1_64 ((uint64_t *) C_skip, ntasks) ; int64_t total_skipped = C_skip [ntasks] ; - C_skipped = GB_MALLOC_WORK (total_skipped, int64_t, &C_skipped_size) ; + C_skipped = GB_MALLOC_MEMORY (total_skipped, sizeof (int64_t), + &C_skipped_size) ; if (C_skipped == NULL) { // out of memory @@ -819,10 +826,10 @@ static GrB_Info GB_SORT (matrix) int64_t n_skipped = C_skip [tid] ; for (int64_t k = kfirst ; k < klast ; k++) { - const int64_t pC_start = Cp [k] ; - const int64_t pC_end = Cp [k+1] ; + const int64_t pC_start = GB_IGET (Cp, k) ; + const int64_t pC_end = GB_IGET (Cp, k+1) ; const int64_t cknz = pC_end - pC_start ; - if (cknz > GB_BASECASE) + if (cknz > GB_SORT_BASECASE) { // C(:,k) was not sorted C_skipped [n_skipped++] = k ; @@ -852,10 +859,14 @@ static GrB_Info GB_SORT (matrix) // allocate workspace //-------------------------------------------------------------------------- - W = GB_MALLOC_WORK (max_length + 6*ntasks2 + 1, int64_t, &W_size) ; - W_0 = (GB_C_TYPE *) GB_MALLOC_WORK (max_length * GB_SIZE, GB_void, + W = GB_MALLOC_MEMORY (max_length + 6*ntasks2 + 1, sizeof (int64_t), + &W_size) ; + W_0 = (GB_C_TYPE *) GB_MALLOC_MEMORY (max_length, GB_SIZE, &W_0_size) ; - if (W == NULL || W_0 == NULL) + W_1 = (GB_Ci_TYPE *) GB_MALLOC_MEMORY (max_length, sizeof (GB_Ci_TYPE), + &W_1_size) ; + + if (W == NULL || W_0 == NULL || W_1 == NULL) { // out of memory GB_FREE_WORKSPACE ; @@ -869,12 +880,12 @@ static GrB_Info GB_SORT (matrix) for (int64_t t = 0 ; t < total_skipped ; t++) { const int64_t k = C_skipped [t] ; - const int64_t pC_start = Cp [k] ; - const int64_t pC_end = Cp [k+1] ; + const int64_t pC_start = GB_IGET (Cp, k) ; + const int64_t pC_end = GB_IGET (Cp, k+1) ; const int64_t cknz = pC_end - pC_start ; - ASSERT (cknz > GB_BASECASE) ; + ASSERT (cknz > GB_SORT_BASECASE) ; GB_SORT (vector) (GB_ADDR (Cx, pC_start), Ci + pC_start, - W_0, W, cknz, kk, ntasks2, nthreads + W_0, W_1, W, cknz, kk, ntasks2, nthreads #if GB_SORT_UDT , csize, xsize, flt, fcast #endif diff --git a/GraphBLAS/Source/split/GB_split.c b/GraphBLAS/Source/split/GB_split.c index 5ff3ad5272..1412f478d2 100644 --- a/GraphBLAS/Source/split/GB_split.c +++ b/GraphBLAS/Source/split/GB_split.c @@ -2,7 +2,7 @@ // GB_split: split a matrix into an array of matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,10 +23,10 @@ GrB_Info GB_split // split a matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n + const int64_t m, + const int64_t n, + const int64_t *Tile_nrows, // array of size m + const int64_t *Tile_ncols, // array of size n const GrB_Matrix A, // input matrix GB_Werk Werk ) @@ -73,7 +73,7 @@ GrB_Info GB_split // split a matrix int64_t s = 0 ; for (int64_t i = 0 ; i < m ; i++) { - GrB_Index tile_nrows = Tile_nrows [i] ; // # of rows in Tile{i,:} + int64_t tile_nrows = Tile_nrows [i] ; // # of rows in Tile{i,:} if (tile_nrows < 0 || tile_nrows > nrows) { return (GrB_DIMENSION_MISMATCH) ; @@ -90,7 +90,7 @@ GrB_Info GB_split // split a matrix s = 0 ; for (int64_t j = 0 ; j < n ; j++) { - GrB_Index tile_ncols = Tile_ncols [j] ; // # of cols in Tile{:,j} + int64_t tile_ncols = Tile_ncols [j] ; // # of cols in Tile{:,j} if (tile_ncols < 0 || tile_ncols > ncols) { return (GrB_DIMENSION_MISMATCH) ; diff --git a/GraphBLAS/Source/split/GB_split.h b/GraphBLAS/Source/split/GB_split.h index c086aff682..e8d3d2f427 100644 --- a/GraphBLAS/Source/split/GB_split.h +++ b/GraphBLAS/Source/split/GB_split.h @@ -2,24 +2,24 @@ // GB_split.h: definitions for GB_split and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #ifndef GB_SPLIT_H #define GB_SPLIT_H + #include "GB.h" -#include "slice/GB_ek_slice.h" #define GB_TILE(Tiles,i,j) (*(Tiles + (i) * n + (j))) GrB_Info GB_split // split a matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n + const int64_t m, + const int64_t n, + const int64_t *Tile_nrows, // array of size m + const int64_t *Tile_ncols, // array of size n const GrB_Matrix A, // input matrix GB_Werk Werk ) ; @@ -27,8 +27,8 @@ GrB_Info GB_split // split a matrix GrB_Info GB_split_bitmap // split a bitmap matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix @@ -38,8 +38,8 @@ GrB_Info GB_split_bitmap // split a bitmap matrix GrB_Info GB_split_full // split a full matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix @@ -49,8 +49,8 @@ GrB_Info GB_split_full // split a full matrix GrB_Info GB_split_sparse // split a sparse matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix diff --git a/GraphBLAS/Source/split/GB_split_bitmap.c b/GraphBLAS/Source/split/GB_split_bitmap.c index 0cfd6a165d..a97adf37e1 100644 --- a/GraphBLAS/Source/split/GB_split_bitmap.c +++ b/GraphBLAS/Source/split/GB_split_bitmap.c @@ -2,11 +2,14 @@ // GB_split_bitmap: split a bitmap matrix into an array of matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each output tile is first created in bitmap form, and then conformed to its +// desired sparsity format. + #define GB_FREE_ALL \ GB_Matrix_free (&C) ; @@ -17,8 +20,8 @@ GrB_Info GB_split_bitmap // split a bitmap matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix @@ -39,11 +42,9 @@ GrB_Info GB_split_bitmap // split a bitmap matrix bool csc = A->is_csc ; GrB_Type atype = A->type ; int64_t avlen = A->vlen ; -// int64_t avdim = A->vdim ; size_t asize = atype->size ; const int8_t *restrict Ab = A->b ; const bool A_iso = A->iso ; -// int64_t anz = GB_nnz (A) ; int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; @@ -81,10 +82,10 @@ GrB_Info GB_split_bitmap // split a bitmap matrix int64_t cnzmax = cvdim * cvlen ; C = NULL ; - // set C->iso = A_iso OK GB_OK (GB_new_bix (&C, // new header - atype, cvlen, cvdim, GB_Ap_null, csc, GxB_BITMAP, false, - hyper_switch, 0, cnzmax, true, A_iso)) ; + atype, cvlen, cvdim, GB_ph_null, csc, GxB_BITMAP, false, + hyper_switch, 0, cnzmax, true, A_iso, + /* OK: */ false, false, false)) ; int8_t *restrict Cb = C->b ; C->sparsity_control = sparsity_control ; C->hyper_switch = hyper_switch ; @@ -198,12 +199,7 @@ GrB_Info GB_split_bitmap // split a bitmap matrix info = GrB_SUCCESS ; } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //------------------------------------------------------------------ // conform the tile and save it in the Tiles array diff --git a/GraphBLAS/Source/split/GB_split_full.c b/GraphBLAS/Source/split/GB_split_full.c index a1827124d3..e80554d38f 100644 --- a/GraphBLAS/Source/split/GB_split_full.c +++ b/GraphBLAS/Source/split/GB_split_full.c @@ -2,11 +2,14 @@ // GB_split_full: split a full matrix into an array of matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each output tile is first created in full form, and then conformed to its +// desired sparsity format. + #define GB_FREE_ALL \ GB_Matrix_free (&C) ; @@ -17,8 +20,8 @@ GrB_Info GB_split_full // split a full matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix @@ -39,7 +42,6 @@ GrB_Info GB_split_full // split a full matrix bool csc = A->is_csc ; GrB_Type atype = A->type ; int64_t avlen = A->vlen ; -// int64_t avdim = A->vdim ; size_t asize = atype->size ; const bool A_iso = A->iso ; @@ -79,10 +81,10 @@ GrB_Info GB_split_full // split a full matrix int64_t cnz = cvdim * cvlen ; C = NULL ; - // set C->iso = A_iso OK GB_OK (GB_new_bix (&C, // new header - atype, cvlen, cvdim, GB_Ap_null, csc, GxB_FULL, false, - hyper_switch, 0, cnz, true, A_iso)) ; + atype, cvlen, cvdim, GB_ph_null, csc, GxB_FULL, false, + hyper_switch, 0, cnz, true, A_iso, + /* OK: */ false, false, false)) ; C->sparsity_control = sparsity_control ; C->hyper_switch = hyper_switch ; int C_nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; @@ -190,12 +192,7 @@ GrB_Info GB_split_full // split a full matrix info = GrB_SUCCESS ; } - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; } //------------------------------------------------------------------ diff --git a/GraphBLAS/Source/split/GB_split_sparse.c b/GraphBLAS/Source/split/GB_split_sparse.c index 7a52d2e57c..a6271df7e7 100644 --- a/GraphBLAS/Source/split/GB_split_sparse.c +++ b/GraphBLAS/Source/split/GB_split_sparse.c @@ -1,15 +1,18 @@ //------------------------------------------------------------------------------ -// GB_split_sparse: split a sparse/hypersparse matrix into tiles +// GB_split_sparse: split a sparse/hypersparse matrix into tiles //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// Each output tile is first created in sparse/hyper form, matching the input +// matrix, and then conformed to its desired sparsity format. + #define GB_FREE_WORKSPACE \ GB_WERK_POP (C_ek_slicing, int64_t) ; \ - GB_FREE_WORK (&Wp, Wp_size) ; + GB_FREE_MEMORY (&Wp, Wp_size) ; #define GB_FREE_ALL \ GB_FREE_WORKSPACE ; \ @@ -22,8 +25,8 @@ GrB_Info GB_split_sparse // split a sparse matrix ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, + const int64_t m, + const int64_t n, const int64_t *restrict Tile_rows, // size m+1 const int64_t *restrict Tile_cols, // size n+1 const GrB_Matrix A, // input matrix @@ -42,13 +45,14 @@ GrB_Info GB_split_sparse // split a sparse matrix GrB_Matrix C = NULL ; GB_WERK_DECLARE (C_ek_slicing, int64_t) ; ASSERT_MATRIX_OK (A, "A sparse for split", GB0) ; + ASSERT (!GB_JUMBLED (A)) ; + ASSERT (!GB_ZOMBIES (A)) ; + ASSERT (!GB_PENDING (A)) ; int sparsity_control = A->sparsity_control ; float hyper_switch = A->hyper_switch ; bool csc = A->is_csc ; GrB_Type atype = A->type ; -// int64_t avlen = A->vlen ; -// int64_t avdim = A->vdim ; size_t asize = atype->size ; int nthreads_max = GB_Context_nthreads_max ( ) ; @@ -61,25 +65,36 @@ GrB_Info GB_split_sparse // split a sparse matrix const int64_t *Tile_vlen = csc ? Tile_rows : Tile_cols ; int64_t anvec = A->nvec ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; + int64_t anz = GB_nnz (A) ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + const bool A_iso = A->iso ; + const bool Ap_is_32 = A->p_is_32 ; + const bool Aj_is_32 = A->j_is_32 ; + const bool Ai_is_32 = A->i_is_32 ; + //-------------------------------------------------------------------------- // allocate workspace //-------------------------------------------------------------------------- - size_t Wp_size = 0 ; - int64_t *restrict Wp = NULL ; - Wp = GB_MALLOC_WORK (anvec, int64_t, &Wp_size) ; + // FUTURE: Wp is allocated with the same integers as Ap, but it could be + // chosen based on anz instead. + + GB_MDECL (Wp, , u) ; size_t Wp_size = 0 ; + size_t apsize = (Ap_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + Wp = GB_MALLOC_MEMORY (anvec, apsize, &Wp_size) ; if (Wp == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_memcpy (Wp, Ap, anvec * sizeof (int64_t), nthreads_max) ; + GB_memcpy (Wp, Ap, anvec * apsize, nthreads_max) ; + GB_IPTR (Wp, Ap_is_32) ; //-------------------------------------------------------------------------- // split A into tiles @@ -108,9 +123,9 @@ GrB_Info GB_split_sparse // split a sparse matrix // Ah [akstart:akend-1]. akend = akstart ; int64_t pright = anvec - 1 ; - bool found ; - GB_SPLIT_BINARY_SEARCH (avend, Ah, akend, pright, found) ; - ASSERT (GB_IMPLIES (akstart <= akend-1, Ah [akend-1] < avend)) ; + GB_split_binary_search (avend, Ah, Aj_is_32, &akend, &pright) ; + ASSERT (GB_IMPLIES (akstart <= akend-1, + GB_IGET (Ah, akend-1) < avend)) ; } else { @@ -138,15 +153,22 @@ GrB_Info GB_split_sparse // split a sparse matrix const int64_t cvdim = avend - avstart ; const int64_t cvlen = aiend - aistart ; + // Assume this tile C can acquire all the entries of A to determine + // the p_is_32, j_is_32, and i_is_32 settings for the new Tile. + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + A_sparsity, anz, cvlen, cvdim, Werk) ; + C = NULL ; GB_OK (GB_new (&C, // new header - atype, cvlen, cvdim, GB_Ap_malloc, csc, A_sparsity, - hyper_switch, cnvec)) ; + atype, cvlen, cvdim, GB_ph_malloc, csc, A_sparsity, + hyper_switch, cnvec, Cp_is_32, Cj_is_32, Ci_is_32)) ; C->sparsity_control = sparsity_control ; C->hyper_switch = hyper_switch ; C->nvec = cnvec ; - int64_t *restrict Cp = C->p ; - int64_t *restrict Ch = C->h ; + + GB_Cp_DECLARE (Cp, ) ; GB_Ap_PTR (Cp, C) ; + GB_Ch_DECLARE (Ch, ) ; GB_Ah_PTR (Ch, C) ; //------------------------------------------------------------------ // determine the boundaries of this tile @@ -156,25 +178,25 @@ GrB_Info GB_split_sparse // split a sparse matrix #pragma omp parallel for num_threads(nth) schedule(static) for (k = akstart ; k < akend ; k++) { - int64_t pA = Wp [k] ; - const int64_t pA_end = Ap [k+1] ; + const int64_t pC_start = GB_IGET (Wp, k) ; + int64_t pA = pC_start ; + const int64_t pA_end = GB_IGET (Ap, k+1) ; const int64_t aknz = pA_end - pA ; - if (aknz == 0 || Ai [pA] >= aiend) + if (aknz == 0 || GB_IGET (Ai, pA) >= aiend) { // this vector of C is empty } else if (aknz > 256) { // use binary search to find aiend - bool found ; int64_t pright = pA_end - 1 ; - GB_SPLIT_BINARY_SEARCH (aiend, Ai, pA, pright, found) ; + GB_split_binary_search (aiend, Ai, Ai_is_32, &pA, &pright) ; #ifdef GB_DEBUG // check the results with a linear search - int64_t p2 = Wp [k] ; - for ( ; p2 < Ap [k+1] ; p2++) + int64_t p2 = pC_start ; + for ( ; p2 < pA_end ; p2++) { - if (Ai [p2] >= aiend) break ; + if (GB_IGET (Ai, p2) >= aiend) break ; } ASSERT (pA == p2) ; #endif @@ -184,34 +206,37 @@ GrB_Info GB_split_sparse // split a sparse matrix // use a linear-time search to find aiend for ( ; pA < pA_end ; pA++) { - if (Ai [pA] >= aiend) break ; + if (GB_IGET (Ai, pA) >= aiend) break ; } #ifdef GB_DEBUG // check the results with a binary search - bool found ; - int64_t p2 = Wp [k] ; - int64_t p2_end = Ap [k+1] - 1 ; - GB_SPLIT_BINARY_SEARCH (aiend, Ai, p2, p2_end, found) ; + int64_t p2 = pC_start ; + int64_t p2_end = pA_end - 1 ; + GB_split_binary_search (aiend, Ai, Ai_is_32, &p2, &p2_end) ; ASSERT (pA == p2) ; #endif } - Cp [k-akstart] = (pA - Wp [k]) ; // # of entries in this vector + int64_t kC = k - akstart ; + int64_t cknz = pA - pC_start ; // # entries in C(:,kC) + GB_ISET (Cp, kC, cknz) ; // Cp [kC] = cknz ; if (A_is_hyper) { - Ch [k-akstart] = Ah [k] - avstart ; + int64_t jC = GB_IGET (Ah, k) - avstart ; + GB_ISET (Ch, kC, jC) ; // Ch [kC] = jC ; } } - GB_cumsum (Cp, cnvec, &(C->nvec_nonempty), nth, Werk) ; - int64_t cnz = Cp [cnvec] ; + int64_t nvec_nonempty ; + GB_cumsum (Cp, Cp_is_32, cnvec, &nvec_nonempty, nth, Werk) ; + GB_nvec_nonempty_set (C, nvec_nonempty) ; + int64_t cnz = GB_IGET (Cp, cnvec) ; //------------------------------------------------------------------ // allocate C->i and C->x for this tile //------------------------------------------------------------------ - // set C->iso = A_iso OK GB_OK (GB_bix_alloc (C, cnz, GxB_SPARSE, false, true, A_iso)) ; - int64_t *restrict Ci = C->i ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; C->nvals = cnz ; C->magic = GB_MAGIC ; // for GB_nnz_held(C), to slice C @@ -332,13 +357,7 @@ GrB_Info GB_split_sparse // split a sparse matrix //------------------------------------------------------------------ GB_WERK_POP (C_ek_slicing, int64_t) ; - - if (info != GrB_SUCCESS) - { - // out of memory, or other error - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; //------------------------------------------------------------------ // advance to the next tile @@ -351,8 +370,8 @@ GrB_Info GB_split_sparse // split a sparse matrix for (k = akstart ; k < akend ; k++) { int64_t ck = k - akstart ; - int64_t cknz = Cp [ck+1] - Cp [ck] ; - Wp [k] += cknz ; + int64_t cknz = GB_IGET (Cp, ck+1) - GB_IGET (Cp, ck) ; + GB_IINC (Wp, k, cknz) ; // Wp [k] += cknz ; } } @@ -361,7 +380,7 @@ GrB_Info GB_split_sparse // split a sparse matrix //------------------------------------------------------------------ ASSERT_MATRIX_OK (C, "C for GB_split", GB0) ; - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + GB_OK (GB_hyper_prune (C, Werk)) ; GB_OK (GB_conform (C, Werk)) ; if (csc) { diff --git a/GraphBLAS/Source/split/GxB_Matrix_split.c b/GraphBLAS/Source/split/GxB_Matrix_split.c index d37e5bc5a2..075744c17f 100644 --- a/GraphBLAS/Source/split/GxB_Matrix_split.c +++ b/GraphBLAS/Source/split/GxB_Matrix_split.c @@ -2,7 +2,7 @@ // GxB_Matrix_split: split a matrix into an array of matrices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,10 +15,10 @@ GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices ( GrB_Matrix *Tiles, // 2D row-major array of size m-by-n - const GrB_Index m, - const GrB_Index n, - const GrB_Index *Tile_nrows, // array of size m - const GrB_Index *Tile_ncols, // array of size n + const uint64_t m, + const uint64_t n, + const uint64_t *Tile_nrows, // array of size m + const uint64_t *Tile_ncols, // array of size n const GrB_Matrix A, // input matrix to split const GrB_Descriptor desc // unused, except threading control ) @@ -28,10 +28,11 @@ GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_split (Tiles, m, n, Tile_nrows, Tile_ncols, A, " + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GxB_Matrix_split (Tiles, m, n, Tile_nrows, Tile_ncols, A, " "desc)") ; GB_BURBLE_START ("GxB_Matrix_split") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + if (m <= 0 || n <= 0) { return (GrB_INVALID_VALUE) ; @@ -47,7 +48,9 @@ GrB_Info GxB_Matrix_split // split a matrix into 2D array of matrices // Tiles = split (A) //-------------------------------------------------------------------------- - info = GB_split (Tiles, m, n, Tile_nrows, Tile_ncols, A, Werk) ; + info = GB_split (Tiles, (int64_t) m, (int64_t) n, + (const int64_t *) Tile_nrows, + (const int64_t *) Tile_ncols, A, Werk) ; GB_BURBLE_END ; return (info) ; } diff --git a/GraphBLAS/Source/split/template/GB_split_bitmap_template.c b/GraphBLAS/Source/split/template/GB_split_bitmap_template.c index 56d0209ba4..ccba54fc06 100644 --- a/GraphBLAS/Source/split/template/GB_split_bitmap_template.c +++ b/GraphBLAS/Source/split/template/GB_split_bitmap_template.c @@ -2,7 +2,7 @@ // GB_split_bitmap_template: split a bitmap matrix into a bitmap tile //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/split/template/GB_split_full_template.c b/GraphBLAS/Source/split/template/GB_split_full_template.c index 3de037e8a1..f15031340c 100644 --- a/GraphBLAS/Source/split/template/GB_split_full_template.c +++ b/GraphBLAS/Source/split/template/GB_split_full_template.c @@ -2,7 +2,7 @@ // GB_split_full_template: split a full matrix into a full tile //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/split/template/GB_split_sparse_template.c b/GraphBLAS/Source/split/template/GB_split_sparse_template.c index 366399814b..65ccffbdf8 100644 --- a/GraphBLAS/Source/split/template/GB_split_sparse_template.c +++ b/GraphBLAS/Source/split/template/GB_split_sparse_template.c @@ -2,11 +2,13 @@ // GB_split_sparse_template: split a single tile from a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ +// A is sparse or hypersparse. C has the same sparsity format as A. + { //-------------------------------------------------------------------------- @@ -19,12 +21,12 @@ #endif #ifdef GB_JIT_KERNEL - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; -// int64_t cvlen = C->vlen ; - int64_t *restrict Ci = C->i ; - int64_t *restrict Cp = C->p ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + GB_Cp_DECLARE (Cp, ) ; GB_Cp_PTR (Cp, C) ; + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + const GB_Ap_TYPE *restrict Wp = (const GB_Ap_TYPE *) Wp_workspace ; const int64_t *restrict kfirst_Cslice = C_ek_slicing ; const int64_t *restrict klast_Cslice = C_ek_slicing + C_ntasks ; const int64_t *restrict pstart_Cslice = C_ek_slicing + C_ntasks * 2 ; @@ -42,19 +44,20 @@ int64_t klast = klast_Cslice [tid] ; for (int64_t k = kfirst ; k <= klast ; k++) { - // int64_t jA = GBH_A (Ah, k+akstart) ; not needed - int64_t p0 = Cp [k] ; + // int64_t jA = GBh_A (Ah, k+akstart) ; not needed + int64_t p0 = GB_IGET (Cp, k) ; GB_GET_PA (pC_start, pC_end, tid, k, - kfirst, klast, pstart_Cslice, p0, Cp [k+1]) ; - int64_t pA_offset = Wp [k + akstart] ; + kfirst, klast, pstart_Cslice, p0, GB_IGET (Cp, k+1)) ; + int64_t pA_offset = GB_IGET (Wp, k + akstart) ; // copy the vector from A to C for (int64_t pC = pC_start ; pC < pC_end ; pC++) { // get the index of A(iA,jA) int64_t pA = pA_offset + pC - p0 ; - int64_t iA = Ai [pA] ; + int64_t iA = GB_IGET (Ai, pA) ; // shift the index and copy into C(i,j) - Ci [pC] = iA - aistart ; + int64_t iC = iA - aistart ; + GB_ISET (Ci, pC, iC) ; // Ci [pC] = iC ; GB_COPY (pC, pA) ; } } diff --git a/GraphBLAS/Source/transplant/GB_transplant.c b/GraphBLAS/Source/transplant/GB_transplant.c index b53b1c9998..e3e24c399c 100644 --- a/GraphBLAS/Source/transplant/GB_transplant.c +++ b/GraphBLAS/Source/transplant/GB_transplant.c @@ -2,7 +2,7 @@ // GB_transplant: replace contents of one matrix with another //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,8 +14,9 @@ // shallow. This function is not user-callable. The new type of C (ctype) // must be compatible with A->type. -// C->hyper_switch, C->bitmap_switch, C->sparsity_control, C->static_header, -// C->user_name, and C->user_name_size are not modified by the transplant. +// C->hyper_switch, C->bitmap_switch, C->sparsity_control, C->header_size, +// C->user_name, C->user_name_size, C->p_control, C->j_control, and +// C->i_control are not modified by the transplant. #define GB_FREE_ALL \ { \ @@ -62,6 +63,11 @@ GrB_Info GB_transplant // transplant one matrix into another int64_t avlen = A->vlen ; const bool A_iso = A->iso ; + // determine if C should be constructed as a bitmap or full matrix + bool C_is_hyper = GB_IS_HYPERSPARSE (A) ; + bool C_is_bitmap = GB_IS_BITMAP (A) ; + bool C_is_full = GB_as_if_full (A) && !C_is_bitmap && !C_is_hyper ; + //-------------------------------------------------------------------------- // determine the number of threads to use //-------------------------------------------------------------------------- @@ -89,8 +95,9 @@ GrB_Info GB_transplant // transplant one matrix into another C->is_csc = A->is_csc ; C->vlen = avlen ; C->vdim = avdim ; - C->nvec_nonempty = A->nvec_nonempty ; - C->iso = A_iso ; // OK:transplant +// C->nvec_nonempty = A->nvec_nonempty ; + GB_nvec_nonempty_set (C, GB_nvec_nonempty_get (A)) ; + C->iso = A_iso ; // C is not shallow, and has no content yet ASSERT (!GB_is_shallow (C)) ; @@ -102,10 +109,19 @@ GrB_Info GB_transplant // transplant one matrix into another ASSERT (C->Y == NULL) ; ASSERT (C->Pending == NULL) ; - // determine if C should be constructed as a bitmap or full matrix - bool C_is_hyper = GB_IS_HYPERSPARSE (A) ; - bool C_is_bitmap = GB_IS_BITMAP (A) ; - bool C_is_full = GB_as_if_full (A) && !C_is_bitmap && !C_is_hyper ; + //-------------------------------------------------------------------------- + // determine integer sizes of C + //-------------------------------------------------------------------------- + + bool p_is_32 = (C_is_full || C_is_bitmap) ? false : A->p_is_32 ; + bool j_is_32 = (C_is_full || C_is_bitmap) ? false : A->j_is_32 ; + bool i_is_32 = (C_is_full || C_is_bitmap) ? false : A->i_is_32 ; + size_t psize = p_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = j_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = i_is_32 ? sizeof (uint32_t) : sizeof (uint64_t) ; + C->p_is_32 = p_is_32 ; + C->j_is_32 = j_is_32 ; + C->i_is_32 = i_is_32 ; //-------------------------------------------------------------------------- // transplant A->Y into C->Y @@ -158,22 +174,22 @@ GrB_Info GB_transplant // transplant one matrix into another if (allocate_Cb) { // allocate new C->b component - C->b = GB_MALLOC (anz, int8_t, &(C->b_size)) ; + C->b = GB_MALLOC_MEMORY (anz, sizeof (int8_t), &(C->b_size)) ; ok = ok && (C->b != NULL) ; } if (allocate_Ci) { // allocate new C->i component - C->i = GB_MALLOC (anz, int64_t, &(C->i_size)) ; + C->i = GB_MALLOC_MEMORY (anz, isize, &(C->i_size)) ; ok = ok && (C->i != NULL) ; } if (allocate_Cx) { // allocate new C->x component; use calloc if C is bitmap - C->x = GB_XALLOC (C_is_bitmap, A_iso, anz, // x:OK - C->type->size, &(C->x_size)) ; + C->x = GB_XALLOC_MEMORY (C_is_bitmap, A_iso, anz, C->type->size, + &(C->x_size)) ; ok = ok && (C->x != NULL) ; } @@ -213,7 +229,7 @@ GrB_Info GB_transplant // transplant one matrix into another GB_OK (GB_cast_matrix (C, A)) ; if (!A->x_shallow) { - GB_FREE (&(A->x), A->x_size) ; + GB_FREE_MEMORY (&(A->x), A->x_size) ; } A->x = NULL ; } @@ -254,8 +270,8 @@ GrB_Info GB_transplant // transplant one matrix into another // A is hypersparse, create new C->p and C->h C->plen = GB_IMAX (1, anvec) ; C->nvec = anvec ; - C->p = GB_MALLOC (C->plen+1, int64_t, &(C->p_size)) ; - C->h = GB_MALLOC (C->plen , int64_t, &(C->h_size)) ; + C->p = GB_MALLOC_MEMORY (C->plen+1, psize, &(C->p_size)) ; + C->h = GB_MALLOC_MEMORY (C->plen , jsize, &(C->h_size)) ; if (C->p == NULL || C->h == NULL) { // out of memory @@ -264,15 +280,15 @@ GrB_Info GB_transplant // transplant one matrix into another } // copy A->p and A->h into the newly created C->p and C->h - GB_memcpy (C->p, A->p, (anvec+1) * sizeof (int64_t), nth) ; - GB_memcpy (C->h, A->h, anvec * sizeof (int64_t), nth) ; + GB_memcpy (C->p, A->p, (anvec+1) * psize, nth) ; + GB_memcpy (C->h, A->h, anvec * jsize, nth) ; } else { // A is sparse, create new C->p C->plen = avdim ; C->nvec = avdim ; - C->p = GB_MALLOC (C->plen+1, int64_t, &(C->p_size)) ; + C->p = GB_MALLOC_MEMORY (C->plen+1, psize, &(C->p_size)) ; if (C->p == NULL) { // out of memory @@ -281,7 +297,7 @@ GrB_Info GB_transplant // transplant one matrix into another } // copy A->p into the newly created C->p - GB_memcpy (C->p, A->p, (avdim+1) * sizeof (int64_t), nth) ; + GB_memcpy (C->p, A->p, (avdim+1) * psize, nth) ; } // free any non-shallow A->p and A->h content of A @@ -340,7 +356,7 @@ GrB_Info GB_transplant // transplant one matrix into another //---------------------------------------------------------------------- // copy A->i into C->i - GB_memcpy (C->i, A->i, anz * sizeof (int64_t), nthreads) ; + GB_memcpy (C->i, A->i, anz * isize, nthreads) ; A->i = NULL ; A->i_shallow = false ; @@ -404,7 +420,7 @@ GrB_Info GB_transplant // transplant one matrix into another C->b_shallow = false ; //-------------------------------------------------------------------------- - // free A and return result + // free A; all content is now in C, and return result //-------------------------------------------------------------------------- GB_Matrix_free (Ahandle) ; diff --git a/GraphBLAS/Source/transplant/GB_transplant.h b/GraphBLAS/Source/transplant/GB_transplant.h index cf0eed4db6..06bdb4611c 100644 --- a/GraphBLAS/Source/transplant/GB_transplant.h +++ b/GraphBLAS/Source/transplant/GB_transplant.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_transplant.h: definitions for GB_transplant* +// GB_transplant.h: definitions for GB_transplant methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/transplant/GB_transplant_conform.c b/GraphBLAS/Source/transplant/GB_transplant_conform.c index f13ba2c3d7..209a74fa3d 100644 --- a/GraphBLAS/Source/transplant/GB_transplant_conform.c +++ b/GraphBLAS/Source/transplant/GB_transplant_conform.c @@ -2,7 +2,7 @@ // GB_transplant_conform: transplant T into C, then conform C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ GrB_Info GB_transplant_conform // transplant and conform sparsity structure // T is always freed, even if the transplant runs out of memory ASSERT (*Thandle == NULL || - (*Thandle != NULL && ((*Thandle)->static_header || GBNSTATIC))) ; + (*Thandle != NULL && ((*Thandle)->header_size == 0 || GBNSTATIC))) ; if (info != GrB_SUCCESS) { @@ -65,7 +65,7 @@ GrB_Info GB_transplant_conform // transplant and conform sparsity structure } ASSERT_MATRIX_OK (C, "C conformed", GB0) ; - ASSERT (C->nvec_nonempty >= 0) ; + ASSERT (GB_nvec_nonempty_get (C) >= 0) ; return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/transpose/GB_transpose.c b/GraphBLAS/Source/transpose/GB_transpose.c index 582c975010..8b689ab08e 100644 --- a/GraphBLAS/Source/transpose/GB_transpose.c +++ b/GraphBLAS/Source/transpose/GB_transpose.c @@ -2,7 +2,7 @@ // GB_transpose: C=A' or C=op(A'), with typecasting //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,10 +36,10 @@ #define GB_FREE_WORKSPACE \ { \ - GB_FREE (&iwork, iwork_size) ; \ - GB_FREE (&jwork, jwork_size) ; \ - GB_FREE (&Swork, Swork_size) ; \ - GB_WERK_POP (Count, int64_t) ; \ + GB_FREE_MEMORY (&iwork, iwork_size) ; \ + GB_FREE_MEMORY (&jwork, jwork_size) ; \ + GB_FREE_MEMORY (&Swork, Swork_size) ; \ + GB_WERK_POP (Count, uint64_t) ; \ } #define GB_FREE_ALL \ @@ -83,24 +83,19 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') ASSERT (C != NULL) ; ASSERT (A != NULL) ; bool in_place = (A == C) ; - GB_WERK_DECLARE (Count, int64_t) ; - int64_t *iwork = NULL ; size_t iwork_size = 0 ; - int64_t *jwork = NULL ; size_t jwork_size = 0 ; + GB_WERK_DECLARE (Count, uint64_t) ; + void *iwork = NULL ; size_t iwork_size = 0 ; + void *jwork = NULL ; size_t jwork_size = 0 ; GB_void *Swork = NULL ; size_t Swork_size = 0 ; struct GB_Matrix_opaque T_header ; GrB_Matrix T = NULL ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; ASSERT_MATRIX_OK (A, "A input for GB_transpose", GB0) ; ASSERT_TYPE_OK_OR_NULL (ctype, "ctype for GB_transpose", GB0) ; ASSERT_OP_OK_OR_NULL (op_in, "unop/binop for GB_transpose", GB0) ; ASSERT_SCALAR_OK_OR_NULL (scalar, "scalar for GB_transpose", GB0) ; - if (in_place) - { - GBURBLE ("(in-place transpose) ") ; - } - // get the current sparsity control of A float A_hyper_switch = A->hyper_switch ; float A_bitmap_switch = A->bitmap_switch ; @@ -129,6 +124,15 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') int64_t anz_held = GB_nnz_held (A) ; int64_t anvec = A->nvec ; int64_t anvals = A->nvals ; + bool Ap_is_32 = A->p_is_32 ; + bool Aj_is_32 = A->j_is_32 ; + bool Ai_is_32 = A->i_is_32 ; + + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + + size_t apsize = (Ap_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t ajsize = (Aj_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t aisize = (Ai_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; //-------------------------------------------------------------------------- // determine the max number of threads to use @@ -247,11 +251,15 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // A is empty //---------------------------------------------------------------------- + // T is created using the requested integers of C. + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_HYPERSPARSE, 0, avdim, avlen, Werk) ; + // create a new empty matrix T, with the new type and dimensions. - // set T->iso = false OK GB_OK (GB_new_bix (&T, // hyper, existing header - ctype, avdim, avlen, GB_Ap_calloc, C_is_csc, GxB_HYPERSPARSE, - true, A_hyper_switch, 1, 1, true, false)) ; + ctype, avdim, avlen, GB_ph_calloc, C_is_csc, GxB_HYPERSPARSE, + true, A_hyper_switch, 1, 1, true, false, + Cp_is_32, Cj_is_32, Ci_is_32)) ; } else if (A_is_bitmap || GB_IS_FULL (A)) @@ -272,23 +280,28 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') && op == NULL // no operator to apply, && atype == ctype ; // and no typecasting + // full/bitmap matrices do not have integers + Cp_is_32 = false ; + Cj_is_32 = false ; + Ci_is_32 = false ; + // allocate T if (T_cheap) { // just initialize the static header of T, not T->b or T->x GBURBLE ("(cheap transpose) ") ; info = GB_new (&T, // bitmap or full, existing header - ctype, avdim, avlen, GB_Ap_null, C_is_csc, - T_sparsity, A_hyper_switch, 1) ; + ctype, avdim, avlen, GB_ph_null, C_is_csc, + T_sparsity, A_hyper_switch, 1, Cp_is_32, Cj_is_32, Ci_is_32) ; ASSERT (info == GrB_SUCCESS) ; } else { // allocate all of T, including T->b and T->x - // set T->iso = C_iso OK GB_OK (GB_new_bix (&T, // bitmap or full, existing header - ctype, avdim, avlen, GB_Ap_null, C_is_csc, T_sparsity, true, - A_hyper_switch, 1, anz_held, true, C_iso)) ; + ctype, avdim, avlen, GB_ph_null, C_is_csc, T_sparsity, true, + A_hyper_switch, 1, anz_held, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32)) ; } T->magic = GB_MAGIC ; @@ -348,7 +361,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') //---------------------------------------------------------------------- // transpose a vector (avlen-by-1) into a "row" matrix (1-by-avlen). - // A must be sorted first. + // A must be sorted first. GBURBLE ("(sparse vector transpose (a)) ") ; ASSERT_MATRIX_OK (A, "the vector A must already be sorted", GB0) ; @@ -358,23 +371,29 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // allocate T //---------------------------------------------------------------------- - // Initialized the header of T, with no content, and initialize the - // type and dimension of T. T is hypersparse. + // Initialize the header of T, with no content, and initialize the + // type and dimension of T. T is hypersparse. The integers for T->p + // are the same as A->p, but the integers for T->i and T->h are swapped + // with A. + + Cp_is_32 = Ap_is_32 ; + Cj_is_32 = Ai_is_32 ; // create T->h with the integers of A->i + Ci_is_32 = Aj_is_32 ; // create T->i with the integers of A->h info = GB_new (&T, // hyper; existing header - ctype, 1, avlen, GB_Ap_null, C_is_csc, - GxB_HYPERSPARSE, A_hyper_switch, 0) ; + ctype, 1, avlen, GB_ph_null, C_is_csc, + GxB_HYPERSPARSE, A_hyper_switch, 0, Cp_is_32, Cj_is_32, Ci_is_32) ; ASSERT (info == GrB_SUCCESS) ; // allocate T->p, T->i, and optionally T->x, but not T->h int64_t tplen = GB_IMAX (1, anz) ; - T->p = GB_MALLOC (tplen+1, int64_t, &(T->p_size)) ; - T->i = GB_MALLOC (anz , int64_t, &(T->i_size)) ; + T->p = GB_MALLOC_MEMORY (tplen+1, apsize, &(T->p_size)) ; + T->i = GB_MALLOC_MEMORY (anz , ajsize, &(T->i_size)) ; bool allocate_Tx = (op != NULL || C_iso) || (ctype != atype) ; if (allocate_Tx) { // allocate new space for the new typecasted numerical values of T - T->x = GB_XALLOC (false, C_iso, anz, csize, &(T->x_size)) ; // x:OK + T->x = GB_XALLOC_MEMORY (false, C_iso, anz, csize, &(T->x_size)) ; } if (T->p == NULL || T->i == NULL || (allocate_Tx && T->x == NULL)) { @@ -438,7 +457,11 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // T->p = 0:anz and T->i = zeros (1,anz), newly allocated T->plen = tplen ; T->nvec = anz ; - T->nvec_nonempty = anz ; +// T->nvec_nonempty = anz ; + GB_nvec_nonempty_set (T, anz) ; + + GB_Ap_DECLARE (Tp, ) ; GB_Ap_PTR (Tp, T) ; + GB_Ai_DECLARE (Ti, ) ; GB_Ai_PTR (Ti, T) ; // fill the vector pointers T->p int nthreads = GB_nthreads (anz, chunk, nthreads_max) ; @@ -446,10 +469,13 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') #pragma omp parallel for num_threads(nthreads) schedule(static) for (k = 0 ; k < anz ; k++) { - T->i [k] = 0 ; - T->p [k] = k ; + // Ti [k] = 0 ; + GB_ISET (Ti, k, 0) ; + // Tp [k] = k ; + GB_ISET (Tp, k, k) ; } - T->p [anz] = anz ; + // Tp [anz] = anz ; + GB_ISET (Tp, anz, anz) ; T->iso = C_iso ; T->nvals = anz ; @@ -464,7 +490,8 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') //---------------------------------------------------------------------- // transpose a "row" matrix (1-by-avdim) into a vector (avdim-by-1). - // if A->vlen is 1, all vectors of A are implicitly sorted + // if A->vlen is 1, all vectors of A are implicitly sorted. + GBURBLE ("(sparse vector transpose (b)) ") ; ASSERT_MATRIX_OK (A, "1-by-n input A already sorted", GB0) ; @@ -480,7 +507,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') ntasks = 8 * nth ; ntasks = GB_IMIN (ntasks, avdim) ; ntasks = GB_IMAX (ntasks, 1) ; - GB_WERK_PUSH (Count, ntasks+1, int64_t) ; + GB_WERK_PUSH (Count, ntasks+1, uint64_t) ; if (Count == NULL) { // out of memory @@ -489,27 +516,39 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') } } + //---------------------------------------------------------------------- + // allocate T + //---------------------------------------------------------------------- + + // Initialize the header of T, with no content, and initialize the type + // and dimension of T. T is sparse. The integers for T->p are the + // same as A->p, but the integers for T->i and T->h are swapped with A. + + Cp_is_32 = Ap_is_32 ; + Cj_is_32 = Ai_is_32 ; // create T->h with the integers of A->i + Ci_is_32 = Aj_is_32 ; // create T->i with the integers of A->h + // Allocate the header of T, with no content // and initialize the type and dimension of T. info = GB_new (&T, // sparse; existing header - ctype, avdim, 1, GB_Ap_null, C_is_csc, - GxB_SPARSE, A_hyper_switch, 0) ; + ctype, avdim, 1, GB_ph_null, C_is_csc, + GxB_SPARSE, A_hyper_switch, 0, Cp_is_32, Cj_is_32, Ci_is_32) ; ASSERT (info == GrB_SUCCESS) ; T->iso = C_iso ; // OK // allocate new space for the values and pattern - T->p = GB_CALLOC (2, int64_t, &(T->p_size)) ; + T->p = GB_CALLOC_MEMORY (2, apsize, &(T->p_size)) ; if (!A_is_hyper) { // A is sparse, so new space is needed for T->i - T->i = GB_MALLOC (anz, int64_t, &(T->i_size)) ; + T->i = GB_MALLOC_MEMORY (anz, ajsize, &(T->i_size)) ; } bool allocate_Tx = (op != NULL || C_iso) || (ctype != atype) ; if (allocate_Tx) { // allocate new space for the new typecasted numerical values of T - T->x = GB_XALLOC (false, C_iso, anz, csize, &(T->x_size)) ; // x:OK + T->x = GB_XALLOC_MEMORY (false, C_iso, anz, csize, &(T->x_size)) ; } if (T->p == NULL || (T->i == NULL && !A_is_hyper) || @@ -587,6 +626,9 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // find the non-empty vectors of A, which become entries in T //------------------------------------------------------------------ + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ti, ) ; GB_Ai_PTR (Ti, T) ; + if (nth == 1) { @@ -597,9 +639,11 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') int64_t k = 0 ; for (int64_t j = 0 ; j < avdim ; j++) { - if (A->p [j] < A->p [j+1]) + if (GB_IGET (Ap, j) < GB_IGET (Ap, j+1)) { - T->i [k++] = j ; + // Ti [k++] = j ; + GB_ISET (Ti, k, j) ; + k++ ; } } ASSERT (k == anz) ; @@ -620,7 +664,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') GB_PARTITION (jstart, jend, avdim, tid, ntasks) ; for (int64_t j = jstart ; j < jend ; j++) { - if (A->p [j] < A->p [j+1]) + if (GB_IGET (Ap, j) < GB_IGET (Ap, j+1)) { k++ ; } @@ -628,7 +672,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') Count [tid] = k ; } - GB_cumsum1 (Count, ntasks) ; + GB_cumsum1_64 (Count, ntasks) ; ASSERT (Count [ntasks] == anz) ; #pragma omp parallel for num_threads(nth) schedule(dynamic,1) @@ -638,9 +682,11 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') GB_PARTITION (jstart, jend, avdim, tid, ntasks) ; for (int64_t j = jstart ; j < jend ; j++) { - if (A->p [j] < A->p [j+1]) + if (GB_IGET (Ap, j) < GB_IGET (Ap, j+1)) { - T->i [k++] = j ; + // Ti [k++] = j ; + GB_ISET (Ti, k, j) ; + k++ ; } } } @@ -650,9 +696,9 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') int64_t k = 0 ; for (int64_t j = 0 ; j < avdim ; j++) { - if (A->p [j] < A->p [j+1]) + if (GB_IGET (Ap, j) < GB_IGET (Ap, j+1)) { - ASSERT (T->i [k] == j) ; + ASSERT (GB_IGET (Ti, k) == j) ; k++ ; } } @@ -667,8 +713,15 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // T->p = [0 anz] ASSERT (T->plen == 1) ; ASSERT (T->nvec == 1) ; - T->nvec_nonempty = (anz == 0) ? 0 : 1 ; - T->p [1] = anz ; +// T->nvec_nonempty = (anz == 0) ? 0 : 1 ; + GB_nvec_nonempty_set (T, (anz == 0) ? 0 : 1) ; + + GB_Ap_DECLARE (Tp, ) ; GB_Ap_PTR (Tp, T) ; + // Tp [0] = 0 ; + // Tp [1] = anz ; + GB_ISET (Tp, 0, 0) ; + GB_ISET (Tp, 1, anz) ; + T->nvals = anz ; T->magic = GB_MAGIC ; ASSERT (!GB_JUMBLED (T)) ; @@ -711,7 +764,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') //------------------------------------------------------------------ // allocate iwork of size anz - iwork = GB_MALLOC (anz, int64_t, &iwork_size) ; + iwork = GB_MALLOC_MEMORY (anz, ajsize, &iwork_size) ; if (iwork == NULL) { // out of memory @@ -721,26 +774,30 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // Construct the "row" indices of C, which are "column" indices of // A. This array becomes the permanent T->i on output. - - GB_OK (GB_extract_vector_list (iwork, A, Werk)) ; + GB_OK (GB_extract_vector_list (iwork, Aj_is_32, A, Werk)) ; //------------------------------------------------------------------ // allocate the output matrix and additional space (jwork and Swork) //------------------------------------------------------------------ + // T is created using the requested integers of C. + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_HYPERSPARSE, anz, avdim, avlen, Werk) ; + // initialize the header of T, with no content, // and initialize the type and dimension of T. info = GB_new (&T, // hyper, existing header - ctype, avdim, avlen, GB_Ap_null, C_is_csc, - GxB_HYPERSPARSE, A_hyper_switch, 0) ; + ctype, avdim, avlen, GB_ph_null, C_is_csc, + GxB_HYPERSPARSE, A_hyper_switch, 0, + Cp_is_32, Cj_is_32, Ci_is_32) ; ASSERT (info == GrB_SUCCESS) ; // if in_place, the prior A->p and A->h can now be freed if (in_place) { - if (!A->p_shallow) GB_FREE (&A->p, A->p_size) ; - if (!A->h_shallow) GB_FREE (&A->h, A->h_size) ; + if (!A->p_shallow) GB_FREE_MEMORY (&A->p, A->p_size) ; + if (!A->h_shallow) GB_FREE_MEMORY (&A->h, A->h_size) ; } GB_void *S_input = NULL ; @@ -753,14 +810,14 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') if (!recycle_Ai) { // allocate jwork of size anz - jwork = GB_MALLOC (anz, int64_t, &jwork_size) ; + jwork = GB_MALLOC_MEMORY (anz, aisize, &jwork_size) ; ok = ok && (jwork != NULL) ; } if (op != NULL && !C_iso) { - Swork = (GB_void *) GB_XALLOC (false, C_iso, anz, // x:OK - csize, &Swork_size) ; + Swork = (GB_void *) GB_XALLOC_MEMORY (false, C_iso, anz, csize, + &Swork_size) ; ok = ok && (Swork != NULL) ; } @@ -789,7 +846,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') { // copy A->i into jwork, making a deep copy. jwork is freed by // GB_builder. A->i is not modified, even if out of memory. - GB_memcpy (jwork, A->i, anz * sizeof (int64_t), nthreads_max) ; + GB_memcpy (jwork, A->i, anz * aisize, nthreads_max) ; } // numerical values: apply the op, typecast, or make shallow copy @@ -831,7 +888,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') //------------------------------------------------------------------ // internally, jwork is freed and then T->x is allocated, so the - // total memory usage is anz * max (csize, sizeof(int64_t)). T is + // total memory usage is anz * max (csize, sizeof(aisize)). T is // always hypersparse. Either T, Swork, and S_input are all iso, // or all non-iso, depending on C_iso. @@ -858,7 +915,9 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') NULL, // no dup operator needed (input has no duplicates) stype, // type of S_input or Swork false, // no burble (already burbled above) - Werk + Werk, + Aj_is_32, Ai_is_32, // integer sizes of iwork and jwork + Cp_is_32, Cj_is_32, Ci_is_32 // integer sizes for T )) ; // GB_builder always frees jwork, and either frees iwork or @@ -886,6 +945,17 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') } } + //========================================================================== + // conform the integers + //========================================================================== + + // In case T was created using the integers of A, it must be converted to + // the requested integers of C. This does nothing if T was already created + // in that form. + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GB_sparsity (T), anz, avdim, avlen, Werk) ; + GB_OK (GB_convert_int (T, Cp_is_32, Cj_is_32, Ci_is_32, true)) ; + //========================================================================== // free workspace, apply positional op, and transplant/conform T into C //========================================================================== @@ -925,7 +995,6 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') // If C was constructed as iso; it needs to be expanded first, // but do not initialize the values. These are computed by // GB_apply_op below. - // set C->iso = false OK: no need to burble GB_OK (GB_convert_any_to_non_iso (C, false)) ; } @@ -962,12 +1031,12 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') if (GB_IS_BITMAP (C)) { // calloc the space so the new C->x has no uninitialized space - Cx_new = GB_CALLOC (anz_held*csize, GB_void, &Cx_size) ; // x:OK + Cx_new = GB_CALLOC_MEMORY (anz_held, csize, &Cx_size) ; } else { // malloc is fine; all C->x will be written - Cx_new = GB_MALLOC (anz_held*csize, GB_void, &Cx_size) ; // x:OK + Cx_new = GB_MALLOC_MEMORY (anz_held, csize, &Cx_size) ; } if (Cx_new == NULL) { @@ -979,7 +1048,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') GB_OK (GB_apply_op (Cx_new, ctype, GB_NON_ISO, op, scalar, false, flipij, C, Werk)) ; // transplant Cx_new as C->x and finalize the type of C - GB_FREE (&(C->x), C->x_size) ; + GB_FREE_MEMORY (&(C->x), C->x_size) ; C->x = Cx_new ; C->x_size = Cx_size ; C->type = ctype ; diff --git a/GraphBLAS/Source/transpose/GB_transpose.h b/GraphBLAS/Source/transpose/GB_transpose.h index f76023f9a2..80d7458b00 100644 --- a/GraphBLAS/Source/transpose/GB_transpose.h +++ b/GraphBLAS/Source/transpose/GB_transpose.h @@ -2,7 +2,7 @@ // GB_transpose.h: definitions for GB_transpose //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,10 +33,10 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') GB_Werk Werk ) ; -GrB_Info GB_transpose_in_place // C=A', no change of type, no operators +GrB_Info GB_transpose_in_place // A=A', to change A->is_csc ( - GrB_Matrix C, // output matrix C, possibly modified in-place - const bool C_is_csc, // desired CSR/CSC format of C + GrB_Matrix A, // input/output matrix + const bool new_csc, // desired format, by row (false) or by col (true) GB_Werk Werk ) ; @@ -71,7 +71,7 @@ GrB_Info GB_transpose_ix // transpose the pattern and values of a matrix GrB_Matrix C, // output matrix const GrB_Matrix A, // input matrix // for sparse case: - int64_t *restrict *Workspaces, // Workspaces, size nworkspaces + void **Workspaces, // Workspaces, size nworkspaces const int64_t *restrict A_slice, // how A is sliced, size nthreads+1 int nworkspaces, // # of workspaces to use // for all cases: @@ -88,20 +88,12 @@ GrB_Info GB_transpose_op // transpose, typecast, and apply operator to a matrix bool binop_bind1st, // if true, binop(x,A) else binop(A,y) const GrB_Matrix A, // input matrix // for sparse or hypersparse case: - int64_t *restrict *Workspaces, // Workspaces, size nworkspaces + void **Workspaces, // Workspaces, size nworkspaces const int64_t *restrict A_slice, // how A is sliced, size nthreads+1 int nworkspaces, // # of workspaces to use // for all cases: int nthreads // # of threads to use ) ; -GrB_Info GB_shallow_copy // create a purely shallow matrix -( - GrB_Matrix C, // output matrix C, with a static header - const bool C_is_csc, // desired CSR/CSC format of C - const GrB_Matrix A, // input matrix - GB_Werk Werk -) ; - #endif diff --git a/GraphBLAS/Source/transpose/GB_transpose_bucket.c b/GraphBLAS/Source/transpose/GB_transpose_bucket.c index 08fb686ff2..ea3ee8c1a9 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_bucket.c +++ b/GraphBLAS/Source/transpose/GB_transpose_bucket.c @@ -2,7 +2,7 @@ // GB_transpose_bucket: transpose and optionally typecast and/or apply operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,12 +41,12 @@ { \ for (int tid = 0 ; tid < nworkspaces ; tid++) \ { \ - GB_FREE_WORK (&(Workspaces [tid]), Workspaces_size [tid]) ; \ + GB_FREE_MEMORY (&(Workspaces [tid]), Workspaces_size [tid]) ; \ } \ } \ GB_WERK_POP (A_slice, int64_t) ; \ GB_WERK_POP (Workspaces_size, size_t) ; \ - GB_WERK_POP (Workspaces, int64_t *) ; \ + GB_WERK_POP (Workspaces, void *) ; \ } #define GB_FREE_ALL \ @@ -76,7 +76,8 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op // check inputs //-------------------------------------------------------------------------- - ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; + // C is an empty header and not yet allocated + ASSERT (C != NULL && (C->header_size == 0 || GBNSTATIC)) ; ASSERT_TYPE_OK (ctype, "ctype for transpose", GB0) ; ASSERT_MATRIX_OK (A, "A input for transpose_bucket", GB0) ; ASSERT (!GB_PENDING (A)) ; @@ -92,24 +93,29 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; GB_WERK_DECLARE (A_slice, int64_t) ; // size nthreads+1 - GB_WERK_DECLARE (Workspaces, int64_t *) ; // size nworkspaces + GB_WERK_DECLARE (Workspaces, void *) ; // size nworkspaces GB_WERK_DECLARE (Workspaces_size, size_t) ; // size nworkspaces //-------------------------------------------------------------------------- // get A //-------------------------------------------------------------------------- + GrB_Info info ; int64_t anz = GB_nnz (A) ; - int64_t vlen = A->vlen ; + int64_t avlen = A->vlen ; + int64_t avdim = A->vdim ; + + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; //-------------------------------------------------------------------------- // determine the number of threads to use //-------------------------------------------------------------------------- - // # of threads to use in the O(vlen) loops below + // # of threads to use in the O(avlen) loops below int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; - int nth = GB_nthreads (vlen, chunk, nthreads_max) ; + int nth = GB_nthreads (avlen, chunk, nthreads_max) ; //-------------------------------------------------------------------------- // allocate C: always sparse @@ -118,22 +124,26 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op // The bucket transpose only works when C is sparse. // A can be sparse or hypersparse. + // determine the p_is_32, j_is_32, and i_is_32 settings for the new matrix + bool Cp_is_32, Cj_is_32, Ci_is_32 ; + GB_determine_pji_is_32 (&Cp_is_32, &Cj_is_32, &Ci_is_32, + GxB_SPARSE, anz, avdim, avlen, Werk) ; + // C->p is allocated but not initialized. - GrB_Info info ; - // set C->iso = C_iso OK bool C_iso = (C_code_iso != GB_NON_ISO) ; GB_OK (GB_new_bix (&C, // sparse, existing header - ctype, A->vdim, vlen, GB_Ap_malloc, C_is_csc, - GxB_SPARSE, true, A->hyper_switch, vlen, anz, true, C_iso)) ; + ctype, avdim, avlen, GB_ph_malloc, C_is_csc, GxB_SPARSE, true, + A->hyper_switch, avlen, anz, true, C_iso, + Cp_is_32, Cj_is_32, Ci_is_32)) ; - int64_t *restrict Cp = C->p ; C->nvals = anz ; + size_t cpsize = (Cp_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; //-------------------------------------------------------------------------- // allocate workspace //-------------------------------------------------------------------------- - GB_WERK_PUSH (Workspaces, nworkspaces, int64_t *) ; + GB_WERK_PUSH (Workspaces, nworkspaces, void *) ; GB_WERK_PUSH (Workspaces_size, nworkspaces, size_t) ; if (Workspaces == NULL || Workspaces_size == NULL) { @@ -145,7 +155,8 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op bool ok = true ; for (int tid = 0 ; tid < nworkspaces ; tid++) { - Workspaces [tid] = GB_MALLOC_WORK (vlen + 1, int64_t, + // each workspace has the same size integer as Cp + Workspaces [tid] = GB_MALLOC_MEMORY (avlen + 1, cpsize, &Workspaces_size [tid]) ; ok = ok && (Workspaces [tid] != NULL) ; } @@ -157,9 +168,9 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op return (GrB_OUT_OF_MEMORY) ; } - //========================================================================== + //-------------------------------------------------------------------------- // phase1: symbolic analysis - //========================================================================== + //-------------------------------------------------------------------------- // slice the A matrix, perfectly balanced for one task per thread GB_WERK_PUSH (A_slice, nthreads + 1, int64_t) ; @@ -169,155 +180,25 @@ GrB_Info GB_transpose_bucket // bucket transpose; typecast and apply op GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, A->p, A->nvec, nthreads, true) ; + GB_p_slice (A_slice, Ap, A->p_is_32, A->nvec, nthreads, true) ; // sum up the row counts and find C->p - if (nthreads == 1) + if (Cp_is_32) { - - //---------------------------------------------------------------------- - // sequential method: A is not sliced - //---------------------------------------------------------------------- - - // Only requires a single int64 workspace of size vlen for a single - // thread. The resulting C matrix is not jumbled. - GBURBLE ("(1-thread bucket transpose) ") ; - - // compute the row counts of A. No need to scan the A->p pointers - ASSERT (nworkspaces == 1) ; - int64_t *restrict workspace = Workspaces [0] ; - memset (workspace, 0, (vlen + 1) * sizeof (int64_t)) ; - const int64_t *restrict Ai = A->i ; - for (int64_t p = 0 ; p < anz ; p++) - { - int64_t i = Ai [p] ; - workspace [i]++ ; - } - - // cumulative sum of the workspace, and copy back into C->p - GB_cumsum (workspace, vlen, &(C->nvec_nonempty), 1, NULL) ; - memcpy (Cp, workspace, (vlen + 1) * sizeof (int64_t)) ; - - } - else if (nworkspaces == 1) - { - - //---------------------------------------------------------------------- - // atomic method: A is sliced but workspace is shared - //---------------------------------------------------------------------- - - // Only requires a single int64 workspace of size vlen, shared by all - // threads. Scales well, but requires atomics. If the # of rows is - // very small and the average row degree is high, this can be very slow - // because of contention on the atomic workspace. Otherwise, it is - // typically faster than the non-atomic method. The resulting C matrix - // is jumbled. - - GBURBLE ("(%d-thread atomic bucket transpose) ", nthreads) ; - - // compute the row counts of A. No need to scan the A->p pointers - int64_t *restrict workspace = Workspaces [0] ; - GB_memset (workspace, 0, (vlen + 1) * sizeof (int64_t), nth) ; - const int64_t *restrict Ai = A->i ; - int64_t p ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (p = 0 ; p < anz ; p++) - { - int64_t i = Ai [p] ; - // update workspace [i]++ automically: - GB_ATOMIC_UPDATE - workspace [i]++ ; - } - - C->jumbled = true ; // atomic transpose leaves C jumbled - - // cumulative sum of the workspace, and copy back into C->p - GB_cumsum (workspace, vlen, &(C->nvec_nonempty), nth, Werk) ; - GB_memcpy (Cp, workspace, (vlen+ 1) * sizeof (int64_t), nth) ; - + #define GB_Cp_TYPE uint32_t + #include "transpose/factory/GB_transpose_bucket_template.c" } else { - - //---------------------------------------------------------------------- - // non-atomic method - //---------------------------------------------------------------------- - - // compute the row counts of A for each slice, one per thread; This - // method is parallel, but not highly scalable. Each thread requires - // int64 workspace of size vlen, but no atomics are required. The - // resulting C matrix is not jumbled, so this can save work if C needs - // to be unjumbled later. - - GBURBLE ("(%d-thread non-atomic bucket transpose) ", nthreads) ; - - ASSERT (nworkspaces == nthreads) ; - const int64_t *restrict Ap = A->p ; -// const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - // get the row counts for this slice, of size A->vlen - int64_t *restrict workspace = Workspaces [tid] ; - memset (workspace, 0, (vlen + 1) * sizeof (int64_t)) ; - for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) - { - // iterate over the entries in A(:,j) - // int64_t j = GBH (Ah, k) ; - int64_t pA_start = Ap [k] ; - int64_t pA_end = Ap [k+1] ; - for (int64_t pA = pA_start ; pA < pA_end ; pA++) - { - // count one more entry in C(i,:) for this slice - int64_t i = Ai [pA] ; - workspace [i]++ ; - } - } - } - - // cumulative sum of the workspaces across the slices - int64_t i ; - #pragma omp parallel for num_threads(nth) schedule(static) - for (i = 0 ; i < vlen ; i++) - { - int64_t s = 0 ; - for (int tid = 0 ; tid < nthreads ; tid++) - { - int64_t *restrict workspace = Workspaces [tid] ; - int64_t c = workspace [i] ; - workspace [i] = s ; - s += c ; - } - Cp [i] = s ; - } - Cp [vlen] = 0 ; - - // compute the vector pointers for C - GB_cumsum (Cp, vlen, &(C->nvec_nonempty), nth, Werk) ; - - // add Cp back to all Workspaces - #pragma omp parallel for num_threads(nth) schedule(static) - for (i = 0 ; i < vlen ; i++) - { - int64_t s = Cp [i] ; - int64_t *restrict workspace = Workspaces [0] ; - workspace [i] = s ; - for (int tid = 1 ; tid < nthreads ; tid++) - { - int64_t *restrict workspace = Workspaces [tid] ; - workspace [i] += s ; - } - } + #define GB_Cp_TYPE uint64_t + #include "transpose/factory/GB_transpose_bucket_template.c" } C->magic = GB_MAGIC ; - //========================================================================== + //-------------------------------------------------------------------------- // phase2: transpose A into C - //========================================================================== + //-------------------------------------------------------------------------- // transpose both the pattern and the values if (op == NULL) diff --git a/GraphBLAS/Source/transpose/GB_transpose_cast.c b/GraphBLAS/Source/transpose/GB_transpose_cast.c index 086672e4ec..63bc22539d 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_cast.c +++ b/GraphBLAS/Source/transpose/GB_transpose_cast.c @@ -2,7 +2,7 @@ // GB_transpose_cast: transpose and typecast //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/transpose/GB_transpose_in_place.c b/GraphBLAS/Source/transpose/GB_transpose_in_place.c index 7dddc67671..c16212a2cd 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_in_place.c +++ b/GraphBLAS/Source/transpose/GB_transpose_in_place.c @@ -1,26 +1,75 @@ //------------------------------------------------------------------------------ -// GB_transpose_in_place: in-place transpose +// GB_transpose_in_place: in-place transpose (to change A->is_csc format) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // All other uses of GB_transpose are not in-place. // No operator is applied and no typecasting is done. +// Does nothing if A is already in the requested format. #include "transpose/GB_transpose.h" +#define GB_FREE_ALL ; -GrB_Info GB_transpose_in_place // C=A', no change of type, no operators +GrB_Info GB_transpose_in_place // A=A', to change A->is_csc ( - GrB_Matrix C, // output matrix C, possibly modified in-place - const bool C_is_csc, // desired CSR/CSC format of C + GrB_Matrix A, // input/output matrix + const bool new_csc, // desired format, by row (false) or by col (true) GB_Werk Werk ) -{ - return (GB_transpose (C, NULL, C_is_csc, C, - NULL, NULL, false, false, // no operator - Werk)) ; +{ + + //-------------------------------------------------------------------------- + // conform the matrix to the new by-row/by-col format + //-------------------------------------------------------------------------- + + if (A->is_csc != new_csc) + { + + //---------------------------------------------------------------------- + // check inputs + //---------------------------------------------------------------------- + + GrB_Info info ; + ASSERT_MATRIX_OK (A, "A for new csc format", GB0) ; + ASSERT (GB_PENDING_OK (A)) ; + ASSERT (GB_ZOMBIES_OK (A)) ; + ASSERT (GB_JUMBLED_OK (A)) ; + GB_BURBLE_N (GB_nnz (A), "(transpose to set orientation) ") ; + + //---------------------------------------------------------------------- + // swap A->[ji]_control + //---------------------------------------------------------------------- + + int8_t j_control = A->j_control ; + A->j_control = A->i_control ; + A->i_control = j_control ; + + //---------------------------------------------------------------------- + // in-place A = A', with the new csc setting + //---------------------------------------------------------------------- + + GB_OK (GB_transpose (A, + /* no change of type: */ NULL, + /* new requested format: */ new_csc, + /* in-place transpose: */ A, + /* no operator: */ NULL, NULL, false, false, + Werk)) ; + + ASSERT_MATRIX_OK (A, "A with new csc format", GB0) ; + ASSERT (A->is_csc == new_csc) ; + ASSERT (!GB_PENDING (A)) ; + ASSERT (!GB_ZOMBIES (A)) ; + ASSERT (GB_JUMBLED_OK (A)) ; + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/transpose/GB_transpose_ix.c b/GraphBLAS/Source/transpose/GB_transpose_ix.c index 85d5c535ca..1ecad0818a 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_ix.c +++ b/GraphBLAS/Source/transpose/GB_transpose_ix.c @@ -2,7 +2,7 @@ // GB_transpose_ix: transpose the values and pattern of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,7 +37,7 @@ GrB_Info GB_transpose_ix // transpose the pattern and values of a matrix GrB_Matrix C, // output matrix const GrB_Matrix A, // input matrix // for sparse case: - int64_t *restrict *Workspaces, // Workspaces, size nworkspaces + void **Workspaces, // Workspaces, size nworkspaces const int64_t *restrict A_slice, // how A is sliced, size nthreads+1 int nworkspaces, // # of workspaces to use // for all cases: @@ -59,6 +59,9 @@ GrB_Info GB_transpose_ix // transpose the pattern and values of a matrix GB_Type_code code2 = A->type->code ; // defines atype size_t asize = A->type->size ; + bool Cp_is_32 = C->p_is_32 ; + #define GB_Cp_IS_32 Cp_is_32 + //-------------------------------------------------------------------------- // built-in worker: transpose and typecast //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/transpose/GB_transpose_method.c b/GraphBLAS/Source/transpose/GB_transpose_method.c index 8db9cdaad0..d28c67bd1e 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_method.c +++ b/GraphBLAS/Source/transpose/GB_transpose_method.c @@ -2,7 +2,7 @@ // GB_transpose_method: select method for GB_transpose //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,9 @@ bool GB_transpose_method // if true: use GB_builder, false: use bucket //-------------------------------------------------------------------------- // if available, A->nvec_nonempty is used to select the method - int64_t anvec = (A->nvec_nonempty < 0) ? A->nvec : A->nvec_nonempty ; + int64_t nvec_nonempty = GB_nvec_nonempty (A) ; + int64_t anvec = (nvec_nonempty < 0) ? A->nvec : nvec_nonempty ; + int64_t anz = GB_nnz (A) ; int64_t avlen = A->vlen ; // int64_t avdim = A->vdim ; diff --git a/GraphBLAS/Source/transpose/GB_transpose_op.c b/GraphBLAS/Source/transpose/GB_transpose_op.c index ec5000cdf2..a85541a374 100644 --- a/GraphBLAS/Source/transpose/GB_transpose_op.c +++ b/GraphBLAS/Source/transpose/GB_transpose_op.c @@ -2,7 +2,7 @@ // GB_transpose_op: transpose, typecast, and apply an operator to a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,7 +51,7 @@ GrB_Info GB_transpose_op // transpose, typecast, and apply operator to a matrix bool binop_bind1st, // if true, binop(x,A) else binop(A,y) const GrB_Matrix A, // input matrix // for sparse or hypersparse case: - int64_t *restrict *Workspaces, // Workspaces, size nworkspaces + void **Workspaces, // Workspaces, size nworkspaces const int64_t *restrict A_slice, // how A is sliced, size nthreads+1 int nworkspaces, // # of workspaces to use // for all cases: @@ -77,6 +77,12 @@ GrB_Info GB_transpose_op // transpose, typecast, and apply operator to a matrix ASSERT (!GB_OPCODE_IS_POSITIONAL (opcode)) ; ASSERT (!GB_IS_INDEXUNARYOP_CODE (opcode)) ; + // for the generic kernels below: + bool Cp_is_32 = C->p_is_32 ; + #define GB_Cp_IS_32 Cp_is_32 + #define GB_A_TYPE GB_void + #define GB_C_TYPE GB_void + //-------------------------------------------------------------------------- // transpose the matrix and apply the operator //-------------------------------------------------------------------------- @@ -188,8 +194,6 @@ GrB_Info GB_transpose_op // transpose, typecast, and apply operator to a matrix fop (Cx +((pC)*zsize), xwork) ; \ } - #define GB_A_TYPE GB_void - #define GB_C_TYPE GB_void #include "transpose/template/GB_transpose_template.c" info = GrB_SUCCESS ; } diff --git a/GraphBLAS/Source/transpose/GrB_transpose.c b/GraphBLAS/Source/transpose/GrB_transpose.c index ad1a68ae54..9bc53d382f 100644 --- a/GraphBLAS/Source/transpose/GrB_transpose.c +++ b/GraphBLAS/Source/transpose/GrB_transpose.c @@ -2,7 +2,7 @@ // GrB_transpose: transpose a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,18 +29,18 @@ GrB_Info GrB_transpose // C = accum(C,A') or accum(C,A) // check inputs //-------------------------------------------------------------------------- + GB_RETURN_IF_NULL (C) ; + GB_RETURN_IF_NULL (A) ; + GB_RETURN_IF_OUTPUT_IS_READONLY (C) ; + GB_WHERE3 (C, M_in, A, "GrB_transpose (C, M, accum, A, desc)") ; + GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; + GB_BURBLE_START ("GrB_transpose") ; + struct GB_Matrix_opaque T_header ; GrB_Matrix T = NULL ; // C may be aliased with M and/or A - GB_WHERE (C, "GrB_transpose (C, M, accum, A, desc)") ; - GB_BURBLE_START ("GrB_transpose") ; - GB_RETURN_IF_NULL_OR_FAULTY (C) ; - GB_RETURN_IF_FAULTY (M_in) ; - GB_RETURN_IF_FAULTY_OR_POSITIONAL (accum) ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; - ASSERT_MATRIX_OK (C, "C input for GrB_transpose", GB0) ; ASSERT_MATRIX_OK_OR_NULL (M_in, "M for GrB_transpose", GB0) ; ASSERT_BINARYOP_OK_OR_NULL (accum, "accum for GrB_transpose", GB0) ; @@ -76,7 +76,7 @@ GrB_Info GrB_transpose // C = accum(C,A') or accum(C,A) // T = A or A', where T can have the type of C or the type of A //-------------------------------------------------------------------------- - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; bool C_is_csc = C->is_csc ; if (C_is_csc != A->is_csc) { @@ -123,7 +123,6 @@ GrB_Info GrB_transpose // C = accum(C,A') or accum(C,A) // differ. That can be postponed at no cost since the following step // is free. GBURBLE ("(cheap) ") ; - // set T->iso = A->iso OK GB_OK (GB_shallow_copy (T, C_is_csc, A, Werk)) ; } diff --git a/GraphBLAS/Source/transpose/factory/GB_transpose_bucket_template.c b/GraphBLAS/Source/transpose/factory/GB_transpose_bucket_template.c new file mode 100644 index 0000000000..90b31fe23f --- /dev/null +++ b/GraphBLAS/Source/transpose/factory/GB_transpose_bucket_template.c @@ -0,0 +1,163 @@ +//------------------------------------------------------------------------------ +// GB_transpose_bucket_template: transpose and typecast and/or apply operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Symbolic phase for GB_transpose_bucket. + +{ + + GB_Cp_TYPE *restrict Cp = C->p ; + int64_t nvec_nonempty ; + + if (nthreads == 1) + { + + //---------------------------------------------------------------------- + // sequential method: A is not sliced + //---------------------------------------------------------------------- + + // Only requires a single workspace of size avlen for a single thread. + // The resulting C matrix is not jumbled. + GBURBLE ("(1-thread bucket transpose) ") ; + + // compute the row counts of A. No need to scan the A->p pointers + ASSERT (nworkspaces == 1) ; + + GB_Cp_TYPE *restrict workspace = Workspaces [0] ; + memset (workspace, 0, (avlen + 1) * sizeof (GB_Cp_TYPE)) ; + for (int64_t p = 0 ; p < anz ; p++) + { + int64_t i = GB_IGET (Ai, p) ; + workspace [i]++ ; + } + + // cumulative sum of the workspace, and copy back into C->p + GB_cumsum (workspace, Cp_is_32, avlen, &nvec_nonempty, 1, NULL) ; + memcpy (Cp, workspace, (avlen + 1) * sizeof (GB_Cp_TYPE)) ; + + } + else if (nworkspaces == 1) + { + + //---------------------------------------------------------------------- + // atomic method: A is sliced but workspace is shared + //---------------------------------------------------------------------- + + // Only requires a single workspace of size avlen, shared by all + // threads. Scales well, but requires atomics. If the # of rows is + // very small and the average row degree is high, this can be very slow + // because of contention on the atomic workspace. Otherwise, it is + // typically faster than the non-atomic method. The resulting C matrix + // is jumbled. + + GBURBLE ("(%d-thread atomic bucket transpose) ", nthreads) ; + + // compute the row counts of A. No need to scan the A->p pointers + GB_Cp_TYPE *restrict workspace = Workspaces [0] ; + GB_memset (workspace, 0, (avlen + 1) * sizeof (GB_Cp_TYPE), nth) ; + + int64_t p ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (p = 0 ; p < anz ; p++) + { + int64_t i = GB_IGET (Ai, p) ; + // update workspace [i]++ automically: + GB_ATOMIC_UPDATE + workspace [i]++ ; + } + + C->jumbled = true ; // atomic transpose leaves C jumbled + + // cumulative sum of the workspace, and copy back into C->p + GB_cumsum (workspace, Cp_is_32, avlen, &nvec_nonempty, nth, Werk) ; + GB_memcpy (Cp, workspace, (avlen + 1) * sizeof (GB_Cp_TYPE), nth) ; + + } + else + { + + //---------------------------------------------------------------------- + // non-atomic method + //---------------------------------------------------------------------- + + // compute the row counts of A for each slice, one per thread; This + // method is parallel, but not highly scalable. Each thread requires + // workspace of size avlen, but no atomics are required. The resulting + // C matrix is not jumbled, so this can save work if C needs to be + // unjumbled later. + + GBURBLE ("(%d-thread non-atomic bucket transpose) ", nthreads) ; + + ASSERT (nworkspaces == nthreads) ; + + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + // get the row counts for this slice, of size A->vlen + GB_Cp_TYPE *restrict workspace = Workspaces [tid] ; + memset (workspace, 0, (avlen + 1) * sizeof (GB_Cp_TYPE)) ; + for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) + { + // iterate over the entries in A(:,j); j not itself not needed + int64_t pA_start = GB_IGET (Ap, k) ; + int64_t pA_end = GB_IGET (Ap, k+1) ; + for (int64_t pA = pA_start ; pA < pA_end ; pA++) + { + // count one more entry in C(i,:) for this slice + int64_t i = GB_IGET (Ai, pA) ; + workspace [i]++ ; + } + } + } + + // cumulative sum of the workspaces across the slices + int64_t i ; + #pragma omp parallel for num_threads(nth) schedule(static) + for (i = 0 ; i < avlen ; i++) + { + GB_Cp_TYPE s = 0 ; + for (int tid = 0 ; tid < nthreads ; tid++) + { + GB_Cp_TYPE *restrict workspace = Workspaces [tid] ; + GB_Cp_TYPE c = workspace [i] ; + workspace [i] = s ; + s += c ; + } + Cp [i] = s ; + } + Cp [avlen] = 0 ; + + //---------------------------------------------------------------------- + // compute the vector pointers for C + //---------------------------------------------------------------------- + + GB_cumsum (Cp, Cp_is_32, avlen, &nvec_nonempty, nth, Werk) ; + + //---------------------------------------------------------------------- + // add Cp back to all Workspaces + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nth) schedule(static) + for (i = 0 ; i < avlen ; i++) + { + GB_Cp_TYPE s = Cp [i] ; + GB_Cp_TYPE *restrict workspace = Workspaces [0] ; + workspace [i] = s ; + for (int tid = 1 ; tid < nthreads ; tid++) + { + GB_Cp_TYPE *restrict workspace = Workspaces [tid] ; + workspace [i] += s ; + } + } + } + GB_nvec_nonempty_set (C, nvec_nonempty) ; +} + +#undef GB_Cp_TYPE + diff --git a/GraphBLAS/Source/transpose/template/GB_transpose_bitmap.c b/GraphBLAS/Source/transpose/template/GB_transpose_bitmap.c index bab9511b42..8939c9e81d 100644 --- a/GraphBLAS/Source/transpose/template/GB_transpose_bitmap.c +++ b/GraphBLAS/Source/transpose/template/GB_transpose_bitmap.c @@ -2,7 +2,7 @@ // GB_transpose_bitmap: C=op(cast(A')), transpose, typecast, and apply op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/transpose/template/GB_transpose_full.c b/GraphBLAS/Source/transpose/template/GB_transpose_full.c index aff11b19c5..7cee0e0d86 100644 --- a/GraphBLAS/Source/transpose/template/GB_transpose_full.c +++ b/GraphBLAS/Source/transpose/template/GB_transpose_full.c @@ -2,7 +2,7 @@ // GB_transpose_full: C=op(cast(A')), transpose, typecast, and apply op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,6 +17,7 @@ ASSERT (GB_IS_FULL (A)) ; ASSERT (GB_IS_FULL (C)) ; + #ifndef GB_ISO_TRANSPOSE // A is avlen-by-avdim; C is avdim-by-avlen int64_t avlen = A->vlen ; int64_t avdim = A->vdim ; @@ -26,7 +27,6 @@ // for large matrices, but in most of the cases in GraphBLAS, A and // C will be tall-and-thin or short-and-fat. - #ifndef GB_ISO_TRANSPOSE int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (tid = 0 ; tid < nthreads ; tid++) diff --git a/GraphBLAS/Source/transpose/template/GB_transpose_sparse.c b/GraphBLAS/Source/transpose/template/GB_transpose_sparse.c index 7c16cb48dd..8b68fa2c68 100644 --- a/GraphBLAS/Source/transpose/template/GB_transpose_sparse.c +++ b/GraphBLAS/Source/transpose/template/GB_transpose_sparse.c @@ -2,7 +2,7 @@ // GB_transpose_sparse: C=op(cast(A')), transpose, typecast, and apply op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,106 +16,17 @@ ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; ASSERT (GB_IS_SPARSE (C)) ; - const int64_t *restrict Ap = A->p ; - const int64_t *restrict Ah = A->h ; - const int64_t *restrict Ai = A->i ; - const int64_t anvec = A->nvec ; - int64_t *restrict Ci = C->i ; - - if (nthreads == 1) - { - - //------------------------------------------------------------------ - // sequential method - //------------------------------------------------------------------ - - int64_t *restrict workspace = Workspaces [0] ; - for (int64_t k = 0 ; k < anvec ; k++) - { - // iterate over the entries in A(:,j) - int64_t j = GBH_AB (Ah, k) ; - int64_t pA_start = Ap [k] ; - int64_t pA_end = Ap [k+1] ; - for (int64_t pA = pA_start ; pA < pA_end ; pA++) - { - // C(j,i) = A(i,j) - int64_t i = Ai [pA] ; - int64_t pC = workspace [i]++ ; - Ci [pC] = j ; - #ifndef GB_ISO_TRANSPOSE - // Cx [pC] = op (Ax [pA]) - GB_APPLY_OP (pC, pA) ; - #endif - } - } - - } - else if (nworkspaces == 1) - { - - //------------------------------------------------------------------ - // atomic method - //------------------------------------------------------------------ - - int64_t *restrict workspace = Workspaces [0] ; - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) - { - // iterate over the entries in A(:,j) - int64_t j = GBH_AB (Ah, k) ; - int64_t pA_start = Ap [k] ; - int64_t pA_end = Ap [k+1] ; - for (int64_t pA = pA_start ; pA < pA_end ; pA++) - { - // C(j,i) = A(i,j) - int64_t i = Ai [pA] ; - // do this atomically: pC = workspace [i]++ - int64_t pC ; - GB_ATOMIC_CAPTURE_INC64 (pC, workspace [i]) ; - Ci [pC] = j ; - #ifndef GB_ISO_TRANSPOSE - // Cx [pC] = op (Ax [pA]) - GB_APPLY_OP (pC, pA) ; - #endif - } - } - } - + if (GB_Cp_IS_32) + { + #define GB_W_TYPE uint32_t + #define GB_ATOMIC_CAPTURE_INC(r,t) GB_ATOMIC_CAPTURE_INC32(r,t) + #include "template/GB_transpose_sparse_template.c" } else { - - //------------------------------------------------------------------ - // non-atomic method - //------------------------------------------------------------------ - - int tid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (tid = 0 ; tid < nthreads ; tid++) - { - int64_t *restrict workspace = Workspaces [tid] ; - for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) - { - // iterate over the entries in A(:,j) - int64_t j = GBH_AB (Ah, k) ; - int64_t pA_start = Ap [k] ; - int64_t pA_end = Ap [k+1] ; - for (int64_t pA = pA_start ; pA < pA_end ; pA++) - { - // C(j,i) = A(i,j) - int64_t i = Ai [pA] ; - int64_t pC = workspace [i]++ ; - Ci [pC] = j ; - #ifndef GB_ISO_TRANSPOSE - // Cx [pC] = op (Ax [pA]) - GB_APPLY_OP (pC, pA) ; - #endif - } - } - } + #define GB_W_TYPE uint64_t + #define GB_ATOMIC_CAPTURE_INC(r,t) GB_ATOMIC_CAPTURE_INC64(r,t) + #include "template/GB_transpose_sparse_template.c" } } diff --git a/GraphBLAS/Source/transpose/template/GB_transpose_sparse_template.c b/GraphBLAS/Source/transpose/template/GB_transpose_sparse_template.c new file mode 100644 index 0000000000..a7e1345998 --- /dev/null +++ b/GraphBLAS/Source/transpose/template/GB_transpose_sparse_template.c @@ -0,0 +1,140 @@ +//------------------------------------------------------------------------------ +// GB_transpose_sparse_template: C=op(cast(A')), transpose, typecast, & apply op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + #undef GBh_AB + #ifdef GB_BIND_1ST + // see discussion in GB_transpose_template.c + GB_Bp_DECLARE (Ap, const) ; GB_Bp_PTR (Ap, A) ; + GB_Bh_DECLARE (Ah, const) ; GB_Bh_PTR (Ah, A) ; + GB_Bi_DECLARE (Ai, const) ; GB_Bi_PTR (Ai, A) ; + #define GBh_AB(Ah,k) GBh_B(Ah,k) + #else + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Ai_DECLARE (Ai, const) ; GB_Ai_PTR (Ai, A) ; + #define GBh_AB(Ah,k) GBh_A(Ah,k) + #endif + GB_Ci_DECLARE (Ci, ) ; GB_Ci_PTR (Ci, C) ; + + //-------------------------------------------------------------------------- + // C = A' + //-------------------------------------------------------------------------- + + if (nthreads == 1) + { + + //---------------------------------------------------------------------- + // sequential method + //---------------------------------------------------------------------- + + // Cp and workspace are of type GB_W_TYPE + GB_W_TYPE *restrict workspace = (GB_W_TYPE *) (Workspaces [0]) ; + const int64_t anvec = A->nvec ; + for (int64_t k = 0 ; k < anvec ; k++) + { + // iterate over the entries in A(:,j) + int64_t j = GBh_AB (Ah, k) ; + int64_t pA_start = GB_IGET (Ap, k) ; + int64_t pA_end = GB_IGET (Ap, k+1) ; + for (int64_t pA = pA_start ; pA < pA_end ; pA++) + { + // C(j,i) = A(i,j) + int64_t i = GB_IGET (Ai, pA) ; + GB_W_TYPE pC = workspace [i]++ ; + // Ci [pC] = j ; + GB_ISET (Ci, pC, j) ; + #ifndef GB_ISO_TRANSPOSE + // Cx [pC] = op (Ax [pA]) + GB_APPLY_OP (pC, pA) ; + #endif + } + } + + } + else if (nworkspaces == 1) + { + + //---------------------------------------------------------------------- + // atomic method + //---------------------------------------------------------------------- + + GB_W_TYPE *restrict workspace = (GB_W_TYPE *) (Workspaces [0]) ; + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) + { + // iterate over the entries in A(:,j) + int64_t j = GBh_AB (Ah, k) ; + int64_t pA_start = GB_IGET (Ap, k) ; + int64_t pA_end = GB_IGET (Ap, k+1) ; + for (int64_t pA = pA_start ; pA < pA_end ; pA++) + { + // C(j,i) = A(i,j) + int64_t i = GB_IGET (Ai, pA) ; + // do this atomically: pC = workspace [i]++ + GB_W_TYPE pC ; + GB_ATOMIC_CAPTURE_INC (pC, workspace [i]) ; + // Ci [pC] = j ; + GB_ISET (Ci, pC, j) ; + #ifndef GB_ISO_TRANSPOSE + // Cx [pC] = op (Ax [pA]) + GB_APPLY_OP (pC, pA) ; + #endif + } + } + } + + } + else + { + + //---------------------------------------------------------------------- + // non-atomic method + //---------------------------------------------------------------------- + + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + GB_W_TYPE *restrict workspace = (GB_W_TYPE *) (Workspaces [tid]) ; + for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) + { + // iterate over the entries in A(:,j) + int64_t j = GBh_AB (Ah, k) ; + int64_t pA_start = GB_IGET (Ap, k) ; + int64_t pA_end = GB_IGET (Ap, k+1) ; + for (int64_t pA = pA_start ; pA < pA_end ; pA++) + { + // C(j,i) = A(i,j) + int64_t i = GB_IGET (Ai, pA) ; + GB_W_TYPE pC = workspace [i]++ ; + // Ci [pC] = j ; + GB_ISET (Ci, pC, j) ; + #ifndef GB_ISO_TRANSPOSE + // Cx [pC] = op (Ax [pA]) + GB_APPLY_OP (pC, pA) ; + #endif + } + } + } + } +} + +#undef GB_W_TYPE +#undef GB_ATOMIC_CAPTURE_INC +#undef GBh_AB + diff --git a/GraphBLAS/Source/transpose/template/GB_transpose_template.c b/GraphBLAS/Source/transpose/template/GB_transpose_template.c index 1a1a2f8578..b9ce20fa27 100644 --- a/GraphBLAS/Source/transpose/template/GB_transpose_template.c +++ b/GraphBLAS/Source/transpose/template/GB_transpose_template.c @@ -2,39 +2,32 @@ // GB_transpose_template: C=op(cast(A')), transpose, typecast, and apply op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ { - // Ax unused for some uses of this template - #include "include/GB_unused.h" - //-------------------------------------------------------------------------- // get A and C //-------------------------------------------------------------------------- - #undef GBH_AB #undef GB_AB_TYPE - #ifdef GB_BIND_1ST // A is the name of the matrix passed in to this kernel, but it takes // the place of the B matrix for C=op(x,A'). As a result, the B macros // must be used to access its contents. - #define GBH_AB(Ah,k) GBH_B(Ah,k) #define GB_AB_TYPE GB_B_TYPE #else // for bind2nd, unary ops, and mere typecasting, use the A macros to // access the A matrix. - #define GBH_AB(Ah,k) GBH_A(Ah,k) #define GB_AB_TYPE GB_A_TYPE #endif #ifndef GB_ISO_TRANSPOSE const GB_AB_TYPE *restrict Ax = (GB_AB_TYPE *) A->x ; - GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif //-------------------------------------------------------------------------- @@ -86,6 +79,5 @@ } #undef GB_ISO_TRANSPOSE -#undef GBH_AB #undef GB_AB_TYPE diff --git a/GraphBLAS/Source/type/GB_code_size.c b/GraphBLAS/Source/type/GB_code_size.c index a22cef119b..a35b4c845a 100644 --- a/GraphBLAS/Source/type/GB_code_size.c +++ b/GraphBLAS/Source/type/GB_code_size.c @@ -2,7 +2,7 @@ // GB_code_size: given a type code, return sizeof (type) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GB_code_string.c b/GraphBLAS/Source/type/GB_code_string.c index 8178475cde..bf5ef657c2 100644 --- a/GraphBLAS/Source/type/GB_code_string.c +++ b/GraphBLAS/Source/type/GB_code_string.c @@ -2,7 +2,7 @@ // GB_code_string: convert a type code into a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GB_code_type.c b/GraphBLAS/Source/type/GB_code_type.c index 918056a3be..5a8d440df9 100644 --- a/GraphBLAS/Source/type/GB_code_type.c +++ b/GraphBLAS/Source/type/GB_code_type.c @@ -2,7 +2,7 @@ // GB_code_type: convert a type code to a GrB_Type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GB_matvec_type.c b/GraphBLAS/Source/type/GB_matvec_type.c index 43c8b9f399..ebdfbbf7b8 100644 --- a/GraphBLAS/Source/type/GB_matvec_type.c +++ b/GraphBLAS/Source/type/GB_matvec_type.c @@ -2,7 +2,7 @@ // GB_matvec_type: return the type of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GB_matvec_type_name.c b/GraphBLAS/Source/type/GB_matvec_type_name.c index b326453bab..0a75ef0a4f 100644 --- a/GraphBLAS/Source/type/GB_matvec_type_name.c +++ b/GraphBLAS/Source/type/GB_matvec_type_name.c @@ -2,7 +2,7 @@ // GB_matvec_type_name: return the name of the type of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GB_type.h b/GraphBLAS/Source/type/GB_type.h index e729a176b9..0165cc4a10 100644 --- a/GraphBLAS/Source/type/GB_type.h +++ b/GraphBLAS/Source/type/GB_type.h @@ -2,7 +2,7 @@ // GB_type.h: definitions for GrB_Type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GrB_Type_free.c b/GraphBLAS/Source/type/GrB_Type_free.c index b12b9c3603..020ab286cb 100644 --- a/GraphBLAS/Source/type/GrB_Type_free.c +++ b/GraphBLAS/Source/type/GrB_Type_free.c @@ -2,7 +2,7 @@ // GrB_Type_free: free a user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,18 +21,18 @@ GrB_Info GrB_Type_free // free a user-defined type GrB_Type t = *type ; if (t != NULL) { - GB_FREE (&(t->user_name), t->user_name_size) ; + GB_FREE_MEMORY (&(t->user_name), t->user_name_size) ; size_t defn_size = t->defn_size ; if (defn_size > 0) { - GB_FREE (&(t->defn), defn_size) ; + GB_FREE_MEMORY (&(t->defn), defn_size) ; } size_t header_size = t->header_size ; if (header_size > 0) { t->magic = GB_FREED ; // to help detect dangling pointers t->header_size = 0 ; - GB_FREE (type, header_size) ; + GB_FREE_MEMORY (type, header_size) ; } } } diff --git a/GraphBLAS/Source/type/GrB_Type_new.c b/GraphBLAS/Source/type/GrB_Type_new.c index dcb7f242d0..73d75c67f9 100644 --- a/GraphBLAS/Source/type/GrB_Type_new.c +++ b/GraphBLAS/Source/type/GrB_Type_new.c @@ -2,7 +2,7 @@ // GrB_Type_new: create a new user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/GxB_Matrix_type.c b/GraphBLAS/Source/type/GxB_Matrix_type.c index c800026421..2d43ad0dbf 100644 --- a/GraphBLAS/Source/type/GxB_Matrix_type.c +++ b/GraphBLAS/Source/type/GxB_Matrix_type.c @@ -2,13 +2,11 @@ // GxB_Matrix_type: return the type of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// NOTE: this function is historical. Use GxB_Matrix_type_name instead. - #include "GB.h" GrB_Info GxB_Matrix_type // get the type of a matrix @@ -22,8 +20,8 @@ GrB_Info GxB_Matrix_type // get the type of a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_type (&type, A)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GxB_Matrix_type (&type, A)") ; //-------------------------------------------------------------------------- // get the type diff --git a/GraphBLAS/Source/type/GxB_Matrix_type_name.c b/GraphBLAS/Source/type/GxB_Matrix_type_name.c index 61b019071b..fe317552d3 100644 --- a/GraphBLAS/Source/type/GxB_Matrix_type_name.c +++ b/GraphBLAS/Source/type/GxB_Matrix_type_name.c @@ -2,7 +2,7 @@ // GxB_Matrix_type_name: return the name of the type of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,8 @@ GrB_Info GxB_Matrix_type_name // return the name of the type of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Matrix_type_name (type_name, A)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE_1 (A, "GxB_Matrix_type_name (type_name, A)") ; //-------------------------------------------------------------------------- // get the type_name diff --git a/GraphBLAS/Source/type/GxB_Scalar_type.c b/GraphBLAS/Source/type/GxB_Scalar_type.c index c33bf45a1e..b22acce7c6 100644 --- a/GraphBLAS/Source/type/GxB_Scalar_type.c +++ b/GraphBLAS/Source/type/GxB_Scalar_type.c @@ -2,13 +2,11 @@ // GxB_Scalar_type: return the type of a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// NOTE: this function is historical. Use GxB_Scalar_type_name instead. - #include "GB.h" GrB_Info GxB_Scalar_type // get the type of a GrB_Scalar @@ -22,8 +20,8 @@ GrB_Info GxB_Scalar_type // get the type of a GrB_Scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Scalar_type (&type, s)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (s) ; + GB_WHERE_1 (s, "GxB_Scalar_type (&type, s)") ; //-------------------------------------------------------------------------- // get the type diff --git a/GraphBLAS/Source/type/GxB_Scalar_type_name.c b/GraphBLAS/Source/type/GxB_Scalar_type_name.c index 3efb877f47..3fdcb37917 100644 --- a/GraphBLAS/Source/type/GxB_Scalar_type_name.c +++ b/GraphBLAS/Source/type/GxB_Scalar_type_name.c @@ -2,7 +2,7 @@ // GxB_Scalar_type_name: return the name of the type of a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,8 @@ GrB_Info GxB_Scalar_type_name // return the name of the type of a scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Scalar_type_name (type_name, s)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (s) ; + GB_WHERE_1 (s, "GxB_Scalar_type_name (type_name, s)") ; //-------------------------------------------------------------------------- // get the type_name diff --git a/GraphBLAS/Source/type/GxB_Type_from_name.c b/GraphBLAS/Source/type/GxB_Type_from_name.c index 57d02ed6d5..e97611bbd7 100644 --- a/GraphBLAS/Source/type/GxB_Type_from_name.c +++ b/GraphBLAS/Source/type/GxB_Type_from_name.c @@ -2,7 +2,7 @@ // GxB_Type_from_name: return a built-in GrB_Type from its name //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -58,10 +58,8 @@ // corresponding GrB_Type with tests such as the ones below, or in the example // above. This cannot be safely done with GxB_Matrix_type. -// As a result, the GxB_Matrix_type function that appears in SuiteSparse -// GraphBLAS has been declared "historical" and its use is discouraged. It -// won't be removed, to preserve backward compatibility, but it is removed from -// the user guide. Use the string-based type mechanism instead. +// However, GxB_Matrix_Type is still very useful when the caller function is in +// the same process that created the matrix. #include "GB.h" diff --git a/GraphBLAS/Source/type/GxB_Type_name.c b/GraphBLAS/Source/type/GxB_Type_name.c index d73c89ba18..1ca88ceda6 100644 --- a/GraphBLAS/Source/type/GxB_Type_name.c +++ b/GraphBLAS/Source/type/GxB_Type_name.c @@ -2,7 +2,7 @@ // GxB_Type_name: return the name of a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_Type_name // return the name of a GraphBLAS type // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Type_name (type_name, type)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; diff --git a/GraphBLAS/Source/type/GxB_Type_new.c b/GraphBLAS/Source/type/GxB_Type_new.c index e2209e8c86..8a8d440b19 100644 --- a/GraphBLAS/Source/type/GxB_Type_new.c +++ b/GraphBLAS/Source/type/GxB_Type_new.c @@ -2,7 +2,7 @@ // GxB_Type_new: create a new user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -49,9 +49,11 @@ GrB_Info GxB_Type_new // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Type_new (&type, sizeof (ctype), type_name, type_defn)") ; - GB_BURBLE_START ("GxB_Type_new") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type) ; + GB_BURBLE_START ("GxB_Type_new") ; + + GrB_Info info ; (*type) = NULL ; if (sizeof_type == 0 && (type_defn == NULL || type_name == NULL)) @@ -67,7 +69,8 @@ GrB_Info GxB_Type_new // allocate the type size_t header_size ; - GrB_Type t = GB_MALLOC (1, struct GB_Type_opaque, &header_size) ; + GrB_Type t = GB_MALLOC_MEMORY (1, sizeof (struct GB_Type_opaque), + &header_size) ; if (t == NULL) { // out of memory @@ -113,11 +116,12 @@ GrB_Info GxB_Type_new size_t defn_len = strlen (type_defn) ; // allocate space for the typedef - t->defn = GB_MALLOC (defn_len+1, char, &(t->defn_size)) ; + t->defn = GB_MALLOC_MEMORY (defn_len+1, sizeof (char), + &(t->defn_size)) ; if (t->defn == NULL) { // out of memory - GB_FREE (&t, header_size) ; + GB_FREE_MEMORY (&t, header_size) ; return (GrB_OUT_OF_MEMORY) ; } @@ -134,7 +138,7 @@ GrB_Info GxB_Type_new if (sizeof_type == 0) { - GrB_Info info = GB_user_type_jit (&sizeof_type, t) ; + info = GB_user_type_jit (&sizeof_type, t) ; if (info != GrB_SUCCESS) { // unable to determine the type size diff --git a/GraphBLAS/Source/type/GxB_Type_size.c b/GraphBLAS/Source/type/GxB_Type_size.c index 9e1d73e028..8defdd4e5f 100644 --- a/GraphBLAS/Source/type/GxB_Type_size.c +++ b/GraphBLAS/Source/type/GxB_Type_size.c @@ -2,7 +2,7 @@ // GxB_Type_size: return the size of a type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ GrB_Info GxB_Type_size // determine the size of the type // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Type_size (&size, type)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (size) ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; diff --git a/GraphBLAS/Source/type/GxB_Vector_type.c b/GraphBLAS/Source/type/GxB_Vector_type.c index 0e9c6c5414..4a48f9d273 100644 --- a/GraphBLAS/Source/type/GxB_Vector_type.c +++ b/GraphBLAS/Source/type/GxB_Vector_type.c @@ -2,13 +2,11 @@ // GxB_Vector_type: return the type of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// NOTE: this function is historical. Use GxB_Vector_type_name instead. - #include "GB.h" GrB_Info GxB_Vector_type // get the type of a vector @@ -22,8 +20,8 @@ GrB_Info GxB_Vector_type // get the type of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_type (&type, v)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE_1 (v, "GxB_Vector_type (&type, v)") ; //-------------------------------------------------------------------------- // get the type diff --git a/GraphBLAS/Source/type/GxB_Vector_type_name.c b/GraphBLAS/Source/type/GxB_Vector_type_name.c index 185d8a62a7..f336ff2ff0 100644 --- a/GraphBLAS/Source/type/GxB_Vector_type_name.c +++ b/GraphBLAS/Source/type/GxB_Vector_type_name.c @@ -2,7 +2,7 @@ // GxB_Vector_type_name: return the name of the type of a vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,8 +21,8 @@ GrB_Info GxB_Vector_type_name // return the name of the type of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Vector_type_name (type_name, v)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE_1 (v, "GxB_Vector_type_name (type_name, v)") ; //-------------------------------------------------------------------------- // get the type_name diff --git a/GraphBLAS/Source/type/include/GB_bytes.h b/GraphBLAS/Source/type/include/GB_bytes.h index ce061dd56d..f66e79c675 100644 --- a/GraphBLAS/Source/type/include/GB_bytes.h +++ b/GraphBLAS/Source/type/include/GB_bytes.h @@ -2,7 +2,7 @@ // GB_bytes.h: sizes of built-in types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/type/include/GB_pun.h b/GraphBLAS/Source/type/include/GB_pun.h index 30c1d0e34c..4a1d8e5920 100644 --- a/GraphBLAS/Source/type/include/GB_pun.h +++ b/GraphBLAS/Source/type/include/GB_pun.h @@ -2,7 +2,7 @@ // GB_pun.h: type punning //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/unaryop/GB_unop.h b/GraphBLAS/Source/unaryop/GB_unop.h index b1b7f19221..bf2de2a8d5 100644 --- a/GraphBLAS/Source/unaryop/GB_unop.h +++ b/GraphBLAS/Source/unaryop/GB_unop.h @@ -2,7 +2,7 @@ // GB_unop.h: definitions for unary operators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/unaryop/GB_unop_identity.c b/GraphBLAS/Source/unaryop/GB_unop_identity.c index 0d476cf6c4..a2beb44b2f 100644 --- a/GraphBLAS/Source/unaryop/GB_unop_identity.c +++ b/GraphBLAS/Source/unaryop/GB_unop_identity.c @@ -2,7 +2,7 @@ // GB_unop_identity: return an identity unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,6 @@ #include "GB.h" #include "unaryop/GB_unop.h" -#include "include/GB_unused.h" GB_Operator GB_unop_identity // return IDENTITY operator, or NULL on error ( @@ -45,7 +44,10 @@ GB_Operator GB_unop_identity // return IDENTITY operator, or NULL on error if (op == NULL) return (NULL) ; // op = &op_header has been provided by the caller op->header_size = 0 ; - GrB_Info info = GB_unop_new (op, + #ifdef GB_DEBUG + GrB_Info info = + #endif + GB_unop_new (op, NULL, // op->unop_function is NULL for IDENTITY_UDT type, type, // type is user-defined type->name, // name is same as the type diff --git a/GraphBLAS/Source/unaryop/GB_unop_new.c b/GraphBLAS/Source/unaryop/GB_unop_new.c index 596802f594..02b3923e54 100644 --- a/GraphBLAS/Source/unaryop/GB_unop_new.c +++ b/GraphBLAS/Source/unaryop/GB_unop_new.c @@ -2,7 +2,7 @@ // GB_unop_new: create a new named unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,6 +51,10 @@ GrB_Info GB_unop_new op->unop_function = function ; // NULL for IDENTITY_UDT operator op->idxunop_function = NULL ; op->binop_function = NULL ; + op->idxbinop_function = NULL ; + op->theta_type = NULL ; + op->theta = NULL ; + op->theta_size = 0 ; op->opcode = opcode ; diff --git a/GraphBLAS/Source/unaryop/GB_unop_one.c b/GraphBLAS/Source/unaryop/GB_unop_one.c index 8c903c56f5..aebb0cab36 100644 --- a/GraphBLAS/Source/unaryop/GB_unop_one.c +++ b/GraphBLAS/Source/unaryop/GB_unop_one.c @@ -2,7 +2,7 @@ // GB_unop_one: return the ONE operator for a given type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/unaryop/GrB_UnaryOp_free.c b/GraphBLAS/Source/unaryop/GrB_UnaryOp_free.c index 8065436a70..fb35fe5738 100644 --- a/GraphBLAS/Source/unaryop/GrB_UnaryOp_free.c +++ b/GraphBLAS/Source/unaryop/GrB_UnaryOp_free.c @@ -2,7 +2,7 @@ // GrB_UnaryOp_free: free a unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/unaryop/GrB_UnaryOp_new.c b/GraphBLAS/Source/unaryop/GrB_UnaryOp_new.c index bf4c77860c..0287b6794b 100644 --- a/GraphBLAS/Source/unaryop/GrB_UnaryOp_new.c +++ b/GraphBLAS/Source/unaryop/GrB_UnaryOp_new.c @@ -2,7 +2,7 @@ // GrB_UnaryOp_new: create a new user-defined unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/unaryop/GxB_UnaryOp_new.c b/GraphBLAS/Source/unaryop/GxB_UnaryOp_new.c index d9a0bfd5a3..743a4e1223 100644 --- a/GraphBLAS/Source/unaryop/GxB_UnaryOp_new.c +++ b/GraphBLAS/Source/unaryop/GxB_UnaryOp_new.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_new: create a new named unary operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_UnaryOp_new (op, function, ztype, xtype, name, defn)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (op_handle) ; (*op_handle) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (ztype) ; @@ -42,7 +42,8 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator // allocate the unary operator size_t header_size ; - GrB_UnaryOp op = GB_CALLOC (1, struct GB_UnaryOp_opaque, &header_size) ; + GrB_UnaryOp op = GB_CALLOC_MEMORY (1, sizeof (struct GB_UnaryOp_opaque), + &header_size) ; if (op == NULL) { // out of memory @@ -57,7 +58,7 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator if (info != GrB_SUCCESS) { // out of memory - GB_FREE (&op, header_size) ; + GB_FREE_MEMORY (&op, header_size) ; return (info) ; } @@ -79,6 +80,7 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator // and cannot be compiled by the JIT). return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } + #include "include/GB_pedantic_disable.h" op->unop_function = (GxB_unary_function) user_function ; GB_BURBLE_END ; } diff --git a/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype.c b/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype.c index 22728a8d02..fdead859cc 100644 --- a/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype.c +++ b/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_xtype: return the type of x for z=f(x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_UnaryOp_xtype // return the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_UnaryOp_xtype (&xtype, unaryop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (xtype) ; GB_RETURN_IF_NULL_OR_FAULTY (unaryop) ; ASSERT_UNARYOP_OK (unaryop, "unaryop for xtype", GB0) ; diff --git a/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype_name.c b/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype_name.c index 375c8700e1..d5ce41a30d 100644 --- a/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype_name.c +++ b/GraphBLAS/Source/unaryop/GxB_UnaryOp_xtype_name.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_xtype_name: return the type_name of x for z=f(x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_UnaryOp_xtype_name // return the name of the type of x // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_UnaryOp_xtype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (unaryop) ; ASSERT_UNARYOP_OK (unaryop, "unaryop for xtype_name", GB0) ; diff --git a/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype.c b/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype.c index 4e5ea5fc70..e498a1708a 100644 --- a/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype.c +++ b/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_ztype: return the type of z for z=f(x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ GrB_Info GxB_UnaryOp_ztype // return the type of z // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_UnaryOp_ztype (&ztype, unaryop)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (ztype) ; GB_RETURN_IF_NULL_OR_FAULTY (unaryop) ; ASSERT_UNARYOP_OK (unaryop, "unaryop for ztype", GB0) ; diff --git a/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype_name.c b/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype_name.c index 35921ecef7..c95ce3d460 100644 --- a/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype_name.c +++ b/GraphBLAS/Source/unaryop/GxB_UnaryOp_ztype_name.c @@ -2,7 +2,7 @@ // GxB_UnaryOp_ztype_name: return the type_name of z for z=f(x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ GrB_Info GxB_UnaryOp_ztype_name // return the name of the type of z // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_UnaryOp_ztype_name (type_name, op)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (type_name) ; GB_RETURN_IF_NULL_OR_FAULTY (unaryop) ; ASSERT_UNARYOP_OK (unaryop, "unaryop for ztype_name", GB0) ; diff --git a/GraphBLAS/Source/vector/GrB_Vector_free.c b/GraphBLAS/Source/vector/GrB_Vector_free.c index 90f544d458..5b04b1cf70 100644 --- a/GraphBLAS/Source/vector/GrB_Vector_free.c +++ b/GraphBLAS/Source/vector/GrB_Vector_free.c @@ -2,13 +2,14 @@ // GrB_Vector_free: free a sparse vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ // free all the content of a vector. After GrB_Vector_free (&v), v is set -// to NULL +// to NULL. The vector may have readonly content; it is simply removed from s +// and not modified. #include "GB.h" diff --git a/GraphBLAS/Source/vector/GrB_Vector_new.c b/GraphBLAS/Source/vector/GrB_Vector_new.c index f16d82b2de..f84de69e8e 100644 --- a/GraphBLAS/Source/vector/GrB_Vector_new.c +++ b/GraphBLAS/Source/vector/GrB_Vector_new.c @@ -2,7 +2,7 @@ // GrB_Vector_new: create a new vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,11 +14,13 @@ #include "GB.h" +#define GB_FREE_ALL GB_Matrix_free ((GrB_Matrix *) v) ; + GrB_Info GrB_Vector_new // create a new vector with no entries ( GrB_Vector *v, // handle of vector to create GrB_Type type, // type of vector to create - GrB_Index n // dimension is n-by-1 + uint64_t n // dimension is n-by-1 ) { @@ -26,7 +28,8 @@ GrB_Info GrB_Vector_new // create a new vector with no entries // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_new (&v, type, n)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (v) ; (*v) = NULL ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; @@ -41,14 +44,19 @@ GrB_Info GrB_Vector_new // create a new vector with no entries // create the vector //-------------------------------------------------------------------------- - GrB_Info info ; int64_t vlen = (int64_t) n ; - info = GB_new ((GrB_Matrix *) v, // new user header - type, vlen, 1, GB_Ap_calloc, + // determine the p_is_32, j_is_32, and i_is_32 settings for the new vector + bool Vp_is_32, Vj_is_32, Vi_is_32 ; + GB_determine_pji_is_32 (&Vp_is_32, &Vj_is_32, &Vi_is_32, + GxB_SPARSE, 1, vlen, 1, NULL) ; + + GB_OK (GB_new ((GrB_Matrix *) v, // new user header + type, vlen, 1, GB_ph_calloc, true, // a GrB_Vector is always held by-column - GxB_SPARSE, GB_Global_hyper_switch_get ( ), 1) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, GB_VECTOR_OK (*v))) ; - return (info) ; + GxB_SPARSE, GB_Global_hyper_switch_get ( ), 1, + Vp_is_32, Vj_is_32, Vi_is_32)) ; + + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/vector/GrB_Vector_size.c b/GraphBLAS/Source/vector/GrB_Vector_size.c index 607cdf01e0..632657f85c 100644 --- a/GraphBLAS/Source/vector/GrB_Vector_size.c +++ b/GraphBLAS/Source/vector/GrB_Vector_size.c @@ -2,7 +2,7 @@ // GrB_Vector_size: dimension of a sparse vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,7 +11,7 @@ GrB_Info GrB_Vector_size // get the dimension of a vector ( - GrB_Index *n, // dimension is n-by-1 + uint64_t *n, // dimension is n-by-1 const GrB_Vector v // vector to query ) { @@ -20,9 +20,10 @@ GrB_Info GrB_Vector_size // get the dimension of a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Vector_size (&n, v)") ; + GrB_Info info ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL (n) ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL_OR_INVALID (v) ; ASSERT (GB_VECTOR_OK (v)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GB_block.c b/GraphBLAS/Source/wait/GB_block.c index 0169b18b81..c1cb5757e5 100644 --- a/GraphBLAS/Source/wait/GB_block.c +++ b/GraphBLAS/Source/wait/GB_block.c @@ -2,7 +2,7 @@ // GB_block: apply all pending computations if blocking mode enabled //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,7 @@ GrB_Info GB_block // apply all pending computations if blocking mode enabled double npending = (double) GB_Pending_n (A) ; double anzmax = ((double) A->vlen) * ((double) A->vdim) ; bool many_pending = (npending >= anzmax) ; - GrB_Mode mode = GB_Global_mode_get ( ) ; + int mode = GB_Global_mode_get ( ) ; bool blocking = (mode == GrB_BLOCKING || mode == GxB_BLOCKING_GPU) ; if (many_pending || blocking) @@ -48,6 +48,7 @@ GrB_Info GB_block // apply all pending computations if blocking mode enabled GB_OK (GB_wait (A, "matrix", Werk)) ; GB_OK (GB_hyper_hash_build (A, Werk)) ; } + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/wait/GB_jappend.h b/GraphBLAS/Source/wait/GB_jappend.h deleted file mode 100644 index 7261a36d1c..0000000000 --- a/GraphBLAS/Source/wait/GB_jappend.h +++ /dev/null @@ -1,171 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_jappend.h: definitions of GB_jappend, and GB_jwrapup -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// These methods are now only used by GB_wait. - -#ifndef GB_JAPPEND_H -#define GB_JAPPEND_H -#include "GB.h" - -//------------------------------------------------------------------------------ -// GB_jappend: append a new vector to the end of a matrix -//------------------------------------------------------------------------------ - -// Append a new vector to the end of a matrix C. - -// If C->h != NULL, C is in hypersparse form with -// C->nvec <= C->plen <= C->vdim. C->h has size C->plen. - -// If C->h == NULL, C is in non-hypersparse form with -// C->nvec == C->plen == C->vdim. C->h is NULL. -// In both cases, C->p has size C->plen+1. - -static inline GrB_Info GB_jappend -( - GrB_Matrix C, // matrix to append vector j to - int64_t j, // new vector to append - int64_t *jlast, // last vector appended, -1 if none - int64_t cnz, // nnz(C) after adding this vector j - int64_t *cnz_last, // nnz(C) before adding this vector j - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - ASSERT (C != NULL) ; - ASSERT (!C->p_shallow) ; - ASSERT (!C->h_shallow) ; - ASSERT (C->p != NULL) ; - ASSERT (!GB_IS_FULL (C)) ; - - if (cnz <= (*cnz_last)) - { - // nothing to do - return (GrB_SUCCESS) ; - } - - // one more non-empty vector - C->nvec_nonempty++ ; - - if (C->h != NULL) - { - - //---------------------------------------------------------------------- - // C is hypersparse; make sure space exists in the hyperlist - //---------------------------------------------------------------------- - - ASSERT (C->p [C->nvec] == (*cnz_last)) ; - ASSERT (C->h != NULL) ; - - // check if space exists - if (C->nvec == C->plen) - { - // double the size of C->h and C->p - GrB_Info info ; - info = GB_hyper_realloc (C, GB_IMIN (C->vdim, 2*(C->plen+1)), - Werk) ; - if (info != GrB_SUCCESS) - { - // out of memory - return (info) ; - } - } - - ASSERT (C->nvec >= 0) ; - ASSERT (C->nvec < C->plen) ; - ASSERT (C->plen <= C->vdim) ; - ASSERT (C->p [C->nvec] == (*cnz_last)) ; - - // add j to the hyperlist - C->h [C->nvec] = j ; - - // mark the end of C(:,j) - C->p [C->nvec+1] = cnz ; - C->nvec++ ; // one more vector in the hyperlist - - } - else - { - - //---------------------------------------------------------------------- - // C is non-hypersparse - //---------------------------------------------------------------------- - - int64_t *restrict Cp = C->p ; - - ASSERT (C->nvec == C->plen && C->plen == C->vdim) ; - ASSERT (C->h == NULL) ; - ASSERT (Cp [(*jlast)+1] == (*cnz_last)) ; - - // Even if C is non-hypersparse, the iteration that uses this function - // may iterate over a hypersparse input matrix, so not every vector j - // will be traversed. So when j is seen, the end of vectors jlast+1 to - // j must logged in Cp. - - for (int64_t jprior = (*jlast)+1 ; jprior < j ; jprior++) - { - // mark the end of C(:,jprior) - Cp [jprior+1] = (*cnz_last) ; - } - // mark the end of C(:,j) - Cp [j+1] = cnz ; - } - - // record the last vector added to C - (*cnz_last) = cnz ; - (*jlast) = j ; - - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// GB_jwrapup: finish contructing a new matrix -//------------------------------------------------------------------------------ - -// Log the end of any vectors in C that are not yet terminated. Nothing -// happens if C is hypersparse (except for setting C->magic). - -static inline void GB_jwrapup -( - GrB_Matrix C, // matrix to finish - int64_t jlast, // last vector appended, -1 if none - int64_t cnz // final nnz(C) -) -{ - - if (C->h == NULL) - { - - //---------------------------------------------------------------------- - // C is non-hypersparse - //---------------------------------------------------------------------- - - // log the end of C(:,jlast+1) to C(:,n-1), in case the last vector - // j=n-1 has not yet been seen, or has been seen but was empty. - - int64_t *restrict Cp = C->p ; - int64_t j = C->vdim - 1 ; - - for (int64_t jprior = jlast+1 ; jprior <= j ; jprior++) - { - // mark the end of C(:,jprior) - Cp [jprior+1] = cnz ; - } - } - - // C->p and C->h are now valid - C->nvals = cnz ; - C->magic = GB_MAGIC ; -} - -#endif - diff --git a/GraphBLAS/Source/wait/GB_unjumble.c b/GraphBLAS/Source/wait/GB_unjumble.c index d4f4f46e25..47645ed620 100644 --- a/GraphBLAS/Source/wait/GB_unjumble.c +++ b/GraphBLAS/Source/wait/GB_unjumble.c @@ -2,7 +2,7 @@ // GB_unjumble: unjumble the vectors of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,10 +28,7 @@ GrB_Info GB_unjumble // unjumble a matrix ASSERT (!GB_ZOMBIES (A)) ; // zombies must be killed first ASSERT (GB_PENDING_OK (A)) ; // pending tuples are not modified - if (A->nvec_nonempty < 0) - { - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + GB_nvec_nonempty_update (A) ; if (!A->jumbled) { @@ -50,8 +47,9 @@ GrB_Info GB_unjumble // unjumble a matrix const int64_t anvec = A->nvec ; const int64_t anz = GB_nnz (A) ; - const int64_t *restrict Ap = A->p ; - int64_t *restrict Ai = A->i ; + GB_Ap_DECLARE (Ap, const) ; GB_Ap_PTR (Ap, A) ; + GB_Ai_DECLARE_U (Ai, ) ; GB_Ai_PTR (Ai, A) ; + bool Ai_is_32 = A->i_is_32 ; const size_t asize = (A->iso) ? 0 : A->type->size ; //-------------------------------------------------------------------------- @@ -76,7 +74,7 @@ GrB_Info GB_unjumble // unjumble a matrix // out of memory return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (A_slice, Ap, anvec, ntasks, false) ; + GB_p_slice (A_slice, Ap, A->p_is_32, anvec, ntasks, false) ; //-------------------------------------------------------------------------- // sort the vectors @@ -91,7 +89,9 @@ GrB_Info GB_unjumble // unjumble a matrix // iso matrices of any type; only sort the pattern //---------------------------------------------------------------------- - #define GB_QSORT GB_qsort_1 (Ai+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1_32 (Ai32+p, n) ; \ + else GB_qsort_1_64 (Ai64+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -111,8 +111,9 @@ GrB_Info GB_unjumble // unjumble a matrix case GB_1BYTE : // bool, uint8, int8, and user types of size 1 { uint8_t *Ax = (uint8_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size1 (Ai+pA_start, Ax+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_size1 (Ai32+p, Ax+p, n) ; \ + else GB_qsort_1b_64_size1 (Ai64+p, Ax+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -121,8 +122,9 @@ GrB_Info GB_unjumble // unjumble a matrix case GB_2BYTE : // uint16, int16, and user types of size 2 { uint16_t *Ax = (uint16_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size2 (Ai+pA_start, Ax+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_size2 (Ai32+p, Ax+p, n) ; \ + else GB_qsort_1b_64_size2 (Ai64+p, Ax+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -131,8 +133,9 @@ GrB_Info GB_unjumble // unjumble a matrix case GB_4BYTE : // uint32, int32, float, and 4-byte user { uint32_t *Ax = (uint32_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size4 (Ai+pA_start, Ax+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_size4 (Ai32+p, Ax+p, n) ; \ + else GB_qsort_1b_64_size4 (Ai64+p, Ax+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -142,8 +145,9 @@ GrB_Info GB_unjumble // unjumble a matrix // and 8-byte user-defined types { uint64_t *Ax = (uint64_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size8 (Ai+pA_start, Ax+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_size8 (Ai32+p, Ax+p, n) ; \ + else GB_qsort_1b_64_size8 (Ai64+p, Ax+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -152,8 +156,9 @@ GrB_Info GB_unjumble // unjumble a matrix case GB_16BYTE : // double complex, and user types of size 16 { GB_blob16 *Ax = (GB_blob16 *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size16 (Ai+pA_start, Ax+pA_start, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_size16 (Ai32+p, Ax+p, n) ; \ + else GB_qsort_1b_64_size16 (Ai64+p, Ax+p, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -185,8 +190,9 @@ GrB_Info GB_unjumble // unjumble a matrix { GBURBLE ("(unjumble: generic kernel) ") ; GB_void *Ax = (GB_void *) A->x ; - #define GB_QSORT \ - GB_qsort_1b (Ai+pA_start, Ax+pA_start*asize, asize, aknz) ; + #define GB_QSORT \ + if (Ai_is_32) GB_qsort_1b_32_generic (Ai32+p, Ax+p*asize, asize, n) ; \ + else GB_qsort_1b_64_generic (Ai64+p, Ax+p*asize, asize, n) ; #include "wait/template/GB_unjumbled_template.c" info = GrB_SUCCESS ; } @@ -200,7 +206,7 @@ GrB_Info GB_unjumble // unjumble a matrix { A->jumbled = false ; // A has been unjumbled ASSERT_MATRIX_OK (A, "A unjumbled", GB0) ; - ASSERT (A->nvec_nonempty >= 0) + ASSERT (GB_nvec_nonempty_get (A) >= 0) } return (info) ; } diff --git a/GraphBLAS/Source/wait/GB_wait.c b/GraphBLAS/Source/wait/GB_wait.c index e9258cb5b6..e6243d370e 100644 --- a/GraphBLAS/Source/wait/GB_wait.c +++ b/GraphBLAS/Source/wait/GB_wait.c @@ -2,7 +2,7 @@ // GB_wait: finish all pending computations on a single matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,23 +10,15 @@ // CALLS: GB_builder // The matrix A has zombies and/or pending tuples placed there by -// GrB_setElement, GrB_*assign, or GB_mxm. Zombies must now be deleted, and -// pending tuples must now be assembled together and added into the matrix. -// The indices in A might also be jumbled; if so, they are sorted now. +// GrB_setElement, GrB_*assign, GB_mxm, or any other GraphBLAS method with an +// accum operator and a small update. Zombies must now be deleted, and pending +// tuples must now be assembled together and added into the matrix. The +// indices in A might also be jumbled; if so, they are sorted now. // When the function returns, and all pending tuples and zombies have been // deleted. This is true even the function fails due to lack of memory (in // that case, the matrix is cleared as well). -// If A is hypersparse, the time taken is at most O(nnz(A) + t log t), where t -// is the number of pending tuples in A, and nnz(A) includes both zombies and -// live entries. There is no O(m) or O(n) time component, if A is m-by-n. -// If the number of non-empty vectors of A grows too large, then A can be -// converted to non-hypersparse. - -// If A is non-hypersparse, then O(n) is added in the worst case, to prune -// zombies and to update the vector pointers for A. - // If A->nvec_nonempty is unknown (-1) it is computed. // The A->Y hyper_hash is freed if the A->h hyperlist has to be constructed. @@ -40,7 +32,7 @@ GB_Matrix_free (&Y) ; \ GB_Matrix_free (&T) ; \ GB_Matrix_free (&S) ; \ - GB_Matrix_free (&A1) ; \ + GB_Matrix_free (&W) ; \ } #define GB_FREE_ALL \ @@ -54,7 +46,6 @@ #include "binaryop/GB_binop.h" #include "pending/GB_Pending.h" #include "builder/GB_build.h" -#include "wait/GB_jappend.h" #include "scalar/GB_Scalar_wrap.h" GrB_Info GB_wait // finish all pending computations @@ -70,10 +61,12 @@ GrB_Info GB_wait // finish all pending computations //-------------------------------------------------------------------------- GrB_Info info = GrB_SUCCESS ; - struct GB_Matrix_opaque T_header, A1_header, S_header ; - GrB_Matrix T = NULL, A1 = NULL, S = NULL, Y = NULL ; + struct GB_Matrix_opaque T_header, W_header, S_header ; + GrB_Matrix T = NULL, W = NULL, S = NULL, Y = NULL ; + + ASSERT_MATRIX_OK (A, "A to wait", GB0_Z) ; - ASSERT_MATRIX_OK (A, "A to wait", GB_ZOMBIE (GB0)) ; + int64_t nvec_nonempty = GB_nvec_nonempty_get (A) ; if (GB_IS_FULL (A) || GB_IS_BITMAP (A)) { @@ -81,7 +74,7 @@ GrB_Info GB_wait // finish all pending computations ASSERT (!GB_ZOMBIES (A)) ; ASSERT (!GB_JUMBLED (A)) ; ASSERT (!GB_PENDING (A)) ; - ASSERT (A->nvec_nonempty >= 0) ; + ASSERT (nvec_nonempty >= 0) ; // ensure the matrix is written to memory #pragma omp flush return (GrB_SUCCESS) ; @@ -100,13 +93,13 @@ GrB_Info GB_wait // finish all pending computations int64_t nzombies = A->nzombies ; int64_t npending = GB_Pending_n (A) ; const bool A_iso = A->iso ; - if (nzombies > 0 || npending > 0 || A->jumbled || A->nvec_nonempty < 0) + if (nzombies > 0 || npending > 0 || A->jumbled || nvec_nonempty < 0) { GB_BURBLE_MATRIX (A, "(%swait:%s " GBd " %s, " GBd " pending%s%s) ", A_iso ? "iso " : "", name, nzombies, (nzombies == 1) ? "zombie" : "zombies", npending, A->jumbled ? ", jumbled" : "", - A->nvec_nonempty < 0 ? ", nvec" : "") ; + nvec_nonempty < 0 ? ", nvec" : "") ; } //-------------------------------------------------------------------------- @@ -121,12 +114,10 @@ GrB_Info GB_wait // finish all pending computations //-------------------------------------------------------------------------- if (npending == 0 && nzombies == 0 && !A->jumbled) - { + { // A->Y is not modified. If not NULL, it remains valid - if (A->nvec_nonempty < 0) - { - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + GB_nvec_nonempty_update (A) ; + #pragma omp flush return (GrB_SUCCESS) ; } @@ -141,9 +132,11 @@ GrB_Info GB_wait // finish all pending computations // jumbled, then it stays sparse or hypersparse. A->Y is not modified // nor accessed, and remains NULL if it is NULL on input. If it is // present, it remains valid. + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; GB_OK (GB_unjumble (A, Werk)) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, A->nvec_nonempty >= 0)) ; - return (info) ; + ASSERT (GB_nvec_nonempty_get (A) >= 0) ; + #pragma omp flush + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- @@ -155,7 +148,7 @@ GrB_Info GB_wait // finish all pending computations int64_t tnz = 0 ; if (npending > 0) - { + { //---------------------------------------------------------------------- // construct a new hypersparse matrix T with just the pending tuples @@ -167,10 +160,11 @@ GrB_Info GB_wait // finish all pending computations // z=accum(x,y) operator can have any types, and it does not have to be // associative. T is constructed as iso if A is iso. + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; GB_void *S_input = (A_iso) ? ((GB_void *) A->x) : NULL ; GrB_Type stype = (A_iso) ? A->type : A->Pending->type ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; + GB_CLEAR_MATRIX_HEADER (T, &T_header) ; info = GB_builder ( T, // create T using a static header A->type, // T->type = A->type @@ -194,7 +188,10 @@ GrB_Info GB_wait // finish all pending computations // NULL if A is iso stype, // type of Pending->x true, // burble is allowed - Werk + Werk, + A->i_is_32, A->j_is_32, // true if Pending->[ij] are 32-bit, + // false if 64-bit + true, true, true // create T with 32/64 bits ) ; //---------------------------------------------------------------------- @@ -224,12 +221,7 @@ GrB_Info GB_wait // finish all pending computations // Finally check the status of the builder. The pending tuples, must // be freed (just above), whether or not the builder is successful. - if (info != GrB_SUCCESS) - { - // out of memory in GB_builder - GB_FREE_ALL ; - return (info) ; - } + GB_OK (info) ; ASSERT_MATRIX_OK (T, "T = hypersparse matrix of pending tuples", GB0) ; ASSERT (GB_IS_HYPERSPARSE (T)) ; @@ -246,22 +238,21 @@ GrB_Info GB_wait // finish all pending computations //-------------------------------------------------------------------------- // A zombie is an entry A(i,j) in the matrix that as been marked for - // deletion, but hasn't been deleted yet. It is marked by "negating" - // replacing its index i with GB_ZOMBIE(i). + // deletion, but hasn't been deleted yet. It is marked by replacing its + // index i with GB_ZOMBIE (i). - // TODO: pass tnz to GB_selector, to pad the reallocated A matrix ASSERT_MATRIX_OK (A, "A before zombies removed", GB0) ; if (nzombies > 0) { // remove all zombies from A - // GB_selector frees A->Y if it changes A->h, or leaves it - // unmodified (and valid) otherwise. - struct GB_Scalar_opaque Thunk_header ; + GB_RETURN_IF_OUTPUT_IS_READONLY (A) ; + struct GB_Scalar_opaque scalar_header ; int64_t k = 0 ; - GrB_Scalar Thunk = GB_Scalar_wrap (&Thunk_header, GrB_INT64, &k) ; - GB_OK (GB_selector (NULL, GxB_NONZOMBIE, false, A, Thunk, Werk)) ; - ASSERT (A->nzombies == (anz_orig - GB_nnz (A))) ; + GrB_Scalar scalar = GB_Scalar_wrap (&scalar_header, GrB_INT64, &k) ; + GB_CLEAR_MATRIX_HEADER (W, &W_header) ; + GB_OK (GB_selector (W, GxB_NONZOMBIE, false, A, scalar, Werk)) ; + GB_OK (GB_transplant (A, A->type, &W, Werk)) ; A->nzombies = 0 ; } @@ -289,10 +280,10 @@ GrB_Info GB_wait // finish all pending computations if (npending == 0) { // conform A to its desired sparsity structure and return result - info = GB_conform (A, Werk) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, A->nvec_nonempty >= 0)) ; + GB_OK (GB_conform (A, Werk)) ; + ASSERT (GB_nvec_nonempty_get (A) >= 0) ; #pragma omp flush - return (info) ; + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- @@ -304,348 +295,163 @@ GrB_Info GB_wait // finish all pending computations { // A has no entries so just transplant T into A, then free T and // conform A to its desired hypersparsity. - info = GB_transplant_conform (A, A->type, &T, Werk) ; - ASSERT (GB_IMPLIES (info == GrB_SUCCESS, A->nvec_nonempty >= 0)) ; + GB_OK (GB_transplant_conform (A, A->type, &T, Werk)) ; + ASSERT (GB_nvec_nonempty_get (A) >= 0) ; #pragma omp flush - return (info) ; + return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- - // create the SECOND_ATYPE binary operator + // S = A+T using the SECOND_ATYPE binary operator //-------------------------------------------------------------------------- + // A single parallel add: S=A+T, free T, and then transplant S back into A. + + // FUTURE:: if GB_add could tolerate zombies in A, then the initial + // prune of zombies can be skipped. + + // T->Y is not present (GB_builder does not create it). The old A->Y + // is still valid, if present, for the matrix A prior to added the + // pending tuples in T. GB_add may need A->Y to compute S, but it does + // not compute S->Y. + struct GB_BinaryOp_opaque op_header ; GrB_BinaryOp op_2nd = GB_binop_second (A->type, &op_header) ; - //-------------------------------------------------------------------------- - // determine the method for A = A+T - //-------------------------------------------------------------------------- - // If anz > 0, T is hypersparse, even if A is a GrB_Vector ASSERT (GB_IS_HYPERSPARSE (T)) ; ASSERT (tnz > 0) ; ASSERT (T->nvec > 0) ; ASSERT (A->nvec > 0) ; + int64_t anvec = A->nvec ; + bool ignore ; - // tjfirst = first vector in T - int64_t tjfirst = T->h [0] ; - int64_t anz0 = 0 ; - int64_t kA = 0 ; - int64_t jlast ; - - int64_t *restrict Ap = A->p ; - int64_t *restrict Ah = A->h ; - int64_t *restrict Ai = A->i ; - GB_void *restrict Ax = (GB_void *) A->x ; + GB_CLEAR_MATRIX_HEADER (S, &S_header) ; + GB_OK (GB_add (S, A->type, A->is_csc, NULL, 0, 0, &ignore, A, T, + false, NULL, NULL, op_2nd, false, true, Werk)) ; + GB_Matrix_free (&T) ; + ASSERT_MATRIX_OK (S, "S after GB_wait:add", GB0) ; - int64_t anvec = A->nvec ; + //-------------------------------------------------------------------------- + // check if the A->Y hyper-hash can be kept + //-------------------------------------------------------------------------- - // anz0 = nnz (A0) = nnz (A (:, 0:tjfirst-1)), the region not modified by T - if (A->h != NULL) - { - // find tjfirst in A->h - int64_t pright = anvec - 1 ; - bool found ; - GB_SPLIT_BINARY_SEARCH (tjfirst, A->h, kA, pright, found) ; - // A->h [0 ... kA-1] excludes vector tjfirst. The list - // A->h [kA ... anvec-1] includes tjfirst. - ASSERT (kA >= 0 && kA <= anvec) ; - ASSERT (GB_IMPLIES (kA > 0 && kA < anvec, A->h [kA-1] < tjfirst)) ; - ASSERT (GB_IMPLIES (found, A->h [kA] == tjfirst)) ; - jlast = (kA > 0) ? A->h [kA-1] : (-1) ; - } - else + if (A->no_hyper_hash) { - kA = tjfirst ; - jlast = tjfirst - 1 ; + // A does not want the hyper_hash, so free A->Y and S->Y if present + GB_hyper_hash_free (A) ; + GB_hyper_hash_free (S) ; } - // anz1 = nnz (A1) = nnz (A (:, kA:end)), the region modified by T - anz0 = A->p [kA] ; - int64_t anz1 = anz - anz0 ; - bool ignore ; - - // A + T will have anz_new entries - int64_t anz_new = anz + tnz ; // must have at least this space - - if (2 * anz1 < anz0) - { - - //---------------------------------------------------------------------- - // append new tuples to A - //---------------------------------------------------------------------- + bool Ai_is_32 = A->i_is_32 ; + bool Aj_is_32 = A->j_is_32 ; - // A is growing incrementally. It splits into two parts: A = [A0 A1]. - // where A0 = A (:, 0:kA-1) and A1 = A (:, kA:end). The - // first part (A0 with anz0 = nnz (A0) entries) is not modified. The - // second part (A1, with anz1 = nnz (A1) entries) overlaps with T. - // If anz1 is zero, or small compared to anz0, then it is faster to - // leave A0 unmodified, and to update just A1. + if (GB_IS_HYPERSPARSE (A) && GB_IS_HYPERSPARSE (S) && A->Y != NULL + && S->Y == NULL && !A->Y_shallow && !GB_is_shallow (A->Y) + && Aj_is_32 == S->j_is_32 && S->nvec == anvec) + { + // A and S are both hypersparse, and the old A->Y exists and is not + // shallow. Check if S->h and A->h are identical. If so, remove A->Y + // from A and save it. Then after the transplant of S into A, below, + // if A is still hyperparse, transplant Y back into A->Y. - // TODO: if A also had zombies, GB_selector could pad A so that - // GB_nnz_max (A) is equal to anz + tnz. + GB_Ah_DECLARE (Ah, const) ; GB_Ah_PTR (Ah, A) ; + GB_Sh_DECLARE (Sh, const) ; GB_Sh_PTR (Sh, S) ; - // make sure A has enough space for the new tuples - if (anz_new > GB_nnz_max (A)) + bool hsame = true ; + int nthreads = GB_nthreads (anvec, chunk, nthreads_max) ; + if (nthreads == 1) { - // double the size if not enough space - GB_OK (GB_ix_realloc (A, 2 * anz_new)) ; - Ai = A->i ; - Ax = (GB_void *) A->x ; - } - - //---------------------------------------------------------------------- - // T = A1 + T - //---------------------------------------------------------------------- - - if (anz1 > 0) - { - - //------------------------------------------------------------------ - // extract A1 = A (:, kA:end) as a shallow copy - //------------------------------------------------------------------ - - // A1 = [0, A (:, kA:end)], hypersparse with same dimensions as A - GB_CLEAR_STATIC_HEADER (A1, &A1_header) ; - GB_OK (GB_new (&A1, // hyper, existing header - A->type, A->vlen, A->vdim, GB_Ap_malloc, A->is_csc, - GxB_HYPERSPARSE, GB_ALWAYS_HYPER, anvec - kA)) ; - - // the A1->i and A1->x content are shallow copies of A(:,kA:end). - // They are not allocated pointers, but point to space inside - // Ai and Ax. - - A1->x = (void *) (Ax + (A_iso ? 0 : (asize * anz0))) ; - A1->x_size = (A_iso ? 1 : anz1) * asize ; - A1->x_shallow = true ; - A1->i = Ai + anz0 ; - A1->i_size = anz1 * sizeof (int64_t) ; - A1->i_shallow = true ; - A1->iso = A_iso ; // OK - - // fill the column A1->h and A1->p with A->h and A->p, shifted - int64_t *restrict A1p = A1->p ; - int64_t *restrict A1h = A1->h ; - int64_t a1nvec = 0 ; - - for (int64_t k = kA ; k < anvec ; k++) // TODO:parallel - { - // get A (:,k) - int64_t pA_start = Ap [k] ; - int64_t pA_end = Ap [k+1] ; - if (pA_end > pA_start) - { - // add this column to A1 if A (:,k) is not empty - int64_t j = GBH (Ah, k) ; - A1p [a1nvec] = pA_start - anz0 ; - A1h [a1nvec] = j ; - a1nvec++ ; - } + // compare Ah and Sh with a single thread + if (Aj_is_32) + { + hsame = (memcmp (Ah32, Sh32, anvec * sizeof (uint32_t)) == 0) ; } - - // finalize A1 - A1p [a1nvec] = anz1 ; - A1->nvec = a1nvec ; - A1->nvec_nonempty = a1nvec ; - A1->nvals = anz1 ; - A1->magic = GB_MAGIC ; - - ASSERT_MATRIX_OK (A1, "A1 slice for GB_wait", GB0) ; - - //------------------------------------------------------------------ - // S = A1 + T, with no operator or mask - //------------------------------------------------------------------ - - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_add (S, A->type, A->is_csc, NULL, 0, 0, &ignore, A1, T, - false, NULL, NULL, op_2nd, false, true, Werk)) ; - - ASSERT_MATRIX_OK (S, "S = A1+T", GB0) ; - - // free A1 and T - GB_Matrix_free (&T) ; - GB_Matrix_free (&A1) ; - - //------------------------------------------------------------------ - // replace T with S - //------------------------------------------------------------------ - - T = S ; - S = NULL ; - tnz = GB_nnz (T) ; - - //------------------------------------------------------------------ - // remove A1 from the vectors of A, if A is hypersparse - //------------------------------------------------------------------ - - if (A->h != NULL) + else { - A->nvec = kA ; + hsame = (memcmp (Ah64, Sh64, anvec * sizeof (uint64_t)) == 0) ; } } - - //---------------------------------------------------------------------- - // append T to the end of A0 - //---------------------------------------------------------------------- - - const int64_t *restrict Tp = T->p ; - const int64_t *restrict Th = T->h ; - const int64_t *restrict Ti = T->i ; - int64_t tnvec = T->nvec ; - - anz = anz0 ; - int64_t anz_last = anz ; - - int nthreads = GB_nthreads (tnz, chunk, nthreads_max) ; - - // append the indices and values of T to the end of A - GB_memcpy (Ai + anz, Ti, tnz * sizeof (int64_t), nthreads) ; - if (!A_iso) - { - const GB_void *restrict Tx = (GB_void *) T->x ; - GB_memcpy (Ax + anz * asize, Tx, tnz * asize, nthreads) ; - } - - // append the vectors of T to the end of A - for (int64_t k = 0 ; k < tnvec ; k++) // TODO:parallel - { - int64_t j = Th [k] ; - ASSERT (j >= tjfirst) ; - anz += (Tp [k+1] - Tp [k]) ; - GB_OK (GB_jappend (A, j, &jlast, anz, &anz_last, Werk)) ; - } - - GB_jwrapup (A, jlast, anz) ; - ASSERT (anz == anz_new) ; - - // need to recompute the # of non-empty vectors in GB_conform - A->nvec_nonempty = -1 ; // recomputed just below - - // A->h has been modified so A->Y is now invalid - GB_hyper_hash_free (A) ; - - ASSERT_MATRIX_OK (A, "A after GB_wait:append", GB0) ; - - GB_Matrix_free (&T) ; - - // conform A to its desired sparsity structure - GB_OK (GB_conform (A, Werk)) ; - ASSERT (A->nvec_nonempty >= 0) ; - - } - else - { - - //---------------------------------------------------------------------- - // A = A+T - //---------------------------------------------------------------------- - - // The update is not incremental since most of A is changing. Just do - // a single parallel add: S=A+T, free T, and then transplant S back - // into A. The nzmax of A is tight, with no room for future - // incremental growth. - - // FUTURE:: if GB_add could tolerate zombies in A, then the initial - // prune of zombies can be skipped. - - // T->Y is not present (GB_builder does not create it). The old A->Y - // is still valid, if present, for the matrix A prior to added the - // pending tuples in T. GB_add may need A->Y to compute S, but it does - // not compute S->Y. - - GB_CLEAR_STATIC_HEADER (S, &S_header) ; - GB_OK (GB_add (S, A->type, A->is_csc, NULL, 0, 0, &ignore, A, T, - false, NULL, NULL, op_2nd, false, true, Werk)) ; - GB_Matrix_free (&T) ; - ASSERT_MATRIX_OK (S, "S after GB_wait:add", GB0) ; - - if (A->no_hyper_hash) + else { - // A does not want the hyper_hash, so free A->Y and S->Y if present - GB_hyper_hash_free (A) ; - GB_hyper_hash_free (S) ; - } - - if (GB_IS_HYPERSPARSE (A) && GB_IS_HYPERSPARSE (S) && A->Y != NULL - && !A->Y_shallow && !GB_is_shallow (A->Y)) - { - // A and S are both hypersparse, and the old A->Y exists and is not - // shallow. Check if S->h and A->h are identical. If so, remove - // A->Y from A and save it. Then after the transplant of S into A, - // below, if A is still hyperparse, transplant Y back into A->Y. - if (S->nvec == anvec) + // compare Ah and Sh with several threads + int ntasks = 64 * nthreads ; + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(dynamic) + for (tid = 0 ; tid < ntasks ; tid++) { - // A and S have the same number of vectors. Compare Ah and Sh - int64_t *restrict Ah = A->h ; - int64_t *restrict Sh = S->h ; - bool hsame = true ; - int nthreads = GB_nthreads (anvec, chunk, nthreads_max) ; - if (nthreads == 1) - { - // compare Ah and Sh with a single thread - hsame = (memcmp (Ah, Sh, anvec * sizeof (int64_t)) == 0) ; - } - else - { - // compare Ah and Sh with several threads - int ntasks = 64 * nthreads ; - int tid ; - #pragma omp parallel for num_threads(nthreads) \ - schedule(dynamic) - for (tid = 0 ; tid < ntasks ; tid++) + int64_t kstart, kend ; + GB_PARTITION (kstart, kend, anvec, tid, ntasks) ; + bool my_hsame ; + GB_ATOMIC_READ + my_hsame = hsame ; + if (my_hsame) + { + // compare this task's region of Ah and Sh + if (Aj_is_32) + { + my_hsame = (memcmp (Ah32 + kstart, Sh32 + kstart, + (kend - kstart) * sizeof (uint32_t)) == 0) ; + } + else + { + my_hsame = (memcmp (Ah64 + kstart, Sh64 + kstart, + (kend - kstart) * sizeof (uint64_t)) == 0) ; + } + if (!my_hsame) { - int64_t kstart, kend ; - GB_PARTITION (kstart, kend, anvec, tid, ntasks) ; - bool my_hsame ; - GB_ATOMIC_READ - my_hsame = hsame ; - if (my_hsame) - { - // compare this task's region of Ah and Sh - my_hsame = (memcmp (Ah + kstart, Sh + kstart, - (kend - kstart) * sizeof (int64_t)) == 0) ; - if (!my_hsame) - { - // tell other tasks to exit early - GB_ATOMIC_WRITE - hsame = false ; - } - } + // tell other tasks to exit early + GB_ATOMIC_WRITE + hsame = false ; } } - if (hsame) - { - // Ah and Sh are the same, so keep A->Y - Y = A->Y ; - A->Y = NULL ; - A->Y_shallow = false ; - } } } - // transplant S into A - GB_OK (GB_transplant_conform (A, A->type, &S, Werk)) ; - ASSERT (A->nvec_nonempty >= 0) ; - - if (Y != NULL && GB_IS_HYPERSPARSE (A) && A->Y == NULL) + if (hsame) { - // The hyperlist of A has not changed. A is still hypersparse, and - // has no A->Y after the transplant/conform above. The original - // A->Y is valid, so transplant it back into A. - A->Y = Y ; + // Ah and Sh are the same, so keep A->Y + Y = A->Y ; + A->Y = NULL ; A->Y_shallow = false ; - Y = NULL ; } + } + + //-------------------------------------------------------------------------- + // transplant S into A, and conform it to its desired sparsity structure + //-------------------------------------------------------------------------- + + GB_OK (GB_transplant_conform (A, A->type, &S, Werk)) ; + ASSERT (GB_nvec_nonempty_get (A) >= 0) ; + + //-------------------------------------------------------------------------- + // restore the A->Y hyper_hash, if A is still hypersparse + //-------------------------------------------------------------------------- - ASSERT_MATRIX_OK (A, "A after GB_wait:add", GB0) ; + if (Y != NULL && GB_IS_HYPERSPARSE (A) && A->Y == NULL && + Aj_is_32 == A->j_is_32) + { + // The hyperlist of A has not changed. A is still hypersparse, and has + // no A->Y after the transplant/conform above. The integer sizes in + // the Y matrix still match the j integers of A, so the + // transplant/conform did not modify them. The original A->Y is thus + // valid, so transplant it back into A. If A is no longer hypersparse, + // Y is not transplanted into A, and is freed by GB_FREE_WORKSPACE. + A->Y = Y ; + A->Y_shallow = false ; + Y = NULL ; + ASSERT (A->Y->i_is_32 == A->j_is_32) ; + ASSERT (A->Y->j_is_32 == A->j_is_32) ; + ASSERT (A->Y->p_is_32 == A->j_is_32) ; } //-------------------------------------------------------------------------- - // flush the matrix and return result + // free workspace and return result //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; + ASSERT_MATRIX_OK (A, "A final for GB_wait", GB0) ; #pragma omp flush - return (info) ; + return (GrB_SUCCESS) ; } diff --git a/GraphBLAS/Source/wait/GB_wait.h b/GraphBLAS/Source/wait/GB_wait.h index 1a8f10d478..717b654e15 100644 --- a/GraphBLAS/Source/wait/GB_wait.h +++ b/GraphBLAS/Source/wait/GB_wait.h @@ -2,7 +2,7 @@ // GB_wait.h: definitions for GB_wait //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/wait/GrB_BinaryOp_wait.c b/GraphBLAS/Source/wait/GrB_BinaryOp_wait.c index 152dd6ac26..e7b1b98a98 100644 --- a/GraphBLAS/Source/wait/GrB_BinaryOp_wait.c +++ b/GraphBLAS/Source/wait/GrB_BinaryOp_wait.c @@ -2,7 +2,7 @@ // GrB_BinaryOp_wait: wait for a user-defined GrB_BinaryOp to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_BinaryOp_wait // no work, just check if the GrB_BinaryOp is valid ( GrB_BinaryOp op, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_BinaryOp_wait // no work, just check if the GrB_BinaryOp is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_BinaryOp_wait (op, waitmode)") ; + GB_CHECK_INIT ; if (op == GxB_IGNORE_DUP) return (GrB_SUCCESS) ; // nothing to do GB_RETURN_IF_NULL_OR_FAULTY (op) ; diff --git a/GraphBLAS/Source/wait/GrB_Descriptor_wait.c b/GraphBLAS/Source/wait/GrB_Descriptor_wait.c index 3485aec425..938a04b547 100644 --- a/GraphBLAS/Source/wait/GrB_Descriptor_wait.c +++ b/GraphBLAS/Source/wait/GrB_Descriptor_wait.c @@ -2,7 +2,7 @@ // GrB_Descriptor_wait: wait for a user-defined GrB_Descriptor to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ GrB_Info GrB_Descriptor_wait // no work, just check if GrB_Descriptor is valid ( GrB_Descriptor desc, - GrB_WaitMode waitmode + int waitmode ) { @@ -26,7 +26,7 @@ GrB_Info GrB_Descriptor_wait // no work, just check if GrB_Descriptor is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Descriptor_wait (desc, waitmode)") ; + GB_CHECK_INIT ; if (desc != NULL) GB_RETURN_IF_FAULTY (desc) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_IndexUnaryOp_wait.c b/GraphBLAS/Source/wait/GrB_IndexUnaryOp_wait.c index 13e0847e83..8101318a9c 100644 --- a/GraphBLAS/Source/wait/GrB_IndexUnaryOp_wait.c +++ b/GraphBLAS/Source/wait/GrB_IndexUnaryOp_wait.c @@ -2,7 +2,7 @@ // GrB_IndexUnaryOp_wait: wait for a user-defined GrB_IndexUnaryOp to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_IndexUnaryOp_wait // no work, just check if valid ( GrB_IndexUnaryOp op, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_IndexUnaryOp_wait // no work, just check if valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_IndexUnaryOp_wait (op, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_Matrix_wait.c b/GraphBLAS/Source/wait/GrB_Matrix_wait.c index 602f7783b0..b3f28282da 100644 --- a/GraphBLAS/Source/wait/GrB_Matrix_wait.c +++ b/GraphBLAS/Source/wait/GrB_Matrix_wait.c @@ -2,7 +2,7 @@ // GrB_Matrix_wait: wait for a matrix to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Matrix_wait // finish all work on a matrix ( GrB_Matrix A, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,8 +24,8 @@ GrB_Info GrB_Matrix_wait // finish all work on a matrix // check inputs //-------------------------------------------------------------------------- - GB_WHERE (A, "GrB_Matrix_wait (A, waitmode)") ; - GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (A) ; + GB_WHERE1 (A, "GrB_Matrix_wait (A, waitmode)") ; //-------------------------------------------------------------------------- // finish all pending work on the matrix, including creating A->Y @@ -34,7 +34,6 @@ GrB_Info GrB_Matrix_wait // finish all work on a matrix if (waitmode != GrB_COMPLETE && (GB_ANY_PENDING_WORK (A) || GB_hyper_hash_need (A))) { - GrB_Info info ; GB_BURBLE_START ("GrB_Matrix_wait") ; GB_OK (GB_wait (A, "matrix", Werk)) ; GB_OK (GB_hyper_hash_build (A, Werk)) ; diff --git a/GraphBLAS/Source/wait/GrB_Monoid_wait.c b/GraphBLAS/Source/wait/GrB_Monoid_wait.c index bafde95751..a8bbb6aae3 100644 --- a/GraphBLAS/Source/wait/GrB_Monoid_wait.c +++ b/GraphBLAS/Source/wait/GrB_Monoid_wait.c @@ -2,7 +2,7 @@ // GrB_Monoid_wait: wait for a user-defined GrB_Monoid to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Monoid_wait // no work, just check if the GrB_Monoid is valid ( GrB_Monoid monoid, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_Monoid_wait // no work, just check if the GrB_Monoid is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Monoid_wait (monoid, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (monoid) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_Scalar_wait.c b/GraphBLAS/Source/wait/GrB_Scalar_wait.c index 829134dbef..8e6c5b6714 100644 --- a/GraphBLAS/Source/wait/GrB_Scalar_wait.c +++ b/GraphBLAS/Source/wait/GrB_Scalar_wait.c @@ -2,7 +2,7 @@ // GrB_Scalar_wait: wait for a scalar to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Scalar_wait // finish all work on a scalar ( GrB_Scalar s, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,8 +24,8 @@ GrB_Info GrB_Scalar_wait // finish all work on a scalar // check inputs //-------------------------------------------------------------------------- - GB_WHERE (s, "GrB_Scalar_wait (s, waitmode)") ; - GB_RETURN_IF_NULL_OR_FAULTY (s) ; + GB_RETURN_IF_NULL (s) ; + GB_WHERE1 (s, "GrB_Scalar_wait (s, waitmode)") ; //-------------------------------------------------------------------------- // finish all pending work on the scalar @@ -33,7 +33,6 @@ GrB_Info GrB_Scalar_wait // finish all work on a scalar if (waitmode != GrB_COMPLETE && GB_ANY_PENDING_WORK (s)) { - GrB_Info info ; GB_BURBLE_START ("GrB_Scalar_wait") ; GB_OK (GB_wait ((GrB_Matrix) s, "scalar", Werk)) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/wait/GrB_Semiring_wait.c b/GraphBLAS/Source/wait/GrB_Semiring_wait.c index b047354cd4..37e572535b 100644 --- a/GraphBLAS/Source/wait/GrB_Semiring_wait.c +++ b/GraphBLAS/Source/wait/GrB_Semiring_wait.c @@ -2,7 +2,7 @@ // GrB_Semiring_wait: wait for a user-defined GrB_Semiring to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Semiring_wait // no work, just check if the GrB_Semiring is valid ( GrB_Semiring semiring, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_Semiring_wait // no work, just check if the GrB_Semiring is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Semiring_wait (semiring, mode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (semiring) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_Type_wait.c b/GraphBLAS/Source/wait/GrB_Type_wait.c index 937d441be1..84134be394 100644 --- a/GraphBLAS/Source/wait/GrB_Type_wait.c +++ b/GraphBLAS/Source/wait/GrB_Type_wait.c @@ -2,7 +2,7 @@ // GrB_Type_wait: wait for a user-defined GrB_Type to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Type_wait // no work, just check if the GrB_Type is valid ( GrB_Type type, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_Type_wait // no work, just check if the GrB_Type is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_Type_wait (type, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (type) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_UnaryOp_wait.c b/GraphBLAS/Source/wait/GrB_UnaryOp_wait.c index d18457169f..1015437d83 100644 --- a/GraphBLAS/Source/wait/GrB_UnaryOp_wait.c +++ b/GraphBLAS/Source/wait/GrB_UnaryOp_wait.c @@ -2,7 +2,7 @@ // GrB_UnaryOp_wait: wait for a user-defined GrB_UnaryOp to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_UnaryOp_wait // no work, just check if the GrB_UnaryOp is valid ( GrB_UnaryOp op, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GrB_UnaryOp_wait // no work, just check if the GrB_UnaryOp is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GrB_UnaryOp_wait (op, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GrB_Vector_wait.c b/GraphBLAS/Source/wait/GrB_Vector_wait.c index 6c6bf11831..4d5eb600c1 100644 --- a/GraphBLAS/Source/wait/GrB_Vector_wait.c +++ b/GraphBLAS/Source/wait/GrB_Vector_wait.c @@ -2,7 +2,7 @@ // GrB_Vector_wait: wait for a vector to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GrB_Vector_wait // finish all work on a vector ( GrB_Vector v, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,8 +24,8 @@ GrB_Info GrB_Vector_wait // finish all work on a vector // check inputs //-------------------------------------------------------------------------- - GB_WHERE (v, "GrB_Vector_wait (v, waitmode)") ; - GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (v) ; + GB_WHERE1 (v, "GrB_Vector_wait (v, waitmode)") ; //-------------------------------------------------------------------------- // finish all pending work on the vector @@ -33,7 +33,6 @@ GrB_Info GrB_Vector_wait // finish all work on a vector if (waitmode != GrB_COMPLETE && GB_ANY_PENDING_WORK (v)) { - GrB_Info info ; GB_BURBLE_START ("GrB_Vector_wait") ; GB_OK (GB_wait ((GrB_Matrix) v, "vector", Werk)) ; GB_BURBLE_END ; diff --git a/GraphBLAS/Source/wait/GxB_Context_wait.c b/GraphBLAS/Source/wait/GxB_Context_wait.c index fe947638da..48f9bb7cec 100644 --- a/GraphBLAS/Source/wait/GxB_Context_wait.c +++ b/GraphBLAS/Source/wait/GxB_Context_wait.c @@ -2,7 +2,7 @@ // GxB_Context_wait: wait for a GxB_Context to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GxB_Context_wait // no work, just check if GxB_Context is valid ( GxB_Context Context, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GxB_Context_wait // no work, just check if GxB_Context is valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_Context_wait (Context, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (Context) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/GxB_IndexBinaryOp_wait.c b/GraphBLAS/Source/wait/GxB_IndexBinaryOp_wait.c index 4bfbdbe5f6..7693275f6b 100644 --- a/GraphBLAS/Source/wait/GxB_IndexBinaryOp_wait.c +++ b/GraphBLAS/Source/wait/GxB_IndexBinaryOp_wait.c @@ -2,7 +2,7 @@ // GxB_IndexBinaryOp_wait: wait for a user-defined GxB_IndexBinaryOp to complete //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ GrB_Info GxB_IndexBinaryOp_wait // no work, just check if valid ( GxB_IndexBinaryOp op, - GrB_WaitMode waitmode + int waitmode ) { @@ -24,7 +24,7 @@ GrB_Info GxB_IndexBinaryOp_wait // no work, just check if valid // check inputs //-------------------------------------------------------------------------- - GB_WHERE1 ("GxB_IndexBinaryOp_wait (op, waitmode)") ; + GB_CHECK_INIT ; GB_RETURN_IF_NULL_OR_FAULTY (op) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Source/wait/include/GB_wait_macros.h b/GraphBLAS/Source/wait/include/GB_wait_macros.h index a9cde8c8ab..4d79a95c95 100644 --- a/GraphBLAS/Source/wait/include/GB_wait_macros.h +++ b/GraphBLAS/Source/wait/include/GB_wait_macros.h @@ -2,7 +2,7 @@ // GB_wait_macros.h: determine if a matrix has pending tuples, zombies, ... //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/wait/template/GB_unjumbled_template.c b/GraphBLAS/Source/wait/template/GB_unjumbled_template.c index 8566791e9f..10d789885b 100644 --- a/GraphBLAS/Source/wait/template/GB_unjumbled_template.c +++ b/GraphBLAS/Source/wait/template/GB_unjumbled_template.c @@ -2,7 +2,7 @@ // GB_unjumbled_template.c: unjumble the vectors of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,12 +32,12 @@ //------------------------------------------------------------------ bool jumbled = false ; - const int64_t pA_start = Ap [k] ; - const int64_t pA_end = Ap [k+1] ; + const int64_t pA_start = GB_IGET (Ap, k ) ; + const int64_t pA_end = GB_IGET (Ap, k+1) ; int64_t ilast = -1 ; for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - int64_t i = Ai [pA] ; + int64_t i = GB_IGET (Ai, pA) ; if (i < ilast) { jumbled = true ; @@ -52,7 +52,8 @@ if (jumbled) { - const int64_t aknz = pA_end - pA_start ; + const int64_t n = pA_end - pA_start ; + const int64_t p = pA_start ; GB_QSORT ; } } diff --git a/GraphBLAS/Source/werk/GB_status_code.c b/GraphBLAS/Source/werk/GB_status_code.c index 46c24c9cae..91664cc29d 100644 --- a/GraphBLAS/Source/werk/GB_status_code.c +++ b/GraphBLAS/Source/werk/GB_status_code.c @@ -2,7 +2,7 @@ // GB_status_code: return an error string describing the last error //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/werk/GB_werk_pop.c b/GraphBLAS/Source/werk/GB_werk_pop.c index 18d1c6389d..f97f4df209 100644 --- a/GraphBLAS/Source/werk/GB_werk_pop.c +++ b/GraphBLAS/Source/werk/GB_werk_pop.c @@ -2,7 +2,7 @@ // GB_werk_pop: free werkspace from the Werk stack //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,20 @@ // space is also being freed, but the assertion below ensures that the freeing // werkspace from the Werk stack is done in LIFO order, like a stack. +#ifdef comments_only +void *GB_werk_pop // free the top block of werkspace memory +( + // input/output + void *p, // werkspace to free + size_t *size_allocated, // # of bytes actually allocated for p + // input + bool on_stack, // true if werkspace is from Werk stack + size_t nitems, // # of items to allocate + size_t size_of_item, // size of each item + GB_Werk Werk +) ; +#endif + GB_CALLBACK_WERK_POP_PROTO (GB_werk_pop) { ASSERT (size_allocated != NULL) ; diff --git a/GraphBLAS/Source/werk/GB_werk_push.c b/GraphBLAS/Source/werk/GB_werk_push.c index 7622f8bfd7..b1d90c149a 100644 --- a/GraphBLAS/Source/werk/GB_werk_push.c +++ b/GraphBLAS/Source/werk/GB_werk_push.c @@ -2,7 +2,7 @@ // GB_werk_push: allocate werkspace from the Werk stack or malloc //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,6 +12,19 @@ // The werkspace is allocated from the Werk static if it small enough and space // is available. Otherwise it is allocated by malloc. +#ifdef comments_only +void *GB_werk_push // return pointer to newly allocated space +( + // output + size_t *size_allocated, // # of bytes actually allocated + bool *on_stack, // true if werkspace is from Werk stack + // input + size_t nitems, // # of items to allocate + size_t size_of_item, // size of each item + GB_Werk Werk +) ; +#endif + GB_CALLBACK_WERK_PUSH_PROTO (GB_werk_push) { @@ -62,7 +75,8 @@ GB_CALLBACK_WERK_PUSH_PROTO (GB_werk_push) else { // allocate the werkspace from malloc - return (GB_malloc_memory (nitems, size_of_item, size_allocated)) ; + void *p = GB_MALLOC_MEMORY (nitems, size_of_item, size_allocated) ; + return (p) ; } } diff --git a/GraphBLAS/Source/werk/GB_where.h b/GraphBLAS/Source/werk/GB_where.h index 4fd909b154..0759b9c546 100644 --- a/GraphBLAS/Source/werk/GB_where.h +++ b/GraphBLAS/Source/werk/GB_where.h @@ -2,7 +2,7 @@ // GB_where.h: definitions for Werk space and error logging //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,133 @@ #ifndef GB_WHERE_H #define GB_WHERE_H +//------------------------------------------------------------------------------ +// GB_Werk_init: initialize the Werk object +//------------------------------------------------------------------------------ + +static inline GB_Werk GB_Werk_init (GB_Werk Werk, const char *where_string) +{ + // set Werk->where so GrB_error can report it if needed + Werk->where = where_string ; + + // get the pointer to where any error will be logged + Werk->logger_handle = NULL ; + Werk->logger_size_handle = NULL ; + + // initialize the Werk stack + Werk->pwerk = 0 ; + + // get the global integer control; revised with C->[pji]_control by + // GB_WHERE_C_LOGGER (C). + Werk->p_control = GB_Global_p_control_get ( ) ; + Werk->j_control = GB_Global_j_control_get ( ) ; + Werk->i_control = GB_Global_i_control_get ( ) ; + + // return result + return (Werk) ; +} + +//------------------------------------------------------------------------------ +// GB_valids: return GrB_SUCCESS if matrices are valid, error otherwise +//------------------------------------------------------------------------------ + +#define GB_RETURN_IF_INVALID(arg) \ + info = GB_valid_matrix ((GrB_Matrix) arg) ; \ + if (info != GrB_SUCCESS) \ + { \ + return (info) ; \ + } + +static inline GrB_Info GB_valid6 +( + void *arg1, + void *arg2, + void *arg3, + void *arg4, + void *arg5, + void *arg6 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + GB_RETURN_IF_INVALID (arg2) ; + GB_RETURN_IF_INVALID (arg3) ; + GB_RETURN_IF_INVALID (arg4) ; + GB_RETURN_IF_INVALID (arg5) ; + GB_RETURN_IF_INVALID (arg6) ; + return (GrB_SUCCESS) ; +} + +static inline GrB_Info GB_valid5 +( + void *arg1, + void *arg2, + void *arg3, + void *arg4, + void *arg5 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + GB_RETURN_IF_INVALID (arg2) ; + GB_RETURN_IF_INVALID (arg3) ; + GB_RETURN_IF_INVALID (arg4) ; + GB_RETURN_IF_INVALID (arg5) ; + return (GrB_SUCCESS) ; +} + +static inline GrB_Info GB_valid4 +( + void *arg1, + void *arg2, + void *arg3, + void *arg4 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + GB_RETURN_IF_INVALID (arg2) ; + GB_RETURN_IF_INVALID (arg3) ; + GB_RETURN_IF_INVALID (arg4) ; + return (GrB_SUCCESS) ; +} + +static inline GrB_Info GB_valid3 +( + void *arg1, + void *arg2, + void *arg3 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + GB_RETURN_IF_INVALID (arg2) ; + GB_RETURN_IF_INVALID (arg3) ; + return (GrB_SUCCESS) ; +} + +static inline GrB_Info GB_valid2 +( + void *arg1, + void *arg2 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + GB_RETURN_IF_INVALID (arg2) ; + return (GrB_SUCCESS) ; +} + +static inline GrB_Info GB_valid1 +( + void *arg1 +) +{ + GrB_Info info ; + GB_RETURN_IF_INVALID (arg1) ; + return (GrB_SUCCESS) ; +} + //------------------------------------------------------------------------------ // GB_WHERE*: allocate the Werk stack and enable error logging //------------------------------------------------------------------------------ @@ -24,40 +151,115 @@ // condition. Thus, each time a user-callable function is entered, it logs the // name of the function with the GB_WHERE macro. +#define GB_CHECK_INIT \ + if (!GB_Global_GrB_init_called_get ( )) \ + { \ + return (GrB_PANIC) ; /* GrB_init not called */ \ + } \ + #define GB_WERK(where_string) \ /* construct the Werk */ \ GB_Werk_struct Werk_struct ; \ - GB_Werk Werk = &Werk_struct ; \ - /* set Werk->where so GrB_error can report it if needed */ \ - Werk->where = where_string ; \ - /* get the pointer to where any error will be logged */ \ - Werk->logger_handle = NULL ; \ - Werk->logger_size_handle = NULL ; \ - /* initialize the Werk stack */ \ - Werk->pwerk = 0 ; + GB_Werk Werk = GB_Werk_init (&Werk_struct, where_string) ; -// C is a matrix, vector, scalar, or descriptor -#define GB_WHERE(C,where_string) \ - if (!GB_Global_GrB_init_called_get ( )) \ +// create the Werk, with no error logging +#define GB_WHERE0(where_string) \ + GrB_Info info ; \ + GB_CHECK_INIT \ + GB_WERK (where_string) + +// C is a matrix, vector, or scalar +#define GB_WHERE(C,arg2,arg3,arg4,arg5,arg6,where_string) \ + GB_WHERE0 (where_string) \ + /* ensure the matrix has valid integers */ \ + info = GB_valid6 (C, arg2, arg3, arg4, arg5, arg6) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE_CHECK_INFO \ + if (info != GrB_SUCCESS) \ { \ - return (GrB_PANIC) ; /* GrB_init not called */ \ + return (info) ; \ } \ - GB_WERK (where_string) \ + +#define GB_WHERE_C_LOGGER(C) \ + GB_WHERE_CHECK_INFO \ if (C != NULL) \ { \ /* free any prior error logged in the object */ \ - GB_FREE (&(C->logger), C->logger_size) ; \ + GB_FREE_MEMORY (&(C->logger), C->logger_size) ; \ + /* get the error logger */ \ Werk->logger_handle = &(C->logger) ; \ Werk->logger_size_handle = &(C->logger_size) ; \ + /* combine the matrix and global pji_control */ \ + Werk->p_control = GB_pji_control (C->p_control, Werk->p_control) ; \ + Werk->j_control = GB_pji_control (C->j_control, Werk->j_control) ; \ + Werk->i_control = GB_pji_control (C->i_control, Werk->i_control) ; \ } -// create the Werk, with no error logging -#define GB_WHERE1(where_string) \ - if (!GB_Global_GrB_init_called_get ( )) \ +// GB_WHEREn: check n arguments, first one is input/output matrix C for logger +#define GB_WHERE6(C,arg2,arg3,arg4,arg5,arg6,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid6 (C, arg2, arg3, arg4, arg5, arg6) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE5(C,arg2,arg3,arg4,arg5,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid5 (C, arg2, arg3, arg4, arg5) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE4(C,arg2,arg3,arg4,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid4 (C, arg2, arg3, arg4) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE3(C,arg2,arg3,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid3 (C, arg2, arg3) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE2(C,arg2,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid2 (C, arg2) ; \ + GB_WHERE_C_LOGGER (C) + +#define GB_WHERE1(C,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid1 (C) ; \ + GB_WHERE_C_LOGGER (C) + +// GB_WHERE_n: check n arguments, no input/output matrix C for logger +#define GB_WHERE_1(arg1,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid1 (arg1) ; \ + GB_WHERE_CHECK_INFO + +#define GB_WHERE_2(arg1,arg2,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid2 (arg1, arg2) ; \ + GB_WHERE_CHECK_INFO + +#define GB_WHERE_3(arg1,arg2,arg3,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid3 (arg1, arg2, arg3) ; \ + GB_WHERE_CHECK_INFO + +#define GB_WHERE_4(arg1,arg2,arg3,arg4,where_string) \ + GB_WHERE0 (where_string) \ + info = GB_valid4 (arg1, arg2, arg3, arg4) ; \ + GB_WHERE_CHECK_INFO + +// for descriptors +#define GB_WHERE_DESC(desc,where_string) \ + GB_CHECK_INIT \ + GB_RETURN_IF_FAULTY (desc) ; \ + GB_WERK (where_string) \ + if (desc != NULL) \ { \ - return (GrB_PANIC) ; /* GrB_init not called */ \ - } \ - GB_WERK (where_string) + /* free any prior error logged in the object */ \ + GB_FREE_MEMORY (&(desc->logger), desc->logger_size) ; \ + Werk->logger_handle = &(desc->logger) ; \ + Werk->logger_size_handle = &(desc->logger_size) ; \ + } //------------------------------------------------------------------------------ // GB_ERROR: error logging @@ -71,11 +273,10 @@ // "Row index %d out of bounds; must be < %d", i, nrows) ; // } // -// The user can then do: +// The user can then retrieve the error string (owned by GraphBLAS) with: // // const char *error ; // GrB_error (&error, A) ; -// printf ("%s", error) ; const char *GB_status_code (GrB_Info info) ; @@ -91,8 +292,8 @@ const char *GB_status_code (GrB_Info info) ; if (logger_handle != NULL) \ { \ size_t *logger_size_handle = Werk->logger_size_handle ; \ - (*logger_handle) = GB_CALLOC (GB_LOGGER_LEN+1, char, \ - logger_size_handle) ; \ + (*logger_handle) = GB_CALLOC_MEMORY (GB_LOGGER_LEN+1, \ + sizeof (char), logger_size_handle) ; \ if ((*logger_handle) != NULL) \ { \ snprintf ((*logger_handle), GB_LOGGER_LEN, \ @@ -104,5 +305,130 @@ const char *GB_status_code (GrB_Info info) ; return (info) ; \ } +//------------------------------------------------------------------------------ +// GB_RETURN_*: input guards for user-callable GrB* and GxB* methods +//------------------------------------------------------------------------------ + +// check if a required arg is NULL +#define GB_RETURN_IF_NULL(arg) \ + if ((arg) == NULL) \ + { \ + /* the required arg is NULL */ \ + return (GrB_NULL_POINTER) ; \ + } + +// arg may be NULL, but if non-NULL then it must be initialized +#define GB_RETURN_IF_FAULTY(arg) \ + if ((arg) != NULL && (arg)->magic != GB_MAGIC) \ + { \ + if ((arg)->magic == GB_MAGIC2) \ + { \ + /* optional arg is not NULL, but invalid */ \ + return (GrB_INVALID_OBJECT) ; \ + } \ + else \ + { \ + /* optional arg is not NULL, but not initialized */ \ + return (GrB_UNINITIALIZED_OBJECT) ; \ + } \ + } + +// arg must not be NULL, and it must be initialized +#define GB_RETURN_IF_NULL_OR_FAULTY(arg) \ + GB_RETURN_IF_NULL (arg) ; \ + GB_RETURN_IF_FAULTY (arg) ; + +// output cannot be readonly +#define GB_RETURN_IF_OUTPUT_IS_READONLY(arg) \ + if (GB_is_shallow ((GrB_Matrix) arg)) \ + { \ + return (GxB_OUTPUT_IS_READONLY) ; \ + } + +// arg must be a matrix, vector, or scalar +#define GB_RETURN_IF_NULL_OR_INVALID(arg) \ + GB_RETURN_IF_NULL (arg) ; \ + GB_RETURN_IF_INVALID (arg) ; + +// positional ops not supported for use as accum operators +#define GB_RETURN_IF_FAULTY_OR_POSITIONAL(accum) \ +{ \ + GB_RETURN_IF_FAULTY (accum) ; \ + if (GB_OP_IS_POSITIONAL (accum)) \ + { \ + GB_ERROR (GrB_DOMAIN_MISMATCH, \ + "Positional op z=%s(x,y) not supported as accum\n", \ + accum->name) ; \ + } \ +} + +// C=Z ignores Z if an empty mask is complemented, or if M is full, +// structural and complemented, so return from the method without computing +// anything. Clear C if replace option is true. +#define GB_RETURN_IF_QUICK_MASK(C, C_replace, M, Mask_comp, Mask_struct) \ + if (Mask_comp && (M == NULL || (GB_IS_FULL (M) && Mask_struct))) \ + { \ + /* C=NULL since result does not depend on computing Z */ \ + return (C_replace ? GB_clear (C, Werk) : GrB_SUCCESS) ; \ + } + +//------------------------------------------------------------------------------ +// GB_GET_DESCRIPTOR*: get the contents of a descriptor +//------------------------------------------------------------------------------ + +// check the descriptor and extract its contents +#define GB_GET_DESCRIPTOR(info,desc,dout,dmc,dms,d0,d1,dalgo,dsort) \ + bool dout, dmc, dms, d0, d1 ; \ + int dsort ; \ + int dalgo ; \ + /* if desc is NULL then defaults are used. This is OK */ \ + info = GB_Descriptor_get (desc, &dout, &dmc, &dms, &d0, &d1, &dalgo, \ + &dsort) ; \ + if (info != GrB_SUCCESS) \ + { \ + /* desc not NULL, but uninitialized or an invalid object */ \ + return (info) ; \ + } + +#define GB_GET_DESCRIPTOR_IMPORT(desc,fast_import) \ + /* default is a fast import, where the data is trusted */ \ + bool fast_import = true ; \ + if (desc != NULL && desc->import != GxB_FAST_IMPORT) \ + { \ + /* input data is not trusted */ \ + fast_import = false ; \ + } + +//------------------------------------------------------------------------------ +// GB_VECTOR_OK, GB_SCALAR_OK: check if typecast from GrB_Matrix is OK +//------------------------------------------------------------------------------ + +// The internal content of a GrB_Matrix and GrB_Vector are identical, and +// inside SuiteSparse:GraphBLAS, they can be typecasted between each other. +// This typecasting feature should not be done in user code, however, since it +// is not supported in the API. All GrB_Vector objects can be safely +// typecasted into a GrB_Matrix, but not the other way around. The GrB_Vector +// object is more restrictive. The GB_VECTOR_OK(v) macro defines the content +// that all GrB_Vector objects must have. + +// GB_VECTOR_OK(v) is used mainly for assertions, but also to determine when it +// is safe to typecast an n-by-1 GrB_Matrix (in standard CSC format) into a +// GrB_Vector. This is not done in the main SuiteSparse:GraphBLAS library, but +// in the GraphBLAS/Test directory only. The macro is also used in +// GB_Vector_check, to ensure the content of a GrB_Vector is valid. + +#define GB_VECTOR_OK(v) \ +( \ + ((v) != NULL) && \ + ((v)->is_csc == true) && \ + ((v)->plen == 1 || (v)->plen == -1) && \ + ((v)->vdim == 1) && \ + ((v)->nvec == 1) && \ + ((v)->h == NULL) \ +) + +// A GxB_Vector is a GrB_Vector of length 1 +#define GB_SCALAR_OK(v) (GB_VECTOR_OK(v) && ((v)->vlen == 1)) + #endif diff --git a/GraphBLAS/Source/werk/include/GB_werk.h b/GraphBLAS/Source/werk/include/GB_werk.h index 72da7dd81f..7972010996 100644 --- a/GraphBLAS/Source/werk/include/GB_werk.h +++ b/GraphBLAS/Source/werk/include/GB_werk.h @@ -2,7 +2,7 @@ // GB_werk.h: definitions for werkspace management on the Werk stack //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,6 +35,11 @@ typedef struct char **logger_handle ; // error report size_t *logger_size_handle ; int pwerk ; // top of Werk stack, initially zero + + // integer control, combines C->[pji]_control and Global [pji]_control: + uint8_t p_control ; // effective p_control for this method + uint8_t j_control ; // effective j_control for this method + uint8_t i_control ; // effective i_control for this method } GB_Werk_struct ; @@ -48,9 +53,6 @@ typedef GB_Werk_struct *GB_Werk ; // of any user-callable GraphBLAS function. It is used for small werkspace // allocations. -// GB_ROUND8(s) rounds up s to a multiple of 8 -#define GB_ROUND8(s) (((s) + 7) & (~0x7)) - //------------------------------------------------------------------------------ // GB_werk_push: allocate werkspace from the Werk stack or malloc //------------------------------------------------------------------------------ @@ -58,7 +60,41 @@ typedef GB_Werk_struct *GB_Werk ; // The werkspace is allocated from the Werk static if it small enough and space // is available. Otherwise it is allocated by malloc. -// See GB_callbacks.h for the prototype. +#ifdef comments_only +void *GB_werk_push // return pointer to newly allocated space +( + // output + size_t *size_allocated, // # of bytes actually allocated + bool *on_stack, // true if werkspace is from Werk stack + // input + size_t nitems, // # of items to allocate + size_t size_of_item, // size of each item + GB_Werk Werk +) ; +#endif + +//------------------------------------------------------------------------------ +// GB_werk_pop: free werkspace from the Werk stack +//------------------------------------------------------------------------------ + +// If the werkspace was allocated from the Werk stack, it must be at the top of +// the stack to free it properly. Freeing a werkspace in the middle of the +// Werk stack also frees everything above it. Freeing werkspace from the Werk +// stack is done in LIFO order, like a stack. + +#ifdef comments_only +void *GB_werk_pop // free the top block of werkspace memory +( + // input/output + void *p, // werkspace to free + size_t *size_allocated, // # of bytes actually allocated for p + // input + bool on_stack, // true if werkspace is from Werk stack + size_t nitems, // # of items to allocate + size_t size_of_item, // size of each item + GB_Werk Werk +) ; +#endif //------------------------------------------------------------------------------ // Werk helper macros @@ -81,17 +117,8 @@ typedef GB_Werk_struct *GB_Werk ; X = (type *) GB_werk_pop (X, &(X ## _size_allocated), X ## _on_stack, \ X ## _nitems, sizeof (type), Werk) ; -//------------------------------------------------------------------------------ -// GB_werk_pop: free werkspace from the Werk stack -//------------------------------------------------------------------------------ - -// If the werkspace was allocated from the Werk stack, it must be at the top of -// the stack to free it properly. Freeing a werkspace in the middle of the -// Werk stack also frees everything above it. This is not a problem if that -// space is also being freed, but the assertion below ensures that the freeing -// werkspace from the Werk stack is done in LIFO order, like a stack. - -// See GB_callbacks.h for the prototype. +// GB_ROUND8(s) rounds up s to a multiple of 8 +#define GB_ROUND8(s) (((s) + 7) & (~0x7)) #endif diff --git a/GraphBLAS/Source/zstd_wrapper/GB_zstd.c b/GraphBLAS/Source/zstd_wrapper/GB_zstd.c index 50a3d56b7b..1a53ad8415 100644 --- a/GraphBLAS/Source/zstd_wrapper/GB_zstd.c +++ b/GraphBLAS/Source/zstd_wrapper/GB_zstd.c @@ -2,7 +2,7 @@ // GB_zstd: wrapper for the ZSTD compression library //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Source/zstd_wrapper/GB_zstd.h b/GraphBLAS/Source/zstd_wrapper/GB_zstd.h index 59d8e0d614..c0d61c8706 100644 --- a/GraphBLAS/Source/zstd_wrapper/GB_zstd.h +++ b/GraphBLAS/Source/zstd_wrapper/GB_zstd.h @@ -2,7 +2,7 @@ // GB_zstd.h: definitions for a wrapper for the ZSTD compression library //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Tcov/Contents.m b/GraphBLAS/Tcov/Contents.m index 23ba0d5366..7402154643 100644 --- a/GraphBLAS/Tcov/Contents.m +++ b/GraphBLAS/Tcov/Contents.m @@ -8,5 +8,5 @@ % grbshow - create a test coverage report in tmp_cover/ % grbmake - compile the GraphBLAS library for statement coverage testing -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/GraphBLAS/Tcov/GB_coverage.c b/GraphBLAS/Tcov/GB_coverage.c index a91aafef51..19de16035b 100644 --- a/GraphBLAS/Tcov/GB_coverage.c +++ b/GraphBLAS/Tcov/GB_coverage.c @@ -2,7 +2,7 @@ // GB_coverage.c: global array for Tcov test coverage //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Tcov/Makefile b/GraphBLAS/Tcov/Makefile index dd232069fa..740378ee0e 100644 --- a/GraphBLAS/Tcov/Makefile +++ b/GraphBLAS/Tcov/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Tcov/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c similarity index 76% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c index f78abcb6e4..94bc673c56 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: sparse #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 1 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 0 -#define GBP_A(Ap,k,vlen) Ap [k] -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) Ai [p] -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) Ap [k] +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) Ai [p] +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = A->nvals #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE double #define GB_DECLAREA(a) double a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: full #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 0 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 1 -#define GBP_B(Bp,k,vlen) ((k) * (vlen)) -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) ((p) % (vlen)) -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) ((k) * (vlen)) +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) ((p) % (vlen)) +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = (B->vlen * B->vdim) #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,18 +125,21 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE float #define GB_DECLAREB(b) float b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xd4163d6cf4f3dd37 ; - v [0] = 9 ; v [1] = 2 ; v [2] = 9 ; // intentionally stale version + v [0] = 9 ; v [1] = 9 ; v [2] = 9 ; // intentionally stale version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2.c similarity index 78% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2.c index 698011a4c6..84538db351 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE double #define GB_DECLAREA(a) double a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: full #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 0 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 1 -#define GBP_B(Bp,k,vlen) ((k) * (vlen)) -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) ((p) % (vlen)) -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) ((k) * (vlen)) +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) ((p) % (vlen)) +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = (B->vlen * B->vdim) #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,11 +125,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE float #define GB_DECLAREB(b) float b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv.c similarity index 77% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv.c index 098071f92e..0d66a67f67 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c +// GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -41,7 +41,7 @@ void my_rdiv (double *z, const double *x, const double *y) { // escape this quote: " /* escape this backslash \ */ - /* modified for GrB 9.4.1 */ + /* revised for GrB 9.4.1 */ (*z) = (*y) / (*x) ; } #define GB_my_rdiv_USER_DEFN \ @@ -49,7 +49,7 @@ void my_rdiv (double *z, const double *x, const double *y) "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ -" /* modified for GrB 9.4.1 */\n" \ +" /* revised for GrB 9.4.1 INTENTIONALLY STALE */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" #endif @@ -70,16 +70,20 @@ void my_rdiv (double *z, const double *x, const double *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -87,16 +91,19 @@ void my_rdiv (double *z, const double *x, const double *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -104,16 +111,19 @@ void my_rdiv (double *z, const double *x, const double *y) #define GB_A2TYPE double #define GB_DECLAREA(a) double a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: sparse #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 1 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 0 -#define GBP_B(Bp,k,vlen) Bp [k] -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) Bi [p] -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) Bp [k] +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) Bi [p] +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = B->nvals #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -121,11 +131,14 @@ void my_rdiv (double *z, const double *x, const double *y) #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv -#define GB_jit_query GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv +#define GB_jit_query GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004015bbb0bbbcd.c similarity index 76% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004015bbb0bbbcd.c index 9ae1da1a09..0082b432ca 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004015bbb0bbbcd.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4015bbb0bbbcd.c +// GB_jit__AxB_dot2__0004015bbb0bbbcd.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -46,16 +46,20 @@ #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -63,16 +67,19 @@ #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -80,16 +87,19 @@ #define GB_A2TYPE double #define GB_DECLAREA(a) double a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: sparse #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 1 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 0 -#define GBP_B(Bp,k,vlen) Bp [k] -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) Bi [p] -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) Bp [k] +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) Bi [p] +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = B->nvals #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -97,11 +107,14 @@ #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4015bbb0bbbcd -#define GB_jit_query GB_jit__AxB_dot2__4015bbb0bbbcd_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004015bbb0bbbcd +#define GB_jit_query GB_jit__AxB_dot2__0004015bbb0bbbcd_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2.c similarity index 78% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2.c index 8ecd316568..92d86fdd53 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE float #define GB_DECLAREA(a) float a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: full #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 0 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 1 -#define GBP_B(Bp,k,vlen) ((k) * (vlen)) -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) ((p) % (vlen)) -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) ((k) * (vlen)) +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) ((p) % (vlen)) +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = (B->vlen * B->vdim) #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,11 +125,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = (double) (Bx [p]) +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2.c similarity index 78% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2.c index d786915a3c..606f8e8dcc 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE float #define GB_DECLAREA(a) float a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: sparse #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 1 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 0 -#define GBP_B(Bp,k,vlen) Bp [k] -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) Bi [p] -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) Bp [k] +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) Bi [p] +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = B->nvals #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,11 +125,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2.c similarity index 78% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2.c index 1ba88e7fad..6f63fa7b32 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: full #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 0 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 1 -#define GBP_A(Ap,k,vlen) ((k) * (vlen)) -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) ((p) % (vlen)) -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) ((k) * (vlen)) +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) ((p) % (vlen)) +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = (A->vlen * A->vdim) #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE float #define GB_DECLAREA(a) float a #define GB_GETA(a,Ax,p,iso) a = Ax [p] +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: full #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 0 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 1 -#define GBP_B(Bp,k,vlen) ((k) * (vlen)) -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) ((p) % (vlen)) -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) ((k) * (vlen)) +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) ((p) % (vlen)) +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = (B->vlen * B->vdim) #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,11 +125,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = Bx [p] +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2.c similarity index 78% rename from GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c rename to GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2.c index e44ad71dff..5a08f587fc 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c +// GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -64,16 +64,20 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_C_IS_SPARSE 0 #define GB_C_IS_BITMAP 0 #define GB_C_IS_FULL 1 -#define GBP_C(Cp,k,vlen) ((k) * (vlen)) -#define GBH_C(Ch,k) (k) -#define GBI_C(Ci,p,vlen) ((p) % (vlen)) -#define GBB_C(Cb,p) 1 +#define GBp_C(Cp,k,vlen) ((k) * (vlen)) +#define GBh_C(Ch,k) (k) +#define GBi_C(Ci,p,vlen) ((p) % (vlen)) +#define GBb_C(Cb,p) 1 #define GB_C_NVALS(e) int64_t e = (C->vlen * C->vdim) #define GB_C_NHELD(e) GB_C_NVALS(e) #define GB_C_ISO 0 #define GB_C_IN_ISO 0 #define GB_C_TYPE double #define GB_PUTC(c,Cx,p) Cx [p] = c +#define GB_Cp_BITS 64 +#define GB_Cj_BITS 64 +#define GB_Ci_BITS 64 +#define GB_Ci_TYPE uint64_t // M matrix: none #define GB_M_TYPE void @@ -81,16 +85,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_MASK_STRUCT 1 #define GB_MASK_COMP 0 #define GB_NO_MASK 1 +#define GB_Mp_BITS 64 +#define GB_Mj_BITS 64 +#define GB_Mi_BITS 64 // A matrix: sparse #define GB_A_IS_HYPER 0 #define GB_A_IS_SPARSE 1 #define GB_A_IS_BITMAP 0 #define GB_A_IS_FULL 0 -#define GBP_A(Ap,k,vlen) Ap [k] -#define GBH_A(Ah,k) (k) -#define GBI_A(Ai,p,vlen) Ai [p] -#define GBB_A(Ab,p) 1 +#define GBp_A(Ap,k,vlen) Ap [k] +#define GBh_A(Ah,k) (k) +#define GBi_A(Ai,p,vlen) Ai [p] +#define GBb_A(Ab,p) 1 #define GB_A_NVALS(e) int64_t e = A->nvals #define GB_A_NHELD(e) GB_A_NVALS(e) #define GB_A_ISO 0 @@ -98,16 +105,19 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_A2TYPE float #define GB_DECLAREA(a) float a #define GB_GETA(a,Ax,p,iso) a = (float) (Ax [p]) +#define GB_Ap_BITS 64 +#define GB_Aj_BITS 64 +#define GB_Ai_BITS 64 // B matrix: full #define GB_B_IS_HYPER 0 #define GB_B_IS_SPARSE 0 #define GB_B_IS_BITMAP 0 #define GB_B_IS_FULL 1 -#define GBP_B(Bp,k,vlen) ((k) * (vlen)) -#define GBH_B(Bh,k) (k) -#define GBI_B(Bi,p,vlen) ((p) % (vlen)) -#define GBB_B(Bb,p) 1 +#define GBp_B(Bp,k,vlen) ((k) * (vlen)) +#define GBh_B(Bh,k) (k) +#define GBi_B(Bi,p,vlen) ((p) % (vlen)) +#define GBb_B(Bb,p) 1 #define GB_B_NVALS(e) int64_t e = (B->vlen * B->vdim) #define GB_B_NHELD(e) GB_B_NVALS(e) #define GB_B_ISO 0 @@ -115,11 +125,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #define GB_B2TYPE double #define GB_DECLAREB(b) double b #define GB_GETB(b,Bx,p,iso) b = (double) (Bx [p]) +#define GB_Bp_BITS 64 +#define GB_Bj_BITS 64 +#define GB_Bi_BITS 64 #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c index 6fd5ebb17a..8668784333 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__user_op__0__my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v10.0.0, Timothy A. Davis, (c) 2017-2025, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -18,7 +18,7 @@ void my_rdiv (double *z, const double *x, const double *y) { // escape this quote: " /* escape this backslash \ */ - /* modified for GrB 9.4.1 */ + /* revised for GrB 10.0.0 */ (*z) = (*y) / (*x) ; } #define GB_my_rdiv_USER_DEFN \ @@ -26,7 +26,7 @@ void my_rdiv (double *z, const double *x, const double *y) "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ -" /* modified for GrB 9.4.1 */\n" \ +" /* revised for GrB 10.0.0 */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" #define GB_USER_OP_DEFN GB_my_rdiv_USER_DEFN @@ -39,9 +39,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xa98ff14e387744fe ; - v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version - v [1] = GxB_IMPLEMENTATION_MINOR ; - v [2] = GxB_IMPLEMENTATION_SUB ; + v [0] = 10 ; v [1] = 0 ; v [2] = 0 ; defn [0] = GB_my_rdiv_USER_DEFN ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_prejit.c b/GraphBLAS/Tcov/PreJIT/GB_prejit.c index 0b848630b2..802d460291 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_prejit.c +++ b/GraphBLAS/Tcov/PreJIT/GB_prejit.c @@ -2,7 +2,7 @@ // GraphBLAS/Config/GB_prejit.c: return list of PreJIT kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,19 +13,20 @@ #include "GB.h" #include "jitifyer/GB_jitifyer.h" #include "jit_kernels/include/GB_jit_kernel_proto.h" +#include "include/GB_pedantic_disable.h" //------------------------------------------------------------------------------ // prototypes for all PreJIT kernels //------------------------------------------------------------------------------ -JIT_DOT2 (GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv) -JIT_DOT2 (GB_jit__AxB_dot2__4015bbb0bbbcd) -JIT_DOT2 (GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv) +JIT_DOT2 (GB_jit__AxB_dot2__0004015bbb0bbbcd) +JIT_DOT2 (GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2) JIT_UOP (GB_jit__user_op__0__my_rdiv) @@ -33,14 +34,14 @@ JIT_UOP (GB_jit__user_op__0__my_rdiv) // prototypes for all PreJIT query kernels //------------------------------------------------------------------------------ -JIT_Q (GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query) -JIT_Q (GB_jit__AxB_dot2__4015bbb0bbbcd_query) -JIT_Q (GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv_query) +JIT_Q (GB_jit__AxB_dot2__0004015bbb0bbbcd_query) +JIT_Q (GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2_query) JIT_Q (GB_jit__user_op__0__my_rdiv_query) @@ -51,14 +52,14 @@ JIT_Q (GB_jit__user_op__0__my_rdiv_query) #if ( 9 > 0 ) static void *GB_prejit_kernels [9] = { -GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2, -GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2, -GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv, -GB_jit__AxB_dot2__4015bbb0bbbcd, -GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2, -GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2, -GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2, -GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2, +GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2, +GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2, +GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv, +GB_jit__AxB_dot2__0004015bbb0bbbcd, +GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2, +GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2, +GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2, +GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2, GB_jit__user_op__0__my_rdiv } ; #endif @@ -70,14 +71,14 @@ GB_jit__user_op__0__my_rdiv #if ( 9 > 0 ) static void *GB_prejit_queries [9] = { -GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query, -GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query, -GB_jit__AxB_dot2__4015bbb0bbbcd_query, -GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query, -GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv_query, +GB_jit__AxB_dot2__0004015bbb0bbbcd_query, +GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2_query, GB_jit__user_op__0__my_rdiv_query } ; #endif @@ -89,14 +90,14 @@ GB_jit__user_op__0__my_rdiv_query #if ( 9 > 0 ) static char *GB_prejit_names [9] = { -"GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2", -"GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2", -"GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv", -"GB_jit__AxB_dot2__4015bbb0bbbcd", -"GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2", -"GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2", -"GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2", -"GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv", +"GB_jit__AxB_dot2__0004015bbb0bbbcd", +"GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2", +"GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2", "GB_jit__user_op__0__my_rdiv" } ; #endif diff --git a/GraphBLAS/Tcov/PreJIT/README.txt b/GraphBLAS/Tcov/PreJIT/README.txt index 7ff0980f18..c80e8443a2 100644 --- a/GraphBLAS/Tcov/PreJIT/README.txt +++ b/GraphBLAS/Tcov/PreJIT/README.txt @@ -1,43 +1,61 @@ -These JIT kernels a subset of those created by test145. -They are placed here to use a PreJIT kernels for the Tcov tests. +These JIT kernels are created by test145. +They are placed here to use as PreJIT kernels for the Tcov tests. This file has an intentionally stale function definition: - GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c + GB_jit__AxB_dot2__0004000bbb0bbbcd__plus_my_rdiv.c This file has an intentionally stale GraphBLAS version: - GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c + GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c These files should be valid PreJIT kernels: - GB_jit__AxB_dot2__0b000bba0bbacf__plus_my_rdiv2.c - GB_jit__AxB_dot2__0b100bba0baacf__plus_my_rdiv2.c - GB_jit__AxB_dot2__0b100bba0babcd__plus_my_rdiv2.c - GB_jit__AxB_dot2__0b100bba0babcf__plus_my_rdiv2.c - GB_jit__AxB_dot2__0b100bba0bbac7__plus_my_rdiv2.c - GB_jit__AxB_dot2__0b046bbb0bbbcd.c + GB_jit__AxB_dot2__0004000bba0bbacf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0004015bbb0bbbcd.c + GB_jit__AxB_dot2__0004100bba0baacf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0004100bba0babcd__plus_my_rdiv2.c + GB_jit__AxB_dot2__0004100bba0babcf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0004100bba0bbac7__plus_my_rdiv2.c GB_jit__user_op__0__my_rdiv.c This file will contain an index of the kernels listed above: GB_prejit.c -These kernels are generated by test145 but are not copied here: +These files are created by test145 but must not be added as PreJIt kernels +(adding them will reduce test coverage of GB_AxB_dot4.c): - GB_jit__AxB_dot4__4014bbb0bbbc5.c - GB_jit__AxB_dot4__4014bbb0bbbcd.c - GB_jit__AxB_dot4__4014bbb0bbbcf.c - GB_jit__AxB_dot4__4900bba0baacf__plus_my_rdiv2.c - GB_jit__AxB_dot4__4900bba0babcf__plus_my_rdiv2.c - GB_jit__AxB_dot4__4900bba0bbac7__plus_my_rdiv2.c + GB_jit__AxB_dot4__0004014bbb0bbbc5.c + GB_jit__AxB_dot4__0004014bbb0bbbcd.c + GB_jit__AxB_dot4__0004014bbb0bbbcf.c + GB_jit__AxB_dot4__0004900bba0baacf__plus_my_rdiv2.c + GB_jit__AxB_dot4__0004900bba0babcf__plus_my_rdiv2.c + GB_jit__AxB_dot4__0004900bba0bbac7__plus_my_rdiv2.c -If GraphBLAS is modified, test145 should be run again to create these JIT -kernels, using the Test/test145.m script. Next, copy the above files into -GraphBLAS/Tcov/PreJIT. Copy them into GraphBLAS/PreJIT and rerun -'make' for the main GraphBLAS library, and then copy Config/GB_prejit.c here. +If GraphBLAS is modified, the JIT kernels can be recreated as follows: -Finally, modify Test/GB_mex_rdiv.c to trigger the stale PreJIT kernel case, by -changing the string MY_RDIV. After modifying it, rerun test145 and copy the -final GB_jit__user_op__0__my_rdiv.c here. + (1) Run Test/test145 to create these JIT kernels, using the Test/test145.m + script in the GraphBLAS/Test folder. + + (2) Copy the *dot2* and *user* JIT files from ~/.SuiteSparse/GrB*/c/, and + place them in GraphBLAS/PreJIT. Leave the *dot4* files. + + (3) Rebuild GraphBLAS. + + (4) Move the JIT files from GraphBLAS/PreJIT to GraphBLAS/Tcov/PreJIT, and + move the GraphBLAS/Config/GB_prejit.c file to GraphBLAS/Tcov/PreJIT. + + (5) Modify Test/GB_mex_rdiv.c to trigger the stale PreJIT kernel case, by + changing the string MY_RDIV. After modifying it, rerun test145 and copy + the final GB_jit__user_op__0__my_rdiv.c from your ~/.SuiteSparse folder to + GraphBLAS/Tcov/PreJIT. + + (6) Edit one of the JIT kernels to trigger a stale GraphBLAS version; + ( GB_jit__AxB_dot2__0004000bba0bbac7__plus_my_rdiv2.c ). + + (7) Edit the remaining JIT kernels so that they track whatever the current + GraphBLAS version is. + + (8) Rerun the test coverage, using grbcov.m in GraphBLAS/Tcov, in MATLAB. diff --git a/GraphBLAS/Tcov/README.txt b/GraphBLAS/Tcov/README.txt index 86bd323e2a..ef7b814a37 100644 --- a/GraphBLAS/Tcov/README.txt +++ b/GraphBLAS/Tcov/README.txt @@ -1,4 +1,4 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 GraphBLAS/Tcov: statement coverage tests diff --git a/GraphBLAS/Tcov/grbcov.m b/GraphBLAS/Tcov/grbcov.m index 5f11578459..896cb21aaf 100644 --- a/GraphBLAS/Tcov/grbcov.m +++ b/GraphBLAS/Tcov/grbcov.m @@ -1,7 +1,7 @@ function grbcov %GRBCOV compile, run, and evaluate test coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 clear all diff --git a/GraphBLAS/Tcov/grbcov_testmake.m b/GraphBLAS/Tcov/grbcov_testmake.m index eb69a8aad2..e84d1646ad 100644 --- a/GraphBLAS/Tcov/grbcov_testmake.m +++ b/GraphBLAS/Tcov/grbcov_testmake.m @@ -6,7 +6,7 @@ function grbcov_testmake (what) % % See also: grbcover_edit, grbmake -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) @@ -63,27 +63,6 @@ function grbcov_testmake (what) fprintf ('\nCompiling GraphBLAS tests\nplease wait [') ; -try - if (strncmp (computer, 'GLNX', 4)) - % remove -ansi from CFLAGS and replace it with -std=c11 - cc = mex.getCompilerConfigurations ('C', 'Selected') ; - env = cc.Details.SetEnv ; - c1 = strfind (env, 'CFLAGS=') ; - q = strfind (env, '"') ; - q = q (q > c1) ; - if (~isempty (c1) && length (q) > 1) - c2 = q (2) ; - cflags = env (c1:c2) ; % the CFLAGS="..." string - ansi = strfind (cflags, '-ansi') ; - if (~isempty (ansi)) - cflags = [cflags(1:ansi-1) '-std=c11' cflags(ansi+5:end)] ; - flags = [flags ' ' cflags] ; - fprintf ('compiling with -std=c11 instead of default -ansi\n') ; - end - end - end -end - libraries = sprintf ('-L%s -lgraphblas_tcov', pwd) ; rpath = '' ; diff --git a/GraphBLAS/Tcov/grbcover_edit.m b/GraphBLAS/Tcov/grbcover_edit.m index de88506af3..482594c25f 100644 --- a/GraphBLAS/Tcov/grbcover_edit.m +++ b/GraphBLAS/Tcov/grbcover_edit.m @@ -25,7 +25,7 @@ % default : GB_cov[count]++ ; statement % -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) diff --git a/GraphBLAS/Tcov/grbmake.m b/GraphBLAS/Tcov/grbmake.m index aaa707414f..38d1aab046 100644 --- a/GraphBLAS/Tcov/grbmake.m +++ b/GraphBLAS/Tcov/grbmake.m @@ -7,7 +7,7 @@ % % See also: grbcov_testmake, grbcover_edit -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) diff --git a/GraphBLAS/Tcov/grbshow.m b/GraphBLAS/Tcov/grbshow.m index dd7d1ec139..d86b832a55 100644 --- a/GraphBLAS/Tcov/grbshow.m +++ b/GraphBLAS/Tcov/grbshow.m @@ -1,7 +1,7 @@ function grbshow %GRBSHOW create a test coverage report in tmp_cover/ -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) diff --git a/GraphBLAS/Tcov/log_16Feb2025.txt b/GraphBLAS/Tcov/log_16Feb2025.txt deleted file mode 100644 index 3e36a22fcc..0000000000 --- a/GraphBLAS/Tcov/log_16Feb2025.txt +++ /dev/null @@ -1,276 +0,0 @@ -16-Feb-2025 16:24:38 grbcov starting - ----------------------------------------------- [cover] -[malloc debugging turned off] -16-Feb 16:26:12 test297 0.3 sec 219: 18898 of 19281 2.0% 764.56/s -16-Feb 16:26:12 test286 0.3 sec 103: 18795 of 19281 2.5% 330.02/s -16-Feb 16:26:12 test286 0.0 sec 24: 18769 of 19281 2.7% 4853.39/s -16-Feb 16:26:13 test78 0.4 sec 85: 18684 of 19281 3.1% 195.52/s -16-Feb 16:26:13 test78 0.0 sec 10: 18674 of 19281 3.1% 529.75/s -16-Feb 16:26:13 test285 0.7 sec 102: 18572 of 19281 3.7% 139.74/s -16-Feb 16:26:13 test285 0.0 sec 13: 18559 of 19281 3.7% 896.98/s -16-Feb 16:26:14 test247 0.2 sec 24: 18535 of 19281 3.9% 128.90/s -16-Feb 16:26:14 test247 0.2 sec 5: 18530 of 19281 3.9% 32.03/s -16-Feb 16:26:14 test109 0.3 sec 38: 18492 of 19281 4.1% 139.76/s -16-Feb 16:26:14 test109 0.0 sec 4: 18488 of 19281 4.1% 2077.92/s -16-Feb 16:26:14 test109 0.2 sec 21: 18467 of 19281 4.2% 138.83/s -16-Feb 16:26:14 test109 0.0 sec 1: 18466 of 19281 4.2% 1145.48/s -16-Feb 16:26:14 test138 0.1 sec 62: 18404 of 19281 4.5% 429.02/s -16-Feb 16:26:14 test138 0.0 sec 1: 18403 of 19281 4.6% 46.74/s -16-Feb 16:26:14 test139 0.1 sec 28: 18375 of 19281 4.7% 186.96/s -16-Feb 16:26:15 test172 0.1 sec 53: 18322 of 19281 5.0% 855.49/s -16-Feb 16:26:15 test172 0.0 sec 4: 18318 of 19281 5.0% 129.38/s -16-Feb 16:26:15 test155 0.1 sec 246: 18072 of 19281 6.3% 4891.82/s -16-Feb 16:26:15 test155 0.0 sec 13: 18059 of 19281 6.3% 603.89/s -16-Feb 16:26:15 test174 0.3 sec 19: 18040 of 19281 6.4% 75.83/s -16-Feb 16:26:15 test174 0.0 sec 6: 18034 of 19281 6.5% 1367.05/s -16-Feb 16:26:15 test203 0.1 sec 24: 18010 of 19281 6.6% 460.87/s -16-Feb 16:26:15 test213 0.1 sec 21: 17989 of 19281 6.7% 166.84/s -16-Feb 16:26:15 test213 0.0 sec 1: 17988 of 19281 6.7% 789.27/s -16-Feb 16:26:15 test216 0.0 sec 14: 17974 of 19281 6.8% 411.15/s -16-Feb 16:26:15 test225 0.3 sec 26: 17948 of 19281 6.9% 92.80/s -16-Feb 16:26:15 test225 0.0 sec 28: 17920 of 19281 7.1% 563.31/s -16-Feb 16:26:16 test226 0.2 sec 11: 17909 of 19281 7.1% 56.21/s -16-Feb 16:26:16 test226 0.0 sec 2: 17907 of 19281 7.1% 400.72/s -16-Feb 16:26:16 test235 0.1 sec 26: 17881 of 19281 7.3% 374.12/s -16-Feb 16:26:16 test235 0.0 sec 3: 17878 of 19281 7.3% 265.84/s -16-Feb 16:26:16 test252 0.0 sec 18: 17860 of 19281 7.4% 675.17/s -16-Feb 16:26:16 test253 0.1 sec 33: 17827 of 19281 7.5% 457.19/s -16-Feb 16:26:16 test255 0.0 sec 8: 17819 of 19281 7.6% 299.78/s -16-Feb 16:26:16 test257 0.5 sec 69: 17750 of 19281 7.9% 129.88/s -16-Feb 16:26:16 test257 0.0 sec 4: 17746 of 19281 8.0% 8676.79/s -16-Feb 16:26:17 test260 0.0 sec 3: 17743 of 19281 8.0% 109.40/s -16-Feb 16:26:17 test261 0.0 sec 37: 17706 of 19281 8.2% 1485.11/s -16-Feb 16:26:17 test262 0.0 sec 38: 17668 of 19281 8.4% 1504.59/s -16-Feb 16:26:17 test263 0.3 sec 14: 17654 of 19281 8.4% 49.50/s -16-Feb 16:26:17 test263 0.0 sec 4: 17650 of 19281 8.5% 2403.85/s -16-Feb 16:26:17 test264 0.0 sec 149: 17501 of 19281 9.2% 5326.56/s -16-Feb 16:26:17 test265 0.3 sec 21: 17480 of 19281 9.3% 71.11/s -16-Feb 16:26:17 test265 0.0 sec 1: 17479 of 19281 9.3% 1818.18/s -16-Feb 16:26:17 test267 0.2 sec 20: 17459 of 19281 9.4% 87.68/s -16-Feb 16:26:17 test269 0.0 sec 140: 17319 of 19281 10.2% 4399.61/s -16-Feb 16:26:18 test271 0.0 sec 544: 16775 of 19281 13.0% 14629.95/s -16-Feb 16:26:18 test272 0.0 sec 10: 16765 of 19281 13.0% 381.49/s -16-Feb 16:26:18 test273 0.1 sec 131: 16634 of 19281 13.7% 1797.75/s -16-Feb 16:26:18 test274 0.0 sec 119: 16515 of 19281 14.3% 3851.01/s -16-Feb 16:26:18 test276 0.1 sec 1696: 14819 of 19281 23.1% 16693.41/s -16-Feb 16:26:18 test277 0.0 sec 38: 14781 of 19281 23.3% 1431.37/s -16-Feb 16:26:18 test279 0.0 sec 47: 14734 of 19281 23.6% 1839.31/s -16-Feb 16:26:18 test281 0.0 sec 16: 14718 of 19281 23.7% 611.29/s -16-Feb 16:26:18 test268 0.2 sec 4: 14714 of 19281 23.7% 21.96/s -16-Feb 16:26:18 test268 0.0 sec 4: 14710 of 19281 23.7% 650.62/s -16-Feb 16:26:18 test207 0.0 sec 10: 14700 of 19281 23.8% 5159.96/s -16-Feb 16:26:19 test211 0.4 sec 25: 14675 of 19281 23.9% 56.97/s -16-Feb 16:26:19 test211 0.0 sec 6: 14669 of 19281 23.9% 932.98/s -16-Feb 16:26:19 test183 0.2 sec 21: 14648 of 19281 24.0% 134.00/s -16-Feb 16:26:19 test212 0.2 sec 8: 14640 of 19281 24.1% 38.31/s -16-Feb 16:26:19 test212 0.0 sec 6: 14634 of 19281 24.1% 1663.89/s -16-Feb 16:26:19 test219 0.0 sec 8: 14626 of 19281 24.1% 285.38/s -16-Feb 16:26:19 test219 0.0 sec 5: 14621 of 19281 24.2% 9469.70/s -[malloc debugging turned on] -16-Feb 16:26:19 test244 0.1 sec 40: 14581 of 19281 24.4% 606.89/s -16-Feb 16:26:19 test194 0.1 sec 28: 14553 of 19281 24.5% 288.84/s -16-Feb 16:26:19 test09 0.3 sec 16: 14537 of 19281 24.6% 63.61/s -16-Feb 16:26:19 test09 0.0 sec 2: 14535 of 19281 24.6% 1029.87/s -16-Feb 16:26:20 test108 0.2 sec 51: 14484 of 19281 24.9% 272.99/s -16-Feb 16:26:20 test108 0.0 sec 25: 14459 of 19281 25.0% 659.46/s -16-Feb 16:26:20 test137 0.1 sec 14: 14445 of 19281 25.1% 93.40/s -16-Feb 16:26:20 test137 0.0 sec 1: 14444 of 19281 25.1% 368.32/s -16-Feb 16:26:20 test137 0.0 sec 1: 14443 of 19281 25.1% 267.74/s -16-Feb 16:26:20 test124 0.2 sec 5: 14438 of 19281 25.1% 31.86/s -16-Feb 16:26:20 test133 0.3 sec 8: 14430 of 19281 25.2% 23.99/s -16-Feb 16:26:20 test133 0.1 sec 20: 14410 of 19281 25.3% 147.57/s -16-Feb 16:26:21 test176 0.4 sec 34: 14376 of 19281 25.4% 79.95/s -16-Feb 16:26:21 test176 0.1 sec 10: 14366 of 19281 25.5% 171.69/s -16-Feb 16:26:21 test197 0.2 sec 18: 14348 of 19281 25.6% 99.56/s -16-Feb 16:26:21 test197 0.2 sec 3: 14345 of 19281 25.6% 16.68/s -16-Feb 16:26:21 test201 0.1 sec 22: 14323 of 19281 25.7% 408.37/s -16-Feb 16:26:21 test208 0.1 sec 17: 14306 of 19281 25.8% 260.64/s -16-Feb 16:26:21 test214 0.0 sec 34: 14272 of 19281 26.0% 11533.24/s -16-Feb 16:26:21 test214 0.0 sec 5: 14267 of 19281 26.0% 2354.05/s -16-Feb 16:26:21 test223 0.0 sec 19: 14248 of 19281 26.1% 2313.41/s -16-Feb 16:26:21 test223 0.0 sec 1: 14247 of 19281 26.1% 63.31/s -16-Feb 16:26:22 test241 0.1 sec 56: 14191 of 19281 26.4% 926.78/s -16-Feb 16:26:22 test241 0.0 sec 8: 14183 of 19281 26.4% 236.32/s -16-Feb 16:26:22 test270 0.0 sec 288: 13895 of 19281 27.9% 9768.01/s -16-Feb 16:26:22 test199 0.0 sec 16: 13879 of 19281 28.0% 6923.41/s -16-Feb 16:26:22 test210 0.1 sec 1: 13878 of 19281 28.0% 8.15/s -16-Feb 16:26:22 test210 0.0 sec 3: 13875 of 19281 28.0% 3314.92/s -16-Feb 16:26:22 test165 0.0 sec 13: 13862 of 19281 28.1% 5522.51/s -16-Feb 16:26:22 test221 0.1 sec 7: 13855 of 19281 28.1% 59.76/s -16-Feb 16:26:22 test221 0.0 sec 2: 13853 of 19281 28.2% 1746.72/s -16-Feb 16:26:22 test278 0.0 sec 51: 13802 of 19281 28.4% 1835.92/s -16-Feb 16:26:22 test162 0.0 sec 20: 13782 of 19281 28.5% 1056.36/s -16-Feb 16:26:22 test162 0.0 sec 1: 13781 of 19281 28.5% 38.75/s -16-Feb 16:26:22 test275 0.0 sec 27: 13754 of 19281 28.7% 917.74/s -16-Feb 16:26:22 test220 0.2 sec 10: 13744 of 19281 28.7% 54.64/s -16-Feb 16:26:22 test83 0.3 sec 11: 13733 of 19281 28.8% 43.53/s -16-Feb 16:26:22 test83 0.0 sec 1: 13732 of 19281 28.8% 1338.69/s -16-Feb 16:26:23 test04 0.7 sec 19: 13713 of 19281 28.9% 28.17/s -16-Feb 16:26:23 test04 0.0 sec 8: 13705 of 19281 28.9% 642.36/s -16-Feb 16:26:23 test132 0.0 sec 14: 13691 of 19281 29.0% 409.64/s -16-Feb 16:26:23 test82 0.2 sec 16: 13675 of 19281 29.1% 68.56/s -16-Feb 16:26:23 test202 0.0 sec 77: 13598 of 19281 29.5% 3938.82/s -16-Feb 16:26:23 test202 0.0 sec 2: 13596 of 19281 29.5% 198.53/s -16-Feb 16:26:24 test202 0.0 sec 4: 13592 of 19281 29.5% 425.89/s -16-Feb 16:26:24 test222 0.1 sec 39: 13553 of 19281 29.7% 718.32/s -16-Feb 16:26:24 test204 0.0 sec 10: 13543 of 19281 29.8% 393.44/s -16-Feb 16:26:24 test258 0.1 sec 13: 13530 of 19281 29.8% 126.42/s -16-Feb 16:26:24 test258 0.0 sec 2: 13528 of 19281 29.8% 2123.14/s -16-Feb 16:26:25 test136 1.0 sec 10: 13518 of 19281 29.9% 10.48/s -16-Feb 16:26:25 test136 0.0 sec 32: 13486 of 19281 30.1% 2747.96/s -16-Feb 16:26:25 test128 0.8 sec 57: 13429 of 19281 30.4% 71.69/s -16-Feb 16:26:26 test128 0.1 sec 3: 13426 of 19281 30.4% 28.10/s -16-Feb 16:26:26 test144 0.2 sec 6: 13420 of 19281 30.4% 28.55/s -[malloc debugging turned off] -16-Feb 16:26:26 test81 0.6 sec 15: 13405 of 19281 30.5% 25.55/s -16-Feb 16:26:27 testc2(0,0) 0.4 sec 183: 13222 of 19281 31.4% 408.55/s -16-Feb 16:26:27 test239 0.0 sec 10: 13212 of 19281 31.5% 1226.39/s -16-Feb 16:26:27 test239 0.3 sec 1: 13211 of 19281 31.5% 3.46/s -16-Feb 16:26:28 test245 0.3 sec 34: 13177 of 19281 31.7% 98.49/s -16-Feb 16:26:28 test245 0.0 sec 8: 13169 of 19281 31.7% 914.08/s -16-Feb 16:26:28 test159 0.3 sec 45: 13124 of 19281 31.9% 143.03/s -16-Feb 16:26:29 test259 0.9 sec 27: 13097 of 19281 32.1% 28.63/s -16-Feb 16:26:29 test259 0.0 sec 1: 13096 of 19281 32.1% 228.47/s -16-Feb 16:26:30 testc4(0) 1.1 sec 12: 13084 of 19281 32.1% 11.16/s -16-Feb 16:26:30 test157 0.6 sec 64: 13020 of 19281 32.5% 112.59/s -16-Feb 16:26:31 test157 0.1 sec 12: 13008 of 19281 32.5% 80.82/s -16-Feb 16:26:32 test182 1.3 sec 25: 12983 of 19281 32.7% 19.53/s -16-Feb 16:26:32 test182 0.2 sec 11: 12972 of 19281 32.7% 44.61/s -16-Feb 16:26:34 test195 2.0 sec 65: 12907 of 19281 33.1% 31.71/s -16-Feb 16:26:44 test173 9.3 sec 27: 12880 of 19281 33.2% 2.90/s -16-Feb 16:26:44 test173 0.4 sec 9: 12871 of 19281 33.2% 23.21/s -16-Feb 16:26:48 test135 3.7 sec 45: 12826 of 19281 33.5% 12.03/s -16-Feb 16:26:55 test84 6.8 sec 33: 12793 of 19281 33.6% 4.83/s -16-Feb 16:26:55 test84 0.3 sec 21: 12772 of 19281 33.8% 65.41/s -16-Feb 16:26:55 test215 0.1 sec 2: 12770 of 19281 33.8% 23.19/s -16-Feb 16:26:55 test80 0.2 sec 13: 12757 of 19281 33.8% 68.48/s -16-Feb 16:26:56 test200 0.7 sec 11: 12746 of 19281 33.9% 16.33/s -16-Feb 16:26:58 test283 2.2 sec 95: 12651 of 19281 34.4% 42.68/s -16-Feb 16:26:58 test254 0.3 sec 25: 12626 of 19281 34.5% 96.65/s -16-Feb 16:26:59 test254 1.1 sec 1: 12625 of 19281 34.5% 0.92/s -16-Feb 16:27:01 test142b 1.7 sec 25: 12600 of 19281 34.7% 14.44/s -16-Feb 16:27:01 test142b 0.0 sec 10: 12590 of 19281 34.7% 625.59/s -16-Feb 16:27:50 test142 48.7 sec 585: 12005 of 19281 37.7% 12.00/s -16-Feb 16:27:51 test142 0.4 sec 2: 12003 of 19281 37.7% 4.65/s -16-Feb 16:27:53 test54 2.9 sec 17: 11986 of 19281 37.8% 5.84/s -16-Feb 16:27:55 test54 1.1 sec 11: 11975 of 19281 37.9% 9.68/s -16-Feb 16:27:57 testcc(1) 2.1 sec 4: 11971 of 19281 37.9% 1.89/s -16-Feb 16:27:58 testcc(1) 1.6 sec 6: 11965 of 19281 37.9% 3.82/s -16-Feb 16:27:59 testc2(1,1) 0.2 sec 11: 11954 of 19281 38.0% 48.95/s -16-Feb 16:28:01 testc2(1,1) 2.4 sec 4: 11950 of 19281 38.0% 1.64/s -16-Feb 16:28:53 test227 51.6 sec 28: 11922 of 19281 38.2% 0.54/s -16-Feb 16:28:54 test141 1.0 sec 440: 11482 of 19281 40.4% 444.42/s -16-Feb 16:28:54 test179 0.0 sec 22: 11460 of 19281 40.6% 555.29/s -16-Feb 16:28:54 test179 0.7 sec 10: 11450 of 19281 40.6% 15.15/s -16-Feb 16:28:54 test188b 0.0 sec 38: 11412 of 19281 40.8% 1019.18/s -16-Feb 16:28:55 test185 0.0 sec 22: 11390 of 19281 40.9% 571.28/s -16-Feb 16:28:55 test256 0.2 sec 48: 11342 of 19281 41.2% 234.50/s -16-Feb 16:28:55 test256 0.0 sec 1: 11341 of 19281 41.2% 1086.96/s -16-Feb 16:28:55 test238b 0.7 sec 25: 11316 of 19281 41.3% 34.35/s -16-Feb 16:28:56 test238 0.0 sec 63: 11253 of 19281 41.6% 1321.42/s -16-Feb 16:28:56 test186 0.9 sec 25: 11228 of 19281 41.8% 27.28/s -16-Feb 16:28:57 test186 0.1 sec : 11228 of 19281 41.8% -16-Feb 16:28:57 test186 0.1 sec : 11228 of 19281 41.8% -[malloc debugging turned on] -16-Feb 16:28:59 testca(1) 2.1 sec 38: 11190 of 19281 42.0% 18.46/s -16-Feb 16:29:00 testca(1) 1.7 sec 2: 11188 of 19281 42.0% 1.17/s -16-Feb 16:29:09 test130 8.7 sec 19: 11169 of 19281 42.1% 2.20/s -16-Feb 16:29:09 test130 0.4 sec 12: 11157 of 19281 42.1% 33.89/s -16-Feb 16:29:10 test148 0.5 sec 6: 11151 of 19281 42.2% 12.03/s -16-Feb 16:29:10 test148 0.0 sec 4: 11147 of 19281 42.2% 1606.43/s -16-Feb 16:29:12 test231 1.6 sec 386: 10761 of 19281 44.2% 242.07/s -16-Feb 16:29:12 test231 0.2 sec 7: 10754 of 19281 44.2% 31.86/s -16-Feb 16:29:12 test129 0.3 sec 7: 10747 of 19281 44.3% 23.42/s -16-Feb 16:29:15 test69 2.9 sec 16: 10731 of 19281 44.3% 5.53/s -16-Feb 16:29:17 test69 2.3 sec 3: 10728 of 19281 44.4% 1.29/s -16-Feb 16:29:19 test29 1.8 sec 154: 10574 of 19281 45.2% 87.74/s -16-Feb 16:29:21 test29 1.7 sec 2: 10572 of 19281 45.2% 1.18/s -16-Feb 16:29:21 test282 0.3 sec 15: 10557 of 19281 45.2% 43.78/s -16-Feb 16:29:22 test249 0.4 sec 29: 10528 of 19281 45.4% 65.55/s -16-Feb 16:29:22 test249 0.4 sec 1: 10527 of 19281 45.4% 2.45/s -16-Feb 16:29:23 test196 0.5 sec 17: 10510 of 19281 45.5% 32.46/s -16-Feb 16:29:23 test250 0.5 sec 80: 10430 of 19281 45.9% 149.54/s -16-Feb 16:29:24 test250 0.8 sec 2: 10428 of 19281 45.9% 2.65/s -16-Feb 16:29:25 test145 0.8 sec 20: 10408 of 19281 46.0% 25.82/s -16-Feb 16:29:25 test145 0.0 sec 6: 10402 of 19281 46.1% 974.03/s -16-Feb 16:29:27 test229 2.1 sec 11: 10391 of 19281 46.1% 5.25/s -16-Feb 16:29:28 test209 1.6 sec 25: 10366 of 19281 46.2% 15.52/s -16-Feb 16:29:30 test224 1.2 sec 59: 10307 of 19281 46.5% 48.36/s -16-Feb 16:29:30 test191 0.3 sec 26: 10281 of 19281 46.7% 86.22/s -16-Feb 16:29:30 test191 0.1 sec 2: 10279 of 19281 46.7% 21.51/s -16-Feb 16:29:30 test150 0.0 sec 15: 10264 of 19281 46.8% 491.53/s -16-Feb 16:29:30 test240 0.4 sec 25: 10239 of 19281 46.9% 66.49/s -16-Feb 16:29:31 test240 0.4 sec 1: 10238 of 19281 46.9% 2.84/s -16-Feb 16:29:31 test237 0.4 sec 11: 10227 of 19281 47.0% 29.19/s -16-Feb 16:29:31 test237 0.0 sec 1: 10226 of 19281 47.0% 104.40/s -16-Feb 16:29:31 test237 0.0 sec 1: 10225 of 19281 47.0% 102.42/s -16-Feb 16:29:31 test237 0.0 sec 1: 10224 of 19281 47.0% 130.36/s -16-Feb 16:29:32 test184 1.0 sec 10: 10214 of 19281 47.0% 9.76/s -16-Feb 16:29:34 test236 2.0 sec 86: 10128 of 19281 47.5% 42.28/s -[malloc debugging turned off] -16-Feb 16:29:45 test230 10.6 sec 250: 9878 of 19281 48.8% 23.61/s -16-Feb 16:29:46 test230 1.5 sec 2: 9876 of 19281 48.8% 1.30/s -16-Feb 16:29:55 test18 8.3 sec 90: 9786 of 19281 49.2% 10.88/s -16-Feb 16:29:57 test18 2.5 sec 5: 9781 of 19281 49.3% 1.97/s -16-Feb 16:30:21 testc7(0) 23.6 sec 7: 9774 of 19281 49.3% 0.30/s -16-Feb 16:30:26 testc7(0) 5.0 sec 6: 9768 of 19281 49.3% 1.21/s -16-Feb 16:30:38 test193 12.2 sec 192: 9576 of 19281 50.3% 15.70/s -16-Feb 16:30:41 test127 2.5 sec 927: 8649 of 19281 55.1% 367.62/s -16-Feb 16:30:45 test23 4.0 sec 61: 8588 of 19281 55.5% 15.20/s -16-Feb 16:30:50 test243 5.4 sec 24: 8564 of 19281 55.6% 4.45/s -16-Feb 16:31:51 test53 60.7 sec 21: 8543 of 19281 55.7% 0.35/s -16-Feb 16:31:55 test53 3.7 sec 5: 8538 of 19281 55.7% 1.34/s -16-Feb 16:32:05 test242 9.9 sec 63: 8475 of 19281 56.0% 6.34/s -16-Feb 16:32:15 test17 10.2 sec 33: 8442 of 19281 56.2% 3.25/s -16-Feb 16:32:24 test246 8.9 sec 4: 8438 of 19281 56.2% 0.45/s -16-Feb 16:32:24 test206 0.5 sec 87: 8351 of 19281 56.7% 164.20/s -16-Feb 16:32:29 test206 4.8 sec 6: 8345 of 19281 56.7% 1.25/s -16-Feb 16:32:34 test251b 5.0 sec 25: 8320 of 19281 56.8% 4.97/s -16-Feb 16:32:45 test251 10.7 sec 94: 8226 of 19281 57.3% 8.81/s -16-Feb 16:32:57 test152 12.5 sec 93: 8133 of 19281 57.8% 7.46/s -16-Feb 16:33:11 test152 13.8 sec 64: 8069 of 19281 58.2% 4.64/s -16-Feb 16:33:14 test160 2.6 sec 17: 8052 of 19281 58.2% 6.59/s -16-Feb 16:33:38 test232 24.2 sec 38: 8014 of 19281 58.4% 1.57/s -16-Feb 16:33:38 test232 0.3 sec 4: 8010 of 19281 58.5% 12.89/s -16-Feb 16:34:43 test19 64.3 sec 32: 7978 of 19281 58.6% 0.50/s -16-Feb 16:34:44 test19 0.9 sec 87: 7891 of 19281 59.1% 98.58/s -16-Feb 16:36:12 test19b 88.4 sec 22: 7869 of 19281 59.2% 0.25/s -16-Feb 16:36:13 test19b 1.4 sec 18: 7851 of 19281 59.3% 13.23/s -16-Feb 16:36:15 test192 1.1 sec 3: 7848 of 19281 59.3% 2.66/s -16-Feb 16:36:22 test181 7.8 sec 4: 7844 of 19281 59.3% 0.51/s -16-Feb 16:36:27 test181 4.3 sec 11: 7833 of 19281 59.4% 2.58/s -[malloc debugging turned on] -16-Feb 16:36:36 test02 9.6 sec 3: 7830 of 19281 59.4% 0.31/s -16-Feb 16:36:49 test11 12.2 sec 12: 7818 of 19281 59.5% 0.98/s -16-Feb 16:36:52 test187 3.6 sec 6: 7812 of 19281 59.5% 1.68/s -16-Feb 16:36:54 test187 2.0 sec 1: 7811 of 19281 59.5% 0.50/s -16-Feb 16:36:57 test189 2.7 sec 6: 7805 of 19281 59.5% 2.20/s -16-Feb 16:37:00 test169 2.6 sec 32: 7773 of 19281 59.7% 12.27/s -16-Feb 16:37:03 test76 3.3 sec 14: 7759 of 19281 59.8% 4.22/s -16-Feb 16:37:10 test01 7.5 sec 691: 7068 of 19281 63.3% 92.38/s -16-Feb 16:37:15 test01 4.2 sec 1: 7067 of 19281 63.3% 0.24/s -16-Feb 16:37:19 test228 4.3 sec 26: 7041 of 19281 63.5% 6.11/s -16-Feb 16:37:23 test104 4.2 sec 36: 7005 of 19281 63.7% 8.67/s -16-Feb 16:37:49 test284 26.3 sec 68: 6937 of 19281 64.0% 2.58/s -16-Feb 16:37:51 test284 1.9 sec 4: 6933 of 19281 64.0% 2.10/s -16-Feb 16:38:01 test180 10.1 sec 3: 6930 of 19281 64.1% 0.30/s -16-Feb 16:38:04 test180 2.3 sec 7: 6923 of 19281 64.1% 3.07/s -16-Feb 16:38:13 test188 9.0 sec 169: 6754 of 19281 65.0% 18.78/s -16-Feb 16:38:36 test151b 23.4 sec 37: 6717 of 19281 65.2% 1.58/s -16-Feb 16:38:36 test151b 0.2 sec 15: 6702 of 19281 65.2% 73.68/s -16-Feb 16:38:55 test14b 19.0 sec 95: 6607 of 19281 65.7% 5.01/s -16-Feb 16:39:19 test14 23.8 sec 257: 6350 of 19281 67.1% 10.78/s -[malloc debugging turned off] -16-Feb 16:39:48 test125 28.4 sec 319: 6031 of 19281 68.7% 11.25/s -16-Feb 16:40:29 test10 41.3 sec 741: 5290 of 19281 72.6% 17.93/s -16-Feb 16:41:06 test75b 37.2 sec 293: 4997 of 19281 74.1% 7.88/s -16-Feb 16:41:35 test74 28.2 sec 4101: 896 of 19281 95.4% 145.25/s -16-Feb 16:43:39 test234 124.8 sec 198: 698 of 19281 96.4% 1.59/s -[malloc debugging turned on] -16-Feb 16:43:40 test154b 0.0 sec 12: 686 of 19281 96.4% 635.59/s -16-Feb 16:45:27 test154 107.3 sec 657: 29 of 19281 99.8% 6.12/s -16-Feb 16:45:32 test280 4.9 sec 12: 17 of 19281 99.9% 2.46/s -16-Feb 16:46:31 test21b 59.1 sec 17: all 19281 full 100% 0.29/s -[malloc debugging turned off] -16-Feb-2025 16:46:31 grbcov ending diff --git a/GraphBLAS/Tcov/log_27Feb2025.txt b/GraphBLAS/Tcov/log_27Feb2025.txt new file mode 100644 index 0000000000..bba52933cd --- /dev/null +++ b/GraphBLAS/Tcov/log_27Feb2025.txt @@ -0,0 +1,324 @@ +27-Feb-2025 08:20:38 grbcov starting +total blocks: 19574 + +---------------------------------------------- [cover] +[malloc debugging turned off] +27-Feb 08:22:14 test297 0:(32,32,32) 0.3 sec 243: 19114 2.4% 826.2/s +27-Feb 08:22:14 test295 0:(32,32,32) 0.0 sec 92: 19020 2.8% 5271.0/s +27-Feb 08:22:14 test294 0:(32,32,32) 0.1 sec 23: 18996 3.0% 220.0/s +27-Feb 08:22:17 test293 0:(32,32,32) 3.1 sec 76: 18920 3.3% 24.7/s +27-Feb 08:22:17 test291 0:(32,32,32) 0.0 sec 24: 18896 3.5% 1415.5/s +27-Feb 08:22:17 test291 1:(32,32,64) 0.0 sec 1: 18893 3.5% 3773.6/s +27-Feb 08:22:17 test291 2:(32,64,32) 0.0 sec 4: 18889 3.5% 24242.4/s +27-Feb 08:22:17 test291 4:(64,32,32) 0.0 sec 1: 18888 3.5% 6060.6/s +27-Feb 08:22:18 test290 0:(32,32,32) 1.6 sec 18: 18870 3.6% 11.1/s +27-Feb 08:22:18 test287 0:(32,32,32) 0.0 sec 137: 18733 4.3% 6266.6/s +27-Feb 08:22:18 test287 4:(64,32,32) 0.0 sec : 18733 4.3% +27-Feb 08:22:19 test286 0:(32,32,32) 0.8 sec 80: 18653 4.7% 95.5/s +27-Feb 08:22:19 test286 0:(32,32,32) 0.0 sec 17: 18636 4.8% 4514.1/s +27-Feb 08:22:20 test286 1:(32,32,64) 0.9 sec : 18636 4.8% +27-Feb 08:22:20 test286 1:(32,32,64) 0.0 sec 1: 18635 4.8% 924.2/s +27-Feb 08:22:21 test286 2:(32,64,32) 0.8 sec : 18635 4.8% +27-Feb 08:22:21 test286 2:(32,64,32) 0.0 sec : 18635 4.8% +27-Feb 08:22:22 test286 4:(64,32,32) 0.9 sec 1: 18634 4.8% 1.1/s +27-Feb 08:22:22 test286 4:(64,32,32) 0.0 sec : 18634 4.8% +27-Feb 08:22:23 test78 0:(32,32,32) 0.5 sec 67: 18567 5.1% 123.4/s +27-Feb 08:22:23 test78 0:(32,32,32) 0.0 sec 5: 18562 5.2% 473.3/s +27-Feb 08:22:23 test78 4:(64,32,32) 0.2 sec 1: 18561 5.2% 4.3/s +27-Feb 08:22:23 test78 4:(64,32,32) 0.0 sec : 18561 5.2% +27-Feb 08:22:24 test285 0:(32,32,32) 0.8 sec 96: 18465 5.7% 125.7/s +27-Feb 08:22:24 test285 0:(32,32,32) 0.0 sec 12: 18453 5.7% 829.8/s +27-Feb 08:22:24 test247 0:(32,32,32) 0.1 sec 23: 18427 5.9% 202.9/s +27-Feb 08:22:24 test247 0:(32,32,32) 0.1 sec 5: 18422 5.9% 56.9/s +27-Feb 08:22:24 test109 0:(32,32,32) 0.2 sec 33: 18389 6.1% 138.8/s +27-Feb 08:22:24 test109 0:(32,32,32) 0.0 sec 2: 18387 6.1% 1445.1/s +27-Feb 08:22:24 test109 0:(32,32,32) 0.1 sec 21: 18366 6.2% 170.8/s +27-Feb 08:22:24 test109 0:(32,32,32) 0.0 sec 1: 18365 6.2% 1189.1/s +27-Feb 08:22:24 test138 0:(32,32,32) 0.1 sec 49: 18316 6.4% 342.6/s +27-Feb 08:22:24 test138 0:(32,32,32) 0.0 sec 1: 18315 6.4% 36.5/s +27-Feb 08:22:24 test172 0:(32,32,32) 0.1 sec 47: 18267 6.7% 922.5/s +27-Feb 08:22:24 test172 0:(32,32,32) 0.0 sec 4: 18263 6.7% 129.5/s +27-Feb 08:22:25 test155 0:(32,32,32) 0.0 sec 162: 18101 7.5% 4004.8/s +27-Feb 08:22:25 test155 0:(32,32,32) 0.0 sec 5: 18096 7.6% 225.3/s +27-Feb 08:22:25 test155 2:(32,64,32) 0.0 sec 2: 18094 7.6% 114.6/s +27-Feb 08:22:25 test155 2:(32,64,32) 0.0 sec : 18094 7.6% +27-Feb 08:22:25 test155 4:(64,32,32) 0.0 sec 1: 18093 7.6% 56.2/s +27-Feb 08:22:25 test155 4:(64,32,32) 0.0 sec : 18093 7.6% +27-Feb 08:22:25 test174 0:(32,32,32) 0.2 sec 20: 18073 7.7% 91.2/s +27-Feb 08:22:25 test174 0:(32,32,32) 0.0 sec 6: 18067 7.7% 1369.2/s +27-Feb 08:22:25 test203 0:(32,32,32) 0.0 sec 26: 18041 7.8% 1454.1/s +27-Feb 08:22:25 test213 0:(32,32,32) 0.2 sec 15: 18026 7.9% 97.4/s +27-Feb 08:22:25 test213 0:(32,32,32) 0.0 sec 1: 18025 7.9% 765.1/s +27-Feb 08:22:25 test216 0:(32,32,32) 0.0 sec 14: 18011 8.0% 617.8/s +27-Feb 08:22:25 test225 0:(32,32,32) 0.3 sec 25: 17986 8.1% 93.3/s +27-Feb 08:22:25 test225 0:(32,32,32) 0.1 sec 29: 17957 8.3% 573.8/s +27-Feb 08:22:26 test226 0:(32,32,32) 0.2 sec 11: 17946 8.3% 58.0/s +27-Feb 08:22:26 test226 0:(32,32,32) 0.0 sec 2: 17944 8.3% 425.2/s +27-Feb 08:22:26 test235 0:(32,32,32) 0.0 sec 26: 17918 8.5% 549.4/s +27-Feb 08:22:26 test235 0:(32,32,32) 0.0 sec 3: 17915 8.5% 270.0/s +27-Feb 08:22:26 test252 0:(32,32,32) 0.0 sec 18: 17897 8.6% 1154.4/s +27-Feb 08:22:26 test253 0:(32,32,32) 0.1 sec 30: 17867 8.7% 585.7/s +27-Feb 08:22:26 test255 0:(32,32,32) 0.0 sec 8: 17859 8.8% 515.0/s +27-Feb 08:22:26 test257 0:(32,32,32) 0.5 sec 58: 17801 9.1% 112.4/s +27-Feb 08:22:26 test257 0:(32,32,32) 0.0 sec 4: 17797 9.1% 8620.7/s +27-Feb 08:22:26 test260 0:(32,32,32) 0.0 sec 3: 17794 9.1% 181.7/s +27-Feb 08:22:26 test261 0:(32,32,32) 0.0 sec 38: 17756 9.3% 2664.6/s +27-Feb 08:22:26 test262 0:(32,32,32) 0.0 sec 14: 17742 9.4% 952.1/s +27-Feb 08:22:27 test263 0:(32,32,32) 0.3 sec 12: 17730 9.4% 43.4/s +27-Feb 08:22:27 test263 0:(32,32,32) 0.0 sec 2: 17728 9.4% 1246.9/s +27-Feb 08:22:27 test264 0:(32,32,32) 0.0 sec 147: 17581 10.2% 8841.0/s +27-Feb 08:22:27 test265 0:(32,32,32) 0.3 sec 16: 17565 10.3% 54.8/s +27-Feb 08:22:27 test265 0:(32,32,32) 0.0 sec 1: 17564 10.3% 1949.3/s +27-Feb 08:22:27 test267 0:(32,32,32) 0.2 sec 16: 17548 10.4% 65.6/s +27-Feb 08:22:27 test269 0:(32,32,32) 0.0 sec 129: 17419 11.0% 6506.6/s +27-Feb 08:22:27 test271 0:(32,32,32) 0.0 sec 543: 16876 13.8% 25938.7/s +27-Feb 08:22:27 test272 0:(32,32,32) 0.0 sec 8: 16868 13.8% 539.5/s +27-Feb 08:22:27 test273 0:(32,32,32) 0.1 sec 126: 16742 14.5% 2091.8/s +27-Feb 08:22:27 test274 0:(32,32,32) 0.0 sec 119: 16623 15.1% 6671.2/s +27-Feb 08:22:28 test276 0:(32,32,32) 0.2 sec 1695: 14928 23.7% 8974.3/s +27-Feb 08:22:28 test277 0:(32,32,32) 0.0 sec 37: 14891 23.9% 2233.4/s +27-Feb 08:22:28 test279 0:(32,32,32) 0.0 sec 67: 14824 24.3% 4265.9/s +27-Feb 08:22:28 test281 0:(32,32,32) 0.0 sec 16: 14808 24.3% 1057.9/s +27-Feb 08:22:28 test268 0:(32,32,32) 0.2 sec 4: 14804 24.4% 19.5/s +27-Feb 08:22:28 test268 0:(32,32,32) 0.0 sec 4: 14800 24.4% 757.9/s +27-Feb 08:22:28 test207 0:(32,32,32) 0.0 sec 7: 14793 24.4% 2568.8/s +27-Feb 08:22:28 test207 1:(32,32,64) 0.0 sec 1: 14792 24.4% 817.7/s +27-Feb 08:22:28 test211 0:(32,32,32) 0.5 sec 24: 14768 24.6% 49.4/s +27-Feb 08:22:28 test211 0:(32,32,32) 0.0 sec 6: 14762 24.6% 1001.0/s +27-Feb 08:22:29 test183 0:(32,32,32) 0.2 sec 18: 14744 24.7% 86.1/s +27-Feb 08:22:29 test212 0:(32,32,32) 0.3 sec 10: 14733 24.7% 37.5/s +27-Feb 08:22:29 test212 0:(32,32,32) 0.0 sec 5: 14728 24.8% 1344.8/s +27-Feb 08:22:29 test219 0:(32,32,32) 0.0 sec 8: 14720 24.8% 449.6/s +27-Feb 08:22:29 test219 0:(32,32,32) 0.0 sec 4: 14716 24.8% 7504.7/s +[malloc debugging turned on] +27-Feb 08:22:29 test296 0:(32,32,32) 0.0 sec 28: 14688 25.0% 10827.5/s +27-Feb 08:22:29 test289 0:(32,32,32) 0.2 sec 89: 14599 25.4% 457.1/s +27-Feb 08:22:29 test288 0:(32,32,32) 0.0 sec 23: 14576 25.5% 1351.2/s +27-Feb 08:22:29 test244 0:(32,32,32) 0.1 sec 27: 14549 25.7% 472.1/s +27-Feb 08:22:29 test244 1:(32,32,64) 0.0 sec 2: 14547 25.7% 67.8/s +27-Feb 08:22:29 test194 0:(32,32,32) 0.1 sec 25: 14522 25.8% 231.1/s +27-Feb 08:22:30 test09 0:(32,32,32) 0.2 sec 12: 14510 25.9% 48.0/s +27-Feb 08:22:30 test09 0:(32,32,32) 0.0 sec 4: 14506 25.9% 2289.6/s +27-Feb 08:22:30 test108 0:(32,32,32) 0.2 sec 51: 14455 26.2% 274.1/s +27-Feb 08:22:30 test108 0:(32,32,32) 0.0 sec 25: 14430 26.3% 549.8/s +27-Feb 08:22:30 test137 0:(32,32,32) 0.1 sec 14: 14416 26.4% 132.6/s +27-Feb 08:22:30 test137 0:(32,32,32) 0.0 sec 1: 14415 26.4% 352.1/s +27-Feb 08:22:30 test137 0:(32,32,32) 0.0 sec 1: 14414 26.4% 264.1/s +27-Feb 08:22:30 test124 0:(32,32,32) 0.2 sec 6: 14408 26.4% 29.6/s +27-Feb 08:22:34 test133 0:(32,32,32) 4.0 sec 16: 14392 26.5% 4.0/s +27-Feb 08:22:39 test133 0:(32,32,32) 4.4 sec 21: 14371 26.6% 4.8/s +27-Feb 08:22:40 test176 0:(32,32,32) 1.7 sec 29: 14342 26.7% 17.1/s +27-Feb 08:22:40 test176 0:(32,32,32) 0.1 sec 10: 14332 26.8% 154.8/s +27-Feb 08:22:41 test197 0:(32,32,32) 0.2 sec 12: 14320 26.8% 64.0/s +27-Feb 08:22:41 test197 0:(32,32,32) 0.2 sec 3: 14317 26.9% 16.1/s +27-Feb 08:22:41 test201 0:(32,32,32) 0.0 sec 23: 14294 27.0% 679.4/s +27-Feb 08:22:41 test208 0:(32,32,32) 0.0 sec 17: 14277 27.1% 377.2/s +27-Feb 08:22:41 test214 0:(32,32,32) 0.0 sec 39: 14238 27.3% 13490.1/s +27-Feb 08:22:41 test214 0:(32,32,32) 0.0 sec 5: 14233 27.3% 2238.1/s +27-Feb 08:22:41 test214 1:(32,32,64) 0.0 sec 1: 14232 27.3% 440.9/s +27-Feb 08:22:41 test214 1:(32,32,64) 0.0 sec : 14232 27.3% +27-Feb 08:22:41 test223 0:(32,32,32) 0.0 sec 11: 14221 27.3% 1450.2/s +27-Feb 08:22:41 test223 0:(32,32,32) 0.0 sec 1: 14220 27.4% 67.1/s +27-Feb 08:22:41 test241 0:(32,32,32) 0.1 sec 54: 14166 27.6% 1065.5/s +27-Feb 08:22:41 test241 0:(32,32,32) 0.0 sec 8: 14158 27.7% 234.9/s +27-Feb 08:22:41 test270 0:(32,32,32) 0.0 sec 288: 13870 29.1% 15103.8/s +27-Feb 08:22:41 test199 0:(32,32,32) 0.0 sec 16: 13854 29.2% 7226.7/s +27-Feb 08:22:41 test210 0:(32,32,32) 0.1 sec 1: 13853 29.2% 8.5/s +27-Feb 08:22:41 test210 0:(32,32,32) 0.0 sec 3: 13850 29.2% 3632.0/s +27-Feb 08:22:41 test165 0:(32,32,32) 0.0 sec 13: 13837 29.3% 5928.0/s +27-Feb 08:22:41 test221 0:(32,32,32) 0.1 sec 7: 13830 29.3% 89.0/s +27-Feb 08:22:41 test221 0:(32,32,32) 0.0 sec 2: 13828 29.4% 1092.3/s +27-Feb 08:22:41 test278 0:(32,32,32) 0.0 sec 53: 13775 29.6% 2980.9/s +27-Feb 08:22:41 test162 0:(32,32,32) 0.0 sec 20: 13755 29.7% 1026.9/s +27-Feb 08:22:41 test162 0:(32,32,32) 0.0 sec 1: 13754 29.7% 38.5/s +27-Feb 08:22:41 test275 0:(32,32,32) 0.0 sec 27: 13727 29.9% 1336.3/s +27-Feb 08:22:42 test220 0:(32,32,32) 0.2 sec 9: 13718 29.9% 51.8/s +27-Feb 08:22:42 test83 0:(32,32,32) 0.3 sec 7: 13711 30.0% 25.9/s +27-Feb 08:22:42 test83 0:(32,32,32) 0.0 sec 1: 13710 30.0% 1351.4/s +27-Feb 08:22:43 test04 0:(32,32,32) 0.8 sec 18: 13692 30.1% 23.9/s +27-Feb 08:22:43 test04 0:(32,32,32) 0.0 sec 16: 13676 30.1% 2413.3/s +27-Feb 08:22:43 test132 0:(32,32,32) 0.0 sec 12: 13664 30.2% 473.7/s +27-Feb 08:22:43 test82 0:(32,32,32) 0.5 sec 15: 13649 30.3% 31.8/s +27-Feb 08:22:43 test202 0:(32,32,32) 0.0 sec 74: 13575 30.6% 4418.7/s +27-Feb 08:22:43 test202 0:(32,32,32) 0.0 sec 2: 13573 30.7% 177.3/s +27-Feb 08:22:43 test202 0:(32,32,32) 0.0 sec 4: 13569 30.7% 377.8/s +27-Feb 08:22:43 test202 1:(32,32,64) 0.0 sec : 13569 30.7% +27-Feb 08:22:43 test202 1:(32,32,64) 0.0 sec 1: 13568 30.7% 87.6/s +27-Feb 08:22:43 test202 1:(32,32,64) 0.0 sec : 13568 30.7% +27-Feb 08:22:43 test202 2:(32,64,32) 0.0 sec 1: 13567 30.7% 108.6/s +27-Feb 08:22:43 test202 2:(32,64,32) 0.0 sec : 13567 30.7% +27-Feb 08:22:43 test202 2:(32,64,32) 0.0 sec : 13567 30.7% +27-Feb 08:22:43 test222 0:(32,32,32) 0.0 sec 40: 13527 30.9% 1126.6/s +27-Feb 08:22:43 test204 0:(32,32,32) 0.0 sec 9: 13518 30.9% 590.9/s +27-Feb 08:22:43 test258 0:(32,32,32) 0.1 sec 13: 13505 31.0% 134.9/s +27-Feb 08:22:43 test258 0:(32,32,32) 0.0 sec 2: 13503 31.0% 1098.9/s +27-Feb 08:22:43 test258 1:(32,32,64) 0.0 sec 1: 13502 31.0% 882.6/s +27-Feb 08:22:43 test258 1:(32,32,64) 0.0 sec : 13502 31.0% +27-Feb 08:22:45 test136 0:(32,32,32) 1.1 sec 7: 13495 31.1% 6.5/s +27-Feb 08:22:45 test136 0:(32,32,32) 0.0 sec 60: 13435 31.4% 5126.0/s +27-Feb 08:22:45 test128 0:(32,32,32) 0.8 sec 52: 13383 31.6% 64.6/s +27-Feb 08:22:45 test128 0:(32,32,32) 0.1 sec 1: 13382 31.6% 8.8/s +27-Feb 08:22:46 test144 0:(32,32,32) 0.2 sec 5: 13377 31.7% 25.4/s +27-Feb 08:22:48 test81 0:(32,32,32) 2.4 sec 40: 13337 31.9% 16.3/s +[malloc debugging turned off] +27-Feb 08:22:49 testc2(0,0) 0:(32,32,32) 0.4 sec 181: 13156 32.8% 423.6/s +27-Feb 08:22:49 testc2(0,0) 1:(32,32,64) 0.3 sec 1: 13155 32.8% 3.3/s +27-Feb 08:22:49 test239 0:(32,32,32) 0.0 sec 10: 13145 32.8% 966.3/s +27-Feb 08:22:49 test239 0:(32,32,32) 0.4 sec 1: 13144 32.8% 2.8/s +27-Feb 08:22:50 test245 0:(32,32,32) 0.4 sec 32: 13112 33.0% 90.8/s +27-Feb 08:22:50 test245 0:(32,32,32) 0.0 sec 8: 13104 33.1% 1538.5/s +27-Feb 08:22:50 test159 0:(32,32,32) 0.4 sec 39: 13065 33.3% 108.6/s +27-Feb 08:22:51 test259 0:(32,32,32) 0.9 sec 27: 13038 33.4% 29.2/s +27-Feb 08:22:51 test259 0:(32,32,32) 0.0 sec 1: 13037 33.4% 209.2/s +27-Feb 08:22:52 testc4(0) 0:(32,32,32) 1.1 sec 12: 13025 33.5% 10.9/s +27-Feb 08:22:53 test157 0:(32,32,32) 0.6 sec 40: 12985 33.7% 72.6/s +27-Feb 08:22:55 test182 0:(32,32,32) 1.9 sec 23: 12962 33.8% 11.9/s +27-Feb 08:22:55 test182 0:(32,32,32) 0.2 sec 13: 12949 33.8% 53.0/s +27-Feb 08:22:57 test195 0:(32,32,32) 2.0 sec 63: 12886 34.2% 32.1/s +27-Feb 08:23:00 test135 0:(32,32,32) 3.6 sec 43: 12843 34.4% 11.8/s +27-Feb 08:23:00 test215 0:(32,32,32) 0.1 sec 2: 12841 34.4% 23.0/s +27-Feb 08:23:03 test80 0:(32,32,32) 2.3 sec 11: 12830 34.5% 4.8/s +27-Feb 08:23:04 test200 0:(32,32,32) 0.7 sec 11: 12819 34.5% 15.5/s +27-Feb 08:23:06 test283 0:(32,32,32) 2.1 sec 96: 12723 35.0% 44.8/s +27-Feb 08:23:07 test283 1:(32,32,64) 1.7 sec 1: 12722 35.0% 0.6/s +27-Feb 08:23:08 test254 0:(32,32,32) 0.3 sec 25: 12697 35.1% 98.1/s +27-Feb 08:23:09 test254 0:(32,32,32) 1.1 sec 1: 12696 35.1% 0.9/s +27-Feb 08:23:12 test54 0:(32,32,32) 3.1 sec 26: 12669 35.3% 8.3/s +27-Feb 08:23:13 test54 0:(32,32,32) 1.2 sec 13: 12656 35.3% 10.5/s +27-Feb 08:23:16 testcc(1) 0:(32,32,32) 2.5 sec 10: 12646 35.4% 3.9/s +27-Feb 08:23:17 testcc(1) 0:(32,32,32) 1.7 sec 6: 12640 35.4% 3.4/s +27-Feb 08:23:18 testc2(1,1) 0:(32,32,32) 0.2 sec 11: 12629 35.5% 44.2/s +27-Feb 08:23:20 testc2(1,1) 0:(32,32,32) 2.5 sec 3: 12626 35.5% 1.2/s +27-Feb 08:23:21 test141 0:(32,32,32) 1.3 sec 521: 12105 38.2% 389.8/s +27-Feb 08:23:22 test179 0:(32,32,32) 0.0 sec 22: 12083 38.3% 712.9/s +27-Feb 08:23:22 test179 0:(32,32,32) 0.7 sec 10: 12073 38.3% 13.8/s +27-Feb 08:23:22 test188b 0:(32,32,32) 0.0 sec 39: 12034 38.5% 1394.3/s +27-Feb 08:23:22 test185 0:(32,32,32) 0.0 sec 23: 12011 38.6% 580.4/s +27-Feb 08:23:23 test256 0:(32,32,32) 0.2 sec 38: 11973 38.8% 212.7/s +27-Feb 08:23:23 test256 0:(32,32,32) 0.0 sec : 11973 38.8% +27-Feb 08:23:23 test256 1:(32,32,64) 0.2 sec 1: 11972 38.8% 5.3/s +27-Feb 08:23:23 test256 1:(32,32,64) 0.0 sec : 11972 38.8% +27-Feb 08:23:23 test238b 0:(32,32,32) 0.7 sec 31: 11941 39.0% 43.1/s +27-Feb 08:23:24 test238 0:(32,32,32) 0.5 sec 64: 11877 39.3% 124.7/s +27-Feb 08:23:25 test186 0:(32,32,32) 0.9 sec 25: 11852 39.5% 26.7/s +27-Feb 08:23:25 test186 0:(32,32,32) 0.1 sec : 11852 39.5% +27-Feb 08:23:25 test186 0:(32,32,32) 0.1 sec : 11852 39.5% +[malloc debugging turned on] +27-Feb 08:23:27 testca(1) 0:(32,32,32) 1.9 sec 38: 11814 39.6% 19.6/s +27-Feb 08:23:29 testca(1) 0:(32,32,32) 2.0 sec 2: 11812 39.7% 1.0/s +27-Feb 08:23:29 test148 0:(32,32,32) 0.4 sec 7: 11805 39.7% 15.6/s +27-Feb 08:23:29 test148 0:(32,32,32) 0.0 sec 4: 11801 39.7% 1366.1/s +27-Feb 08:23:31 test231 0:(32,32,32) 1.6 sec 385: 11416 41.7% 233.4/s +27-Feb 08:23:32 test129 0:(32,32,32) 0.7 sec 13: 11403 41.7% 19.7/s +27-Feb 08:23:37 test69 0:(32,32,32) 4.9 sec 37: 11366 41.9% 7.5/s +27-Feb 08:23:41 test69 0:(32,32,32) 3.9 sec 13: 11353 42.0% 3.4/s +27-Feb 08:23:43 test29 0:(32,32,32) 1.9 sec 152: 11201 42.8% 80.8/s +27-Feb 08:23:44 test29 0:(32,32,32) 1.8 sec 2: 11199 42.8% 1.1/s +27-Feb 08:23:46 test29 1:(32,32,64) 1.8 sec 2: 11197 42.8% 1.1/s +27-Feb 08:23:48 test29 1:(32,32,64) 1.8 sec : 11197 42.8% +27-Feb 08:23:48 test282 0:(32,32,32) 0.3 sec 15: 11182 42.9% 45.1/s +27-Feb 08:23:49 test249 0:(32,32,32) 0.3 sec 30: 11152 43.0% 92.0/s +27-Feb 08:23:49 test249 0:(32,32,32) 0.3 sec 1: 11151 43.0% 3.2/s +27-Feb 08:23:49 test196 0:(32,32,32) 0.5 sec 18: 11133 43.1% 33.7/s +27-Feb 08:23:50 test250 0:(32,32,32) 0.5 sec 77: 11056 43.5% 149.5/s +27-Feb 08:23:51 test250 0:(32,32,32) 0.8 sec 4: 11052 43.5% 5.3/s +27-Feb 08:23:51 test145 0:(32,32,32) 0.7 sec 22: 11030 43.6% 31.5/s +27-Feb 08:23:51 test145 0:(32,32,32) 0.0 sec 6: 11024 43.7% 1142.4/s +27-Feb 08:23:58 test229 0:(32,32,32) 6.8 sec 13: 11011 43.7% 1.9/s +27-Feb 08:24:01 test209 0:(32,32,32) 2.4 sec 44: 10967 44.0% 18.4/s +27-Feb 08:24:03 test209 1:(32,32,64) 2.4 sec 1: 10966 44.0% 0.4/s +27-Feb 08:24:05 test224 0:(32,32,32) 1.4 sec 60: 10906 44.3% 41.5/s +27-Feb 08:24:05 test191 0:(32,32,32) 0.5 sec 26: 10880 44.4% 57.7/s +27-Feb 08:24:05 test191 0:(32,32,32) 0.1 sec 2: 10878 44.4% 21.4/s +27-Feb 08:24:05 test150 0:(32,32,32) 0.0 sec 20: 10858 44.5% 597.2/s +27-Feb 08:24:05 test240 0:(32,32,32) 0.3 sec 25: 10833 44.7% 85.6/s +27-Feb 08:24:06 test240 0:(32,32,32) 0.4 sec 1: 10832 44.7% 2.8/s +27-Feb 08:24:06 test237 0:(32,32,32) 0.4 sec 11: 10821 44.7% 28.8/s +27-Feb 08:24:06 test237 0:(32,32,32) 0.0 sec 1: 10820 44.7% 113.0/s +27-Feb 08:24:06 test237 0:(32,32,32) 0.0 sec 1: 10819 44.7% 104.6/s +27-Feb 08:24:06 test237 0:(32,32,32) 0.0 sec 1: 10818 44.7% 128.5/s +27-Feb 08:24:07 test184 0:(32,32,32) 1.0 sec 7: 10811 44.8% 6.7/s +27-Feb 08:24:11 test236 0:(32,32,32) 3.3 sec 117: 10694 45.4% 35.9/s +[malloc debugging turned off] +27-Feb 08:24:22 test84 0:(32,32,32) 11.1 sec 25: 10669 45.5% 2.3/s +27-Feb 08:24:22 test84 0:(32,32,32) 0.4 sec 37: 10632 45.7% 93.2/s +27-Feb 08:24:31 test84 2:(32,64,32) 9.2 sec 1: 10631 45.7% 0.1/s +27-Feb 08:24:32 test84 2:(32,64,32) 0.4 sec : 10631 45.7% +27-Feb 08:24:32 test84 0:(32,32,32) 0.4 sec 3: 10628 45.7% 6.9/s +27-Feb 08:24:33 test84 0:(32,32,32) 0.5 sec 8: 10620 45.7% 17.7/s +27-Feb 08:24:33 test84 2:(32,64,32) 0.4 sec 1: 10619 45.7% 2.3/s +27-Feb 08:24:34 test84 2:(32,64,32) 0.5 sec : 10619 45.7% +27-Feb 08:24:51 test173 0:(32,32,32) 18.0 sec 20: 10599 45.9% 1.1/s +27-Feb 08:24:52 test173 0:(32,32,32) 0.4 sec 4: 10595 45.9% 10.2/s +27-Feb 08:25:04 test230 0:(32,32,32) 12.0 sec 250: 10345 47.1% 20.9/s +27-Feb 08:25:05 test230 0:(32,32,32) 1.6 sec 2: 10343 47.2% 1.3/s +27-Feb 08:25:18 test18 0:(32,32,32) 12.2 sec 91: 10252 47.6% 7.4/s +27-Feb 08:25:20 test18 0:(32,32,32) 2.7 sec 7: 10245 47.7% 2.6/s +27-Feb 08:26:03 testc7(0) 0:(32,32,32) 42.5 sec 13: 10232 47.7% 0.3/s +27-Feb 08:26:09 testc7(0) 0:(32,32,32) 6.4 sec 13: 10219 47.8% 2.0/s +27-Feb 08:26:35 test193 0:(32,32,32) 26.1 sec 200: 10019 48.8% 7.7/s +27-Feb 08:26:38 test127 0:(32,32,32) 2.6 sec 929: 9090 53.6% 351.6/s +27-Feb 08:26:42 test23 0:(32,32,32) 4.0 sec 61: 9029 53.9% 15.1/s +27-Feb 08:26:48 test243 0:(32,32,32) 6.2 sec 26: 9003 54.0% 4.2/s +27-Feb 08:27:50 test53 0:(32,32,32) 61.9 sec 40: 8963 54.2% 0.6/s +27-Feb 08:27:54 test53 0:(32,32,32) 3.9 sec 5: 8958 54.2% 1.3/s +27-Feb 08:28:06 test242 0:(32,32,32) 11.9 sec 61: 8897 54.5% 5.1/s +27-Feb 08:28:17 test17 0:(32,32,32) 10.4 sec 32: 8865 54.7% 3.1/s +27-Feb 08:28:26 test246 0:(32,32,32) 9.6 sec 4: 8861 54.7% 0.4/s +27-Feb 08:28:31 test251b 0:(32,32,32) 5.2 sec 26: 8835 54.9% 5.0/s +27-Feb 08:28:42 test251 0:(32,32,32) 11.0 sec 100: 8735 55.4% 9.1/s +27-Feb 08:28:55 test152 0:(32,32,32) 12.7 sec 190: 8545 56.3% 15.0/s +27-Feb 08:29:09 test152 0:(32,32,32) 13.9 sec 123: 8422 57.0% 8.8/s +27-Feb 08:29:12 test160 0:(32,32,32) 2.6 sec 17: 8405 57.1% 6.6/s +27-Feb 08:29:48 test232 0:(32,32,32) 36.0 sec 59: 8346 57.4% 1.6/s +27-Feb 08:29:48 test232 0:(32,32,32) 0.4 sec 5: 8341 57.4% 11.6/s +27-Feb 08:29:50 test142b 0:(32,32,32) 1.7 sec 10: 8331 57.4% 5.8/s +27-Feb 08:29:50 test142b 0:(32,32,32) 0.0 sec 3: 8328 57.5% 210.3/s +27-Feb 08:30:45 test142 0:(32,32,32) 54.9 sec 304: 8024 59.0% 5.5/s +27-Feb 08:31:56 test227 0:(32,32,32) 70.9 sec 15: 8009 59.1% 0.2/s +27-Feb 08:32:04 test292 0:(32,32,32) 8.2 sec 1: 8008 59.1% 0.1/s +27-Feb 08:32:05 test192 0:(32,32,32) 1.1 sec 3: 8005 59.1% 2.7/s +27-Feb 08:32:14 test181 0:(32,32,32) 8.5 sec 4: 8001 59.1% 0.5/s +27-Feb 08:32:19 test181 0:(32,32,32) 4.5 sec 11: 7990 59.2% 2.5/s +[malloc debugging turned on] +27-Feb 08:32:36 test130 0:(32,32,32) 17.6 sec 8: 7982 59.2% 0.5/s +27-Feb 08:32:36 test130 0:(32,32,32) 0.4 sec 6: 7976 59.3% 16.3/s +27-Feb 08:32:37 test206 0:(32,32,32) 0.6 sec 86: 7890 59.7% 136.9/s +27-Feb 08:32:42 test206 0:(32,32,32) 5.1 sec 12: 7878 59.8% 2.4/s +27-Feb 08:32:58 test02 0:(32,32,32) 15.3 sec 3: 7875 59.8% 0.2/s +27-Feb 08:33:50 test11 0:(32,32,32) 52.6 sec 17: 7858 59.9% 0.3/s +27-Feb 08:33:56 test187 0:(32,32,32) 5.6 sec 6: 7852 59.9% 1.1/s +27-Feb 08:33:58 test187 0:(32,32,32) 2.1 sec 1: 7851 59.9% 0.5/s +27-Feb 08:34:01 test169 0:(32,32,32) 2.6 sec 32: 7819 60.1% 12.4/s +27-Feb 08:34:05 test76 0:(32,32,32) 3.8 sec 14: 7805 60.1% 3.7/s +27-Feb 08:34:13 test01 0:(32,32,32) 8.3 sec 601: 7204 63.2% 72.8/s +27-Feb 08:34:18 test01 0:(32,32,32) 5.2 sec 4: 7200 63.2% 0.8/s +27-Feb 08:34:22 test228 0:(32,32,32) 4.0 sec 25: 7175 63.3% 6.3/s +27-Feb 08:34:27 test104 0:(32,32,32) 4.9 sec 35: 7140 63.5% 7.1/s +27-Feb 08:35:32 test284 0:(32,32,32) 64.5 sec 68: 7072 63.9% 1.1/s +27-Feb 08:35:34 test284 0:(32,32,32) 2.0 sec 4: 7068 63.9% 2.0/s +27-Feb 08:35:54 test180 0:(32,32,32) 20.5 sec 21: 7047 64.0% 1.0/s +27-Feb 08:36:00 test180 0:(32,32,32) 5.9 sec 92: 6955 64.5% 15.6/s +27-Feb 08:36:09 test188 0:(32,32,32) 8.7 sec 169: 6786 65.3% 19.5/s +27-Feb 08:36:38 test151b 0:(32,32,32) 29.5 sec 34: 6752 65.5% 1.2/s +27-Feb 08:36:39 test151b 0:(32,32,32) 0.2 sec 18: 6734 65.6% 88.0/s +27-Feb 08:37:02 test14b 0:(32,32,32) 23.1 sec 95: 6639 66.1% 4.1/s +27-Feb 08:37:29 test14 0:(32,32,32) 27.4 sec 257: 6382 67.4% 9.4/s +[malloc debugging turned off] +27-Feb 08:38:01 test125 0:(32,32,32) 31.8 sec 319: 6063 69.0% 10.0/s +27-Feb 08:39:15 test10 0:(32,32,32) 74.0 sec 702: 5361 72.6% 9.5/s +27-Feb 08:39:55 test75b 0:(32,32,32) 39.4 sec 293: 5068 74.1% 7.4/s +27-Feb 08:40:23 test74 0:(32,32,32) 28.1 sec 4101: 967 95.1% 145.8/s +27-Feb 08:42:56 test234 0:(32,32,32) 153.6 sec 198: 769 96.1% 1.3/s +[malloc debugging turned on] +27-Feb 08:42:57 test154b 0:(32,32,32) 0.0 sec 12: 757 96.1% 621.5/s +27-Feb 08:45:03 test154 0:(32,32,32) 126.8 sec 657: 100 99.5% 5.2/s +27-Feb 08:46:10 test21b 0:(32,32,32) 66.5 sec 65: 35 99.8% 1.0/s +27-Feb 08:50:22 test19b 0:(32,32,32) 252.0 sec 20: 15 99.9% 0.1/s +27-Feb 08:50:24 test19b 0:(32,32,32) 1.5 sec 4: 11 99.9% 2.7/s +[malloc debugging turned off] +27-Feb 08:53:03 test19 0:(32,32,32) 158.3 sec 8: 3 99.9% 0.1/s +27-Feb 08:53:04 test19 0:(32,32,32) 0.9 sec 2: 1 99.9% 2.3/s +27-Feb 08:53:04 test280(0) 0:(32,32,32) 0.0 sec 1: all 100% 28.0/s +[malloc debugging turned off] +27-Feb-2025 08:53:04 grbcov ending diff --git a/GraphBLAS/Tcov/testcov.m b/GraphBLAS/Tcov/testcov.m index 3520baff89..7f3bf87ec3 100644 --- a/GraphBLAS/Tcov/testcov.m +++ b/GraphBLAS/Tcov/testcov.m @@ -1,6 +1,6 @@ %TESTCOV run all GraphBLAS tests, with statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) diff --git a/GraphBLAS/Tcov/tmp/.gitignore b/GraphBLAS/Tcov/tmp/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/GraphBLAS/Tcov/tmp/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/GraphBLAS/Test/Contents.m b/GraphBLAS/Test/Contents.m index 93d7a0f49d..b05b9ad062 100644 --- a/GraphBLAS/Test/Contents.m +++ b/GraphBLAS/Test/Contents.m @@ -3,8 +3,8 @@ % Primary functiuns -% testmake - compiles the test interface to GraphBLAS -% testall - run all GraphBLAS tests +% testmake - compiles the test interface to GraphBLAS +% testall - run all GraphBLAS tests % mimics of GraphBLAS operations: % @@ -37,6 +37,7 @@ % GB_spec_operator - get the contents of an operator % GB_spec_opsall - return a list of all operators, types, and semirings % GB_spec_random - generate random matrix +% GB_spec_random_32 - select 32/64 bit format at random % GB_spec_reduce_to_scalar - a mimic of GrB_reduce (to scalar) % GB_spec_reduce_to_vector - a mimic of GrB_reduce (to vector) % GB_spec_resize - a mimic of GxB_resize @@ -93,7 +94,9 @@ % test21b - test GrB_assign % test23 - test GrB_*_build -% test29 - GrB_reduce with zombies +% test29 - test GrB_reduce + +% test43 - test subref % test53 - test GrB_Matrix_extract % test54 - test GB_subref: numeric case with I=lo:hi, J=lo:hi @@ -119,7 +122,6 @@ % test125 - test GrB_mxm: row and column scaling % test127 - test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) % test128 - test eWiseMult, eWiseAdd, eWiseUnion, special cases - % test129 - test GxB_select (tril and nonzero, hypersparse) % test130 - test GrB_apply (hypersparse cases) @@ -129,7 +131,7 @@ % test136 - GxB_subassign, method 08, 09, 11 % test137 - GrB_eWiseMult with FIRST and SECOND operators % test138 - test assign, with coarse-only tasks in IxJ slice -% test139 - merge sort, special cases + % test141 - test GrB_eWiseAdd (all types and operators) for dense matrices % test142 - test GrB_assign for dense matrices @@ -139,13 +141,11 @@ % test148 - eWiseAdd with aliases % test150 - test GrB_mxm with typecasting and zombies (dot3 and saxpy) - % test151b - test bitshift operators % test152 - test C = A+B for dense A, B, and C % test154 - test GrB_apply with scalar binding % test154b - test GrB_apply with scalar binding % test155 - test GrB_*_setElement and GrB_*_removeElement - % test157 - test sparsity formats % test159 - test dot and saxpy with positional ops @@ -176,7 +176,6 @@ % test187 - test dup/assign for all sparsity formats % test188 - test concat % test188b - test concat -% test189 - test large assignment % test191 - test split % test192 - test GrB_assign C=scalar @@ -278,29 +277,41 @@ % test284 - test GrB_mxm using indexop-based semirings % test285 - test GrB_assign (bitmap case, C+=A, whole matrix) % test286 - test kron with idxop +% test287 - misc tests +% test288 - load/unload tests +% test289 - test the Container for all sparsity formats + +% test290 - test bitmap_subref on a large matrix +% test291 - test GB_ix_realloc +% test292 - test GxB_Vector_build_Scalar_Vector with a very large vector +% test293 - merge sort, different integer sizes +% test294 - reduce with zombies % Helper functions -% nthreads_get - get # of threads and chunk to use in GraphBLAS -% nthreads_set - set # of threads and chunk to use in GraphBLAS -% test10_compare - check results for test10 -% test_cast - z = cast (x,type) but handle complex types -% test_contains - same as contains (text, pattern) -% debug_off - turn off malloc debugging -% debug_on - turn on malloc debugging -% grbinfo - print info about the GraphBLAS version -% irand - construct a random integer matrix -% logstat - run a GraphBLAS test and log the results to log.txt -% runtest - run a single GraphBLAS test -% stat - report status of statement coverage and malloc debugging -% isequal_roundoff - compare two matrices, allowing for roundoff errors -% grb_clear_coverage - clear current statement coverage -% grb_get_coverage - return current statement coverage -% feature_numcores - determine # of cores the system has -% jit_reset - turn off the JIT and then set it back to its original state -% grblines - total # of lines in the test coverage -% set_malloc_debug - Turn on/off malloc debugging and mark the log.txt - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% nthreads_get - get # of threads and chunk to use in GraphBLAS +% nthreads_set - set # of threads and chunk to use in GraphBLAS +% test10_compare - check results for test10 +% test_cast - z = cast (x,type) but handle complex types +% test_contains - same as contains (text, pattern) +% debug_off - turn off malloc debugging +% debug_on - turn on malloc debugging +% grbinfo - print info about the GraphBLAS version +% irand - construct a random integer matrix +% logstat - run a GraphBLAS test and log the results to log.txt +% runtest - run a single GraphBLAS test +% stat - report status of statement coverage and malloc debugging +% isequal_roundoff - compare two matrices, allowing for roundoff errors +% grb_clear_coverage - clear current statement coverage +% grb_get_coverage - return current statement coverage +% feature_numcores - determine # of cores the system has +% jit_reset - turn off the JIT and then set it back to its original state +% grblines - total # of lines in the test coverage +% set_malloc_debug - Turn on/off malloc debugging and mark the log.txt +% bench3 - test and benchmark qsort and msort +% GB_isequal_ignore_32 - compare two structs but ignore [phi]_is_32 fields + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 + diff --git a/GraphBLAS/Test/GB_builtin_complex_get.m b/GraphBLAS/Test/GB_builtin_complex_get.m index 944c6ab297..a2e56ba6fe 100644 --- a/GraphBLAS/Test/GB_builtin_complex_get.m +++ b/GraphBLAS/Test/GB_builtin_complex_get.m @@ -9,7 +9,7 @@ % % See also GB_builtin_complex_set. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_builtin_complex diff --git a/GraphBLAS/Test/GB_builtin_complex_set.m b/GraphBLAS/Test/GB_builtin_complex_set.m index a2995b063b..65e5575c94 100644 --- a/GraphBLAS/Test/GB_builtin_complex_set.m +++ b/GraphBLAS/Test/GB_builtin_complex_set.m @@ -9,7 +9,7 @@ % % See also GB_builtin_complex_get. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_builtin_complex diff --git a/GraphBLAS/Test/GB_isequal_ignore_32.m b/GraphBLAS/Test/GB_isequal_ignore_32.m new file mode 100644 index 0000000000..c04ffd6202 --- /dev/null +++ b/GraphBLAS/Test/GB_isequal_ignore_32.m @@ -0,0 +1,9 @@ +function result = GB_isequal_ignore_32 (C1, C2) +%GB_ISEQUAL_IGNORE_32 compare two structs but ignore [phi]_is_32 fields + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +f = { 'p_is_32', 'j_is_32', 'i_is_32' } ; +result = isequal (rmfield (C1, f), rmfield (C2, f)) ; + diff --git a/GraphBLAS/Test/GB_mex.h b/GraphBLAS/Test/GB_mex.h index 906b394da6..bf5214a758 100644 --- a/GraphBLAS/Test/GB_mex.h +++ b/GraphBLAS/Test/GB_mex.h @@ -2,7 +2,7 @@ // GB_mex.h: definitions for the Test interface to GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -193,11 +193,14 @@ GrB_Monoid GB_mx_BinaryOp_to_Monoid // monoid, or NULL if error bool GB_mx_mxArray_to_indices // true if successful, false otherwise ( - GrB_Index **handle, // index array returned + // input: const mxArray *I_builtin, // built-in mxArray to get - GrB_Index *ni, // length of I, or special - GrB_Index Icolon [3], // for all but GB_LIST - bool *I_is_list // true if I is an explicit list + // output: + uint64_t **I_handle, // index array + uint64_t *ni, // length of I, or special + uint64_t Icolon [3], // for all but GB_LIST + bool *I_is_list, // true if GB_LIST + GrB_Vector *I_vector // non-NULL if found ) ; bool GB_mx_Monoid // true if successful, false otherwise @@ -275,8 +278,8 @@ GrB_Matrix GB_mx_alias // output matrix (NULL if no match found) mxArray *GB_mx_create_full // return new built-in full matrix ( - const GrB_Index nrows, - const GrB_Index ncols, + const uint64_t nrows, + const uint64_t ncols, GrB_Type type // type of the matrix to create ) ; @@ -314,9 +317,9 @@ GrB_Scalar GB_mx_get_Scalar #define METHOD_START(OP) \ printf ("\n================================================================================\n") ; \ - printf ("method: [%s] start: "GBd" \n", #OP, \ - GB_Global_nmalloc_get ( )) ; \ - printf ("================================================================================\n") ; + printf ("method: [%s] start: "GBd" \n", #OP, GB_Global_nmalloc_get ( )) ; \ + printf ("================================================================================\n") ; \ + GB_Global_memtable_dump ( ) ; #define METHOD_TRY \ printf ("\n--------------------------------------------------------------------- try %d\n", tries) ; diff --git a/GraphBLAS/Test/GB_mex_AdotB.c b/GraphBLAS/Test/GB_mex_AdotB.c index d3e4a8657c..8b1a19a8b0 100644 --- a/GraphBLAS/Test/GB_mex_AdotB.c +++ b/GraphBLAS/Test/GB_mex_AdotB.c @@ -2,7 +2,7 @@ // GB_mex_AdotB: compute C=spones(Mask).*(A'*B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ GrB_Monoid add = NULL ; GrB_Semiring semiring = NULL ; GrB_Info adotb_complex (GB_Werk Werk) ; GrB_Info adotb (GB_Werk Werk) ; -GrB_Index anrows, ancols, bnrows, bncols, mnrows, mncols ; +uint64_t anrows, ancols, bnrows, bncols, mnrows, mncols ; bool flipxy = false ; struct GB_Matrix_opaque C_header ; @@ -216,7 +216,7 @@ void mexFunction GET_SCALAR (3, bool, flipxy, false) ; struct GB_Matrix_opaque C_header ; - C = GB_clear_static_header (&C_header) ; + C = GB_clear_matrix_header (&C_header) ; if (A->type == Complex) { diff --git a/GraphBLAS/Test/GB_mex_AplusB.c b/GraphBLAS/Test/GB_mex_AplusB.c index 12fcb78241..b16b2da72e 100644 --- a/GraphBLAS/Test/GB_mex_AplusB.c +++ b/GraphBLAS/Test/GB_mex_AplusB.c @@ -2,7 +2,7 @@ // GB_mex_AplusB: compute C=A+B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ void mexFunction ) { struct GB_Matrix_opaque C_header ; - GrB_Matrix C = GB_clear_static_header (&C_header) ; + GrB_Matrix C = GB_clear_matrix_header (&C_header) ; bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; diff --git a/GraphBLAS/Test/GB_mex_AxB.c b/GraphBLAS/Test/GB_mex_AxB.c index 42799da9ea..c8f1e7dfab 100644 --- a/GraphBLAS/Test/GB_mex_AxB.c +++ b/GraphBLAS/Test/GB_mex_AxB.c @@ -2,7 +2,7 @@ // GB_mex_AxB: compute C=A*B, A'*B, A*B', or A'*B' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,7 +44,7 @@ int64_t bnrows = 0 ; int64_t bncols = 0 ; struct GB_Matrix_opaque C_header ; -GrB_Desc_Value AxB_method = GxB_DEFAULT ; +int AxB_method = GxB_DEFAULT ; GrB_Info axb (GB_Werk Werk) ; GrB_Info axb_complex (GB_Werk Werk) ; @@ -66,7 +66,7 @@ GrB_Info axb (GB_Werk Werk) } struct GB_Matrix_opaque MT_header ; - GrB_Matrix MT = GB_clear_static_header (&MT_header) ; + GrB_Matrix MT = GB_clear_matrix_header (&MT_header) ; // C = A*B, A'*B, A*B', or A'*B' info = GB_AxB_meta (C, NULL, @@ -92,7 +92,6 @@ GrB_Info axb (GB_Werk Werk) GrB_Monoid_free_(&add) ; GrB_Semiring_free_(&semiring) ; - return (info) ; } @@ -163,7 +162,7 @@ GrB_Info axb_complex (GB_Werk Werk) } struct GB_Matrix_opaque MT_header ; - GrB_Matrix MT = GB_clear_static_header (&MT_header) ; + GrB_Matrix MT = GB_clear_matrix_header (&MT_header) ; info = GB_AxB_meta (C, NULL, false, // C_replace @@ -188,7 +187,6 @@ GrB_Info axb_complex (GB_Werk Werk) GrB_Matrix_free_(&Bconj) ; GrB_Matrix_free_(&Aconj) ; - return (info) ; } @@ -254,7 +252,7 @@ void mexFunction // 7083: dot // 7084: hash // 7085: saxpy - GET_SCALAR (4, GrB_Desc_Value, AxB_method, GxB_DEFAULT) ; + GET_SCALAR (4, int, AxB_method, GxB_DEFAULT) ; if (! ((AxB_method == GxB_DEFAULT) || (AxB_method == GxB_AxB_GUSTAVSON) || @@ -275,7 +273,7 @@ void mexFunction mexErrMsgTxt ("invalid dimensions") ; } - C = GB_clear_static_header (&C_header) ; + C = GB_clear_matrix_header (&C_header) ; if (A->type == Complex) { diff --git a/GraphBLAS/Test/GB_mex_AxB_idx.c b/GraphBLAS/Test/GB_mex_AxB_idx.c index d4623aaaef..2a05de530b 100644 --- a/GraphBLAS/Test/GB_mex_AxB_idx.c +++ b/GraphBLAS/Test/GB_mex_AxB_idx.c @@ -2,7 +2,7 @@ // GB_mex_AxB_idx: C=A*B, A'*B, A*B', or A'*B' using the indexop semirings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -37,88 +37,88 @@ //------------------------------------------------------------------------------ void firsti_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) ; void firsti_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) { (*z) = ix + (*theta) ; } -#define FIRSTI_THETA \ +#define FIRSTI_THETA_DEFN \ "void firsti_theta (int64_t *z, \n" \ -" const void *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const int64_t *theta) \n" \ "{ \n" \ " (*z) = ix + (*theta) ; \n" \ "}" void secondi_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) ; void secondi_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) { (*z) = iy + (*theta) ; } -#define SECONDI_THETA \ +#define SECONDI_THETA_DEFN \ "void secondi_theta (int64_t *z, \n" \ -" const void *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const int64_t *theta) \n" \ "{ \n" \ " (*z) = iy + (*theta) ; \n" \ "}" void firstj_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) ; void firstj_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) { (*z) = jx + (*theta) ; } -#define FIRSTJ_THETA \ +#define FIRSTJ_THETA_DEFN \ "void firstj_theta (int64_t *z, \n" \ -" const void *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const int64_t *theta) \n" \ "{ \n" \ " (*z) = jx + (*theta) ; \n" \ "}" void secondj_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) ; void secondj_theta (int64_t *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) { (*z) = jy + (*theta) ; } -#define SECONDJ_THETA \ +#define SECONDJ_THETA_DEFN \ "void secondj_theta (int64_t *z, \n" \ -" const void *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const int64_t *theta) \n" \ "{ \n" \ " (*z) = jy + (*theta) ; \n" \ @@ -142,7 +142,7 @@ void mexFunction GrB_BinaryOp mult = NULL ; GxB_IndexBinaryOp Iop = NULL ; GrB_Semiring semiring = NULL ; - GrB_Index anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; + uint64_t anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; GrB_Descriptor desc = NULL ; GrB_Monoid monoid = NULL ; @@ -171,7 +171,7 @@ void mexFunction bool GET_SCALAR (3, bool, btrans, false) ; // get the axb_method - GrB_Desc_Value GET_SCALAR (4, GrB_Desc_Value, AxB_method, GxB_DEFAULT) ; + int GET_SCALAR (4, int, AxB_method, GxB_DEFAULT) ; // get the C_is_csc option bool GET_SCALAR (5, bool, C_is_csc, true) ; @@ -215,8 +215,8 @@ void mexFunction OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_nrows (&bnrows, B)) ; OK (GrB_Matrix_ncols (&bncols, B)) ; - GrB_Index cnrows = (atrans) ? ancols : anrows ; - GrB_Index cncols = (btrans) ? bnrows : bncols ; + uint64_t cnrows = (atrans) ? ancols : anrows ; + uint64_t cncols = (btrans) ? bnrows : bncols ; // create the output matrix C OK (GrB_Matrix_new (&C, GrB_INT64, cnrows, cncols)) ; @@ -269,7 +269,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) firsti_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "firsti_theta", FIRSTI_THETA)) ; + "firsti_theta", FIRSTI_THETA_DEFN)) ; } else if (MATCH (multname, "firsti1")) { @@ -277,7 +277,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) firsti_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "firsti_theta", FIRSTI_THETA)) ; + "firsti_theta", FIRSTI_THETA_DEFN)) ; } else if (MATCH (multname, "firstj" )) { @@ -285,7 +285,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) firstj_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "firstj_theta", FIRSTJ_THETA)) ; + "firstj_theta", FIRSTJ_THETA_DEFN)) ; } else if (MATCH (multname, "firstj1")) { @@ -293,7 +293,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) firstj_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "firstj_theta", FIRSTJ_THETA)) ; + "firstj_theta", FIRSTJ_THETA_DEFN)) ; } else if (MATCH (multname, "secondi" )) { @@ -301,7 +301,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) secondi_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "secondi_theta", SECONDI_THETA)) ; + "secondi_theta", SECONDI_THETA_DEFN)) ; } else if (MATCH (multname, "secondi1")) { @@ -309,7 +309,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) secondi_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "secondi_theta", SECONDI_THETA)) ; + "secondi_theta", SECONDI_THETA_DEFN)) ; } else if (MATCH (multname, "secondj" )) { @@ -317,7 +317,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) secondj_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "secondj_theta", SECONDJ_THETA)) ; + "secondj_theta", SECONDJ_THETA_DEFN)) ; } else if (MATCH (multname, "secondj1")) { @@ -325,7 +325,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) secondj_theta, GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, - "secondj_theta", SECONDJ_THETA)) ; + "secondj_theta", SECONDJ_THETA_DEFN)) ; } else { diff --git a/GraphBLAS/Test/GB_mex_Col_assign.c b/GraphBLAS/Test/GB_mex_Col_assign.c deleted file mode 100644 index 28715dd6ba..0000000000 --- a/GraphBLAS/Test/GB_mex_Col_assign.c +++ /dev/null @@ -1,493 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_mex_assign: C(I,J) = accum (C (I,J), A) -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -// This function is a wrapper for GrB_Matrix_assign, GrB_Matrix_assign_T -// GrB_Vector_assign, and GrB_Vector_assign_T. For these uses, the Mask must -// always be the same size as C. - -// This mexFunction does not call GrB_Row_assign or GrB_Col_assign, since -// the Mask is a single row or column in these cases, and C is not modified -// outside that single row (for GrB_Row_assign) or column (for GrB_Col_assign). - -// This function does the same thing as the mimic GB_spec_assign.m. - -//------------------------------------------------------------------------------ - -#include "GB_mex.h" - -#define USAGE "C =GB_mex_assign (C, Mask, accum, A, I, J, desc) or (C, Work)" - -#define FREE_ALL \ -{ \ - GrB_Matrix_free_(&A) ; \ - GrB_Matrix_free_(&Mask) ; \ - GrB_Matrix_free_(&C) ; \ - GrB_Descriptor_free_(&desc) ; \ - GB_mx_put_global (true) ; \ -} - -#define GET_DEEP_COPY \ - C = GB_mx_mxArray_to_Matrix (pargin [0], "C input", true, true) ; - -#define FREE_DEEP_COPY GrB_Matrix_free_(&C) ; - -GrB_Matrix C = NULL ; -GrB_Matrix Mask = NULL ; -GrB_Matrix A = NULL ; -GrB_Descriptor desc = NULL ; -GrB_BinaryOp accum = NULL ; -GrB_Index *I = NULL, ni = 0, I_range [3] ; -GrB_Index *J = NULL, nj = 0, J_range [3] ; -bool ignore ; -bool malloc_debug = false ; -GrB_Info info = GrB_SUCCESS ; -GrB_Info assign (void) ; - -GrB_Info many_assign -( - int nwork, - int fA, - int fI, - int fJ, - int faccum, - int fMask, - int fdesc, - const mxArray *pargin [ ] -) ; - -//------------------------------------------------------------------------------ -// assign: perform a single assignment -//------------------------------------------------------------------------------ - -#define OK(method) \ -{ \ - info = method ; \ - if (info != GrB_SUCCESS) \ - { \ - return (info) ; \ - } \ -} - -GrB_Info assign ( ) -{ - bool at = (desc != NULL && desc->in0 == GrB_TRAN) ; - GrB_Info info ; - - ASSERT_MATRIX_OK (C, "C", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (Mask, "Mask", GB0) ; - ASSERT_MATRIX_OK (A, "A", GB0) ; - ASSERT_BINARYOP_OK_OR_NULL (accum, "accum", GB0) ; - ASSERT_DESCRIPTOR_OK_OR_NULL (desc, "desc", GB0) ; - - if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && GB_nnz (A) == 1) - { - GB_void *Ax = A->x ; // OK: A is a scalar with exactly one entry - - if (ni == 1 && nj == 1 && Mask == NULL && I != GrB_ALL && J != GrB_ALL - && GB_op_is_second (accum, C->type) && A->type->code < GB_FC64_code - && desc == NULL) - { - // test GrB_Matrix_setElement - #define ASSIGN(prefix,suffix,type) \ - { \ - type x = ((type *) Ax) [0] ; \ - OK (prefix ## Matrix_setElement ## suffix \ - (C, x, I [0], J [0])) ; \ - } break ; - - switch (A->type->code) - { - case GB_BOOL_code : ASSIGN (GrB_, _BOOL, bool) ; - case GB_INT8_code : ASSIGN (GrB_, _INT8, int8_t) ; - case GB_INT16_code : ASSIGN (GrB_, _INT16, int16_t) ; - case GB_INT32_code : ASSIGN (GrB_, _INT32, int32_t) ; - case GB_INT64_code : ASSIGN (GrB_, _INT64, int64_t) ; - case GB_UINT8_code : ASSIGN (GrB_, _UINT8, uint8_t) ; - case GB_UINT16_code : ASSIGN (GrB_, _UINT16, uint16_t) ; - case GB_UINT32_code : ASSIGN (GrB_, _UINT32, uint32_t) ; - case GB_UINT64_code : ASSIGN (GrB_, _UINT64, uint64_t) ; - case GB_FP32_code : ASSIGN (GrB_, _FP32, float) ; - case GB_FP64_code : ASSIGN (GrB_, _FP64, double) ; - case GB_FC32_code : ASSIGN (GxB_, _FC32, GxB_FC32_t) ; - case GB_FC64_code : ASSIGN (GxB_, _FC64, GxB_FC64_t) ; - case GB_UDT_code : - default: - FREE_ALL ; - mexErrMsgTxt ("unknown type: col setEl") ; - } - - ASSERT_MATRIX_OK (C, "C after setElement", GB0) ; - - } - else if (C->vdim == 1) - { - - // test GrB_Vector_assign_scalar functions - #undef ASSIGN - #define ASSIGN(prefix,suffix,type) \ - { \ - type x = ((type *) Ax) [0] ; \ - OK (prefix ## Vector_assign ## suffix ((GrB_Vector) C, \ - (GrB_Vector) Mask, accum, x, I, ni, desc)) ; \ - } break ; - - switch (A->type->code) - { - case GB_BOOL_code : ASSIGN (GrB_, _BOOL, bool) ; - case GB_INT8_code : ASSIGN (GrB_, _INT8, int8_t) ; - case GB_INT16_code : ASSIGN (GrB_, _INT16, int16_t) ; - case GB_INT32_code : ASSIGN (GrB_, _INT32, int32_t) ; - case GB_INT64_code : ASSIGN (GrB_, _INT64, int64_t) ; - case GB_UINT8_code : ASSIGN (GrB_, _UINT8, uint8_t) ; - case GB_UINT16_code : ASSIGN (GrB_, _UINT16, uint16_t) ; - case GB_UINT32_code : ASSIGN (GrB_, _UINT32, uint32_t) ; - case GB_UINT64_code : ASSIGN (GrB_, _UINT64, uint64_t) ; - case GB_FP32_code : ASSIGN (GrB_, _FP32, float) ; - case GB_FP64_code : ASSIGN (GrB_, _FP64, double) ; - case GB_FC32_code : ASSIGN (GxB_, _FC32, GxB_FC32_t) ; - case GB_FC64_code : ASSIGN (GxB_, _FC64, GxB_FC64_t) ; - case GB_UDT_code : - { - OK (GrB_Vector_assign_UDT ((GrB_Vector) C, - (GrB_Vector) Mask, accum, Ax, I, ni, desc)) ; - } - break ; - default: - FREE_ALL ; - mexErrMsgTxt ("unknown type: vec assign") ; - } - - } - else - { - - // test Matrix_assign_scalar functions - #undef ASSIGN - #define ASSIGN(prefix,suffix,type) \ - { \ - type x = ((type *) Ax) [0] ; \ - OK (prefix ## Matrix_assign ## suffix (C, Mask, accum, \ - x, I, ni, J, nj,desc)) ; \ - } break ; - - switch (A->type->code) - { - case GB_BOOL_code : ASSIGN (GrB_, _BOOL, bool) ; - case GB_INT8_code : ASSIGN (GrB_, _INT8, int8_t) ; - case GB_INT16_code : ASSIGN (GrB_, _INT16, int16_t) ; - case GB_INT32_code : ASSIGN (GrB_, _INT32, int32_t) ; - case GB_INT64_code : ASSIGN (GrB_, _INT64, int64_t) ; - case GB_UINT8_code : ASSIGN (GrB_, _UINT8, uint8_t) ; - case GB_UINT16_code : ASSIGN (GrB_, _UINT16, uint16_t) ; - case GB_UINT32_code : ASSIGN (GrB_, _UINT32, uint32_t) ; - case GB_UINT64_code : ASSIGN (GrB_, _UINT64, uint64_t) ; - case GB_FP32_code : ASSIGN (GrB_, _FP32, float) ; - case GB_FP64_code : ASSIGN (GrB_, _FP64, double) ; - case GB_FC32_code : ASSIGN (GxB_, _FC32, GxB_FC32_t) ; - case GB_FC64_code : ASSIGN (GxB_, _FC64, GxB_FC64_t) ; - case GB_UDT_code : - { - OK (GrB_Matrix_assign_UDT (C, Mask, accum, - Ax, I, ni, J, nj, desc)) ; - } - break ; - - default: - FREE_ALL ; - mexErrMsgTxt ("unknown type: mtx assign") ; - } - } - - } - else if (C->vdim == 1 && A->vdim == 1 && - (Mask == NULL || Mask->vdim == 1) && !at) - { - // test GrB_Vector_assign - OK (GrB_Vector_assign_((GrB_Vector) C, (GrB_Vector) Mask, accum, - (GrB_Vector) A, I, ni, desc)) ; - } - else - { - // standard submatrix assignment - OK (GrB_Matrix_assign_(C, Mask, accum, A, I, ni, J, nj, desc)) ; - } - - ASSERT_MATRIX_OK (C, "Final C before wait", GB0) ; - OK (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; - return (info) ; -} - -//------------------------------------------------------------------------------ -// many_assign: do a sequence of assignments -//------------------------------------------------------------------------------ - -// The list of assignments is in a struct array - -GrB_Info many_assign -( - int nwork, - int fA, - int fI, - int fJ, - int faccum, - int fMask, - int fdesc, - const mxArray *pargin [ ] -) -{ - GrB_Info info = GrB_SUCCESS ; - - for (int64_t k = 0 ; k < nwork ; k++) - { - - //---------------------------------------------------------------------- - // get the kth work to do - //---------------------------------------------------------------------- - - // each struct has fields A, I, J, and optionally Mask, accum, and desc - - mxArray *p ; - - // [ turn off malloc debugging - bool save = GB_Global_malloc_debug_get ( ) ; - GB_Global_malloc_debug_set (false) ; - - // get Mask (shallow copy) - Mask = NULL ; - if (fMask >= 0) - { - p = mxGetFieldByNumber (pargin [1], k, fMask) ; - Mask = GB_mx_mxArray_to_Matrix (p, "Mask", false, false) ; - if (Mask == NULL && !mxIsEmpty (p)) - { - FREE_ALL ; - mexErrMsgTxt ("Mask failed") ; - } - } - - // get A (shallow copy) - p = mxGetFieldByNumber (pargin [1], k, fA) ; - A = GB_mx_mxArray_to_Matrix (p, "A", false, true) ; - if (A == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("A failed") ; - } - - // get accum, if present - accum = NULL ; - if (faccum >= 0) - { - p = mxGetFieldByNumber (pargin [1], k, faccum) ; - bool user_complex = (Complex != GxB_FC64) - && (C->type == Complex || A->type == Complex) ; - if (!GB_mx_mxArray_to_BinaryOp (&accum, p, "accum", - C->type, user_complex)) - { - FREE_ALL ; - mexErrMsgTxt ("accum failed") ; - } - } - - // get I - p = mxGetFieldByNumber (pargin [1], k, fI) ; - if (!GB_mx_mxArray_to_indices (&I, p, &ni, I_range, &ignore)) - { - FREE_ALL ; - mexErrMsgTxt ("I failed") ; - } - - // get J - p = mxGetFieldByNumber (pargin [1], k, fJ) ; - if (!GB_mx_mxArray_to_indices (&J, p, &nj, J_range, &ignore)) - { - FREE_ALL ; - mexErrMsgTxt ("J failed") ; - } - - // get desc - desc = NULL ; - if (fdesc > 0) - { - p = mxGetFieldByNumber (pargin [1], k, fdesc) ; - if (!GB_mx_mxArray_to_Descriptor (&desc, p, "desc")) - { - FREE_ALL ; - mexErrMsgTxt ("desc failed") ; - } - } - - // restore malloc debugging to test the method - GB_Global_malloc_debug_set (save) ; // ] - - //---------------------------------------------------------------------- - // C(I,J) = A - //---------------------------------------------------------------------- - - info = assign ( ) ; - - GrB_Matrix_free_(&A) ; - GrB_Matrix_free_(&Mask) ; - GrB_Descriptor_free_(&desc) ; - - if (info != GrB_SUCCESS) - { - return (info) ; - } - } - - ASSERT_MATRIX_OK (C, "Final C before wait", GB0) ; - OK (GrB_Matrix_wait_(C, GrB_MATERIALIZE)) ; - return (info) ; -} - -//------------------------------------------------------------------------------ -// GB_mex_assign mexFunction -//------------------------------------------------------------------------------ - -void mexFunction -( - int nargout, - mxArray *pargout [ ], - int nargin, - const mxArray *pargin [ ] -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - malloc_debug = GB_mx_get_global (true) ; - A = NULL ; - C = NULL ; - Mask = NULL ; - desc = NULL ; - - if (nargout > 1 || ! (nargin == 2 || nargin == 6 || nargin == 7)) - { - mexErrMsgTxt ("Usage: " USAGE) ; - } - - //-------------------------------------------------------------------------- - // get C (make a deep copy) - //-------------------------------------------------------------------------- - - GET_DEEP_COPY ; - if (C == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("C failed") ; - } - - if (nargin == 2) - { - - //---------------------------------------------------------------------- - // get a list of work to do: a struct array of length nwork - //---------------------------------------------------------------------- - - // each entry is a struct with fields: - // Mask, accum, A, I, J, desc - - if (!mxIsStruct (pargin [1])) - { - FREE_ALL ; - mexErrMsgTxt ("2nd argument must be a struct") ; - } - - int nwork = mxGetNumberOfElements (pargin [1]) ; - int nf = mxGetNumberOfFields (pargin [1]) ; - for (int f = 0 ; f < nf ; f++) - { - mxArray *p ; - for (int k = 0 ; k < nwork ; k++) - { - p = mxGetFieldByNumber (pargin [1], k, f) ; - } - } - - int fA = mxGetFieldNumber (pargin [1], "A") ; - int fI = mxGetFieldNumber (pargin [1], "I") ; - int fJ = mxGetFieldNumber (pargin [1], "J") ; - int faccum = mxGetFieldNumber (pargin [1], "accum") ; - int fMask = mxGetFieldNumber (pargin [1], "Mask") ; - int fdesc = mxGetFieldNumber (pargin [1], "desc") ; - - if (fA < 0 || fI < 0 || fJ < 0) mexErrMsgTxt ("A,I,J required") ; - - METHOD (many_assign (nwork, fA, fI, fJ, faccum, fMask, fdesc, pargin)) ; - - } - else - { - - //---------------------------------------------------------------------- - // C(I,J) = A, with a single assignment - //---------------------------------------------------------------------- - - // get Mask (shallow copy) - Mask = GB_mx_mxArray_to_Matrix (pargin [1], "Mask", false, false) ; - if (Mask == NULL && !mxIsEmpty (pargin [1])) - { - FREE_ALL ; - mexErrMsgTxt ("Mask failed") ; - } - - // get A (shallow copy) - A = GB_mx_mxArray_to_Matrix (pargin [3], "A", false, true) ; - if (A == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("A failed") ; - } - - // get accum, if present - bool user_complex = (Complex != GxB_FC64) - && (C->type == Complex || A->type == Complex) ; - accum = NULL ; - if (!GB_mx_mxArray_to_BinaryOp (&accum, pargin [2], "accum", - C->type, user_complex)) - { - FREE_ALL ; - mexErrMsgTxt ("accum failed") ; - } - - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) - { - FREE_ALL ; - mexErrMsgTxt ("I failed") ; - } - - // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) - { - FREE_ALL ; - mexErrMsgTxt ("J failed") ; - } - - // get desc - if (!GB_mx_mxArray_to_Descriptor (&desc, PARGIN (6), "desc")) - { - FREE_ALL ; - mexErrMsgTxt ("desc failed") ; - } - - // C(I,J) = A - - METHOD (assign ( )) ; - } - - //-------------------------------------------------------------------------- - // return C as a struct - //-------------------------------------------------------------------------- - - pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C assign result", true) ; - FREE_ALL ; -} - diff --git a/GraphBLAS/Test/GB_mex_Col_extract.c b/GraphBLAS/Test/GB_mex_Col_extract.c index f79d87950a..69ba2dfbd0 100644 --- a/GraphBLAS/Test/GB_mex_Col_extract.c +++ b/GraphBLAS/Test/GB_mex_Col_extract.c @@ -2,20 +2,21 @@ // GB_mex_Col_extract: interface for w = accum (w,A(I,j)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "w = GB_mex_Col_extract (w, mask, accum, A, I, j, desc)" +#define USAGE "w = GB_mex_Col_extract (w, mask, accum, A, I, j, desc, method)" #define FREE_ALL \ { \ GrB_Vector_free_(&w) ; \ GrB_Vector_free_(&mask) ; \ GrB_Matrix_free_(&A) ; \ + GrB_Matrix_free_(&I_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -30,16 +31,15 @@ void mexFunction { bool malloc_debug = GB_mx_get_global (true) ; - GrB_Vector w = NULL ; - GrB_Vector mask = NULL ; + GrB_Vector w = NULL, mask = NULL, I_vector = NULL ; GrB_Matrix A = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; // check inputs - if (nargout > 1 || nargin < 6 || nargin > 7) + if (nargout > 1 || nargin < 6 || nargin > 8) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -82,27 +82,38 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + // get the method: 0: use (uint64_t *), 1: use GrB_Vector for I + int GET_SCALAR (7, int, method, 0) ; + + if (method == 0) { - FREE_ALL ; - mexErrMsgTxt ("I failed") ; + // get I + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + NULL)) + { + FREE_ALL ; + mexErrMsgTxt ("I failed") ; + } + } + else + { + // get I_vector + I_vector = GB_mx_mxArray_to_Vector (pargin [4], "I", false, false) ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; } - if (nj != 1) { FREE_ALL ; mexErrMsgTxt ("j must be a scalar") ; } - - GrB_Index j = J [0] ; + uint64_t j = J [0] ; // get desc if (!GB_mx_mxArray_to_Descriptor (&desc, PARGIN (6), "desc")) @@ -112,7 +123,14 @@ void mexFunction } // w = accum (w,A(I,j)) - METHOD (GrB_Col_extract_(w, mask, accum, A, I, ni, j, desc)) ; + if (method == 0) + { + METHOD (GrB_Col_extract_(w, mask, accum, A, I, ni, j, desc)) ; + } + else + { + METHOD (GxB_Col_extract_Vector_(w, mask, accum, A, I_vector, j, desc)) ; + } // return w as a struct and free the GraphBLAS C pargout [0] = GB_mx_Vector_to_mxArray (&w, "w output", true) ; diff --git a/GraphBLAS/Test/GB_mex_Matrix_build.c b/GraphBLAS/Test/GB_mex_Matrix_build.c index 630d6e3f25..0be5e1b01c 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_build.c +++ b/GraphBLAS/Test/GB_mex_Matrix_build.c @@ -2,12 +2,13 @@ // GB_mex_Matrix_build.c: interface to GrB_Matrix_build //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" +#include "GB_mex_errors.h" #define MATRIX #include "GB_mx_build_template.c" diff --git a/GraphBLAS/Test/GB_mex_Matrix_eWiseAdd.c b/GraphBLAS/Test/GB_mex_Matrix_eWiseAdd.c index 699b01571c..b2a4a7658d 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_eWiseAdd.c +++ b/GraphBLAS/Test/GB_mex_Matrix_eWiseAdd.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_eWiseAdd: C = accum(C,A+B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Matrix_eWiseMult.c b/GraphBLAS/Test/GB_mex_Matrix_eWiseMult.c index 39d981266f..18da6631fd 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_eWiseMult.c +++ b/GraphBLAS/Test/GB_mex_Matrix_eWiseMult.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_eWiseMult: C = accum(C,A.*B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Matrix_eWiseUnion.c b/GraphBLAS/Test/GB_mex_Matrix_eWiseUnion.c index 8bb0719859..abf808f3b9 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_eWiseUnion.c +++ b/GraphBLAS/Test/GB_mex_Matrix_eWiseUnion.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_eWiseUnion: C = accum(C,A+B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Matrix_extract.c b/GraphBLAS/Test/GB_mex_Matrix_extract.c index 92057fc9b9..df5aa1ce8f 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_extract.c +++ b/GraphBLAS/Test/GB_mex_Matrix_extract.c @@ -2,20 +2,23 @@ // GB_mex_Matrix_extract: interface for C = accum (C,A(I,J)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "C = GB_mex_Matrix_extract (C, Mask, accum, A, I, J, desc)" +#define USAGE "C = GB_mex_Matrix_extract" \ + " (C, Mask, accum, A, I, J, desc, method)" #define FREE_ALL \ { \ GrB_Matrix_free_(&C) ; \ GrB_Matrix_free_(&Mask) ; \ GrB_Matrix_free_(&A) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -33,13 +36,14 @@ void mexFunction GrB_Matrix C = NULL ; GrB_Matrix Mask = NULL ; GrB_Matrix A = NULL ; + GrB_Vector I_vector = NULL, J_vector = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; // check inputs - if (nargout > 1 || nargin < 6 || nargin > 7) + if (nargout > 1 || nargin < 6 || nargin > 8) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -82,15 +86,19 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } + // get the method: 0: use (uint64_t *), 1: use GrB_Vector for I,J + int GET_SCALAR (7, int, method, 0) ; + // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + (method == 0) ? NULL : &I_vector)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } - // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + (method == 0) ? NULL : &J_vector)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -104,7 +112,15 @@ void mexFunction } // C = accum (C,A(I,J)) - METHOD (GrB_Matrix_extract_(C, Mask, accum, A, I, ni, J, nj, desc)) ; + if (method == 0) + { + METHOD (GrB_Matrix_extract_(C, Mask, accum, A, I, ni, J, nj, desc)) ; + } + else + { + METHOD (GxB_Matrix_extract_Vector_(C, Mask, accum, A, + I_vector, J_vector, desc)) ; + } // return C as a struct and free the GraphBLAS C pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", true) ; diff --git a/GraphBLAS/Test/GB_mex_Matrix_extractElement.c b/GraphBLAS/Test/GB_mex_Matrix_extractElement.c index 211562fd24..ff863486c9 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_extractElement.c +++ b/GraphBLAS/Test/GB_mex_Matrix_extractElement.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_extractElement: interface for x = A(i,j) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,8 +35,8 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; GB_void *Y = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK + uint64_t *J = NULL, nj = 0, J_range [3] ; // OK bool is_list ; GrB_Scalar S = NULL ; @@ -58,7 +58,8 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; @@ -69,7 +70,8 @@ void mexFunction } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -98,7 +100,7 @@ void mexFunction size_t s = 2 * sizeof (double) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; bool is_scalar = GB_SCALAR_OK (A) ; diff --git a/GraphBLAS/Test/GB_mex_Matrix_extract_UDT.c b/GraphBLAS/Test/GB_mex_Matrix_extract_UDT.c index fb68401b95..93b227606b 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_extract_UDT.c +++ b/GraphBLAS/Test/GB_mex_Matrix_extract_UDT.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_extract_UDT: interface for C = accum (C,A(I,J)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "C = GB_mex_Matrix_extract (C, Mask, accum, A, I, J, desc, hack)" +#define USAGE "C = GB_mex_Matrix_extract (C, Mask, accum, A, I, J, desc, use_mydouble)" #define FREE_ALL \ { \ @@ -47,10 +47,10 @@ void mexFunction GrB_Matrix Mask = NULL ; GrB_Matrix A = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; - GrB_Index m, n ; + uint64_t m, n ; GrB_Type mydouble = NULL ; GrB_UnaryOp castdouble = NULL, castback = NULL ; @@ -98,14 +98,14 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -118,18 +118,20 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } - // get the hack option - bool GET_SCALAR (7, bool, hack, false) ; + // get the use_mydouble option + bool GET_SCALAR (7, bool, use_mydouble, false) ; - if (hack) + if (use_mydouble) { // A = (mydouble) A, if A is double if (A->type == GrB_FP64 && C->type == GrB_FP64) { -// printf ("hack A\n") ; +// printf ("use_mydouble A\n") ; OK (GrB_Type_new (&mydouble, sizeof (double))) ; - OK (GrB_UnaryOp_new (&castdouble, cast_double, mydouble, GrB_FP64)) ; - OK (GrB_UnaryOp_new (&castback, cast_back, GrB_FP64, mydouble)) ; + OK (GrB_UnaryOp_new (&castdouble, + (GxB_unary_function) cast_double, mydouble, GrB_FP64)) ; + OK (GrB_UnaryOp_new (&castback, + (GxB_unary_function) cast_back, GrB_FP64, mydouble)) ; OK (GrB_Matrix_nrows (&m, A)) ; OK (GrB_Matrix_ncols (&n, A)) ; // OK (GxB_print (A, 2)) ; diff --git a/GraphBLAS/Test/GB_mex_Matrix_isStoredElement.c b/GraphBLAS/Test/GB_mex_Matrix_isStoredElement.c index c2489cd92e..d3bf52b59e 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_isStoredElement.c +++ b/GraphBLAS/Test/GB_mex_Matrix_isStoredElement.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_isStoredElement: interface for x = A(i,j) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,8 +33,8 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK + uint64_t *J = NULL, nj = 0, J_range [3] ; // OK bool is_list ; // check inputs @@ -55,24 +55,28 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("I is invalid; must be a list") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("J is invalid; must be a list") ; } diff --git a/GraphBLAS/Test/GB_mex_Matrix_sort.c b/GraphBLAS/Test/GB_mex_Matrix_sort.c index 60b834456c..eeb4815a18 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_sort.c +++ b/GraphBLAS/Test/GB_mex_Matrix_sort.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_sort: [C,P] = sort (A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ #include "GB_mex.h" #define USAGE \ - "[C,P] = GB_mex_Matrix_sort (op, A, desc, arg1)" + "[C,P] = GB_mex_Matrix_sort (op, A, desc, arg1, ptype)" #define FREE_ALL \ { \ @@ -40,7 +40,7 @@ void mexFunction GrB_BinaryOp lt = NULL ; // check inputs - if (nargout > 2 || nargin < 2 || nargin > 4) + if (nargout > 2 || nargin < 2 || nargin > 5) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -72,45 +72,61 @@ void mexFunction // get arg1 int GET_SCALAR (3, int, arg1, false) ; - if (arg1 < 0 && op == GrB_LT_FP64) { // use a user-defined "<" op instead of GrB_LT_FP64 - GrB_BinaryOp_new (<, my_lt_double, GrB_BOOL, GrB_FP64, GrB_FP64) ; + GrB_BinaryOp_new (<, + (GxB_binary_function) + my_lt_double, GrB_BOOL, GrB_FP64, GrB_FP64) ; op = lt ; } + // get ptype; defaults to GrB_INT64 + GrB_Type ptype = GB_mx_string_to_Type (PARGIN (4), GrB_INT64) ; + // create C and P - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; // P = GB_mex_Matrix_sort (op, A, desc, 1): do not compute C bool P_only = (arg1 >= 1 && nargout == 1) ; - if (!P_only) - { - GrB_Matrix_new (&C, A->type, nrows, ncols) ; - } - if (P_only || nargout > 1) - { - GrB_Matrix_new (&P, GrB_INT64, nrows, ncols) ; - } - if (nargout == 1 && !P_only) + if (nargout == 1) { - GrB_Matrix_free (&C) ; - #define FREE_DEEP_COPY GrB_Matrix_free (&C) ; - #define GET_DEEP_COPY GrB_Matrix_dup (&C, A) ; - GET_DEEP_COPY ; - METHOD (GxB_Matrix_sort (C, NULL, op, C, desc)) ; + if (P_only) + { + // P = sort (op, A, desc), do not return C + #undef FREE_DEEP_COPY + #define FREE_DEEP_COPY GrB_Matrix_free (&P) ; + #undef GET_DEEP_COPY + #define GET_DEEP_COPY GrB_Matrix_new (&P, ptype, nrows, ncols) ; + GET_DEEP_COPY ; + METHOD (GxB_Matrix_sort (NULL, P, op, A, desc)) ; + } + else + { + // C = sort (op, C, desc), in place + #undef FREE_DEEP_COPY + #define FREE_DEEP_COPY GrB_Matrix_free (&C) ; + #undef GET_DEEP_COPY + #define GET_DEEP_COPY GrB_Matrix_dup (&C, A) ; + GET_DEEP_COPY ; + METHOD (GxB_Matrix_sort (C, NULL, op, C, desc)) ; + } } else { - // [C,P] = sort(op,A,desc) + // [C,P] = sort (op, A, desc) #undef FREE_DEEP_COPY - #define FREE_DEEP_COPY ; + #define FREE_DEEP_COPY \ + GrB_Matrix_free (&C) ; \ + GrB_Matrix_free (&P) ; #undef GET_DEEP_COPY - #define GET_DEEP_COPY ; + #define GET_DEEP_COPY \ + GrB_Matrix_new (&C, A->type, nrows, ncols) ; \ + GrB_Matrix_new (&P, ptype, nrows, ncols) ; + GET_DEEP_COPY ; METHOD (GxB_Matrix_sort (C, P, op, A, desc)) ; } diff --git a/GraphBLAS/Test/GB_mex_Matrix_subref.c b/GraphBLAS/Test/GB_mex_Matrix_subref.c index 20ef9f016e..57bddac0ed 100644 --- a/GraphBLAS/Test/GB_mex_Matrix_subref.c +++ b/GraphBLAS/Test/GB_mex_Matrix_subref.c @@ -2,7 +2,7 @@ // GB_mex_Matrix_subref: C=A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,12 +27,12 @@ void mexFunction ) { struct GB_Matrix_opaque C_header ; - GrB_Matrix C = GB_clear_static_header (&C_header) ; + GrB_Matrix C = GB_clear_matrix_header (&C_header) ; bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; // check inputs @@ -54,21 +54,25 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; } + bool I_is_32 = false ; + bool J_is_32 = false ; + // C = A(I,J), numeric not symbolic - METHOD (GB_subref (C, C->iso, true, A, I, ni, J, nj, false, Werk)) ; + METHOD (GB_subref (C, C->iso, true, A, I, I_is_32, ni, J, J_is_32, nj, + false, Werk)) ; // return C pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C subref result", false) ; diff --git a/GraphBLAS/Test/GB_mex_Vector_build.c b/GraphBLAS/Test/GB_mex_Vector_build.c index 74cf8b6169..d7a0fff2ed 100644 --- a/GraphBLAS/Test/GB_mex_Vector_build.c +++ b/GraphBLAS/Test/GB_mex_Vector_build.c @@ -2,11 +2,12 @@ // GB_mex_Vector_build.c: interface to GrB_Vector_build //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" +#include "GB_mex_errors.h" #include "GB_mx_build_template.c" diff --git a/GraphBLAS/Test/GB_mex_Vector_eWiseAdd.c b/GraphBLAS/Test/GB_mex_Vector_eWiseAdd.c index 669522c382..047c0d15fd 100644 --- a/GraphBLAS/Test/GB_mex_Vector_eWiseAdd.c +++ b/GraphBLAS/Test/GB_mex_Vector_eWiseAdd.c @@ -2,7 +2,7 @@ // GB_mex_Vector_eWiseAdd: w = accum(w,u+v) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Vector_eWiseMult.c b/GraphBLAS/Test/GB_mex_Vector_eWiseMult.c index 8532de94ca..f2fa47e039 100644 --- a/GraphBLAS/Test/GB_mex_Vector_eWiseMult.c +++ b/GraphBLAS/Test/GB_mex_Vector_eWiseMult.c @@ -2,7 +2,7 @@ // GB_mex_Vector_eWiseMult: w = accum(w,u.*v) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Vector_eWiseUnion.c b/GraphBLAS/Test/GB_mex_Vector_eWiseUnion.c index 991ccb092a..f6bd394ff3 100644 --- a/GraphBLAS/Test/GB_mex_Vector_eWiseUnion.c +++ b/GraphBLAS/Test/GB_mex_Vector_eWiseUnion.c @@ -2,7 +2,7 @@ // GB_mex_Vector_eWiseUnion: w = accum(w,u+v) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_Vector_extract.c b/GraphBLAS/Test/GB_mex_Vector_extract.c index 8a093b297d..d4db2f73cf 100644 --- a/GraphBLAS/Test/GB_mex_Vector_extract.c +++ b/GraphBLAS/Test/GB_mex_Vector_extract.c @@ -2,20 +2,21 @@ // GB_mex_Vector_extract: interface for w = accum (w,u(I)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "w = GB_mex_Vector_extract w, mask, accum, u, I, desc)" +#define USAGE "w = GB_mex_Vector_extract (w, mask, accum, u, I, desc, method)" #define FREE_ALL \ { \ GrB_Vector_free_(&w) ; \ GrB_Vector_free_(&mask) ; \ GrB_Vector_free_(&u) ; \ + GrB_Vector_free_(&I_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -30,15 +31,13 @@ void mexFunction { bool malloc_debug = GB_mx_get_global (true) ; - GrB_Vector w = NULL ; - GrB_Vector mask = NULL ; - GrB_Vector u = NULL ; + GrB_Vector w = NULL, I_vector = NULL, mask = NULL, u = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; bool ignore ; // check inputs - if (nargout > 1 || nargin < 5 || nargin > 6) + if (nargout > 1 || nargin < 5 || nargin > 7) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -81,11 +80,23 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + // get the method: 0: use (uint64_t *), 1: use GrB_Vector for I,J + int GET_SCALAR (6, int, method, 0) ; + + if (method == 0) { - FREE_ALL ; - mexErrMsgTxt ("I failed") ; + // get I + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + NULL)) + { + FREE_ALL ; + mexErrMsgTxt ("I failed") ; + } + } + else + { + // get I_vector + I_vector = GB_mx_mxArray_to_Vector (pargin [4], "I", false, false) ; } // get desc @@ -96,7 +107,14 @@ void mexFunction } // w = accum (w,u(I)) - METHOD (GrB_Vector_extract_(w, mask, accum, u, I, ni, desc)) ; + if (method == 0) + { + METHOD (GrB_Vector_extract_(w, mask, accum, u, I, ni, desc)) ; + } + else + { + METHOD (GxB_Vector_extract_Vector_(w, mask, accum, u, I_vector, desc)) ; + } // return w as a struct and free the GraphBLAS w pargout [0] = GB_mx_Vector_to_mxArray (&w, "w output", true) ; diff --git a/GraphBLAS/Test/GB_mex_Vector_extractElement.c b/GraphBLAS/Test/GB_mex_Vector_extractElement.c index 0a9b813922..18b7e29d70 100644 --- a/GraphBLAS/Test/GB_mex_Vector_extractElement.c +++ b/GraphBLAS/Test/GB_mex_Vector_extractElement.c @@ -2,7 +2,7 @@ // GB_mex_Vector_extractElement: interface for x = v(i) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Vector v = NULL ; GB_void *Y = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK bool is_list ; GrB_Scalar S = NULL ; @@ -52,13 +52,15 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("I must be a list") ; } diff --git a/GraphBLAS/Test/GB_mex_Vector_isStoredElement.c b/GraphBLAS/Test/GB_mex_Vector_isStoredElement.c index 120196a7a4..2197c3ae71 100644 --- a/GraphBLAS/Test/GB_mex_Vector_isStoredElement.c +++ b/GraphBLAS/Test/GB_mex_Vector_isStoredElement.c @@ -2,7 +2,7 @@ // GB_mex_Vector_isStoredElement: interface for x = v(i) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Vector v = NULL ; bool *X = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK bool is_list ; // check inputs @@ -50,13 +50,15 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("I must be a list") ; } diff --git a/GraphBLAS/Test/GB_mex_Vector_sort.c b/GraphBLAS/Test/GB_mex_Vector_sort.c index 57b0c6a732..d56bee07e2 100644 --- a/GraphBLAS/Test/GB_mex_Vector_sort.c +++ b/GraphBLAS/Test/GB_mex_Vector_sort.c @@ -2,7 +2,7 @@ // GB_mex_Vector_sort: [C,P] = sort (A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ #include "GB_mex.h" #define USAGE \ - "[C,P] = GB_mex_Vector_sort (op, A, desc)" + "[C,P] = GB_mex_Vector_sort (op, A, desc, ptype)" #define FREE_ALL \ { \ @@ -36,7 +36,7 @@ void mexFunction GrB_Descriptor desc = NULL ; // check inputs - if (nargout > 2 || nargin < 2 || nargin > 3) + if (nargout > 2 || nargin < 2 || nargin > 4) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -66,8 +66,11 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } + // get ptype; defaults to GrB_INT64 + GrB_Type ptype = GB_mx_string_to_Type (PARGIN (3), GrB_INT64) ; + // create C and P - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; if (ncols != 1) @@ -75,21 +78,25 @@ void mexFunction mexErrMsgTxt ("A must be a column vector") ; } - GrB_Vector_new (&C, A->type, nrows) ; - if (nargout > 1) - { - GrB_Vector_new (&P, GrB_INT64, nrows) ; - } - GrB_Vector u = (GrB_Vector) A ; if (!GB_VECTOR_OK (u)) { mexErrMsgTxt ("invalid input vector") ; } + #define FREE_DEEP_COPY \ + GrB_Vector_free (&C) ; \ + GrB_Vector_free (&P) ; + + #define GET_DEEP_COPY \ + GrB_Vector_new (&C, A->type, nrows) ; \ + if (nargout > 1) \ + { \ + GrB_Vector_new (&P, ptype, nrows) ; \ + } + // [C,P] = sort(op,A,desc) - #define FREE_DEEP_COPY ; - #define GET_DEEP_COPY ; + GET_DEEP_COPY ; METHOD (GxB_Vector_sort (C, P, op, u, desc)) ; // return C as a struct and free the GraphBLAS C diff --git a/GraphBLAS/Test/GB_mex_apply.c b/GraphBLAS/Test/GB_mex_apply.c index e6cd116397..013f501d46 100644 --- a/GraphBLAS/Test/GB_mex_apply.c +++ b/GraphBLAS/Test/GB_mex_apply.c @@ -2,7 +2,7 @@ // GB_mex_apply: C = accum(C,op(A)) or op(A') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_apply1.c b/GraphBLAS/Test/GB_mex_apply1.c index 46afc19720..012e88a32e 100644 --- a/GraphBLAS/Test/GB_mex_apply1.c +++ b/GraphBLAS/Test/GB_mex_apply1.c @@ -2,7 +2,7 @@ // GB_mex_apply1: C = accum(C,op(x,A)) or op(x,A') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -274,11 +274,11 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("scalar failed") ; } - GrB_Index snrows, sncols, snvals ; + uint64_t snrows, sncols, snvals ; GrB_Matrix_nrows (&snrows, S) ; GrB_Matrix_ncols (&sncols, S) ; GrB_Matrix_nvals (&snvals, S) ; - GxB_Format_Value fmt ; + int fmt ; GxB_Matrix_Option_get_(S, GxB_FORMAT, &fmt) ; if (snrows != 1 || sncols != 1 || snvals != 1 || fmt != GxB_BY_COL) { diff --git a/GraphBLAS/Test/GB_mex_apply2.c b/GraphBLAS/Test/GB_mex_apply2.c index eb98d1a4dd..2c09f03f15 100644 --- a/GraphBLAS/Test/GB_mex_apply2.c +++ b/GraphBLAS/Test/GB_mex_apply2.c @@ -2,7 +2,7 @@ // GB_mex_apply2: C = accum(C,op(A,y)) or op(A',y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -274,11 +274,11 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("scalar failed") ; } - GrB_Index snrows, sncols, snvals ; + uint64_t snrows, sncols, snvals ; GrB_Matrix_nrows (&snrows, S) ; GrB_Matrix_ncols (&sncols, S) ; GrB_Matrix_nvals (&snvals, S) ; - GxB_Format_Value fmt ; + int fmt ; GxB_Matrix_Option_get_(S, GxB_FORMAT, &fmt) ; if (snrows != 1 || sncols != 1 || snvals != 1 || fmt != GxB_BY_COL) { diff --git a/GraphBLAS/Test/GB_mex_apply_alias.c b/GraphBLAS/Test/GB_mex_apply_alias.c index 8fe111345f..1a930e164f 100644 --- a/GraphBLAS/Test/GB_mex_apply_alias.c +++ b/GraphBLAS/Test/GB_mex_apply_alias.c @@ -2,7 +2,7 @@ // GB_mex_apply_alias: C = op(C) using a unary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_apply_idxunop.c b/GraphBLAS/Test/GB_mex_apply_idxunop.c index b5a1c8854d..89d333f95c 100644 --- a/GraphBLAS/Test/GB_mex_apply_idxunop.c +++ b/GraphBLAS/Test/GB_mex_apply_idxunop.c @@ -2,7 +2,7 @@ // GB_mex_apply_idxunop: C = accum(C,op(A,y)) or op(A',y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -274,11 +274,11 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("scalar failed") ; } - GrB_Index snrows, sncols, snvals ; + uint64_t snrows, sncols, snvals ; GrB_Matrix_nrows (&snrows, S) ; GrB_Matrix_ncols (&sncols, S) ; GrB_Matrix_nvals (&snvals, S) ; - GxB_Format_Value fmt ; + int fmt ; GxB_Matrix_Option_get_(S, GxB_FORMAT, &fmt) ; if (snrows != 1 || sncols != 1 || snvals != 1 || fmt != GxB_BY_COL) { diff --git a/GraphBLAS/Test/GB_mex_apply_idxunop_user.c b/GraphBLAS/Test/GB_mex_apply_idxunop_user.c index 8bf5bcac69..00953cb3a8 100644 --- a/GraphBLAS/Test/GB_mex_apply_idxunop_user.c +++ b/GraphBLAS/Test/GB_mex_apply_idxunop_user.c @@ -2,7 +2,7 @@ // GB_mex_apply_idxunop_user: C = idxunop (A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,8 +25,8 @@ GrB_Matrix C = NULL ; GrB_Matrix A = NULL ; GrB_IndexUnaryOp op = NULL ; -void idx2 (int64_t *z, const void *x, GrB_Index i, GrB_Index j, const void *y); -void idx2 (int64_t *z, const void *x, GrB_Index i, GrB_Index j, const void *y) +void idx2 (int64_t *z, const void *x, uint64_t i, uint64_t j, const void *y) ; +void idx2 (int64_t *z, const void *x, uint64_t i, uint64_t j, const void *y) { uint64_t thunk = *((uint64_t *) y) ; (*z) = i + j + thunk ; @@ -69,7 +69,7 @@ void mexFunction } // C = op (A), where thunk = 1 - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; GrB_Matrix_new (&C, GrB_FP64, nrows, ncols) ; diff --git a/GraphBLAS/Test/GB_mex_apply_maskalias.c b/GraphBLAS/Test/GB_mex_apply_maskalias.c index 46a330dfee..0c07fa569e 100644 --- a/GraphBLAS/Test/GB_mex_apply_maskalias.c +++ b/GraphBLAS/Test/GB_mex_apply_maskalias.c @@ -2,7 +2,7 @@ // GB_mex_apply_maskalias: C = accum(C,op(A)) or op(A') //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_argmax.c b/GraphBLAS/Test/GB_mex_argmax.c index a738dc322c..64f8c3e59d 100644 --- a/GraphBLAS/Test/GB_mex_argmax.c +++ b/GraphBLAS/Test/GB_mex_argmax.c @@ -2,7 +2,7 @@ // GB_mex_argmax: compute [x,p]=argmax(A,dim,pr,jit) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,22 +17,22 @@ "typedef struct { int64_t k ; double v ; } tuple_kv ;" void make_tuple_kv (tuple_kv *z, - const double *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) ; void make_tuple_kv (tuple_kv *z, - const double *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const void *theta) { z->k = (int64_t) jx + 1 ; z->v = (*x) ; } -#define MAKE_TUPLE_KV \ +#define MAKE_TUPLE_KV_DEFN \ "void make_tuple_kv (tuple_kv *z, \n" \ -" const double *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const double *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const void *theta) \n" \ "{ \n" \ " z->k = (int64_t) jx + 1 ; \n" \ @@ -145,7 +145,7 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("failed") ; } - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; @@ -180,7 +180,7 @@ void mexFunction METHOD (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) make_tuple_kv, Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, - "make_tuple_kv", MAKE_TUPLE_KV)) ; + "make_tuple_kv", MAKE_TUPLE_KV_DEFN)) ; } else { @@ -191,7 +191,7 @@ void mexFunction NULL, NULL)) ; } OK (GxB_IndexBinaryOp_wait (Iop, GrB_MATERIALIZE)) ; - char *error ; + const char *error ; OK (GxB_IndexBinaryOp_error (&error, Iop)) ; if (error == NULL || strlen (error) > 0) { @@ -273,10 +273,10 @@ void mexFunction OK (GxB_IndexBinaryOp_get_SIZE (Iop, &name_size, GxB_JIT_C_NAME)) ; // printf ("name size %d\n", (int) name_size) ; char name [256] ; - OK (GxB_IndexBinaryOp_get_String (Iop, &name, GxB_JIT_C_NAME)) ; + OK (GxB_IndexBinaryOp_get_String (Iop, name, GxB_JIT_C_NAME)) ; // printf ("name [%s]\n", name) ; int expected = GrB_INVALID_VALUE ; - ERR (GxB_IndexBinaryOp_get_VOID (Iop, &name, GxB_JIT_C_NAME)) ; + ERR (GxB_IndexBinaryOp_get_VOID (Iop, name, GxB_JIT_C_NAME)) ; OK (GxB_IndexBinaryOp_set_String (Iop, "my index binop", GrB_NAME)) ; name [0] = '\0' ; diff --git a/GraphBLAS/Test/GB_mex_assign.c b/GraphBLAS/Test/GB_mex_assign.c index 58bd2c35ad..9c7ed12e1b 100644 --- a/GraphBLAS/Test/GB_mex_assign.c +++ b/GraphBLAS/Test/GB_mex_assign.c @@ -2,7 +2,7 @@ // GB_mex_assign: C(I,J) = accum (C (I,J), A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This function is a wrapper for GrB_Matrix_assign, GrB_Matrix_assign_T @@ -18,6 +18,14 @@ // (when kind=0), GB_spec_Col_assign (when kind=1), and GB_spec_Row_assign // (when kind=2). +// When kind=3, the indices I and J are passed into GxB_Matrix_assign_Vector +// as GrB_Vectors, not plain uint64_t * arrays. + +// kind=4: GxB_Col_assign_Vector +// kind=5: GxB_Row_assign_Vector +// kind=6: GxB_Matrix_assign_Scalar_Vector or GxB_Vector_assign_Scalar_Vector +// kind=7: GxB_Vector_assign_Vector or GxB_Matrix_assign_Vector + //------------------------------------------------------------------------------ #include "GB_mex.h" @@ -29,6 +37,8 @@ GrB_Matrix_free_(&A) ; \ GrB_Matrix_free_(&Mask) ; \ GrB_Matrix_free_(&C) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -47,8 +57,8 @@ GrB_Matrix Mask = NULL ; GrB_Matrix A = NULL ; GrB_Descriptor desc = NULL ; GrB_BinaryOp accum = NULL ; -GrB_Index *I = NULL, ni = 0, I_range [3] ; -GrB_Index *J = NULL, nj = 0, J_range [3] ; +uint64_t *I = NULL, ni = 0, I_range [3] ; GrB_Vector I_vector = NULL ; +uint64_t *J = NULL, nj = 0, J_range [3] ; GrB_Vector J_vector = NULL ; bool ignore ; bool malloc_debug = false ; GrB_Info info = GrB_SUCCESS ; @@ -102,15 +112,40 @@ GrB_Info assign ( ) if (kind == 1) { + + //---------------------------------------------------------------------- // test GrB_Col_assign + //---------------------------------------------------------------------- + ASSERT (GB_VECTOR_OK (A)) ; ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; OK (GrB_Col_assign_(C, (GrB_Vector) Mask, accum, (GrB_Vector) A, I, ni, J [0], desc)) ; + + } + else if (kind == 4) + { + + //---------------------------------------------------------------------- + // test GxB_Col_assign_Vector + //---------------------------------------------------------------------- + + uint64_t j0 = 0 ; + OK (GrB_Vector_extractElement_UINT64_(&j0, J_vector, 0)) ; + + ASSERT (GB_VECTOR_OK (A)) ; + ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; + OK (GxB_Col_assign_Vector(C, (GrB_Vector) Mask, accum, (GrB_Vector) A, + I_vector, j0, desc)) ; + } else if (kind == 2) { + + //---------------------------------------------------------------------- // test GrB_Row_assign + //---------------------------------------------------------------------- + ASSERT (GB_VECTOR_OK (A)) ; ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; ASSERT_VECTOR_OK_OR_NULL ((GrB_Vector) Mask, "row mask", GB0) ; @@ -118,24 +153,94 @@ GrB_Info assign ( ) OK (GrB_Row_assign_(C, (GrB_Vector) Mask, accum, (GrB_Vector) A, I [0], J, nj, desc)) ; + + } + else if (kind == 5) + { + + //---------------------------------------------------------------------- + // test GxB_Row_assign_Vector + //---------------------------------------------------------------------- + + uint64_t i0 = 0 ; + OK (GrB_Vector_extractElement_UINT64_(&i0, I_vector, 0)) ; + + ASSERT (GB_VECTOR_OK (A)) ; + ASSERT (Mask == NULL || GB_VECTOR_OK (Mask)) ; + ASSERT_VECTOR_OK_OR_NULL ((GrB_Vector) Mask, "row mask", GB0) ; + ASSERT_VECTOR_OK ((GrB_Vector) A, "row u", GB0) ; + + OK (GxB_Row_assign_Vector_(C, (GrB_Vector) Mask, accum, (GrB_Vector) A, + i0, J_vector, desc)) ; + + } + else if (kind == 3) + { + + //---------------------------------------------------------------------- + // test GxB_*_assign_Vector, with GrB_Vectors as I and J + //---------------------------------------------------------------------- + + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (Mask)) + { + OK (GxB_Vector_assign_Vector_((GrB_Vector) C, (GrB_Vector) Mask, + accum, (GrB_Vector) A, I_vector, desc)) ; + } + else + { + OK (GxB_Matrix_assign_Vector_((GrB_Matrix) C, (GrB_Matrix) Mask, + accum, A, I_vector, J_vector, desc)) ; + } + } else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && use_GrB_Scalar) { + + //---------------------------------------------------------------------- // use GrB_Matrix_assign_Scalar or GrB_Vector_assign_Scalar + //---------------------------------------------------------------------- + GrB_Scalar S = (GrB_Scalar) A ; - if (GB_VECTOR_OK (C) && GB_VECTOR_OK (Mask)) + + // OK but not used; see GB_mex_assign_scalar.c instead + if (kind == 6) { - OK (GrB_Vector_assign_Scalar ((GrB_Vector) C, (GrB_Vector) Mask, - accum, S, I, ni, desc)) ; + // test _Vector variant + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (Mask)) + { + OK (GxB_Vector_assign_Scalar_Vector_((GrB_Vector) C, + (GrB_Vector) Mask, accum, S, I_vector, desc)) ; + } + else + { + OK (GxB_Matrix_assign_Scalar_Vector_((GrB_Matrix) C, + (GrB_Matrix) Mask, accum, S, I_vector, J_vector, desc)) ; + } } else { - OK (GrB_Matrix_assign_Scalar ((GrB_Matrix) C, (GrB_Matrix) Mask, - accum, S, I, ni, J, nj, desc)) ; + // test original variants with (uint64_t *) arrays I and J + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (Mask)) + { + OK (GrB_Vector_assign_Scalar_((GrB_Vector) C, (GrB_Vector) Mask, + accum, S, I, ni, desc)) ; + } + else + { + OK (GrB_Matrix_assign_Scalar_((GrB_Matrix) C, (GrB_Matrix) Mask, + accum, S, I, ni, J, nj, desc)) ; + } } + } - else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && GB_nnz (A) == 1) + else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && GB_nnz (A) == 1 + && kind == 0) { + + //---------------------------------------------------------------------- + // test GrB_Matrix_assign_TYPE or GrB_Vector_assign_TYPE + //---------------------------------------------------------------------- + GB_void *Ax = A->x ; // OK: A is a scalar with exactly one entry if (ni == 1 && nj == 1 && Mask == NULL && I != GrB_ALL && J != GrB_ALL @@ -143,7 +248,10 @@ GrB_Info assign ( ) && desc == NULL) { + //------------------------------------------------------------------ // test GrB_Matrix_setElement + //------------------------------------------------------------------ + #define ASSIGN(prefix,suffix, type) \ { \ type x = ((type *) Ax) [0] ; \ @@ -178,7 +286,10 @@ GrB_Info assign ( ) else if (GB_VECTOR_OK (C) && (Mask == NULL || GB_VECTOR_OK (Mask))) { + //------------------------------------------------------------------ // test GrB_Vector_assign_scalar functions + //------------------------------------------------------------------ + #undef ASSIGN #define ASSIGN(prefix,suffix,type) \ { \ @@ -217,7 +328,10 @@ GrB_Info assign ( ) else { + //------------------------------------------------------------------ // test Matrix_assign_scalar functions + //------------------------------------------------------------------ + #undef ASSIGN #define ASSIGN(prefix,suffix,type) \ { \ @@ -253,18 +367,43 @@ GrB_Info assign ( ) mexErrMsgTxt ("unknown type: mtx assign") ; } } + } else if (GB_VECTOR_OK (C) && GB_VECTOR_OK (A) && (Mask == NULL || GB_VECTOR_OK (Mask)) && !at) { - // test GrB_Vector_assign - OK (GrB_Vector_assign_((GrB_Vector) C, (GrB_Vector) Mask, accum, - (GrB_Vector) A, I, ni, desc)) ; + + //---------------------------------------------------------------------- + // test GrB_Vector_assign and GxB_Vector_assign_Vector + //---------------------------------------------------------------------- + + if (kind == 7) + { + OK (GxB_Vector_assign_Vector_((GrB_Vector) C, (GrB_Vector) Mask, + accum, (GrB_Vector) A, I_vector, desc)) ; + } + else + { + OK (GrB_Vector_assign_((GrB_Vector) C, (GrB_Vector) Mask, accum, + (GrB_Vector) A, I, ni, desc)) ; + } } else { + + //---------------------------------------------------------------------- // standard submatrix assignment - OK (GrB_Matrix_assign_(C, Mask, accum, A, I, ni, J, nj, desc)) ; + //---------------------------------------------------------------------- + + if (kind == 7) + { + OK (GxB_Matrix_assign_Vector_(C, Mask, accum, A, I_vector, + J_vector, desc)) ; + } + else + { + OK (GrB_Matrix_assign_(C, Mask, accum, A, I, ni, J, nj, desc)) ; + } } ASSERT_MATRIX_OK (C, "Final C before wait", GB0) ; @@ -351,17 +490,28 @@ GrB_Info many_assign } } - // get I + // get kind (0: matrix/vector, 1: col_assign, 2: row_assign, + // 3 or more: matrix/vector with I and J as GrB_Vectors) + kind = 0 ; + if (fkind > 0) + { + p = mxGetFieldByNumber (pargin [1], k, fkind) ; + kind = (int) mxGetScalar (p) ; + } + + // get I: may be a GrB_Vector p = mxGetFieldByNumber (pargin [1], k, fI) ; - if (!GB_mx_mxArray_to_indices (&I, p, &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (p, &I, &ni, I_range, &ignore, + (kind >= 3) ? (&I_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } - // get J + // get J: may be a GrB_Vector p = mxGetFieldByNumber (pargin [1], k, fJ) ; - if (!GB_mx_mxArray_to_indices (&J, p, &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (p, &J, &nj, J_range, &ignore, + (kind >= 3) ? (&J_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -387,14 +537,6 @@ GrB_Info many_assign use_GrB_Scalar = (bool) (mxGetScalar (p) == 2) ; } - // get kind - kind = 0 ; - if (fkind > 0) - { - p = mxGetFieldByNumber (pargin [1], k, fkind) ; - kind = (int) mxGetScalar (p) ; - } - // restore malloc debugging to test the method GB_Global_malloc_debug_set (save) ; // ] @@ -406,6 +548,8 @@ GrB_Info many_assign GrB_Matrix_free_(&A) ; GrB_Matrix_free_(&Mask) ; + GrB_Vector_free_(&I_vector) ; + GrB_Vector_free_(&J_vector) ; GrB_Descriptor_free_(&desc) ; if (info != GrB_SUCCESS) @@ -445,6 +589,8 @@ void mexFunction C_sparsity_control = GxB_AUTO_SPARSITY ; M_sparsity_control = GxB_AUTO_SPARSITY ; have_sparsity_control = false ; + I_vector = NULL ; + J_vector = NULL ; //-------------------------------------------------------------------------- // check inputs @@ -459,7 +605,7 @@ void mexFunction // check inputs if (nargout > 1 || ! (nargin == 2 || nargin == 3 || nargin == 6 || nargin == 7 || - nargin == 8)) + nargin == 8 || nargin == 9)) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -562,15 +708,25 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + // get kind (0: matrix/vector, 1: col_assign, 2: row_assign, + // 3 or more: matrix/vector with I and J as GrB_Vectors) + kind = 0 ; + if (nargin > 7) + { + kind = (int) mxGetScalar (pargin [7]) ; + } + + // get I: may be a GrB_Vector + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + (kind >= 3) ? (&I_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } - // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + // get J: may be a GrB_Vector + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + (kind >= 3) ? (&J_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -583,13 +739,6 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } - // get kind (0: matrix/vector, 1: col_assign, 2: row_assign) - kind = 0 ; - if (nargin > 7) - { - kind = (int) mxGetScalar (pargin [7]) ; - } - // C(I,J) = A METHOD (assign ( )) ; } diff --git a/GraphBLAS/Test/GB_mex_assign_alias.c b/GraphBLAS/Test/GB_mex_assign_alias.c index 35fd87f9b2..a50fcb8905 100644 --- a/GraphBLAS/Test/GB_mex_assign_alias.c +++ b/GraphBLAS/Test/GB_mex_assign_alias.c @@ -2,7 +2,7 @@ // GB_mex_assign_alias: C(I,J) = accum(C(I,J),C) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,8 +30,8 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix C = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; // check inputs @@ -62,14 +62,14 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, PARGIN (2), &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (PARGIN (2), &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, PARGIN (3), &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (PARGIN (3), &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; diff --git a/GraphBLAS/Test/GB_mex_assign_alias_mask.c b/GraphBLAS/Test/GB_mex_assign_alias_mask.c index 99809effb6..c25293b533 100644 --- a/GraphBLAS/Test/GB_mex_assign_alias_mask.c +++ b/GraphBLAS/Test/GB_mex_assign_alias_mask.c @@ -2,7 +2,7 @@ // GB_mex_assign_alias_mask: C = A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -61,7 +61,7 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, C) ; GrB_Matrix_ncols (&ncols, C) ; diff --git a/GraphBLAS/Test/GB_mex_assign_alias_mask_scalar.c b/GraphBLAS/Test/GB_mex_assign_alias_mask_scalar.c index a3d4a00734..c38af0993a 100644 --- a/GraphBLAS/Test/GB_mex_assign_alias_mask_scalar.c +++ b/GraphBLAS/Test/GB_mex_assign_alias_mask_scalar.c @@ -2,7 +2,7 @@ // GB_mex_assign_alias_mask_scalar: C = scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,7 +26,7 @@ GrB_Info assign_mask_scalar (void) ; GrB_Info assign_mask_scalar (void) { GrB_Info info ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, C) ; GrB_Matrix_ncols (&ncols, C) ; GrB_Type stype ; @@ -159,11 +159,11 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("scalar failed") ; } - GrB_Index snrows, sncols, snvals ; + uint64_t snrows, sncols, snvals ; GrB_Matrix_nrows (&snrows, S) ; GrB_Matrix_ncols (&sncols, S) ; GrB_Matrix_nvals (&snvals, S) ; - GxB_Format_Value fmt ; + int fmt ; GxB_Matrix_Option_get_(S, GxB_FORMAT, &fmt) ; if (snrows != 1 || sncols != 1 || snvals != 1 || fmt != GxB_BY_COL) { diff --git a/GraphBLAS/Test/GB_mex_assign_scalar.c b/GraphBLAS/Test/GB_mex_assign_scalar.c index 8bb3812f24..b25f371f39 100644 --- a/GraphBLAS/Test/GB_mex_assign_scalar.c +++ b/GraphBLAS/Test/GB_mex_assign_scalar.c @@ -2,20 +2,22 @@ // GB_mex_assign_scalar: C(I,J) = accum (C (I,J), Scalar) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "C = GB_mex_assign_scalar(C,Mask,acc,S,I,J,desc)" +#define USAGE "C = GB_mex_assign_scalar(C,Mask,acc,S,I,J,desc,kind)" #define FREE_ALL \ { \ GrB_Matrix_free_(&A) ; \ GrB_Matrix_free_(&Mask) ; \ GrB_Matrix_free_(&C) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -30,8 +32,8 @@ GrB_Matrix Mask = NULL ; GrB_Matrix A = NULL ; GrB_Descriptor desc = NULL ; GrB_BinaryOp accum = NULL ; -GrB_Index *I = NULL, ni = 0, I_range [3] ; -GrB_Index *J = NULL, nj = 0, J_range [3] ; +uint64_t *I = NULL, ni = 0, I_range [3] ; GrB_Vector I_vector = NULL ; +uint64_t *J = NULL, nj = 0, J_range [3] ; GrB_Vector J_vector = NULL ; bool ignore ; bool malloc_debug = false ; GrB_Info info = GrB_SUCCESS ; @@ -84,7 +86,7 @@ void mexFunction desc = NULL ; // check inputs - if (nargout > 1 || nargin != 7 ) + if (nargout > 1 || !(nargin == 7 || nargin == 8)) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -128,15 +130,22 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } + // get kind: + // 0: use uint64_t * arrays for I and J + // else: use GrB_Vector variants + int GET_SCALAR (7, int, kind, 0) ; + // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + (kind == 0) ? NULL: (&I_vector))) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + (kind == 0) ? NULL: (&J_vector))) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -153,13 +162,30 @@ void mexFunction GrB_Scalar S = (GrB_Scalar) A ; if (GB_VECTOR_OK (C) && (Mask == NULL || GB_VECTOR_OK (Mask))) { - METHOD (GrB_Vector_assign_Scalar ((GrB_Vector) C, (GrB_Vector) Mask, - accum, S, I, ni, desc)) ; + if (kind == 0) + { + METHOD (GrB_Vector_assign_Scalar_((GrB_Vector) C, (GrB_Vector) Mask, + accum, S, I, ni, desc)) ; + } + else + { + METHOD (GxB_Vector_assign_Scalar_Vector_((GrB_Vector) C, + (GrB_Vector) Mask, accum, S, I_vector, desc)) ; + } } else { - METHOD (GrB_Matrix_assign_Scalar ((GrB_Matrix) C, (GrB_Matrix) Mask, - accum, S, I, ni, J, nj, desc)) ; + if (kind == 0) + { + METHOD (GrB_Matrix_assign_Scalar_((GrB_Matrix) C, (GrB_Matrix) Mask, + accum, S, I, ni, J, nj, desc)) ; + } + else + { + METHOD (GxB_Matrix_assign_Scalar_Vector_((GrB_Matrix) C, + (GrB_Matrix) Mask, + accum, S, I_vector, J_vector, desc)) ; + } } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_band.c b/GraphBLAS/Test/GB_mex_band.c index 2991bc8a36..1997b1cab3 100644 --- a/GraphBLAS/Test/GB_mex_band.c +++ b/GraphBLAS/Test/GB_mex_band.c @@ -2,7 +2,7 @@ // GB_mex_band: C = tril (triu (A,lo), hi), or with A' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,10 +40,10 @@ "typedef struct { int64_t lo ; int64_t hi ; } LoHi_type ;" void LoHi_band (bool *z, /* x is unused: */ const void *x, - GrB_Index i, GrB_Index j, const LoHi_type *thunk) ; + uint64_t i, uint64_t j, const LoHi_type *thunk) ; void LoHi_band (bool *z, /* x is unused: */ const void *x, - GrB_Index i, GrB_Index j, const LoHi_type *thunk) + uint64_t i, uint64_t j, const LoHi_type *thunk) { int64_t i2 = (int64_t) i ; int64_t j2 = (int64_t) j ; @@ -113,7 +113,7 @@ void mexFunction METHOD (GrB_IndexUnaryOp_new (&op, (GxB_index_unary_function) LoHi_band, GrB_BOOL, GrB_FP64, Thunk_type)) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; if (bandwidth.lo == 0 && bandwidth.hi == 0 && nrows == 10 && ncols == 10) diff --git a/GraphBLAS/Test/GB_mex_band2.c b/GraphBLAS/Test/GB_mex_band2.c index 29dca90e7f..bc9075567c 100644 --- a/GraphBLAS/Test/GB_mex_band2.c +++ b/GraphBLAS/Test/GB_mex_band2.c @@ -2,7 +2,7 @@ // GB_mex_band2: C = tril (triu (A,lo), hi), or with A' with typecasting //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,10 +40,10 @@ "typedef struct { int64_t lo ; int64_t hi ; } LoHi_type ;" void LoHi_band2 (int16_t *z, /* x is unused: */ const void *x, - GrB_Index i, GrB_Index j, const LoHi_type *thunk) ; + uint64_t i, uint64_t j, const LoHi_type *thunk) ; void LoHi_band2 (int16_t *z, /* x is unused: */ const void *x, - GrB_Index i, GrB_Index j, const LoHi_type *thunk) + uint64_t i, uint64_t j, const LoHi_type *thunk) { int64_t i2 = (int64_t) i ; int64_t j2 = (int64_t) j ; @@ -113,7 +113,7 @@ void mexFunction METHOD (GrB_IndexUnaryOp_new (&op, (GxB_index_unary_function) LoHi_band2, GrB_INT16, GrB_FP64, Thunk_type)) ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; if (bandwidth.lo == 0 && bandwidth.hi == 0 && nrows == 10 && ncols == 10) diff --git a/GraphBLAS/Test/GB_mex_binaryop.c b/GraphBLAS/Test/GB_mex_binaryop.c index 6d092b3f00..a4cbff8bc8 100644 --- a/GraphBLAS/Test/GB_mex_binaryop.c +++ b/GraphBLAS/Test/GB_mex_binaryop.c @@ -2,7 +2,7 @@ // GB_mex_binaryop: parse a binaryop, for testing //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_bsort.c b/GraphBLAS/Test/GB_mex_bsort.c new file mode 100644 index 0000000000..b47684ff00 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_bsort.c @@ -0,0 +1,237 @@ +//------------------------------------------------------------------------------ +// GB_mex_bsort: sort IJK using a struct qsort +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" + +#define USAGE "[I,J,K] = GB_mex_bsort (I,J,K)" + +typedef struct +{ + uint32_t i ; + uint32_t j ; + uint32_t k ; +} +GB_bsort_32_32_32_t ; + +typedef struct +{ + uint64_t i ; + uint64_t j ; + uint64_t k ; +} +GB_bsort_64_64_64_t ; + +#undef GB_lt_1 +#define GB_lt_1(A, a, B, b) (A [a].k < B [b].k) + +#undef GB_lt_2 +#define GB_lt_2(A, a, B, b) \ +( \ + (A [a].j < B [b].j) ? \ + ( \ + true \ + ) \ + : \ + ( \ + (A [a].j == B [b].j) ? \ + ( \ + GB_lt_1 (A, a, B, b) \ + ) \ + : \ + ( \ + false \ + ) \ + ) \ +) + +#undef GB_lt_3 +#define GB_lt_3(A, a, B, b) \ +( \ + (A [a].i < B [b].i) ? \ + ( \ + true \ + ) \ + : \ + ( \ + (A [a].i == B [b].i) ? \ + ( \ + GB_lt_2 (A, a, B, b) \ + ) \ + : \ + ( \ + false \ + ) \ + ) \ +) + +#undef GB_lt +#define GB_lt(A,a,B,b) GB_lt_3(A,a,B,b) + +// swap A [a] and A [b] +#undef GB_swap +#define GB_swap(A,a,b) \ +{ \ + GB_BSORT_T t = A [a] ; \ + A [a] = A [b] ; \ + A [b] = t ; \ +} + +#define GB_BSORT_T GB_bsort_32_32_32_t +#define GB_partition GB_partition_32_32_32 +#define GB_quicksort GB_quicksort_32_32_32 +#include "factory/GB_bsort_template.c" + +#undef GB_BSORT_T +#undef GB_partition +#undef GB_quicksort + +#define GB_BSORT_T GB_bsort_64_64_64_t +#define GB_partition GB_partition_64_64_64 +#define GB_quicksort GB_quicksort_64_64_64 +#include "factory/GB_bsort_template.c" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + // check inputs + if (nargin != 3 || nargout != 3) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool J_is_32 ; + if (mxIsClass (pargin [1], "uint32")) + { + J_is_32 = true ; + } + else if (mxIsClass (pargin [1], "uint64")) + { + J_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool K_is_32 ; + if (mxIsClass (pargin [2], "uint32")) + { + K_is_32 = true ; + } + else if (mxIsClass (pargin [2], "uint64")) + { + K_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + void *I = mxGetData (pargin [0]) ; + int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; + uint32_t *I32 = (I_is_32) ? I : NULL ; + uint64_t *I64 = (I_is_32) ? NULL : I ; + + void *J = mxGetData (pargin [1]) ; + uint32_t *J32 = (J_is_32) ? J : NULL ; + uint64_t *J64 = (J_is_32) ? NULL : J ; + if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) + { + mexErrMsgTxt ("I and J must be the same length") ; + } + + void *K = mxGetData (pargin [2]) ; + uint32_t *K32 = (K_is_32) ? K : NULL ; + uint64_t *K64 = (K_is_32) ? NULL : K ; + if (n != (uint64_t) mxGetNumberOfElements (pargin [2])) + { + mexErrMsgTxt ("I and K must be the same length") ; + } + + uint64_t seed = n ; + + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Io = mxGetData (pargout [0]) ; + uint32_t *Io32 = (I_is_32) ? Io : NULL ; + uint64_t *Io64 = (I_is_32) ? NULL : Io ; + + pargout [1] = GB_mx_create_full (n, 1, J_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Jo = mxGetData (pargout [1]) ; + uint32_t *Jo32 = (J_is_32) ? Jo : NULL ; + uint64_t *Jo64 = (J_is_32) ? NULL : Jo ; + + pargout [2] = GB_mx_create_full (n, 1, K_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Ko = mxGetData (pargout [2]) ; + uint32_t *Ko32 = (K_is_32) ? Ko : NULL ; + uint64_t *Ko64 = (K_is_32) ? NULL : Ko ; + + double t ; + + if (I_is_32 && J_is_32 && K_is_32) + { + GB_bsort_32_32_32_t *A = mxMalloc (n * sizeof (GB_bsort_32_32_32_t)) ; + for (int64_t k = 0 ; k < n ; k++) + { + A [k].i = I32 [k] ; + A [k].j = J32 [k] ; + A [k].k = K32 [k] ; + } +// t = GB_omp_get_wtime ( ) ; + GB_quicksort_32_32_32 (A, n, &seed) ; +// t = GB_omp_get_wtime ( ) - t ; + for (int64_t k = 0 ; k < n ; k++) + { + Io32 [k] = A [k].i ; + Jo32 [k] = A [k].j ; + Ko32 [k] = A [k].k ; + } + } + else + { + GB_bsort_64_64_64_t *A = mxMalloc (n * sizeof (GB_bsort_64_64_64_t)) ; + for (int64_t k = 0 ; k < n ; k++) + { + A [k].i = I32 ? ((uint64_t) I32 [k]) : I64 [k] ; + A [k].j = J32 ? ((uint64_t) J32 [k]) : J64 [k] ; + A [k].k = K32 ? ((uint64_t) K32 [k]) : K64 [k] ; + } +// t = GB_omp_get_wtime ( ) ; + GB_quicksort_64_64_64 (A, n, &seed) ; +// t = GB_omp_get_wtime ( ) - t ; + for (int64_t k = 0 ; k < n ; k++) + { + if (Io32) { Io32 [k] = A [k].i ; } else { Io64 [k] = A [k].i ; } + if (Jo32) { Jo32 [k] = A [k].j ; } else { Jo64 [k] = A [k].j ; } + if (Ko32) { Ko32 [k] = A [k].k ; } else { Ko64 [k] = A [k].k ; } + } + } +// printf ("bsort time: %g\n:", t) ; +} + + diff --git a/GraphBLAS/Test/GB_mex_burble.c b/GraphBLAS/Test/GB_mex_burble.c index 95db67b713..fbff494e26 100644 --- a/GraphBLAS/Test/GB_mex_burble.c +++ b/GraphBLAS/Test/GB_mex_burble.c @@ -2,7 +2,7 @@ // GB_mex_burble: set/get the burble //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_cast.c b/GraphBLAS/Test/GB_mex_cast.c index 1a590ef10f..78e420da30 100644 --- a/GraphBLAS/Test/GB_mex_cast.c +++ b/GraphBLAS/Test/GB_mex_cast.c @@ -2,7 +2,7 @@ // GB_mex_cast: cast a built-in array using C-style casting rules //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -76,7 +76,7 @@ void mexFunction // create a shallow cnz-by-1 matrix T to wrap the array X T = NULL ; void *Tx = X ; - GrB_Index nrows = cnz, ncols = 1, Tx_size = cnz * xtype->size ; + uint64_t nrows = cnz, ncols = 1, Tx_size = cnz * xtype->size ; GxB_Matrix_import_FullC (&T, xtype, nrows, ncols, &Tx, Tx_size, false, NULL) ; // GB_cast_array (C, ctype->code, X, xtype->code, NULL, cnz, 1) ; GB_cast_array (C, ctype->code, T, 1) ; diff --git a/GraphBLAS/Test/GB_mex_clear.c b/GraphBLAS/Test/GB_mex_clear.c index 52117611d4..628e4fae27 100644 --- a/GraphBLAS/Test/GB_mex_clear.c +++ b/GraphBLAS/Test/GB_mex_clear.c @@ -2,7 +2,7 @@ // GB_mex_clear: clear a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_complex.c b/GraphBLAS/Test/GB_mex_complex.c index d3d5c9fd3b..8d0dc28784 100644 --- a/GraphBLAS/Test/GB_mex_complex.c +++ b/GraphBLAS/Test/GB_mex_complex.c @@ -2,7 +2,7 @@ // GB_mex_complex: convert a real matrix into a complex one //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,11 +45,12 @@ void mexFunction mexErrMsgTxt ("A must be double or double complex") ; } - int64_t *Ap, *Ai ; + uint64_t *Ap ; + int64_t *Ai ; if (A_is_sparse) { - Ap = (int64_t *) mxGetJc (A) ; + Ap = (uint64_t *) mxGetJc (A) ; Ai = (int64_t *) mxGetIr (A) ; } else @@ -77,7 +78,7 @@ void mexFunction { // A and C are sparse pargout [0] = mxCreateSparse (m, n, anz+1, mxCOMPLEX) ; - int64_t *Cp = (int64_t *) mxGetJc (pargout [0]) ; + uint64_t *Cp = (uint64_t *) mxGetJc (pargout [0]) ; int64_t *Ci = (int64_t *) mxGetIr (pargout [0]) ; // copy the pattern of A into C memcpy (Cp, Ap, (n+1) * sizeof (int64_t)) ; diff --git a/GraphBLAS/Test/GB_mex_concat.c b/GraphBLAS/Test/GB_mex_concat.c index 54687638bd..f2c20ff615 100644 --- a/GraphBLAS/Test/GB_mex_concat.c +++ b/GraphBLAS/Test/GB_mex_concat.c @@ -2,7 +2,7 @@ // GB_mex_concat: C = concat (Tiles) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -81,19 +81,19 @@ void mexFunction GrB_Type ctype = GB_mx_string_to_Type (PARGIN (1), GrB_FP64) ; // determine the # of rows of C from Tiles {:,0} - GrB_Index cnrows = 0 ; + uint64_t cnrows = 0 ; for (int64_t i = 0 ; i < m ; i++) { - GrB_Index anrows ; + uint64_t anrows ; OK (GrB_Matrix_nrows (&anrows, Tiles [i*n])) ; cnrows += anrows ; } // determine the # of columms of C from Tiles {0,:} - GrB_Index cncols = 0 ; + uint64_t cncols = 0 ; for (int64_t j = 0 ; j < n ; j++) { - GrB_Index ancols ; + uint64_t ancols ; OK (GrB_Matrix_ncols (&ancols, Tiles [j])) ; cncols += ancols ; } diff --git a/GraphBLAS/Test/GB_mex_container.c b/GraphBLAS/Test/GB_mex_container.c new file mode 100644 index 0000000000..76ac98bbc4 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_container.c @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// GB_mex_container: copy a matrix, by loading/unloading it into a container +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// copy a matrix/vector via load/unload of a container + +#include "GB_mex.h" +#include "GB_mex_errors.h" +#include "../Source/container/GB_container.h" + +#define USAGE "C = GB_mex_container (A)" + +#undef FREE_ALL2 +#define FREE_ALL2 \ +{ \ + GrB_Matrix_free_(&C) ; \ + GxB_Container_free (&Container) ; \ +} + +#define OK2(method) \ +{ \ + info = (method) ; \ + if (info != GrB_SUCCESS) \ + { \ + FREE_ALL2 ; \ + return (info) ; \ + } \ +} + +//------------------------------------------------------------------------------ +// matrix_method +//------------------------------------------------------------------------------ + +GrB_Info matrix_method (GrB_Matrix *C_handle, GrB_Matrix A) ; +GrB_Info matrix_method (GrB_Matrix *C_handle, GrB_Matrix A) +{ + // test matrix variant + GrB_Info info ; + GrB_Matrix C = NULL ; + GxB_Container Container = NULL ; + OK2 (GxB_Container_new (&Container)) ; + OK2 (GrB_Matrix_dup (&C, A)) ; + OK2 (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; + OK2 (GxB_unload_Matrix_into_Container (C, Container, NULL)) ; + uint64_t len ; + OK2 (GrB_Vector_size (&len, Container->h)) ; + if (len == 0) + { +// printf ("\n----------------- h_empty:\n") ; + // test case when h_empty is true + GB_vector_reset (Container->h) ; + } +// printf ("\n----------------- GxB_load_Matrix_from_Container:\n") ; + OK2 (GxB_load_Matrix_from_Container (C, Container, NULL)) ; + (*C_handle) = C ; + GxB_Container_free (&Container) ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// vector_method +//------------------------------------------------------------------------------ + +GrB_Info vector_method (GrB_Vector *C_handle, GrB_Vector A) ; +GrB_Info vector_method (GrB_Vector *C_handle, GrB_Vector A) +{ + // test vector variant + GrB_Info info ; + GrB_Vector C = NULL ; + GxB_Container Container ; + OK2 (GxB_Container_new (&Container)) ; + OK2 (GrB_Vector_dup (&C, A)) ; + OK2 (GrB_Vector_wait (C, GrB_MATERIALIZE)) ; + OK2 (GxB_unload_Vector_into_Container (C, Container, NULL)) ; + uint64_t len ; + OK2 (GrB_Vector_size (&len, Container->h)) ; + if (len == 0) + { +// printf ("\n----------------- h_empty:\n") ; + // test case when h_empty is true + GB_vector_reset (Container->h) ; + } +// printf ("\n----------------- GxB_load_Vector_from_Container:\n") ; + OK2 (GxB_load_Vector_from_Container (C, Container, NULL)) ; + (*C_handle) = C ; + GxB_Container_free (&Container) ; + return (GrB_SUCCESS) ; +} + +//------------------------------------------------------------------------------ +// GB_mex_container mexFunction +//------------------------------------------------------------------------------ + + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + GrB_Matrix_free_(&C) ; \ + GrB_Matrix_free_(&A) ; \ + GB_mx_put_global (true) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix C = NULL, A = NULL ; + + // check inputs + if (nargout > 1 || nargin != 1) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + #define GET_DEEP_COPY ; + #define FREE_DEEP_COPY \ + GrB_Matrix_free (&C) ; + + // get a shallow copy of the input + A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", false, true) ; + + if (GB_VECTOR_OK (A)) + { + // test vector variant + METHOD (vector_method ((GrB_Vector *) &C, (GrB_Vector) A)) ; + } + else + { + // test matrix variant + METHOD (matrix_method (&C, A)) ; + } + + // return C as a struct and free the GraphBLAS C + pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", true) ; + + FREE_ALL ; +} + diff --git a/GraphBLAS/Test/GB_mex_context_test.c b/GraphBLAS/Test/GB_mex_context_test.c index 6657c81d33..e522d0dde0 100644 --- a/GraphBLAS/Test/GB_mex_context_test.c +++ b/GraphBLAS/Test/GB_mex_context_test.c @@ -2,7 +2,7 @@ // GB_mex_context_text: based on Demo/Programcontext_demo //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -118,11 +118,11 @@ void mexFunction // construct tuples for a decent-sized random matrix //-------------------------------------------------------------------------- - GrB_Index n = 1000 ; // 10000 ; - GrB_Index nvals = 20000 ; // 2000000 ; + uint64_t n = 1000 ; // 10000 ; + uint64_t nvals = 20000 ; // 2000000 ; simple_rand_seed (1) ; - GrB_Index *I = mxMalloc (nvals * sizeof (GrB_Index)) ; - GrB_Index *J = mxMalloc (nvals * sizeof (GrB_Index)) ; + uint64_t *I = mxMalloc (nvals * sizeof (uint64_t)) ; // OK + uint64_t *J = mxMalloc (nvals * sizeof (uint64_t)) ; // OK double *X = mxMalloc (nvals * sizeof (double)) ; for (int k = 0 ; k < nvals ; k++) { @@ -158,7 +158,7 @@ void mexFunction { if (nouter <= nmat) { - double t = GB_OPENMP_GET_WTIME ; + double t = GB_omp_get_wtime ( ) ; #pragma omp parallel for num_threads (nouter) \ schedule (dynamic, 1) for (int k = 0 ; k < nmat ; k++) @@ -184,7 +184,7 @@ void mexFunction OK (GxB_Context_free (&Context)) ; } - t = GB_OPENMP_GET_WTIME - t ; + t = GB_omp_get_wtime ( ) - t ; if (nouter == 1 && ninner == 1) t1 = t ; printf (" threads (%4d,%4d): %4d " diff --git a/GraphBLAS/Test/GB_mex_control.c b/GraphBLAS/Test/GB_mex_control.c new file mode 100644 index 0000000000..d74fdcc205 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_control.c @@ -0,0 +1,108 @@ +//------------------------------------------------------------------------------ +// GB_mex_control: get/set global is_csc and [pji]_control control +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" + +#define USAGE "ctrl = GB_mex_control (ctrl) or ctrl = GB_mex_control" + +static const char *ControlFields [ ] = { + "is_csc", + "p_control", + "j_control", + "i_control" } ; + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + mxArray *X ; + bool malloc_debug = GB_mx_get_global (false) ; + + // check inputs + if (nargout > 1 || nargin > 1) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + if (nargin > 0 && !mxIsStruct (pargin [0])) + { + mexErrMsgTxt ("input must be struct") ; + } + + // get the current controls + int csc, p_control, r_control, c_control ; + GrB_get (GrB_GLOBAL, &csc, GxB_FORMAT) ; + GrB_get (GrB_GLOBAL, &p_control, GxB_OFFSET_INTEGER_HINT) ; + GrB_get (GrB_GLOBAL, &r_control, GxB_ROWINDEX_INTEGER_HINT) ; + GrB_get (GrB_GLOBAL, &c_control, GxB_COLINDEX_INTEGER_HINT) ; + int j_control = csc ? c_control : r_control ; + int i_control = csc ? r_control : c_control ; + + // get the input struct + if (nargin > 0) + { + int fieldnumber = mxGetFieldNumber (pargin [0], "is_csc") ; + if (fieldnumber >= 0) + { + X = mxGetFieldByNumber (pargin [0], 0, fieldnumber) ; + csc = (int) mxGetScalar (X) ; + } + + fieldnumber = mxGetFieldNumber (pargin [0], "p_control") ; + if (fieldnumber >= 0) + { + X = mxGetFieldByNumber (pargin [0], 0, fieldnumber) ; + p_control = (int) mxGetScalar (X) ; + } + + fieldnumber = mxGetFieldNumber (pargin [0], "j_control") ; + if (fieldnumber >= 0) + { + X = mxGetFieldByNumber (pargin [0], 0, fieldnumber) ; + j_control = (int) mxGetScalar (X) ; + } + + fieldnumber = mxGetFieldNumber (pargin [0], "i_control") ; + if (fieldnumber >= 0) + { + X = mxGetFieldByNumber (pargin [0], 0, fieldnumber) ; + i_control = (int) mxGetScalar (X) ; + } + } + + // set the new controls + c_control = csc ? j_control : i_control ; + r_control = csc ? i_control : j_control ; + GrB_set (GrB_GLOBAL, csc, GxB_FORMAT) ; + GrB_set (GrB_GLOBAL, p_control, GxB_OFFSET_INTEGER_HINT) ; + GrB_set (GrB_GLOBAL, r_control, GxB_ROWINDEX_INTEGER_HINT) ; + GrB_set (GrB_GLOBAL, c_control, GxB_COLINDEX_INTEGER_HINT) ; + + // return new controls as a struct + pargout [0] = mxCreateStructMatrix (1, 1, 4, ControlFields) ; + + mxArray *is_csc = mxCreateLogicalScalar (csc) ; + mxArray *p_32 = mxCreateDoubleScalar (p_control) ; + mxArray *j_32 = mxCreateDoubleScalar (j_control) ; + mxArray *i_32 = mxCreateDoubleScalar (i_control) ; + + mxSetFieldByNumber (pargout [0], 0, 0, is_csc) ; + mxSetFieldByNumber (pargout [0], 0, 1, p_32) ; + mxSetFieldByNumber (pargout [0], 0, 2, j_32) ; + mxSetFieldByNumber (pargout [0], 0, 3, i_32) ; + + // log the test coverage + GB_mx_put_global (true) ; +} + diff --git a/GraphBLAS/Test/GB_mex_cumsum.c b/GraphBLAS/Test/GB_mex_cumsum.c index d4ad489f47..3d32e50a61 100644 --- a/GraphBLAS/Test/GB_mex_cumsum.c +++ b/GraphBLAS/Test/GB_mex_cumsum.c @@ -2,7 +2,7 @@ // GB_mex_cumsum: cumulative using GB_cumsum //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,15 +56,14 @@ void mexFunction if (!malloc_debug) { // normal usage - GB_cumsum (p, n, kresult, nthreads, NULL) ; + GB_cumsum (p, false, n, kresult, nthreads, NULL) ; } else { // test with malloc failures - // printf ("test cumsum with malloc_debug_count: %d\n", malloc_debug_count) ; GB_Global_malloc_debug_set (true) ; GB_Global_malloc_debug_count_set (malloc_debug_count) ; - GB_cumsum (p, n, kresult, nthreads, NULL) ; + GB_cumsum (p, false, n, kresult, nthreads, NULL) ; GB_Global_malloc_debug_set (false) ; } diff --git a/GraphBLAS/Test/GB_mex_debug.c b/GraphBLAS/Test/GB_mex_debug.c index 8069931755..8694dc035f 100644 --- a/GraphBLAS/Test/GB_mex_debug.c +++ b/GraphBLAS/Test/GB_mex_debug.c @@ -2,7 +2,7 @@ // GB_mex_debug: determine GB_DEBUG status //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_diag.c b/GraphBLAS/Test/GB_mex_diag.c index a4a0c88fd6..cc3392ddbc 100644 --- a/GraphBLAS/Test/GB_mex_diag.c +++ b/GraphBLAS/Test/GB_mex_diag.c @@ -2,7 +2,7 @@ // GB_mex_diag: compute C=diag(A,k) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_dot_iterator.c b/GraphBLAS/Test/GB_mex_dot_iterator.c index 5065a5427e..97905eaabc 100644 --- a/GraphBLAS/Test/GB_mex_dot_iterator.c +++ b/GraphBLAS/Test/GB_mex_dot_iterator.c @@ -2,7 +2,7 @@ // GB_mex_dot_iterator: s = X'*Y, dot product of 2 vectors using iterators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,7 @@ GB_mx_put_global (true) ; \ } -#define Assert(x) \ +#define my_assert(x) \ { \ if (!(x)) \ { \ @@ -54,13 +54,33 @@ void mexFunction mexErrMsgTxt ("Usage: " USAGE) ; } - // get X (shallow copy) - X = GB_mx_mxArray_to_Vector (pargin [0], "X input", false, true) ; + // get kind: + // 0: merge, using macros + // 1: iterate through x and lookup y, using macros + // 2: merge, using functions + // 3: iterate through x and lookup y, using functions + bool deep_and_jumbled = false ; + int GET_SCALAR (2, int, kind, 0) ; + if (kind < 0) + { + deep_and_jumbled = true ; + kind = -kind ; + } + bool use_macros = (kind <= 1) ; + kind = kind % 2 ; + + // get X (deep or shallow copy) + X = GB_mx_mxArray_to_Vector (pargin [0], "X input", deep_and_jumbled, true) ; if (X == NULL) { FREE_ALL ; mexErrMsgTxt ("X failed") ; } + if (deep_and_jumbled) + { + // to test the wait in Iterator_attach + X->jumbled = true ; + } // get Y (shallow copy) Y = GB_mx_mxArray_to_Vector (pargin [1], "Y input", false, true) ; @@ -70,16 +90,7 @@ void mexFunction mexErrMsgTxt ("Y failed") ; } - // get kind: - // 0: merge, using macros - // 1: iterate through x and lookup y, using macros - // 2: merge, using functions - // 3: iterate through x and lookup y, using functions - int GET_SCALAR (2, int, kind, 0) ; - bool use_macros = (kind <= 1) ; - kind = kind % 2 ; - - GrB_Index n, ny ; + uint64_t n, ny ; OK (GrB_Vector_size (&n, X)) ; OK (GrB_Vector_size (&ny, Y)) ; @@ -121,7 +132,7 @@ void mexFunction int x_sparsity, y_sparsity ; OK (GxB_Vector_Option_get (X, GxB_SPARSITY_STATUS, &x_sparsity)) ; OK (GxB_Vector_Option_get (Y, GxB_SPARSITY_STATUS, &y_sparsity)) ; - GrB_Index xnvals, ynvals ; + uint64_t xnvals, ynvals ; OK (GrB_Vector_nvals (&xnvals, X)) ; OK (GrB_Vector_nvals (&ynvals, Y)) ; diff --git a/GraphBLAS/Test/GB_mex_dump.c b/GraphBLAS/Test/GB_mex_dump.c index 960bd7118b..71baa155b0 100644 --- a/GraphBLAS/Test/GB_mex_dump.c +++ b/GraphBLAS/Test/GB_mex_dump.c @@ -2,7 +2,7 @@ // GB_mex_dump: copy and print a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_dup.c b/GraphBLAS/Test/GB_mex_dup.c index ee51af00f2..a769242263 100644 --- a/GraphBLAS/Test/GB_mex_dup.c +++ b/GraphBLAS/Test/GB_mex_dup.c @@ -2,7 +2,7 @@ // GB_mex_dup: copy a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -50,6 +50,8 @@ void mexFunction // get ctype of output matrix GrB_Type ctype = GB_mx_string_to_Type (PARGIN (1), A->type) ; + bool is_csc = A->is_csc ; + // get method int GET_SCALAR (2, int, method, 0) ; @@ -75,7 +77,7 @@ void mexFunction // C = create an exact copy of A, just like GrB_Matrix_dup GrB_Type type ; - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; #undef GET_DEEP_COPY #undef FREE_DEEP_COPY @@ -127,7 +129,7 @@ void mexFunction } // C = (ctype) A - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; #define GET_DEEP_COPY \ { \ @@ -165,6 +167,10 @@ void mexFunction #undef FREE_DEEP_COPY } + // ensure C has the same csc property as A + GrB_Matrix_set_INT32 (C, is_csc ? GrB_COLMAJOR : GrB_ROWMAJOR, + GrB_STORAGE_ORIENTATION_HINT) ; + // return C as a struct and free the GraphBLAS C pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", true) ; diff --git a/GraphBLAS/Test/GB_mex_eWiseMult_first.c b/GraphBLAS/Test/GB_mex_eWiseMult_first.c index df9770cb41..df8237a9ea 100644 --- a/GraphBLAS/Test/GB_mex_eWiseMult_first.c +++ b/GraphBLAS/Test/GB_mex_eWiseMult_first.c @@ -2,7 +2,7 @@ // GB_mex_eWiseMult_first: C = accum(C,first(A,B)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_eWiseMult_second.c b/GraphBLAS/Test/GB_mex_eWiseMult_second.c index b1b064e102..4be871d763 100644 --- a/GraphBLAS/Test/GB_mex_eWiseMult_second.c +++ b/GraphBLAS/Test/GB_mex_eWiseMult_second.c @@ -2,7 +2,7 @@ // GB_mex_eWiseMult_second: C = accum(C,second(A,B)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_edit.c b/GraphBLAS/Test/GB_mex_edit.c index b4a00005d9..2d559c41f4 100644 --- a/GraphBLAS/Test/GB_mex_edit.c +++ b/GraphBLAS/Test/GB_mex_edit.c @@ -2,7 +2,7 @@ // GB_mex_edit: add/remove entries from a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,6 +22,7 @@ info = method ; \ if (info != GrB_SUCCESS) \ { \ + printf ("info %d line %d\n", info, __LINE__) ; \ mexErrMsgTxt ("fail") ; \ } \ } @@ -36,8 +37,8 @@ void mexFunction { GrB_Matrix C = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK + uint64_t *J = NULL, nj = 0, J_range [3] ; // OK bool ignore ; bool malloc_debug = false ; GrB_Info info = GrB_SUCCESS ; @@ -67,8 +68,8 @@ void mexFunction mexErrMsgTxt ("C failed") ; } - GrB_Index ncols ; - GxB_Format_Value fmt ; + uint64_t ncols ; + int fmt ; bool is_hyper ; OK (GrB_Matrix_ncols (&ncols, C)) ; OK (GxB_Matrix_Option_get (C, GxB_FORMAT, &fmt)) ; @@ -76,14 +77,14 @@ void mexFunction bool is_vector = (fmt == GxB_BY_COL && !is_hyper && ncols == 1) ; // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; diff --git a/GraphBLAS/Test/GB_mex_errors.h b/GraphBLAS/Test/GB_mex_errors.h index 13ea299eb2..fb193ca44a 100644 --- a/GraphBLAS/Test/GB_mex_errors.h +++ b/GraphBLAS/Test/GB_mex_errors.h @@ -2,7 +2,7 @@ // GB_mex_errors.h: error handling macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias1.c b/GraphBLAS/Test/GB_mex_ewise_alias1.c index cd4b6e936e..6b7f9eb626 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias1.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias1.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias1: C = A+C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias2.c b/GraphBLAS/Test/GB_mex_ewise_alias2.c index 1903d88d00..eda0e3e1cc 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias2.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias2.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias2: C += A+A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias3.c b/GraphBLAS/Test/GB_mex_ewise_alias3.c index 4529edf833..ba5ffd9c6d 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias3.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias3.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias3: C = C+A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias4.c b/GraphBLAS/Test/GB_mex_ewise_alias4.c index 445b9e2dc7..f4ef047cf6 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias4.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias4.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias4: C = M+M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias5.c b/GraphBLAS/Test/GB_mex_ewise_alias5.c index 1846c8fce4..0504a7b0eb 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias5.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias5.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias5: C = A+M //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_ewise_alias6.c b/GraphBLAS/Test/GB_mex_ewise_alias6.c index 096a9f97a7..a9fd596867 100644 --- a/GraphBLAS/Test/GB_mex_ewise_alias6.c +++ b/GraphBLAS/Test/GB_mex_ewise_alias6.c @@ -2,7 +2,7 @@ // GB_mex_ewise_alias5: C = M+A //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_expand.c b/GraphBLAS/Test/GB_mex_expand.c index 222ecdadb5..a17034d438 100644 --- a/GraphBLAS/Test/GB_mex_expand.c +++ b/GraphBLAS/Test/GB_mex_expand.c @@ -2,7 +2,7 @@ // GB_mex_expand: C = scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,7 +45,7 @@ void mexFunction mexErrMsgTxt ("M failed") ; } - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, M) ; GrB_Matrix_ncols (&ncols, M) ; diff --git a/GraphBLAS/Test/GB_mex_export.c b/GraphBLAS/Test/GB_mex_export.c index 31b187e6a0..52d371c1f5 100644 --- a/GraphBLAS/Test/GB_mex_export.c +++ b/GraphBLAS/Test/GB_mex_export.c @@ -2,7 +2,7 @@ // GB_mex_export: test import/export //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,20 +44,20 @@ GrB_Vector v = NULL ; GrB_Matrix C = NULL ; -GrB_Index *Ap = NULL ; -GrB_Index *Ah = NULL ; -GrB_Index *Ai = NULL ; -GrB_Index *Aj = NULL ; -GrB_Index nrows = 0 ; -GrB_Index ncols = 0 ; -GrB_Index nvals = 0 ; -GrB_Index nvec = 0 ; -GrB_Index Ai_size = 0 ; -GrB_Index Ax_size = 0 ; +uint64_t *Ap = NULL ; // OK; 64-bit only +uint64_t *Ah = NULL ; // OK; 64-bit only +uint64_t *Ai = NULL ; // OK; 64-bit only +uint64_t *Aj = NULL ; // OK; 64-bit only +uint64_t nrows = 0 ; +uint64_t ncols = 0 ; +uint64_t nvals = 0 ; +uint64_t nvec = 0 ; +uint64_t Ai_size = 0 ; +uint64_t Ax_size = 0 ; bool iso = false ; -GrB_Index Ap_size = 0 ; -GrB_Index Aj_size = 0 ; -GrB_Index Ah_size = 0 ; +uint64_t Ap_size = 0 ; +uint64_t Aj_size = 0 ; +uint64_t Ah_size = 0 ; int64_t ignore = -1 ; char *Ax = NULL ; int format = 0 ; diff --git a/GraphBLAS/Test/GB_mex_export_import.c b/GraphBLAS/Test/GB_mex_export_import.c index e8a14b742f..a579a6dc76 100644 --- a/GraphBLAS/Test/GB_mex_export_import.c +++ b/GraphBLAS/Test/GB_mex_export_import.c @@ -2,7 +2,7 @@ // GB_mex_export_import: export and then reimport a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -75,19 +75,19 @@ GrB_Descriptor desc = NULL ; GrB_Matrix A = NULL ; GrB_Matrix C = NULL ; -GrB_Index *Cp = NULL, *Ch = NULL, *Ci = NULL, *Tp = NULL, *Ti = NULL ; +uint64_t *Cp = NULL, *Ch = NULL, *Ci = NULL, *Tp = NULL, *Ti = NULL ; void *Cx = NULL, *Tx = NULL ; int8_t *Cb = NULL ; -GrB_Index nvec = 0, nvals = 0, nrows = 0, ncols = 0 ; +uint64_t nvec = 0, nvals = 0, nrows = 0, ncols = 0 ; GrB_Type type2 = NULL ; -GrB_Index nrows2, ncols2 ; +uint64_t nrows2, ncols2 ; size_t typesize ; -GrB_Index Cp_size = 0, Tp_len = 0 ; -GrB_Index Ch_size = 0 ; -GrB_Index Cb_size = 0 ; -GrB_Index Ci_size = 0, Ti_len = 0 ; -GrB_Index Cx_size = 0, Tx_len = 0 ; +uint64_t Cp_size = 0, Tp_len = 0 ; +uint64_t Ch_size = 0 ; +uint64_t Cb_size = 0 ; +uint64_t Ci_size = 0, Ti_len = 0 ; +uint64_t Cx_size = 0, Tx_len = 0 ; bool iso = false ; int64_t ignore = -1 ; @@ -102,8 +102,8 @@ GrB_Info vector_export_import ( int format_matrix, int format_export) ; // GB_exporter: export a matrix with GrB_Matrix_export_T //------------------------------------------------------------------------------ -static GrB_Info GB_exporter (GrB_Index *Ap, GrB_Index *Ai, void *Ax, - GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, +static GrB_Info GB_exporter (uint64_t *Ap, uint64_t *Ai, void *Ax, + uint64_t *Ap_len, uint64_t *Ai_len, uint64_t *Ax_len, int format, GrB_Matrix A) { switch (A->type->code) @@ -132,9 +132,9 @@ static GrB_Info GB_exporter (GrB_Index *Ap, GrB_Index *Ai, void *Ax, // GB_importer: import a matrix with GrB_Matrix_import_T //------------------------------------------------------------------------------ -static GrB_Info GB_importer (GrB_Matrix *A, GrB_Type type, GrB_Index nrows, - GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, - GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format) +static GrB_Info GB_importer (GrB_Matrix *A, GrB_Type type, uint64_t nrows, + uint64_t ncols, const uint64_t *Ap, const uint64_t *Ai, const void *Ax, + uint64_t Ap_len, uint64_t Ai_len, uint64_t Ax_len, int format) { switch (type->code) { @@ -531,8 +531,8 @@ GrB_Info export_import // export in CSR format, then free C OK (GrB_Matrix_exportSize (&Tp_len, &Ti_len, &Tx_len, GrB_CSR_FORMAT, C)) ; - Tp = mxMalloc ((Tp_len+1) * sizeof (GrB_Index)) ; - Ti = mxMalloc ((Ti_len+1) * sizeof (GrB_Index)) ; + Tp = mxMalloc ((Tp_len+1) * sizeof (uint64_t)) ; + Ti = mxMalloc ((Ti_len+1) * sizeof (uint64_t)) ; Tx = mxMalloc ((Tx_len+1) * typesize) ; OK (GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, GrB_CSR_FORMAT, C)) ; OK (GrB_Matrix_free (&C)) ; @@ -551,8 +551,8 @@ GrB_Info export_import // export in CSC format, then free C OK (GrB_Matrix_exportSize (&Tp_len, &Ti_len, &Tx_len, GrB_CSC_FORMAT, C)) ; - Tp = mxMalloc ((Tp_len+1) * sizeof (GrB_Index)) ; - Ti = mxMalloc ((Ti_len+1) * sizeof (GrB_Index)) ; + Tp = mxMalloc ((Tp_len+1) * sizeof (uint64_t)) ; + Ti = mxMalloc ((Ti_len+1) * sizeof (uint64_t)) ; Tx = mxMalloc ((Tx_len+1) * typesize) ; OK (GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, GrB_CSC_FORMAT, C)) ; OK (GrB_Matrix_free (&C)) ; @@ -588,7 +588,8 @@ GrB_Info export_import // OK (GrB_Matrix_exportSize (&Tp_len, &Ti_len, &Tx_len, // GrB_DENSE_COL_FORMAT, C)) ; // Tx = mxMalloc ((Tx_len+1) * typesize) ; -// OK (GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, GrB_DENSE_COL_FORMAT, C)) ; +// OK (GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, +// GrB_DENSE_COL_FORMAT, C)) ; // OK (GrB_Matrix_free (&C)) ; // // import in CSR format, then free Tx // OK (GB_importer (&C, type2, nrows2, ncols2, Tp, Ti, Tx, @@ -603,10 +604,11 @@ GrB_Info export_import // export in COO format, then free C OK (GrB_Matrix_exportSize (&Tp_len, &Ti_len, &Tx_len, GrB_COO_FORMAT, C)) ; - Tp = mxMalloc ((Tp_len+1) * sizeof (GrB_Index)) ; - Ti = mxMalloc ((Ti_len+1) * sizeof (GrB_Index)) ; + Tp = mxMalloc ((Tp_len+1) * sizeof (uint64_t)) ; + Ti = mxMalloc ((Ti_len+1) * sizeof (uint64_t)) ; Tx = mxMalloc ((Tx_len+1) * typesize) ; - info = GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, GrB_COO_FORMAT, C) ; + info = GB_exporter (Tp, Ti, Tx, &Tp_len, &Ti_len, &Tx_len, + GrB_COO_FORMAT, C) ; OK (info) ; OK (GrB_Matrix_free (&C)) ; // import in COO format, then free Tp, Ti, Tx diff --git a/GraphBLAS/Test/GB_mex_extractTuples.c b/GraphBLAS/Test/GB_mex_extractTuples.c index 88032fdde5..a753317016 100644 --- a/GraphBLAS/Test/GB_mex_extractTuples.c +++ b/GraphBLAS/Test/GB_mex_extractTuples.c @@ -2,18 +2,21 @@ // GB_mex_extractTuples: extract all tuples from a matrix or vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "[I,J,X] = GB_mex_extractTuples (A, xtype)" +#define USAGE "[I,J,X] = GB_mex_extractTuples (A, xtype, method)" #define FREE_ALL \ { \ GrB_Matrix_free_(&A) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ + GrB_Vector_free_(&X_vector) ; \ GB_mx_put_global (true) ; \ } @@ -28,11 +31,14 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; - GB_void *Y = NULL ; - GrB_Index nvals = 0 ; + GrB_Vector I_vector = NULL, J_vector = NULL, X_vector = NULL ; + void *I_output = NULL, *J_output = NULL ; + GB_void *X = NULL ; + GrB_Type xtype = NULL ; + uint64_t nvals = 0 ; // check inputs - if (nargout > 3 || nargin < 1 || nargin > 2) + if (nargout > 3 || nargin < 1 || nargin > 3) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -51,74 +57,156 @@ void mexFunction // get the number of entries in A GrB_Matrix_nvals (&nvals, A) ; - // create I - pargout [0] = GB_mx_create_full (nvals, 1, GrB_UINT64) ; - GrB_Index *I = (GrB_Index *) mxGetData (pargout [0]) ; + // get the method: 0: use (uint64_t *), 1: use GrB_Vector for I,J + int GET_SCALAR (2, int, method, 0) ; - // create J - GrB_Index *J = NULL ; - if (nargout > 1) - { - pargout [1] = GB_mx_create_full (nvals, 1, GrB_UINT64) ; - J = (GrB_Index *) mxGetData (pargout [1]) ; - } + //-------------------------------------------------------------------------- + // [I,J,X] = find (A) + //-------------------------------------------------------------------------- - // create X - GB_void *X = NULL ; - GrB_Type xtype = GB_mx_string_to_Type (PARGIN (1), A->type) ; - if (nargout > 2) + if (method == 0) { - pargout [2] = GB_mx_create_full (nvals, 1, xtype) ; - X = (GB_void *) mxGetData (pargout [2]) ; - } - // [I,J,X] = find (A) - if (GB_VECTOR_OK (A)) - { - // test extract vector methods - GrB_Vector v = (GrB_Vector) A ; - switch (xtype->code) + //---------------------------------------------------------------------- + // use GrB_[Matrix,Vector]_extractTuples_TYPE, no GrB_Vectors + //---------------------------------------------------------------------- + + // create I + pargout [0] = GB_mx_create_full (nvals, 1, GrB_UINT64) ; + I_output = mxGetData (pargout [0]) ; + // create J + if (nargout > 1) { - case GB_BOOL_code : METHOD (GrB_Vector_extractTuples_BOOL_ (I, (bool *) X, &nvals, v)) ; break ; - case GB_INT8_code : METHOD (GrB_Vector_extractTuples_INT8_ (I, (int8_t *) X, &nvals, v)) ; break ; - case GB_UINT8_code : METHOD (GrB_Vector_extractTuples_UINT8_ (I, (uint8_t *) X, &nvals, v)) ; break ; - case GB_INT16_code : METHOD (GrB_Vector_extractTuples_INT16_ (I, (int16_t *) X, &nvals, v)) ; break ; - case GB_UINT16_code : METHOD (GrB_Vector_extractTuples_UINT16_(I, (uint16_t *) X, &nvals, v)) ; break ; - case GB_INT32_code : METHOD (GrB_Vector_extractTuples_INT32_ (I, (int32_t *) X, &nvals, v)) ; break ; - case GB_UINT32_code : METHOD (GrB_Vector_extractTuples_UINT32_(I, (uint32_t *) X, &nvals, v)) ; break ; - case GB_INT64_code : METHOD (GrB_Vector_extractTuples_INT64_ (I, (int64_t *) X, &nvals, v)) ; break ; - case GB_UINT64_code : METHOD (GrB_Vector_extractTuples_UINT64_(I, (uint64_t *) X, &nvals, v)) ; break ; - case GB_FP32_code : METHOD (GrB_Vector_extractTuples_FP32_ (I, (float *) X, &nvals, v)) ; break ; - case GB_FP64_code : METHOD (GrB_Vector_extractTuples_FP64_ (I, (double *) X, &nvals, v)) ; break ; - case GB_FC32_code : METHOD (GxB_Vector_extractTuples_FC32_ (I, (GxB_FC32_t *) X, &nvals, v)) ; break ; - case GB_FC64_code : METHOD (GxB_Vector_extractTuples_FC64_ (I, (GxB_FC64_t *) X, &nvals, v)) ; break ; - case GB_UDT_code : METHOD (GrB_Vector_extractTuples_UDT_ (I, (void *) X, &nvals, v)) ; break ; - default : FREE_ALL ; mexErrMsgTxt ("unsupported type") ; + pargout [1] = GB_mx_create_full (nvals, 1, GrB_UINT64) ; + J_output = mxGetData (pargout [1]) ; } - if (J != NULL) + // create X + xtype = GB_mx_string_to_Type (PARGIN (1), A->type) ; + if (nargout > 2) { - for (int64_t p = 0 ; p < nvals ; p++) J [p] = 0 ; + pargout [2] = GB_mx_create_full (nvals, 1, xtype) ; + X = (GB_void *) mxGetData (pargout [2]) ; } + + uint64_t *I = (uint64_t *) I_output ; + uint64_t *J = (uint64_t *) J_output ; + + if (GB_VECTOR_OK (A)) + { + // test extract vector methods + GrB_Vector v = (GrB_Vector) A ; + switch (xtype->code) + { + case GB_BOOL_code : METHOD (GrB_Vector_extractTuples_BOOL_ (I, (bool *) X, &nvals, v)) ; break ; + case GB_INT8_code : METHOD (GrB_Vector_extractTuples_INT8_ (I, (int8_t *) X, &nvals, v)) ; break ; + case GB_UINT8_code : METHOD (GrB_Vector_extractTuples_UINT8_ (I, (uint8_t *) X, &nvals, v)) ; break ; + case GB_INT16_code : METHOD (GrB_Vector_extractTuples_INT16_ (I, (int16_t *) X, &nvals, v)) ; break ; + case GB_UINT16_code : METHOD (GrB_Vector_extractTuples_UINT16_(I, (uint16_t *) X, &nvals, v)) ; break ; + case GB_INT32_code : METHOD (GrB_Vector_extractTuples_INT32_ (I, (int32_t *) X, &nvals, v)) ; break ; + case GB_UINT32_code : METHOD (GrB_Vector_extractTuples_UINT32_(I, (uint32_t *) X, &nvals, v)) ; break ; + case GB_INT64_code : METHOD (GrB_Vector_extractTuples_INT64_ (I, (int64_t *) X, &nvals, v)) ; break ; + case GB_UINT64_code : METHOD (GrB_Vector_extractTuples_UINT64_(I, (uint64_t *) X, &nvals, v)) ; break ; + case GB_FP32_code : METHOD (GrB_Vector_extractTuples_FP32_ (I, (float *) X, &nvals, v)) ; break ; + case GB_FP64_code : METHOD (GrB_Vector_extractTuples_FP64_ (I, (double *) X, &nvals, v)) ; break ; + case GB_FC32_code : METHOD (GxB_Vector_extractTuples_FC32_ (I, (GxB_FC32_t *) X, &nvals, v)) ; break ; + case GB_FC64_code : METHOD (GxB_Vector_extractTuples_FC64_ (I, (GxB_FC64_t *) X, &nvals, v)) ; break ; + case GB_UDT_code : METHOD (GrB_Vector_extractTuples_UDT_ (I, (void *) X, &nvals, v)) ; break ; + default : FREE_ALL ; mexErrMsgTxt ("unsupported type") ; + } + if (J != NULL) + { + for (int64_t p = 0 ; p < nvals ; p++) J [p] = 0 ; + } + } + else + { + switch (xtype->code) + { + case GB_BOOL_code : METHOD (GrB_Matrix_extractTuples_BOOL_ (I, J, (bool *) X, &nvals, A)) ; break ; + case GB_INT8_code : METHOD (GrB_Matrix_extractTuples_INT8_ (I, J, (int8_t *) X, &nvals, A)) ; break ; + case GB_UINT8_code : METHOD (GrB_Matrix_extractTuples_UINT8_ (I, J, (uint8_t *) X, &nvals, A)) ; break ; + case GB_INT16_code : METHOD (GrB_Matrix_extractTuples_INT16_ (I, J, (int16_t *) X, &nvals, A)) ; break ; + case GB_UINT16_code : METHOD (GrB_Matrix_extractTuples_UINT16_(I, J, (uint16_t *) X, &nvals, A)) ; break ; + case GB_INT32_code : METHOD (GrB_Matrix_extractTuples_INT32_ (I, J, (int32_t *) X, &nvals, A)) ; break ; + case GB_UINT32_code : METHOD (GrB_Matrix_extractTuples_UINT32_(I, J, (uint32_t *) X, &nvals, A)) ; break ; + case GB_INT64_code : METHOD (GrB_Matrix_extractTuples_INT64_ (I, J, (int64_t *) X, &nvals, A)) ; break ; + case GB_UINT64_code : METHOD (GrB_Matrix_extractTuples_UINT64_(I, J, (uint64_t *) X, &nvals, A)) ; break ; + case GB_FP32_code : METHOD (GrB_Matrix_extractTuples_FP32_ (I, J, (float *) X, &nvals, A)) ; break ; + case GB_FP64_code : METHOD (GrB_Matrix_extractTuples_FP64_ (I, J, (double *) X, &nvals, A)) ; break ; + case GB_FC32_code : METHOD (GxB_Matrix_extractTuples_FC32_ (I, J, (GxB_FC32_t *) X, &nvals, A)) ; break ; + case GB_FC64_code : METHOD (GxB_Matrix_extractTuples_FC64_ (I, J, (GxB_FC64_t *) X, &nvals, A)) ; break ; + case GB_UDT_code : METHOD (GrB_Matrix_extractTuples_UDT_ (I, J, (void *) X, &nvals, A)) ; break ; + default : FREE_ALL ; mexErrMsgTxt ("unsupported type") ; + } + } + } else { - switch (xtype->code) + + //---------------------------------------------------------------------- + // use GxB_[Matrix,Vector]_extractTuples_Vector + //---------------------------------------------------------------------- + + + #undef GET_DEEP_COPY + #define GET_DEEP_COPY \ + GrB_Vector_new (&I_vector, GrB_UINT64, 0) ; \ + if (nargout > 1) \ + { \ + /* J = zeros (nvals,1) */ \ + GrB_Vector_new (&J_vector, GrB_UINT32, nvals) ; \ + GrB_Vector_assign_UINT32 (J_vector, NULL, NULL, 0, \ + GrB_ALL, nvals, NULL) ; \ + /* ensure J is non-iso */ \ + if (nvals > 0) \ + { \ + uint64_t gunk [1] ; \ + gunk [0] = 0 ; \ + GrB_Vector_assign_UINT32 (J_vector, NULL, NULL, \ + 1, gunk, 1, NULL) ; \ + GrB_Vector_assign_UINT32 (J_vector, NULL, NULL, \ + 0, gunk, 1, NULL) ; \ + } \ + } \ + if (nargout > 2) \ + { \ + GrB_Vector_new (&X_vector, GrB_UINT64, 0) ; \ + } + + #undef FREE_DEEP_COPY + #define FREE_DEEP_COPY \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ + GrB_Vector_free_(&X_vector) ; + + GET_DEEP_COPY ; + + if (GB_VECTOR_OK (A)) + { + GrB_Vector v = (GrB_Vector) A ; + METHOD (GxB_Vector_extractTuples_Vector_(I_vector, X_vector, v, + NULL)) ; + if (nargout > 1) + { + // J = zeros (nvals,1) + GrB_Vector_assign_UINT64 (J_vector, NULL, NULL, 0, + GrB_ALL, nvals, NULL) ; + } + } + else + { + METHOD (GxB_Matrix_extractTuples_Vector_(I_vector, J_vector, + X_vector, A, NULL)) ; + } + pargout [0] = GB_mx_Vector_to_mxArray (&I_vector, "I", false) ; + if (nargout > 1) + { + pargout [1] = GB_mx_Vector_to_mxArray (&J_vector, "J", false) ; + } + if (nargout > 2) { - case GB_BOOL_code : METHOD (GrB_Matrix_extractTuples_BOOL_ (I, J, (bool *) X, &nvals, A)) ; break ; - case GB_INT8_code : METHOD (GrB_Matrix_extractTuples_INT8_ (I, J, (int8_t *) X, &nvals, A)) ; break ; - case GB_UINT8_code : METHOD (GrB_Matrix_extractTuples_UINT8_ (I, J, (uint8_t *) X, &nvals, A)) ; break ; - case GB_INT16_code : METHOD (GrB_Matrix_extractTuples_INT16_ (I, J, (int16_t *) X, &nvals, A)) ; break ; - case GB_UINT16_code : METHOD (GrB_Matrix_extractTuples_UINT16_(I, J, (uint16_t *) X, &nvals, A)) ; break ; - case GB_INT32_code : METHOD (GrB_Matrix_extractTuples_INT32_ (I, J, (int32_t *) X, &nvals, A)) ; break ; - case GB_UINT32_code : METHOD (GrB_Matrix_extractTuples_UINT32_(I, J, (uint32_t *) X, &nvals, A)) ; break ; - case GB_INT64_code : METHOD (GrB_Matrix_extractTuples_INT64_ (I, J, (int64_t *) X, &nvals, A)) ; break ; - case GB_UINT64_code : METHOD (GrB_Matrix_extractTuples_UINT64_(I, J, (uint64_t *) X, &nvals, A)) ; break ; - case GB_FP32_code : METHOD (GrB_Matrix_extractTuples_FP32_ (I, J, (float *) X, &nvals, A)) ; break ; - case GB_FP64_code : METHOD (GrB_Matrix_extractTuples_FP64_ (I, J, (double *) X, &nvals, A)) ; break; - case GB_FC32_code : METHOD (GxB_Matrix_extractTuples_FC32_ (I, J, (GxB_FC32_t *) X, &nvals, A)) ; break ; - case GB_FC64_code : METHOD (GxB_Matrix_extractTuples_FC64_ (I, J, (GxB_FC64_t *) X, &nvals, A)) ; break; - case GB_UDT_code : METHOD (GrB_Matrix_extractTuples_UDT_ (I, J, (void *) X, &nvals, A)) ; break; - default : FREE_ALL ; mexErrMsgTxt ("unsupported type") ; + pargout [2] = GB_mx_Vector_to_mxArray (&X_vector, "X", false) ; } } diff --git a/GraphBLAS/Test/GB_mex_factory_control.c b/GraphBLAS/Test/GB_mex_factory_control.c index 76c449784c..373171ee28 100644 --- a/GraphBLAS/Test/GB_mex_factory_control.c +++ b/GraphBLAS/Test/GB_mex_factory_control.c @@ -2,7 +2,7 @@ // GB_mex_factory_control: enable/disable the factory kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_finalize.c b/GraphBLAS/Test/GB_mex_finalize.c index c65676ccfb..3b422acfae 100644 --- a/GraphBLAS/Test/GB_mex_finalize.c +++ b/GraphBLAS/Test/GB_mex_finalize.c @@ -2,7 +2,7 @@ // GB_mex_finalize: finalize GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_gabor.c b/GraphBLAS/Test/GB_mex_gabor.c index fb05bd2914..e9f214b4ab 100644 --- a/GraphBLAS/Test/GB_mex_gabor.c +++ b/GraphBLAS/Test/GB_mex_gabor.c @@ -2,7 +2,7 @@ // GB_mex_gabor: test case from Gabor Szarnyas and Marton Elekes //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_generic.h b/GraphBLAS/Test/GB_mex_generic.h index bcf017b62c..4a4821e528 100644 --- a/GraphBLAS/Test/GB_mex_generic.h +++ b/GraphBLAS/Test/GB_mex_generic.h @@ -2,7 +2,7 @@ // GB_mex_generic.h: testing _Generic methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -246,6 +246,9 @@ #define GrB_Scalar_extractElement_UDT_(...) GrB_Scalar_extractElement (__VA_ARGS__) // GrB_Vector_build: +#define GxB_Vector_build_Scalar_(...) GrB_Vector_build (__VA_ARGS__) +#define GxB_Vector_build_Vector_(...) GrB_Vector_build (__VA_ARGS__) +#define GxB_Vector_build_Scalar_Vector_(...) GrB_Vector_build (__VA_ARGS__) #define GrB_Vector_build_BOOL_(...) GrB_Vector_build (__VA_ARGS__) #define GrB_Vector_build_INT8_(...) GrB_Vector_build (__VA_ARGS__) #define GrB_Vector_build_INT16_(...) GrB_Vector_build (__VA_ARGS__) @@ -296,6 +299,7 @@ #define GrB_Vector_extractElement_Scalar_(...) GrB_Vector_extractElement (__VA_ARGS__) // GrB_Vector_extractTuples: +#define GxB_Vector_extractTuples_Vector_(...) GrB_Vector_extractTuples (__VA_ARGS__) #define GrB_Vector_extractTuples_BOOL_(...) GrB_Vector_extractTuples (__VA_ARGS__) #define GrB_Vector_extractTuples_INT8_(...) GrB_Vector_extractTuples (__VA_ARGS__) #define GrB_Vector_extractTuples_INT16_(...) GrB_Vector_extractTuples (__VA_ARGS__) @@ -312,6 +316,9 @@ #define GrB_Vector_extractTuples_UDT_(...) GrB_Vector_extractTuples (__VA_ARGS__) // GrB_Matrix_build: +#define GxB_Matrix_build_Scalar_(...) GrB_Matrix_build (__VA_ARGS__) +#define GxB_Matrix_build_Vector_(...) GrB_Matrix_build (__VA_ARGS__) +#define GxB_Matrix_build_Scalar_Vector_(...) GrB_Matrix_build (__VA_ARGS__) #define GrB_Matrix_build_BOOL_(...) GrB_Matrix_build (__VA_ARGS__) #define GrB_Matrix_build_INT8_(...) GrB_Matrix_build (__VA_ARGS__) #define GrB_Matrix_build_INT16_(...) GrB_Matrix_build (__VA_ARGS__) @@ -394,6 +401,7 @@ #define GrB_Matrix_extractElement_Scalar_(...) GrB_Matrix_extractElement (__VA_ARGS__) // GrB_Matrix_extractTuples: +#define GxB_Matrix_extractTuples_Vector_(...) GrB_Matrix_extractTuples (__VA_ARGS__) #define GrB_Matrix_extractTuples_BOOL_(...) GrB_Matrix_extractTuples (__VA_ARGS__) #define GrB_Matrix_extractTuples_INT8_(...) GrB_Matrix_extractTuples (__VA_ARGS__) #define GrB_Matrix_extractTuples_INT16_(...) GrB_Matrix_extractTuples (__VA_ARGS__) @@ -455,12 +463,25 @@ #define GrB_Vector_extract_(...) GrB_extract (__VA_ARGS__) #define GrB_Matrix_extract_(...) GrB_extract (__VA_ARGS__) #define GrB_Col_extract_(...) GrB_extract (__VA_ARGS__) +#define GxB_Vector_extract_Vector_(...) GrB_extract (__VA_ARGS__) +#define GxB_Matrix_extract_Vector_(...) GrB_extract (__VA_ARGS__) +#define GxB_Col_extract_Vector_(...) GrB_extract (__VA_ARGS__) // GxB_subassign: #define GxB_Vector_subassign_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Vector_subassign_Scalar_(...) GxB_subassign (__VA_ARGS__) #define GxB_Matrix_subassign_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Matrix_subassign_Scalar_(...) GxB_subassign (__VA_ARGS__) #define GxB_Col_subassign_(...) GxB_subassign (__VA_ARGS__) #define GxB_Row_subassign_(...) GxB_subassign (__VA_ARGS__) +// +#define GxB_Vector_subassign_Vector_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Vector_subassign_Scalar_Vector_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Matrix_subassign_Vector_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Matrix_subassign_Scalar_Vector_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Col_subassign_Vector_(...) GxB_subassign (__VA_ARGS__) +#define GxB_Row_subassign_Vector_(...) GxB_subassign (__VA_ARGS__) +// #define GxB_Vector_subassign_BOOL_(...) GxB_subassign (__VA_ARGS__) #define GxB_Vector_subassign_INT8_(...) GxB_subassign (__VA_ARGS__) #define GxB_Vector_subassign_INT16_(...) GxB_subassign (__VA_ARGS__) @@ -492,9 +513,19 @@ // GrB_assign: #define GrB_Vector_assign_(...) GrB_assign (__VA_ARGS__) +#define GrB_Vector_assign_Scalar_(...) GrB_assign (__VA_ARGS__) #define GrB_Matrix_assign_(...) GrB_assign (__VA_ARGS__) +#define GrB_Matrix_assign_Scalar_(...) GrB_assign (__VA_ARGS__) #define GrB_Col_assign_(...) GrB_assign (__VA_ARGS__) #define GrB_Row_assign_(...) GrB_assign (__VA_ARGS__) +// +#define GxB_Vector_assign_Vector_(...) GrB_assign (__VA_ARGS__) +#define GxB_Vector_assign_Scalar_Vector_(...) GrB_assign (__VA_ARGS__) +#define GxB_Matrix_assign_Vector_(...) GrB_assign (__VA_ARGS__) +#define GxB_Matrix_assign_Scalar_Vector_(...) GrB_assign (__VA_ARGS__) +#define GxB_Col_assign_Vector_(...) GrB_assign (__VA_ARGS__) +#define GxB_Row_assign_Vector_(...) GrB_assign (__VA_ARGS__) +// #define GrB_Vector_assign_BOOL_(...) GrB_assign (__VA_ARGS__) #define GrB_Vector_assign_INT8_(...) GrB_assign (__VA_ARGS__) #define GrB_Vector_assign_INT16_(...) GrB_assign (__VA_ARGS__) @@ -963,6 +994,9 @@ #define GrB_Scalar_extractElement_UDT_(...) GrB_Scalar_extractElement_UDT (__VA_ARGS__) // GrB_Vector_build: +#define GxB_Vector_build_Scalar_(...) GxB_Vector_build_Scalar (__VA_ARGS__) +#define GxB_Vector_build_Vector_(...) GrB_Vector_build_Vector (__VA_ARGS__) +#define GxB_Vector_build_Scalar_Vector_(...) GrB_Vector_build_Scalar_Vector (__VA_ARGS__) #define GrB_Vector_build_BOOL_(...) GrB_Vector_build_BOOL (__VA_ARGS__) #define GrB_Vector_build_INT8_(...) GrB_Vector_build_INT8 (__VA_ARGS__) #define GrB_Vector_build_INT16_(...) GrB_Vector_build_INT16 (__VA_ARGS__) @@ -1013,6 +1047,7 @@ #define GrB_Vector_extractElement_Scalar_(...) GrB_Vector_extractElement_Scalar (__VA_ARGS__) // GrB_Vector_extractTuples: +#define GxB_Vector_extractTuples_Vector_(...) GxB_Vector_extractTuples_Vector (__VA_ARGS__) #define GrB_Vector_extractTuples_BOOL_(...) GrB_Vector_extractTuples_BOOL (__VA_ARGS__) #define GrB_Vector_extractTuples_INT8_(...) GrB_Vector_extractTuples_INT8 (__VA_ARGS__) #define GrB_Vector_extractTuples_INT16_(...) GrB_Vector_extractTuples_INT16 (__VA_ARGS__) @@ -1029,6 +1064,9 @@ #define GrB_Vector_extractTuples_UDT_(...) GrB_Vector_extractTuples_UDT (__VA_ARGS__) // GrB_Matrix_build: +#define GxB_Matrix_build_Scalar_(...) GxB_Matrix_build_Scalar (__VA_ARGS__) +#define GxB_Matrix_build_Vector_(...) GrB_Matrix_build_Vector (__VA_ARGS__) +#define GxB_Matrix_build_Scalar_Vector_(...) GrB_Matrix_build_Scalar_Vector (__VA_ARGS__) #define GrB_Matrix_build_BOOL_(...) GrB_Matrix_build_BOOL (__VA_ARGS__) #define GrB_Matrix_build_INT8_(...) GrB_Matrix_build_INT8 (__VA_ARGS__) #define GrB_Matrix_build_INT16_(...) GrB_Matrix_build_INT16 (__VA_ARGS__) @@ -1111,6 +1149,7 @@ #define GrB_Matrix_extractElement_Scalar_(...) GrB_Matrix_extractElement_Scalar (__VA_ARGS__) // GrB_Matrix_extractTuples: +#define GxB_Matrix_extractTuples_Vector_(...) GxB_Matrix_extractTuples_Vector (__VA_ARGS__) #define GrB_Matrix_extractTuples_BOOL_(...) GrB_Matrix_extractTuples_BOOL (__VA_ARGS__) #define GrB_Matrix_extractTuples_INT8_(...) GrB_Matrix_extractTuples_INT8 (__VA_ARGS__) #define GrB_Matrix_extractTuples_INT16_(...) GrB_Matrix_extractTuples_INT16 (__VA_ARGS__) @@ -1170,12 +1209,25 @@ #define GrB_Vector_extract_(...) GrB_Vector_extract (__VA_ARGS__) #define GrB_Matrix_extract_(...) GrB_Matrix_extract (__VA_ARGS__) #define GrB_Col_extract_(...) GrB_Col_extract (__VA_ARGS__) +#define GxB_Vector_extract_Vector_(...) GxB_Vector_extract_Vector (__VA_ARGS__) +#define GxB_Matrix_extract_Vector_(...) GxB_Matrix_extract_Vector (__VA_ARGS__) +#define GxB_Col_extract_Vector_(...) GxB_Col_extract_Vector (__VA_ARGS__) // GxB_subassign: #define GxB_Vector_subassign_(...) GxB_Vector_subassign (__VA_ARGS__) +#define GxB_Vector_subassign_Scalar_(...) GxB_Vector_subassign_Scalar (__VA_ARGS__) #define GxB_Matrix_subassign_(...) GxB_Matrix_subassign (__VA_ARGS__) +#define GxB_Matrix_subassign_Scalar_(...) GxB_Matrix_subassign_Scalar (__VA_ARGS__) #define GxB_Col_subassign_(...) GxB_Col_subassign (__VA_ARGS__) #define GxB_Row_subassign_(...) GxB_Row_subassign (__VA_ARGS__) +// +#define GxB_Vector_subassign_Vector_(...) GxB_Vector_subassign_Vector (__VA_ARGS__) +#define GxB_Vector_subassign_Scalar_Vector_(...) GxB_Vector_subassign_Scalar_Vector (__VA_ARGS__) +#define GxB_Matrix_subassign_Vector_(...) GxB_Matrix_subassign_Vector (__VA_ARGS__) +#define GxB_Matrix_subassign_Scalar_Vector_(...) GxB_Matrix_subassign_Scalar_Vector (__VA_ARGS__) +#define GxB_Col_subassign_Vector_(...) GxB_Col_subassign_Vector (__VA_ARGS__) +#define GxB_Row_subassign_Vector_(...) GxB_Row_subassign_Vector (__VA_ARGS__) +// #define GxB_Vector_subassign_BOOL_(...) GxB_Vector_subassign_BOOL (__VA_ARGS__) #define GxB_Vector_subassign_INT8_(...) GxB_Vector_subassign_INT8 (__VA_ARGS__) #define GxB_Vector_subassign_INT16_(...) GxB_Vector_subassign_INT16 (__VA_ARGS__) @@ -1207,9 +1259,20 @@ // GrB_assign: #define GrB_Vector_assign_(...) GrB_Vector_assign (__VA_ARGS__) +#define GrB_Vector_assign_Scalar_(...) GrB_Vector_assign_Scalar (__VA_ARGS__) #define GrB_Matrix_assign_(...) GrB_Matrix_assign (__VA_ARGS__) +#define GrB_Matrix_assign_Scalar_(...) GrB_Matrix_assign_Scalar (__VA_ARGS__) #define GrB_Col_assign_(...) GrB_Col_assign (__VA_ARGS__) #define GrB_Row_assign_(...) GrB_Row_assign (__VA_ARGS__) +// +#define GxB_Vector_assign_Vector_(...) GxB_Vector_assign_Vector (__VA_ARGS__) +#define GxB_Vector_assign_Scalar_Vector_(...) GxB_Vector_assign_Scalar_Vector (__VA_ARGS__) +#define GxB_Matrix_assign_Vector_(...) GxB_Matrix_assign_Vector (__VA_ARGS__) +#define GxB_Matrix_assign_Scalar_Vector_(...) GxB_Matrix_assign_Scalar_Vector (__VA_ARGS__) +#define GxB_Col_assign_Vector_(...) GxB_Col_assign_Vector (__VA_ARGS__) +#define GxB_Row_assign_Vector_(...) GxB_Row_assign_Vector (__VA_ARGS__) +// + #define GrB_Vector_assign_BOOL_(...) GrB_Vector_assign_BOOL (__VA_ARGS__) #define GrB_Vector_assign_INT8_(...) GrB_Vector_assign_INT8 (__VA_ARGS__) #define GrB_Vector_assign_INT16_(...) GrB_Vector_assign_INT16 (__VA_ARGS__) diff --git a/GraphBLAS/Test/GB_mex_grow.c b/GraphBLAS/Test/GB_mex_grow.c index 2c71e57266..8e75f98842 100644 --- a/GraphBLAS/Test/GB_mex_grow.c +++ b/GraphBLAS/Test/GB_mex_grow.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_mex_grow: MATLAB version of GraphBLAS/Demo/Programgrow_demo.c +// GB_mex_grow: MATLAB version of GraphBLAS/Demo/Program/grow_demo.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,7 +31,7 @@ GrB_Info check_result (GrB_Matrix A1, GrB_Matrix C1, GrB_BinaryOp eq) GrB_Info info ; GrB_Matrix A = NULL, C = NULL, T = NULL, W = NULL ; GrB_Vector w = NULL ; - GrB_Index anvals, cnvals, tnvals, anrows, ancols ; + uint64_t anvals, cnvals, tnvals, anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A1)) ; OK (GrB_Matrix_ncols (&ancols, A1)) ; OK (GrB_Matrix_nvals (&anvals, A1)) ; @@ -49,6 +49,7 @@ GrB_Info check_result (GrB_Matrix A1, GrB_Matrix C1, GrB_BinaryOp eq) t = (WALLCLOCK - t) ; GrB_Matrix_free (&T) ; printf ("A and C match, time %g\n", t) ; + return (GrB_SUCCESS) ; } @@ -76,8 +77,8 @@ void mexFunction #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; - // get A - A = GB_mx_mxArray_to_Matrix (pargin [0], "A", false, true) ; + // get A (deep copy) + A = GB_mx_mxArray_to_Matrix (pargin [0], "A", true, true) ; if (A == NULL) { mexErrMsgTxt ("A failed") ; @@ -91,7 +92,7 @@ void mexFunction // get A matrix //-------------------------------------------------------------------------- - GrB_Index anrows, ancols ; + uint64_t anrows, ancols ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; @@ -166,7 +167,7 @@ void mexFunction // C (i,:) = w t = WALLCLOCK ; - OK (GrB_Row_assign (C, NULL, NULL, w, i, GrB_ALL, ancols, NULL)) ; + OK (GrB_Row_assign_(C, NULL, NULL, w, i, GrB_ALL, ancols, NULL)) ; tt [2] += (WALLCLOCK - t) ; // ensure C is finished @@ -189,7 +190,7 @@ void mexFunction // check to see if A and C are equal OK (check_result (A, C, eq)) ; GrB_Matrix_free (&C) ; - GrB_Matrix_free (&w) ; + GrB_Vector_free (&w) ; //-------------------------------------------------------------------------- // C = A, multiple rows at a time @@ -221,7 +222,7 @@ void mexFunction OK (GrB_set (W, false, GxB_HYPER_HASH)) ; OK (GrB_set (W, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; OK (GrB_set (W, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; - GrB_Index Icolon [3] ; + uint64_t Icolon [3] ; // OK Icolon [GxB_BEGIN] = i1 ; Icolon [GxB_INC ] = 1 ; Icolon [GxB_END ] = i2 ; @@ -235,8 +236,8 @@ void mexFunction // C (i1:i2,:) = W t = WALLCLOCK ; - OK (GrB_assign (C, NULL, NULL, W, Icolon, GxB_RANGE, GrB_ALL, ancols, - NULL)) ; + OK (GrB_Matrix_assign_(C, NULL, NULL, W, Icolon, GxB_RANGE, + GrB_ALL, ancols, NULL)) ; t2 [2] += (WALLCLOCK - t) ; // ensure C is finished diff --git a/GraphBLAS/Test/GB_mex_hack.c b/GraphBLAS/Test/GB_mex_hack.c index 1b558b47de..389601bba9 100644 --- a/GraphBLAS/Test/GB_mex_hack.c +++ b/GraphBLAS/Test/GB_mex_hack.c @@ -2,7 +2,7 @@ // GB_mex_hack: get or set the global hack flags //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,6 +11,16 @@ #define USAGE "hack = GB_mex_hack (hack)" +#define NHACK 8 + +// current hacks (0-based): +// +// 0: saxpy3 balance +// 1: disable Werk +// 2: GPU control +// 3: disable the JIT entirely (returns GrB_NOT_IMPLEMENTED) +// 4: enable 32-bit methods + void mexFunction ( int nargout, @@ -28,19 +38,20 @@ void mexFunction if (nargin == 1) { - if (mxGetNumberOfElements (pargin [0]) != 2) + int n = mxGetNumberOfElements (pargin [0]) ; + hack = mxGetDoubles (pargin [0]) ; + for (int k = 0 ; k < GB_IMIN (NHACK, n) ; k++) { - mexErrMsgTxt ("usage: " USAGE " where length(hack) is 2\n") ; + GB_Global_hack_set (k, (int64_t) hack [k]) ; } - hack = mxGetDoubles (pargin [0]) ; - GB_Global_hack_set (0, (int64_t) hack [0]) ; - GB_Global_hack_set (1, (int64_t) hack [1]) ; } - // GB_mex_hack returns an array of size 2 - pargout [0] = mxCreateDoubleMatrix (1, 2, mxREAL) ; + // GB_mex_hack returns an array of size NHACK + pargout [0] = mxCreateDoubleMatrix (1, NHACK, mxREAL) ; hack = mxGetDoubles (pargout [0]) ; - hack [0] = (double) GB_Global_hack_get (0) ; - hack [1] = (double) GB_Global_hack_get (1) ; + for (int k = 0 ; k < NHACK ; k++) + { + hack [k] = (double) GB_Global_hack_get (k) ; + } } diff --git a/GraphBLAS/Test/GB_mex_init.c b/GraphBLAS/Test/GB_mex_init.c index a2ceb509a7..52143b7050 100644 --- a/GraphBLAS/Test/GB_mex_init.c +++ b/GraphBLAS/Test/GB_mex_init.c @@ -2,7 +2,7 @@ // GB_mex_init: initialize GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ void mexFunction const mxArray *pargin [ ] ) { - mexPrintf ("usage:\n%s\n", USAGE) ; +// mexPrintf ("usage:\n%s\n", USAGE) ; // finalize GraphBLAS but tell it that it can be called again GB_mx_at_exit ( ) ; @@ -43,7 +43,7 @@ void mexFunction GxB_Global_Option_get_(GxB_NTHREADS, &nthreads) ; pargout [0] = mxCreateDoubleScalar (nthreads) ; - GxB_Format_Value format ; + int format ; GxB_Global_Option_get_(GxB_FORMAT, &format) ; pargout [1] = mxCreateDoubleScalar (format) ; @@ -108,24 +108,6 @@ void mexFunction bswitch [k] = bitmap_switch [k] ; } - for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) - { - printf ("bitmap_switch [%d] = %g ", k, bswitch [k]) ; - if (k == 0) - { - printf ("for vectors and matrices with 1 row or column\n") ; - } - else if (k == GxB_NBITMAP_SWITCH - 1) - { - printf ("for matrices with min dimension > %d\n", 1 << (k-1)) ; - } - else - { - printf ("for matrices with min dimension %d to %d\n", - (1 << (k-1)) + 1, 1 << k) ; - } - } - // finalize GraphBLAS but tell it that it can be called again GB_mx_at_exit ( ) ; } diff --git a/GraphBLAS/Test/GB_mex_jit_control.c b/GraphBLAS/Test/GB_mex_jit_control.c index afb4d1d9f0..8a8808fda8 100644 --- a/GraphBLAS/Test/GB_mex_jit_control.c +++ b/GraphBLAS/Test/GB_mex_jit_control.c @@ -2,7 +2,7 @@ // GB_mex_jit_control: set/get the JIT control //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_kron.c b/GraphBLAS/Test/GB_mex_kron.c index 547c76f3f3..b5021bdf5f 100644 --- a/GraphBLAS/Test/GB_mex_kron.c +++ b/GraphBLAS/Test/GB_mex_kron.c @@ -2,7 +2,7 @@ // GB_mex_kron: C = accum(C,kron(A,B)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_kron_idx.c b/GraphBLAS/Test/GB_mex_kron_idx.c index 208380963b..0fe9bfa3d8 100644 --- a/GraphBLAS/Test/GB_mex_kron_idx.c +++ b/GraphBLAS/Test/GB_mex_kron_idx.c @@ -2,7 +2,7 @@ // GB_mex_kron_idx: C = kron(A,B) with a user-defined index binary op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ #define USAGE "C = GB_mex_kron_idx (A, B, atrans, btrans, C_is_csc)" void mykronidx (double *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) ; void mykronidx (double *z, - const void *x, GrB_Index ix, GrB_Index jx, - const void *y, GrB_Index iy, GrB_Index jy, + const void *x, uint64_t ix, uint64_t jx, + const void *y, uint64_t iy, uint64_t jy, const int64_t *theta) { (*z) = (double) ( @@ -31,8 +31,8 @@ void mykronidx (double *z, #define MYKRONIDX_DEFN \ "void mykronidx (double *z, \n" \ -" const void *x, GrB_Index ix, GrB_Index jx, \n" \ -" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *x, uint64_t ix, uint64_t jx, \n" \ +" const void *y, uint64_t iy, uint64_t jy, \n" \ " const int64_t *theta) \n" \ "{ \n" \ " (*z) = (double) ( \n" \ @@ -72,7 +72,7 @@ void mexFunction GrB_BinaryOp mult = NULL ; GxB_IndexBinaryOp Iop = NULL ; GrB_Descriptor desc = NULL ; - GrB_Index anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; + uint64_t anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; // check inputs if (nargout > 1 || nargin < 2 || nargin > 5) @@ -118,10 +118,10 @@ void mexFunction OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_nrows (&bnrows, B)) ; OK (GrB_Matrix_ncols (&bncols, B)) ; - GrB_Index cnrows = ((atrans) ? ancols : anrows) - * ((btrans) ? bncols : bnrows) ; - GrB_Index cncols = ((atrans) ? anrows : ancols) - * ((btrans) ? bnrows : bncols) ; + uint64_t cnrows = ((atrans) ? ancols : anrows) + * ((btrans) ? bncols : bnrows) ; + uint64_t cncols = ((atrans) ? anrows : ancols) + * ((btrans) ? bnrows : bncols) ; // create the output matrix C OK (GrB_Matrix_new (&C, GrB_FP64, cnrows, cncols)) ; diff --git a/GraphBLAS/Test/GB_mex_mdiag.c b/GraphBLAS/Test/GB_mex_mdiag.c index e884f10186..4ed0245b81 100644 --- a/GraphBLAS/Test/GB_mex_mdiag.c +++ b/GraphBLAS/Test/GB_mex_mdiag.c @@ -2,7 +2,7 @@ // GB_mex_mdiag: compute C=diag(v,k) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -68,7 +68,7 @@ void mexFunction int GET_SCALAR (3, int, fmt, GxB_BY_COL) ; // construct C - int64_t n ; + uint64_t n ; GrB_Matrix_nrows (&n, V) ; n += GB_IABS (k) ; diff --git a/GraphBLAS/Test/GB_mex_msort_1.c b/GraphBLAS/Test/GB_mex_msort_1.c new file mode 100644 index 0000000000..9e9bd05fe1 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_msort_1.c @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// GB_mex_msort_1: sort using GB_msort_1 +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" + +#define USAGE "[I] = GB_mex_msort_1 (I,nthreads)" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + bool malloc_debug = GB_mx_get_global (true) ; + + // check inputs + if (nargin != 2 || nargout != 1) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + void *I = mxGetData (pargin [0]) ; + int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; + + int GET_SCALAR (1, int, nthreads, 1) ; + + // make a copy of the input arrays + + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; + + GB_msort_1 (Iout, I_is_32, n, nthreads) ; + + GB_mx_put_global (true) ; +} + diff --git a/GraphBLAS/Test/GB_mex_msort_2.c b/GraphBLAS/Test/GB_mex_msort_2.c index 313aed6489..795344b51b 100644 --- a/GraphBLAS/Test/GB_mex_msort_2.c +++ b/GraphBLAS/Test/GB_mex_msort_2.c @@ -2,7 +2,7 @@ // GB_mex_msort_2: sort using GB_msort_2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,19 +26,39 @@ void mexFunction { mexErrMsgTxt ("Usage: " USAGE) ; } - if (!mxIsClass (pargin [0], "int64")) + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) { - mexErrMsgTxt ("I must be a int64 array") ; + I_is_32 = false ; } - if (!mxIsClass (pargin [1], "int64")) + else { - mexErrMsgTxt ("J must be a int64 array") ; + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; } - int64_t *I = mxGetData (pargin [0]) ; + bool J_is_32 ; + if (mxIsClass (pargin [1], "uint32")) + { + J_is_32 = true ; + } + else if (mxIsClass (pargin [1], "uint64")) + { + J_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + void *I = mxGetData (pargin [0]) ; int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; - int64_t *J = mxGetData (pargin [1]) ; + void *J = mxGetData (pargin [1]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) { mexErrMsgTxt ("I and J must be the same length") ; @@ -47,15 +67,16 @@ void mexFunction int GET_SCALAR (2, int, nthreads, 1) ; // make a copy of the input arrays - pargout [0] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Iout = mxGetData (pargout [0]) ; - memcpy (Iout, I, n * sizeof (int64_t)) ; - pargout [1] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Jout = mxGetData (pargout [1]) ; - memcpy (Jout, J, n * sizeof (int64_t)) ; + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; + + pargout [1] = GB_mx_create_full (n, 1, J_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Jout = mxGetData (pargout [1]) ; + memcpy (Jout, J, n * (J_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - GB_msort_2 (Iout, Jout, n, nthreads) ; + GB_msort_2 (Iout, I_is_32, Jout, J_is_32, n, nthreads) ; GB_mx_put_global (true) ; } diff --git a/GraphBLAS/Test/GB_mex_msort_3.c b/GraphBLAS/Test/GB_mex_msort_3.c index 329fc8df18..98913c9d8b 100644 --- a/GraphBLAS/Test/GB_mex_msort_3.c +++ b/GraphBLAS/Test/GB_mex_msort_3.c @@ -2,7 +2,7 @@ // GB_mex_msort_3: sort using GB_msort_3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,29 +26,59 @@ void mexFunction { mexErrMsgTxt ("Usage: " USAGE) ; } - if (!mxIsClass (pargin [0], "int64")) + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool J_is_32 ; + if (mxIsClass (pargin [1], "uint32")) + { + J_is_32 = true ; + } + else if (mxIsClass (pargin [1], "uint64")) + { + J_is_32 = false ; + } + else { - mexErrMsgTxt ("I must be a int64 array") ; + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool K_is_32 ; + if (mxIsClass (pargin [2], "uint32")) + { + K_is_32 = true ; } - if (!mxIsClass (pargin [1], "int64")) + else if (mxIsClass (pargin [2], "uint64")) { - mexErrMsgTxt ("J must be a int64 array") ; + K_is_32 = false ; } - if (!mxIsClass (pargin [2], "int64")) + else { - mexErrMsgTxt ("K must be a int64 array") ; + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; } - int64_t *I = mxGetData (pargin [0]) ; + void *I = mxGetData (pargin [0]) ; int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; - int64_t *J = mxGetData (pargin [1]) ; + void *J = mxGetData (pargin [1]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) { mexErrMsgTxt ("I and J must be the same length") ; } - int64_t *K = mxGetData (pargin [2]) ; + void *K = mxGetData (pargin [2]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [2])) { mexErrMsgTxt ("I and K must be the same length") ; @@ -56,19 +86,19 @@ void mexFunction int GET_SCALAR (3, int, nthreads, 1) ; - pargout [0] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Iout = mxGetData (pargout [0]) ; - memcpy (Iout, I, n * sizeof (int64_t)) ; + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - pargout [1] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Jout = mxGetData (pargout [1]) ; - memcpy (Jout, J, n * sizeof (int64_t)) ; + pargout [1] = GB_mx_create_full (n, 1, J_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Jout = mxGetData (pargout [1]) ; + memcpy (Jout, J, n * (J_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - pargout [2] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Kout = mxGetData (pargout [2]) ; - memcpy (Kout, K, n * sizeof (int64_t)) ; + pargout [2] = GB_mx_create_full (n, 1, K_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Kout = mxGetData (pargout [2]) ; + memcpy (Kout, K, n * (K_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - GB_msort_3 (Iout, Jout, Kout, n, nthreads) ; + GB_msort_3 (Iout, I_is_32, Jout, J_is_32, Kout, K_is_32, n, nthreads) ; GB_mx_put_global (true) ; } diff --git a/GraphBLAS/Test/GB_mex_mxm.c b/GraphBLAS/Test/GB_mex_mxm.c index 2a802a1b20..d21f9f77cd 100644 --- a/GraphBLAS/Test/GB_mex_mxm.c +++ b/GraphBLAS/Test/GB_mex_mxm.c @@ -2,7 +2,7 @@ // GB_mex_mxm: C = accum(C,A*B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxm_alias.c b/GraphBLAS/Test/GB_mex_mxm_alias.c index e462f4aa44..3d5521f424 100644 --- a/GraphBLAS/Test/GB_mex_mxm_alias.c +++ b/GraphBLAS/Test/GB_mex_mxm_alias.c @@ -2,7 +2,7 @@ // GB_mex_mxm_alias: C = accum(C,C*C) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxm_flops.c b/GraphBLAS/Test/GB_mex_mxm_flops.c index d5263fafca..473800a6cc 100644 --- a/GraphBLAS/Test/GB_mex_mxm_flops.c +++ b/GraphBLAS/Test/GB_mex_mxm_flops.c @@ -2,7 +2,7 @@ // GB_mex_mxm_flops: compute flops to do C=A*B, C=A*B or C=A*B //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxm_generic.c b/GraphBLAS/Test/GB_mex_mxm_generic.c index aeab6a3449..445500aedf 100644 --- a/GraphBLAS/Test/GB_mex_mxm_generic.c +++ b/GraphBLAS/Test/GB_mex_mxm_generic.c @@ -2,7 +2,7 @@ // GB_mex_mxm_generic: C = accum(C,A*B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxm_update.c b/GraphBLAS/Test/GB_mex_mxm_update.c index b1f3a0ce3c..8c471382b5 100644 --- a/GraphBLAS/Test/GB_mex_mxm_update.c +++ b/GraphBLAS/Test/GB_mex_mxm_update.c @@ -2,7 +2,7 @@ // GB_mex_mxm_update: C += A*B where the accum is the same as the monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxv.c b/GraphBLAS/Test/GB_mex_mxv.c index e2e4f73f37..78738f517f 100644 --- a/GraphBLAS/Test/GB_mex_mxv.c +++ b/GraphBLAS/Test/GB_mex_mxv.c @@ -2,7 +2,7 @@ // GB_mex_mxv: w = accum(w,A*u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_mxv_iterator.c b/GraphBLAS/Test/GB_mex_mxv_iterator.c index bc4a7dab00..ca58b2b057 100644 --- a/GraphBLAS/Test/GB_mex_mxv_iterator.c +++ b/GraphBLAS/Test/GB_mex_mxv_iterator.c @@ -2,7 +2,7 @@ // GB_mex_mxv_iterator: Y = A*X using an iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,7 +24,7 @@ GB_mx_put_global (true) ; \ } -#define Assert(x) \ +#define my_assert(x) \ { \ if (!(x)) \ { \ @@ -61,7 +61,7 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("A failed") ; } - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; OK (GrB_Matrix_nrows (&nrows, A)) ; OK (GrB_Matrix_ncols (&ncols, A)) ; GB_Global_print_one_based_set (0) ; @@ -75,7 +75,7 @@ void mexFunction } // GxB_print (X, 3) ; - GrB_Index n ; + uint64_t n ; OK (GrB_Vector_size (&n, X)) ; if (n != ncols) { @@ -100,6 +100,7 @@ void mexFunction OK (GxB_Vector_Option_get (X, GxB_SPARSITY_STATUS, &sparsity)) ; if (sparsity != GxB_FULL) { + GxB_print (X, 5) ; FREE_ALL ; mexErrMsgTxt ("X must be full") ; } @@ -153,12 +154,12 @@ void mexFunction if (A->is_csc) { info = GxB_rowIterator_attach (iterator, A, NULL) ; - Assert (info == GrB_NOT_IMPLEMENTED) ; + my_assert (info == GrB_NOT_IMPLEMENTED) ; } else { info = GxB_colIterator_attach (iterator, A, NULL) ; - Assert (info == GrB_NOT_IMPLEMENTED) ; + my_assert (info == GrB_NOT_IMPLEMENTED) ; } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_nonzero.c b/GraphBLAS/Test/GB_mex_nonzero.c index 5bb9226c2a..ab0f20f995 100644 --- a/GraphBLAS/Test/GB_mex_nonzero.c +++ b/GraphBLAS/Test/GB_mex_nonzero.c @@ -2,7 +2,7 @@ // GB_mex_nonzero: compute C=nonzero(A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_offdiag.c b/GraphBLAS/Test/GB_mex_offdiag.c index 275c5fe412..aa355d0d7f 100644 --- a/GraphBLAS/Test/GB_mex_offdiag.c +++ b/GraphBLAS/Test/GB_mex_offdiag.c @@ -2,7 +2,7 @@ // GB_mex_offdiag: compute C=offdiag(A,1) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_omp_max_threads.c b/GraphBLAS/Test/GB_mex_omp_max_threads.c index 712ffcd934..d0e493ef3a 100644 --- a/GraphBLAS/Test/GB_mex_omp_max_threads.c +++ b/GraphBLAS/Test/GB_mex_omp_max_threads.c @@ -2,7 +2,7 @@ // GB_mex_omp_max_threads: omp_get_max_threads ( ) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_op.c b/GraphBLAS/Test/GB_mex_op.c index 7d6c8c9039..57576048d4 100644 --- a/GraphBLAS/Test/GB_mex_op.c +++ b/GraphBLAS/Test/GB_mex_op.c @@ -2,7 +2,7 @@ // GB_mex_op: apply a built-in GraphBLAS operator to built-in arrays //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_plusplus.c b/GraphBLAS/Test/GB_mex_plusplus.c index 63b145c7da..2e70583b13 100644 --- a/GraphBLAS/Test/GB_mex_plusplus.c +++ b/GraphBLAS/Test/GB_mex_plusplus.c @@ -2,14 +2,14 @@ // GB_mex_plusplus: C = accum(C,A*B) with user-defined plus_plus_fp32 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "C = GB_mex_plusplus (C, M, accum, [ ], A, B, desc, macrofy)" +#define USAGE "C = GB_mex_plusplus (C, M, accum, [ ], A, B, desc)" #define FREE_ALL \ { \ @@ -49,7 +49,7 @@ void mexFunction GrB_Monoid MyAdd = NULL ; // check inputs - if (nargout > 1 || nargin < 6 || nargin > 8) + if (nargout > 1 || nargin < 6 || nargin > 7) { mexErrMsgTxt ("Usage: " USAGE) ; } diff --git a/GraphBLAS/Test/GB_mex_qsort_1.c b/GraphBLAS/Test/GB_mex_qsort_1.c new file mode 100644 index 0000000000..911d5c72b3 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_qsort_1.c @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// GB_mex_qsort_1: sort using GB_qsort_1 +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" + +#define USAGE "[I] = qsort (I)" + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + // check inputs + if (nargin != 1 || nargout != 1) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + void *I = mxGetData (pargin [0]) ; + int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; + + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; + +// double t = GB_omp_get_wtime ( ) ; + GB_qsort_1 (Iout, I_is_32, n) ; +// printf ("qsort_1 time %g\n", GB_omp_get_wtime ( ) - t) ; +} + diff --git a/GraphBLAS/Test/GB_mex_qsort_1b.c b/GraphBLAS/Test/GB_mex_qsort_1b.c index 90ebadc588..f4d64c9397 100644 --- a/GraphBLAS/Test/GB_mex_qsort_1b.c +++ b/GraphBLAS/Test/GB_mex_qsort_1b.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_mex_qsort_1b: sort using GB_qsort_1b +// GB_mex_qsort_1b: sort using GB_qsort_1b_generic //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,32 +25,34 @@ void mexFunction { mexErrMsgTxt ("Usage: " USAGE) ; } - if (!mxIsClass (pargin [0], "int64")) + if (!mxIsClass (pargin [0], "uint64")) { - mexErrMsgTxt ("I must be a int64 array") ; + mexErrMsgTxt ("I must be a uint64 array") ; } - if (!mxIsClass (pargin [1], "int64")) + if (!mxIsClass (pargin [1], "uint64")) { - mexErrMsgTxt ("J must be a int64 array") ; + mexErrMsgTxt ("J must be a uint64 array") ; } - int64_t *I = mxGetData (pargin [0]) ; + uint64_t *I = mxGetData (pargin [0]) ; int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; - int64_t *J = mxGetData (pargin [1]) ; + uint64_t *J = mxGetData (pargin [1]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) { mexErrMsgTxt ("I and J must be the same length") ; } - pargout [0] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Iout = mxGetData (pargout [0]) ; - memcpy (Iout, I, n * sizeof (int64_t)) ; + pargout [0] = GB_mx_create_full (n, 1, GrB_UINT64) ; + uint64_t *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * sizeof (uint64_t)) ; - pargout [1] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Jout = mxGetData (pargout [1]) ; - memcpy (Jout, J, n * sizeof (int64_t)) ; + pargout [1] = GB_mx_create_full (n, 1, GrB_UINT64) ; + uint64_t *Jout = mxGetData (pargout [1]) ; + memcpy (Jout, J, n * sizeof (uint64_t)) ; - GB_qsort_1b (Iout, (GB_void *) Jout, sizeof (int64_t), n) ; +// double t = GB_omp_get_wtime ( ) ; + GB_qsort_1b_64_generic (Iout, (GB_void *) Jout, sizeof (int64_t), n) ; +// printf ("1b_64_generic time %g\n", GB_omp_get_wtime ( ) - t) ; } diff --git a/GraphBLAS/Test/GB_mex_qsort_2.c b/GraphBLAS/Test/GB_mex_qsort_2.c index dff21f28c2..352c2285b1 100644 --- a/GraphBLAS/Test/GB_mex_qsort_2.c +++ b/GraphBLAS/Test/GB_mex_qsort_2.c @@ -2,7 +2,7 @@ // GB_mex_qsort_2: sort using GB_qsort_2 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,32 +25,54 @@ void mexFunction { mexErrMsgTxt ("Usage: " USAGE) ; } - if (!mxIsClass (pargin [0], "int64")) + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool J_is_32 ; + if (mxIsClass (pargin [1], "uint32")) + { + J_is_32 = true ; + } + else if (mxIsClass (pargin [1], "uint64")) { - mexErrMsgTxt ("I must be a int64 array") ; + J_is_32 = false ; } - if (!mxIsClass (pargin [1], "int64")) + else { - mexErrMsgTxt ("J must be a int64 array") ; + mexErrMsgTxt ("J must be a uint32 or uint64 array") ; } - int64_t *I = mxGetData (pargin [0]) ; + void *I = mxGetData (pargin [0]) ; int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; - int64_t *J = mxGetData (pargin [1]) ; + void *J = mxGetData (pargin [1]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) { mexErrMsgTxt ("I and J must be the same length") ; } - pargout [0] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Iout = mxGetData (pargout [0]) ; - memcpy (Iout, I, n * sizeof (int64_t)) ; + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - pargout [1] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Jout = mxGetData (pargout [1]) ; - memcpy (Jout, J, n * sizeof (int64_t)) ; + pargout [1] = GB_mx_create_full (n, 1, J_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Jout = mxGetData (pargout [1]) ; + memcpy (Jout, J, n * (J_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - GB_qsort_2 (Iout, Jout, n) ; +// double t = GB_omp_get_wtime ( ) ; + GB_qsort_2 (Iout, I_is_32, Jout, J_is_32, n) ; +// printf ("qsort_2 time %g\n", GB_omp_get_wtime ( ) - t) ; } diff --git a/GraphBLAS/Test/GB_mex_qsort_3.c b/GraphBLAS/Test/GB_mex_qsort_3.c index e2b20a94d8..ec1e8fd898 100644 --- a/GraphBLAS/Test/GB_mex_qsort_3.c +++ b/GraphBLAS/Test/GB_mex_qsort_3.c @@ -2,7 +2,7 @@ // GB_mex_qsort_3: sort using GB_qsort_3 //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,46 +25,78 @@ void mexFunction { mexErrMsgTxt ("Usage: " USAGE) ; } - if (!mxIsClass (pargin [0], "int64")) + + bool I_is_32 ; + if (mxIsClass (pargin [0], "uint32")) + { + I_is_32 = true ; + } + else if (mxIsClass (pargin [0], "uint64")) + { + I_is_32 = false ; + } + else + { + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool J_is_32 ; + if (mxIsClass (pargin [1], "uint32")) + { + J_is_32 = true ; + } + else if (mxIsClass (pargin [1], "uint64")) + { + J_is_32 = false ; + } + else { - mexErrMsgTxt ("I must be a int64 array") ; + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; + } + + bool K_is_32 ; + if (mxIsClass (pargin [2], "uint32")) + { + K_is_32 = true ; } - if (!mxIsClass (pargin [1], "int64")) + else if (mxIsClass (pargin [2], "uint64")) { - mexErrMsgTxt ("J must be a int64 array") ; + K_is_32 = false ; } - if (!mxIsClass (pargin [2], "int64")) + else { - mexErrMsgTxt ("K must be a int64 array") ; + mexErrMsgTxt ("I must be a uint32 or uint64 array") ; } - int64_t *I = mxGetData (pargin [0]) ; + void *I = mxGetData (pargin [0]) ; int64_t n = (uint64_t) mxGetNumberOfElements (pargin [0]) ; - int64_t *J = mxGetData (pargin [1]) ; + void *J = mxGetData (pargin [1]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [1])) { mexErrMsgTxt ("I and J must be the same length") ; } - int64_t *K = mxGetData (pargin [2]) ; + void *K = mxGetData (pargin [2]) ; if (n != (uint64_t) mxGetNumberOfElements (pargin [2])) { mexErrMsgTxt ("I and K must be the same length") ; } - pargout [0] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Iout = mxGetData (pargout [0]) ; - memcpy (Iout, I, n * sizeof (int64_t)) ; + pargout [0] = GB_mx_create_full (n, 1, I_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Iout = mxGetData (pargout [0]) ; + memcpy (Iout, I, n * (I_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - pargout [1] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Jout = mxGetData (pargout [1]) ; - memcpy (Jout, J, n * sizeof (int64_t)) ; + pargout [1] = GB_mx_create_full (n, 1, J_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Jout = mxGetData (pargout [1]) ; + memcpy (Jout, J, n * (J_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - pargout [2] = GB_mx_create_full (n, 1, GrB_INT64) ; - int64_t *Kout = mxGetData (pargout [2]) ; - memcpy (Kout, K, n * sizeof (int64_t)) ; + pargout [2] = GB_mx_create_full (n, 1, K_is_32 ? GrB_UINT32 : GrB_UINT64) ; + void *Kout = mxGetData (pargout [2]) ; + memcpy (Kout, K, n * (K_is_32 ? sizeof (uint32_t) : sizeof (uint64_t))) ; - GB_qsort_3 (Iout, Jout, Kout, n) ; +// double t = GB_omp_get_wtime ( ) ; + GB_qsort_3 (Iout, I_is_32, Jout, J_is_32, Kout, K_is_32, n) ; +// printf ("qsort_3 time %g\n", GB_omp_get_wtime ( ) - t) ; } diff --git a/GraphBLAS/Test/GB_mex_random.c b/GraphBLAS/Test/GB_mex_random.c index b332e1eb65..75fb0bee41 100644 --- a/GraphBLAS/Test/GB_mex_random.c +++ b/GraphBLAS/Test/GB_mex_random.c @@ -2,7 +2,7 @@ // GB_mex_random: construct a random matrix, double or Complex //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_rdiv.c b/GraphBLAS/Test/GB_mex_rdiv.c index 5d61b2bd94..3a2581b91d 100644 --- a/GraphBLAS/Test/GB_mex_rdiv.c +++ b/GraphBLAS/Test/GB_mex_rdiv.c @@ -2,7 +2,7 @@ // GB_mex_rdiv: compute C=A*B with the rdiv operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,7 +36,7 @@ int64_t anrows = 0 ; int64_t ancols = 0 ; int64_t bnrows = 0 ; int64_t bncols = 0 ; -GrB_Desc_Value AxB_method = GxB_DEFAULT ; +int AxB_method = GxB_DEFAULT ; struct GB_Matrix_opaque MT_header, C_header ; GrB_Info axb (GB_Werk Werk, bool cprint) ; @@ -56,7 +56,7 @@ GrB_BinaryOp My_rdiv = NULL ; "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ -" /* revised for GrB 9.4.1 */\n" \ +" /* revised for GrB 10.0.0 */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" @@ -86,8 +86,8 @@ GrB_Info axb (GB_Werk Werk, bool cprint) return (info) ; } - MT = GB_clear_static_header (&MT_header) ; - C = GB_clear_static_header (&C_header) ; + MT = GB_clear_matrix_header (&MT_header) ; + C = GB_clear_matrix_header (&C_header) ; // C = A*B info = GB_AxB_meta (C, NULL, // C cannot be computed in place @@ -110,7 +110,7 @@ GrB_Info axb (GB_Werk Werk, bool cprint) true, // do the sort Werk) ; - if (C != NULL) + if (info == GrB_SUCCESS && C != NULL) { if (cprint) GxB_Matrix_fprint_(C, GxB_COMPLETE, NULL) ; } @@ -175,7 +175,7 @@ void mexFunction // 7083: dot // 7084: hash // 7085: saxpy - GET_SCALAR (2, GrB_Desc_Value, AxB_method, GxB_DEFAULT) ; + GET_SCALAR (2, int, AxB_method, GxB_DEFAULT) ; // get the cprint flag GET_SCALAR (3, bool, cprint, false) ; diff --git a/GraphBLAS/Test/GB_mex_rdiv2.c b/GraphBLAS/Test/GB_mex_rdiv2.c index ff9f2256b1..b13c54c117 100644 --- a/GraphBLAS/Test/GB_mex_rdiv2.c +++ b/GraphBLAS/Test/GB_mex_rdiv2.c @@ -2,7 +2,7 @@ // GB_mex_rdiv2: compute C=A*B with the rdiv2 operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -40,7 +40,7 @@ int64_t anrows = 0 ; int64_t ancols = 0 ; int64_t bnrows = 0 ; int64_t bncols = 0 ; -GrB_Desc_Value AxB_method = GxB_DEFAULT ; +int AxB_method = GxB_DEFAULT ; bool flipxy = false ; bool done_in_place = false ; double C_scalar = 0 ; @@ -90,8 +90,8 @@ GrB_Info axb (GB_Werk Werk) if (do_in_place) { // construct the result matrix and fill it with the scalar - GrB_Index cnrows = anrows ; - GrB_Index cncols = bncols ; + uint64_t cnrows = anrows ; + uint64_t cncols = bncols ; info = GrB_Matrix_new (&C, GrB_FP64, cnrows, cncols) ; if (info != GrB_SUCCESS) { @@ -110,8 +110,8 @@ GrB_Info axb (GB_Werk Werk) } } - MT = GB_clear_static_header (&MT_header) ; - T = GB_clear_static_header (&T_header) ; + MT = GB_clear_matrix_header (&MT_header) ; + T = GB_clear_matrix_header (&T_header) ; // C = A*B or C += A*B info = GB_AxB_meta (T, C, // can be done in place if C != NULL @@ -151,12 +151,9 @@ GrB_Info axb (GB_Werk Werk) { GrB_Matrix_free_(&C) ; } - GrB_Matrix_free_(&T) ; - GrB_BinaryOp_free_(&My_rdiv2) ; GrB_Semiring_free_(&My_plus_rdiv2) ; - return (info) ; } @@ -221,7 +218,7 @@ void mexFunction // 7083: dot // 7084: hash // 7085: saxpy - GET_SCALAR (4, GrB_Desc_Value, AxB_method, GxB_DEFAULT) ; + GET_SCALAR (4, int, AxB_method, GxB_DEFAULT) ; if (! ((AxB_method == GxB_DEFAULT) || (AxB_method == GxB_AxB_GUSTAVSON) || diff --git a/GraphBLAS/Test/GB_mex_reduce_bool.c b/GraphBLAS/Test/GB_mex_reduce_bool.c index dce32c107f..a2ac9893fd 100644 --- a/GraphBLAS/Test/GB_mex_reduce_bool.c +++ b/GraphBLAS/Test/GB_mex_reduce_bool.c @@ -2,7 +2,7 @@ // GB_mex_reduce_bool: c = accum(c,reduce_to_scalar(A)) for boolean //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_reduce_complex.c b/GraphBLAS/Test/GB_mex_reduce_complex.c index 59ac44f073..9126bda0be 100644 --- a/GraphBLAS/Test/GB_mex_reduce_complex.c +++ b/GraphBLAS/Test/GB_mex_reduce_complex.c @@ -2,7 +2,7 @@ // GB_mex_mxm: C = accum(C,A*B) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_reduce_terminal.c b/GraphBLAS/Test/GB_mex_reduce_terminal.c index ce754492a3..78c2baf89d 100644 --- a/GraphBLAS/Test/GB_mex_reduce_terminal.c +++ b/GraphBLAS/Test/GB_mex_reduce_terminal.c @@ -2,7 +2,7 @@ // GB_mex_reduce_terminal: [c,flag] = sum(A), reduce to scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_reduce_to_GrB_Scalar.c b/GraphBLAS/Test/GB_mex_reduce_to_GrB_Scalar.c index 5e46760c68..fa8424832d 100644 --- a/GraphBLAS/Test/GB_mex_reduce_to_GrB_Scalar.c +++ b/GraphBLAS/Test/GB_mex_reduce_to_GrB_Scalar.c @@ -2,7 +2,7 @@ // GB_mex_reduce_to_GrB_Scalar: S = accum(S,reduce_to_scalar(A)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -56,7 +56,7 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("S failed") ; } - int64_t Snrows, Sncols ; + uint64_t Snrows, Sncols ; GrB_Matrix_nrows (&Snrows, S) ; GrB_Matrix_ncols (&Sncols, S) ; if (Snrows != 1 || Sncols != 1) diff --git a/GraphBLAS/Test/GB_mex_reduce_to_scalar.c b/GraphBLAS/Test/GB_mex_reduce_to_scalar.c index 50d4783e98..9383aeaa44 100644 --- a/GraphBLAS/Test/GB_mex_reduce_to_scalar.c +++ b/GraphBLAS/Test/GB_mex_reduce_to_scalar.c @@ -2,7 +2,7 @@ // GB_mex_reduce_to_scalar: c = accum(c,reduce_to_scalar(A)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_reduce_to_vector.c b/GraphBLAS/Test/GB_mex_reduce_to_vector.c index f6815cc5f1..fbd9fda3e5 100644 --- a/GraphBLAS/Test/GB_mex_reduce_to_vector.c +++ b/GraphBLAS/Test/GB_mex_reduce_to_vector.c @@ -2,7 +2,7 @@ // GB_mex_reduce_to_vector: c = accum(c,reduce_to_vector(A)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_reduce_with_zombies.c b/GraphBLAS/Test/GB_mex_reduce_with_zombies.c new file mode 100644 index 0000000000..52bfbe342e --- /dev/null +++ b/GraphBLAS/Test/GB_mex_reduce_with_zombies.c @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// GB_mex_reduce_with_zombies: sum up the entries in a matrix with zombies +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#define USAGE "s = GB_mex_reduce_with_zombies (A)" + +#define FREE_ALL \ +{ \ + GrB_Matrix_free_(&A) ; \ + GB_mx_put_global (true) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + uint64_t nvals = 0 ; + + // check inputs + if (nargout > 1 || nargin > 1) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + // get a deep copy of the input matrix + A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", true, true) ; + OK (GxB_Matrix_fprint (A, "A without zombies", GxB_SILENT, NULL)) ; + + // ensure the matrix is sparse, by column + OK (GrB_Matrix_set_INT32 (A, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (A, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_nvals (&nvals, A)) ; + + // make every other entry a zombie + uint64_t nzombies = 0 ; + if (A->i_is_32) + { + uint32_t *Ai = A->i ; + for (int64_t k = 0 ; k < nvals ; k += 2) + { + Ai [k] = ~(Ai [k]) ; + nzombies++ ; + } + } + else + { + uint64_t *Ai = A->i ; + for (int64_t k = 0 ; k < nvals ; k += 2) + { + Ai [k] = ~(Ai [k]) ; + nzombies++ ; + } + } + A->nzombies = nzombies ; + OK (GxB_Matrix_fprint (A, "A with zombies", GxB_SILENT, NULL)) ; + + // sum up the entries, excluding the zombies + double result = 0 ; + OK (GrB_Matrix_reduce_FP64 (&result, NULL, GrB_PLUS_MONOID_FP64, A, NULL)) ; + + // free workspace return the result + pargout [0] = mxCreateDoubleScalar (result) ; + FREE_ALL ; +} + diff --git a/GraphBLAS/Test/GB_mex_reshape.c b/GraphBLAS/Test/GB_mex_reshape.c index adce1eddb3..51084b2bf1 100644 --- a/GraphBLAS/Test/GB_mex_reshape.c +++ b/GraphBLAS/Test/GB_mex_reshape.c @@ -2,7 +2,7 @@ // GB_mex_reshape: reshape a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,10 +38,10 @@ void mexFunction #define FREE_DEEP_COPY GrB_Matrix_free_(&C) ; - GrB_Index nrows_new = (GrB_Index) mxGetScalar (pargin [1]) ; - GrB_Index ncols_new = (GrB_Index) mxGetScalar (pargin [2]) ; - bool by_col = (bool ) mxGetScalar (pargin [3]) ; - bool in_place = (bool ) mxGetScalar (pargin [4]) ; + uint64_t nrows_new = (uint64_t) mxGetScalar (pargin [1]) ; + uint64_t ncols_new = (uint64_t) mxGetScalar (pargin [2]) ; + bool by_col = (bool ) mxGetScalar (pargin [3]) ; + bool in_place = (bool ) mxGetScalar (pargin [4]) ; // reshape the matrix if (in_place) diff --git a/GraphBLAS/Test/GB_mex_resize.c b/GraphBLAS/Test/GB_mex_resize.c index d993b32302..c88b6ffa1f 100644 --- a/GraphBLAS/Test/GB_mex_resize.c +++ b/GraphBLAS/Test/GB_mex_resize.c @@ -2,7 +2,7 @@ // GB_mex_resize: resize a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_select.c b/GraphBLAS/Test/GB_mex_select.c index fefc88488d..d369850758 100644 --- a/GraphBLAS/Test/GB_mex_select.c +++ b/GraphBLAS/Test/GB_mex_select.c @@ -2,7 +2,7 @@ // GB_mex_select: C = accum(C,select(A,k)) or select(A',k) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -24,21 +24,12 @@ GB_mx_put_global (true) ; \ } -#if 0 -bool isnan64 (GrB_Index i, GrB_Index j, const void *x, const void *b) ; -bool isnan64 (GrB_Index i, GrB_Index j, const void *x, const void *b) -{ - double aij = * ((double *) x) ; - return (isnan (aij)) ; -} -#else -void isnan64 (bool *z, const void *x, GrB_Index i, GrB_Index j, const void *b) ; -void isnan64 (bool *z, const void *x, GrB_Index i, GrB_Index j, const void *b) +void isnan64 (bool *z, const void *x, uint64_t i, uint64_t j, const void *b) ; +void isnan64 (bool *z, const void *x, uint64_t i, uint64_t j, const void *b) { double aij = * ((double *) x) ; (*z) = (isnan (aij)) ; } -#endif void mexFunction ( @@ -67,7 +58,7 @@ void mexFunction #define GET_DEEP_COPY \ C = GB_mx_mxArray_to_Matrix (pargin [0], "C input", true, true) ; \ if (nargin > 7 && C != NULL) C->nvec_nonempty = -1 ; \ - GrB_set (C, false, (GrB_Field) GxB_HYPER_HASH) ; + GrB_set (C, false, GxB_HYPER_HASH) ; #define FREE_DEEP_COPY GrB_Matrix_free_(&C) ; GET_DEEP_COPY ; if (C == NULL) diff --git a/GraphBLAS/Test/GB_mex_select_idxunop.c b/GraphBLAS/Test/GB_mex_select_idxunop.c index 56e9c8c29f..b8c1ed8f58 100644 --- a/GraphBLAS/Test/GB_mex_select_idxunop.c +++ b/GraphBLAS/Test/GB_mex_select_idxunop.c @@ -2,7 +2,7 @@ // GB_mex_select_idxunop: C = accum(C,select(A,y)) or select(A',y) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -260,11 +260,11 @@ void mexFunction FREE_ALL ; mexErrMsgTxt ("scalar failed") ; } - GrB_Index snrows, sncols, snvals ; + uint64_t snrows, sncols, snvals ; GrB_Matrix_nrows (&snrows, S) ; GrB_Matrix_ncols (&sncols, S) ; GrB_Matrix_nvals (&snvals, S) ; - GxB_Format_Value fmt ; + int fmt ; GxB_Matrix_Option_get_(S, GxB_FORMAT, &fmt) ; if (snrows != 1 || sncols != 1 || snvals != 1 || fmt != GxB_BY_COL) { diff --git a/GraphBLAS/Test/GB_mex_semiring.c b/GraphBLAS/Test/GB_mex_semiring.c index db7ede33b9..f11acaf4ae 100644 --- a/GraphBLAS/Test/GB_mex_semiring.c +++ b/GraphBLAS/Test/GB_mex_semiring.c @@ -2,7 +2,7 @@ // GB_mex_semiring: parse a semiring, for testing; returns nothing //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_serialize.c b/GraphBLAS/Test/GB_mex_serialize.c index ca30a0cfec..3d984b8fe9 100644 --- a/GraphBLAS/Test/GB_mex_serialize.c +++ b/GraphBLAS/Test/GB_mex_serialize.c @@ -2,7 +2,7 @@ // GB_mex_serialize: copy a matrix, using serialize/deserialize //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ void mexFunction GrB_Matrix A = NULL, C = NULL ; GrB_Descriptor desc = NULL ; void *blob = NULL ; - GrB_Index blob_size = 0 ; + uint64_t blob_size = 0 ; // check inputs if (nargout > 1 || nargin < 1 || nargin > 3) @@ -133,6 +133,7 @@ void mexFunction GxB_Matrix_type_name (type_name1, C) ; GxB_Matrix_type_name (type_name2, A) ; GxB_deserialize_type_name (type_name3, blob, blob_size) ; +// printf ("\n[%s]\n[%s]\n[%s]\n", type_name1, type_name2, type_name3) ; CHECK (MATCH (type_name1, type_name2)) ; CHECK (MATCH (type_name1, type_name3)) ; diff --git a/GraphBLAS/Test/GB_mex_setElement.c b/GraphBLAS/Test/GB_mex_setElement.c index 39d695f923..822fc0eb84 100644 --- a/GraphBLAS/Test/GB_mex_setElement.c +++ b/GraphBLAS/Test/GB_mex_setElement.c @@ -2,7 +2,7 @@ // GB_mex_setElement: interface for A(i,j) = x //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,7 +38,7 @@ GrB_Type xtype = NULL ; #define setEl(prefix,name,type) \ GrB_Info set_ ## name \ -(GrB_Matrix A, type *X, GrB_Index *I, GrB_Index *J, GrB_Index ni) \ +(GrB_Matrix A, type *X, uint64_t *I, uint64_t *J, uint64_t ni) /* OK */ \ { \ GrB_Info info ; \ GrB_Scalar Scalar = NULL ; \ @@ -109,7 +109,7 @@ setEl (GrB_, UDT , GxB_FC64_t) ; #define vsetEl(prefix,name,type) \ GrB_Info vset_ ## name \ -(GrB_Matrix A, type *X, GrB_Index *I, GrB_Index ni) \ +(GrB_Matrix A, type *X, uint64_t *I, uint64_t ni) /* OK */ \ { \ GrB_Info info ; \ GrB_Scalar Scalar = NULL ; \ @@ -183,8 +183,8 @@ void mexFunction GrB_Matrix A = NULL ; GB_void *Y ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; // OK; 64-bit only + uint64_t *J = NULL, nj = 0, J_range [3] ; // OK; 64-bit only bool is_list ; // check inputs @@ -205,24 +205,28 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("I is invalid; must be a list") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &is_list)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &is_list, + NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; } if (!is_list) { + FREE_ALL ; mexErrMsgTxt ("J is invalid; must be a list") ; } diff --git a/GraphBLAS/Test/GB_mex_split.c b/GraphBLAS/Test/GB_mex_split.c index e7082bde29..4bec18c14e 100644 --- a/GraphBLAS/Test/GB_mex_split.c +++ b/GraphBLAS/Test/GB_mex_split.c @@ -2,7 +2,7 @@ // GB_mex_split: C = split (Tiles) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -62,11 +62,11 @@ void mexFunction mexErrMsgTxt ("ms must be double") ; } double *ms_double = mxGetDoubles (pargin [1]) ; - GrB_Index m = mxGetNumberOfElements (pargin [1]) ; - GrB_Index *Tile_nrows = mxMalloc (m * sizeof (GrB_Index)) ; + uint64_t m = mxGetNumberOfElements (pargin [1]) ; + uint64_t *Tile_nrows = mxMalloc (m * sizeof (uint64_t)) ; for (int64_t k = 0 ; k < m ; k++) { - Tile_nrows [k] = (GrB_Index) (ms_double [k]) ; + Tile_nrows [k] = (uint64_t) (ms_double [k]) ; } // get ns (deep copy) @@ -75,11 +75,11 @@ void mexFunction mexErrMsgTxt ("ns must be double") ; } double *ns_double = mxGetDoubles (pargin [2]) ; - GrB_Index n = mxGetNumberOfElements (pargin [2]) ; - GrB_Index *Tile_ncols = mxMalloc (n * sizeof (GrB_Index)) ; + uint64_t n = mxGetNumberOfElements (pargin [2]) ; + uint64_t *Tile_ncols = mxMalloc (n * sizeof (uint64_t)) ; for (int64_t k = 0 ; k < n ; k++) { - Tile_ncols [k] = (GrB_Index) (ns_double [k]) ; + Tile_ncols [k] = (uint64_t) (ns_double [k]) ; } // create Tiles diff --git a/GraphBLAS/Test/GB_mex_subassign.c b/GraphBLAS/Test/GB_mex_subassign.c index 675b14946c..5768c08148 100644 --- a/GraphBLAS/Test/GB_mex_subassign.c +++ b/GraphBLAS/Test/GB_mex_subassign.c @@ -2,7 +2,7 @@ // GB_mex_subassign: C(I,J) = accum (C (I,J), A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This function is a wrapper for all GxB_*_subassign functions. @@ -35,7 +35,8 @@ #include "GB_mex.h" #define USAGE "[C,s,t] = GB_mex_subassign " \ - "(C, M, accum, A, I, J, desc, reduce) or (C, Work, control)" + "(C, M, accum, A, I, J, desc, reduce) or (C, Work, control)" \ + "or C = GB_mex_subassign (C, M, accum, A, I, J, desc, kind)" #define FREE_ALL \ { \ @@ -48,6 +49,8 @@ GrB_Matrix_free_(&C) ; \ if (C_is_M) M = NULL ; \ GrB_Matrix_free_(&M) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ GrB_Descriptor_free_(&desc) ; \ if (!user_complex) GrB_Monoid_free_(&reduce) ; \ GB_mx_put_global (true) ; \ @@ -83,8 +86,9 @@ GrB_Matrix A = NULL ; GrB_Matrix mask = NULL, u = NULL ; GrB_Descriptor desc = NULL ; GrB_BinaryOp accum = NULL ; -GrB_Index *I = NULL, ni = 0, I_range [3] ; -GrB_Index *J = NULL, nj = 0, J_range [3] ; +uint64_t *I = NULL, ni = 0, I_range [3] ; GrB_Vector I_vector = NULL ; +uint64_t *J = NULL, nj = 0, J_range [3] ; GrB_Vector J_vector = NULL ; +int kind = 0 ; bool ignore ; bool malloc_debug = false ; GrB_Info info = GrB_SUCCESS ; @@ -139,32 +143,83 @@ GrB_Info assign (void) ASSERT_BINARYOP_OK_OR_NULL (accum, "accum for mex assign", pr) ; ASSERT_MATRIX_OK (A, "A for mex assign", pr) ; - if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && use_GrB_Scalar) + + if (kind == 3) { - // use GxB_Matrix_subassign_Scalar or GxB_Vector_subassign_Scalar - GrB_Scalar S = (GrB_Scalar) A ; + + //---------------------------------------------------------------------- + // test GxB_*_subassign_Vector, with GrB_Vectors as I and J + //---------------------------------------------------------------------- + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (M)) { - OK (GxB_Vector_subassign_Scalar ((GrB_Vector) C, (GrB_Vector) M, - accum, S, I, ni, desc)) ; + OK (GxB_Vector_subassign_Vector_((GrB_Vector) C, (GrB_Vector) M, + accum, (GrB_Vector) A, I_vector, desc)) ; } else { - OK (GxB_Matrix_subassign_Scalar ((GrB_Matrix) C, (GrB_Matrix) M, - accum, S, I, ni, J, nj, desc)) ; + OK (GxB_Matrix_subassign_Vector_((GrB_Matrix) C, (GrB_Matrix) M, + accum, A, I_vector, J_vector, desc)) ; + } + + } + else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && + ((use_GrB_Scalar && kind == 0) || kind == 4)) + { + + //---------------------------------------------------------------------- + // use GxB_Matrix_subassign_Scalar or GxB_Vector_subassign_Scalar + //---------------------------------------------------------------------- + + GrB_Scalar S = (GrB_Scalar) A ; + + if (kind == 0) + { + + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (M)) + { + OK (GxB_Vector_subassign_Scalar_((GrB_Vector) C, (GrB_Vector) M, + accum, S, I, ni, desc)) ; + } + else + { + OK (GxB_Matrix_subassign_Scalar_((GrB_Matrix) C, (GrB_Matrix) M, + accum, S, I, ni, J, nj, desc)) ; + } + } + else + { + if (GB_VECTOR_OK (C) && GB_VECTOR_OK (M)) + { + OK (GxB_Vector_subassign_Scalar_Vector_((GrB_Vector) C, + (GrB_Vector) M, accum, S, I_vector, desc)) ; + } + else + { + OK (GxB_Matrix_subassign_Scalar_Vector_((GrB_Matrix) C, + (GrB_Matrix) M, + accum, S, I_vector, J_vector, desc)) ; + } + } } - else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && GB_nnz (A) == 1) + else if (GB_NROWS (A) == 1 && GB_NCOLS (A) == 1 && GB_nnz (A) == 1 + && kind == 0) { + GB_void *Ax = A->x ; // OK: A is a scalar with exactly one entry if (ni == 1 && nj == 1 && M == NULL && I != GrB_ALL && J != GrB_ALL && GB_op_is_second (accum, C->type) && A->type->code <= GB_FC64_code && desc == NULL) { - if (ph) printf ("setElement\n") ; + + //------------------------------------------------------------------ // test GrB_Matrix_setElement + //------------------------------------------------------------------ + + if (ph) printf ("setElement\n") ; #define ASSIGN(prefix,suffix,type) \ { \ type x = ((type *) Ax) [0] ; \ @@ -199,7 +254,10 @@ GrB_Info assign (void) else if (GB_VECTOR_OK (C) && GB_VECTOR_OK (M)) { + //------------------------------------------------------------------ // test GxB_Vector_subassign_scalar functions + //------------------------------------------------------------------ + if (ph) printf ("scalar assign to vector\n") ; #define ASSIGN(suffix,type) \ { \ @@ -243,7 +301,10 @@ GrB_Info assign (void) else { + //------------------------------------------------------------------ // test Matrix_subassign_scalar functions + //------------------------------------------------------------------ + if (ph) printf ("scalar assign to matrix\n") ; #define ASSIGN(suffix,type) \ { \ @@ -281,35 +342,68 @@ GrB_Info assign (void) mexErrMsgTxt ("unsupported type") ; } #undef ASSIGN - } + } else if (GB_VECTOR_OK (C) && GB_VECTOR_OK (A) && (M == NULL || GB_VECTOR_OK (M)) && !at) { - // test GxB_Vector_subassign + + //---------------------------------------------------------------------- + // test GxB_Vector_subassign and GxB_Vector_subassign_Vector + //---------------------------------------------------------------------- + if (ph) printf ("vector assign\n") ; - OK (GxB_Vector_subassign_((GrB_Vector) C, (GrB_Vector) M, accum, - (GrB_Vector) A, I, ni, desc)) ; + if (kind >= 3) + { + OK (GxB_Vector_subassign_Vector_((GrB_Vector) C, (GrB_Vector) M, + accum, (GrB_Vector) A, I_vector, desc)) ; + } + else + { + OK (GxB_Vector_subassign_((GrB_Vector) C, (GrB_Vector) M, accum, + (GrB_Vector) A, I, ni, desc)) ; + } + } else if (GB_VECTOR_OK (A) && nj == 1 && (M == NULL || GB_VECTOR_OK (M)) && !at) { + + //---------------------------------------------------------------------- // test GxB_Col_subassign + //---------------------------------------------------------------------- + if (ph) printf ("col assign\n") ; - OK (GxB_Col_subassign_(C, (GrB_Vector) M, accum, (GrB_Vector) A, - I, ni, J [0], desc)) ; + + if (kind >= 3) + { + uint64_t j0 ; + OK (GrB_Vector_extractElement (&j0, J_vector, 0)) ; + OK (GxB_Col_subassign_Vector_(C, (GrB_Vector) M, accum, + (GrB_Vector) A, I_vector, j0, desc)) ; + } + else + { + OK (GxB_Col_subassign_(C, (GrB_Vector) M, accum, (GrB_Vector) A, + I, ni, J [0], desc)) ; + } + } else if (A->vlen == 1 && ni == 1 && nj > 0 && (M == NULL || M->vlen == 1) && !at) { - // test GxB_Row_subassign; this is not meant to be efficient, - // just for testing + + //---------------------------------------------------------------------- + // test GxB_Row_subassign/GxB_Row_subassign_Vector + //---------------------------------------------------------------------- + + // This not efficient, it is just for testing if (ph) printf ("row assign\n") ; if (M != NULL) { // mask = M' - int64_t mnrows, mncols ; + uint64_t mnrows, mncols ; OK (GrB_Matrix_nrows (&mnrows, M)) ; OK (GrB_Matrix_ncols (&mncols, M)) ; OK (GrB_Matrix_new (&mask, M->type, mncols, mnrows)) ; @@ -318,23 +412,46 @@ GrB_Info assign (void) ASSERT (GB_VECTOR_OK (mask)) ; } // u = A' - int64_t ancols, anrows ; + uint64_t ancols, anrows ; OK (GrB_Matrix_nrows (&anrows, A)) ; OK (GrB_Matrix_ncols (&ancols, A)) ; OK (GrB_Matrix_new (&u, A->type, ancols, anrows)) ; OK (GrB_transpose (u, NULL, NULL, A, NULL)) ; u->is_csc = true ; ASSERT (GB_VECTOR_OK (u)) ; - OK (GxB_Row_subassign_(C, (GrB_Vector) mask, accum, (GrB_Vector) u, - I [0], J, nj, desc)) ; + if (kind == 0) + { + OK (GxB_Row_subassign_(C, (GrB_Vector) mask, accum, + (GrB_Vector) u, I [0], J, nj, desc)) ; + } + else + { + uint64_t i0 ; + OK (GrB_Vector_extractElement (&i0, I_vector, 0)) ; + OK (GxB_Row_subassign_Vector_(C, (GrB_Vector) mask, accum, + (GrB_Vector) u, i0, J_vector, desc)) ; + } GrB_Matrix_free_(&mask) ; GrB_Matrix_free_(&u) ; + } else { + + //---------------------------------------------------------------------- // standard submatrix assignment + //---------------------------------------------------------------------- + if (ph) printf ("submatrix assign\n") ; - OK (GxB_Matrix_subassign_(C, M, accum, A, I, ni, J, nj, desc)) ; + if (kind >= 3) + { + OK (GxB_Matrix_subassign_Vector_(C, M, accum, A, + I_vector, J_vector, desc)) ; + } + else + { + OK (GxB_Matrix_subassign_(C, M, accum, A, I, ni, J, nj, desc)) ; + } } ASSERT_MATRIX_OK (C, "C after assign", pr) ; @@ -422,7 +539,7 @@ GrB_Info many_subassign // get I p = mxGetFieldByNumber (pargin [1], k, fI) ; - if (!GB_mx_mxArray_to_indices (&I, p, &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (p, &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; @@ -430,7 +547,7 @@ GrB_Info many_subassign // get J p = mxGetFieldByNumber (pargin [1], k, fJ) ; - if (!GB_mx_mxArray_to_indices (&J, p, &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (p, &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -524,7 +641,7 @@ void mexFunction reduce = NULL ; if (!((nargout == 1 && (nargin == 2 || nargin == 3 || - nargin == 6 || nargin == 7)) || + nargin == 6 || nargin == 7 || nargin == 8)) || ((nargout == 2 || nargout == 3) && nargin == 8))) { GB_mx_put_global (true) ; @@ -640,20 +757,39 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + // get kind (if >= 3: matrix/vector with I and J as GrB_Vectors) + kind = 0 ; + if (nargin > 7 && nargout == 1) + { + kind = (int) mxGetScalar (pargin [7]) ; + } + + // get I: may be a GrB_Vector + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + (kind >= 3) ? (&I_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } - // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (I_vector != NULL) + { + GrB_Vector_size (&ni, I_vector) ; + } + + // get J: may be a GrB_Vector + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + (kind >= 3) ? (&J_vector) : NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; } + if (J_vector != NULL) + { + GrB_Vector_size (&nj, J_vector) ; + } + // get desc if (!GB_mx_mxArray_to_Descriptor (&desc, PARGIN (6), "desc")) { diff --git a/GraphBLAS/Test/GB_mex_subassign_alias.c b/GraphBLAS/Test/GB_mex_subassign_alias.c index 421565ffbd..9ed78e70d2 100644 --- a/GraphBLAS/Test/GB_mex_subassign_alias.c +++ b/GraphBLAS/Test/GB_mex_subassign_alias.c @@ -2,7 +2,7 @@ // GB_mex_subassign_alias: C(:,:) = accum(C(:,:),C) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -65,7 +65,7 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, C) ; GrB_Matrix_ncols (&ncols, C) ; diff --git a/GraphBLAS/Test/GB_mex_subassign_scalar.c b/GraphBLAS/Test/GB_mex_subassign_scalar.c index d7c8d677c1..d59adef517 100644 --- a/GraphBLAS/Test/GB_mex_subassign_scalar.c +++ b/GraphBLAS/Test/GB_mex_subassign_scalar.c @@ -2,20 +2,22 @@ // GB_mex_subassign_scalar: C(I,J) = accum (C (I,J), Scalar) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ #include "GB_mex.h" -#define USAGE "C = GB_mex_subassign_scalar(C,Mask,acc,S,I,J,desc)" +#define USAGE "C = GB_mex_subassign_scalar(C,Mask,acc,S,I,J,desc,kind)" #define FREE_ALL \ { \ GrB_Matrix_free_(&A) ; \ GrB_Matrix_free_(&Mask) ; \ GrB_Matrix_free_(&C) ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -30,8 +32,8 @@ GrB_Matrix Mask = NULL ; GrB_Matrix A = NULL ; GrB_Descriptor desc = NULL ; GrB_BinaryOp accum = NULL ; -GrB_Index *I = NULL, ni = 0, I_range [3] ; -GrB_Index *J = NULL, nj = 0, J_range [3] ; +uint64_t *I = NULL, ni = 0, I_range [3] ; GrB_Vector I_vector = NULL ; +uint64_t *J = NULL, nj = 0, J_range [3] ; GrB_Vector J_vector = NULL ; bool ignore ; bool malloc_debug = false ; GrB_Info info = GrB_SUCCESS ; @@ -84,7 +86,7 @@ void mexFunction desc = NULL ; // check inputs - if (nargout > 1 || nargin != 7 ) + if (nargout > 1 || !(nargin == 7 || nargin == 8)) { mexErrMsgTxt ("Usage: " USAGE) ; } @@ -128,15 +130,22 @@ void mexFunction mexErrMsgTxt ("accum failed") ; } + // get kind: + // 0: use uint64_t * arrays for I and J + // else: use GrB_Vector variants + int GET_SCALAR (7, int, kind, 0) ; + // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [4], &I, &ni, I_range, &ignore, + (kind == 0) ? NULL: (&I_vector))) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [5], &J, &nj, J_range, &ignore, + (kind == 0) ? NULL: (&J_vector))) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -153,13 +162,29 @@ void mexFunction GrB_Scalar S = (GrB_Scalar) A ; if (GB_VECTOR_OK (C) && (Mask == NULL || GB_VECTOR_OK (Mask))) { - METHOD (GxB_Vector_subassign_Scalar ((GrB_Vector) C, (GrB_Vector) Mask, - accum, S, I, ni, desc)) ; + if (kind == 0) + { + METHOD (GxB_Vector_subassign_Scalar_((GrB_Vector) C, (GrB_Vector) Mask, + accum, S, I, ni, desc)) ; + } + else + { + METHOD (GxB_Vector_subassign_Scalar_Vector_((GrB_Vector) C, + (GrB_Vector) Mask, accum, S, I_vector, desc)) ; + } } else { - METHOD (GxB_Matrix_subassign_Scalar ((GrB_Matrix) C, (GrB_Matrix) Mask, - accum, S, I, ni, J, nj, desc)) ; + if (kind == 0) + { + METHOD (GxB_Matrix_subassign_Scalar_((GrB_Matrix) C, (GrB_Matrix) Mask, + accum, S, I, ni, J, nj, desc)) ; + } + else + { + METHOD (GxB_Matrix_subassign_Scalar_Vector_((GrB_Matrix) C, + (GrB_Matrix) Mask, accum, S, I_vector, J_vector, desc)) ; + } } //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_subref_symbolic.c b/GraphBLAS/Test/GB_mex_subref_symbolic.c index 64332ce43e..d5807422e0 100644 --- a/GraphBLAS/Test/GB_mex_subref_symbolic.c +++ b/GraphBLAS/Test/GB_mex_subref_symbolic.c @@ -2,7 +2,7 @@ // GB_mex_subref_symbolic: S=A(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,12 +27,12 @@ void mexFunction ) { struct GB_Matrix_opaque C_header ; - GrB_Matrix C = GB_clear_static_header (&C_header) ; + GrB_Matrix C = GB_clear_matrix_header (&C_header) ; bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, ni = 0, I_range [3] ; + uint64_t *J = NULL, nj = 0, J_range [3] ; bool ignore ; // check inputs @@ -54,14 +54,14 @@ void mexFunction } // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [1], &ni, I_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [1], &I, &ni, I_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("I failed") ; } // get J - if (!GB_mx_mxArray_to_indices (&J, pargin [2], &nj, J_range, &ignore)) + if (!GB_mx_mxArray_to_indices (pargin [2], &J, &nj, J_range, &ignore, NULL)) { FREE_ALL ; mexErrMsgTxt ("J failed") ; @@ -75,8 +75,12 @@ void mexFunction mexErrMsgTxt ("A failed: cannot be bitmap") ; } + bool I_is_32 = false ; + bool J_is_32 = false ; + // C = A(I,J) or A(J,I)', no need to check dimensions of C; symbolic - METHOD (GB_subref (C, false, true, A, I, ni, J, nj, true, Werk)) ; + METHOD (GB_subref (C, false, true, A, I, I_is_32, ni, J, J_is_32, nj, + true, Werk)) ; // return C as a struct pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C subref symbolic", true) ; diff --git a/GraphBLAS/Test/GB_mex_test0.c b/GraphBLAS/Test/GB_mex_test0.c index 3889ca6a42..6db9cacd84 100644 --- a/GraphBLAS/Test/GB_mex_test0.c +++ b/GraphBLAS/Test/GB_mex_test0.c @@ -2,7 +2,7 @@ // GB_mex_test0: test error handling //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -90,8 +90,8 @@ void f3 (GxB_FC64_t *z, const GxB_FC64_t *x, const double *y) (*z) = GB_FC64_add ((*x), GB_CMPLX64 (0,(*y))) ; } -bool fselect (GrB_Index i, GrB_Index j, const double *x, const double *k) ; -bool fselect (GrB_Index i, GrB_Index j, const double *x, const double *k) +bool fselect (uint64_t i, uint64_t j, const double *x, const double *k) ; +bool fselect (uint64_t i, uint64_t j, const double *x, const double *k) { // select entries in triu(A) that are greater than k int64_t i2 = (int64_t) i ; @@ -159,14 +159,14 @@ void mexFunction semiring2 = NULL ; GrB_Descriptor desc = NULL, dcrud = NULL, d0 = NULL, dnt = NULL, dtn = NULL, dtt = NULL, descb = NULL ; - GrB_Desc_Value dval ; - GrB_Index n = 0, nvals = 0, n2 = 0, i = 0, j = 0, a, b, uvals = 0 ; - GrB_Index *I0 = NULL, *J0 = NULL ; + int dval ; + uint64_t n = 0, nvals = 0, n2 = 0, i = 0, j = 0, a, b, uvals = 0 ; + uint64_t *I0 = NULL, *J0 = NULL ; // OK #define LEN 100 - GrB_Index I [5] = { 0, 7, 8, 3, 2 }, I2 [LEN] ; - GrB_Index J [5] = { 4, 1, 2, 2, 1 }, J2 [LEN] ; - double X [5] = { 4.5, 8.2, 9.1, -1.2, 3.14159 }, X2 [LEN] ; - GB_Pending AP = NULL ; + uint64_t I [5] = { 0, 7, 8, 3, 2 }, I2 [LEN] ; // OK + uint64_t J [5] = { 4, 1, 2, 2, 1 }, J2 [LEN] ; // OK + double X [5] = { 4.5, 8.2, 9.1, -1.2, 3.14159 }, X2 [LEN] ; + GB_Pending A_Pending = NULL ; size_t s ; bool x_bool, ok ; @@ -494,52 +494,6 @@ void mexFunction #undef FREE_DEEP_COPY #undef GET_DEEP_COPY - //-------------------------------------------------------------------------- - // SelectOp - //-------------------------------------------------------------------------- - -#if 0 -// GxB_SelectOp selectop = NULL, selectopcrud = NULL, sel0 ; - printf ("GxB_SelectOp-------------------------------------------------\n") ; - CHECK (selectop == NULL) ; - OK (GxB_SelectOp_new (&selectop, (GxB_select_function) fselect, GrB_FP64, GrB_FP64)) ; - OK (GxB_SelectOp_free_(&selectop)) ; - CHECK (selectop == NULL) ; - - expected = GrB_NULL_POINTER ; - - CHECK (T == NULL) ; - ERR (GxB_SelectOp_xtype (&T, selectop)) ; - CHECK (T == NULL) ; - - CHECK (T == NULL) ; - ERR (GxB_SelectOp_ttype (&T, selectop)) ; - CHECK (T == NULL) ; - - CHECK (selectop == NULL) ; - OK (GxB_SelectOp_new (&selectop, (GxB_select_function) fselect, GrB_FP64, GrB_FP64)) ; - - CHECK (T == NULL) ; - OK (GxB_SelectOp_xtype (&T, selectop)) ; - CHECK (T == GrB_FP64) ; - T = NULL ; - - CHECK (T == NULL) ; - OK (GxB_SelectOp_ttype (&T, selectop)) ; - CHECK (T == GrB_FP64) ; - T = NULL ; - - OK (GxB_SelectOp_free_(&selectop)) ; - CHECK (selectop == NULL) ; - - expected = GrB_NULL_POINTER ; - ERR (GxB_SelectOp_new (&selectop, NULL, GrB_FP64, GrB_FP64)) ; - CHECK (selectop == NULL) ; - - OK (GxB_SelectOp_free_(&selectop)) ; - CHECK (selectop == NULL) ; -#endif - //-------------------------------------------------------------------------- // Monoid //-------------------------------------------------------------------------- @@ -846,11 +800,14 @@ void mexFunction GxB_Scalar_fprint_(a_scalar, 3, NULL) ; // force a zombie + GB_MDECL (Ai, , ) ; i_scalar = 33 ; bool scalar_is_full = GB_IS_FULL (a_scalar) ; if (!scalar_is_full) { - a_scalar->i [0] = GB_ZOMBIE (0) ; + Ai = a_scalar->i ; + GB_IPTR (Ai, a_scalar->i_is_32) ; + GB_ISET (Ai, 0, i) ; // Ai [0] = i a_scalar->nzombies = 1 ; } @@ -925,15 +882,13 @@ void mexFunction ERR (GrB_Vector_dup (NULL, NULL)) ; ERR (GrB_Vector_dup (NULL, v)) ; - ERR (GrB_Vector_dup (NULL, vcrud)) ; ERR (GrB_Vector_dup (NULL, vempty)) ; ERR (GrB_Vector_clear (NULL)) ; - + ERR (GrB_Vector_dup (NULL, vcrud)) ; ERR (GrB_Vector_dup (&u, NULL)) ; CHECK (u == NULL) ; expected = GrB_UNINITIALIZED_OBJECT ; - ERR (GrB_Vector_dup (&u, vcrud)) ; CHECK (u == NULL) ; @@ -952,7 +907,6 @@ void mexFunction CHECK (n == 32) ; expected = GrB_UNINITIALIZED_OBJECT ; - nvals = 7 ; ERR (GrB_Vector_dup (&u, vcrud)) ; ERR (GrB_Vector_nvals (&nvals, vcrud)) ; @@ -1065,8 +1019,6 @@ void mexFunction OK (GrB_Vector_new (&v, GrB_FP64, 10)) ; ERR1 (v, GrB_Vector_build_FP64 (v, I, NULL, 0, NULL)) ; -// dup NULL is now OK -// ERR1 (v, GrB_Vector_build_FP64_(v, I, X, 0, NULL)) ; expected = GrB_INVALID_VALUE ; o2 = GrB_SECOND_FP64 ; @@ -1085,7 +1037,6 @@ void mexFunction printf ("build udt:\n") ; OK (GrB_Vector_free_(&v)) ; GrB_Type user_type = NULL ; -// OK (GrB_Type_new (&user_type, sizeof (user_int))) ; OK (GxB_Type_new (&user_type, sizeof (user_int), "user_int", "typedef int16_t user_int ;")) ; OK (GrB_Vector_new (&v, user_type, 10)) ; @@ -1396,18 +1347,15 @@ void mexFunction CHECK (C == NULL) ; expected = GrB_NULL_POINTER ; - ERR (GrB_Matrix_dup (NULL, NULL)) ; ERR (GrB_Matrix_dup (NULL, A)) ; - ERR (GrB_Matrix_dup (NULL, Acrud)) ; ERR (GrB_Matrix_dup (NULL, Aempty)) ; ERR (GrB_Matrix_clear (NULL)) ; - + ERR (GrB_Matrix_dup (NULL, Acrud)) ; ERR (GrB_Matrix_dup (&C, NULL)) ; CHECK (C == NULL) ; expected = GrB_UNINITIALIZED_OBJECT ; - ERR (GrB_Matrix_nrows (&n, Acrud)) ; ERR (GrB_Matrix_ncols (&n, Acrud)) ; ERR (GrB_Matrix_nvals (&n, Acrud)) ; @@ -1417,7 +1365,6 @@ void mexFunction OK (GrB_Matrix_clear (A)) ; expected = GrB_NULL_POINTER ; - n = 999 ; ERR (GrB_Matrix_nrows (NULL, NULL)) ; ERR (GrB_Matrix_nrows (NULL, A)) ; @@ -1531,8 +1478,6 @@ void mexFunction ERR1 (A, GrB_Matrix_build_FP64 (A, I, NULL, NULL, 0, NULL)) ; ERR1 (A, GrB_Matrix_build_FP64 (A, NULL, NULL, NULL, 0, NULL)) ; ERR1 (A, GrB_Matrix_build_FP64 (A, I, J, NULL, 0, NULL)) ; -// dup of NULL is now OK -// ERR1 (A, GrB_Matrix_build_FP64_(A, I, J, X, 0, NULL)) ; expected = GrB_INVALID_VALUE ; @@ -1818,16 +1763,25 @@ void mexFunction GrB_Descriptor dnull = NULL ; + expected = GrB_INVALID_VALUE ; ERRD (dnull, GxB_Desc_set (dnull, 0, 0)) ; + + expected = GrB_NULL_POINTER ; ERR (GxB_Desc_get (dnull, 0, NULL)) ; + expected = GrB_INVALID_VALUE ; ERRD (dnull, GxB_Desc_set_INT32 (dnull, 0, 0)) ; + + expected = GrB_NULL_POINTER ; ERR (GxB_Desc_get_INT32 (dnull, 0, NULL)) ; // ERRD (dnull, GxB_Desc_set_FP64 (dnull, 0, 0)) ; // ERR (GxB_Desc_get_FP64 (dnull, 0, NULL)) ; + expected = GrB_INVALID_VALUE ; ERRD (dnull, GrB_Descriptor_set (dnull, 0, 0)) ; + + expected = GrB_NULL_POINTER ; ERR (GxB_Descriptor_get (NULL, dnull, 0)) ; expected = GrB_UNINITIALIZED_OBJECT ; @@ -1840,8 +1794,6 @@ void mexFunction ERR (GxB_Desc_get_INT32 (dcrud, 0, &dval2)) ; double dval3 ; -// ERRD (dcrud, GxB_Desc_set_FP64 (dcrud, 0, 0)) ; -// ERR (GxB_Desc_get_FP64 (dcrud, 0, &dval3)) ; ERRD (dcrud, GrB_Descriptor_set (dcrud, 0, 0)) ; ERR (GxB_Descriptor_get (&dval, dcrud, 0)) ; @@ -2091,27 +2043,37 @@ void mexFunction s2 = GxB_MAX_PLUS_FP32 ; o2 = GrB_MAX_FP32 ; - expected = GrB_UNINITIALIZED_OBJECT ; - + expected = GrB_NULL_POINTER ; ERR1 (Acrud, GrB_mxm (Acrud, NULL , NULL , NULL , NULL , NULL , NULL )) ; ERR1 (C, GrB_mxm (C , Acrud, NULL , NULL , NULL , NULL , NULL )) ; ERR1 (C, GrB_mxm (C , C , NULL , NULL , Acrud, NULL , NULL )) ; + + expected = GrB_UNINITIALIZED_OBJECT ; + ERR1 (Acrud, GrB_mxm (Acrud, NULL , NULL, s2 , A , A , NULL )) ; ERR1 (C, GrB_mxm (C , C , NULL , NULL , A , Acrud, NULL )) ; ERR1 (C, GrB_mxm (C , C , NULL , NULL , A , A , dcrud)) ; ERR1 (C, GrB_mxm (C , C , op2crud, NULL , A , A , NULL )) ; ERR1 (C, GrB_mxm (C , C , o2 , semicrud, A , A , NULL )) ; + expected = GrB_NULL_POINTER ; ERR1 (vcrud, GrB_vxm (vcrud, NULL , NULL , NULL , NULL , NULL , NULL )) ; ERR1 (v, GrB_vxm (v , vcrud, NULL , NULL , NULL , NULL , NULL )) ; ERR1 (v, GrB_vxm (v , v , NULL , NULL , vcrud, NULL , NULL )) ; + + expected = GrB_UNINITIALIZED_OBJECT ; + ERR1 (vcrud, GrB_vxm (vcrud, NULL, NULL, s2 , v , A , NULL )) ; ERR1 (v, GrB_vxm (v , v , NULL , NULL , v , Acrud, NULL )) ; ERR1 (v, GrB_vxm (v , v , NULL , NULL , v , A , dcrud)) ; ERR1 (v, GrB_vxm (v , v , op2crud, NULL , v , A , NULL )) ; ERR1 (v, GrB_vxm (v , v , o2 , semicrud, v , A , NULL )) ; + expected = GrB_NULL_POINTER ; ERR1 (vcrud, GrB_mxv (vcrud, NULL , NULL , NULL , NULL , NULL , NULL )) ; ERR1 (v, GrB_mxv (v , vcrud, NULL , NULL , NULL , NULL , NULL )) ; ERR1 (v, GrB_mxv (v , v , NULL , NULL , Acrud, NULL , NULL )) ; + + expected = GrB_UNINITIALIZED_OBJECT ; + ERR1 (vcrud, GrB_mxv (vcrud, NULL , NULL, s2 , A , v , NULL )) ; ERR1 (v, GrB_mxv (v , v , NULL , NULL , A , vcrud, NULL )) ; ERR1 (v, GrB_mxv (v , v , NULL , NULL , A , v , dcrud)) ; ERR1 (v, GrB_mxv (v , v , op2crud, NULL , A , v , NULL )) ; @@ -2167,14 +2129,14 @@ void mexFunction // GrB_mxm dot product //-------------------------------------------------------------------------- - GrB_Index huge = GB_NMAX ; + uint64_t huge = GB_NMAX ; GrB_Matrix HugeRow ; OK (GrB_Matrix_new (&HugeRow, GrB_FP64, 1, huge)) ; GB_Matrix_check (HugeRow, "huge row", G3, NULL) ; GxB_Matrix_fprint (HugeRow, "HugeRow", G3, ff) ; struct GB_Matrix_opaque HugeMatrix_header ; - GrB_Matrix HugeMatrix = GB_clear_static_header (&HugeMatrix_header) ; + GrB_Matrix HugeMatrix = GB_clear_matrix_header (&HugeMatrix_header) ; OK (GB_AxB_dot2 (HugeMatrix, false, NULL, NULL, false, false, false, HugeRow, HugeRow, GxB_PLUS_TIMES_FP64, false, Werk)) ; @@ -2531,6 +2493,8 @@ void mexFunction OK (GrB_Col_extract_(h, NULL, NULL, A, I, 1, 0, d0)) ; // column extract ERR1 (h, GrB_Col_extract_(h, NULL, NULL, A, I, 1, 911, d0)) ; // column extract + GrB_Vector II = NULL ; + ERR1 (h, GxB_Col_extract_Vector_(h, NULL, NULL, A, II, 911, d0)) ; // column extract expected = GrB_INDEX_OUT_OF_BOUNDS ; @@ -2920,18 +2884,18 @@ void mexFunction fprintf (ff, "done bounds test: error returned:\n%s\n", err) ; OK (GrB_Matrix_free_(&A4)) ; - GrB_Index I3 [5] = { 0, 1, 2, 3, 4 } ; - GrB_Index J3 [5] = { 0, 1, 2, 3, 4 } ; + uint64_t I3 [5] = { 0, 1, 2, 3, 4 } ; // OK + uint64_t J3 [5] = { 0, 1, 2, 3, 4 } ; // OK OK (GxB_Matrix_fprint_(A, GxB_COMPLETE, NULL)) ; OK (GxB_Matrix_fprint_(A, GxB_COMPLETE, ff)) ; OK (GxB_Matrix_subassign_(A, NULL, GrB_PLUS_FP64, C, I3, 3, J3, 2, NULL)) ; - OK (GxB_Matrix_subassign (C, C, GrB_PLUS_FP64, C, I3, 3, J3, 2, NULL)) ; + OK (GxB_Matrix_subassign_(C, C, GrB_PLUS_FP64, C, I3, 3, J3, 2, NULL)) ; J3 [0] = 999 ; OK (GrB_Matrix_dup (&C4, C)) ; - ERR1 (C4, GxB_Matrix_subassign (C4, C4, GrB_PLUS_FP64, C4, I3, 3, J3, 2, NULL)) ; + ERR1 (C4, GxB_Matrix_subassign_(C4, C4, GrB_PLUS_FP64, C4, I3, 3, J3, 2, NULL)) ; OK (GrB_Matrix_free_(&C4)) ; expected = GrB_INVALID_INDEX ; @@ -3397,98 +3361,6 @@ void mexFunction ERR1 (A, GrB_Matrix_apply_(A , NULL, NULL, GrB_AINV_FP64, C , d0)) ; - //-------------------------------------------------------------------------- - // select - //-------------------------------------------------------------------------- - -#if 0 - printf ("GxB_select---------------------------------------------------\n") ; - CHECK (selectop == NULL) ; - OK (GxB_SelectOp_new (&selectop, (GxB_select_function) fselect, GrB_FP64, GrB_FP64)) ; - CHECK (selectop != NULL) ; - OK (GB_SelectOp_check (selectop, "select op OK", G3, NULL)) ; - - expected = GrB_NULL_POINTER ; - - ERR1 (v0, GxB_Vector_select_(v0, NULL, NULL, NULL, v0, NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , NULL, NULL, NULL, v0, NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , NULL, NULL, NULL, v , NULL, d0)) ; - - ERR1 (A0, GxB_Matrix_select_(A0, NULL, NULL, NULL, A0, NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , NULL, NULL, NULL, A0, NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , NULL, NULL, NULL, A , NULL, d0)) ; - - CHECK (selectopcrud == NULL) ; - OK (GxB_SelectOp_new (&selectopcrud, (GxB_select_function) fselect, GrB_FP64, GrB_FP64)) ; - CHECK (selectopcrud != NULL) ; - selectopcrud->magic = 22309483 ; - expected = GrB_UNINITIALIZED_OBJECT ; - ERR (GB_SelectOp_check (selectopcrud, "select crud", G3, NULL)) ; - - expected = GrB_UNINITIALIZED_OBJECT ; - - v0 = vcrud ; - A0 = Acrud ; - d0 = dcrud ; - op0 = op2crud ; - sel0 = selectopcrud ; - - ERR1 (v0, GxB_Vector_select_(v0, NULL, NULL, sel0, v0, NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , v0 , NULL, sel0, v0, NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , v , NULL, sel0, v0, NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , v , NULL, sel0, v , NULL, d0)) ; - ERR1 (v, GxB_Vector_select_(v , v , op0 , sel0, v , NULL, NULL)) ; - ERR1 (v, GxB_Vector_select_(v , v , NULL, sel0, v , NULL, NULL)) ; - - ERR1 (A0, GxB_Matrix_select_(A0, NULL, NULL, sel0, A0, NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , A0 , NULL, sel0, A0, NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , A , NULL, sel0, A0, NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , A , NULL, sel0, A , NULL, d0)) ; - ERR1 (A, GxB_Matrix_select_(A , A , op0 , sel0, A , NULL, NULL)) ; - ERR1 (A, GxB_Matrix_select_(A , A , NULL, sel0, A , NULL, NULL)) ; - - expected = GrB_DOMAIN_MISMATCH ; - - double thresh = 42 ; - - GrB_Scalar Thunk = NULL ; - OK (GrB_Scalar_new (&Thunk, GrB_FP64)) ; - OK (GrB_Scalar_setElement_FP64 (Thunk, thresh)) ; - - o2 = Complex_plus ; - expected = (Complex == GxB_FC64) ? GrB_DIMENSION_MISMATCH : GrB_DOMAIN_MISMATCH ; - if (Complex == GxB_FC64) - { - OK (GxB_Matrix_select_(A, NULL, o2 , selectop, A, Thunk, NULL)) ; - OK (GxB_Matrix_select_(Z, NULL, NULL, selectop, Z, Thunk, NULL)) ; - } - else - { - ERR1 (A, GxB_Matrix_select_(A, NULL, o2 , selectop, A, Thunk, NULL)) ; - ERR1 (Z, GxB_Matrix_select_(Z, NULL, NULL, selectop, Z, Thunk, NULL)) ; - } - - ERR1 (A, GxB_Matrix_select_(A, Z , NULL, selectop, A, Thunk, NULL)) ; - ERR1 (A, GxB_Matrix_select_(A, NULL, o2 , selectop, Z, Thunk, NULL)) ; - ERR1 (A, GxB_Matrix_select_(A, NULL, NULL, selectop, Z, Thunk, NULL)) ; - ERR1 (Z, GxB_Matrix_select_(Z, NULL, NULL, selectop, A, Thunk, NULL)) ; - - v0 = NULL ; - A0 = NULL ; - d0 = NULL ; - op0 = NULL ; - sel0 = NULL ; - - OK (GxB_SelectOp_free_(&selectop)) ; - CHECK (selectop == NULL) ; - - expected = GrB_DIMENSION_MISMATCH ; - - ERR1 (A, GxB_Matrix_select_(A , NULL, NULL, GxB_TRIL, C , NULL, d0)) ; - - OK (GrB_Scalar_free_(&Thunk)) ; -#endif - //-------------------------------------------------------------------------- // reduce to scalar //-------------------------------------------------------------------------- @@ -3804,11 +3676,12 @@ void mexFunction ERR (GrB_transpose (NULL, NULL, NULL, NULL, NULL)) ; ERR1 (A, GrB_transpose (A , NULL, NULL, NULL, NULL)) ; - expected = GrB_UNINITIALIZED_OBJECT ; - + expected = GrB_NULL_POINTER ; ERR1 (Acrud, GrB_transpose (Acrud, NULL , NULL , NULL , NULL )) ; ERR1 (A, GrB_transpose (A , Acrud, NULL , NULL , NULL )) ; ERR1 (A, GrB_transpose (A , A , op2crud, NULL , NULL )) ; + + expected = GrB_UNINITIALIZED_OBJECT ; ERR1 (A, GrB_transpose (A , NULL , NULL , Acrud, NULL )) ; ERR1 (A, GrB_transpose (A , NULL , NULL , A , dcrud)) ; @@ -4139,11 +4012,14 @@ void mexFunction expected = GrB_INVALID_OBJECT ; CHECK (!GB_IS_FULL (v)) ; - v->i [0] = 1 ; - v->i [1] = 0 ; + GB_MDECL (Vi, , ) ; + Vi = v->i ; + GB_IPTR (Vi, v->i_is_32) ; + GB_ISET (Vi, 0, 1) ; // Vi [0] = 1 ; + GB_ISET (Vi, 1, 0) ; // Vi [1] = 0 ; ERR (GxB_Vector_fprint (v, "v jumbled", G3, ff)) ; - v->i [0] = 0 ; - v->i [1] = 1 ; + GB_ISET (Vi, 0, 0) ; // Vi [0] = 0 ; + GB_ISET (Vi, 1, 1) ; // Vi [1] = 1 ; OK (GxB_Vector_fprint (v, "v fixed", G3, ff)) ; expected = GrB_UNINITIALIZED_OBJECT ; @@ -4155,24 +4031,31 @@ void mexFunction expected = GrB_INVALID_OBJECT ; v->vdim = 2 ; - int64_t *psave = v->p ; + void *psave = v->p ; size_t p_size_save = v->p_size ; + printf ("test0, remove v->p from memtable %d\n", v->p) ; GB_Global_memtable_remove (v->p) ; v->p_size = 3 * sizeof (int64_t) ; - v->p = mxMalloc (3 * sizeof (int64_t)) ; + v->p = mxMalloc (v->p_size) ; memset (v->p, 0, v->p_size) ; + printf ("test0, add v->p to memtable %d\n", v->p) ; GB_Global_memtable_add (v->p, v->p_size) ; ERR (GB_Vector_check (v, "v invalid", G1, ff)) ; v->vdim = 1 ; CHECK (!GB_IS_FULL (v)) ; - v->p [0] = 1 ; + GB_MDECL (Vp, , ) ; + Vp = v->p ; + GB_IPTR (Vp, v->p_is_32) ; + GB_ISET (Vp, 0, 1) ; // Vp [0] = 1 ; ERR (GB_Vector_check (v, "v p[0] invalid", G1, ff)) ; mxFree (v->p) ; + printf ("test0, remove v->p from memtable %d\n", v->p) ; GB_Global_memtable_remove (v->p) ; v->p = psave ; v->p_size = p_size_save ; + printf ("test0, add v->p to memtable %d\n", v->p) ; GB_Global_memtable_add (v->p, v->p_size) ; psave = NULL ; OK (GB_Vector_check (v, "v OK now", G1, ff)) ; @@ -4201,6 +4084,8 @@ void mexFunction OK (GB_Matrix_check (A, "A ok", G3, ff)) ; CHECK (A->h != NULL) ; + CHECK (A->i == NULL) ; + expected = GrB_UNINITIALIZED_OBJECT ; A->magic = GB_FREED ; @@ -4210,9 +4095,12 @@ void mexFunction expected = GrB_INVALID_OBJECT ; CHECK (!GB_IS_FULL (A)) ; - A->p [0] = 1 ; + GB_MDECL (Ap, , ) ; + Ap = A->p ; + GB_IPTR (Ap, A->p_is_32) ; + GB_ISET (Ap, 0, 1) ; // Ap [0] = 1 ; ERR (GB_Matrix_check (A, "p[0] invalid", G1, ff)) ; - A->p [0] = 0 ; + GB_ISET (Ap, 0, 0) ; // Ap [0] = 0 ; A->vlen = -1 ; ERR (GB_Matrix_check (A, "invalid dimensions", G1, ff)) ; @@ -4232,8 +4120,8 @@ void mexFunction OK (GrB_Matrix_free_(&A)) ; OK (GrB_Matrix_new (&A, GrB_FP64, 10, 4)) ; - GrB_Index I00 [1] = { 0 } ; - GrB_Index J00 [1] = { 0 } ; + uint64_t I00 [1] = { 0 } ; // OK + uint64_t J00 [1] = { 0 } ; // OK OK (GrB_Matrix_setElement_FP64 (A, 3.14159, 0, 0)) ; OK (GrB_Matrix_assign_BOOL (A, NULL, GrB_SECOND_FP64, true, I00, 1, J00, 1, NULL)) ; @@ -4261,17 +4149,17 @@ void mexFunction OK (GrB_Matrix_setElement_FP64 (A, 3.14159, 3, 3)) ; OK (GB_Matrix_check (A, "with pi pending", G3, NULL)) ; - AP = A->Pending ; - CHECK (AP != NULL) ; - CHECK (AP->n == 1) ; - CHECK (AP->type == GrB_FP64) ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + CHECK (A_Pending->n == 1) ; + CHECK (A_Pending->type == GrB_FP64) ; OK (GrB_Matrix_setElement_FP64 (A, 9.0909, 2, 1)) ; - AP = A->Pending ; - CHECK (AP != NULL) ; - CHECK (AP->n == 2) ; - CHECK (AP->type == GrB_FP64) ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + CHECK (A_Pending->n == 2) ; + CHECK (A_Pending->type == GrB_FP64) ; OK (GB_Matrix_check (A, "with pi and 9.0909 pending", G3, NULL)) ; @@ -4288,19 +4176,21 @@ void mexFunction OK (GB_Matrix_check (A, "valid pi", G0, NULL)) ; CHECK (!GB_IS_FULL (A)) ; - A->p [0] = 1 ; + Ap = A->p ; + GB_IPTR (Ap, A->p_is_32) ; + GB_ISET (Ap, 0, 1) ; // Ap [0] = 1 ERR (GB_Matrix_check (A, "Ap[0] invalid", G1, NULL)) ; - A->p [0] = 0 ; + GB_ISET (Ap, 0, 0) ; // Ap [0] = 0 - int64_t isave = A->p [1] ; - A->p [1] = -1 ; + int64_t isave = GB_IGET (Ap, 1) ; + GB_ISET (Ap, 1, -1) ; // Ap [1] = -1 ; ERR (GB_Matrix_check (A, "Ap[1] invalid", G1, NULL)) ; - A->p [1] = isave ; + GB_ISET (Ap, 1, isave) ; // Ap [1] = isave ; - isave = A->p [4] ; - A->p [4] += 999 ; + isave = GB_IGET (Ap, 4) ; + GB_ISET (Ap, 4, 999) ; // Ap [4] += 999 ; ERR (GB_Matrix_check (A, "Ap[ncols] invalid", G1, NULL)) ; - A->p [4] = isave ; + GB_ISET (Ap, 4, isave) ; // Ap [4] = isave ; isave = A->nzombies ; A->nzombies = -1 ; @@ -4312,18 +4202,21 @@ void mexFunction ERR (GB_Matrix_check (A, "too many zombies", G1, NULL)) ; A->nzombies = isave ; - isave = A->i [0] ; - A->i [0] = -1 ; + Ai = A->i ; + GB_IPTR (Ai, A->i_is_32) ; + isave = GB_IGET (Ai, 0) ; + GB_ISET (Ai, 0, -1) ; // Ai [0] = -1 ERR (GB_Matrix_check (A, "row index invalid", G3, NULL)) ; - A->i [0] = isave ; + GB_ISET (Ai, 0, isave) ; // Ai [0] = isave ; isave = A->nzombies ; A->nzombies = 1 ; ERR (GB_Matrix_check (A, "bad zombies", G3, NULL)) ; A->nzombies = isave ; - AP = A->Pending ; - CHECK (AP == NULL) ; + A_Pending = A->Pending ; + CHECK (A_Pending == NULL) ; + OK (GB_Matrix_check (A, "so far", G3, NULL)) ; printf ("\n========================================== valid [pi 7.1]\n") ; OK (GrB_Matrix_setElement_FP64 (A, 7.1, 1, 0)) ; @@ -4332,29 +4225,31 @@ void mexFunction Werk->where = "GB_Matrix_check" ; - AP = A->Pending ; - CHECK (AP != NULL) ; - isave = AP->n ; - AP->n = -1 ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + isave = A_Pending->n ; + A_Pending->n = -1 ; ERR (GB_Matrix_check (A, "negative pending", G1, NULL)) ; - AP->n = isave ; + A_Pending->n = isave ; - AP = A->Pending ; - CHECK (AP != NULL) ; - psave = AP->i ; - AP->i = NULL ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + psave = A_Pending->i ; + A_Pending->i = NULL ; ERR (GB_Matrix_check (A, "missing pending", G3, NULL)) ; - AP->i = psave ; + A_Pending->i = psave ; OK (GB_Matrix_check (A, "valid pending [pi 7.1]", G0, NULL)) ; - AP = A->Pending ; - CHECK (AP != NULL) ; - CHECK (AP->j != NULL) ; - isave = AP->j [0] ; - AP->j [0] = 1070 ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + GB_MDECL (Pending_j, , u) ; + GB_GET_PENDINGj_PTR (Pending_j, A) ; + CHECK (Pending_j != NULL) ; + isave = GB_IGET (Pending_j, 0) ; + GB_ISET (Pending_j, 0, 1070) ; ERR (GB_Matrix_check (A, "bad pending tuple", G3, NULL)) ; - AP->j [0] = isave ; + GB_ISET (Pending_j, 0, isave) ; OK (GB_Matrix_check (A, "valid pending [pi 7.1]", G0, NULL)) ; printf ("\n====================================== valid [pi 7.1 11.4]\n") ; @@ -4364,24 +4259,21 @@ void mexFunction Werk->where = "GB_Matrix_check" ; - AP = A->Pending ; - CHECK (AP != NULL) ; - AP->sorted = !(AP->sorted) ; -// isave = AP->j [0] ; -// AP->j [0] = 2 ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + A_Pending->sorted = !(A_Pending->sorted) ; printf ("matrix check with jumbled pending tuples:\n") ; ERR (GxB_Matrix_fprint (A, "jumbled pending tuples", G3, ff)) ; ERR (GB_Matrix_check (A, "jumbled pending tuples", G3, ff)) ; - AP->sorted = !(AP->sorted) ; -// AP->j [0] = isave ; + A_Pending->sorted = !(A_Pending->sorted) ; OK (GB_Matrix_check (A, "valid pending [pi 7.1 11.4]", G0, ff)) ; - AP = A->Pending ; - CHECK (AP != NULL) ; - CHECK (AP->op == NULL) ; - AP->op = op2crud ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + CHECK (A_Pending->op == NULL) ; + A_Pending->op = op2crud ; ERR (GB_Matrix_check (A, "invalid operator", G3, NULL)) ; - AP->op = NULL ; + A_Pending->op = NULL ; OK (GB_Matrix_check (A, "valid pending [pi 7.1 11.4]", G3, NULL)) ; printf ("\n=========================================================\n") ; @@ -4402,8 +4294,10 @@ void mexFunction CHECK (!GB_IS_FULL (A)) ; CHECK (!GB_IS_BITMAP (A)) ; - A->i [0] = 1 ; - A->i [1] = 0 ; + Ai = A->i ; + GB_IPTR (Ai, A->i_is_32) ; + GB_ISET (Ai, 0, 1) ; // Ai [0] = 1 ; + GB_ISET (Ai, 1, 0) ; // Ai [1] = 0 ; info = GB_Matrix_check (A, "jumbled", G3, NULL) ; printf ("jumbled info %d\n", info) ; @@ -4415,20 +4309,22 @@ void mexFunction CHECK (!GB_IS_FULL (A)) ; CHECK (!GB_IS_BITMAP (A)) ; - A->i [0] = 0 ; - A->i [1] = 1 ; + Ai = A->i ; + GB_IPTR (Ai, A->i_is_32) ; + GB_ISET (Ai, 0, 0) ; // Ai [0] = 0 ; + GB_ISET (Ai, 1, 1) ; // Ai [1] = 1 ; OK (GB_Matrix_check (A, "OK", G3, NULL)) ; OK (GrB_Matrix_nvals (&nvals, A)) ; OK (GrB_Matrix_wait_(A, GrB_MATERIALIZE)) ; CHECK (nvals == 5) ; - AP = A->Pending ; - CHECK (AP == NULL) ; + A_Pending = A->Pending ; + CHECK (A_Pending == NULL) ; CHECK (A->nzombies == 0) ; OK (GrB_Matrix_new (&Empty1, GrB_FP64, 1, 1)) ; I [0] = 0 ; J [0] = 0 ; - OK (GxB_Matrix_subassign (A, NULL, NULL, Empty1, I, 1, J, 1, NULL)) ; + OK (GxB_Matrix_subassign_(A, NULL, NULL, Empty1, I, 1, J, 1, NULL)) ; OK (GB_Matrix_check (A, "valid zombie", G3, NULL)) ; OK (GrB_Matrix_setElement_INT32 (A, 99099, 0, 0)) ; OK (GB_Matrix_check (A, "no more zombie", G3, NULL)) ; @@ -4436,7 +4332,7 @@ void mexFunction OK (GrB_Matrix_wait_(A, GrB_MATERIALIZE)) ; CHECK (nvals == 5) ; - OK (GxB_Matrix_subassign (A, NULL, NULL, Empty1, I, 1, J, 1, NULL)) ; + OK (GxB_Matrix_subassign_(A, NULL, NULL, Empty1, I, 1, J, 1, NULL)) ; OK (GB_Matrix_check (A, "valid zombie", G3, NULL)) ; OK (GrB_Matrix_nvals (&nvals, A)) ; OK (GrB_Matrix_wait_(A, GrB_MATERIALIZE)) ; @@ -4486,21 +4382,21 @@ void mexFunction // make sure A->nvec_nonempty is valid CHECK (GB_IS_HYPERSPARSE (A)) ; - if (A->nvec_nonempty < 0) - { - A->nvec_nonempty = GB_nvec_nonempty (A) ; - } + GB_nvec_nonempty_update (A) ; // now make invalid. GB_Matrix_check requires it to be -1, or correct value CHECK (GB_IS_HYPERSPARSE (A)) ; - isave = A->p [1] ; - A->p [1] = 0 ; + + Ap = A->p ; + GB_IPTR (Ap, A->p_is_32) ; + isave = GB_IGET (Ap, 1) ; + GB_ISET (Ap, 1, 0) ; // Ap [1] = 0 ; expected = GrB_INDEX_OUT_OF_BOUNDS ; ERR (GB_Matrix_check (A, "A with bad nvec_nonempty", G1, NULL)) ; expected = GrB_INVALID_OBJECT ; ERR (GxB_Matrix_fprint (A, "A", G1, ff)) ; CHECK (GB_IS_HYPERSPARSE (A)) ; - A->p [1] = isave ; + GB_ISET (Ap, 1, isave) ; // Ap [1] = isave ; OK (GB_Matrix_check (A, "A fixed", G0, NULL)) ; double hratio = 0.5; @@ -4574,7 +4470,7 @@ void mexFunction CHECK (GB_IS_HYPERSPARSE (A)) ; CHECK (A->is_csc) ; - GxB_Format_Value format = 0; + int format = 0; OK (GxB_Matrix_Option_get_(A, GxB_FORMAT, &format)) ; CHECK (format == GxB_BY_COL) ; @@ -4711,11 +4607,13 @@ void mexFunction ERR (GxB_Global_Option_get_CHAR (-1, &ignore6)) ; CHECK (ignore6 == NULL) ; + expected = GrB_NULL_POINTER ; ERR (GxB_Matrix_Option_get_(A, 999, NULL)) ; GrB_Matrix_error_(&err, A) ; printf ("error expected (bad field):%s\n", err) ; int ii ; + expected = GrB_INVALID_VALUE ; ERR (GxB_Matrix_Option_get_INT32 (A, 999, &ii)) ; GrB_Matrix_error_(&err, A) ; printf ("error expected (bad field):%s\n", err) ; @@ -4763,13 +4661,13 @@ void mexFunction expected = GrB_INVALID_OBJECT ; - int64_t *Ah_save = A->h ; + void *Ah_save = A->h ; A->h = NULL ; ERR (GB_Matrix_check (A, "h invalid", G3, NULL)) ; A->h = Ah_save ; OK (GB_Matrix_check (A, "h restored", G1, NULL)) ; - int64_t nvec = A->nvec ; + uint64_t nvec = A->nvec ; A->nvec = -1 ; ERR (GB_Matrix_check (A, "nvec invalid", G1, NULL)) ; A->nvec = nvec ; @@ -4777,10 +4675,13 @@ void mexFunction CHECK (!GB_IS_FULL (A)) ; CHECK (A->h != NULL) ; - int64_t jsave = A->h [0] ; - A->h [0] = -1 ; + GB_MDECL (Ah, , ) ; + Ah = A->h ; + GB_IPTR (Ah, A->j_is_32) ; + int64_t jsave = GB_IGET (Ah, 0) ; + GB_ISET (Ah, 0, -1) ; // Ah [0] = -1 ; ERR (GB_Matrix_check (A, "h[0] invalid", G1, NULL)) ; - A->h [0] = jsave ; + GB_ISET (Ah, 0, jsave) ; // Ah [0] = jsave ; OK (GB_Matrix_check (A, "h[0] restored", G1, NULL)) ; GrB_Matrix Eleven ; @@ -4804,10 +4705,12 @@ void mexFunction GB_free_memory ((void **) &(Eleven->h), Eleven->h_size) ; Eleven->h = ¬hing ; Eleven->h_size = sizeof (int64_t) ; + printf ("test0, add Eleven->h to memtable %d\n", Eleven->h) ; GB_Global_memtable_add (Eleven->h, 1 * sizeof (int64_t)) ; ERR (GB_Matrix_check (Eleven, "Eleven invalid", G2, NULL)) ; ERR (GxB_Matrix_fprint (Eleven, "Eleven", G2, NULL)) ; ERR (GxB_Matrix_fprint (Eleven, "Eleven invalid", G2, ff)) ; + printf ("test0, remove Eleven->h from memtable %d\n", Eleven->h) ; GB_Global_memtable_remove (Eleven->h) ; Eleven->h = NULL ; @@ -4835,20 +4738,20 @@ void mexFunction OK (GrB_Matrix_setElement_FP64 (A, 32.4, 3, 2)) ; OK (GB_Matrix_check (A, "A with one pending", G3, NULL)) ; - AP = A->Pending ; - CHECK (AP != NULL) ; - CHECK (AP->n == 1 && A->nzombies == 0) ; + A_Pending = A->Pending ; + CHECK (A_Pending != NULL) ; + CHECK (A_Pending->n == 1 && A->nzombies == 0) ; GB_Global_mode_set (GrB_BLOCKING) ; OK (GB_block (A, Werk)) ; OK (GB_Matrix_check (A, "A with no pending", G3, NULL)) ; - AP = A->Pending ; - CHECK (AP == NULL) ; + A_Pending = A->Pending ; + CHECK (A_Pending == NULL) ; CHECK (A->nzombies == 0) ; OK (GrB_Matrix_setElement_FP64 (A, 99.4, 3, 3)) ; OK (GB_Matrix_check (A, "A blocking mode", G3, NULL)) ; GB_Global_mode_set (GrB_NONBLOCKING) ; - AP = A->Pending ; - CHECK (AP == NULL) ; + A_Pending = A->Pending ; + CHECK (A_Pending == NULL) ; CHECK (A->nzombies == 0) ; printf ("\nAll blocking/nonblocking mode tests passed\n") ; @@ -4857,8 +4760,6 @@ void mexFunction // restore all 'crud' objects so they can be freed //-------------------------------------------------------------------------- - // printf ("\n-------------- Restore crud objects:\n") ; - expected = GrB_UNINITIALIZED_OBJECT ; Werk->where = "GB *_check" ; @@ -4985,18 +4886,14 @@ void mexFunction CHECK (!ok) ; CHECK (n == 0) ; - ok = GB_int64_multiply (&n, - ((GrB_Index) GB_NMAX)+1, - ((GrB_Index) GB_NMAX)+1) ; + ok = GB_int64_multiply (&n, ((uint64_t) GB_NMAX)+1, ((uint64_t) GB_NMAX)+1); CHECK (!ok) ; - ok = GB_int64_multiply (&n, - ((GrB_Index) GB_NMAX), - ((GrB_Index) GB_NMAX)) ; + ok = GB_int64_multiply (&n, ((uint64_t) GB_NMAX), ((uint64_t) GB_NMAX)) ; CHECK (!ok) ; - a = (GrB_Index) 16777216/2 ; // (2^24)/2 - b = (GrB_Index) 16777216 ; + a = (uint64_t) 16777216/2 ; // (2^24)/2 + b = (uint64_t) 16777216 ; ok = GB_int64_multiply (&n, a, b) ; // printf ("%lld %lld n\n", n, a*b) ; CHECK (ok) ; @@ -5006,17 +4903,6 @@ void mexFunction // internal GB * routines //-------------------------------------------------------------------------- -#if 0 - OK (GxB_Matrix_fprint (A, "A for bix_alloc", G3, NULL)) ; - CHECK (A != NULL) ; - Werk->where = "GB_bix_alloc" ; - info = GB_bix_alloc (A, GB_NMAX+1, GxB_SPARSE, true, true, false, - Werk) ; - CHECK (info == GrB_OUT_OF_MEMORY) ; - OK (GrB_Matrix_free_(&A)) ; - OK (GrB_Matrix_new (&A, GrB_BOOL, 11, 11)) ; -#endif - Werk->where = "GB_ix_realloc" ; CHECK (A != NULL) ; @@ -5041,8 +4927,9 @@ void mexFunction Werk->where = "GB_shallow_op" ; struct GB_Matrix_opaque Q_header ; - GrB_Matrix Q = GB_clear_static_header (&Q_header) ; - OK (GB_shallow_op (Q, true, (GB_Operator) GrB_AINV_FP32, NULL, NULL, false, C, Werk)) ; + GrB_Matrix Q = GB_clear_matrix_header (&Q_header) ; + OK (GB_shallow_op (Q, true, (GB_Operator) GrB_AINV_FP32, NULL, NULL, + false, C, Werk)) ; OK (GB_Matrix_check (Q, "Q empty, float", G3, NULL)) ; GrB_Matrix_free_(&Q) ; @@ -5068,8 +4955,8 @@ void mexFunction n = NWHAT ; nvals = 40 ; uvals = 4 ; - GrB_Index ilist [NWHAT] = { 8, 9, 0, 1, 5, 6, 11, 3, 2, 10, 7, 4 } ; - GrB_Index jlist [NWHAT] = { 0, 11, 1, 7, 8, 4, 2, 3, 5, 6, 10, 9 } ; + uint64_t ilist [NWHAT] = { 8, 9, 0, 1, 5, 6, 11, 3, 2, 10, 7, 4 } ; // OK + uint64_t jlist [NWHAT] = { 0, 11, 1, 7, 8, 4, 2, 3, 5, 6, 10, 9 } ; // OK OK (GB_mx_random_matrix (&A, false, false, n, n, nvals, 0, false)) ; OK (GrB_Vector_new (&u, GrB_FP64, n)) ; @@ -5261,8 +5148,8 @@ void mexFunction //---------------------------------------------------------------------- OK (GrB_Matrix_dup (&B, A)) ; - OK (GxB_Matrix_subassign (B, Amask, NULL, A, GrB_ALL, n, GrB_ALL, n, NULL)) ; - OK (GxB_Matrix_subassign (A, Amask, NULL, A, GrB_ALL, n, GrB_ALL, n, NULL)) ; + OK (GxB_Matrix_subassign_(B, Amask, NULL, A, GrB_ALL, n, GrB_ALL, n, NULL)) ; + OK (GxB_Matrix_subassign_(A, Amask, NULL, A, GrB_ALL, n, GrB_ALL, n, NULL)) ; GB_wait (A, "A", Werk) ; GB_wait (B, "B", Werk) ; @@ -5270,24 +5157,24 @@ void mexFunction GrB_Matrix_free_(&B) ; OK (GrB_Matrix_dup (&B, A)) ; - OK (GxB_Matrix_subassign (B, Amask, NULL, A, ilist, n, jlist, n, NULL)); - OK (GxB_Matrix_subassign (A, Amask, NULL, A, ilist, n, jlist, n, NULL)); + OK (GxB_Matrix_subassign_(B, Amask, NULL, A, ilist, n, jlist, n, NULL)); + OK (GxB_Matrix_subassign_(A, Amask, NULL, A, ilist, n, jlist, n, NULL)); GB_wait (A, "A", Werk) ; GB_wait (B, "B", Werk) ; CHECK (GB_mx_isequal (A, B, 0)) ; GrB_Matrix_free_(&B) ; OK (GrB_Vector_dup (&v, u)) ; - OK (GxB_Vector_subassign (v, umask, NULL, u, GrB_ALL, n, NULL)) ; - OK (GxB_Vector_subassign (u, umask, NULL, u, GrB_ALL, n, NULL)) ; + OK (GxB_Vector_subassign_(v, umask, NULL, u, GrB_ALL, n, NULL)) ; + OK (GxB_Vector_subassign_(u, umask, NULL, u, GrB_ALL, n, NULL)) ; GB_wait ((GrB_Matrix) u, "u", Werk) ; GB_wait ((GrB_Matrix) v, "v", Werk) ; CHECK (GB_mx_isequal ((GrB_Matrix) u, (GrB_Matrix) v, 0)) ; GrB_Vector_free_(&v) ; OK (GrB_Vector_dup (&v, u)) ; - OK (GxB_Vector_subassign (v, umask, NULL, u, ilist, n, NULL)) ; - OK (GxB_Vector_subassign (u, umask, NULL, u, ilist, n, NULL)) ; + OK (GxB_Vector_subassign_(v, umask, NULL, u, ilist, n, NULL)) ; + OK (GxB_Vector_subassign_(u, umask, NULL, u, ilist, n, NULL)) ; GB_wait ((GrB_Matrix) v, "v", Werk) ; GB_wait ((GrB_Matrix) u, "u", Werk) ; @@ -5370,7 +5257,7 @@ void mexFunction OK (GrB_transpose (B, Amask, NULL, A, NULL)) ; OK (GrB_transpose (A, Amask, NULL, A, NULL)) ; - GrB_Index ignore ; + uint64_t ignore ; OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; OK (GrB_Matrix_wait (B, GrB_MATERIALIZE)) ; @@ -5410,11 +5297,16 @@ void mexFunction printf ("\n----------------------------- import/export\n") ; OK (GxB_Matrix_fprint (A, "A to import/export", GxB_COMPLETE, stdout)) ; - GrB_Index *Ap, *Ai, *Aj, *Ah, nrows, ncols, nvecs ; + uint64_t *Aj ; // OK + uint64_t nrows, ncols, nvecs ; double *Ax ; GrB_Type atype ; bool jumbled, iso ; - int64_t Ap_size, Aj_size, Ai_size, Ax_size, Ah_size, Ab_size ; + uint64_t Ap_size, Aj_size, Ai_size, Ax_size, Ah_size, Ab_size ; + +{ + // import/export are all-64-bit + uint64_t *Ap, *Ah, *Ai ; // OK OK (GxB_Matrix_export_CSR (&A, &atype, &nrows, &ncols, &Ap, &Aj, (void **) &Ax, &Ap_size, &Aj_size, &Ax_size, &iso, @@ -5437,9 +5329,6 @@ void mexFunction expected = GrB_NULL_POINTER ; - - - ERR (GxB_Matrix_export_CSR (NULL, &atype, &nrows, &ncols, &Ap, &Aj, (void **) &Ax, &Ap_size, &Aj_size, &Ax_size, &iso, &jumbled, desc)) ; @@ -5888,6 +5777,7 @@ void mexFunction OK (GxB_Vector_import_CSC (&u, utype, n, &Ai, (void **) &Ax, Ai_size, Ax_size, iso, nvals, jumbled, desc)) ; OK (GB_Vector_check (u, "u still OK", G3, NULL)) ; +} //-------------------------------------------------------------------------- // free all diff --git a/GraphBLAS/Test/GB_mex_test1.c b/GraphBLAS/Test/GB_mex_test1.c index ed70f90701..fec25b5fc7 100644 --- a/GraphBLAS/Test/GB_mex_test1.c +++ b/GraphBLAS/Test/GB_mex_test1.c @@ -2,7 +2,7 @@ // GB_mex_test1: various tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -21,17 +21,17 @@ GrB_Info ack (int64_t *stuff, GrB_Matrix GunkIt) return (GrB_SUCCESS) ; } -bool select_plus_one (GrB_Index i, GrB_Index j, const double *x, const double *thunk) ; +bool select_plus_one (uint64_t i, uint64_t j, const double *x, const double *thunk) ; -bool select_nothing (GrB_Index i, GrB_Index j, const void *x, const void *thunk) ; +bool select_nothing (uint64_t i, uint64_t j, const void *x, const void *thunk) ; -bool select_plus_one (GrB_Index i, GrB_Index j, const double *x, const double *thunk) +bool select_plus_one (uint64_t i, uint64_t j, const double *x, const double *thunk) { // return true if x >= thunk+1 return ((*x) >= ((*thunk)+1)) ; } -bool select_nothing (GrB_Index i, GrB_Index j, const void *x, const void *thunk) +bool select_nothing (uint64_t i, uint64_t j, const void *x, const void *thunk) { return (false) ; } @@ -209,7 +209,7 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Descriptor Duh ; - GrB_Desc_Value val ; + int val ; int v2 ; GrB_Descriptor_new (&Duh) ; @@ -559,25 +559,25 @@ void mexFunction printf ("\nprinting built-in types:\n") ; bool b = true ; - int8_t i8 = 22 ; + int8_t int8 = 22 ; uint8_t u8 = 44 ; - int16_t i16 = 909 ; + int16_t int16 = 909 ; uint16_t u16 = 777 ; - int32_t i32 = 3203 ; + int32_t int32 = 3203 ; uint32_t u32 = 8080 ; - int64_t i64 = -987 ; + int64_t int64 = -987 ; uint64_t u64 = 987 ; float f32 = 3.14 ; double f64 = 99.4 ; GB_code_check (GB_BOOL_code, &b , 5, stdout) ; printf ("\n"); - GB_code_check (GB_INT8_code, &i8 , 5, stdout) ; printf ("\n"); + GB_code_check (GB_INT8_code, &int8 , 5, stdout) ; printf ("\n"); GB_code_check (GB_UINT8_code, &u8 , 5, stdout) ; printf ("\n"); - GB_code_check (GB_INT16_code, &i16, 5, stdout) ; printf ("\n"); + GB_code_check (GB_INT16_code, &int16, 5, stdout) ; printf ("\n"); GB_code_check (GB_UINT16_code, &u16, 5, stdout) ; printf ("\n"); - GB_code_check (GB_INT32_code, &i32, 5, stdout) ; printf ("\n"); + GB_code_check (GB_INT32_code, &int32, 5, stdout) ; printf ("\n"); GB_code_check (GB_UINT32_code, &u32, 5, stdout) ; printf ("\n"); - GB_code_check (GB_INT64_code, &i64, 5, stdout) ; printf ("\n"); + GB_code_check (GB_INT64_code, &int64, 5, stdout) ; printf ("\n"); GB_code_check (GB_UINT64_code, &u64, 5, stdout) ; printf ("\n"); GB_code_check (GB_FP32_code, &f32, 5, stdout) ; printf ("\n"); GB_code_check (GB_FP64_code, &f64, 5, stdout) ; printf ("\n"); @@ -614,7 +614,7 @@ void mexFunction double h = 1, h2 = 3, bswitch [GxB_NBITMAP_SWITCH] ; double bswitch2 [GxB_NBITMAP_SWITCH] ; - GxB_Format_Value ff ; + int ff ; int32_t ff2 ; GxB_Global_Option_get_(GxB_HYPER_SWITCH, &h) ; GxB_Global_Option_get_FP64 (GxB_HYPER_SWITCH, &h2) ; @@ -632,7 +632,7 @@ void mexFunction CHECK (bswitch [k] == bswitch2 [k]) ; } - GrB_Mode mode = GrB_BLOCKING ; + int mode = GrB_BLOCKING ; GxB_Global_Option_get_(GxB_MODE, &mode) ; printf ("mode: %d\n", mode) ; @@ -664,7 +664,7 @@ void mexFunction OK (GrB_Matrix_wait_(A, GrB_MATERIALIZE)) ; OK (GrB_Matrix_wait_(B, GrB_MATERIALIZE)) ; CHECK (!GB_any_aliased (A, B)) ; - int64_t *Bh_save = B->h ; + void *Bh_save = B->h ; B->h = A->h ; B->h_shallow = true ; CHECK (GB_any_aliased (A, B)) ; B->h = Bh_save ; B->h_shallow = false ; @@ -674,37 +674,13 @@ void mexFunction GrB_Matrix_free_(&A) ; GrB_Matrix_free_(&B) ; - //-------------------------------------------------------------------------- - // check descripter set/get for nthreads and chunk - //-------------------------------------------------------------------------- - -#if 0 - GrB_Descriptor desc ; - OK (GrB_Descriptor_new (&desc)) ; - OK (GxB_Desc_set (desc, GxB_NTHREADS, 42)) ; - OK (GxB_Desc_set (desc, GxB_CHUNK, (double) 12345)) ; - OK (GxB_Desc_get (desc, GxB_CHUNK, &chunk)) ; - OK (GxB_Desc_get (desc, GxB_NTHREADS, &nthreads)) ; - OK (GrB_Descriptor_wait_(desc, GrB_MATERIALIZE)) ; - OK (GxB_Descriptor_fprint_(desc, GxB_COMPLETE, NULL)) ; - CHECK (chunk == 12345) ; - CHECK (nthreads == 42) ; - - chunk = -1 ; - nthreads = 0 ; - OK (GxB_Desc_get_FP64 (desc, GxB_CHUNK, &chunk)) ; - OK (GxB_Desc_get_INT32 (desc, GxB_NTHREADS, &nthreads)) ; - - GrB_Descriptor_free_(&desc) ; -#endif - //-------------------------------------------------------------------------- // make a shallow copy of an empty matrix //-------------------------------------------------------------------------- OK (GrB_Matrix_new (&A, GrB_BOOL, 10000, 10000)) ; struct GB_Matrix_opaque Q_header ; - GrB_Matrix Q = GB_clear_static_header (&Q_header) ; + GrB_Matrix Q = GB_clear_matrix_header (&Q_header) ; OK (GB_shallow_copy (Q, A->is_csc, A, NULL)) ; // A is empty, not iso OK (GxB_Matrix_fprint_(Q, GxB_COMPLETE, NULL)) ; GrB_Matrix_free_(&A) ; @@ -718,7 +694,7 @@ void mexFunction GB_Global_malloc_tracking_set (false) ; GB_void *p = GB_malloc_memory (4, sizeof (int64_t), &nbytes) ; CHECK (p != NULL) ; - GB_FREE (&p, nbytes) ; + GB_free_memory ((void **) &p, nbytes) ; CHECK (p == NULL) ; p = GB_calloc_memory (4, sizeof (int64_t), &nbytes) ; CHECK (p != NULL) ; @@ -726,7 +702,7 @@ void mexFunction p = GB_realloc_memory (6, sizeof (int64_t), p, &nbytes, &ok) ; CHECK (p != NULL) ; CHECK (ok) ; - GB_FREE (&p, nbytes) ; + GB_free_memory ((void **) &p, nbytes) ; CHECK (p == NULL) ; CHECK (!GB_Global_malloc_is_thread_safe_get ( )) ; @@ -754,7 +730,7 @@ void mexFunction //-------------------------------------------------------------------------- int64_t Slice [30] ; - GB_p_slice (Slice, NULL, 0, 4, true) ; + GB_p_slice (Slice, NULL, false, 0, 4, true) ; for (int t = 0 ; t < 4 ; t++) CHECK (Slice [t] == 0) ; //-------------------------------------------------------------------------- @@ -804,7 +780,6 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Type user_type = NULL ; -// OK (GrB_Type_new (&user_type, sizeof (user_int))) ; OK (GxB_Type_new (&user_type, sizeof (user_int), "user_int", "typedef int16_t user_int ;")) ; OK (GrB_Type_wait_(user_type, GrB_MATERIALIZE)) ; @@ -828,14 +803,10 @@ void mexFunction OK (GxB_Scalar_type (&type2, thunk)) ; CHECK (type2 == user_type) ; OK (GxB_Scalar_fprint (thunk, "thunk", GxB_COMPLETE, NULL)) ; -#if 0 - OK (GxB_Matrix_select_(A, NULL, NULL, GxB_NE_THUNK, A, thunk, NULL)) ; -#endif value = (int64_t) 4 ; OK (GrB_Scalar_setElement_UDT (thunk, &value)) ; -// expected = GrB_DOMAIN_MISMATCH ; expected = GrB_NOT_IMPLEMENTED ; ERR1 (A, GxB_Matrix_select_(A, NULL, NULL, GxB_GE_THUNK, A, thunk, NULL)) ; GrB_Matrix_error_(&err, A) ; @@ -846,7 +817,6 @@ void mexFunction OK (GrB_Scalar_setElement_INT16 (thunk2, 4)) ; OK (GrB_Scalar_wait_(thunk2, GrB_MATERIALIZE)) ; -// expected = GrB_DOMAIN_MISMATCH ; expected = GrB_NOT_IMPLEMENTED ; ERR1 (A, GxB_Matrix_select_(A, NULL, NULL, GxB_GE_ZERO, A, NULL, NULL)) ; @@ -871,22 +841,6 @@ void mexFunction printf ("Expected error: info: %d\n%s\n", info, err) ; GrB_Matrix_free_(&B) ; -#if 0 - OK (GrB_Matrix_new (&B, user_type, 10, 10)) ; - printf ("\n============== B = select (A != 0)\n") ; - OK (GxB_Matrix_select_(B, NULL, NULL, GxB_NONZERO, A, NULL, NULL)) ; - OK (GxB_Matrix_fprint_(B, GxB_COMPLETE, NULL)) ; - printf ("\n============== B = select (A == 0)\n") ; - OK (GxB_Matrix_select_(B, NULL, NULL, GxB_EQ_ZERO, A, NULL, NULL)) ; - OK (GxB_Matrix_fprint_(B, GxB_COMPLETE, NULL)) ; - printf ("\n============== B = select (A != 4)\n") ; - OK (GxB_Matrix_select_(B, NULL, NULL, GxB_NE_THUNK, A, thunk, NULL)) ; - OK (GxB_Matrix_fprint_(B, GxB_COMPLETE, NULL)) ; - printf ("\n============== B = select (A == 4)\n") ; - OK (GxB_Matrix_select_(B, NULL, NULL, GxB_EQ_THUNK, A, thunk, NULL)) ; - OK (GxB_Matrix_fprint_(B, GxB_COMPLETE, NULL)) ; -#endif - GrB_Matrix_free_(&B) ; GrB_Matrix_free_(&A) ; GrB_Scalar_free_(&thunk) ; @@ -968,7 +922,7 @@ void mexFunction OK (GxB_Vector_Option_get_INT32 (victor, GxB_SPARSITY_STATUS, &sparsity)) ; CHECK (sparsity == GxB_SPARSE) ; - GxB_Format_Value fmt ; + int fmt ; OK (GxB_Vector_Option_get_(victor, GxB_FORMAT, &fmt)) ; CHECK (fmt == GxB_BY_COL) ; @@ -1020,7 +974,7 @@ void mexFunction GrB_Matrix_free_(&A) ; OK (GrB_Matrix_new (&A, GrB_FP64, 8, 8)) ; - GrB_Index I [1] = { 0 }, J [1] = { 0 } ; + uint64_t I [1] = { 0 }, J [1] = { 0 } ; // OK OK (GrB_Matrix_assign_FP64_(A, NULL, GrB_PLUS_FP64, (double) 2, I, 1, J, 1, NULL)) ; GxB_Matrix_fprint_(A, GxB_COMPLETE, NULL) ; @@ -1045,106 +999,11 @@ void mexFunction GrB_Vector_free_(&victor) ; printf ("removeElement: OK\n") ; -#if 0 - //-------------------------------------------------------------------------- - // select error handling - //-------------------------------------------------------------------------- - - GxB_SelectOp selectop = NULL ; - OK (GxB_SelectOp_new (&selectop, - (GxB_select_function) select_plus_one, GrB_FP64, GrB_FP64)) ; - OK (GxB_SelectOp_wait_(selectop, GrB_MATERIALIZE)) ; - OK (GrB_Matrix_new (&A, GrB_FP64, 8, 8)) ; - OK (GrB_Matrix_new (&C, GrB_FP64, 8, 8)) ; - for (int i = 0 ; i < 8 ; i++) - { - OK (GrB_Matrix_setElement_FP64 (A, i, i, i)) ; - } - OK (GxB_Matrix_fprint_(A, GxB_COMPLETE, NULL)) ; - OK (GrB_Scalar_new (&thunk, GrB_FP64)) ; - OK (GrB_Scalar_setElement_FP64 (thunk, 4)) ; - OK (GxB_Matrix_select_(C, NULL, NULL, selectop, A, thunk, NULL)) ; - - printf ("\nprint in one-based, long format:\n") ; - bool onebased ; - OK (GxB_Global_Option_set (GxB_PRINT_1BASED, true)) ; - OK (GxB_Global_Option_get (GxB_PRINT_1BASED, &onebased)) ; - CHECK (onebased) ; - - int32_t onebased2 ; - OK (GxB_Global_Option_get_INT32 (GxB_PRINT_1BASED, &onebased2)) ; - CHECK (onebased2) ; - - OK (GxB_Global_Option_set_INT32 (GxB_PRINT_1BASED, false)) ; - OK (GxB_Global_Option_get_INT32 (GxB_PRINT_1BASED, &onebased2)) ; - CHECK (!onebased2) ; - - OK (GxB_Matrix_fprint_(C, GxB_COMPLETE_VERBOSE, NULL)) ; - OK (GxB_Global_Option_set (GxB_PRINT_1BASED, true)) ; - OK (GxB_Global_Option_get (GxB_PRINT_1BASED, &onebased)) ; - CHECK (onebased) ; - - OK (GxB_Global_Option_get_INT32 (GxB_PRINT_1BASED, &onebased2)) ; - CHECK (onebased2) ; - - OK (GxB_Global_Option_set_INT32 (GxB_PRINT_1BASED, true)) ; - OK (GxB_Global_Option_get_INT32 (GxB_PRINT_1BASED, &onebased2)) ; - CHECK (onebased2) ; - - expected = GrB_NULL_POINTER ; - ERR1 (C, GxB_Matrix_select_(C, NULL, NULL, selectop, A, NULL, NULL)) ; - GrB_Matrix_error_(&err, C) ; - printf ("Error expected: %d\n%s\n", info, err) ; - - expected = GrB_EMPTY_OBJECT ; - OK (GrB_Scalar_clear (thunk)) ; - ERR1 (C, GxB_Matrix_select_(C, NULL, NULL, selectop, A, thunk, NULL)) ; - GrB_Matrix_error_(&err, C) ; - printf ("Error expected: %d\n%s\n", info, err) ; - - expected = GrB_DOMAIN_MISMATCH ; - GrB_Scalar_free_(&thunk) ; - OK (GrB_Scalar_new (&thunk, GrB_FP32)) ; - ERR1 (C, GxB_Matrix_select_(C, NULL, NULL, selectop, A, thunk, NULL)) ; - GrB_Matrix_error_(&err, C) ; - printf ("Error expected: %d\n%s\n", info, err) ; - - GxB_SelectOp_free_(&selectop) ; - OK (GxB_SelectOp_new (&selectop, - (GxB_select_function) select_nothing, GrB_FP64, NULL)) ; - ERR1 (C, GxB_Matrix_select_(C, NULL, NULL, selectop, A, thunk, NULL)) ; - GrB_Matrix_error_(&err, C) ; - printf ("Error expected: %d\n%s\n", info, err) ; - - expected = GrB_UNINITIALIZED_OBJECT ; -// OK (GrB_Type_new (&user_type, sizeof (user_int))) ; - OK (GxB_Type_new (&user_type, sizeof (user_int), "user_int", - "typedef int16_t user_int ;")) ; - user_type->magic = 0xDEAD ; - ERR (GxB_Type_fprint_(user_type, GxB_COMPLETE, NULL)) ; - expected = GrB_INVALID_OBJECT ; - selectop->ytype = user_type ; - ERR (GxB_SelectOp_fprint_(selectop, GxB_COMPLETE, NULL)) ; - user_type->magic = GB_MAGIC ; - GrB_Type_free_(&user_type) ; - - expected = GrB_UNINITIALIZED_OBJECT ; - thunk->magic = 0xDEAD ; - ERR (GxB_Scalar_fprint (thunk, "thunk", GxB_COMPLETE, NULL)) ; - thunk->magic = GB_MAGIC ; - printf ("Error expected: %d\n", info) ; - - GrB_Matrix_free_(&A) ; - GrB_Matrix_free_(&C) ; - GrB_Scalar_free_(&thunk) ; - GxB_SelectOp_free_(&selectop) ; -#endif - //-------------------------------------------------------------------------- // GrB_Scalar //-------------------------------------------------------------------------- - GrB_Index nvals = 42 ; + uint64_t nvals = 42 ; GrB_Scalar scalar = NULL, scalar2 = NULL ; OK (GrB_Scalar_new (&scalar, GrB_FP64)) ; OK (GrB_Scalar_nvals (&nvals, scalar)) ; @@ -1303,13 +1162,13 @@ void mexFunction // assign scalar into hypersparse //-------------------------------------------------------------------------- - GrB_Index n = INT32_MAX ; + uint64_t n = INT32_MAX ; n = n * 1024 ; OK (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; OK (GrB_Matrix_assign_FP64_(A, NULL, NULL, (double) 1, GrB_ALL, n, GrB_ALL, n, NULL)) ; OK (GxB_Matrix_fprint (A, "A iso full", 3, NULL)) ; - GrB_Index I0 [1] = { 0 } ; + uint64_t I0 [1] = { 0 } ; // OK expected = GrB_OUT_OF_MEMORY ; ERR1 (A, GrB_Matrix_assign_FP64_(A, NULL, NULL, (double) 2, I0, 1, I0, 1, NULL)) ; diff --git a/GraphBLAS/Test/GB_mex_test10.c b/GraphBLAS/Test/GB_mex_test10.c index 140bac5224..0fb4a30a08 100644 --- a/GraphBLAS/Test/GB_mex_test10.c +++ b/GraphBLAS/Test/GB_mex_test10.c @@ -2,7 +2,7 @@ // GB_mex_test10: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test11.c b/GraphBLAS/Test/GB_mex_test11.c index 25065d5866..9c0004ee5a 100644 --- a/GraphBLAS/Test/GB_mex_test11.c +++ b/GraphBLAS/Test/GB_mex_test11.c @@ -2,7 +2,7 @@ // GB_mex_test11: JIT testing and set/get //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,13 +26,13 @@ void myinc (float *z, const float *x) { (*z) = (*x)+1 ; } #define MYINC_DEFN \ "void myinc (float *z, const float *x) { (*z) = (*x)+1 ; }" -void myidx (int64_t *z, const void *x, GrB_Index i, GrB_Index j, const void *y); -void myidx (int64_t *z, const void *x, GrB_Index i, GrB_Index j, const void *y) +void myidx (int64_t *z, const void *x, uint64_t i, uint64_t j, const void *y); +void myidx (int64_t *z, const void *x, uint64_t i, uint64_t j, const void *y) { (*z) = i + j ; } #define MYIDX_DEFN \ -"void myidx (int64_t *z, const void *x, GrB_Index i, GrB_Index j," \ +"void myidx (int64_t *z, const void *x, uint64_t i, uint64_t j," \ " const void *y)\n" \ "{ \n" \ " (*z) = (int64_t) (i + j) ; \n" \ @@ -57,6 +57,9 @@ void mexFunction size_t mysize = 99 ; bool use_cmake = false ; + #define MAXLEN 4096 + char save_string [MAXLEN+1] ; + //-------------------------------------------------------------------------- // startup GraphBLAS //-------------------------------------------------------------------------- @@ -71,7 +74,7 @@ void mexFunction remove ("/tmp/grberr2.txt") ; remove ("/tmp/grb_error_log.txt") ; - system ("rm -rf /tmp/grb_cache") ; + int ignore = system ("rm -rf /tmp/grb_cache") ; //-------------------------------------------------------------------------- // determine if GraphBLAS was compiled with GRAPHBLAS_USE_JIT @@ -93,17 +96,29 @@ if (jit_enabled) OK (GrB_assign (A, NULL, NULL, 1, GrB_ALL, 3, GrB_ALL, 4, NULL)) ; OK (GxB_Matrix_iso (&iso, A)) ; CHECK (iso) ; + int iso2 = false ; + OK (GrB_Matrix_get_INT32 (A, &iso2, GxB_ISO)) ; + CHECK (iso == iso2) ; + OK (GrB_Matrix_setElement (A, 3, 0, 0)) ; OK (GxB_Matrix_iso (&iso, A)) ; CHECK (!iso) ; + OK (GrB_Matrix_get_INT32 (A, &iso2, GxB_ISO)) ; + CHECK (iso == iso2) ; OK (GrB_Vector_new (&v, GrB_FP32, 3)) ; OK (GrB_assign (v, NULL, NULL, 1, GrB_ALL, 3, NULL)) ; OK (GxB_Vector_iso (&iso, v)) ; CHECK (iso) ; + OK (GrB_Vector_get_INT32 (v, &iso2, GxB_ISO)) ; + CHECK (iso == iso2) ; + OK (GrB_Vector_setElement (v, 3, 0)) ; OK (GxB_Vector_iso (&iso, v)) ; CHECK (!iso) ; + OK (GrB_Vector_get_INT32 (v, &iso2, GxB_ISO)) ; + CHECK (iso == iso2) ; + OK (GrB_free (&v)) ; OK (GxB_set (GxB_PRINT_1BASED, true)) ; @@ -117,6 +132,10 @@ if (jit_enabled) CHECK (onebased_int == 0) ; OK (GrB_free (&A)) ; + //-------------------------------------------------------------------------- + // try cmake + //-------------------------------------------------------------------------- + OK (GxB_set (GxB_BURBLE, true)) ; OK (GxB_set (GxB_JIT_USE_CMAKE, true)) ; OK (GxB_get (GxB_JIT_USE_CMAKE, &use_cmake)) ; @@ -124,7 +143,6 @@ if (jit_enabled) OK (GxB_Global_Option_get_INT32 (GxB_JIT_USE_CMAKE, &use_cmake_int)) ; CHECK (use_cmake_int == 1) ; - // try cmake GrB_Type MyType = NULL ; info = GxB_Type_new (&MyType, 0, "mytype", "typedef double mytype ;") ; if (info != GrB_SUCCESS || MyType->size != sizeof (double)) @@ -139,11 +157,15 @@ if (jit_enabled) CHECK (mysize == sizeof (double)) ; OK (GrB_free (&MyType)) ; + //-------------------------------------------------------------------------- + // test compiler name + //-------------------------------------------------------------------------- + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_NAME, &c)) ; printf ("default compiler [%s]\n", c) ; - int len = strlen (c) ; - char *save_c = mxMalloc (len+2) ; - strcpy (save_c, c) ; + strncpy (save_string, c, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_C_COMPILER_NAME, "cc")) ; OK (GxB_get (GxB_JIT_C_COMPILER_NAME, &s)) ; CHECK (MATCH (s, "cc")) ; @@ -153,19 +175,20 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_NAME, &t)) ; CHECK (MATCH (t, "gcc")) ; - #ifdef __APPLE__ - // reset the compiler back to the default on the Mac - OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_NAME, save_c)) ; - #endif - mxFree (save_c) ; - save_c = NULL ; + // reset the compiler back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_NAME, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_NAME, &t)) ; + CHECK (MATCH (t, save_string)) ; + //-------------------------------------------------------------------------- // test compiler flags + //-------------------------------------------------------------------------- + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_FLAGS, &s)) ; printf ("default flags [%s]\n", s) ; - len = strlen (s) ; - char *save_flags = mxMalloc (len+2) ; - strcpy (save_flags, s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_C_COMPILER_FLAGS, "-g")) ; OK (GxB_get (GxB_JIT_C_COMPILER_FLAGS, &s)) ; CHECK (MATCH (s, "-g")) ; @@ -174,13 +197,21 @@ if (jit_enabled) OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_FLAGS, "-O0")) ; OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_FLAGS, &t)) ; CHECK (MATCH (t, "-O0")) ; - OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_FLAGS, save_flags)) ; - mxFree (save_flags) ; - save_flags = NULL ; + // reset the flags back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_FLAGS, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_FLAGS, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- // test libraries for cmake + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_C_CMAKE_LIBS, &s)) ; printf ("default C cmake libs [%s]\n", s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + printf ("set cmake libs:\n") ; OK (GxB_set (GxB_JIT_C_CMAKE_LIBS, "m")) ; printf ("get cmake libs:\n") ; @@ -192,17 +223,37 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_CMAKE_LIBS, &t)) ; CHECK (MATCH (t, "m;dl")) ; + // reset the cmake libraries back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_CMAKE_LIBS, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_CMAKE_LIBS, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- + // test new type + //-------------------------------------------------------------------------- + OK (GxB_Type_new (&MyType, 0, "mytype", "typedef int32_t mytype ;")) ; OK (GxB_Type_size (&mysize, MyType)) ; CHECK (mysize == sizeof (int32_t)) ; OK (GrB_free (&MyType)) ; + //-------------------------------------------------------------------------- + // switch back from cmake to use the C compiler + //-------------------------------------------------------------------------- + OK (GxB_Global_Option_set_INT32 (GxB_JIT_USE_CMAKE, false)) ; OK (GxB_get (GxB_JIT_USE_CMAKE, &use_cmake)) ; CHECK (use_cmake == false) ; + //-------------------------------------------------------------------------- + // test C linker flags + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_C_LINKER_FLAGS, &s)) ; printf ("default linker flags [%s]\n", s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_C_LINKER_FLAGS, "-shared")) ; OK (GxB_get (GxB_JIT_C_LINKER_FLAGS, &s)) ; CHECK (MATCH (s, "-shared")) ; @@ -212,8 +263,20 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_LINKER_FLAGS, &t)) ; CHECK (MATCH (t, " -shared ")) ; + // reset the C linker flags back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_LINKER_FLAGS, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_LINKER_FLAGS, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- + // test C libraries + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_C_LIBRARIES, &s)) ; printf ("default C libraries [%s]\n", s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_C_LIBRARIES, "-lm")) ; OK (GxB_get (GxB_JIT_C_LIBRARIES, &s)) ; CHECK (MATCH (s, "-lm")) ; @@ -223,8 +286,20 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_LIBRARIES, &t)) ; CHECK (MATCH (t, "-lm -ldl")) ; + // reset the C libraries back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_LIBRARIES, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_LIBRARIES, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- + // test C preface + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_C_PREFACE, &s)) ; printf ("default C preface [%s]\n", s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_C_PREFACE, "// stuff here")) ; OK (GxB_get (GxB_JIT_C_PREFACE, &s)) ; CHECK (MATCH (s, "// stuff here")) ; @@ -234,8 +309,20 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_PREFACE, &t)) ; CHECK (MATCH (t, "// more stuff here")) ; + // reset the C preface back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_PREFACE, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_PREFACE, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- + // test CUDA preface + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_CUDA_PREFACE, &s)) ; printf ("default CUDA preface [%s]\n", s) ; + strncpy (save_string, s, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_CUDA_PREFACE, "// cuda stuff here")) ; OK (GxB_get (GxB_JIT_CUDA_PREFACE, &s)) ; CHECK (MATCH (s, "// cuda stuff here")) ; @@ -246,6 +333,15 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_CUDA_PREFACE, &t)) ; CHECK (MATCH (t, "// more cuda stuff here")) ; + // reset the CUDA preface back to the default + OK (GxB_Global_Option_set_CHAR (GxB_JIT_CUDA_PREFACE, save_string)) ; + OK (GxB_Global_Option_get_CHAR (GxB_JIT_CUDA_PREFACE, &t)) ; + CHECK (MATCH (t, save_string)) ; + + //-------------------------------------------------------------------------- + // test JIT error handling + //-------------------------------------------------------------------------- + OK (GxB_Type_new (&MyType, 0, "mytype", "typedef double mytype ;")) ; OK (GxB_Type_size (&mysize, MyType)) ; CHECK (mysize == sizeof (double)) ; @@ -280,11 +376,12 @@ if (jit_enabled) CHECK (MyType == NULL) ; printf ("\n------------------------ compile error log (intentional):\n") ; - system ("cat /tmp/grb_error_log.txt") ; + ignore = system ("cat /tmp/grb_error_log.txt") ; printf ("\n-------------------------------------------------------\n\n") ; OK (GxB_Global_Option_get_CHAR (GxB_JIT_ERROR_LOG, &s)) ; CHECK (MATCH (s, "/tmp/grb_error_log.txt")) ; + OK (GxB_Global_Option_set_CHAR (GxB_JIT_ERROR_LOG, "/tmp/grberr2.txt")) ; OK (GxB_Global_Option_get_CHAR (GxB_JIT_ERROR_LOG, &s)) ; CHECK (MATCH (s, "/tmp/grberr2.txt")) ; @@ -294,14 +391,18 @@ if (jit_enabled) CHECK (MyType == NULL) ; printf ("\n------------------------ compile error log (intentional):\n") ; - system ("cat /tmp/grberr2.txt") ; + ignore = system ("cat /tmp/grberr2.txt") ; printf ("\n-------------------------------------------------------\n\n") ; + //-------------------------------------------------------------------------- + // test JIT cache path + //-------------------------------------------------------------------------- + OK (GxB_get (GxB_JIT_CACHE_PATH, &cache)) ; printf ("default cache path: [%s]\n", cache) ; - len = strlen (cache) ; - char *save_cache = mxMalloc (len+2) ; - strcpy (save_cache, cache) ; + strncpy (save_string, cache, MAXLEN) ; + save_string [MAXLEN] = '\0' ; + OK (GxB_set (GxB_JIT_CACHE_PATH, "/tmp/grb_cache")) ; OK (GxB_get (GxB_JIT_CACHE_PATH, &s)) ; printf ("new cache path: [%s]\n", s) ; @@ -346,20 +447,19 @@ if (jit_enabled) ERR (GxB_Global_Option_set_CHAR (GxB_JIT_CACHE_PATH, "/root/noperm")) ; OK (GxB_get (GxB_JIT_C_CONTROL, &control)) ; CHECK (control == GxB_JIT_RUN) ; - printf ("\nhere %d control is now: %d\n", __LINE__, GB_jitifyer_get_control ( )) ; // restore cache path - printf ("set back to default cache path: [%s]\n", save_cache) ; - OK (GxB_Global_Option_set_CHAR (GxB_JIT_CACHE_PATH, save_cache)) ; OK (GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; + printf ("\nhere %d control is now: %d\n", __LINE__, + GB_jitifyer_get_control ( )) ; + printf ("\nset back to default cache path: [%s]\n", save_string) ; + OK (GxB_Global_Option_set_CHAR (GxB_JIT_CACHE_PATH, save_string)) ; OK (GxB_Global_Option_get_CHAR (GxB_JIT_CACHE_PATH, &s)) ; - printf ("cache [%s]\n" , save_cache) ; + printf ("cache [%s]\n" , save_string) ; printf ("s [%s]\n" , s) ; - CHECK (MATCH (s, save_cache)) ; - mxFree (save_cache) ; - save_cache = NULL ; + CHECK (MATCH (s, save_string)) ; } //-------------------------------------------------------------------------- @@ -562,12 +662,16 @@ if (jit_enabled) //-------------------------------------------------------------------------- GB_WERK ("about11") ; - GrB_Index I [1] = {0} ; + uint64_t I [1] = {0} ; // OK int Ikind = GB_LIST ; int64_t Icolon [3] = {0,0,0}, imin_result, imax_result ; bool I_is_unsorted, I_has_dupl, I_is_contig ; - OK (GB_ijproperties (I, 0, 0, 5, + OK (GB_ijproperties ( + // input: + I, false, 0, 0, 5, + // input/output: &Ikind, Icolon, + // output: &I_is_unsorted, &I_has_dupl, &I_is_contig, &imin_result, &imax_result, Werk)) ; printf ("ijproperties: imin %ld imax %ld\n", imin_result, imax_result) ; @@ -581,7 +685,7 @@ if (jit_enabled) // remove temp files and folders remove ("/tmp/grberr2.txt") ; remove ("/tmp/grb_error_log.txt") ; - system ("rm -rf /tmp/grb_cache") ; + ignore = system ("rm -rf /tmp/grb_cache") ; OK (GxB_set (GxB_BURBLE, false)) ; GB_mx_put_global (true) ; diff --git a/GraphBLAS/Test/GB_mex_test12.c b/GraphBLAS/Test/GB_mex_test12.c index 72eebd094a..1543ab42ee 100644 --- a/GraphBLAS/Test/GB_mex_test12.c +++ b/GraphBLAS/Test/GB_mex_test12.c @@ -2,7 +2,7 @@ // GB_mex_test12: more simple tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -51,21 +51,21 @@ void mexFunction GrB_Info expected = GrB_DOMAIN_MISMATCH ; const char *error ; - ERR (GrB_Matrix_assign_Scalar (A, NULL, NULL, scalar, + ERR (GrB_Matrix_assign_Scalar_(A, NULL, NULL, scalar, GrB_ALL, 3, GrB_ALL, 3, NULL)) ; OK (GrB_Matrix_error (&error, A)) ; printf ("expected: %s\n", error) ; - ERR (GxB_Matrix_subassign_Scalar (A, NULL, NULL, scalar, + ERR (GxB_Matrix_subassign_Scalar_(A, NULL, NULL, scalar, GrB_ALL, 3, GrB_ALL, 3, NULL)) ; OK (GrB_Matrix_error (&error, A)) ; printf ("expected: %s\n", error) ; - ERR (GrB_Vector_assign_Scalar (v, NULL, NULL, scalar, GrB_ALL, 3, NULL)) ; + ERR (GrB_Vector_assign_Scalar_(v, NULL, NULL, scalar, GrB_ALL, 3, NULL)) ; OK (GrB_Vector_error (&error, v)) ; printf ("expected: %s\n", error) ; - ERR (GxB_Vector_subassign_Scalar (v, NULL, NULL, scalar, GrB_ALL, 3, NULL)); + ERR (GxB_Vector_subassign_Scalar_(v, NULL, NULL, scalar, GrB_ALL, 3, NULL)); OK (GrB_Vector_error (&error, v)) ; printf ("expected: %s\n", error) ; diff --git a/GraphBLAS/Test/GB_mex_test13.c b/GraphBLAS/Test/GB_mex_test13.c index d64a582b03..c75c99c47a 100644 --- a/GraphBLAS/Test/GB_mex_test13.c +++ b/GraphBLAS/Test/GB_mex_test13.c @@ -2,7 +2,7 @@ // GB_mex_test13: more JIT tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -66,7 +66,7 @@ void mexFunction { unsetenv ("GRAPHBLAS_CACHE_PATH") ; } - system ("rm -rf /tmp/grbcache13") ; + int ignore = system ("rm -rf /tmp/grbcache13") ; cache_env = getenv ("GRAPHBLAS_CACHE_PATH") ; CHECK (cache_env == NULL) ; diff --git a/GraphBLAS/Test/GB_mex_test14.c b/GraphBLAS/Test/GB_mex_test14.c index 505b3bbc92..bc8d54d7e6 100644 --- a/GraphBLAS/Test/GB_mex_test14.c +++ b/GraphBLAS/Test/GB_mex_test14.c @@ -2,7 +2,7 @@ // GB_mex_test14: more simple tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test15.c b/GraphBLAS/Test/GB_mex_test15.c index a678684cea..0f8df2b499 100644 --- a/GraphBLAS/Test/GB_mex_test15.c +++ b/GraphBLAS/Test/GB_mex_test15.c @@ -2,7 +2,7 @@ // GB_mex_test15: JIT error handling //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -34,7 +34,7 @@ void mexFunction // create some valid matrices //-------------------------------------------------------------------------- - GrB_Index n = 4 ; + uint64_t n = 4 ; GrB_Matrix A = NULL, B = NULL, F = NULL, C = NULL, D = NULL, G = NULL, S = NULL, H = NULL, F2 = NULL, F3 = NULL ; OK (GrB_Matrix_new (&A, GrB_FP32, n, n)) ; @@ -180,8 +180,8 @@ void mexFunction ERR (GxB_Matrix_concat (G, Tiles, 2, 2, NULL)) ; // split full - GrB_Index Tile_rows [2] = {2, 2} ; - GrB_Index Tile_cols [2] = {2, 2} ; + uint64_t Tile_rows [2] = {2, 2} ; + uint64_t Tile_cols [2] = {2, 2} ; ERR (GxB_Matrix_split (Tiles, 2, 2, Tile_rows, Tile_cols, F, NULL)) ; // split sparse diff --git a/GraphBLAS/Test/GB_mex_test16.c b/GraphBLAS/Test/GB_mex_test16.c index e424589aa6..423ca950aa 100644 --- a/GraphBLAS/Test/GB_mex_test16.c +++ b/GraphBLAS/Test/GB_mex_test16.c @@ -2,7 +2,7 @@ // GB_mex_test16: JIT error handling //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -41,7 +41,7 @@ void mexFunction // create some valid matrices //-------------------------------------------------------------------------- - GrB_Index n = 4 ; + uint64_t n = 4 ; GrB_Matrix A = NULL, B = NULL, C = NULL ; GrB_Vector v = NULL ; OK (GrB_Matrix_new (&A, GrB_FP32, n, n)) ; @@ -115,20 +115,22 @@ void mexFunction GB_jit_encoding e ; char *suffix ; uint64_t code = GB_encodify_mxm (&e, &suffix, 0, false, false, GxB_SPARSE, - GrB_FP32, NULL, false, false, s, false, A, B) ; + GrB_FP32, false, false, false, NULL, false, false, s, false, A, B) ; CHECK (code == UINT64_MAX) ; code = GB_encodify_reduce (&e, &suffix, GB_JIT_KERNEL_REDUCE, mon, A) ; CHECK (code == UINT64_MAX) ; code = GB_encodify_assign (&e, &suffix, /* kcode: */ 0, C, - /* C_replace: */ false, /* Ikind: */ 0, /* Jkind: */ 0, /* M: */ NULL, + /* C_replace: */ false, /* I_is_32: */ false, /* J_is_32: */ false, + /* Ikind: */ 0, /* Jkind: */ 0, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, /* accum: */ mult, A, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ 0) ; CHECK (code == UINT64_MAX) ; - code = GB_encodify_build (&e, &suffix, 0, mult, GrB_FP32, GrB_FP32) ; + code = GB_encodify_build (&e, &suffix, 0, mult, GrB_FP32, GrB_FP32, + true, true, true, true, false) ; CHECK (code == UINT64_MAX) ; //-------------------------------------------------------------------------- @@ -156,9 +158,9 @@ void mexFunction OK (GrB_Matrix_new (&C, GrB_FP32, 2*n, 2*n)) ; OK (GxB_set (A, GxB_SPARSITY_CONTROL, GxB_BITMAP)) ; OK (GxB_set (C, GxB_SPARSITY_CONTROL, GxB_BITMAP)) ; - OK (GrB_Row_assign (A, NULL, NULL, v, 0, GrB_ALL, n, NULL)) ; - OK (GrB_Col_assign (A, NULL, NULL, v, GrB_ALL, n, 0, NULL)) ; - GrB_Index I [4] = {0,1,2,3} ; + OK (GrB_Row_assign_(A, NULL, NULL, v, 0, GrB_ALL, n, NULL)) ; + OK (GrB_Col_assign_(A, NULL, NULL, v, GrB_ALL, n, 0, NULL)) ; + uint64_t I [4] = {0,1,2,3} ; // OK OK (GrB_assign (C, NULL, NULL, A, I, 4, I, 4, NULL)) ; OK (GxB_subassign (C, NULL, NULL, A, I, 4, I, 4, NULL)) ; diff --git a/GraphBLAS/Test/GB_mex_test17.c b/GraphBLAS/Test/GB_mex_test17.c index 3585116953..67fc560f4a 100644 --- a/GraphBLAS/Test/GB_mex_test17.c +++ b/GraphBLAS/Test/GB_mex_test17.c @@ -2,7 +2,7 @@ // GB_mex_test17: reduce to vector with user-data type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test18.c b/GraphBLAS/Test/GB_mex_test18.c index 1dd1e9b3f4..357fa2b82e 100644 --- a/GraphBLAS/Test/GB_mex_test18.c +++ b/GraphBLAS/Test/GB_mex_test18.c @@ -2,7 +2,7 @@ // GB_mex_test18: demacrofy tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test19.c b/GraphBLAS/Test/GB_mex_test19.c index effac0ab39..cb74132590 100644 --- a/GraphBLAS/Test/GB_mex_test19.c +++ b/GraphBLAS/Test/GB_mex_test19.c @@ -2,7 +2,7 @@ // GB_mex_test19: serialize/deserialize tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ void mexFunction // OK (GxB_print (A, 2)) ; void *blob = NULL ; - GrB_Index blob_size ; + uint64_t blob_size ; // default compression OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; diff --git a/GraphBLAS/Test/GB_mex_test2.c b/GraphBLAS/Test/GB_mex_test2.c index 5d15b75e08..b56b5e12cb 100644 --- a/GraphBLAS/Test/GB_mex_test2.c +++ b/GraphBLAS/Test/GB_mex_test2.c @@ -2,7 +2,7 @@ // GB_mex_test2: more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -83,7 +83,9 @@ void mexFunction OK (GxB_Scalar_fprint (scalar, "scalar after remove", 3, NULL)) ; i = 777 ; expected = GrB_NO_VALUE ; +// printf ("here %d\n", __LINE__) ; ERR (GrB_Scalar_extractElement_INT32 (&i, scalar)) ; +// printf ("here %d %d\n", __LINE__, i) ; CHECK (i == 777) ; // force a zombie into the scalar @@ -93,13 +95,19 @@ void mexFunction OK (GxB_Matrix_Option_set ((GrB_Matrix) scalar, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; CHECK (scalar->i != NULL) ; - scalar->i [0] = GB_ZOMBIE (0) ; + GB_MDECL (Si, , ) ; + Si = scalar->i ; + GB_IPTR (Si, scalar->i_is_32) ; + i = GB_ZOMBIE (0) ; + GB_ISET (Si, 0, i) ; // Si [0] = i scalar->nzombies = 1 ; OK (GxB_Scalar_fprint (scalar, "scalar with zombie", 3, NULL)) ; expected = GrB_NO_VALUE ; + i = 123456 ; ERR (GrB_Scalar_extractElement_INT32 (&i, scalar)) ; OK (GxB_Scalar_fprint (scalar, "scalar after extract", 3, NULL)) ; - CHECK (i == 777) ; +// printf ("here %d %d\n", __LINE__, i) ; + CHECK (i == 123456) ; GrB_Vector_free_(&victor) ; GrB_Matrix_free_(&A) ; @@ -129,15 +137,21 @@ void mexFunction //-------------------------------------------------------------------------- int64_t Slice [30] ; - GB_p_slice (Slice, A->p, n, 2, true) ; + GB_p_slice (Slice, A->p, A->p_is_32, n, 2, true) ; CHECK (Slice [0] == 0) ; int64_t Ap [11] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; - GB_p_slice (Slice, Ap, 10, 10, false) ; + GB_p_slice (Slice, Ap, /* OK: */ false, 10, 10, false) ; printf ("Slice: ") ; for (int k = 0 ; k <= 10 ; k++) printf (" %ld", Slice [k]) ; printf ("\n") ; + int32_t Ap_32 [11] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; + GB_p_slice (Slice, Ap_32, true, 10, 10, false) ; + printf ("Slice32: ") ; + for (int k = 0 ; k <= 10 ; k++) printf (" %ld", Slice [k]) ; + printf ("\n") ; + GrB_Matrix_free_(&A) ; //-------------------------------------------------------------------------- @@ -159,14 +173,14 @@ void mexFunction OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; OK (GxB_Matrix_fprint (A, "valid matrix", GxB_SHORT, NULL)) ; // mangle the matrix - GB_FREE (&(A->p), A->p_size) ; - GB_FREE (&(A->x), A->x_size) ; // OK + GB_free_memory (&(A->p), A->p_size) ; + GB_free_memory (&(A->x), A->x_size) ; // OK expected = GrB_INVALID_OBJECT ; ERR (GxB_Matrix_fprint (A, "invalid sparse matrix", GxB_SHORT, NULL)) ; GrB_Matrix_free_(&A) ; OK (GrB_Matrix_new (&A, GrB_INT32, n, n)) ; - A->sparsity_control = 999 ; + A->sparsity_control = 0 ; ERR (GxB_Matrix_fprint (A, "invalid sparsity control", GxB_SHORT, NULL)) ; GrB_Matrix_free_(&A) ; @@ -188,7 +202,7 @@ void mexFunction ERR (GxB_Matrix_fprint (A, "full matrix cannot have zombies", GxB_SHORT, NULL)) ; A->nzombies = 0 ; - CHECK (GB_Pending_alloc (&(A->Pending), false, GrB_INT32, NULL, true, 4)) ; + CHECK (GB_Pending_alloc (A, false, GrB_INT32, NULL, 4)) ; ERR (GxB_Matrix_fprint (A, "full matrix cannot have pending tuples", GxB_SHORT, NULL)) ; GrB_Matrix_free_(&A) ; @@ -229,8 +243,8 @@ void mexFunction OK (GxB_Global_Option_set_(GxB_BURBLE, true)) ; OK (GrB_Matrix_new (&A, GrB_INT32, n, n)) ; - GrB_Index I [3] = { 1, 1, 0 } ; - int32_t I32 [3] = { 1, 1, 0 } ; + uint64_t I [3] = { 1, 1, 0 } ; // OK + int32_t I32 [3] = { 1, 1, 0 } ; // OK OK (GrB_Matrix_new (&C, GrB_INT32, n, 0)) ; OK (GrB_Matrix_extract_(C, NULL, NULL, A, GrB_ALL, n, I, GxB_STRIDE, NULL)) ; @@ -245,7 +259,7 @@ void mexFunction OK (GxB_Global_Option_set_(GxB_BURBLE, false)) ; int64_t Icolon [3] = { 1, 1, 0 } ; - CHECK (!GB_ij_is_in_list (NULL, 0, 0, GB_STRIDE, Icolon)) ; + CHECK (!GB_ij_is_in_list (NULL, false, 0, 0, GB_STRIDE, Icolon)) ; //-------------------------------------------------------------------------- // GB_any_aliased @@ -255,14 +269,14 @@ void mexFunction OK (GrB_Matrix_setElement_INT32 (A, 12345, 0, 0)) ; OK (GrB_Matrix_dup (&C, A)) ; CHECK (!GB_any_aliased (A, C)) ; - GB_FREE (&(C->p), C->p_size) ; + GB_free_memory (&(C->p), C->p_size) ; C->p = A->p ; C->p_shallow = true ; CHECK (GB_any_aliased (A, C)) ; C->p = NULL ; C->p_shallow = false ; CHECK (!GB_any_aliased (A, C)) ; - GB_FREE (&(C->i), C->i_size) ; + GB_free_memory (&(C->i), C->i_size) ; C->i = A->i ; C->i_shallow = true ; CHECK (GB_any_aliased (A, C)) ; @@ -316,18 +330,23 @@ void mexFunction OK (GrB_Descriptor_free (&desc)) ; //-------------------------------------------------------------------------- - // GrB_build an empty matrix + // GrB_build an empty matrix of type GrB_UINT32 //-------------------------------------------------------------------------- OK (GrB_Matrix_new (&A, GrB_INT32, n, n)) ; - OK (GrB_Matrix_build_INT32 (A, I, I, I32, 0, GrB_PLUS_INT32)) ; + OK (GrB_Matrix_build_INT32 (A, I, I, I32, 0, GrB_PLUS_INT32)) ; // OK OK (GxB_Matrix_fprint (A, "empty", GxB_COMPLETE, NULL)) ; CHECK (!GB_is_shallow (A)) ; + + int shallow = true ; + OK (GrB_Matrix_get_INT32 (A, &shallow, GxB_IS_READONLY)) ; + CHECK (!shallow) ; + GrB_Matrix_free_(&A) ; OK (GrB_Matrix_new (&A, GrB_INT32, n, n)) ; expected = GrB_DOMAIN_MISMATCH ; - ERR (GrB_Matrix_build_INT32 (A, I, I, I32, 0, GxB_FIRSTI_INT32)) ; + ERR (GrB_Matrix_build_INT32 (A, I, I, I32, 0, GxB_FIRSTI_INT32)) ; // OK OK (GrB_Matrix_error (&message, A)) ; printf ("expected error: %s\n", message) ; GrB_Matrix_free_(&A) ; @@ -376,8 +395,11 @@ void mexFunction // jumble the matrix C->jumbled = true ; - C->i [0] = 1 ; - C->i [1] = 0 ; + GB_MDECL (Ci, , ) ; + Ci = C->i ; + GB_IPTR (Ci, C->i_is_32) ; + GB_ISET (Ci, 0, 1) ; // Ci [0] = 1 ; + GB_ISET (Ci, 1, 0) ; // Ci [1] = 0 ; OK (GxB_Matrix_fprint (C, "wild matrix jumbled", GxB_SHORT, NULL)) ; // unjumble the matrix @@ -410,7 +432,7 @@ void mexFunction NULL, UINT64_MAX, false, NULL) ; if (info != GrB_INVALID_VALUE || X != NULL) mexErrMsgTxt ("huge fail1") ; - GrB_Index nhuge = (((GrB_Index) 2) << 50) ; + uint64_t nhuge = (((uint64_t) 2) << 50) ; info = GxB_Matrix_import_BitmapC (&X, GrB_FP32, nhuge, nhuge, NULL, NULL, 0, 0, false, 0, NULL) ; if (info != GrB_INVALID_VALUE || X != NULL) mexErrMsgTxt ("huge fail5") ; @@ -423,7 +445,7 @@ void mexFunction GrB_Matrix_free (&X) ; //-------------------------------------------------------------------------- - // hypermatrix prune + // hyper_prune //-------------------------------------------------------------------------- OK (GrB_Matrix_new (&C, GrB_FP32, GB_NMAX, GB_NMAX)) ; @@ -431,7 +453,7 @@ void mexFunction OK (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; OK (GxB_Matrix_fprint (C, "huge matrix", GxB_SHORT, NULL)) ; C->nvec_nonempty = -1 ; - OK (GB_hypermatrix_prune (C, NULL)) ; + OK (GB_hyper_prune (C, NULL)) ; CHECK (C->nvec_nonempty == 1) ; GrB_Matrix_free (&C) ; @@ -466,8 +488,8 @@ void mexFunction GrB_Matrix Tiles [4] ; memset (Tiles, 0, 4 * sizeof (GrB_Matrix)) ; n = 20 ; - GrB_Index Tile_nrows [2] = { 5, 15 } ; - GrB_Index Tile_ncols [2] = { 12, 8 } ; + uint64_t Tile_nrows [2] = { 5, 15 } ; + uint64_t Tile_ncols [2] = { 12, 8 } ; for (int k = 0 ; k <= 3 ; k++) { diff --git a/GraphBLAS/Test/GB_mex_test20.c b/GraphBLAS/Test/GB_mex_test20.c index 1babd4db17..a5c35a734d 100644 --- a/GraphBLAS/Test/GB_mex_test20.c +++ b/GraphBLAS/Test/GB_mex_test20.c @@ -2,7 +2,7 @@ // GB_mex_test20: test GB_mask //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test21.c b/GraphBLAS/Test/GB_mex_test21.c index b580e9573e..3fa1051f47 100644 --- a/GraphBLAS/Test/GB_mex_test21.c +++ b/GraphBLAS/Test/GB_mex_test21.c @@ -2,12 +2,12 @@ // GB_mex_test21: test JIT functionality currently not used by GraphBLAS itself //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// The enumfy/macrofy methods handle more cases than are currently used by +// The enumify/macrofy methods handle more cases than are currently used by // the JIT kernels, such as (1) typecasting the output of the accum/monoid/op // to the type of C, (2) positional select operators, (3) positional index // unary operators, and (4) the case when the output C matrix is iso-valued. @@ -28,16 +28,16 @@ #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; -void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, GrB_Index i, GrB_Index j, +void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, uint64_t i, uint64_t j, const GxB_FC32_t *y) ; -void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, GrB_Index i, GrB_Index j, +void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, uint64_t i, uint64_t j, const GxB_FC32_t *y) { (*z) = (*x) ; } #define OPI32_DEFN \ -"void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, GrB_Index i, GrB_Index j, \n" \ -" const GxB_FC32_t *y) \n" \ +"void opi32func (GxB_FC32_t *z, const GxB_FC32_t *x, uint64_t i, uint64_t j,\n"\ +" const GxB_FC32_t *y) \n" \ "{ \n" \ " (*z) = (*x) ; \n" \ "}" @@ -63,7 +63,7 @@ void mexFunction // results are written to a single log file //-------------------------------------------------------------------------- - FILE *fp = fopen ("log_GB_mex_test21.txt", "w") ; + FILE *fp = fopen ("tmp/log_GB_mex_test21.txt", "w") ; CHECK (fp != NULL) ; //-------------------------------------------------------------------------- @@ -114,7 +114,7 @@ void mexFunction fprintf (fp, "GB_assign_describe\n") ; printf ("GB_assign_describe\n") ; char str [2048] ; - GB_assign_describe (str, 2048, false, GB_ALL, GB_ALL, + GB_assign_describe (str, 2048, false, GB_ALL, GB_ALL, /* M_is_null: */ true, /* M_sparsity: */ GxB_SPARSE, /* Mask_comp: */ true, /* Mask_struct: */ true, /* accum: */ NULL, /* A_is_null: */ false, GB_ASSIGN) ; @@ -130,6 +130,7 @@ void mexFunction printf ("GB_enumify_ewise / GB_macrofy_ewise, C iso\n") ; GB_enumify_ewise (&method_code, false, false, false, true, /* C_iso: */ true, /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, + /* is32: */ false, false, false, /* M: */ NULL, false, false, GrB_LAND, false, false, A, B) ; GB_macrofy_ewise (fp, method_code, GB_JIT_KERNEL_ADD, GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; @@ -139,6 +140,7 @@ void mexFunction printf ("GB_enumify_ewise / GB_macrofy_ewise, C non iso\n") ; GB_enumify_ewise (&method_code, false, false, false, true, /* C_iso: */ false, /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, + /* is32: */ false, false, false, /* M: */ NULL, false, false, GrB_LAND, false, false, A, B) ; GB_macrofy_ewise (fp, method_code, GB_JIT_KERNEL_ADD, GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; @@ -151,7 +153,8 @@ void mexFunction fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, C iso\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, C iso\n") ; GB_enumify_mxm (&method_code, /* C_iso: */ true, /* C_in_iso: */ true, - GxB_SPARSE, GrB_BOOL, /* M: */ NULL, false, false, + GxB_SPARSE, GrB_BOOL, /* is_32: */ false, false, false, + /* M: */ NULL, false, false, GrB_LAND_LOR_SEMIRING_BOOL, /* flipxy: */ true, A, B) ; GB_macrofy_mxm (fp, method_code, GrB_LAND_LOR_SEMIRING_BOOL, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; @@ -160,7 +163,8 @@ void mexFunction fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, any_pair, flipxy\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, any_pair, flipxy\n") ; GB_enumify_mxm (&method_code, /* C_iso: */ true, /* C_in_iso: */ false, - GxB_SPARSE, GrB_BOOL, /* M: */ NULL, false, false, + GxB_SPARSE, GrB_BOOL, /* is_32: */ false, false, false, + /* M: */ NULL, false, false, GxB_ANY_PAIR_BOOL, /* flipxy: */ true, A, B) ; GB_macrofy_mxm (fp, method_code, GxB_ANY_PAIR_BOOL, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; @@ -169,7 +173,8 @@ void mexFunction fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, any_pair fp32\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, any_pair fp32\n") ; GB_enumify_mxm (&method_code, /* C_iso: */ false, /* C_in_iso: */ false, - GxB_SPARSE, GrB_FP32, /* M: */ NULL, false, false, + GxB_SPARSE, GrB_FP32, /* is_32: */ false, false, false, + /* M: */ NULL, false, false, GxB_ANY_PAIR_FP32, /* flipxy: */ true, A, B) ; GB_macrofy_mxm (fp, method_code, GxB_ANY_PAIR_FP32, GrB_FP32, GrB_FP32, GrB_FP32) ; @@ -193,8 +198,8 @@ void mexFunction fprintf (fp, "GB_enumify_select / GB_macrofy_select: %s\n", op->name) ; printf ("GB_enumify_select / GB_macrofy_select: %s\n", op->name) ; // GxB_print (op, 3) ; - GB_enumify_select (&method_code, /* C iso: */ false, - /* inplace A: */ false, op, /* flipij: */ false, A) ; + GB_enumify_select (&method_code, /* C: */ A, + op, /* flipij: */ false, A) ; GB_macrofy_select (fp, method_code, op, GrB_BOOL) ; } @@ -204,8 +209,8 @@ void mexFunction GrB_IndexUnaryOp opi ; OK (GxB_IndexUnaryOp_new (&opi, (GxB_index_unary_function) opi32func, GxB_FC32, GxB_FC32, GxB_FC32, "opi32func", OPI32_DEFN)) ; - GB_enumify_select (&method_code, /* C iso: */ false, - /* inplace A: */ false, opi, /* flipij: */ false, A) ; + GB_enumify_select (&method_code, /* C: */ A, + opi, /* flipij: */ false, A) ; GB_macrofy_select (fp, method_code, opi, GxB_FC32) ; GrB_free (&opi) ; @@ -226,8 +231,8 @@ void mexFunction fprintf (fp, "GB_enumify_apply / GB_macrofy_apply: %s\n", op->name) ; printf ("GB_enumify_apply / GB_macrofy_apply: %s\n", op->name) ; GB_enumify_apply (&method_code, GxB_SPARSE, true, GrB_INT32, - (GB_Operator) op, false, - GB_sparsity (A), true, GrB_INT32, A->iso, A->nzombies) ; + false, false, false, (GB_Operator) op, false, GB_sparsity (A), + true, GrB_INT32, false, false, false, A->iso, A->nzombies) ; GB_macrofy_apply (fp, method_code, (GB_Operator) op, GrB_INT32, GrB_INT32) ; } @@ -237,8 +242,8 @@ void mexFunction fprintf (fp, "GB_enumify_apply / GB_macrofy_apply: %s\n", op1->name) ; printf ("GB_enumify_apply / GB_macrofy_apply: %s\n", op1->name) ; GB_enumify_apply (&method_code, GxB_SPARSE, true, GrB_INT32, - (GB_Operator) op1, false, - GB_sparsity (A), true, GrB_INT32, A->iso, A->nzombies) ; + false, false, false, (GB_Operator) op1, false, GB_sparsity (A), + true, GrB_INT32, false, false, false, A->iso, A->nzombies) ; GB_macrofy_apply (fp, method_code, (GB_Operator) op1, GrB_INT32, GrB_INT32) ; @@ -250,14 +255,16 @@ void mexFunction GrB_BinaryOp op2 = GxB_TIMES_FC32 ; fprintf (fp, "GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; printf ("GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; - GB_enumify_build (&method_code, op2, GrB_BOOL, GrB_BOOL) ; + GB_enumify_build (&method_code, op2, GrB_BOOL, GrB_BOOL, false, false, + false, false, false) ; GB_macrofy_build (fp, method_code, op2, GrB_BOOL, GrB_BOOL) ; HEADER ; op2 = GrB_LAND ; fprintf (fp, "GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; printf ("GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; - GB_enumify_build (&method_code, op2, GxB_FC32, GxB_FC32) ; + GB_enumify_build (&method_code, op2, GxB_FC32, GxB_FC32, false, false, + false, false, true) ; GB_macrofy_build (fp, method_code, op2, GxB_FC32, GxB_FC32) ; //-------------------------------------------------------------------------- @@ -270,7 +277,9 @@ void mexFunction "C(lo:hi,lo:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)=A (assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, A, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -283,7 +292,9 @@ void mexFunction "C(lo:s:hi,lo:s:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:s:hi,lo:s:hi)=A (assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_STRIDE, GB_STRIDE, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_STRIDE, GB_STRIDE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, A, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -296,8 +307,10 @@ void mexFunction "C(i,J)=s (row assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(i,J)=s (row assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_ALL, GB_LIST, /* M: */ NULL, - /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_ALL, GB_LIST, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ NULL, /* scalar_type: */ GxB_FC32, /* S: */ NULL, /* assign_kind: */ GB_ROW_ASSIGN) ; GB_macrofy_assign (fp, method_code, accum, @@ -309,8 +322,10 @@ void mexFunction "C(I,j)=s (col assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(I,j)=s (col assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_LIST, GB_ALL, /* M: */ NULL, - /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_LIST, GB_ALL, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ NULL, /* scalar_type: */ GxB_FC32, /* S: */ NULL, /* assign_kind: */ GB_COL_ASSIGN) ; GB_macrofy_assign (fp, method_code, accum, @@ -322,9 +337,10 @@ void mexFunction "C_iso(lo:hi,lo:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)=A (assign) \n") ; - GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, - /* M: */ NULL, - /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + GB_enumify_assign (&method_code, C_iso, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; GB_macrofy_assign (fp, method_code, accum, @@ -336,7 +352,9 @@ void mexFunction "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; - GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C_iso, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -349,7 +367,9 @@ void mexFunction "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; - GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C_iso, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ NULL, /* scalar_type: */ GrB_INT32, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -362,7 +382,9 @@ void mexFunction "C(lo:hi,lo:hi)+=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)+=A (assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ H, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -375,7 +397,9 @@ void mexFunction "C(lo:hi,lo:hi)&=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)&=A (assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ A, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -391,7 +415,9 @@ void mexFunction "C(lo:hi,lo:hi)<=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)<=A (assign) \n") ; - GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ A, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; @@ -404,7 +430,9 @@ void mexFunction "C_iso(lo:hi,lo:hi)<=H (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)<=H (assign) \n") ; - GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + GB_enumify_assign (&method_code, C_iso, /* C_replace: */ false, + /* I_is_32: */ false, /* J_is_32: */ false, + GB_RANGE, GB_RANGE, /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, /* A: */ H, /* scalar_type: */ NULL, /* S: */ NULL, /* assign_kind: */ GB_ASSIGN) ; diff --git a/GraphBLAS/Test/GB_mex_test22.c b/GraphBLAS/Test/GB_mex_test22.c index a1dfb0363f..1300a481a0 100644 --- a/GraphBLAS/Test/GB_mex_test22.c +++ b/GraphBLAS/Test/GB_mex_test22.c @@ -2,7 +2,7 @@ // GB_mex_test22: reduce to scalar with user-data types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -38,11 +38,11 @@ void myadd32 (my32 *z, const my32 *x, const my32 *y) typedef struct { double a ; double b ; double c ; double d ; - double e ; double f ; double g ; double h ; } my64 ; + double e ; double f ; double g ; double k ; } my64 ; #define MY64_DEFN \ "typedef struct { \n" \ " double a ; double b ; double c ; double d ; \n" \ -" double e ; double f ; double g ; double h ; } my64 ; " +" double e ; double f ; double g ; double k ; } my64 ; " void myadd64 (my64 *z, const my64 *x, const my64 *y) ; void myadd64 (my64 *z, const my64 *x, const my64 *y) @@ -54,7 +54,7 @@ void myadd64 (my64 *z, const my64 *x, const my64 *y) z->e = x->e + y->e ; z->f = x->f + y->f ; z->g = x->g + y->g ; - z->h = x->h + y->h ; + z->k = x->k + y->k ; } #define MYADD64_DEFN \ @@ -67,7 +67,7 @@ void myadd64 (my64 *z, const my64 *x, const my64 *y) " z->e = x->e + y->e ; \n" \ " z->f = x->f + y->f ; \n" \ " z->g = x->g + y->g ; \n" \ -" z->h = x->h + y->h ; \n" \ +" z->k = x->k + y->k ; \n" \ "}" void mexFunction @@ -160,7 +160,7 @@ void mexFunction zero64.e = 0 ; zero64.f = 0 ; zero64.g = 0 ; - zero64.h = 0 ; + zero64.k = 0 ; GrB_Monoid Monoid64 = NULL ; OK (GrB_Monoid_new_UDT (&Monoid64, MyAdd64, (void *) &zero64)) ; OK (GxB_print (Monoid64, 3)) ; @@ -183,11 +183,11 @@ void mexFunction z64.e = 1-k ; z64.f = 99 ; z64.g = i+j+k ; - z64.h = k-j ; + z64.k = k-j ; OK (GrB_Matrix_setElement_UDT (A, (void *) &z64, i, j)) ; printf ("A (%d, %d) = (%g, %g, %g, %g, %g, %g, %g, %g)\n", i, j, z64.a, z64.b, z64.c, z64.d, - z64.e, z64.f, z64.g, z64.h) ; + z64.e, z64.f, z64.g, z64.k) ; } } OK (GrB_wait (A, GrB_MATERIALIZE)) ; @@ -195,7 +195,7 @@ void mexFunction OK (GrB_Matrix_reduce_UDT ((void *) &z64, NULL, Monoid64, A, NULL)) ; printf ("sum: (%g, %g, %g, %g, %g, %g, %g, %g)\n", - z64.a, z64.b, z64.c, z64.d, z64.e, z64.f, z64.g, z64.h) ; + z64.a, z64.b, z64.c, z64.d, z64.e, z64.f, z64.g, z64.k) ; CHECK (z64.a == 55) ; CHECK (z64.b == 40) ; CHECK (z64.c == 0) ; @@ -203,7 +203,7 @@ void mexFunction CHECK (z64.e == -55) ; CHECK (z64.f == 990) ; CHECK (z64.g == 95) ; - CHECK (z64.h == 45) ; + CHECK (z64.k == 45) ; GrB_free (&A) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test24.c b/GraphBLAS/Test/GB_mex_test24.c index 9ff667fbd4..2efbc44f01 100644 --- a/GraphBLAS/Test/GB_mex_test24.c +++ b/GraphBLAS/Test/GB_mex_test24.c @@ -2,7 +2,7 @@ // GB_mex_test24: JIT error handling //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test25.c b/GraphBLAS/Test/GB_mex_test25.c index 2c5900c38c..610fc56785 100644 --- a/GraphBLAS/Test/GB_mex_test25.c +++ b/GraphBLAS/Test/GB_mex_test25.c @@ -2,7 +2,7 @@ // GB_mex_test25: more simple tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,10 +36,10 @@ void mexFunction //-------------------------------------------------------------------------- GrB_Vector v ; - GrB_Index nmax = GrB_INDEX_MAX + 1 ; - GrB_Index nvals ; + uint64_t nmax = GrB_INDEX_MAX + 1 ; + uint64_t nvals ; - for (GrB_Index n = nmax - 5 ; n <= nmax ; n++) + for (uint64_t n = nmax - 5 ; n <= nmax ; n++) { printf ("n %lu, nmax %lu, (n == nmax): %d\n", n, nmax, n == nmax) ; OK (GrB_Vector_new (&v, GrB_BOOL, n)) ; @@ -51,7 +51,7 @@ void mexFunction } GrB_Matrix A ; - GrB_Index n = (GrB_INDEX_MAX + 1) / 2 ; + uint64_t n = (GrB_INDEX_MAX + 1) / 2 ; OK (GrB_Matrix_new (&A, GrB_BOOL, n, 2)) ; OK (GrB_assign (A, NULL, NULL, true, GrB_ALL, n, GrB_ALL, 2, NULL)) ; OK (GxB_print (A, 1)) ; diff --git a/GraphBLAS/Test/GB_mex_test26.c b/GraphBLAS/Test/GB_mex_test26.c index f3a276a27e..487f98c8fa 100644 --- a/GraphBLAS/Test/GB_mex_test26.c +++ b/GraphBLAS/Test/GB_mex_test26.c @@ -2,7 +2,7 @@ // GB_mex_test26: test GrB_get and GrB_set (type, scalar, vector, matrix) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -346,9 +346,9 @@ void mexFunction CHECK (i == sizeof (mytype)) ; expected = GrB_INVALID_VALUE ; - ERR (GrB_Type_get_Scalar_(type, s_int32, (GrB_Field) GrB_OUTP)) ; - ERR (GrB_Type_get_String_(type, name, (GrB_Field) GrB_OUTP)) ; - ERR (GrB_Type_get_SIZE_(type, &size, (GrB_Field) GrB_OUTP)) ; + ERR (GrB_Type_get_Scalar_(type, s_int32, GrB_OUTP)) ; + ERR (GrB_Type_get_String_(type, name, GrB_OUTP)) ; + ERR (GrB_Type_get_SIZE_(type, &size, GrB_OUTP)) ; ERR (GrB_Type_get_SIZE_(GrB_FP32, &i, GrB_SIZE)) ; @@ -389,16 +389,16 @@ void mexFunction printf ("scalar storage: %d\n", i) ; CHECK (i == GrB_COLMAJOR) ; - OK (GrB_Scalar_get_INT32_(s, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Scalar_get_INT32_(s, &i, GxB_FORMAT)) ; printf ("scalar storage: %d\n", i) ; CHECK (i == GxB_BY_COL) ; - OK (GrB_Scalar_get_INT32_(s, &i, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Scalar_get_INT32_(s, &i, GxB_SPARSITY_CONTROL)) ; printf ("sparsity control: %d\n", i) ; CHECK (i == GxB_AUTO_SPARSITY) ; GxB_print (s_int32, 3) ; - OK (GrB_Scalar_get_INT32_(s_int32, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Scalar_get_INT32_(s_int32, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_FULL) ; @@ -458,7 +458,7 @@ void mexFunction printf ("vector storage: %d\n", i) ; CHECK (i == GrB_COLMAJOR) ; - OK (GrB_Vector_get_INT32_(v, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Vector_get_INT32_(v, &i, GxB_FORMAT)) ; printf ("vector storage: %d\n", i) ; CHECK (i == GxB_BY_COL) ; @@ -466,14 +466,14 @@ void mexFunction OK (GrB_Vector_get_INT32_(v, &i, GrB_STORAGE_ORIENTATION_HINT)) ; CHECK (i == GrB_COLMAJOR) ; - OK (GrB_Vector_get_INT32_(v, &i, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Vector_get_INT32_(v, &i, GxB_SPARSITY_CONTROL)) ; printf ("sparsity control: %d\n", i) ; CHECK (i == GxB_AUTO_SPARSITY) ; OK (GrB_assign (v, NULL, NULL, 1, GrB_ALL, 10, NULL)) ; GxB_print (v, 3) ; - OK (GrB_Vector_get_INT32_(v, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Vector_get_INT32_(v, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_FULL) ; @@ -482,33 +482,33 @@ void mexFunction ERR (GrB_Vector_get_SIZE_(v, &size, 0)) ; fvalue = -1 ; - OK (GrB_Vector_get_Scalar_(v, s_fp32, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Vector_get_Scalar_(v, s_fp32, GxB_BITMAP_SWITCH)) ; OK (GrB_Scalar_extractElement_FP32_(&fvalue, s_fp32)) ; printf ("bitmap switch: %g\n", fvalue) ; CHECK (fabs (fvalue - 0.04) < 1e-6) ; OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.5)) ; - OK (GrB_Vector_set_Scalar_(v, s_fp32, (GrB_Field) GxB_BITMAP_SWITCH)) ; - OK (GrB_Vector_get_Scalar_(v, s_fp64, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Vector_set_Scalar_(v, s_fp32, GxB_BITMAP_SWITCH)) ; + OK (GrB_Vector_get_Scalar_(v, s_fp64, GxB_BITMAP_SWITCH)) ; OK (GrB_Scalar_extractElement_FP64_(&dvalue, s_fp64)) ; printf ("bitmap switch: %g\n", dvalue) ; CHECK (fabs (dvalue - 0.5) < 1e-6) ; OK (GrB_Scalar_setElement_INT32_(s_int32, GxB_BITMAP)) ; - OK (GrB_Vector_set_Scalar_(v, s_int32, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Vector_set_Scalar_(v, s_int32, GxB_SPARSITY_CONTROL)) ; GxB_print (v, 3) ; - OK (GrB_Vector_get_INT32_(v, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Vector_get_INT32_(v, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_BITMAP) ; - OK (GrB_Vector_set_INT32_(v, GxB_SPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; - OK (GrB_Vector_get_INT32_(v, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Vector_set_INT32_(v, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Vector_get_INT32_(v, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_SPARSE) ; - ERR (GrB_Vector_set_Scalar_(v, s_int32, (GrB_Field) GxB_HYPER_SWITCH)) ; - ERR (GrB_Vector_get_Scalar_(v, s_int32, (GrB_Field) GxB_HYPER_SWITCH)) ; + ERR (GrB_Vector_set_Scalar_(v, s_int32, GxB_HYPER_SWITCH)) ; + ERR (GrB_Vector_get_Scalar_(v, s_int32, GxB_HYPER_SWITCH)) ; OK (GrB_Vector_set_String_(v, "vector name", GrB_NAME)) ; OK (GrB_Vector_get_String_(v, name, GrB_NAME)) ; @@ -527,7 +527,7 @@ void mexFunction expected = GrB_EMPTY_OBJECT ; OK (GrB_Scalar_clear (s_int32)) ; - ERR (GrB_Vector_set_Scalar_(v, s_int32, (GrB_Field) GxB_FORMAT)) ; + ERR (GrB_Vector_set_Scalar_(v, s_int32, GxB_FORMAT)) ; //-------------------------------------------------------------------------- // GrB_Matrix get/set @@ -560,18 +560,18 @@ void mexFunction printf ("matrix storage: %d\n", i) ; CHECK (i == GrB_COLMAJOR) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_FORMAT)) ; printf ("matrix storage: %d\n", i) ; CHECK (i == GxB_BY_COL) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_SPARSITY_CONTROL)) ; printf ("sparsity control: %d\n", i) ; CHECK (i == GxB_AUTO_SPARSITY) ; OK (GrB_assign (A, NULL, NULL, 1, GrB_ALL, 5, GrB_ALL, 5, NULL)) ; GxB_print (A, 3) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_FULL) ; @@ -580,29 +580,29 @@ void mexFunction ERR (GrB_Matrix_get_SIZE_(A, &size, 0)) ; fvalue = -1 ; - OK (GrB_Matrix_get_Scalar_(A, s_fp32, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Matrix_get_Scalar_(A, s_fp32, GxB_BITMAP_SWITCH)) ; OK (GrB_Scalar_extractElement_FP32_(&fvalue, s_fp32)) ; printf ("bitmap switch: %g\n", fvalue) ; CHECK (fabs (fvalue - 0.08) < 1e-6) ; OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.5)) ; - OK (GrB_Matrix_set_Scalar_(A, s_fp32, (GrB_Field) GxB_BITMAP_SWITCH)) ; - OK (GrB_Matrix_get_Scalar_(A, s_fp64, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Matrix_set_Scalar_(A, s_fp32, GxB_BITMAP_SWITCH)) ; + OK (GrB_Matrix_get_Scalar_(A, s_fp64, GxB_BITMAP_SWITCH)) ; OK (GrB_Scalar_extractElement_FP64_(&dvalue, s_fp64)) ; printf ("bitmap switch: %g\n", dvalue) ; CHECK (fabs (dvalue - 0.5) < 1e-6) ; OK (GrB_Scalar_setElement_INT32_(s_int32, GxB_BITMAP)) ; - OK (GrB_Matrix_set_Scalar_(A, s_int32, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_Scalar_(A, s_int32, GxB_SPARSITY_CONTROL)) ; GxB_print (A, 3) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_SPARSITY_STATUS)) ; printf ("sparsity status: %d\n", i) ; CHECK (i == GxB_BITMAP) ; OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.25)) ; - OK (GrB_Matrix_set_Scalar_(A, s_fp32, (GrB_Field) GxB_HYPER_SWITCH)) ; - OK (GrB_Matrix_get_Scalar_(A, s_fp64, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Matrix_set_Scalar_(A, s_fp32, GxB_HYPER_SWITCH)) ; + OK (GrB_Matrix_get_Scalar_(A, s_fp64, GxB_HYPER_SWITCH)) ; OK (GrB_Scalar_extractElement_FP64_(&dvalue, s_fp64)) ; printf ("hyper switch: %g\n", dvalue) ; CHECK (fabs (dvalue - 0.25) < 1e-6) ; @@ -635,26 +635,26 @@ void mexFunction OK (GrB_Matrix_set_INT32_(A, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; OK (GrB_Matrix_get_INT32_(A, &i, GrB_STORAGE_ORIENTATION_HINT)) ; CHECK (i == GrB_ROWMAJOR) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_FORMAT)) ; CHECK (i == GxB_BY_ROW) ; GxB_print (A, 3) ; OK (GrB_Matrix_set_INT32_(A, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; OK (GrB_Matrix_get_INT32_(A, &i, GrB_STORAGE_ORIENTATION_HINT)) ; CHECK (i == GrB_COLMAJOR) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_FORMAT)) ; CHECK (i == GxB_BY_COL) ; GxB_print (A, 3) ; expected = GrB_INVALID_VALUE ; - ERR (GrB_Matrix_set_INT32_(A, 99, (GrB_Field) GxB_FORMAT)) ; + ERR (GrB_Matrix_set_INT32_(A, 99, GxB_FORMAT)) ; ERR (GrB_Matrix_set_INT32_(A, 99, 999)) ; ERR (GrB_Matrix_get_String_(A, defn, 999)) ; ERR (GrB_Matrix_get_Scalar(A, s_int32, 999)) ; expected = GrB_EMPTY_OBJECT ; OK (GrB_Scalar_clear (s_int32)) ; - ERR (GrB_Matrix_set_Scalar_(A, s_int32, (GrB_Field) GxB_FORMAT)) ; + ERR (GrB_Matrix_set_Scalar_(A, s_int32, GxB_FORMAT)) ; //-------------------------------------------------------------------------- // finalize GraphBLAS diff --git a/GraphBLAS/Test/GB_mex_test27.c b/GraphBLAS/Test/GB_mex_test27.c index 57c961f2cd..f41eb7b17d 100644 --- a/GraphBLAS/Test/GB_mex_test27.c +++ b/GraphBLAS/Test/GB_mex_test27.c @@ -2,7 +2,7 @@ // GB_mex_test27: test GrB_get and GrB_set (unary ops) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test28.c b/GraphBLAS/Test/GB_mex_test28.c index 521aaf965c..3c4a24f1d4 100644 --- a/GraphBLAS/Test/GB_mex_test28.c +++ b/GraphBLAS/Test/GB_mex_test28.c @@ -2,7 +2,7 @@ // GB_mex_test28: test GrB_get and GrB_set (binary ops) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test29.c b/GraphBLAS/Test/GB_mex_test29.c index 7f52bac712..a1abc55974 100644 --- a/GraphBLAS/Test/GB_mex_test29.c +++ b/GraphBLAS/Test/GB_mex_test29.c @@ -2,7 +2,7 @@ // GB_mex_test29: test GrB_get and GrB_set (global) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -92,7 +92,7 @@ void mexFunction CHECK (i == GrB_NONBLOCKING) ; i = -1 ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_MODE)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_MODE)) ; CHECK (i == GrB_NONBLOCKING) ; OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GrB_STORAGE_ORIENTATION_HINT)) ; @@ -138,66 +138,66 @@ void mexFunction ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 999, GrB_STORAGE_ORIENTATION_HINT)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_FORMAT)) ; - ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 999, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_FORMAT)) ; + ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 999, GxB_FORMAT)) ; CHECK (i == GxB_BY_COL) ; int32_t nth ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &nth, (GrB_Field) GxB_GLOBAL_NTHREADS)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &nth, GxB_GLOBAL_NTHREADS)) ; printf ("nthreads: %d\n", nth) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 2, (GrB_Field) GxB_GLOBAL_NTHREADS)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_GLOBAL_NTHREADS)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 2, GxB_GLOBAL_NTHREADS)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_GLOBAL_NTHREADS)) ; CHECK (i == 2) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, nth, (GrB_Field) GxB_GLOBAL_NTHREADS)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, nth, GxB_GLOBAL_NTHREADS)) ; int32_t gpu ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &gpu, (GrB_Field) GxB_GLOBAL_GPU_ID)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &gpu, GxB_GLOBAL_GPU_ID)) ; printf ("gpu id: %d\n", gpu) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 2, (GrB_Field) GxB_GLOBAL_GPU_ID)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_GLOBAL_GPU_ID)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 2, GxB_GLOBAL_GPU_ID)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_GLOBAL_GPU_ID)) ; CHECK (i == -1) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, gpu, (GrB_Field) GxB_GLOBAL_GPU_ID)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, gpu, GxB_GLOBAL_GPU_ID)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_BURBLE)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_BURBLE)) ; printf ("burble: %d\n", i) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, (GrB_Field) GxB_BURBLE)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GxB_BURBLE)) ; OK (GrB_Matrix_new (&A, GrB_FP32, 3, 3)) ; OK (GrB_assign (A, NULL, NULL, 3, GrB_ALL, 3, GrB_ALL, 3, NULL)) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 0, (GrB_Field) GxB_BURBLE)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 0, GxB_BURBLE)) ; OK (GrB_assign (A, NULL, NULL, 4, GrB_ALL, 3, GrB_ALL, 3, NULL)) ; OK (GxB_print (A, 2)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_LIBRARY_OPENMP)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_LIBRARY_OPENMP)) ; CHECK (i == 1) ; int32_t onebase ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &onebase, (GrB_Field) GxB_PRINT_1BASED)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &onebase, GxB_PRINT_1BASED)) ; printf ("1based: %d\n", i) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, (GrB_Field) GxB_PRINT_1BASED)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GxB_PRINT_1BASED)) ; OK (GxB_print (A, 2)) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, onebase, (GrB_Field) GxB_PRINT_1BASED)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_PRINT_1BASED)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, onebase, GxB_PRINT_1BASED)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_PRINT_1BASED)) ; CHECK (i == onebase) ; int32_t control ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &control, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &control, GxB_JIT_C_CONTROL)) ; printf ("jit ctrl: %d\n", control) ; for (int c = 0 ; c <= GxB_JIT_ON ; c++) { int32_t b ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, c, (GrB_Field) GxB_JIT_C_CONTROL)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &b, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, c, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &b, GxB_JIT_C_CONTROL)) ; CHECK (c == b) ; } - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, control, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, control, GxB_JIT_C_CONTROL)) ; int32_t use_cmake ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &use_cmake, (GrB_Field) GxB_JIT_USE_CMAKE)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &use_cmake, GxB_JIT_USE_CMAKE)) ; printf ("jit cmake %d\n", use_cmake) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, (GrB_Field) GxB_JIT_USE_CMAKE)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i,(GrB_Field) GxB_JIT_USE_CMAKE)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GxB_JIT_USE_CMAKE)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i,GxB_JIT_USE_CMAKE)) ; CHECK (i == 1) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, use_cmake, (GrB_Field) GxB_JIT_USE_CMAKE)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, use_cmake, GxB_JIT_USE_CMAKE)) ; expected = GrB_INVALID_VALUE ; ERR (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, GrB_BLOCKING_MODE)) ; @@ -208,36 +208,36 @@ void mexFunction OK (GrB_Scalar_setElement_INT32 (s_int32, 1)) ; ERR (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_int32, GrB_BLOCKING_MODE)) ; - OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_int32, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_int32, GxB_JIT_C_CONTROL)) ; OK (GrB_Scalar_setElement_INT32 (s_int32, 2)) ; - OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_int32, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_int32, GxB_JIT_C_CONTROL)) ; OK (GrB_Scalar_extractElement (&i, s_int32)) ; CHECK (i == 1) ; - OK (GrB_Global_set_INT32_ (GrB_GLOBAL, control, (GrB_Field) GxB_JIT_C_CONTROL)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_set_INT32_ (GrB_GLOBAL, control, GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i, GxB_JIT_C_CONTROL)) ; CHECK (i == control) ; - OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GxB_HYPER_SWITCH)) ; OK (GrB_Scalar_extractElement (&dvalue, s_fp64)) ; printf ("hyper switch: %g\n", dvalue) ; OK (GrB_Scalar_setElement (s_fp64, 0.75)) ; - OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, GxB_HYPER_SWITCH)) ; OK (GrB_Scalar_clear (s_fp64)) ; - OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GxB_HYPER_SWITCH)) ; OK (GrB_Scalar_extractElement (&dvalue, s_fp64)) ; CHECK (dvalue == 0.75) ; OK (GrB_Scalar_setElement_FP64 (s_fp64, 0.75)) ; - OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, GxB_HYPER_SWITCH)) ; OK (GrB_Scalar_clear (s_fp64)) ; - OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_CHUNK)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GxB_CHUNK)) ; OK (GrB_Scalar_extractElement (&dvalue, s_fp64)) ; printf ("chunk: %g\n", dvalue) ; OK (GrB_Scalar_setElement (s_fp64, 8901)) ; - OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_CHUNK)) ; + OK (GrB_Global_set_Scalar_ (GrB_GLOBAL, s_fp64, GxB_CHUNK)) ; OK (GrB_Scalar_clear (s_fp64)) ; - OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, (GrB_Field) GxB_CHUNK)) ; + OK (GrB_Global_get_Scalar_ (GrB_GLOBAL, s_fp64, GxB_CHUNK)) ; OK (GrB_Scalar_extractElement (&dvalue, s_fp64)) ; CHECK (dvalue == 8901) ; @@ -254,182 +254,181 @@ void mexFunction CHECK (MATCH (name, GxB_IMPLEMENTATION_NAME)) ; name [0] = 0 ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_LIBRARY_NAME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_LIBRARY_NAME)) ; printf ("library name: [%s]\n", name) ; CHECK (MATCH (name, GxB_IMPLEMENTATION_NAME)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_LIBRARY_DATE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_LIBRARY_DATE)) ; printf ("library date: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_LIBRARY_ABOUT)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_LIBRARY_ABOUT)) ; printf ("library about: [%s]\n", defn) ; CHECK (MATCH (defn, GxB_IMPLEMENTATION_ABOUT)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_LIBRARY_LICENSE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_LIBRARY_LICENSE)) ; printf ("library license: [%s]\n", defn) ; CHECK (MATCH (defn, GxB_IMPLEMENTATION_LICENSE)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_LIBRARY_COMPILE_DATE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_LIBRARY_COMPILE_DATE)) ; printf ("library compile date: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_LIBRARY_COMPILE_TIME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_LIBRARY_COMPILE_TIME)) ; printf ("library compile time: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_LIBRARY_URL)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_LIBRARY_URL)) ; printf ("library url: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_API_DATE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_API_DATE)) ; printf ("api date: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_API_ABOUT)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_API_ABOUT)) ; printf ("api about: [%s]\n", defn) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, name, (GrB_Field) GxB_API_URL)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, name, GxB_API_URL)) ; printf ("api url: [%s]\n", name) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_COMPILER_NAME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_COMPILER_NAME)) ; printf ("compiler: [%s]\n", defn) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_COMPILER_NAME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_COMPILER_NAME)) ; printf ("JIT C compiler: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "cc", (GrB_Field) GxB_JIT_C_COMPILER_NAME)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_COMPILER_NAME)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "cc", GxB_JIT_C_COMPILER_NAME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_COMPILER_NAME)) ; CHECK (MATCH (defn2, "cc")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_COMPILER_NAME)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_COMPILER_NAME)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_COMPILER_NAME)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_COMPILER_NAME)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_COMPILER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_COMPILER_FLAGS)) ; printf ("JIT C compiler flags: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "-O", (GrB_Field) GxB_JIT_C_COMPILER_FLAGS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_COMPILER_FLAGS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "-O", GxB_JIT_C_COMPILER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_COMPILER_FLAGS)) ; CHECK (MATCH (defn2, "-O")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_COMPILER_FLAGS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_COMPILER_FLAGS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_COMPILER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_COMPILER_FLAGS)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_LINKER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_LINKER_FLAGS)) ; printf ("JIT C link flags: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "-stuff", (GrB_Field) GxB_JIT_C_LINKER_FLAGS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_LINKER_FLAGS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "-stuff", GxB_JIT_C_LINKER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_LINKER_FLAGS)) ; CHECK (MATCH (defn2, "-stuff")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_LINKER_FLAGS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_LINKER_FLAGS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_LINKER_FLAGS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_LINKER_FLAGS)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_LIBRARIES)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_LIBRARIES)) ; printf ("JIT C libraries: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "-lm", (GrB_Field) GxB_JIT_C_LIBRARIES)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_LIBRARIES)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "-lm", GxB_JIT_C_LIBRARIES)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_LIBRARIES)) ; CHECK (MATCH (defn2, "-lm")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_LIBRARIES)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_LIBRARIES)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_LIBRARIES)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_LIBRARIES)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_CMAKE_LIBS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_CMAKE_LIBS)) ; printf ("JIT C cmake libs: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "m;dl", (GrB_Field) GxB_JIT_C_CMAKE_LIBS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_CMAKE_LIBS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "m;dl", GxB_JIT_C_CMAKE_LIBS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_CMAKE_LIBS)) ; CHECK (MATCH (defn2, "m;dl")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_CMAKE_LIBS)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_CMAKE_LIBS)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_CMAKE_LIBS)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_CMAKE_LIBS)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_C_PREFACE)) ; printf ("JIT C preface: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "// stuff", (GrB_Field) GxB_JIT_C_PREFACE)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "// stuff", GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_PREFACE)) ; CHECK (MATCH (defn2, "// stuff")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_C_PREFACE)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_C_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_C_PREFACE)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_CUDA_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_CUDA_PREFACE)) ; printf ("JIT CUDA preface: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "// cu", (GrB_Field) GxB_JIT_CUDA_PREFACE)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_CUDA_PREFACE)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "// cu", GxB_JIT_CUDA_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_CUDA_PREFACE)) ; CHECK (MATCH (defn2, "// cu")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_CUDA_PREFACE)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_CUDA_PREFACE)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_CUDA_PREFACE)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_CUDA_PREFACE)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_ERROR_LOG)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_ERROR_LOG)) ; printf ("JIT error log: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "errlog.txt", (GrB_Field) GxB_JIT_ERROR_LOG)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_ERROR_LOG)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "errlog.txt", GxB_JIT_ERROR_LOG)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_ERROR_LOG)) ; CHECK (MATCH (defn2, "errlog.txt")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_ERROR_LOG)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_ERROR_LOG)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_ERROR_LOG)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_ERROR_LOG)) ; CHECK (MATCH (defn2, defn)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn, GxB_JIT_CACHE_PATH)) ; printf ("JIT cache: [%s]\n", defn) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, "/tmp/stuff", (GrB_Field) GxB_JIT_CACHE_PATH)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, "/tmp/stuff", GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_CACHE_PATH)) ; CHECK (MATCH (defn2, "/tmp/stuff")) ; - OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, (GrB_Field) GxB_JIT_CACHE_PATH)) ; - OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, (GrB_Field) GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_set_String_ (GrB_GLOBAL, defn, GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_get_String_ (GrB_GLOBAL, defn2, GxB_JIT_CACHE_PATH)) ; CHECK (MATCH (defn2, defn)) ; - system ("ls /tmp/stuff ; rm -rf /tmp/stuff") ; + int ignore = system ("ls /tmp/stuff ; rm -rf /tmp/stuff") ; ERR (GrB_Global_set_String_ (GrB_GLOBAL, defn, GrB_NAME)) ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_JIT_CACHE_PATH)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_JIT_CACHE_PATH)) ; CHECK (size == strlen (defn) + 1) ; double sw [GxB_NBITMAP_SWITCH] ; double s2 [GxB_NBITMAP_SWITCH] ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_BITMAP_SWITCH)) ; CHECK (size == sizeof (double) * GxB_NBITMAP_SWITCH) ; - OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, (GrB_Field) GxB_BITMAP_SWITCH)) ; - OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) s2, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, GxB_BITMAP_SWITCH)) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) s2, GxB_BITMAP_SWITCH)) ; for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) { printf ("bitmap switch [%d] = %g\n", k, sw [k]) ; sw [k] = ((double) k) / 8. ; } - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) sw, (GrB_Field) GxB_BITMAP_SWITCH, + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) sw, GxB_BITMAP_SWITCH, size)) ; memset (sw, 0, size) ; - OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, GxB_BITMAP_SWITCH)) ; for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) { CHECK (sw [k] == ((double) k) / 8.) ; } - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, (GrB_Field) GxB_BITMAP_SWITCH, + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, GxB_BITMAP_SWITCH, 0)) ; - OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, (GrB_Field) GxB_BITMAP_SWITCH)) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) sw, GxB_BITMAP_SWITCH)) ; for (int k = 0 ; k < GxB_NBITMAP_SWITCH ; k++) { CHECK (sw [k] == s2 [k]) ; } - ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) s2, (GrB_Field) GxB_BITMAP_SWITCH, + ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) s2, GxB_BITMAP_SWITCH, 1)) ; ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, 0, 0)) ; - ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, (GrB_Field) GxB_PRINTF, 0)) ; - ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, (GrB_Field) GxB_FLUSH, 0)) ; - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) myprintf, (GrB_Field) GxB_PRINTF, + ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, GxB_PRINTF, 0)) ; + ERR (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, GxB_FLUSH, 0)) ; + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) myprintf, GxB_PRINTF, sizeof (GB_printf_function_t))) ; - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) myflush, (GrB_Field) GxB_FLUSH, + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) myflush, GxB_FLUSH, sizeof (GB_flush_function_t))) ; OK (GxB_print (s_int32, 3)) ; - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) mexPrintf, (GrB_Field) GxB_PRINTF, + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) mexPrintf, GxB_PRINTF, sizeof (GB_printf_function_t))) ; - OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, (GrB_Field) GxB_FLUSH, + OK (GrB_Global_set_VOID_ (GrB_GLOBAL, (void *) NULL, GxB_FLUSH, sizeof (GB_flush_function_t))) ; OK (GxB_print (s_int32, 3)) ; int32_t cv [3] ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_COMPILER_VERSION)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_COMPILER_VERSION)) ; CHECK (size == sizeof (int32_t) * 3) ; - OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) cv, - (GrB_Field) GxB_COMPILER_VERSION)) ; + OK (GrB_Global_get_VOID_ (GrB_GLOBAL, (void *) cv, GxB_COMPILER_VERSION)) ; for (int k = 0 ; k < 3 ; k++) { @@ -437,22 +436,22 @@ void mexFunction } void *f = NULL ; - OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, (GrB_Field) GxB_MALLOC_FUNCTION)) ; + OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, GxB_MALLOC_FUNCTION)) ; CHECK (f == mxMalloc) ; - OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, (GrB_Field) GxB_REALLOC_FUNCTION)) ; + OK (GrB_Global_get_VOID_(GrB_GLOBAL, (void *) &f, GxB_REALLOC_FUNCTION)) ; CHECK (f == mxRealloc) ; - OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, (GrB_Field) GxB_CALLOC_FUNCTION)) ; + OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, GxB_CALLOC_FUNCTION)) ; CHECK (f == mxCalloc) ; - OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, (GrB_Field) GxB_FREE_FUNCTION)) ; + OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) &f, GxB_FREE_FUNCTION)) ; CHECK (f == mxFree) ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_MALLOC_FUNCTION)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_MALLOC_FUNCTION)) ; CHECK (size == sizeof (void *)) ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_REALLOC_FUNCTION)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_REALLOC_FUNCTION)) ; CHECK (size == sizeof (void *)) ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_CALLOC_FUNCTION)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_CALLOC_FUNCTION)) ; CHECK (size == sizeof (void *)) ; - OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, (GrB_Field) GxB_FREE_FUNCTION)) ; + OK (GrB_Global_get_SIZE_ (GrB_GLOBAL, &size, GxB_FREE_FUNCTION)) ; CHECK (size == sizeof (void *)) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test3.c b/GraphBLAS/Test/GB_mex_test3.c index 9fa8a92fb2..06ecb3f2ca 100644 --- a/GraphBLAS/Test/GB_mex_test3.c +++ b/GraphBLAS/Test/GB_mex_test3.c @@ -2,7 +2,7 @@ // GB_mex_test3: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -79,7 +79,7 @@ void mexFunction OK (GrB_Matrix_new (&C, GrB_FP32, 10, 10)) ; printf ("\nBurble with standard printf/flush:\n") ; - GrB_Index nvals ; + uint64_t nvals ; OK (GrB_Matrix_nvals (&nvals, C)) ; CHECK (nvals == 0) ; @@ -213,27 +213,77 @@ void mexFunction // empty scalar for iso build //-------------------------------------------------------------------------- - GrB_Index I [4] = { 1, 2, 3, 4 } ; + uint64_t I [4] = { 1, 2, 3, 4 } ; // OK GrB_Scalar scalar = NULL ; OK (GrB_Scalar_new (&scalar, GrB_FP32)) ; OK (GxB_Scalar_fprint (scalar, "scalar init", GxB_COMPLETE, NULL)) ; OK (GrB_Matrix_new (&C, GrB_FP32, 10, 10)) ; OK (GrB_Vector_new (&w, GrB_FP32, 10)) ; expected = GrB_EMPTY_OBJECT ; - ERR (GxB_Matrix_build_Scalar (C, I, I, scalar, 4)) ; + ERR (GxB_Matrix_build_Scalar_(C, I, I, scalar, 4)) ; OK (GrB_error (&s, C)) ; printf ("expected error: [%s]\n", s) ; - ERR (GxB_Vector_build_Scalar (w, I, scalar, 4)) ; + ERR (GxB_Vector_build_Scalar_(w, I, scalar, 4)) ; OK (GrB_error (&s, w)) ; printf ("expected error: [%s]\n", s) ; + + GrB_Vector I_vector = NULL, J_vector = NULL, X_vector = NULL ; + OK (GrB_Vector_new (&I_vector, GrB_UINT32, 4)) ; + OK (GrB_Vector_new (&J_vector, GrB_UINT32, 5)) ; + OK (GrB_Vector_new (&X_vector, GrB_UINT32, 6)) ; + for (int k = 0 ; k < 4 ; k++) + { + OK (GrB_Vector_setElement_UINT32 (I_vector, I [k], k)) ; + } + for (int k = 0 ; k < 5 ; k++) + { + OK (GrB_Vector_setElement_UINT32 (J_vector, k, k)) ; + } + for (int k = 0 ; k < 6 ; k++) + { + OK (GrB_Vector_setElement_UINT32 (X_vector, 2*k+1, k)) ; + } + + ERR (GxB_Matrix_build_Scalar_Vector_(C, I_vector, I_vector, scalar, NULL)) ; + OK (GrB_error (&s, C)) ; + printf ("expected error: [%s]\n", s) ; + + ERR (GxB_Matrix_build_Scalar_Vector_(C, I_vector, I_vector, scalar, NULL)) ; + OK (GrB_error (&s, C)) ; + printf ("expected error: [%s]\n", s) ; + + ERR (GxB_Vector_build_Scalar_Vector_(w, I_vector, scalar, NULL)) ; + OK (GrB_error (&s, w)) ; + printf ("expected error: [%s]\n", s) ; + + OK (GrB_Scalar_setElement_FP32 (scalar, 3.0)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_Matrix_build_Scalar_Vector_(C, I_vector, J_vector, scalar, NULL)) ; + OK (GrB_error (&s, C)) ; + printf ("expected error: [%s]\n", s) ; + + ERR (GxB_Matrix_build_Vector_(C, I_vector, J_vector, X_vector, + GrB_PLUS_UINT32, NULL)) ; + OK (GrB_error (&s, C)) ; + printf ("expected error: [%s]\n", s) ; + + ERR (GxB_Vector_build_Vector_(w, I_vector, X_vector, + GrB_PLUS_UINT32, NULL)) ; + OK (GrB_error (&s, w)) ; + printf ("expected error: [%s]\n", s) ; + + GrB_Vector_free_(&I_vector) ; + GrB_Vector_free_(&J_vector) ; + GrB_Vector_free_(&X_vector) ; GrB_Vector_free_(&w) ; + GrB_Matrix_free_(&C) ; //-------------------------------------------------------------------------- // build error handling //-------------------------------------------------------------------------- - GrB_Matrix_free_(&C) ; OK (GrB_Type_new (&myint, sizeof (int))) ; OK (GrB_Matrix_new (&C, myint, 10, 10)) ; OK (GrB_Scalar_setElement_FP32 (scalar, 3.0)) ; @@ -250,7 +300,7 @@ void mexFunction OK (GrB_error (&s, C)) ; printf ("expected error: [%s]\n", s) ; - ERR (GxB_Matrix_build_Scalar (C, I, I, scalar, 4)) ; + ERR (GxB_Matrix_build_Scalar_(C, I, I, scalar, 4)) ; OK (GrB_error (&s, C)) ; printf ("expected error: [%s]\n", s) ; GrB_Matrix_free_(&C) ; @@ -268,8 +318,8 @@ void mexFunction } GrB_Type type ; - GrB_Index nrows, ncols, Ap_size, Ai_size, Ax_size, Ah_size, nvec ; - GrB_Index *Ap = NULL, *Ai = NULL, *Ah = NULL ; + uint64_t nrows, ncols, Ap_size, Ai_size, Ax_size, Ah_size, nvec ; + uint64_t *Ap = NULL, *Ai = NULL, *Ah = NULL ; // OK float *Ax = NULL ; bool iso, jumbled ; OK (GrB_Matrix_wait (C, GrB_MATERIALIZE)) ; @@ -360,8 +410,8 @@ void mexFunction OK (GrB_Matrix_new (&C, My4x64, 4, 4)) ; GrB_Matrix Tiles [4] = { NULL, NULL, NULL, NULL} ; - GrB_Index Tile_nrows [2] = { 2, 2 } ; - GrB_Index Tile_ncols [2] = { 2, 2 } ; + uint64_t Tile_nrows [2] = { 2, 2 } ; + uint64_t Tile_ncols [2] = { 2, 2 } ; for (int sparsity_control = 1 ; sparsity_control <= 8 ; @@ -499,7 +549,7 @@ void mexFunction OK (GrB_Matrix_assign_FP32 (A, NULL, NULL, 1, GrB_ALL, 4, GrB_ALL, 4, NULL)) ; OK (GxB_Matrix_fprint (A, "A iso", GxB_SHORT, NULL)) ; - OK (GrB_Matrix_assign (C, NULL, NULL, A, I, 4, I, 4, NULL)) ; + OK (GrB_Matrix_assign_(C, NULL, NULL, A, I, 4, I, 4, NULL)) ; OK (GxB_Matrix_fprint (C, "C iso with pending", GxB_SHORT, NULL)) ; GrB_Matrix_free_(&A) ; @@ -509,7 +559,7 @@ void mexFunction OK (GrB_Matrix_setElement_FP32 (A, 2.1, 1, 0)) ; OK (GrB_Matrix_setElement_FP32 (A, 2.2, 1, 1)) ; OK (GxB_Matrix_fprint (A, "A non-iso", GxB_SHORT, NULL)) ; - OK (GrB_Matrix_assign (C, NULL, NULL, A, I, 2, I, 2, NULL)) ; + OK (GrB_Matrix_assign_(C, NULL, NULL, A, I, 2, I, 2, NULL)) ; OK (GxB_Matrix_fprint (C, "C non-iso", GxB_SHORT, NULL)) ; GrB_Matrix_free_(&A) ; @@ -562,7 +612,7 @@ void mexFunction // C(I,I) = A OK (GB_bitmap_assign_6 (C, true, - I, 2, 2, GB_LIST, NULL, I, 2, 2, GB_LIST, NULL, + I, false, 2, 2, GB_LIST, NULL, I, false, 2, 2, GB_LIST, NULL, false, true, A, NULL, GrB_BOOL, GB_ASSIGN, NULL)) ; OK (GxB_Matrix_fprint (C, "C after C=A", GxB_SHORT, NULL)) ; @@ -761,11 +811,33 @@ void mexFunction GrB_Vector_free_(&w) ; GrB_Scalar_free_(&scalar) ; - GB_Global_print_mem_shallow_set (true) ; - CHECK (GB_Global_print_mem_shallow_get ( )) ; - - GB_Global_print_mem_shallow_set (false) ; - CHECK (!GB_Global_print_mem_shallow_get ( )) ; + int shallow = false ; + GB_Global_stats_mem_shallow_set (true) ; + CHECK (GB_Global_stats_mem_shallow_get ( )) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &shallow, + GxB_INCLUDE_READONLY_STATISTICS)) ; + CHECK (shallow) ; + + shallow = true ; + GB_Global_stats_mem_shallow_set (false) ; + CHECK (!GB_Global_stats_mem_shallow_get ( )) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &shallow, + GxB_INCLUDE_READONLY_STATISTICS)) ; + CHECK (!shallow) ; + + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, + GxB_INCLUDE_READONLY_STATISTICS)) ; + CHECK (GB_Global_stats_mem_shallow_get ( )) ; + + shallow = false ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &shallow, + GxB_INCLUDE_READONLY_STATISTICS)) ; + CHECK (shallow) ; + CHECK (GB_Global_stats_mem_shallow_get ( )) ; + + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, + GxB_INCLUDE_READONLY_STATISTICS)) ; + CHECK (!GB_Global_stats_mem_shallow_get ( )) ; int64_t nallocs ; size_t mem_deep, mem_shallow ; diff --git a/GraphBLAS/Test/GB_mex_test30.c b/GraphBLAS/Test/GB_mex_test30.c index 5a306c1d42..e33cca8e18 100644 --- a/GraphBLAS/Test/GB_mex_test30.c +++ b/GraphBLAS/Test/GB_mex_test30.c @@ -2,7 +2,7 @@ // GB_mex_test30: test GrB_get and GrB_set (index unary ops) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,8 +19,7 @@ size_t siz1, siz2, siz3 ; \ OK (GrB_IndexUnaryOp_get_String (op, name, GrB_NAME)) ; \ CHECK (MATCH (name, opname)) ; \ - OK (GrB_IndexUnaryOp_get_String (op, cname, \ - (GrB_Field) GxB_JIT_C_NAME)); \ + OK (GrB_IndexUnaryOp_get_String (op, cname, GxB_JIT_C_NAME)); \ printf ("\n%s: %s\n", name, cname) ; \ OK (GxB_IndexUnaryOp_fprint (op, "idxunop", 5, stdout)) ; \ OK (GrB_IndexUnaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ @@ -48,16 +47,16 @@ GETOP (op, #op) ; \ } -void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, +void myfunc (bool *z, const float *x, uint64_t i, uint64_t j, const float *y) ; -void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, +void myfunc (bool *z, const float *x, uint64_t i, uint64_t j, const float *y) { (*z) = (*x) > 2 ; } #define MYFUNC_DEFN \ -"void myfunc (bool *z, const float *x, GrB_Index i, GrB_Index j, \n" \ +"void myfunc (bool *z, const float *x, uint64_t i, uint64_t j, \n" \ " const float *y) \n" \ "{ \n" \ " (*z) = (*x) > 2 ; \n" \ diff --git a/GraphBLAS/Test/GB_mex_test31.c b/GraphBLAS/Test/GB_mex_test31.c index 398f863c62..bb922acc63 100644 --- a/GraphBLAS/Test/GB_mex_test31.c +++ b/GraphBLAS/Test/GB_mex_test31.c @@ -2,7 +2,7 @@ // GB_mex_test31: test GrB_get and GrB_set (monoids) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -82,7 +82,7 @@ void mexFunction int32_t code, i ; float fvalue ; double dvalue ; - GrB_Index nvals = 999 ; + uint64_t nvals = 999 ; OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; @@ -278,7 +278,8 @@ void mexFunction OK (GrB_BinaryOp_new (&binop, (GxB_binary_function) myfunc, GrB_FP32, GrB_FP32, GrB_FP32)) ; OK (GrB_BinaryOp_set_String_(binop, "myfunc", GrB_NAME)) ; - METHOD (GrB_BinaryOp_set_String (binop, MYFUNC_DEFN, GxB_JIT_C_DEFINITION)) ; + METHOD (GrB_BinaryOp_set_String (binop, MYFUNC_DEFN, + GxB_JIT_C_DEFINITION)) ; OK (GrB_Monoid_new_FP32 (&monoid, binop, (float) 0.0)) ; OK (GrB_Monoid_get_SIZE_(monoid, &size, GrB_NAME)) ; diff --git a/GraphBLAS/Test/GB_mex_test32.c b/GraphBLAS/Test/GB_mex_test32.c index b748750271..c01978e183 100644 --- a/GraphBLAS/Test/GB_mex_test32.c +++ b/GraphBLAS/Test/GB_mex_test32.c @@ -2,7 +2,7 @@ // GB_mex_test32: test GrB_get and GrB_set (semirings) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -88,7 +88,7 @@ void mexFunction int32_t code, i ; float fvalue ; double dvalue ; - GrB_Index nvals = 999 ; + uint64_t nvals = 999 ; OK (GrB_Scalar_new (&s_fp64, GrB_FP64)) ; OK (GrB_Scalar_new (&s_fp32, GrB_FP32)) ; @@ -2169,13 +2169,12 @@ void mexFunction (GxB_binary_function) mytimes, GrB_FP32, GrB_FP32, GrB_FP32)) ; OK (GrB_BinaryOp_set_String_(times, "mytimes", GrB_NAME)) ; METHOD (GrB_BinaryOp_set_String (times, MYTIMES_DEFN, - (GrB_Field) GxB_JIT_C_DEFINITION)) ; + GxB_JIT_C_DEFINITION)) ; OK (GrB_BinaryOp_new (&add, (GxB_binary_function) myadd, GrB_FP32, GrB_FP32, GrB_FP32)) ; OK (GrB_BinaryOp_set_String_(add, "myadd", GrB_NAME)) ; - METHOD (GrB_BinaryOp_set_String (add, MYADD_DEFN, - (GrB_Field) GxB_JIT_C_DEFINITION)) ; + METHOD (GrB_BinaryOp_set_String (add, MYADD_DEFN, GxB_JIT_C_DEFINITION)) ; OK (GrB_Monoid_new_FP32 (&monoid, add, (float) 0.0)) ; OK (GrB_Monoid_get_SIZE_(monoid, &size, GrB_NAME)) ; diff --git a/GraphBLAS/Test/GB_mex_test33.c b/GraphBLAS/Test/GB_mex_test33.c index 83417d7ebc..6abb5041ce 100644 --- a/GraphBLAS/Test/GB_mex_test33.c +++ b/GraphBLAS/Test/GB_mex_test33.c @@ -2,7 +2,7 @@ // GB_mex_test33: test GrB_get and GrB_set (context) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -110,7 +110,7 @@ void mexFunction OK (GxB_Context_get_String_ (GxB_CONTEXT_WORLD, name, GrB_NAME)) ; CHECK (MATCH (name, "GxB_CONTEXT_WORLD")) ; - ERR (GxB_Context_get_SIZE_ (GxB_CONTEXT_WORLD, &size, (GrB_Field) GxB_FORMAT)) ; + ERR (GxB_Context_get_SIZE_ (GxB_CONTEXT_WORLD, &size, GxB_FORMAT)) ; expected = GrB_INVALID_VALUE ; ERR (GxB_Context_get_VOID_ (GxB_CONTEXT_WORLD, nothing, 0)) ; diff --git a/GraphBLAS/Test/GB_mex_test34.c b/GraphBLAS/Test/GB_mex_test34.c index 8f36169c63..bf6a9cd0a8 100644 --- a/GraphBLAS/Test/GB_mex_test34.c +++ b/GraphBLAS/Test/GB_mex_test34.c @@ -2,7 +2,7 @@ // GB_mex_test34: test GrB_get and GrB_set (descriptor) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,39 +14,39 @@ #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; -#define DGET(desc,value,field) \ -{ \ - if (print) \ - { \ - printf ("\ndescriptor: %s\n", #desc) ; \ - OK (GxB_Descriptor_fprint (desc, "desc", 5, stdout)) ; \ - } \ - OK (GrB_Descriptor_get_INT32 (desc, &i, (GrB_Field) (field))) ; \ - CHECK (i == value) ; \ - OK (GrB_Scalar_clear (s_int32)) ; \ - OK (GrB_Descriptor_get_Scalar (desc, s_int32, (GrB_Field) (field))) ; \ - int32_t iscalar = -1 ; \ - OK (GrB_Scalar_extractElement_INT32 (&iscalar, s_int32)) ; \ - CHECK (iscalar == value) ; \ - OK (GrB_Descriptor_get_SIZE (desc, &size, GrB_NAME)) ; \ - CHECK (size == GxB_MAX_NAME_LEN) ; \ - OK (GrB_Descriptor_get_String (desc, name, GrB_NAME)) ; \ - CHECK (MATCH (name, #desc)) ; \ +#define DGET(desc,value,field) \ +{ \ + if (print) \ + { \ + printf ("\ndescriptor: %s\n", #desc) ; \ + OK (GxB_Descriptor_fprint (desc, "desc", 5, stdout)) ; \ + } \ + OK (GrB_Descriptor_get_INT32 (desc, &i, (field))) ; \ + CHECK (i == value) ; \ + OK (GrB_Scalar_clear (s_int32)) ; \ + OK (GrB_Descriptor_get_Scalar (desc, s_int32, (field))) ; \ + int32_t ii = -1 ; \ + OK (GrB_Scalar_extractElement_INT32 (&ii, s_int32)) ; \ + CHECK (ii == value) ; \ + OK (GrB_Descriptor_get_SIZE (desc, &size, GrB_NAME)) ; \ + CHECK (size == GxB_MAX_NAME_LEN) ; \ + OK (GrB_Descriptor_get_String (desc, name, GrB_NAME)) ; \ + CHECK (MATCH (name, #desc)) ; \ } -#define DSET(desc,value,field) \ -{ \ - OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (GrB_Field) (field))) ; \ - OK (GrB_Descriptor_set_INT32 (desc, value, (GrB_Field) (field))) ; \ - int32_t i2 ; \ - OK (GrB_Descriptor_get_INT32 (desc, &i2, (GrB_Field) (field))) ; \ - CHECK (i2 == value) ; \ - OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (GrB_Field) (field))) ; \ - OK (GrB_Scalar_setElement_INT32 (s_int32, value)) ; \ - OK (GrB_Descriptor_set_Scalar (desc, s_int32, (GrB_Field) (field))) ; \ - int32_t i3 ; \ - OK (GrB_Descriptor_get_INT32 (desc, &i2, (GrB_Field) (field))) ; \ - CHECK (i2 == value) ; \ +#define DSET(desc,value,field) \ +{ \ + OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (field))) ; \ + OK (GrB_Descriptor_set_INT32 (desc, value, (field))) ; \ + int32_t i2 ; \ + OK (GrB_Descriptor_get_INT32 (desc, &i2, (field))) ; \ + CHECK (i2 == value) ; \ + OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (field))) ; \ + OK (GrB_Scalar_setElement_INT32 (s_int32, value)) ; \ + OK (GrB_Descriptor_set_Scalar (desc, s_int32, (field))) ; \ + int32_t i3 ; \ + OK (GrB_Descriptor_get_INT32 (desc, &i2, (field))) ; \ + CHECK (i2 == value) ; \ } void mexFunction @@ -394,6 +394,20 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN DSET (desc, GxB_SECURE_IMPORT , GxB_IMPORT) ; DSET (desc, GrB_DEFAULT , GxB_IMPORT) ; + DSET (desc, GxB_DEFAULT , GxB_ROWINDEX_LIST) ; + DSET (desc, GxB_USE_VALUES , GxB_ROWINDEX_LIST) ; + DSET (desc, GxB_USE_INDICES , GxB_ROWINDEX_LIST) ; + DSET (desc, GxB_IS_STRIDE , GxB_ROWINDEX_LIST) ; + + DSET (desc, GxB_DEFAULT , GxB_COLINDEX_LIST) ; + DSET (desc, GxB_USE_VALUES , GxB_COLINDEX_LIST) ; + DSET (desc, GxB_USE_INDICES , GxB_COLINDEX_LIST) ; + DSET (desc, GxB_IS_STRIDE , GxB_COLINDEX_LIST) ; + + DSET (desc, GxB_DEFAULT , GxB_VALUE_LIST) ; + DSET (desc, GxB_USE_VALUES , GxB_VALUE_LIST) ; + DSET (desc, GxB_USE_INDICES , GxB_VALUE_LIST) ; + OK (GrB_Descriptor_get_String_ (desc, name, GrB_NAME)) ; CHECK (MATCH (name, "")) ; OK (GrB_Descriptor_set_String_ (desc, "user_name", GrB_NAME)) ; @@ -422,38 +436,50 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN expected = GrB_INVALID_VALUE ; ERR (GrB_Descriptor_get_INT32_ (GrB_DESC_T1, &i, GrB_NAME)) ; - ERR (GrB_Descriptor_set_INT32_ (GrB_DESC_T1, GrB_REPLACE, (GrB_Field) GrB_OUTP)) ; - ERR (GrB_Descriptor_set_INT32 (NULL, GrB_REPLACE, (GrB_Field) GrB_OUTP)) ; - ERR (GrB_Descriptor_get_SIZE_ (GrB_DESC_T1, &size, (GrB_Field) GrB_OUTP)) ; - ERR (GrB_Descriptor_set_Scalar_ (GrB_DESC_T1, s_int32, (GrB_Field) GrB_MASK)) ; - ERR (GrB_Descriptor_set_Scalar (NULL, s_int32, (GrB_Field) GrB_MASK)) ; + ERR (GrB_Descriptor_set_INT32_ (GrB_DESC_T1, GrB_REPLACE, GrB_OUTP)) ; + ERR (GrB_Descriptor_set_INT32 (NULL, GrB_REPLACE, GrB_OUTP)) ; + ERR (GrB_Descriptor_get_SIZE_ (GrB_DESC_T1, &size, GrB_OUTP)) ; + ERR (GrB_Descriptor_set_Scalar_ (GrB_DESC_T1, s_int32, GrB_MASK)) ; + ERR (GrB_Descriptor_set_Scalar (NULL, s_int32, GrB_MASK)) ; ERR (GrB_Descriptor_set_INT32_ (desc, GrB_DEFAULT, GrB_NAME)) ; ERR (GrB_Descriptor_set_String_ (GrB_DESC_T1, "newname", GrB_NAME)) ; const char *err ; - ERR (GrB_Descriptor_set_INT32_ (desc, 999, (GrB_Field) GrB_OUTP)) ; + ERR (GrB_Descriptor_set_INT32_ (desc, 999, GrB_OUTP)) ; + OK (GrB_Descriptor_error (&err, desc)) ; + printf ("error: %s\n\n", err) ; + + ERR (GrB_Descriptor_set_INT32_ (desc, 998, GrB_MASK)) ; + OK (GrB_Descriptor_error (&err, desc)) ; + printf ("error: %s\n\n", err) ; + + ERR (GrB_Descriptor_set_INT32_ (desc, 997, GrB_INP0)) ; + OK (GrB_Descriptor_error (&err, desc)) ; + printf ("error: %s\n\n", err) ; + + ERR (GrB_Descriptor_set_INT32_ (desc, 996, GrB_INP1)) ; OK (GrB_Descriptor_error (&err, desc)) ; printf ("error: %s\n\n", err) ; - ERR (GrB_Descriptor_set_INT32_ (desc, 998, (GrB_Field) GrB_MASK)) ; + ERR (GrB_Descriptor_set_INT32_ (desc, 995, GxB_AxB_METHOD)) ; OK (GrB_Descriptor_error (&err, desc)) ; printf ("error: %s\n\n", err) ; - ERR (GrB_Descriptor_set_INT32_ (desc, 997, (GrB_Field) GrB_INP0)) ; + ERR (GrB_Descriptor_set_INT32_ (desc, 995, GxB_ROWINDEX_LIST)) ; OK (GrB_Descriptor_error (&err, desc)) ; printf ("error: %s\n\n", err) ; - ERR (GrB_Descriptor_set_INT32_ (desc, 996, (GrB_Field) GrB_INP1)) ; + ERR (GrB_Descriptor_set_INT32_ (desc, 995, GxB_COLINDEX_LIST)) ; OK (GrB_Descriptor_error (&err, desc)) ; printf ("error: %s\n\n", err) ; - ERR (GrB_Descriptor_set_INT32_ (desc, 995, (GrB_Field) GxB_AxB_METHOD)) ; + ERR (GrB_Descriptor_set_INT32_ (desc, 995, GxB_VALUE_LIST)) ; OK (GrB_Descriptor_error (&err, desc)) ; printf ("error: %s\n\n", err) ; expected = GrB_EMPTY_OBJECT ; OK (GrB_Scalar_clear (s_int32)) ; - ERR (GrB_Descriptor_set_Scalar_ (desc, s_int32, (GrB_Field) GrB_MASK)) ; + ERR (GrB_Descriptor_set_Scalar_ (desc, s_int32, GrB_MASK)) ; expected = GrB_INVALID_VALUE ; ERR (GrB_Descriptor_set_VOID_ (desc, nothing, 0, 0)) ; diff --git a/GraphBLAS/Test/GB_mex_test35.c b/GraphBLAS/Test/GB_mex_test35.c index c325493f91..7e3d10000b 100644 --- a/GraphBLAS/Test/GB_mex_test35.c +++ b/GraphBLAS/Test/GB_mex_test35.c @@ -2,7 +2,7 @@ // GB_mex_test35: test GrB_get for a serialized blob //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -39,10 +39,10 @@ void mexFunction uint8_t stuff [256] ; void *nothing = stuff ; size_t size ; - GrB_Index blob_size = 0 ; + uint64_t blob_size = 0 ; char name [256] ; char defn [2048] ; - int32_t code, i ; + int32_t code, i, iso ; float fvalue ; double dvalue ; void *blob = NULL ; @@ -52,57 +52,155 @@ void mexFunction OK (GrB_Scalar_new (&s_int32, GrB_INT32)) ; //-------------------------------------------------------------------------- - // GxB_Serialized_get + // create a non-iso test matrix //-------------------------------------------------------------------------- OK (GrB_Matrix_new (&A, GrB_FP32, 5, 5)) ; OK (GrB_Matrix_setElement (A, 0, 0, 1)) ; + OK (GrB_Matrix_setElement (A, 1, 0, 2)) ; OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; - OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + OK (GrB_set (A, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_set (A, 64, GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_set (A, 64, GxB_ROWINDEX_INTEGER_HINT)) ; + OK (GrB_set (A, 64, GxB_COLINDEX_INTEGER_HINT)) ; expected = GrB_INVALID_VALUE ; - ERR (GxB_Serialized_get_VOID_(blob, nothing, 0, blob_size)) ; - - OK (GxB_Serialized_get_SIZE_(blob, &size, GrB_EL_TYPE_STRING, blob_size)) ; - CHECK (size == strlen ("GrB_FP32") + 1) ; - OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; - CHECK (MATCH (name, "GrB_FP32")) ; + ERR (GrB_set (GrB_GLOBAL, 0, GxB_OFFSET_INTEGER_HINT)) ; + ERR (GrB_set (GrB_GLOBAL, 0, GxB_ROWINDEX_INTEGER_HINT)) ; + ERR (GrB_set (GrB_GLOBAL, 0, GxB_COLINDEX_INTEGER_HINT)) ; - OK (GxB_Serialized_get_SIZE_(blob, &size, GxB_JIT_C_NAME, blob_size)) ; - CHECK (size == strlen ("float") + 1) ; - OK (GxB_Serialized_get_String_(blob, name, GxB_JIT_C_NAME, blob_size)) ; - CHECK (MATCH (name, "float")) ; - - OK (GxB_Serialized_get_String_(blob, name, GrB_NAME, blob_size)) ; - CHECK (MATCH (name, "")) ; - - OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; - CHECK (MATCH (name, "GrB_FP32")) ; - - OK (GxB_Serialized_get_SIZE_(blob, &size, GrB_EL_TYPE_STRING, blob_size)) ; - CHECK (size == strlen ("GrB_FP32") + 1) ; + //-------------------------------------------------------------------------- + // test GxB_Serialized_get + //-------------------------------------------------------------------------- - OK (GxB_Serialized_get_INT32_(blob, &code, GrB_EL_TYPE_CODE, blob_size)) ; - CHECK (code == GrB_FP32_CODE) ; + for (int p_control = 0 ; p_control <= 64 ; p_control += 32) + for (int r_control = 0 ; r_control <= 64 ; r_control += 32) + for (int c_control = 0 ; c_control <= 64 ; c_control += 32) + { + printf ("\n-----------------controls: (%d %d %d)\n", + p_control, r_control, c_control) ; + OK (GrB_set (A, p_control, GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_set (A, r_control, GxB_ROWINDEX_INTEGER_HINT)) ; + OK (GrB_set (A, c_control, GxB_COLINDEX_INTEGER_HINT)) ; + OK (GxB_print (A, 5)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GrB_set (A, 1, GxB_OFFSET_INTEGER_HINT)) ; + ERR (GrB_set (A, 1, GxB_ROWINDEX_INTEGER_HINT)) ; + ERR (GrB_set (A, 1, GxB_COLINDEX_INTEGER_HINT)) ; + + // create the blob + OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_OFFSET_INTEGER_HINT, blob_size)) ; + CHECK (i == p_control) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_OFFSET_INTEGER_HINT)) ; + CHECK (i == p_control) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_ROWINDEX_INTEGER_HINT, blob_size)) ; + CHECK (i == r_control) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_ROWINDEX_INTEGER_HINT)) ; + CHECK (i == r_control) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_COLINDEX_INTEGER_HINT, blob_size)) ; + CHECK (i == c_control) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_COLINDEX_INTEGER_HINT)) ; + CHECK (i == c_control) ; + + iso = true ; + OK (GxB_Serialized_get_INT32_(blob, &iso, GxB_ISO, blob_size)) ; + CHECK (!iso) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_OFFSET_INTEGER_BITS, blob_size)) ; + if (p_control != 0) CHECK (i == p_control) ; + CHECK (i == 32 || i == 64) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_OFFSET_INTEGER_BITS)) ; + if (p_control != 0) CHECK (i == p_control) ; + CHECK (i == 32 || i == 64) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_ROWINDEX_INTEGER_BITS, blob_size)) ; + if (r_control != 0) CHECK (i == r_control) ; + CHECK (i == 32 || i == 64) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_ROWINDEX_INTEGER_BITS)) ; + if (r_control != 0) CHECK (i == r_control) ; + CHECK (i == 32 || i == 64) ; + + i = 911 ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_COLINDEX_INTEGER_BITS, blob_size)) ; + if (c_control != 0) CHECK (i == c_control) ; + CHECK (i == 32 || i == 64) ; + + i = 911 ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_COLINDEX_INTEGER_BITS)) ; + if (c_control != 0) CHECK (i == c_control) ; + CHECK (i == 32 || i == 64) ; + + ERR (GxB_Serialized_get_VOID_(blob, nothing, 0, blob_size)) ; + + OK (GxB_Serialized_get_SIZE_(blob, &size, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GxB_Serialized_get_SIZE_(blob, &size, GxB_JIT_C_NAME, blob_size)) ; + CHECK (size == strlen ("float") + 1) ; + OK (GxB_Serialized_get_String_(blob, name, GxB_JIT_C_NAME, blob_size)) ; + CHECK (MATCH (name, "float")) ; + + OK (GxB_Serialized_get_String_(blob, name, GrB_NAME, blob_size)) ; + CHECK (MATCH (name, "")) ; + + OK (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (MATCH (name, "GrB_FP32")) ; + + OK (GxB_Serialized_get_SIZE_(blob, &size, GrB_EL_TYPE_STRING, blob_size)) ; + CHECK (size == strlen ("GrB_FP32") + 1) ; + + OK (GxB_Serialized_get_INT32_(blob, &code, GrB_EL_TYPE_CODE, blob_size)) ; + CHECK (code == GrB_FP32_CODE) ; + + i = -1 ; + OK (GxB_Serialized_get_Scalar_(blob, s_int32, GrB_EL_TYPE_CODE, blob_size)) ; + OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; + CHECK (i == GrB_FP32_CODE) ; + + OK (GxB_Serialized_get_INT32_(blob, &i, GrB_STORAGE_ORIENTATION_HINT, + blob_size)) ; + printf ("blob storage: %d\n", i) ; + CHECK (i == GrB_COLMAJOR) ; - i = -1 ; - OK (GxB_Serialized_get_Scalar_(blob, s_int32, GrB_EL_TYPE_CODE, blob_size)) ; - OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; - CHECK (i == GrB_FP32_CODE) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; + printf ("blob storage: %d\n", i) ; + CHECK (i == GxB_BY_COL) ; - OK (GxB_Serialized_get_INT32_(blob, &i, GrB_STORAGE_ORIENTATION_HINT, - blob_size)) ; - printf ("blob storage: %d\n", i) ; - CHECK (i == GrB_COLMAJOR) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_SPARSITY_CONTROL, blob_size)) ; + printf ("blob sparsity control: %d\n", i) ; + CHECK (i == GxB_HYPERSPARSE) ; - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_FORMAT, blob_size)) ; - printf ("blob storage: %d\n", i) ; - CHECK (i == GxB_BY_COL) ; + // free the blob + mxFree (blob) ; blob = NULL ; blob_size = 0 ; + } - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_SPARSITY_CONTROL, blob_size)) ; - printf ("blob sparsity control: %d\n", i) ; - CHECK (i == GxB_AUTO_SPARSITY) ; + //-------------------------------------------------------------------------- + // change the matrix to dense + //-------------------------------------------------------------------------- + OK (GrB_set (A, GxB_AUTO_SPARSITY, GxB_SPARSITY_CONTROL)) ; OK (GrB_assign (A, NULL, NULL, 1, GrB_ALL, 5, GrB_ALL, 5, NULL)) ; OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; @@ -118,11 +216,10 @@ void mexFunction OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; CHECK (MATCH (name, "A matrix")) ; - // free the blob and recreate it - mxFree (blob) ; blob = NULL ; blob_size = 0 ; + // create the blob OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_SPARSITY_STATUS, blob_size)) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_SPARSITY_STATUS, blob_size)) ; printf ("blob sparsity status: %d\n", i) ; CHECK (i == GxB_FULL) ; @@ -145,34 +242,44 @@ void mexFunction expected = GrB_INVALID_VALUE ; ERR (GxB_Serialized_get_INT32_(blob, &i, 0, blob_size)) ; ERR (GxB_Serialized_get_SIZE_(blob, &size, 0, blob_size)) ; + ERR (GxB_Serialized_get_INT32_(blob, &i, GxB_JIT_C_NAME, blob_size)) ; fvalue = -1 ; - OK (GxB_Serialized_get_Scalar_(blob, s_fp32, (GrB_Field) GxB_BITMAP_SWITCH, + OK (GxB_Serialized_get_Scalar_(blob, s_fp32, GxB_BITMAP_SWITCH, blob_size)) ; OK (GrB_Scalar_extractElement_FP32_(&fvalue, s_fp32)) ; printf ("blob bitmap switch: %g\n", fvalue) ; CHECK (fabs (fvalue - 0.08) < 1e-6) ; - OK (GrB_Matrix_set_INT32_(A, GxB_BITMAP, (GrB_Field) GxB_SPARSITY_CONTROL)) ; - - // free the blob and recreate it + // free the blob mxFree (blob) ; blob = NULL ; blob_size = 0 ; + + //-------------------------------------------------------------------------- + // change the matrix to bitmap + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_set_INT32_(A, GxB_BITMAP, GxB_SPARSITY_CONTROL)) ; + + //-------------------------------------------------------------------------- + // create the blob + //-------------------------------------------------------------------------- + OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; OK (GxB_Serialized_get_String_(A, name, GxB_JIT_C_NAME)) ; - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_SPARSITY_STATUS, blob_size)) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_SPARSITY_STATUS, blob_size)) ; printf ("blob sparsity status: %d\n", i) ; CHECK (i == GxB_BITMAP) ; OK (GrB_Scalar_setElement_FP32_(s_fp32, 0.25)) ; - OK (GrB_Matrix_set_Scalar_(A, s_fp32, (GrB_Field) GxB_HYPER_SWITCH)) ; + OK (GrB_Matrix_set_Scalar_(A, s_fp32, GxB_HYPER_SWITCH)) ; // free the blob and recreate it mxFree (blob) ; blob = NULL ; blob_size = 0 ; OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; - OK (GxB_Serialized_get_Scalar_(blob, s_fp64, (GrB_Field) GxB_HYPER_SWITCH, blob_size)) ; + OK (GxB_Serialized_get_Scalar_(blob, s_fp64, GxB_HYPER_SWITCH, blob_size)) ; OK (GrB_Scalar_extractElement_FP64_(&dvalue, s_fp64)) ; printf ("blob hyper switch: %g\n", dvalue) ; CHECK (fabs (dvalue - 0.25) < 1e-6) ; @@ -180,18 +287,19 @@ void mexFunction OK (GrB_Matrix_set_INT32_(A, GrB_ROWMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; OK (GrB_Matrix_get_INT32_(A, &i, GrB_STORAGE_ORIENTATION_HINT)) ; CHECK (i == GrB_ROWMAJOR) ; - OK (GrB_Matrix_get_INT32_(A, &i, (GrB_Field) GxB_FORMAT)) ; + OK (GrB_Matrix_get_INT32_(A, &i, GxB_FORMAT)) ; CHECK (i == GxB_BY_ROW) ; // GxB_print (A, 3) ; // free the blob and recreate it mxFree (blob) ; blob = NULL ; blob_size = 0 ; OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; + GxB_print (A, 3) ; OK (GxB_Serialized_get_INT32_(blob, &i, GrB_STORAGE_ORIENTATION_HINT, blob_size)) ; CHECK (i == GrB_ROWMAJOR) ; - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_FORMAT, blob_size)) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; CHECK (i == GxB_BY_ROW) ; // GxB_print (A, 3) ; @@ -204,11 +312,11 @@ void mexFunction expected = GrB_INVALID_OBJECT ; uint8_t *b = (uint8_t *) blob ; - ERR (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_FORMAT, 20)) ; + ERR (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, 20)) ; b [0]++ ; - ERR (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_FORMAT, blob_size)) ; + ERR (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; b [0]-- ; - OK (GxB_Serialized_get_INT32_(blob, &i, (GrB_Field) GxB_FORMAT, blob_size)) ; + OK (GxB_Serialized_get_INT32_(blob, &i, GxB_FORMAT, blob_size)) ; CHECK (i == GxB_BY_ROW) ; OK (GxB_Serialized_get_Scalar_(blob, s_int32, GrB_STORAGE_ORIENTATION_HINT, @@ -216,16 +324,16 @@ void mexFunction OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; CHECK (i == GrB_ROWMAJOR) ; - OK (GxB_Serialized_get_Scalar_(blob, s_int32, (GrB_Field) GxB_FORMAT, blob_size)) ; + OK (GxB_Serialized_get_Scalar_(blob, s_int32, GxB_FORMAT, blob_size)) ; OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; CHECK (i == GxB_BY_ROW) ; - OK (GxB_Serialized_get_Scalar_(blob, s_int32, (GrB_Field) GxB_SPARSITY_CONTROL, + OK (GxB_Serialized_get_Scalar_(blob, s_int32, GxB_SPARSITY_CONTROL, blob_size)) ; OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; CHECK (i == GxB_BITMAP) ; - OK (GxB_Serialized_get_Scalar_(blob, s_int32, (GrB_Field) GxB_SPARSITY_STATUS, + OK (GxB_Serialized_get_Scalar_(blob, s_int32, GxB_SPARSITY_STATUS, blob_size)) ; OK (GrB_Scalar_extractElement_INT32_(&i, s_int32)) ; CHECK (i == GxB_BITMAP) ; @@ -265,7 +373,7 @@ void mexFunction OK (GrB_Matrix_new (&A, type, 50, 50)) ; OK (GrB_Matrix_setElement (A, (void *) &one, 0, 0)) ; OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; - OK (GrB_Matrix_set_INT32_(A, GxB_HYPERSPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32_(A, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; OK (GrB_Matrix_set_String_(A, "A hyper", GrB_NAME)) ; OK (GrB_Matrix_get_String_(A, name, GrB_NAME)) ; @@ -298,6 +406,10 @@ void mexFunction printf ("name [%s]\n", name) ; CHECK (MATCH (name, "A hyper")) ; + expected = GrB_INVALID_VALUE ; + ERR (GxB_Serialized_get_String_(blob, name, GrB_EL_TYPE_CODE, blob_size)) ; + ERR (GxB_Serialized_get_SIZE_(blob, &size, GrB_EL_TYPE_CODE, blob_size)) ; + //-------------------------------------------------------------------------- // finalize GraphBLAS //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mex_test36.c b/GraphBLAS/Test/GB_mex_test36.c index 04902de18f..04974bdf5f 100644 --- a/GraphBLAS/Test/GB_mex_test36.c +++ b/GraphBLAS/Test/GB_mex_test36.c @@ -2,7 +2,7 @@ // GB_mex_test36: reduce a huge iso full matrix to a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -45,8 +45,8 @@ void mexFunction // create and reduce a huge iso full matrix //-------------------------------------------------------------------------- - GrB_Index nrows = 1UL << 40 ; - GrB_Index ncols = 1UL << 48 ; + uint64_t nrows = 1UL << 40 ; + uint64_t ncols = 1UL << 48 ; double pi = 3.141592653589793 ; double sum = 0 ; mexPrintf ( diff --git a/GraphBLAS/Test/GB_mex_test37.c b/GraphBLAS/Test/GB_mex_test37.c index e05d7987b9..fcd84960a4 100644 --- a/GraphBLAS/Test/GB_mex_test37.c +++ b/GraphBLAS/Test/GB_mex_test37.c @@ -2,7 +2,7 @@ // GB_mex_test37: index binary op tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,8 @@ bool isequal (GrB_Matrix C1, GrB_Matrix C2) int32_t s ; OK (GrB_Matrix_get_INT32 (C1, &s, GrB_STORAGE_ORIENTATION_HINT)) ; OK (GrB_Matrix_set_INT32 (C2, s, GrB_STORAGE_ORIENTATION_HINT)) ; - OK (GrB_Matrix_get_INT32 (C1, &s, (GrB_Field) GxB_SPARSITY_STATUS)) ; - OK (GrB_Matrix_set_INT32 (C2, s, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_get_INT32 (C1, &s, GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_set_INT32 (C2, s, GxB_SPARSITY_CONTROL)) ; OK (GrB_Matrix_wait (C1, GrB_MATERIALIZE)) ; OK (GrB_Matrix_wait (C2, GrB_MATERIALIZE)) ; // check if C1 and C2 are equal @@ -43,7 +43,7 @@ bool isequal (GrB_Matrix C1, GrB_Matrix C2) printf ("\n=========================================\n") ; printf ("matrices differ!\n") ; printf ("\n=========================================\n") ; - GrB_Index nvals = 0, nrows = 0, ncols = 0 ; + uint64_t nvals = 0, nrows = 0, ncols = 0 ; OK (GrB_Matrix_nrows (&nrows, C1)) ; OK (GrB_Matrix_ncols (&ncols, C1)) ; OK (GrB_Matrix_new (&D, GrB_FP64, nrows, ncols)) ; @@ -63,22 +63,22 @@ bool isequal (GrB_Matrix C1, GrB_Matrix C2) //------------------------------------------------------------------------------ void test37_idxbinop (double *z, - const double *x, GrB_Index ix, GrB_Index jx, - const double *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const double *y, uint64_t iy, uint64_t jy, const double *theta) ; void test37_idxbinop (double *z, - const double *x, GrB_Index ix, GrB_Index jx, - const double *y, GrB_Index iy, GrB_Index jy, + const double *x, uint64_t ix, uint64_t jx, + const double *y, uint64_t iy, uint64_t jy, const double *theta) { (*z) = (*x) + 2*(*y) - 42*ix + jx + 3*iy + 1000*jy - (*theta) ; } -#define TEST37_IDXBINOP \ +#define TEST37_IDXBINOP_DEFN \ "void test37_idxbinop (double *z, \n" \ -" const double *x, GrB_Index ix, GrB_Index jx, \n" \ -" const double *y, GrB_Index iy, GrB_Index jy, \n" \ +" const double *x, uint64_t ix, uint64_t jx, \n" \ +" const double *y, uint64_t iy, uint64_t jy, \n" \ " const double *theta) \n" \ "{ \n" \ " (*z) = (*x) + 2*(*y) - 42*ix + jx + 3*iy + 1000*jy - (*theta) ; \n" \ @@ -137,11 +137,11 @@ GrB_Info ewise int8_t *Ab = NULL, *Bb = NULL, *Tb = NULL ; double *Ax = NULL, *Bx = NULL, *Tx = NULL ; GrB_Matrix T = NULL, C = NULL, a = NULL, b = NULL ; - GrB_Index Ab_size = 0, Ax_size = 0, A_nvals = 0, - Bb_size = 0, Bx_size = 0, B_nvals = 0, - Tb_size = 0, Tx_size = 0, T_nvals = 0 ; + uint64_t Ab_size = 0, Ax_size = 0, A_nvals = 0, + Bb_size = 0, Bx_size = 0, B_nvals = 0, + Tb_size = 0, Tx_size = 0, T_nvals = 0 ; void (* free_function) (void *) = NULL ; - GrB_Index n = 0 ; + uint64_t n = 0 ; (*C_handle) = NULL ; //-------------------------------------------------------------------------- @@ -164,18 +164,18 @@ GrB_Info ewise OK (GrB_transpose (b, NULL, NULL, b, NULL)) ; // extract a in bitmap CSC format - OK (GxB_Matrix_unpack_BitmapC (a, &Ab, &Ax, &Ab_size, &Ax_size, + OK (GxB_Matrix_unpack_BitmapC (a, &Ab, (void **) &Ax, &Ab_size, &Ax_size, NULL, &A_nvals, NULL)) ; GrB_Matrix_free (&a) ; // extract b in bitmap CSC format - OK (GxB_Matrix_unpack_BitmapC (b, &Bb, &Bx, &Bb_size, &Bx_size, + OK (GxB_Matrix_unpack_BitmapC (b, &Bb, (void **) &Bx, &Bb_size, &Bx_size, NULL, &B_nvals, NULL)) ; GrB_Matrix_free (&b) ; // create T and extract in bitmap CSC format OK (GrB_Matrix_new (&T, GrB_FP64, n, n)) ; - OK (GxB_Matrix_unpack_BitmapC (T, &Tb, &Tx, &Tb_size, &Tx_size, + OK (GxB_Matrix_unpack_BitmapC (T, &Tb, (void **) &Tx, &Tb_size, &Tx_size, NULL, &T_nvals, NULL)) ; //-------------------------------------------------------------------------- @@ -189,9 +189,9 @@ GrB_Info ewise T_nvals = 0 ; - for (GrB_Index i = 0 ; i < n ; i++) + for (uint64_t i = 0 ; i < n ; i++) { - for (GrB_Index j = 0 ; j < n ; j++) + for (uint64_t j = 0 ; j < n ; j++) { int64_t p = i + j*n ; @@ -251,7 +251,7 @@ GrB_Info ewise } // pack T in bitmap CSC format - OK (GxB_Matrix_pack_BitmapC (T, &Tb, &Tx, Tb_size, Tx_size, + OK (GxB_Matrix_pack_BitmapC (T, &Tb, (void **) &Tx, Tb_size, Tx_size, false, T_nvals, NULL)) ; //-------------------------------------------------------------------------- @@ -262,7 +262,7 @@ GrB_Info ewise { // C = T OK (GrB_Matrix_new (&C, GrB_FP64, n, n)) ; - OK (GrB_Matrix_assign (C, M, NULL, T, GrB_ALL, n, GrB_ALL, n, + OK (GrB_Matrix_assign_(C, M, NULL, T, GrB_ALL, n, GrB_ALL, n, GrB_DESC_R)) ; } else @@ -382,7 +382,7 @@ void mexFunction OK (GxB_IndexBinaryOp_new (&Iop, (GxB_index_binary_function) test37_idxbinop, GrB_FP64, GrB_FP64, GrB_FP64, GrB_FP64, - "test37_idxbinop", TEST37_IDXBINOP)) ; + "test37_idxbinop", TEST37_IDXBINOP_DEFN)) ; OK (GxB_IndexBinaryOp_set_String (Iop, "test37 idx binop", GrB_NAME)) ; OK (GxB_print (Iop, 5)) ; @@ -395,7 +395,7 @@ void mexFunction char theta_type_name [256] ; theta_type_name [0] = '\0' ; - OK (GxB_IndexBinaryOp_get_String (Iop, &theta_type_name, + OK (GxB_IndexBinaryOp_get_String (Iop, theta_type_name, GxB_THETA_TYPE_STRING)) ; CHECK (strcmp (theta_type_name, "GrB_FP64") == 0) ; @@ -438,7 +438,7 @@ void mexFunction CHECK (theta_type_namelen == strlen ("GrB_FP64") + 1) ; theta_type_name [0] = '\0' ; - OK (GrB_BinaryOp_get_String (Bop, &theta_type_name, + OK (GrB_BinaryOp_get_String (Bop, theta_type_name, GxB_THETA_TYPE_STRING)) ; CHECK (strcmp (theta_type_name, "GrB_FP64") == 0) ; @@ -451,8 +451,7 @@ void mexFunction OK (GrB_Matrix_dup (&A2, A)) ; OK (GrB_Matrix_dup (&M, A)) ; - OK (GrB_Matrix_set_INT32 (M, GxB_SPARSE, - (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (M, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; //-------------------------------------------------------------------------- // create the expected results @@ -487,12 +486,12 @@ void mexFunction // turn on/off the JIT OK (GrB_Global_set_INT32 (GrB_GLOBAL, jit ? GxB_JIT_ON : GxB_JIT_OFF, - (GrB_Field) GxB_JIT_C_CONTROL)) ; + GxB_JIT_C_CONTROL)) ; // change A sparsity OK (GrB_Matrix_set_INT32 (A, a1_sparsity ? GxB_SPARSE : GxB_BITMAP, - (GrB_Field) GxB_SPARSITY_CONTROL)) ; + GxB_SPARSITY_CONTROL)) ; // change A storage orientation OK (GrB_Matrix_set_INT32 (A, @@ -518,7 +517,7 @@ void mexFunction // change A sparsity again OK (GrB_Matrix_set_INT32 (A2, a2_sparsity ? GxB_SPARSE : GxB_BITMAP, - (GrB_Field) GxB_SPARSITY_CONTROL)) ; + GxB_SPARSITY_CONTROL)) ; // change A storage again OK (GrB_Matrix_set_INT32 (A, @@ -582,8 +581,7 @@ void mexFunction //------------------------------------------------------------------------ // turn on the JIT - OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, - (GrB_Field) GxB_JIT_C_CONTROL)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, GxB_JIT_C_CONTROL)) ; int save_jit = 0, save_burble = 0 ; OK (GxB_get (GxB_JIT_C_CONTROL, &save_jit)) ; @@ -592,7 +590,7 @@ void mexFunction printf ("\nerror handling tests: JIT is %d\n", save_jit) ; expected = GrB_INVALID_OBJECT ; - void *p = Bop->theta_type = NULL ; + void *p = Bop->theta_type ; Bop->theta_type = NULL ; ERR (GB_BinaryOp_check (Bop, "Bop: bad theta_type", 5, stdout)) ; Bop->theta_type = p ; @@ -644,7 +642,7 @@ void mexFunction OK (GrB_Type_new (&Crud_Type, 4)) ; OK (GrB_Scalar_new (&Crud_Scalar, Crud_Type)) ; ERR (GxB_BinaryOp_new_IndexOp (&Crud_Bop, Iop, Crud_Scalar)) ; - ERR (GrB_Matrix_apply (A, NULL, NULL, Bop, A, NULL)) ; + ERR (GrB_Matrix_apply (A, NULL, NULL, (GrB_UnaryOp) Bop, A, NULL)) ; //------------------------------------------------------------------------ // JIT testing @@ -652,10 +650,10 @@ void mexFunction printf ("\n\n-------------- lots of compiler errors expected here:\n") ; - #define CRUD_IDXBINOP \ + #define CRUD_IDXBINOP_DEFN \ "void crud_idxbinop (double *z, " \ - " const double *x, GrB_Index ix, GrB_Index jx, " \ - " const double *y, GrB_Index iy, GrB_Index jy, " \ + " const double *x, uint64_t ix, uint64_t jx, " \ + " const double *y, uint64_t iy, uint64_t jy, " \ " const double *theta) " \ "{ " \ " compiler error occurs here " \ @@ -673,7 +671,7 @@ void mexFunction expected = GxB_JIT_ERROR ; ERR (GxB_IndexBinaryOp_new (&Crud_Iop, NULL, GrB_FP64, GrB_FP64, GrB_FP64, GrB_FP64, - "crud_idxbinop", CRUD_IDXBINOP)) ; + "crud_idxbinop", CRUD_IDXBINOP_DEFN)) ; // restore the JIT control and the burble OK (GxB_set (GxB_JIT_C_CONTROL, save_jit)) ; diff --git a/GraphBLAS/Test/GB_mex_test38.c b/GraphBLAS/Test/GB_mex_test38.c new file mode 100644 index 0000000000..4c43154358 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test38.c @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// GB_mex_test38: misc tests +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" +#include "../Source/werk/include/GB_werk.h" + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + mxFree (W) ; W = NULL ; \ + GrB_Vector_free (&V) ; \ + GrB_Matrix_free (&A) ; \ +} + +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL, B = NULL ; + GrB_Vector V = NULL ; + uint32_t *W = NULL ; + bool malloc_debug = GB_mx_get_global (true) ; + GB_WERK ("GB_mex_test38") ; + + //-------------------------------------------------------------------------- + // create a test matrix + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&A, GrB_FP64, 10, 10)) ; + + double x = 1 ; + for (int64_t i = 0 ; i < 9 ; i++) + { + OK (GrB_Matrix_setElement_FP64 (A, x, i, i)) ; + x = x*1.2 ; + OK (GrB_Matrix_setElement_FP64 (A, x, i, i+1)) ; + x = x*1.2 ; + OK (GrB_Matrix_setElement_FP64 (A, x, i+1, i)) ; + x = x*1.2 ; + } + + OK (GrB_Matrix_setElement_FP64 (A, x, 9, 9)) ; + x = x - 1000 ; + OK (GrB_Matrix_setElement_FP64 (A, x, 5, 2)) ; + OK (GxB_print (A, 5)) ; + + //-------------------------------------------------------------------------- + // test convert_int with pending tuples + //-------------------------------------------------------------------------- + + int expected = GrB_SUCCESS ; + OK (GB_convert_int (NULL, false, false, false, true)) ; + OK (GB_convert_int (A, false, false, false, true)) ; + OK (GxB_print (A, 5)) ; + OK (GrB_wait (A, GrB_MATERIALIZE)) ; + OK (GxB_print (A, 5)) ; + + //-------------------------------------------------------------------------- + // test 32-bit cumsum with integer overflow + //-------------------------------------------------------------------------- + + uint32_t n = 1000000 ; + W = mxMalloc (n * sizeof (uint32_t)) ; + for (int k = 0 ; k < n ; k++) + { + W [k] = UINT32_MAX ; + } + + int64_t kresult ; + bool ok ; + + ok = GB_cumsum (W, true, n, NULL, 1, Werk) ; + CHECK (!ok) ; + ok = GB_cumsum (W, true, n, NULL, 4, Werk) ; + CHECK (!ok) ; + + ok = GB_cumsum (W, true, n, &kresult, 1, Werk) ; + CHECK (!ok) ; + ok = GB_cumsum (W, true, n, &kresult, 4, Werk) ; + CHECK (!ok) ; + + //-------------------------------------------------------------------------- + // test GB_index methods + //-------------------------------------------------------------------------- + + ok = GB_determine_p_is_32 (true, INT64_MAX / 4) ; + CHECK (!ok) ; + + OK (GB_convert_int (A, true, true, true, true)) ; + OK (GrB_set (A, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_set (A, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GxB_print (A, 5)) ; + int64_t save = A->vlen ; + A->vlen = GrB_INDEX_MAX ; + + if (A->i_is_32) + { + // matrix is too large for 32-bit integers: + expected = GrB_INVALID_OBJECT ; + ERR (GB_valid_matrix (A)) ; + ERR (GxB_print (A, 5)) ; + } + else + { + // matrix is OK with 64-bit integers + OK (GB_valid_matrix (A)) ; + OK (GxB_print (A, 5)) ; + } + + A->vlen = save ; + OK (GB_valid_matrix (A)) ; + OK (GxB_print (A, 5)) ; + + // index out of range: + uint32_t *Ai = A->i ; + save = Ai [0] ; + Ai [0] = 1000 ; + expected = GrB_INVALID_OBJECT ; + ERR (GxB_print (A, 5)) ; + Ai [0] = save ; + OK (GxB_print (A, 5)) ; + + //-------------------------------------------------------------------------- + // test GB_new_bix + //-------------------------------------------------------------------------- + + // matrix is too large for 32-bit integers + expected = GrB_INVALID_VALUE ; + ERR (GB_new_bix (&B, GrB_FP64, INT64_MAX / 4, INT64_MAX / 4, GB_ph_null, + true, GxB_HYPERSPARSE, false, 0.1, 2, 2, true, true, + true, true, true)) ; + CHECK (B == NULL) ; + + //-------------------------------------------------------------------------- + // test GrB_Matrix_sort with A == P (not supported) + //-------------------------------------------------------------------------- + + expected = GrB_NOT_IMPLEMENTED ; + GrB_Matrix_free (&A) ; + OK (GrB_Matrix_new (&A, GrB_INT64, 10, 10)) ; + ERR (GxB_Matrix_sort (NULL, A, GrB_LT_FP64, A, NULL)) ; + + //-------------------------------------------------------------------------- + // test GxB_*_extractTuples_Vector with I == A (not supported) + //-------------------------------------------------------------------------- + + OK (GrB_Vector_new (&V, GrB_INT64, 10)) ; + ERR (GxB_Vector_extractTuples_Vector (V, V, V, NULL)) ; + ERR (GxB_Matrix_extractTuples_Vector (V, V, V, A, NULL)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + FREE_ALL ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test38: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test39.c b/GraphBLAS/Test/GB_mex_test39.c new file mode 100644 index 0000000000..e457231129 --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test39.c @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// GB_mex_test39: load/unload +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + if (X4 != NULL) mxFree (X4) ; \ + X3 = NULL ; \ + if (X != NULL) mxFree (X) ; \ + X = NULL ; \ + GxB_Container_free (&Container) ; \ + GrB_Vector_free (&V) ; \ + GrB_Matrix_free (&A) ; \ + GrB_Matrix_free (&C) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Vector V = NULL ; + GrB_Matrix A = NULL, C = NULL ; + GxB_Container Container = NULL ; + uint32_t *X = NULL, *X2 = NULL, *X3 = NULL, *X4 = NULL, *X5 = NULL ; + bool malloc_debug = GB_mx_get_global (true) ; + uint64_t n = 10, n2 = 999, X_size, X_size2 = 911, n4 = 0, X4_size = 0, + n5 = 0, X5_size = 0 ; + GrB_Type type = NULL ; + int handling = 0 ; + + //-------------------------------------------------------------------------- + // test load/unload + //-------------------------------------------------------------------------- + + X_size = GB_IMAX (1, n * sizeof (uint32_t)) ; + X = mxMalloc (X_size) ; // X is owned by the user application + X2 = X ; + + printf ("mxMalloc: X = %p\n", (void *) X) ; + + OK (GrB_Vector_new (&V, GrB_FP64, 0)) ; + OK (GxB_print (V, 5)) ; + + for (int64_t i = 0 ; i < n ; i++) + { + X [i] = i ; + } + + int expected = GrB_INVALID_VALUE ; + ERR (GxB_Vector_load (V, (void **) &X, GrB_UINT32, n, 2, GrB_DEFAULT, + NULL)) ; + CHECK (X == X2) ; // X is still owned by the user application + + // handling is GrB_DEFAULT, so after the load, X is owned by GraphBLAS + OK (GxB_Vector_load (V, (void **) &X, GrB_UINT32, n, X_size, GrB_DEFAULT, + NULL)) ; + OK (GxB_print (V, 5)) ; + CHECK (X == NULL) ; // X is not freed, but owned by V + CHECK (X2 != NULL) ; // X2 is not owned by the user application + + // handling is GrB_DEFAULT, so after the unload, X is owned by the user + // application (this test function) + OK (GxB_Vector_unload (V, (void **) &X, &type, &n2, &X_size2, &handling, + NULL)) ; + OK (GxB_print (V, 5)) ; + CHECK (X == X2) ; // X is owned by the user application again + CHECK (n2 == n) ; + CHECK (X_size == X_size2) ; + CHECK (type == GrB_UINT32) ; + CHECK (handling == GrB_DEFAULT) ; + + for (int64_t i = 0 ; i < n ; i++) + { + CHECK (X [i] == i) ; + } + + // unload an empty vector + OK (GxB_Vector_unload (V, (void **) &X3, &type, &n2, &X_size2, &handling, + NULL)) ; + OK (GxB_print (V, 5)) ; + CHECK (X3 == NULL) ; + CHECK (n2 == 0) ; + CHECK (X_size2 == 0) ; + CHECK (type == GrB_UINT32) ; + CHECK (handling == GrB_DEFAULT) ; + + OK (GrB_Vector_free (&V)) ; + OK (GrB_Vector_new (&V, GrB_UINT32, n)) ; + OK (GrB_set (V, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + for (int64_t i = 0 ; i < n ; i++) + { + OK (GrB_Vector_setElement_UINT32 (V, 2*i, i)) ; + } + + // handling should be GrB_DEFAULT, so X4 is now owned by the user + // application + OK (GxB_print (V, 5)) ; + OK (GxB_Vector_unload (V, (void **) &X4, &type, &n4, &X4_size, &handling, + NULL)) ; + OK (GxB_print (V, 5)) ; + CHECK (n4 == n) ; + CHECK (X4 != NULL) ; // X4 is owned by the user application + for (int64_t i = 0 ; i < n ; i++) + { + CHECK (X4 [i] == 2*i) ; + } + CHECK (handling == GrB_DEFAULT) ; + + expected = GrB_INVALID_OBJECT ; + OK (GrB_Vector_free (&V)) ; + OK (GrB_Vector_new (&V, GrB_FP64, n)) ; + ERR (GxB_Vector_unload (V, (void **) &X5, &type, &n5, &X5_size, &handling, + NULL)) ; + OK (GrB_Vector_free (&V)) ; + + //-------------------------------------------------------------------------- + // test the Container with a matrix + //-------------------------------------------------------------------------- + + printf ("\n------------------- testing Container unload (Matrix):\n") ; + OK (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; + for (int i = 0 ; i < n ; i++) + { + double x = 2*i + 0.1 ; + OK (GrB_Matrix_setElement_FP64 (A, x, i, i)) ; + } + OK (GxB_print (A, 5)) ; + + OK (GxB_Container_new (&Container)) ; + OK (GxB_unload_Matrix_into_Container (A, Container, NULL)) ; + OK (GxB_print (A, 5)) ; + + printf ("\n------------------- testing Container load (Matrix):\n") ; + OK (GxB_load_Matrix_from_Container (A, Container, NULL)) ; + OK (GxB_print (A, 5)) ; + + //-------------------------------------------------------------------------- + // test the Container with a vector + //-------------------------------------------------------------------------- + + printf ("\n------------------- testing Container unload (Matrix):\n") ; + OK (GrB_Vector_new (&V, GrB_FP64, n)) ; + for (int i = 0 ; i < n/2 ; i++) + { + double x = 2*i + 0.1 ; + OK (GrB_Vector_setElement_FP64 (V, x, i)) ; + } + OK (GxB_print (V, 5)) ; + + OK (GxB_unload_Vector_into_Container (V, Container, NULL)) ; + OK (GxB_print (V, 5)) ; + + printf ("\n------------------- testing Container load (Vector):\n") ; + OK (GxB_load_Vector_from_Container (V, Container, NULL)) ; + OK (GxB_print (V, 5)) ; + + //-------------------------------------------------------------------------- + // test extract with empty vectors + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&C, GrB_FP64, 0, 0)) ; + OK (GrB_Vector_clear (V)) ; + #define GET_DEEP_COPY ; + #define FREE_DEEP_COPY ; + METHOD (GxB_Matrix_extract_Vector_(C, NULL, NULL, A, V, V, NULL)) ; + OK (GxB_print (C, 5)) ; + + //-------------------------------------------------------------------------- + // test the container error conditions + //-------------------------------------------------------------------------- + + printf ("test errors ...\n") ; + OK (GrB_Matrix_free (&C)) ; + OK (GrB_Matrix_new (&C, GrB_FP64, 100, 100)) ; + OK (GxB_unload_Matrix_into_Container (C, Container, NULL)) ; + OK (GrB_Vector_free (&(Container->h))) ; + OK (GrB_Vector_new (&(Container->h), GrB_UINT64, 42)) ; + OK (GrB_Vector_assign_UINT64 (Container->h, NULL, NULL, 0, GrB_ALL, 100, + NULL)) ; + expected = GrB_INVALID_VALUE ; + ERR (GxB_load_Matrix_from_Container (C, Container, NULL)) ; + OK (GrB_Matrix_free (&C)) ; + OK (GrB_Matrix_new (&C, GrB_FP64, 100, 100)) ; + Container->format = GxB_BITMAP ; + Container->nrows = 100 ; + Container->ncols = 100 ; + ERR (GxB_load_Matrix_from_Container (C, Container, NULL)) ; + Container->format = GxB_SPARSE ; + OK (GrB_Matrix_free (&C)) ; + OK (GrB_Matrix_new (&C, GrB_FP64, 100, 100)) ; + ERR (GxB_load_Matrix_from_Container (C, Container, NULL)) ; + + OK (GrB_Matrix_free (&C)) ; + OK (GxB_Container_free (&Container)) ; + OK (GxB_Container_new (&Container)) ; + OK (GrB_Matrix_new (&C, GrB_FP64, 100, 100)) ; + OK (GxB_unload_Matrix_into_Container (C, Container, NULL)) ; + + void *x = Container->p->x ; + size_t x_size = Container->p->x_size ; + Container->p->x_shallow = true ; + Container->jumbled = true ; + ERR (GxB_load_Matrix_from_Container (C, Container, NULL)) ; + Container->p->x_shallow = false ; + GB_FREE_MEMORY ((void **) &x, x_size) ; + OK (GxB_Container_free (&Container)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + FREE_ALL ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test39: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test4.c b/GraphBLAS/Test/GB_mex_test4.c index 764a91d175..0c4f2483f1 100644 --- a/GraphBLAS/Test/GB_mex_test4.c +++ b/GraphBLAS/Test/GB_mex_test4.c @@ -2,7 +2,7 @@ // GB_mex_test4: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; int expected = GrB_SUCCESS ; - double wtime = GB_Global_get_wtime ( ) ; + double wtime = GB_omp_get_wtime ( ) ; //-------------------------------------------------------------------------- // pack/unpack @@ -43,7 +43,7 @@ void mexFunction int pr = GxB_SILENT ; - GrB_Index m = 4, n = 5 ; + uint64_t m = 4, n = 5 ; OK (GrB_Matrix_new (&S, GrB_FP64, m, n)) ; OK (GxB_Matrix_Option_set (S, GxB_FORMAT, GxB_BY_ROW)) ; double x = 0 ; @@ -51,8 +51,7 @@ void mexFunction { for (int j = 0 ; j < n ; j++) { - OK (GrB_Matrix_setElement_FP64 (S, x, - (GrB_Index) i, (GrB_Index) j)) ; + OK (GrB_Matrix_setElement_FP64 (S, x, (uint64_t) i, (uint64_t) j)) ; x++ ; } } @@ -60,12 +59,12 @@ void mexFunction OK (GxB_Matrix_fprint (S, "initial S by row", pr, NULL)) ; double *Cx = NULL ; - GrB_Index *Cp = NULL, *Ch = NULL, *Ci = NULL ; + uint64_t *Cp = NULL, *Ch = NULL, *Ci = NULL ; // OK; 64-bit only int8_t *Cb = NULL ; - GrB_Index Cp_size = 0, Ch_size = 0, Cb_size = 0, Ci_size = 0, Cx_size = 0 ; + uint64_t Cp_size = 0, Ch_size = 0, Cb_size = 0, Ci_size = 0, Cx_size = 0 ; bool C_iso = false ; bool jumbled = false ; - GrB_Index nrows = 0, ncols = 0, nvals = 0, nvec = 0 ; + uint64_t nrows = 0, ncols = 0, nvals = 0, nvec = 0 ; // full (row to col) OK (GrB_Matrix_dup (&C, S)) ; @@ -259,7 +258,7 @@ void mexFunction //-------------------------------------------------------------------------- GB_mx_put_global (true) ; - wtime = GB_Global_get_wtime ( ) - wtime ; + wtime = GB_omp_get_wtime ( ) - wtime ; printf ("\nGB_mex_test4: all tests passed, time: %g\n\n", wtime) ; } diff --git a/GraphBLAS/Test/GB_mex_test40.c b/GraphBLAS/Test/GB_mex_test40.c new file mode 100644 index 0000000000..3b618abeee --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test40.c @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// GB_mex_test40: GB_ix_realloc +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + GrB_Matrix_free (&A) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + + //-------------------------------------------------------------------------- + // test GB_ix_realloc + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&A, GrB_BOOL, 10, 10)) ; + OK (GrB_Matrix_set_INT32 (A, 32, GxB_ROWINDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_set_INT32 (A, 32, GxB_COLINDEX_INTEGER_HINT)) ; + OK (GrB_Matrix_set_INT32 (A, 32, GxB_OFFSET_INTEGER_HINT)) ; + OK (GrB_Matrix_setElement (A, 1, 1, 1)) ; + OK (GrB_Matrix_wait (A, GrB_MATERIALIZE)) ; + OK (GxB_Matrix_fprint (A, "A for ix_realloc", 5, NULL)) ; + int64_t nzmax_new = ((int64_t) UINT32_MAX) + 10 ; + printf ("nzmax_new %ld\n", nzmax_new) ; + OK (GB_ix_realloc (A, nzmax_new)) ; + OK (GxB_Matrix_fprint (A, "A for ix_realloc; realloced", 5, NULL)) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + FREE_ALL ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test40: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test41.c b/GraphBLAS/Test/GB_mex_test41.c new file mode 100644 index 0000000000..315239767b --- /dev/null +++ b/GraphBLAS/Test/GB_mex_test41.c @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// GB_mex_test41: test iso get/set +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + GrB_Matrix_free (&A) ; \ + GrB_Vector_free (&V) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info ; + GrB_Matrix A = NULL ; + GrB_Vector V = NULL ; + uint64_t n = 4 ; + bool iso ; + int iso2 ; + + //-------------------------------------------------------------------------- + // test iso_hint + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; + OK (GrB_Vector_new (&V, GrB_FP64, n)) ; + OK (GxB_Matrix_fprint (A, "A empty", 5, NULL)) ; + OK (GxB_Vector_fprint (V, "V empty", 5, NULL)) ; + + // create iso-valued matrix A and vector V + OK (GrB_Matrix_assign_FP64 (A, NULL, NULL, 3.14159, + GrB_ALL, n, GrB_ALL, n, NULL)) ; + OK (GxB_Matrix_fprint (A, "A iso", 5, NULL)) ; + iso2 = false ; + OK (GrB_Matrix_get_INT32 (A, &iso2, GxB_ISO)) ; + CHECK (iso2) ; + iso = false ; + OK (GxB_Matrix_iso (&iso, A)) ; + CHECK (iso) ; + + OK (GrB_Vector_assign_FP64 (V, NULL, NULL, 15.9, GrB_ALL, n, NULL)) ; + OK (GxB_Vector_fprint (V, "V iso", 5, NULL)) ; + iso2 = false ; + OK (GrB_Vector_get_INT32 (V, &iso2, GxB_ISO)) ; + CHECK (iso2) ; + iso = false ; + OK (GxB_Vector_iso (&iso, V)) ; + CHECK (iso) ; + + // make them non-iso + OK (GrB_Matrix_set_INT32 (A, 0, GxB_ISO)) ; + OK (GxB_Matrix_fprint (A, "A not iso", 5, NULL)) ; + iso2 = true ; + OK (GrB_Matrix_get_INT32 (A, &iso2, GxB_ISO)) ; + CHECK (!iso2) ; + iso = true ; + OK (GxB_Matrix_iso (&iso, A)) ; + CHECK (!iso) ; + + OK (GrB_Vector_set_INT32 (V, 0, GxB_ISO)) ; + OK (GxB_Vector_fprint (V, "V not iso", 5, NULL)) ; + iso2 = true ; + OK (GrB_Vector_get_INT32 (V, &iso2, GxB_ISO)) ; + CHECK (!iso2) ; + iso = true ; + OK (GxB_Vector_iso (&iso, V)) ; + CHECK (!iso) ; + + // make them iso + OK (GrB_Matrix_set_INT32 (A, 1, GxB_ISO)) ; + OK (GxB_Matrix_fprint (A, "A iso again", 5, NULL)) ; + iso2 = false ; + OK (GrB_Matrix_get_INT32 (A, &iso2, GxB_ISO)) ; + CHECK (iso2) ; + iso = false ; + OK (GxB_Matrix_iso (&iso, A)) ; + CHECK (iso) ; + + OK (GrB_Vector_set_INT32 (V, 1, GxB_ISO)) ; + OK (GxB_Vector_fprint (V, "V iso again", 5, NULL)) ; + OK (GrB_Vector_get_INT32 (V, &iso2, GxB_ISO)) ; + CHECK (iso2) ; + iso = false ; + OK (GxB_Vector_iso (&iso, V)) ; + CHECK (iso) ; + + //-------------------------------------------------------------------------- + // finalize GraphBLAS + //-------------------------------------------------------------------------- + + FREE_ALL ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test41: all tests passed\n\n") ; +} + diff --git a/GraphBLAS/Test/GB_mex_test5.c b/GraphBLAS/Test/GB_mex_test5.c index cd6ff0cbd1..472af636f4 100644 --- a/GraphBLAS/Test/GB_mex_test5.c +++ b/GraphBLAS/Test/GB_mex_test5.c @@ -2,7 +2,7 @@ // GB_mex_test5: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -252,8 +252,8 @@ void mexFunction mytype scalar1 ; scalar1.x = 4 ; scalar1.y = 3 ; - GrB_Index *Ap = NULL ; - GrB_Index *Ai = NULL ; + uint64_t *Ap = NULL ; // OK; 64-bit only + uint64_t *Ai = NULL ; // OK; 64-bit only float *Ax = NULL ; void *blob = NULL ; @@ -596,7 +596,7 @@ void mexFunction OK (GxB_Matrix_fprint (A, "A", 3, NULL)) ; OK (GrB_Matrix_new (&C, GrB_INT64, 5, 6)) ; - int64_t cnvals ; + uint64_t cnvals ; OK (GxB_Matrix_fprint (A, "A for select:banded", 3, NULL)) ; OK (GxB_Global_Option_set (GxB_BURBLE, true)) ; @@ -663,7 +663,7 @@ void mexFunction OK (GrB_Matrix_select_INT64 (E, NULL, NULL, UpperBanded, A, 1, GrB_DESC_T0)) ; OK (GxB_Matrix_fprint (E, "E = upper_banded (A')", 3, NULL)) ; - int64_t envals ; + uint64_t envals ; OK (GrB_Matrix_nvals (&envals, E)) ; CHECK (envals == 8) ; for (int i = 0 ; i < 6 ; i++) @@ -924,7 +924,7 @@ void mexFunction //-------------------------------------------------------------------------- blob = NULL ; - GrB_Index blob_size = 0, blob_size2 = 0 ; + uint64_t blob_size = 0, blob_size2 = 0 ; OK (GxB_Matrix_serialize (&blob, &blob_size, A, NULL)) ; OK (GxB_Matrix_deserialize (&C, MyType, blob, blob_size, NULL)) ; OK (GxB_Matrix_fprint (C, "C of MyType", 3, NULL)) ; @@ -1036,7 +1036,7 @@ void mexFunction GrB_ALL, 4, NULL)) ; OK (GrB_Matrix_setElement_FP32 (A, (float) 32, 0, 0)) ; - GrB_Format fmt ; + int fmt ; OK (GxB_Matrix_Option_set (A, GxB_FORMAT, GxB_BY_ROW)) ; OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_HYPERSPARSE)) ; @@ -1131,11 +1131,11 @@ void mexFunction // import/export //-------------------------------------------------------------------------- - GrB_Index Ap_len = 5 ; - GrB_Index Ai_len = 16 ; - GrB_Index Ax_len = 16 ; - Ap = mxCalloc (Ap_len , sizeof (GrB_Index)) ; - Ai = mxCalloc (Ax_len, sizeof (GrB_Index)) ; + uint64_t Ap_len = 5 ; + uint64_t Ai_len = 16 ; + uint64_t Ax_len = 16 ; + Ap = mxCalloc (Ap_len, sizeof (uint64_t)) ; + Ai = mxCalloc (Ax_len, sizeof (uint64_t)) ; Ax = mxCalloc (Ax_len, sizeof (float)) ; OK (GrB_Matrix_new (&A, GrB_FP32, 4, 4)) ; OK (GrB_Matrix_setElement_FP32 (A, 1, 0, 0)) ; @@ -1199,10 +1199,9 @@ void mexFunction // build with duplicates //-------------------------------------------------------------------------- -#if 1 - GrB_Index *I = mxCalloc (4, sizeof (GrB_Index)) ; - GrB_Index *J = mxCalloc (4, sizeof (GrB_Index)) ; - double *X = mxCalloc (4, sizeof (double)) ; + uint64_t *I = mxCalloc (4, sizeof (uint64_t)) ; // OK + uint64_t *J = mxCalloc (4, sizeof (uint64_t)) ; // OK + double *X = mxCalloc (4, sizeof (double)) ; expected = GrB_INVALID_VALUE ; OK (GrB_Matrix_new (&A, GrB_FP64, 5, 5)) ; ERR (GrB_Matrix_build (A, I, J, X, 4, NULL)) ; @@ -1271,7 +1270,7 @@ void mexFunction OK (GrB_Matrix_select_Scalar (A, NULL, NULL, GrB_VALUEEQ_FP32, A, scalar, NULL)) ; OK (GxB_Matrix_fprint (A, "A iso select output", 3, NULL)) ; - int64_t anvals ; + uint64_t anvals ; OK (GrB_Matrix_nvals (&anvals, A)) ; CHECK (anvals == 5) ; @@ -1460,7 +1459,6 @@ void mexFunction } OK (GrB_Matrix_free_ (&A)) ; -#endif //-------------------------------------------------------------------------- // wrapup @@ -1471,25 +1469,6 @@ void mexFunction MXFREE (Ai) ; MXFREE (Ax) ; -#if 0 - GrB_free (&C) ; - GrB_free (&A) ; - GrB_free (&M) ; - GrB_free (&S) ; - GrB_free (&E) ; - GrB_free (&desc) ; - GrB_free (&w) ; - GrB_free (&scalar) ; - GrB_free (&Banded) ; - GrB_free (&UpperBanded) ; - GrB_free (&UpperBanded_int64) ; - GrB_free (&Gunk) ; - GrB_free (&Banded32) ; - GrB_free (&type) ; - GrB_free (&MyType) ; - GrB_free (&MyInt64) ; -#endif - GB_mx_put_global (true) ; printf ("\nGB_mex_test5: all tests passed\n\n") ; } diff --git a/GraphBLAS/Test/GB_mex_test6.c b/GraphBLAS/Test/GB_mex_test6.c index 865f7a26bc..a5f9e50c69 100644 --- a/GraphBLAS/Test/GB_mex_test6.c +++ b/GraphBLAS/Test/GB_mex_test6.c @@ -2,7 +2,7 @@ // GB_mex_test6: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_test7.c b/GraphBLAS/Test/GB_mex_test7.c index fd5c0c78bb..65f504bbf9 100644 --- a/GraphBLAS/Test/GB_mex_test7.c +++ b/GraphBLAS/Test/GB_mex_test7.c @@ -2,7 +2,7 @@ // GB_mex_test7: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,19 +44,23 @@ void mexFunction OK (GrB_Scalar_new (&s, GrB_INT64)) ; OK (GrB_Scalar_setElement_INT64 (s, 0)) ; - OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, (GrB_Field) GxB_HYPER_HASH)) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; OK (GrB_Scalar_clear (s)) ; - OK (GrB_Global_get_Scalar (GrB_GLOBAL, s, (GrB_Field) GxB_HYPER_HASH)) ; + OK (GrB_Global_get_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; int64_t i = 1 ; OK (GrB_Scalar_extractElement_INT64 (&i, s)) ; CHECK (i == 0) ; OK (GrB_Matrix_new (&A, GrB_FP64, 100, 100)) ; - OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, (GrB_Field) GxB_HYPERSPARSE)) ; + OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_HYPERSPARSE)) ; OK (GrB_Matrix_setElement_FP64 (A, (double) 1.2, 0, 0)) ; OK (GrB_Matrix_wait (A, 1)) ; OK (GxB_Matrix_fprint (A, "A valid", 3, NULL)) ; + int will_wait = true ; + OK (GrB_Matrix_get_INT32 (A, &will_wait, GxB_WILL_WAIT)) ; + CHECK (!will_wait) ; + printf ("\ninvalid A->p:\n") ; size_t save = A->p_size ; A->p_size = 3 ; @@ -116,15 +120,40 @@ void mexFunction OK (GrB_Matrix_free (&(B->Y))) ; B->Y = A->Y ; B->Y_shallow = true ; - GB_Global_print_mem_shallow_set (true) ; + + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, + GxB_INCLUDE_READONLY_STATISTICS)) ; OK (GxB_Matrix_fprint (B, - "B valid (shallow hypersparse: print_mem_shallow true)", 3, NULL)) ; - GB_Global_print_mem_shallow_set (false) ; + "B valid (shallow hypersparse: stats_mem_shallow true)", 3, NULL)) ; + + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, + GxB_INCLUDE_READONLY_STATISTICS)) ; OK (GxB_Matrix_fprint (B, - "B valid (shallow hypersparse: print_mem_shallow false)", 3, NULL)) ; + "B valid (shallow hypersparse: stats_mem_shallow false)", 3, NULL)) ; + + expected = GrB_INVALID_OBJECT ; + B->jumbled = true ; + ERR (GxB_Matrix_fprint (B, "B invalid; jumbled and shallow", 3, NULL)) ; + B->jumbled = false ; + + OK (GxB_print (A,3)) ; + OK (GxB_print (B,3)) ; + + A->jumbled = true ; + will_wait = false ; + OK (GrB_Matrix_get_INT32 (A, &will_wait, GxB_WILL_WAIT)) ; + CHECK (will_wait) ; + + A->jumbled = false ; + will_wait = true ; + OK (GrB_Matrix_get_INT32 (A, &will_wait, GxB_WILL_WAIT)) ; + CHECK (!will_wait) ; + + OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, + GxB_INCLUDE_READONLY_STATISTICS)) ; + + OK (GxB_print (B,3)) ; - GxB_print (A,3) ; - GxB_print (B,3) ; CHECK (GB_any_aliased (A, B)) ; OK (GrB_Matrix_free (&B)) ; @@ -134,9 +163,12 @@ void mexFunction OK (GxB_pack_HyperHash (A, &Y, NULL)) ; OK (GxB_Matrix_fprint (A, "A hypersparse (pack did nothing)", 3, NULL)) ; - A->Y->i [0] = 99 ; + GB_MDECL (A_Yi, , ) ; + A_Yi = A->Y->i ; + GB_IPTR (A_Yi, A->Y->i_is_32) ; + GB_ISET (A_Yi, 0, 99) ; // A_Yi [0] = 99 ; ERR (GxB_Matrix_fprint (A, "A->Y invalid (not found) ", 3, NULL)) ; - A->Y->i [0] = 0 ; + GB_ISET (A_Yi, 0, 0) ; // A_Yi [0] = 0 ; int64_t *Yx = A->Y->x ; Yx [0] = 99 ; @@ -162,10 +194,7 @@ void mexFunction int64_t n = 1024*1024 ; OK (GrB_Matrix_new (&A, GrB_FP64, n, n)) ; - OK (GrB_Matrix_new (&C1, GrB_FP64, n, n)) ; - OK (GrB_Matrix_new (&C2, GrB_FP64, n, n)) ; - OK (GxB_Matrix_Option_set (C1, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - OK (GxB_Matrix_Option_set (C2, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_HYPERSPARSE)) ; OK (GxB_Matrix_Option_set (A, GxB_FORMAT, GxB_BY_ROW)) ; @@ -252,18 +281,50 @@ void mexFunction OK (GxB_Matrix_fprint (A, "A->Y with many collisions", 2, NULL)) ; CHECK (A->Y != NULL) ; - CHECK (A->Y->p [1] == 257) ; + GB_MDECL (A_Yp, , ) ; + A_Yp = A->Y->p ; + GB_IPTR (A_Yp, A->Y->p_is_32) ; + CHECK (GB_IGET (A_Yp, 1) == 257) ; - OK (GrB_mxm (C1, A, NULL, GrB_PLUS_TIMES_SEMIRING_FP64, A, A, - GrB_DESC_T0)) ; - OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; - OK (GrB_mxm (C2, A, NULL, GrB_PLUS_TIMES_SEMIRING_FP64, A, A, - GrB_DESC_T0)) ; - OK (GxB_Matrix_fprint (C1, "C=A'*A", 2, NULL)) ; - CHECK (GB_mx_isequal (C1, C2, 0)) ; + for (int shallow = 0 ; shallow <= 1 ; shallow++) + { + for (int j_is_32 = 0 ; j_is_32 <= 1 ; j_is_32++) + { + OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, + GxB_HYPERSPARSE)) ; + GrB_Matrix Y = NULL ; + if (shallow) + { + A->Y_shallow = true ; + Y = A->Y ; + } + OK (GB_convert_int (A, false, j_is_32, false, true)) ; + if (shallow) + { + CHECK (A->Y == NULL) ; + CHECK (A->Y_shallow == false) ; + OK (GrB_Matrix_free (&Y)) ; + } + OK (GxB_Matrix_fprint (A, "hyper A for hyper_hash test", 2, NULL)) ; + OK (GrB_Matrix_new (&C1, GrB_FP64, n, n)) ; + OK (GrB_Matrix_new (&C2, GrB_FP64, n, n)) ; + OK (GxB_Matrix_Option_set (C1, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GxB_Matrix_Option_set (C2, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GrB_mxm (C1, A, NULL, GrB_PLUS_TIMES_SEMIRING_FP64, A, A, + GrB_DESC_T0)) ; + OK (GxB_Matrix_fprint (C1, "C1=A'*A", 2, NULL)) ; + OK (GxB_Matrix_Option_set (A, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; + OK (GxB_Matrix_fprint (A, "sparse A for hyper_hash test", 2, + NULL)) ; + OK (GrB_mxm (C2, A, NULL, GrB_PLUS_TIMES_SEMIRING_FP64, A, A, + GrB_DESC_T0)) ; + OK (GxB_Matrix_fprint (C2, "C2=A'*A", 2, NULL)) ; + CHECK (GB_mx_isequal (C1, C2, 0)) ; + OK (GrB_Matrix_free (&C1)) ; + OK (GrB_Matrix_free (&C2)) ; + } + } OK (GrB_Matrix_free (&A)) ; - OK (GrB_Matrix_free (&C1)) ; - OK (GrB_Matrix_free (&C2)) ; //-------------------------------------------------------------------------- // axv2 and avx512f @@ -297,9 +358,9 @@ void mexFunction //-------------------------------------------------------------------------- OK (GrB_Scalar_setElement_INT64 (s, 1024)) ; - OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, (GrB_Field) GxB_HYPER_HASH)) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; OK (GrB_Scalar_clear (s)) ; - OK (GrB_Global_get_Scalar (GrB_GLOBAL, s, (GrB_Field) GxB_HYPER_HASH)) ; + OK (GrB_Global_get_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH)) ; OK (GrB_Scalar_extractElement_INT64 (&i, s)) ; CHECK (i == 1024) ; OK (GrB_Scalar_free (&s)) ; diff --git a/GraphBLAS/Test/GB_mex_test8.c b/GraphBLAS/Test/GB_mex_test8.c index 5e24920ef2..955d47f4db 100644 --- a/GraphBLAS/Test/GB_mex_test8.c +++ b/GraphBLAS/Test/GB_mex_test8.c @@ -2,7 +2,7 @@ // GB_mex_test8: still more basic tests //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -67,7 +67,7 @@ void mexFunction // reshape error handling //-------------------------------------------------------------------------- - GrB_Index n = (1L << 40) ; + uint64_t n = (1L << 40) ; OK (GrB_Matrix_new (&C, GrB_BOOL, n, n)) ; expected = GrB_OUT_OF_MEMORY ; ERR (GxB_Matrix_reshape (C, true, n/2, 2*n, NULL)) ; diff --git a/GraphBLAS/Test/GB_mex_test9.c b/GraphBLAS/Test/GB_mex_test9.c index 0dca3c5494..5817998138 100644 --- a/GraphBLAS/Test/GB_mex_test9.c +++ b/GraphBLAS/Test/GB_mex_test9.c @@ -2,7 +2,7 @@ // GB_mex_test9: still more basic tests (not for Windows) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,25 +26,24 @@ bigtype ; void f1 (void *z, const void *x) ; void f2 (void *z, const void *x, const void *y) ; - void i1 (void *z, const void *x, GrB_Index i, GrB_Index j, const void *thunk) ; + void i1 (void *z, const void *x, uint64_t i, uint64_t j, const void *thunk) ; -#define F1 \ -"void f1 (void *z, const void *x) " \ +#define F1_DEFN \ +"void f1 (void *z, const void *x) " \ "{ (*((double *)z)) = 2*(*(double *)x) ; } " void f1 (void *z, const void *x) { (*((double *)z)) = 2*(*(double *)x) ; } -#define F2 \ -"void f2 (void *z, const void *x, const void *y) " \ +#define F2_DEFN \ +"void f2 (void *z, const void *x, const void *y) " \ "{ (*((double *)z)) = 2*(*(double *)x) + 1 ; } " void f2 (void *z, const void *x, const void *y) { (*((double *)z)) = 2*(*(double *)x) + 1 ; } -#define I1 \ -"void i1 (void *z, const void *x, GrB_Index i, GrB_Index j, " \ -" const void *thunk) " \ +#define I1_DEFN \ +"void i1 (void *z, const void *x, uint64_t i, uint64_t j, const void *thunk) " \ "{ (*((bool *)z)) = (i == j) ; }" - void i1 (void *z, const void *x, GrB_Index i, GrB_Index j, const void *thunk) + void i1 (void *z, const void *x, uint64_t i, uint64_t j, const void *thunk) { (*((bool *)z)) = (i == j) ; } #define GET_DEEP_COPY ; @@ -83,19 +82,19 @@ void mexFunction //-------------------------------------------------------------------------- GrB_UnaryOp op1 = NULL ; - METHOD (GxB_UnaryOp_new (&op1, &f1, GrB_FP64, GrB_FP64, "f1", F1)) ; + METHOD (GxB_UnaryOp_new (&op1, &f1, GrB_FP64, GrB_FP64, "f1", F1_DEFN)) ; OK (GxB_UnaryOp_fprint (op1, "f1", GxB_COMPLETE, stdout)) ; OK (GrB_UnaryOp_free (&op1)) ; GrB_BinaryOp op2 = NULL ; METHOD (GxB_BinaryOp_new (&op2, &f2, GrB_FP64, GrB_FP64, GrB_FP64, - "f2", F2)) ; + "f2", F2_DEFN)) ; OK (GxB_BinaryOp_fprint (op2, "f2", GxB_COMPLETE, stdout)) ; OK (GrB_BinaryOp_free (&op2)) ; GrB_IndexUnaryOp opi = NULL ; METHOD (GxB_IndexUnaryOp_new (&opi, &i1, GrB_FP64, GrB_FP64, GrB_FP64, - "i1", I1)) ; + "i1", I1_DEFN)) ; OK (GxB_IndexUnaryOp_fprint (opi, "i1", GxB_COMPLETE, stdout)) ; OK (GrB_IndexUnaryOp_free (&opi)) ; diff --git a/GraphBLAS/Test/GB_mex_transpose.c b/GraphBLAS/Test/GB_mex_transpose.c index 53dafa49ad..2639858dbd 100644 --- a/GraphBLAS/Test/GB_mex_transpose.c +++ b/GraphBLAS/Test/GB_mex_transpose.c @@ -2,7 +2,7 @@ // GB_mex_transpose: transpose a sparse matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_tril.c b/GraphBLAS/Test/GB_mex_tril.c index 58782574c3..94977a14fb 100644 --- a/GraphBLAS/Test/GB_mex_tril.c +++ b/GraphBLAS/Test/GB_mex_tril.c @@ -2,7 +2,7 @@ // GB_mex_tril: compute C=tril(A,1) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_triple_mxm.c b/GraphBLAS/Test/GB_mex_triple_mxm.c index ef27dc98dc..518e01fb05 100644 --- a/GraphBLAS/Test/GB_mex_triple_mxm.c +++ b/GraphBLAS/Test/GB_mex_triple_mxm.c @@ -2,7 +2,7 @@ // GB_mex_triple_mxm: C = A*B*E //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -99,7 +99,7 @@ void mexFunction } // T = B*E - GrB_Index nrows, ncols ; + uint64_t nrows, ncols ; GrB_Matrix_nrows (&nrows, B) ; GrB_Matrix_ncols (&ncols, E) ; GrB_Matrix_new (&T, A->type, nrows, ncols) ; diff --git a/GraphBLAS/Test/GB_mex_triu.c b/GraphBLAS/Test/GB_mex_triu.c index 4fc4022a94..20dfb9cd1f 100644 --- a/GraphBLAS/Test/GB_mex_triu.c +++ b/GraphBLAS/Test/GB_mex_triu.c @@ -2,7 +2,7 @@ // GB_mex_triu: compute C=triu(A,1) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mex_unpack_pack.c b/GraphBLAS/Test/GB_mex_unpack_pack.c index 26dc1b0a9f..6de893ce41 100644 --- a/GraphBLAS/Test/GB_mex_unpack_pack.c +++ b/GraphBLAS/Test/GB_mex_unpack_pack.c @@ -2,7 +2,7 @@ // GB_mex_unpack_pack: unpack and then pack a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -68,16 +68,16 @@ GrB_Matrix A = NULL ; GrB_Matrix C = NULL ; GrB_Matrix Y = NULL ; -GrB_Index *Cp = NULL, *Ch = NULL, *Ci = NULL ; +uint64_t *Cp = NULL, *Ch = NULL, *Ci = NULL ; // OK; 64-bit only void *Cx = NULL ; int8_t *Cb = NULL ; -GrB_Index nvec = 0, nvals = 0 ; +uint64_t nvec = 0, nvals = 0 ; -GrB_Index Cp_size = 0 ; -GrB_Index Ch_size = 0 ; -GrB_Index Cb_size = 0 ; -GrB_Index Ci_size = 0 ; -GrB_Index Cx_size = 0 ; +uint64_t Cp_size = 0 ; +uint64_t Ch_size = 0 ; +uint64_t Cb_size = 0 ; +uint64_t Ci_size = 0 ; +uint64_t Cx_size = 0 ; bool iso = false ; int64_t ignore = -1 ; diff --git a/GraphBLAS/Test/GB_mex_vdiag.c b/GraphBLAS/Test/GB_mex_vdiag.c index c21435aa75..7731369133 100644 --- a/GraphBLAS/Test/GB_mex_vdiag.c +++ b/GraphBLAS/Test/GB_mex_vdiag.c @@ -2,7 +2,7 @@ // GB_mex_vdiag: compute v=diag(A,k) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -65,8 +65,8 @@ void mexFunction // construct V int64_t n, nrows, ncols ; - GrB_Matrix_nrows (&nrows, A) ; - GrB_Matrix_ncols (&ncols, A) ; + GrB_Matrix_nrows ((uint64_t *) &nrows, A) ; + GrB_Matrix_ncols ((uint64_t *) &ncols, A) ; if (k >= ncols || k <= -nrows) { // output vector V must have zero length diff --git a/GraphBLAS/Test/GB_mex_vxm.c b/GraphBLAS/Test/GB_mex_vxm.c index 4a646be183..0806a09bd7 100644 --- a/GraphBLAS/Test/GB_mex_vxm.c +++ b/GraphBLAS/Test/GB_mex_vxm.c @@ -2,7 +2,7 @@ // GB_mex_vxm: w' = accum(w',u'A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_BinaryOp_to_Monoid.c b/GraphBLAS/Test/GB_mx_BinaryOp_to_Monoid.c index dec395df7a..5b8ce09462 100644 --- a/GraphBLAS/Test/GB_mx_BinaryOp_to_Monoid.c +++ b/GraphBLAS/Test/GB_mx_BinaryOp_to_Monoid.c @@ -2,7 +2,7 @@ // GB_mx_BinaryOp_to_Monoid: convert a binary op to a monoid //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_Matrix_to_mxArray.c b/GraphBLAS/Test/GB_mx_Matrix_to_mxArray.c index f6febe6974..ef123bd841 100644 --- a/GraphBLAS/Test/GB_mx_Matrix_to_mxArray.c +++ b/GraphBLAS/Test/GB_mx_Matrix_to_mxArray.c @@ -2,7 +2,7 @@ // GB_mx_Matrix_to_mxArray //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_Monoid.c b/GraphBLAS/Test/GB_mx_Monoid.c index 6b3d85e71f..dc6564d414 100644 --- a/GraphBLAS/Test/GB_mx_Monoid.c +++ b/GraphBLAS/Test/GB_mx_Monoid.c @@ -2,7 +2,7 @@ // GB_mx_Monoid: construct a monoid from a built-in operator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_Type.c b/GraphBLAS/Test/GB_mx_Type.c index aafa6ebea6..759242a6fa 100644 --- a/GraphBLAS/Test/GB_mx_Type.c +++ b/GraphBLAS/Test/GB_mx_Type.c @@ -2,7 +2,7 @@ // GB_mx_Type: get GraphBLAS type of a built-in matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_Type_to_mxstring.c b/GraphBLAS/Test/GB_mx_Type_to_mxstring.c index 380ef215c8..b26ef96df2 100644 --- a/GraphBLAS/Test/GB_mx_Type_to_mxstring.c +++ b/GraphBLAS/Test/GB_mx_Type_to_mxstring.c @@ -2,7 +2,7 @@ // GB_mx_Type_to_string: return a built-in string for a GrB_Type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_Vector_to_mxArray.c b/GraphBLAS/Test/GB_mx_Vector_to_mxArray.c index 526fe1292f..bcc7e33932 100644 --- a/GraphBLAS/Test/GB_mx_Vector_to_mxArray.c +++ b/GraphBLAS/Test/GB_mx_Vector_to_mxArray.c @@ -2,7 +2,7 @@ // GB_mx_Vector_to_mxArray //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_abort.c b/GraphBLAS/Test/GB_mx_abort.c index f854cadb88..9b88d12490 100644 --- a/GraphBLAS/Test/GB_mx_abort.c +++ b/GraphBLAS/Test/GB_mx_abort.c @@ -2,7 +2,7 @@ // GB_mx_abort: terminate //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_alias.c b/GraphBLAS/Test/GB_mx_alias.c index 0d6f5d73af..b20bb98890 100644 --- a/GraphBLAS/Test/GB_mx_alias.c +++ b/GraphBLAS/Test/GB_mx_alias.c @@ -2,7 +2,7 @@ // GB_mx_alias: return an aliased argument //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_at_exit.c b/GraphBLAS/Test/GB_mx_at_exit.c index 26ab05f9e7..6df0b9de5b 100644 --- a/GraphBLAS/Test/GB_mx_at_exit.c +++ b/GraphBLAS/Test/GB_mx_at_exit.c @@ -2,7 +2,7 @@ // GB_mx_at_exit: terminate GraphBLAS //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_cover.c b/GraphBLAS/Test/GB_mx_cover.c index 289e7217d8..c222b8e2f2 100644 --- a/GraphBLAS/Test/GB_mx_cover.c +++ b/GraphBLAS/Test/GB_mx_cover.c @@ -2,7 +2,7 @@ // GB_mx_cover.c: utilities for test coverage //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_create_full.c b/GraphBLAS/Test/GB_mx_create_full.c index 5cba213bba..643d6dd325 100644 --- a/GraphBLAS/Test/GB_mx_create_full.c +++ b/GraphBLAS/Test/GB_mx_create_full.c @@ -2,7 +2,7 @@ // GB_mx_create_full: create a full built-in matrix of a given GrB_Type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,8 +11,8 @@ mxArray *GB_mx_create_full // return new built-in full matrix ( - const GrB_Index nrows, - const GrB_Index ncols, + const uint64_t nrows, + const uint64_t ncols, GrB_Type type // type of the matrix to create ) { diff --git a/GraphBLAS/Test/GB_mx_get_Scalar.c b/GraphBLAS/Test/GB_mx_get_Scalar.c index 529a587d42..9a9ade8214 100644 --- a/GraphBLAS/Test/GB_mx_get_Scalar.c +++ b/GraphBLAS/Test/GB_mx_get_Scalar.c @@ -2,7 +2,7 @@ // GB_mx_get_Scalar: get a GrB_Scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_get_global.c b/GraphBLAS/Test/GB_mx_get_global.c index 9a11be6fc2..25208c68d1 100644 --- a/GraphBLAS/Test/GB_mx_get_global.c +++ b/GraphBLAS/Test/GB_mx_get_global.c @@ -2,7 +2,7 @@ // GB_mx_get_global: get variables from the global workspace //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -55,7 +55,7 @@ bool GB_mx_get_global // true if doing malloc_debug bool burble = GB_Global_burble_get ( ) ; // save JIT control - GxB_JIT_Control control = GB_jitifyer_get_control ( ) ; + int control = GB_jitifyer_get_control ( ) ; if (!GB_Global_GrB_init_called_get ( )) { @@ -169,7 +169,7 @@ bool GB_mx_get_global // true if doing malloc_debug GrB_Scalar s ; GrB_Scalar_new (&s, GrB_INT64) ; GrB_Scalar_setElement_INT64 (s, 8) ; - GrB_Global_set_Scalar (GrB_GLOBAL, s, (GrB_Field) GxB_HYPER_HASH) ; + GrB_Global_set_Scalar (GrB_GLOBAL, s, GxB_HYPER_HASH) ; GrB_Scalar_free (&s) ; //-------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_mx_isequal.c b/GraphBLAS/Test/GB_mx_isequal.c index 2aa0622225..938b35b2a1 100644 --- a/GraphBLAS/Test/GB_mx_isequal.c +++ b/GraphBLAS/Test/GB_mx_isequal.c @@ -2,7 +2,7 @@ // GB_mx_isequal: check if two matrices are equal //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -29,36 +29,38 @@ bool GB_mx_isequal // true if A and B are exactly the same return (false) ; } - GB_Pending AP = A->Pending ; - GB_Pending BP = B->Pending ; - if (A->magic != B->magic) return (false) ; if (A->type != B->type ) return (false) ; if (A->vlen != B->vlen ) return (false) ; if (A->vdim != B->vdim ) return (false) ; if (A->nvec != B->nvec ) return (false) ; - if (GB_nnz (A) != GB_nnz (B) ) return (false) ; - + if (GB_nnz (A) != GB_nnz (B) ) return (false) ; if ((A->h != NULL) != (B->h != NULL)) return (false) ; - if (A->is_csc != B->is_csc ) return (false) ; - - if (A->nzombies != B->nzombies ) return (false) ; + if (A->is_csc != B->is_csc ) return (false) ; + if (A->nzombies != B->nzombies ) return (false) ; - if ((AP != NULL) != (BP != NULL)) return (false) ; - - if (AP != NULL) + GB_Pending A_Pending = A->Pending ; + GB_Pending B_Pending = B->Pending ; + if ((A_Pending != NULL) != (B_Pending != NULL)) return (false) ; + if (A_Pending != NULL) { - if (AP->n != BP->n ) return (false) ; - if (AP->sorted != BP->sorted) return (false) ; - if (AP->op != BP->op ) return (false) ; - if (AP->type != BP->type ) return (false) ; - if (AP->size != BP->size ) return (false) ; + if (A_Pending->n != B_Pending->n ) return (false) ; + if (A_Pending->sorted != B_Pending->sorted) return (false) ; + if (A_Pending->op != B_Pending->op ) return (false) ; + if (A_Pending->type != B_Pending->type ) return (false) ; + if (A_Pending->size != B_Pending->size ) return (false) ; } + if (A->p_is_32 != B->p_is_32) return (false) ; + if (A->j_is_32 != B->j_is_32) return (false) ; + if (A->i_is_32 != B->i_is_32) return (false) ; + size_t psize = (A->p_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t jsize = (A->j_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + size_t isize = (A->i_is_32) ? sizeof (uint32_t) : sizeof (uint64_t) ; + int64_t n = A->nvec ; int64_t nnz = GB_nnz (A) ; - size_t s = sizeof (int64_t) ; size_t asize = A->type->size ; ASSERT (n >= 0 && n <= A->vdim) ; @@ -70,13 +72,13 @@ bool GB_mx_isequal // true if A and B are exactly the same if (!A_is_dense) { - if (!GB_mx_same ((char *) A->p, (char *) B->p, (n+1) * s)) + if (!GB_mx_same ((char *) A->p, (char *) B->p, (n+1) * psize)) { return (false) ; } if (A->h != NULL) { - if (!GB_mx_same ((char *) A->h, (char *) B->h, n * s)) + if (!GB_mx_same ((char *) A->h, (char *) B->h, n * jsize)) return (false) ; } } @@ -93,7 +95,7 @@ bool GB_mx_isequal // true if A and B are exactly the same { if (!A_is_dense) { - if (!GB_mx_same ((char *) A->i, (char *) B->i, nnz * s)) + if (!GB_mx_same ((char *) A->i, (char *) B->i, nnz * isize)) { return (false) ; } @@ -131,19 +133,28 @@ bool GB_mx_isequal // true if A and B are exactly the same } } - if (AP != NULL) + if (A_Pending != NULL) { - size_t psize = AP->size ; - int64_t np = AP->n ; - if (!GB_mx_same ((char *) AP->i, (char *) BP->i, np*s)) return (false) ; - if (!GB_mx_same ((char *) AP->j, (char *) BP->j, np*s)) return (false) ; - if ((AP->x == NULL) != (BP->x == NULL)) // OK + size_t xsize = A_Pending->size ; + int64_t np = A_Pending->n ; + if (!GB_mx_same ((char *) A_Pending->i, (char *) B_Pending->i, + np*isize)) + { + return (false) ; + } + if (!GB_mx_same ((char *) A_Pending->j, (char *) B_Pending->j, + np*jsize)) + { + return (false) ; + } + if ((A_Pending->x == NULL) != (B_Pending->x == NULL)) // OK { return (false) ; } - if (AP->x != NULL && BP->x != NULL) // OK + if (A_Pending->x != NULL && B_Pending->x != NULL) // OK { - if (!GB_mx_same ((char *) AP->x, (char *) BP->x, np*psize)) // OK + if (!GB_mx_same ((char *) A_Pending->x, (char *) B_Pending->x, + np*xsize)) { return (false) ; } diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_BinaryOp.c b/GraphBLAS/Test/GB_mx_mxArray_to_BinaryOp.c index 0583eff03f..f20d1864e0 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_BinaryOp.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_BinaryOp.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_BinaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_Descriptor.c b/GraphBLAS/Test/GB_mx_mxArray_to_Descriptor.c index d87178d6cb..d8af51bec1 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_Descriptor.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_Descriptor.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_Descriptor: get the contents of a GraphBLAS Descriptor //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,7 +18,7 @@ static bool get_descriptor GrB_Descriptor D, // GraphBLAS descriptor to modify const mxArray *D_builtin, // built-in struct with D.output, etc const char *fieldname, // fieldname to extract from D_builtin - const GrB_Desc_Field field // field to set in D + const int field // field to set in D ) { @@ -98,9 +98,21 @@ static bool get_descriptor { info = GxB_Desc_set (D, field, GxB_AxB_HASH) ; } + else if (MATCH (s, "use_values")) + { + info = GrB_Descriptor_set_INT32 (D, GxB_USE_VALUES, field) ; + } + else if (MATCH (s, "use_indices")) + { + info = GrB_Descriptor_set_INT32 (D, GxB_USE_INDICES, field) ; + } + else if (MATCH (s, "is_stride")) + { + info = GrB_Descriptor_set_INT32 (D, GxB_IS_STRIDE, field) ; + } else { - // the string must be one of the four strings listed above + // the string must be one of the strings listed above mexWarnMsgIdAndTxt ("GB:warn","unrecognized descriptor value") ; return (false) ; } @@ -146,7 +158,10 @@ bool GB_mx_mxArray_to_Descriptor // true if successful, false otherwise !get_descriptor (D, D_builtin, "inp0", GrB_INP0) || !get_descriptor (D, D_builtin, "inp1", GrB_INP1) || !get_descriptor (D, D_builtin, "mask", GrB_MASK) || - !get_descriptor (D, D_builtin, "axb", GxB_AxB_METHOD)) + !get_descriptor (D, D_builtin, "axb", GxB_AxB_METHOD) || + !get_descriptor (D, D_builtin, "rowindex_list", GxB_ROWINDEX_LIST) || + !get_descriptor (D, D_builtin, "colindex_list", GxB_COLINDEX_LIST) || + !get_descriptor (D, D_builtin, "value_list", GxB_VALUE_LIST)) { GrB_Matrix_free_(&D) ; mexWarnMsgIdAndTxt ("GB:warn", "descriptor failed") ; diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_IndexUnaryOp.c b/GraphBLAS/Test/GB_mx_mxArray_to_IndexUnaryOp.c index 6059575174..88ca1450ec 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_IndexUnaryOp.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_IndexUnaryOp.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_IndexUnaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_Matrix.c b/GraphBLAS/Test/GB_mx_mxArray_to_Matrix.c index 78a50be9f2..24550df58e 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_Matrix.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_Matrix.c @@ -1,35 +1,35 @@ //------------------------------------------------------------------------------ -// GB_mx_mxArray_to_Matrix +// GB_mx_mxArray_to_Matrix: convert a MATLAB matrix or struct to a GrB_Matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Convert a built-in sparse or full matrix, or a struct to a GraphBLAS sparse -// matrix. The mxArray is either a struct containing two terms: a sparse or -// full matrix or vector, and type (a string, "logical", "double", etc), or it -// is just a plain sparse or full matrix. If A.class is present, it is used to -// typecast the built-in matrix into the corresponding type in GraphBLAS. +// Convert a MATLAB sparse or full matrix, or a struct with the contents of a +// GraphBLAS matrix, to a GrB_Matrix. The mxArray is either a struct +// containing two terms: a sparse or full matrix or vector, and type (a string, +// "logical", "double", etc), or it is just a plain sparse or full matrix. If +// A.class is present, it is used to typecast the MATLAB matrix into the +// corresponding type in GraphBLAS. -// That is: -// A = sparse (...) ; % a sparse double or logical GraphBLAS matrix +// That is: A = sparse (...) ; % a sparse double or logical GraphBLAS matrix -// A.matrix = A ; A.class = 'int8' ; Represents a built-in sparse or full matrix -// that represents a GraphBLAS int8 matrix. On input, the built-in sparse or +// A.matrix = A ; A.class = 'int8' ; Represents a MATLAB sparse or full matrix +// that represents a GraphBLAS int8 matrix. On input, the MATLAB sparse or // full matrix is typecasted. -// The built-in matrix or struct is not modified. If deep_copy is true, the +// The MATLAB matrix or struct is not modified. If deep_copy is true, the // GraphBLAS matrix is always a deep copy and can be modified by GraphBLAS. // Otherwise, its pattern (A->p, A->h, and A->i) may be a shallow copy, and -// A->x is a shallow copy if the built-in matrix is 'logical' or 'double'. +// A->x is a shallow copy if the MATLAB matrix is 'logical' or 'double'. -// If the built-in matrix is double complex, it becomes a GraphBLAS -// Complex or GxB_FC64 matrix. +// If the MATLAB matrix is double complex, it becomes a GraphBLAS Complex or +// GxB_FC64 matrix. // A->x is always a deep copy for other types, since it must be typecasted from -// a built-in matrix to GraphBLAS. +// a MATLAB matrix to GraphBLAS. // Like GB_mx_Matrix_to_mxArray, this could be done using only user-callable // GraphBLAS functions, but the method used here is faster. @@ -53,7 +53,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A ( - const mxArray *A_builtin, // built-in version of A + const mxArray *A_matlab, // MATLAB version of A const char *name, // name of the argument bool deep_copy, // if true, return a deep copy const bool empty // if false, 0-by-0 matrices are returned as NULL. @@ -69,21 +69,21 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A struct GB_Matrix_opaque T_header ; GrB_Matrix T = NULL ; - if (A_builtin == NULL) + if (A_matlab == NULL) { // input is not present; this is not an error if A is an // optional input return (NULL) ; } - if ((mxGetM (A_builtin) == 0) && (mxGetN (A_builtin) == 0)) + if ((mxGetM (A_matlab) == 0) && (mxGetN (A_matlab) == 0)) { // input is "[ ]", zero-by-zero. if (empty) { // treat as a sparse 0-by-0 matrix, not NULL GrB_Matrix_new (&A, GrB_FP64, 0, 0) ; - ASSERT_MATRIX_OK (A, "got A = [ ] from built-in", GB0) ; + ASSERT_MATRIX_OK (A, "got A = [ ] from MATLAB", GB0) ; return (A) ; } else @@ -103,25 +103,25 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A GrB_Type atype_in, atype_out ; GB_Type_code atype_in_code, atype_out_code ; - if (mxIsStruct (A_builtin)) + if (mxIsStruct (A_matlab)) { // look for A.matrix - int fieldnumber = mxGetFieldNumber (A_builtin, "matrix") ; + int fieldnumber = mxGetFieldNumber (A_matlab, "matrix") ; if (fieldnumber >= 0) { - Amatrix = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + Amatrix = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; } else { // A.matrix not present, try A.vector - fieldnumber = mxGetFieldNumber (A_builtin, "vector") ; + fieldnumber = mxGetFieldNumber (A_matlab, "vector") ; if (fieldnumber < 0) { FREE_ALL ; mexWarnMsgIdAndTxt ("GB:warn", "invalid matrix/vector struct") ; return (NULL) ; } - Amatrix = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + Amatrix = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; if (mxGetN (Amatrix) != 1) { FREE_ALL ; @@ -135,19 +135,19 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A atype_in = GB_mx_Type (Amatrix) ; atype_out = atype_in ; - fieldnumber = mxGetFieldNumber (A_builtin, "class") ; + fieldnumber = mxGetFieldNumber (A_matlab, "class") ; if (fieldnumber >= 0) { - mxArray *s = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + mxArray *s = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; atype_out = GB_mx_string_to_Type (s, atype_in) ; if (atype_out == NULL) mexErrMsgTxt ("unknown class") ; } // get the iso property (false if not present) - fieldnumber = mxGetFieldNumber (A_builtin, "iso") ; + fieldnumber = mxGetFieldNumber (A_matlab, "iso") ; if (fieldnumber >= 0) { - mxArray *s = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + mxArray *s = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; if (mxIsLogicalScalar (s)) { A_iso = mxIsLogicalScalarTrue (s) ; @@ -159,10 +159,10 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A } // get the no_hyper_hash property (false if not present) - fieldnumber = mxGetFieldNumber (A_builtin, "no_hyper_hash") ; + fieldnumber = mxGetFieldNumber (A_matlab, "no_hyper_hash") ; if (fieldnumber >= 0) { - mxArray *s = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + mxArray *s = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; if (mxIsLogicalScalar (s)) { A_no_hyper_hash = mxIsLogicalScalarTrue (s) ; @@ -177,7 +177,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A else { // just a matrix - Amatrix = A_builtin ; + Amatrix = A_matlab ; atype_in = GB_mx_Type (Amatrix) ; atype_out = atype_in ; } @@ -192,16 +192,17 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A atype_out_code = atype_out->code ; //-------------------------------------------------------------------------- - // get the size and content of the built-in matrix + // get the size and content of the MATLAB matrix //-------------------------------------------------------------------------- int64_t nrows = mxGetM (Amatrix) ; int64_t ncols = mxGetN (Amatrix) ; - int64_t *Mp, *Mi, anz, anzmax ; + uint64_t *Mp ; + int64_t *Mi, anz, anzmax ; if (A_is_sparse) { - Mp = (int64_t *) mxGetJc (Amatrix) ; + Mp = (uint64_t *) mxGetJc (Amatrix) ; Mi = (int64_t *) mxGetIr (Amatrix) ; anz = Mp [ncols] ; anzmax = mxGetNzmax (Amatrix) ; @@ -225,13 +226,13 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A // look for A.values //-------------------------------------------------------------------------- - if (mxIsStruct (A_builtin)) + if (mxIsStruct (A_matlab)) { // this is used for int64 and uint64 only - int fieldnumber = mxGetFieldNumber (A_builtin, "values") ; + int fieldnumber = mxGetFieldNumber (A_matlab, "values") ; if (fieldnumber >= 0) { - mxArray *values = mxGetFieldByNumber (A_builtin, 0, fieldnumber) ; + mxArray *values = mxGetFieldByNumber (A_matlab, 0, fieldnumber) ; if (mxIsComplex (values)) { mexErrMsgTxt ("A.values must be real") ; @@ -258,10 +259,53 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A GrB_Info info ; - // built-in matrices are sparse or full CSC, not hypersparse or bitmap + // MATLAB matrices are sparse or full CSC, not hypersparse or bitmap bool is_csc = true ; int sparsity = (A_is_sparse) ? GxB_SPARSE : GxB_FULL ; + //-------------------------------------------------------------------------- + // get the integer sizes + //-------------------------------------------------------------------------- + + // MATLAB matrices are all-64-bit + bool p_is_32 = false ; + bool j_is_32 = false ; + bool i_is_32 = false ; + + if (mxIsStruct (A_matlab)) + { + + // look for A.p_is_32 + int fieldnumber = mxGetFieldNumber (A_matlab, "p_is_32") ; + if (fieldnumber >= 0) + { + p_is_32 = mxGetScalar (mxGetFieldByNumber (A_matlab, + 0, fieldnumber)) ; + } + + // look for A.j_is_32 + fieldnumber = mxGetFieldNumber (A_matlab, "j_is_32") ; + if (fieldnumber >= 0) + { + j_is_32 = mxGetScalar (mxGetFieldByNumber (A_matlab, + 0, fieldnumber)) ; + } + + // look for A.i_is_32 + fieldnumber = mxGetFieldNumber (A_matlab, "i_is_32") ; + if (fieldnumber >= 0) + { + i_is_32 = mxGetScalar (mxGetFieldByNumber (A_matlab, + 0, fieldnumber)) ; + } + } + + // can only do a shallow copy if the resulting GrB_Matrix is all-64 + deep_copy = deep_copy || p_is_32 || j_is_32 || i_is_32 ; + + GB_Type_code apcode = (p_is_32) ? GB_UINT32_code : GB_UINT64_code ; + GB_Type_code aicode = (i_is_32) ? GB_UINT32_code : GB_UINT64_code ; + //-------------------------------------------------------------------------- // get the pattern of A //-------------------------------------------------------------------------- @@ -271,8 +315,9 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A // create the GraphBLAS matrix info = GB_new (&A, // sparse or full, new header - atype_out, (GrB_Index) nrows, (GrB_Index) ncols, - GB_Ap_calloc, is_csc, sparsity, GxB_HYPER_DEFAULT, 0) ; + atype_out, (uint64_t) nrows, (uint64_t) ncols, + GB_ph_calloc, is_csc, sparsity, GxB_HYPER_DEFAULT, 0, + p_is_32, j_is_32, i_is_32) ; if (info != GrB_SUCCESS) { FREE_ALL ; @@ -291,23 +336,25 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A if (sparsity != GxB_FULL) { - memcpy (A->p, Mp, (ncols+1) * sizeof (int64_t)) ; - memcpy (A->i, Mi, anz * sizeof (int64_t)) ; - A->nvals = A->p [ncols] ; +// memcpy (A->p, Mp, (ncols+1) * sizeof (int64_t)) ; + GB_cast_int (A->p, apcode, Mp, GB_UINT64_code, ncols+1, 1) ; +// memcpy (A->i, Mi, anz * sizeof (int64_t)) ; + GB_cast_int (A->i, aicode, Mi, GB_UINT64_code, anz, 1) ; } - A->magic = GB_MAGIC ; } else { // the GraphBLAS pattern (A->p and A->i) are pointers into the - // built-in matrix and must not be modified. + // MATLAB sparse mxArray, and must not be modified. - // [ create the GraphBLAS matrix, do not allocate A->p + // create the GraphBLAS matrix, do not allocate A->p info = GB_new (&A, // sparse or full, new header - atype_out, (GrB_Index) nrows, (GrB_Index) ncols, - GB_Ap_null, is_csc, sparsity, GxB_HYPER_DEFAULT, 0) ; + atype_out, (uint64_t) nrows, (uint64_t) ncols, + GB_ph_null, is_csc, sparsity, GxB_HYPER_DEFAULT, 0, + /* must be false (MATLAB matrices are 64/64 bit): */ + false, false, false) ; if (info != GrB_SUCCESS) { FREE_ALL ; @@ -323,7 +370,6 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A A->i_size = GB_IMAX (anz, 1) * sizeof (int64_t) ; A->p_shallow = true ; A->i_shallow = true ; - A->nvals = A->p [ncols] ; } else { @@ -336,11 +382,13 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A } A->h_shallow = false ; // A->h is NULL - A->magic = GB_MAGIC ; // A->p now initialized ] } + A->nvals = anz ; + A->magic = GB_MAGIC ; + //-------------------------------------------------------------------------- - // copy the numerical values from built-in to the GraphBLAS matrix + // copy the numerical values from MATLAB to the GraphBLAS matrix //-------------------------------------------------------------------------- if (sparsity == GxB_FULL) @@ -358,7 +406,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A if (A->x_shallow) { - // the built-in matrix and GraphBLAS matrix have the same type; + // the MATLAB matrix and GraphBLAS matrix have the same type; // (logical, double, or double complex), and a deep copy is not // requested. Just make a shallow copy. A->x = MatlabX ; @@ -404,7 +452,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A GrB_Type ttype = (atype_in_code == GB_UDT_code) ? GxB_FC64 : atype_in ; void *Tx = MatlabX ; - GrB_Index nrows = anz, ncols = 1, Tx_size = anz * asize ; + uint64_t nrows = anz, ncols = 1, Tx_size = anz * asize ; GxB_Matrix_import_FullC (&T, ttype, nrows, ncols, &Tx, Tx_size, false, NULL) ; GB_cast_array (A->x, code1, T, 1) ; @@ -444,7 +492,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A // A->x for the iso value, so set it to zero A->iso = false ; } - GB_convert_any_to_iso (A, NULL) ; + GB_convert_any_to_iso (A, NULL) ; // OK } else { @@ -452,9 +500,11 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A // only if A->x is large enough to hold at least 1 entry. A->iso = (A->x_size >= atype_out->size) ; } + + ASSERT_MATRIX_OK (A, "got iso A from MATLAB", GB0) ; } - ASSERT_MATRIX_OK (A, "got natural A from built-in", GB0) ; + ASSERT_MATRIX_OK (A, "got natural A from MATLAB", GB0) ; ASSERT (A->h == NULL) ; //-------------------------------------------------------------------------- @@ -476,41 +526,42 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A int sparsity_control = GxB_AUTO_SPARSITY ; double hyper_switch = GxB_HYPER_DEFAULT ; - if (mxIsStruct (A_builtin)) + if (mxIsStruct (A_matlab)) { // look for A.is_csc - int fieldnumber = mxGetFieldNumber (A_builtin, "is_csc") ; + int fieldnumber = mxGetFieldNumber (A_matlab, "is_csc") ; if (fieldnumber >= 0) { - is_csc = mxGetScalar (mxGetFieldByNumber (A_builtin, + is_csc = mxGetScalar (mxGetFieldByNumber (A_matlab, 0, fieldnumber)) ; } // look for A.is_hyper (ignored if hyper_switch present // or if A is full) - fieldnumber = mxGetFieldNumber (A_builtin, "is_hyper") ; + fieldnumber = mxGetFieldNumber (A_matlab, "is_hyper") ; if (fieldnumber >= 0) { - A_is_hyper = mxGetScalar (mxGetFieldByNumber (A_builtin, + A_is_hyper = mxGetScalar (mxGetFieldByNumber (A_matlab, 0, fieldnumber)) ; } // look for A.hyper_switch (ignored if A is full) - fieldnumber = mxGetFieldNumber (A_builtin, "hyper_switch") ; + fieldnumber = mxGetFieldNumber (A_matlab, "hyper_switch") ; if (fieldnumber >= 0) { has_hyper_switch = true ; - hyper_switch = mxGetScalar (mxGetFieldByNumber (A_builtin, + hyper_switch = mxGetScalar (mxGetFieldByNumber (A_matlab, 0, fieldnumber)) ; } // look for A.sparsity - fieldnumber = mxGetFieldNumber (A_builtin, "sparsity") ; + fieldnumber = mxGetFieldNumber (A_matlab, "sparsity") ; if (fieldnumber >= 0) { has_sparsity_control = true ; - sparsity_control = mxGetScalar (mxGetFieldByNumber (A_builtin, + sparsity_control = mxGetScalar (mxGetFieldByNumber (A_matlab, 0, fieldnumber)) ; +// printf ("sparsity control is %d\n", sparsity_control) ; } } @@ -521,9 +572,19 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A int64_t nrows_old = GB_NROWS (A) ; int64_t ncols_old = GB_NCOLS (A) ; + #define ENSURE_DEEP \ + if (GB_is_shallow (A)) \ + { \ + GrB_Matrix_dup (&T, A) ; \ + GrB_Matrix_free (&A) ; \ + A = T ; \ + T = NULL ; \ + } + if (!is_csc) { // this might convert A to hypersparse + ENSURE_DEEP ; GxB_Matrix_Option_set_(A, GxB_FORMAT, GxB_BY_ROW) ; // so convert it back; hypersparsity is defined below if (sparsity != GxB_FULL) @@ -536,7 +597,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A ASSERT (!A->is_csc) ; } - ASSERT_MATRIX_OK (A, "conformed from built-in", GB0) ; + ASSERT_MATRIX_OK (A, "conformed from MATLAB", GB0) ; ASSERT (A->h == NULL) ; ASSERT (A->is_csc == is_csc) ; @@ -553,11 +614,13 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A { // this sets the hyper_switch and then conforms the matrix to its // desired hypersparsity. It may stay non-hypersparse. + ENSURE_DEEP ; GxB_Matrix_Option_set_(A, GxB_HYPER_SWITCH, hyper_switch) ; } else if (A_is_hyper) { // this forces the matrix to be always hypersparse + ENSURE_DEEP ; ASSERT_MATRIX_OK (A, "to always hyper", GB0) ; GxB_Matrix_Option_set_(A, GxB_SPARSITY_CONTROL, GxB_HYPERSPARSE) ; ASSERT_MATRIX_OK (A, "always hyper", GB0) ; @@ -570,6 +633,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A if (has_sparsity_control) { ASSERT_MATRIX_OK (A, "setting sparsity", GB0) ; + ENSURE_DEEP ; GxB_Matrix_Option_set_(A, GxB_SPARSITY_CONTROL, sparsity_control) ; ASSERT_MATRIX_OK (A, "set sparsity", GB0) ; } @@ -590,7 +654,7 @@ GrB_Matrix GB_mx_mxArray_to_Matrix // returns GraphBLAS version of A return (NULL) ; } - ASSERT_MATRIX_OK (A, "got A from built-in", GB0) ; + ASSERT_MATRIX_OK (A, "got A from MATLAB", GB0) ; return (A) ; } diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_SelectOp.c b/GraphBLAS/Test/GB_mx_mxArray_to_SelectOp.c index 3e40347cc5..20b19e852b 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_SelectOp.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_SelectOp.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_SelectOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_Semiring.c b/GraphBLAS/Test/GB_mx_mxArray_to_Semiring.c index c1e375a036..4281dfccb1 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_Semiring.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_Semiring.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_Semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_UnaryOp.c b/GraphBLAS/Test/GB_mx_mxArray_to_UnaryOp.c index c998ff5347..1e49b9334e 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_UnaryOp.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_UnaryOp.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_UnaryOp //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_Vector.c b/GraphBLAS/Test/GB_mx_mxArray_to_Vector.c index 1d720ae5e4..b03d087305 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_Vector.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_Vector.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_Vector //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_array.c b/GraphBLAS/Test/GB_mx_mxArray_to_array.c index efb32c21e7..8c90d7c672 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_array.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_array.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_array: get a dense numerical built-in array //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_indices.c b/GraphBLAS/Test/GB_mx_mxArray_to_indices.c index 01b0b8ab50..ddf3cf735d 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_indices.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_indices.c @@ -1,115 +1,157 @@ //------------------------------------------------------------------------------ -// GB_mx_mxArray_to_indices +// GB_mx_mxArray_to_indices: get a list of indices //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Get a list of indices from a built-in array +// Get a list of indices from a MATLAB array or struct with I.begin, or +// a MATLAB struct holding a GraphBLAS GrB_Vector. #include "GB_mex.h" bool GB_mx_mxArray_to_indices // true if successful, false otherwise ( - GrB_Index **handle, // index array returned + // input: const mxArray *I_builtin, // built-in mxArray to get - GrB_Index *ni, // length of I, or special - GrB_Index Icolon [3], // for all but GB_LIST - bool *I_is_list // true if GB_LIST + // output: + uint64_t **I_handle, // index array + uint64_t *ni, // length of I, or special + uint64_t Icolon [3], // for all but GB_LIST + bool *I_is_list, // true if GB_LIST + GrB_Vector *I_vector // non-NULL if found ) { - (*handle) = NULL ; + (*I_handle) = NULL ; + if (I_vector != NULL) + { + (*I_vector) = NULL ; + } mxArray *X ; - GrB_Index *I ; + uint64_t *I ; if (I_builtin == NULL || mxIsEmpty (I_builtin)) { - I = (GrB_Index *) GrB_ALL ; // like the ":" in C=A(:,j) + + //---------------------------------------------------------------------- + // I is NULL or empty; treat as ":" + //---------------------------------------------------------------------- + + I = (uint64_t *) GrB_ALL ; // like the ":" in C=A(:,j) (*ni) = 0 ; - (*handle) = I ; + (*I_handle) = I ; (*I_is_list) = false ; // Icolon not used + } - else + else if (mxIsStruct (I_builtin) && + mxGetFieldNumber (I_builtin, "begin") >= 0) { - if (mxIsStruct (I_builtin)) + + //---------------------------------------------------------------------- + // I is a struct with I.begin + //---------------------------------------------------------------------- + + // a struct with 3 integers: I.begin, I.inc, I.end + (*I_is_list) = false ; + + // look for I.begin (required) + int fieldnumber = mxGetFieldNumber (I_builtin, "begin") ; + if (fieldnumber < 0) + { + mexWarnMsgIdAndTxt ("GB:warn","I.begin missing") ; + return (false) ; + } + X = mxGetFieldByNumber (I_builtin, 0, fieldnumber) ; + Icolon [GxB_BEGIN] = (int64_t) mxGetScalar (X) ; + + // look for I.end (required) + fieldnumber = mxGetFieldNumber (I_builtin, "end") ; + if (fieldnumber < 0) { - // a struct with 3 integers: I.begin, I.inc, I.end - (*I_is_list) = false ; + mexWarnMsgIdAndTxt ("GB:warn","I.end missing") ; + return (false) ; + } + mxArray *X ; + X = mxGetFieldByNumber (I_builtin, 0, fieldnumber) ; + Icolon [GxB_END] = (int64_t) mxGetScalar (X) ; - // look for I.begin (required) - int fieldnumber = mxGetFieldNumber (I_builtin, "begin") ; - if (fieldnumber < 0) - { - mexWarnMsgIdAndTxt ("GB:warn","I.begin missing") ; - return (false) ; - } + // look for I.inc (optional) + fieldnumber = mxGetFieldNumber (I_builtin, "inc") ; + if (fieldnumber < 0) + { + (*ni) = GxB_RANGE ; + Icolon [GxB_INC] = 1 ; + } + else + { X = mxGetFieldByNumber (I_builtin, 0, fieldnumber) ; - Icolon [GxB_BEGIN] = (int64_t) mxGetScalar (X) ; - - // look for I.end (required) - fieldnumber = mxGetFieldNumber (I_builtin, "end") ; - if (fieldnumber < 0) + int64_t iinc = (int64_t) mxGetScalar (X) ; + if (iinc == 0) { - mexWarnMsgIdAndTxt ("GB:warn","I.end missing") ; - return (false) ; + // this can be either a stride, or backwards. Either + // one works the same, but try a mixture, just for testing. + (*ni) = (Icolon [GxB_BEGIN] % 2) ? + GxB_STRIDE : GxB_BACKWARDS ; + Icolon [GxB_INC] = 0 ; } - mxArray *X ; - X = mxGetFieldByNumber (I_builtin, 0, fieldnumber) ; - Icolon [GxB_END] = (int64_t) mxGetScalar (X) ; - - // look for I.inc (optional) - fieldnumber = mxGetFieldNumber (I_builtin, "inc") ; - if (fieldnumber < 0) + else if (iinc > 0) { - (*ni) = GxB_RANGE ; - Icolon [GxB_INC] = 1 ; + (*ni) = GxB_STRIDE ; + Icolon [GxB_INC] = iinc ; } else { - // - X = mxGetFieldByNumber (I_builtin, 0, fieldnumber) ; - int64_t iinc = (int64_t) mxGetScalar (X) ; - if (iinc == 0) - { - // this can be either a stride, or backwards. Either - // one works the same, but try a mixture, just for testing. - (*ni) = (Icolon [GxB_BEGIN] % 2) ? - GxB_STRIDE : GxB_BACKWARDS ; - Icolon [GxB_INC] = 0 ; - } - else if (iinc > 0) - { - (*ni) = GxB_STRIDE ; - Icolon [GxB_INC] = iinc ; - } - else - { - // GraphBLAS must be given the magnitude of the stride - (*ni) = GxB_BACKWARDS ; - Icolon [GxB_INC] = -iinc ; - } + // GraphBLAS must be given the magnitude of the stride + (*ni) = GxB_BACKWARDS ; + Icolon [GxB_INC] = -iinc ; } - (*handle) = Icolon ; - } - else - { - if (!mxIsClass (I_builtin, "uint64")) - { - mexWarnMsgIdAndTxt ("GB:warn","indices must be uint64") ; - return (false) ; - } + (*I_handle) = Icolon ; + + } + else if (mxIsClass (I_builtin, "uint64") && I_vector == NULL) + { + + //---------------------------------------------------------------------- + // I is a built-in array of type uint64 + //---------------------------------------------------------------------- + + (*I_is_list) = true ; + I = mxGetData (I_builtin) ; + (*ni) = (uint64_t) mxGetNumberOfElements (I_builtin) ; + (*I_handle) = I ; - (*I_is_list) = true ; - I = mxGetData (I_builtin) ; - (*ni) = (uint64_t) mxGetNumberOfElements (I_builtin) ; - (*handle) = I ; + } + else if (I_vector != NULL) + { + + //---------------------------------------------------------------------- + // I could be a GrB_Vector held as a struct or MATLAB matrix + //---------------------------------------------------------------------- + + (*I_vector) = GB_mx_mxArray_to_Vector (I_builtin, "I_vector", + true, true) ; + if ((*I_vector) == NULL) + { + mexWarnMsgIdAndTxt ("GB:warn", "indices invalid") ; + return (false) ; } + + } + else + { + + //---------------------------------------------------------------------- + // I not recognized + //---------------------------------------------------------------------- + + mexWarnMsgIdAndTxt ("GB:warn", "indices invalid") ; + return (false) ; } return (true) ; diff --git a/GraphBLAS/Test/GB_mx_mxArray_to_string.c b/GraphBLAS/Test/GB_mx_mxArray_to_string.c index fc064eded1..efa11ef1f7 100644 --- a/GraphBLAS/Test/GB_mx_mxArray_to_string.c +++ b/GraphBLAS/Test/GB_mx_mxArray_to_string.c @@ -2,7 +2,7 @@ // GB_mx_mxArray_to_string.c: get a built-in string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_object_to_mxArray.c b/GraphBLAS/Test/GB_mx_object_to_mxArray.c index fa49b1459c..dfc6461aed 100644 --- a/GraphBLAS/Test/GB_mx_object_to_mxArray.c +++ b/GraphBLAS/Test/GB_mx_object_to_mxArray.c @@ -1,21 +1,21 @@ //------------------------------------------------------------------------------ -// GB_mx_object_to_mxArray +// GB_mx_object_to_mxArray: convert a GrB_Matrix to MATLAB struct //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ -// Convert a GraphBLAS sparse or full matrix to a built-in struct C containing +// Convert a GraphBLAS GrB_Matrix to a MATLAB struct C containing // C.matrix and a string C.class. The GraphBLAS matrix is destroyed. // This could be done using only user-callable GraphBLAS functions, by -// extracting the tuples and converting them into a built-in sparse matrix. But +// extracting the tuples and converting them into a MATLAB sparse matrix. But // that would be much slower and take more memory. Instead, most of the work // can be done by pointers, and directly accessing the internal contents of C. // If C has type GB_BOOL_code or GB_FP64_code, then C can be converted to a -// built-in matrix in constant time with essentially no extra memory allocated. +// MATLAB matrix in constant time with essentially no extra memory allocated. // This is faster, but it means that this Test interface will only work with // this specific implementation of GraphBLAS. @@ -30,13 +30,22 @@ #define GB_AS_IF_FREE(p) \ { \ + GBMDUMP ("test, as-if-free removing %p\n", (void *) p) ; \ GB_Global_memtable_remove (p) ; \ (p) = NULL ; \ } -static const char *MatrixFields [ ] = { "matrix", "class", "iso", "values" } ; - -mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray +static const char *MatrixFields [ ] = { + "matrix", // 0 + "class", // 1 + "iso", // 2 + "is_csc", // 3 + "p_is_32", // 4 + "j_is_32", // 5 + "i_is_32", // 6 + "values" } ; // 7 + +mxArray *GB_mx_object_to_mxArray // returns the MATLAB mxArray ( GrB_Matrix *handle, // handle of GraphBLAS matrix to convert const char *name, @@ -44,10 +53,27 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray ) { + //-------------------------------------------------------------------------- // get the inputs + //-------------------------------------------------------------------------- + mxArray *A, *Astruct, *X = NULL ; GrB_Matrix C = *handle ; GrB_Type ctype = C->type ; + ASSERT_MATRIX_OK (C, "C for conversion to MATLAB matrix or struct", GB0) ; + + //-------------------------------------------------------------------------- + // save the integer status of the matrix + //-------------------------------------------------------------------------- + + bool is_csc = C->is_csc ; + bool Cp_is_32 = C->p_is_32 ; + bool Cj_is_32 = C->j_is_32 ; + bool Ci_is_32 = C->i_is_32 ; + + //-------------------------------------------------------------------------- + // check matrix + //-------------------------------------------------------------------------- // may have pending tuples ASSERT_MATRIX_OK (C, name, GB0) ; @@ -59,7 +85,10 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray ASSERT (!C->i_shallow) ; ASSERT (!C->x_shallow) ; + //-------------------------------------------------------------------------- // make sure there are no pending computations + //-------------------------------------------------------------------------- + if (GB_IS_FULL (C) || GB_IS_BITMAP (C)) { ASSERT (!GB_JUMBLED (C)) ; @@ -116,7 +145,14 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray ASSERT_MATRIX_OK (C, "TO mxArray, non-iso non-hyper CSC", GB0) ; } - // empty built-in matrices don't want NULL pointers + // convert to all-64-bit + GB_convert_int (C, false, false, false, false) ; // OK: for MATLAB mxArray + ASSERT_MATRIX_OK (C, "C converted to all-64", GB0) ; + ASSERT (!C->p_is_32) ; + ASSERT (!C->j_is_32) ; + ASSERT (!C->i_is_32) ; + + // empty MATLAB matrices don't want NULL pointers if (C->x == NULL) { ASSERT (cnz == 0) ; @@ -129,27 +165,28 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray bool C_is_full = (sparsity == GxB_FULL) ; if (!C_is_full) { - // empty built-in sparse matrices don't want NULL pointers + // empty MATLAB sparse matrices don't want NULL pointers if (C->i == NULL) { ASSERT (cnz == 0) ; - C->i = (int64_t *) GB_malloc_memory (1, sizeof (int64_t), + C->i = (int64_t *) GB_malloc_memory (1, sizeof (uint64_t), &(C->i_size)) ; - C->i [0] = 0 ; + uint64_t *Ci = C->i ; + Ci [0] = 0 ; C->i_shallow = false ; } if (C->p == NULL) { ASSERT (cnz == 0) ; - C->p = (int64_t *) GB_malloc_memory (C->vdim + 1, - sizeof (int64_t), &(C->p_size)) ; + C->p = (int64_t *) GB_malloc_memory (C->vdim + 1, sizeof (uint64_t), + &(C->p_size)) ; memset (C->p, 0, (C->vdim + 1) * sizeof (int64_t)) ; C->p_shallow = false ; } } //-------------------------------------------------------------------------- - // create the built-in matrix A and link in the numerical values of C + // create the MATLAB matrix A and link in the numerical values of C //-------------------------------------------------------------------------- if (C_is_full) @@ -231,31 +268,31 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray mexMakeMemoryPersistent (C->x) ; C->x_shallow = false ; - GB_AS_IF_FREE (C->x) ; // unlink C->x from C; now in built-in C + GB_AS_IF_FREE (C->x) ; // unlink C->x from C; now in MATLAB C } else if (C->type == GrB_BOOL) { - // C is boolean, which is the same as a built-in logical sparse matrix + // C is boolean, which is the same as a MATLAB logical sparse matrix A = mxCreateSparseLogicalMatrix (0, 0, 0) ; mexMakeMemoryPersistent (C->x) ; mxSetData (A, (bool *) C->x) ; C->x_shallow = false ; // C->x is treated as if it was freed - GB_AS_IF_FREE (C->x) ; // unlink C->x from C; now in built-in C + GB_AS_IF_FREE (C->x) ; // unlink C->x from C; now in MATLAB C } else if (C->type == GrB_FP64) { - // C is double, which is the same as a built-in double sparse matrix + // C is double, which is the same as a MATLAB double sparse matrix A = mxCreateSparse (0, 0, 0, mxREAL) ; mexMakeMemoryPersistent (C->x) ; mxSetData (A, C->x) ; C->x_shallow = false ; // C->x is treated as if it was freed - GB_AS_IF_FREE (C->x) ; // unlink C->x from C; in built-in C + GB_AS_IF_FREE (C->x) ; // unlink C->x from C; in MATLAB C } else if (C->type == Complex || C->type == GxB_FC64) @@ -279,7 +316,7 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray else { - // otherwise C is cast into a built-in double sparse matrix + // otherwise C is cast into a MATLAB double sparse matrix A = mxCreateSparse (0, 0, 0, mxREAL) ; size_t Sx_size ; double *Sx = (double *) GB_malloc_memory (cnz+1, sizeof (double), @@ -314,6 +351,9 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray if (!C_is_full) { + ASSERT (!C->p_is_32) ; + ASSERT (!C->j_is_32) ; + ASSERT (!C->i_is_32) ; mxFree (mxGetJc (A)) ; mxFree (mxGetIr (A)) ; mexMakeMemoryPersistent (C->p) ; @@ -329,25 +369,43 @@ mxArray *GB_mx_object_to_mxArray // returns the built-in mxArray GB_AS_IF_FREE (C->i) ; } + //-------------------------------------------------------------------------- + // free C + //-------------------------------------------------------------------------- + // free C, but leave any shallow components untouched - // since these have been transplanted into the built-in matrix. + // since these have been transplanted into the MATLAB matrix. GrB_Matrix_free_(handle) ; + //-------------------------------------------------------------------------- + // return result as a MATLAB struct or a MATLAB matrix + //-------------------------------------------------------------------------- + if (create_struct) { // create the type mxArray *atype = GB_mx_Type_to_mxstring (ctype) ; // create the iso flag mxArray *c_iso = mxCreateLogicalScalar (C_iso) ; + // create the csc flag + mxArray *c_csc = mxCreateLogicalScalar (is_csc) ; + // create the *is_32 flags + mxArray *p_32 = mxCreateLogicalScalar (Cp_is_32) ; + mxArray *j_32 = mxCreateLogicalScalar (Cj_is_32) ; + mxArray *i_32 = mxCreateLogicalScalar (Ci_is_32) ; // create the output struct Astruct = mxCreateStructMatrix (1, 1, - (X == NULL) ? 3 : 4, MatrixFields) ; - mxSetFieldByNumber (Astruct, 0, 0, A) ; - mxSetFieldByNumber (Astruct, 0, 1, atype) ; - mxSetFieldByNumber (Astruct, 0, 2, c_iso) ; + (X == NULL) ? 7 : 8, MatrixFields) ; + mxSetFieldByNumber (Astruct, 0, 0, A) ; // matrix + mxSetFieldByNumber (Astruct, 0, 1, atype) ; // class + mxSetFieldByNumber (Astruct, 0, 2, c_iso) ; // iso + mxSetFieldByNumber (Astruct, 0, 3, c_csc) ; // is_csc + mxSetFieldByNumber (Astruct, 0, 4, p_32) ; // p_is_32 + mxSetFieldByNumber (Astruct, 0, 5, j_32) ; // j_is_32 + mxSetFieldByNumber (Astruct, 0, 6, i_32) ; // i_is_32 if (X != NULL) { - mxSetFieldByNumber (Astruct, 0, 3, X) ; + mxSetFieldByNumber (Astruct, 0, 7, X) ; // values } return (Astruct) ; } diff --git a/GraphBLAS/Test/GB_mx_put_global.c b/GraphBLAS/Test/GB_mx_put_global.c index e6bcfd37c6..6cf20961a3 100644 --- a/GraphBLAS/Test/GB_mx_put_global.c +++ b/GraphBLAS/Test/GB_mx_put_global.c @@ -2,7 +2,7 @@ // GB_mx_put_global: put the GraphBLAS status in global workspace //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_random_matrix.c b/GraphBLAS/Test/GB_mx_random_matrix.c index 24478dec5a..1ba69117a4 100644 --- a/GraphBLAS/Test/GB_mx_random_matrix.c +++ b/GraphBLAS/Test/GB_mx_random_matrix.c @@ -2,7 +2,7 @@ // GraphBLAS/Test/GB_mx_random_matrix.c: create a random matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -48,7 +48,7 @@ GrB_Info GB_mx_random_matrix // create a random double-precision matrix GrB_Matrix Areal = NULL, Aimag = NULL, A = NULL ; *A_output = NULL ; - GrB_Index *I = NULL, *J = NULL ; + uint64_t *I = NULL, *J = NULL ; // OK double *X = NULL ; GrB_Info info ; @@ -119,8 +119,8 @@ GrB_Info GB_mx_random_matrix // create a random double-precision matrix for (int64_t k = 0 ; k < nedges ; k++) { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; + uint64_t i = simple_rand_i ( ) % nrows ; + uint64_t j = simple_rand_i ( ) % ncols ; if (no_self_edges && (i == j)) continue ; double x = simple_rand_x ( ) ; // A (i,j) = x @@ -144,8 +144,8 @@ GrB_Info GB_mx_random_matrix // create a random double-precision matrix // by the mode (blocking or non-blocking). int64_t s = ((make_symmetric) ? 2 : 1) * nedges + 1 ; - I = (GrB_Index *) mxMalloc (s * sizeof (GrB_Index)) ; - J = (GrB_Index *) mxMalloc (s * sizeof (GrB_Index)) ; + I = (uint64_t *) mxMalloc (s * sizeof (uint64_t)) ; // OK + J = (uint64_t *) mxMalloc (s * sizeof (uint64_t)) ; // OK X = (double *) mxMalloc (s * sizeof (double )) ; if (I == NULL || J == NULL || X == NULL) { // out of memory @@ -160,8 +160,8 @@ GrB_Info GB_mx_random_matrix // create a random double-precision matrix int64_t ntuples = 0 ; for (int64_t k = 0 ; k < nedges ; k++) { - GrB_Index i = simple_rand_i ( ) % nrows ; - GrB_Index j = simple_rand_i ( ) % ncols ; + uint64_t i = simple_rand_i ( ) % nrows ; + uint64_t j = simple_rand_i ( ) % ncols ; if (no_self_edges && (i == j)) continue ; double x = simple_rand_x ( ) ; // A (i,j) = x diff --git a/GraphBLAS/Test/GB_mx_same.c b/GraphBLAS/Test/GB_mx_same.c index 59ba13c82d..b29d9169db 100644 --- a/GraphBLAS/Test/GB_mx_same.c +++ b/GraphBLAS/Test/GB_mx_same.c @@ -2,7 +2,7 @@ // GB_mx_same: check if two arrays are equal //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_semiring.c b/GraphBLAS/Test/GB_mx_semiring.c index 22e1e0be2c..b31b122540 100644 --- a/GraphBLAS/Test/GB_mx_semiring.c +++ b/GraphBLAS/Test/GB_mx_semiring.c @@ -2,7 +2,7 @@ // GB_mx_semiring: get a built-in semiring //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -64,16 +64,6 @@ GrB_Semiring GB_mx_semiring // semiring, or NULL if error if (xcode == GB_BOOL_code) { // z = mult(x,y) where both x and y are Boolean. - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, MINUS, and RMINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE mult_binop_code = GB_boolean_rename (mult_binop_code) ; } diff --git a/GraphBLAS/Test/GB_mx_simple_rand.c b/GraphBLAS/Test/GB_mx_simple_rand.c index 8ea6c04c4e..4ae1f0dda2 100644 --- a/GraphBLAS/Test/GB_mx_simple_rand.c +++ b/GraphBLAS/Test/GB_mx_simple_rand.c @@ -2,7 +2,7 @@ // GraphBLAS/Test/GB_mx_simple_rand.c: a very simple random number generator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_string_to_BinaryOp.c b/GraphBLAS/Test/GB_mx_string_to_BinaryOp.c index 12d521a08a..01c989e75d 100644 --- a/GraphBLAS/Test/GB_mx_string_to_BinaryOp.c +++ b/GraphBLAS/Test/GB_mx_string_to_BinaryOp.c @@ -2,7 +2,7 @@ // GB_mx_string_to_BinaryOp.c: get a GraphBLAS operator from built-in strings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_string_to_IndexUnaryOp.c b/GraphBLAS/Test/GB_mx_string_to_IndexUnaryOp.c index c12b542dcc..330bb39568 100644 --- a/GraphBLAS/Test/GB_mx_string_to_IndexUnaryOp.c +++ b/GraphBLAS/Test/GB_mx_string_to_IndexUnaryOp.c @@ -2,7 +2,7 @@ // GB_mx_string_to_IndexUnaryOp.c: get GraphBLAS operator from built-in strings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_string_to_Type.c b/GraphBLAS/Test/GB_mx_string_to_Type.c index 8ffdb7c527..91ac4019fb 100644 --- a/GraphBLAS/Test/GB_mx_string_to_Type.c +++ b/GraphBLAS/Test/GB_mx_string_to_Type.c @@ -2,7 +2,7 @@ // GB_mx_string_to_Type.c: return the GrB_type from a string //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_string_to_UnaryOp.c b/GraphBLAS/Test/GB_mx_string_to_UnaryOp.c index 42e32c1477..3555a5d8b3 100644 --- a/GraphBLAS/Test/GB_mx_string_to_UnaryOp.c +++ b/GraphBLAS/Test/GB_mx_string_to_UnaryOp.c @@ -2,7 +2,7 @@ // GB_mx_string_to_UnaryOp.c: get a GraphBLAS operator from built-in strings //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_usercomplex.h b/GraphBLAS/Test/GB_mx_usercomplex.h index c6b878196b..d59c47dba7 100644 --- a/GraphBLAS/Test/GB_mx_usercomplex.h +++ b/GraphBLAS/Test/GB_mx_usercomplex.h @@ -2,7 +2,7 @@ // GraphBLAS/Test/GB_mx_usercomplex.h: complex numbers as a user-defined type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_xsame.c b/GraphBLAS/Test/GB_mx_xsame.c index 0a0b695ebb..c29a82d4a4 100644 --- a/GraphBLAS/Test/GB_mx_xsame.c +++ b/GraphBLAS/Test/GB_mx_xsame.c @@ -2,7 +2,7 @@ // GB_mx_xsame: check if two arrays are equal (ignoring zombies) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_mx_xsame32.c b/GraphBLAS/Test/GB_mx_xsame32.c index 3533345395..c6d16da4c9 100644 --- a/GraphBLAS/Test/GB_mx_xsame32.c +++ b/GraphBLAS/Test/GB_mx_xsame32.c @@ -2,7 +2,7 @@ // GB_mx_xsame32: check if two FP32 arrays are equal (ignoring zombies) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -33,8 +33,8 @@ bool GB_mx_xsame32 // true if arrays X and Y are the same (ignoring zombies) // check X [i] and Y [i], but ignore zombies if (I == NULL || I [i] >= 0) { - float xi = GBX (X, i, X_iso) ; - float yi = GBX (Y, i, Y_iso) ; + float xi = X [X_iso ? 0 : i] ; + float yi = Y [Y_iso ? 0 : i] ; int c = fpclassify (xi) ; if (c != fpclassify (yi)) return (false) ; if (c == FP_ZERO) diff --git a/GraphBLAS/Test/GB_mx_xsame64.c b/GraphBLAS/Test/GB_mx_xsame64.c index f73ff5f90b..d09e36f6e4 100644 --- a/GraphBLAS/Test/GB_mx_xsame64.c +++ b/GraphBLAS/Test/GB_mx_xsame64.c @@ -2,7 +2,7 @@ // GB_mx_xsame64: check if two FP64 arrays are equal (ignoring zombies) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,8 +32,8 @@ bool GB_mx_xsame64 // true if arrays X and Y are the same (ignoring zombies) // check X [i] and Y [i], but ignore zombies if (I == NULL || I [i] >= 0) { - double xi = GBX (X, i, X_iso) ; - double yi = GBX (Y, i, Y_iso) ; + double xi = X [X_iso ? 0 : i] ; + double yi = Y [Y_iso ? 0 : i] ; int c = fpclassify (xi) ; if (c != fpclassify (yi)) return (false) ; if (c == FP_ZERO) diff --git a/GraphBLAS/Test/GB_random_mask.m b/GraphBLAS/Test/GB_random_mask.m index 777374ba25..87e7e6ac00 100644 --- a/GraphBLAS/Test/GB_random_mask.m +++ b/GraphBLAS/Test/GB_random_mask.m @@ -5,7 +5,7 @@ % With 3 arguments, Mask is a sparse logical matrix. % With 4, Mask is a struct. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 M = (sprand (m, n, d) ~= 0) ; diff --git a/GraphBLAS/Test/GB_spec_Col_assign.m b/GraphBLAS/Test/GB_spec_Col_assign.m index ed0d77956d..63add1d181 100644 --- a/GraphBLAS/Test/GB_spec_Col_assign.m +++ b/GraphBLAS/Test/GB_spec_Col_assign.m @@ -8,7 +8,7 @@ % % This function does the same thing as GrB_Col_assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Col_extract.m b/GraphBLAS/Test/GB_spec_Col_extract.m index 5a1506909d..1308fcb4f5 100644 --- a/GraphBLAS/Test/GB_spec_Col_extract.m +++ b/GraphBLAS/Test/GB_spec_Col_extract.m @@ -1,7 +1,7 @@ function w = GB_spec_Col_extract (w, mask, accum, A, I, j, descriptor) %GB_SPEC_COL_EXTRACT a mimic of GrB_Col_extract -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargout > 1 || nargin ~= 7) diff --git a/GraphBLAS/Test/GB_spec_Matrix_eWiseAdd.m b/GraphBLAS/Test/GB_spec_Matrix_eWiseAdd.m index ff1c6cda76..67fd412a29 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_eWiseAdd.m +++ b/GraphBLAS/Test/GB_spec_Matrix_eWiseAdd.m @@ -7,7 +7,7 @@ % Computes C = accum(C,T), in GraphBLAS notation, where T =A+B, A'+B, % A+B' or A'+B'. The pattern of T is the union of A and B. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Matrix_eWiseMult.m b/GraphBLAS/Test/GB_spec_Matrix_eWiseMult.m index a13211af05..bc80c7db15 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_eWiseMult.m +++ b/GraphBLAS/Test/GB_spec_Matrix_eWiseMult.m @@ -7,7 +7,7 @@ % Computes C = accum(C,T), in GraphBLAS notation, where T =A.*B, A'.*B, % A.*B' or A'.*B'. The pattern of T is the union of A and B. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Matrix_eWiseUnion.m b/GraphBLAS/Test/GB_spec_Matrix_eWiseUnion.m index dc45528056..aa1087bd72 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_eWiseUnion.m +++ b/GraphBLAS/Test/GB_spec_Matrix_eWiseUnion.m @@ -7,7 +7,7 @@ % Computes C = accum(C,T), in GraphBLAS notation, where T =A+B, A'+B, % A+B' or A'+B'. The pattern of T is the union of A and B. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Matrix_extract.m b/GraphBLAS/Test/GB_spec_Matrix_extract.m index db4c563dc6..e3dcc2d57e 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_extract.m +++ b/GraphBLAS/Test/GB_spec_Matrix_extract.m @@ -6,7 +6,7 @@ % % mimic of C = accum (A (I,J)) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Matrix_extractElement.m b/GraphBLAS/Test/GB_spec_Matrix_extractElement.m index fa2a1fbb5d..df4bc03fa4 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_extractElement.m +++ b/GraphBLAS/Test/GB_spec_Matrix_extractElement.m @@ -1,7 +1,7 @@ function [x no_value] = GB_spec_Matrix_extractElement (A, i, j, xclass) %GB_SPEC_MATRIX_EXTRACTELEMENT a mimic of GrB_Matrix_extractElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A = GB_spec_matrix (A) ; diff --git a/GraphBLAS/Test/GB_spec_Matrix_sort.m b/GraphBLAS/Test/GB_spec_Matrix_sort.m index 1a7751d8c6..829d628f87 100644 --- a/GraphBLAS/Test/GB_spec_Matrix_sort.m +++ b/GraphBLAS/Test/GB_spec_Matrix_sort.m @@ -4,7 +4,7 @@ % Usage: % [C,P] = GB_spec_Matrix_sort (op, A, descriptor) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Row_assign.m b/GraphBLAS/Test/GB_spec_Row_assign.m index 23e56b8965..8aa8a0dd14 100644 --- a/GraphBLAS/Test/GB_spec_Row_assign.m +++ b/GraphBLAS/Test/GB_spec_Row_assign.m @@ -9,7 +9,7 @@ % % This function does the same thing as GrB_Row_assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Vector_eWiseAdd.m b/GraphBLAS/Test/GB_spec_Vector_eWiseAdd.m index 1f7d006f06..c3e96881f0 100644 --- a/GraphBLAS/Test/GB_spec_Vector_eWiseAdd.m +++ b/GraphBLAS/Test/GB_spec_Vector_eWiseAdd.m @@ -7,7 +7,7 @@ % Computes w = accum(w,t), in GraphBLAS notation, where t =u+v, % The pattern of t is the union of u and v. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Vector_eWiseMult.m b/GraphBLAS/Test/GB_spec_Vector_eWiseMult.m index 35f225c7c4..2d241c8015 100644 --- a/GraphBLAS/Test/GB_spec_Vector_eWiseMult.m +++ b/GraphBLAS/Test/GB_spec_Vector_eWiseMult.m @@ -7,7 +7,7 @@ % Computes w = accum(w,t), in GraphBLAS notation, where t =u.*v, % The pattern of t is the union of u and v. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Vector_eWiseUnion.m b/GraphBLAS/Test/GB_spec_Vector_eWiseUnion.m index 9c05012bce..edf3737cb2 100644 --- a/GraphBLAS/Test/GB_spec_Vector_eWiseUnion.m +++ b/GraphBLAS/Test/GB_spec_Vector_eWiseUnion.m @@ -7,7 +7,7 @@ % Computes w = accum(w,t), in GraphBLAS notation, where t =u+v, % The pattern of t is the union of u and v. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_Vector_extract.m b/GraphBLAS/Test/GB_spec_Vector_extract.m index d2354c6aa7..1cb2fcfdb0 100644 --- a/GraphBLAS/Test/GB_spec_Vector_extract.m +++ b/GraphBLAS/Test/GB_spec_Vector_extract.m @@ -1,7 +1,7 @@ function w = GB_spec_Vector_extract (w, mask, accum, u, I, descriptor) %GB_SPEC_VECTOR_EXTRACT a mimic of GrB_Vector_extract -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargout > 1 || nargin ~= 6) diff --git a/GraphBLAS/Test/GB_spec_Vector_extractElement.m b/GraphBLAS/Test/GB_spec_Vector_extractElement.m index 39a724a536..c6d9a2507d 100644 --- a/GraphBLAS/Test/GB_spec_Vector_extractElement.m +++ b/GraphBLAS/Test/GB_spec_Vector_extractElement.m @@ -1,7 +1,7 @@ function [x no_value] = GB_spec_Vector_extractElement (A, i, xclass) %GB_SPEC_VECTOR_EXTRACTELEMENT a mimic of GrB_Matrix_extractElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (size (A,2) ~= 1) diff --git a/GraphBLAS/Test/GB_spec_Vector_sort.m b/GraphBLAS/Test/GB_spec_Vector_sort.m index 16eccf804c..77364553d4 100644 --- a/GraphBLAS/Test/GB_spec_Vector_sort.m +++ b/GraphBLAS/Test/GB_spec_Vector_sort.m @@ -4,7 +4,7 @@ % Usage: % [C,P] = GB_spec_Vector_sort (op, A, descriptor) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_accum.m b/GraphBLAS/Test/GB_spec_accum.m index 08577608c1..e5490d9a91 100644 --- a/GraphBLAS/Test/GB_spec_accum.m +++ b/GraphBLAS/Test/GB_spec_accum.m @@ -5,7 +5,7 @@ % % Apply accum binary operator to the input C and the intermediate result T. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the operator; of is type(C) if type is not present in the accum op diff --git a/GraphBLAS/Test/GB_spec_accum_mask.m b/GraphBLAS/Test/GB_spec_accum_mask.m index a7ffbe39a6..184f15c86f 100644 --- a/GraphBLAS/Test/GB_spec_accum_mask.m +++ b/GraphBLAS/Test/GB_spec_accum_mask.m @@ -4,7 +4,7 @@ % % C = accum (C,T): apply the accum, then mask, and return the result -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [Z simple] = GB_spec_accum (accum, C, T, identity) ; diff --git a/GraphBLAS/Test/GB_spec_apply.m b/GraphBLAS/Test/GB_spec_apply.m index 049c0d2344..e8c03ab582 100644 --- a/GraphBLAS/Test/GB_spec_apply.m +++ b/GraphBLAS/Test/GB_spec_apply.m @@ -5,7 +5,7 @@ % C = GB_spec_apply (C, Mask, accum, op, A, descriptor) % C = GB_spec_apply (C, Mask, accum, op, A, descriptor, thunk) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_assign.m b/GraphBLAS/Test/GB_spec_assign.m index 72fd70a44d..2f67bbf2cd 100644 --- a/GraphBLAS/Test/GB_spec_assign.m +++ b/GraphBLAS/Test/GB_spec_assign.m @@ -16,7 +16,7 @@ % not affect any part of C outside that row or column. Those two functions % have their own GB_spec_Row_assign.m and GB_spec_Col_assign.m functions. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_binop_positional.m b/GraphBLAS/Test/GB_spec_binop_positional.m index ef43e2fdfc..bc40369371 100644 --- a/GraphBLAS/Test/GB_spec_binop_positional.m +++ b/GraphBLAS/Test/GB_spec_binop_positional.m @@ -1,7 +1,7 @@ function z = GB_spec_binop_positional (op, ia, ja, ib, jb) %GB_SPEC_BINOP_POSITIONAL compute a binary positional op -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 switch (op) diff --git a/GraphBLAS/Test/GB_spec_build.m b/GraphBLAS/Test/GB_spec_build.m index 35cf4d0dce..e69068514f 100644 --- a/GraphBLAS/Test/GB_spec_build.m +++ b/GraphBLAS/Test/GB_spec_build.m @@ -48,7 +48,7 @@ % parameters, or pass fewer inputs. For exampe S = GB_spec_build (I, J, X, % nrows, ncols) uses defaults for op, and order, but not X, nrows and ncols. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_compare.m b/GraphBLAS/Test/GB_spec_compare.m index ec47b9fd3c..b8d86bc973 100644 --- a/GraphBLAS/Test/GB_spec_compare.m +++ b/GraphBLAS/Test/GB_spec_compare.m @@ -7,7 +7,7 @@ % some GraphBLAS method. C_mex = GB_mex_* (...) is the output of the % corresponding interface to the true GraphBLAS method, in C. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 err = 0 ; diff --git a/GraphBLAS/Test/GB_spec_concat.m b/GraphBLAS/Test/GB_spec_concat.m index f001fc2f3e..8a0469de11 100644 --- a/GraphBLAS/Test/GB_spec_concat.m +++ b/GraphBLAS/Test/GB_spec_concat.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_concat (Types, ctype) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_descriptor.m b/GraphBLAS/Test/GB_spec_descriptor.m index 5dfa64e616..65b68c04c6 100644 --- a/GraphBLAS/Test/GB_spec_descriptor.m +++ b/GraphBLAS/Test/GB_spec_descriptor.m @@ -12,7 +12,7 @@ % inp0: 'default' or 'tran' % inp1: 'default' or 'tran' -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isempty (descriptor)) diff --git a/GraphBLAS/Test/GB_spec_extractTuples.m b/GraphBLAS/Test/GB_spec_extractTuples.m index b73d0d3c9b..d825afb77c 100644 --- a/GraphBLAS/Test/GB_spec_extractTuples.m +++ b/GraphBLAS/Test/GB_spec_extractTuples.m @@ -1,7 +1,7 @@ -function [I, J, X] = GB_spec_extractTuples (A, xclass) +function [I, J, X] = GB_spec_extractTuples (A, xclass, iclass) %GB_SPEC_EXTRACTTUPLES a mimic of GrB_*_extractTuples -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 A = GB_spec_matrix (A) ; @@ -10,8 +10,13 @@ end p = A.pattern ; [I J] = find (p) ; -I = uint64 (I-1) ; -J = uint64 (J-1) ; +if (isequal (iclass, 'uint32')) + I = uint64 (I-1) ; + J = uint64 (J-1) ; +else + I = uint32 (I-1) ; + J = uint32 (J-1) ; +end X = GB_mex_cast (A.matrix (p), xclass) ; I = I (:) ; diff --git a/GraphBLAS/Test/GB_spec_getmask.m b/GraphBLAS/Test/GB_spec_getmask.m index 72af5d292e..972d980860 100644 --- a/GraphBLAS/Test/GB_spec_getmask.m +++ b/GraphBLAS/Test/GB_spec_getmask.m @@ -1,7 +1,7 @@ function Mask = GB_spec_getmask (Mask, Mask_struct) %GB_SPEC_GETMASK return the mask, typecasted to logical -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isstruct (Mask)) diff --git a/GraphBLAS/Test/GB_spec_identity.m b/GraphBLAS/Test/GB_spec_identity.m index 4c8e2f60d7..67cff2b859 100644 --- a/GraphBLAS/Test/GB_spec_identity.m +++ b/GraphBLAS/Test/GB_spec_identity.m @@ -16,7 +16,7 @@ % For the 'or', 'and', 'xor', and 'eq' the add_type must be 'logical'. % For the 'bit*' operators, the add_type must be unsigned integer. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin == 1) diff --git a/GraphBLAS/Test/GB_spec_idxunop.m b/GraphBLAS/Test/GB_spec_idxunop.m index dce07415a0..b6a0d05fea 100644 --- a/GraphBLAS/Test/GB_spec_idxunop.m +++ b/GraphBLAS/Test/GB_spec_idxunop.m @@ -1,7 +1,7 @@ function z = GB_spec_idxunop (opname, aij, i, j, thunk) %GB_SPEC_IDXUNOP apply an idxunop -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % convert indices to 0-based diff --git a/GraphBLAS/Test/GB_spec_is_idxunop.m b/GraphBLAS/Test/GB_spec_is_idxunop.m index 7951cbf697..c94a207473 100644 --- a/GraphBLAS/Test/GB_spec_is_idxunop.m +++ b/GraphBLAS/Test/GB_spec_is_idxunop.m @@ -1,7 +1,7 @@ function [s, ztype] = GB_spec_is_idxunop (op, optype) %GB_SPEC_IS_IDXUNOP determine if an op is an idxunop -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isstruct (op)) diff --git a/GraphBLAS/Test/GB_spec_is_positional.m b/GraphBLAS/Test/GB_spec_is_positional.m index 4eb3a7b16a..5b59fd6cc1 100644 --- a/GraphBLAS/Test/GB_spec_is_positional.m +++ b/GraphBLAS/Test/GB_spec_is_positional.m @@ -1,7 +1,7 @@ function s = GB_spec_is_positional (op) %GB_SPEC_IS_POSITIONAL determine if an op is positional -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isstruct (op)) diff --git a/GraphBLAS/Test/GB_spec_kron.m b/GraphBLAS/Test/GB_spec_kron.m index e4e073c65b..6c2685fbae 100644 --- a/GraphBLAS/Test/GB_spec_kron.m +++ b/GraphBLAS/Test/GB_spec_kron.m @@ -7,7 +7,7 @@ % Computes C = accum(C,T), in GraphBLAS notation, where T = kron(A,B), % kron(A',B), kron(A,B') or kron(A',B') -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_kron_idx.m b/GraphBLAS/Test/GB_spec_kron_idx.m index 37c711222e..8253458e28 100644 --- a/GraphBLAS/Test/GB_spec_kron_idx.m +++ b/GraphBLAS/Test/GB_spec_kron_idx.m @@ -1,7 +1,7 @@ function C = GB_spec_kron_idx (A, B, atrans, btrans) % C = kron(A,B), using the mykronidx operator -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 3) diff --git a/GraphBLAS/Test/GB_spec_mask.m b/GraphBLAS/Test/GB_spec_mask.m index efacb9adb5..3f7901cebd 100644 --- a/GraphBLAS/Test/GB_spec_mask.m +++ b/GraphBLAS/Test/GB_spec_mask.m @@ -20,7 +20,7 @@ % This method operates on both plain matrices and on structs with % matrix, pattern, and class components. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 6) diff --git a/GraphBLAS/Test/GB_spec_matrix.m b/GraphBLAS/Test/GB_spec_matrix.m index 41fcff7899..ea6edc45a5 100644 --- a/GraphBLAS/Test/GB_spec_matrix.m +++ b/GraphBLAS/Test/GB_spec_matrix.m @@ -63,7 +63,7 @@ % must first be passed to this function, C0=GB_spec_matrix(C0,identity) and % then C0 and C1 should be identical. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the semiring addititive identity, if present diff --git a/GraphBLAS/Test/GB_spec_mdiag.m b/GraphBLAS/Test/GB_spec_mdiag.m index d8e15c6029..f3bece0c6a 100644 --- a/GraphBLAS/Test/GB_spec_mdiag.m +++ b/GraphBLAS/Test/GB_spec_mdiag.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_mdiag (v, k, ctype) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_mxm.m b/GraphBLAS/Test/GB_spec_mxm.m index f36fba0c6c..f66f19841f 100644 --- a/GraphBLAS/Test/GB_spec_mxm.m +++ b/GraphBLAS/Test/GB_spec_mxm.m @@ -42,7 +42,7 @@ % C = accum (C,T). See GrB_accum_mask for a description of this % last step. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_mxv.m b/GraphBLAS/Test/GB_spec_mxv.m index 222e5325ff..a0f77afa2c 100644 --- a/GraphBLAS/Test/GB_spec_mxv.m +++ b/GraphBLAS/Test/GB_spec_mxv.m @@ -6,7 +6,7 @@ % % w, mask, and u are vectors. u is not transposed (descriptor inp1 ignored) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargout > 1 || nargin ~= 7) diff --git a/GraphBLAS/Test/GB_spec_nbits.m b/GraphBLAS/Test/GB_spec_nbits.m index b4ec497e62..edef64b9d9 100644 --- a/GraphBLAS/Test/GB_spec_nbits.m +++ b/GraphBLAS/Test/GB_spec_nbits.m @@ -3,7 +3,7 @@ % % bits = GB_spec_nbits ('int16') returns 16. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 switch (type) diff --git a/GraphBLAS/Test/GB_spec_ones.m b/GraphBLAS/Test/GB_spec_ones.m index 40ba1cd7df..389a54bac5 100644 --- a/GraphBLAS/Test/GB_spec_ones.m +++ b/GraphBLAS/Test/GB_spec_ones.m @@ -7,7 +7,7 @@ % % See also GB_spec_type, GB_spec_zeros, ones. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 2) diff --git a/GraphBLAS/Test/GB_spec_op.m b/GraphBLAS/Test/GB_spec_op.m index 52b3f07dc3..180e6ab4fc 100644 --- a/GraphBLAS/Test/GB_spec_op.m +++ b/GraphBLAS/Test/GB_spec_op.m @@ -36,7 +36,7 @@ % % Positional ops are not computed by this function. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % get the operator name and class diff --git a/GraphBLAS/Test/GB_spec_operator.m b/GraphBLAS/Test/GB_spec_operator.m index a3bac673ba..1893d66ef1 100644 --- a/GraphBLAS/Test/GB_spec_operator.m +++ b/GraphBLAS/Test/GB_spec_operator.m @@ -9,7 +9,7 @@ % ztype, xtype, and ytype are the types of z, x, and y for z = f(x,y), if % f is a binary operator, or z = f(x) if f is a unary operator. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (isempty (op)) diff --git a/GraphBLAS/Test/GB_spec_opsall.m b/GraphBLAS/Test/GB_spec_opsall.m index 7854749036..29f93ec10d 100644 --- a/GraphBLAS/Test/GB_spec_opsall.m +++ b/GraphBLAS/Test/GB_spec_opsall.m @@ -3,7 +3,7 @@ % % [binops unary_ops add_ops types semirings select_ops idxunop] = GB_spec_opsall -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_random.m b/GraphBLAS/Test/GB_spec_random.m index f2fe5334bc..44e251ea98 100644 --- a/GraphBLAS/Test/GB_spec_random.m +++ b/GraphBLAS/Test/GB_spec_random.m @@ -11,7 +11,7 @@ % is_csc: true for CSC, false for CSR; defaults to true % is_hyper: false for non-hypersparse, true for hypersparse, default false -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) @@ -36,6 +36,8 @@ if (nargin >= 6) A.is_csc = is_csc ; +else + is_csc = true ; end if (nargin >= 7 && ~isempty (is_hyper)) @@ -49,7 +51,12 @@ if (isinf (d)) A.matrix = scale * sparse (rand (m, n)) ; else - A.matrix = scale * sprandn (m, n, d) ; + A1 = sprandn (m, n, d) ; + A.matrix = scale * A1 ; + [i,j,x] = find (A1, 1, 'first') ; + if (~isempty (x)) + A = GB_spec_random_32 (A, x) ; + end end if (test_contains (type, 'complex')) diff --git a/GraphBLAS/Test/GB_spec_random_32.m b/GraphBLAS/Test/GB_spec_random_32.m new file mode 100644 index 0000000000..ecc096a4b2 --- /dev/null +++ b/GraphBLAS/Test/GB_spec_random_32.m @@ -0,0 +1,56 @@ +function C = GB_spec_random_32 (A, x) +%GB_SPEC_RANDOM_32 select 32/64 bit format at random +% +% C = GB_spec_random_32 (A, x) +% +% A: a MATLAB matrix, or a struct with A.matrix +% x: a random scalar, either uniform or standard distribution +% +% C.p_is_32, C.j_is_32, and C.i_is_32 are set at random. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 2) + x = rand ; +end + +if (isstruct (A)) + C = A ; +else + C.matrix = A ; +end + +is_csc = true ; +if (isfield (C, 'is_csc')) + is_csc = C.is_csc ; +end + +x = 1000 * abs (x) ; +x = x - fix (x) ; +x = 8 * x ; +x = floor (x) + 1 ; +C.p_is_32 = (bitand (x, 4) ~= 0) ; +C.j_is_32 = (bitand (x, 2) ~= 0) ; +C.i_is_32 = (bitand (x, 1) ~= 0) ; +if (nnz (C.matrix) > 2^31) + C.p_is_32 = false ; +end +[m n] = size (C.matrix) ; +if (is_csc) + if (n > 2^30) + C.j_is_32 = false ; + end + if (m > 2^30) + C.i_is_32 = false ; + end +else + if (n > 2^30) + C.i_is_32 = false ; + end + if (m > 2^30) + C.j_is_32 = false ; + end +end + + diff --git a/GraphBLAS/Test/GB_spec_reduce_to_scalar.m b/GraphBLAS/Test/GB_spec_reduce_to_scalar.m index dc70908d33..132d807d92 100644 --- a/GraphBLAS/Test/GB_spec_reduce_to_scalar.m +++ b/GraphBLAS/Test/GB_spec_reduce_to_scalar.m @@ -8,7 +8,7 @@ % % cin is a dense scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_reduce_to_vector.m b/GraphBLAS/Test/GB_spec_reduce_to_vector.m index 810d03db9c..3298ed03e6 100644 --- a/GraphBLAS/Test/GB_spec_reduce_to_vector.m +++ b/GraphBLAS/Test/GB_spec_reduce_to_vector.m @@ -6,7 +6,7 @@ % % Reduces a matrix to a vector -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_resize.m b/GraphBLAS/Test/GB_spec_resize.m index 22536263d6..b7de6b06a2 100644 --- a/GraphBLAS/Test/GB_spec_resize.m +++ b/GraphBLAS/Test/GB_spec_resize.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_resize (A, nrows_new, ncols_new) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_select.m b/GraphBLAS/Test/GB_spec_select.m index 9b1e86baa7..e62e3f5f20 100644 --- a/GraphBLAS/Test/GB_spec_select.m +++ b/GraphBLAS/Test/GB_spec_select.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_select (C, Mask, accum, opname, A, thunk, descriptor) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_select_idxunop.m b/GraphBLAS/Test/GB_spec_select_idxunop.m index 4c2b20104a..c5fbb867f8 100644 --- a/GraphBLAS/Test/GB_spec_select_idxunop.m +++ b/GraphBLAS/Test/GB_spec_select_idxunop.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_select_idxunop (C, Mask, accum, op, A, thunk, descriptor) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_semiring.m b/GraphBLAS/Test/GB_spec_semiring.m index d224a04d8d..4f1fa2626e 100644 --- a/GraphBLAS/Test/GB_spec_semiring.m +++ b/GraphBLAS/Test/GB_spec_semiring.m @@ -25,7 +25,7 @@ % 'double' (FP64 in GraphBLAS), 'single complex', and 'double % complex' -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % set the default semiring diff --git a/GraphBLAS/Test/GB_spec_split.m b/GraphBLAS/Test/GB_spec_split.m index b13eb40e7b..7db28ac5f3 100644 --- a/GraphBLAS/Test/GB_spec_split.m +++ b/GraphBLAS/Test/GB_spec_split.m @@ -4,7 +4,7 @@ % Usage: % C = GB_spec_split (A, ms, ns) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_subassign.m b/GraphBLAS/Test/GB_spec_subassign.m index c73edf47c4..c1d65911ab 100644 --- a/GraphBLAS/Test/GB_spec_subassign.m +++ b/GraphBLAS/Test/GB_spec_subassign.m @@ -12,7 +12,7 @@ % is the same size as A (after optionally being transpose) and the submatrix % C(I,J). Entries outside the C(I,J) submatrix are never modified. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_transpose.m b/GraphBLAS/Test/GB_spec_transpose.m index 59586415d4..0b403e900c 100644 --- a/GraphBLAS/Test/GB_spec_transpose.m +++ b/GraphBLAS/Test/GB_spec_transpose.m @@ -57,7 +57,7 @@ % Use an empty value ([ ] or '') to obtain the default value for optional % parameters. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_type.m b/GraphBLAS/Test/GB_spec_type.m index 5759efbc30..c94dcfaee7 100644 --- a/GraphBLAS/Test/GB_spec_type.m +++ b/GraphBLAS/Test/GB_spec_type.m @@ -11,7 +11,7 @@ % % See also GrB.type. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = class (X) ; diff --git a/GraphBLAS/Test/GB_spec_unop_positional.m b/GraphBLAS/Test/GB_spec_unop_positional.m index 6023f3dc9c..66cf1ad7a2 100644 --- a/GraphBLAS/Test/GB_spec_unop_positional.m +++ b/GraphBLAS/Test/GB_spec_unop_positional.m @@ -1,7 +1,7 @@ function z = GB_spec_unop_positional (op, i, j) %GB_SPEC_UNOP_POSITIONAL compute a unary positional op -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 switch (op) diff --git a/GraphBLAS/Test/GB_spec_vdiag.m b/GraphBLAS/Test/GB_spec_vdiag.m index aa87643142..1f5e43621f 100644 --- a/GraphBLAS/Test/GB_spec_vdiag.m +++ b/GraphBLAS/Test/GB_spec_vdiag.m @@ -4,7 +4,7 @@ % Usage: % V = GB_spec_vdiag (A, k, vtype) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 %------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/GB_spec_vxm.m b/GraphBLAS/Test/GB_spec_vxm.m index b3504bc154..1dd182b8ee 100644 --- a/GraphBLAS/Test/GB_spec_vxm.m +++ b/GraphBLAS/Test/GB_spec_vxm.m @@ -6,7 +6,7 @@ % % w, mask, and u are column vectors. Computes w'=u'*A or w'=u'*A' -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargout > 1 || nargin ~= 7) diff --git a/GraphBLAS/Test/GB_spec_zeros.m b/GraphBLAS/Test/GB_spec_zeros.m index f044d4632c..3f496f2d1c 100644 --- a/GraphBLAS/Test/GB_spec_zeros.m +++ b/GraphBLAS/Test/GB_spec_zeros.m @@ -7,7 +7,7 @@ % % See also GB_spec_type, GB_spec_zeros, zeros. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 2) diff --git a/GraphBLAS/Test/GB_spok.m b/GraphBLAS/Test/GB_spok.m index 2a463931fb..af19779207 100644 --- a/GraphBLAS/Test/GB_spok.m +++ b/GraphBLAS/Test/GB_spok.m @@ -1,7 +1,7 @@ function ok = GB_spok (A) %GB_SPOK check if a matrix is valid -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (issparse (A)) diff --git a/GraphBLAS/Test/GB_spones_mex.c b/GraphBLAS/Test/GB_spones_mex.c index 1deb6915a8..805a6055d2 100644 --- a/GraphBLAS/Test/GB_spones_mex.c +++ b/GraphBLAS/Test/GB_spones_mex.c @@ -2,7 +2,7 @@ // GB_spones_mex: like spones(A) in MATLAB but do not drop zeros on input //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The MATLAB built-in function spones(A) has changed, as of MATLAB R2019b. diff --git a/GraphBLAS/Test/GB_undef_iterator.h b/GraphBLAS/Test/GB_undef_iterator.h index 102e1ad637..5990492a1b 100644 --- a/GraphBLAS/Test/GB_undef_iterator.h +++ b/GraphBLAS/Test/GB_undef_iterator.h @@ -2,7 +2,7 @@ // GB_undef_iterator.h: remove #define's for Iterator methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/GraphBLAS/Test/GB_user_op.m b/GraphBLAS/Test/GB_user_op.m index 2ffdfa2f02..c57356fa78 100644 --- a/GraphBLAS/Test/GB_user_op.m +++ b/GraphBLAS/Test/GB_user_op.m @@ -10,7 +10,7 @@ % No typecasting is done for user-defined operators. x,y,z are either % double complex or double -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 tol = false ; diff --git a/GraphBLAS/Test/GB_user_opsall.m b/GraphBLAS/Test/GB_user_opsall.m index 0144f59cda..db703d1c5c 100644 --- a/GraphBLAS/Test/GB_user_opsall.m +++ b/GraphBLAS/Test/GB_user_opsall.m @@ -1,7 +1,7 @@ function [complex_binaryops complex_unaryops ] = GB_user_opsall %GB_USER_OPSALL return list of complex operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % complex binary operators diff --git a/GraphBLAS/Test/Makefile b/GraphBLAS/Test/Makefile index 4c0ac271b6..c1d726b46e 100644 --- a/GraphBLAS/Test/Makefile +++ b/GraphBLAS/Test/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Test/Makefile #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/Test/README.txt b/GraphBLAS/Test/README.txt index fa26f4731b..0bd24fd44c 100644 --- a/GraphBLAS/Test/README.txt +++ b/GraphBLAS/Test/README.txt @@ -1,4 +1,4 @@ -SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 GraphBLAS/Test: diff --git a/GraphBLAS/Test/Template/GB_mx_build_template.c b/GraphBLAS/Test/Template/GB_mx_build_template.c index 3f86098c50..991ffbafe2 100644 --- a/GraphBLAS/Test/Template/GB_mx_build_template.c +++ b/GraphBLAS/Test/Template/GB_mx_build_template.c @@ -2,7 +2,7 @@ // GB_mx_build_template: build a sparse vector or matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -42,9 +42,9 @@ // operator is ignored in that case. #ifdef MATRIX -#define MAX_NARGIN 8 +#define MAX_NARGIN 9 #define MIN_NARGIN 3 -#define USAGE "GB_mex_Matrix_build (I,J,X,nrows,ncols,dup,type,csc)" +#define USAGE "GB_mex_Matrix_build (I,J,X,nrows,ncols,dup,type,csc,desc)" #define I_ARG 0 #define J_ARG 1 #define X_ARG 2 @@ -53,20 +53,22 @@ #define DUP_ARG 5 #define TYPE_ARG 6 #define CSC_ARG 7 +#define DESC_ARG 8 #define FREE_WORK \ { \ GrB_Scalar_free_(&scalar) ; \ GrB_Matrix_free_(&C) ; \ } #else -#define MAX_NARGIN 5 +#define MAX_NARGIN 6 #define MIN_NARGIN 2 -#define USAGE "GB_mex_Vector_build (I,X,nrows,dup,type)" +#define USAGE "GB_mex_Vector_build (I,X,nrows,dup,type,desc)" #define I_ARG 0 #define X_ARG 1 #define NROWS_ARG 2 #define DUP_ARG 3 #define TYPE_ARG 4 +#define DESC_ARG 5 #define FREE_WORK \ { \ GrB_Scalar_free_(&scalar) ; \ @@ -77,6 +79,10 @@ #define FREE_ALL \ { \ FREE_WORK ; \ + GrB_Vector_free_(&I_vector) ; \ + GrB_Vector_free_(&J_vector) ; \ + GrB_Vector_free_(&X_vector) ; \ + GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } @@ -95,28 +101,9 @@ bool malloc_debug = false ; -GrB_Info builder -( - #ifdef MATRIX - GrB_Matrix *Chandle, - #else - GrB_Vector *Chandle, - #endif - GrB_Type ctype, - GrB_Index nrows, - GrB_Index ncols, - GrB_Index *I, - GrB_Index *J, - GB_void *X, bool scalar_build, - GrB_Index ni, - GrB_BinaryOp dup, - bool C_is_csc, - GrB_Type xtype -) ; - //------------------------------------------------------------------------------ -GrB_Info builder +static GrB_Info builder ( #ifdef MATRIX GrB_Matrix *Chandle, @@ -124,15 +111,19 @@ GrB_Info builder GrB_Vector *Chandle, #endif GrB_Type ctype, - GrB_Index nrows, - GrB_Index ncols, - GrB_Index *I, - GrB_Index *J, + uint64_t nrows, + uint64_t ncols, + void *I, + void *J, GB_void *X, bool scalar_build, - GrB_Index ni, + uint64_t ni, GrB_BinaryOp dup, bool C_is_csc, - GrB_Type xtype + GrB_Type xtype, + GrB_Vector I_vector, + GrB_Vector J_vector, + GrB_Vector X_vector, + GrB_Descriptor desc ) { @@ -147,15 +138,15 @@ GrB_Info builder { // create a hypersparse CSC matrix info = GB_new (Chandle, // sparse/hyper, new header - ctype, nrows, ncols, GB_Ap_calloc, - true, sparsity, GxB_HYPER_DEFAULT, 1) ; + ctype, nrows, ncols, GB_ph_calloc, + true, sparsity, GxB_HYPER_DEFAULT, 1, false, false, false) ; } else { // create a hypersparse CSR matrix info = GB_new (Chandle, // sparse/hyper, new header - ctype, ncols, nrows, GB_Ap_calloc, - false, sparsity, GxB_HYPER_DEFAULT, 1) ; + ctype, ncols, nrows, GB_ph_calloc, + false, sparsity, GxB_HYPER_DEFAULT, 1, false, false, false) ; } #else info = GrB_Vector_new (Chandle, ctype, nrows) ; @@ -175,37 +166,48 @@ GrB_Info builder if (scalar_build) { - OK1 (GrB_Scalar_new (&scalar, xtype)) ; - // build an iso matrix or vector from the tuples and the scalar - #ifdef MATRIX - #define BUILD(prefix,suffix,type) \ - OK1 (prefix ## Scalar_setElement ## suffix (scalar, * (type *) X)) ; \ - OK1 (GxB_Matrix_build_Scalar (C, I, J, scalar, ni)) ; - #else - #define BUILD(prefix,suffix,type) \ - OK1 (prefix ## Scalar_setElement ## suffix (scalar, * (type *) X)) ; \ - OK1 (GxB_Vector_build_Scalar (C, I, scalar, ni)) ; - #endif - - switch (xtype->code) + if (desc == NULL) + { + OK1 (GrB_Scalar_new (&scalar, xtype)) ; + #ifdef MATRIX + #define BUILD(prefix,suffix,type) \ + OK1 (prefix ## Scalar_setElement ## suffix (scalar, * (type *) X)) ; \ + OK1 (GxB_Matrix_build_Scalar_(C, (uint64_t *) I, (uint64_t *) J, scalar, ni)) ; + #else + #define BUILD(prefix,suffix,type) \ + OK1 (prefix ## Scalar_setElement ## suffix (scalar, * (type *) X)) ; \ + OK1 (GxB_Vector_build_Scalar_(C, (uint64_t *) I, scalar, ni)) ; + #endif + switch (xtype->code) + { + case GB_BOOL_code : BUILD (GrB_, _BOOL, bool ) ; break ; + case GB_INT8_code : BUILD (GrB_, _INT8, int8_t ) ; break ; + case GB_INT16_code : BUILD (GrB_, _INT16, int16_t ) ; break ; + case GB_INT32_code : BUILD (GrB_, _INT32, int32_t ) ; break ; + case GB_INT64_code : BUILD (GrB_, _INT64, int64_t ) ; break ; + case GB_UINT8_code : BUILD (GrB_, _UINT8, uint8_t ) ; break ; + case GB_UINT16_code : BUILD (GrB_, _UINT16, uint16_t) ; break ; + case GB_UINT32_code : BUILD (GrB_, _UINT32, uint32_t) ; break ; + case GB_UINT64_code : BUILD (GrB_, _UINT64, uint64_t) ; break ; + case GB_FP32_code : BUILD (GrB_, _FP32, float ) ; break ; + case GB_FP64_code : BUILD (GrB_, _FP64, double ) ; break ; + case GB_FC32_code : BUILD (GxB_, _FC32, GxB_FC32_t) ; break ; + case GB_FC64_code : BUILD (GxB_, _FC64, GxB_FC64_t) ; break ; + default : + FREE_WORK ; + mexErrMsgTxt ("xtype not supported") ; + } + GrB_Scalar_free_(&scalar) ; + } + else { - case GB_BOOL_code : BUILD (GrB_, _BOOL, bool ) ; break ; - case GB_INT8_code : BUILD (GrB_, _INT8, int8_t ) ; break ; - case GB_INT16_code : BUILD (GrB_, _INT16, int16_t ) ; break ; - case GB_INT32_code : BUILD (GrB_, _INT32, int32_t ) ; break ; - case GB_INT64_code : BUILD (GrB_, _INT64, int64_t ) ; break ; - case GB_UINT8_code : BUILD (GrB_, _UINT8, uint8_t ) ; break ; - case GB_UINT16_code : BUILD (GrB_, _UINT16, uint16_t) ; break ; - case GB_UINT32_code : BUILD (GrB_, _UINT32, uint32_t) ; break ; - case GB_UINT64_code : BUILD (GrB_, _UINT64, uint64_t) ; break ; - case GB_FP32_code : BUILD (GrB_, _FP32, float ) ; break ; - case GB_FP64_code : BUILD (GrB_, _FP64, double ) ; break ; - case GB_FC32_code : BUILD (GxB_, _FC32, GxB_FC32_t) ; break ; - case GB_FC64_code : BUILD (GxB_, _FC64, GxB_FC64_t) ; break ; - default : - FREE_WORK ; - mexErrMsgTxt ("xtype not supported") ; + GrB_Scalar x = (GrB_Scalar) X_vector ; + #ifdef MATRIX + OK1 (GxB_Matrix_build_Scalar_Vector_(C, I_vector, J_vector, x, desc)) ; + #else + OK1 (GxB_Vector_build_Scalar_Vector_(C, I_vector, x, desc)) ; + #endif } } @@ -213,39 +215,48 @@ GrB_Info builder { // build a non-iso matrix or vector from the tuples - #undef BUILD - #ifdef MATRIX - #define BUILD(prefix,suffix,type) \ - OK1 (prefix ## Matrix_build ## suffix \ - (C, I, J, (const type *) X, ni, dup)) - #else - #define BUILD(prefix,suffix,type) \ - OK1 (prefix ## Vector_build ## suffix \ - (C, I, (const type *) X, ni, dup)) - #endif - - switch (xtype->code) + if (desc == NULL) + { + #undef BUILD + #ifdef MATRIX + #define BUILD(prefix,suffix,type) \ + OK1 (prefix ## Matrix_build ## suffix \ + (C, (uint64_t *) I, (uint64_t *) J, (const type *) X, ni, dup)) + #else + #define BUILD(prefix,suffix,type) \ + OK1 (prefix ## Vector_build ## suffix \ + (C, (uint64_t *) I, (const type *) X, ni, dup)) + #endif + switch (xtype->code) + { + case GB_BOOL_code : BUILD (GrB_, _BOOL, bool ) ; break ; + case GB_INT8_code : BUILD (GrB_, _INT8, int8_t ) ; break ; + case GB_INT16_code : BUILD (GrB_, _INT16, int16_t ) ; break ; + case GB_INT32_code : BUILD (GrB_, _INT32, int32_t ) ; break ; + case GB_INT64_code : BUILD (GrB_, _INT64, int64_t ) ; break ; + case GB_UINT8_code : BUILD (GrB_, _UINT8, uint8_t ) ; break ; + case GB_UINT16_code : BUILD (GrB_, _UINT16, uint16_t) ; break ; + case GB_UINT32_code : BUILD (GrB_, _UINT32, uint32_t) ; break ; + case GB_UINT64_code : BUILD (GrB_, _UINT64, uint64_t) ; break ; + case GB_FP32_code : BUILD (GrB_, _FP32, float ) ; break ; + case GB_FP64_code : BUILD (GrB_, _FP64, double ) ; break ; + case GB_FC32_code : BUILD (GxB_, _FC32, GxB_FC32_t) ; break ; + case GB_FC64_code : BUILD (GxB_, _FC64, GxB_FC64_t) ; break ; + default : + FREE_WORK ; + mexErrMsgTxt ("xtype not supported") ; + } + } + else { - case GB_BOOL_code : BUILD (GrB_, _BOOL, bool ) ; break ; - case GB_INT8_code : BUILD (GrB_, _INT8, int8_t ) ; break ; - case GB_INT16_code : BUILD (GrB_, _INT16, int16_t ) ; break ; - case GB_INT32_code : BUILD (GrB_, _INT32, int32_t ) ; break ; - case GB_INT64_code : BUILD (GrB_, _INT64, int64_t ) ; break ; - case GB_UINT8_code : BUILD (GrB_, _UINT8, uint8_t ) ; break ; - case GB_UINT16_code : BUILD (GrB_, _UINT16, uint16_t) ; break ; - case GB_UINT32_code : BUILD (GrB_, _UINT32, uint32_t) ; break ; - case GB_UINT64_code : BUILD (GrB_, _UINT64, uint64_t) ; break ; - case GB_FP32_code : BUILD (GrB_, _FP32, float ) ; break ; - case GB_FP64_code : BUILD (GrB_, _FP64, double ) ; break ; - case GB_FC32_code : BUILD (GxB_, _FC32, GxB_FC32_t) ; break ; - case GB_FC64_code : BUILD (GxB_, _FC64, GxB_FC64_t) ; break ; - default : - FREE_WORK ; - mexErrMsgTxt ("xtype not supported") ; + #ifdef MATRIX + OK1 (GxB_Matrix_build_Vector_(C, I_vector, J_vector, X_vector, dup, desc)) ; + #else + OK1 (GxB_Vector_build_Vector_(C, I_vector, X_vector, dup, desc)) ; + #endif } } - GrB_Scalar_free_(&scalar) ; return (GrB_SUCCESS) ; } @@ -262,8 +273,11 @@ void mexFunction GrB_Info info ; malloc_debug = GB_mx_get_global (true) ; - GrB_Index *I = NULL, ni = 0, I_range [3] ; - GrB_Index *J = NULL, nj = 0, J_range [3] ; + uint64_t *I = NULL, *J = NULL ; + uint64_t ni = 0, I_range [3] ; + uint64_t nj = 0, J_range [3] ; + uint64_t nx = 0, nvals = 0 ; + GB_void *X = NULL ; GrB_Scalar scalar = NULL ; bool is_list ; #ifdef MATRIX @@ -271,6 +285,10 @@ void mexFunction #else GrB_Vector C = NULL ; #endif + GrB_Type xtype = NULL ; + bool scalar_build = false ; + GrB_Vector I_vector = NULL, J_vector = NULL, X_vector = NULL ; + GrB_Descriptor desc = NULL ; // check inputs if (nargout > 1 || nargin < MIN_NARGIN || nargin > MAX_NARGIN) @@ -278,60 +296,93 @@ void mexFunction mexErrMsgTxt ("Usage: C = " USAGE) ; } - // get I - if (!GB_mx_mxArray_to_indices (&I, pargin [I_ARG], &ni, I_range, &is_list)) + // get the descriptor + if (nargin > DESC_ARG) { - FREE_ALL ; - mexErrMsgTxt ("I failed") ; - } - if (!is_list) - { - mexErrMsgTxt ("I is invalid; must be a list") ; + if (!GB_mx_mxArray_to_Descriptor (&desc, pargin [DESC_ARG], "desc")) + { + FREE_ALL ; + mexErrMsgTxt ("desc failed") ; + } } - #ifdef MATRIX - // get J for a matrix - if (!GB_mx_mxArray_to_indices (&J, pargin [J_ARG], &nj, J_range, &is_list)) + if (desc == NULL) { - FREE_ALL ; - mexErrMsgTxt ("J failed") ; - } - if (!is_list) - { - mexErrMsgTxt ("J is invalid; must be a list") ; - } - if (ni != nj) - { - FREE_ALL ; - mexErrMsgTxt ("I and J must be the same size") ; - } - #endif + // get I + if (!GB_mx_mxArray_to_indices (pargin [I_ARG], &I, &ni, I_range, &is_list, + NULL)) + { + FREE_ALL ; + mexErrMsgTxt ("I failed") ; + } + if (!is_list) + { + FREE_ALL ; + mexErrMsgTxt ("I is invalid; must be a list") ; + } - // get X - GrB_Index nx = mxGetNumberOfElements (pargin [X_ARG]) ; - bool scalar_build = (nx == 1) ; - if (!scalar_build && ni != nx) - { - FREE_ALL ; - mexErrMsgTxt ("I and X must be the same size") ; - } - if (!(mxIsNumeric (pargin [X_ARG]) || mxIsLogical (pargin [X_ARG]))) - { - FREE_ALL ; - mexErrMsgTxt ("X must be a numeric or logical array") ; - } - if (mxIsSparse (pargin [X_ARG])) - { - FREE_ALL ; - mexErrMsgTxt ("X cannot be sparse") ; + #ifdef MATRIX + // get J for a matrix + if (!GB_mx_mxArray_to_indices (pargin [J_ARG], &J, &nj, J_range, &is_list, + NULL)) + { + FREE_ALL ; + mexErrMsgTxt ("J failed") ; + } + if (!is_list) + { + FREE_ALL ; + mexErrMsgTxt ("J is invalid; must be a list") ; + } + if (ni != nj) + { + FREE_ALL ; + mexErrMsgTxt ("I and J must be the same size") ; + } + #endif + + // get X + nx = mxGetNumberOfElements (pargin [X_ARG]) ; + nvals = nx ; + scalar_build = (nx == 1) ; + if (!scalar_build && ni != nx) + { + FREE_ALL ; + mexErrMsgTxt ("I and X must be the same size") ; + } + if (!(mxIsNumeric (pargin [X_ARG]) || mxIsLogical (pargin [X_ARG]))) + { + FREE_ALL ; + mexErrMsgTxt ("X must be a numeric or logical array") ; + } + if (mxIsSparse (pargin [X_ARG])) + { + FREE_ALL ; + mexErrMsgTxt ("X cannot be sparse") ; + } + X = mxGetData (pargin [X_ARG]) ; + xtype = GB_mx_Type (pargin [X_ARG]) ; + if (xtype == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("X must be numeric") ; + } } - GB_void *X = mxGetData (pargin [X_ARG]) ; - GrB_Type xtype = GB_mx_Type (pargin [X_ARG]) ; - if (xtype == NULL) + else { - FREE_ALL ; - mexErrMsgTxt ("X must be numeric") ; + // get I_vector + I_vector = GB_mx_mxArray_to_Vector (pargin [I_ARG], "I", false, false) ; + #ifdef MATRIX + // get J_vector + J_vector = GB_mx_mxArray_to_Vector (pargin [J_ARG], "J", false, false) ; + #endif + // get X_vector + X_vector = GB_mx_mxArray_to_Vector (pargin [X_ARG], "X", false, false) ; + OK (GxB_Vector_type (&xtype, X_vector)) ; + OK (GrB_Vector_nvals (&nvals, X_vector)) ; + OK (GrB_Vector_size (&nx, X_vector)) ; + scalar_build = (nx == 1 && nvals == 1) ; } // get the number of rows @@ -342,9 +393,18 @@ void mexFunction } else { - for (int64_t k = 0 ; k < ni ; k++) + if (desc == NULL) { - nrows = GB_IMAX (nrows, I [k]) ; + uint64_t *I64 = I ; + for (int64_t k = 0 ; k < ni ; k++) + { + nrows = GB_IMAX (nrows, I64 [k]) ; + } + } + else + { + OK (GrB_Vector_reduce_UINT64 (&nrows, NULL, + GrB_MAX_MONOID_UINT64, I_vector, NULL)) ; } nrows++ ; } @@ -359,9 +419,18 @@ void mexFunction else { ncols = 0 ; - for (int64_t k = 0 ; k < ni ; k++) + if (desc == NULL) + { + uint64_t *J64 = J ; + for (int64_t k = 0 ; k < ni ; k++) + { + ncols = GB_IMAX (ncols, J64 [k]) ; + } + } + else { - ncols = GB_IMAX (ncols, J [k]) ; + OK (GrB_Vector_reduce_UINT64 (&ncols, NULL, + GrB_MAX_MONOID_UINT64, J_vector, NULL)) ; } ncols++ ; } @@ -411,15 +480,16 @@ void mexFunction } #endif - METHOD (builder (&C, ctype, nrows, ncols, I, J, X, scalar_build, ni, dup, - C_is_csc, xtype)) ; - - ASSERT_MATRIX_OK (C, "C built", GB0) ; + METHOD (builder (&C, ctype, nrows, ncols, I, J, + X, scalar_build, ni, dup, C_is_csc, xtype, + I_vector, J_vector, X_vector, desc)) ; // return C as a struct and free the GraphBLAS C #ifdef MATRIX + ASSERT_MATRIX_OK (C, "C matrix built", GB0) ; pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", true) ; #else + ASSERT_VECTOR_OK (C, "C vector built", GB0) ; pargout [0] = GB_mx_Vector_to_mxArray (&C, "C output", true) ; #endif diff --git a/GraphBLAS/Test/Template/GB_mx_dot_iterator_template.c b/GraphBLAS/Test/Template/GB_mx_dot_iterator_template.c index 8ab7f76db1..c0f23f0965 100644 --- a/GraphBLAS/Test/Template/GB_mx_dot_iterator_template.c +++ b/GraphBLAS/Test/Template/GB_mx_dot_iterator_template.c @@ -2,7 +2,7 @@ // GB_mx_dot_iterator: s = X'*Y, dot product of 2 vectors using iterators //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -108,11 +108,11 @@ } { - GrB_Index x_pmax = GxB_Vector_Iterator_getpmax (X_iterator) ; - Assert (x_pmax == ((x_sparsity == GxB_BITMAP && xnvals > 0) ? n : xnvals)) ; + uint64_t x_pmax = GxB_Vector_Iterator_getpmax (X_iterator) ; + my_assert (x_pmax == ((x_sparsity == GxB_BITMAP && xnvals > 0) ? n:xnvals)); - GrB_Index y_pmax = GxB_Vector_Iterator_getpmax (Y_iterator) ; - Assert (y_pmax == ((y_sparsity == GxB_BITMAP && ynvals > 0) ? n : ynvals)) ; + uint64_t y_pmax = GxB_Vector_Iterator_getpmax (Y_iterator) ; + my_assert (y_pmax == ((y_sparsity == GxB_BITMAP && ynvals > 0) ? n:ynvals)); if (kind == 0) { @@ -124,8 +124,8 @@ while (X_info != GxB_EXHAUSTED && Y_info != GxB_EXHAUSTED) { // get the index of entries x(i) and y(j) - GrB_Index i = GxB_Vector_Iterator_getIndex (X_iterator) ; - GrB_Index j = GxB_Vector_Iterator_getIndex (Y_iterator) ; + uint64_t i = GxB_Vector_Iterator_getIndex (X_iterator) ; + uint64_t j = GxB_Vector_Iterator_getIndex (Y_iterator) ; if (i < j) { // consume x(i) @@ -158,20 +158,20 @@ // seek all entries in x, backwards for (int64_t p = ((int64_t) x_pmax) - 1 ; p >= 0 ; p--) { - X_info = GxB_Vector_Iterator_seek (X_iterator, (GrB_Index) p) ; + X_info = GxB_Vector_Iterator_seek (X_iterator, (uint64_t) p) ; if (X_info == GrB_SUCCESS) { - GrB_Index p2 = GxB_Vector_Iterator_getp (X_iterator) ; + uint64_t p2 = GxB_Vector_Iterator_getp (X_iterator) ; if (p != p2) continue ; // get x(i) - GrB_Index i = GxB_Vector_Iterator_getIndex (X_iterator) ; + uint64_t i = GxB_Vector_Iterator_getIndex (X_iterator) ; // find y(i) via brute force Y_info = GxB_Vector_Iterator_seek (Y_iterator, 0) ; while (Y_info != GxB_EXHAUSTED) { - GrB_Index i2 = GxB_Vector_Iterator_getIndex (Y_iterator) ; + uint64_t i2 = GxB_Vector_Iterator_getIndex (Y_iterator) ; if (i2 == i) { // s += x(i) * y(i) diff --git a/GraphBLAS/Test/Template/GB_mx_mxv_iterator_template.c b/GraphBLAS/Test/Template/GB_mx_mxv_iterator_template.c index e6e33078df..7f3c670f2b 100644 --- a/GraphBLAS/Test/Template/GB_mx_mxv_iterator_template.c +++ b/GraphBLAS/Test/Template/GB_mx_mxv_iterator_template.c @@ -2,7 +2,7 @@ // GB_mx_mxv_iterator: Y = A*X using an iterator //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -105,8 +105,8 @@ // attach it to the matrix A OK (GxB_rowIterator_attach (iterator, A, NULL)) ; // get the kount - GrB_Index kount2 = 0 ; - GrB_Index kount1 = GxB_rowIterator_kount (iterator) ; + uint64_t kount2 = 0 ; + uint64_t kount1 = GxB_rowIterator_kount (iterator) ; // seek to A(0,:) info = GxB_rowIterator_seekRow (iterator, 0) ; OK (info) ; @@ -114,13 +114,13 @@ { // iterate over entries in A(i,:) kount2++ ; - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i < nrows) ; + uint64_t i = GxB_rowIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i < nrows) ; while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; - Assert (j >= 0 && j < ncols) ; + uint64_t j = GxB_rowIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j < ncols) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(i,:) @@ -132,11 +132,11 @@ OK (info) ; } - Assert (kount1 == kount2) ; + my_assert (kount1 == kount2) ; // check the return value when the iterator is exhausted - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; - Assert (i == nrows) ; + uint64_t i = GxB_rowIterator_getRowIndex (iterator) ; + my_assert (i == nrows) ; } else if (kind == 1) @@ -149,8 +149,8 @@ // attach it to the matrix A OK (GxB_colIterator_attach (iterator, A, NULL)) ; // get the kount - GrB_Index kount2 = 0 ; - GrB_Index kount1 = GxB_colIterator_kount (iterator) ; + uint64_t kount2 = 0 ; + uint64_t kount1 = GxB_colIterator_kount (iterator) ; // seek to A(:,0) info = GxB_colIterator_seekCol (iterator, 0) ; OK (info) ; @@ -158,13 +158,13 @@ { // iterate over entries in A(:,j) kount2++ ; - GrB_Index j = GxB_colIterator_getColIndex (iterator) ; - Assert (j >= 0 && j < ncols) ; + uint64_t j = GxB_colIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j < ncols) ; while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i < nrows) ; + uint64_t i = GxB_colIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i < nrows) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(:,j) @@ -176,11 +176,11 @@ OK (info) ; } - Assert (kount1 == kount2) ; + my_assert (kount1 == kount2) ; // check the return value when the iterator is exhausted - GrB_Index j = GxB_rowIterator_getRowIndex (iterator) ; - Assert (j == ncols) ; + uint64_t j = GxB_rowIterator_getRowIndex (iterator) ; + my_assert (j == ncols) ; } else if (kind == 2) @@ -190,8 +190,12 @@ // Y = A*X using a matrix iterator //---------------------------------------------------------------------- - // useless descriptor, just to test nthreads extraction for GB_wait - if (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) A->jumbled = true ; + // need to test GB_Iterator_attach call to GB_wait +// ... but is not valid if A is shallow: +// if (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) A->jumbled = true ; +// the above line is necessary to test the call to GB_wait in +// GB_Iterator_attach. Need to be able to pass in A as a deep copy +// so it can be flagged here as jumbled. // attach it to the matrix A OK (GxB_Matrix_Iterator_attach (iterator, A, GrB_DESC_S)) ; @@ -200,10 +204,10 @@ while (info != GxB_EXHAUSTED) { // get the entry A(i,j) - GrB_Index i, j ; + uint64_t i, j ; GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; - Assert (i >= 0 && i < nrows) ; - Assert (j >= 0 && j < ncols) ; + my_assert (i >= 0 && i < nrows) ; + my_assert (j >= 0 && j < ncols) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A @@ -211,9 +215,9 @@ OK (info); } - GrB_Index p = GxB_Matrix_Iterator_getp (iterator) ; - GrB_Index pmax = GxB_Matrix_Iterator_getpmax (iterator) ; - Assert (p == pmax) ; + uint64_t p = GxB_Matrix_Iterator_getp (iterator) ; + uint64_t pmax = GxB_Matrix_Iterator_getpmax (iterator) ; + my_assert (p == pmax) ; } else if (kind == 3) @@ -226,23 +230,23 @@ // attach it to the matrix A OK (GxB_rowIterator_attach (iterator, A, NULL)) ; // get the kount - GrB_Index kount = GxB_rowIterator_kount (iterator) ; + uint64_t kount = GxB_rowIterator_kount (iterator) ; for (int k = kount-1 ; k >= 0 ; k--) { // seek to A(k,:) - info = GxB_rowIterator_kseek (iterator, (GrB_Index) k) ; - Assert (info == GrB_SUCCESS || info == GrB_NO_VALUE) ; + info = GxB_rowIterator_kseek (iterator, (uint64_t) k) ; + my_assert (info == GrB_SUCCESS || info == GrB_NO_VALUE) ; // get the row index - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i <= nrows) ; + uint64_t i = GxB_rowIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i <= nrows) ; // iterate over entries in A(i,:) while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; - Assert (j >= 0 && j < ncols) ; + uint64_t j = GxB_rowIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j < ncols) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(i,:) @@ -262,23 +266,23 @@ // attach it to the matrix A OK (GxB_colIterator_attach (iterator, A, NULL)) ; // get the kount - GrB_Index kount = GxB_colIterator_kount (iterator) ; + uint64_t kount = GxB_colIterator_kount (iterator) ; for (int k = kount-1 ; k >= 0 ; k--) { // seek to A(:,k) - info = GxB_colIterator_kseek (iterator, (GrB_Index) k) ; - Assert (info == GrB_SUCCESS || info == GrB_NO_VALUE) ; + info = GxB_colIterator_kseek (iterator, (uint64_t) k) ; + my_assert (info == GrB_SUCCESS || info == GrB_NO_VALUE) ; // get the col index - GrB_Index j = GxB_colIterator_getColIndex (iterator) ; - Assert (j >= 0 && j <= ncols) ; + uint64_t j = GxB_colIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j <= ncols) ; // iterate over entries in A(:,j) while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i < nrows) ; + uint64_t i = GxB_colIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i < nrows) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(:,j) @@ -301,12 +305,12 @@ for (int k = 0 ; k < nrows ; k++) { // seek to A(k,:) - info = GxB_rowIterator_seekRow (iterator, (GrB_Index) k) ; - Assert (info >= GrB_SUCCESS) ; + info = GxB_rowIterator_seekRow (iterator, (uint64_t) k) ; + my_assert (info >= GrB_SUCCESS) ; // get the row index - GrB_Index i = GxB_rowIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i <= nrows) ; + uint64_t i = GxB_rowIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i <= nrows) ; // if the matrix is hypersparse, seekRow can skip if (i != k) continue ; @@ -315,8 +319,8 @@ while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index j = GxB_rowIterator_getColIndex (iterator) ; - Assert (j >= 0 && j < ncols) ; + uint64_t j = GxB_rowIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j < ncols) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(i,:) @@ -327,7 +331,7 @@ // try exhaustion info = GxB_rowIterator_seekRow (iterator, nrows) ; - Assert (info == GxB_EXHAUSTED) ; + my_assert (info == GxB_EXHAUSTED) ; } else if (kind == 6) @@ -342,12 +346,12 @@ for (int k = 0 ; k < ncols ; k++) { // seek to A(:,k) - info = GxB_colIterator_seekCol (iterator, (GrB_Index) k) ; - Assert (info >= GrB_SUCCESS) ; + info = GxB_colIterator_seekCol (iterator, (uint64_t) k) ; + my_assert (info >= GrB_SUCCESS) ; // get the col index - GrB_Index j = GxB_colIterator_getColIndex (iterator) ; - Assert (j >= 0 && j <= ncols) ; + uint64_t j = GxB_colIterator_getColIndex (iterator) ; + my_assert (j >= 0 && j <= ncols) ; // if the matrix is hypersparse, seekCol can skip if (j != k) continue ; @@ -356,8 +360,8 @@ while (info == GrB_SUCCESS) { // get the entry A(i,j) - GrB_Index i = GxB_colIterator_getRowIndex (iterator) ; - Assert (i >= 0 && i < nrows) ; + uint64_t i = GxB_colIterator_getRowIndex (iterator) ; + my_assert (i >= 0 && i < nrows) ; // Y (i) += A(i,j) * X (j) MULTADD ; // move to the next entry in A(:,j) @@ -368,7 +372,7 @@ // try exhaustion info = GxB_colIterator_seekCol (iterator, ncols) ; - Assert (info == GxB_EXHAUSTED) ; + my_assert (info == GxB_EXHAUSTED) ; } else if (kind == 7) @@ -380,9 +384,9 @@ // attach it to the matrix A OK (GxB_Matrix_Iterator_attach (iterator, A, NULL)) ; - GrB_Index pmax = GxB_Matrix_Iterator_getpmax (iterator) ; + uint64_t pmax = GxB_Matrix_Iterator_getpmax (iterator) ; - for (GrB_Index p = 0 ; p < pmax ; p++) + for (uint64_t p = 0 ; p < pmax ; p++) { // seek to the pth entry OK (GxB_Matrix_Iterator_seek (iterator, p)) ; @@ -390,17 +394,17 @@ if (p == GxB_Matrix_Iterator_getp (iterator)) { // get the entry A(i,j) - GrB_Index i, j ; + uint64_t i, j ; GxB_Matrix_Iterator_getIndex (iterator, &i, &j) ; - Assert (i >= 0 && i < nrows) ; - Assert (j >= 0 && j < ncols) ; + my_assert (i >= 0 && i < nrows) ; + my_assert (j >= 0 && j < ncols) ; // Y (i) += A(i,j) * X (j) MULTADD ; } } // try exhaustion info = GxB_Matrix_Iterator_seek (iterator, pmax) ; - Assert (info == GxB_EXHAUSTED) ; + my_assert (info == GxB_EXHAUSTED) ; } } diff --git a/GraphBLAS/Test/bench3.m b/GraphBLAS/Test/bench3.m new file mode 100644 index 0000000000..311faf2c2a --- /dev/null +++ b/GraphBLAS/Test/bench3.m @@ -0,0 +1,353 @@ +function bench3(longtests) +%BENCH3 test and benchmark qsort and msort + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('\ntest44\n------------------------------------- qsort tests\n') ; + +if (nargin < 1) + longtests = 0 ; +end + +nlist = [10 512 1024 2*1024 4*1024 8*1024 16*1024 32*1024 64*1024 103e3 200e3 1e6 ] ; +if (longtests) + nlist = [nlist 10e6 100e6] ; +end +save = maxNumCompThreads ; + +[save_nthreads save_chunk] = nthreads_get ; +fprintf ('maxNumCompThreads: %d feature_numcores: %d\n', save, ... + feature_numcores) ; +nthreads_max = 32 ; + +rng ('default') ; + +for n = nlist + +fprintf ('\n\n\n\n========================== n %d (%g million)\n', ... + n, n / 1e6) ; + +fprintf ('\n----------------------- qsort 1b\n') ; +% qsort1b is not stable; it used only when I has unique values +I = uint64 (randperm (n))' ; +J = uint64 ((n/10)* rand (n,1)) ; +IJ = [I J] ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJout = sortrows (IJ, 1) ; + t = toc ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + if (nthreads == 1) + t1 = t ; + end +end +tic +[Iout, Jout] = GB_mex_qsort_1b (I, J) ; +t2 = toc ; +fprintf ('built-in: sortrows %g sec qsort1b: %g speedup: %g\n', t1, t2, t1/t2); +assert (isequal ([Iout Jout], IJout)) +clear Iout Jout IJout + +clear tt +fprintf ('\n----------------------- qsort 1: 32 bit\n') ; +I = uint32 ((n/10)* rand (n,1)) ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJout = sortrows (I) ; + t = toc ; + tt (nthreads) = t ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + if (nthreads == 1) + t1 = t ; + end +end +tic +Iout = GB_mex_qsort_1 (I) ; +t2 = toc ; +assert (isequal (Iout, IJout)) ; +clear Iout +fprintf ('built-in: sortrows %g sec qsort1: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort1: 32 bit\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout] = GB_mex_msort_1 (I, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout], IJout)) ; + clear Iout + fprintf ('msort1_32: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end +clear IJout + +fprintf ('\n----------------------- qsort 1: 64 bit\n') ; +I = uint64 (I) ; +clear tt +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJout = sortrows (I) ; + t = toc ; + tt (nthreads) = t ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + if (nthreads == 1) + t1 = t ; + end +end +tic +Iout = GB_mex_qsort_1 (I) ; +t2 = toc ; +assert (isequal (Iout, IJout)) ; +clear Iout +fprintf ('built-in: sortrows %g sec qsort1: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort1: 64 bit\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout] = GB_mex_msort_1 (I, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout], IJout)) ; + clear Iout + fprintf ('msort1_64: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end +clear IJout + +if (n > 200e6) + continue ; +end + +fprintf ('\n----------------------- qsort 2: 32 bit\n') ; +I = uint32 ((n/10)* rand (n,1)) ; +J = uint32 (randperm (n))' ; +IJ = [I J] ; +clear tt +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJout = sortrows (IJ) ; + t = toc ; + tt (nthreads) = t ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + if (nthreads == 1) + t1 = t ; + end +end +tic +[Iout, Jout] = GB_mex_qsort_2 (I, J) ; +t2 = toc ; +assert (isequal ([Iout Jout], IJout)) ; +clear Iout Jout +fprintf ('built-in: sortrows %g sec qsort2: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort2: 32 bit\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout, Jout] = GB_mex_msort_2 (I, J, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout Jout], IJout)) ; + clear Iout Jout + fprintf ('msort2_32: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end +clear IJout + +fprintf ('\n----------------------- qsort 2: 64 bit\n') ; +I = uint64 (I) ; +J = uint64 (J) ; +IJ = [I J] ; +clear tt +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJout = sortrows (IJ) ; + t = toc ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + tt (nthreads) = t ; + if (nthreads == 1) + t1 = t ; + end +end +tic +[Iout, Jout] = GB_mex_qsort_2 (I, J) ; +t2 = toc ; +assert (isequal ([Iout Jout], IJout)) ; +clear Iout Jout +fprintf ('built-in: sortrows %g sec qsort2: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort2: 64 bit\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout, Jout] = GB_mex_msort_2 (I, J, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout Jout], IJout)) ; + clear Iout Jout + fprintf ('msort2_64: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end +clear IJout + +fprintf ('\n----------------------- qsort 3: 32 bit\n') ; +I = uint32 ((n/10)* rand (n,1)) ; +J = uint32 ((n/10)* rand (n,1)) ; +K = uint32 (randperm (n))' ; +IJK = [I J K] ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJKout = sortrows (IJK) ; + t = toc ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + if (nthreads == 1) + t1 = t ; + end +end +for trials = 1:10 +tic +[Iout, Jout, Kout] = GB_mex_qsort_3 (I, J, K) ; +t2 = toc ; +end +assert (isequal ([Iout Jout Kout], IJKout)) +clear Iout Jout Kout +fprintf ('built-in: sortrows %g sec qsort3: %g speedup: %g\n', t1, t2, t1/t2) ; +for trials = 1:10 +tic +[Iout, Jout, Kout] = GB_mex_bsort (I, J, K) ; +t2 = toc ; +end +assert (isequal ([Iout Jout Kout], IJKout)) +clear Iout Jout Kout +fprintf ('built-in: sortrows %g sec bsort: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort3: 32\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout, Jout, Kout] = GB_mex_msort_3 (I, J, K, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout Jout Kout], IJKout)) ; + clear Iout Jout Kout + fprintf ('msort3_32: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end + +clear IJKout + +fprintf ('\n----------------------- qsort 3: 64 bit\n') ; +I = uint64 (I) ; +J = uint64 (J) ; +K = uint64 (K) ; +IJK = [I J K] ; +clear tt +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + maxNumCompThreads (nthreads) ; + tic + IJKout = sortrows (IJK) ; + t = toc ; + fprintf ('builtin: %2d threads: time %g\n', nthreads, t) ; + tt (nthreads) = t ; + if (nthreads == 1) + t1 = t ; + end +end +for trials = 1:10 +tic +[Iout, Jout, Kout] = GB_mex_qsort_3 (I, J, K) ; +t2 = toc ; +end +assert (isequal ([Iout Jout Kout], IJKout)) +clear Iout Jout Kout +fprintf ('built-in: sortrows %g sec qsort3: %g speedup: %g\n', t1, t2, t1/t2); +for trials = 1:10 +tic +[Iout, Jout, Kout] = GB_mex_bsort (I, J, K) ; +t2 = toc ; +end +assert (isequal ([Iout Jout Kout], IJKout)) +clear Iout Jout Kout +fprintf ('built-in: sortrows %g sec bsort: %g speedup: %g\n', t1, t2, t1/t2) ; + +fprintf ('\nmsort3: 64\n') ; +for nthreads = [1 2 4 8 16 20 32 40 48 64 128 256] + if (nthreads > nthreads_max) + break ; + end + tic + [Iout, Jout, Kout] = GB_mex_msort_3 (I, J, K, nthreads) ; + tp = toc ; + if (nthreads == 1) + tp1 = tp ; + end + assert (isequal ([Iout Jout Kout], IJKout)) ; + clear Iout Jout Kout + fprintf ('msort3_64: %3d: %10.4g ', nthreads, tp) ; + fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; + fprintf ('speedup vs built-in: %8.3f\n', tt (nthreads) / tp) ; +end +clear IJKout + +end + +fprintf ('\ntest44: all tests passed\n') ; +nthreads_set (save_nthreads, save_chunk) ; + +maxNumCompThreads (save) ; + diff --git a/GraphBLAS/Test/debug_off.m b/GraphBLAS/Test/debug_off.m index ffb1ee0db7..0cf69e2ab2 100644 --- a/GraphBLAS/Test/debug_off.m +++ b/GraphBLAS/Test/debug_off.m @@ -1,7 +1,7 @@ function debug_off %DEBUG_OFF turn off malloc debugging -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_debug diff --git a/GraphBLAS/Test/debug_on.m b/GraphBLAS/Test/debug_on.m index 01256655a9..a99960a0db 100644 --- a/GraphBLAS/Test/debug_on.m +++ b/GraphBLAS/Test/debug_on.m @@ -1,7 +1,7 @@ function debug_on %DEBUG_ON turn on malloc debugging -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_debug diff --git a/GraphBLAS/Test/factory/GB_bsort_template.c b/GraphBLAS/Test/factory/GB_bsort_template.c new file mode 100644 index 0000000000..9bcb725549 --- /dev/null +++ b/GraphBLAS/Test/factory/GB_bsort_template.c @@ -0,0 +1,115 @@ +//------------------------------------------------------------------------------ +// GB_qsort_template: quicksort of a K-by-n array +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This file is #include'd in GB_qsort*.c to create specific versions for +// different kinds of sort keys and auxiliary arrays. Requires an inline or +// macro definition of the GB_lt function. The GB_lt function has the form +// GB_lt (A,i,B,j) and returns true if A[i] < B[j]. + +// All of these functions are static; there will be versions of them in each +// variant of GB_qsort*, and given unique names via #define's in the +// #include'ing file. + +//------------------------------------------------------------------------------ +// GB_partition: use a pivot to partition an array +//------------------------------------------------------------------------------ + +// C.A.R Hoare partition method, partitions an array in-place via a pivot. +// k = partition (A, n) partitions A [0:n-1] such that all entries in +// A [0:k] are <= all entries in A [k+1:n-1]. + +static inline int64_t GB_partition +( + GB_BSORT_T A [ ], + const int64_t n, // size of the array(s) to partition + uint64_t *seed // random number seed, modified on output +) +{ + + // select a pivot at random + uint64_t pivot = GB_rand (seed) % ((uint64_t) n) ; + + // get the Pivot + GB_BSORT_T Pivot [1] ; + Pivot [0] = A [pivot] ; + + // At the top of the while loop, A [left+1...right-1] is considered, and + // entries outside this range are in their proper place and not touched. + // Since the input specification of this function is to partition A + // [0..n-1], left must start at -1 and right must start at n. + int64_t left = -1 ; + int64_t right = n ; + + // keep partitioning until the left and right sides meet + while (true) + { + // loop invariant: A [0..left] < pivot and A [right..n-1] > pivot, + // so the region to be considered is A [left+1 ... right-1]. + + // increment left until finding an entry A [left] >= pivot + do { left++ ; } while (GB_lt (A, left, Pivot, 0)) ; + + // decrement right until finding an entry A [right] <= pivot + do { right-- ; } while (GB_lt (Pivot, 0, A, right)) ; + + // now A [0..left-1] < pivot and A [right+1..n-1] > pivot, but + // A [left] > pivot and A [right] < pivot, so these two entries + // are out of place and must be swapped. + + // However, if the two sides have met, the partition is finished. + if (left >= right) + { + // A has been partitioned into A [0:right] and A [right+1:n-1]. + // k = right+1, so A is split into A [0:k-1] and A [k:n-1]. + return (right + 1) ; + } + + // since A [left] > pivot and A [right] < pivot, swap them + GB_swap (A, left, right) ; + + // after the swap this condition holds: + // A [0..left] < pivot and A [right..n-1] > pivot + } +} + +//------------------------------------------------------------------------------ +// GB_quicksort: recursive single-threaded quicksort +//------------------------------------------------------------------------------ + +static void GB_quicksort // sort A [0:n-1] +( + GB_BSORT_T A [ ], // array(s) to sort + const int64_t n, // size of the array(s) to sort + uint64_t *seed // random number seed +) +{ + + if (n < 8) + { + // in-place insertion sort on A [0:n-1], where n is small + for (int64_t k = 1 ; k < n ; k++) + { + for (int64_t j = k ; j > 0 && GB_lt (A, j, A, j-1) ; j--) + { + // swap A [j-1] and A [j] + GB_swap (A, j-1, j) ; + } + } + } + else + { + // partition A [0:n-1] into A [0:k-1] and A [k:n-1] + int64_t k = GB_partition (A, n, seed) ; + + // sort each partition + GB_quicksort (A, k, seed) ; // sort A [0:k-1] + GB_quicksort (A + k, n-k, seed) ; // sort A [k:n-1] + } +} + diff --git a/GraphBLAS/Test/feature_numcores.m b/GraphBLAS/Test/feature_numcores.m index 7fb6f98256..c441c96b3b 100644 --- a/GraphBLAS/Test/feature_numcores.m +++ b/GraphBLAS/Test/feature_numcores.m @@ -1,7 +1,7 @@ function ncores = feature_numcores %FEATURE_NUMCORES determine # of cores the system has -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ; diff --git a/GraphBLAS/Test/grb_clear_coverage.m b/GraphBLAS/Test/grb_clear_coverage.m index cfab2cc041..4f5516c306 100644 --- a/GraphBLAS/Test/grb_clear_coverage.m +++ b/GraphBLAS/Test/grb_clear_coverage.m @@ -1,7 +1,7 @@ function c = grb_clear_coverage %GRB_CLEAR_COVERAGE clear current statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 try diff --git a/GraphBLAS/Test/grb_get_coverage.m b/GraphBLAS/Test/grb_get_coverage.m index 2e55cc7329..62e265b931 100644 --- a/GraphBLAS/Test/grb_get_coverage.m +++ b/GraphBLAS/Test/grb_get_coverage.m @@ -1,7 +1,7 @@ function c = grb_get_coverage %GRB_GET_COVERAGE return current statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 c = 0 ; diff --git a/GraphBLAS/Test/grbinfo.m b/GraphBLAS/Test/grbinfo.m index 1a34fb4897..2ff1d26f17 100644 --- a/GraphBLAS/Test/grbinfo.m +++ b/GraphBLAS/Test/grbinfo.m @@ -3,7 +3,7 @@ % % nthreads = grbinfo -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [nthreads, format, hyper_switch, ... diff --git a/GraphBLAS/Test/grow_demo.c b/GraphBLAS/Test/grow_demo.c deleted file mode 100644 index be3f9db1be..0000000000 --- a/GraphBLAS/Test/grow_demo.c +++ /dev/null @@ -1,258 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/Demo/Program/grow_demo.c: grow a matrix row-by-row -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Reads in a matrix A, then does C = A one row at a time. - -#include "graphblas_demos.h" -#include "simple_rand.c" -#include "usercomplex.h" -#include "usercomplex.c" -#include "wathen.c" -#include "get_matrix.c" -#include "random_matrix.c" -#include "import_test.c" -#include "read_matrix.c" - -#include "omp.h" -#if defined ( _OPENMP ) -#define WALLCLOCK omp_get_wtime ( ) -#else -#define WALLCLOCK 0 -#endif - -// macro used by OK(...) to free workspace if an error occurs -#undef FREE_ALL -#define FREE_ALL \ - GrB_Matrix_free (&A) ; \ - GrB_Matrix_free (&C) ; \ - GrB_Matrix_free (&T) ; \ - GrB_Matrix_free (&W) ; \ - GrB_Vector_free (&w) ; \ - -GrB_Info check_result (GrB_Matrix A1, GrB_Matrix C1, GrB_BinaryOp eq) ; -GrB_Info check_result (GrB_Matrix A1, GrB_Matrix C1, GrB_BinaryOp eq) -{ - double t = WALLCLOCK ; - GrB_Info info ; - GrB_Matrix A = NULL, C = NULL, T = NULL, W = NULL ; - GrB_Vector w = NULL ; - GrB_Index anvals, cnvals, tnvals, anrows, ancols ; - OK (GrB_Matrix_nrows (&anrows, A1)) ; - OK (GrB_Matrix_ncols (&ancols, A1)) ; - OK (GrB_Matrix_nvals (&anvals, A1)) ; - OK (GrB_Matrix_nvals (&cnvals, C1)) ; - CHECK (anvals == cnvals, GrB_PANIC) ; - OK (GrB_Matrix_new (&T, GrB_BOOL, anrows, ancols)) ; - OK (GrB_eWiseMult (T, NULL, NULL, eq, A1, C1, NULL)) ; - // OK (GxB_print (T, 2)) ; - OK (GrB_Matrix_nvals (&tnvals, T)) ; - CHECK (anvals == tnvals, GrB_PANIC) ; - bool ok = true ; - OK (GrB_reduce (&ok, NULL, GrB_LAND_MONOID_BOOL, T, NULL)) ; - CHECK (ok, GrB_PANIC) ; - t = (WALLCLOCK - t) ; - FREE_ALL ; - printf ("A and C match, time %g\n", t) ; -} - -int main (int argc, char **argv) -{ - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Matrix A = NULL, C = NULL, T = NULL, W = NULL ; - GrB_Vector w = NULL ; - GrB_Info info ; - - OK (GrB_init (GrB_NONBLOCKING)) ; - int nthreads ; - OK (GxB_Global_Option_get (GxB_GLOBAL_NTHREADS, &nthreads)) ; - fprintf (stderr, "grow demo: nthreads %d\n", nthreads) ; - - //-------------------------------------------------------------------------- - // get A matrix - //-------------------------------------------------------------------------- - - OK (get_matrix (&A, argc, argv, false, false, false)) ; - GrB_Index anrows, ancols ; - OK (GrB_Matrix_nrows (&anrows, A)) ; - OK (GrB_Matrix_ncols (&ancols, A)) ; - - int type_code ; - OK (GrB_Matrix_get_INT32 (A, &type_code, GrB_EL_TYPE_CODE)) ; - GrB_Type atype = NULL ; - // OK (GxB_print (A, 5)) ; - // printf ("type_code: %d\n", type_code) ; - GrB_BinaryOp eq = NULL ; - - switch (type_code) - { - case GrB_BOOL_CODE : atype = GrB_BOOL ; eq = GrB_EQ_BOOL ; break ; - case GrB_INT8_CODE : atype = GrB_INT8 ; eq = GrB_EQ_INT8 ; break ; - case GrB_UINT8_CODE : atype = GrB_UINT8 ; eq = GrB_EQ_UINT8 ; break ; - case GrB_INT16_CODE : atype = GrB_INT16 ; eq = GrB_EQ_INT16 ; break ; - case GrB_UINT16_CODE : atype = GrB_UINT16 ; eq = GrB_EQ_UINT16 ; break ; - case GrB_INT32_CODE : atype = GrB_INT32 ; eq = GrB_EQ_INT32 ; break ; - case GrB_UINT32_CODE : atype = GrB_UINT32 ; eq = GrB_EQ_UINT32 ; break ; - case GrB_INT64_CODE : atype = GrB_INT64 ; eq = GrB_EQ_INT64 ; break ; - case GrB_UINT64_CODE : atype = GrB_UINT64 ; eq = GrB_EQ_UINT64 ; break ; - case GrB_FP32_CODE : atype = GrB_FP32 ; eq = GrB_EQ_FP32 ; break ; - case GrB_FP64_CODE : atype = GrB_FP64 ; eq = GrB_EQ_FP64 ; break ; - case GxB_FC32_CODE : atype = GxB_FC32 ; eq = GxB_EQ_FC32 ; break ; - case GxB_FC64_CODE : atype = GxB_FC64 ; eq = GxB_EQ_FC64 ; break ; - default : ; - } - - // OK (GxB_print (atype, 5)) ; - CHECK (atype != NULL, GrB_INVALID_VALUE) ; - OK (GxB_print (A, 1)) ; - - //-------------------------------------------------------------------------- - // C = A, one row at a time - //-------------------------------------------------------------------------- - - OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; - OK (GrB_Vector_new (&w, atype, ancols)) ; - // OK (GrB_set (GrB_GLOBAL, true, GxB_BURBLE)) ; - OK (GrB_set (C, false, GxB_HYPER_HASH)) ; - OK (GrB_set (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; - OK (GrB_set (w, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; - // printf ("\n\nC empty:\n") ; - // OK (GxB_print (C, 1)) ; - - double t, tt [4] = {0, 0, 0, 0}, t2 [4] = {0, 0, 0, 0} ; - tt [0] = WALLCLOCK ; - - for (int64_t i = 0 ; i < anrows ; i++) - { - // printf ("\n\ni = %ld\n", i) ; - - // w = A (i,:), using A' via the descriptor - t = WALLCLOCK ; - OK (GrB_Col_extract (w, NULL, NULL, A, GrB_ALL, ancols, i, - GrB_DESC_T0)) ; - tt [1] += (WALLCLOCK - t) ; - // OK (GxB_print (w, 3)) ; - - // C (i,:) = w - t = WALLCLOCK ; - OK (GrB_Row_assign (C, NULL, NULL, w, i, GrB_ALL, ancols, NULL)) ; - tt [2] += (WALLCLOCK - t) ; - - // ensure C is finished - t = WALLCLOCK ; - OK (GrB_wait (C, GrB_MATERIALIZE)) ; - tt [3] += (WALLCLOCK - t) ; - // OK (GxB_print (C, 1)) ; - } - - OK (GrB_set (GrB_GLOBAL, false, GxB_BURBLE)) ; - // OK (GxB_print (C, 1)) ; - - tt [0] = WALLCLOCK - tt [0] ; - printf ("one row at a time:\n") ; - printf ("total time: %g\n", tt [0]) ; - printf ("extract: %g\n", tt [1]) ; - printf ("assign: %g\n", tt [2]) ; - printf ("wait: %g\n", tt [3]) ; - - // check to see if A and C are equal - OK (check_result (A, C, eq)) ; - - //-------------------------------------------------------------------------- - // C = A, multiple rows at a time - //-------------------------------------------------------------------------- - - // OK (GrB_set (GrB_GLOBAL, true, GxB_BURBLE)) ; - GrB_Matrix_free (&C) ; - OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; - OK (GrB_set (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; - - t2 [0] = WALLCLOCK ; - int64_t i1 = 0 ; - int64_t ilast = anrows - 1 ; - while (i1 <= ilast) - { - // determine the rows i1:i2 of A to append - int64_t irows = (ilast - i1) / 2 ; - if (irows == 0) irows = 1 ; - int64_t i2 = i1 + irows - 1 ; - if (i2 > ilast) i2 = ilast ; - irows = i2 - i1 + 1 ; - // printf ("i1: %ld i2: %ld irows %ld ilast: %ld\n", - // i1, i2, irows, ilast) ; - - // W = A (i1:i2,:) - t = WALLCLOCK ; - OK (GrB_Matrix_new (&W, atype, irows, ancols)) ; - OK (GrB_set (W, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; - GrB_Index Icolon [3] ; - Icolon [GxB_BEGIN] = i1 ; - Icolon [GxB_INC ] = 1 ; - Icolon [GxB_END ] = i2 ; - // OK (GxB_print (W, 3)) ; - info = GrB_extract (W, NULL, NULL, A, Icolon, GxB_RANGE, - GrB_ALL, ancols, NULL) ; - // printf ("got here: %d\n", info) ; - OK (info) ; - t2 [1] += (WALLCLOCK - t) ; - // OK (GxB_print (W, 3)) ; - - // C (i1:i2,:) = W - t = WALLCLOCK ; - OK (GrB_assign (C, NULL, NULL, W, Icolon, GxB_RANGE, GrB_ALL, ancols, - NULL)) ; - t2 [2] += (WALLCLOCK - t) ; - - // ensure C is finished - t = WALLCLOCK ; - OK (GrB_wait (C, GrB_MATERIALIZE)) ; - t2 [3] += (WALLCLOCK - t) ; - // OK (GxB_print (C, 1)) ; - - GrB_Matrix_free (&W) ; - - i1 += irows ; - } - OK (GrB_set (GrB_GLOBAL, false, GxB_BURBLE)) ; - - t2 [0] = WALLCLOCK - t2 [0] ; - printf ("\nmany rows at a time:\n") ; - printf ("total time: %g\n", t2 [0]) ; - printf ("extract: %g\n", t2 [1]) ; - printf ("assign: %g\n", t2 [2]) ; - printf ("wait: %g\n", t2 [3]) ; - - // check to see if A and C are equal - OK (check_result (A, C, eq)) ; - - //-------------------------------------------------------------------------- - // C = A, using dup (1 threads and all threads) - //-------------------------------------------------------------------------- - - printf ("\nsingle call to dup:\n") ; - for (int trial = 1 ; trial <= 2 ; trial++) - { - int threads ; - GrB_get (GrB_GLOBAL, &threads, GxB_GLOBAL_NTHREADS) ; - GrB_free (&T) ; - t = WALLCLOCK ; - OK (GrB_Matrix_dup (&T, A)) ; - t = (WALLCLOCK - t) ; - printf ("dup: %g (%d threads)\n", t, threads) ; - GrB_set (GrB_GLOBAL, (int) 1, GxB_GLOBAL_NTHREADS) ; - } - - printf ("grow_demo: all tests passed\n") ; - FREE_ALL ; - GrB_finalize ( ) ; - return (0) ; -} - diff --git a/GraphBLAS/Test/irand.m b/GraphBLAS/Test/irand.m index 14e04e3dcd..fb9621f586 100644 --- a/GraphBLAS/Test/irand.m +++ b/GraphBLAS/Test/irand.m @@ -8,7 +8,7 @@ % % if imin > imax, the ranges are swapped. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 4) diff --git a/GraphBLAS/Test/isequal_roundoff.m b/GraphBLAS/Test/isequal_roundoff.m index aa5bfc6fb2..8ec51b044b 100644 --- a/GraphBLAS/Test/isequal_roundoff.m +++ b/GraphBLAS/Test/isequal_roundoff.m @@ -5,7 +5,7 @@ % tol = 64*eps if not present. NaNs and Infs are ignored in the % tol, but the NaN and +/-Inf pattern must be the same. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % if (~isequal (GB_spec_type (A), GB_spec_type (B))) diff --git a/GraphBLAS/Test/jit_reset.m b/GraphBLAS/Test/jit_reset.m index 3055fe7dd8..b1ce416a6c 100644 --- a/GraphBLAS/Test/jit_reset.m +++ b/GraphBLAS/Test/jit_reset.m @@ -1,7 +1,7 @@ function jit_reset %JIT_RESET turn off the JIT and then set it back to its original state -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 c = GB_mex_jit_control ; diff --git a/GraphBLAS/Test/logstat.m b/GraphBLAS/Test/logstat.m index a5c0a5e330..0a9a07e507 100644 --- a/GraphBLAS/Test/logstat.m +++ b/GraphBLAS/Test/logstat.m @@ -1,7 +1,7 @@ -function logstat (testscript, threads, jit_controls, factory_controls) +function logstat (testscript, threads, jit_controls, factory_controls, pji_controls) %LOGSTAT run a GraphBLAS test and log the results to log.txt % -% logstat (testscript, threads, jit_controls, factory_controls) +% logstat (testscript, threads, jit_controls, factory_controls, pji_controls) % % threads: defaults to threads{1} = [4 1], which uses 4 threads and a tiny % chunk size of 1. @@ -14,8 +14,11 @@ function logstat (testscript, threads, jit_controls, factory_controls) % % factory_controls: 1 to enable the factory kernels, 0 to disable them. % If empty, default is enabled. +% +% pji_controls: a list of integers in the range 0 to 7, where each integer +% is a 3-bit number with [pji]_control. Defaults to [0] -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_finalize ; @@ -48,7 +51,18 @@ function logstat (testscript, threads, jit_controls, factory_controls) % factory_controls {3} = 0 ; % factory off end +% default pji_controls +if (nargin < 5) + pji_controls = [ 0 ] ; +end + +if (0) + % enable this to run with all pji_controls + pji_controls = 0:7 ; +end + if (0) + % enable this to run with all JIT / factory controls jall = {4,3,2,1,0,4,3,2,1,0} ; fall = {1,1,1,1,1,0,0,0,0,0} ; jit_controls = jall ; @@ -76,136 +90,152 @@ function logstat (testscript, threads, jit_controls, factory_controls) catch n = 0 ; end +if (nargin == 0) + fprintf ( 'total blocks: %d\n', n) ; + f = fopen ('log.txt', 'a') ; + fprintf (f, 'total blocks: %d\n', n) ; + fclose (f) ; +end -for control_trial = 1:length (jit_controls) - for trial = 1:length (threads) +% f = fopen ('log.txt', 'a') ; +% fprintf (f, '\n') ; + +for pji_control_trials = 1:length(pji_controls) + + clear ctrl + pji_control = pji_controls (pji_control_trials) ; + p_control = 32 * (bitand (pji_control, 4) ~= 0) + 32 ; + j_control = 32 * (bitand (pji_control, 2) ~= 0) + 32 ; + i_control = 32 * (bitand (pji_control, 1) ~= 0) + 32 ; + ctrl.p_control = p_control ; + ctrl.j_control = j_control ; + ctrl.i_control = i_control ; + ctrl = GB_mex_control (ctrl) ; + + for control_trial = 1:length (jit_controls) + for trial = 1:length (threads) + + GB_mex_finalize ; + jit_control = jit_controls {control_trial} ; + factory_control = factory_controls {control_trial} ; + if (~isempty (jit_control)) + GB_mex_jit_control (jit_control) ; + end + if (isempty (factory_control)) + factory_control = 1 ; + end + GB_mex_factory_control (factory_control) ; + fprintf ('\nTrial: jit: %d factory: %d pji: %d:(%d,%d,%d)\n', ... + jit_control, factory_control, pji_control, ... + p_control, j_control, i_control) ; - GB_mex_finalize ; - jit_control = jit_controls {control_trial} ; - factory_control = factory_controls {control_trial} ; - if (~isempty (jit_control)) - GB_mex_jit_control (jit_control) ; - end - if (isempty (factory_control)) - factory_control = 1 ; - end - GB_mex_factory_control (factory_control) ; - fprintf ('\nTrial: jit: %d factory: %d\n', ... - jit_control, factory_control) ; + clast = grb_get_coverage ; - clast = grb_get_coverage ; + nthreads_and_chunk = threads {trial} ; + nthreads = nthreads_and_chunk (1) ; + chunk = nthreads_and_chunk (2) ; + nthreads_set (nthreads, chunk) ; - nthreads_and_chunk = threads {trial} ; - nthreads = nthreads_and_chunk (1) ; - chunk = nthreads_and_chunk (2) ; - nthreads_set (nthreads, chunk) ; + if (nargin == 0) + f = fopen ('log.txt', 'a') ; + fprintf (f, '\n----------------------------------------------'); + if (debug) + fprintf (f, ' [debug]') ; + end + if (compact) + fprintf (f, ' [compact]') ; + end + if (malloc) + fprintf (f, ' [malloc]') ; + end + if (covered) + fprintf (f, ' [cover]') ; + end + fprintf (f, '\n') ; + fclose (f) ; + return + end + + fprintf ('\n======== test: %-10s ', testscript) ; - if (nargin == 0) - f = fopen ('log.txt', 'a') ; - fprintf (f, '\n----------------------------------------------') ; if (debug) - fprintf (f, ' [debug]') ; + fprintf (' [debug]') ; end if (compact) - fprintf (f, ' [compact]') ; + fprintf (' [compact]') ; end if (malloc) - fprintf (f, ' [malloc]') ; + fprintf (' [malloc]') ; end if (covered) - fprintf (f, ' [cover]') ; + fprintf (' [cover]') ; end - fprintf (f, '\n') ; - fclose (f) ; - return - end - - fprintf ('\n======== test: %-10s ', testscript) ; - - if (debug) - fprintf (' [debug]') ; - end - if (compact) - fprintf (' [compact]') ; - end - if (malloc) - fprintf (' [malloc]') ; - end - if (covered) - fprintf (' [cover]') ; - end - fprintf (' [nthreads: %d chunk: %g]', nthreads, chunk) ; - fprintf (' jit: %d', GB_mex_jit_control) ; - fprintf (' factory: %d\n', GB_mex_factory_control) ; - - t1 = tic ; - runtest (testscript) - t = toc (t1) ; + fprintf (' [nthreads: %d chunk: %g]', nthreads, chunk) ; + fprintf (' jit: %d', GB_mex_jit_control) ; + fprintf (' factory: %d\n', GB_mex_factory_control) ; - f = fopen ('log.txt', 'a') ; + t1 = tic ; + runtest (testscript) + t = toc (t1) ; - s = datestr (now) ; + f = fopen ('log.txt', 'a') ; - % trim the year from the date - s = s ([1:6 12:end]) ; + s = datestr (now) ; - fprintf ( '%s %-11s %7.1f sec ', s, testscript, t) ; - fprintf (f, '%s %-11s %7.1f sec ', s, testscript, t) ; + % trim the year from the date + s = s ([1:6 12:end]) ; - if (test_coverage) + fprintf ( '%s %-11s %d:(%d,%d,%d) %7.1f sec', s, testscript, ... + pji_control, p_control, j_control, i_control, t) ; + fprintf (f, '%s %-11s %d:(%d,%d,%d) %7.1f sec', s, testscript, ... + pji_control, p_control, j_control, i_control, t) ; -% GraphBLAS_grbcovs {end+1} = GraphBLAS_grbcov (1:n) ; -% GraphBLAS_scripts {end+1} = sprintf ('%s.%d.%d.%d', testscript, ... -% jit_control, factory_control, trial) ; -% GraphBLAS_times {end+1} = t ; -% save grbstat GraphBLAS_debug GraphBLAS_grbcov -% GraphBLAS_grbcovs GraphBLAS_scripts GraphBLAS_times + if (test_coverage) - if (isempty (GraphBLAS_debug)) - GraphBLAS_debug = false ; - end - if (~isempty (GraphBLAS_grbcov)) - c = sum (GraphBLAS_grbcov > 0) ; - if (c == n) - % full coverage reached with this test - fprintf ( '%5d: all %5d full 100%% %8.2f/s', ... - c - clast, n, (c-clast) / t) ; - fprintf (f, '%5d: all %5d full 100%% %8.2f/s', ... - c - clast, n, (c-clast) / t) ; - elseif (c == clast) - % no new coverage at all with this test - fprintf ( ' : %5d of %5d %5.1f%%', ... - n-c, n, 100 * (c/n)) ; - fprintf (f, ' : %5d of %5d %5.1f%%', ... - n-c, n, 100 * (c/n)) ; - else - fprintf ( '%5d: %5d of %5d %5.1f%% %8.2f/s', ... - c - clast, n-c, n, 100 * (c/n), (c-clast) / t) ; - fprintf (f, '%5d: %5d of %5d %5.1f%% %8.2f/s', ... - c - clast, n-c, n, 100 * (c/n), (c-clast) / t) ; - end - if (debug) - fprintf (' [debug]') ; - end - if (compact) - fprintf (' [compact]') ; + if (isempty (GraphBLAS_debug)) + GraphBLAS_debug = false ; end - if (malloc) - fprintf (' [malloc]') ; - end - if (covered) - fprintf (' [cover]') ; + if (~isempty (GraphBLAS_grbcov)) + c = sum (GraphBLAS_grbcov > 0) ; + if (c == n) + % full coverage reached with this test + fprintf ( '%5d: all 100%% %7.1f/s', ... + c - clast, (c-clast) / t) ; + fprintf (f, '%5d: all 100%% %7.1f/s', ... + c - clast, (c-clast) / t) ; + elseif (c == clast) + % no new coverage at all with this test + fprintf ( ' : %5d %4.1f%%', n-c, 100 * (c/n)) ; + fprintf (f, ' : %5d %4.1f%%', n-c, 100 * (c/n)) ; + else + crel = 100 * (c/n) ; + if (crel < 100 && crel > 99.9) + crel = 99.9 ; + end + fprintf ( '%5d: %5d %4.1f%% %7.1f/s', ... + c - clast, n-c, crel, (c-clast) / t) ; + fprintf (f, '%5d: %5d %4.1f%% %7.1f/s', ... + c - clast, n-c, crel, (c-clast) / t) ; + end + if (debug) + fprintf (' [debug]') ; + end + if (compact) + fprintf (' [compact]') ; + end + if (malloc) + fprintf (' [malloc]') ; + end + if (covered) + fprintf (' [cover]') ; + end end end - end - fprintf ( '\n') ; - fprintf (f, '\n') ; - fclose (f) ; + fprintf ( '\n') ; + fprintf (f, '\n') ; + fclose (f) ; + end end end -% f = fopen ('log.txt', 'a') ; -% fprintf (f,'\n') ; -% fclose (f) ; - diff --git a/GraphBLAS/Test/nthreads_get.m b/GraphBLAS/Test/nthreads_get.m index a2cc91294d..ac903cfc6b 100644 --- a/GraphBLAS/Test/nthreads_get.m +++ b/GraphBLAS/Test/nthreads_get.m @@ -3,7 +3,7 @@ % % [nthreads chunk] = nthreads_get -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_nthreads diff --git a/GraphBLAS/Test/nthreads_set.m b/GraphBLAS/Test/nthreads_set.m index 4409be7de2..413b384ff8 100644 --- a/GraphBLAS/Test/nthreads_set.m +++ b/GraphBLAS/Test/nthreads_set.m @@ -6,7 +6,7 @@ % If nthreads is empty, or if no input arguments, nthreads is set to 1. % If chunk is empty, or if no input arguments, chunk is not modified. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_nthreads diff --git a/GraphBLAS/Test/runtest.m b/GraphBLAS/Test/runtest.m index 25959fa4ad..444cb6abd6 100644 --- a/GraphBLAS/Test/runtest.m +++ b/GraphBLAS/Test/runtest.m @@ -1,7 +1,7 @@ function runtest (testscript) %RUNTEST run a single GraphBLAS test -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 eval (testscript) ; diff --git a/GraphBLAS/Test/spok/private/spok_invalid.c b/GraphBLAS/Test/spok/private/spok_invalid.c index 08e5fb4492..9d15a59b59 100644 --- a/GraphBLAS/Test/spok/private/spok_invalid.c +++ b/GraphBLAS/Test/spok/private/spok_invalid.c @@ -14,7 +14,8 @@ void mexFunction const mxArray *pargin [ ] ) { - SPOK_INT *Ap, *Ai ; + mwIndex *Ap ; + mwIndex *Ai ; double *Ax ; int kind ; @@ -32,8 +33,8 @@ void mexFunction /* a sparse 2-by-2 matrix with invalid column pointers*/ pargout [0] = mxCreateSparse (2, 2, 4, mxREAL) ; - Ap = (mwSignedIndex *) mxGetJc (pargout [0]) ; - Ai = (mwSignedIndex *) mxGetIr (pargout [0]) ; + Ap = (mwIndex *) mxGetJc (pargout [0]) ; + Ai = (mwIndex *) mxGetIr (pargout [0]) ; Ax = mxGetPr (pargout [0]) ; Ap [0] = 2 ; Ap [1] = 2 ; @@ -45,8 +46,8 @@ void mexFunction /* a sparse 1-by-1 matrix with one explicit zero */ pargout [0] = mxCreateSparse (1, 1, 1, mxREAL) ; - Ap = (mwSignedIndex *) mxGetJc (pargout [0]) ; - Ai = (mwSignedIndex *) mxGetIr (pargout [0]) ; + Ap = (mwIndex *) mxGetJc (pargout [0]) ; + Ai = (mwIndex *) mxGetIr (pargout [0]) ; Ax = mxGetPr (pargout [0]) ; Ap [0] = 0 ; Ap [1] = 1 ; @@ -59,8 +60,8 @@ void mexFunction /* a sparse 2-by-2 matrix with jumbled row indices */ pargout [0] = mxCreateSparse (2, 2, 4, mxREAL) ; - Ap = (mwSignedIndex *) mxGetJc (pargout [0]) ; - Ai = (mwSignedIndex *) mxGetIr (pargout [0]) ; + Ap = (mwIndex *) mxGetJc (pargout [0]) ; + Ai = (mwIndex *) mxGetIr (pargout [0]) ; Ax = mxGetPr (pargout [0]) ; Ap [0] = 0 ; Ap [1] = 2 ; diff --git a/GraphBLAS/Test/spok/spok_mex.c b/GraphBLAS/Test/spok/spok_mex.c index 45e8c55c05..e3d0ec511d 100644 --- a/GraphBLAS/Test/spok/spok_mex.c +++ b/GraphBLAS/Test/spok/spok_mex.c @@ -29,7 +29,7 @@ void mexFunction const mxArray *pargin [ ] ) { - SPOK_INT *Ap, *Ai ; + mwIndex *Ap, *Ai ; double *Ax, *Az ; char *As ; SPOK_INT i, j, p, njumbled, nzeros, m, n, nzmax ; @@ -55,8 +55,8 @@ void mexFunction return ; } - Ap = (SPOK_INT *) mxGetJc (pargin [0]) ; - Ai = (SPOK_INT *) mxGetIr (pargin [0]) ; + Ap = (mwIndex *) mxGetJc (pargin [0]) ; + Ai = (mwIndex *) mxGetIr (pargin [0]) ; m = mxGetM (pargin [0]) ; n = mxGetN (pargin [0]) ; nzmax = mxGetNzmax (pargin [0]) ; @@ -93,8 +93,9 @@ void mexFunction } } - switch (spok (m, n, nzmax, Ap, Ai, Ax, Az, As, &njumbled, &nzeros)) - { + switch (spok (m, n, nzmax, (int64_t *) Ap, (int64_t *) Ai, Ax, Az, As, + &njumbled, &nzeros)) + { case SPOK_FATAL_M: ERROR ("negative number of rows") ; diff --git a/GraphBLAS/Test/stat.m b/GraphBLAS/Test/stat.m index 349d2c7fcd..66a58757ae 100644 --- a/GraphBLAS/Test/stat.m +++ b/GraphBLAS/Test/stat.m @@ -1,7 +1,7 @@ function [d nthreads] = stat %STAT report status of statement coverage and malloc debugging -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 global GraphBLAS_debug GraphBLAS_grbcov diff --git a/GraphBLAS/Test/test01.m b/GraphBLAS/Test/test01.m index 588e1a84b6..c52fb03acf 100644 --- a/GraphBLAS/Test/test01.m +++ b/GraphBLAS/Test/test01.m @@ -1,7 +1,7 @@ function test01 %TEST01 test GraphBLAS error handling -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test2 ; diff --git a/GraphBLAS/Test/test02.m b/GraphBLAS/Test/test02.m index db1ba39591..3265ded7c6 100644 --- a/GraphBLAS/Test/test02.m +++ b/GraphBLAS/Test/test02.m @@ -1,7 +1,7 @@ function test02 %TEST02 test GrB_*_dup -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; @@ -27,6 +27,7 @@ assert (GB_spok (A.pattern) == 1) ; for k2 = 1:length (types) + fprintf ('.') ; ctype = types {k2} ; % typecast to type of C @@ -43,7 +44,7 @@ C2 = GB_mex_dup (A, ctype, 1) ; C2_matrix = full (C2.matrix) ; C2_pattern = full (GB_spones_mex (C2.matrix)) ; - assert (isequal (C, C2)) ; + assert (GB_isequal_ignore_32 (C, C2)) ; assert (GB_spok (1*C2.matrix) == 1) ; end @@ -74,5 +75,5 @@ format GB_builtin_complex_set (true) ; -fprintf ('test02: all typecast and copy tests passed\n') ; +fprintf ('\ntest02: all typecast and copy tests passed\n') ; diff --git a/GraphBLAS/Test/test04.m b/GraphBLAS/Test/test04.m index 5fbe1251be..5d5ae45b9f 100644 --- a/GraphBLAS/Test/test04.m +++ b/GraphBLAS/Test/test04.m @@ -1,7 +1,7 @@ function test04 %TEST04 test and demo for accumulator/mask and transpose -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n-------------------- simple mask and transpose tests\n') ; @@ -55,7 +55,6 @@ A = Z ; fprintf ('C3 = C + A'' :\n', ... Mask_comp, C_replace) ; -D C3 = GB_spec_transpose (C, [ ], 'plus', A, D) ; C5 = GB_mex_transpose (sparse(C), [ ], 'plus', sparse(A), D); assert (isequal (C3.matrix, C5.matrix)) diff --git a/GraphBLAS/Test/test06.m b/GraphBLAS/Test/test06.m index df291fcf8f..401d09f1fa 100644 --- a/GraphBLAS/Test/test06.m +++ b/GraphBLAS/Test/test06.m @@ -9,7 +9,7 @@ function test06 (A,B,fulltests,method_list) % matrix id number from the SuiteSparse collection otherwise A is the sparse % matrix to use in the test -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test06: GrB_mxm on all semirings\n') ; diff --git a/GraphBLAS/Test/test09.m b/GraphBLAS/Test/test09.m index 7bb2ff084a..cd4f4e4442 100644 --- a/GraphBLAS/Test/test09.m +++ b/GraphBLAS/Test/test09.m @@ -1,7 +1,7 @@ function test09 %TEST09 test GxB_subassign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n-----------duplicate I,J test of GB_mex_subassign\n') ; diff --git a/GraphBLAS/Test/test10.m b/GraphBLAS/Test/test10.m index 3ebfd440ab..d98eddd02d 100644 --- a/GraphBLAS/Test/test10.m +++ b/GraphBLAS/Test/test10.m @@ -1,7 +1,7 @@ function test10 %TEST10 test GrB_apply -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: for full test coverage, the JIT cache must be empty before running diff --git a/GraphBLAS/Test/test104.m b/GraphBLAS/Test/test104.m index 3f8011c06f..1c8b81df70 100644 --- a/GraphBLAS/Test/test104.m +++ b/GraphBLAS/Test/test104.m @@ -1,7 +1,7 @@ function test104 %TEST104 export/import -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/Test/test108.m b/GraphBLAS/Test/test108.m index b13c9dd699..34a0b9bb22 100644 --- a/GraphBLAS/Test/test108.m +++ b/GraphBLAS/Test/test108.m @@ -1,7 +1,7 @@ function test108 %TEST108 test boolean monoids -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % only well-defined if op is associative diff --git a/GraphBLAS/Test/test109.m b/GraphBLAS/Test/test109.m index f7f58623a1..73aa1947a2 100644 --- a/GraphBLAS/Test/test109.m +++ b/GraphBLAS/Test/test109.m @@ -1,7 +1,7 @@ function test109 %TEST109 terminal monoid with user-defined type -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest109: terminal monoid with user-defined type\n') ; diff --git a/GraphBLAS/Test/test10_compare.m b/GraphBLAS/Test/test10_compare.m index 861e8c2992..c25d87bbb8 100644 --- a/GraphBLAS/Test/test10_compare.m +++ b/GraphBLAS/Test/test10_compare.m @@ -7,7 +7,7 @@ function test10_compare (op, C1, C2, tol) % acos, asin, and other a* trig functions can return different but valid % results. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 C1 = GB_spec_matrix (C1, 0) ; diff --git a/GraphBLAS/Test/test11.m b/GraphBLAS/Test/test11.m index c73a3943fd..c9016793f6 100644 --- a/GraphBLAS/Test/test11.m +++ b/GraphBLAS/Test/test11.m @@ -1,7 +1,7 @@ function test11 %TEST11 test GrB_*_extractTuples -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; @@ -9,6 +9,8 @@ fprintf ('\n------------ testing GrB_extractTuples') ; +rng ('default') ; + % type of the output X for k1 = 1:length (types) xtype = types {k1} ; @@ -28,43 +30,56 @@ clear B B = GB_spec_random (m*n, 1, 0.1, 32, atype) ; - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; + for method = 0:1 - [I1, J1, X1] = GB_mex_extractTuples (A, xtype) ; - [I2, J2, X2] = GB_spec_extractTuples (A, xtype) ; + if (method == 1) + xtyp = atype ; + else + xtyp = xtype ; + end - % If A is CSR, the extraction returns tuples in row major - % order, but GB_spec_extractTuples always returns the tuples in - % column major order. Either way is fine since the order does - % not matter. + for A_is_hyper = 0:1 + for A_is_csc = 0:1 - [~,p1] = sortrows ([I1 J1]) ; - I1 = I1 (p1) ; - J1 = J1 (p1) ; - X1 = X1 (p1) ; + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; - [~,p2] = sortrows ([I2 J2]) ; - I2 = I2 (p2) ; - J2 = J2 (p2) ; - X2 = X2 (p2) ; + [I1, J1, X1] = GB_mex_extractTuples (A, xtyp, method); + [I2, J2, X2] = GB_spec_extractTuples (A, xtyp, method); - assert (isequal (I1, I2)) ; - assert (isequal (J1, J2)) ; - assert (isequal (X1, X2)) ; + % If A is CSR, the extraction returns tuples in row + % major order, but GB_spec_extractTuples always returns + % the tuples in column major order. Either way is fine + % since the order does not matter. - end - end + [~,p1] = sortrows ([I1 J1]) ; + I1 = I1 (p1) ; + J1 = J1 (p1) ; + X1 = X1 (p1) ; + + [~,p2] = sortrows ([I2 J2]) ; + I2 = I2 (p2) ; + J2 = J2 (p2) ; + X2 = X2 (p2) ; - [I1, J1, X1] = GB_mex_extractTuples (B, xtype) ; - [I2, J2, X2] = GB_spec_extractTuples (B, xtype) ; + assert (isequal (I1, I2)) ; + assert (isequal (J1, J2)) ; + assert (isequal (X1, X2)) ; - assert (isequal (I1, I2)) ; - assert (isequal (J1, J2)) ; - assert (isequal (X1, X2)) ; + end + end + [I1, J1, X1] = GB_mex_extractTuples (B, xtyp, method) ; + [I2, J2, X2] = GB_spec_extractTuples (B, xtyp, method) ; + + assert (isequal (I1, I2)) ; + assert (isequal (J1, J2)) ; + assert (isequal (X1, X2)) ; + + clear I1 + [I1] = GB_mex_extractTuples (B, xtyp, method) ; + assert (isequal (I1, I2)) ; + end end end end @@ -75,11 +90,13 @@ A.matrix = pi * sparse (rand (5) > 0.5) ; A.iso = true ; A.sparsity = 4 ; -[I1, J1, X1] = GB_mex_extractTuples (A, 'double') ; -[I2, J2, X2] = GB_spec_extractTuples (A, 'double') ; -assert (isequal (I1, I2)) ; -assert (isequal (J1, J2)) ; -assert (isequal (X1, X2)) ; +for method = 0:1 + [I1, J1, X1] = GB_mex_extractTuples (A, 'double', method) ; + [I2, J2, X2] = GB_spec_extractTuples (A, 'double', method) ; + assert (isequal (I1, I2)) ; + assert (isequal (J1, J2)) ; + assert (isequal (X1, X2)) ; +end fprintf ('\ntest11: all tests passed\n') ; diff --git a/GraphBLAS/Test/test124.m b/GraphBLAS/Test/test124.m index 7b3926d594..40df9991cf 100644 --- a/GraphBLAS/Test/test124.m +++ b/GraphBLAS/Test/test124.m @@ -1,7 +1,7 @@ function test124 %TEST124 GrB_extract, trigger case 6 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test124: GrB_extract, trigger case 6\n') ; @@ -18,7 +18,7 @@ m = huge ; A (3,n) = 999 ; -I = [3 4 1] ; +I = [3 4 1]' ; C = A (I,:) ; I0 = uint64 (I) - 1 ; @@ -27,4 +27,7 @@ C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I0, [ ], [ ]) ; assert (isequal (C, C2.matrix)) ; +C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I0, [ ], [ ], 1) ; +assert (isequal (C, C2.matrix)) ; + fprintf ('test124: all tests passed\n') ; diff --git a/GraphBLAS/Test/test125.m b/GraphBLAS/Test/test125.m index 093c549fe2..e90654cd47 100644 --- a/GraphBLAS/Test/test125.m +++ b/GraphBLAS/Test/test125.m @@ -2,7 +2,7 @@ %TEST125 test GrB_mxm: row and column scaling % all built-in semirings, no typecast, no mask -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test127.m b/GraphBLAS/Test/test127.m index 05005eb17a..eab966e19c 100644 --- a/GraphBLAS/Test/test127.m +++ b/GraphBLAS/Test/test127.m @@ -1,7 +1,7 @@ function test127 %TEST127 test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test128.m b/GraphBLAS/Test/test128.m index 701a43a848..17c4617909 100644 --- a/GraphBLAS/Test/test128.m +++ b/GraphBLAS/Test/test128.m @@ -1,7 +1,7 @@ function test128 %TEST128 test eWiseMult, eWiseAdd, eWiseUnion, special cases -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest128: test eWiseMult, eWiseAdd, eWiseUnion, special cases\n') ; diff --git a/GraphBLAS/Test/test129.m b/GraphBLAS/Test/test129.m index 976499fc84..3fd88108b0 100644 --- a/GraphBLAS/Test/test129.m +++ b/GraphBLAS/Test/test129.m @@ -3,7 +3,7 @@ % This is a shorter version of test25 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest129: GxB_select tests (tril and nonzero)\n') ; diff --git a/GraphBLAS/Test/test130.m b/GraphBLAS/Test/test130.m index 575a322fa4..3c6ebabf78 100644 --- a/GraphBLAS/Test/test130.m +++ b/GraphBLAS/Test/test130.m @@ -1,7 +1,7 @@ function test130 %TEST130 test GrB_apply (hypersparse cases) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest130: quick GrB_apply tests\n') ; diff --git a/GraphBLAS/Test/test132.m b/GraphBLAS/Test/test132.m index 021813b414..06bdf165b7 100644 --- a/GraphBLAS/Test/test132.m +++ b/GraphBLAS/Test/test132.m @@ -1,7 +1,7 @@ function test132 %TEST132 test GrB_*_setElement and GrB_*_*build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % simplified from test45 diff --git a/GraphBLAS/Test/test133.m b/GraphBLAS/Test/test133.m index 19baa13777..111adc5f33 100644 --- a/GraphBLAS/Test/test133.m +++ b/GraphBLAS/Test/test133.m @@ -1,41 +1,47 @@ function test133 %TEST133 test mask operations (GB_masker) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest133: test the mask operation\n') ; -n = 1000 ; -S = sprand (n, n, 0.01) ; -Z = sprand (n, n, 0.5) ; -M = sprand (n, n, 0.01) ; +rng ('default') ; +for trial = 1:32 -dtn.inp0 = 'tran' ; + fprintf ('.') ; -C1 = GB_mex_transpose (S, M, [ ], Z, dtn) ; -C2 = GB_spec_transpose (S, M, [ ], Z, dtn) ; -GB_spec_compare (C1, C2) ; + n = 1000 ; + S = sprand (n, n, 0.01) ; + Z = sprand (n, n, 0.5) ; + M = sprand (n, n, 0.01) ; -d2.inp0 = 'tran' ; -d2.mask = 'complement' ; + dtn.inp0 = 'tran' ; -C1 = GB_mex_transpose (S, Z, [ ], M, d2) ; -C2 = GB_spec_transpose (S, Z, [ ], M, d2) ; -GB_spec_compare (C1, C2) ; + C1 = GB_mex_transpose (S, M, [ ], Z, dtn) ; + C2 = GB_spec_transpose (S, M, [ ], Z, dtn) ; + GB_spec_compare (C1, C2) ; -D = sprand (n, n, 0.8) ; -D (:, 2:end) = 0 ; + d2.inp0 = 'tran' ; + d2.mask = 'complement' ; -n2 = floor (n/2) ; -S (n2:end, :) = 0 ; -M = sparse (n, n) ; -M (n,1) = 1 ; + C1 = GB_mex_transpose (S, Z, [ ], M, d2) ; + C2 = GB_spec_transpose (S, Z, [ ], M, d2) ; + GB_spec_compare (C1, C2) ; -C1 = GB_mex_transpose (D, M, [ ], S, d2) ; -C2 = GB_spec_transpose (D, M, [ ], S, d2) ; -GB_spec_compare (C1, C2) ; + D = sprand (n, n, 0.8) ; + D (:, 2:end) = 0 ; -fprintf ('\ntest133: all tests passed\n') ; + n2 = floor (n/2) ; + S (n2:end, :) = 0 ; + M = sparse (n, n) ; + M (n,1) = 1 ; + + C1 = GB_mex_transpose (D, M, [ ], S, d2) ; + C2 = GB_spec_transpose (D, M, [ ], S, d2) ; + GB_spec_compare (C1, C2) ; +end + +fprintf ('\ntest133: all tests passed\n') ; diff --git a/GraphBLAS/Test/test135.m b/GraphBLAS/Test/test135.m index 6b378b95f5..19aa243edc 100644 --- a/GraphBLAS/Test/test135.m +++ b/GraphBLAS/Test/test135.m @@ -1,7 +1,7 @@ function test135 %TEST135 reduce-to-scalar, built-in monoids with terminal values -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test135: reduce to scalar\n') ; diff --git a/GraphBLAS/Test/test136.m b/GraphBLAS/Test/test136.m index 9897b82402..d7829f8732 100644 --- a/GraphBLAS/Test/test136.m +++ b/GraphBLAS/Test/test136.m @@ -1,7 +1,7 @@ function test136 %TEST136 GxB_subassign, method 08, 09, 11 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test136: GxB_subassign, special cases\n') ; diff --git a/GraphBLAS/Test/test137.m b/GraphBLAS/Test/test137.m index 39336cf400..c51073a523 100644 --- a/GraphBLAS/Test/test137.m +++ b/GraphBLAS/Test/test137.m @@ -1,7 +1,7 @@ function test137 %TEST137 GrB_eWiseMult with FIRST and SECOND operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test137: GrB_eWiseMult with FIRST and SECOND operators\n') ; diff --git a/GraphBLAS/Test/test138.m b/GraphBLAS/Test/test138.m index 9f99aa959b..8e7cc81bee 100644 --- a/GraphBLAS/Test/test138.m +++ b/GraphBLAS/Test/test138.m @@ -1,7 +1,7 @@ function test138 %TEST138 test assign, with coarse-only tasks in IxJ slice -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test139.m b/GraphBLAS/Test/test139.m deleted file mode 100644 index 8791c75776..0000000000 --- a/GraphBLAS/Test/test139.m +++ /dev/null @@ -1,31 +0,0 @@ -function test139 -%TEST139 merge sort, special cases - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test139 --------------- merge sort, special cases\n') ; -rng ('default') ; - -n = 1e6 ; -I = 42 * ones (n,1) ; -J = (1:n)' ; -K = 100 * ones (n,1) ; - -I0 = int64 (I) ; -J0 = int64 (J) ; -K0 = int64 (K) ; - -IJ1 = sortrows ([I0 J0]) ; -[a b] = GB_mex_msort_2 (I0, J0, 2) ; -assert (isequal (IJ1, [a b])) ; - -IJ3 = sortrows ([I0 J0 K0]) ; -[a b c] = GB_mex_msort_3 (I0, J0, K0, 2) ; -assert (isequal (IJ3, [a b c])) ; - -IJ1 = sortrows ([J0 I0]) ; -[a b] = GB_mex_msort_2 (J0, I0, 2) ; -assert (isequal (IJ1, [a b])) ; - -fprintf ('test139 --------------- all tests passed\n') ; diff --git a/GraphBLAS/Test/test14.m b/GraphBLAS/Test/test14.m index c15c1dc3c1..7eb0838588 100644 --- a/GraphBLAS/Test/test14.m +++ b/GraphBLAS/Test/test14.m @@ -1,7 +1,7 @@ function test14(tasks) %TEST14 test GrB_reduce -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest14: reduce to column and scalar\n') ; diff --git a/GraphBLAS/Test/test141.m b/GraphBLAS/Test/test141.m index 08d2542232..262bc59f77 100644 --- a/GraphBLAS/Test/test141.m +++ b/GraphBLAS/Test/test141.m @@ -1,7 +1,7 @@ function test141 %TEST141 test GrB_eWiseAdd (all types and operators) for dense matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test142.m b/GraphBLAS/Test/test142.m index 505d4b1dba..9030d03966 100644 --- a/GraphBLAS/Test/test142.m +++ b/GraphBLAS/Test/test142.m @@ -1,7 +1,7 @@ function test142(tasks) %TEST142 test GrB_assign for dense matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test142b.m b/GraphBLAS/Test/test142b.m index 07b7cbe74f..54677e5cbf 100644 --- a/GraphBLAS/Test/test142b.m +++ b/GraphBLAS/Test/test142b.m @@ -1,7 +1,7 @@ function test142b(tasks) %TEST142B test GrB_assign for dense matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test144.m b/GraphBLAS/Test/test144.m index 705ae49c91..293c2ab323 100644 --- a/GraphBLAS/Test/test144.m +++ b/GraphBLAS/Test/test144.m @@ -1,7 +1,7 @@ function test144 %TEST144 test GB_cumsum -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test144 ---------------------- test GB_cumsum\n') ; diff --git a/GraphBLAS/Test/test145.m b/GraphBLAS/Test/test145.m index 877e22b36d..c452e87d26 100644 --- a/GraphBLAS/Test/test145.m +++ b/GraphBLAS/Test/test145.m @@ -2,7 +2,7 @@ %TEST145 test dot4 with rdiv2 operator % GB_AxB_dot4 computes C+=A'*B when C is dense. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test145 -------------------- C+=A''*B when C is dense, with dot4\n') ; diff --git a/GraphBLAS/Test/test148.m b/GraphBLAS/Test/test148.m index d9cb5d1843..cfd7f07d05 100644 --- a/GraphBLAS/Test/test148.m +++ b/GraphBLAS/Test/test148.m @@ -1,7 +1,7 @@ function test148 %TEST148 eWiseAdd with aliases -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test148 ---------------eWiseAdd with alias\n') ; diff --git a/GraphBLAS/Test/test14b.m b/GraphBLAS/Test/test14b.m index d7ec68fa85..fbb2128c7a 100644 --- a/GraphBLAS/Test/test14b.m +++ b/GraphBLAS/Test/test14b.m @@ -1,7 +1,7 @@ function test14b(tasks) %TEST14B test GrB_reduce -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test150.m b/GraphBLAS/Test/test150.m index 24b33d0f65..ee1f0e6054 100644 --- a/GraphBLAS/Test/test150.m +++ b/GraphBLAS/Test/test150.m @@ -1,7 +1,7 @@ function test150 %TEST150 test GrB_mxm with typecasting and zombies (dot3 and saxpy) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test150: ------- GrB_mxm with typecasting and zombies (dot3)\n') ; diff --git a/GraphBLAS/Test/test151b.m b/GraphBLAS/Test/test151b.m index 4f1ec41d8a..1be209bc74 100644 --- a/GraphBLAS/Test/test151b.m +++ b/GraphBLAS/Test/test151b.m @@ -1,7 +1,7 @@ function test151b %TEST151B test bitshift operators -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test151b: test bshift operator\n') ; diff --git a/GraphBLAS/Test/test152.m b/GraphBLAS/Test/test152.m index 1ae7b9dc22..84a460a509 100644 --- a/GraphBLAS/Test/test152.m +++ b/GraphBLAS/Test/test152.m @@ -1,7 +1,7 @@ function test152 %TEST152 test C = A+B for dense A, B, and C -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest152: test binops with C=A+B, all dense\n') ; diff --git a/GraphBLAS/Test/test154.m b/GraphBLAS/Test/test154.m index 4dc86638c5..0fd1106a51 100644 --- a/GraphBLAS/Test/test154.m +++ b/GraphBLAS/Test/test154.m @@ -1,7 +1,7 @@ function test154(tasks) %TEST154 test GrB_apply with scalar binding -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test154b.m b/GraphBLAS/Test/test154b.m index 81f2faa29d..d34da60363 100644 --- a/GraphBLAS/Test/test154b.m +++ b/GraphBLAS/Test/test154b.m @@ -1,7 +1,7 @@ function test154b(tasks) %TEST154B test GrB_apply with scalar binding -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test155.m b/GraphBLAS/Test/test155.m index 9ae8122921..15551d48e0 100644 --- a/GraphBLAS/Test/test155.m +++ b/GraphBLAS/Test/test155.m @@ -1,7 +1,7 @@ function test155 %TEST155 test GrB_*_setElement and GrB_*_removeElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test157.m b/GraphBLAS/Test/test157.m index 8c4dd39da2..e8f930aaea 100644 --- a/GraphBLAS/Test/test157.m +++ b/GraphBLAS/Test/test157.m @@ -1,7 +1,7 @@ function test157 %TEST157 test sparsity formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -41,8 +41,5 @@ end end -% A = GrB (rand (40)) ; -% A (1,1) = sparse (0) - fprintf ('test157: all tests passed\n') ; diff --git a/GraphBLAS/Test/test159.m b/GraphBLAS/Test/test159.m index b61e30311a..91da2319e2 100644 --- a/GraphBLAS/Test/test159.m +++ b/GraphBLAS/Test/test159.m @@ -1,7 +1,7 @@ function test159 %TEST159 test dot and saxpy with positional ops -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test160.m b/GraphBLAS/Test/test160.m index b99ae16739..8464967ef7 100644 --- a/GraphBLAS/Test/test160.m +++ b/GraphBLAS/Test/test160.m @@ -1,7 +1,7 @@ function test160 %TEST160 test GrB_mxm -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test162.m b/GraphBLAS/Test/test162.m index 5737e5f9ae..14e2bdcc36 100644 --- a/GraphBLAS/Test/test162.m +++ b/GraphBLAS/Test/test162.m @@ -1,7 +1,7 @@ function test162 %TEST162 test C=A*B with very sparse M -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 semiring.add = 'plus' ; diff --git a/GraphBLAS/Test/test165.m b/GraphBLAS/Test/test165.m index f7e33fdb82..aec574cb77 100644 --- a/GraphBLAS/Test/test165.m +++ b/GraphBLAS/Test/test165.m @@ -1,7 +1,7 @@ function test165 %TEST165 test C=A*B' where A is diagonal and B becomes bitmap -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test169.m b/GraphBLAS/Test/test169.m index 83181400cf..1bd08a982f 100644 --- a/GraphBLAS/Test/test169.m +++ b/GraphBLAS/Test/test169.m @@ -1,7 +1,7 @@ function test169 %TEST169 C=A+B with different sparsity formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test17.m b/GraphBLAS/Test/test17.m index e18b57730a..ce1a722f47 100644 --- a/GraphBLAS/Test/test17.m +++ b/GraphBLAS/Test/test17.m @@ -1,7 +1,7 @@ function test17 %TEST17 test GrB_*_extractElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n ------------ testing GrB_extractElement\n') ; diff --git a/GraphBLAS/Test/test172.m b/GraphBLAS/Test/test172.m index c35c3273e9..794a980543 100644 --- a/GraphBLAS/Test/test172.m +++ b/GraphBLAS/Test/test172.m @@ -1,7 +1,7 @@ function test172 %TEST172 eWiseMult with M bitmap/full -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test173.m b/GraphBLAS/Test/test173.m index 4698831eed..c9068f1907 100644 --- a/GraphBLAS/Test/test173.m +++ b/GraphBLAS/Test/test173.m @@ -1,7 +1,7 @@ function test173 %TEST173 test GrB_assign C=A -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 types = { 'logical', 'double', 'double complex' } ; diff --git a/GraphBLAS/Test/test174.m b/GraphBLAS/Test/test174.m index 73089b19a4..5331e8355f 100644 --- a/GraphBLAS/Test/test174.m +++ b/GraphBLAS/Test/test174.m @@ -1,7 +1,7 @@ function test174 %TEST174 bitmap assignment, C+=A -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test176.m b/GraphBLAS/Test/test176.m index b87b7eec55..1e625ac8f0 100644 --- a/GraphBLAS/Test/test176.m +++ b/GraphBLAS/Test/test176.m @@ -1,7 +1,7 @@ function test176 %TEST176 test C(I,J) = scalar (method 09, 11), M bitmap -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test176 ------------ assign/subassign: methods 09, 11\n') ; diff --git a/GraphBLAS/Test/test179.m b/GraphBLAS/Test/test179.m index fdbf4c3a85..4050e79835 100644 --- a/GraphBLAS/Test/test179.m +++ b/GraphBLAS/Test/test179.m @@ -1,7 +1,7 @@ function test179 %TEST179 bitmap select -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test179: --------------------------------- bitmap select\n') ; diff --git a/GraphBLAS/Test/test18.m b/GraphBLAS/Test/test18.m index b02f838612..a111131564 100644 --- a/GraphBLAS/Test/test18.m +++ b/GraphBLAS/Test/test18.m @@ -1,7 +1,7 @@ function test18 %TEST18 test GrB_eWiseAdd, GxB_eWiseUnion, and GrB_eWiseMult -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test180.m b/GraphBLAS/Test/test180.m index 412b5c23e1..0078de8acd 100644 --- a/GraphBLAS/Test/test180.m +++ b/GraphBLAS/Test/test180.m @@ -1,7 +1,7 @@ function test180 %TEST180 subassign and assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % For test coverage, this test must be run with 1 thread @@ -13,10 +13,12 @@ Cin = GB_spec_random (n, n, 0.5, 1, 'double') ; m = 6 ; -I1 = [2 3 5 1 9 11] ; -J1 = [4 5 1 9 2 12] ; +I1 = [2 3 5 1 9 11]' ; +J1 = [4 5 1 9 2 12]' ; I0 = uint64 (I1) - 1 ; J0 = uint64 (J1) - 1 ; +I32 = uint32 (I0) ; +J32 = uint32 (J0) ; M1.matrix = logical (sprand (m, m, 0.5)) ; M2.matrix = logical (sprand (n, n, 0.5)) ; A = GB_spec_random (m, m, 0.8, 1, 'double') ; @@ -36,6 +38,22 @@ C2 = GB_mex_subassign (Cin, [ ], [ ], A, I0, J0, [ ]) ; GB_spec_compare (C1, C2) ; + % C(I,J) = A, with GrB_Vectors for I and J (64,64) + C2 = GB_mex_subassign (Cin, [ ], [ ], A, I0, J0, [ ], 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, with GrB_Vectors for I and J (32,64) + C2 = GB_mex_subassign (Cin, [ ], [ ], A, I32, J0, [ ], 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, with GrB_Vectors for I and J (64,32) + C2 = GB_mex_subassign (Cin, [ ], [ ], A, I0, J32, [ ], 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, with GrB_Vectors for I and J (32,32) + C2 = GB_mex_subassign (Cin, [ ], [ ], A, I32, J32, [ ], 3) ; + GB_spec_compare (C1, C2) ; + for ms = [2 4] M1.sparsity = ms ; M2.sparsity = ms ; @@ -45,16 +63,52 @@ C2 = GB_mex_subassign (Cin, M1, [ ], A, I0, J0, [ ]) ; GB_spec_compare (C1, C2) ; + % C(I,J) = A, with GrB_Vectors for I and J (64,64) + C2 = GB_mex_subassign (Cin, M1, [ ], A, I0, J0, [ ], 3) ; + GB_spec_compare (C1, C2) ; + % C(I,J) = A C1 = GB_spec_assign (Cin, M2, [ ], A, I1, J1, dr, false) ; C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J0, dr) ; GB_spec_compare (C1, C2) ; + % C(I,J) = A, using GrB_Vectors for I and J (64,64) + C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J0, dr, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (32,64) + C2 = GB_mex_assign (Cin, M2, [ ], A, I32, J0, dr, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (64,32) + C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J32, dr, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (32,32) + C2 = GB_mex_assign (Cin, M2, [ ], A, I32, J32, dr, 3) ; + GB_spec_compare (C1, C2) ; + % C(I,J) = A C1 = GB_spec_assign (Cin, M2, [ ], A, I1, J1, drc, false) ; C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J0, drc) ; GB_spec_compare (C1, C2) ; + % C(I,J) = A, using GrB_Vectors for I and J (64,64) + C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J0, drc, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (32,64) + C2 = GB_mex_assign (Cin, M2, [ ], A, I32, J0, drc, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (64,32) + C2 = GB_mex_assign (Cin, M2, [ ], A, I0, J32, drc, 3) ; + GB_spec_compare (C1, C2) ; + + % C(I,J) = A, using GrB_Vectors for I and J (32,32) + C2 = GB_mex_assign (Cin, M2, [ ], A, I32, J32, drc, 3) ; + GB_spec_compare (C1, C2) ; + % C(I,J) = A C1 = GB_spec_subassign (Cin, M1, [ ], A, I1, J1, dr, false) ; C2 = GB_mex_subassign (Cin, M1, [ ], A, I0, J0, dr) ; diff --git a/GraphBLAS/Test/test181.m b/GraphBLAS/Test/test181.m index e9958e006c..acfad77416 100644 --- a/GraphBLAS/Test/test181.m +++ b/GraphBLAS/Test/test181.m @@ -1,7 +1,7 @@ function test181 %TEST181 test transpose with explicit zeros in the Mask -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % see also test99 diff --git a/GraphBLAS/Test/test182.m b/GraphBLAS/Test/test182.m index 06d8118c76..f8b70d8241 100644 --- a/GraphBLAS/Test/test182.m +++ b/GraphBLAS/Test/test182.m @@ -33,7 +33,7 @@ % % This test case comes from Gabor Szarnyas and Marton Elekes. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 I = [ 1, 2, 4, 5, 7, 11, 12, 13, 15, 18, 19, 20, 27, 32, 33, ... diff --git a/GraphBLAS/Test/test183.m b/GraphBLAS/Test/test183.m index 9afa69fa82..ba542ddb52 100644 --- a/GraphBLAS/Test/test183.m +++ b/GraphBLAS/Test/test183.m @@ -1,7 +1,7 @@ function test183 %TEST183 test GrB_eWiseMult with a hypersparse mask -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test184.m b/GraphBLAS/Test/test184.m index d99b9a2812..de18707db8 100644 --- a/GraphBLAS/Test/test184.m +++ b/GraphBLAS/Test/test184.m @@ -1,7 +1,7 @@ function test184 %TEST184 test special cases for mxm, transpose, and build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -16,7 +16,7 @@ B = sprand (0, 10, 1) ; Cin = sparse (10, 10) ; C1 = A'*B ; -C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, B, dtn) +C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, B, dtn) ; %---------------------------------------------------------------------- @@ -88,7 +88,6 @@ A1 = sparse (I, J, X, m, n) ; A2 = GB_mex_Matrix_build (I0, J0, X, m, n, [ ]) ; - assert (norm (A1 - A2.matrix, 1) < 1e-12) %---------------------------------------------------------------------- @@ -102,5 +101,6 @@ % restore # of threads nthreads_set (nthreads) ; +GB_mex_burble (0) ; fprintf ('\ntest184: all tests passed\n') ; diff --git a/GraphBLAS/Test/test185.m b/GraphBLAS/Test/test185.m index a8a7058668..ae0d74826e 100644 --- a/GraphBLAS/Test/test185.m +++ b/GraphBLAS/Test/test185.m @@ -2,7 +2,7 @@ function test185(tasks) %TEST185 test dot4 for all sparsity formats % GB_AxB_dot4 computes C+=A'*B when C is dense. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test185 -------------------- C+=A''*B when C is dense\n') ; diff --git a/GraphBLAS/Test/test186.m b/GraphBLAS/Test/test186.m index 49ce572d5e..40d1d3a2dc 100644 --- a/GraphBLAS/Test/test186.m +++ b/GraphBLAS/Test/test186.m @@ -1,7 +1,7 @@ function test186 (dohack) %TEST186 test saxpy for all sparsity formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test186 --------------- CA*B for all sparsity formats\n') ; @@ -14,8 +14,7 @@ function test186 (dohack) if (nargin < 1) dohack = 2 ; end -hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced -GB_mex_hack (hack) ; +hack (1) = dohack ; GB_mex_hack (hack) ; % "very_costly" in saxpy3 load west0479 ; A.matrix = west0479 ; diff --git a/GraphBLAS/Test/test187.m b/GraphBLAS/Test/test187.m index 23849dcb61..ca47b35ff0 100644 --- a/GraphBLAS/Test/test187.m +++ b/GraphBLAS/Test/test187.m @@ -1,7 +1,7 @@ function test187 %TEST187 test dup/assign for all sparsity formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test187 ----------- C = A for all sparsity formats and all types\n') ; diff --git a/GraphBLAS/Test/test188.m b/GraphBLAS/Test/test188.m index 344bf74373..d722921411 100644 --- a/GraphBLAS/Test/test188.m +++ b/GraphBLAS/Test/test188.m @@ -1,7 +1,7 @@ function test188(tasks) %TEST188 test concat -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: the test coverage requires the JIT cache to be empty first, diff --git a/GraphBLAS/Test/test188b.m b/GraphBLAS/Test/test188b.m index fbe0c9fafe..91d440f230 100644 --- a/GraphBLAS/Test/test188b.m +++ b/GraphBLAS/Test/test188b.m @@ -1,7 +1,7 @@ function test188b(tasks) %TEST188B test concat -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: the test coverage requires the JIT cache to be empty first, diff --git a/GraphBLAS/Test/test189.m b/GraphBLAS/Test/test189.m deleted file mode 100644 index af6cbece35..0000000000 --- a/GraphBLAS/Test/test189.m +++ /dev/null @@ -1,29 +0,0 @@ -function test189 -%TEST189 test large assignment - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test189 ----------- test large C(I,J)=A\n') ; - -rng ('default') ; - -n = 1e6 ; -nz = 1e6 ; -d = nz/n^2 ; -C = sprand (n, n, d) ; -A = sprand (n, n, d) ; -I = randperm (n) ; -J = randperm (n) ; -nthreads_set (4, 1) ; -% C (I,J) = A ; -I0 = uint64 (I) - 1 ; -J0 = uint64 (J) - 1 ; - -C1 = GB_mex_assign (C, [ ], [ ], A, I0, J0, [ ], 0) ; -C2 = C ; -C2 (I, J) = A ; - -assert (isequal (C1.matrix, C2)) ; - -fprintf ('test189: all tests passed\n') ; diff --git a/GraphBLAS/Test/test19.m b/GraphBLAS/Test/test19.m index cbf21d94fe..8fb3058b87 100644 --- a/GraphBLAS/Test/test19.m +++ b/GraphBLAS/Test/test19.m @@ -1,7 +1,7 @@ function test19(fulltest) %TEST19 test GxB_subassign and GrB_*_setElement with many pending operations -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test191.m b/GraphBLAS/Test/test191.m index 63830be34b..82da2ffe68 100644 --- a/GraphBLAS/Test/test191.m +++ b/GraphBLAS/Test/test191.m @@ -1,7 +1,7 @@ function test191(tasks) %TEST191 test split -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test191 ----------- Tiles = split (A)\n') ; diff --git a/GraphBLAS/Test/test192.m b/GraphBLAS/Test/test192.m index 0fedddd3da..1fed2567d9 100644 --- a/GraphBLAS/Test/test192.m +++ b/GraphBLAS/Test/test192.m @@ -1,7 +1,7 @@ function test192 %TEST192 test GrB_assign C=scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test193.m b/GraphBLAS/Test/test193.m index 9a02215b80..266d35cb03 100644 --- a/GraphBLAS/Test/test193.m +++ b/GraphBLAS/Test/test193.m @@ -1,7 +1,7 @@ function test193 %TEST193 test GxB_Matrix_diag and GrB_Matrix_diag -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test193 ----------- C = diag (v,k)\n') ; diff --git a/GraphBLAS/Test/test194.m b/GraphBLAS/Test/test194.m index a9fcbc0aee..587e8a3ce8 100644 --- a/GraphBLAS/Test/test194.m +++ b/GraphBLAS/Test/test194.m @@ -1,7 +1,7 @@ function test194(tasks) %TEST194 test GxB_Vector_diag -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test194 ----------- V = diag (A,k)\n') ; diff --git a/GraphBLAS/Test/test195.m b/GraphBLAS/Test/test195.m index d11042af01..ad88fb3c1d 100644 --- a/GraphBLAS/Test/test195.m +++ b/GraphBLAS/Test/test195.m @@ -1,7 +1,7 @@ function test195 (dohack) %TEST195 test all variants of saxpy3 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test195 -------------- saxpy3 variants\n') ; @@ -50,8 +50,7 @@ function test195 (dohack) if (nargin < 1) dohack = 2 ; end -hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced -GB_mex_hack (hack) ; +hack (1) = dohack ; GB_mex_hack (hack) ; % "very_costly" in saxpy3 k = 3 ; n = 4 ; diff --git a/GraphBLAS/Test/test196.m b/GraphBLAS/Test/test196.m index f3dcfc870f..bb0cb906ab 100644 --- a/GraphBLAS/Test/test196.m +++ b/GraphBLAS/Test/test196.m @@ -1,7 +1,7 @@ function test196 %TEST196 test large hypersparse concat -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test197.m b/GraphBLAS/Test/test197.m index 3ccfbf619b..90f4a84d46 100644 --- a/GraphBLAS/Test/test197.m +++ b/GraphBLAS/Test/test197.m @@ -1,7 +1,7 @@ function test197 %TEST197 test large sparse split -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test199.m b/GraphBLAS/Test/test199.m index ac8e71865c..aa8ec3fc56 100644 --- a/GraphBLAS/Test/test199.m +++ b/GraphBLAS/Test/test199.m @@ -1,7 +1,7 @@ function test199 %TEST199 test dot2 with hypersparse -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test19b.m b/GraphBLAS/Test/test19b.m index 3e85d28a71..66dc3cddff 100644 --- a/GraphBLAS/Test/test19b.m +++ b/GraphBLAS/Test/test19b.m @@ -1,7 +1,7 @@ function test19b(fulltest) %TEST19B test GrB_assign and GrB_*_setElement with many pending operations -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest19b: GrB_assign and setElement, many pending computations\n') ; diff --git a/GraphBLAS/Test/test200.m b/GraphBLAS/Test/test200.m index 49c76b001c..fa02804e61 100644 --- a/GraphBLAS/Test/test200.m +++ b/GraphBLAS/Test/test200.m @@ -1,7 +1,7 @@ function test200 %TEST200 test iso full matrix multiply -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test201.m b/GraphBLAS/Test/test201.m index 2c4d6b14b2..1dbb4d01dc 100644 --- a/GraphBLAS/Test/test201.m +++ b/GraphBLAS/Test/test201.m @@ -1,7 +1,7 @@ function test201 %TEST201 test iso reduce to vector and reduce to scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 n = 10 ; @@ -24,7 +24,6 @@ % reduce a huge iso full matrix to a scalar m = 2^40 ; n = 2^48 ; -% s = sum (pi * GrB.ones (m, n), 'all') s = GB_mex_test36 ; % expected result: t = pi * m * n ; diff --git a/GraphBLAS/Test/test202.m b/GraphBLAS/Test/test202.m index 0f0a1065d2..1347c1c22d 100644 --- a/GraphBLAS/Test/test202.m +++ b/GraphBLAS/Test/test202.m @@ -1,7 +1,7 @@ function test202 %TEST202 test iso add and emult -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % GB_mex_burble (1) ; diff --git a/GraphBLAS/Test/test203.m b/GraphBLAS/Test/test203.m index fe2368d4cb..d1829feb29 100644 --- a/GraphBLAS/Test/test203.m +++ b/GraphBLAS/Test/test203.m @@ -1,7 +1,7 @@ function test203 %TEST203 test iso subref -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -12,7 +12,7 @@ A.iso = true ; m = 5 ; -I = 1:m ; +I = (1:m)' ; I0 = uint64 (I) - 1 ; Cin = sparse (m,m) ; @@ -20,17 +20,26 @@ C2 = A.matrix (I,I) ; assert (isequal (C1.matrix, C2)) ; +C1 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, I0, [ ], 1) ; +assert (isequal (C1.matrix, C2)) ; + A.sparsity = 4 ; C1 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, I0, [ ]) ; C2 = A.matrix (I,I) ; assert (isequal (C1.matrix, C2)) ; +C1 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, I0, [ ], 1) ; +assert (isequal (C1.matrix, C2)) ; + A.matrix = pi * sparse (ones (n,n)) ; A.sparsity = 8 ; C1 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, I0, [ ]) ; C2 = A.matrix (I,I) ; assert (isequal (C1.matrix, C2)) ; +C1 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, I0, [ ], 1) ; +assert (isequal (C1.matrix, C2)) ; + GB_mex_burble (0) ; fprintf ('test203: all tests passed\n') ; diff --git a/GraphBLAS/Test/test204.m b/GraphBLAS/Test/test204.m index ac22a99f5f..19dd8c1ec1 100644 --- a/GraphBLAS/Test/test204.m +++ b/GraphBLAS/Test/test204.m @@ -1,7 +1,7 @@ function test204 %TEST204 test iso diag -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % GB_mex_burble (1) ; diff --git a/GraphBLAS/Test/test206.m b/GraphBLAS/Test/test206.m index bd51430299..7544ce137d 100644 --- a/GraphBLAS/Test/test206.m +++ b/GraphBLAS/Test/test206.m @@ -1,7 +1,7 @@ function test206 %TEST206 test iso select -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, select_ops] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test207.m b/GraphBLAS/Test/test207.m index 31674684b5..0ebfc57b42 100644 --- a/GraphBLAS/Test/test207.m +++ b/GraphBLAS/Test/test207.m @@ -1,7 +1,7 @@ function test207 %TEST207 test iso subref -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -20,6 +20,11 @@ C2 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, J0, [ ]) ; assert (isequal (C2.matrix, C1)) ; +I0 = I0 (:) ; +J0 = J0 (:) ; +C2 = GB_mex_Matrix_extract (Cin, [ ], [ ], A, I0, J0, [ ],1) ; +assert (isequal (C2.matrix, C1)) ; + GB_mex_burble (0) ; fprintf ('\ntest207: all tests passed\n') ; diff --git a/GraphBLAS/Test/test208.m b/GraphBLAS/Test/test208.m index 632d394c1f..31d5f4250a 100644 --- a/GraphBLAS/Test/test208.m +++ b/GraphBLAS/Test/test208.m @@ -1,7 +1,7 @@ function test208 %TEST208 test iso apply, bind 1st and 2nd -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test209.m b/GraphBLAS/Test/test209.m index 41f86f903b..c5b46a2b0f 100644 --- a/GraphBLAS/Test/test209.m +++ b/GraphBLAS/Test/test209.m @@ -1,7 +1,7 @@ -function test209 +function test210 %TEST209 test iso build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -11,8 +11,6 @@ types = types.all ; op.opname = 'second' ; -% GB_mex_burble (1) ; - n = 100 ; m = 200 ; nnz = 1000 ; @@ -23,6 +21,15 @@ Y = 10 * rand (nnz, 1) ; Yimag = 10 * rand (nnz, 1) ; +% desc.*list can be: use_values, use_indices, or is_stride, +% but is_stride cannot be used by build +desc.rowindex_list = 'use_values' ; +desc.colindex_list = 'use_values' ; +desc.value_list = 'use_values' ; + +desc1 = desc ; +desc1.value_list = 'use_indices' ; + ntypes = 1+length(types) ; for k = 1:ntypes @@ -37,6 +44,7 @@ Z = X (1) ; X (:) = Z ; + R = (0:length (X)-1)' ; op.optype = type ; @@ -45,21 +53,66 @@ C2 = GB_spec_build (I, J, X, m, n, op) ; GB_spec_compare (C1, C2) ; + % non-iso matrix build, using _Vector method + C1 = GB_mex_Matrix_build (I, J, X, m, n, op, type, 1, desc) ; + GB_spec_compare (C1, C2) ; + % iso matrix build C1 = GB_mex_Matrix_build (I, J, Z, m, n, op, type) ; C2 = GB_spec_build (I, J, X, m, n, op) ; GB_spec_compare (C1, C2) ; + % iso matrix build, using _Vector method + C1 = GB_mex_Matrix_build (I, J, Z, m, n, op, type, 1, desc) ; + GB_spec_compare (C1, C2) ; + + % iso matrix build, using _Vector method + clear Xvector + Xvector.matrix = X ; + Xvector.iso = true ; + for sparsity = [2 4 8] + Xvector.sparsity = sparsity ; + C1 = GB_mex_Matrix_build (I, J, Xvector, m, n, op, type, 1, desc) ; + GB_spec_compare (C1, C2) ; + end + % non-iso vector build C1 = GB_mex_Vector_build (I, X, m, op, type) ; C2 = GB_spec_build (I, [ ], X, m, 1, op) ; GB_spec_compare (C1, C2) ; + % non-iso vector build, using _Vector method + C1 = GB_mex_Vector_build (I, X, m, op, type, desc) ; + GB_spec_compare (C1, C2) ; + % iso vector build C1 = GB_mex_Vector_build (I, Z, m, op, type) ; C2 = GB_spec_build (I, [ ], X, m, 1, op) ; GB_spec_compare (C1, C2) ; + % iso vector build, using _Vector method + C1 = GB_mex_Vector_build (I, Z, m, op, type, desc) ; + GB_spec_compare (C1, C2) ; + + if (isequal (type, 'double') || isequal (type, 'uint32')) + % non-iso matrix build, ramp + C1 = GB_mex_Matrix_build (I, J, R, m, n, op, type) ; + C2 = GB_spec_build (I, J, R, m, n, op) ; + GB_spec_compare (C1, C2) ; + + % non-iso matrix build, ramp, using _Vector method, and indices of X + C3 = GB_mex_Matrix_build (I, J, X, m, n, op, type, 1, desc1) ; + GB_spec_compare (C3, C2) ; + + % non-iso matrix build, ramp, using _Vector method, and indices of Xvector + clear Xvector + Xvector.matrix = X ; + for sparsity = [2 4 8] + Xvector.sparsity = sparsity ; + C3 = GB_mex_Matrix_build (I, J, Xvector, m, n, op, type, 1, desc1) ; + end + GB_spec_compare (C3, C2) ; + end end % large iso vector build @@ -75,6 +128,5 @@ C2 = logical (sparse (I1, 1, X, m, 1)) ; assert (isequal (C1.matrix, C2)) ; -GB_mex_burble (0) ; fprintf ('\ntest209: all tests passed\n') ; diff --git a/GraphBLAS/Test/test210.m b/GraphBLAS/Test/test210.m index ff9f586492..2dfd0132b7 100644 --- a/GraphBLAS/Test/test210.m +++ b/GraphBLAS/Test/test210.m @@ -1,7 +1,7 @@ function test210 %TEST210 test iso assign25: C=A, C empty, A dense, M structural -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test211.m b/GraphBLAS/Test/test211.m index 373351f68f..548ad5c8ea 100644 --- a/GraphBLAS/Test/test211.m +++ b/GraphBLAS/Test/test211.m @@ -1,7 +1,7 @@ function test211 %TEST211 test iso assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test212.m b/GraphBLAS/Test/test212.m index eb5e98e563..d7452e5200 100644 --- a/GraphBLAS/Test/test212.m +++ b/GraphBLAS/Test/test212.m @@ -1,7 +1,7 @@ function test212 %TEST212 test iso mask all zero -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test213.m b/GraphBLAS/Test/test213.m index a210c80266..e5d59c5e53 100644 --- a/GraphBLAS/Test/test213.m +++ b/GraphBLAS/Test/test213.m @@ -1,7 +1,7 @@ function test213 %TEST213 test iso assign (method 05d) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test214.m b/GraphBLAS/Test/test214.m index 422c9d59b2..3fa38dc960 100644 --- a/GraphBLAS/Test/test214.m +++ b/GraphBLAS/Test/test214.m @@ -1,7 +1,7 @@ function test214 %TEST214 test C=A'*B (tricount) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test215.m b/GraphBLAS/Test/test215.m index 171bd7abf5..490f439e25 100644 --- a/GraphBLAS/Test/test215.m +++ b/GraphBLAS/Test/test215.m @@ -1,7 +1,7 @@ function test215 %TEST215 test C=A'*B (dot2, ANY_PAIR semiring) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test216.m b/GraphBLAS/Test/test216.m index 85688d11ac..b6862c141d 100644 --- a/GraphBLAS/Test/test216.m +++ b/GraphBLAS/Test/test216.m @@ -1,7 +1,7 @@ function test216 %TEST216 test C=A, iso case -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test219.m b/GraphBLAS/Test/test219.m index 4a4f0612b1..8a6c641971 100644 --- a/GraphBLAS/Test/test219.m +++ b/GraphBLAS/Test/test219.m @@ -1,7 +1,7 @@ function test219 %TEST219 test reduce to scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test21b.m b/GraphBLAS/Test/test21b.m index b143e3073e..39db57092a 100644 --- a/GraphBLAS/Test/test21b.m +++ b/GraphBLAS/Test/test21b.m @@ -1,7 +1,7 @@ function test21b (fulltest) %TEST21B test GrB_assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test220.m b/GraphBLAS/Test/test220.m index 47804d4c63..25741a8bcb 100644 --- a/GraphBLAS/Test/test220.m +++ b/GraphBLAS/Test/test220.m @@ -1,12 +1,12 @@ function test220 %TEST220 test mask C=Z, iso case -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; -GB_mex_burble (0) ; +GB_mex_burble (1) ; n = 100 ; Cin.matrix = spones (sprand (n, n, 0.01)) ; Cin.sparsity = 1 ; diff --git a/GraphBLAS/Test/test221.m b/GraphBLAS/Test/test221.m index 48058a4094..51032704f5 100644 --- a/GraphBLAS/Test/test221.m +++ b/GraphBLAS/Test/test221.m @@ -1,7 +1,7 @@ function test221 %TEST221 test C += A where C is bitmap and A is full -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test222.m b/GraphBLAS/Test/test222.m index 6b003549d6..42316bea44 100644 --- a/GraphBLAS/Test/test222.m +++ b/GraphBLAS/Test/test222.m @@ -1,7 +1,7 @@ function test222 %TEST222 test user selectop for iso matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test223.m b/GraphBLAS/Test/test223.m index 1a24be2ab9..25e0a01861 100644 --- a/GraphBLAS/Test/test223.m +++ b/GraphBLAS/Test/test223.m @@ -1,7 +1,7 @@ function test223 %TEST223 test matrix multiply, C=A*B -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % tests the Coarse Gustavson method for C=A*B, for the case when diff --git a/GraphBLAS/Test/test224.m b/GraphBLAS/Test/test224.m index a322627fec..bed21840b9 100644 --- a/GraphBLAS/Test/test224.m +++ b/GraphBLAS/Test/test224.m @@ -1,7 +1,7 @@ function test224 %TEST224 unpack/pack -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') diff --git a/GraphBLAS/Test/test225.m b/GraphBLAS/Test/test225.m index 97de370652..eaa61f6257 100644 --- a/GraphBLAS/Test/test225.m +++ b/GraphBLAS/Test/test225.m @@ -1,7 +1,7 @@ function test225 %TEST225 test mask operations (GB_masker) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % GB_mex_burble (1) ; diff --git a/GraphBLAS/Test/test226.m b/GraphBLAS/Test/test226.m index efaecd839d..41f77fd3d3 100644 --- a/GraphBLAS/Test/test226.m +++ b/GraphBLAS/Test/test226.m @@ -1,7 +1,7 @@ function test226 %TEST226 test kron with iso matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test227.m b/GraphBLAS/Test/test227.m index 47550ee23d..98e75da2e2 100644 --- a/GraphBLAS/Test/test227.m +++ b/GraphBLAS/Test/test227.m @@ -1,7 +1,7 @@ function test227 %TEST227 test kron -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, ~, ~, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test228.m b/GraphBLAS/Test/test228.m index dc1a6cc945..05b53bcfd8 100644 --- a/GraphBLAS/Test/test228.m +++ b/GraphBLAS/Test/test228.m @@ -1,7 +1,7 @@ function test228 %TEST228 test serialize/deserialize for all sparsity formats -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test228 C = serialize (A) for all sparsity formats and all types\n') ; diff --git a/GraphBLAS/Test/test229.m b/GraphBLAS/Test/test229.m index 4ebf743376..82dc712237 100644 --- a/GraphBLAS/Test/test229.m +++ b/GraphBLAS/Test/test229.m @@ -1,7 +1,7 @@ function test229 %TEST229 set setElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest229: ---- test setElement_* for all types\n') ; @@ -31,7 +31,7 @@ C3 = GB_mex_setElement (A, I0, J0, X, true, true) ; C4 = GB_mex_setElement (A, I0, J0, X, true, true) ; - assert (isequal (C1, C2)) ; + assert (GB_isequal_ignore_32 (C1, C2)) ; assert (isequal (C1, C3)) ; assert (isequal (C1, C4)) ; diff --git a/GraphBLAS/Test/test23.m b/GraphBLAS/Test/test23.m index 42a69c2b78..931c9b0e9a 100644 --- a/GraphBLAS/Test/test23.m +++ b/GraphBLAS/Test/test23.m @@ -1,7 +1,7 @@ function test23(fulltest) %TEST23 test GrB_*_build -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test230.m b/GraphBLAS/Test/test230.m index 0a6d96e786..145ec87654 100644 --- a/GraphBLAS/Test/test230.m +++ b/GraphBLAS/Test/test230.m @@ -1,7 +1,7 @@ function test230 %TEST230 test GrB_apply with idxunop -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~, idxunops] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test231.m b/GraphBLAS/Test/test231.m index e34f702643..f78028d57e 100644 --- a/GraphBLAS/Test/test231.m +++ b/GraphBLAS/Test/test231.m @@ -1,7 +1,7 @@ function test231 %TEST231 test GrB_select with idxunp -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~, idxunops] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test232.m b/GraphBLAS/Test/test232.m index 0b83f52538..e0d9433f49 100644 --- a/GraphBLAS/Test/test232.m +++ b/GraphBLAS/Test/test232.m @@ -1,7 +1,7 @@ function test232 %TEST232 test assign with GrB_Scalar -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~, ~] = GB_spec_opsall ; @@ -24,23 +24,25 @@ for trial = 0:3 if (trial == 0 || trial == 3) - I1 = [1 3 5] ; + I1 = [1 3 5]' ; else I1 = 3 ; end I0 = uint64 (I1) - 1 ; + I2 = uint32 (I0) ; for n = [1 9] if (n == 1) J1 = 1 ; elseif (trial == 1 || trial == 3) - J1 = [1 2 5] ; + J1 = [1 2 5]' ; else J1 = 2 ; end J0 = uint64 (J1) - 1 ; + J2 = uint32 (J0) ; fprintf ('.') ; C = GB_spec_random (m, n, 0.8, 100, type) ; @@ -56,34 +58,64 @@ C1 = GB_mex_assign_scalar (C, [ ], accum, S1, I0, J0, [ ]) ; C2 = GB_spec_assign (C, [ ], accum, S1, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_assign_scalar (C, [ ], accum, S1, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; + % using GrB_Vector: 32-bit + C1 = GB_mex_assign_scalar (C, [ ], accum, S1, I2, J2, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_assign_scalar (C, [ ], accum, S0, I0, J0, [ ]) ; C2 = GB_spec_assign (C, [ ], accum, S0, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_assign_scalar (C, [ ], accum, S0, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_subassign_scalar (C, [ ], accum, S1, I0, J0, [ ]) ; C2 = GB_spec_subassign (C, [ ], accum, S1, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_subassign_scalar (C, [ ], accum, S1, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; + % using GrB_Vector: 32-bit + C1 = GB_mex_subassign_scalar (C, [ ], accum, S1, I2, J2, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_subassign_scalar (C, [ ], accum, S0, I0, J0, [ ]) ; C2 = GB_spec_subassign (C, [ ], accum, S0, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_subassign_scalar (C, [ ], accum, S0, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_assign_scalar (C, [ ], [ ], S1, I0, J0, [ ]) ; C2 = GB_spec_assign (C, [ ], [ ], S1, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_assign_scalar (C, [ ], [ ], S1, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_assign_scalar (C, [ ], [ ], S0, I0, J0, [ ]) ; C2 = GB_spec_assign (C, [ ], [ ], S0, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_assign_scalar (C, [ ], [ ], S0, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_subassign_scalar (C, [ ], [ ], S1, I0, J0, [ ]) ; C2 = GB_spec_subassign (C, [ ], [ ], S1, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + C1 = GB_mex_subassign_scalar (C, [ ], [ ], S1, I0, J0, [ ], 1) ; + GB_spec_compare (C1, C2) ; C1 = GB_mex_subassign_scalar (C, [ ], [ ], S0, I0, J0, [ ]) ; C2 = GB_spec_subassign (C, [ ], [ ], S0, I1, J1, [ ], 1) ; GB_spec_compare (C1, C2) ; + % using GrB_Vector: + GB_spec_compare (C1, C2) ; + C1 = GB_mex_subassign_scalar (C, [ ], [ ], S0, I0, J0, [ ], 1) ; end end diff --git a/GraphBLAS/Test/test234.m b/GraphBLAS/Test/test234.m index b2d8a53662..963f7c33b3 100644 --- a/GraphBLAS/Test/test234.m +++ b/GraphBLAS/Test/test234.m @@ -1,7 +1,7 @@ function test234(tasks) %TEST234 test GxB_eWiseUnion -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test235.m b/GraphBLAS/Test/test235.m index ecb05d9458..d82413c21f 100644 --- a/GraphBLAS/Test/test235.m +++ b/GraphBLAS/Test/test235.m @@ -1,7 +1,7 @@ function test235 %TEST235 test GxB_eWiseUnion and GrB_eWiseAdd -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test236.m b/GraphBLAS/Test/test236.m index 9d79314c52..90388c415d 100644 --- a/GraphBLAS/Test/test236.m +++ b/GraphBLAS/Test/test236.m @@ -1,7 +1,7 @@ function test236 %TEST236 test GxB_Matrix_sort and GxB_Vector_sort -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [~, ~, ~, types, ~, ~] = GB_spec_opsall ; @@ -48,6 +48,29 @@ [C2,P2] = GB_spec_Matrix_sort (lt, A, [ ]) ; GB_spec_compare (P1, P2) ; + P1 = GB_mex_Matrix_sort (lt, A, [ ], 1, 'int32') ; + assert (isequal (P1.class, 'int32')) ; + P1.class = 'int64' ; + GB_spec_compare (P1, P2) ; + + P1 = GB_mex_Matrix_sort (lt, A, [ ], 1, 'uint32') ; + assert (isequal (P1.class, 'uint32')) ; + P1.class = 'int64' ; + GB_spec_compare (P1, P2) ; + + try + P1 = GB_mex_Matrix_sort (lt, A, [ ], 1, 'double') ; + ok = 0 ; + catch me + ok = 1 ; + end + assert (ok) ; + + P1 = GB_mex_Matrix_sort (lt, A, [ ], 1, 'uint64') ; + assert (isequal (P1.class, 'uint64')) ; + P1.class = 'int64' ; + GB_spec_compare (P1, P2) ; + C1 = GB_mex_Matrix_sort (gt, A) ; C2 = GB_spec_Matrix_sort (gt, A, [ ]) ; GB_spec_compare (C1, C2) ; @@ -151,6 +174,7 @@ fprintf (' typecast') ; lt.optype = 'single' ; gt.optype = 'single' ; +is_csc = 1 ; A = GB_spec_random (m, n, 0.3, 100, 'double', is_csc) ; diff --git a/GraphBLAS/Test/test237.m b/GraphBLAS/Test/test237.m index 8922714d46..f616c72266 100644 --- a/GraphBLAS/Test/test237.m +++ b/GraphBLAS/Test/test237.m @@ -1,7 +1,7 @@ function test237 %TEST237 test GrB_mxm (saxpy4) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_burble (1) ; @@ -44,9 +44,9 @@ % typecasting (to trigger the JIT) A.class = 'single' ; - C1 = GB_mex_mxm (F, [ ], accum, semiring, A, B, [ ]) ; - C2 = GB_spec_mxm (F, [ ], accum, semiring, A, B, [ ]) ; - GB_spec_compare (C2, C1, 0, tol) ; + C1s = GB_mex_mxm (F, [ ], accum, semiring, A, B, [ ]) ; + C2s = GB_spec_mxm (F, [ ], accum, semiring, A, B, [ ]) ; + GB_spec_compare (C2s, C1s, 0, tol) ; end diff --git a/GraphBLAS/Test/test238.m b/GraphBLAS/Test/test238.m index 0ca4581762..44696fdd20 100644 --- a/GraphBLAS/Test/test238.m +++ b/GraphBLAS/Test/test238.m @@ -1,7 +1,7 @@ function test238(tasks) %TEST238 test GrB_mxm (dot4 and dot2) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test238b.m b/GraphBLAS/Test/test238b.m index bf030385fe..b03950bf35 100644 --- a/GraphBLAS/Test/test238b.m +++ b/GraphBLAS/Test/test238b.m @@ -1,7 +1,7 @@ function test238b(tasks) %TEST238B test GrB_mxm (dot4 and dot2) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test239.m b/GraphBLAS/Test/test239.m index 2004788a10..f839501542 100644 --- a/GraphBLAS/Test/test239.m +++ b/GraphBLAS/Test/test239.m @@ -1,7 +1,7 @@ function test239 %TEST239 test GxB_eWiseUnion -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test240.m b/GraphBLAS/Test/test240.m index 9de98ec37e..90b1b3dfbf 100644 --- a/GraphBLAS/Test/test240.m +++ b/GraphBLAS/Test/test240.m @@ -1,7 +1,7 @@ function test240 %TEST240 test GrB_mxm: dot4, saxpy4, saxpy5 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test241.m b/GraphBLAS/Test/test241.m index 2d7c8e6676..9f4599b636 100644 --- a/GraphBLAS/Test/test241.m +++ b/GraphBLAS/Test/test241.m @@ -1,7 +1,7 @@ function test241 %TEST241 test GrB_mxm: swap_rule -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test241 -------- GrB_mxm swap_rule\n') ; diff --git a/GraphBLAS/Test/test242.m b/GraphBLAS/Test/test242.m index 118927b001..0fa98c477b 100644 --- a/GraphBLAS/Test/test242.m +++ b/GraphBLAS/Test/test242.m @@ -1,7 +1,7 @@ function test242 %TEST242 test GxB_Iterator for matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test243.m b/GraphBLAS/Test/test243.m index 740093d145..e301ca179b 100644 --- a/GraphBLAS/Test/test243.m +++ b/GraphBLAS/Test/test243.m @@ -1,7 +1,7 @@ function test243 %TEST243 test GxB_Vector_Iterator -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -120,6 +120,10 @@ y1 = GB_mex_dot_iterator (X, Y, 3) ; GB_spec_compare (y0, y1, 0, tol) ; + % with vector iterator, brute force, with functions, deep and jumbled + y1 = GB_mex_dot_iterator (X, Y, -3) ; + GB_spec_compare (y0, y1, 0, tol) ; + end fprintf ('\n') ; end diff --git a/GraphBLAS/Test/test244.m b/GraphBLAS/Test/test244.m index 68883f7692..b303f5d930 100644 --- a/GraphBLAS/Test/test244.m +++ b/GraphBLAS/Test/test244.m @@ -1,7 +1,7 @@ function test244(tasks) %TEST244 test reshape -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/test245.m b/GraphBLAS/Test/test245.m index 5692f7784c..653b99b66f 100644 --- a/GraphBLAS/Test/test245.m +++ b/GraphBLAS/Test/test245.m @@ -1,7 +1,7 @@ function test245 %TEST245 test colscale (A*D) and rowscale (D*B) with complex types -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test246.m b/GraphBLAS/Test/test246.m index fe2214b54a..4abb697b3c 100644 --- a/GraphBLAS/Test/test246.m +++ b/GraphBLAS/Test/test246.m @@ -6,7 +6,7 @@ function test246 (dohack) % it the test coverage might vary, or even be zero. See also test247.m. % It is thus run for many trials below. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test246: testing of GB_AxB_saxpy3_fineHash_phase2.c\n') ; @@ -26,8 +26,7 @@ function test246 (dohack) if (nargin < 1) dohack = 2 ; % use 0 for default, 2 for prior setting in v7.2.0 end -hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced -GB_mex_hack (hack) ; +hack (1) = dohack ; GB_mex_hack (hack) ; % "very_costly" in saxpy3 semiring.multiply = 'times' ; semiring.add = 'plus' ; diff --git a/GraphBLAS/Test/test247.m b/GraphBLAS/Test/test247.m index ca0ce96433..fdbb2ed52a 100644 --- a/GraphBLAS/Test/test247.m +++ b/GraphBLAS/Test/test247.m @@ -6,7 +6,7 @@ % it the test coverage might vary, or even be zero. See also test246.m. % It is thus run many times. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test249.m b/GraphBLAS/Test/test249.m index 55b0a6f9e8..077b33ae17 100644 --- a/GraphBLAS/Test/test249.m +++ b/GraphBLAS/Test/test249.m @@ -1,7 +1,7 @@ function test249 %TEST249 GxB_Context object tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 nthreads_set (2 * maxNumCompThreads) ; diff --git a/GraphBLAS/Test/test250.m b/GraphBLAS/Test/test250.m index a250dd79e5..7b9bf3f9d2 100644 --- a/GraphBLAS/Test/test250.m +++ b/GraphBLAS/Test/test250.m @@ -1,7 +1,7 @@ function test250 %TEST250 JIT tests, set/get, other tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test11 ; diff --git a/GraphBLAS/Test/test251.m b/GraphBLAS/Test/test251.m index 60fa7b1274..7f39a3404b 100644 --- a/GraphBLAS/Test/test251.m +++ b/GraphBLAS/Test/test251.m @@ -2,7 +2,7 @@ function test251(tasks) %TEST251 test dot4 for plus-pair semirings % GB_AxB_dot4 computes C+=A'*B when C is dense. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: test coverage should start with an empty JIT cache. diff --git a/GraphBLAS/Test/test251b.m b/GraphBLAS/Test/test251b.m index afa80c14f3..d5adf0f79e 100644 --- a/GraphBLAS/Test/test251b.m +++ b/GraphBLAS/Test/test251b.m @@ -2,7 +2,7 @@ function test251b(tasks) %TEST251B test dot4 for plus-pair semirings % GB_AxB_dot4 computes C+=A'*B when C is dense. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % NOTE: test coverage should start with an empty JIT cache. diff --git a/GraphBLAS/Test/test252.m b/GraphBLAS/Test/test252.m index 22fa63591b..c94f2ad3ff 100644 --- a/GraphBLAS/Test/test252.m +++ b/GraphBLAS/Test/test252.m @@ -1,7 +1,7 @@ function test252 %TEST252 basic tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test12 ; diff --git a/GraphBLAS/Test/test253.m b/GraphBLAS/Test/test253.m index 988a13dbcb..ff7a901cbc 100644 --- a/GraphBLAS/Test/test253.m +++ b/GraphBLAS/Test/test253.m @@ -1,7 +1,7 @@ function test253 %TEST253 basic tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test13 ; diff --git a/GraphBLAS/Test/test254.m b/GraphBLAS/Test/test254.m index 26e2616db7..4c07d3270c 100644 --- a/GraphBLAS/Test/test254.m +++ b/GraphBLAS/Test/test254.m @@ -1,7 +1,7 @@ function test254 %TEST254 test masks with all types -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test254 ------------ C=A+B with different masks\n') ; diff --git a/GraphBLAS/Test/test255.m b/GraphBLAS/Test/test255.m index dde7466f52..49e3812695 100644 --- a/GraphBLAS/Test/test255.m +++ b/GraphBLAS/Test/test255.m @@ -1,7 +1,7 @@ function test255 %TEST255 basic tests -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test14 ; diff --git a/GraphBLAS/Test/test256.m b/GraphBLAS/Test/test256.m index dd8f4b69e9..d0e707d924 100644 --- a/GraphBLAS/Test/test256.m +++ b/GraphBLAS/Test/test256.m @@ -1,7 +1,7 @@ function test256 %TEST256 JIT error handling -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test15 ; diff --git a/GraphBLAS/Test/test257.m b/GraphBLAS/Test/test257.m index b055808f9e..868fa2f863 100644 --- a/GraphBLAS/Test/test257.m +++ b/GraphBLAS/Test/test257.m @@ -1,7 +1,7 @@ function test257 %TEST257 JIT error handling -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test16 ; diff --git a/GraphBLAS/Test/test258.m b/GraphBLAS/Test/test258.m index 754bbdcca0..d9214bc9eb 100644 --- a/GraphBLAS/Test/test258.m +++ b/GraphBLAS/Test/test258.m @@ -1,7 +1,7 @@ function test258 %TEST258 reduce to vector with user-defined type -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test17 ; diff --git a/GraphBLAS/Test/test259.m b/GraphBLAS/Test/test259.m index 22b55adce9..9e643ffc02 100644 --- a/GraphBLAS/Test/test259.m +++ b/GraphBLAS/Test/test259.m @@ -1,7 +1,7 @@ function test259 %TEST259 test with plus_plus semiring -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test259 ---C+=A''*B when C is dense, with dot4, plus_plus_fp32\n') ; diff --git a/GraphBLAS/Test/test260.m b/GraphBLAS/Test/test260.m index ae48e640cb..56e77ce20f 100644 --- a/GraphBLAS/Test/test260.m +++ b/GraphBLAS/Test/test260.m @@ -1,7 +1,7 @@ function test260 %TEST260 test demacrofy -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test18 ; diff --git a/GraphBLAS/Test/test261.m b/GraphBLAS/Test/test261.m index 0261a035fb..0a20294b34 100644 --- a/GraphBLAS/Test/test261.m +++ b/GraphBLAS/Test/test261.m @@ -1,7 +1,7 @@ function test261 %TEST261 test serialize/deserialize -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test19 ; diff --git a/GraphBLAS/Test/test262.m b/GraphBLAS/Test/test262.m index b761e8ddcf..4dac25b185 100644 --- a/GraphBLAS/Test/test262.m +++ b/GraphBLAS/Test/test262.m @@ -1,7 +1,7 @@ function test262 %TEST262 test GB_mask -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test20 ; diff --git a/GraphBLAS/Test/test263.m b/GraphBLAS/Test/test263.m index 0e8c5e0ebf..6c45589acb 100644 --- a/GraphBLAS/Test/test263.m +++ b/GraphBLAS/Test/test263.m @@ -1,7 +1,7 @@ function test263 %TEST263 test JIT -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test263 ------------ jit tests\n') ; diff --git a/GraphBLAS/Test/test264.m b/GraphBLAS/Test/test264.m index 77614e4f10..c67808d7f2 100644 --- a/GraphBLAS/Test/test264.m +++ b/GraphBLAS/Test/test264.m @@ -1,7 +1,7 @@ function test264 %TEST264 test enumify/macrofy -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test21 ; diff --git a/GraphBLAS/Test/test265.m b/GraphBLAS/Test/test265.m index abe20c525a..a8bde240e0 100644 --- a/GraphBLAS/Test/test265.m +++ b/GraphBLAS/Test/test265.m @@ -1,7 +1,7 @@ function test265 %TEST265 test enumify/macrofy -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test22 ; diff --git a/GraphBLAS/Test/test267.m b/GraphBLAS/Test/test267.m index e6c4800981..8bb96790bb 100644 --- a/GraphBLAS/Test/test267.m +++ b/GraphBLAS/Test/test267.m @@ -1,7 +1,7 @@ function test267 %TEST267 test JIT error handling -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test24 ; diff --git a/GraphBLAS/Test/test268.m b/GraphBLAS/Test/test268.m index a8f835f248..bcd6a0a79e 100644 --- a/GraphBLAS/Test/test268.m +++ b/GraphBLAS/Test/test268.m @@ -1,7 +1,7 @@ function test268 %TEST268 test sparse masker, C=Z -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test269.m b/GraphBLAS/Test/test269.m index 7499482c72..2380f7b6c7 100644 --- a/GraphBLAS/Test/test269.m +++ b/GraphBLAS/Test/test269.m @@ -1,7 +1,7 @@ function test269 %TEST269 test GrB_get / GrB_set for types, scalars, vectors, and matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test26 ; diff --git a/GraphBLAS/Test/test270.m b/GraphBLAS/Test/test270.m index ef47b3e291..784478b09f 100644 --- a/GraphBLAS/Test/test270.m +++ b/GraphBLAS/Test/test270.m @@ -1,7 +1,7 @@ function test270 %TEST270 test GrB_get / GrB_set for unary ops -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test27 ; diff --git a/GraphBLAS/Test/test271.m b/GraphBLAS/Test/test271.m index d894881954..e333cbe6cd 100644 --- a/GraphBLAS/Test/test271.m +++ b/GraphBLAS/Test/test271.m @@ -1,7 +1,7 @@ function test271 %TEST271 test GrB_get / GrB_set for binary ops -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test28 ; diff --git a/GraphBLAS/Test/test272.m b/GraphBLAS/Test/test272.m index 2efc364d82..cb65c07469 100644 --- a/GraphBLAS/Test/test272.m +++ b/GraphBLAS/Test/test272.m @@ -1,7 +1,7 @@ function test272 %TEST272 test Context -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test25 ; diff --git a/GraphBLAS/Test/test273.m b/GraphBLAS/Test/test273.m index d6ab27b54d..52c9e914ce 100644 --- a/GraphBLAS/Test/test273.m +++ b/GraphBLAS/Test/test273.m @@ -1,7 +1,7 @@ function test273 %TEST273 test Global get/set -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test29 ; diff --git a/GraphBLAS/Test/test274.m b/GraphBLAS/Test/test274.m index 0e6ea92271..8443500710 100644 --- a/GraphBLAS/Test/test274.m +++ b/GraphBLAS/Test/test274.m @@ -1,7 +1,7 @@ function test274 %TEST274 test get/set for IndexUnary ops -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test30 ; diff --git a/GraphBLAS/Test/test275.m b/GraphBLAS/Test/test275.m index b6238edafb..1d6cc50cf1 100644 --- a/GraphBLAS/Test/test275.m +++ b/GraphBLAS/Test/test275.m @@ -1,7 +1,7 @@ function test275 %TEST275 test get/set for monoids -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test31 ; diff --git a/GraphBLAS/Test/test276.m b/GraphBLAS/Test/test276.m index 832a5c1794..2334c616e2 100644 --- a/GraphBLAS/Test/test276.m +++ b/GraphBLAS/Test/test276.m @@ -1,7 +1,7 @@ function test276 %TEST276 test get/set for semirings -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test32 ; diff --git a/GraphBLAS/Test/test277.m b/GraphBLAS/Test/test277.m index c84d58d820..45fd60d360 100644 --- a/GraphBLAS/Test/test277.m +++ b/GraphBLAS/Test/test277.m @@ -1,7 +1,7 @@ function test277 %TEST277 test get/set for context -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test33 ; diff --git a/GraphBLAS/Test/test278.m b/GraphBLAS/Test/test278.m index b594294c13..a76490f83e 100644 --- a/GraphBLAS/Test/test278.m +++ b/GraphBLAS/Test/test278.m @@ -1,7 +1,7 @@ function test278 %TEST278 test get/set for descriptor -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test34 ; diff --git a/GraphBLAS/Test/test279.m b/GraphBLAS/Test/test279.m index cb5a68c705..47a78da5fc 100644 --- a/GraphBLAS/Test/test279.m +++ b/GraphBLAS/Test/test279.m @@ -1,7 +1,7 @@ function test279 %TEST279 test get/set for serialized blob -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 GB_mex_test35 ; diff --git a/GraphBLAS/Test/test280.m b/GraphBLAS/Test/test280.m index 31d7e21568..c2b6cfa734 100644 --- a/GraphBLAS/Test/test280.m +++ b/GraphBLAS/Test/test280.m @@ -1,38 +1,47 @@ function test280(quick) %TEST280 subassign method 26 -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) - quick = 1 ; + quick = 0 ; end rng ('default') ; +% quick: 0 tic load west0479 GB_mex_grow (west0479) ; toc -tic -n = 10000 ; -nz = 10e6 ; -A = sprand (n, n, nz/n^2) ; -GB_mex_grow (A) ; -toc +if (quick >= 1) + tic + n = 1e5 ; + nz = 10e6 ; + A = sprand (n, n, nz/n^2) ; + GB_mex_grow (A) ; + toc +end -tic -if (quick) +if (quick >= 2) n = 1e6 ; nz = 1e5 ; -else + tic + A = sprand (n, n, nz/n^2) ; + GB_mex_grow (A) ; + toc +end + +if (quick >= 2) n = 2e6 ; nz = 10e6 ; + tic + A = sprand (n, n, nz/n^2) ; + GB_mex_grow (A) ; + toc end -A = sprand (n, n, nz/n^2) ; -GB_mex_grow (A) ; -toc fprintf ('test280 all tests passed.\n') ; diff --git a/GraphBLAS/Test/test281.m b/GraphBLAS/Test/test281.m index 7610be16f6..6944e14444 100644 --- a/GraphBLAS/Test/test281.m +++ b/GraphBLAS/Test/test281.m @@ -1,7 +1,7 @@ function test281 %TEST281 test GrB_apply with user-defined idxunp -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n--- testing apply with user-defined idxunop (no JIT)\n') ; diff --git a/GraphBLAS/Test/test282.m b/GraphBLAS/Test/test282.m index ed15ba93b1..fa59316ff8 100644 --- a/GraphBLAS/Test/test282.m +++ b/GraphBLAS/Test/test282.m @@ -1,7 +1,7 @@ function test282 %TEST282 test argmax with index binary op -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n--- testing argmax with user-defined index binary op\n') ; diff --git a/GraphBLAS/Test/test283.m b/GraphBLAS/Test/test283.m index c7322f756e..7b6f71c7d4 100644 --- a/GraphBLAS/Test/test283.m +++ b/GraphBLAS/Test/test283.m @@ -1,7 +1,7 @@ function test283 %TEST283 test index binary op -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n--- testing ewise with user-defined index binary op\n') ; diff --git a/GraphBLAS/Test/test284.m b/GraphBLAS/Test/test284.m index 7038eaa960..0cc9879d86 100644 --- a/GraphBLAS/Test/test284.m +++ b/GraphBLAS/Test/test284.m @@ -1,7 +1,7 @@ function test284 %TEST284 test GrB_mxm using indexop-based semirings -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest284: GrB_mxm with indexop-based semirings\n') ; diff --git a/GraphBLAS/Test/test285.m b/GraphBLAS/Test/test285.m index 74669843cd..7a6840a3e4 100644 --- a/GraphBLAS/Test/test285.m +++ b/GraphBLAS/Test/test285.m @@ -1,7 +1,7 @@ function test285 %TEST285 test GrB_assign (bitmap case, C+=A, whole matrix) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % tests GB_bitmap_assign_7_whole @@ -32,35 +32,35 @@ % C(I,J) = accum (C (I,J),A) C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; -GrB.burble (1) ; +GB_mex_burble (1) ; C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; -GrB.burble (0) ; +GB_mex_burble (0) ; GB_spec_compare (C0, C1) ; % C(I,J) = accum (C (I,J),A), with int16 mask matrix M M.matrix = ceil (M.matrix) ; M.class = 'int16' ; C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; -GrB.burble (1) ; +GB_mex_burble (1) ; C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; -GrB.burble (0) ; +GB_mex_burble (0) ; GB_spec_compare (C0, C1) ; % C(I,J) = accum (C (I,J),A), with int32 mask matrix M M.matrix = ceil (M.matrix) ; M.class = 'int32' ; C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; -GrB.burble (1) ; +GB_mex_burble (1) ; C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; -GrB.burble (0) ; +GB_mex_burble (0) ; GB_spec_compare (C0, C1) ; % C(I,J) = accum (C (I,J),A), with double complex mask matrix M M.class = 'double complex' ; C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; -GrB.burble (1) ; +GB_mex_burble (1) ; C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; -GrB.burble (0) ; +GB_mex_burble (0) ; GB_spec_compare (C0, C1) ; fprintf ('\ntest285: all tests passed\n') ; diff --git a/GraphBLAS/Test/test286.m b/GraphBLAS/Test/test286.m index eec70b6c7c..eba1a835d1 100644 --- a/GraphBLAS/Test/test286.m +++ b/GraphBLAS/Test/test286.m @@ -1,7 +1,7 @@ function test286 %TEST286 test kron with idxop -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; @@ -11,9 +11,7 @@ for btrans = 0:1 C2 = GB_spec_kron_idx (A, B, atrans, btrans) ; for csc = 0:1 -% GrB.burble (1) ; C = GB_mex_kron_idx (A, B, atrans, btrans, csc) ; -% GrB.burble (0) ; assert (isequal (C, C2)) ; end end diff --git a/GraphBLAS/Test/test287.m b/GraphBLAS/Test/test287.m new file mode 100644 index 0000000000..45874e6614 --- /dev/null +++ b/GraphBLAS/Test/test287.m @@ -0,0 +1,9 @@ +function test287 +%TEST287 misc tests + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test38 ; +fprintf ('\ntest287: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test288.m b/GraphBLAS/Test/test288.m new file mode 100644 index 0000000000..2566d358be --- /dev/null +++ b/GraphBLAS/Test/test288.m @@ -0,0 +1,9 @@ +function test288 +%TEST288 load/unload tests + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test39 ; +fprintf ('\ntest288: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test289.m b/GraphBLAS/Test/test289.m new file mode 100644 index 0000000000..f0d4f553d6 --- /dev/null +++ b/GraphBLAS/Test/test289.m @@ -0,0 +1,62 @@ +function test289 +%TEST289 test the Container for all sparsity formats + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test289 ----------- C = A using load/unload of a Container\n') ; + +[~, ~, ~, types, ~, ~] = GB_spec_opsall ; +types = types.all ; +GB_mex_burble (0) ; + +rng ('default') ; + +% empty hypersparse test +B = GB_spec_random (10, 10, 0, 128, 'double') ; +B.sparsity = 1 ; +C = GB_mex_container (B) ; +GB_spec_compare (B, C) ; + +for k1 = 1:length (types) + atype = types {k1} ; + fprintf ('\n%s', atype) ; + for d = [0.5 inf] + fprintf (' ') ; + % matrix case + A = GB_spec_random (10, 10, d, 128, atype) ; + for A_sparsity = 0:15 + fprintf ('.') ; + A.sparsity = A_sparsity ; + C = GB_mex_container (A) ; + GB_spec_compare (A, C) ; + end + fprintf (':') ; + % emtpy hypersparse case + B = GB_spec_random (10, 10, 0, 128, atype) ; + B.sparsity = 1 ; + C = GB_mex_container (B) ; + GB_spec_compare (B, C) ; + fprintf (':') ; + % vector case + V = GB_spec_random (10, 1, d, 128, atype) ; + for V_sparsity = 0:15 + fprintf ('.') ; + V.sparsity = V_sparsity ; + C = GB_mex_container (V) ; + GB_spec_compare (V, C) ; + end + end +end + +% iso test +clear A +A.matrix = pi * spones (sprand (10, 10, 0.2)) ; +A.iso = true ; +C = GB_mex_container (A) ; +GB_spec_compare (A, C) ; + +fprintf ('\n') ; +GB_mex_burble (0) ; +fprintf ('\ntest289: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test29.m b/GraphBLAS/Test/test29.m index 83c21743f6..dc703b6200 100644 --- a/GraphBLAS/Test/test29.m +++ b/GraphBLAS/Test/test29.m @@ -1,22 +1,26 @@ function test29 -%TEST29 GrB_reduce with zombies +%TEST29 test GrB_reduce -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +% In past versions of GraphBLAS, this method caused the reduction to be done +% on a matrix with zombies. It no longer does so, but still is important +% for test coverage of a reduction to scalar. + [~, ~, add_ops, types, ~, ~] = GB_spec_opsall ; types = types.all ; -fprintf ('\ntest29: ----------------- GrB_reduce with zombies\n') ; +fprintf ('\ntest29: ----------------- GrB_reduce\n') ; for m = [1 5 10] for n = [1 5 10] - fprintf ('.') ; rng ('default') ; for k3 = 1:length (types) atype = types {k3} ; + fprintf ('.') ; for builtin = 0:1 GB_builtin_complex_set (builtin) ; diff --git a/GraphBLAS/Test/test290.m b/GraphBLAS/Test/test290.m new file mode 100644 index 0000000000..c233c22c3e --- /dev/null +++ b/GraphBLAS/Test/test290.m @@ -0,0 +1,22 @@ +function test290 +%TEST290 test bitmap_subref on a large matrix + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% This takes about 93 seconds when GraphBLAS is compiled with GB_DEBUG + +n = 3e9 ; +A = ones (n,2, 'int8') ; +A (1:2, 1:2) = [2 3 ; 4 5] ; +I = uint64 (0:1) ; +fprintf ('subref starting ...\n') ; +C = GB_mex_subref_symbolic (A, I, I) ; +fprintf ('subref done ...\n') ; +S = [ 0 3000000000 + 1 3000000001 ] ; +S = uint64 (S) ; +assert (isequal (C.matrix, S)) ; + +fprintf ('test290: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test291.m b/GraphBLAS/Test/test291.m new file mode 100644 index 0000000000..52c7e33a55 --- /dev/null +++ b/GraphBLAS/Test/test291.m @@ -0,0 +1,9 @@ +function test291 +%TEST291 test GB_ix_realloc + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test40 ; +fprintf ('test291: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test292.m b/GraphBLAS/Test/test292.m new file mode 100644 index 0000000000..bef418331d --- /dev/null +++ b/GraphBLAS/Test/test292.m @@ -0,0 +1,49 @@ +function test292 +%TEST292 test GxB_Vector_build_Scalar_Vector with a very large vector + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% get the amount of memory available +q = '''' ; +if (ismac) + % Mac + cmd = sprintf ('memory_pressure | awk %s/The system has/ { print $4}%s', q, q) ; + [status, result] = system (cmd) ; + memory = str2double (result) ; +elseif (ispc) + % Windows: not supported + memory = 0 ; +else + % Linux + cmd = sprintf ('cat /proc/meminfo | awk %s/MemTotal/ { print $2}%s', q, q) ; + [status, result] = system (cmd) ; + memory = str2double (result) * 1024 ; +end + +% this test takes about 16*n bytes of memory +n = 5e9 ; +if (memory > n * 16) + + [nth chunk] = nthreads_get ; + nthreads_set (8) ; + GB_mex_burble (1) ; + X = ones (n, 1, 'int8') ; + s = int8 (3) ; + op.opname = 'plus' ; + op.optype = 'int8' ; + desc.rowindex_list = 'use_indices' ; + V = GB_mex_Vector_build (X, s, n, op, 'int8', desc) ; + assert (nnz (V.matrix) == n) + assert (size (V.matrix,1) == n) ; + assert (min (V.matrix) == 3) ; + assert (max (V.matrix) == 3) ; + nthreads_set (nth, chunk) ; + GB_mex_burble (0) ; + fprintf ('test292: all tests passed\n') ; + +else + + fprintf ('test292: skipped\n') ; + +end diff --git a/GraphBLAS/Test/test293.m b/GraphBLAS/Test/test293.m new file mode 100644 index 0000000000..8245f556fc --- /dev/null +++ b/GraphBLAS/Test/test293.m @@ -0,0 +1,57 @@ +function test293 +%TEST293 merge sort, different integer sizes + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test293 --------------- merge sort, integer cases\n') ; +rng ('default') ; + +n = 1e6 ; +imax = 2e6 ; +I = randi (imax, n, 1) ; +J = randi (imax, n, 1) ; +K = (1:n)' ; + +for i = [32 64] + + if (i == 32) + I0 = uint32 (I) ; + else + I0 = uint64 (I) ; + end + + for k = [32 64] + + if (k == 32) + K0 = uint32 (K) ; + else + K0 = uint64 (K) ; + end + + IK1 = sortrows ([I0 K0]) ; + for nthreads = [1 2 4 8] + fprintf ('.') ; + [a b] = GB_mex_msort_2 (I0, K0, nthreads) ; + assert (isequal (IK1, [a b])) ; + end + + for j = [32 64] + + if (j == 32) + J0 = uint32 (J) ; + else + J0 = uint64 (J) ; + end + + IJK = sortrows ([I0 J0 K0]) ; + for nthreads = [1 2 4 8] + fprintf ('.') ; + [a b c] = GB_mex_msort_3 (I0, J0, K0, nthreads) ; + assert (isequal (IJK, [a b c])) ; + end + end + end +end + +fprintf ('\ntest293 --------------- all tests passed\n') ; diff --git a/GraphBLAS/Test/test294.m b/GraphBLAS/Test/test294.m new file mode 100644 index 0000000000..472ce5ee04 --- /dev/null +++ b/GraphBLAS/Test/test294.m @@ -0,0 +1,28 @@ +function test294 +%TEST294 reduce with zombies + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') ; +fprintf ('test294 --------------- reduce with zombies\n') ; + +n = 10000 ; +d = 0.01 ; +A = sprand (n, n, d) ; +[i j x] = find (A) ; +z = x (2:2:end) ; +s1 = sum (z) ; + +[nth_save chunk_save] = nthreads_get ; + +for nthreads = [1 8] + nthreads_set (nthreads, 1024) ; + s2 = GB_mex_reduce_with_zombies (A) ; + err = abs (s1 - s2) / abs (s1) ; + assert (err < 1e-10) ; +end + +nthreads_set (nth_save, chunk_save) ; +fprintf ('\ntest294: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test295.m b/GraphBLAS/Test/test295.m new file mode 100644 index 0000000000..b463eed3ce --- /dev/null +++ b/GraphBLAS/Test/test295.m @@ -0,0 +1,10 @@ +function test295 +%TEST295 iso hint + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GB_mex_test41 ; + +fprintf ('\ntest295: all tests passed\n') ; + diff --git a/GraphBLAS/Test/test296.m b/GraphBLAS/Test/test296.m new file mode 100644 index 0000000000..a8e84eb846 --- /dev/null +++ b/GraphBLAS/Test/test296.m @@ -0,0 +1,41 @@ +function test296 +%TEST296 test integer overflow in GB_AxB_saxpy3_cumsum.c +% +% See also test_saxpy3.m + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') ; + +n = 1000 ; +nz = 1000 ; +range = int8 ([0 128]) ; + +d = nz / n^2 ; +A = sprand (n, n, d) ; +Cin = sparse (n, n) ; +save = GB_mex_hack ; +hack = save ; + +semiring.add = 'plus' ; +semiring.multiply = 'times' ; +semiring.class = 'double' ; + +for k = 1:2 + + if (k == 2) + hack (5) = 1 ; + GB_mex_hack (hack) ; + end + + C1 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, A, [ ]) ; + C2 = A*A ; + assert (isequal (C1.matrix, C2)) ; + +end + +% restore the flag +GB_mex_hack (save) ; + +fprintf ('test296: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test43.m b/GraphBLAS/Test/test43.m similarity index 98% rename from GraphBLAS/Test/unused/test43.m rename to GraphBLAS/Test/test43.m index 1f642469f7..f770d4f273 100644 --- a/GraphBLAS/Test/unused/test43.m +++ b/GraphBLAS/Test/test43.m @@ -1,7 +1,7 @@ function test43 %TEST43 test subref -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n------------------------------ testing GB_mex_Matrix_subref\n') ; @@ -76,7 +76,7 @@ assert (ok) ; assert (isequal (A1, A2)) ; -fprintf ('builtin %g GrB %g CSparse %g\n', t0, t1, t2) ; +fprintf ('builtin %g GB %g CSparse %g\n', t0, t1, t2) ; n = size (A,1) ; diff --git a/GraphBLAS/Test/test53.m b/GraphBLAS/Test/test53.m index fe966b50cb..419bdbfb0b 100644 --- a/GraphBLAS/Test/test53.m +++ b/GraphBLAS/Test/test53.m @@ -1,7 +1,7 @@ function test53(fulltests) %TEST53 test GrB_Matrix_extract -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) @@ -223,6 +223,12 @@ function test53(fulltests) k6_cases = 4 ; end + if (isempty (I)) + I0 = [ ] ; + else + I0 = I (:) - 1 ; + end + % try several J's for k6 = 1:k6_cases @@ -245,6 +251,12 @@ function test53(fulltests) end nj = length (JJ) ; + if (isempty (J)) + J0 = [ ] ; + else + J0 = J (:) - 1 ; + end + clear Csub Csub2 Csub.matrix = Cin.matrix (1:ni,1:nj) ; @@ -279,31 +291,35 @@ function test53(fulltests) if (A_is_vector) % A is a column vector; test Vector_extract % C = op (Csub,A(I,1)) - C = GB_mex_Vector_extract (Csub, [ ], ... - accum, A, I-1, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; S = GB_spec_Vector_extract (Csub, [ ], ... accum, A, I, [ ]) ; - assert (isequal (C.class, cintype)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (... - full (double (C.matrix)), ... - double (S.matrix))) ; + for method = 0:1 + C = GB_mex_Vector_extract (Csub, [ ], ... + accum, A, I0, [ ], method) ; + assert (GB_spok (C.matrix*1) == 1) ; + assert (isequal (C.class, cintype)) ; + assert (isequal (C.class, S.class)) ; + assert (isequalwithequalnans (... + full (double (C.matrix)), ... + double (S.matrix))) ; + end end if (length (J) == 1) % J is a scalar, test Col_extract % C = op (Csub,A(I,j)) - C = GB_mex_Col_extract (Csub, [ ], ... - accum, A, I-1, J-1, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; S = GB_spec_Col_extract (Csub, [ ], ... accum, A, I, J, [ ]) ; - assert (isequal (C.class, cintype)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (... - full (double (C.matrix)), ... - double (S.matrix))) ; + for method = 0:1 + C = GB_mex_Col_extract (Csub, [ ], ... + accum, A, I0, J0, [ ], method) ; + assert (GB_spok (C.matrix*1) == 1) ; + assert (isequal (C.class, cintype)) ; + assert (isequal (C.class, S.class)) ; + assert (isequalwithequalnans (... + full (double (C.matrix)), ... + double (S.matrix))) ; + end end % C = op (Csub,A(J,I)') @@ -359,16 +375,18 @@ function test53(fulltests) if (A_is_vector) % A is a column vector; test Vector_extract % C = op (Csub,A(I,1)) - C = GB_mex_Vector_extract (Csub, Msub, ... - accum, A, I-1, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; S = GB_spec_Vector_extract (Csub, Msub, ... accum, A, I, [ ]) ; - assert (isequal (C.class, cintype)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (... - full (double (C.matrix)), ... - double (S.matrix))) ; + for method = 0:1 + C = GB_mex_Vector_extract (Csub, ... + Msub, accum, A, I0, [ ], method) ; + assert (GB_spok (C.matrix*1) == 1) ; + assert (isequal (C.class, cintype)) ; + assert (isequal (C.class, S.class)) ; + assert (isequalwithequalnans (... + full (double (C.matrix)), ... + double (S.matrix))) ; + end end if (length (J) == 1) diff --git a/GraphBLAS/Test/test54.m b/GraphBLAS/Test/test54.m index ad2ab445b4..96b17045bb 100644 --- a/GraphBLAS/Test/test54.m +++ b/GraphBLAS/Test/test54.m @@ -1,7 +1,7 @@ function test54 %TEST54 test GB_subref: numeric case with I=lo:hi, J=lo:hi -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest54: ==== quick test for subref and assign (lo:stride:hi):\n') ; @@ -46,10 +46,14 @@ C0 = C ; C0 (ilo:ihi,:) = S ; - I1 = uint64 (ilo:ihi) - 1 ; + I1 = (uint64 (ilo:ihi) - 1)' ; C1 = GB_mex_subassign (C, [ ], [ ], S, I1, [ ], [ ]) ; assert (isequal (C0, C1.matrix)) ; + % with GrB_Vector: + C1 = GB_mex_subassign (C, [ ], [ ], S, I1, [ ], [ ], 5) ; + assert (isequal (C0, C1.matrix)) ; + C1b = GB_mex_assign (C, [ ], [ ], S, I1, [ ], [ ]) ; assert (isequal (C0, C1b.matrix)) ; @@ -69,6 +73,10 @@ C1 = GB_mex_subassign (C, [ ], [ ], S, [ ], I1, [ ]) ; assert (isequal (C0, C1.matrix)) ; + % with GrB_Vector: + C1 = GB_mex_subassign (C, [ ], [ ], S, [ ], I1, [ ], 5) ; + assert (isequal (C0, C1.matrix)) ; + C1b = GB_mex_assign (C, [ ], [ ], S, [ ], I1, [ ]) ; assert (isequal (C0, C1b.matrix)) ; @@ -88,11 +96,15 @@ C0 = C ; C0 (ilo:ihi,jlo:jhi) = S ; - I1 = uint64 (ilo:ihi) - 1 ; - J1 = uint64 (jlo:jhi) - 1 ; + I1 = (uint64 (ilo:ihi) - 1)' ; + J1 = (uint64 (jlo:jhi) - 1)' ; C1 = GB_mex_subassign (C, [ ], [ ], S, I1, J1, [ ]) ; assert (isequal (C0, C1.matrix)) ; + % with GrB_Vector + C1 = GB_mex_subassign (C, [ ], [ ], S, I1, J1, [ ], 5) ; + assert (isequal (C0, C1.matrix)) ; + C1b = GB_mex_assign (C, [ ], [ ], S, I1, J1, [ ]) ; assert (isequal (C0, C1b.matrix)) ; diff --git a/GraphBLAS/Test/test69.m b/GraphBLAS/Test/test69.m index c1981dd0f1..a852c27995 100644 --- a/GraphBLAS/Test/test69.m +++ b/GraphBLAS/Test/test69.m @@ -1,7 +1,7 @@ function test69 %TEST69 test GrB_assign with aliased inputs, C(:,:) = accum(C(:,:),C) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test69 ------------------ assign alias tests\n') ; @@ -27,36 +27,55 @@ C1 = GB_mex_assign_alias (C, 'plus', [ ], [ ], [ ]) ; C2 = GB_mex_assign (C, [ ], 'plus', C, [ ], [ ], [ ], 0) ; assert (isequal (C1, C2)) ; + % using GrB_Vector + C2 = GB_mex_assign (C, [ ], 'plus', C, [ ], [ ], [ ], 7) ; + assert (isequal (C1, C2)) ; % C += C C1 = GB_mex_assign_alias (C, 'plus', [ ], [ ], desc) ; C2 = GB_mex_assign (C, [ ], 'plus', C, [ ], [ ], desc, 0) ; assert (isequal (C1, C2)) ; + % using GrB_Vector + C2 = GB_mex_assign (C, [ ], 'plus', C, [ ], [ ], desc, 7) ; + assert (isequal (C1, C2)) ; % C = C C1 = GB_mex_assign_alias (C, [ ], [ ], [ ], desc) ; C2 = GB_mex_assign (C, [ ], [ ], C, [ ], [ ], desc, 0) ; C2.iso = 0 ; + % using GrB_Vector + assert (isequal (C1, C2)) ; + C2 = GB_mex_assign (C, [ ], [ ], C, [ ], [ ], desc, 7) ; + C2.iso = 0 ; assert (isequal (C1, C2)) ; % C(I,J) += C(I,J) - I = uint64 (randperm (m) - 1) ; - J = uint64 (randperm (n) - 1) ; + I = uint64 (randperm (m) - 1)' ; + J = uint64 (randperm (n) - 1)' ; C1 = GB_mex_assign_alias (C, 'plus', I, J, [ ]) ; C2 = GB_mex_assign (C, [ ], 'plus', C, I, J, [ ], 0) ; - assert (isequal (C1, C2)) ; + assert (GB_isequal_ignore_32 (C1, C2)) ; + % using GrB_Vector + C2 = GB_mex_assign (C, [ ], 'plus', C, I, J, [ ], 7) ; + assert (GB_isequal_ignore_32 (C1, C2)) ; % C += C C1 = GB_mex_subassign_alias (C, 'plus', desc) ; C2 = GB_mex_subassign (C, C, 'plus', C, [ ], [ ], desc) ; assert (isequal (C1, C2)) ; + % using GrB_Vector + C2 = GB_mex_subassign (C, C, 'plus', C, [ ], [ ], desc, 7) ; + assert (isequal (C1, C2)) ; % C = C C1 = GB_mex_subassign_alias (C, [ ], desc) ; C2 = GB_mex_subassign (C, C, [ ], C, [ ], [ ], desc) ; - assert (isequal (C1, C2)) ; + assert (GB_isequal_ignore_32 (C1, C2)) ; + % using GrB_Vector + C2 = GB_mex_subassign (C, C, [ ], C, [ ], [ ], desc, 7) ; + assert (GB_isequal_ignore_32 (C1, C2)) ; - % C(:,:) = 0 + % C(:,:) = 0, using scalar assign Z = GB_mex_expand (sparse (1), 0) ; C1 = GB_mex_subassign (C, [ ], [ ], Z, [ ], [ ], desc) ; C2 = sparse (m, n) ; diff --git a/GraphBLAS/Test/test74.m b/GraphBLAS/Test/test74.m index fe842e55c4..799679b9c8 100644 --- a/GraphBLAS/Test/test74.m +++ b/GraphBLAS/Test/test74.m @@ -1,7 +1,7 @@ function test74 %TEST74 test GrB_mxm: all built-in semirings -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; diff --git a/GraphBLAS/Test/test75b.m b/GraphBLAS/Test/test75b.m index 2dc67b3f95..2ca4e67526 100644 --- a/GraphBLAS/Test/test75b.m +++ b/GraphBLAS/Test/test75b.m @@ -1,7 +1,7 @@ function test75b %TEST75B GrB_mxm and GrB_vxm on all semirings (shorter test than test75) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test75b: test mxm and vxm\n') ; diff --git a/GraphBLAS/Test/test76.m b/GraphBLAS/Test/test76.m index 794173e715..45ed3f5cd5 100644 --- a/GraphBLAS/Test/test76.m +++ b/GraphBLAS/Test/test76.m @@ -1,7 +1,7 @@ function test76 %TEST76 test GxB_resize -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test78.m b/GraphBLAS/Test/test78.m index 5525fb7c1f..4d0331b272 100644 --- a/GraphBLAS/Test/test78.m +++ b/GraphBLAS/Test/test78.m @@ -1,7 +1,7 @@ function test78 %TEST78 test subref -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 n = 500 ; diff --git a/GraphBLAS/Test/test80.m b/GraphBLAS/Test/test80.m index 135ac9b6c8..d2fdca76b5 100644 --- a/GraphBLAS/Test/test80.m +++ b/GraphBLAS/Test/test80.m @@ -1,7 +1,7 @@ function test80 %TEST80 rerun test06 with different matrices -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/test81.m b/GraphBLAS/Test/test81.m index 42e981eabb..aff7384a38 100644 --- a/GraphBLAS/Test/test81.m +++ b/GraphBLAS/Test/test81.m @@ -1,7 +1,7 @@ function test81 %TEST81 test GrB_Matrix_extract with index range, stride, & backwards -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test81: GrB_Matrix_extract with index range, stride, backwards\n') ; @@ -20,9 +20,8 @@ JJ {jlen} = randperm (n) ; end -for ilo = 1 % 1:2:n - for ihi = 4 % 1:2:n -% fprintf ('\n#') ; +for ilo = 1:2 % 1:2:n + for ihi = [4 8] % 1:2:n for i_inc = [-10 2 inf] % [-n:n inf] clear I I.begin = ilo-1 ; @@ -33,14 +32,24 @@ else iinc = 1 ; end + clear Ivec + I_vec = [I.begin, I.end, iinc]' ; + Ivec.sparsity = 8 ; % full + if (nnz (I_vec) == 3) + I_vec = sparse (I_vec) ; + Ivec.sparsity = 2 ; % sparse + end + Ivec.matrix = I_vec ; + if (ihi == 8) + Ivec.sparsity = 4 ; % bitmap + end + Ivec.class = 'double' ; -% fprintf (':') ; for jlen = [1:2:n] clear J -% J = randperm (n) ; J = JJ {jlen} ; J = J (1:jlen) ; - J0 = uint64 (J) - 1 ; + J0 = (uint64 (J) - 1)' ; C1 = A (ilo:iinc:ihi, J) ; [sm sn] = size (C1) ; S = sparse (sm, sn) ; @@ -49,9 +58,39 @@ C3 = GB_mex_Matrix_extract (S, [ ], [ ], ... Ahyper, I, J0, [ ]) ; assert (isequal (C1, C3.matrix)) ; + + clear desc + desc.rowindex_list = 'is_stride' ; + J0_double = double (J0) ; + C4 = GB_mex_Matrix_extract (S, [ ], [ ], A, Ivec, J0_double, desc, 1) ; + assert (isequal (C1, C4.matrix)) ; + + clear Jvec + C6 = A (ilo:iinc:ihi, 1:4) ; + Jvec.matrix = [2 3 4 1]' ; + Jvec.sparsity = 8 ; + Jvec.class = 'double' ; + desc.colindex_list = 'use_indices' ; +% Jvec +% Jvec.matrix + S = sparse (sm, 4) ; + C5 = GB_mex_Matrix_extract (S, [ ], [ ], A, Ivec, Jvec, desc, 1) ; +% C6 +% C5.matrix + assert (isequal (C6, C5.matrix)) ; + + Iv = [1 2]' ; + try + C4 = GB_mex_Matrix_extract (S, [ ], [ ], A, Iv, J0, ... + desc, 1) ; + ok = 0 ; + catch me + ok = 1 ; + end + assert (ok) ; + end -% fprintf ('.') ; for jlo = 1:2:n for jhi = 1:2:n for j_inc = [-n:n inf] @@ -65,6 +104,7 @@ else jinc = 1 ; end + Jvec = [J.begin, J.end, jinc]' ; C1 = A (ilo:iinc:ihi, jlo:jinc:jhi) ; [sm sn] = size (C1) ; @@ -77,6 +117,13 @@ Ahyper, I, J, [ ]) ; assert (isequal (C1, C3.matrix)) ; + clear desc + desc.rowindex_list = 'is_stride' ; + desc.colindex_list = 'is_stride' ; + C4 = GB_mex_Matrix_extract (S, [ ], [ ], A, ... + Ivec, Jvec, desc, 1) ; + assert (isequal (C1, C4.matrix)) ; + end end end diff --git a/GraphBLAS/Test/test82.m b/GraphBLAS/Test/test82.m index b9b2d09243..d276c01dc9 100644 --- a/GraphBLAS/Test/test82.m +++ b/GraphBLAS/Test/test82.m @@ -1,7 +1,7 @@ function test82 %TEST82 test GrB_Matrix_extract with index range (hypersparse) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test82: test GrB_Matrix_extract with index range (hypersparse)\n') ; diff --git a/GraphBLAS/Test/test83.m b/GraphBLAS/Test/test83.m index 7b084aac52..f8fe0b3e99 100644 --- a/GraphBLAS/Test/test83.m +++ b/GraphBLAS/Test/test83.m @@ -1,7 +1,7 @@ function test83 %TEST83 test GrB_assign with J=lo:0:hi, an empty list, and C_replace true -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 % exercises the C_replace_phase of GB_assign.c diff --git a/GraphBLAS/Test/test84.m b/GraphBLAS/Test/test84.m index 05b10798a1..89a76a159f 100644 --- a/GraphBLAS/Test/test84.m +++ b/GraphBLAS/Test/test84.m @@ -1,7 +1,7 @@ function test84 %TEST84 test GrB_assign (row and column with C in CSR/CSC format) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntest84: GrB_assign with row/col assignments\n') ; @@ -16,10 +16,10 @@ Acol = sprandn (4, 1, 0.5) ; Arow = sprandn (4, 1, 0.5) ; -J = [3 4 5 6] ; -J0 = uint64 (J) - 1 ; +J = [3 4 5 6]' ; +J0 = (uint64 (J) - 1) ; I = 2 ; -I0 = uint64 (I) - 1 ; +I0 = (uint64 (I) - 1) ; for trial = 1:2 @@ -48,21 +48,37 @@ C2 = GB_spec_Row_assign (C0, Mrow, 'plus', Arow, I, J, []) ; GB_spec_compare (C1, C2) ; + % row assign, _Vector + C1 = GB_mex_assign (C0, Mrow, 'plus', Arow, I0, J0, [], 5); + GB_spec_compare (C1, C2) ; + % col assign C1 = GB_mex_assign (C0, Mcol, 'plus', Acol, J0, I0, [], 1); C2 = GB_spec_Col_assign (C0, Mcol, 'plus', Acol, J, I, [ ]) ; GB_spec_compare (C1, C2) ; + % col assign _Vector + C1 = GB_mex_assign (C0, Mcol, 'plus', Acol, J0, I0, [], 4); + GB_spec_compare (C1, C2) ; + % row assign, no accum C1 = GB_mex_assign (C0, Mrow, [ ], Arow, I0, J0, [ ], 2) ; C2 = GB_spec_Row_assign (C0, Mrow, [ ], Arow, I, J, [ ]) ; GB_spec_compare (C1, C2) ; + % row assign, no accum, _Vector + GB_spec_compare (C1, C2) ; + C1 = GB_mex_assign (C0, Mrow, [ ], Arow, I0, J0, [ ], 5) ; + % col assign, no accum C1 = GB_mex_assign (C0, Mcol, [ ], Acol, J0, I0, [ ], 1) ; C2 = GB_spec_Col_assign (C0, Mcol, [ ], Acol, J, I, [ ]) ; GB_spec_compare (C1, C2) ; + % col assign, no accum, _Vector + C1 = GB_mex_assign (C0, Mcol, [ ], Acol, J0, I0, [ ], 4) ; + GB_spec_compare (C1, C2) ; + end end end diff --git a/GraphBLAS/Test/test_contains.m b/GraphBLAS/Test/test_contains.m index 6f43ae7314..8702bdd88f 100644 --- a/GraphBLAS/Test/test_contains.m +++ b/GraphBLAS/Test/test_contains.m @@ -2,7 +2,7 @@ %TEST_CONTAINS same as contains (text, pattern) % returns true if the pattern string is found in text string. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 s = ~isempty (strfind (text, pattern)) ; diff --git a/GraphBLAS/Test/test_saxpy3.m b/GraphBLAS/Test/test_saxpy3.m new file mode 100644 index 0000000000..ad7b6f77c9 --- /dev/null +++ b/GraphBLAS/Test/test_saxpy3.m @@ -0,0 +1,39 @@ +%TEST_SAXPY3 test integer overflow in GB_AxB_saxpy3_cumsum.c +% +% This test creates successively larger matrices, eventually triggering +% integer overflow when Cp is 32-bit and the matrix has more the 2^32 entries. +% It does not need to set the global hack flag to trigger the condition +% artificially. However, this test is costly and can only be done on a +% large system, so it is not part of the testall.m script. See test296.m. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') ; +clear all +clear mex +n = 10e6 ; +nz = 1 ; +range = int8 ([0 128]) ; +GrB.threads (32) ; +% GrB.burble (1) ; +e = 1 ; + +while (e < 4.2e9) + + nz = 1.25*nz ; + d = nz / n^2 ; + tic ; + C = GrB.random (n, n, d, 'range', range) ; + t = toc ; + e = GrB.entries (C) ; + fprintf ('\ncreate: %g sec, nvals %g million\n', t, e / 1e6) ; + tic ; + C = C^2 ; + t = toc ; + e = GrB.entries (C) ; + fprintf ('mxm: %g sec, nvals: %g million\n', t, e/1e6) ; +% disp (C, 1) ; + clear C + +end diff --git a/GraphBLAS/Test/testall.m b/GraphBLAS/Test/testall.m index e9298be9f3..545207ac11 100644 --- a/GraphBLAS/Test/testall.m +++ b/GraphBLAS/Test/testall.m @@ -6,15 +6,15 @@ function testall (threads, mdebug) % testall ; % runs just the shorter tests % testall(threads) ; % run with specific list of threads and chunk sizes % testall(threads,1) ; % runs with malloc debugging enabled +% testall([ ],1) ; % default # threads, with malloc debugging enabled % % threads is a cell array. Each entry is 2-by-1, with the first value being % the # of threads to use and the 2nd being the chunk size. The default is % {[4 1]} if threads is empty or not present. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -GrB.init ; GB_mex_init ; testall_time = tic ; @@ -33,6 +33,9 @@ function testall (threads, mdebug) % single thread s {1} = [1 1] ; +% all pji_controls +o = 0:7 ; + % clear the statement coverage counts clear global GraphBLAS_grbcov @@ -57,7 +60,7 @@ function testall (threads, mdebug) hack = GB_mex_hack ; % start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; +hack (2) = 0 ; GB_mex_hack (hack) ; % enable the Werk stack % save the current malloc debug status debug_save = stat ; @@ -118,15 +121,20 @@ function testall (threads, mdebug) % < 1 second: debug_off set_malloc_debug (mdebug, 0) ; logstat ('test297' ,t, J4 , F0 ) ; % plus_one semiring -logstat ('test286' ,t, J40 , F00 ) ; % kron with index binary op -logstat ('test78' ,t, J40 , F00 ) ; % subref +logstat ('test295' ,t, J4 , F1 ) ; % get/set iso +logstat ('test294' ,t, J0 , F1 ) ; % reduce with zombies +logstat ('test293' ,t, J0 , F0 ) ; % msort/qsort: all int variants +logstat ('test291' ,t, J0 , F0 , [0 1 2 4]) ; % GB_ix_realloc +logstat ('test290' ,t, J0 , F0 ) ; % large symbolic bitmap_subref +logstat ('test287' ,t, J0 , F0 , [0 4]) ; % misc tests +logstat ('test286' ,t, J40 , F00 , [0 1 2 4]) ; % kron with index binop +logstat ('test78' ,t, J40 , F00 , [0 4]) ; % subref logstat ('test285' ,t, J40 , F00 ) ; % GB_mex_assign (bitmap, 7_whole) logstat ('test247' ,t, J40 , F10 ) ; % GrB_mxm: fine Hash method logstat ('test109' ,t, J4040, F1100) ; % terminal monoid with user-defn type logstat ('test138' ,s, J40 , F10 ) ; % assign, coarse-only in IxJ slice -logstat ('test139' ,s, J4 , F1 ) ; % merge sort, special cases logstat ('test172' ,t, J40 , F10 ) ; % eWiseMult with M bitmap/full -logstat ('test155' ,t, J40 , F10 ) ; % setElement, removeElement +logstat ('test155' ,t, J40 , F10 , [0 2 4]) ; % setElement, removeElement logstat ('test174' ,t, J40 , F10 ) ; % GrB_assign C=A logstat ('test203' ,t, J4 , F1 ) ; % iso subref logstat ('test213' ,t, J40 , F10 ) ; % iso assign (method 05d) @@ -155,15 +163,18 @@ function testall (threads, mdebug) logstat ('test279' ,t, J0 , F1 ) ; % blob get/set logstat ('test281' ,t, J4 , F1 ) ; % user-defined idx unop, no JIT logstat ('test268' ,t, J40 , F10 ) ; % C=Z sparse masker -logstat ('test207' ,t, J4 , F1 ) ; % iso subref +logstat ('test207' ,t, J4 , F1 , [0 1]) ; % iso subref logstat ('test211' ,t, J40 , F10 ) ; % iso assign logstat ('test183' ,s, J4 , F1 ) ; % eWiseMult w/hypersparse mask -logstat ('test212' ,t, J40 , F10 ) ; % iso mask all zero -logstat ('test219' ,s, J40 , F10 ) ; % reduce to scalar (1 thread) +logstat ('test212' ,t, J40 , F10 ) ; % iso mask all zero +logstat ('test219' ,s, J40 , F10 ) ; % reduce to scalar (1 thread) % < 1 second: debug_on set_malloc_debug (mdebug, 1) ; -logstat ('test244' ,t, J4 , F1 ) ; % GxB_Matrix_reshape* +logstat ('test296' ,t, J4 , F1 ) ; % integer overflow in saxpy3 cumsum +logstat ('test289' ,t, J0 , F0 ) ; % container tests +logstat ('test288' ,t, J0 , F0 ) ; % load/unload tests +logstat ('test244' ,t, J4 , F1 , [0 1]) ; % GxB_Matrix_reshape* logstat ('test194' ,t, J4 , F1 ) ; % GxB_Vector_diag logstat ('test09' ,t, J40 , F10 ) ; % duplicate I,J in GB_mex_subassign logstat ('test108' ,t, J40 , F10 ) ; % boolean monoids @@ -174,7 +185,7 @@ function testall (threads, mdebug) logstat ('test197' ,t, J40 , F10 ) ; % large sparse split logstat ('test201' ,t, J4 , F1 ) ; % iso reduce to vector, scalar logstat ('test208' ,t, J4 , F1 ) ; % iso apply, bind 1st and 2nd -logstat ('test214' ,t, J40 , F10 ) ; % C=A'*B (tricount) +logstat ('test214' ,t, J40 , F10 , [0 1]) ; % C=A'*B (tricount) logstat ('test223' ,t, J40 , F10 ) ; % matrix multiply, C=A*B logstat ('test241' ,t, J40 , F10 ) ; % GrB_mxm, trigger swap_rule logstat ('test270' ,t, J0 , F1 ) ; % unary op get/set @@ -190,13 +201,14 @@ function testall (threads, mdebug) logstat ('test04' ,t, J40 , F10 ) ; % simple mask and transpose test logstat ('test132' ,t, J4 , F1 ) ; % setElement logstat ('test82' ,t, J4 , F1 ) ; % GrB_extract, index range (hyper) -logstat ('test202' ,t, J400 , F110 ) ; % iso add and emult +logstat ('test202' ,t, J400 , F110 , [0 1 2]) ; % iso add and emult logstat ('test222' ,t, J4 , F1 ) ; % user selectop, iso matrices logstat ('test204' ,t, J4 , F1 ) ; % iso diag -logstat ('test258' ,t, J40 , F00 ) ; % reduce-to-vector for UDT +logstat ('test258' ,t, J40 , F00 , [0 1]) ; % reduce-to-vector for UDT logstat ('test136' ,s, J40 , F10 ) ; % subassignment special cases logstat ('test128' ,t, J40 , F10 ) ; % eWiseMult, eWiseAdd, eWiseUnion logstat ('test144' ,t, J4 , F1 ) ; % cumsum +logstat ('test81' ,t, J4 , F1 ) ; % extract stride, range, backwards %=============================================================================== % 1 to 10 seconds @@ -204,30 +216,24 @@ function testall (threads, mdebug) % 1 to 10 seconds: debug_off set_malloc_debug (mdebug, 0) ; -logstat ('test81' ,t, J4 , F1 ) ; % extract stride, range, backwards -logstat ('testc2(0,0)',t, J0 , F1 ) ; % A'*B, A+B, A*B, user-defn complex +logstat ('testc2(0,0)',t, J0 , F1 , [0 1]) ; % user-defn complex logstat ('test239' ,t, J44 , F10 ) ; % GxB_eWiseUnion logstat ('test245' ,t, J40 , F11 ) ; % complex row/col scale logstat ('test159' ,t, J0 , F0 ) ; % A*B logstat ('test259' ,t, J40 , F00 ) ; % plus_plus_fp32 semiring logstat ('testc4(0)' ,t, J4 , F1 ) ; % extractElement, setElement, udt -logstat ('test157' ,t, J40 , F10 ) ; % sparsity formats +logstat ('test157' ,t, J4 , F1 ) ; % sparsity formats logstat ('test182' ,s, J40 , F10 ) ; % for internal wait logstat ('test195' ,t, J4 , F1 ) ; % saxpy3 slice_balanced -logstat ('test173' ,t, J40 , F10 ) ; % GrB_assign C=A logstat ('test135' ,t, J4 , F1 ) ; % reduce to scalar -logstat ('test84' ,t, J40 , F10 ) ; % GrB_assign (row/col w/ C CSR/CSC) logstat ('test215' ,t, J4 , F1 ) ; % C=A'*B (dot2, ANY_PAIR) logstat ('test80' ,t, J4 , F1 ) ; % GrB_mxm on all semirings logstat ('test200' ,t, J4 , F1 ) ; % iso full matrix multiply -logstat ('test283' ,t, J4 , F1 ) ; % index binary op +logstat ('test283' ,t, J4 , F1 , [0 1]) ; % index binary op logstat ('test254' ,t, J44 , F10 ) ; % mask types -logstat ('test142b' ,t, J40 , F00 ) ; % GrB_assign with accum -logstat ('test142' ,t, J40 , F11 ) ; % GrB_assign with accum logstat ('test54' ,t, J40 , F10 ) ; % assign, extract with begin:inc:end logstat ('testcc(1)' ,t, J40 , F10 ) ; % transpose, builtin complex logstat ('testc2(1,1)',t, J44 , F10 ) ; % complex tests (quick case, builtin) -logstat ('test227' ,t, J4 , F1 ) ; % kron logstat ('test141' ,t, J0 , F1 ) ; % eWiseAdd with dense matrices logstat ('test179' ,t, J44 , F10 ) ; % bitmap select @@ -235,16 +241,15 @@ function testall (threads, mdebug) hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack logstat ('test188b' ,t, J0 , F1 ) ; % concat logstat ('test185' ,s, J4 , F1 ) ; % dot4, saxpy for all sparsity -logstat ('test256' ,t, J40 , F00 ) ; % JIT error handling +logstat ('test256' ,t, J40 , F00 , [0 1]) ; % JIT error handling logstat ('test238b' ,t, J4 , F0 ) ; % GrB_mxm (dot4 and dot2) logstat ('test238' ,t, J4 , F1 ) ; % GrB_mxm (dot4 and dot2) - % Note that test186 can sometimes non-deterministically miss this block of code % in GB_AxB_saxbit_A_sparse_B_bitmap_template.c, about line 352, so it is run % 3 times: % ... % else if (cb == keep) -% { <----- HERE +% { <----- here % // C(i,j) is already present % #if !GB_IS_ANY_MONOID % GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) @@ -257,25 +262,23 @@ function testall (threads, mdebug) logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) - hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack % 1 to 10 seconds: debug_on set_malloc_debug (mdebug, 1) ; logstat ('testca(1)' ,t, J40 , F10 ) ; % complex mxm, mxv, and vxm -logstat ('test130' ,t, J40 , F10 ) ; % GrB_apply, hypersparse cases logstat ('test148' ,t, J40 , F10 ) ; % ewise with alias -logstat ('test231' ,t, J40 , F10 ) ; % GrB_select with idxunp +logstat ('test231' ,t, J4 , F1 ) ; % GrB_select with idxunp logstat ('test129' ,t, J4 , F1 ) ; % GxB_select (tril, nonz, hyper) logstat ('test69' ,t, J40 , F10 ) ; % assign and subassign with alias -logstat ('test29' ,t, J00 , F10 ) ; % reduce with zombies +logstat ('test29' ,t, J00 , F10 , [0 1]) ; % reduce tests logstat ('test282' ,t, J4 , F1 ) ; % argmax, index binary op logstat ('test249' ,t, J40 , F10 ) ; % GxB_Context object logstat ('test196' ,t, J4 , F1 ) ; % hypersparse concat logstat ('test250' ,t, J44 , F10 ) ; % JIT tests, set/get, other tests logstat ('test145' ,t, J42 , F11 ) ; % dot4 for C += A'*B logstat ('test229' ,t, J4 , F1 ) ; % setElement -logstat ('test209' ,t, J4 , F1 ) ; % iso build +logstat ('test209' ,t, J4 , F1 , [0 1]) ; % iso/non-iso build logstat ('test224' ,t, J4 , F1 ) ; % unpack/pack % 1 to 10 seconds, no Werk, debug_on @@ -285,7 +288,7 @@ function testall (threads, mdebug) logstat ('test240' ,t, J40 , F10 ) ; % dot4, saxpy4, and saxpy5 logstat ('test237' ,t, J40 , F10 ) ; % GrB_mxm (saxpy4) logstat ('test237' ,s, J40 , F10 ) ; % GrB_mxm (saxpy4) (1 task) -logstat ('test184' ,t, J4 , F1 ) ; % special cases: mxm, transp, build +logstat ('test184' ,t, J4 , F1 ) ; % mxm, transp, build logstat ('test236' ,t, J4 , F1 ) ; % GxB_*_sort hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack @@ -295,6 +298,9 @@ function testall (threads, mdebug) % 10 to 100 seconds: debug_off set_malloc_debug (mdebug, 0) ; +logstat ('test84' ,s, J40 , F10 , [0 2]) ; % GrB_assign (row/col) +logstat ('test84' ,t, J40 , F10 , [0 2]) ; % GrB_assign (row/col) +logstat ('test173' ,t, J40 , F10 ) ; % GrB_assign C=A logstat ('test230' ,t, J40 , F10 ) ; % apply with idxunops logstat ('test18' ,t, J40 , F10 ) ; % GrB_eWiseAdd and eWiseMult logstat ('testc7(0)' ,t, J40 , F10 ) ; % assign, builtin complex @@ -306,14 +312,15 @@ function testall (threads, mdebug) logstat ('test242' ,t, J4 , F1 ) ; % GxB_Iterator for matrices logstat ('test17' ,t, J4 , F1 ) ; % quick test of GrB_*_extractElement logstat ('test246' ,t, J4 , F1 ) ; % GrB_mxm: fine Hash, parallelism -logstat ('test206' ,t, J44 , F10 ) ; % iso select logstat ('test251b' ,t, J4 , F0 ) ; % dot4, dot2, with plus_pair logstat ('test251' ,t, J4 , F1 ) ; % dot4, dot2, with plus_pair logstat ('test152' ,t, J44 , F10 ) ; % binops C=A+B, all dense logstat ('test160' ,s, J0 , F1 ) ; % A*B, single threaded logstat ('test232' ,t, J40 , F10 ) ; % assign with GrB_Scalar -logstat ('test19' ,t, J40 , F10 ) ; % GxB_subassign, many pending ops -logstat ('test19b' ,s, J40 , F10 ) ; % GrB_assign, many pending operators +logstat ('test142b' ,t, J40 , F00 ) ; % GrB_assign with accum +logstat ('test142' ,t, J4 , F1 ) ; % GrB_assign with accum +logstat ('test227' ,t, J4 , F1 ) ; % kron +logstat ('test292' ,t, J4 , F1 ) ; % build_Vector with large vector % 10 to 100 seconds, no Werk, debug_off hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack @@ -323,10 +330,11 @@ function testall (threads, mdebug) % 10 to 100 seconds: debug_on set_malloc_debug (mdebug, 1) ; +logstat ('test130' ,t, J40 , F10 ) ; % GrB_apply, hypersparse cases +logstat ('test206' ,t, J44 , F10 ) ; % iso select and iso resize logstat ('test02' ,t, J4 , F1 ) ; % matrix copy and dup tests logstat ('test11' ,t, J4 , F1 ) ; % GrB_extractTuples logstat ('test187' ,t, J40 , F10 ) ; % dup/assign for all formats -logstat ('test189' ,t, J4 , F1 ) ; % large assign logstat ('test169' ,t, J0 , F1 ) ; % C=A+B with many formats logstat ('test76' ,s, J4 , F1 ) ; % GxB_resize (single threaded) logstat ('test01' ,t, J40 , F10 ) ; % error handling @@ -358,13 +366,18 @@ function testall (threads, mdebug) % > 100 seconds, no Werk, debug_on set_malloc_debug (mdebug, 1) ; hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test154b' ,t, J0 , F1 ) ; % apply with binop and scalar binding -logstat ('test154' ,t, J4 , F1 ) ; % apply with binop and scalar binding +logstat ('test154b' ,t, J0 , F1 ) ; % apply binop and scalar binding +logstat ('test154' ,t, J4 , F1 ) ; % apply binop and scalar binding hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack -% > 100 seconds, debug_off -logstat ('test280' ,t, J4 , F1 ) ; % subassign method 26 +% > 100 seconds, debug_on logstat ('test21b' ,t, J0 , F0 ) ; % GB_mex_assign +logstat ('test19b' ,s, J40 , F10 ) ; % GrB_assign, many pending ops + +% > 100 seconds, debug_off +set_malloc_debug (mdebug, 0) ; +logstat ('test19' ,t, J40 , F10 ) ; % GxB_subassign, many pending ops +logstat ('test280(0)' ,t, J4 , F1 ) ; % subassign method 26 %=============================================================================== % finalize diff --git a/GraphBLAS/Test/testc2.m b/GraphBLAS/Test/testc2.m index 9bad63a623..0311cf8bbc 100644 --- a/GraphBLAS/Test/testc2.m +++ b/GraphBLAS/Test/testc2.m @@ -1,7 +1,7 @@ function testc2(quick,use_builtin) %TESTC2 test complex A*B, A'*B, A*B', A'*B', A+B -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/testc4.m b/GraphBLAS/Test/testc4.m index 1f58353d5b..ab581c5ae6 100644 --- a/GraphBLAS/Test/testc4.m +++ b/GraphBLAS/Test/testc4.m @@ -1,7 +1,7 @@ function testc4(use_builtin) %TESTC4 test complex extractElement and setElement -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; diff --git a/GraphBLAS/Test/testc7.m b/GraphBLAS/Test/testc7.m index 45ff4b8f12..8da891a114 100644 --- a/GraphBLAS/Test/testc7.m +++ b/GraphBLAS/Test/testc7.m @@ -1,7 +1,7 @@ function testc7(use_builtin) %TESTC7 test complex assign -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\ntestc7: all complex assign C(I,J)=A --------------------------\n') ; @@ -23,8 +23,8 @@ function testc7(use_builtin) C = GB_mex_random (m, n, 10*(m+n), 1, seed) ; for ni = 1:m for nj = 1:n - I = randperm (m, ni) ; - J = randperm (n, nj) ; + I = randperm (m, ni)' ; + J = randperm (n, nj)' ; seed = seed + 1 ; A = GB_mex_random (ni, nj, 2*(ni+nj), 1, seed) ; seed = seed + 1 ; @@ -38,6 +38,10 @@ function testc7(use_builtin) C2 = GB_mex_subassign (C, [ ], [ ], A, I0, J0, []) ; assert (isequal (C1, C2.matrix)) ; + % with GrB_Vector + C2 = GB_mex_subassign (C, [ ], [ ], A, I0, J0, [], 7) ; + assert (isequal (C1, C2.matrix)) ; + [C3,c1] = GB_mex_subassign (C, M, [ ], A, I0, J0, [], 'plus') ; cin = complex (0,0) ; c2 = GB_mex_reduce_to_scalar (cin, '', 'plus', C3) ; diff --git a/GraphBLAS/Test/testca.m b/GraphBLAS/Test/testca.m index 60f21889d9..23b1ae7238 100644 --- a/GraphBLAS/Test/testca.m +++ b/GraphBLAS/Test/testca.m @@ -1,7 +1,7 @@ function testca(use_builtin) %TESTCA test complex mxm, mxv, and vxm -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/testcc.m b/GraphBLAS/Test/testcc.m index 193f01243a..2fc76286b4 100644 --- a/GraphBLAS/Test/testcc.m +++ b/GraphBLAS/Test/testcc.m @@ -1,7 +1,7 @@ function testcc(use_builtin) %TESTCC test complex transpose -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (nargin < 1) diff --git a/GraphBLAS/Test/testmake.m b/GraphBLAS/Test/testmake.m index 83e4e92a28..2431c25b0a 100644 --- a/GraphBLAS/Test/testmake.m +++ b/GraphBLAS/Test/testmake.m @@ -14,7 +14,7 @@ function testmake (what) % % See also graphblas_install. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 here = pwd ; @@ -52,29 +52,7 @@ function testmake (what) flags = '-g -R2018a -DGBNCPUFEAT' ; -if (~have_octave) - try - if (strncmp (computer, 'GLNX', 4)) - % remove -ansi from CFLAGS and replace it with -std=c11 - cc = mex.getCompilerConfigurations ('C', 'Selected') ; - env = cc.Details.SetEnv ; - c1 = strfind (env, 'CFLAGS=') ; - q = strfind (env, '"') ; - q = q (q > c1) ; - if (~isempty (c1) && length (q) > 1) - c2 = q (2) ; - cflags = env (c1:c2) ; % the CFLAGS="..." string - ansi = strfind (cflags, '-ansi') ; - if (~isempty (ansi)) - cflags = [cflags(1:ansi-1) '-std=c11' cflags(ansi+5:end)] ; - flags = [flags ' ' cflags] ; - fprintf ('compiling with -std=c11 instead of default -ansi\n') ; - end - end - end - catch - end -end +cflags = '' ; mexfunctions = dir ('GB_mex_*.c') ; cfiles = [ dir('../Demo/Include/usercomplex.c') ; dir('GB_mx_*.c') ] ; @@ -84,6 +62,7 @@ function testmake (what) inc = [inc ' -I../zstd -I../zstd/zstd_subset -I.'] ; inc = [inc ' -I../Config '] ; inc = [inc ' -I../Source/builtin '] ; +inc = [inc ' -I../Source/hyper '] ; if (ismac) % Mac (do 'make install' for GraphBLAS first) @@ -92,9 +71,6 @@ function testmake (what) else libraries = '-L/usr/local/lib -lgraphblas' ; % -lomp' ; end -% flags = [ flags ' CFLAGS="$CXXFLAGS -Xpreprocessor -fopenmp" ' ] ; -% flags = [ flags ' CXXFLAGS="$CXXFLAGS -Xpreprocessor -fopenmp" ' ] ; -% flags = [ flags ' LDFLAGS="$LDFLAGS -fopenmp"' ] ; elseif (ispc) % Windows if (need_rename) @@ -110,9 +86,36 @@ function testmake (what) else libraries = '-L../build -L. -lgraphblas' ; end - flags = [ flags ' CFLAGS="$CXXFLAGS -fopenmp -fPIC -Wno-pragmas" '] ; - flags = [ flags ' CXXFLAGS="$CXXFLAGS -fopenmp -fPIC -Wno-pragmas" '] ; - flags = [ flags ' LDFLAGS="$LDFLAGS -fopenmp -fPIC" '] ; +end + +if ispc + if (need_rename) + library_path = sprintf ('%s/../GraphBLAS/build/Release', pwd) ; + else + library_path = sprintf ('%s/../build/Release', pwd) ; + end +else + if (need_rename) + library_path = sprintf ('%s/../GraphBLAS/build', pwd) ; + else + library_path = sprintf ('%s/../build', pwd) ; + end +end + +% revise compiler flags for MATLAB +if (ismac) + ldflags = '-fPIC' ; + rpath = '-rpath ' ; +elseif (isunix) + cflags = [cflags ' -fopenmp'] ; + ldflags = '-fopenmp -fPIC' ; + rpath = '-rpath=' ; +end +if (ismac || isunix) + rpath = sprintf (' -Wl,%s''''%s'''' ', rpath, library_path) ; + flags = [ flags ' CFLAGS=''$CFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' CXXFLAGS=''$CXXFLAGS ' cflags ' -Wno-pragmas'' '] ; + flags = [ flags ' LDFLAGS=''$LDFLAGS ' ldflags rpath ' '' '] ; end if (need_rename) @@ -124,6 +127,13 @@ function testmake (what) libgraphblas = '-lgraphblas' ; end +Lflags = sprintf ('-L''%s''', library_path) ; + +fprintf ('compiler flags: %s\n', flags) ; +fprintf ('compiler incs: %s\n', inc) ; +fprintf ('linking flags: %s\n', Lflags) ; +fprintf ('library: %s\n', libgraphblas) ; + %------------------------------------------------------------------------------- dryrun = false ; @@ -172,6 +182,7 @@ function testmake (what) fprintf ('.') ; % fprintf ('%s\n', cfile) ; mexcmd = sprintf ('mex -c %s -silent %s %s', flags, inc, cfile) ; + % fprintf ('\n%s\n', mexcmd) ; if (dryrun) fprintf ('%s\n', mexcmd) ; else @@ -203,8 +214,8 @@ function testmake (what) % compile if it is newer than its object file, or if any cfile was compiled if (make_all || tc > tobj || any_c_compiled) % compile the mexFunction - mexcmd = sprintf ('mex -silent %s %s %s %s %s', ... - flags, inc, mexfunction, objlist, libraries) ; + mexcmd = sprintf ('mex %s -silent %s %s ''%s'' %s %s', ... + Lflags, flags, inc, mexfunction, objlist, libraries) ; fprintf (':') ; % fprintf ('%s\n', mexfunction) ; if (dryrun) @@ -220,12 +231,5 @@ function testmake (what) mex -g -R2018a GB_spones_mex.c % load the library -if (ispc) - cd ../build/Release - GrB (1) - cd ../../Test - pwd -end - - +GB_mex_init ; diff --git a/GraphBLAS/Test/tmp/.gitignore b/GraphBLAS/Test/tmp/.gitignore new file mode 100644 index 0000000000..52e15321b7 --- /dev/null +++ b/GraphBLAS/Test/tmp/.gitignore @@ -0,0 +1,4 @@ +# Ignore all files except this file. +* +*/ +!.gitignore diff --git a/GraphBLAS/Test/unused/GB_complex_compare.m b/GraphBLAS/Test/unused/GB_complex_compare.m deleted file mode 100644 index 4fa19fff04..0000000000 --- a/GraphBLAS/Test/unused/GB_complex_compare.m +++ /dev/null @@ -1,25 +0,0 @@ -function GB_complex_compare (C1, C2, tol) -%GB_COMPLEX_COMPARE compare GraphBLAS results for complex types -% -% compare two complex results, from GB_mex_op and GB_user_op - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (tol ~= 0) - if (any (any (isinf (C1)))) - assert (isequal (isinf (C1), isinf (C2))) - C1 (isinf (C1)) = 1i ; - C2 (isinf (C2)) = 1i ; - end - if (any (any (isnan (C1)))) - assert (isequal (isnan (C1), isnan (C2))) - C1 (isnan (C1)) = 1i ; - C2 (isnan (C2)) = 1i ; - end - assert (norm (C1 - C2,1) < 16 * eps (norm (C2,1))) -else - assert (isequal (C1, C2)) -end - - diff --git a/GraphBLAS/Test/unused/GB_mex_AplusB_M_aliased.c b/GraphBLAS/Test/unused/GB_mex_AplusB_M_aliased.c deleted file mode 100644 index 226c61f315..0000000000 --- a/GraphBLAS/Test/unused/GB_mex_AplusB_M_aliased.c +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_mex_AplusB_M_aliased: compute C=A+B -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// This is for testing only. See GrB_eWiseAdd instead. Returns a plain -// built-in matrix, in double. - -#include "GB_mex.h" - -#define USAGE "C = GB_mex_AplusB_M_aliased (A, B, op)" - -#define FREE_ALL \ -{ \ - GrB_Matrix_free_(&A) ; \ - GrB_Matrix_free_(&B) ; \ - GrB_Matrix_free_(&C) ; \ - GrB_free (&op) ; \ - GB_mx_put_global (true) ; \ -} - -void mexFunction -( - int nargout, - mxArray *pargout [ ], - int nargin, - const mxArray *pargin [ ] -) -{ - struct GB_Matrix_opaque C_header ; - GrB_Matrix C = NULL ; - - bool malloc_debug = GB_mx_get_global (true) ; - GrB_Matrix A = NULL ; - GrB_Matrix B = NULL ; - GrB_BinaryOp op = NULL ; - - GB_WERK (USAGE) ; - - // check inputs - if (nargout > 1 || nargin != 3) - { - mexErrMsgTxt ("Usage: " USAGE) ; - } - - // get A and B - A = GB_mx_mxArray_to_Matrix (pargin [0], "A", false, true) ; - B = GB_mx_mxArray_to_Matrix (pargin [1], "B", false, true) ; - if (A == NULL || B == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("failed") ; - } - - // get op - bool user_complex = (Complex != GxB_FC64) - && (A->type == Complex || B->type == Complex) ; - if (!GB_mx_mxArray_to_BinaryOp (&op, pargin [2], "op", - A->type, user_complex) || op == NULL) - { - FREE_ALL ; - mexErrMsgTxt ("op failed") ; - } - - // C = A+B using the op. M == B alias - -// this can ignore the mask now; so use GB_eWiseAdd instead: -// bool ignore ; -// METHOD (GB_add (C, A->type, true, B, false, false, &ignore, A, B, -// false, NULL, NULL, op, false, Werk)) ; - - // using eWiseAdd instead: - GrB_Index nrows, ncols ; - GrB_Matrix_nrows (&nrows, A) ; - GrB_Matrix_ncols (&ncols, A) ; - - #define GET_DEEP_COPY \ - GrB_Matrix_new (&C, op->ztype, nrows, ncols) ; \ - GxB_Matrix_Option_set (C, GxB_FORMAT, GxB_BY_COL) ; - - #define FREE_DEEP_COPY \ - GrB_Matrix_free_(&C) ; - - GET_DEEP_COPY ; - METHOD (GrB_Matrix_eWiseAdd_BinaryOp (C, B, NULL, op, A, B, NULL)) ; - - // return C as a plain sparse matrix - pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C=A+B result", false) ; - - FREE_ALL ; -} - diff --git a/GraphBLAS/Test/unused/GB_mex_test23.c b/GraphBLAS/Test/unused/GB_mex_test23.c deleted file mode 100644 index c0b2b435c1..0000000000 --- a/GraphBLAS/Test/unused/GB_mex_test23.c +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_mex_test23: JIT error handling -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB_mex.h" -#include "GB_mex_errors.h" -#include "../Source/jitifyer/GB_stringify.h" - -#define USAGE "GB_mex_test23" - -#define FREE_ALL ; -#define GET_DEEP_COPY ; -#define FREE_DEEP_COPY ; - -void mexFunction -( - int nargout, - mxArray *pargout [ ], - int nargin, - const mxArray *pargin [ ] -) -{ - - //-------------------------------------------------------------------------- - // startup GraphBLAS - //-------------------------------------------------------------------------- - - GrB_Info info ; - GB_mx_at_exit ( ) ; - bool malloc_debug = GB_mx_get_global (true) ; - - //-------------------------------------------------------------------------- - // invalid cache path - //-------------------------------------------------------------------------- - - OK (GxB_set (GxB_BURBLE, true)) ; - int save, c ; - OK (GxB_get (GxB_JIT_C_CONTROL, &save)) ; - OK (GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - OK (GxB_get (GxB_JIT_C_CONTROL, &c)) ; - - if (c == GxB_JIT_ON) - { - // JIT is enabled - GrB_Info expected = GrB_INVALID_VALUE ; - ERR (GxB_Global_Option_set_CHAR (GxB_JIT_CACHE_PATH, "/myroot")) ; - } - else - { - // JIT is disabled - printf ("JIT disabled\n") ; - OK (GxB_Global_Option_set_CHAR (GxB_JIT_CACHE_PATH, "/myroot")) ; - const char *s ; - OK (GxB_Global_Option_get_CHAR (GxB_JIT_CACHE_PATH, &s)) ; - CHECK (MATCH (s, "/myroot")) ; - } - - OK (GxB_set (GxB_JIT_C_CONTROL, save)) ; - - //-------------------------------------------------------------------------- - // finalize GraphBLAS - //-------------------------------------------------------------------------- - - GB_mx_put_global (true) ; - GB_mx_at_exit ( ) ; - printf ("\nGB_mex_test23: all tests passed\n\n") ; -} - diff --git a/GraphBLAS/Test/unused/GB_spec_opdomain.m b/GraphBLAS/Test/unused/GB_spec_opdomain.m deleted file mode 100644 index 8af5dd668f..0000000000 --- a/GraphBLAS/Test/unused/GB_spec_opdomain.m +++ /dev/null @@ -1,47 +0,0 @@ -function [xdomain, ydomain] = GB_spec_opdomain (op) -%GB_SPEC_OPDOMAIN determine domain of a unary or binary operator -% -% [xdomain, ydomain] = GB_spec_opdomain (op) determines the domains of -% x and y where the unary or binary operator is valid. Each output is an -% array of size two. Divide-by-zero is ignored. -% -% An error results if the operator is not defined at all (op.opname = 'erf' -% and op.opname = 'single complex' for example). -% -% See also GB_spec_op. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% get the operator name and type -[opname optype ztype xtype ytype] = GB_spec_operator (op, 'double') ; - -xdomain = [-inf, inf] ; -ydomain = [-inf, inf] ; - -if (test_contains (optype, 'complex')) - % complex operators z=f(x,y) are valid over all x and y - return -end - -% find the domain of a real operator - -switch opname - - case { 'pow', 'sqrt', 'log', 'log10', 'log2', 'gammaln', 'lgamma' } - xdomain = [0, inf] ; - - case { 'asin', 'acos', 'atanh' } - xdomain = [-1, 1] ; - - case { 'acosh', 'asech' } - xdomain = [1, inf] ; - - case 'log1p' - xdomain = [-1, inf] ; - - otherwise - % op is defined for all x and y - -end - diff --git a/GraphBLAS/Test/unused/README.txt b/GraphBLAS/Test/unused/README.txt deleted file mode 100644 index a85ff0f929..0000000000 --- a/GraphBLAS/Test/unused/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -GraphBLAS/Test/unused: - -Former tests, no longer needed for full test coverage. -Kept in case they are needed in the future. - diff --git a/GraphBLAS/Test/unused/accum_mask.m b/GraphBLAS/Test/unused/accum_mask.m deleted file mode 100644 index a8d4d5b33c..0000000000 --- a/GraphBLAS/Test/unused/accum_mask.m +++ /dev/null @@ -1,47 +0,0 @@ -function C = accum_mask (C, Mask, accum, T, C_replace, Mask_complement) -%ACCUM_MASK apply the mask - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[m n] = size (C.matrix) ; -Z.matrix = zeros (m, n) ; -Z.pattern = false (m, n) ; - -if (isempty (accum)) - Z = T ; % no accum operator -else - % Z = accum (C,T), like Z=C+T but with an binary operator, accum - p = C.pattern & T.pattern ; Z.matrix (p) = accum (C.matrix (p), T.matrix (p)); - p = C.pattern & ~T.pattern ; Z.matrix (p) = C.matrix (p) ; - p = ~C.pattern & T.pattern ; Z.matrix (p) = T.matrix (p) ; - Z.pattern = C.pattern | T.pattern ; -end - -% apply the mask to the values and pattern -C.matrix = mask (C.matrix, Mask, Z.matrix, C_replace, Mask_complement) ; -C.pattern = mask (C.pattern, Mask, Z.pattern, C_replace, Mask_complement) ; -end - -function C = mask (C, Mask, Z, C_replace, Mask_complement) -% replace C if requested -if (C_replace) - C (:,:) = 0 ; -end -if (isempty (Mask)) % if empty, Mask is implicit ones(m,n) - % implicitly, Mask = ones (size (C)) - if (~Mask_complement) - C = Z ; % this is the default - else - C = C ; % Z need never have been computed - end -else - % apply the mask - if (~Mask_complement) - C (Mask) = Z (Mask) ; - else - C (~Mask) = Z (~Mask) ; - end -end -end - diff --git a/GraphBLAS/Test/unused/accum_mask2.m b/GraphBLAS/Test/unused/accum_mask2.m deleted file mode 100644 index ce4ad762a3..0000000000 --- a/GraphBLAS/Test/unused/accum_mask2.m +++ /dev/null @@ -1,65 +0,0 @@ -function C = accum_mask (C, Mask, accum, T, C_replace, Mask_complement) -%ACCUM_MASK2 a simpler version of GB_spec_accum_mask -% It does not handle typecasting and it assumes the identity value is zero. -% The purpose is for illustration to describe what the accum/mask operation -% does, not for actual testing. This file appears in the User Guide. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[nrows ncols] = size (C.matrix) ; -Z.matrix = zeros (nrows, ncols) ; -Z.pattern = false (nrows, ncols) ; - -if (isempty (accum)) - % Z = T, no accum operator - Z.matrix = T.matrix ; - Z.pattern = T.pattern ; -else - % Z = accum (C,T) - % apply the binary operator to the set intersection - p = T.pattern & C.pattern ; - Z.matrix (p) = GB_spec_op (accum, C.matrix (p), T.matrix (p)) ; - - % copy entries in C but not T - p = C.pattern & ~T.pattern ; - Z.matrix (p) = C.matrix (p) ; - - % copy entries in T but not C - p = T.pattern & ~C.pattern ; - Z.matrix (p) = T.matrix (p) ; - - % pattern is the set union - Z.pattern = C.pattern | T.pattern ; -end - -% apply the mask to the values and pattern -C.matrix = mask (C.matrix, Mask, Z.matrix, C_replace, Mask_complement) ; -C.pattern = mask (C.pattern, Mask, Z.pattern, C_replace, Mask_complement) ; -end - -function C = mask (C, Mask, Z, C_replace, Mask_complement) ; -% replace C if requested -if (C_replace) - C (:,:) = 0 ; % assume identity is zero -end -if (isempty (Mask)) - % implicitly, Mask = ones (size (C)) - if (~Mask_complement) - % this is the default - C = Z ; - else - % note that Z need never have been computed - C = C ; - end -else - % apply the mask - if (~Mask_complement) - C (Mask) = Z (Mask) ; - else - C (~Mask) = Z (~Mask) ; - end -end -end - - diff --git a/GraphBLAS/Test/unused/atest.m b/GraphBLAS/Test/unused/atest.m deleted file mode 100644 index 5078b99e59..0000000000 --- a/GraphBLAS/Test/unused/atest.m +++ /dev/null @@ -1,63 +0,0 @@ -% test GrB_assign and GxB_subassign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -for nth = [2 1] - nthreads_set (nth,1) ; - - for d = 0 % [1 0] - if (d) - debug_on - else - debug_off - end - grbinfo - - test07 - test07b - - test08 - test08b - - test09 - test09b - - test106 - - testc7 - test29 - - test30 - test30b - test39 - - test54 - test55 - test55b - - test64 - test64b - - test69 - test83 - test84 - test97 - - test19 - test19b - test21 - test21b - - end -end - -% performance tests -test46 -test46b -test51 -test51b diff --git a/GraphBLAS/Test/unused/atest11.m b/GraphBLAS/Test/unused/atest11.m deleted file mode 100644 index d871956a98..0000000000 --- a/GraphBLAS/Test/unused/atest11.m +++ /dev/null @@ -1,29 +0,0 @@ -% test GrB_assign and GxB_subassign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -% tests Method11c - -for nth = [2 1] - nthreads_set (nth,1) ; - - for d = 0 % [1 0] - if (d) - debug_on - else - debug_off - end - grbinfo - - test19 - test19b - test21 - test21b - - end -end diff --git a/GraphBLAS/Test/unused/btest.m b/GraphBLAS/Test/unused/btest.m deleted file mode 100644 index 802fb9f673..0000000000 --- a/GraphBLAS/Test/unused/btest.m +++ /dev/null @@ -1,24 +0,0 @@ -% test GrB_build - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -nthreads_set(2) -grbinfo -test56 -test23 - -test42 ; - -nthreads_max = feature_numcores ; -for nthreads = [1 2 4 8 16 20 32 40 64 128 256] - if (nthreads > 2*nthreads_max) - break ; - end - fprintf ('\n================================================================================\n') ; - fprintf ('===================== nthreads: %d\n', nthreads) ; - fprintf ('================================================================================\n') ; - nthreads_set(nthreads) ; - test45 ; -end - diff --git a/GraphBLAS/Test/unused/ee.m b/GraphBLAS/Test/unused/ee.m deleted file mode 100644 index 195c86418e..0000000000 --- a/GraphBLAS/Test/unused/ee.m +++ /dev/null @@ -1,18 +0,0 @@ -%EE eWiseMult and eWiseAdd performance tests - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -for threads = 1:4 - nthreads_set (threads) ; - grbinfo - test68 % eWiseMult performance - test58(0) % eWiseAdd performance - test61 % eWiseMult performance - test39 % eWiseAdd performance -end - diff --git a/GraphBLAS/Test/unused/eee.m b/GraphBLAS/Test/unused/eee.m deleted file mode 100644 index e95cada140..0000000000 --- a/GraphBLAS/Test/unused/eee.m +++ /dev/null @@ -1,33 +0,0 @@ - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% test141 -% test63 -% test151 -% test75b -% test21b -% test53 -% test02 -% test150 -% test100 -% test17 -% test03 - -% test11 -% test29 -% test142 -% test18 -% test76 -% test125 -% test134 -test20 -test23 - -% -test25 -test114 -test75 -test06 -test62 -test22 diff --git a/GraphBLAS/Test/unused/etest.m b/GraphBLAS/Test/unused/etest.m deleted file mode 100644 index 6e37b25cd0..0000000000 --- a/GraphBLAS/Test/unused/etest.m +++ /dev/null @@ -1,30 +0,0 @@ -% test eWise - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -for k = [2 1] - nthreads_set (k) ; - grbinfo - - test15 - test72 - testc8 - test68 % eWiseMult performance - test105 - % test20 - % test26 - test34 - test58 % eWiseAdd performance - - test61 % eWiseMult performance - test18 - test39 % eWiseAdd performance - - test111 % eWiseAdd performance -end - diff --git a/GraphBLAS/Test/unused/flopcount.m b/GraphBLAS/Test/unused/flopcount.m deleted file mode 100644 index 66f7624c02..0000000000 --- a/GraphBLAS/Test/unused/flopcount.m +++ /dev/null @@ -1,63 +0,0 @@ -function [flops mwork] = flopcount (M,Mask_complement,A,B) ; -%FLOPCOUNT cumulative sum of flop counts for A*B, C=A*B, C=A*B -% -% flops = flopcount (M,Mask_complementA,B) ; -% -% flops(j) is the flops to compute A*B(1:j-1), and flops(n+1) is the total -% flopcount, if B is m-by-n. -% -% Each 'flop' counted is actually a multiply-add. M can be [ ]. The -% flopcount m-file returns the same thing as GB_AxB_saxpy3_flopcount. Also -% included in flops(j) is the work needed to access the mask M(:,j). - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -n = size (B,2) ; -flops = zeros (1,n) ; -mwork = 0 ; - -if (isempty (M)) - - % C = A*B - - for j = 1:n - brows = find (B (:,j)) ; - brows = brows (:)' ; - for k = brows - flops (j) = flops (j) + nnz (A (:,k)) ; - end - end - -else - - % C=A*B and C=A*B - - mask_is_M = (~Mask_complement) ; % true for C=A*B - mask_is_dense = (nnz (M) == prod (size (M))) ; - - for j = 1:n - brows = find (B (:,j)) ; - if (isempty (brows)) - continue ; - end - - if (~mask_is_dense) - mrows = find (M (:,j)) ; - mjnz = length (mrows) ; - if (mask_is_M & mjnz == 0) - continue ; - end - flops (j) = flops (j) + mjnz ; - mwork = mwork + mjnz ; - end - - brows = brows (:)' ; - for k = brows - flops (j) = flops (j) + nnz (A (:,k)) ; - end - end - -end - -flops = cumsum ([0 flops]) ; diff --git a/GraphBLAS/Test/unused/floptest.m b/GraphBLAS/Test/unused/floptest.m deleted file mode 100644 index 466f15a822..0000000000 --- a/GraphBLAS/Test/unused/floptest.m +++ /dev/null @@ -1,28 +0,0 @@ -function floptest (M, Mask_complement, A, B, flops1) -%FLOPTEST compare flopcount with GB_mex_mxm_flops -% floptest (M, Mask_complement, A, B, flops1) -% -% compares the results of -% flops1 = flopcount (M, Mask_complement, A, B) -% with -% flops2 = GB_mex_mxm_flops (M, Mask_complement, A, B) -% -% However, flopcount(M,Mask_complement,A,B) can only be computed when M, A, B -% are all built-in sparse matrices, not structs. If the matrices are -% hypersparse, flops1 has length B->nvec+1, not size(B,2). In this case, -% only the total flop count is checked. In that case, flops1 is a scalar. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[flops2 mwork] = GB_mex_mxm_flops (M, Mask_complement, A, B) ; -total_flops = flops2 (end) ; - -if (isscalar (flops1)) - % flops1 is just the total flop count - assert (isequal (flops1, total_flops)) ; -else - % flops1 is the cumulative sum - assert (isequal (flops1, flops2)) ; -end - diff --git a/GraphBLAS/Test/unused/grbuniq.m b/GraphBLAS/Test/unused/grbuniq.m deleted file mode 100644 index 27ef4ccccd..0000000000 --- a/GraphBLAS/Test/unused/grbuniq.m +++ /dev/null @@ -1,87 +0,0 @@ - -% load grbstat -ntests = length (GraphBLAS_grbcovs) ; -n = length (GraphBLAS_grbcovs {1}) ; -G = cell2mat (GraphBLAS_grbcovs') ; -T = cell2mat (GraphBLAS_times') ; - -Mine = zeros (ntests, n) ; -Mine (1, :) = G (1, :) ; - -for k = 2:ntests - % find the statements covered by this test - Mine (k,:) = G (k,:) - G (k-1,:) ; -end - -% Mine (k,i) = 1 if the kth test covers statement i -Mine = full (spones (Mine)) ; - -S = sum (Mine) ; -U = (S == 1) ; -keeper = [ ] ; - -for k = 1:ntests - my_uniq = (Mine (k,:) > 0) & U ; - n_uniq = sum (my_uniq) ; - t = T (k) ; - fprintf ('%3d %-20s : %5d %9.2f', k, GraphBLAS_scripts {k}, n_uniq, t) ; - fprintf (' %10.2f ', t/n_uniq) ; - if (n_uniq == 0) - fprintf ('<<<<<<<<<<<') ; - else - keeper = [keeper k] ; - end - fprintf ('\n') ; -end - -fprintf ('\n====================================\n') ; - -[ignore I] = sort (T, 'descend') ; -for kk = 1:ntests - k = I (kk) ; - my_uniq = (Mine (k,:) > 0) & U ; - n_uniq = sum (my_uniq) ; - t = T (k) ; - fprintf ('%3d %3d %-20s : %5d %9.2f', kk, k, GraphBLAS_scripts {k}, n_uniq, t) ; - fprintf (' %10.2f ', t/n_uniq) ; - if (n_uniq == 0) - fprintf ('<<<<<<<<<<<') ; - Mine (k,:) = 0 ; - S = sum (Mine) ; - U = (S == 1) ; - else - keeper = [keeper k] ; - end - fprintf ('\n') ; -end - - - -%{ -fprintf ('\n====================================\n') ; - -Mine2 = Mine (keeper, :) ; -S2 = sum (Mine2) ; -U2 = (S2 == 1) ; -ntests2 = length (keeper) ; -T2 = T (keeper) ; -Scr = GraphBLAS_scripts (keeper) ; - -for k = 1:ntests2 - my_uniq = (Mine2 (k,:) > 0) & U2 ; - n_uniq = sum (my_uniq) ; - t = T2 (k) ; - fprintf ('%3d %-20s : %5d %6.2f', k, Scr {k}, n_uniq, t) ; - fprintf (' %10.2f ', t/n_uniq) ; - if (n_uniq == 0) - fprintf ('<<<<<<<<<<<') ; - else - keeper = [keeper k] ; - end - fprintf ('\n') ; -end - -sum (T) /60 -sum (T2) /60 -(sum (T) - sum (T2)) / 60 -%} diff --git a/GraphBLAS/Test/unused/longtests.m b/GraphBLAS/Test/unused/longtests.m deleted file mode 100644 index c114243d10..0000000000 --- a/GraphBLAS/Test/unused/longtests.m +++ /dev/null @@ -1,27 +0,0 @@ -%LONGTESTS very long tests - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -nthreads_set (4,1) ; -debug_off - - test21(1) ; % exhaustive test of GB_mex_subassign - test23(1) ; % exhaustive test of GB_*_build - test24(1) ; % exhaustive test of GrB_Matrix_reduce - - test30b ; % performance test GB_mex_assign, scalar expansion - - test12(0) ; % Wathen finite-element matrices (full test) - test58(0) ; % longer GB_mex_Matrix_eWiseAdd performance test - - test53 ; % exhaustive test of GB_mex_Matrix_extract - test62 ; % exhaustive test of GrB_apply - test45 ; % test GB_mex_setElement and build - test46 ; % performance test GB_mex_subassign - test46b ; % performance test GB_mex_assign - - test51 ; % performance test GB_mex_subassign, multiple ops - test51b ; % performance test GB_mex_assign, multiple ops - test06(936) ; % performance test of GrB_mxm on all semirings - diff --git a/GraphBLAS/Test/unused/mtest.m b/GraphBLAS/Test/unused/mtest.m deleted file mode 100644 index 1346cc7c39..0000000000 --- a/GraphBLAS/Test/unused/mtest.m +++ /dev/null @@ -1,32 +0,0 @@ -% test mxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; -% debug_on -nthreads_set (2) ; -grbinfo - - -% -test06 -test16 -test20 -test28 -test32 -test49 -test59 -test72 -test73 -test74 -test75 -test87 -test88 -test98 -test48 -testall -testca -testperf diff --git a/GraphBLAS/Test/unused/rtest.m b/GraphBLAS/Test/unused/rtest.m deleted file mode 100644 index de86098698..0000000000 --- a/GraphBLAS/Test/unused/rtest.m +++ /dev/null @@ -1,36 +0,0 @@ -% test GrB_reduce to vector and scalar - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make - -for k = [4 2 1] - - nthreads_set (k) ; - - debug_off - stat - - fprintf ('\n=============== GrB_reduce to scalar tests: nthreads %d\n', k) ; - test29 - fprintf ('\n=============== GrB_reduce to vector tests: nthreads %d\n', k) ; - test66 - test95 - test14 - test24(0) - - debug_on - stat - - fprintf ('\n=============== GrB_reduce to scalar tests: nthreads %d\n', k) ; - test29 - fprintf ('\n=============== GrB_reduce to vector tests: nthreads %d\n', k) ; - test66 - test95 - test14 - test24(0) - -end - -test107 diff --git a/GraphBLAS/Test/unused/save_test75b.m b/GraphBLAS/Test/unused/save_test75b.m deleted file mode 100644 index d271a1d8b4..0000000000 --- a/GraphBLAS/Test/unused/save_test75b.m +++ /dev/null @@ -1,165 +0,0 @@ -function test75b -%TEST75B GrB_mxm and GrB_vxm on all semirings (shorter test than test75) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test75b: test mxm and vxm on all semirings\n') ; -[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -mult_ops = binops.all ; -types = types.all ; - -rng ('default') ; - -m = 200 ; -n = 5 ; -A_sparse = sprandn (m, n, 0.1) ; -A_sparse (:,3) = 0 ; -A_sparse (2,3) = 1.7 ; -A_sparse (18,3) = 2.2 ; -A_sparse (:,1:2) = sparse (rand (m,2)) ; -A_sparse (1,1) = 0; -A_sparse (18,1) = 0; -A_sparse (:,5) = 0 ; -A_sparse (1,5) = 11 ; -A_sparse (2,5) = 23 ; -A_sparse (18,5) = 33 ; - -B_sparse = sprandn (m, n, 0.1) ; -B_sparse (:,1) = 0 ; -B_sparse (1,1) = 3 ; -B_sparse (18,1) = 2 ; -B_sparse (:,[2 n]) = sparse (rand (m,2)) ; -B_sparse (3,2) = 0 ; -B_sparse (18,2) = 0 ; -A_sparse (:,3) = 0 ; -B_sparse (2,1) = 7 ; -B_sparse (18,1) = 8 ; -B_sparse (19,1) = 9 ; - -x_sparse = sparse (rand (m,1)) ; -x_sparse (99) = 0 ; - -y_sparse = sparse (zeros (m,1)) ; -y_sparse (99) = 1 ; - -A.matrix = A_sparse ; -A.class = 'see below' ; -A.pattern = logical (spones (A_sparse)) ; - -B.matrix = B_sparse ; -B.class = 'see below' ; -B.pattern = logical (spones (B_sparse)) ; - -X.matrix = x_sparse ; -X.class = 'see below' ; -X.pattern = logical (spones (x_sparse)) ; - -Y.matrix = y_sparse ; -Y.class = 'see below' ; -Y.pattern = logical (spones (y_sparse)) ; - -fprintf ('\n-------------- GrB_mxm, vxm (dot product) on many semirings\n') ; - -Cin = sparse (n, n) ; - -Din = 10 * sparse (rand (n, n)) ; -D.matrix = Din ; -D.class = 'see below' ; -D.pattern = true (n,n) ; - -Xin = sparse (n, 1) ; - -Mask = sparse (ones (n,n)) ; -mask = sparse (ones (n,1)) ; - -dnn = struct ; -dtn = struct ( 'inp0', 'tran' ) ; -dtn_dot = struct ( 'inp0', 'tran', 'axb', 'dot' ) ; -dtn_saxpy = struct ( 'inp0', 'tran', 'axb', 'saxpy' ) ; -dnt = struct ( 'inp1', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; - -n_semirings = 0 ; - -track_coverage = true ; -if (track_coverage) - global GraphBLAS_grbcov - track_coverage = ~isempty (GraphBLAS_grbcov) ; - clast = sum (GraphBLAS_grbcov > 0) ; - cfirst = clast ; -end - -for k1 = 1:length(mult_ops) - mulop = mult_ops {k1} ; - fprintf ('\n%-10s ', mulop) ; - if (track_coverage) - fprintf ('\n') ; - end - GB_mex_finalize ; - - for k2 = 1:length(add_ops) - addop = add_ops {k2} ; - - for k3 = 1:length (types) - type = types {k3} ; - - semiring.multiply = mulop ; - semiring.add = addop ; - semiring.class = type ; - - % create the semiring. some are not valid because the or,and,xor,eq - % monoids can only be used when z is boolean with z=mult(x,y). - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype xtype ytype] = ... - GB_spec_operator (mult_op) ; - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add, add_optype) ; - catch - continue - end - - A.class = type ; - B.class = type ; - X.class = type ; - Y.class = type ; - D.class = add_op.optype ; - - n_semirings = n_semirings + 1 ; - - % C += A'*B, C dense, typecasting of C - % (test coverage: 96) - C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (Din, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C sparse, no typecasting of C - % (test coverage: 1,234) - C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (D, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - - % X = u*A, with mask (test coverage: 12) - C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - GB_spec_compare (C1, C2, id) ; - - if (track_coverage) - c = sum (GraphBLAS_grbcov > 0) ; - d = c - clast ; - if (d > 0) - fprintf ('[%s.%s.%s %d %d]\n', addop, mulop, type, d, c-cfirst) ; - end - clast = c ; - else - fprintf ('.') ; - end - - end - end -end - -fprintf ('\nsemirings tested: %d\n', n_semirings) ; -fprintf ('\ntest75b: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/ss.m b/GraphBLAS/Test/unused/ss.m deleted file mode 100644 index eeb73990ae..0000000000 --- a/GraphBLAS/Test/unused/ss.m +++ /dev/null @@ -1,17 +0,0 @@ -% test GxB_select - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make - -for k = 32 % [1 2 4 8 16 32] - nthreads_set (k) - debug_off - grbinfo - test27 % LoHi_band, for user-defined - debug_on - grbinfo - test27 -end - diff --git a/GraphBLAS/Test/unused/stest.m b/GraphBLAS/Test/unused/stest.m deleted file mode 100644 index c01bfad9ef..0000000000 --- a/GraphBLAS/Test/unused/stest.m +++ /dev/null @@ -1,34 +0,0 @@ -% test GxB_select - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make - -for k = [1 2 4 8 ] % 16 32] - nthreads_set (k) - - debug_on - grbinfo - stat - - test129 %GxB_select (tril and nonzero, hypersparse) - test134 % shorter version of test25 - test27 % LoHi_band, for user-defined - test26 % performance test - test76 % resize - test25 % built-in, exhaustive test - - debug_off - grbinfo - stat - - test129 %GxB_select (tril and nonzero, hypersparse) - test134 % shorter version of test25 - test27 % LoHi_band, for user-defined - test26 % performance test - test76 % resize - test25 % built-in, exhaustive test - -end - diff --git a/GraphBLAS/Test/unused/t74.m b/GraphBLAS/Test/unused/t74.m deleted file mode 100644 index 6fe9539ebd..0000000000 --- a/GraphBLAS/Test/unused/t74.m +++ /dev/null @@ -1,11 +0,0 @@ -%T74 run test20 and test74 - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -threads {1} = [4 1] ; -t = threads ; -logstat ('test20',t) ; % quick test of GB_mex_mxm on a few semirings -logstat ('test74',t) ; % test GrB_mxm on all semirings - diff --git a/GraphBLAS/Test/unused/t99.m b/GraphBLAS/Test/unused/t99.m deleted file mode 100644 index b0f23e6e42..0000000000 --- a/GraphBLAS/Test/unused/t99.m +++ /dev/null @@ -1,9 +0,0 @@ - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all -test99 -t {1} = [4 1] ; -logstat ('test99',t) ; % GB_mex_transpose with explicit zeros in the Mask - diff --git a/GraphBLAS/Test/unused/test03.m b/GraphBLAS/Test/unused/test03.m deleted file mode 100644 index 40248bf37f..0000000000 --- a/GraphBLAS/Test/unused/test03.m +++ /dev/null @@ -1,63 +0,0 @@ -function test03 -%TEST03 test GB_*_check functions - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -rng ('default') ; - -for k = 1:length (types) - aclass = types {k} ; - for is_hyper = 0:1 - for is_csc = 0:1 - A = GB_spec_random (10,30,0.2,100,aclass, is_csc, is_hyper) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - end - end - for hyper_switch = -0.1:0.1:0.4 - A = GB_spec_random (10,30,0.02,100,aclass, is_csc, [ ], hyper_switch) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - end -end - -for is_hyper = 0:1 - for is_csc = 0:1 - A = GB_spec_random (100,2,0.5,100,'int8', is_csc, is_hyper) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - end -end - -for k = [false true] - fprintf ('builtin_complex: %d\n', k) ; - GB_builtin_complex_set (k) ; - - % complex case: - A = GB_mex_random (10, 30, 15, 1, 1, 0, 0, 0) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - A = GB_mex_random (10, 30, 15, 1, 1, 0, 0, 1) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - A = GB_mex_random (10, 30, 15, 1, 1, 1, 0, 1) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - A = GB_mex_random (10, 30, 15, 1, 1, 1, 0, 0) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - A = GB_mex_random (10, 30, 15, 1, 1, 1, 1, 1) ; - C = GB_mex_dump (A,2) ; - GB_spec_compare (C, A) ; - A = GB_mex_random (3, 3, 5, 0, 1, 1, 1, 3) - C = GB_mex_dump (A) - GB_spec_compare (C, A) ; -end - -GB_builtin_complex_set (true) ; -fprintf ('\ntest03: all object check tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test05.m b/GraphBLAS/Test/unused/test05.m deleted file mode 100644 index bd6d735b89..0000000000 --- a/GraphBLAS/Test/unused/test05.m +++ /dev/null @@ -1,45 +0,0 @@ -function test05 -%TEST05 test GrB_*_setElement - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -A = sparse (5,5) ; -A (2,2) = 42 ; - -I = [1 2 3 2]' ; -J = [1 2 3 2]' ; - -I0 = uint64 (I-1) ; -J0 = uint64 (I-1) ; -X = [4 5 6 3]' ; - - -C1 = GB_mex_setElement (A, I0, J0, int8(X)) ; -C2 = GB_mex_setElement (A, I0, J0, int8(X), false, true) ; - -B = A ; -for k = 1:length(I) - B (I (k), J (k)) = X (k) ; -end - -assert (isequal (C1.matrix, B)) -assert (isequal (C2.matrix, B)) - -A2.matrix = A ; - -for A_is_hyper = 0:1 - for A_is_csc = 0:1 - A2.is_csc = A_is_csc ; - A2.is_hyper = A_is_hyper ; - - C3 = GB_mex_setElement (A2, I0, J0, int8(X)) ; - C4 = GB_mex_setElement (A2, I0, J0, int8(X), false, true) ; - assert (isequal (C3.matrix, B)) - assert (isequal (C4.matrix, B)) - - end -end - -fprintf ('\ntest05: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test07.m b/GraphBLAS/Test/unused/test07.m deleted file mode 100644 index 4e53d5d960..0000000000 --- a/GraphBLAS/Test/unused/test07.m +++ /dev/null @@ -1,39 +0,0 @@ -function test07 -%TEST07 test GxB_subassign with a single pending tuple - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% adds a single pending tuple - -rng ('default') ; -C = sparse (rand (5,4)) ; -C (2,3) = 0 ; -A = 100 * sparse (magic (2)) ; - -I = [2 3] ; -J = [3 4] ; - -C2 = C ; -C2 (I,J) = A ; - -% full (C) -% full (C2) - -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; - -C3 = GB_mex_subassign (C, [ ], '', A, I0, J0, [ ]) ; -% C3.matrix -% full (C3.matrix) -assert (isequal (C3.matrix, C2)) - -I0 = I0 (1) ; -I = I (1) ; -C3 = GB_mex_subassign (C, C(I,J), '', A(1,:), I0, J0, [ ]) ; -C2 = C ; -C2 (I,J(2)) = A (1,2) ; -assert (isequal (C3.matrix, C2)) - -fprintf ('\ntest07: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test07b.m b/GraphBLAS/Test/unused/test07b.m deleted file mode 100644 index 1808277858..0000000000 --- a/GraphBLAS/Test/unused/test07b.m +++ /dev/null @@ -1,41 +0,0 @@ -function test07b -%TEST07B test GrB_assign with a single pending tuple - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% adds a single pending tuple - -rng ('default') ; -C = sparse (rand (5,4)) ; -C (2,3) = 0 ; -A = 100 * sparse (magic (2)) ; - -I = [2 3] ; -J = [3 4] ; - -C2 = C ; -C2 (I,J) = A ; - -% full (C) -% full (C2) - -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; - -C3 = GB_mex_assign (C, [ ], '', A, I0, J0, [ ]) -% C3.matrix -% full (C3.matrix) -assert (isequal (C3.matrix, C2)) - -I0 = I0 (1) ; -I = I (1) ; -M = sparse ([0 1]) ; -% note that the Mask has the same size as C -C3 = GB_mex_assign (C, C, '', A(1,:), I0, J0, [ ]) ; -C2 = C ; -C2 (I,J(2)) = A (1,2) ; -assert (isequal (C3.matrix, C2)) - -fprintf ('\ntest07b: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test09b.m b/GraphBLAS/Test/unused/test09b.m deleted file mode 100644 index 206afacf49..0000000000 --- a/GraphBLAS/Test/unused/test09b.m +++ /dev/null @@ -1,46 +0,0 @@ -function test09b -%TEST09B test GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n-----------duplicate I,J test of GB_mex_assign\n') ; - -I = [2 3 2 3 3] ; J = [2 2 4 4 ] ; -I0 = uint64 (I) ; -J0 = uint64 (J); - -C = sparse (magic (5)) ; -A = sparse (77 * ones (5,4)) ; - -C2 = GB_mex_assign(C, [ ], [ ], A, I0, J0) ; - -% check erroneous I and J - -fprintf ('testing error handling, errors expected:\n') ; -A = sparse (1) ; -try - K = uint64 (99) ; - GB_mex_assign (C, [], 'plus', A, K, K) ; - ok = false ; -catch me - ok = true ; -end -assert (ok) ; - - -A = sparse (rand (2)) ; -try - I = uint64 ([0 0]) ; - K = uint64 ([99 100]) ; - GB_mex_assign (C, [], 'plus', A, I, K) ; - ok = false ; -catch me - ok = true ; -end -assert (ok) ; - -fprintf ('\nAll tests passed (errors expected)\n') ; -fprintf ('\ntest09b: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test101.m b/GraphBLAS/Test/unused/test101.m deleted file mode 100644 index 34cf5d48dc..0000000000 --- a/GraphBLAS/Test/unused/test101.m +++ /dev/null @@ -1,29 +0,0 @@ -function test101 -%TEST101 test import/export - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('\ntest101: GB_mex_export\n') ; - -dump = 0 ; - -for clear_nvec = 0:1 - for n = 1:5 - for m = 1:5 - A = sprand (m, n, 0.1) ; - for f = 0:3 - for hyper = 0:1 - for csc = 0:1 - C = GB_mex_export (A, f, hyper, csc, dump, clear_nvec) ; - assert (isequal (A, C)) ; - end - end - end - end - end -end - -fprintf ('\ntest101: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test102.m b/GraphBLAS/Test/unused/test102.m deleted file mode 100644 index 9d098d24c0..0000000000 --- a/GraphBLAS/Test/unused/test102.m +++ /dev/null @@ -1,63 +0,0 @@ -function test102 -%TEST102 test GB_AxB_saxpy3_flopcount - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest102: testing GB_AxB_saxpy3_flopcount\n') ; - -rng ('default') ; - -for m = [0 1 10 100] - for n = [0 1 10 100] - for d = [0.01 0.1 0.5 1.0] - - % create the mask M and its hypersparse version - M = sprand (m, n, d) ; - Mhyper.matrix = M ; - Mhyper.pattern = spones (M) ; - Mhyper.is_hyper = true ; - - for k = [0 1 10 100] - - % create B and its hypersparse version - B = sprand (k, n, d) ; - Bhyper.matrix = B ; - Bhyper.pattern = spones (B) ; - Bhyper.is_hyper = true ; - - % create A and its hypersparse version - A = sprand (m, k, d) ; - Ahyper.matrix = A ; - Ahyper.pattern = spones (A) ; - Ahyper.is_hyper = true ; - - % flop counts for C=A*B - mflops = flopcount ([ ], 0, A, B) ; - total = mflops (end) ; - - floptest ([ ], 0, A, B, mflops) ; - floptest ([ ], 0, Ahyper, Bhyper, total) ; - floptest ([ ], 0, Ahyper, B, total) ; - floptest ([ ], 0, A, Bhyper, total) ; - - % flop counts for C=A*B - mflops = flopcount (M, 0, A, B) ; - total = mflops (end) ; - - floptest (M, 0, A, B, mflops) ; - floptest (M, 0, A, Bhyper, total) ; - floptest (M, 0, Ahyper, B, total) ; - floptest (M, 0, Ahyper, Bhyper, total) ; - floptest (Mhyper, 0, A, B, total) ; - floptest (Mhyper, 0, Ahyper, B, total) ; - floptest (Mhyper, 0, A, Bhyper, total) ; - floptest (Mhyper, 0, A, B, total) ; - - end - end - end -end - -fprintf ('\ntest102: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test103.m b/GraphBLAS/Test/unused/test103.m deleted file mode 100644 index 59ba869159..0000000000 --- a/GraphBLAS/Test/unused/test103.m +++ /dev/null @@ -1,78 +0,0 @@ -function test103 -%TEST103 test aliases in GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng 'default' -fprintf ('\ntest103: test aliases in GrB_transpose\n') ; - -for m = [1 5 10] - for n = [1 5 10] - for d = [0 0.1 .5 1] - for is_csc = 0:1 - for is_hyper = 0:1 - - if (is_hyper) - hyper_switch = 1 ; - else - hyper_switch = 0 ; - end - - % A = GB_spec_random (m, n, d, scale, class, - % is_csc,is_hyper,hyper_switch) - - C = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - - M = sparse (ones (m, n)) ; - - A = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - - % C=A, to test shallow cast - desc.inp0 = 'tran' ; - C2a = GB_spec_transpose (C, M, 'plus', A, desc) ; - C2b = GB_mex_transpose (C, M, 'plus', A, desc, 'test') ; - GB_spec_compare (C2a, C2b) ; - - C2a = GB_spec_transpose (C, M, [ ], A, desc) ; - C2b = GB_mex_transpose (C, M, [ ], A, desc, 'test') ; - GB_spec_compare (C2a, C2b) ; - - C2a = GB_spec_transpose (C, [ ], [ ], A, desc) ; - C2b = GB_mex_transpose (C, [ ], [ ], A, desc, 'test') ; - GB_spec_compare (C2a, C2b) ; - - C3a = GB_spec_transpose (C, C, 'plus', A, desc) ; - C3b = GB_mex_transpose (C, C, 'plus', A, desc, 'test') ; - C3c = GB_mex_transpose (C, 'C', 'plus', A, desc, 'test') ; - GB_spec_compare (C3a, C3b) ; - GB_spec_compare (C3a, C3c) ; - - C3a = GB_spec_transpose (C, C, [ ], A, desc) ; - C3b = GB_mex_transpose (C, C, [ ], A, desc, 'test') ; - C3c = GB_mex_transpose (C, 'C', [ ], A, desc, 'test') ; - GB_spec_compare (C3a, C3b) ; - GB_spec_compare (C3a, C3c) ; - - C4a = GB_spec_transpose (C, C, 'plus', C, desc) ; - C4b = GB_mex_transpose (C, C, 'plus', C, desc, 'test'); - GB_spec_compare (C4a, C4b) ; - C4c = GB_mex_transpose (C, 'C', 'plus', 'C', desc, 'test'); - GB_spec_compare (C4a, C4c) ; - - C4a = GB_spec_transpose (C, C, [ ], C, desc) ; - C4b = GB_mex_transpose (C, C, [ ], C, desc, 'test'); - GB_spec_compare (C4a, C4b) ; - C4c = GB_mex_transpose (C, 'C', [ ], 'C', desc, 'test'); - GB_spec_compare (C4a, C4c) ; - - end - end - end - end -end - -fprintf ('\ntest103: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test105.m b/GraphBLAS/Test/unused/test105.m deleted file mode 100644 index a8d66f26f1..0000000000 --- a/GraphBLAS/Test/unused/test105.m +++ /dev/null @@ -1,51 +0,0 @@ -function test105 -%TEST105 eWiseAdd with hypersparse matrices - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng 'default' -fprintf ('\ntest105: eWiseAdd with hypersparse\n') ; - -for m = [0 1 5 100] - for n = [0 1 5 100] - for d = [0 0.1 0.5 1] - for is_csc = 0:1 - for is_hyper = 0:1 - - if (is_hyper) - hyper_switch = 1 ; - else - hyper_switch = 0 ; - end - - A = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - B = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - C = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - M = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - - % C = A+B, no mask - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], ... - 'plus', A, B, [ ], 'test') ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], ... - 'plus', A, B, [ ], 'test') ; - GB_spec_compare (C0, C1) ; - - % C = A+B, with mask - C0 = GB_spec_Matrix_eWiseAdd (C, M, [ ], ... - 'plus', A, B, [ ], 'test') ; - C1 = GB_mex_Matrix_eWiseAdd (C, M, [ ], ... - 'plus', A, B, [ ], 'test') ; - GB_spec_compare (C0, C1) ; - - end - end - end - end -end - -fprintf ('\ntest105: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test106.m b/GraphBLAS/Test/unused/test106.m deleted file mode 100644 index d1e38e4737..0000000000 --- a/GraphBLAS/Test/unused/test106.m +++ /dev/null @@ -1,54 +0,0 @@ -function test106 -%TEST106 GxB_subassign with alias - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng 'default' -fprintf ('\ntest106: GxB_subassign with alias\n') ; - -for m = [0 1 5 100] - for n = [0 1 5 100] - I1 = randperm (m) ; - J1 = randperm (n) ; - I0 = uint64 (I1) - 1 ; - J0 = uint64 (J1) - 1 ; - for d = [0 0.1 0.5 1] - for is_csc = 0:1 - for is_hyper = 0:1 - - if (is_hyper) - hyper_switch = 1 ; - else - hyper_switch = 0 ; - end - - A = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - B = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - C = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - M = GB_spec_random (m, n, d, 100, 'double', ... - is_csc, is_hyper, hyper_switch) ; - - C1a = GB_mex_subassign (C, [ ], [ ], C, I0, J0, [ ]) ; - C2 = GB_spec_subassign (C, [ ], [ ], C, I1, J1, [ ], 0) ; - GB_spec_compare (C1a, C2) ; - C1b = GB_mex_subassign (C, [ ], [ ], 'C', I0, J0, [ ]) ; - GB_spec_compare (C1b, C2) ; - - C1a = GB_mex_subassign (C, C, [ ], A, I0, J0, [ ]) ; - C2 = GB_spec_subassign (C, C, [ ], A, I1, J1, [ ], 0) ; - GB_spec_compare (C1a, C2) ; - C1b = GB_mex_subassign (C, 'C', [ ], A, I0, J0, [ ]) ; - GB_spec_compare (C1b, C2) ; - - end - end - end - end -end - -fprintf ('\ntest106: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test107.m b/GraphBLAS/Test/unused/test107.m deleted file mode 100644 index 10cb34e53a..0000000000 --- a/GraphBLAS/Test/unused/test107.m +++ /dev/null @@ -1,248 +0,0 @@ -function test107 -%TEST107 user-defined terminal monoid - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test107: reduce with built-in and user-defined terminal monoids\n') ; - -rng ('default') ; - -save = nthreads_get ; -if (nargin < 1) - fulltest = false ; -end -nthreads_max = GB_mex_omp_max_threads ; -if (fulltest) - nthreads_list = [1 2 4 8 16 20 40 64 160] ; -else - nthreads_list = [1 nthreads_max 2*nthreads_max] ; -end - -% create a matrix with entries [0..2] -A = 2 * sparse (rand (4)) ; -s = full (max (max (A))) ; - -c = GB_mex_reduce_terminal (A, 2) ; -assert (c == s) ; - -% now add the terminal value somewhere -A (1,2) = 2 ; -s = full (max (max (A))) ; -c = GB_mex_reduce_terminal (A, 2) ; -assert (c == s) ; -clear A - -ntrials = 10 ; - -%------------------------------------------------------------------------------- -% big matrix ... -fprintf ('\nbig matrix, no early exit\n') ; -if (fulltest) - n = 6000 ; -else - n = 1000 ; -end -A = sparse (rand (n)) ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > 2*nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (0, [ ], 'max', A) ; - end - tg = toc ; - assert (s == c1) ; - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('nthreads %3d built-in %g speedup %g\n', nthreads, tg, t1/tg) ; - - tic - for trial = 1:ntrials - c2 = GB_mex_reduce_terminal (A, 1) ; % user-defined - end - t2 = toc ; - fprintf ('nthreads %3d %g\n', nthreads, t2) ; - assert (s == c2) ; - - tic - for trial = 1:ntrials - c3 = GB_mex_reduce_terminal (A, 2) ; % user-defined - end - t3 = toc ; - fprintf ('nthreads %3d %g\n', nthreads, t3) ; - assert (s == c3) ; - -end - -%------------------------------------------------------------------------------- -fprintf ('\nbig matrix, with early exit\n') ; - -A (n,1) = 1 ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (0, [ ], 'max', A) ; - end - t1 = toc ; - fprintf ('nthreads %3d built-in %g\n', nthreads, t1) ; - tic - for trial = 1:ntrials - c2 = GB_mex_reduce_terminal (A, 1) ; % user-defined - end - t2 = toc ; - fprintf ('nthreads %3d %g\n', nthreads, t2) ; - assert (s == c1) ; - assert (s == c2) ; -end - -%------------------------------------------------------------------------------- -fprintf ('\nbig matrix, with inf \n') ; - -A (n,1) = inf ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (0, [ ], 'max', A) ; - end - t1 = toc ; - fprintf ('nthreads %3d built-in %g\n', nthreads, t1) ; - tic - for trial = 1:ntrials - c2 = GB_mex_reduce_terminal (A, inf) ; - end - t2 = toc ; - fprintf ('nthreads %3d %g\n', nthreads, t2) ; - assert (s == c1) ; - assert (s == c2) ; -end - -%------------------------------------------------------------------------------- -fprintf ('\nbig matrix, with 2 \n') ; - -A (n,1) = 2 ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (0, [ ], 'max', A) ; - end - t1 = toc ; - fprintf ('nthreads %3d built-in %g\n', nthreads, t1) ; - tic - for trial = 1:ntrials - c2 = GB_mex_reduce_terminal (A, 2) ; - end - t2 = toc ; - fprintf ('nthreads %3d %g\n', nthreads, t2) ; - assert (s == c1) ; - assert (s == c2) ; -end - -%------------------------------------------------------------------------------- -fprintf ('\nbig matrix, with nan\n') ; - -A (n,1) = nan ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (0, [ ], 'max', A) ; - end - t1 = toc ; - fprintf ('nthreads %3d built-in %g\n', nthreads, t1) ; - assert (s == c1) ; -end - -assert (s == c1) ; - -%------------------------------------------------------------------------------- -fprintf ('\nsum\n') ; - -A (n,1) = 1 ; - -tic -for trial = 1:ntrials - ss = full (sum (sum (A))) ; -end -tm = toc ; -fprintf ('builtin sum: %g\n', tm) ; -for nthreads = nthreads_list - fprintf ('\n') ; - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - tic - for trial = 1:ntrials - cc = GB_mex_reduce_to_scalar (0, [ ], 'plus', A) ; - end - t1 = toc ; - fprintf ('nthreads %3d built-in %g\n', nthreads, t1) ; - assert (s == c1) ; -end - -err = abs (ss - cc) / ss -assert (err < 1e-12) ; - -nthreads_set (save) ; -fprintf ('test107: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test110.m b/GraphBLAS/Test/unused/test110.m deleted file mode 100644 index bdbdb1c704..0000000000 --- a/GraphBLAS/Test/unused/test110.m +++ /dev/null @@ -1,30 +0,0 @@ -function test110 -%TEST110 test accum/mask (binary search of M(:,j)) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest110: test accum/mask (binary search of M(:,j))\n') ; - -rng ('default') - -m = 100 ; -n = 100 ; -M = spones (rand (m,n)) ; -M (m,:) = 0 ; - -C = sprand (m, n, 0.01) ; -A = sprand (m, n, 0.02) ; - -C1 = GB_mex_apply (C, M, 'plus', 'identity', A) ; -C2 = GB_spec_apply (C, M, 'plus', 'identity', A, [ ]) ; -GB_spec_compare (C1,C2) ; - -d.mask = 'complement' ; - -C1 = GB_mex_apply (C, M, 'plus', 'identity', A, d) ; -C2 = GB_spec_apply (C, M, 'plus', 'identity', A, d) ; -GB_spec_compare (C1,C2) ; - -fprintf ('\ntest110: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test111.m b/GraphBLAS/Test/unused/test111.m deleted file mode 100644 index 0b1eb5f4bd..0000000000 --- a/GraphBLAS/Test/unused/test111.m +++ /dev/null @@ -1,222 +0,0 @@ -function test111 -%TEST111 performance test for eWiseAdd - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest111 performance tests : eWiseAdd \n') ; -rng ('default') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -n = 40e6 ; -% n = 1e6 ; -Empty = sparse (n, 1) ; - -% for d = [0.001 0.01 0.1:.1:1] -for d = [0.001 0.01 0.1 0.4 1 2 3] - - if (d == 1) - A = sparse (rand (n,1)) ; - B = sparse (rand (n,1)) ; - mds = 1 ; - elseif (d == 2) - A = sparse (rand (n,1)) ; - B = sprand (n,1,0.1) ; - mds = 0.1 ; - elseif (d == 3) - A = sprand (n,1,0.1) ; - B = sparse (rand (n,1)) ; - mds = 0.1 ; - else - A = sprand (n,1,d) ; - B = sprand (n,1,d) ; - mds = [d/36 d/8 d] ; - end - - for md = mds - - if (md == 1) - M = sparse (rand (n,1)) ; - else - M = sprand (n,1,md) ; - end - - M = spones (M) ; - M0 = logical (M) ; - - fprintf ('\n######################################################\n') ; - fprintf ('d = %12.4f md = %12.4f\n', d, md) ; - fprintf ('######################################################\n') ; - fprintf ('nnz (A) = %d nnz (B) = %d nnz (M) = %d\n', ... - nnz (A), nnz (B), nnz (M)) ; - - %---------------------------------------------------------------------- - % add - %---------------------------------------------------------------------- - - % warmup - C1 = A + B ; - tic - C1 = A + B ; - toc - tm = toc ; - fprintf ('nnz (C) = %d\n', nnz (C1)); - fprintf ('\nvia GB_add:\n') ; - - for nthreads = [1 2 4 8 20 40] - nthreads_set (nthreads, chunk) ; - tic ; - C4 = GB_mex_AplusB (A, B, 'plus') ; - tg = toc ; - if (nthreads == 1) - t1 = tg ; - end - fprintf ('nthreads %2d GraphBLAS time: %12.4f ', nthreads, tg) ; - fprintf ('speedup %12.4f over built-in: %12.4f\n', t1/tg, tm/tg) ; - assert (GB_spok (C4) == 1) ; - assert (isequal (C1, C4)) ; - end - - %---------------------------------------------------------------------- - % masked add - %---------------------------------------------------------------------- - - fprintf ('\nmasked add:\n') ; - % warmup - C1 = M.*(A + B) ; - tic - C1 = M.*(A + B) ; - toc - tm = toc ; - fprintf ('nnz (C) = %d\n', nnz (C1)); - fprintf ('\nvia masked GB_add:\n') ; - - for nthreads = [1 2 4 8 20 40] - nthreads_set (nthreads, chunk) ; - % warmup - C4 = GB_mex_Vector_eWiseAdd (Empty, M0, [ ], 'plus', A, B, [ ]) ; - tic - C4 = GB_mex_Vector_eWiseAdd (Empty, M0, [ ], 'plus', A, B, [ ]) ; - tg = toc ; - if (nthreads == 1) - t1 = tg ; - end - fprintf ('nthreads %2d GraphBLAS time: %12.4f ', nthreads, tg) ; - fprintf ('speedup %12.4f over built-in: %12.4f\n', t1/tg, tm/tg) ; - assert (GB_spok (C4.matrix) == 1) ; - assert (isequal (C1, C4.matrix)) ; - end - - %----------------------------------------------------------------------- - % unmasked add then ewise mult - %----------------------------------------------------------------------- - - fprintf ('\nunmasked add then emult:\n') ; - % warmup - C1 = M.*(A + B) ; - tic - C1 = M.*(A + B) ; - toc - tm = toc ; - fprintf ('nnz (C) = %d\n', nnz (C1)); - fprintf ('\nvia unmasked add then emult:\n') ; - - for nthreads = [1 2 4 8 20 40] - nthreads_set (nthreads, chunk) ; - % warmup - C4 = GB_mex_Vector_eWiseAdd (Empty, [ ], [ ], 'plus', A, B, [ ]) ; - C4 = GB_mex_Vector_eWiseMult(Empty, [ ], [ ], 'times',M, C4, [ ]) ; - tic - C4 = GB_mex_Vector_eWiseAdd (Empty, [ ], [ ], 'plus', A, B, [ ]) ; - tg1 = toc ; - tic - C4 = GB_mex_Vector_eWiseMult(Empty, [ ], [ ], 'times',M, C4, [ ]) ; - tg2 = toc ; - tg = tg1 + tg2 ; - if (nthreads == 1) - t1 = tg ; - end - fprintf ('nthreads %2d GraphBLAS time: %12.4f ', nthreads, tg) ; - fprintf ('speedup %12.4f over built-in: %12.4f\n', t1/tg, tm/tg) ; - assert (GB_spok (C4.matrix) == 1) ; - assert (isequal (C1, C4.matrix)) ; - end - - %----------------------------------------------------------------------- - % ewise multiply - %----------------------------------------------------------------------- - - % warmup - C1 = A .* B ; - tic - C1 = A .* B ; - toc - tm = toc ; - fprintf ('nnz (C) = %d for A.*B\n', nnz (C1)); - fprintf ('\nvia GB_eWiseMult:\n') ; - - for nthreads = [1 2 4 8 20 40] - nthreads_set (nthreads, chunk) ; - % warmup - C4 = GB_mex_Vector_eWiseMult (Empty, [ ], [ ], 'times', A,B, [ ]) ; - tic - C4 = GB_mex_Vector_eWiseMult (Empty, [ ], [ ], 'times', A,B, [ ]) ; - tg = toc ; - if (nthreads == 1) - t1 = tg ; - end - fprintf ('nthreads %2d GraphBLAS time: %12.4f ', nthreads, tg) ; - fprintf ('speedup %12.4f over built-in: %12.4f\n', t1/tg, tm/tg) ; - assert (GB_spok (C4.matrix) == 1) ; - assert (isequal (C1, C4.matrix)) ; - end - - %----------------------------------------------------------------------- - % masked ewise multiply - %----------------------------------------------------------------------- - - fprintf ('\nmasked emult:\n') ; - % warmup - C1 = M.* (A .* B) ; - tic - C1 = M.* (A .* B) ; - toc - tm = toc ; - fprintf ('nnz (C) = %d for A.*B\n', nnz (C1)); - fprintf ('\nvia GB_eWiseMult:\n') ; - - for nthreads = [1 2 4 8 20 40] - nthreads_set (nthreads, chunk) ; - % warmup - C4 = GB_mex_Vector_eWiseMult (Empty, M0, [ ], 'times', A,B, [ ]) ; - tic - C4 = GB_mex_Vector_eWiseMult (Empty, M0, [ ], 'times', A,B, [ ]) ; - tg = toc ; - if (nthreads == 1) - t1 = tg ; - end - fprintf ('nthreads %2d GraphBLAS time: %12.4f ', nthreads, tg) ; - fprintf ('speedup %12.4f over built-in: %12.4f\n', t1/tg, tm/tg) ; - assert (GB_spok (C4.matrix) == 1) ; - assert (isequal (C1, C4.matrix)) ; - end - - end -end - -fprintf ('\ndense matrices:\n') ; - -A = full (A) ; -B = full (B) ; - -for trial = 1:4 - tic - C1 = A + B ; - toc - tm = toc ; -end -nthreads_set (save, save_chunk) ; - -fprintf ('test111: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test112.m b/GraphBLAS/Test/unused/test112.m deleted file mode 100644 index d8aa491f1a..0000000000 --- a/GraphBLAS/Test/unused/test112.m +++ /dev/null @@ -1,55 +0,0 @@ -function test112 -%TEST112 test row/col scale - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test112: row/col scale\n') ; - -rng ('default') ; - -n = 2000 ; - - D = spdiags (rand (n,1), 0, n, n) ; - A = sprand (n, n, 0.1) ; - B = sprand (n, n, 0.1) ; - p = randperm (n) ; - P = D (p,:) ; - - % both diag - fprintf ('\nboth diag:\n') ; - C1 = D*D ; - C2 = GB_mex_AxB (D, D) ; - assert (norm (C1-C2,1) < 1e-14) ; - - % row scale - fprintf ('\nA is diag:\n') ; - C1 = D*B ; - C2 = GB_mex_AxB (D, B) ; - assert (norm (C1-C2,1) < 1e-14) ; - - % col scale - fprintf ('\nB is diag:\n') ; - C1 = A*D ; - C2 = GB_mex_AxB (A, D) ; - assert (norm (C1-C2,1) < 1e-14) ; - - % regular - fprintf ('\nneither diag:\n') ; - C1 = A*B ; - C2 = GB_mex_AxB (A, B) ; - assert (norm (C1-C2,1) < 1e-14) ; - - % permute - fprintf ('\ncol permutation:\n') ; - C1 = A*P ; - C2 = GB_mex_AxB (A, P) ; - assert (norm (C1-C2,1) < 1e-14) ; - - % permute - fprintf ('\nrow permutation:\n') ; - C1 = P*B ; - C2 = GB_mex_AxB (P, B) ; - assert (norm (C1-C2,1) < 1e-14) ; - -fprintf ('test112: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test113.m b/GraphBLAS/Test/unused/test113.m deleted file mode 100644 index 80d70a9e01..0000000000 --- a/GraphBLAS/Test/unused/test113.m +++ /dev/null @@ -1,46 +0,0 @@ -function test113 -%TEST113 performance tests for GrB_kron - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test113: performance tests for GrB_kron\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -ncores = feature_numcores ; - -A = sprand (310, 302, 0.1) ; -B = sprand (300, 301, 0.1) ; -fprintf ('nnz(A) %g\n', nnz (A)) ; -fprintf ('nnz(B) %g\n', nnz (B)) ; -fprintf ('nnz(C) %g\n', nnz (A) * nnz (B)) ; - -tic -C = kron (A,B) ; -tm = toc ; -fprintf ('built-in: %g sec\n', tm) ; - -[m n] = size (C) ; -Empty = sparse (m,n) ; - -for nthreads = [1 2 4 8 16 20 40] - - if (nthreads > 2*ncores) - break ; - end - - nthreads_set (nthreads,chunk) ; - - tic - C1 = GB_mex_kron (Empty, [ ], [ ], 'times', A, B) ; - t (nthreads) = toc ; - - assert (isequal (C, C1.matrix)) ; - - fprintf ('GB: %12.4f sec speedup: %12.4f vs built-in: %12.4f\n', ... - t (nthreads), t (1) / t (nthreads), tm / t (nthreads)) ; - -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test114.m b/GraphBLAS/Test/unused/test114.m deleted file mode 100644 index 6faf37f649..0000000000 --- a/GraphBLAS/Test/unused/test114.m +++ /dev/null @@ -1,141 +0,0 @@ -function test114 -%TEST114 performance of reduce-to-scalar - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads_list = [1 2 4 8 16 2 40 64 160] ; -nthreads_max = GB_mex_omp_max_threads ; -ntrials = 10 ; - -%------------------------------------------------------------------------------- -% big matrix ... -fprintf ('\nbig matrix, no early exit\n') ; -n = 8000 ; -A = sparse (ones (n)) ; - -tic -for trial = 1:ntrials - s = full (max (max (A))) ; -end -tm = toc ; -fprintf ('builtin max: %g\n', tm) ; - -tic -for trial = 1:ntrials - s = full (min (min (A))) ; -end -tm = toc ; -fprintf ('builtin min: %g\n', tm) ; - -tic -for trial = 1:ntrials - s = full (sum (sum (A))) ; -end -tm = toc ; -fprintf ('builtin sum: %g\n', tm) ; - -tic -for trial = 1:ntrials - s = full (prod (prod (A))) ; -end -tm = toc ; -fprintf ('builtin prod: %g\n', tm) ; - -S.matrix = A ; -S.pattern = logical (spones (A)) ; - -[~, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -ops = { 'or', 'and', 'xor', 'eq', 'any' } ; -for k1 = 1:length(ops) - op = ops {k1} ; - fprintf ('\nGraphBLAS: op %s\n', op) ; - S.class = 'logical' ; - cin = logical (0) ; - for nthreads = nthreads_list - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads,chunk) ; - t = 0 ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (cin, [ ], op, S) ; - end - t = toc ; - if (nthreads == 1) - t1 = t ; - end - fprintf ('nthreads %3d %12.4f speedup %12.4f\n', ... - nthreads, t, t1/t) ; - end -end - -ops = add_ops ; -for k1 = 1:length(ops) - op = ops {k1} ; - fprintf ('\nGraphBLAS: op %s\n', op) ; - for k2 = 2:length(types) - atype = types {k2} ; - S.class = atype ; - fprintf ('\ntype: %s\n', atype) ; - try - GB_spec_operator (op, atype) ; - catch - continue - end - switch atype - case 'logical' - cin = logical (0) ; - case 'int8' % GrB_INT8 - cin = int8 (0) ; - case 'uint8' % GrB_UINT8 - cin = uint8 (0) ; - case 'int16' % GrB_INT16 - cin = int16 (0) ; - case 'uint16' % GrB_UINT16 - cin = uint16 (0) ; - case 'int32' % GrB_INT32 - cin = int32 (0) ; - case 'uint32' % GrB_UINT32 - cin = uint32 (0) ; - case 'int64' % GrB_INT64 - cin = int64 (0) ; - case 'uint64' % GrB_UINT64 - cin = uint64 (0) ; - case 'single' % GrB_FP32 - cin = single (0) ; - case 'double' % GrB_FP64 - cin = double (0) ; - case 'single complex' % GxB_FC32 - cin = complex (single (0)) ; - case 'double complex' % GxB_FC64 - cin = complex (double (0)) ; - end - for nthreads = nthreads_list - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads,chunk) ; - t = 0 ; - tic - for trial = 1:ntrials - c1 = GB_mex_reduce_to_scalar (cin, [ ], op, S) ; - end - t = toc ; - if (nthreads == 1) - t1 = t ; - end - fprintf ('nthreads %3d %12.4f speedup %12.4f\n', ... - nthreads, t, t1/t) ; - end - end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test115.m b/GraphBLAS/Test/unused/test115.m deleted file mode 100644 index 3e55ccf124..0000000000 --- a/GraphBLAS/Test/unused/test115.m +++ /dev/null @@ -1,67 +0,0 @@ -function test115 -%TEST115 test GB_assign, scalar expansion and zombies, with duplicates - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - - n = 200 ; - C = sparse (rand (n)) ; - C (:,1) = sparse (rand (n,1) > 0.5) ; - - ntrials = 10 ; - - for k = 1:2:ntrials - - % make some zombies - Work (k).A = sprandn (n, n, 0.1) ; - Work (k).I = [ ] ; - Work (k).J = [ ] ; - Work (k).Mask = sparse (ones (n)) ; - Work (k).accum = [ ] ; - Work (k).desc = [ ] ; - Work (k).scalar = 0 ; - - % scalar expansion - if (rand (1) > 0.5) - % use non-opaque scalar - Work (k+1).A = sparse (pi) ; - use_GrB_Scalar = 1 ; - else - % use GrB_Scalar - Work (k+1).A = sparse (pi * (rand(1) > 0.5)) ; - use_GrB_Scalar = 2 ; - end - Work (k+1).I = uint64 (irand (1, n, n, 1) - 1) ; - Work (k+1).J = uint64 (irand (1, n, n, 1) - 1) ; - Work (k+1).Mask = sparse (ones (n)) ; - Work (k+1).accum = [ ] ; - Work (k+1).desc = [ ] ; - Work (k+1).scalar = use_GrB_Scalar ; - end - - C1 = GB_mex_assign (C, Work) ; % WORK_ASSIGN - - C2 = C ; - for k = 1:ntrials - M = Work (k).Mask ; - A = Work (k).A ; - I = double (Work (k).I + 1) ; - J = double (Work (k).J + 1) ; - scalar = Work (k).scalar ; - C2 = GB_spec_subassign (C2, M, [ ], A, I, J, [ ], scalar) ; - end - - GB_spec_compare (C1, C2) ; - - for C_sparsity = [2 4] - for M_sparsity = [2 4] - ctrl = [C_sparsity M_sparsity] ; - C1 = GB_mex_assign (C, Work, ctrl) ; % WORK_ASSIGN - GB_spec_compare (C1, C2) ; - end - end - -fprintf ('\ntest115: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test116.m b/GraphBLAS/Test/unused/test116.m deleted file mode 100644 index e6e9bce330..0000000000 --- a/GraphBLAS/Test/unused/test116.m +++ /dev/null @@ -1,98 +0,0 @@ -function test116 -%TEST116 performance tests for GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test116:---------------- C(I,J)=A and C=A(I,J) performance\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -million = 1e6 ; - -rng ('default') ; -n = million ; -nz = 100 * million ; -d = nz / n^2 ; -C0 = sprand (n, n, d) ; - -k = n/10 ; -nz = 10 * million ; -d = nz / k^2 ; -A = sprand (k, k, d) ; - -I.begin = 0 ; -I.inc = 1 ; -I.end = k-1 ; - -ncores = feature_numcores ; - -% warmup -C1 = C0 ; -C1 (1:k,1:k) = A ; - -fprintf ('\n--------------------------------------\n') ; -fprintf ('C(I,J) = A:\n') ; -tic -C1 = C0 ; -C1 (1:k,1:k) = A ; -tm = toc ; - -for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - nthreads_set (nthreads, chunk) ; - - % warmup - C2 = GB_mex_assign (C0, [ ], [ ], A, I, I) ; - tic - C2 = GB_mex_assign (C0, [ ], [ ], A, I, I) ; - tg = toc ; - - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : built-in: %10.4f GB: %10.4f speedup %10.4f %10.4f\n', ... - nthreads, tm, tg, tm / tg, t1/tg) ; - - assert (isequal (C1, C2.matrix)) ; -end - - -fprintf ('\n--------------------------------------\n') ; -fprintf ('B = C(I,J):\n') ; - -% warmup -B1 = C1 (1:k,1:k) ; - -tic -B1 = C1 (1:k,1:k) ; -tm = toc ; -S = sparse (k,k) ; - -for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - nthreads_set (nthreads, chunk) ; - - % warmup - B2 = GB_mex_Matrix_extract (S, [ ], [ ], C1, I, I) ; - tic - B2 = GB_mex_Matrix_extract (S, [ ], [ ], C1, I, I) ; - tg = toc ; - - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : built-in: %10.4f GB: %10.4f speedup %10.4f %10.4f\n', ... - nthreads, tm, tg, tm / tg, t1/tg) ; - - assert (isequal (B1, B2.matrix)) ; -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test117.m b/GraphBLAS/Test/unused/test117.m deleted file mode 100644 index 218b4ca03f..0000000000 --- a/GraphBLAS/Test/unused/test117.m +++ /dev/null @@ -1,92 +0,0 @@ -function test117 -%TEST117 performance tests for GrB_assign - -% test C(:,:) += A - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test117 ----------------------------------- C(:,:) += A\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -n = 4000 ; - -I.begin = 0 ; -I.inc = 1 ; -I.end = n-1 ; - -ncores = feature_numcores ; - -for dc = [1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - C0 = sprand (n, n, dc) ; - -for da = [1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - A = sprand (n, n, da) ; - -for dm = [1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - - M = spones (sprand (n, n, dm)) ; - - for subset = 0:1 - - fprintf ('\n--------------------------------------\n') ; - fprintf ('dc: %g, da: %g, dm: %g ', dc, da, dm) ; - if (subset) - fprintf ('M is a subset of C\n') ; - M = spones (M.*C0) ; - end - fprintf ('\n') ; - - fprintf ('nnz(C): %g million, nnz(M): %g million, ', ... - nnz (C0) / 1e6, nnz (M) / 1e6) ; - fprintf ('nnz(A): %g million\n', nnz (A) / 1e6) ; - - % warmup - C1 = C0 + M.*A ; - - tic - C1 = C0 + M.*A ; - tm = toc ; - - for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - nthreads_set (nthreads, chunk) ; - - if (nthreads > 1 & t1 < 0.003) - continue - end - - % warmup: - C2 = GB_mex_assign (C0, M, 'plus', A, I, I) ; - tic - C2 = GB_mex_assign (C0, M, 'plus', A, I, I) ; - tg = toc ; - assert (isequal (C1, C2.matrix)) ; - if (nthreads == 1) - t1 = tg ; - end - - % ewise - C2 = GB_mex_Matrix_eWiseMult (C0, [ ], 'plus', 'times', M, A) ; - tic - C2 = GB_mex_Matrix_eWiseMult (C0, [ ], 'plus', 'times', M, A) ; - tg3 = toc ; - - assert (isequal (C1, C2.matrix)) ; - - fprintf (... - '%3d : %8.4f GB: %8.4f %8.4f rel %8.2f %8.2f\n', ... - nthreads, tm, tg, tg3, tm / tg, tm/tg3) ; - end - - end -end -end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test118.m b/GraphBLAS/Test/unused/test118.m deleted file mode 100644 index 68b57a578f..0000000000 --- a/GraphBLAS/Test/unused/test118.m +++ /dev/null @@ -1,82 +0,0 @@ -function test118 -%TEST118 performance tests for GrB_assign - -% test C(:,:) = A - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test118 ----------------------------------- C(:,:) = A\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -n = 2000 ; -S = sparse (n,n) ; - -I.begin = 0 ; -I.inc = 1 ; -I.end = n-1 ; - -ncores = feature_numcores ; - -for dc = [0 1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - - C0 = sparse (n,n,dc) ; - - for da = [1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - A = sprand (n, n, da) ; - - for dm = [1e-5 1e-4 1e-3 1e-2 1e-1 0.5] - - M = spones (sprand (n, n, dm)) ; - Mbool = logical (M) ; - - fprintf ('\n--------------------------------------\n') ; - fprintf ('dc: %g, da: %g, dm: %g ', dc, da, dm) ; - fprintf ('\n') ; - - fprintf ('nnz(M): %g million, ', nnz (M) / 1e6) ; - fprintf ('nnz(A): %g million\n', nnz (A) / 1e6) ; - - % warmup - % C1 = C0 ; - % C1 (Mbool) = A (Mbool) ; - - tic - C1 = C0 ; - C1 (Mbool) = A (Mbool) ; - tm = toc ; - - t1 = 0 ; - - for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - nthreads_set (nthreads, chunk) ; - - if (nthreads > 1 & t1 < 0.1) - continue - end - - % if (nnz(A) 2*ncores) - break ; - end - if (nthreads > 1 && t1 < 0.01) - break ; - end - - nthreads_set (nthreads, chunk) ; - - C2 = GB_mex_assign (C0, [ ], 'plus', scalar, I0, I0) ; - tic - C2 = GB_mex_assign (C0, [ ], 'plus', scalar, I0, I0) ; - tg = toc ; - assert (isequal (C1, C2.matrix)) ; - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : built-in: %10.4f GB: %8.4f ', nthreads, tm, tg) ; - fprintf (' speedup %10.4f %10.4f\n', tm / tg, t1/tg) ; - - end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test120.m b/GraphBLAS/Test/unused/test120.m deleted file mode 100644 index fb716a0b12..0000000000 --- a/GraphBLAS/Test/unused/test120.m +++ /dev/null @@ -1,92 +0,0 @@ -function test120 -%TEST120 performance tests for GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test120:------------------- C(I,J) += scalar:\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -n = 4000 ; ; - -k = 3000 ; - -% I0.begin = 0 ; -% I0.inc = 1 ; -% I0.end = k-1 ; - I1 = randperm (k) ; - I0 = uint64 (I1) - 1 ; - -d.mask = 'complement' ; - -ncores = feature_numcores ; - -for dc = [2 0 1e-6 1e-5 1e-4 1e-3 1e-2 0.1 1] - - if (dc == 2) - C0 = sparse (rand (n)) ; - else - C0 = sprand (n, n, dc) ; - end - - for dm = [2 0 1e-6 1e-5 1e-4 1e-3 1e-2 0.1 1] - - if (dm == 2) - M = sparse (ones (k)) ; - else - M = spones (sprand (k, k, dm)) ; - end - - Mbool = logical (M) ; - - fprintf ('\n--------------------------------------\n') ; - fprintf ('dc = %g nnz(C) %8.4f million\n', dc, nnz(C0)/1e6) ; - fprintf ('dm = %g nnz(M) %8.4f million\n', dm, nnz(M)/1e6) ; - - tm = inf ; - if (n < 500) - % built-in methods are exceedingly slow for this case - tic - C1 = C0 ; - % Csub = C1 (1:k, 1:k) ; - Csub = C1 (I1, I1) ; - Csub (~Mbool) = Csub (~Mbool) + pi ; - % C1 (1:k, 1:k) = Csub ; - C1 (I1, I1) = Csub ; - tm = toc ; - end - - scalar = sparse (pi) ; - - for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - if (nthreads > 1 && t1 < 0.01) - break ; - end - - nthreads_set (nthreads, chunk) ; - - C2 = GB_mex_subassign (C0, M, 'plus', scalar, I0, I0, d) ; - tic - C2 = GB_mex_subassign (C0, M, 'plus', scalar, I0, I0, d) ; - tg = toc ; - if (n < 500) - assert (isequal (C1, C2.matrix)) ; - end - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : builtin: %10.4f GB: %8.4f ', nthreads, tm, tg) ; - fprintf (' speedup %10.4f %10.4f\n', tm / tg, t1/tg) ; - - end - end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test121.m b/GraphBLAS/Test/unused/test121.m deleted file mode 100644 index e0361e840f..0000000000 --- a/GraphBLAS/Test/unused/test121.m +++ /dev/null @@ -1,68 +0,0 @@ -function test121 -%TEST121 performance tests for GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test121:---------------- C(I,J)+=A performance\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -n = 1e6 ; -k = n/10 ; - -% I.begin = 0 ; -% I.inc = 1 ; -% I.end = k-1 ; - I1 = randperm (k) ; - I0 = uint64 (I1) - 1 ; - -ncores = feature_numcores ; - -for dc = [ 0 1e-6 1e-5 1e-4 ] - - C0 = sprandn (n, n, dc) ; - - for da = [ 0 1e-6 1e-5 1e-4 1e-3 ] - - A = sprandn (k, k, da) ; - - % warmup - C1 = C0 ; - C1 (1:k,1:k) = C1 (1:k,1:k) + A ; - - fprintf ('\n--------------------------------------\n') ; - fprintf ('dc = %g, da = %g\n', dc, da) ; - tic - C1 = C0 ; - % C1 (1:k,1:k) = C1 (1:k,1:k) + A ; - C1 (I1,I1) = C1 (I1,I1) + A ; - tm = toc ; - - for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - nthreads_set (nthreads, chunk) ; - if (nthreads > 1 && t1 < 0.01) - continue ; - end - - C2 = GB_mex_assign (C0, [ ], 'plus', A, I0, I0) ; - tic - C2 = GB_mex_assign (C0, [ ], 'plus', A, I0, I0) ; - tg = toc ; - assert (isequal (C1, C2.matrix)) ; - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : builtin: %10.4f GB: %10.4f', nthreads, tm, tg) ; - fprintf (' speedup %10.4f %10.4f\n', t1/tg, tm / tg) ; - end - end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test122.m b/GraphBLAS/Test/unused/test122.m deleted file mode 100644 index c638369854..0000000000 --- a/GraphBLAS/Test/unused/test122.m +++ /dev/null @@ -1,101 +0,0 @@ -function test122 -%TEST122 performance tests for GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test120:------------------- C(I,J) += A:\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -n = 4000 ; ; - -k = 3000 ; - -% I0.begin = 0 ; -% I0.inc = 1 ; -% I0.end = k-1 ; - I1 = randperm (k) ; - I0 = uint64 (I1) - 1 ; - -d.mask = 'complement' ; - -ncores = feature_numcores ; - -for dc = [2 0 1e-6 1e-5 1e-4 1e-3 1e-2 0.1 1] - - if (dc == 2) - C0 = sparse (rand (n)) ; - else - C0 = sprand (n, n, dc) ; - end - - for da = [2 0 1e-6 1e-5 1e-4 1e-3 1e-2 0.1 1] - - if (da == 2) - A = sparse (rand (k)) ; - else - A = sprandn (k, k, da) ; - end - - for dm = [2 0 1e-6 1e-5 1e-4 1e-3 1e-2 0.1 1] - - if (dm == 2) - M = sparse (ones (k)) ; - else - M = spones (sprand (k, k, dm)) ; - end - - Mbool = logical (M) ; - - fprintf ('\n--------------------------------------\n') ; - fprintf ('dc = %g, dm = %g, da = %g\n', dc, dm, da) ; -% fprintf ('dc = %g nnz(C) %8.4f million\n', dc, nnz(C0)/1e6) ; -% fprintf ('dm = %g nnz(M) %8.4f million\n', dm, nnz(M)/1e6) ; -% fprintf ('da = %g nnz(A) %8.4f million\n', da, nnz(A)/1e6) ; - - tm = inf ; - if (n < 500) - % built-in methods are exceedingly slow for this case - tic - C1 = C0 ; - % Csub = C1 (1:k, 1:k) ; - Csub = C1 (I1, I1) ; - Csub (~Mbool) = Csub (~Mbool) + A (~Mbool) ; - % C1 (1:k, 1:k) = Csub ; - C1 (I1, I1) = Csub ; - tm = toc ; - end - - for nthreads = [1 2 4 8 16 20 32 40 64] - if (nthreads > 2*ncores) - break ; - end - if (nthreads > 1 && t1 < 0.01) - break ; - end - - nthreads_set (nthreads, chunk) ; - - C2 = GB_mex_subassign (C0, M, 'plus', A, I0, I0, d) ; - tic - C2 = GB_mex_subassign (C0, M, 'plus', A, I0, I0, d) ; - tg = toc ; - if (n < 500) - assert (isequal (C1, C2.matrix)) ; - end - if (nthreads == 1) - t1 = tg ; - end - - fprintf ('%3d : builtin: %10.4f GB: %8.4f', nthreads, tm, tg) ; - fprintf (' speedup %10.4f %10.4f\n', tm / tg, t1/tg) ; - - end - end - end -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test126.m b/GraphBLAS/Test/unused/test126.m deleted file mode 100644 index 0648517ae1..0000000000 --- a/GraphBLAS/Test/unused/test126.m +++ /dev/null @@ -1,44 +0,0 @@ -function test126 -%TEST126 test GrB_reduce to vector on a very sparse matrix - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test126: test GrB_reduce to vector on a very sparse matrix\n') ; -rng ('default') ; - -n = 1000 ; -A = sprand (n, n, 0.1) ; -huge = 1e9 ; -A (huge, 2) = 42 ; - -tic -row = sum (A,1) ; -tm1 = toc ; - -nrm = full (sum (row)) ; - -tic -col = sum (A,2) ; -tm2 = toc ; - -s = sparse (huge, 1) ; -tic -w = GB_mex_reduce_to_vector (s, [ ], [ ], 'plus', A, [ ]) ; -tg1 = toc ; -assert (norm (col - w.matrix, 1) / nrm < 1e-12) - -dtn.inp0 = 'tran' ; -s = sparse (n, 1) ; -tic -w = GB_mex_reduce_to_vector (s, [ ], [ ], 'plus', A, dtn) ; -tg2 = toc ; -assert (norm (row' - w.matrix, 1) / nrm < 1e-12) - -fprintf ('reduce each vector: built-in %g GrB %g speedup %g\n', ... - tm1, tg1, tm1/tg1) ; - -fprintf ('reduce each index: built-in %g GrB %g speedup %g\n', ... - tm2, tg2, tm2/tg2) ; - -fprintf ('test126: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test127.m b/GraphBLAS/Test/unused/test127.m deleted file mode 100644 index 0541858bbd..0000000000 --- a/GraphBLAS/Test/unused/test127.m +++ /dev/null @@ -1,428 +0,0 @@ -function test127 -%TEST127 test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -fprintf ('test127 -----------tests of GrB_eWiseAdd and eWiseMult (all ops)\n') ; - -m = 5 ; -n = 5 ; - -rng ('default') ; - -dnn = struct ; -dtn = struct ( 'inp0', 'tran' ) ; -dnt = struct ( 'inp1', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; -dnn_notM = struct ('mask', 'complement') ; - -Amat2 = sparse (2 * sprand (m,n, 0.8)) ; -Bmat2 = sparse (2 * sprand (m,n, 0.8)) ; -Cmat2 = sparse (2 * sprand (m,n, 0.8)) ; -w2 = sparse (2 * sprand (m,1, 0.8)) ; -uvec2 = sparse (2 * sprand (m,1, 0.8)) ; -vvec2 = sparse (2 * sprand (m,1, 0.8)) ; - -Amat = sparse (100 * sprandn (m,n, 0.8)) ; -Bmat = sparse (100 * sprandn (m,n, 0.8)) ; -Cmat = sparse (100 * sprandn (m,n, 0.8)) ; -w = sparse (100 * sprandn (m,1, 0.8)) ; -uvec = sparse (100 * sprandn (m,1, 0.8)) ; -vvec = sparse (100 * sprandn (m,1, 0.8)) ; - -Maskmat = sprandn (m,n,0.9) ~= 0 ; -maskvec = sprandn (m,1,0.9) ~= 0 ; - -% create a very sparse matrix mask -Maskmat2 = sparse (m,n) ; -T = Amat .* Bmat ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -T = (Amat ~= 0) & (Bmat == 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -T = (Amat == 0) & (Bmat ~= 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -clear T i j x - -% create a very sparse vector mask -maskvec2 = sparse (m,1) ; -T = uvec .* vvec ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -T = (uvec ~= 0) & (vvec == 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -T = (uvec == 0) & (vvec ~= 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -clear T i j x - -ATmat = Amat' ; -BTmat = Bmat' ; - -ATmat2 = Amat2.' ; -BTmat2 = Bmat2.' ; - -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('\n\n%-8s : ', type) ; - - for k2 = 1:length(binops) - binop = binops {k2} ; - - op.opname = binop ; - op.optype = type ; - - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - try - GB_spec_operator (op) ; - catch - continue ; - end - - fprintf (' %s', binop) ; - - for A_sparsity_control = 0:1 - for A_is_csc = 0 % 0:1 - for B_sparsity_control = 0:1 - for B_is_csc = 0 % 0:1 - for C_sparsity_control = 0:1 - for C_is_csc = 0 % 0:1 - - if (A_sparsity_control == 0) - A_is_hyper = 0 ; % not hyper - A_sparsity = 1 ; % sparse - else - A_is_hyper = 0 ; % not hyper - A_sparsity = 4 ; % bitmap - end - - if (B_sparsity_control == 0) - B_is_hyper = 0 ; % not hyper - B_sparsity = 1 ; % sparse - else - B_is_hyper = 0 ; % not hyper - B_sparsity = 4 ; % bitmap - end - - if (C_sparsity_control == 0) - C_is_hyper = 0 ; % not hyper - C_sparsity = 1 ; % sparse - else - C_is_hyper = 0 ; % not hyper - C_sparsity = 4 ; % bitmap - end - - for native = 1 % 0:1 - - clear A AT B BT C u v - - if (isequal (binop, 'pow')) - A.matrix = Amat2 ; - AT.matrix = ATmat2 ; - B.matrix = Bmat2 ; - BT.matrix = BTmat2 ; - C.matrix = Cmat2 ; - u.matrix = uvec2 ; - v.matrix = vvec2 ; - else - A.matrix = Amat ; - AT.matrix = ATmat ; - B.matrix = Bmat ; - BT.matrix = BTmat ; - C.matrix = Cmat ; - u.matrix = uvec ; - v.matrix = vvec ; - end - - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - A.sparsity = A_sparsity ; - if (native) - A.class = op.optype ; - end - - AT.is_hyper = A_is_hyper ; - AT.sparsity = A_sparsity ; - AT.is_csc = A_is_csc ; - if (native) - AT.class = op.optype ; - end - - B.is_hyper = B_is_hyper ; - B.sparsity = B_sparsity ; - B.is_csc = B_is_csc ; - if (native) - B.class = op.optype ; - end - - BT.is_hyper = B_is_hyper ; - BT.sparsity = B_sparsity ; - BT.is_csc = B_is_csc ; - if (native) - BT.class = op.optype ; - end - - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - C.sparsity = C_sparsity ; - - u.is_csc = true ; - if (native) - u.class = op.optype ; - end - - v.is_csc = true ; - if (native) - v.class = op.optype ; - end - - %--------------------------------------- - % A+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % B.*A' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %----------------------------------------------- - % with mask - %----------------------------------------------- - - for M_is_very_sparse = 0 % 0:1 - % for M_is_hyper = 0 % 0:1 - for M_sparsity_control = 0:1 - for M_is_csc = 0 % 0:1 - - clear Mask mask - if (M_is_very_sparse) - Mask.matrix = Maskmat2 ; - mask.matrix = maskvec2 ; - else - Mask.matrix = Maskmat ; - mask.matrix = maskvec ; - end - - if (M_sparsity_control == 0) - M_is_hyper = 0 ; % not hyper - M_sparsity = 1 ; % sparse - else - M_is_hyper = 0 ; % not hyper - M_sparsity = 4 ; % bitmap - end - - Mask.is_hyper = M_is_hyper ; - Mask.sparsity = M_sparsity ; - Mask.is_csc = M_is_csc ; - mask.is_csc = true ; - - %--------------------------------------- - % A+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A+B, with mask complemented - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; - w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B, with mask complemented - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; - w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; - - - end - end - end - end - end - end - end - end - end - end - end -end - -fprintf ('\ntest127: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test13.m b/GraphBLAS/Test/unused/test13.m deleted file mode 100644 index 75dcbd193a..0000000000 --- a/GraphBLAS/Test/unused/test13.m +++ /dev/null @@ -1,38 +0,0 @@ -function test13 -%TEST13 test GrB_tranpsose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -cinclass = 'int16' ; - -A.matrix = 50 * sparse (rand (2)) ; -A.matrix (1,2) = 0 ; -A.class = 'logical' ; - -Cin.matrix = 50 * sparse (rand (2)) ; -Cin.class = 'int16' ; - -accum.opname = '' ; -accum.optype = 'logical' - -C = GB_mex_transpose (Cin, [ ], accum, A, [ ]) ; -assert (GB_spok (C.matrix*1) == 1) ; -S = GB_spec_transpose (Cin, [ ], accum, A, [ ]) ; - -assert (isequal (full (double (C.matrix)), double (S.matrix))) ; - -A = GB_spec_matrix (A) ; -Cin = GB_spec_matrix (Cin) ; -Cmatrix = full (C.matrix) ; -Smatrix = full (S.matrix) ; - -assert (isequal (C.class, cinclass)) ; -assert (isequal (C.class, S.class)) ; -if (~(isequalwithequalnans (full (double (C.matrix)), ... - double (S.matrix)))) - assert (false) -end - -fprintf ('\ntest13: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test131.m b/GraphBLAS/Test/unused/test131.m deleted file mode 100644 index ea43acd727..0000000000 --- a/GraphBLAS/Test/unused/test131.m +++ /dev/null @@ -1,44 +0,0 @@ -function test131 -%TEST131 test GrB_Matrix_clear - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest131: GrB_Matrix_clear\n') ; - -rng ('default') ; - -A = sparse (rand (4)) ; -C = GB_mex_clear (A) ; -S = sparse (4,4) ; -assert (isequal (S, C.matrix)) ; - -Ahyper.matrix = A ; -Ahyper.is_hyper = true ; - -C = GB_mex_clear (Ahyper) ; -assert (isequal (S, C.matrix)) ; - -A = sparse (rand (4,1)) ; -C = GB_mex_clear (A) ; -S = sparse (4,1) ; -assert (isequal (S, C.matrix)) ; - -A = sparse (eye (4)) ; -C = GB_mex_clear (A) ; -S = sparse (4,4) ; -assert (isequal (S, C.matrix)) ; - -Ahyper.matrix = A ; -Ahyper.is_hyper = true ; - -C = GB_mex_clear (Ahyper) ; -assert (isequal (S, C.matrix)) ; - -A = sparse (eye (4,1)) ; -C = GB_mex_clear (A) ; -S = sparse (4,1) ; -assert (isequal (S, C.matrix)) ; - -fprintf ('\ntest131: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test134.m b/GraphBLAS/Test/unused/test134.m deleted file mode 100644 index 401a9df5ee..0000000000 --- a/GraphBLAS/Test/unused/test134.m +++ /dev/null @@ -1,193 +0,0 @@ -function test134(short) -%TEST134 test GxB_select - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% A shorter version of test25 - -fprintf ('\ntest134: GxB_select tests\n') ; - -if (nargin < 1) - short = false ; -end - -[~, ~, ~, types, ~, select_ops] = GB_spec_opsall ; -types = types.all ; - -if (short) - types = { 'double' } ; -end - -rng ('default') ; - -m = 10 ; -n = 6 ; -dt = struct ('inp0', 'tran') ; - -for k1 = 1:length(types) - atype = types {k1} ; - fprintf ('%-14s ', atype) ; - - for A_sparsity = [0 1 2] - for A_is_csc = 0:1 - for C_is_hyper = 0:1 - for C_is_csc = 0:1 - for M_is_hyper = 0:1 - for M_is_csc = 0:1 - - if (A_sparsity == 0) - A_is_hyper = 0 ; - A_sparsity_control = 2 ; % sparse - elseif (A_sparsity == 1) - A_is_hyper = 1 ; - A_sparsity_control = 1 ; % hypersparse - else - A_is_hyper = 0 ; - A_sparsity_control = 4 ; % bitmap - end - - if (A_is_hyper) - ha = 1 ; - else - ha = 0 ; - end - - if (C_is_hyper) - hc = 1 ; - else - hc = 0 ; - end - - if (M_is_hyper) - hm = 1 ; - else - hm = 0 ; - end - - A = GB_spec_random (m, n, 0.3, 100, atype, A_is_csc, A_is_hyper, ha) ; - A.matrix (:,1) = rand (m,1) ; - A.pattern (:,1) = true (m,1) ; - Cin = GB_spec_random (m, n, 0.3, 100, atype, C_is_csc, C_is_hyper, hc) ; - B = GB_spec_random (n, m, 0.3, 100, atype, A_is_csc, A_is_hyper, ha) ; - cin = GB_mex_cast (0, atype) ; - Mask = GB_random_mask (m, n, 0.5, M_is_csc, M_is_hyper) ; - Mask.hyper_switch = hm ; - - A.sparsity = A_sparsity_control ; - B.sparsity = A_sparsity_control ; - - fprintf ('.') ; - - for k2 = 1:length(select_ops) - op = select_ops {k2} ; - - if (test_contains (atype, 'complex')) - switch (op) - case { 'gt_zero', 'ge_zero', 'lt_zero', 'le_zero', ... - 'gt_thunk', 'ge_thunk', 'lt_thunk', 'le_thunk' } - continue ; - % error ('op %s not defined for complex types', op) ; - otherwise - % op is OK - end - end - - switch op - case {'tril' } - klist = [-4 0 4] ; - case {'triu' } - klist = [-4 0 4] ; - case {'diag' } - klist = [-4 0 4] ; - case {'offdiag' } - klist = [-4 0 4] ; - case {'nonzero' } - klist = 0 ; - case {'eq_zero' } - klist = 0 ; - case {'gt_zero' } - klist = 0 ; - case {'ge_zero' } - klist = 0 ; - case {'lt_zero' } - klist = 0 ; - case {'le_zero' } - klist = 0 ; - case {'ne_thunk'} - klist = [0 1] ; - case {'eq_thunk'} - klist = [0 1] ; - case {'gt_thunk'} - klist = [0 1] ; - case {'ge_thunk'} - klist = [0 1] ; - case {'lt_thunk'} - klist = [0 1] ; - case {'le_thunk'} - klist = [0 1] ; - end - - - - for k = klist - - % no mask - C1 = GB_spec_select (Cin, [], [], op, A, k, []) ; - C2 = GB_mex_select (Cin, [], [], op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % no mask, transpose - C1 = GB_spec_select (Cin, [], [], op, B, k, dt) ; - C2 = GB_mex_select (Cin, [], [], op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - if (strcmp (op, 'tril')) - - % no mask, with accum - C1 = GB_spec_select (Cin, [], 'plus', op, A, k, []) ; - C2 = GB_mex_select (Cin, [], 'plus', op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask - C1 = GB_spec_select (Cin, Mask, [], op, A, k, []) ; - C2 = GB_mex_select (Cin, Mask, [], op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask and accum - C1 = GB_spec_select (Cin, Mask, 'plus', op, A, k, []) ; - C2 = GB_mex_select (Cin, Mask, 'plus', op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % no mask, with accum, transpose - C1 = GB_spec_select (Cin, [], 'plus', op, B, k, dt) ; - C2 = GB_mex_select (Cin, [], 'plus', op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask, transpose - C1 = GB_spec_select (Cin, Mask, [], op, B, k, dt) ; - C2 = GB_mex_select (Cin, Mask, [], op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask and accum, transpose - C1 = GB_spec_select (Cin, Mask, 'plus', op, B, k, dt) ; - C2 = GB_mex_select (Cin, Mask, 'plus', op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - end - end - end - - end - end - end - end - end - end - fprintf ('\n') ; - -end - -fprintf ('\ntest134: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test14.m b/GraphBLAS/Test/unused/test14.m deleted file mode 100644 index 65333c7f62..0000000000 --- a/GraphBLAS/Test/unused/test14.m +++ /dev/null @@ -1,250 +0,0 @@ -function test14 -%TEST14 test GrB_reduce - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest14: reduce to column and scalar\n') ; - -[~, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -rng ('default') ; - -m = 8 ; -n = 4 ; -dt = struct ('inp0', 'tran') ; - -for k1 = 1:length(types) - atype = types {k1} ; - fprintf ('.') ; - A = GB_spec_random (m, n, 0.3, 100, atype) ; - B = GB_spec_random (n, m, 0.3, 100, atype) ; - w = GB_spec_random (m, 1, 0.3, 100, atype) ; - cin = GB_mex_cast (0, atype) ; - - clear S_input - S_input.matrix = cin ; - S_input.pattern = true ; - S_input.class = atype ; - - clear E_input - E_input.matrix = sparse (0) ; - E_input.pattern = false ; - E_input.class = atype ; - - mask = GB_random_mask (m, 1, 0.5, true, false) ; - - if (isequal (atype, 'logical')) - ops = {'or', 'and', 'xor', 'eq', 'any'} ; - else - ops = {'min', 'max', 'plus', 'times', 'any'} ; - end - - if (isequal (atype, 'double')) - hrange = [0 1] ; - crange = [0 1] ; - else - hrange = 0 ; - crange = 1 ; - end - - is_float = test_contains (atype, 'single') || test_contains (atype, 'double') ; - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - - A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; - B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; - - for k2 = 1:length(add_ops) - op = add_ops {k2} ; - - if (isequal (op, 'any')) - tol = [ ] ; - elseif (test_contains (atype, 'single')) - tol = 1e-5 ; - elseif (test_contains (atype, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - try - GB_spec_operator (op, atype) ; - identity = GB_spec_identity (op, atype) ; - catch - continue - end - - % no mask - w1 = GB_spec_reduce_to_vector (w, [], [], op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, [], [], op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, with accum - w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask - w1 = GB_spec_reduce_to_vector (w, mask, [], op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, mask, [], op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask and accum - w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, transpose - w1 = GB_spec_reduce_to_vector (w, [], [], op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, [], [], op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, with accum, transpose - w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask, transpose - w1 = GB_spec_reduce_to_vector (w, mask, [], op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, mask, [], op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask and accum, transpose - w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % GB_spec_reduce_to_scalar always operates column-wise, but GrB_reduce - % operates in whatever order it is given: by column if CSC or by row if - % CSR. The result can vary slightly because of different round off - % errors. A_flip causes GB_spec_reduce_to_scalar to operate in the - % same order as GrB_reduce. - - A_flip = A ; - if (~A.is_csc && is_float) - A_flip.matrix = A_flip.matrix.' ; - A_flip.pattern = A_flip.pattern' ; - A_flip.is_csc = true ; - end - - % Parallel reduction leads to different roundoff. So even with A_flip, - % c1 and c2 can only be compared to within round-off error. - - % to scalar - c2 = GB_mex_reduce_to_scalar (cin, [ ], op, A) ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; - else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, A) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; - else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (E_input, [ ], op, A) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; - else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % vector to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, w) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (w.matrix (w.pattern)), w.class) ; - assert (any (X == c2)) ; - else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, w) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % to scalar, with accum - c2 = GB_mex_reduce_to_scalar (cin, 'plus', op, A) ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % to GrB_Scalar, with accum - S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, A) ; - c2 = S.matrix ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - % vector to GrB_Scalar, with accum - S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, w) ; - c2 = S.matrix ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, w) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end - end - - end - end - end -end - -clear A -A.matrix = sparse (4,5) ; -A.pattern = false (4,5) ; -A.class = 'double' ; - -clear S_input -S_input.matrix = 1 ; -S_input.pattern = true ; -S_input.class = 'double' ; - -% empty matrix to GrB_Scalar -S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], 'plus', A) ; -assert (nnz (S.matrix) == 0) ; - -fprintf ('\ntest14: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test140.m b/GraphBLAS/Test/unused/test140.m deleted file mode 100644 index 2ea26508c6..0000000000 --- a/GraphBLAS/Test/unused/test140.m +++ /dev/null @@ -1,34 +0,0 @@ -function test140 -%TEST140 test assign with duplicates - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -n = 6 ; -A = 100 * sprand (n, n, 0.5) ; -M = sparse (rand (n)) > 0.5 ; -Cin = sprand (n, n, 0.5) ; - -Cout = gb.assign (Cin, A, { }, { }) ; -assert (isequal (A, sparse (Cout))) ; - -I = [2 1 5] ; -J = [3 3 1 2] ; -% J = [2 2 1 3] ; -B = sprandn (length (I), length (J), 0.5) ; - - [J1 J1k] = sort (J) - J1k = J1k-1 - Jduplicate = [(J1 (1:end-1) == J1 (2:end)), false] - J2 = J1 (~Jduplicate) - J2k = J1k (~Jduplicate) - -I0 = uint64(I)-1 ; -J0 = uint64(J)-1 ; - -C_spec = GB_spec_assign (Cin, [ ], [ ], B, I, J, [ ], [ ]) -C_mex = GB_mex_assign (Cin, [ ], [ ], B, I0, J0, [ ], [ ]) -GB_spec_compare (C_spec, C_mex) ; - diff --git a/GraphBLAS/Test/unused/test142.m b/GraphBLAS/Test/unused/test142.m deleted file mode 100644 index 25a0f00e26..0000000000 --- a/GraphBLAS/Test/unused/test142.m +++ /dev/null @@ -1,217 +0,0 @@ -function test142 -%TEST142 test GrB_assign for dense matrices - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -fprintf ('test142 ------------ GrB_assign with dense matrices\n') ; - -m = 10 ; -n = 12 ; - -rng ('default') ; - -M = sprand (m, n, 0.5) ; - -Amat2 = sparse (2 * rand (m,n)) ; -Bmat2 = sparse (2 * sprand (m,n, 0.5)) ; -Cmat2 = sparse (2 * rand (m,n)) ; - -Amat = 50 * Amat2 ; -Bmat = 50 * Bmat2 ; -Cmat = 50 * Cmat2 ; - -Smat = sparse (m,n) ; -Xmat = sparse (pi) ; -desc.mask = 'structural' ; -drep.outp = 'replace' ; - -A.matrix = Amat ; A.class = 'see below' ; -B.matrix = Bmat ; B.class = 'see below' ; -C.matrix = Cmat ; C.class = 'see below' ; -S.matrix = Smat ; S.class = 'see below' ; -X.matrix = Xmat ; X.class = 'see below' ; -Bmask = logical (Bmat) ; -A.sparsity = 8 ; -C.sparsity = 8 ; -X.sparsity = 8 ; - -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('%s ', type) ; - - A.class = type ; - id = test_cast (0, type) ; - A_iso = A ; - A_iso.iso = true ; - - for k3 = 1:3 - - if (k3 == 1) - X.class = type ; - B.class = type ; - C.class = 'logical' ; - S.class = 'logical' ; - elseif (k3 == 2) - X.class = type ; - B.class = type ; - C.class = type ; - S.class = type ; - else - X.class = 'int8' ; - B.class = 'int8' ; - C.class = type ; - S.class = type ; - end - - %--------------------------------------- - % C = A where A is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], A, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, M, [ ], A, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = B where B is sparse - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], B, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, M, [ ], B, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = A where A is dense and C starts empty - %--------------------------------------- - - C0 = GB_spec_assign (S, M, [ ], A, [ ], [ ], desc, false) ; - C1 = GB_mex_assign (S, M, [ ], A, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = A where A is iso full and C starts empty - %--------------------------------------- - - C0 = GB_spec_assign (S, M, [ ], A_iso, [ ], [ ], desc, false) ; - C1 = GB_mex_assign (S, M, [ ], A_iso, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = B where B is sparse - %--------------------------------------- - - C0 = GB_spec_assign (C, Bmask, [ ], B, [ ], [ ], desc, false) ; - C1 = GB_mex_assign_alias_mask (C, B, desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x where C is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x where C is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], desc, true) ; - C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x - %--------------------------------------- - - C0 = GB_spec_assign (S, M, [ ], X, [ ], [ ], desc, true) ; - C1 = GB_mex_assign (S, M, [ ], X, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x - %--------------------------------------- - - C0 = GB_spec_assign (S, [ ], [ ], X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (S, [ ], [ ], X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % with accum operators - %--------------------------------------- - - for k2 = 1:length(binops) - binop = binops {k2} ; - - tol = [ ] ; - switch (binop) - case { 'pow', 'atan2', 'hypot', 'remainder' } - A.matrix = Amat2 ; - B.matrix = Bmat2 ; - C.matrix = Cmat2 ; - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - end - otherwise - A.matrix = Amat ; - B.matrix = Bmat ; - C.matrix = Cmat ; - end - - accum.opname = binop ; - accum.optype = type ; - - try - GB_spec_operator (accum) ; - catch - continue - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - %--------------------------------------- - % C += A where A is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, A, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, A, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; - - %--------------------------------------- - % C += B where B is sparse - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, B, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, B, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; - - %--------------------------------------- - % C += x - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (C, [ ], accum, X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; - - %--------------------------------------- - % C += x - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], drep, true) ; - C1 = GB_mex_subassign (C, [ ], accum, X, [ ], [ ], drep) ; - GB_spec_compare (C0, C1, id, tol) ; - - end - end -end - -fprintf ('\ntest142: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test143.m b/GraphBLAS/Test/unused/test143.m deleted file mode 100644 index e1b533c07f..0000000000 --- a/GraphBLAS/Test/unused/test143.m +++ /dev/null @@ -1,110 +0,0 @@ -function test143 -%TEST143 test special cases for C=A*B and C=A*B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test143 ----------------------------- A*B special cases\n') ; - -rng ('default') ; - -n = 3000 ; -d = 0.001 ; -A = sprand (n, n, d) ; - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -% coarse Gustavson tasks, C=A*B, C(:,j) very sparse compared to M(:,j) -S = sparse (n, n) ; -M = logical (sprand (n, n, 0.01)) ; -M (:,1) = 1 ; -B = sprand (n, n, d) ; -C2 = GB_mex_mxm (S, M, [ ], semiring, A, B, struct ('mask', 'complement')) ; -C = (A*B) .* double (~M) ; -assert (nnz (C) > 0) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -%---------------------------------------- -desc = struct ('axb', 'hash', 'mask', 'complement') ; -%---------------------------------------- - -% coarse hash tasks, C=A*B -S = sparse (n, n) ; -M = logical (sprand (n, n, 0.01)) ; -B = sprand (n, n, d) ; -C2 = GB_mex_mxm (S, M, [ ], semiring, A, B, desc) ; -C = (A*B) .* double (~M) ; -assert (nnz (C) > 0) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -% fine hash tasks, C=A*B -S = sparse (n, 1) ; -M = logical (sprand (n, 1, 0.01)) ; -B = sprand (n, 1, d) ; -C2 = GB_mex_mxm (S, M, [ ], semiring, A, B, desc) ; -C = (A*B) .* double (~M) ; -assert (nnz (C) > 0) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -%---------------------------------------- -desc = struct ('axb', 'hash') ; -%---------------------------------------- - -% coarse hash tasks, C=A*B -S = sparse (n, n) ; -M = logical (sprand (n, n, 0.01)) ; -B = sprand (n, n, d) ; -C2 = GB_mex_mxm (S, M, [ ], semiring, A, B, desc) ; -C = (A*B) .* double (M) ; -assert (nnz (C) > 0) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -% fine hash tasks, C=A*B -S = sparse (n, 1) ; -M = logical (sprand (n, 1, 0.01)) ; -B = sprand (n, 1, d) ; -M (1:3) = 1 ; -A (1:3,1:3) = rand (3) ; -B (1:3) = rand (3,1) ; -C = (A*B) .* double (M) ; -assert (nnz (C) > 0) ; -C2 = GB_mex_mxm (S, M, [ ], semiring, A, B, desc) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -%---------------------------------------- -fprintf (' please wait: ') ; -m = 10e6 ; -A = sprand (m, n, d) ; -[save save_chunk] = nthreads_get ; -nthreads_set (4, 1) ; -%---------------------------------------- -fprintf (':') ; - -% fine hash tasks, C=A*B -S = sparse (m, 1) ; -B = sprand (n, 1, d) ; -B (1:100, 1) = rand (100, 1) ; -fprintf (':') ; -C = (A*B) ; -assert (nnz (C) > 0) ; -fprintf (':') ; -C2 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, desc) ; -err = norm (C - C2.matrix, 1) ; -assert (err < 1e-12) ; -fprintf ('.') ; - -nthreads_set (save, save_chunk) ; -fprintf ('\ntest143: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test146.m b/GraphBLAS/Test/unused/test146.m deleted file mode 100644 index 13554b6987..0000000000 --- a/GraphBLAS/Test/unused/test146.m +++ /dev/null @@ -1,35 +0,0 @@ -function test146 -%TEST146 test C = scalar - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test146 --------------------- C = scalar\n') ; - -m = 5 ; -n = 4 ; - -M = logical (sprand (m, n, 0.5)) ; - -C1 = GB_mex_expand (M, pi) ; -C2 = sparse (m, n) ; -C2 (M) = pi ; -assert (isequal (C2, C1.matrix)) - -for k = [false true] - GB_builtin_complex_set (k) ; - z = 1 + 1i ; - C1 = GB_mex_expand (M, z) ; - C2 = sparse (m, n) ; - C2 (M) = z ; - assert (isequal (C2, C1.matrix)) -end - -C1 = GB_mex_expand (M, true) ; -C2 = logical (sparse (m, n)) ; -C2 (M) = true ; -assert (isequal (C2, logical (C1.matrix))) - -GB_builtin_complex_set (true) ; -fprintf ('test146: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test147.m b/GraphBLAS/Test/unused/test147.m deleted file mode 100644 index 2e9f68e922..0000000000 --- a/GraphBLAS/Test/unused/test147.m +++ /dev/null @@ -1,27 +0,0 @@ -function test147 -%TEST147 test CA*B with very sparse M - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test147 ----------------------------- CA*B with very sparse M\n') ; -rng ('default') ; - -n = 1000 ; -A = sprand (n, n, 0.01) ; -A (:,1:300) = 1 ; -S = sparse (n, n) ; -M = spones (speye (n) + sparse (n, n, 1e-5)) ; - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -% also create the /tmp/GB_mxm_[code].h file, flipxy = false -C1 = GB_mex_mxm (S, M, [ ], semiring, A, A, [ ], 0) ; -C2 = (A*A) .* M ; - -assert (norm (C1.matrix - C2, 1) < 1e-12) - -fprintf ('test147: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test149.m b/GraphBLAS/Test/unused/test149.m deleted file mode 100644 index 2b6da6b618..0000000000 --- a/GraphBLAS/Test/unused/test149.m +++ /dev/null @@ -1,41 +0,0 @@ -function test149 -%TEST149 test fine hash method for C=A*B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test149: --------- fine hash method for C=A*B\n') ; - -rng ('default') ; - -nthreads_set (4, 1) ; - -desc.axb = 'hash' ; -desc.mask = 'complement' ; - -n = 1000 ; -m = 1e8 ; -A = sparse (m, n) ; -A (1:n, 1:n) = rand (n) ; -B = sparse (rand (n,1)) ; -C = sparse (m, 1) ; - -M = logical (sparse (m, 1)) ; -M (1:n, 1) = sparse (rand (n,1) > 0.5) ; - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -tic -C1 = GB_mex_mxm (C, M, [ ], semiring, A, B, desc) ; -toc -tic -C2 = (A*B) .* double (~M) ; -toc - -cnorm = norm (C2,1) ; -assert (norm (C1.matrix - C2, 1) / cnorm < 1e-12) - -fprintf ('test149: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test15.m b/GraphBLAS/Test/unused/test15.m deleted file mode 100644 index 81a4d798b9..0000000000 --- a/GraphBLAS/Test/unused/test15.m +++ /dev/null @@ -1,50 +0,0 @@ -function test15 -%TEST15 test AxB and AdotB internal functions - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n --------------------- GB_mex_AxB, GB_mex_AdotB tests\n') ; - -rng ('default') ; -m = 8 ; -k = 6 ; -n = 10 ; -A = sprand (m,k,0.5) ; -B = sprand (k,n,0.5) ; -C1 = A*B ; -C = GB_mex_AxB (A, B) ; -assert (GB_spok (C) == 1) ; -assert (norm (C-C1,1) / norm (C,1)< 1e-12) ; - -A = A' ; -C1 = A'*B ; -C = GB_mex_AdotB (A, B) ; -assert (GB_spok (C) == 1) ; -assert (isequal (C, C1)) ; - -A = sprandn (10000,2,0.5) ; -B = sprandn (10000,2,0.0001) ; -A (5,1) = pi ; -B (5,2) = 42 ; -C1 = A'*B ; -C = GB_mex_AdotB (A, B) ; -assert (GB_spok (C) == 1) ; -assert (isequal (C, C1)) ; -C1 = B'*A ; -C = GB_mex_AdotB (B, A) ; -assert (GB_spok (C) == 1) ; -assert (isequal (C, C1)) ; - -S = sparse (10000,2) ; -C1 = A.*B ; -C = GB_mex_Matrix_eWiseMult (S, [], [], 'times', A, B) ; -assert (GB_spok (C.matrix) == 1) ; -assert (isequal (C.matrix, C1)) ; -C1 = B.*A ; -C = GB_mex_Matrix_eWiseMult (S, [], [], 'times', B, A) ; -assert (GB_spok (C.matrix) == 1) ; -assert (isequal (C.matrix, C1)) ; - -fprintf ('\ntest15: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test151.m b/GraphBLAS/Test/unused/test151.m deleted file mode 100644 index 8c3a598969..0000000000 --- a/GraphBLAS/Test/unused/test151.m +++ /dev/null @@ -1,111 +0,0 @@ -function test151 -%TEST151 test bitwise operators - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test151: test bitwise operators\n') ; - -[binops, ~, ~, types, ~, ~,] = GB_spec_opsall ; -types = types.int ; -ops2 = binops.int ; - -int_nbits = [ 8, 16, 32, 64, 8, 16, 32, 64 ] ; - -rng ('default') ; -Cin = sparse (4,4) ; -C10 = sparse (10,10) ; - -for k = 1:8 - - type = types {k} ; - nbits = int_nbits (k) ; - fprintf ('\n%s', type) ; - - for trial = 1:40 - fprintf ('.') ; - - % dense case - - imax = double (intmax (type) / 4) ; - A = GB_mex_cast (imax * rand (4), type) ; - B = GB_mex_cast ((nbits-1) * rand (4), type) + 1 ; - clear A2 ; A2.matrix = sparse (double (A)) ; A2.class = type ; - clear B2 ; B2.matrix = sparse (double (B)) ; B2.class = type ; - A2.pattern = logical (spones (A)) ; - B2.pattern = logical (spones (B)) ; - - for j = 1:length (ops2) - opname = ops2 {j} ; - % C1 = bitop (A, B) ; - op.opname = opname ; op.optype = type ; - - if (isequal (opname, 'bitshift') || isequal (opname, 'bshift')) - B2.class = 'int8' ; - else - B2.class = type ; - end - - C1 = GB_spec_Matrix_eWiseMult(Cin, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseMult (Cin, [ ], [ ], op, A2, B2, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_spec_Matrix_eWiseAdd (Cin, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], [ ], op, A2, B2, [ ]) ; - GB_spec_compare (C1, C2) ; - end - - % C1 = bitcmp (A) ; - op.opname = 'bitnot' ; op.optype = type ; - C1 = GB_spec_apply(Cin, [ ], [ ], op, A2, [ ]) ; - C2 = GB_mex_apply (Cin, [ ], [ ], op, A2, [ ]) ; - GB_spec_compare (C1, C2) ; - - % sparse case - - A = sprand (10, 10, 0.5) * imax ; - Afull = GB_mex_cast (full (A), type) ; - % B ranges in value from 0 to 8 - B = round (sprand (10, 10, 0.5) * nbits) ; - Bfull = GB_mex_cast (full (B), type) ; - clear A2 ; A2.matrix = sparse (double (Afull)) ; A2.class = type ; - clear B2 ; B2.matrix = sparse (double (Bfull)) ; B2.class = type ; - A2.pattern = logical (spones (Afull)) ; - B2.pattern = logical (spones (Bfull)) ; - - for j = 1:length (ops2) - opname = ops2 {j} ; - % C1 = bitop (A, B) ; - op.opname = opname ; op.optype = type ; - - if (isequal (opname, 'bitshift') || isequal (opname, 'bshift')) - B2.class = 'int8' ; - else - B2.class = type ; - end - - C1 = GB_spec_Matrix_eWiseMult(C10, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseMult (C10, [ ], [ ], op, A2, B2, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_spec_Matrix_eWiseAdd (C10, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseAdd (C10, [ ], [ ], op, A2, B2, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_spec_Matrix_eWiseUnion (C10, [ ], [ ], op, A2, 3, B2, 1, [ ]) ; - C2 = GB_mex_Matrix_eWiseUnion (C10, [ ], [ ], op, A2, 3, B2, 1, [ ]) ; - GB_spec_compare (C1, C2) ; - - end - - % C1 = bitcmp (Afull) ; - op.opname = 'bitnot' ; op.optype = type ; - C1 = GB_spec_apply(C10, [ ], [ ], op, A2, [ ]) ; - C2 = GB_mex_apply (C10, [ ], [ ], op, A2, [ ]) ; - GB_spec_compare (C1, C2) ; - - end -end - -fprintf ('\ntest151: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test153.m b/GraphBLAS/Test/unused/test153.m deleted file mode 100644 index a4a9f26e2e..0000000000 --- a/GraphBLAS/Test/unused/test153.m +++ /dev/null @@ -1,73 +0,0 @@ -function test153 -%TEST153 list all possible semirings -% -% Lists all possible semirings that can be constructed from built-in operators. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, unary_ops, add_ops, types, semirings, selops] = GB_spec_opsall ; - -n = 0 ; -types = types.all ; -binops = binops.all ; - -for kadd = 1:length (add_ops) - for kadd_types = 1:length (types) - add.opname = add_ops {kadd} ; - add.optype = types {kadd_types} ; - - try - [opadd, t, ztype, xtype, ytype] = GB_spec_operator (add) ; - id = GB_spec_identity (add) ; - catch - continue ; - end - - if (~isequal (opadd, add.opname)) - % ignore renames - continue ; - end - - if (~isequal (ztype, xtype)) - continue ; - end - - if (~isequal (ztype, ytype)) - continue ; - end - - fprintf ('\n======================= monoid %s.%s:\n', opadd, ztype) ; - - n2 = 0 ; - for kmult = 1:length (binops) - for kmult_types = 1:length (types) - - mult.opname = binops {kmult} ; - mult.optype = types {kmult_types} ; - - try - [opmult, t2, z2, xtype, y] = GB_spec_operator (mult) ; - catch - continue ; - end - - if (~isequal (opmult, mult.opname)) - % ignore renames - continue ; - end - - if (isequal (z2, ztype)) - n2 = n2+1 ; - fprintf (' %s.%s.%s\n', opadd, opmult, xtype) ; - end - end - end - - fprintf (' semirings with %s.%s: %d\n', opadd, ztype, n2) ; - n = n + n2 ; - end -end - -fprintf ('total unique semirings: %d\n', n) ; - diff --git a/GraphBLAS/Test/unused/test154.m b/GraphBLAS/Test/unused/test154.m deleted file mode 100644 index 822a3f6311..0000000000 --- a/GraphBLAS/Test/unused/test154.m +++ /dev/null @@ -1,179 +0,0 @@ -function test154 -%TEST154 test GrB_apply with scalar binding - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -ops = binops.all ; -types = types.all ; - -fprintf ('\n--- testing apply with binaryop and scalar binding\n') ; -rng ('default') ; -% the right approach for apply_bind1st and apply_bind2nd -desc0.inp0 = 'tran' ; -desc1.inp1 = 'tran' ; -% shotgun approach for eWiseMult -desc.inp0 = 'tran' ; -desc.inp1 = 'tran' ; - -n_operators = 0 ; -for k2 = 1:length(ops) - mulop = ops {k2} ; - fprintf ('\n%-10s ', mulop) ; - - for k1 = 1:length (types) - type = types {k1} ; - - % create the op - clear op - op.opname = mulop ; - op.optype = type ; - - try - [oname ot ztype xtype ytype] = GB_spec_operator (op) ; - catch - continue ; - end - n_operators = n_operators + 1 ; - - switch (mulop) - case { 'pow' } - xlimits = [0, 5] ; - ylimits = [0, 5] ; - case { 'ldexp' } - xlimits = [-5, 5] ; - ylimits = [-5, 5] ; - otherwise - xlimits = [ ] ; - ylimits = [ ] ; - end - - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - fprintf ('.') ; - - for m = [1 4] % [ 1 10 ]% 100] - for n = [1 4] % [1 10 ]% 100] - for hi = [1 5] % [-1:2:5 ] - for lo = [-1 0] % [-3:2:5 ] - Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - Bmat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - xmat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; - ymat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; - Cmat = sparse (m, n) ; - - if (~isempty (xlimits)) - Amat = max (Amat, xlimits (1)) ; - Amat = min (Amat, xlimits (2)) ; - xmat = max (xmat, xlimits (1)) ; - xmat = min (xmat, xlimits (2)) ; - end - if (xmat == 0) - xmat = sparse (0.5) ; - end - - if (~isempty (ylimits)) - Bmat = max (Bmat, ylimits (1)) ; - Bmat = min (Bmat, ylimits (2)) ; - ymat = max (ymat, ylimits (1)) ; - ymat = min (ymat, ylimits (2)) ; - end - if (ymat == 0) - ymat = sparse (0.5) ; - end - - C.matrix = Cmat ; - C.class = ztype ; - - CT.matrix = Cmat' ; - CT.class = ztype ; - - A.matrix = Amat ; - A.class = xtype ; - - B.matrix = Bmat ; - B.class = ytype ; - - x.matrix = xmat ; - x.class = xtype ; - - y.matrix = ymat ; - y.class = ytype ; - - X.matrix = xmat .* spones (Bmat) ; - X.class = xtype ; - - Y.matrix = ymat .* spones (Amat) ; - Y.class = ytype ; - - op_ewise_bind1st = op ; - op_ewise_bind2nd = op ; - if (isequal (op.opname, 'any')) - op_ewise_bind1st.opname = 'first' ; - op_ewise_bind2nd.opname = 'second' ; - end - - C1 = GB_mex_apply1 (C, [ ], [ ], op, 0, x, B) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind1st, X, B, [ ]) ; - GB_spec_compare (C1, C2, 0, tol) ; - C1 = GB_mex_apply1 (C, [ ], [ ], op, 1, x, B) ; - GB_spec_compare (C1, C2, 0, tol) ; - - C1 = GB_mex_apply1 (CT, [ ], [ ], op, 0, x, B, desc1) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind1st, X, B, desc) ; - GB_spec_compare (C1, C2, 0, tol) ; - C1 = GB_mex_apply1 (CT, [ ], [ ], op, 1, x, B, desc1) ; - GB_spec_compare (C1, C2, 0, tol) ; - - for csc = 0:1 - - A.is_csc = csc ; - C.is_csc = csc ; - CT.is_csc = csc ; - - C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; - GB_spec_compare (C1, C2, 0, tol) ; - C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; - GB_spec_compare (C1, C2, 0, tol) ; - - C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; - GB_spec_compare (C1, C2, 0, tol) ; - C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; - GB_spec_compare (C1, C2, 0, tol) ; - end - - y.class = 'double' ; - Y.class = 'double' ; - - C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; - GB_spec_compare (C1, C2, 0, tol) ; - - C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; - GB_spec_compare (C1, C2, 0, tol) ; - - C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; - GB_spec_compare (C1, C2, 0, tol) ; - C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; - GB_spec_compare (C1, C2, 0, tol) ; - -end -end -end -end -end -end - -fprintf ('\nNumber of built-in GraphBLAS operators: %d\n', n_operators) ; -fprintf ('\ntest154: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test156.m b/GraphBLAS/Test/unused/test156.m deleted file mode 100644 index 41f24b9d5c..0000000000 --- a/GraphBLAS/Test/unused/test156.m +++ /dev/null @@ -1,47 +0,0 @@ -function test156 -%TEST156 test assign C=A with typecasting - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - - -for k1 = 1:length(types) - in_type = types {k1} ; - A = GB_spec_random (5, 5, 0.5, 10, in_type) ; - B = GB_spec_random (5, 5, inf, 10, in_type) ; - - for k2 = 1:length(types) - out_type = types {k2} ; - C = GB_spec_random (5, 5, 0.5, 10, out_type) ; - D = GB_spec_random (5, 5, inf, 10, out_type) ; - - % C = A - C1 = GB_spec_assign (C, [ ], [ ], A, [ ], [ ], [ ], false) ; - C2 = GB_mex_assign (C, [ ], [ ], A, [ ], [ ], [ ]) ; - GB_spec_compare (C1, C2) ; - - % C = B - C1 = GB_spec_assign (C, [ ], [ ], B, [ ], [ ], [ ], false) ; - C2 = GB_mex_assign (C, [ ], [ ], B, [ ], [ ], [ ]) ; - GB_spec_compare (C1, C2) ; - - % D = A - C1 = GB_spec_assign (D, [ ], [ ], A, [ ], [ ], [ ], false) ; - C2 = GB_mex_assign (D, [ ], [ ], A, [ ], [ ], [ ]) ; - GB_spec_compare (C1, C2) ; - - % D = B - C1 = GB_spec_assign (D, [ ], [ ], B, [ ], [ ], [ ], false) ; - C2 = GB_mex_assign (D, [ ], [ ], B, [ ], [ ], [ ]) ; - GB_spec_compare (C1, C2) ; - - end -end - - -fprintf ('test156: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test158.m b/GraphBLAS/Test/unused/test158.m deleted file mode 100644 index 0b5476a2e0..0000000000 --- a/GraphBLAS/Test/unused/test158.m +++ /dev/null @@ -1,99 +0,0 @@ -function test158 -%TEST158 test colscale (A*D) and rowscale (D*B) with positional ops - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -[binops, ~, ~, ~, ~, ~] = GB_spec_opsall ; -pos = binops.positional ; -pos {end+1} = 'times' ; -pos {end+1} = 'div' ; - -n = 30 ; -A = GB_spec_random (n, n, 0.05, 256, 'int64') ; -D.matrix = speye (n) ; -D.class = 'int64' ; -D.pattern = logical (spones (D.matrix)) ; - -dnn = struct ; -dtn = struct ('inp0', 'tran') ; -dnt = struct ('inp1', 'tran') ; -dtt = struct ('inp0', 'tran', 'inp1', 'tran') ; - -Cin = sparse (n,n) ; - -semiring.add = 'plus' ; -semiring.class = 'int64' ; - -for c = 1:3 - - if (c == 1) - A.class = 'int32' ; - D.class = 'int32' ; - semiring.class = 'int32' ; - elseif (c == 2) - A.class = 'int64' ; - D.class = 'int64' ; - semiring.class = 'int64' ; - else - A.class = 'int32' ; - D.class = 'int64' ; - semiring.class = 'int64' ; - end - - fprintf ('\ntypes: %s %s %s\n', D.class, A.class, semiring.class) ; - - for k = 1:length(pos) - - op = pos {k} ; - fprintf ('op: %s\n', op) ; - semiring.multiply = op ; - - % colscale: C = A*D - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, A, D, [ ]) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, D, [ ]) ; - GB_spec_compare (C1, C2) ; - - % rowscale: C = D*A - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, D, A, [ ]) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, D, A, [ ]) ; - GB_spec_compare (C1, C2) ; - - % colscale: C = A'*D - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, A, D, dtn) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, D, dtn) ; - GB_spec_compare (C1, C2) ; - - % colscale: C = D'*A - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, D, A, dtn) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, D, A, dtn) ; - GB_spec_compare (C1, C2) ; - - % rowscale: C = D*A' - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, D, A, dnt) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, D, A, dnt) ; - GB_spec_compare (C1, C2) ; - - % rowscale: C = A*D' - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, A, D, dnt) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, D, dnt) ; - GB_spec_compare (C1, C2) ; - - % colscale: C = A'*D' - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, A, D, dtt) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, A, D, dtt) ; - GB_spec_compare (C1, C2) ; - - % rowscale: C = D'*B' - C1 = GB_spec_mxm (Cin, [ ], [ ], semiring, D, A, dtt) ; - C2 = GB_mex_mxm (Cin, [ ], [ ], semiring, D, A, dtt) ; - GB_spec_compare (C1, C2) ; - - end - -end - -fprintf ('\ntest158: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test16.m b/GraphBLAS/Test/unused/test16.m deleted file mode 100644 index f3abba192e..0000000000 --- a/GraphBLAS/Test/unused/test16.m +++ /dev/null @@ -1,33 +0,0 @@ -function test16 -%TEST16 test user-defined complex type (runs all testc*.m) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% all complex matrix tests - -for k = [false true] - GB_builtin_complex_set (k) ; - if (k) - fprintf ('\nTesting built-in GxB_FC64 complex type:\n') ; - else - fprintf ('\nTesting user-defined Complex type:\n') ; - end - - testc1 (k) % test ops - testc2 (0,k) % A'*B, A+B, A*B - testc3 (k) % extract column, extract submatrix - testc4 (k) % extractElement, setElement - testc5 (k) % subref - testc6 (k) % apply - testc7 (k) % assign - testc8 (k) % eWise - testc9 (k) % extractTuples - testca (k) % mxm, mxv, vxm - testcb (k) % reduce - testcc (k) % transpose -end - -GB_builtin_complex_set (true) ; -fprintf ('\ntest16: all complex tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test161.m b/GraphBLAS/Test/unused/test161.m deleted file mode 100644 index 2cb1cb1358..0000000000 --- a/GraphBLAS/Test/unused/test161.m +++ /dev/null @@ -1,26 +0,0 @@ -function test161 -%TEST161 C=A*B*E - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -n = 100 ; -d = 0.05 ; -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -for trial = 1:10 - - A = sprand (n, n, d) ; - B = sprand (n, n, d) ; - E = sprand (n, n, d) ; - semiring.class = 'double' ; - - C1 = A*B*E ; - C2 = GB_mex_triple_mxm (semiring, A, B, E) ; - GB_spec_compare (C1, C2) ; -end - diff --git a/GraphBLAS/Test/unused/test163.m b/GraphBLAS/Test/unused/test163.m deleted file mode 100644 index 46b38ad68b..0000000000 --- a/GraphBLAS/Test/unused/test163.m +++ /dev/null @@ -1,24 +0,0 @@ -function test163 -%TEST163 test C=A'*B where C and M are sparse - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -rng ('default') ; - -n = 1000 ; -m = 10 ; -A = sprand (m, n, 0.1) ; -B = sprand (m, n, 0.1) ; -M = logical (sprand (n, n, 0.1)) ; -Cin = sparse (n, n) ; -dtn = struct ('inp0', 'tran', 'mask', 'complement', 'axb', 'dot') ; - -C1 = double (~M) .* (A'*B) ; -C2 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, dtn) ; -GB_spec_compare (C1, C2) ; - diff --git a/GraphBLAS/Test/unused/test164.m b/GraphBLAS/Test/unused/test164.m deleted file mode 100644 index 13acca7b6f..0000000000 --- a/GraphBLAS/Test/unused/test164.m +++ /dev/null @@ -1,37 +0,0 @@ -function test164 -%TEST164 test dot method - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -n = 10 ; -A = GB_spec_random (n, n, 0.5, 1, 'logical') ; -A.sparsity = 2 ; % sparse -B = GB_spec_random (n, 1, 0.5, 1, 'logical') ; -B.sparsity = 4 ; % bitmap - -semiring.add = 'any' ; -semiring.multiply = 'secondi1' ; -semiring.class = 'int32' ; - -M = GB_spec_random (n, 1, inf, 1, 'int32') ; -M.matrix = double (full (M.matrix > 0.5)) ; -M.sparsity = 8 ; % full -desc = struct ('inp0', 'tran', 'mask', 'complement') ; - -% no accum -Cin = sparse (n, 1) ; - -% can't compare C0 and C1 because the ANY monoid differs -C0 = GB_spec_mxm (Cin, M, [ ], semiring, A, B, desc) ; -C1 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, desc) ; -% GB_spec_compare (C0,C1) ; - -semiring.add = 'min' ; -C0 = GB_spec_mxm (Cin, M, [ ], semiring, A, B, desc) ; -C1 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, desc) ; -GB_spec_compare (C0,C1) ; - -fprintf ('test164: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test166.m b/GraphBLAS/Test/unused/test166.m deleted file mode 100644 index 4d2980e21d..0000000000 --- a/GraphBLAS/Test/unused/test166.m +++ /dev/null @@ -1,41 +0,0 @@ -function test166 -%TEST166 GxB_select with a dense matrix - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; -fprintf ('test166: ') ; - -n = 10 ; -A.matrix = rand (n) ; -A.matrix (1,1) = 0 ; -A.pattern = true (n) ; -A.sparsity = 8 ; -Cin = sparse (n, n) ; - -[~, ~, ~, ~, ~, select_ops] = GB_spec_opsall ; - -thunk = 0 ; - -for k = 1:length(select_ops) - - op = select_ops {k} ; - fprintf ('%s ', op) ; - if (mod (k, 4) == 0) - fprintf ('\n') ; - end - - % no mask, thunk = 0 - C1 = GB_spec_select (Cin, [], [], op, A, thunk, []) ; - C2 = GB_mex_select (Cin, [], [], op, A, thunk, [], 'test') ; - GB_spec_compare (C1, C2) ; - -end - -fprintf ('resize\n') ; -C1 = GB_spec_resize (A, 5, 15) ; -C2 = GB_mex_resize (A, 5, 15) ; -GB_spec_compare (C1, C2) ; -fprintf ('test166: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test167.m b/GraphBLAS/Test/unused/test167.m deleted file mode 100644 index 95cd777639..0000000000 --- a/GraphBLAS/Test/unused/test167.m +++ /dev/null @@ -1,50 +0,0 @@ -function test167 -%TEST167 test C=A*B with very sparse M, different types of A and B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -d = 0.02 ; -n = 1000 ; - -A.matrix = 100 * sprand (n, n, d) ; -A.matrix (1:257,1) = rand (257, 1) ; - -B.matrix = 100 * sprand (n, n, d) ; -B.matrix (1,1) = 1 ; -M = logical (sprand (n, n, 0.002)) ; -Cin.matrix = sparse (n, n) ; - -[~, ~, ~, types, ~, ~,] = GB_spec_opsall ; -types = types.all ; - -for k = 1:length (types) - - type = types {k} ; - semiring.class = type ; - A.class = type ; - B.class = type ; - Cin.class = type ; - fprintf ('%s ', type) ; - - C2 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, [ ]) ; - - if (isequal (type, 'double')) - A2 = GB_spec_matrix (A) ; - B2 = GB_spec_matrix (B) ; - C1 = double (M) .* (A2.matrix * B2.matrix) ; - err = norm (C1 - C2.matrix, 1) / norm (C1, 1) ; - assert (err < 1e-12) ; - % C1 = GB_spec_mxm (Cin, M, [ ], semiring, A, B, [ ]) ; - % GB_spec_compare (C1, C2) ; - end -end - -fprintf ('\ntest167: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test168.m b/GraphBLAS/Test/unused/test168.m deleted file mode 100644 index a8ce792fb3..0000000000 --- a/GraphBLAS/Test/unused/test168.m +++ /dev/null @@ -1,26 +0,0 @@ -function test168 -%TEST168 C=A+B with C and B full, A bitmap - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('test168:\n') ; - -n = 10 ; -C = GB_spec_random (n, n, inf, 1, 'double') ; -C.sparsity = 8 ; % full - -A = GB_spec_random (n, n, 0.5, 1, 'double') ; -A.sparsity = 4 ; % bitmap - -B = GB_spec_random (n, n, inf, 1, 'double') ; -B.sparsity = 8 ; % full - -C1 = A.matrix + B.matrix ; -C2 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], 'plus', A, B, [ ]) ; -GB_spec_compare (C1, C2) ; - -fprintf ('test168: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test169_orig.m b/GraphBLAS/Test/unused/test169_orig.m deleted file mode 100644 index a4001e100c..0000000000 --- a/GraphBLAS/Test/unused/test169_orig.m +++ /dev/null @@ -1,31 +0,0 @@ -function test169 -%TEST169 C=A+B with C sparse, M hyper, A and B sparse - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('test169:\n') ; - -n = 10 ; -C = GB_spec_random (n, n, 0.5, 1, 'double') ; -C.sparsity = 2 ; % sparse - -M = GB_spec_random (n, n, 0.02, 1, 'double') ; -M.sparsity = 1 ; % hypersparse - -A = GB_spec_random (n, n, 0.5, 1, 'double') ; -A.sparsity = 2 ; % sparse - -B = GB_spec_random (n, n, 0.5, 1, 'double') ; -B.sparsity = 2 ; % sparse - -desc = struct ('mask', 'complement') ; - -C1 = GB_spec_Matrix_eWiseAdd (C, M, [ ], 'plus', A, B, desc) ; -C2 = GB_mex_Matrix_eWiseAdd (C, M, [ ], 'plus', A, B, desc) ; -GB_spec_compare (C1, C2) ; - -fprintf ('test169: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test170.m b/GraphBLAS/Test/unused/test170.m deleted file mode 100644 index 797f85c344..0000000000 --- a/GraphBLAS/Test/unused/test170.m +++ /dev/null @@ -1,26 +0,0 @@ -function test170 -%TEST170 test C=A+B (alias M==B) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('test170:\n') ; -GB_mex_burble (1) ; - -n = 30 ; - -A = GB_spec_random (n, n, 0.5, 1, 'double') ; -A.sparsity = 2 ; % sparse - -B = GB_spec_random (n, n, 0.5, 1, 'double') ; -B.sparsity = 2 ; % sparse - -C1 = spones (B.matrix) .* (A.matrix+B.matrix) ; -C2 = GB_mex_AplusB_M_aliased (A, B, 'plus') ; -GB_spec_compare (C1, C2) ; - -GB_mex_burble (0) ; -fprintf ('test170: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test171.m b/GraphBLAS/Test/unused/test171.m deleted file mode 100644 index f8b522b6f0..0000000000 --- a/GraphBLAS/Test/unused/test171.m +++ /dev/null @@ -1,23 +0,0 @@ -function test171 -%TEST171 test conversion - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('test171:\n') ; - -for n = [ 1000 1025 2000 ] - - A.matrix = rand (n) ; - A.sparsity = 4 ; - C = GB_mex_dump (A, 1) ; - - A.matrix = sparse (rand (n)) ; - A.sparsity = 4 ; - C = GB_mex_dump (A, 1) ; -end - -fprintf ('test171: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test175.m b/GraphBLAS/Test/unused/test175.m deleted file mode 100644 index 0c17d3f22d..0000000000 --- a/GraphBLAS/Test/unused/test175.m +++ /dev/null @@ -1,247 +0,0 @@ -function test175 -%TEST175 test GrB_assign with accum - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -fprintf ('test175 ------------ GrB_assign with accum\n') ; - -m = 10 ; -n = 14 ; - -rng ('default') ; - -M1.matrix = logical (spones (sprand (m, n, 0.5))) ; -M1.sparsity = 2 ; % sparse - -M2.matrix = logical (spones (sprand (m, n, 0.5))) ; -M2.sparsity = 4 ; % sparse - -Amat2 = sparse (2 * rand (m,n)) ; -Bmat2 = sparse (2 * sprand (m,n, 0.5)) ; -Cmat2 = sparse (2 * rand (m,n)) ; - -Amat = 5000 * Amat2 ; -B1mat = 5000 * Bmat2 ; -Cmat = 5000 * Cmat2 ; - -B2mat = rand (m,n) ; - -Smat = sparse (m,n) ; -Xmat = sparse (pi) ; -desc.mask = 'structural' ; -drep.outp = 'replace' ; - -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('%s, ', type) ; - - clear A B1 B2 C S X - A.matrix = Amat ; A.class = 'see below' ; - B1.matrix = B1mat ; B1.class = 'see below' ; - B2.matrix = B2mat ; B2.class = 'see below' ; - C.matrix = Cmat ; C.class = 'see below' ; - S.matrix = Smat ; S.class = 'see below' ; - X.matrix = Xmat ; X.class = 'see below' ; - A.class = type ; - - for k3 = 1:3 - - if (k3 == 1) - X.class = type ; - B1.class = type ; - B2.class = type ; - C.class = 'logical' ; - S.class = 'logical' ; - elseif (k3 == 2) - X.class = type ; - B1.class = type ; - B2.class = type ; - C.class = type ; - S.class = type ; - else - X.class = 'int8' ; - B1.class = 'int8' ; - B2.class = 'int8' ; - C.class = type ; - S.class = type ; - end - - for k4 = 1:7 - - if (k4 == 1) - M = M1 ; - B = B1 ; - C.sparsity = 2 ; - B.sparsity = 2 ; - elseif (k4 == 2) - M = M2 ; - B = B1 ; - C.sparsity = 2 ; - B.sparsity = 2 ; - elseif (k4 == 3) - M = M1 ; - B = B1 ; - C.sparsity = 4 ; - B.sparsity = 2 ; - elseif (k4 == 4) - M = M2 ; - B = B1 ; - C.sparsity = 4 ; - B.sparsity = 2 ; - elseif (k4 == 5) - M = M2 ; - B = B1 ; - C.sparsity = 4 ; - B.sparsity = 4 ; - elseif (k4 == 6) - M = M2 ; - B = B2 ; - C.sparsity = 4 ; - B.sparsity = 4 ; - elseif (k4 == 7) - M = M2 ; - B = B2 ; - C.sparsity = 2 ; - B.sparsity = 4 ; - end - - %--------------------------------------- - % C = A where A is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], A, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, M, [ ], A, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = B where B is sparse - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], B, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, M, [ ], B, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = A where A is dense and C starts empty - %--------------------------------------- - - C0 = GB_spec_assign (S, M, [ ], A, [ ], [ ], desc, false) ; - C1 = GB_mex_assign (S, M, [ ], A, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x where C is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x where C is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], desc, true) ; - C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % C = x - %--------------------------------------- - - C0 = GB_spec_assign (S, M, [ ], X, [ ], [ ], desc, true) ; - C1 = GB_mex_assign (S, M, [ ], X, [ ], [ ], desc) ; - GB_spec_compare (C0, C1) ; - - end - - %--------------------------------------- - % C = x - %--------------------------------------- - - C0 = GB_spec_assign (S, [ ], [ ], X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (S, [ ], [ ], X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % with accum operators - %--------------------------------------- - - clear A B C - - for k2 = 1:length(binops) - binop = binops {k2} ; - - tol = 0 ; - switch (binop) - case { 'pow', 'atan2', 'hypot', 'remainder' } - A.matrix = Amat2 ; - B.matrix = Bmat2 ; - C.matrix = Cmat2 ; - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - end - otherwise - A.matrix = Amat ; - B.matrix = B1mat ; - C.matrix = Cmat ; - end - - accum.opname = binop ; - accum.optype = type ; - - try - GB_spec_operator (accum) ; - catch - continue - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - %--------------------------------------- - % C += A where A is dense - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, A, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, A, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % C += B where B is sparse - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, B, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, B, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % C += x - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (C, [ ], accum, X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % C += x - %--------------------------------------- - - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], drep, true) ; - C1 = GB_mex_subassign (C, [ ], accum, X, [ ], [ ], drep) ; - GB_spec_compare (C0, C1, 0, tol) ; - - end -end -end - -fprintf ('\ntest175: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test177.m b/GraphBLAS/Test/unused/test177.m deleted file mode 100644 index edc1b977f4..0000000000 --- a/GraphBLAS/Test/unused/test177.m +++ /dev/null @@ -1,48 +0,0 @@ -function test177 -%TEST177 C=A*B, C bitmap, M sparse, A bitmap, B sparse - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test177: C=A*B, C bitmap, M sparse, A bitmap, B sparse\n') ; - -n = 20 ; - -rng ('default') ; - -desc.mask = 'complement' ; -semiring.class = 'double' ; - -for trial = 1:10 - - clear M Cin - M.matrix = logical (spones (sprand (n, n, 0.5))) ; - M.sparsity = 2 ; % bitmap - - Cin = GB_spec_random (n, n, 0.5, 1, 'double') ; - Cin.sparsity = 4 ; % bitmap - - A = GB_spec_random (n, n, 0.5, 1, 'double') ; - A.sparsity = 4 ; % bitmap - - B = GB_spec_random (n, n, 0.5, 1, 'double') ; - B.sparsity = 2 ; % sparse - - semiring.add = 'plus' ; - semiring.multiply = 'times' ; - - C1 = GB_spec_mxm (Cin, M, [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2) ; - - semiring.add = 'max' ; - semiring.multiply = 'plus' ; - - C1 = GB_spec_mxm (Cin, M, [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (Cin, M, [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2) ; - -end - -fprintf ('\ntest177: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test178.m b/GraphBLAS/Test/unused/test178.m deleted file mode 100644 index a2b0971e75..0000000000 --- a/GraphBLAS/Test/unused/test178.m +++ /dev/null @@ -1,33 +0,0 @@ -function test178 -%TEST178 matrix realloc - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test178: --------------------------------- matrix realloc\n') ; - -n = 20 ; - -rng ('default') ; - -desc = struct ('mask', 'complement') ; - -for trial = 1:10 - - Cin = GB_spec_random (n, n, inf, 1, 'double') ; - Cin.sparsity = 2 ; % sparse - M = sparse (n,n) ; - M (1,1) = 1 ; - A = sparse (n,n) ; - - C1 = GB_spec_assign (Cin, M, [ ], A, [ ], [ ], desc, false) ; - C2 = GB_mex_assign (Cin, M, [ ], A, [ ], [ ], desc) ; - GB_spec_compare (C1, C2) ; - sparse (C1.matrix) - sparse (C2.matrix) - -end - - -fprintf ('\ntest178: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test185.m b/GraphBLAS/Test/unused/test185.m deleted file mode 100644 index 6b71f2bb5c..0000000000 --- a/GraphBLAS/Test/unused/test185.m +++ /dev/null @@ -1,99 +0,0 @@ -function test185 -%TEST185 test dot4 for all sparsity formats -% GB_AxB_dot4 computes C+=A'*B when C is dense. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test185 -------------------- C+=A''*B when C is dense\n') ; - -rng ('default') ; -GB_mex_burble (0) ; - -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; - -plus_pair.add = 'plus' ; -plus_pair.multiply = 'oneb' ; % same as pair -plus_pair.class = 'double' ; - -add_op = 'plus' ; -dtn_dot = struct ('axb', 'dot', 'inp0', 'tran') ; -dtn_sax = struct ('axb', 'saxpy', 'inp0', 'tran') ; - -n = 20 ; -C = GB_spec_random (n, n, inf, 1, 'double') ; -C.sparsity = 8 ; -C0 = sparse (n, n) ; -maxerr = 0 ; - -M = sparse (rand (n, n) > 0.5) ; - -for da = [0.01 0.1 .5 0.9 inf] - A = GB_spec_random (n, n, da, 1, 'double') ; - - for db = [0.01 0.1 .5 0.9 inf] - B = GB_spec_random (n, n, db, 1, 'double') ; - - for A_sparsity = [1 2 4 8] - fprintf ('.') ; - - for B_sparsity = [1 2 4 8] - A.sparsity = A_sparsity ; - B.sparsity = B_sparsity ; - - % C2 = C + A'*B using dot4 - C2 = GB_mex_mxm (C, [ ], add_op, semiring, A, B, dtn_dot) ; - C1 = GB_spec_mxm (C, [ ], add_op, semiring, A, B, dtn_dot) ; - GB_spec_compare (C1, C2) ; - C3 = C.matrix + (A.matrix)'*B.matrix ; - err = norm (C3 - C2.matrix, 1) ; - maxerr = max (maxerr, err) ; - assert (err < 1e-12) ; - - % C2 = A'*B using dot2/dot3 - C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, dtn_dot) ; - C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, dtn_dot) ; - GB_spec_compare (C1, C2) ; - C3 = (A.matrix)'*B.matrix ; - err = norm (C3 - C2.matrix, 1) ; - maxerr = max (maxerr, err) ; - assert (err < 1e-12) ; - - % C2 = C + A'*B using saxpy - C2 = GB_mex_mxm (C, [ ], add_op, semiring, A, B, dtn_sax) ; - C1 = GB_spec_mxm (C, [ ], add_op, semiring, A, B, dtn_sax) ; - GB_spec_compare (C1, C2) ; - C3 = C.matrix + (A.matrix)'*B.matrix ; - err = norm (C3 - C2.matrix, 1) ; - maxerr = max (maxerr, err) ; - assert (err < 1e-12) ; - - % C2 = C + spones(A)'*spones(B) using dot4 - C2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - C1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - GB_spec_compare (C1, C2) ; - C3 = C.matrix + spones (A.matrix)' * spones (B.matrix) ; - err = norm (C3 - C2.matrix, 1) ; - maxerr = max (maxerr, err) ; - assert (err < 1e-12) ; - - % C2 = spones(A)'*spones(B) using dot2/dot3 - C2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - C1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - GB_spec_compare (C1, C2) ; - C3 = spones (A.matrix)' * spones (B.matrix) ; - err = norm (C3 - C2.matrix, 1) ; - maxerr = max (maxerr, err) ; - assert (err < 1e-12) ; - end - end - end -end - -fprintf ('\n') ; -GB_mex_burble (0) ; -fprintf ('maxerr: %g\n', maxerr) ; -fprintf ('test185: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test188.m b/GraphBLAS/Test/unused/test188.m deleted file mode 100644 index 0db3e2ae72..0000000000 --- a/GraphBLAS/Test/unused/test188.m +++ /dev/null @@ -1,105 +0,0 @@ -function test188 -%TEST188 test concat - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test188 ----------- C = concat (Tiles)\n') ; - -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -track_coverage = true ; -if (track_coverage) - global GraphBLAS_grbcov - track_coverage = ~isempty (GraphBLAS_grbcov) ; - clast = sum (GraphBLAS_grbcov > 0) ; - cfirst = clast ; - cstart = find (GraphBLAS_grbcov > 0) ; -end - -rng ('default') ; - -n1 = 20 ; -n2 = 4 ; - -densities = [1e-4 0.01 0.2 0.8 inf] ; -for k1 = 1:length(densities) - density = densities (k1) ; - % fprintf ('\nd = %g\n', density) ; - - for ka = 1:length (types) - atype = types {ka} ; - - A1 = GB_spec_random (n1, n1, density, 128, atype) ; - A2 = GB_spec_random (n1, n2, density, 128, atype) ; - A3 = GB_spec_random (n2, n1, density, 128, atype) ; - - if (ka == 11) - A4 = GB_spec_random (n2, n2, inf, 128, atype) ; - else - A4 = GB_spec_random (n2, n2, density, 128, atype) ; - end - - for iso = 0:1 - - % test iso case - A1.iso = iso ; - A2.iso = iso ; - A3.iso = iso ; - A4.iso = iso ; - - for sparsity_control = [1 2 4 8] - A1.sparsity = sparsity_control ; - A2.sparsity = sparsity_control ; - A3.sparsity = sparsity_control ; - if (ka == 11) - A4.sparsity = 8 ; - else - A4.sparsity = sparsity_control ; - end - for is_csc = [0 1] - A1.is_csc = is_csc ; - A2.is_csc = is_csc ; - A3.is_csc = is_csc ; - A4.is_csc = is_csc ; - Tiles = cell (2,2) ; - Tiles {1,1} = A1 ; - Tiles {1,2} = A2 ; - Tiles {2,1} = A3 ; - Tiles {2,2} = A4 ; - for kc = 1:length (types) - ctype = types {kc} ; - for fmt = 0:1 - C1 = GB_mex_concat (Tiles, ctype, fmt) ; - C2 = GB_spec_concat (Tiles, ctype) ; - GB_spec_compare (C1, C2) ; - - if (track_coverage) - c = sum (GraphBLAS_grbcov > 0) ; - d = c - clast ; - if (d > 0) - fprintf (... - '[%15s, %15s, %d, %d, %d, %d, %d]', ... - ctype, atype, ... - k1, iso, sparsity_control, ... - is_csc, fmt) ; - fprintf (' (%d, %d)\n', d, c - cfirst) ; - end - clast = c ; - else - fprintf ('.') ; - end - - end - end - end - end - end - end -end - -fprintf ('\n') ; -GB_mex_burble (0) ; -fprintf ('test188: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test190.m b/GraphBLAS/Test/unused/test190.m deleted file mode 100644 index 677fadff21..0000000000 --- a/GraphBLAS/Test/unused/test190.m +++ /dev/null @@ -1,26 +0,0 @@ -function test190 -%TEST190 test dense matrix for C=A*B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test190 ----------- dense matrix for C=A*B\n') ; - -rng ('default') ; -n = 1000 ; -M.matrix = eye (n) ; -M.sparsity = 2 ; -desc.mask = 'structural complement' ; -A = sprand (n, n, 0.001) ; -B = sprand (n, n, 0.001) ; -C = sparse (n, n) ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -C1 = GB_mex_mxm (C, M, [ ], semiring, A, B, desc) ; - -assert (nnz (C1.matrix) == 0) ; - -fprintf ('test190 all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test191.m b/GraphBLAS/Test/unused/test191.m deleted file mode 100644 index 80453e2e54..0000000000 --- a/GraphBLAS/Test/unused/test191.m +++ /dev/null @@ -1,57 +0,0 @@ -function test191 -%TEST191 test split - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test191 ----------- Tiles = split (A)\n') ; - -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -rng ('default') ; - -m = 100 ; -n = 110 ; -ms = [10 1 89] ; -ns = [1 4 50 45 10] ; - -for d = [1e-4 0.01 0.2 0.8 inf] - fprintf ('\nd = %g\n', d) ; - for ka = 1:length (types) - atype = types {ka} ; - A = GB_spec_random (m, n, d, 128, atype) ; - for sparsity_control = [1 2 4 8] - fprintf ('.') ; - A.sparsity = sparsity_control ; - for is_csc = [0 1] - A.is_csc = is_csc ; - C2 = GB_spec_split (A, ms, ns) ; - C1 = GB_mex_split (A, ms, ns) ; - for i = 1:length(ms) - for j = 1:length(ns) - GB_spec_compare (C1 {i,j}, C2 {i,j}) ; - end - end - - if (nnz (A.matrix) > 0) - % also try the iso case - B = A ; - B.matrix = spones (A.matrix) * pi ; - B.iso = true ; - C2 = GB_spec_split (B, ms, ns) ; - C1 = GB_mex_split (B, ms, ns) ; - for i = 1:length(ms) - for j = 1:length(ns) - GB_spec_compare (C1 {i,j}, C2 {i,j}) ; - end - end - end - end - end - end -end - -fprintf ('\n') ; -fprintf ('test191: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test191b.m b/GraphBLAS/Test/unused/test191b.m deleted file mode 100644 index 52628fa1fa..0000000000 --- a/GraphBLAS/Test/unused/test191b.m +++ /dev/null @@ -1,22 +0,0 @@ -function test191b(tasks) -%TEST191B test split - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test191 ----------- Tiles = split (A)\n') ; - -if (nargin < 1) - tasks = [ ] ; -end - -if (isempty (tasks)) - tasks = { - {1, 'logical', 1, 0}, ... % ( 1, 1) - {1, 'logical', 4, 0}, ... % ( 1, 2) - {2, 'logical', 8, 0}, ... % ( 1, 3) - } ; -end - -test191 (tasks) ; - diff --git a/GraphBLAS/Test/unused/test194.m b/GraphBLAS/Test/unused/test194.m deleted file mode 100644 index 11d49c58be..0000000000 --- a/GraphBLAS/Test/unused/test194.m +++ /dev/null @@ -1,47 +0,0 @@ -function test194 -%TEST194 test GxB_Vector_diag - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test194 ----------- V = diag (A,k)\n') ; - -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; - -rng ('default') ; -GB_builtin_complex_set (true) ; - -ms = [10 20] ; -ns = [4 10] ; - -for d = [1e-4 0.1 0.8 inf] - fprintf ('\nd = %g\n', d) ; - for ka = 1:length (types) - atype = types {ka} ; - for m = ms - for n = ns - A = GB_spec_random (m, n, d, 128, atype) ; - for sparsity_control = [1 2 4 8] - fprintf ('.') ; - A.sparsity = sparsity_control ; - for csc = [1 0] - A.is_csc = csc ; - for kc = 1:length (types) - vtype = types {kc} ; - for k = [-10 -2 0 3 ] - V2 = GB_spec_vdiag (A, k, vtype) ; - V1 = GB_mex_vdiag (A, k, vtype) ; - GB_spec_compare (V1, V2) ; - end - end - end - end - end - end - end -end - -fprintf ('\n') ; -fprintf ('test194: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test195.m b/GraphBLAS/Test/unused/test195.m deleted file mode 100644 index d1b1d955fb..0000000000 --- a/GraphBLAS/Test/unused/test195.m +++ /dev/null @@ -1,109 +0,0 @@ -function test195 (dohack) -%TEST195 test all variants of saxpy3 - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; -[nthreads_orig chunk_orig] = nthreads_get ; - -% save current global settings, then modify them -save_hack = GB_mex_hack ; -hack = save_hack ; -if (nargin < 1) - dohack = 2 ; -end -hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced -GB_mex_hack (hack) ; - -k = 3 ; -n = 4 ; -m = 200 ; -desc.axb = 'hash' ; -desc_s.axb = 'hash' ; desc_s.mask = 'structural' ; -dnot.axb = 'hash' ; dnot.mask = 'complement' ; -dnot_s.axb = 'hash' ; dnot_s.mask = 'structural complement' ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -for asparsity = [1 2 4 8] - fprintf ('\nA: %s ', GB_sparsity (asparsity)) ; - for bsparsity = [1 2 4 8] - fprintf ('\n B: %s ', GB_sparsity (bsparsity)) ; - for msparsity = [1 2 4 8] - fprintf ('\n M: %s ', GB_sparsity (msparsity)) ; - for da = [0.01 .1 inf] - A = GB_spec_random (m, k, da) ; A.sparsity = asparsity ; - for db = [0.01 .1 inf] - B = GB_spec_random (k, n, db) ; B.sparsity = bsparsity ; - for dm = [0.01 .1 inf] - fprintf ('.') ; - M = GB_spec_random (m, n, dm) ; M.sparsity = msparsity ; - M.matrix = spones (M.matrix) ; - - % C = A*B - C0 = A.matrix * B.matrix ; - C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - if (msparsity == 4) - chunks = unique ([1 chunk_orig 65536]) ; - else - chunks = chunk_orig ; - end - - for chunk = chunks - nthreads_set (nthreads_orig, chunk) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* M.matrix ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* M.matrix ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc_s) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc_s) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - end - end - end - end - end - end -end - -% restore global settings -GB_mex_burble (0) ; -GB_mex_hack (save_hack) ; -nthreads_set (nthreads_orig, chunk_orig) ; - -fprintf ('\ntest195: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test198.m b/GraphBLAS/Test/unused/test198.m deleted file mode 100644 index 77b4be2577..0000000000 --- a/GraphBLAS/Test/unused/test198.m +++ /dev/null @@ -1,30 +0,0 @@ -function test198 -%TEST198 test apply with C=op(C) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -% GB_mex_burble (1) ; -n = 10 ; -C = sprand (n, n, 0.5) ; -op.opname = 'sqrt' ; -op.optype = 'double' ; - -C1 = GB_mex_apply_alias (C, op) ; -C2 = sqrt (C) ; -err = norm (C1.matrix - C2, 1) ; -assert (err < 1e-12) ; - -Ciso.matrix = pi * spones (C) ; -Ciso.iso = true ; - -C1 = GB_mex_apply_alias (Ciso, op) ; -C2 = sqrt (Ciso.matrix) ; -err = norm (C1.matrix - C2, 1) ; -assert (err < 1e-12) ; - -GB_mex_burble (0) ; -fprintf ('test198: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test20.m b/GraphBLAS/Test/unused/test20.m deleted file mode 100644 index ba764003eb..0000000000 --- a/GraphBLAS/Test/unused/test20.m +++ /dev/null @@ -1,393 +0,0 @@ -function test20(fulltest) -%TEST20 test GrB_mxm, mxv, and vxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -mult_ops = binops.all ; -types = types.all ; - -tic - -if (nargin < 1) - fulltest = 0 ; -end - -if (fulltest == 2) - fprintf ('test20: lengthy tests of GrB_mxm, mxv, and vxm\n') ; - n_semirings_max = inf ; -else - fprintf ('test20: quick test of GrB_mxm, mxv, and vxm\n') ; - n_semirings_max = 1 ; -end - -% types to test: -kk = 1 ; -% ops to test -aa = 1 ; - -if (fulltest > 0) - k1_list = 1:length(mult_ops) ; - k2_list = 1:length(add_ops) ; - k3_list = 1:length(types) ; -else - k1_list = [ 9 ] ; % times - k2_list = [ 3 ] ; % plus - k3_list = [ 11 ] ; % double -end - -kk = min (kk, length (types)) ; - -dnn = struct ; -dtn = struct ( 'inp0', 'tran' ) ; -dnt = struct ( 'inp1', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; - -n_semirings = 0 ; -ntrials = 0 ; - -for k1 = k1_list % 1:length(mult_ops) - mulop = mult_ops {k1} ; - % if (~GB_spec_is_positional (mulop)) - % continue ; - % end - - for k2 = k2_list % 1:length(add_ops) - - addop = add_ops {k2} ; - fprintf ('\nsemiring %s:%s ', addop, mulop) ; - - for k3 = k3_list % 1:length (types) - - rng ('default') ; - type = types {k3} ; - - semiring.multiply = mulop ; - semiring.add = addop ; - semiring.class = type ; - if (n_semirings_max == 1) - semiring - end - - % create the semiring. some are not valid because the or,and,xor - % monoids can only be used when z is boolean for z=mult(x,y). - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype] = GB_spec_operator (mult_op); - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add, add_optype) ; - catch - continue - end - - if (n_semirings+1 > n_semirings_max) - fprintf ('\ntest20: all quick tests passed\n') ; - return ; - end - - % fprintf ('\n%4d ', n_semirings) ; - % fprintf ('%12.2f mxm semiring %s:%s:%s ', toc,addop,mulop,type) ; - % fprintf (' id: %g ', double (identity)) ; - n_semirings = n_semirings + 1 ; - - % for k4 = [0 5 11 15] % 0:length(mult_ops) - for k4 = [ 0 randperm(length(mult_ops), aa)] - - if (k4 == 0) - accum_op = '' ; - ntypes = 1 ; - else - accum_op = mult_ops {k4} ; - % ntypes = [1 2 8 ] ; % length (types) ; - % ntypes = 1:length (types) ; - ntypes = randperm (length (types),kk) ; - end - - for k5 = ntypes - - clear accum - if (~isempty (accum_op)) - accum_type = types {k5} ; - accum.opname = accum_op ; - accum.optype = accum_type ; - else - accum = '' ; - accum_type = '' ; - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - GB_spec_operator (accum) ; - catch - continue - end - - for Mask_complement = [false true] - - if (Mask_complement) - dnn.mask = 'complement' ; - dtn.mask = 'complement' ; - dnt.mask = 'complement' ; - dtt.mask = 'complement' ; - else - dnn.mask = 'default' ; - dtn.mask = 'default' ; - dnt.mask = 'default' ; - dtt.mask = 'default' ; - end - - for C_replace = [false true] - - if (C_replace) - dnn.outp = 'replace' ; - dtn.outp = 'replace' ; - dnt.outp = 'replace' ; - dtt.outp = 'replace' ; - else - dnn.outp = 'default' ; - dtn.outp = 'default' ; - dnt.outp = 'default' ; - dtt.outp = 'default' ; - end - - % pick a random class, and int32 - atypes = randperm(length(types),kk) ; - % 1:length (types) - atypes = unique ([atypes 6]) ; - - % try all matrix types, to test casting - for k6 = atypes - - aclas = types {k6} ; - - if (isequal (aclas, 'int32') && ... - mod (n_semirings, 100) == 1) - % single or double would lead to - % different roundoff errors - hyper_range = 0:1 ; - csc_range = 0:1 ; - else - hyper_range = 0 ; - csc_range = 1 ; - end - - % try some matrices - for m = 8 % [1 5 10 ] - - for n = 5 % [ 1 5 10 ] - - for s = 4 % [ 1 5 10 ] - for density = [0.1 0.2 0.3 0.5] - - % try all combinations of hyper/ - % non-hyper and CSR/CSC - for A_is_hyper = hyper_range - for A_is_csc = csc_range - for B_is_hyper = hyper_range - for B_is_csc = csc_range - for C_is_hyper = hyper_range - for C_is_csc = csc_range - for M_is_hyper = hyper_range - for M_is_csc = csc_range - - if (mod (ntrials, 23) == 0) - fprintf ('.') ; - end - - %----------------------------------- - % A*B - %----------------------------------- - - A = GB_spec_random (m,s,density,100,aclas, A_is_csc, A_is_hyper) ; - B = GB_spec_random (s,n,density,100,aclas, B_is_csc, B_is_hyper) ; - C = GB_spec_random (m,n,density,100,aclas, C_is_csc, C_is_hyper) ; - - % C = A*B, no mask - Mask = [ ] ; - C0 = GB_spec_mxm (C, [ ], accum, semiring, A, B, dnn); - C1 = GB_mex_mxm (C, [ ], accum, semiring, A, B, dnn); - GB_spec_compare (C0, C1, identity) ; - - % w = A*u, no mask - w = GB_spec_random (m,1,density,100,type) ; - u = GB_spec_random (s,1,density,100,type) ; - - w0 = GB_spec_mxv (w, [ ], accum, semiring, A, u, dnn); - w1 = GB_mex_mxv (w, [ ], accum, semiring, A, u, dnn); - GB_spec_compare (w0, w1, identity) ; - - % w' = u'*A' no mask - w0 = GB_spec_vxm (w, [ ], accum, semiring, u, A, dnt); - w1 = GB_mex_vxm (w, [ ], accum, semiring, u, A, dnt); - GB_spec_compare (w0, w1, identity) ; - - % C = A*B with mask - % Mask = sprandn (m,n,0.2) ~= 0 ; - Mask = GB_random_mask(m,n,0.2, M_is_csc, M_is_hyper) ; - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dnn); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dnn); - GB_spec_compare (C0, C1, identity) ; - - % C = A*B with mask (with explicit zero entries) - Mask1 = sprandn (m,n,0.2) ~= 0 ; - Mask2 = Mask1 .* spones (sprandn (m,n,0.5)) ; - S = sparse (m,n) ; - Mask3 = GB_mex_Matrix_eWiseAdd (S,[ ],[ ],'minus',Mask1,Mask2) ; - clear Mask - Mask.matrix = Mask3.matrix ; - Mask.is_csc = M_is_csc ; - Mask.is_hyper = M_is_hyper ; - clear Mask1 Mask2 Mask3 - % the Mask matrix will not pass GB_spok(Mask) test since - % it will have explicit zeros - - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dnn); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dnn); - GB_spec_compare (C0, C1, identity) ; - - % w = A*u with mask - % mask = sprandn (m,1,0.2) ~= 0 ; - mask = GB_random_mask (m,1,0.2) ; - w0 = GB_spec_mxv (w, mask, accum, semiring, A, u, dnn); - w1 = GB_mex_mxv (w, mask, accum, semiring, A, u, dnn); - GB_spec_compare (w0, w1, identity) ; - - % w' = u'*A' with mask - w0 = GB_spec_vxm (w, mask, accum, semiring, u, A, dnt) ; - w1 = GB_mex_vxm (w, mask, accum, semiring, u, A, dnt) ; - GB_spec_compare (w0, w1, identity) ; - - %----------------------------------- - % A'*B - %----------------------------------- - - A = GB_spec_random (s,m,density,100,aclas, A_is_csc, A_is_hyper) ; - B = GB_spec_random (s,n,density,100,aclas, B_is_csc, B_is_hyper) ; - C = GB_spec_random (m,n,density,100,aclas, C_is_csc, C_is_hyper) ; - - % C = A'*B, no Mask - C0 = GB_spec_mxm (C, [ ], accum, semiring, A, B, dtn); - C1 = GB_mex_mxm (C, [ ], accum, semiring, A, B, dtn); - GB_spec_compare (C0, C1, identity) ; - - % w = A'*u, no mask - - w0 = GB_spec_mxv (w, [ ], accum, semiring, A, u, dtn); - w1 = GB_mex_mxv (w, [ ], accum, semiring, A, u, dtn); - GB_spec_compare (w0, w1, identity) ; - - % w' = u'*A, no mask - w0 = GB_spec_vxm (w, [ ], accum, semiring, u, A, dnn); - w1 = GB_mex_vxm (w, [ ], accum, semiring, u, A, dnn); - GB_spec_compare (w0, w1, identity) ; - - % C = A'*B with mask - % Mask = sprandn (m,n,0.2) ~= 0 ; - Mask = GB_random_mask (m,n,0.2, M_is_csc, M_is_hyper) ; - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dtn); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dtn); - GB_spec_compare (C0, C1, identity) ; - - % C = A'*B with mask - Mask1 = sprandn (m,n,0.2) ~= 0 ; - Mask2 = Mask1 .* spones (sprandn (m,n,0.5)) ; - S = sparse (m,n) ; - Mask3 = GB_mex_Matrix_eWiseAdd (S,[ ],[ ],'minus',Mask1,Mask2) ; - clear Mask - Mask.matrix = Mask3.matrix ; - Mask.is_csc = M_is_csc ; - Mask.is_hyper = M_is_hyper ; - clear Mask1 Mask2 Mask3 - % the Mask matrix will not pass GB_spok(Mask) test since - % it will have explicit zeros - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dtn); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dtn); - GB_spec_compare (C0, C1, identity) ; - - % w = A'*u, with mask - % mask = sprandn (m,1,0.2) ~= 0 ; - mask = GB_random_mask (m,1,0.2) ; - w0 = GB_spec_mxv (w, mask, accum, semiring, A, u, dtn); - w1 = GB_mex_mxv (w, mask, accum, semiring, A, u, dtn); - GB_spec_compare (w0, w1, identity) ; - - % w' = u'*A, with mask - w0 = GB_spec_vxm (w, mask, accum, semiring, u, A, dnn); - w1 = GB_mex_vxm (w, mask, accum, semiring, u, A, dnn); - GB_spec_compare (w0, w1, identity) ; - - %----------------------------------- - % A*B' - %----------------------------------- - - % no mask - - A = GB_spec_random (m,s,density,100,aclas, A_is_csc, A_is_hyper) ; - B = GB_spec_random (n,s,density,100,aclas, B_is_csc, B_is_hyper) ; - C = GB_spec_random (m,n,density,100,aclas, C_is_csc, C_is_hyper) ; - - C0 = GB_spec_mxm (C, [ ], accum, semiring, A, B, dnt); - C1 = GB_mex_mxm (C, [ ], accum, semiring, A, B, dnt); - GB_spec_compare (C0, C1, identity) ; - - % with mask - % Mask = sprandn (m,n,0.2) ~= 0 ; - Mask = GB_random_mask (m,n,0.2, M_is_csc, M_is_hyper) ; - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dnt); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dnt); - GB_spec_compare (C0, C1, identity) ; - - %----------------------------------- - % A'*B' - %----------------------------------- - - % no Mask - - A = GB_spec_random (s,m,density,100,aclas, A_is_csc, A_is_hyper) ; - B = GB_spec_random (n,s,density,100,aclas, B_is_csc, B_is_hyper) ; - C = GB_spec_random (m,n,density,100,aclas, C_is_csc, C_is_hyper) ; - - C0 = GB_spec_mxm (C, [ ], accum, semiring, A, B, dtt); - C1 = GB_mex_mxm (C, [ ], accum, semiring, A, B, dtt); - GB_spec_compare (C0, C1, identity) ; - - - % A'*B', with mask - % Mask = sprandn (m,n,0.2) ~= 0 ; - Mask = GB_random_mask (m,n,0.2, M_is_csc, M_is_hyper) ; - - C0 = GB_spec_mxm (C, Mask, accum, semiring, A, B, dtt); - C1 = GB_mex_mxm (C, Mask, accum, semiring, A, B, dtt); - GB_spec_compare (C0, C1, identity) ; - - ntrials = ntrials + 1 ; - - -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end - -fprintf ('semirings tested: %d\n', n_semirings) ; -fprintf ('\ntest20: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test205.m b/GraphBLAS/Test/unused/test205.m deleted file mode 100644 index 0c0b1450dd..0000000000 --- a/GraphBLAS/Test/unused/test205.m +++ /dev/null @@ -1,40 +0,0 @@ -function test205 -%TEST205 test iso kron - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% GB_mex_burble (1) ; -rng ('default') ; -n = 10 ; -A.matrix = pi * spones (sprandn (n, n, 0.5)) ; -A.class = 'double' ; -A.iso = true ; - -B.matrix = 3 * spones (sprandn (n, n, 0.5)) ; -B.class = 'double' ; -B.iso = true ; - -op_times.opname = 'times' ; -op_times.optype = 'double' ; - -Cin = sparse (n*n,n*n) ; -C1 = GB_mex_kron (Cin, [ ], [ ], op_times, A, B, [ ]) ; -C2 = kron (A.matrix, B.matrix) ; -err = norm (C1.matrix - C2, 1) ; -assert (err < 1e-12) -assert (C1.iso) ; - -A.matrix = pi * ones (n,n) ; -B.matrix = 3 * ones (n,n) ; - -Cin = sparse (n*n,n*n) ; -C1 = GB_mex_kron (Cin, [ ], [ ], op_times, A, B, [ ]) ; -C2 = kron (A.matrix, B.matrix) ; -err = norm (C1.matrix - C2, 1) ; -assert (err < 1e-12) -assert (C1.iso) ; - -GB_mex_burble (0) ; -fprintf ('test205: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test21.m b/GraphBLAS/Test/unused/test21.m deleted file mode 100644 index c1c826b64f..0000000000 --- a/GraphBLAS/Test/unused/test21.m +++ /dev/null @@ -1,201 +0,0 @@ -function test21(fulltest) -%TEST21 test GxB_subassign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - % do a short test, by default - fulltest = 0 ; -end - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -accum_ops = binops.all ; -types = types.real ; - -dn = struct ; -dt = struct ( 'inp0', 'tran' ) ; - -if (fulltest) - fprintf ('\ntest21 --------------exhaustive test of GB_mex_subassign\n') ; - k1test = 0:length(accum_ops) ; -else - fprintf ('\ntest21 --------------quick test of GB_mex_subassign\n') ; - k1test = [ 4 0] ; % Was [4 0 2 7] ; -end - -% try all accum -for k1 = k1test - if (k1 == 0) - accum_op = '' ; - ntypes = 1 ; - else - accum_op = accum_ops {k1} ; - ntypes = length (types) ; - end - fprintf ('\naccum: [%s]', accum_op) ; - - if (fulltest) - k2test = 1:ntypes ; - else - k2test = 11 ; % Was [1 2 11] ; - end - - % try all types - for k2 = k2test % 1:ntypes - clear accum - if (~isempty (accum_op)) - accum_type = types {k2} ; - accum.opname = accum_op ; - accum.optype = accum_type ; - else - accum = '' ; - accum_type = '' ; - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - GB_spec_operator (accum) ; - catch - continue ; - end - fprintf (' %s', accum_type) ; - - rng (k1 * 100 + k2, 'v4') ; - - for Mask_complement = [false true] - - if (Mask_complement) - dn.mask = 'complement' ; - dt.mask = 'complement' ; - else - dn.mask = 'default' ; - dt.mask = 'default' ; - end - - for C_replace = [false true] - - if (C_replace) - dn.outp = 'replace' ; - dt.outp = 'replace' ; - else - dn.outp = 'default' ; - dt.outp = 'default' ; - end - - kk3 = randperm (length (types), 1) ; - - % try all matrix types, to test casting - for k3 = kk3 % 1:length (types) - atype = types {k3} ; - - % try some matrices - for m = [1 10] % Was [1 5 10 ] - for n = [1 10] % Was [ 1 5 10 ] - for sm = [0 1 5] % Was [ 0 1 5 10 ] - if (sm > m) - continue - end - for sn = [0 1 5] % Was [ 0 1 5 10 ] - if (sn > n) - continue - end - for scalar = [false true] - - %--------------------------------------- - - - if (sm == 0) - I = [ ] ; - am = m ; - else - I = randperm (m,sm) ; % I = I(1:sm); - am = sm ; - end - I0 = uint64 (I-1) ; - if (sn == 0) - J = [ ] ; - an = n ; - else - J = randperm (n,sn) ; % J = J(1:sn); - an = sn ; - end - J0 = uint64 (J-1) ; - - fprintf ('.') ; - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - for C_is_hyper = 0:1 - for C_is_csc = 0:1 - for M_is_hyper = 0:1 - for M_is_csc = 0:1 - - if (scalar) - % test scalar expansion - % fprintf ('test expansion\n') ; - A.matrix = sparse (rand (1)) * 100 ; - A.pattern = sparse (logical (true)); - A.class = atype ; - if (A_is_hyper || ~A_is_csc) - continue - end - else - A = GB_spec_random (am,an,0.2,100,atype, A_is_csc, A_is_hyper) ; - end - - C = GB_spec_random (m,n,0.2,100,atype, C_is_csc, C_is_hyper) ; - Mask = GB_random_mask (am,an,0.2, M_is_csc, M_is_hyper) ; - - % C(I,J) = accum (C (I,J),A) - % Mask = [ ] ; - - C0 = GB_spec_subassign (C, [ ], accum, A, I, J, dn, scalar); - C1 = GB_mex_subassign (C, [ ], accum, A, I0, J0, dn); - GB_spec_compare (C0, C1) ; - - % C(I,J) = accum (C (I,J),A) - C0 = GB_spec_subassign (C, Mask, accum, A, I, J, dn, scalar); - C1 = GB_mex_subassign (C, Mask, accum, A, I0, J0, dn); - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - - % C(I,J) = accum (C(I,J), A'); - % note transposing twice - clear AT - AT.matrix = A.matrix' ; - AT.pattern = A.pattern' ; - AT.class = A.class ; - - C0 = GB_spec_subassign (C, [ ], accum, AT, I, J, dt, scalar); - C1 = GB_mex_subassign (C, [ ], accum, AT, I0, J0, dt); - GB_spec_compare (C0, C1) ; - - C0 = GB_spec_subassign (C, Mask, accum, AT, I, J, dt, scalar); - C1 = GB_mex_subassign (C, Mask, accum, AT, I0, J0, dt); - GB_spec_compare (C0, C1) ; - - %--------------------------------------- -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end -end - -fprintf ('\ntest21: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test217.m b/GraphBLAS/Test/unused/test217.m deleted file mode 100644 index 1f92fc4eef..0000000000 --- a/GraphBLAS/Test/unused/test217.m +++ /dev/null @@ -1,38 +0,0 @@ -function test217 -%TEST217 test C(I,J)=A, bitmap assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -GB_mex_burble (1) ; - -n = 100 ; -Cin.matrix = sprand (n, n, 0.5) ; -Cin.class = 'double' ; -Cin.sparsity = 4 ; % C is bitmap - -m = 10 ; -I1 = randperm (n, 10) ; -J1 = randperm (n, 10) ; -I0 = uint64 (I1) - 1 ; -J0 = uint64 (J1) - 1 ; - -A.matrix = sprand (m, m, 0.5) ; -A.class = 'double' ; -A.sparsity = 4 ; % A is bitmap - -desc = struct ('outp', 'replace') ; -C1 = GB_mex_assign (Cin, [ ], [ ], A, I0, J0, desc) -C2 = GB_spec_assign (Cin, [ ], [ ], A, I1, J1, desc, false) ; -GB_spec_compare (C1, C2) ; - -desc = struct ('outp', 'replace', 'mask', 'complement') ; -C1 = GB_mex_assign (Cin, [ ], [ ], A, I0, J0, desc) -C2 = GB_spec_assign (Cin, [ ], [ ], A, I1, J1, desc, false) ; -GB_spec_compare (C1, C2) ; - -GB_mex_burble (0) ; -fprintf ('\ntest217: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test218.m b/GraphBLAS/Test/unused/test218.m deleted file mode 100644 index 7f62afc979..0000000000 --- a/GraphBLAS/Test/unused/test218.m +++ /dev/null @@ -1,32 +0,0 @@ -function test218 -%TEST218 test C=A+B, C and A are full, B is bitmap - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -GB_mex_burble (1) ; - -n = 10 ; - -A.matrix = sparse (rand (n,n)) ; -A.class = 'double' ; -A.sparsity = 8 ; - -B.matrix = sprand (n,n, 0.5) ; -B.class = 'double' ; -B.sparsity = 4 ; - -op.opname = 'plus' ; -op.optype = 'double' ; - -Cin = sparse (n,n) ; - -C1 = GB_mex_Matrix_eWiseAdd (Cin, [ ], [ ], op, A, B, [ ]) ; -C2 = A.matrix + B.matrix ; -assert (isequal (C1.matrix, C2)) ; - -GB_mex_burble (0) ; -fprintf ('\ntest218: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test22.m b/GraphBLAS/Test/unused/test22.m deleted file mode 100644 index f3602e68a1..0000000000 --- a/GraphBLAS/Test/unused/test22.m +++ /dev/null @@ -1,224 +0,0 @@ -function test22(fulltest) -%TEST22 test GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - % do a short test, by default - fulltest = 0 ; -end - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -if (fulltest) - fprintf ('\n==== exhaustive test for GB_mex_transpose:\n') ; - problems = [ - 10, 8, 40, -5, 100 - 10, 20, 100, -99, 200 - 100, 200, 1000, -99, 200 - 50, 50, 500, -2, 3 - ] ; -else - fprintf ('\n==== test GB_mex_transpose:\n') ; - problems = [ - 10, 8, 40, -5, 100 - ] ; -end - -% try several problems -for k0 = 1:size (problems,1) ; - - % create nnz triplets for a matrix of size nrows-by-nrows - nrows = problems (k0,1) ; - ncols = problems (k0,2) ; - nnz = problems (k0,3) ; - y1 = problems (k0,4) ; - y2 = problems (k0,5) ; - - % create A - rng ('default') ; - I = irand (0, nrows-1, nnz, 1) ; - J = irand (0, ncols-1, nnz, 1) ; - Y = y2 * rand (nnz, 1) + y1 ; - clear A - A.matrix = sparse (double (I)+1, double (J)+1, Y, nrows, ncols) ; - - % create Cin; note that it has the same dimensions as A, so if A - % gets transpose, Cin must also be transposed (so use Cin2 instead) - I = irand (0, nrows-1, nnz, 1) ; - J = irand (0, ncols-1, nnz, 1) ; - Y = y2 * rand (nnz, 1) + y1 ; - clear Cin - Cin.matrix = sparse (double (I)+1, double (J)+1, Y, nrows, ncols) ; - - clear Cin2 - Cin2.matrix = Cin.matrix' ; - - clear Cempty - Cempty.matrix = sparse (nrows, ncols) ; - Cempty2.matrix = Cempty.matrix' ; - - % create a boolean Mask with roughly the same density as A and Cin - Mask = cast (sprandn (nrows, ncols, nnz/(nrows*ncols)), 'logical') ; - - fprintf ('\nnrows: %d ncols %d nnz %d ymin %g ymax %g\n', ... - nrows, ncols, nnz, min (Y), max (Y)) ; - - % try every type for A - for k1 = 1:length (types) - atype = types {k1} ; - A.class = atype ; - Cempty.class = atype ; - Cempty2.class = atype ; - fprintf ('%s', atype) ; - - % C = A' - C = GB_mex_transpose (Cempty2, [ ], [ ], A, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cempty2, [ ], [ ], A, [ ]) ; - assert (isequal (C.class, A.class)) ; - assert (isequal (C.class, S.class)) ; - assert (isequal (full (double (C.matrix)), double (S.matrix))) ; - if (isequal (C.class, 'double')) - assert (isequal (C.matrix, A.matrix')) ; - end - - % C = A - clear desc - desc = struct ('inp0', 'tran') ; - C = GB_mex_transpose (Cempty, [ ], [ ], A, desc) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cempty, [ ], [ ], A, desc) ; - assert (isequal (C.class, A.class)) ; - assert (isequal (C.class, S.class)) ; - assert (isequal (full (double (C.matrix)), double (S.matrix))) ; - if (isequal (C.class, 'double')) - assert (isequal (C.matrix, A.matrix)) ; - end - - % C = A' - Cempty2.class = A.class ; - C = GB_mex_transpose (Cempty2, Mask', [ ], A, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cempty2, Mask', [ ], A, [ ]) ; - assert (isequal (C.class, A.class)) ; - assert (isequal (C.class, S.class)) ; - assert (isequal (full (double (C.matrix)), double (S.matrix))) ; - if (isequal (C.class, 'double')) - assert (isequal (C.matrix .* Mask', (A.matrix').*Mask')) ; - end - - % C = A - clear desc - desc = struct ('inp0', 'tran') ; - Cempty.class = A.class ; - C = GB_mex_transpose (Cempty, Mask, [ ], A, desc) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cempty, Mask, [ ], A, desc) ; - assert (isequal (C.class, A.class)) ; - assert (isequal (C.class, S.class)) ; - assert (isequal (full (double (C.matrix)), double (S.matrix))) ; - if (isequal (C.class, 'double')) - assert (isequal (C.matrix .* Mask, A.matrix .* Mask)) ; - end - - % try every class for Cin - for k2 = 1:length (types) - cinclass = types {k2} ; - fprintf ('.') ; - Cin2.class = cinclass ; - Cin.class = cinclass ; - - % try every operator - for k3 = 0:length (binops) - if (k3 == 0) - op = '' ; - ntypes = 1 ; - else - op = binops {k3} ; - ntypes = length (types) ; - end - - % try every operator class - for k4 = 1:ntypes - if (isempty (op)) - optype = '' ; - else - optype = types {k4} ; - end - - clear accum - accum.opname = op ; - accum.optype = optype ; - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - GB_spec_operator (accum) ; - catch - continue - end - - % C = op (Cin2,A') - C = GB_mex_transpose (Cin2, [ ], accum, A, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cin2, [ ], accum, A, [ ]) ; - assert (isequal (C.class, cinclass)) ; - assert (isequal (C.class, S.class)) ; - if (~(isequalwithequalnans (full (double (C.matrix)), ... - double (S.matrix)))) - assert (false) - end - - % C = op (Cin,A) - clear desc - desc = struct ('inp0', 'tran') ; - C = GB_mex_transpose (Cin, [ ], accum, A, desc) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cin, [ ], accum, A, desc) ; - assert (isequal (C.class, cinclass)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (full (double (C.matrix)), ... - double (S.matrix))) ; - - % try with a Mask (Mask must be sparse; logical and double) - for k5 = [1 11] - mask_class = types {k5} ; - M = cast (Mask, mask_class) ; - - % C = op (Cin2,A') - C = GB_mex_transpose (Cin2, M', accum, A, [ ]) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cin2, M', accum, A, [ ]) ; - assert (isequal (C.class, cinclass)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (... - full (double (C.matrix)), ... - double (S.matrix))) ; - - % C = op (Cin,A) - clear desc - desc = struct ('inp0', 'tran') ; - C = GB_mex_transpose (Cin, M, accum, A, desc) ; - assert (GB_spok (C.matrix*1) == 1) ; - S = GB_spec_transpose (Cin, M, accum, A, desc) ; - assert (isequal (C.class, cinclass)) ; - assert (isequal (C.class, S.class)) ; - assert (isequalwithequalnans (... - full (double (C.matrix)), ... - double (S.matrix))) ; - - end - end - end - end - end -end - -fprintf ('\ntest22: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test231.m b/GraphBLAS/Test/unused/test231.m deleted file mode 100644 index 18787d02e3..0000000000 --- a/GraphBLAS/Test/unused/test231.m +++ /dev/null @@ -1,97 +0,0 @@ -function test231 -%TEST231 test GrB_select with idxunp - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[~, ~, ~, types, ~, ~, idxunops] = GB_spec_opsall ; -ops = idxunops ; -types = types.all ; - -fprintf ('\n--- testing select with idxunops\n') ; -rng ('default') ; - -desc.inp0 = 'tran' ; - -n_operators = 0 ; -for k2 = 1:length(ops) - opname = ops {k2} ; - fprintf ('\n%-10s ', opname) ; - - for k1 = 1:length (types) - type = types {k1} ; - - % create the op - clear op - op.opname = opname ; - op.optype = type ; - - [is_idxunop, ztype] = GB_spec_is_idxunop (opname, type) ; - if (~is_idxunop) - continue ; - end - - n_operators = n_operators + 1 ; - - for m = [1 4] % [ 1 10 ]% 100] - for n = [1 4] % [1 10 ]% 100] - for hi = [1 5] % [-1:2:5 ] - for lo = [-1 0] % [-3:2:5 ] - Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - Cmat = sparse (m, n) ; - fprintf ('.') ; - - C.matrix = Cmat ; - C.class = ztype ; - - CT.matrix = Cmat' ; - CT.class = ztype ; - - A.matrix = Amat ; - A.class = type ; - - B.matrix = spones (Amat) ; - B.class = type ; - B.iso = true ; - - for ythunk = -3:3 - y.matrix = ythunk ; - y.class = type ; - - for how = 0:1 - for csc = 0:1 - - A.is_csc = csc ; - C.is_csc = csc ; - CT.is_csc = csc ; - - for sparsity = [1 2 4] - A.sparsity = sparsity ; - - C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, A, y, [ ]) ; - C2 = GB_spec_select_idxunop (C, [ ], [ ], op, A, y, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, B, y, [ ]) ; - C2 = GB_spec_select_idxunop (C, [ ], [ ], op, B, y, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_mex_select_idxunop (CT, [ ], [ ], op, how, A, y, desc) ; - C2 = GB_spec_select_idxunop (CT, [ ], [ ], op, A, y, desc) ; - GB_spec_compare (C1, C2) ; - - end - end - -end -end -end -end -end -end -end -end - -fprintf ('\nNumber of built-in GraphBLAS idxunops: %d\n', n_operators) ; -fprintf ('\ntest231: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test233.m b/GraphBLAS/Test/unused/test233.m deleted file mode 100644 index 48f45972aa..0000000000 --- a/GraphBLAS/Test/unused/test233.m +++ /dev/null @@ -1,37 +0,0 @@ -function test233 -%TEST233 test bitmap saxpy C=A*B with A sparse and B bitmap - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; -tol = 1e-12 ; - -for m = [1 10 100] - for n = [1 4 8 10 100] - for k = [1 10 100] - - A = GB_spec_random (m, k, 0.4) ; - B = GB_spec_random (k, n, 0.4) ; - C = GB_spec_random (m, n, 0) ; - - B.matrix = pi * spones (B.matrix) ; - B.iso = true ; - B.sparsity = 4 ; % bitmap - - A.sparsity = 2 ; % sparse - - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, [ ]) ; - C2 = GB_spec_mxm (C, [ ], [ ], semiring, A, B, [ ]) ; - - GB_spec_compare (C1, C2, 0, tol) ; - end - end -end - -fprintf ('\ntest233: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test234.m b/GraphBLAS/Test/unused/test234.m deleted file mode 100644 index e063693c60..0000000000 --- a/GraphBLAS/Test/unused/test234.m +++ /dev/null @@ -1,287 +0,0 @@ -function test234 -%TEST234 test GxB_eWiseUnion - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% derived from test127 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -fprintf ('test234 -----------tests of GxB_eWiseUnion (all ops)\n') ; - -m = 5 ; -n = 5 ; - -rng ('default') ; - -dnn = struct ; -dnn_notM = struct ('mask', 'complement') ; - -Amat2 = sparse (2 * sprand (m,n, 0.8)) ; -Bmat2 = sparse (2 * sprand (m,n, 0.8)) ; -Cmat2 = sparse (2 * sprand (m,n, 0.8)) ; -w2 = sparse (2 * sprand (m,1, 0.8)) ; -uvec2 = sparse (2 * sprand (m,1, 0.8)) ; -vvec2 = sparse (2 * sprand (m,1, 0.8)) ; - -Amat = sparse (100 * sprandn (m,n, 0.8)) ; -Bmat = sparse (100 * sprandn (m,n, 0.8)) ; -Cmat = sparse (100 * sprandn (m,n, 0.8)) ; -w = sparse (100 * sprandn (m,1, 0.8)) ; -uvec = sparse (100 * sprandn (m,1, 0.8)) ; -vvec = sparse (100 * sprandn (m,1, 0.8)) ; - -Maskmat = sprandn (m,n,0.9) ~= 0 ; -maskvec = sprandn (m,1,0.9) ~= 0 ; - -% create a very sparse matrix mask -Maskmat2 = sparse (m,n) ; -T = Amat .* Bmat ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -T = (Amat ~= 0) & (Bmat == 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -T = (Amat == 0) & (Bmat ~= 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; -end -clear T i j x - -% create a very sparse vector mask -maskvec2 = sparse (m,1) ; -T = uvec .* vvec ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -T = (uvec ~= 0) & (vvec == 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -T = (uvec == 0) & (vvec ~= 0) ; -[i j x] = find (T) ; -if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; -end -clear T i j x - -A_is_csc = 0 ; -B_is_csc = 0 ; -C_is_csc = 0 ; - -M_is_very_sparse = 0 ; -M_is_csc = 0 ; - -track_coverage = true ; -if (track_coverage) - global GraphBLAS_grbcov - track_coverage = ~isempty (GraphBLAS_grbcov) ; - clast = sum (GraphBLAS_grbcov > 0) ; - cfirst = clast ; -end - -for k1 = 1:length (types) - type = types {k1} ; - % fprintf ('\n\n%-8s : ', type) ; - - for k2 = 1:length(binops) - binop = binops {k2} ; - - op.opname = binop ; - op.optype = type ; - - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - try - GB_spec_operator (op) ; - catch - continue ; - end - - % fprintf (' %s', binop) ; - - for A_sparsity_control = 0:1 - for B_sparsity_control = 0:1 - for C_sparsity_control = 0:1 - - if (A_sparsity_control == 0) - A_is_hyper = 0 ; % not hyper - A_sparsity = 1 ; % sparse - else - A_is_hyper = 0 ; % not hyper - A_sparsity = 4 ; % bitmap - end - - if (B_sparsity_control == 0) - B_is_hyper = 0 ; % not hyper - B_sparsity = 1 ; % sparse - else - B_is_hyper = 0 ; % not hyper - B_sparsity = 4 ; % bitmap - end - - if (C_sparsity_control == 0) - C_is_hyper = 0 ; % not hyper - C_sparsity = 1 ; % sparse - else - C_is_hyper = 0 ; % not hyper - C_sparsity = 4 ; % bitmap - end - - clear A B C u v - - if (isequal (binop, 'pow')) - A.matrix = Amat2 ; - B.matrix = Bmat2 ; - C.matrix = Cmat2 ; - u.matrix = uvec2 ; - v.matrix = vvec2 ; - else - A.matrix = Amat ; - B.matrix = Bmat ; - C.matrix = Cmat ; - u.matrix = uvec ; - v.matrix = vvec ; - end - - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - A.sparsity = A_sparsity ; - A.class = op.optype ; - a0 = GB_mex_cast (1, op.optype) ; - - B.is_hyper = B_is_hyper ; - B.sparsity = B_sparsity ; - B.is_csc = B_is_csc ; - B.class = op.optype ; - b0 = GB_mex_cast (2, op.optype) ; - - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - C.sparsity = C_sparsity ; - - u.is_csc = true ; - u.class = op.optype ; - u0 = GB_mex_cast (1, op.optype) ; - - v.is_csc = true ; - v.class = op.optype ; - v0 = GB_mex_cast (2, op.optype) ; - - %--------------------------------------- - % A+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion (C, ... - [ ], [ ], op, A, a0, B, b0, dnn) ; - C1 = GB_mex_Matrix_eWiseUnion (C, ... - [ ], [ ], op, A, a0, B, b0, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion (w, ... - [ ], [ ], op, u, u0, v, v0, dnn) ; - w1 = GB_mex_Vector_eWiseUnion (w, ... - [ ], [ ], op, u, u0, v, v0, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %----------------------------------------------- - % with mask - %----------------------------------------------- - - for M_sparsity_control = 0:1 - - clear Mask mask - if (M_is_very_sparse) - Mask.matrix = Maskmat2 ; - mask.matrix = maskvec2 ; - else - Mask.matrix = Maskmat ; - mask.matrix = maskvec ; - end - - if (M_sparsity_control == 0) - M_is_hyper = 0 ; % not hyper - M_sparsity = 1 ; % sparse - else - M_is_hyper = 0 ; % not hyper - M_sparsity = 4 ; % bitmap - end - - Mask.is_hyper = M_is_hyper ; - Mask.sparsity = M_sparsity ; - Mask.is_csc = M_is_csc ; - mask.is_csc = true ; - - %--------------------------------------- - % A+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion (C, Mask, ... - [ ], op, A, a0, B, b0, dnn) ; - C1 = GB_mex_Matrix_eWiseUnion (C, Mask, ... - [ ], op, A, a0, B, b0, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion (w, mask, ... - [ ], op, u, u0, v, v0, dnn) ; - w1 = GB_mex_Vector_eWiseUnion (w, mask, ... - [ ], op, u, u0, v, v0, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A+B, with mask complemented - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion (C, Mask, ... - [ ], op, A, a0, B, b0, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseUnion (C, Mask, ... - [ ], op, A, a0, B, b0, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion (w, mask, ... - [ ], op, u, u0, v, v0, dnn_notM) ; - w1 = GB_mex_Vector_eWiseUnion (w, mask, ... - [ ], op, u, u0, v, v0, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; - - if (track_coverage) - c = sum (GraphBLAS_grbcov > 0) ; - d = c - clast ; - if (d > 0) - fprintf ('{''%s'',''%s'', %d,%d,%d,%d }, ... %% %d %d\n', ... - type, binop, ... - A_sparsity_control, ... - B_sparsity_control, ... - C_sparsity_control, ... - M_sparsity_control, d, c-cfirst) ; - end - clast = c ; - else - fprintf ('.') ; - end - - end - end - end - end - end -end - -fprintf ('\ntest234: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test234b.m b/GraphBLAS/Test/unused/test234b.m deleted file mode 100644 index 94fdea3ed0..0000000000 --- a/GraphBLAS/Test/unused/test234b.m +++ /dev/null @@ -1,11 +0,0 @@ -function test234b (tasks) -%TEST234B test GxB_eWiseUnion - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -test234 ({{'int8','iseq', 0,0,0,0 }}) ; - -fprintf ('\ntest234b: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test24.m b/GraphBLAS/Test/unused/test24.m deleted file mode 100644 index a7ac1fb89a..0000000000 --- a/GraphBLAS/Test/unused/test24.m +++ /dev/null @@ -1,179 +0,0 @@ -function test24(fulltest) -%TEST24 test GrB_reduce -% test24(fulltest); fulltest=1 if longer test, 0 for quick test - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -test_types = types.all ; -accum_ops = binops.all ; - -rng ('default') ; - -if (nargin < 1) - fulltest = 0 ; -end - -if (fulltest) - fprintf ('\ntest24: ----- exhaustive test of GrB_reduce_to_scalar and vector\n') ; - cset = 1:length (test_types) ; - aset = 1:length (test_types) ; -else - fprintf ('\ntest24: ----- quick test of GrB_reduce_to_scalar and vector\n'); - cset = 10 ; - aset = 11 ; -end - -dt = struct ('inp0', 'tran') ; - -% class of the vector x -for k1 = cset - cclass = test_types {k1} ; - cin = GB_mex_cast (2, cclass) ; - % fprintf ('\n=================================== c class: %s\n',cclass) ; - - % class of the matrix A - for k2 = aset - aclass = test_types {k2} ; - % fprintf ('\n==================================A class: %s\n',aclass) ; - fprintf ('[%s %s]', cclass, aclass) ; - - % create a matrix - for m = [1 10 25] - for n = [1 10 25] - fprintf ('.') ; - clear A - A.matrix = sprandn (m, n, 0.1) ; - A.class = aclass ; - - clear B - B.matrix = sprandn (m*n, 1, 0.1) ; - B.class = aclass ; - - clear xin - xin.matrix = sprandn (m, 1, 0.1) ; - xin.class = cclass ; - - clear yin - yin.matrix = sprandn (n, 1, 0.1) ; - yin.class = cclass ; - - % reduce operator - for k3 = 1:length(add_ops) - if (k3 == 0) - reduce_op = '' ; - ntypes = 1 ; - else - reduce_op = add_ops {k3} ; - ntypes = 1;length (test_types) ; - end - % fprintf ('reduce: %s\n', reduce_op) ; - % reduce operator class - - for k4 = ntypes - clear reduce - if (~isempty (reduce_op)) - reduce_class = test_types {k4} ; - reduce.opname = reduce_op ; - reduce.optype = reduce_class ; - else - reduce = '' ; - reduce_class = '' ; - end - - try - [opname optype ztype xtype ytype] = ... - GB_spec_operator (reduce) ; - catch - continue - end - - if (~isequal (reduce_class, 'logical') && ... - ( isequal (reduce_op, 'or') || ... - isequal (reduce_op, 'and') || ... - isequal (reduce_op, 'xor') || ... - isequal (reduce_op, 'eq'))) - continue ; - end - - identity = GB_spec_identity (reduce) ; - - % accum operator - for k5 = 0:length(accum_ops) - if (k5 == 0) - accum_op = '' ; - ntypes = 1 ; - else - accum_op = accum_ops {k5} ; - ntypes = 1;length (test_types) ; - end - % accum operator class - for k6 = ntypes - clear accum - if (~isempty (accum_op)) - accum_class = test_types {k6} ; - accum.opname = accum_op ; - accum.optype = accum_class ; - else - accum = '' ; - accum_class = '' ; - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - [opname optype ztype xtype ytype] = GB_spec_operator (accum) ; - catch - continue - end - - % reduce matrix to scalar - c = GB_mex_reduce_to_scalar (cin, accum, reduce, A) ; - c3 = GB_spec_reduce_to_scalar (cin, accum, reduce, A) ; - assert (isequal (c, c3)) - - % reduce vector to scalar - c = GB_mex_reduce_to_scalar (cin, accum, reduce, B) ; - c3 = GB_spec_reduce_to_scalar (cin, accum, reduce, B) ; - assert (isequal (c, c3)) - - % row-wise reduce matrix to vector - - % no mask - x = GB_mex_reduce_to_vector (xin, [ ], accum, reduce, A, [ ]) ; - x3 = GB_spec_reduce_to_vector (xin, [ ], accum, reduce, A, [ ]) ; - GB_spec_compare (x, x3, identity) ; - - % with mask - mask = sprandn (m,1,0.3) ~= 0 ; - x = GB_mex_reduce_to_vector (xin, mask, accum, reduce, A, [ ]) ; - x3 = GB_spec_reduce_to_vector (xin, mask, accum, reduce, A, [ ]) ; - GB_spec_compare (x, x3, identity) ; - - % col-wise reduce matrix to vector - - % no mask - y = GB_mex_reduce_to_vector (yin, [ ], accum, reduce, A, dt) ; - y3 = GB_spec_reduce_to_vector (yin, [ ], accum, reduce, A, dt) ; - GB_spec_compare (y, y3, identity) ; - - % with mask - mask = sprandn (n,1,0.3) ~= 0 ; - y = GB_mex_reduce_to_vector (yin, mask, accum, reduce, A, dt) ; - y3 = GB_spec_reduce_to_vector (yin, mask, accum, reduce, A, dt) ; - GB_spec_compare (y, y3, identity) ; - - end - end - end - end - end - end - end -end - -fprintf ('\ntest24: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test248.m b/GraphBLAS/Test/unused/test248.m deleted file mode 100644 index c2569ff479..0000000000 --- a/GraphBLAS/Test/unused/test248.m +++ /dev/null @@ -1,66 +0,0 @@ -function test248 -%TEST248 count the number of valid built-in semirings -% This does not count all possible semirings that could be constructed from -% all built-in types and operators. Just those that are in GraphBLAS.h, -% or equivalent to those in that list. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -mult_ops = binops.all ; -types = types.all ; - -n_semirings = 0 ; - -for k1 = 1:length(mult_ops) - mulop = mult_ops {k1} ; -% fprintf ('\n%-10s ', mulop) ; - nmult_semirings = 0 ; - - for k2 = 1:length(add_ops) - addop = add_ops {k2} ; -% fprintf ('.') ; - - for k3 = 1:length (types) - type = types {k3} ; - -% fprintf ('\n---------- try this: %s.%s.%s\n', addop, mulop, type) ; - semiring.add = addop ; - semiring.multiply = mulop ; - semiring.class = type ; - - % create the semiring. some are not valid because the - % or,and,xor monoids can only be used when z is boolean for - % z=mult(x,y). - - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype xtype ytype] = ... - GB_spec_operator (mult_op) ; - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add, add_optype) ; - catch me - continue - end - - n_semirings = n_semirings + 1 ; - nmult_semirings = nmult_semirings + 1 ; - - % This produces a superset of the list of all files in - % Source/FactoryKernels, if the operators and are renamed ("xor" - % becomes "lxor", "logical" becomes "bool", etc). Some semirings - % have different names but are handled by boolean renaming. Other - % semirings appear here, and in GraphBLAS.h, but do not have any - % kernel in FactoryKernels (GxB_TIMES_LOR_FP64 for example). -% semiring -% fprintf ('GB_AxB__%s_%s_%s.c\n', add_opname, mult_opname, xtype) ; - end - end - -% fprintf (' %d', nmult_semirings) ; - -end - -fprintf ('\nTotal: %d semirings\n', n_semirings) ; - diff --git a/GraphBLAS/Test/unused/test25.m b/GraphBLAS/Test/unused/test25.m deleted file mode 100644 index d15007934a..0000000000 --- a/GraphBLAS/Test/unused/test25.m +++ /dev/null @@ -1,117 +0,0 @@ -function test25 -%TEST25 test GxB_select - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest25: GxB_select tests\n') ; - -[~, ~, ~, types, ~, select_ops] = GB_spec_opsall ; -types = types.all ; - -rng ('default') ; - -m = 10 ; -n = 6 ; -dt = struct ('inp0', 'tran') ; - -for k1 = 1:length(types) - atype = types {k1} ; - fprintf ('%s: ', atype) ; - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - for C_is_hyper = 0:1 - for C_is_csc = 0:1 - for M_is_hyper = 0:1 - for M_is_csc = 0:1 - - if (A_is_hyper) - ha = 1 ; - else - ha = 0 ; - end - - if (C_is_hyper) - hc = 1 ; - else - hc = 0 ; - end - - if (M_is_hyper) - hm = 1 ; - else - hm = 0 ; - end - - A = GB_spec_random (m, n, 0.3, 100, atype, A_is_csc, A_is_hyper, ha) ; - A.matrix (:,1) = rand (m,1) ; - A.pattern (:,1) = true (m,1) ; - Cin = GB_spec_random (m, n, 0.3, 100, atype, C_is_csc, C_is_hyper, hc) ; - B = GB_spec_random (n, m, 0.3, 100, atype, A_is_csc, A_is_hyper, ha) ; - cin = GB_mex_cast (0, atype) ; - % Mask = (sprand (m, n, 0.5) ~= 0) ; - Mask = GB_random_mask (m, n, 0.5, M_is_csc, M_is_hyper) ; - Mask.hyper_switch = hm ; - - fprintf ('.') ; - - for k2 = 1:length(select_ops) - op = select_ops {k2} ; - % fprintf ('%s ', op) ; - - for k = -m:3:n % Was: [-m:n] - - % no mask - C1 = GB_spec_select (Cin, [], [], op, A, k, []) ; - C2 = GB_mex_select (Cin, [], [], op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % no mask, with accum - C1 = GB_spec_select (Cin, [], 'plus', op, A, k, []) ; - C2 = GB_mex_select (Cin, [], 'plus', op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask - C1 = GB_spec_select (Cin, Mask, [], op, A, k, []) ; - C2 = GB_mex_select (Cin, Mask, [], op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask and accum - C1 = GB_spec_select (Cin, Mask, 'plus', op, A, k, []) ; - C2 = GB_mex_select (Cin, Mask, 'plus', op, A, k, [], 'test') ; - GB_spec_compare (C1, C2) ; - - % no mask, transpose - C1 = GB_spec_select (Cin, [], [], op, B, k, dt) ; - C2 = GB_mex_select (Cin, [], [], op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - % no mask, with accum, transpose - C1 = GB_spec_select (Cin, [], 'plus', op, B, k, dt) ; - C2 = GB_mex_select (Cin, [], 'plus', op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask, transpose - C1 = GB_spec_select (Cin, Mask, [], op, B, k, dt) ; - C2 = GB_mex_select (Cin, Mask, [], op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - % with mask and accum, transpose - C1 = GB_spec_select (Cin, Mask, 'plus', op, B, k, dt) ; - C2 = GB_mex_select (Cin, Mask, 'plus', op, B, k, dt, 'test') ; - GB_spec_compare (C1, C2) ; - - end - end - end - end - end - end - end - end - fprintf ('\n') ; -end -fprintf ('\ntest25: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test251.m b/GraphBLAS/Test/unused/test251.m deleted file mode 100644 index d22753085a..0000000000 --- a/GraphBLAS/Test/unused/test251.m +++ /dev/null @@ -1,97 +0,0 @@ -function test251 -%TEST251 test dot4 for plus-pair semirings -% GB_AxB_dot4 computes C+=A'*B when C is dense. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test251 ------------ C+=A''*B when C is dense (plus-pair)\n') ; - -rng ('default') ; -GB_mex_burble (0) ; - -plus_pair.add = 'plus' ; -plus_pair.multiply = 'oneb' ; % same as pair -[~, ~, ~, types, ~, ~, ~,] = GB_spec_opsall ; -types = types.all ; - -add_op.opname = 'plus' ; -dtn_dot = struct ('axb', 'dot', 'inp0', 'tran') ; -dtn_sax = struct ('axb', 'saxpy', 'inp0', 'tran') ; - -n = 20 ; -C = GB_spec_random (n, n, inf, 100, 'double') ; -C.sparsity = 8 ; -C0.matrix = sparse (n, n) ; - -for A_sparsity = [1 2 4 8] - if (A_sparsity == 8) - A = GB_spec_random (n, n, inf, 100, 'double') ; - else - A = GB_spec_random (n, n, 0.1, 100, 'double') ; - end - A.sparsity = A_sparsity ; - - for B_sparsity = [1 2 4 8] - if (B_sparsity == 8) - B = GB_spec_random (n, n, inf, 100, 'double') ; - else - B = GB_spec_random (n, n, 0.1, 100, 'double') ; - end - B.sparsity = B_sparsity ; - - for k = 0:length(types) - if (k == 0) - type = 'logical' ; - add_op.opname = 'xor' ; - plus_pair.add = 'xor' ; - else - type = types {k} ; - add_op.opname = 'plus' ; - plus_pair.add = 'plus' ; - end - plus_pair.class = type ; - add_op.optype = type ; - if (test_contains (type, 'single')) - tol = 1e-5 ; - else - tol = 1e-10 ; - end - fprintf ('.') ; - - for k2 = 1 % 1:2 - if (k2 == 1) - A.class = type ; - B.class = type ; - C0.class = type ; - C.class = type ; - else - A.class = 'double' ; - B.class = 'double' ; - C0.class = 'double' ; - C.class = 'double' ; - end - - % X = C + A'*B using dot4 - X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - GB_spec_compare (X1, X2, 0, tol) ; - - % X = A'*B using dot2/dot3 - X2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - X1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - GB_spec_compare (X1, X2, 0, tol) ; - - % X = C + A'*B using saxpy - X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; - X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; - GB_spec_compare (X1, X2) ; - end - end - end -end - -fprintf ('\n') ; -GB_mex_burble (0) ; -fprintf ('test251: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test26.m b/GraphBLAS/Test/unused/test26.m deleted file mode 100644 index c1c6236210..0000000000 --- a/GraphBLAS/Test/unused/test26.m +++ /dev/null @@ -1,146 +0,0 @@ -function test26(longtests) -%TEST26 performance test for GxB_select - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest26 ------------------------------performance of GxB_select\n') ; - -[save_nthreads save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -[~, ~, ~, ~, ~, select_ops] = GB_spec_opsall ; - -if (nargin < 1) - longtests = 0 ; -end - -if (longtests) - % ssget will be used - nprobs = 5 ; -else - nprobs = 3 ; -end - -rng ('default') ; - -dt = struct ('inp0', 'tran') ; - -for probs = 1:nprobs - - switch probs - case 1 - A = sparse (200, 1, 0.1) ; - case 2 - A = sparse (200, 100, 0.1) ; - case 3 - A1 = spones (sprand (10, 10, 0.5)) ; - A2 = spones (sprand (10, 10, 0.5)) ; - A3 = sparse (10,10) ; - A4 = GB_mex_Matrix_eWiseAdd (A3, [], [], 'minus', A1, A2, [ ]) ; - A = A4.matrix ; - % GB_spok(A) will fail since it has intentional explicit zeros - case 4 - A = sparse (rand (6000)) ; - case 5 - Prob = ssget (2662) ; - A = Prob.A ; - end - - [m n] = size (A) ; - fprintf ('\nProblem: m %d n %d nnz %d\n', m, n, nnz (A)) ; - Cin = sparse (m,n) ; - - for k2 = 1:length(select_ops) - op = select_ops {k2} ; - fprintf ('%s:\n', op) ; - - for k = [-m -floor(m/2) -50 -1 0 1 50 floor(n/2) n] - - fprintf ('k: %10d ', k) ; - - tic - C1 = GB_mex_select (Cin, [], [], op, A, k, []) ; - t1 = toc ; - fprintf ('GB: %10.6f ', t1) ; - - C3 = 'none' ; - C2 = 'none' ; - - switch (op) - case 'tril' - tic - C2 = tril (A,k) ; - t2 = toc ; - tic - C3 = GB_mex_tril (A, k) ; - t3 = toc ; - case 'triu' - tic - C2 = triu (A,k) ; - t2 = toc ; - tic - C3 = GB_mex_triu (A, k) ; - t3 = toc ; - case 'diag' - if (size (A,2) > 1) - tic - C2 = spdiags (spdiags (A,k), k, m, n) ; - t2 = toc ; - end - tic - C3 = GB_mex_diag (A, k) ; - t3 = toc ; - case 'offdiag' - if (size (A,2) > 1) - tic - C2 = A - spdiags (spdiags (A,k), k, m, n) ; - t2 = toc ; - end - tic - C3 = GB_mex_offdiag (A, k) ; - t3 = toc ; - case 'nonzero' - tic - C2 = A .* (A ~= 0) ; - t2 = toc ; - assert (isequal (1*C2,1*A)) ; - tic - C3 = GB_mex_nonzero (A) ; - t3 = toc ; - assert (isequal (1*C3,1*A)) ; - end - - if (~ischar (C3)) - fprintf (' %10.6f ', t3) ; - assert (isequal (C3, C1.matrix)) - end - - if (~ischar (C2)) - fprintf ('builtin: %10.6f ', t2) ; - fprintf ('nnz: %10d speedup %5.2f ', nnz (C2), t2/t1) ; - - if (~ischar (C3)) - fprintf (' %5.2f ', t2/t3) ; - end - assert (isequal (1*C1.matrix, 1*C2)) - end - fprintf ('\n') ; - - end - end -end - -ok = true ; -A = sparse (ones (4)) ; -try - C = GB_mex_select (A, [ ], [ ], 'tril', A, A, [ ]) ; - ok = false ; -catch me - fprintf ('\nexpected error: %s\n', me.message) ; -end - -nthreads_set (save_nthreads, save_chunk) ; -fprintf ('test26: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test266.m b/GraphBLAS/Test/unused/test266.m deleted file mode 100644 index c4abe5b528..0000000000 --- a/GraphBLAS/Test/unused/test266.m +++ /dev/null @@ -1,10 +0,0 @@ -function test266 -%TEST266 test JIT error handling - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -GB_mex_test23 ; -fprintf ('test266: all tests passed.\n') ; - - diff --git a/GraphBLAS/Test/unused/test27.m b/GraphBLAS/Test/unused/test27.m deleted file mode 100644 index 1523e0432f..0000000000 --- a/GraphBLAS/Test/unused/test27.m +++ /dev/null @@ -1,30 +0,0 @@ -function test27 -%TEST27 test GxB_select with user-defined select op (LoHi_band) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test 27: GxB_select with user-defined op (LoHi_band)\n') ; - -for m = 1:10 - for n = 1:10 - fprintf ('.') ; - A = sprand (m, n, 0.1) ; - for lo = -12:12 - for hi = -12:12 - - C1 = GB_mex_band (A, lo, hi, 0) ; - C2 = triu (tril (A,hi), lo) ; - assert (isequal (C1, C2)) ; - - C1 = GB_mex_band (A, lo, hi, 1) ; - C2 = triu (tril (A',hi), lo) ; - assert (isequal (C1, C2)) ; - - end - end - end -end - -fprintf ('\ntest27: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test28.m b/GraphBLAS/Test/unused/test28.m deleted file mode 100644 index 721e1933d5..0000000000 --- a/GraphBLAS/Test/unused/test28.m +++ /dev/null @@ -1,27 +0,0 @@ -function test28 -%TEST28 test mxm with aliased inputs, C = accum(C,C*C) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -seed = 1 ; -for n = [1 5 10 100] - - for trial = 1:30 - - C = GB_mex_random (n, n, 10*n, 0, seed) ; seed = seed + 1 ; - - C1 = GB_mex_mxm_alias (C, 'plus', semiring, [ ]) ; - C2 = GB_mex_mxm (C, C, 'plus', semiring, C, C, [ ]) ; - assert (norm (C1.matrix - C2.matrix, 1) < 1e-12) ; - end -end - -fprintf ('test28: mxm alias tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test30.m b/GraphBLAS/Test/unused/test30.m deleted file mode 100644 index da0ed4f84d..0000000000 --- a/GraphBLAS/Test/unused/test30.m +++ /dev/null @@ -1,42 +0,0 @@ -function test30 -%TEST30 test GxB_subassign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - - [save save_chunk] = nthreads_get ; - chunk = 4096 ; - nthreads = feature_numcores ; - nthreads_set (nthreads, chunk) ; - - Prob = ssget (2662) ; - A = Prob.A ; - - [m n] = size (A) ; - - ni = 500 ; - nj = 1000 ; - I = randperm (m,ni) ; - J = randperm (n,nj) ; - I0 = uint64 (I-1) ; - J0 = uint64 (J-1) ; - - scalar = sparse (pi) ; - - fprintf ('start GraphBLAS:\n') ; - - tic - C2 = GB_mex_subassign (A, [], [], scalar, I0, J0, []) ; - t = toc ; - - C = A ; - fprintf ('start builtin:\n') ; - tic - C (I,J) = scalar ; - tm = toc - - fprintf ('GraphBLAS speedup over builtin: %g\n', tm/t) ; - - assert (isequal (C, C2.matrix)) ; - fprintf ('\ntest30: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test30b.m b/GraphBLAS/Test/unused/test30b.m deleted file mode 100644 index 44d7ea90af..0000000000 --- a/GraphBLAS/Test/unused/test30b.m +++ /dev/null @@ -1,46 +0,0 @@ -function test30b -%TEST30B performance test GB_mex_assign, scalar expansion - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[save_nthreads save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -Prob = ssget (2662) ; -A = Prob.A ; - -[m n] = size (A) ; - -ni = 500 ; -nj = 1000 ; -I = randperm (m,ni) ; -J = randperm (n,nj) ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; - -scalar = sparse (pi) ; - -% tic/toc includes the mexFunction overhead of making a deep copy -% of the input matrix. - -fprintf ('start GraphBLAS:\n') ; -tic -C2 = GB_mex_assign (A, [], [], scalar, I0, J0, []) ; -t = toc ; - -C = A ; -fprintf ('start built-in method:\n') ; -tic -C (I,J) = scalar ; -tm = toc - -fprintf ('GraphBLAS speedup over built-in method: %g\n', tm/t) ; - -assert (isequal (C, C2.matrix)) ; -fprintf ('\ntest30b: all tests passed\n') ; - -nthreads_set (save_nthreads, save_chunk) ; - diff --git a/GraphBLAS/Test/unused/test31.m b/GraphBLAS/Test/unused/test31.m deleted file mode 100644 index d6af6eccd6..0000000000 --- a/GraphBLAS/Test/unused/test31.m +++ /dev/null @@ -1,93 +0,0 @@ -function test31 -%TEST31 test GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n------------------- simple tests of GB_mex_transpose\n') ; - -rng ('default') ; -A = sprand (4, 3, 0.4) ; -% full (A) -% full (A') -C = GB_mex_transpose (sparse (3,4), [ ], [ ], A) ; -assert (GB_spok (C.matrix) == 1) ; -assert (isequal (C.matrix,A')) ; - -% C = A -D = struct ('inp0', 'tran') ; -C = GB_mex_transpose (sparse(4,3), [ ], [ ], A, D) ; -assert (isequal (C.matrix,A)) ; - -% C = A' -C = GB_mex_transpose (sparse(3,4), [ ], [ ], A) ; -assert (isequal (C.matrix,A')) ; - -Cin = sprand (4, 3, 0.5) ; -Cin2 = Cin' ; - -% C = A' -C = GB_mex_transpose (Cin2, [ ], [ ], A) ; -assert (isequal (C.matrix,A')) ; - -% C = Cin2+A' -C = GB_mex_transpose (Cin2, [ ], 'plus', A) ; -assert (isequal (C.matrix,Cin2+A')) ; - -% C = Cin+A -D = struct ('inp0', 'tran') ; -C = GB_mex_transpose (Cin, [ ], 'plus', A, D) ; -assert (isequal (C.matrix,Cin+A)) ; - -ops = { - 'first', - 'second', - 'pair', - 'oneb', % same as pair - 'min', - 'max', - 'plus', - 'minus', - 'times', - 'div', } ; - -for k = 1:length(ops) - op = ops {k} ; - - % C = op (Cin2,A') - D = struct ; - C = GB_mex_transpose (Cin2, [ ], op, A, D) ; - S = GB_spec_transpose (Cin2, [ ], op, A, D) ; - assert (isequal (C.matrix, sparse (S.matrix))) ; - assert (isequal (GB_spones_mex (C.matrix), sparse (S.pattern))) ; - - % C = A', ignore the op - D = struct ('outp', 'replace') ; - C = GB_mex_transpose (Cin2, [ ], op, A, D) ; - S = GB_spec_transpose (Cin2, [ ], op, A, D) ; - assert (isequal (GB_spones_mex (C.matrix), sparse (S.pattern))) ; - - % C = A, ignore the op - D = struct ('inp0', 'tran', 'outp', 'replace') ; - C = GB_mex_transpose (Cin, [ ], op, A, D) ; - S = GB_spec_transpose (Cin, [ ], op, A, D) ; - assert (isequal (GB_spones_mex (C.matrix), sparse (S.pattern))) ; - - % C = op (Cin,A) - D = struct ('inp0', 'tran') ; - C = GB_mex_transpose (Cin, [ ], op, A, D) ; - S = GB_spec_transpose (Cin, [ ], op, A, D) ; - assert (isequal (GB_spones_mex (C.matrix), sparse (S.pattern))) ; - -end - -%{ -A = sprand (20, 16, 0.45) -C = GB_mex_transpose (A) - -A = sparse (rand (40,10)) ; -C = GB_mex_transpose (A) -%} - -fprintf ('\ntest31: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test32.m b/GraphBLAS/Test/unused/test32.m deleted file mode 100644 index 52f988160f..0000000000 --- a/GraphBLAS/Test/unused/test32.m +++ /dev/null @@ -1,31 +0,0 @@ -function test32 -%TEST32 test GrB_mxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----- quick test for GB_mex_mxm\n') ; - -A = sparse (rand (4,3)) ; -B = sparse (rand (3,5)) ; -Cin = sparse (rand (4,5)) ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; -accum = 'plus' ; -Mask = [ ] ; -accum = 'plus' ; - -% GB_mex_semiring (semiring) - -C0 = Cin + A*B ; - -C = GB_mex_mxm (Cin, Mask, accum, semiring, A, B, [ ]) ; -assert (isequal (C.matrix, C0)) - -C3 = GB_spec_mxm (Cin, Mask, accum, semiring, A, B, [ ]) ; -assert (isequal (C3.matrix, C0)) - -fprintf ('\ntest32: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test33.m b/GraphBLAS/Test/unused/test33.m deleted file mode 100644 index f508983c47..0000000000 --- a/GraphBLAS/Test/unused/test33.m +++ /dev/null @@ -1,15 +0,0 @@ -function test33 -%TEST33 test a semiring - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -semiring = struct ( ... - 'multiply', 'times', ... - 'add', 'plus', ... - 'class', 'double' ) - -GB_mex_semiring (semiring) - -fprintf ('\ntest33: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test34.m b/GraphBLAS/Test/unused/test34.m deleted file mode 100644 index ee588876e2..0000000000 --- a/GraphBLAS/Test/unused/test34.m +++ /dev/null @@ -1,36 +0,0 @@ -function test34 -%TEST34 test GrB_eWiseAdd - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----- quick test for GB_mex_Matrix_eWiseAdd\n') ; - -A = sparse (rand (4,3)) ; -B = sparse (rand (4,3)) ; -Cin = sparse (rand (4,3)) ; - -add = 'plus' ; -Mask = [ ] ; -accum = 'plus' ; - -C0 = Cin + (A+B) ; - -C = GB_mex_Matrix_eWiseAdd (Cin, Mask, accum, add, A, B, [ ]) ; -assert (isequal (C.matrix, C0)) - -C3 = GB_spec_Matrix_eWiseAdd (Cin, Mask, accum, add, A, B, [ ]) ; -assert (isequal (C3.matrix, C0)) - -try - % compare with CSparse - C4 = cs_add (Cin, cs_add (A, B)) ; - ok = isequal (C4, C0) ; -catch - % CSparse not available - ok = true ; -end -assert (ok) ; - -fprintf ('\ntest34: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test35.m b/GraphBLAS/Test/unused/test35.m deleted file mode 100644 index 947fbaa5f4..0000000000 --- a/GraphBLAS/Test/unused/test35.m +++ /dev/null @@ -1,59 +0,0 @@ -function test35 -%TEST35 test GrB_*_extractTuples - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n test35 ---------------------- quick test of GrB_extractTuples\n') ; - -Prob = ssget ('HB/west0067') ; -A = Prob.A ; -[I1, J1, X1] = find (A) ; -[I2, J2, X2] = GB_mex_extractTuples (A) ; -assert (isequal (I1, double (I2+1))) -assert (isequal (J1, double (J2+1))) -assert (isequal (X1, X2)) - -Prob = ssget (2662) ; -A = Prob.A ; - -% add some dense columns -n = size (A,2) ; -J = randperm (n, 20) ; -A (:,J) = 77 ; - -% warmup -[I1, J1, X1] = find (A) ; -tic -[I1, J1, X1] = find (A) ; -tm = toc ; -fprintf ('built-in [i,j,x]=find(A) time: %g\n', tm) ; - -nthreads_max = 2*GB_mex_omp_max_threads ; -save = nthreads_get ; - -t1 = 0 ; -for nthreads = [1 2 4 8 16 20 32 40 64 128 260 256] - if (nthreads > nthreads_max) - break ; - end - nthreads_set (nthreads) ; - % warmup - [I2, J2, X2] = GB_mex_extractTuples (A) ; - % for timing - tic - [I2, J2, X2] = GB_mex_extractTuples (A) ; - t = toc ; - if (nthreads == 1) - t1 = t ; - end - fprintf ('nthreads %3d speedup vs built-in: %10.4f vs GrB: %10.4f\n', ... - nthreads, tm/t, t1/t) ; - assert (isequal (I1, double (I2+1))) - assert (isequal (J1, double (J2+1))) - assert (isequal (X1, X2)) -end - -nthreads_set (save) ; -fprintf ('\ntest35: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test36.m b/GraphBLAS/Test/unused/test36.m deleted file mode 100644 index 7bf912152c..0000000000 --- a/GraphBLAS/Test/unused/test36.m +++ /dev/null @@ -1,113 +0,0 @@ -function test36 -%TEST36 performance test of matrix subref - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest36 --------------------- performance of GB_Matrix_subref\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; -n = 100e6 ; -fprintf ('-------------------------- column vector (%d-by-1):\n', n) ; -V = sprand (n, 1, 0.01) ; -J = uint64 (0) ; -[i j x] = find (V) ; -nz = length (i) ; - - -fprintf (' V(:,1): nnz (V) = %d\n', nnz (V)) ; - tic - C0 = V (:,1) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, [ ], [ ]) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - -fprintf (' V(50e6:80e6,1) explicit list:\n') ; -I = uint64 (50e6:80e6) ; -I1 = I+1 ; - tic - C0 = V (I1,1) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, I, [ ]) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - -fprintf (' V(50e6:80e6,1) colon:\n') ; -clear I -I.begin = 50e6-1 ; I.inc = 1 ; I.end = 80e6-1 ; -% I1 = I+1 ; - tic - C0 = V (50e6:80e6,1) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, I, [ ]) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - -I1 = i (floor (nz/2)) ; -I = uint64 (I1)-1 ; -fprintf (' V(%d,1):\n', I1) ; - - C0 = V (I1,1) ; - tic - C0 = V (I1,1) ; - t0 = toc ; - C1 = GB_mex_Matrix_subref (V, I, J) ; - tic - C1 = GB_mex_Matrix_subref (V, I, J) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - - tic - C0 = V (I1,1) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, I, J) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - - -fprintf (' V( 100 entries ,1):\n') ; -p = randperm (nz) ; -I1 = i (p (1:100)) ; -I = uint64 (I1)-1 ; - - tic - C0 = V (I1,1) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, I, [ ] ) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - - -fprintf (' V( 100 entries ,1:4):\n') ; -V = [V V V V] ; - - tic - C0 = V (I1,:) ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_subref (V, I, [ ]) ; - t1 = toc ; - assert (isequal (C0, C1)) ; - fprintf ('builtin %0.6f GrB: %0.6f speedup %g\n', t0, t1, t0/t1) ; - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest36: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test38.m b/GraphBLAS/Test/unused/test38.m deleted file mode 100644 index 3e2bacb68d..0000000000 --- a/GraphBLAS/Test/unused/test38.m +++ /dev/null @@ -1,35 +0,0 @@ -function test38 -%TEST38 test GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n ----------- testing GB_mex_transpose on SuiteSparse matrices\n') ; - -% test GB_mex_transpose on lots of matrices from the -% SuiteSparse matrix collection - -index = ssget ; -[~, f] = sort (index.nnz) ; -nmat = length (f) ; - -for k = 1:500 - fprintf ('.') ; - id = f (k) ; - Prob = ssget (id) ; - A = Prob.A ; - if (~isreal (A)) - A = real (A) ; - end - [m n] = size (A) ; - % tic - C = A' ; - % toc - % tic - S = GB_mex_transpose (sparse (n,m), [ ], [ ], A) ; - % toc - assert (isequal (C,S.matrix)) ; -end - -fprintf ('\ntest38: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test39.m b/GraphBLAS/Test/unused/test39.m deleted file mode 100644 index 352cc32d32..0000000000 --- a/GraphBLAS/Test/unused/test39.m +++ /dev/null @@ -1,225 +0,0 @@ -function test39(use_ssget) -%TEST39 performance test for GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest39 performance tests : GrB_transpose \n') ; - -if (nargin < 1) - use_ssget = true ; -end - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; - -if (use_ssget) - try - Prob = ssget (939) - A = Prob.A ; - catch - use_ssget = false ; - end -end - -if (~use_ssget) - fprintf ('not using ssget\n') ; - n = 72000 ; - nz = 29e6 ; - A = sprandn (n, n, nz/n^2) ; -end - -[m n] = size (A) ; -Cin = sprandn (n, m, 0.000001) ; -A (1,2) =1 ; -Empty = sparse (n, m) ; - -fprintf ('\n===============================================================n') ; -fprintf ('\nC = A''\n') ; -tic -C1 = A' ; -toc -tm = toc ; - -fprintf ('GraphBLAS, transpose :\n') ; -tic -C = GB_mex_transpose (Empty, [ ], [ ], A) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -assert (isequal (C1, C.matrix)) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; - -fprintf ('\n===============================================================n') ; -fprintf ('\nGraphBLAS: C = (single) A'' compared with C=A'' in built-in\n') ; -clear Empty_struct -Empty_struct.matrix = sparse (n, m) ; -Empty_struct.class = 'single' ; - -tic -C1 = A' ; -toc -tm = toc ; - -fprintf ('GraphBLAS, transpose:\n') ; -% C = A' -tic -C2 = GB_mex_transpose (Empty_struct, [ ], '', A) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; - -[I1, J1, X1] = find (C1) ; -[I2, J2, X2] = find (C2.matrix) ; -clear C2 - -assert (isequal (I1, I2)) ; -assert (isequal (J1, J2)) ; -assert (isequal (single(X1), X2)) ; - -fprintf ('\n===============================================================n') ; -fprintf ('\nC = Cin + A''\n') ; -tic -C1 = Cin + A' ; -toc -tm = toc ; - -fprintf ('GraphBLAS, transpose and then accum with GB_add:\n') ; -% C = Cin + A' -tic -C = GB_mex_transpose (Cin, [ ], 'plus', A) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -assert (isequal (C1, C.matrix)) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; - -fprintf ('\n===============================================================n') ; -fprintf ('\nC = A + B\n') ; - -B = sprandn (m, n, 0.00001) ; -fprintf ('nnz (A) = %d nnz (B) = %d\n', nnz (A), nnz (B)) ; - -tic -C1 = A + B ; -toc -tm = toc ; - -D = struct ('inp0', 'tran') ; - -fprintf ('\nusing accum and subassign, then GB_wait:\n') ; -tic -C2 = GB_mex_transpose (A, [ ], 'plus', B, D) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; -assert (isequal (C1, C2.matrix)) ; - -fprintf ('\nusing accum and GB_add:\n') ; -tic -C2 = GB_mex_transpose (B, [ ], 'plus', A, D) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; -assert (isequal (C1, C2.matrix)) ; - -fprintf ('\nvia GB_add and then accum:\n') ; -clear Cin -Cin = sparse (m,n) ; -tic -C3 = GB_mex_Matrix_eWiseAdd (Cin, [ ], '', 'plus', A, B) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; -assert (isequal (C1, C3.matrix)) ; - -fprintf ('\nvia GB_add:\n') ; -tic -C4 = GB_mex_AplusB (A, B, 'plus') ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; -assert (isequal (C1, C4)) ; - -fprintf ('\nvia GB_add:\n') ; -tic -C4 = GB_mex_AplusB (B, A, 'plus') ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm/tg) ; -assert (isequal (C1, C4)) ; - -fprintf ('\n===============================================================n') ; -fprintf ('\nC = Cin + A + B\n') ; - -Cin = sprandn (m, n, 0.0001) ; - -tic -C1 = Cin + A + B ; -toc -tm1 = toc ; - -tic -C1 = (Cin + A) + B ; -toc -tm2 = toc ; - -tic -C1 = Cin + (A + B) ; -toc -tm3 = toc ; - -tic -C1 = (Cin + B) + A ; -toc -tm5 = toc ; - -tic -C3 = GB_mex_Matrix_eWiseAdd (Cin, [ ], 'plus', 'plus', A, B) ; -tg = toc ; -fprintf ('GraphBLAS time: %g\n', tg) ; -fprintf ('speedup over built-in: %g\n\n', tm1/tg) ; - -assert (isequal (C1, C3.matrix)) ; - -fprintf ('\nvia two GB_add: (Cin+A)+B:\n') ; -tic -C4 = GB_mex_AplusB (Cin, A, 'plus') ; -tg1 = toc ; -tic -C4 = GB_mex_AplusB (C4, B, 'plus') ; -tg2 = toc ; -fprintf ('GraphBLAS time: %g\n', tg1+tg2) ; -fprintf ('speedup over built-in: %g\n\n', tm2/(tg1+tg2)) ; -assert (isequal (C1, C4)) ;; - -fprintf ('\nvia two GB_add: (Cin+(A+B)):\n') ; -tic -C4 = GB_mex_AplusB (A, B, 'plus') ; -tg1 = toc ; -tic -C4 = GB_mex_AplusB (C4, Cin, 'plus') ; -tg2 = toc ; -fprintf ('GraphBLAS time: %g\n', tg1+tg2) ; -fprintf ('speedup over built-in: %g\n\n', tm3/(tg1+tg2)) ; -assert (isequal (C1, C4)) - -fprintf ('\nvia two GB_add: (Cin+B)+A)):\n') ; -tic ; -C4 = GB_mex_AplusB (Cin, B, 'plus') ; -tg1 = toc ; - -tic -C4 = GB_mex_AplusB (C4, A, 'plus') ; -tg2 = toc ; - -fprintf ('GraphBLAS time: %g\n', tg1+tg2) ; -fprintf ('speedup over built-in: %g\n\n', tm5/(tg1+tg2)) ; -assert (isequal (C1, C4)) ;; - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest39: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test40.m b/GraphBLAS/Test/unused/test40.m deleted file mode 100644 index c644223da2..0000000000 --- a/GraphBLAS/Test/unused/test40.m +++ /dev/null @@ -1,161 +0,0 @@ -function test40 -%TEST40 test GrB_Matrix_extractElement - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n ------ quick test of GrB_Matrix_extractElement\n') ; - -Prob = ssget (936) ; -A = Prob.A ; -[m n] = size (A) ; - -for i = double (1:500:m) - for j = double (1:500:n) - x1 = full (A (i,j)) ; - use_scalar = (rand (1) > 0.5) ; - x2 = GB_mex_Matrix_extractElement (A, uint64 (i-1), uint64 (j-1), '', use_scalar) ; - assert (isequal (x1,x2)) ; - end -end - -i2 = double (1:10:m) ; -j2 = double (1:10:n) ; -ni = length (i2) * length (j2) ; -I = zeros (ni, 1) ; -J = zeros (ni, 1) ; -X = zeros (ni, 1) ; - -k = 0 ; -for i = i2 - for j = j2 - k = k + 1 ; - I (k) = i ; - J (k) = j ; - end -end - -% loop 1 -tic -for i = i2 - for j = j2 - x1 = full (A (i,j)) ; - end -end -t1 = toc ; -fprintf ('built-in, scalar A(i,j): %g sec\n', t1) ; - -% loop 2 is about the same speed -tic -for k = 1:ni - X (k) = full (A (I (k), J (k))) ; -end -t2 = toc ; -fprintf ('built-in, scalar A(i,j): %g sec (2nd loop)\n', t2) ; -t0 = min (t1, t2) ; - -I = uint64 (I-1) ; -J = uint64 (J-1) ; -X1 = zeros (ni, 1) ; - -tic -for k = 1:ni - use_scalar = (rand (1) > 0.5) ; - X1 (k) = GB_mex_Matrix_extractElement (A, I (k), J (k), '', use_scalar) ; -end -t3 = toc ; -fprintf ('GrB single A(i,j): %g sec speedup: %g\n', t3, t0/ t3) ; - -% This is about 15x faster than built-in loop 1 and 2. -% the loop is internal in the mexFunction, so this code -% avoids the interpretive overhead. It also avoids the -% malloc need to construct the GraphBLAS header for -% the shallow copy of A, and the malloc for the scalar result, -% for each iteration. Instead, those mallocs are done once. -tic -X2 = GB_mex_Matrix_extractElement (A, I, J) ; -t4 = toc ; -fprintf ('GrB many A(i,j): %g sec speedup: %g\n', t4, t0/ t4) ; - -assert (isequal (X, X2)) ; -assert (isequal (X, X1)) ; - -X2 = GB_mex_Matrix_extractElement (A, I, J, '', true) ; -assert (isequal (X, X2)) ; - - -tic -[I,J,X] = find (A) ; -t7 = toc ; -fprintf ('built-in, [I,J,X] = find(A) %g sec\n', t7) ; - -tic -[I2, J2, X2] = GB_mex_extractTuples (A) ; -t8 = toc ; -fprintf ('GrB [I,J,X] = find(A) %g sec, speedup %g\n', t8, t7/t8) ; -assert (isequal (I, double (I2+1))) -assert (isequal (J, double (J2+1))) -assert (isequal (X, X2)) - -ni = length (I) ; - -% built-in loop 3 -tic -for k = 1:ni - X (k) = full (A (I (k), J (k))) ; -end -t5 = toc ; -fprintf ('built-in, scalar A(i,j): %g sec (all entries)\n', t5) ; - -tic -X2 = GB_mex_Matrix_extractElement (A, I2, J2) ; -t6 = toc ; -fprintf ('GrB many A(i,j): %g sec (all entries) speedup: %g\n', t6, t5/ t6) ; -assert (isequal (X, X2)) ; - -X2 = GB_mex_Matrix_extractElement (A, I2, J2, '', true) ; -assert (isequal (X, X2)) ; - -%------------------------------------------------------------------------------- -% vector - -V = A (:) ; - -mn = length (V) ; -for i = double (1:500:mn) - x1 = full (V (i)) ; - x2 = GB_mex_Vector_extractElement (V, uint64 (i-1)) ; - assert (isequal (x1,x2)) ; -end - -tic -[I,J,X] = find (V) ; -t9 = toc ; -fprintf ('built-in, [I,J,X] = find(V) %g sec\n', t9) ; -ni = length (I) ; - -tic -[I2, J2, X2] = GB_mex_extractTuples (V) ; -t8 = toc ; -fprintf ('GrB [I,J,X] = find(V) %g sec, speedup %g\n', t8, t7/t8) ; -assert (isequal (I, double (I2+1))) -assert (isequal (J, double (J2+1))) -assert (isequal (X, X2)) - -% built-in vector loop -tic -for k = 1:ni - X (k) = full (V (I (k))) ; -end -t10 = toc ; -fprintf ('built-in, scalar V(i): %g sec (all entries)\n', t10) ; - -tic -X2 = GB_mex_Vector_extractElement (V, I2) ; -t6 = toc ; -fprintf ('GrB many A(i,j): %g sec (all entries) speedup: %g\n', t6, t5/ t6) ; - -assert (isequal (X, X2)) ; - -fprintf ('\ntest40: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test41.m b/GraphBLAS/Test/unused/test41.m deleted file mode 100644 index 7618e24f57..0000000000 --- a/GraphBLAS/Test/unused/test41.m +++ /dev/null @@ -1,84 +0,0 @@ -function test41 -%TEST41 test AxB - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n -------------- simple GB_mex_AxB numeric tests\n') ; - -rng ('default') ; - -for at = [false true] - for bt = [false true] - for ct = [false true] - - - % create the problem - - % A or A' will be 4-by-5 - if (at) - A = sprand (5000, 4000, 0.01) ; - else - A = sprand (4000, 5000, 0.01) ; - end - - % B or B' will be 5-by-3 - if (bt) - B = sprand (3000, 5000, 0.01) ; - else - B = sprand (5000, 3000, 0.01) ; - end - - % C will be 4-by-3 - % C' will be 3-by-4 - - fprintf ('\nat %d bt %d ct %d\n', at, bt, ct) ; - - fprintf ('built-in: ') ; - tic - if (at) - if (bt) - if (ct) - C = (A'*B')' ; - else - C = (A'*B') ; - end - else - if (ct) - C = (A'*B)' ; - else - C = (A'*B) ; - end - end - else - if (bt) - if (ct) - C = (A*B')' ; - else - C = (A*B') ; - end - else - if (ct) - C = (A*B)' ; - else - C = (A*B) ; - end - end - end - toc - - fprintf ('GrB num: ') ; - tic - S = GB_mex_AxB (A, B, at, bt) ; - if (ct) - S = S' ; - end - toc - assert (isequal (S, C)) ; - - end - end -end - -fprintf ('\ntest41: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test42.m b/GraphBLAS/Test/unused/test42.m deleted file mode 100644 index e72004cdbc..0000000000 --- a/GraphBLAS/Test/unused/test42.m +++ /dev/null @@ -1,258 +0,0 @@ -function test42 -%TEST42 test GrB_Matrix_build - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----------------------- performance tests for GrB_Matrix_build\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads_max = feature_numcores ; -% fprintf ('GraphBLAS: one thread\n') ; -% nthreads_set (1, chunk) ; - -Prob = ssget ('HB/west0067') -A = Prob.A ; -[m n] = size (A) ; - -[i j x] = find (Prob.A) ; -i = uint64 (i-1) ; -j = uint64 (j-1) ; -T = sparse (double (i+1), double (j+1), x) ; -assert (isequal (A,T)) ; - -S = GB_mex_Matrix_build (i,j,x) ; -S = S.matrix ; -assert (isequal (A,S)) ; -assert (GB_spok (S) == 1) ; - -nz = nnz (A) ; -p = randperm (nz) ; -i = i(p) ; -j = j(p) ; -x = x(p) ; - -S = GB_mex_Matrix_build (i,j,x) ; -S = S.matrix ; -assert (isequal (A,(S')')) -assert (isequal (A,S)) ; -assert (GB_spok (S) == 1) ; - -% duplicates -rng ('default') ; -i2 = floor (rand (100,1) * n) + 1 ; -j2 = floor (rand (100,1) * n) + 1 ; -x2 = rand (100,1) ; -i = [i ; uint64(i2-1)] ; -j = [j ; uint64(j2-1)] ; -x = [x ; x2] ; -T = sparse (double (i+1), double (j+1), x) ; - -S = GB_mex_Matrix_build (i,j,x) ; -S = S.matrix ; -assert (isequal (spones (S), spones (T))) -assert (norm (S-T,1) == 0) ; -assert (GB_spok (T) == 1) ; - -%------------------------------------------------------------------------------- -fprintf ('----------------------- matrix from collection, no sorting:\n') ; -Prob = ssget (939) -A = Prob.A ; -[m n] = size (A) ; -[i j x] = find (Prob.A) ; -i = uint64 (i-1) ; -j = uint64 (j-1) ; -i1 = double (i+1) ; -j1 = double (j+1) ; -fprintf ('built-in:\n') ; -tic -T = sparse (i1, j1, x) ; -toc -assert (isequal (A,T)) - -fprintf ('GrB:\n') ; -for nth = [1 2 4 8 16 20 40] - if (nth > 2*nthreads_max) - break ; - end - nthreads_set (nth) ; - tic - S = GB_mex_Matrix_build (i,j,x) ; - S = S.matrix ; - t = toc ; - fprintf ('GrB with %d threads: %g\n', nth, t) ; - assert (isequal (A,S)) - assert (GB_spok (S) == 1) ; -end - -try - fprintf ('Csparse:\n') ; - tic - W = cs_sparse (i1,j1,x) ; - toc - ok = isequal (A,W) && (GB_spok (W) == 1) ; -catch - % CSparse not available - ok = true ; -end -assert (ok) ; - -fprintf ('sparse2:\n') ; -try - tic - Y = sparse2 (i1,j1,x) ; - toc - ok = (isequal (A,Y)) && assert (GB_spok (Y) == 1) ; -catch - % CHOLMOD not available - ok = true ; -end -assert (ok) ; - -%------------------------------------------------------------------------------- -fprintf ('\n----------------------- same matrix, but unsorted:\n') ; - -rng ('default') ; -nz = length (x) -p = randperm (nz) ; -i1 = i1 (p) ; -j1 = j1 (p) ; -x = x (p) ; -i = i (p) ; -j = j (p) ; - -fprintf ('built-in:\n') ; -tic -T = sparse (i1, j1, x) ; -toc - -fprintf ('GrB:\n') ; -for nth = [1 2 4 8 16 20 40] - if (nth > 2*nthreads_max) - break ; - end - nthreads_set (nth) ; - tic - S = GB_mex_Matrix_build (i,j,x) ; - S = S.matrix ; - t = toc ; - fprintf ('GrB with %d threads: %g\n', nth, t) ; - assert (isequal (T,S)) - assert (GB_spok (S) == 1) ; -end - -%------------------------------------------------------------------------------- -fprintf ('\n----------------------- random matrix, with duplicates:\n') ; -i2 = floor (rand (1000000,1) * n) + 1 ; -j2 = floor (rand (1000000,1) * n) + 1 ; -x2 = rand (1000000,1) ; -i = [i ; uint64(i2-1)] ; -j = [j ; uint64(j2-1)] ; -x = [x ; x2] ; -i1 = double (i+1) ; -j1 = double (j+1) ; - -fprintf ('built-in:\n') ; -tic -T = sparse (i1, j1, x) ; -toc - -fprintf ('GrB:\n') ; -for nth = [1 2 4 8 16 20 40] - if (nth > 2*nthreads_max) - break ; - end - nthreads_set (nth) ; - tic - S = GB_mex_Matrix_build (i,j,x) ; - S = S.matrix ; - % norm (T-S,1) - t = toc ; - fprintf ('GrB with %d threads: %g\n', nth, t) ; - assert (isequal (T,S)) - assert (GB_spok (S) == 1) ; -end - -try - fprintf ('Csparse:\n') ; - tic - W = cs_sparse (i1,j1,x) ; - toc - ok = isequal (T,W) && (GB_spok (W) == 1) ; -catch - % CSparse not available - ok = true ; -end -assert (ok) ; - -fprintf ('sparse2:\n') ; -try - tic - Y = sparse2 (i1,j1,x) ; - toc - % norm (T-Y,1) - ok = (isequal (T,Y)) && assert (GB_spok (Y) == 1) ; -catch - % CHOLMOD not available - ok = true ; -end -assert (ok) ; - -fprintf ('\n----------------------- same random matrix, but presorted:\n') ; -[ignore,p] = sortrows ([j i x]) ; -i = i (p) ; -j = j (p) ; -x = x (p) ; -i1 = i1 (p) ; -j1 = j1 (p) ; - -fprintf ('built-in:\n') ; -tic -T = sparse (i1, j1, x) ; -toc - -fprintf ('GrB:\n') ; -for nth = [1 2 4 8 16 20 40] - if (nth > 2*nthreads_max) - break ; - end - nthreads_set (nth) ; - tic - S = GB_mex_Matrix_build (i,j,x) ; - S = S.matrix ; - % norm (T-S,1) - t = toc ; - fprintf ('GrB with %d threads: %g\n', nth, t) ; - assert (isequal (T,S)) - assert (GB_spok (S) == 1) ; -end - -try - fprintf ('CSparse:\n') ; - tic - W = cs_sparse (i1,j1,x) ; - toc - ok = isequal (T,W) && (GB_spok (W) == 1) ; -catch - % CSparse not available - ok = true ; -end -assert (ok) ; - -fprintf ('sparse2:\n') ; -try - tic - Y = sparse2 (i1,j1,x) ; - toc - % norm (T-Y,1) - ok = (isequal (T,Y)) && assert (GB_spok (Y) == 1) ; -catch - % CHOLMOD not available - ok = true ; -end -assert (ok) ; - -fprintf ('\ntest42: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test44.m b/GraphBLAS/Test/unused/test44.m deleted file mode 100644 index aa4f04a6bf..0000000000 --- a/GraphBLAS/Test/unused/test44.m +++ /dev/null @@ -1,121 +0,0 @@ -function test44(longtests) -%TEST44 test qsort - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest44\n------------------------------------- qsort tests\n') ; - -if (nargin < 1) - longtests = 0 ; -end - -nlist = [0 1 5 100 50e3 103e3 200e3 1e6 ] ; -if (longtests) - nlist = [nlist 10e6 100e6] ; -else -end - -[save_nthreads save_chunk] = nthreads_get ; -nthreads_max = feature_numcores ; - -rng ('default') ; - -for n = nlist - -fprintf ('\n========================== n %g million\n', n / 1e6) ; - -fprintf ('\n----------------------- qsort 1b\n') ; - -% qsort1b is not stable; it used only when I has unique values -I = int64 (randperm (n))' ; -J = int64 ((n/10)* rand (n,1)) ; -IJ = [I J] ; - -tic -IJout = sortrows (IJ, 1) ; -t = toc ; - -tic -[Iout, Jout] = GB_mex_qsort_1b (I, J) ; -t2 = toc ; - -fprintf ('built-in: sortrows %g sec qsort1b: %g speedup: %g\n', t, t2, t/t2) ; - -assert (isequal ([Iout Jout], IJout)) - -fprintf ('\n----------------------- qsort 2\n') ; - -I = int64 ((n/10)* rand (n,1)) ; -J = int64 (randperm (n))' ; -IJ = [I J] ; - -tic -IJout = sortrows (IJ) ; -t = toc ; - -tic -[Iout, Jout] = GB_mex_qsort_2 (I, J) ; -t2_just = toc ; -t2 = toc ; -assert (isequal ([Iout Jout], IJout)); - -fprintf ('built-in: sortrows %g sec qsort2: %g %g speedup: %g\n', ... - t, t2, t2_just, t/t2) ; - -for nthreads = [1 2 4 8 16 20 32 40 64 128 256] - if (nthreads > 2*nthreads_max) - break ; - end - tic - [Iout, Jout] = GB_mex_msort_2 (I, J, nthreads) ; - tp = toc ; - if (nthreads == 1) - tp1 = tp ; - end - assert (isequal ([Iout Jout], IJout)); - fprintf ('msort2: %3d: %10.4g ', nthreads, tp) ; - fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; - fprintf ('speedup vs built-in: %8.3f\n', t / tp) ; -end - -fprintf ('\n----------------------- qsort 3\n') ; - -I = int64 ((n/10)* rand (n,1)) ; -J = int64 ((n/10)* rand (n,1)) ; -K = int64 (randperm (n))' ; -IJK = [I J K] ; - -tic -IJKout = sortrows (IJK) ; -t = toc ; - -tic -[Iout, Jout, Kout] = GB_mex_qsort_3 (I, J, K) ; -t2_just = toc ; -t2 = toc ; -assert (isequal ([Iout Jout Kout], IJKout)) - -fprintf ('built-in: sortrows %g sec qsort3: %g speedup: %g\n', t, t2, t/t2) ; - -for nthreads = [1 2 4 8 16 20 32 40 64 128 256] - if (nthreads > 2*nthreads_max) - break ; - end - tic - [Iout, Jout, Kout] = GB_mex_msort_3 (I, J, K, nthreads) ; - tp = toc ; - if (nthreads == 1) - tp1 = tp ; - end - assert (isequal ([Iout Jout Kout], IJKout)); - fprintf ('msort3: %3d: %10.4g ', nthreads, tp) ; - fprintf ('speedup vs 1: %8.3f ', tp1 / tp) ; - fprintf ('speedup vs built-in: %8.3f\n', t / tp) ; -end - -end - -fprintf ('\ntest44: all tests passed\n') ; -nthreads_set (save_nthreads, save_chunk) ; - diff --git a/GraphBLAS/Test/unused/test45.m b/GraphBLAS/Test/unused/test45.m deleted file mode 100644 index df622cc060..0000000000 --- a/GraphBLAS/Test/unused/test45.m +++ /dev/null @@ -1,234 +0,0 @@ -function test45(use_ssget) -%TEST45 test GrB_*_setElement and GrB_*_*build - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest45\n------------------ testing GrB_setElement and _build\n') ; - -if (nargin < 1) - use_ssget = true ; -end - -rng ('default') ; -A = sparse (rand (3,2)) ; - -C = GB_mex_setElement (A, uint64(0), uint64(0), 42.1) ; - -A = rand (3,2) ; -A (2,2) = 0 ; -A = sparse (A) ; - -C = GB_mex_setElement (A, uint64(1), uint64(1), 99) ; -GB_spok (C.matrix) ; - -if (use_ssget) - Prob = ssget ('HB/west0067') ; - A = Prob.A ; -else - A = sprand (67, 67, 0.1) ; -end -[m n] = size (A) ; - -ntuples = 1000 ; -A1 = A ; -I = 1 + floor (m * rand (ntuples, 1)) ; -J = 1 + floor (n * rand (ntuples, 1)) ; -X = 100 * rand (ntuples, 1) ; -I0 = uint64 (I)-1 ; -J0 = uint64 (J)-1 ; - -for k = 1:ntuples - A1 (I (k), J (k)) = X (k) ; -end - -A2 = A ; -A3 = GB_mex_setElement (A2, I0, J0, X) ; -assert (GB_spok (A3.matrix) == 1) - -assert (isequal (A3.matrix, A1)) ; -% nnz (A) -% ntuples -% nnz (A1) -% nnz (A3.matrix) -% nnz (A) + ntuples - -if (use_ssget) - Prob = ssget (2662) - A = Prob.A ; -else - n = 2999349 ; - nz = 14.3e6 ; - density = nz / (n^2) ; - A = sprandn (n, n, density) ; -end -[m n] = size (A) ; -fprintf ('nnz(A) = %g\n', nnz (A)) ; - -for trial = 1:3 - - if (trial == 1) - fprintf ('\n---------------------- with I,J,X in sorted order\n') ; - elseif (trial == 2) - fprintf ('\n---------------------- with I,J,X in randomized order\n') ; - elseif (trial == 3) - fprintf ('\n---------------------- with I,J,X in randomized order') ; - fprintf (' and duplicates\n') ; - end - - ntuples = 100 ; - A1 = A ; - I = 1 + floor (m * rand (ntuples, 1)) ; - J = 1 + floor (n * rand (ntuples, 1)) ; - X = 100 * rand (ntuples, 1) ; - I0 = uint64 (I)-1 ; - J0 = uint64 (J)-1 ; - - fprintf ('starting built-in method... please wait\n') ; - tic - for k = 1:ntuples - A1 (I (k), J (k)) = X (k) ; - end - t = toc ; - fprintf ('built-in set element: %g sec\n', t) ; - - tic - A2 = GB_mex_setElement (A, I0, J0, X) ; - t2 = toc ; - fprintf ('GraphBLAS setElement: %g seconds speedup %g\n', t2, t/t2) ; - - assert (isequal (A1, A2.matrix)) - - tic - [I,J,X]=find(A) ; - t = toc ; - fprintf ('built-in find: %g sec\n', t) ; - - if (trial >= 2) - p = randperm (length (X)) ; - X = X (p) ; - I = I (p) ; - J = J (p) ; - end - - tic - G=sparse(I,J,X) ; - t3 = toc ; - fprintf ('built-in sparse: %g sec\n', t3) ; - - I0 = uint64 (I)-1 ; - J0 = uint64 (J)-1 ; - S = sparse (m,n) ; - tic - S = GB_mex_setElement (S, I0, J0, X) ; - t5 = toc ; - fprintf ('GraphBLAS setElement: %g sec from scratch, nnz %d\n', ... - t5, nnz (S.matrix)) ; - - % fprintf ('GB_spok it 1\n') ; - assert (GB_spok (S.matrix*1) == 1) ; - assert (isequal (G, S.matrix)) ; - - if (trial == 3) - X = [X ; X] ; - I = [I ; I] ; - J = [J ; J] ; - I0 = uint64 (I)-1 ; - J0 = uint64 (J)-1 ; - fprintf ('\nnow with lots of duplicates\n') ; - end - - tic - G=sparse(I,J,X) ; - t3 = toc ; - fprintf ('built-in sparse: %g sec\n', t3) ; - - tic - T = GB_mex_Matrix_build (I0, J0, X, m, n) ; - t4 = toc ; - fprintf ('GraphBLAS build: %g sec from scratch, nnz %d\n', ... - t4, nnz (T.matrix)) ; - - % fprintf ('GB_spok it 2\n') ; - assert (GB_spok (T.matrix*1) == 1) ; - assert (isequal (G, T.matrix)) ; - - fprintf ('\n------------------- now try a vector B = A(:)\n') ; - - B = A (:) ; - blen = size (B,1) ; - fprintf ('vector B has length %d with %d nonzeros\n', blen, nnz (B)) ; - - tic - [I,J,X]=find(B) ; - t = toc ; - fprintf ('built-in find: %g sec\n', t) ; - - if (trial == 2) - p = randperm (length (X)) ; - X = X (p) ; - I = I (p) ; - J = J (p) ; - end - - tic - G=sparse(I,J,X,blen,1) ; - t3 = toc ; - fprintf ('built-in sparse: %g sec\n', t3) ; - - I0 = uint64 (I)-1 ; - J0 = uint64 (J)-1 ; - S = sparse (blen,1) ; - - tic - S = GB_mex_setElement (S, I0, J0, X) ; - t5 = toc ; - fprintf ('GraphBLAS setElement: %g sec from scratch, nnz %d\n', ... - t5, nnz (S.matrix)) ; - - % fprintf ('GB_spok it 3\n') ; - assert (GB_spok (S.matrix*1) == 1) ; - assert (isequal (G, S.matrix)) ; - - if (trial == 3) - X = [X ; X] ; - I = [I ; I] ; - J = [J ; J] ; - I0 = uint64 (I)-1 ; - J0 = uint64 (J)-1 ; - fprintf ('\nnow with lots of duplicates\n') ; - end - - tic - G=sparse(I,J,X,blen,1) ; - t3 = toc ; - fprintf ('built-in sparse: %g sec\n', t3) ; - - tic - T = GB_mex_Matrix_build (I0, J0, X, blen, 1) ; - t4 = toc ; - fprintf ('GraphBLAS mtx: build: %g sec from scratch, nnz %d\n', ... - t4, nnz (T.matrix)) ; - - % fprintf ('GB_spok it 4\n') ; - T_matrix = T.matrix * 1 ; - assert (GB_spok (T_matrix) == 1) ; - % assert (isequal (G, T.matrix)) ; - assert (norm (G - T_matrix, 1) / norm (G,1) < 1e-12) ; - - tic - T = GB_mex_Vector_build (I0, X, blen) ; - t4 = toc ; - fprintf ('GraphBLAS vec: build: %g sec from scratch, nnz %d\n', ... - t4, nnz (T.matrix)) ; - - % fprintf ('GB_spok it 4\n') ; - T_matrix = T.matrix * 1 ; - assert (GB_spok (T_matrix) == 1) ; - assert (norm (G - T_matrix, 1) / norm (G,1) < 1e-12) ; - -end - - -fprintf ('\ntest45: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test46.m b/GraphBLAS/Test/unused/test46.m deleted file mode 100644 index c819317f00..0000000000 --- a/GraphBLAS/Test/unused/test46.m +++ /dev/null @@ -1,142 +0,0 @@ -function test46 -%TEST46 performance test of GxB_subassign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n--------------performance test GB_mex_subassign\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; -debug_off - -dt = struct ('inp0', 'tran') ; - -rng ('default') ; - -A = sparse (rand (3,4)) ; -I = uint64 (0:2) ; -J = uint64 (0:3) ; -C = A ; - -C0 = sprandn (length(I), length (J), 0.5) ; -C1 = C ; -C1 (I+1,J+1) = C0 ; -CC = GB_mex_subassign (C, [],[], C0, I, J, []) ; -assert (isequal (C1, CC.matrix)) - -C0 = sprandn (length(I), length (J), 0.5)' ; -C1 = C ; -C1 (I+1,J+1) = C0' ; -CC = GB_mex_subassign (C, [],[], C0, I, J, dt) ; -assert (isequal (C1, CC.matrix)) - -for trial = 1:100 - - for m = [1 10 100] - for n = [1 10 100] - - C = sprandn (m, n, 0.1) ; - - ni = double (irand (1, m)) ; - nj = double (irand (1, n)) ; - I = randperm (m) ; - J = randperm (n) ; - I = I (1:ni) ; - J = J (1:nj) ; - I0 = uint64 (I-1) ; - J0 = uint64 (J-1) ; - - A = sprandn (ni, nj, 0.1) ; - - C1 = C ; - C1 (I,J) = A ; - C2 = GB_mex_subassign (C, [], '', A, I0, J0, []) ; - - C3 = C ; - C3 (I,J) = C3 (I,J) + A ; - C4 = GB_mex_subassign (C, [], 'plus', A, I0, J0, []) ; - - assert (isequal (C3, C4.matrix)) - end - end -end - - -Prob = ssget (2662) ; -A = Prob.A ; -% n = 2^21 ; A = A (1:n,1:n) ; -% A = A (:) ; -A = [A A ; A A] ; -A = [A A ; A A] ; -% A = [A A ; A A] ; -%A = [A A ; A A] ; -%A = [A A ; A A] ; -C = A ; -C (1,1) = 1 ; -[m n] = size (A) ; -fprintf ('size: %d %d\n', m, n) ; - -ni = min (size (A, 1), 5500) ; -nj = min (size (A, 2), 7000) ; -B = sprandn (ni, nj, 0.001) ; -% I = randperm (m) ; I = I (1:ni) ; -% J = randperm (n) ; J = J (1:nj) ; -I = randperm (m,ni) ; -J = randperm (n,nj) ; -fprintf ('nnzB: %g\n', nnz (B)) ; - -fprintf ('\nC(I,J)=B, builtin start:\n') -tic -C (I,J) = B ; -toc - -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; - -C2 = A; -C2 (1,1) =1 ; - -fprintf ('GraphBLAS start:\n') - -for nthreads = [1 20 40] - nthreads_set (nthreads) ; - tic - C3 = GB_mex_subassign (C2, [], [], B, I0, J0, []) ; - tg = toc ; - fprintf ('%d threads, GB time: %g\n', nthreads, tg) ; - assert (isequal (C, C3.matrix)) ; -end - -% A = Prob.A ; -% A = A (:) ; -% A = [A A] ; -% n = 2^21 ; A = A (1:n,1:n) ; -C = A ; -C (1,1) = 1 ; - -fprintf ('\nC(I,J)+=B, builtin start:\n') -tic -C (I,J) = C (I,J) + B ; -toc - -C2 = A ; -C2 (1,1) = 1 ; - -fprintf ('GraphBLAS start:\n') - -for nthreads = [1 20 40] - nthreads_set (nthreads) ; - tic - C3 = GB_mex_subassign (C2, [], 'plus', B, I0, J0, []) ; - tg = toc ; - fprintf ('%d threads, GB time: %g\n', nthreads, tg) ; - assert (isequal (C, C3.matrix)) ; -end - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest46: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test46b.m b/GraphBLAS/Test/unused/test46b.m deleted file mode 100644 index 5f14ab09e4..0000000000 --- a/GraphBLAS/Test/unused/test46b.m +++ /dev/null @@ -1,119 +0,0 @@ -function test46b -%TEST46B performance test of GrB_assign - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n--------------performance test GB_mex_assign\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -dt = struct ('inp0', 'tran') ; - -rng ('default') ; - -A = sparse (rand (3,4)) ; -I = uint64 (0:2) ; -J = uint64 (0:3) ; -C = A ; - -C0 = sprandn (length(I), length (J), 0.5) ; -C1 = C ; -C1 (I+1,J+1) = C0 ; -CC = GB_mex_assign (C, [],[], C0, I, J, []) ; -assert (isequal (C1, CC.matrix)) - -C0 = sprandn (length(I), length (J), 0.5)' ; -C1 = C ; -C1 (I+1,J+1) = C0' ; -CC = GB_mex_assign (C, [],[], C0, I, J, dt) ; -assert (isequal (C1, CC.matrix)) - -for trial = 1:100 - - for m = [1 10 100] - for n = [1 10 100] - - C = sprandn (m, n, 0.1) ; - - ni = double (irand (1, m)) ; - nj = double (irand (1, n)) ; - I = randperm (m) ; - J = randperm (n) ; - I = I (1:ni) ; - J = J (1:nj) ; - I0 = uint64 (I-1) ; - J0 = uint64 (J-1) ; - - A = sprandn (ni, nj, 0.1) ; - - C1 = C ; - C1 (I,J) = A ; - C2 = GB_mex_assign (C, [], '', A, I0, J0, []) ; - - C3 = C ; - C3 (I,J) = C3 (I,J) + A ; - C4 = GB_mex_assign (C, [], 'plus', A, I0, J0, []) ; - - assert (isequal (C3, C4.matrix)) - end - end -end - - -Prob = ssget (2662) ; -A = Prob.A ; -C = A ; -C (1,1) = 1 ; -[m n] = size (A) ; - -ni = 5500 ; -nj = 7000 ; -B = sprandn (ni, nj, 0.001) ; -I = randperm (m) ; I = I (1:ni) ; -J = randperm (n) ; J = J (1:nj) ; -fprintf ('nnzB: %g\n', nnz (B)) ; - -fprintf ('built-in start:\n') -tic -C (I,J) = B ; -toc - -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; - -C2 = A; -C2 (1,1) =1 ; - -fprintf ('GraphBLAS start:\n') -tic -C3 = GB_mex_assign (C2, [], [], B, I0, J0, []) ; -toc - -assert (isequal (C, C3.matrix)) ; - -A = Prob.A ; -C = A ; -C (1,1) = 1 ; - -fprintf ('built-in start:\n') -tic -C (I,J) = C (I,J) + B ; -toc - -C2 = A ; -C2 (1,1) = 1 ; - -fprintf ('GraphBLAS start:\n') -tic -C3 = GB_mex_assign (C2, [], 'plus', B, I0, J0, []) ; -toc - -assert (isequal (C, C3.matrix)) ; - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest46b: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test47.m b/GraphBLAS/Test/unused/test47.m deleted file mode 100644 index 6b186fd427..0000000000 --- a/GraphBLAS/Test/unused/test47.m +++ /dev/null @@ -1,56 +0,0 @@ -function test47 -%TEST47 prformance test of GrB_vxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; -% d = struct ('inp1', 'tran', 'inp0', 'tran') ; -Prob = ssget (939) ; -% Prob = ssget (2662) ; -A = Prob.A ; - -n = size (A,1) ; -A (1,2) = 1 ; - -w = sparse (n,1) ; -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -t3 = 0 ; - -Xnz = [ ] ; -T = [ ] - -d2.axb = 'dot' ; - -for xnz = [100:100:1000 2000:1000:72000] - - x = sprand (n, 1, xnz/n) ; - - tic - c1 = GB_mex_vxm (w, [],[], semiring, x, A, [ ]) ; - t = toc ; - - tic - c2 = GB_mex_vxm (w, [],[], semiring, x, A, d2) ; - t2 = toc ; - - tic - c0 = x'*A ; - tm = toc ; - - assert (isequal (c0', c1.matrix)) ; - - Xnz = [Xnz nnz(x)] ; - T = [T t] ; - - fprintf ('%5d : %10g(%s) %10g built-in %10g speedup %10g %10g\n', ... - nnz(x), t, method (1), t2, tm, tm/t, tm/t2) ; - -end - -fprintf ('\ntest47: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test48.m b/GraphBLAS/Test/unused/test48.m deleted file mode 100644 index 03cb87fd02..0000000000 --- a/GraphBLAS/Test/unused/test48.m +++ /dev/null @@ -1,318 +0,0 @@ -function test48 -%TEST48 performance test of GrB_mxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -% d = struct ('inp1', 'tran', 'inp0', 'tran') ; -rng ('default') ; - -dt_auto = struct ('inp0', 'tran') ; -dt_dot = struct ('inp0', 'tran', 'axb', 'dot') ; -dt_gus = struct ('inp0', 'tran', 'axb', 'gustavson') ; -dt_hash = struct ('inp0', 'tran', 'axb', 'hash') ; - -da_auto = struct ; -da_dot = struct ('axb', 'dot') ; -da_gus = struct ('axb', 'gustavson') ; -da_hash = struct ('axb', 'hash') ; - -dtn_auto = struct ('inp0', 'tran') ; -dtn_dot = struct ('inp0', 'tran', 'axb', 'dot') ; -dtn_gus = struct ('inp0', 'tran', 'axb', 'gustavson') ; -dtn_hash = struct ('inp0', 'tran', 'axb', 'hash') ; - -dtt_auto = struct ('inp0', 'tran', 'inp1', 'tran') ; -dtt_dot = struct ('inp0', 'tran', 'inp1', 'tran', 'axb', 'dot') ; -dtt_gus = struct ('inp0', 'tran', 'inp1', 'tran', 'axb', 'gustavson') ; -dtt_hash = struct ('inp0', 'tran', 'inp1', 'tran', 'axb', 'hash') ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -xnz_list = [0 100 1000 5000 72000 -1] ; - -for pp = 0:2 - - if (pp == 1) - Prob = ssget (939) - A = Prob.A ; - elseif (pp == 2) - Prob = ssget (2662) - A = Prob.A ; - else - A = sparse (rand (2000)) ; - end - - n = size (A,1) ; - A (1,2) = 1 ; - - for ncols = [1 2 3 4 8 16] - - fprintf ('\n================ ncols %d\n', ncols) ; - w = sparse (n,ncols) ; - - fprintf ('\n------------------------------ C = A''*x\n') ; - for xnz = xnz_list % [0 100:200:1000 2000:20000:72000 -1] - - if (xnz == 0) - x = sparse (n,ncols) ; - x (1:ncols,1:ncols) = speye (ncols) ; - elseif (xnz > 0) - x = sprand (n, ncols, xnz/n) ; - else - x = sparse (rand (n, ncols)) ; - end - - % tic - ca = GB_mex_mxm (w, [],[], semiring, A, x, dt_auto) ; - ta = toc ; - - tic - c1 = GB_mex_mxm (w, [],[], semiring, A, x, dt_dot) ; - t = toc ; - - tic - cg = GB_mex_mxm (w, [],[], semiring, A, x, dt_gus) ; - tg = toc ; - - tic - ch = GB_mex_mxm (w, [],[], semiring, A, x, dt_hash) ; - th = toc ; - - tic - c0 = A'*x ; - t2 = toc ; - - assert (isequal_roundoff (c0, ca.matrix)) ; - assert (isequal_roundoff (c0, cg.matrix)) ; - assert (isequal_roundoff (c0, c1.matrix)) ; - assert (isequal_roundoff (c0, ch.matrix)) ; - - fprintf ('%8d : ', nnz (x)) ; - fprintf ('auto: %10.4f dot: %10.4f gus: %10.4f hash: %10.4f builtin %10.4f', ... - ta, t, tg, th, t2) ; - fprintf (' speedup auto: %10.2f dot: %10.2f gus: %10.2f hash: %10.2f\n', ... - t2/ta, t2/t, t2/tg, t2/th) ; - - end - - tic - c0 = A'*full(x) ; - toc - - fprintf ('\n------------------------------ C = A*x\n') ; - for xnz = xnz_list % [0 100:200:1000 2000:20000:72000 -1] - - if (xnz == 0) - x = sparse (n,ncols) ; - x (1:ncols,1:ncols) = speye (ncols) ; - elseif (xnz > 0) - x = sprand (n, ncols, xnz/n) ; - else - x = sparse (rand (n, ncols)) ; - end - - tic - ca = GB_mex_mxm (w, [],[], semiring, A, x, da_auto) ; - ta = toc - - tic - c1 = GB_mex_mxm (w, [],[], semiring, A, x, da_dot) ; - t = toc ; - - tic - cg = GB_mex_mxm (w, [],[], semiring, A, x, da_gus) ; - tg = toc ; - - tic - ch = GB_mex_mxm (w, [],[], semiring, A, x, da_hash) ; - th = toc ; - - tic - c0 = A*x ; - t2 = toc ; - - assert (isequal_roundoff (c0, ca.matrix)) ; - assert (isequal_roundoff (c0, cg.matrix)) ; - assert (isequal_roundoff (c0, c1.matrix)) ; - assert (isequal_roundoff (c0, ch.matrix)) ; - - fprintf ('%8d : ', nnz (x)) ; - fprintf ('auto: %10.4f dot: %10.4f gus: %10.4f hash: %10.4f builtin %10.4f', ... - ta, t, tg, th, t2) ; - fprintf (' speedup auto: %10.2f dot: %10.2f gus: %10.2f hash: %10.2f\n', ... - t2/ta, t2/t, t2/tg, t2/th) ; - - end - - tic - c0 = A*full(x) ; - toc - - w = sparse (ncols,n) ; - - fprintf ('\n------------------------------ C = x''*A\n') ; - for xnz = xnz_list % [0 100:200:1000 2000:20000:72000 -1] - - if (xnz == 0) - x = sparse (n,ncols) ; - x (1:ncols,1:ncols) = speye (ncols) ; - elseif (xnz > 0) - x = sprand (n, ncols, xnz/n) ; - else - x = sparse (rand (n, ncols)) ; - end - - tic - ca = GB_mex_mxm (w, [],[], semiring, x, A, dtn_auto) ; - ta = toc ; - - tic - c1 = GB_mex_mxm (w, [],[], semiring, x, A, dtn_dot) ; - t = toc ; - - tic - cg = GB_mex_mxm (w, [],[], semiring, x, A, dtn_gus) ; - tg = toc ; - - tic - ch = GB_mex_mxm (w, [],[], semiring, x, A, dtn_hash) ; - th = toc ; - - tic - c0 = x'*A ; - t2 = toc ; - - % norm (c0 - ca.matrix, 1) - assert (isequal_roundoff (c0, ca.matrix)) ; - assert (isequal_roundoff (c0, cg.matrix)) ; - assert (isequal_roundoff (c0, c1.matrix)) ; - assert (isequal_roundoff (c0, ch.matrix)) ; - - fprintf ('%8d : ', nnz (x)) ; - fprintf ('auto: %10.4f dot: %10.4f gus: %10.4f hash: %10.4f builtin %10.4f', ... - ta, t, tg, th, t2) ; - fprintf (' speedup auto: %10.2f dot: %10.2f gus: %10.2f hash: %10.2f\n', ... - t2/ta, t2/t, t2/tg, t2/th) ; - - end - - tic - c0 = full(x')*A ; - toc - - fprintf ('\n------------------------------ C = x''*A''\n') ; - for xnz = xnz_list % [0 100:200:1000 2000:20000:72000 -1] - - if (xnz == 0) - x = sparse (n,ncols) ; - x (1:ncols,1:ncols) = speye (ncols) ; - elseif (xnz > 0) - x = sprand (n, ncols, xnz/n) ; - else - x = sparse (rand (n, ncols)) ; - end - - tic - ca = GB_mex_mxm (w, [],[], semiring, x, A, dtt_auto) ; - ta = toc ; - - tic - c1 = GB_mex_mxm (w, [],[], semiring, x, A, dtt_dot) ; - t = toc ; - - tic - cg = GB_mex_mxm (w, [],[], semiring, x, A, dtt_gus) ; - tg = toc ; - - tic - ch = GB_mex_mxm (w, [],[], semiring, x, A, dtt_hash) ; - th = toc ; - - tic - c0 = x'*A' ; - t2 = toc ; - - assert (isequal_roundoff (c0, ca.matrix)) ; - assert (isequal_roundoff (c0, cg.matrix)) ; - assert (isequal_roundoff (c0, c1.matrix)) ; - assert (isequal_roundoff (c0, ch.matrix)) ; - - fprintf ('%8d : ', nnz (x)) ; - fprintf ('auto: %10.4f dot: %10.4f gus: %10.4f hash: %10.4f builtin %10.4f', ... - ta, t, tg, th, t2) ; - fprintf (' speedup auto: %10.2f dot: %10.2f gus: %10.2f hash: %10.2f\n', ... - t2/ta, t2/t, t2/tg, t2/th) ; - - end - - tic - c0 = full(x')*A' ; - toc - - w = sparse (n,ncols) ; - - fprintf ('\n------------------------------ C = A''*x''\n') ; - for xnz = xnz_list % [0 100:200:1000 2000:20000:72000 -1] - - if (xnz == 0) - x = sparse (n,ncols) ; - x (1:ncols,1:ncols) = speye (ncols) ; - elseif (xnz > 0) - x = sprand (n, ncols, xnz/n) ; - else - x = sparse (rand (n, ncols)) ; - end - x=x' ; - - tic - ca = GB_mex_mxm (w, [],[], semiring, A, x, dtt_auto) ; - ta = toc ; - - tic - c1 = GB_mex_mxm (w, [],[], semiring, A, x, dtt_dot) ; - t = toc ; - - tic - cg = GB_mex_mxm (w, [],[], semiring, A, x, dtt_gus) ; - tg = toc ; - - tic - ch = GB_mex_mxm (w, [],[], semiring, A, x, dtt_hash) ; - th = toc ; - - tic - c0 = A'*x' ; - t2 = toc ; - - assert (isequal_roundoff (c0, ca.matrix)) ; - assert (isequal_roundoff (c0, cg.matrix)) ; - assert (isequal_roundoff (c0, c1.matrix)) ; - assert (isequal_roundoff (c0, ch.matrix)) ; - - fprintf ('%8d : ', nnz (x)) ; - fprintf ('auto: %10.4f dot: %10.4f gus: %10.4f hash: %10.4f builtin %10.4f', ... - ta, t, tg, th, t2) ; - fprintf (' speedup auto: %10.2f dot: %10.2f gus: %10.2f hash: %10.2f\n', ... - t2/ta, t2/t, t2/tg, t2/th) ; - - end - - tic - c0 = A'*full(x') ; - toc - - end -end - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest48: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test49.m b/GraphBLAS/Test/unused/test49.m deleted file mode 100644 index a561d7c154..0000000000 --- a/GraphBLAS/Test/unused/test49.m +++ /dev/null @@ -1,50 +0,0 @@ -function test49 -%TEST49 performance test of GrB_mxm (dot product method, A'*B) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -d = struct ('inp0', 'tran', 'axb', 'dot') ; - -rng ('default') ; -k = 1e6 ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -A1 = sprand (k, 16, 10e6 / (k*16)) ; -B1 = sprand (k, 16, 10e6 / (k*16)) ; - -for m = 1:4 - for n = 1:4 - - A = A1 (:, 1:m) ; - B = B1 (:, 1:n) ; - - W = sparse (m, n) ; - - tic ; - C = A'*B ; - t1 = toc ; - - tic ; - C2 = GB_mex_mxm (W, [], [], semiring, A, B, d) ; - t2 = toc ; - - e = norm (C - C2.matrix, 1) ; - fprintf (... - 'm %3d n %3d built-in: %10.5g GrB: %10.5g speedup %10.2f err: %g\n', ... - m, n, t1, t2, t1/t2, e) ; - end -end - -nthreads_set (save, save_chunk) ; - -fprintf ('\ntest49: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test50.m b/GraphBLAS/Test/unused/test50.m deleted file mode 100644 index 61faca0115..0000000000 --- a/GraphBLAS/Test/unused/test50.m +++ /dev/null @@ -1,61 +0,0 @@ -function test50 -%TEST50 test AxB numeric and symbolic - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----------------------------- GB_mex_AxB\n') ; - -% Prob = ssget (2662) ; -Prob = ssget (936) -A = Prob.A ; -A(1,2) = 443 ; - -for trial = 1:2 - - if (trial == 1) - B = A ; - else - % make it rectangular - [m k] = size (A) ; - A = A (:,1:k-1) ; - [m k] = size (A) ; - nz = nnz (A) ; - n = m+1 ; - B = sprand (k, n, nz / (k*n)) ; - end - - fprintf ('\n---------------builtin: C=A*B\n') ; - tic ; - C = (A*B) ; - toc - C0 = cast (C, 'logical') ; - cnorm = norm (C, 1) ; - fprintf ('nnz(C) %d density %g mincol %d maxcol %d norm %g\n', ... - nnz (C0), nnz (C0) / prod (size (C0)), ... - full (min (sum (spones (C0)))), ... - full (max (sum (spones (C0)))), cnorm) ; - % figure (1) - % subplot (1,3,1) ; spy (A) ; - % subplot (1,3,2) ; spy (B) ; - % subplot (1,3,3) ; spy (C) ; - - fprintf ('numerical matrix multiply (GraphBLAS):\n') ; - tic - S = GB_mex_AxB (A, B) ; - toc - assert (GB_spok (S*1) == 1) ; - err = norm (C-S,1) / cnorm ; - fprintf ('err %g\n', err) ; - assert (isequal (C, S)) ; - - fprintf ('\n---------------builtin: C=(A*B)''\n') ; - tic ; - C = (A*B)' ; - toc - C0 = cast (C, 'logical') ; - -end - -fprintf ('\ntest50: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test51.m b/GraphBLAS/Test/unused/test51.m deleted file mode 100644 index 5a56d02d68..0000000000 --- a/GraphBLAS/Test/unused/test51.m +++ /dev/null @@ -1,169 +0,0 @@ -function test51 -%TEST51 test GxB_subassign, multiply operations - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n-----------performance test GB_mex_subassign, multiple ops\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') - -for problem = 1:5 - - fprintf ('\n----------------------------------------------------- %d\n',... - problem) ; - - switch (problem) - case 1 - Corig = sprand (1000, 1, 0.1) ; - nwork = 10 ; - m_max = 1000 ; - n_max = 1 ; - d = 0.1 ; - case 2 - Prob = ssget ('HB/west0067') ; Corig = Prob.A ; - nwork = 1000 ; - m_max = 64 ; - n_max = 64 ; - d = 0.1 ; - case 3 - Corig = abs (sprand (80, 80, 0.4)) ; - nwork = 1000 ; - m_max = 64 ; - n_max = 64 ; - d = 0.1 ; - case 4 - Corig = sparse (rand (50000, 500)) ; - nwork = 50 ; - % [m n] = size (A) ; - [m n] = size (Corig) ; - m_max = m ; - n_max = n ; - d = 100 / (m*n) ; - case 5 - Prob = ssget (2662) - Corig = Prob.A ; - nwork = 100 ; - m_max = 1024 ; - n_max = 1024 ; - d = 10000 / (ni*nj) ; - end - - Corig = abs (Corig) ; - [m n] = size (Corig) ; - - for opkind = 1 % 1:3 - - fprintf ('\n--------------------------\n') ; - switch opkind - case 1 - fprintf ('C(I,J) = accum(C(I,J),A) one op, assemble at end\n') ; - case 2 - fprintf ('C(I,J) = accum(C(I,J),A) two ops, change every 10th\n') ; - case 3 - fprintf ('C(I,J) = A no accum\n') ; - end - - nz = 0 ; - ni_min = inf ; - ni_max = -inf ; - nj_min = inf ; - nj_max = -inf ; - nz_min = inf ; - nz_max = -inf ; - - clear Work - - for k = 1:nwork - ni = double (irand (1, min (m,m_max))) ; - nj = double (irand (1, min (n,n_max))) ; - ni_min = min (ni_min, ni) ; - nj_min = min (nj_min, nj) ; - ni_max = max (ni_max, ni) ; - nj_max = max (nj_max, nj) ; - - if (d == 1) - A = sparse (rand (ni, nj)) ; - else - A = sprand (ni, nj, d) ; - end - nz_min = min (nz_min, nnz (A)) ; - nz_max = max (nz_max, nnz (A)) ; - if (opkind == 1) - op = 'plus' ; - else - if (mod (k,5) == 0) - op = 'max' ; - else - op = 'plus' ; - end - end - nz = nz + nnz (A) ; - I = randperm (m,ni) ; - J = randperm (n,nj) ; - Work (k).A = A ; - Work (k).I = I ; - Work (k).J = J ; - Work (k).accum = op ; - end - fprintf ('number of C(I,J) = ... to do: %d\n', nwork) ; - fprintf ('ni: [ %d to %d]\n', ni_min, ni_max) ; - fprintf ('nj: [ %d to %d]\n', nj_min, nj_max) ; - fprintf ('nz: [ %d to %d]\n', nz_min, nz_max) ; - fprintf ('C is %d-by-%d nnz(A): %d nz to add: %d matrices: %d\n', ... - m, n, nnz (Corig), nz, nwork) ; - - Work2 = Work ; - for k = 1:nwork - Work2 (k).I = uint64 (Work2 (k).I - 1) ; - Work2 (k).J = uint64 (Work2 (k).J - 1) ; - end - tic - C2 = GB_mex_subassign (Corig, Work2) ; % WORK_ASSIGN - t1 = toc ; - fprintf ('GraphBLAS time: %g\n', t1) ; - fprintf ('final nnz: %d\n', nnz (C2.matrix)) ; - - fprintf ('start built-in methods...\n') ; - tic - C = Corig ; - % full (C) - for k = 1:nwork - I = Work (k).I ; - J = Work (k).J ; - A = Work (k).A ; - % Afull = full (A) - if (isequal (Work (k).accum, 'plus')) - % fprintf (' %d : plus\n', k) ; - C (I,J) = C (I,J) + A ; - elseif (isequal (Work (k).accum, 'max')) - % fprintf (' %d : max\n', k) ; - C (I,J) = max (C (I,J),A) ; - else - C (I,J) = A ; - end - % full (C) - end - t2 = toc ; - fprintf ('built-in methods time: %g\n', t2) ; - fprintf ('GraphBLAS speedup: %g\n', t2/t1) ; - - % C2.matrix - % C - C2.matrix - - % C2 = full (C2.matrix) - % C-C2 - % assert (isequal (C, C2)) ; - assert (isequal (C, C2.matrix)) ; - end - -end - -fprintf ('\ntest51: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test51b.m b/GraphBLAS/Test/unused/test51b.m deleted file mode 100644 index 9b18f55ebe..0000000000 --- a/GraphBLAS/Test/unused/test51b.m +++ /dev/null @@ -1,170 +0,0 @@ -function test51b -%TEST51B test GrB_assign, multiply operations - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n-----------performance test GB_mex_assign, multiple ops\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') - -for problem = 1:5 - - fprintf ('\n----------------------------------------------------- %d\n',... - problem) ; - - switch (problem) - case 1 - Corig = sprand (1000, 1, 0.1) ; - nwork = 10 ; - m_max = 1000 ; - n_max = 1 ; - d = 0.1 ; - case 2 - Prob = ssget ('HB/west0067') ; Corig = Prob.A ; - nwork = 1000 ; - m_max = 64 ; - n_max = 64 ; - d = 0.1 ; - case 3 - Corig = abs (sprand (80, 80, 0.4)) ; - nwork = 1000 ; - m_max = 64 ; - n_max = 64 ; - d = 0.1 ; - case 4 - Corig = sparse (rand (50000, 500)) ; - nwork = 50 ; - % [m n] = size (A) ; - [m n] = size (Corig) ; - m_max = m ; - n_max = n ; - d = 100 / (m*n) ; - case 5 - Prob = ssget (2662) - Corig = Prob.A ; - nwork = 100 ; - m_max = 1024 ; - n_max = 1024 ; - d = 10000 / (ni*nj) ; - end - - Corig = abs (Corig) ; - [m n] = size (Corig) ; - - for opkind = 1 % 1:3 - - fprintf ('\n--------------------------\n') ; - switch opkind - case 1 - fprintf ('C(I,J) = accum(C(I,J),A) one op, assemble at end\n') ; - case 2 - fprintf ('C(I,J) = accum(C(I,J),A) two ops, change every 10th\n') ; - case 3 - fprintf ('C(I,J) = A no accum\n') ; - end - - nz = 0 ; - ni_min = inf ; - ni_max = -inf ; - nj_min = inf ; - nj_max = -inf ; - nz_min = inf ; - nz_max = -inf ; - - clear Work - - for k = 1:nwork - ni = double (irand (1, min (m,m_max))) ; - nj = double (irand (1, min (n,n_max))) ; - ni_min = min (ni_min, ni) ; - nj_min = min (nj_min, nj) ; - ni_max = max (ni_max, ni) ; - nj_max = max (nj_max, nj) ; - - if (d == 1) - A = sparse (rand (ni, nj)) ; - else - A = sprand (ni, nj, d) ; - end - nz_min = min (nz_min, nnz (A)) ; - nz_max = max (nz_max, nnz (A)) ; - if (opkind == 1) - op = 'plus' ; - else - if (mod (k,5) == 0) - op = 'max' ; - else - op = 'plus' ; - end - end - nz = nz + nnz (A) ; - I = randperm (m,ni) ; - J = randperm (n,nj) ; - Work (k).A = A ; - Work (k).I = I ; - Work (k).J = J ; - Work (k).accum = op ; - end - fprintf ('number of C(I,J) = ... to do: %d\n', nwork) ; - fprintf ('ni: [ %d to %d]\n', ni_min, ni_max) ; - fprintf ('nj: [ %d to %d]\n', nj_min, nj_max) ; - fprintf ('nz: [ %d to %d]\n', nz_min, nz_max) ; - fprintf ('C is %d-by-%d nnz(A): %d nz to add: %d matrices: %d\n', ... - m, n, nnz (Corig), nz, nwork) ; - - Work2 = Work ; - for k = 1:nwork - Work2 (k).I = uint64 (Work2 (k).I - 1) ; - Work2 (k).J = uint64 (Work2 (k).J - 1) ; - end - tic - C2 = GB_mex_assign (Corig, Work2) ; % WORK_ASSIGN - t1 = toc ; - fprintf ('GraphBLAS time: %g\n', t1) ; - fprintf ('final nnz: %d\n', nnz (C2.matrix)) ; - - fprintf ('start builtin...\n') ; - tic - C = Corig ; - % full (C) - for k = 1:nwork - I = Work (k).I ; - J = Work (k).J ; - A = Work (k).A ; - % Afull = full (A) - if (isequal (Work (k).accum, 'plus')) - % fprintf (' %d : plus\n', k) ; - C (I,J) = C (I,J) + A ; - elseif (isequal (Work (k).accum, 'max')) - % fprintf (' %d : max\n', k) ; - C (I,J) = max (C (I,J),A) ; - else - C (I,J) = A ; - end - % full (C) - end - t2 = toc ; - fprintf ('builtin time: %g\n', t2) ; - fprintf ('GraphBLAS speedup: %g\n', t2/t1) ; - - % C2.matrix - % C - C2.matrix - - % C2 = full (C2.matrix) - % C-C2 - % assert (isequal (C, C2)) ; - assert (isequal (C, C2.matrix)) ; - end - -end - -fprintf ('\ntest51b: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; - diff --git a/GraphBLAS/Test/unused/test52.m b/GraphBLAS/Test/unused/test52.m deleted file mode 100644 index 7f2e83ac66..0000000000 --- a/GraphBLAS/Test/unused/test52.m +++ /dev/null @@ -1,137 +0,0 @@ -function test52 -%TEST52 test AdotB vs AxB - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----------------------- AdotB versus AxB\n') ; - -rng ('default') -x = sparse (rand (10,1)) ; -y = sparse (rand (10,1)) ; -c = x'*y ; -'AdotB' -C = GB_mex_AdotB (x, y) -'did AdotB' -c - C -assert (isequal (c, C)) - -x = sprandn (100, 1, 0.2) ; -y = sprandn (100, 1, 0.2) ; -c = x'*y ; -C = GB_mex_AdotB (x, y) -assert (isequal (c, C)) - -for m = 1:10 - for n = 1:10 - for k = [10 100 1000 10000] - - A = sprandn (k, m, 0.2) ; - B = sprandn (k, n, 0.2) ; - Mask = sprand (m, n, 0.5) ; - - C = A'*B ; - C2 = GB_mex_AdotB (A,B) ; - - assert (isequal (C, C2)) ; - assert (GB_spok (C2) == 1) - - C = spones (Mask) .* C ; - C2 = GB_mex_AdotB (A,B, Mask) ; - - assert (isequal (C, C2)) ; - assert (GB_spok (C2) == 1) - end - end -end - -relwork = [ ] ; -reltime = [ ] ; - -k = 10e6 ; -fprintf ('\nbuilding random sparse matrices %d by M\n', k) ; -for m = [1 10 20:10:60 61:65 70:10:100] -fprintf ('\n') ; -for n = [1 10 20:10:60 61:65 70:10:100] - - d = 0.001 ; - A = sprandn (k, m, d) ; - B = sprandn (k, n, d) ; - Mask = spones (sprandn (m, n, 0.5)) ; - % A (:,m) = sparse (rand (k,1)) ; - % B (:,m) = sparse (rand (k,1)) ; - - cwork = m*n ; - awork = min (nnz(A) + k + m, nnz(B) + k + n) ; - - relwork = [relwork cwork/awork] ; - - tic - C = A'*B ; - t1 = toc ; - - % fprintf ('GrB AdotB:\n') ; - tic - C2 = GB_mex_AdotB (A,B) ; - t2 = toc ; - - % fprintf ('GrB A''*B native:\n') ; - tic - C4 = GB_mex_AxB (A,B, true) ; - t4 = toc ; - - % fprintf ('GrB A''*B native:\n') ; - tic - C5 = GB_mex_AxB (A',B) ; - t5 = toc ; - - reltime = [reltime t2/t5] ; - - fprintf (... -'m %3d n %3d %10.2e builtin: %10.4f AdotB : %10.4f GB,auto:: %10.4f outer %10.4f', ... - m, n, cwork/awork, t1, t2, t4, t5) ; - % fprintf (' speedup: %10.4f (no Mask)\n', t2/t5) ; - fprintf (' rel: %10.4f ', t2/t5) ; - fprintf (' speedup: %10.4f\n', t1/t4) ; - - assert (isequal (C, C2)) ; - assert (isequal (C, C4)) ; - assert (isequal (C, C5)) ; - - %{ - - tic - C = Mask .* (A'*B) ; - t1 = toc ; - - % fprintf ('GrB AdotB:\n') ; - tic - C2 = GB_mex_AdotB (A,B, Mask) ; - t2 = toc ; - - % fprintf ('GrB A''*B native:\n') ; - tic - C4 = Mask .* GB_mex_AxB (A,B, true) ; - t4 = toc ; - - % fprintf ('GrB A''*B native:\n') ; - tic - C5 = Mask .* GB_mex_AxB (A',B) ; - t5 = toc ; - - fprintf (... - 'm %2d builtin: %10.4f AdotB : %10.4f GB,auto:: %10.4f outer %10.4f', ... - m, t1, t2, t4, t5) ; - fprintf (' speedup: %10.4f (with Mask)\n', t1/t4) ; - - assert (isequal (C, C2)) ; - assert (isequal (C, C4)) ; - %} - - loglog (relwork, reltime, 'o') ; - drawnow - -end -end - -fprintf ('\ntest52: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test55.m b/GraphBLAS/Test/unused/test55.m deleted file mode 100644 index ef934494bb..0000000000 --- a/GraphBLAS/Test/unused/test55.m +++ /dev/null @@ -1,73 +0,0 @@ -function test55 -%TEST55 test GxB_subassign, illustrate duplicate indices - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -A = magic (5) - -A ([2 2], [4 5]) - -B = [1000 800 ; 60000 2000 ] -% B (1,1) = nan - -i = [2 2] -j = [4 5] - -C1 = A ; -C1 ([2 2], [4 5]) = A ([2 2], [4 5]) + B - -a = sparse (A) -b = sparse (B) -i0 = uint64 (i-1) -j0 = uint64 (j-1) - -C2 = GB_mex_subassign (a, [], 'plus', b, i0, j0) - -C1 -full (C2.matrix) - -c = sparse ([ 1 2 3 4 5 ]) -i = uint64 (0) -j = uint64 ([ 0 0 4 ]) -a = sparse ([ 10 100 1000]) -e = GB_mex_subassign (c, [], 'plus', a, i, j) -e = full (e.matrix) - -ac = accumarray (double (j+1)', full(a)')' -e2 = c ; -e2 (i+1, :) = e2 (i+1, :) + ac -e2 = full (e2) - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + a -e2 = full (e2) - -a = sparse ([ 1000 1000 1000]) -e = GB_mex_subassign (c, [], 'plus', a, i, j) -e = full (e.matrix) - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + a -e2 = full (e2) - - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + 1000 -e2 = full (e2) - - -a = sparse ([ 1000 1000 1000]) -e = GB_mex_subassign (c, [], '', a, i, j) -e = full (e.matrix) - -e2 = c ; -e2 (i+1,j+1) = a -e2 = full (e2) - -e2 = c ; -e2 (i+1,j+1) = 1000 -e2 = full (e2) - -fprintf ('\ntest55: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test55b.m b/GraphBLAS/Test/unused/test55b.m deleted file mode 100644 index e0a75ee871..0000000000 --- a/GraphBLAS/Test/unused/test55b.m +++ /dev/null @@ -1,74 +0,0 @@ -function test55b -%TEST55B test GrB_assign, illustrate duplicate indices - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -A = magic (5) - -A ([2 2], [4 5]) - -B = [1000 800 ; 60000 2000 ] -% B (1,1) = nan - -i = [2 2] -j = [4 5] - -C1 = A ; -C1 ([2 2], [4 5]) = A ([2 2], [4 5]) + B - -a = sparse (A) -b = sparse (B) -i0 = uint64 (i-1) -j0 = uint64 (j-1) - -C2 = GB_mex_assign (a, [], 'plus', b, i0, j0) - -C1 -full (C2.matrix) - -c = sparse ([ 1 2 3 4 5 ]) -i = uint64 (0) -j = uint64 ([ 0 0 4 ]) -a = sparse ([ 10 100 1000]) -e = GB_mex_assign (c, [], 'plus', a, i, j) -e = full (e.matrix) - -ac = accumarray (double (j+1)', full(a)')' -e2 = c ; -e2 (i+1, :) = e2 (i+1, :) + ac -e2 = full (e2) - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + a -e2 = full (e2) - -a = sparse ([ 1000 1000 1000]) -e = GB_mex_assign (c, [], 'plus', a, i, j) -e = full (e.matrix) - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + a -e2 = full (e2) - - -e2 = c ; -e2 (i+1,j+1) = e2 (i+1,j+1) + 1000 -e2 = full (e2) - - -a = sparse ([ 1000 1000 1000]) -e = GB_mex_assign (c, [], '', a, i, j) -e = full (e.matrix) - -e2 = c ; -e2 (i+1,j+1) = a -e2 = full (e2) - -e2 = c ; -e2 (i+1,j+1) = 1000 -e2 = full (e2) - -fprintf ('\ntest55b: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test56.m b/GraphBLAS/Test/unused/test56.m deleted file mode 100644 index 25345f9c5e..0000000000 --- a/GraphBLAS/Test/unused/test56.m +++ /dev/null @@ -1,31 +0,0 @@ -function test56 -%TEST56 test GrB_*_build - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -op.opname = 'min' ; -op.optype = 'uint32' ; - -fprintf ('ktriplets:\n') ; -I = uint64 ([0 0 0]') ; -J = uint64 ([0 0 0]') ; -Xk = int16 ([-93 74 -85]') - -fprintf ('ptriplets:\n') ; -Xp = int16 ([-93 -85 74]') ; - -A1 = GB_mex_Matrix_build (I, J, Xk, 1, 1, op); -A1_matrix = full (double (A1.matrix)) - -A2 = GB_mex_Matrix_build (I, J, Xp, 1, 1, op); -A2_matrix = full (double (A2.matrix)) - -S1 = GB_spec_build (I, J, Xk, 1, 1, op); -S1_matrix = double (S1.matrix) - -S2 = GB_spec_build (I, J, Xp, 1, 1, op); -S2_matrix = double (S2.matrix) - -fprintf ('\ntest56: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test57.m b/GraphBLAS/Test/unused/test57.m deleted file mode 100644 index 293b776fc4..0000000000 --- a/GraphBLAS/Test/unused/test57.m +++ /dev/null @@ -1,18 +0,0 @@ -function test57 (op) -%TEST57 test operator on large uint32 values -% -% Usage: -% test57(op) -% test57 % Default op is 'max' if no arguments given - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - op = 'max' -end - -GB_mex_op (op, uint32(4294967211), uint32(4294967203)) - -fprintf ('\ntest57: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test58.m b/GraphBLAS/Test/unused/test58.m deleted file mode 100644 index dcadd34a75..0000000000 --- a/GraphBLAS/Test/unused/test58.m +++ /dev/null @@ -1,155 +0,0 @@ -function test58 (cover) -%TEST58 test GrB_eWiseAdd - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - cover = 1 ; -end - -fprintf ('\ntest58: ----- quick performance for GB_mex_Matrix_eWiseAdd\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - - -add = 'plus' ; -Mask = [ ] ; -accum = 'plus' ; - -if (~cover) - Prob = ssget (939) ; - A = Prob.A ; - B = 2*A ; - Cin = A .* (A < 0) ; - - tic - C = Cin + (A+B) ; - t1 =toc ; - - tic - C2 = GB_mex_Matrix_eWiseAdd (Cin, Mask, accum, add, A, B, [ ]) ; - t2 = toc ; - assert (isequal (C2.matrix, C)) - - fprintf ('built-in: %g GB: %g speedup: %g\n', t1, t2, t1/t2) ; -end - -if (cover) - nn = [10 100 ] ; -else - nn = [10 100 1000 10000 50000] ; -end - -for m = nn - for n = nn - A = sprandn (m, n, 0.01) ; - B = sprandn (m, n, 0.01) ; - Cin = sprandn (m, n, 0.01) ; - AT = A' ; - BT = B' ; - - if (min (m,n) >= 10000) - trials = 1 ; - else - trials = 20 ; - end - - Dnn = struct ; - Dtn = struct ('inp0', 'tran') ; - Dnt = struct ('inp1', 'tran') ; - Dtt = struct ('inp0', 'tran', 'inp1', 'tran') ; - - % C += A+B - tic - for k = 1:trials - C1 = Cin + (A+B) ; - end - t1 = toc / trials ; - - tic - for k = 1:trials - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], accum, add, A, B, [ ]) ; - end - tg = toc ; - t2 = tg /trials ; - assert (isequal (C1, C2.matrix)) ; - - fprintf ('A+B: ') ; - fprintf ('m %6d n %6d nz %8d: built-in %8.4f GrB %8.4f', ... - m, n, nnz (C1), t1, t2) ; - % fprintf (' Cs: %8.4f', t3) ; - fprintf (' speedup %g\n', t1/t2) ; - - % C += A+B' - tic - for k = 1:trials - C1 = Cin + (A+BT') ; - end - t1 = toc / trials ; - - tic ; - for k = 1:trials - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], accum, add, A, BT, Dnt) ; - end - tg = toc ; - t2 = tg /trials ; - assert (isequal (C1, C2.matrix)) ; - - fprintf ('A+B'': ') ; - fprintf ('m %6d n %6d nz %8d: built-in %8.4f GrB %8.4f', ... - m, n, nnz (C1), t1, t2) ; - % fprintf (' Cs: %8.4f', t3) ; - fprintf (' speedup %g\n', t1/t2) ; - - % C += A'+B - tic - for k = 1:trials - C1 = Cin + (AT'+B) ; - end - t1 = toc / trials ; - - tic - for k = 1:trials - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], accum, add, AT, B, Dtn) ; - end - tg = toc ; - t2 = tg /trials ; - assert (isequal (C1, C2.matrix)) ; - - fprintf ('A''+B: ') ; - fprintf ('m %6d n %6d nz %8d: built-in %8.4f GrB %8.4f', ... - m, n, nnz (C1), t1, t2) ; - % fprintf (' Cs: %8.4f', t3) ; - fprintf (' speedup %g\n', t1/t2) ; - - % C += A'+B' - tic - for k = 1:trials - C1 = Cin + (AT'+BT') ; - end - t1 = toc / trials ; - - tic ; - for k = 1:trials - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], accum, add, AT, BT, Dtt) ; - end - tg = toc ; - t2 = tg /trials ; - assert (isequal (C1, C2.matrix)) ; - - fprintf ('A''+B'': ') ; - fprintf ('m %6d n %6d nz %8d: built-in %8.4f GrB %8.4f', ... - m, n, nnz (C1), t1, t2) ; - % fprintf (' Cs: %8.4f', t3) ; - fprintf (' speedup %g\n', t1/t2) ; - - end -end - -fprintf ('\ntest58: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test59.m b/GraphBLAS/Test/unused/test59.m deleted file mode 100644 index 031868bc5c..0000000000 --- a/GraphBLAS/Test/unused/test59.m +++ /dev/null @@ -1,31 +0,0 @@ -function test59 -%TEST59 test GrB_mxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----- quick test for GB_mex_mxm\n') ; - -A = sparse (rand (4,3)) ; -B = sparse (rand (3,5)) ; -Cin = sparse (rand (4,5)) ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; -accum = 'plus' ; -Mask = [ ] ; -accum = 'plus' ; - -GB_mex_semiring (semiring) - -C0 = Cin + A*B ; - -C = GB_mex_mxm (Cin, Mask, accum, semiring, A, B, [ ]) ; -assert (isequal (C.matrix, C0)) - -C3 = GB_spec_mxm (Cin, Mask, accum, semiring, A, B, [ ]) ; -assert (isequal (C3.matrix, C0)) - -fprintf ('\ntest59: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test60.m b/GraphBLAS/Test/unused/test60.m deleted file mode 100644 index f76ddc39eb..0000000000 --- a/GraphBLAS/Test/unused/test60.m +++ /dev/null @@ -1,30 +0,0 @@ -function test60 -%TEST60 test min and max operators with NaNs - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('min\n') ; -for x = [3 nan inf] - for y = [3 nan inf -inf] - a = min (x, y); - c = min (x, y, 'includenan'); - b = GB_mex_op ('min', x, y) ; - fprintf ('x: %4g y: %4g built-in(omit): %4g built-in(incl): %4g GrB %4g match: %d\n', ... - x, y, a, c, b, isequalwithequalnans (a,b)) ; - end -end - -fprintf ('\nmax\n') ; -for x = [3 nan inf] - for y = [3 nan inf -inf] - a = max (x, y); - c = max (x, y, 'includenan'); - b = GB_mex_op ('max', x, y) ; - fprintf ('x: %4g y: %4g built-in(omit): %4g built-in(incl): %4g GrB %4g match: %d\n', ... - x, y, a, c, b, isequalwithequalnans (a,b)) ; - end -end - -fprintf ('\ntest60: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test61.m b/GraphBLAS/Test/unused/test61.m deleted file mode 100644 index 374a257aee..0000000000 --- a/GraphBLAS/Test/unused/test61.m +++ /dev/null @@ -1,65 +0,0 @@ -function test61 -%TEST61 performance test of GrB_eWiseMult - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----------------------------- eWiseMult performance tests\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -Prob = ssget (2662) -A = Prob.A ; -[m n] = size (A) ; - -B = A ; -A (:, 1:5) = 44 ; - -S = sparse (m,n) ; -fprintf ('\n\nm: %d n %d nnz(A) %d\n', m, n, nnz (A)) ; - -d = nnz (A) / prod (size (A)) ; - - tic - C = A .*B ; - t1 = toc ; - - tic - C2 = GB_mex_Matrix_eWiseMult (S, [ ], [ ], 'times', A, B, [ ]) ; - t2 = toc ; - - fprintf (... - 'd %10.6g nnz(C) %8d built-in %10.6f GB %10.6f speedup %10.4f\n',... - d, nnz (C), t1, t2, t1/t2) ; - - -A = sparse (rand (5000)) ; -[m n] = size (A) ; -S = sparse (m,n) ; -fprintf ('\n\nm: %d n %d nnz(A) %d\n', m, n, nnz (A)) ; - -for d = [0.00001:0.00001:0.0001 0.0002:0.0001: 0.001 0.002:.001:0.01 0.02:0.01:.1 1] - - B = sprandn (m, n, d) ; - - tic - C = A .*B ; - t1 = toc ; - - tic - C2 = GB_mex_Matrix_eWiseMult (S, [ ], [ ], 'times', A, B, [ ]) ; - t2 = toc ; - - fprintf (... - 'd %10.6g nnz(C) %8d built-in %10.6f GB %10.6f speedup %10.4f\n',... - d, nnz (C), t1, t2, t1/t2) ; - - assert (isequal (C, C2.matrix)) ; -end - -fprintf ('\ntest61: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test62.m b/GraphBLAS/Test/unused/test62.m deleted file mode 100644 index d6299ec8fb..0000000000 --- a/GraphBLAS/Test/unused/test62.m +++ /dev/null @@ -1,150 +0,0 @@ -function test62 -%TEST62 test GrB_apply - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n ------------ testing GrB_apply\n') ; - -rng ('default') - -[binops, unary_ops, ~, types, ~, ~] = GB_spec_opsall ; -ops = unary_ops.all ; -accum_ops = binops.all ; -types = types.all ; - -dt = struct ('inp0', 'tran') ; - -% type of the matrix C -for k1 = 1:length (types) - ctype = types {k1} ; - fprintf ('\n%s', ctype) ; - - % type of the matrix A - for k2 = 1:length (types) - atype = types {k2} ; - - % create a matrix - for m = [1 10 25] - for n = [1 10 25] - fprintf ('.') ; - clear A - A.matrix = sprandn (m, n, 0.1) ; - A.class = atype ; - - Mask = (sprandn (m, n, 0.1) ~= 0) ; - MaskT = Mask' ; - - clear B - B.matrix = sprandn (m*n, 1, 0.1) ; - B.class = atype ; - - mask = (sprandn (m*n, 1, 0.1) ~= 0) ; - - clear Cin - Cin.matrix = sprandn (m, n, 0.1) ; - Cin.class = ctype ; - - clear CinT - CinT.matrix = Cin.matrix' ; - CinT.class = ctype ; - - clear Cin2 - Cin2.matrix = sprandn (m*n, 1, 0.1) ; - Cin2.class = ctype ; - - % unary operator - for k3 = 1:length(ops) - unary_op = ops {k3} ; - ntypes = 1;length (types) ; - % fprintf ('unary: %s\n', unary_op) ; - % unary operator type - for k4 = ntypes - clear unary - if (~isempty (unary_op)) - unary_type = types {k4} ; - unary.opname = unary_op ; - unary.optype = unary_type ; - else - unary = '' ; - unary_type = '' ; - end - - try - GB_spec_operator (unary_op) ; - catch - continue - end - - % accum operator - for k5 = 0:length(accum_ops) - if (k5 == 0) - accum_op = '' ; - ntypes = 1 ; - else - accum_op = accum_ops {k5} ; - ntypes = 1;length (types) ; - end - % accum operator type - for k6 = ntypes - clear accum - if (~isempty (accum_op)) - accum_type = types {k6} ; - accum.opname = accum_op ; - accum.optype = accum_type ; - else - accum = '' ; - accum_type = '' ; - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - GB_spec_operator (accum) ; - catch - continue - end - - % apply to A, no mask - C1 = GB_mex_apply (Cin, [ ], accum, unary, A, [ ]) ; - C2 = GB_spec_apply (Cin, [ ], accum, unary, A, [ ]) ; - GB_spec_compare (C1, C2) ; - - % apply to A', no mask - C2 = GB_spec_apply (CinT, [ ], accum, unary, A, dt) ; - C1 = GB_mex_apply (CinT, [ ], accum, unary, A, dt) ; - GB_spec_compare (C1, C2) ; - - % apply to vector B, no mask - C1 = GB_mex_apply (Cin2, [ ], accum, unary, B, [ ]) ; - C2 = GB_spec_apply (Cin2, [ ], accum, unary, B, [ ]) ; - GB_spec_compare (C1, C2) ; - - % apply to A, with mask - C1 = GB_mex_apply (Cin, Mask, accum, unary, A, [ ]) ; - C2 = GB_spec_apply (Cin, Mask, accum, unary, A, [ ]) ; - GB_spec_compare (C1, C2) ; - - % apply to A', with mask - C1 = GB_mex_apply (CinT, MaskT, accum, unary, A, dt) ; - C2 = GB_spec_apply (CinT, MaskT, accum, unary, A, dt) ; - GB_spec_compare (C1, C2) ; - - % apply to vector B, with mask - C1 = GB_mex_apply (Cin2, mask, accum, unary, B, [ ]) ; - C2 = GB_spec_apply (Cin2, mask, accum, unary, B, [ ]) ; - GB_spec_compare (C1, C2) ; - - end - end - end - end - end - end - end -end - -fprintf ('\ntest62: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test63.m b/GraphBLAS/Test/unused/test63.m deleted file mode 100644 index 221c85170b..0000000000 --- a/GraphBLAS/Test/unused/test63.m +++ /dev/null @@ -1,104 +0,0 @@ -function test63 -%TEST63 test GraphBLAS binary operators - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -ops = binops.all ; -types = types.all ; - -fprintf ('\n ---------------------------- testing GB_mex_op\n') ; - -rng ('default') ; - -n_operators = 0 ; -for k2 = 1:length(ops) - mulop = ops {k2} ; - if (GB_spec_is_positional (mulop)) - continue - end - fprintf ('\n%-10s ', mulop) ; - - for k1 = 1:length (types) - type = types {k1} ; - - % create the op - clear op - op.opname = mulop ; - op.optype = type ; - - try - GB_spec_operator (op) ; - catch - continue ; - end - - switch (mulop) - case { 'pow' } - xlimits = [0, 5] ; - ylimits = [0, 5] ; - case { 'ldexp' } - xlimits = [-5, 5] ; - ylimits = [-5, 5] ; - otherwise - xlimits = [ ] ; - ylimits = [ ] ; - end - - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - fprintf ('.') ; - - for m = [ 1:3:10 ]% 100] - for n = [1:3:10 ]% 100] - for hi = [-1:5 200] - for lo = [-3:5 100] - A = full ((hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5)); - B = full ((hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5)); - - if (~isempty (xlimits)) - A = max (A, xlimits (1)) ; - A = min (A, xlimits (2)) ; - end - if (~isempty (ylimits)) - B = max (B, ylimits (1)) ; - B = min (B, ylimits (2)) ; - end - - % use pure GraphBLAS - Z1 = GB_mex_op (op, A, B) ; - % use built-in methods as much as possible - Z2 = GB_spec_op (op, A, B) ; - % the results should either match perfectly - assert (isequal (isnan (Z1), isnan (Z2))) - assert (isequal (isfinite (Z1), isfinite (Z2))) - if (isequalwithequalnans (Z1, Z2)) - continue ; - else - % ... or within roundoff error - mask = isfinite (Z1) ; - err = norm (Z1 (mask) - Z2 (mask), inf) ; - err = err / max (1, norm (Z1 (mask), inf)) ; - assert (err < tol) ; - end - end - end - end - end - n_operators = n_operators + 1 ; - end -end - -fprintf ('\nall tests passed\n') ; - -fprintf ('Number of built-in GraphBLAS operators: %d\n', n_operators) ; - -fprintf ('\ntest63: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test64.m b/GraphBLAS/Test/unused/test64.m deleted file mode 100644 index aaf0fd9e19..0000000000 --- a/GraphBLAS/Test/unused/test64.m +++ /dev/null @@ -1,42 +0,0 @@ -function test64 -%TEST64 test GxB_*_subassign, scalar expansion, with and without duplicates - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n ------------------- quick test of GxB_*_subassign_scalar\n') ; - -Corig = sparse (rand (5,4)) ; - -% no accum, no duplicates in I -C = Corig ; -I = [2 3 5] ; -J = [1 3] ; -C (I,J) = 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_subassign (Corig, [], [], sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -% no accum, with duplicates in I -C = Corig ; -I = [2 2 5] ; -J = [1 3] ; -C (I,J) = 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_subassign (Corig, [], [], sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -% accum 'plus', no duplicates in I -C = Corig ; -I = [2 3 5] ; -J = [1 3] ; -C (I,J) = C (I,J) + 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_subassign (Corig, [], 'plus', sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -fprintf ('\ntest64: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test64b.m b/GraphBLAS/Test/unused/test64b.m deleted file mode 100644 index 337f3b4296..0000000000 --- a/GraphBLAS/Test/unused/test64b.m +++ /dev/null @@ -1,43 +0,0 @@ -function test64b -%TEST64B test GrB_*_assign, scalar expansion, with and without duplicates - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n ------------------- quick test of GrB_*_assign_scalar\n') ; - -Corig = sparse (rand (5,4)) ; - -% no accum, no duplicates in I -C = Corig ; -I = [2 3 5] ; -J = [1 3] ; -C (I,J) = 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_assign (Corig, [], [], sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -% no accum, with duplicates in I -C = Corig ; -I = [2 2 5] ; -J = [1 3] ; -C (I,J) = 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_assign (Corig, [], [], sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -% accum 'plus', no duplicates in I -C = Corig ; -I = [2 3 5] ; -J = [1 3] ; -C (I,J) = C (I,J) + 100 ; -I0 = uint64 (I-1) ; -J0 = uint64 (J-1) ; -C2 = GB_mex_assign (Corig, [], 'plus', sparse (100), I0, J0, []) ; -assert (isequal (C, C2.matrix)) - -fprintf ('\ntest64b: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test65.m b/GraphBLAS/Test/unused/test65.m deleted file mode 100644 index e8f4b54865..0000000000 --- a/GraphBLAS/Test/unused/test65.m +++ /dev/null @@ -1,54 +0,0 @@ -function test65 -%TEST65 test type casting - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -X = logical (rand (4) > 0.5) ; -C = GB_mex_cast (X, 'logical', 1) ; -assert (isequal (X,C)) ; - - A = 100 * randn (4) ; - - X = int8 (A) ; - C = GB_mex_cast (X, 'int8', 1) ; - assert (isequal (X,C)) ; - - X = uint8 (A) ; - C = GB_mex_cast (X, 'uint8', 1) ; - assert (isequal (X,C)) ; - - X = int16 (A) ; - C = GB_mex_cast (X, 'int16', 1) ; - assert (isequal (X,C)) ; - - X = uint16 (A) ; - C = GB_mex_cast (X, 'uint16', 1) ; - assert (isequal (X,C)) ; - - X = int32 (A) ; - C = GB_mex_cast (X, 'int32', 1) ; - assert (isequal (X,C)) ; - - X = uint32 (A) ; - C = GB_mex_cast (X, 'uint32', 1) ; - assert (isequal (X,C)) ; - - X = int32 (A) ; - C = GB_mex_cast (X, 'int32', 1) ; - assert (isequal (X,C)) ; - - X = uint32 (A) ; - C = GB_mex_cast (X, 'uint32', 1) ; - assert (isequal (X,C)) ; - - X = single (A) ; - C = GB_mex_cast (X, 'single', 1) ; - assert (isequal (X,C)) ; - - X = double (A) ; - C = GB_mex_cast (X, 'double', 1) ; - assert (isequal (X,C)) ; - - fprintf ('\ntest65: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test66.m b/GraphBLAS/Test/unused/test66.m deleted file mode 100644 index 60944833db..0000000000 --- a/GraphBLAS/Test/unused/test66.m +++ /dev/null @@ -1,125 +0,0 @@ -function test66 -%TEST66 test GrB_reduce - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest66: ---- quick test for GrB_reduce_to_scalar and vector\n') ; - -rng ('default') ; -A = sparse (rand (4,3)) ; -x = full (sum (sum (A))) + 3.1416 -c = GB_mex_reduce_to_scalar (3.1416, 'plus', 'plus', A) ; -assert (isequal (x,c)) - -tic -x = full (sum (sum (A))) ; -toc -tic -y = GB_mex_reduce_to_scalar (0, '', 'plus', A) ; -toc -assert (norm(x-y) < nnz (A) * eps * norm(x)) - -tic -x = full (sum (A (:))) ; -toc -tic -y = GB_mex_reduce_to_scalar (0, '', 'plus', A) ; -toc -assert (norm(x-y) < nnz (A) * eps * norm(x)) -% assert (isequal (x,y)) - - -% reduce to vector -y = sparse (4,1) ; -y = GB_mex_reduce_to_vector (y, [ ], '', 'plus', A) ; -y0 = sum (A')' ; -err = norm (y.matrix - y0) / norm (y0) ; -assert (err < 1e-14) ; -% assert (isequal (y.matrix, sum (A')')) - -clear d -d.inp0 = 'tran' ; -y = sparse (3,1) ; -y = GB_mex_reduce_to_vector (y, [ ], '', 'plus', A, d) ; -y0 = sum (A)' ; -err = norm (y.matrix - y0) / norm (y0) ; -assert (err < 1e-14) ; -% assert (isequal (y.matrix, sum (A)')) - -A = sprand (3e6, 3e6, 2e-6) ; -n = size (A,1) ; -yin = sparse (rand (n,1)) ; -fprintf ('\nbig matrix with %g million entries\n', nnz (A)/ 1e6) ; - -% sum across the rows -fprintf ('row sum with accum:\n') ; -tic -y2 = yin + (sum (A,2)) ; -t1 = toc ; -tic -y = GB_mex_reduce_to_vector (yin, [ ], 'plus', 'plus', A) ; -t2 = toc ; -fprintf ('builtin: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -y1 = 1*y.matrix ; -err = norm (y1-y2,1) / norm (y2,1) ; -assert (err < 1e-14) -% assert (isequal (y.matrix, y2)) - -% sum across the rows (no accum) -fprintf ('row sum no accum:\n') ; -tic -y2 = (sum (A,2)) ; -t1 = toc ; -tic -y = GB_mex_reduce_to_vector (yin, [ ], [ ], 'plus', A) ; -t2 = toc ; -fprintf ('builtin: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -y1 = 1*y.matrix ; -err = norm (y1-y2,1) / norm (y2,1) ; -assert (err < 1e-14) -% assert (isequal (y.matrix, y2)) - -% sum down the columns -fprintf ('col sum with accum:\n') ; -yinrow = yin' ; -tic -y2 = yinrow + (sum (A,1)) ; -t1 = toc ; -tic -y = GB_mex_reduce_to_vector (yin, [ ], 'plus', 'plus', A, d) ; -t2 = toc ; -fprintf ('builtin: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -y1 = 1*y.matrix ; -err = norm (y1-y2',1) / norm (y2,1) ; -assert (err < 1e-14) -% assert (isequal (y.matrix, y2')) - -% sum down the columns -fprintf ('col sum no accum:\n') ; -yempty = sparse (n,1) ; -tic -y2 = (sum (A,1)) ; -t1 = toc ; -tic -y = GB_mex_reduce_to_vector (yempty, [ ], [ ], 'plus', A, d) ; -t2 = toc ; -fprintf ('builtin: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -y1 = 1*y.matrix ; -err = norm (y1-y2',1) / norm (y2,1) ; -assert (err < 1e-14) -% assert (isequal (y.matrix, y2')) - -% reduce to scalar -fprintf ('to scalar:\n') ; -tic -x = full (sum (sum (A))) ; -t1 = toc ; -tic -y = GB_mex_reduce_to_scalar (0, '', 'plus', A) ; -t2 = toc ; -fprintf ('builtin: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -assert (norm(x-y) < nnz (A) * eps * norm(x)) - -fprintf ('\ntest66: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test67.m b/GraphBLAS/Test/unused/test67.m deleted file mode 100644 index e809b927a5..0000000000 --- a/GraphBLAS/Test/unused/test67.m +++ /dev/null @@ -1,36 +0,0 @@ -function test67 -%TEST67 test GrB_apply - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n---------------------------- quick test of GrB_apply\n') ; - -A = sparse (rand (4,3)) ; -C = sparse (rand (4,3)) ; - -C0 = GB_mex_apply (C, [ ], '', 'ainv', A) ; -C1 = -A ; -assert (isequal (full (C0.matrix), C1)) - -C0 = GB_mex_apply (C, [ ], 'plus', 'identity', A) ; -C1 = C + A ; -assert (isequal (full (C0.matrix), C1)) - -C0 = GB_mex_apply (C, [ ], 'times', 'minv', A) ; -C1 = C .* (1./ A) ; -assert (isequal (full (C0.matrix), C1)) - -d = struct ('inp0', 'tran') ; -C0 = GB_mex_apply (C', [ ], 'times', 'ainv', A, d) ; -C1 = C' .* (-A') ; -assert (isequal (full (C0.matrix), C1)) - -A = sparse (zeros (4,3)) ; -C0 = GB_mex_apply (A', [ ], 'plus', 'ainv', A, d) ; -assert (nnz (C0.matrix) == 0) -C0 = GB_mex_apply (A, [ ], '', 'ainv', A) ; -assert (nnz (C0.matrix) == 0) - -fprintf ('\ntest67: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test68.m b/GraphBLAS/Test/unused/test68.m deleted file mode 100644 index 85593e7368..0000000000 --- a/GraphBLAS/Test/unused/test68.m +++ /dev/null @@ -1,97 +0,0 @@ -function test68(n) -%TEST68 performance tests for eWiseMult - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest68 --------------------------- quick test of GrB_eWiseMult\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; - -if (nargin < 1) - n = 3000 ; -end - -A = sparse (rand (n)) ; -B = sparse (rand (n)) ; -C = sparse (n,n) ; - -for trial = 1:2 - % C = A.*B, no mask - Afull = full (A) ; - Bfull = full (B) ; - - tic - C0 = Afull .* Bfull ; - tf = toc ; - fprintf ('built-in, full: %0.4f\n', tf) ; - - tic - C0 = A .* B ; - t0 = toc ; - - tic - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], 'times', A, B, [ ]); - t1 = toc ; - fprintf ('built-in %0.4f GB %0.4f speedup %g\n', t0, t1, t0/t1) ; - assert (isequal (C0, C1.matrix)) ; -end - -A = sprand (n, n, 0.001) ; - - % C = A.*B, no mask - tic - C0 = A .* B ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], 'times', A, B, [ ]); - t1 = toc ; - fprintf ('built-in %0.4f GB %0.4f speedup %g\n', t0, t1, t0/t1) ; - assert (isequal (C0, C1.matrix)) ; - -A = sparse (n, n) ; -A (n,:) = 1 ; - - % C = A.*B, no mask - tic - C0 = A .* B ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], 'times', A, B, [ ]); - t1 = toc ; - fprintf ('built-in %0.4f GB %0.4f speedup %g\n', t0, t1, t0/t1) ; - assert (isequal (C0, C1.matrix)) ; - -A = sparse (n, n) ; -A (1,:) = 1 ; - - % C = A.*B, no mask - tic - C0 = A .* B ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], 'times', A, B, [ ]); - t1 = toc ; - fprintf ('built-in %0.4f GB %0.4f speedup %g\n', t0, t1, t0/t1) ; - assert (isequal (C0, C1.matrix)) ; - -for d = [0.000:0.002:0.1] - A = sprand (n, n, d) ; - - % C = A.*B, no mask - tic - C0 = A .* B ; - t0 = toc ; - tic - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], 'times', A, B, [ ]); - t1 = toc ; - fprintf ('d %8.3f built-in %0.4f GB %0.4f speedup %g\n', d, t0, t1, t0/t1) ; - assert (isequal (C0, C1.matrix)) ; -end - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test72.m b/GraphBLAS/Test/unused/test72.m deleted file mode 100644 index a1b282b625..0000000000 --- a/GraphBLAS/Test/unused/test72.m +++ /dev/null @@ -1,70 +0,0 @@ -function test72 -%TEST72 special cases for mxm, ewise, ... - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n--------------test72: special cases\n') ; - -rng ('default') ; -clear - -dnt = struct ( 'inp1', 'tran' ) ; -dtn = struct ( 'inp0', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; - -n = 20 ; -p = randperm (n) ; -A = speye (n) ; -A = A (p,p) ; -B = sprand (n, n, 0.2) ; -Z = sparse (n, n) ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - -Mask = sparse (ones (n)) ; -C0 = GB_spec_mxm (Z, Mask, [ ], semiring, A, B, dtt); -C1 = GB_mex_mxm (Z, Mask, [ ], semiring, A, B, dtt); - -C2 = (A'*B') .* Mask ; -GB_spec_compare (C0, C1, 0) ; -assert (isequal (C2, C0.matrix)) ; - -M = GB_mex_Matrix_eWiseAdd (Z, [ ], [ ], 'minus', Mask, Mask, [ ]) ; -C0 = GB_spec_mxm (Z, M.matrix, [ ], semiring, A, B, dtn); -C1 = GB_mex_mxm (Z, M.matrix, [ ], semiring, A, B, dtn); -GB_spec_compare (C0, C1, 0) ; -assert (isequal (Z, sparse (C0.matrix))) ; - -n = 500 ; -% n = 4 ; -A = speye (n) ; -% A = sparse (rand (n)) ; -B = sparse (rand (n)) ; -Z = sparse (n,n) ; - -C0 = GB_mex_Matrix_eWiseMult (Z, [ ], [ ], 'times', A, B, [ ]) ; -C1 = A .* B ; -assert (isequal (C1, sparse (C0.matrix))) ; - -C0 = GB_mex_Matrix_eWiseMult (Z, [ ], [ ], 'times', B, A, [ ]) ; -C1 = B .* A ; -assert (isequal (C1, sparse (C0.matrix))) ; - -A = logical (A) ; -C0 = GB_mex_Matrix_eWiseMult (Z, [ ], [ ], 'times', A, B, [ ]) ; -C1 = double (A) .* B ; -assert (isequal (C1, sparse (C0.matrix))) ; - -C0 = GB_mex_Matrix_eWiseMult (Z, [ ], [ ], 'times', B, A, [ ]) ; -C1 = B .* double (A) ; -assert (isequal (C1, sparse (C0.matrix))) ; - -M = sprand (n, n, 0.01) ; -C0 = GB_mex_mxm (Z, M, [ ], semiring, A, B, dnt) ; -C1 = (A*B') .* spones (M) ; -assert (isequal (C1, sparse (C0.matrix))) ; - -fprintf ('test72: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test73.m b/GraphBLAS/Test/unused/test73.m deleted file mode 100644 index c2a8f1ceb7..0000000000 --- a/GraphBLAS/Test/unused/test73.m +++ /dev/null @@ -1,84 +0,0 @@ -function test73 -%TEST73 performance of C = A*B, with mask - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n----------------- C=A*B performance\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -Prob = ssget (1338) -A = Prob.A ; - - % remove the diagonal and extract L and U - A = spones (A) ; - A = spones (A+A') ; - L = tril (A,-1) ; - U = triu (A,1) ; - A = L + U ; - n = size (A,1) ; - nz = nnz (L) ; - - semiring.multiply = 'times' ; - semiring.add = 'plus' ; - semiring.class = 'double' ; - -Cin = sparse (n, n) ; -S = spones (L) ; - -dnn = [ ] ; -dtn = struct ('inp0', 'tran') ; - -% no mask --------------------------------------------- -tic -C1 = GB_mex_mxm (Cin, [ ], [ ], semiring, L, L, dnn); -t1 = toc ; -fprintf ('mxm, no mask %g\n', t1) ; - -tic -C1 = GB_mex_mxm (Cin, [ ], [ ], semiring, L, L, dnn); -t1 = toc ; -fprintf ('mxm, no mask %g\n', t1) ; - -tic -C2 = L*L ; -t2 = toc ; -fprintf ('built-in, no mask %g\n', t2) ; - -% with mask --------------------------------------------- - -tic -C2b = (L*L) .* L ; -t2 = toc ; -fprintf ('built-in, mask %g\n', t2) ; - -tic -C3 = GB_mex_mxm (Cin, L, [ ], semiring, L, L, dnn); -t3 = toc ; -fprintf ('mxm, with mask %g\n', t3) ; - -tic -C5 = GB_mex_mxm (Cin, [ ], [ ], semiring, L, L, dnn); -C5.matrix = C5.matrix .* L ; -t3 = toc ; -fprintf ('mxm, then emult %g\n', t3) ; - -tic -C4 = GB_mex_mxm (Cin, C2, [ ], semiring, L, L, dnn); -t4 = toc ; -fprintf ('mxm, with mask C %g\n', t4) ; - -tic -C5 = GB_mex_mxm (Cin, L, [ ], semiring, U, L, dtn); -t5 = toc ; -fprintf ('mxm, with mask L %g (dot)\n', t5) ; - -assert (isequal (C2, C1.matrix)) ; -assert (isequal (C2 .* spones (L), C3.matrix)) ; -assert (isequal (C2, C4.matrix)) ; -assert (isequal (C2b, C5.matrix)) ; -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test75.m b/GraphBLAS/Test/unused/test75.m deleted file mode 100644 index 4c8da0addc..0000000000 --- a/GraphBLAS/Test/unused/test75.m +++ /dev/null @@ -1,186 +0,0 @@ -function test75 -%TEST75 test GrB_mxm and GrB_vxm on all semirings - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -% mult_ops = binops.positional ; -mult_ops = binops.all ; -types = types.all ; - -rng ('default') ; - -m = 200 ; -n = 5 ; -A_sparse = sprandn (m, n, 0.1) ; -A_sparse (:,3) = 0 ; -A_sparse (2,3) = 1.7 ; -A_sparse (18,3) = 2.2 ; -A_sparse (:,1:2) = sparse (rand (m,2)) ; -A_sparse (1,1) = 0; -A_sparse (18,1) = 0; -A_sparse (:,5) = 0 ; -A_sparse (1,5) = 11 ; -A_sparse (2,5) = 23 ; -A_sparse (18,5) = 33 ; - -B_sparse = sprandn (m, n, 0.1) ; -B_sparse (:,1) = 0 ; -B_sparse (1,1) = 3 ; -B_sparse (18,1) = 2 ; -B_sparse (:,[2 n]) = sparse (rand (m,2)) ; -B_sparse (3,2) = 0 ; -B_sparse (18,2) = 0 ; -A_sparse (:,3) = 0 ; -B_sparse (2,1) = 7 ; -B_sparse (18,1) = 8 ; -B_sparse (19,1) = 9 ; - -x_sparse = sparse (rand (m,1)) ; -x_sparse (99) = 0 ; - -y_sparse = sparse (zeros (m,1)) ; -y_sparse (99) = 1 ; - -A.matrix = A_sparse ; -A.class = 'see below' ; -A.pattern = logical (spones (A_sparse)) ; - -B.matrix = B_sparse ; -B.class = 'see below' ; -B.pattern = logical (spones (B_sparse)) ; - -X.matrix = x_sparse ; -X.class = 'see below' ; -X.pattern = logical (spones (x_sparse)) ; - -Y.matrix = y_sparse ; -Y.class = 'see below' ; -Y.pattern = logical (spones (y_sparse)) ; - -fprintf ('\n-------------- GrB_mxm, vxm (dot product) on all semirings\n') ; - -Cin = sparse (n, n) ; - -Din = 10 * sparse (rand (n, n)) ; -D.matrix = Din ; -D.class = 'see below' ; -D.pattern = true (n,n) ; - -Xin = sparse (n, 1) ; - -Mask = sparse (ones (n,n)) ; -mask = sparse (ones (n,1)) ; - -dnn = struct ; -dtn = struct ( 'inp0', 'tran' ) ; -dtn_dot = struct ( 'inp0', 'tran', 'axb', 'dot' ) ; -dtn_saxpy = struct ( 'inp0', 'tran', 'axb', 'saxpy' ) ; -dnt = struct ( 'inp1', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; - -n_semirings = 0 ; - -for k1 = 1:length(mult_ops) - mulop = mult_ops {k1} ; - fprintf ('\n%s', mulop) ; - - for k2 = 1:length(add_ops) - addop = add_ops {k2} ; - - for k3 = 1:length (types) - semiring_type = types {k3} ; - - semiring.multiply = mulop ; - semiring.add = addop ; - semiring.class = semiring_type ; - - % create the semiring. some are not valid because the or,and,xor,eq - % monoids can only be used when z is boolean for z=mult(x,y). - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype xtype ytype] = GB_spec_operator (mult_op) ; - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add, add_optype) ; - catch - continue - end - - A.class = semiring_type ; - B.class = semiring_type ; - X.class = semiring_type ; - Y.class = semiring_type ; - D.class = add_op.optype ; - - n_semirings = n_semirings + 1 ; - fprintf ('.') ; - - % C = A'*B, with mask - C1 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dtn_dot); - C2 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - C1 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dtn_saxpy); - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C dense, typecasting of C - C1 = GB_mex_mxm (Din, Mask, add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (Din, Mask, add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - C1 = GB_mex_mxm (Din, Mask, add_op, semiring, A, B, dtn_saxpy) ; - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C dense, no typecasting of C - C1 = GB_mex_mxm (D, Mask, add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (D, Mask, add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - C1 = GB_mex_mxm (D, Mask, add_op, semiring, A, B, dtn_saxpy) ; - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C dense, typecasting of C - C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (Din, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_saxpy) ; - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C dense, no typecasting of C - C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (D, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_saxpy) ; - GB_spec_compare (C1, C2, id) ; - - % X = u*A, with mask - C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - GB_spec_compare (C1, C2, id) ; - - if (k3 == 1) - % repeat but with typecasting, to test generic A'*B - A.class = 'double' ; - - % C = A'*B, with mask - C1 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dtn); - C2 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dtn); - GB_spec_compare (C1, C2, id) ; - - % X = u*A, with mask - C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]); - C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]); - GB_spec_compare (C1, C2, id) ; - - % X = u*A, with mask - C1 = GB_mex_vxm (Xin, mask, [ ], semiring, Y, A, [ ]); - C2 = GB_spec_vxm (Xin, mask, [ ], semiring, Y, A, [ ]); - GB_spec_compare (C1, C2, id) ; - - end - end - end -end - -n_semirings - -fprintf ('\ntest75: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test77.m b/GraphBLAS/Test/unused/test77.m deleted file mode 100644 index e860cad700..0000000000 --- a/GraphBLAS/Test/unused/test77.m +++ /dev/null @@ -1,243 +0,0 @@ -function test77 (fulltest) -%TEST77 test GrB_kronecker - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% TODO: this test takes too long; cut it down - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; - -if (nargin < 1) - fulltest = 0 ; -end - -if (fulltest) - fprintf ('--------------lengthy tests of GrB_kronecker\n') ; - k1test = 1:length(types) ; -else - fprintf ('--------------quick tests of GrB_kronecker\n') ; - k1test = [4 5 10 11] ; -end - -rng ('default') ; - -dnn = struct ; -dtn = struct ( 'inp0', 'tran' ) ; -dnt = struct ( 'inp1', 'tran' ) ; -dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; - -n_semirings = 0 ; -for k1 = k1test - type = types {k1} ; - - fprintf ('\n%s:\n', type) ; - - if (fulltest) - k2test = 1:length(binops) ; - else - k2test = [45:52 45 4 7] ; - end - - for k2 = k2test - - binop = binops {k2} ; - op.opname = binop ; - op.optype = type ; - if (GB_spec_is_positional (op.opname)) - if (~(isequal (type, 'int32') || isequal (type, 'int64'))) - continue - end - end - - try - GB_spec_operator (op) ; - catch - continue - end - - fprintf ('\n binary op: [ %s %s ] ', binop, type) ; - - for k4 = [0 randi([0,length(binops)], 1, 3)] % 0:length(binops) - - clear accum - if (k4 == 0) - accum = '' ; - ntypes = 1 ; - fprintf ('\n accum: [ none ]') ; - else - if (GB_spec_is_positional (op.opname)) - continue ; - end - accum.opname = binops {k4} ; - if (GB_spec_is_positional (accum.opname)) - continue ; - end - ntypes = length (types) ; - fprintf ('\n accum: %s ', accum.opname) ; - end - - for k5 = randi ([1 ntypes], 1, 3) % ntypes - - if (k4 > 0) - accum.optype = types {k5} ; - end - - if (GB_spec_is_positional (accum)) - continue ; - end - - try - GB_spec_operator (accum) ; - catch - continue - end - - if (~isempty (accum)) - fprintf ('%s ', accum.optype) ; - end - - for Mask_complement = [false true] - - if (Mask_complement) - dnn.mask = 'complement' ; - dtn.mask = 'complement' ; - dnt.mask = 'complement' ; - dtt.mask = 'complement' ; - else - dnn.mask = 'default' ; - dtn.mask = 'default' ; - dnt.mask = 'default' ; - dtt.mask = 'default' ; - end - - for C_replace = [false true] - - if (C_replace) - dnn.outp = 'replace' ; - dtn.outp = 'replace' ; - dnt.outp = 'replace' ; - dtt.outp = 'replace' ; - else - dnn.outp = 'default' ; - dtn.outp = 'default' ; - dnt.outp = 'default' ; - dtt.outp = 'default' ; - end - - % try some matrices - for am = 5 % % Was [1 5 10 ] - for an = 3 % [1 10 ] % Was [ 1 5 10 ] - for bm = 4 % % Was [1 4 9 ] - for bn = 2 % % Was [1 4 9 ] - fprintf ('.') ; - - Ax= sparse (100 * sprandn (am,an, 0.5)); - Bx= sparse (100 * sprandn (bm,bn, 0.5)); - cm = am * bm ; - cn = an * bn ; - Cx= sparse (100 * sprandn (cm,cn, 0.2)); - Mask = sprandn (cm,cn,0.2) ~= 0 ; - AT = Ax' ; - BT = Bx' ; - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - for B_is_hyper = 0:1 - for B_is_csc = 0:1 - for C_is_hyper = 0:1 - for C_is_csc = 0:1 - - clear A - A.matrix = Ax ; - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - - clear B - B.matrix = Bx ; - B.is_hyper = B_is_hyper ; - B.is_csc = B_is_csc ; - - clear C - C.matrix = Cx ; - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - - %--------------------------------------- - % kron(A,B) - %--------------------------------------- - - % C = kron(A,B) - C0 = GB_spec_kron (C, [ ], accum, op, A, B, dnn); - C1 = GB_mex_kron (C, [ ], accum, op, A, B, dnn); - GB_spec_compare (C0, C1) ; - - % C = kron(A,B) with Mask - C0 = GB_spec_kron (C, Mask, accum, op, A, B, dnn); - C1 = GB_mex_kron (C, Mask, accum, op, A, B, dnn); - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % kron(A',B) - %--------------------------------------- - - % C = kron(A',B), no Mask - C0 = GB_spec_kron (C, [ ], accum, op, AT, B, dtn); - C1 = GB_mex_kron (C, [ ], accum, op, AT, B, dtn); - GB_spec_compare (C0, C1) ; - - % C = kron(A',B), with Mask - C0 = GB_spec_kron (C, Mask, accum, op, AT, B, dtn); - C1 = GB_mex_kron (C, Mask, accum, op, AT, B, dtn); - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % kron(A,B') - %--------------------------------------- - - % no mask - C0 = GB_spec_kron (C, [ ], accum, op, A, BT, dnt); - C1 = GB_mex_kron (C, [ ], accum, op, A, BT, dnt); - GB_spec_compare (C0, C1) ; - - % with mask - C0 = GB_spec_kron (C, Mask, accum, op, A, BT, dnt); - C1 = GB_mex_kron (C, Mask, accum, op, A, BT, dnt); - GB_spec_compare (C0, C1) ; - - %--------------------------------------- - % kron(A',B') - %--------------------------------------- - - % no Mask - C0 = GB_spec_kron (C, [ ], accum, op, AT, BT, dtt); - C1 = GB_mex_kron (C, [ ], accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1) ; - - % with mask - C0 = GB_spec_kron (C, Mask, accum, op, AT, BT, dtt); - C1 = GB_mex_kron (C, Mask, accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1) ; - - end - end - end - end - end - end - -end -end -end -end -end -end -end -end -end -end - -fprintf ('\ntest77: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test79.m b/GraphBLAS/Test/unused/test79.m deleted file mode 100644 index 0975acf6b2..0000000000 --- a/GraphBLAS/Test/unused/test79.m +++ /dev/null @@ -1,20 +0,0 @@ -function test79 -%TEST79 run all matrices with test06 - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -index = ssget ; -f = find (index.nrows == index.ncols & index.isReal & index.nrows > 1000) ; - -[ignore i] = sort (index.nnz (f)) ; - -f = f (i) ; -nmat = length (f) ; - -for k = 1:nmat - id = f (k) ; - Prob = ssget (id, index) - A = Prob.A ; - test06 (A, A, 0) ; -end diff --git a/GraphBLAS/Test/unused/test84_orig.m b/GraphBLAS/Test/unused/test84_orig.m deleted file mode 100644 index 21adaea128..0000000000 --- a/GraphBLAS/Test/unused/test84_orig.m +++ /dev/null @@ -1,37 +0,0 @@ -function test84 -%TEST84 test GrB_assign (row and column with C in CSR format) - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; -m = 10 ; -n = 20 ; - -% create a CSR matrix -C0 = GB_spec_random (m, n, 0.5, 100, 'double', false, false) ; - -Mcol = sparse (ones (m,1)) ; % spones (sprandn (m, 1, 0.5)) ; -Mrow = sparse (ones (n,1)) ; % spones (sprandn (n, 1, 0.5)) ; - -Acol = sprandn (4, 1, 0.5) ; -Arow = sprandn (4, 1, 0.5) ; - -J = [3 4 5 6] ; -J0 = uint64 (J) - 1 ; -I = 2 ; -I0 = uint64 (I) - 1 ; - -% row assign -C1 = GB_mex_assign (C0, Mrow, 'plus', Arow, I0, J0, [ ], 2) ; -C2 = GB_spec_Row_assign (C0, Mrow, 'plus', Arow, I, J, [ ]) ; -GB_spec_compare (C1, C2) ; - -% col assign -C1 = GB_mex_assign (C0, Mcol, 'plus', Acol, J0, I0, [ ], 1) ; -C2 = GB_spec_Col_assign (C0, Mcol, 'plus', Acol, J, I, [ ]) ; -GB_spec_compare (C1, C2) ; - -fprintf ('\ntest84: all tests passed\n') ; - - diff --git a/GraphBLAS/Test/unused/test85.m b/GraphBLAS/Test/unused/test85.m deleted file mode 100644 index 066a3f36cc..0000000000 --- a/GraphBLAS/Test/unused/test85.m +++ /dev/null @@ -1,17 +0,0 @@ -function test85 -%TEST85 test GrB_transpose: 1-by-n with typecasting - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -A.matrix = sparse ([ 1 2 3 4]) ; -A.class = 'single' ; - -C.matrix = sparse (4,1) ; -C.class = 'double' ; - -C2 = GB_mex_transpose (C, [ ], [ ], A, [ ]) ; -assert (isequal (A.matrix', C2.matrix)) ; - -fprintf ('\ntest85: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test86.m b/GraphBLAS/Test/unused/test86.m deleted file mode 100644 index ff5e8d9fae..0000000000 --- a/GraphBLAS/Test/unused/test86.m +++ /dev/null @@ -1,200 +0,0 @@ -function test86 -%TEST86 performance test of of GrB_Matrix_extract - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test86: performance test of of GrB_Matrix_extract\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; - -rng ('default') ; -nthreads_max = 2*GB_mex_omp_max_threads ; -nthread_list = [1 2 3 4 8 16 32 40 64 128 160 256] ; -nthread_list = nthread_list (nthread_list <= nthreads_max) ; - -Prob = ssget (2662) - -A = Prob.A ; -n = size (A,1) ; - -fprintf ('\nrandperm==========================================================:\n') ; -J = randperm (n) ; -I = randperm (n) ; -for subset = [n 1e6 1e4 100] - fprintf ('\nC = A (length %d randperm, length %d randperm)\n', subset, subset) ; - I2 = I (1:subset) ; - J2 = J (1:subset) ; - tic ; - C = A (I2,J2) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - I0 = uint64 (I2) - 1 ; - J0 = uint64 (J2) - 1 ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I0, J0) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end -end - -clear I0 J0 I2 J2 - -fprintf ('\nrandperm==========================================================:\n') ; -for subset = [n 1e6 1e4 100] - fprintf ('\nC = A (length %d randperm, :)\n', subset) ; - I2 = I (1:subset) ; - tic ; - C = A (I2,:) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - I0 = uint64 (I2) - 1 ; - J0.begin = 0 ; J0.inc = 1 ; J0.end = n-1 ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I0, J0) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end -end - -clear I J I0 J0 I2 J2 - -fprintf ('\nC = A (1:inc:n, :) ===============================================:\n') ; -for inc = [1:10 16 64 128 256 1024 100000 1e6 2e6] - % fprintf ('\nC = A (1:%7d:n, 1:%7d:n)\n', inc, inc) ; - fprintf ('\nC = A (1:%7d:n, :)\n', inc) ; - tic - % C = A (1:inc:n, 1:inc:n) ; - C = A (1:inc:n, :) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - clear I J - I.begin = 0 ; I.inc = inc ; I.end = n-1 ; - J.begin = 0 ; J.inc = 1 ; J.end = n-1 ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I, J) ; - t2 = toc ; - GB_spok (C2.matrix) ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end -end - -fprintf ('\nC = A (1:k, 1:k) =================================================:\n') ; - -for hi = [1:10 16 64 128 256 1024 100000 1e6 2e6] - fprintf ('\nC = A (1:%7d, 1:%7d)\n', hi, hi) ; - tic - C = A (1:hi, 1:hi) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - I.begin = 0 ; - I.inc = 1 ; - I.end = hi-1 ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I, I) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end -end - -fprintf ('\nC = A (lo:hi, lo:hi) =============================================:\n') ; - -for lo = [1:10 16 64 128 256 1024 100000 1e6 2e6] - for delta = [1 10000 1e6] - hi = lo + delta ; - hi = min (n, hi) ; - fprintf ('\nC = A (%7d:%7d, %7d:%7d)\n', lo, hi, lo, hi) ; - tic - C = A (lo:hi, lo:hi) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - I.begin = lo-1 ; - I.inc = 1 ; - I.end = hi-1 ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I, I) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end - end -end - -fprintf ('\nC = A (hi:-1:lo, hi:-1:lo) =======================================:\n') ; - -for lo = [1:10 16 64 128 256 1024 100000 1e6 2e6] - for delta = [1 10000 1e6] - hi = lo + delta ; - hi = min (n, hi) ; - fprintf ('\nC = A (%7d:-1:%7d, %7d:-1:%7d)\n', hi, lo, hi, lo) ; - tic - C = A (hi:-1:lo, hi:-1:lo) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - I.begin = hi-1 ; - I.inc = -1 ; - I.end = lo-1 ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I, I) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end - end -end - -fprintf ('\nC = A (n:-inc:1, n:-inc:1) =======================================:\n') ; - -for inc = [1:10 16 64 128 256 1024 100000 1e6 2e6] - fprintf ('\nC = A (n:%7d:1, n:%7d:1)\n', -inc, -inc) ; - tic - C = A (n:(-inc):1, n:(-inc):1) ; - t1 = toc ; - fprintf (' builtin %12.6f\n', t1) ; - I.begin = n-1 ; - I.inc = -inc ; - I.end = 0 ; - [cm cn] = size (C) ; - S = sparse (cm, cn) ; - for nthreads = nthread_list - nthreads_set (nthreads, chunk) ; - tic - C2 = GB_mex_Matrix_extract (S, [ ], [ ], A, I, I) ; - t2 = toc ; - assert (isequal (C, C2.matrix)) ; - fprintf (' GraphBLAS nthreads %2d %12.6f speedup %8.2f\n', nthreads, t2, t1/t2) ; - end -end - -fprintf ('test86: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test87.m b/GraphBLAS/Test/unused/test87.m deleted file mode 100644 index 8c98c5fcba..0000000000 --- a/GraphBLAS/Test/unused/test87.m +++ /dev/null @@ -1,267 +0,0 @@ -function test87 -%TEST87 performance test of GrB_mxm - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; - -%------------------------------------------------------------------------------- - -fprintf ('\n--------------------------------------------------\n') ; - -k = 30e6 -fprintf ('building random sparse matrix, %d by %d\n', k,2) ; -A = sprandn (k, 2, 0.01) ; -B = sprandn (k, 2, 0.01) ; - -fprintf ('builtin:\n') ; -tic -C = A'*B ; -toc -tm = toc ; - -fprintf ('GrB AdotB:\n') ; -tic -C2 = GB_mex_AdotB (A,B) ; -toc - -fprintf ('GrB (A'')*B:\n') ; -tic -C3 = GB_mex_AxB (A',B) ; -toc - -fprintf ('GrB A''*B native:\n') ; -C4 = GB_mex_AxB (A,B, true) ; -tg = toc ; - -assert (norm (C-C2,1) / norm (C,1) < 1e-12) -assert (norm (C-C3,1) / norm (C,1) < 1e-12) -assert (norm (C-C4,1) / norm (C,1) < 1e-12) - -fprintf ('builtin: %10.4f GB:auto: %10.4f speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; - -k = 30e6 -m = 100 -fprintf ('building random sparse matrix, %d by %d\n', k,m) ; -A = sprandn (k, 2, 0.01) ; -B = sprandn (k, m, 0.01) ; - -fprintf ('builtin:\n') ; -tic -C = A'*B ; -toc -tm = toc ; - -fprintf ('GrB AdotB:\n') ; -tic -C2 = GB_mex_AdotB (A,B) ; -toc - -fprintf ('GrB (A'')*B:\n') ; -tic -C3 = GB_mex_AxB (A',B) ; -tg1 = toc ; -fprintf ('just A*B %g (both A and B non-hypersparse)\n', tg1) ; - -% this is slower than GB_mex_AxB (A',B) even though it uses the -% same method, because the builtin A' above is non-hypersparse, -% but the internal AT=A' is hypersparse. - -fprintf ('GrB A''*B native (AT becomes hypersparse):\n') ; -tic -C4 = GB_mex_AxB (A,B, true) ; -tg = toc ; - -fprintf ('builtin: %10.4f GB:auto: %10.4f(%s) speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -assert (norm (C-C2,1) / norm (C,1) < 1e-12) -assert (norm (C-C3,1) / norm (C,1) < 1e-12) -assert (norm (C-C4,1) / norm (C,1) < 1e-12) - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; - -fprintf ('matrix A above, transposed:\n') ; - -tic -AT1 = A' ; -toc -tm = toc ; - -[mm nn] = size (AT1) ; -S = sparse (mm,nn) ; - -tic -AT2 = GB_mex_transpose (S, [ ], [ ], A) -tg = toc ; - -assert (isequal (AT1, AT2.matrix)) ; - -fprintf ('size of AT: %d %d\n', mm, nn) ; -fprintf ('builtin transpose %g GB %g speedup %g\n', tm, tg, tm/tg) ; - -fprintf ('GrB (AT)*B:\n') ; -tic -C3 = GB_mex_AxB (AT1,B) ; -tg1 = toc ; -fprintf ('just A*B %g\n', tg1) ; - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; - -fprintf ('\nA''*x where A is big and x is a dense vector\n') ; -Prob = ssget (2662) ; -A = Prob.A ; -n = size (A, 1) ; -x = sparse (rand (n,1)) ; -z = full (x) ; - -fprintf ('builtin: x full:\n') ; -tic -y0 = A'*z ; -toc - -fprintf ('builtin: x sparse:\n') ; -tic -y1 = A'*x ; -toc -tm = toc ; - -fprintf ('GrB AdotB:\n') ; -tic -y2 = GB_mex_AdotB (A,x) ; -toc - -fprintf ('GrB A''xB auto select:\n') ; -tic -y3 = GB_mex_AxB (A,x, true) ; -tg = toc ; -fprintf ('GrB time is %g\n', tg) ; - -fprintf ('GrB (A'')xB outer:\n') ; -tic -y3 = GB_mex_AxB (A',x) ; -toc - -assert (isequal (y1, sparse (y0))) ; -assert (isequal (y1, y2)) ; -% assert (isequal (y1, y3)) ; -assert (norm (y1-y3,1) / norm (y1,1) < eps) - -fprintf ('builtin: %10.4f GB:auto: %10.4f speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; - -fprintf ('\nx''A where A is big and x is a dense vector\n') ; - -fprintf ('builtin: x full:\n') ; -tic -y0 = z'*A ; -toc - -fprintf ('builtin: x sparse:\n') ; -tic -y1 = x'*A ; -toc -tm = toc ; - -fprintf ('GrB AdotB:\n') ; -tic -y2 = GB_mex_AdotB (x,A) ; -toc - -fprintf ('GrB A''xB auto select:\n') ; -tic -y3 = GB_mex_AxB (x, A, true) ; -tg = toc ; - -fprintf ('GrB (A''B outer:\n') ; -tic -y3 = GB_mex_AxB (x', A) ; -toc - -assert (isequal (y1, sparse (y0))) ; -assert (isequal (y1, y2)) ; -% assert (isequal (y1, y3)) ; -assert (norm (y1-y2,1) / norm (y2,1) < eps) - -fprintf ('builtin: %10.4f GB:auto: %10.4f speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; -fprintf ('\nA*x where A is big and x is a dense vector\n') ; - -fprintf ('builtin: x full:\n') ; -tic -y0 = A*z ; -toc - -fprintf ('builtin: x sparse:\n') ; -tic -y1 = A*x ; -toc -tm = toc ; - -fprintf ('GrB AxB:\n') ; -tic -y3 = GB_mex_AxB (A, x, false) ; -tg = toc ; - -assert (isequal (y1, sparse (y0))) ; -% assert (isequal (y1, y3)) ; -assert (norm (y1-y3,1) / norm (y1,1) < eps) - -fprintf ('builtin: %10.4f GB:auto: %10.4f speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -%------------------------------------------------------------------------------- -fprintf ('\n--------------------------------------------------\n') ; - -fprintf ('\nA''*x where A is big and x is a very sparse vector\n') ; -x = sprandn (n,1, 0.0001) ; - -fprintf ('builtin: x sparse:\n') ; -tic -y1 = A'*x ; -toc -tm = toc ; - -fprintf ('GrB AdotB:\n') ; -tic -y2 = GB_mex_AdotB (A,x) ; -toc - -fprintf ('GrB A''xB auto select:\n') ; -tic -y3 = GB_mex_AxB (A,x, true) ; -tg = toc ; - -fprintf ('GrB (A'')xB outer:\n') ; -tic -y3 = GB_mex_AxB (A',x) ; -toc - -assert (isequal (y1, y2)) ; -% assert (isequal (y1, y3)) ; -assert (norm (y1-y3,1) / norm (y1,1) < eps) - -fprintf ('builtin: %10.4f GB:auto: %10.4f speedup %10.4f\n', ... - tm, tg, tm/tg) ; - -fprintf ('\ntest87: all tests passed\n') ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test88.m b/GraphBLAS/Test/unused/test88.m deleted file mode 100644 index aa51c0077b..0000000000 --- a/GraphBLAS/Test/unused/test88.m +++ /dev/null @@ -1,34 +0,0 @@ -function test88 -%TEST88 test hypersparse matrices with hash-based method - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; -d.axb = 'hash' ; -semiring.multiply = 'times' ; -semiring.class = 'double' ; -semiring.add = 'plus' ; - -for n = [10 100 200 300 1000] - - for trials = 1:100 - - A = GB_spec_random (n, n, 0.001, 1, 'double', true, true, 0.001) ; - B = GB_spec_random (n, n, 0.001, 1, 'double', true, true, 0.001) ; - S = sparse (n,n) ; - - B.matrix (1:10,:) = sparse (rand (10,n)) ; - B.pattern (1:10,:) = sparse (true (10,n)) ; - B.matrix (:,10) = sparse (rand (n,1)) ; - B.pattern (:,10) = sparse (true (n,1)) ; - - C1 = A.matrix * B.matrix ; - C2 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, d) ; - - assert (isequal_roundoff (C1, C2.matrix)) ; - end -end - -fprintf ('test88: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test89.m b/GraphBLAS/Test/unused/test89.m deleted file mode 100644 index 53823089f4..0000000000 --- a/GraphBLAS/Test/unused/test89.m +++ /dev/null @@ -1,85 +0,0 @@ -function test89 -%TEST89 performance test of complex A*B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; -Prob = ssget (936) -A = Prob.A ; -% A = sprandn (1000, 1000, 0.3) ; -[i j x] = find (A) ; -n = size (A,1) ; -nz = length (x) ; -x = x .* (rand (nz,1) + 1i * rand (nz,1)) ; -y = x .* (rand (nz,1) + 1i * rand (nz,1)) ; -A = sparse (i,j,x,n,n) ; -B = sparse (i,j,y,n,n) ; -clear x y i j - -for do_real = 0:1 - - if (do_real) - fprintf ('real:\n') ; - A = real (A) ; - B = real (B) ; - else - fprintf ('complex:\n') ; - end - - fprintf ('start built-in\n') ; - tic - C1 = A*B ; - tm = toc ; - fprintf ('built-in %g\n', tm) ; - - % 7081: Gustavson - % 7083: dot - - for k = [false true] - GB_builtin_complex_set (k) ; - - if (k) - % GraphBLAS is fast - fprintf ('\nbuilt-in GxB_FC64 complex type:\n') ; - else - % GraphBLAS is slower than it could be because the complex type is - % user-defined. - fprintf ('\nuser-defined Complex type:\n') ; - end - - % This uses the default method, which selects Gustavson's method: - - tic - C2 = GB_mex_AxB (A, B) ; - tg = toc ; - err = norm (C1-C2,1) ; - fprintf ('GraphBLAS %g speedup %g err: %g\n', tg, tm/tg, err) ; - - % these are expected to be slower still; they do not use the default - % method (Gustavson) which is selected by the auto-strategy. - - tic - C2 = GB_mex_AxB (A, B, 0, 0, 7084) ; - tg = toc ; - err = norm (C1-C2,1) ; - fprintf ('GraphBLAS %g speedup %g (hash) err: %g\n', tg, tm/tg, err) ; - - tic - C2 = GB_mex_AxB (A, B, 0, 0, 7083) ; - tg = toc ; - err = norm (C1-C2,1) ; - fprintf ('GraphBLAS %g speedup %g (dot) err: %g\n', tg, tm/tg, err) ; - - end - -end - -GB_builtin_complex_set (true) ; -nthreads_set (save, save_chunk) ; - diff --git a/GraphBLAS/Test/unused/test90.m b/GraphBLAS/Test/unused/test90.m deleted file mode 100644 index 7d3bec9bc5..0000000000 --- a/GraphBLAS/Test/unused/test90.m +++ /dev/null @@ -1,148 +0,0 @@ -function test90 -%TEST90 test AxB with user-defined semirings: plus_rdiv and plus_rdiv2 - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n -------------- A*B plus_rdiv (user-defined semiring)\n') ; -GB_mex_burble (1) ; - - % 7081: Gustavson - % 7083: dot - % 7084: hash - % 7085: saxpy - -rng ('default') ; - -for N = [10 100] % 1000] - - % create the problem - A = sprand (4*N, 5*N, 0.01) ; - B = sprand (5*N, 3*N, 0.01) ; - - [i j x] = find (A) ; - [m n] = size (A) ; - X = sparse (i, j, 1./x, m, n) ; - clear i j x - - C1 = X*B ; - - C2 = GB_mex_rdiv (A, B) ; - assert (norm (C1-C2,1) / norm (C1,1) < 1e-10) ; - - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - cprint = (N <= 10) ; - C2 = GB_mex_rdiv (A, B, method, cprint) ; - assert (norm (C1-C2,1) / norm (C1,1) < 1e-10) ; - end - - % try rdiv2, which typecasts B to single precision first - C3 = GB_mex_rdiv2 (A, B) ; - assert (norm (C1-C3,1) / norm (C1,1) < 1e-5) ; - - [i j x] = find (B) ; - [m n] = size (B) ; - Y = sparse (i, j, 1./x, m, n) ; - - C4 = A*Y ; - - % try rdiv2, with flipxy, which inverts A instead of B - C5 = GB_mex_rdiv2 (A, B, false, false, 0, 1) ; - assert (norm (C4-C5,1) / norm (C4,1) < 1e-5) ; - - %-------------------------------------------------------------------------- - % fprintf ('\nextensive tests:\n') ; - - A = sprand (n, n, 0.01) ; - B = sprand (n, n, 0.01) ; - [i j x] = find (A) ; - X = sparse (i, j, 1./x, n, n) ; - [i j x] = find (B) ; - Y = sparse (i, j, 1./x, n, n) ; - - flipxy = 0 ; - at = 0 ; - bt = 0 ; - C0 = X*B ; - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 0 ; - at = 1 ; - bt = 0 ; - C0 = X'*B ; - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 0 ; - at = 0 ; - bt = 1 ; - C0 = X*B' ; - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 0 ; - at = 1 ; - bt = 1 ; - C0 = X'*B' ; - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 1 ; - at = 0 ; - bt = 0 ; - C0 = A*Y ; - for method = [7081 7083 7084 7085] - fprintf ('method: %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 1 ; - at = 1 ; - bt = 0 ; - C0 = A'*Y ; - for method = [7081 7083 7084 7085] - fprintf ('method %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 1 ; - at = 0 ; - bt = 1 ; - C0 = A*Y' ; - for method = [7081 7083 7084 7085] - fprintf ('method %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - - flipxy = 1 ; - at = 1 ; - bt = 1 ; - C0 = A'*Y' ; - for method = [7081 7083 7084 7085] - fprintf ('method %d\n', method) ; - C5 = GB_mex_rdiv2 (A, B, at, bt, method, flipxy) ; - assert (norm (C0-C5,1) / norm (C5,1) < 1e-5) ; - end - -end - -GB_mex_burble (0) ; -fprintf ('\ntest90: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test91.m b/GraphBLAS/Test/unused/test91.m deleted file mode 100644 index ebf7579b5c..0000000000 --- a/GraphBLAS/Test/unused/test91.m +++ /dev/null @@ -1,85 +0,0 @@ -function test91 -%TEST91 test subref performance on dense vectors - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\n------------------------------ testing GB_mex_Matrix_subref\n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -ntrials = 10 ; - -% addpath old -rng ('default') - -n = 10 * 1e6 ; -A = sparse (rand (n,1)) ; -fprintf ('A is a sparse %d-by-1 vector, all nonzero\n', n) ; -F = full (A) ; - - -for ilen = [1 10 100 1000 10000 100000 1e6] - - fprintf ('\n----- C(I) = A (I), I is random with length(I) = %d\n', ilen) ; - - I = irand (1, n, ilen, 1) ; - I0 = uint64 (I-1) ; - - tic - for trials = 1:ntrials - C1 = A (I) ; - end - tm = toc ; - fprintf ('built-in sparse: %g sec\n', tm) ; - - tic - for trials = 1:ntrials - Cfull = F (I) ; - end - tf = toc ; - fprintf ('built-in full: %g sec\n', tf) ; - - J0 = uint64 (0) ; - - tic - for trials = 1:ntrials - C3 = GB_mex_Matrix_subref (A, I0, J0) ; - end - tg = toc ; - fprintf ('GraphBLAS: %g sec speedup %g\n', tg, tm/tg) ; - assert (isequal (C1, C3)) ; - -end - -fprintf ('\n----- C(:) = A (:)\n') ; - -tic -for trials = 1:ntrials - C1 = A (:) ; -end -tm = toc ; -fprintf ('built-in: %g\n', tm) ; - -tic -for trials = 1:ntrials - C3 = GB_mex_Matrix_subref (A, [ ], J0) ; -end -tg = toc ; -assert (isequal (C1, C3)) ; -fprintf ('GraphBLAS: %g sec speedup %g\n', tg, tm/tg) ; - -F = full (A) ; - -tic -for trials = 1:ntrials - C0 = F (:) ; - C0 (1) = 1 ; % make sure the copy gets done, not a lazy copy -end -tf = toc ; -fprintf ('\nbuilt-in (full): %g\n', tf) ; - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test92.m b/GraphBLAS/Test/unused/test92.m deleted file mode 100644 index 09b958460d..0000000000 --- a/GraphBLAS/Test/unused/test92.m +++ /dev/null @@ -1,45 +0,0 @@ -function test92 -%TEST92 test GB_subref: symbolic case - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('test92: test GB_subref: symbolic case\n') ; - -rng ('default') ; -n = 100 ; -A = sprand (n, n, 0.1) ; - -% S = A (I,J) ; -% No column of A can be dense -% length(I) > 1 -% I is not ":", not lo:hi -% sort not needed so I must be sorted -% 32*length(I) > entries in columns of A - -I = [ 1 2 2 4:8 20:30 32 32 32 32] ; -I0 = uint64 (I) - 1 ; - -J = 1:n ; -J0 = uint64 (J) - 1 ; - -nI = length (I) ; -nJ = n ; - -S = GB_mex_subref_symbolic (A, I0, J0) ; -[si,sj,sx] = find (S.matrix) ; - -[i,j,x] = find (A) ; -nz = length (x) ; -x = 1:nz ; -X = sparse (i,j,x,n,n) ; - -S2 = X (I,J) ; -[si2,sj2,sx2] = find (S2) ; - -assert (isequal (si, si2)) ; -assert (isequal (sj, sj2)) ; -assert (isequal (sx+1, sx2)) ; - -fprintf ('test92: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test95.m b/GraphBLAS/Test/unused/test95.m deleted file mode 100644 index f0b8785164..0000000000 --- a/GraphBLAS/Test/unused/test95.m +++ /dev/null @@ -1,111 +0,0 @@ -function test95 -%TEST95 performance test for GrB_transpose - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('\ntest95: performance tests : GrB_transpose \n') ; - -[save save_chunk] = nthreads_get ; -chunk = 4096 ; -nthreads = feature_numcores ; -nthreads_set (nthreads, chunk) ; - -rng ('default') ; -tol = 1e-12 ; - -Prob = ssget (2662) -A = Prob.A ; -% A = sparse (rand (6000)) ; -[m n] = size (A) ; -Cin = sparse (n, m) ; -A (1,2) =1 ; - -ntrials = 10 ; - -tic -for trial = 1:ntrials - C1 = A' ; -end -tmsum = toc ; -fprintf ('built-in transpose time: %g\n', tmsum / ntrials) ; - -% C = 0 ; C += A' -for trial = 1:ntrials - tic - C = GB_mex_transpose (Cin, [ ], 'plus', A) ; - tg (trial) = toc ; -end -tgsum = sum (tg) ; -fprintf ('GraphBLAS transpose time: %g (for C=0 ; C+=A'')\n', tgsum / ntrials) ; -assert (isequal (C1, C.matrix)) ; -fprintf ('speedup over built-in: %g\n', tmsum / tgsum) ; - -% C = A' -for trial = 1:ntrials - tic - C = GB_mex_transpose (Cin, [ ], [ ], A) ; - tg (trial) = toc ; -end -tgsum = sum (tg) ; -fprintf ('GraphBLAS transpose time: %g (for C=A'')\n', tgsum / ntrials) ; -assert (isequal (C1, C.matrix)) ; -fprintf ('speedup over built-in: %g\n', tmsum / tgsum) ; - -% sum across the rows -yin = sparse (rand (m,1)) ; -fprintf ('row sum (with accum):\n') ; -tic -y2 = yin + (sum (A,2)) ; -t1 = toc ; - -toc -y = GB_mex_reduce_to_vector (yin, [ ], 'plus', 'plus', A) ; -t2 = tic ; -fprintf ('built-in: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -err = norm (1*(y.matrix) - y2, 1) ; -if (norm (y2) ~= 0) - err = err / norm (y2) ; -end -assert (err < tol) -% assert (isequal (y.matrix, y2)) - -% sum across the rows, no accum -yin = sparse (rand (m,1)) ; -fprintf ('row sum (no accum):\n') ; -tic -y2 = (sum (A,2)) ; -t1 = toc ; - -tic -y = GB_mex_reduce_to_vector (yin, [ ], [ ], 'plus', A) ; -t2 = toc ; -fprintf ('built-in: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -err = norm (1*(y.matrix) - y2, 1) ; -if (norm (y2) ~= 0) - err = err / norm (y2) ; -end -assert (err < tol) -% assert (isequal (1*(y.matrix), y2)) - -% sum down the columns, no accum -yin = sparse (rand (m,1)) ; -fprintf ('col sum (no accum):\n') ; -tic -y2 = (sum (A,1)) ; -t1 = toc ; - -desc.inp0 = 'tran' ; - -tic -y = GB_mex_reduce_to_vector (yin, [ ], [ ], 'plus', A, desc) ; -t2 = toc ; -fprintf ('built-in: %g GraphBLAS %g speedup %g\n', t1, t2, t1/t2) ; -err = norm (1*(y.matrix) - y2', 1) ; -if (norm (y2) ~= 0) - err = err / norm (y2) ; -end -assert (err < tol) -% assert (isequal (1*(y.matrix), y2')) - -nthreads_set (save, save_chunk) ; diff --git a/GraphBLAS/Test/unused/test96.m b/GraphBLAS/Test/unused/test96.m deleted file mode 100644 index a0e947b7bc..0000000000 --- a/GraphBLAS/Test/unused/test96.m +++ /dev/null @@ -1,27 +0,0 @@ -function test96 -%TEST96 test dot product - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -n = 1000 ; -A = sprandn (n, n, 0.5) ; -B = sprandn (n, n, 0.5) ; - -C1 = A'*B ; - -M = spones (sprandn (n, n, 0.5)) ; - -C2 = GB_mex_AdotB (A,B) ; - -err = norm (C1-C2, 1) / norm (C1, 1) -assert (err < 1e-12) - -C4 = C1 .* M ; - -C3 = GB_mex_AdotB (A,B,M) ; - -err = norm (C3-C4, 1) / norm (C3, 1) -assert (err < 1e-12) - -fprintf ('test96: all tests passed\n') ; diff --git a/GraphBLAS/Test/unused/test97.m b/GraphBLAS/Test/unused/test97.m deleted file mode 100644 index 0c6e6c2123..0000000000 --- a/GraphBLAS/Test/unused/test97.m +++ /dev/null @@ -1,49 +0,0 @@ -function test97 -%TEST97 test GB_assign, scalar expansion and zombies - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - - n = 20 ; - C = sparse (rand (n)) ; - C (:,1) = sparse (rand (n,1) > 0.5) ; - - ntrials = 10 ; - - for k = 1:2:ntrials - - % make some zombies - Work (k).A = sprandn (n, n, 0.1) ; - Work (k).I = [ ] ; - Work (k).J = [ ] ; - Work (k).Mask = sparse (ones (n)) ; - Work (k).accum = [ ] ; - Work (k).desc = [ ] ; - Work (k).scalar = 0 ; - - % scalar expansion - Work (k+1).A = sparse (pi) ; - Work (k+1).I = [ ] ; - Work (k+1).J = [ ] ; - Work (k+1).Mask = sparse (ones (n)) ; - Work (k+1).accum = [ ] ; - Work (k+1).desc = [ ] ; - Work (k+1).scalar = 1 ; - end - - C1 = GB_mex_assign (C, Work) ; % WORK_ASSIGN - - C2 = C ; - for k = 1:ntrials - M = Work (k).Mask ; - A = Work (k).A ; - scalar = Work (k).scalar ; - C2 = GB_spec_subassign (C2, M, [ ], A, [ ], [ ], [ ], scalar) ; - end - - GB_spec_compare (C1, C2) ; - -fprintf ('\ntest97: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test98.m b/GraphBLAS/Test/unused/test98.m deleted file mode 100644 index 11a5853474..0000000000 --- a/GraphBLAS/Test/unused/test98.m +++ /dev/null @@ -1,28 +0,0 @@ -function test98 -%TEST98 test GrB_mxm, typecasting on the fly - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -% This test is for the case when the auto AxB method selects the hash - -rng ('default') ; - -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; - - n = 20 ; - A.matrix = sprandn (n, n, 1) ; - A.class = 'single' ; - B.matrix = sprandn (n, n, 0.01) ; - B.class = 'single' ; - C.matrix = sparse (n, n) ; - C.class = 'single' ; - - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, [ ]) ; - C2 = GB_spec_mxm (C, [ ], [ ], semiring, A, B, [ ]) ; - GB_spec_compare (C1, C2) ; - -fprintf ('\ntest98: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test99.m b/GraphBLAS/Test/unused/test99.m deleted file mode 100644 index 1d901dc52c..0000000000 --- a/GraphBLAS/Test/unused/test99.m +++ /dev/null @@ -1,64 +0,0 @@ -function test99 -%TEST99 test GB_mex_transpose with explicit zeros in the Mask - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -fprintf ('test99: GB_mex_transpose with explicit zeros in the Mask\n') ; - -masks = { '', 'complement', 'structural', 'structural complement' } ; -repls = { '', 'replace' } ; - -for n = 10:20 - for d = 0:.1:1 - fprintf ('.') ; - for k = 1:10 - - C = sprand (n, n, 0.1) ; - A = sprand (n, n, 0.1) ; - if (d == 1) - Mask = sparse (rand (n)) ; - else - Mask = sprand (n, n, d) ; - end - if (nnz (Mask) > 0) - [i j x] = find (Mask) ; - nz = length (x) ; - p = randperm (nz, floor(nz/2)) ; - x (p) = 0 ; - i = uint64 (i-1) ; - j = uint64 (j-1) ; - Mask = GB_mex_Matrix_build (i,j,x,n,n,[]) ; - Mask = Mask.matrix ; - end - - for k1 = 1:length(masks) - for k2 = 1:2 - - clear desc - desc.inp0 = 'tran' ; - if (~isempty (masks {k1})) - desc.mask = masks {k1} ; - end - if (~isempty (repls {k2})) - desc.outp = repls {k2} ; - end - - C2 = GB_spec_transpose (C, Mask, [], A, desc) ; - C3 = GB_mex_transpose (C, Mask, [], A, desc) ; - GB_spec_compare (C2, C3) ; - - C2 = GB_spec_transpose (C, Mask, [], C, desc) ; - C3 = GB_mex_transpose (C, Mask, [], C, desc) ; - GB_spec_compare (C2, C3) ; - - end - end - end - end -end - -fprintf ('\ntest99: all tests passed\n') ; - diff --git a/GraphBLAS/Test/unused/test_assign.m b/GraphBLAS/Test/unused/test_assign.m deleted file mode 100644 index 2bfb38cb0a..0000000000 --- a/GraphBLAS/Test/unused/test_assign.m +++ /dev/null @@ -1,22 +0,0 @@ -test138 -% test142 -test156 -test173 -test174 -test176 -test180 -test189 -test192 -test19b -test210 -test211 -test213 -test216 -test21b -test221 -test232 -test54 -test69 -test83 -test84 - diff --git a/GraphBLAS/Test/unused/test_other.m b/GraphBLAS/Test/unused/test_other.m deleted file mode 100644 index 431ac87406..0000000000 --- a/GraphBLAS/Test/unused/test_other.m +++ /dev/null @@ -1,57 +0,0 @@ -function test_other -%TEST_OTHER installs all packages needed for extensive tests - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -here = pwd ; -fprintf ('\n------------------installing ssget\n') ; -try - index = ssget ; -catch - cd ../../ssget - addpath (pwd) ; -end -cd (here) ; - -fprintf ('\n------------------installing spok\n') ; -cd spok -addpath (pwd) ; -try - spok (sparse (1)) ; -catch - spok_install ; -end -cd (here) ; - -fprintf ('\n------------------installing SSMULT\n') ; -cd ../../SuiteSparse/MATLAB_Tools/SSMULT -addpath (pwd) ; -try - L = sparse (1) ; - ssmultsym (L, L) ; -catch - ssmult_install -end -cd (here) ; - -fprintf ('\n------------------installing CXSparse\n') ; -cd ../../SuiteSparse/CXSparse/MATLAB/CSparse -addpath (pwd) ; -try - cs_sparse (1, 1, 1) ; -catch - cs_make (1) ; -end -cd (here) ; - -fprintf ('\n------------------installing CHOLMOD\n') ; -cd ../../SuiteSparse/CHOLMOD/MATLAB -addpath (pwd) ; -try - sparse2 (1, 1, 1) ; -catch - cholmod_make ; -end -cd (here) ; - diff --git a/GraphBLAS/Test/unused/test_semirings.m b/GraphBLAS/Test/unused/test_semirings.m deleted file mode 100644 index 21cf36a642..0000000000 --- a/GraphBLAS/Test/unused/test_semirings.m +++ /dev/null @@ -1,12 +0,0 @@ -function test_semirings -%TEST_SEMIRINGS test all semirings - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -test06 -test125 -test74 -test75b -test75 -test20(2) diff --git a/GraphBLAS/Test/unused/test_threads.m b/GraphBLAS/Test/unused/test_threads.m deleted file mode 100644 index 8ea736cf8a..0000000000 --- a/GraphBLAS/Test/unused/test_threads.m +++ /dev/null @@ -1,20 +0,0 @@ -%TESTALL2 run testall with different # of threads - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -for k = [4 1] % 8 20] - - nthreads_set (k,1) ; - - % if (k == 1) - debug_on - testall - % end - - debug_off ; - testall -end - -mtest diff --git a/GraphBLAS/Test/unused/test_threads3.m b/GraphBLAS/Test/unused/test_threads3.m deleted file mode 100644 index 1ee4af6de1..0000000000 --- a/GraphBLAS/Test/unused/test_threads3.m +++ /dev/null @@ -1,14 +0,0 @@ -%TESTALL3 run testall with different # of threads - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -grbinfo -for k = [1 2 4] - nthreads_set (k) ; - debug_off ; - testall - debug_on - testall -end diff --git a/GraphBLAS/Test/unused/testall_Oct9.m b/GraphBLAS/Test/unused/testall_Oct9.m deleted file mode 100644 index 6d9057ca3e..0000000000 --- a/GraphBLAS/Test/unused/testall_Oct9.m +++ /dev/null @@ -1,342 +0,0 @@ -function testall (threads,longtests) -%TESTALL run all GraphBLAS tests -% -% Usage: -% testall ; % runs just the shorter tests (about 30 minutes) -% -% testall(threads) ; % run with specific list of threads and chunk sizes -% testall([ ],1) ; % run all longer tests, with default # of threads -% -% threads is a cell array. Each entry is 2-by-1, with the first value being -% the # of threads to use and the 2nd being the chunk size. The default is -% {[4 1]} if empty or not present. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -GrB.init ; -GB_mex_init ; -testall_time = tic ; - -if (nargin < 2) - % run the shorter tests by default - longtests = 0 ; -end - -if (nargin < 1) - threads = [ ] ; -end -if (isempty (threads)) - threads {1} = [4 1] ; -end -t = threads ; - -% single thread -s {1} = [1 1] ; - -% clear the statement coverage counts -clear global GraphBLAS_grbcov - -global GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... - GraphBLAS_scripts GraphBLAS_times - -% use built-in complex data types by default -GB_builtin_complex_set (true) ; - -% many of the tests use spok in SuiteSparse, a copy of which is -% included here in GraphBLAS/Test/spok. -addpath ('../Test/spok') ; -try - spok (sparse (1)) ; -catch - here = pwd ; - cd ../Test/spok ; - spok_install ; - cd (here) ; -end - -logstat ; % start the log.txt -hack = GB_mex_hack ; - -% JIT and factory controls - -% run once -j4 = {4} ; % JIT on -f1 = {1} ; % factory on -j0 = {0} ; % JIT off -f0 = {0} ; % factory off - -% run twice -j44 = {4,4} ; % JIT on, on -j04 = {0,4} ; % JIT off, on -j40 = {4,0} ; % JIT on, off -f10 = {1,0} ; % factory on, off -f00 = {0,0} ; % factory off, off -f11 = {1,1} ; % factory on, on - -% 3 runs -j440 = {4,4,0} ; % JIT on, on , off -j404 = {4,0,4} ; % JIT on, off, on -f100 = {1,0,0} ; % factory on, off, off -f110 = {1,1,0} ; % factory on, on , off - -% start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; - -malloc_debugging = stat ; - -% lots of tests -jall = {4,3,2,1,4,2} ; -fall = {1,1,1,1,0,0} ; - -jlot = {4,3,2,1} ; -flot = {1,1,1,1} ; - -%=============================================================================== -% statement coverage test, with malloc debugging and Werk stack enabled -%=============================================================================== - -% < 1 second -logstat ('test268' ,t, j4 , f1 ) ; % C=Z sparse masker -logstat ('test247' ,t, j4 , f1 ) ; % GrB_mxm: fine Hash method -logstat ('test199' ,t, j4 , f1 ) ; % test dot2 with hypersparse -logstat ('test210' ,t, j4 , f1 ) ; % iso assign25: C=A -logstat ('test165' ,t, j4 , f1 ) ; % test C=A*B', A is diagonal, B bitmap -logstat ('test226' ,t, j4 , f1 ) ; % test kron with iso matrices -logstat ('test207' ,t, j4 , f1 ) ; % test iso subref -logstat ('test221' ,t, j4 , f1 ) ; % test C += A, C is bitmap and A is full -logstat ('test09' ,t, j4 , f1 ) ; % duplicate I,J test of GB_mex_subassign -logstat ('test214' ,t, j4 , f1 ) ; % test C=A'*B (tricount) -logstat ('test213' ,t, j4 , f1 ) ; % test iso assign (method 05d) -logstat ('test272' ,t, j0 , f1 ) ; % misc simple tests -logstat ('test279' ,t, j0 , f1 ) ; % blob get/set -logstat ('test278' ,t, j0 , f1 ) ; % descriptor get/set -logstat ('test277' ,t, j0 , f1 ) ; % context get/set -logstat ('test269' ,t, j0 , f1 ) ; % get/set for type, scalar, vec, mtx -logstat ('test264' ,t, j4 , f0 ) ; % enumify / macrofy tests -logstat ('test262' ,t, j0 , f1 ) ; % GB_mask -logstat ('test261' ,t, j4 , f0 ) ; % serialize/deserialize error handling -logstat ('test260' ,t, j4 , f0 ) ; % demacrofy name -logstat ('test211' ,t, j4 , f1 ) ; % test iso assign -logstat ('test235' ,t, j4 , f1 ) ; % test GxB_eWiseUnion and GrB_eWiseAdd -logstat ('test223' ,t, j4 , f1 ) ; % test matrix multiply, C=A*B -logstat ('test203' ,t, j4 , f1 ) ; % test iso subref -logstat ('test183' ,s, j4 , f1 ) ; % test eWiseMult with hypersparse mask -logstat ('test174' ,t, j4 , f1 ) ; % test GrB_assign C=A -logstat ('test162' ,t, j4 , f1 ) ; % test C=A*B with very sparse M -logstat ('test275' ,t, j0 , f1 ) ; % monoid get/set -logstat ('test274' ,t, j0 , f1 ) ; % index unary op get/set -logstat ('test271' ,t, j0 , f1 ) ; % binary op get/set -logstat ('test270' ,t, j0 , f1 ) ; % unary op get/set -logstat ('test212' ,t, j44 , f10 ) ; % test iso mask all zero -logstat ('test255' ,t, j4 , f1 ) ; % flip binop -logstat ('test241' ,t, j4 , f1 ) ; % test GrB_mxm, trigger the swap_rule -logstat ('test220' ,t, j4 , f1 ) ; % test mask C=Z, iso case -logstat ('test252' ,t, j4 , f1 ) ; % basic tests -logstat ('test83' ,t, j4 , f1 ) ; % GrB_assign with C_replace and empty J -logstat ('test04' ,t, j4 , f1 ) ; % simple mask and transpose test -logstat ('test132' ,t, j4 , f1 ) ; % setElement -logstat ('test82' ,t, j4 , f1 ) ; % GrB_extract with index range (hyper) -logstat ('test202' ,t, j40 , f11 ) ; % test iso add and emult -logstat ('test219' ,s, j44 , f10 ) ; % test reduce to scalar (1 thread) -logstat ('test281' ,t, j4 , f1 ) ; % test user-defined idx unop, no JIT -logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests -logstat ('test222' ,t, j4 , f1 ) ; % test user selectop for iso matrices -logstat ('test204' ,t, j4 , f1 ) ; % test iso diag -logstat ('test155' ,t, j4 , f1 ) ; % test GrB_*_setElement, removeElement -logstat ('test273' ,t, j0 , f1 ) ; % Global get/set -logstat ('test258' ,t, j4 , f0 ) ; % reduce-to-vector for UDT -logstat ('test257' ,t, j4 , f0 ) ; % JIT error handling -logstat ('test136' ,s, j4 , f1 ) ; % subassignment special cases -logstat ('test276' ,t, j0 , f1 ) ; % semiring get/set -logstat ('test201' ,t, j4 , f1 ) ; % test iso reduce to vector and scalar -logstat ('test265' ,t, j4 , f0 ) ; % reduce to scalar with user types -logstat ('test128' ,t, j4 , f1 ) ; % eWiseMult, eWiseAdd, eWiseUnion cases -logstat ('test267' ,t, j40 , f00 ) ; % JIT error handling -logstat ('test263' ,t, j4 , f0 ) ; % JIT tests -logstat ('test144' ,t, j4 , f1 ) ; % cumsum -logstat ('test109' ,t, j404, f110) ; % terminal monoid with user-defined type - -% 1 to 10 seconds: -logstat ('test245' ,t, j40 , f11 ) ; % test complex row/col scale -logstat ('test282' ,t, jlot, flot) ; % test argmax, index binary op -logstat ('test239' ,t, j44 , f10 ) ; % test GxB_eWiseUnion -logstat ('test249' ,t, j4 , f1 ) ; % GxB_Context object -logstat ('test179' ,t, j44 , f10 ) ; % test bitmap select -logstat ('test159' ,t, j0 , f0 ) ; % test A*B -logstat ('test196' ,t, j4 , f1 ) ; % test hypersparse concat -logstat ('test259' ,t, j4 , f0 ) ; % plus_plus_fp32 semiring -logstat ('test232' ,t, j4 , f1 ) ; % test assign with GrB_Scalar -logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other tests -logstat ('test145' ,t, jall, fall) ; % dot4 for C += A'*B -logstat ('test283' ,t, j4 , f1 ) ; % test index binary op -logstat ('test254' ,t, j440, f100) ; % mask types -logstat ('test229' ,t, j40 , f11 ) ; % test setElement -logstat ('test209' ,t, j4 , f1 ) ; % test iso build -logstat ('test141' ,t, j0 , f1 ) ; % eWiseAdd with dense matrices -logstat ('test224' ,t, j4 , f1 ) ; % test unpack/pack -logstat ('testc2(1,1)',t, j44 , f10 ) ; % complex tests (quick case, builtin) - -% 10 to 60 seconds: -logstat ('test189' ,t, j4 , f1 ) ; % test large assign -logstat ('test246' ,t, j4 , f1 ) ; % GrB_mxm parallelism (slice_balanced) -logstat ('test169' ,t, j0 , f1 ) ; % C=A+B with many formats -logstat ('test76' ,s, j4 , f1 ) ; % GxB_resize (single threaded) -logstat ('test01' ,t, j4 , f1 ) ; % error handling -logstat ('test228' ,t, j4 , f1 ) ; % test serialize/deserialize -logstat ('test206' ,t, j44 , f10 ) ; % test iso select -logstat ('test104' ,t, j4 , f1 ) ; % export/import -logstat ('test02' ,t, j4 , f1 ) ; % matrix copy and dup tests -logstat ('test251' ,t, j4 , f1 ) ; % dot4, dot2, with plus_pair -logstat ('test251b' ,t, j4 , f0 ) ; % dot4, dot2, with plus_pair -logstat ('test244' ,t, j4 , f1 ) ; % test GxB_Matrix_reshape* - -% about 100 seconds: -logstat ('test152' ,t, j404, f110) ; % test binops C=A+B, all matrices dense -logstat ('test194' ,t, j4 , f1 ) ; % test GxB_Vector_diag -logstat ('test280' ,t, j4 , f1 ) ; % subassign method 26 - -%=============================================================================== -% tests with Werk stack disabled, but malloc debugging enabled -%=============================================================================== - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -% < 10 seconds -logstat ('test150' ,t, j0 , f0 ) ; %% mxm zombies, typecasting (dot3,saxpy) -logstat ('test256' ,t, j4 , f0 ) ; % JIT error handling -logstat ('test240' ,t, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 -logstat ('test240' ,s, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 (1 task) -logstat ('test237' ,t, j440, f100) ; % test GrB_mxm (saxpy4) -logstat ('test237' ,s, j40 , f10 ) ; % test GrB_mxm (saxpy4) (1 task) -logstat ('test184' ,t, j4 , f1 ) ; % special cases: mxm, transpose, build -logstat ('test186' ,t, j40 , f11 ) ; % saxpy, all formats (slice_balanced) -logstat ('test186(0)' ,t, j4 , f1 ) ; % repeat with default slice_balanced -logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort - -% 10 to 100 seconds -logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) -logstat ('test188' ,t, j4 , f1 ) ; % test concat -logstat ('test188b' ,t, j0 , f1 ) ; % test concat -logstat ('test151b' ,t, j4 , f1 ) ; % test bshift operator -logstat ('test191' ,t, j40 , f10 ) ; %% test split - -% over 100 seconds -logstat ('test238' ,t, j44 , f10 ) ; % test GrB_mxm (dot4 and dot2) -logstat ('test14' ,t, j4 , f1 ) ; % GrB_reduce -logstat ('test14b' ,t, j4 , f0 ) ; % GrB_reduce -logstat ('test154' ,t, j4 , f1 ) ; % apply with binop and scalar binding -logstat ('test154b' ,t, j0 , f1 ) ; % apply with binop and scalar binding - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%=============================================================================== -% tests with no malloc debugging and no Werk stack -%=============================================================================== - -% Turn off malloc debugging -if (malloc_debugging) - debug_off - fprintf ('[malloc debugging turned off]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned off]\n') ; - fclose (fp) ; -end - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -logstat ('test187' ,t, j4 , f1 ) ; % test dup/assign for all formats -logstat ('test192' ,t, j4 , f1 ) ; % test C=scalar -logstat ('test181' ,s, j4 , f1 ) ; % transpose with explicit zeros in mask -logstat ('test185' ,s, j4 , f1 ) ; % test dot4, saxpy for all sparsity - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%=============================================================================== -% tests with no malloc debugging, with Werk enabled -%=============================================================================== - -% < 1 second: -logstat ('test208' ,t, j4 , f1 ) ; % test iso apply, bind 1st and 2nd -logstat ('test176' ,t, j4 , f1 ) ; % test GrB_assign, method 09, 11 -logstat ('test172' ,t, j4 , f1 ) ; % test eWiseMult with M bitmap/full -logstat ('test124' ,t, j4 , f1 ) ; % GrB_extract, case 6 -logstat ('test138' ,s, j4 , f1 ) ; % assign, coarse-only tasks in IxJ slice -logstat ('test225' ,t, j4 , f1 ) ; % test mask operations (GB_masker) -logstat ('test216' ,t, j4 , f1 ) ; % test C=A, iso case -logstat ('test197' ,t, j4 , f1 ) ; % test large sparse split -logstat ('test133' ,t, j4 , f1 ) ; % test mask operations (GB_masker) -logstat ('test137' ,s, j40 , f11 ) ; % GrB_eWiseMult, FIRST and SECOND -logstat ('test139' ,s, j4 , f1 ) ; % merge sort, special cases -logstat ('test108' ,t, j40 , f10 ) ; % boolean monoids - -% 1 to 10 seconds: -logstat ('testc4(0)' ,t, j4 , f1 ) ; % extractElement, setElement, user type -logstat ('test157' ,t, j4 , f1 ) ; % test sparsity formats -logstat ('test182' ,s, j4 , f1 ) ; % test for internal wait -logstat ('test130' ,t, j4 , f1 ) ; % GrB_apply, hypersparse cases -logstat ('test148' ,t, j4 , f1 ) ; % ewise with alias -logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp -logstat ('test129' ,t, j4 , f1 ) ; % test GxB_select (tril, nonz, hyper) -logstat ('test173' ,t, j4 , f1 ) ; % test GrB_assign C=A -logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar -logstat ('test84' ,t, j4 , f1 ) ; % GrB_assign (row/col with C CSR/CSC) -logstat ('test69' ,t, j4 , f1 ) ; % assign and subassign with alias -logstat ('test215' ,t, j4 , f1 ) ; % test C=A'*B (dot2, ANY_PAIR) -logstat ('test80' ,t, j4 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test200' ,t, j4 , f1 ) ; % test iso full matrix multiply -logstat ('test11' ,t, j4 , f1 ) ; % exhaustive test of GrB_extractTuples -logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators -logstat ('test142' ,t, j0 , f1 ) ; %% test GrB_assign with accum -logstat ('test142b' ,t, j4 , f0 ) ; %% test GrB_assign with accum -logstat ('test54' ,t, j4 , f1 ) ; % assign and extract with begin:inc:end -logstat ('testcc(1)' ,t, j4 , f1 ) ; % transpose, builtin complex -logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies -logstat ('test227' ,t, j4 , f1 ) ; % test kron -logstat ('test19b' ,s, j4 , f1 ) ; % GrB_assign, many pending operators - -% 10 to 100 seconds: -logstat ('test18' ,t, j4 , f1 ) ; % GrB_eWiseAdd and eWiseMult -logstat ('testc7(0)' ,t, j4 , f1 ) ; % assign, builtin complex -logstat ('testc2(0,0)',t, j04, f10 ) ; % A'*B, A+B, A*B, user-defined complex -logstat ('test193' ,t, j4 , f1 ) ; % test GxB_Matrix_diag -logstat ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build -logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator -logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract -logstat ('testca(1)' ,t, j4 , f1 ) ; % test complex mxm, mxv, and vxm -logstat ('test242' ,t, j4 , f1 ) ; % test GxB_Iterator for matrices -logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement -logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling - -% > 100 seconds -logstat ('test10' ,t, j4 , f1 ) ; % GrB_apply -logstat ('test160' ,s, j0 , f1 ) ; % test A*B, single threaded -logstat ('test75b' ,t, j4 , f1 ) ; % test GrB_mxm A'*B -logstat ('test81' ,t, j4 , f1 ) ; % extract with stride, range, backwards -logstat ('test230' ,t, j4 , f1 ) ; % test apply with idxunops -logstat ('test21b' ,t, j4 , f1 ) ; % quick test of GB_mex_assign -logstat ('test74' ,t, j0 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test234' ,t, j4 , f1 ) ; % test GxB_eWiseUnion -logstat ('test234b' ,t, j0 , f1 ) ; % test GxB_eWiseUnion - -save test195_start GraphBLAS_grbcov -logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced -save test127_start GraphBLAS_grbcov -logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult - -%=============================================================================== -% finalize -%=============================================================================== - -% turn malloc debugging back on -if (malloc_debugging) - debug_on - fprintf ('[malloc debugging turned back on]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned back on]\n') ; - fclose (fp) ; -end - -t = toc (testall_time) ; -fprintf ('\ntestall: all tests passed, total time %0.4g minutes\n', t / 60) ; - diff --git a/GraphBLAS/Test/unused/testc1.m b/GraphBLAS/Test/unused/testc1.m deleted file mode 100644 index 7c90b21c20..0000000000 --- a/GraphBLAS/Test/unused/testc1.m +++ /dev/null @@ -1,107 +0,0 @@ -function testc1(use_builtin) -%TESTC1 test complex operators - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng 'default' - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -A = sparse (rand (2) + 1i * rand (2)) ; -C = GB_mex_dump (A,0) ; -GB_spec_compare (C, A) ; - -B = sparse (rand (2) + 1i * rand (2)) ; - -A = full (A) ; -B = full (B) ; - -C1 = GB_mex_op ('plus', A, B, 1) ; -C2 = A+B ; - -assert (isequal (C1,C2)) ; - -E = rand (2) ; -F = rand (2) ; - -C1 = GB_mex_op ('complex', E, F, 1) ; -C2 = complex (E,F) ; -assert (isequal (C1,C2)) ; - -[complex_binary complex_unary] = GB_user_opsall ; - -A (2,1) = B (2,1) ; - -% create some complex test matrices - -for m = [1 5 10 50 100 ] - for n = [ 1 5 10 50 100 ] - - for akind = 1:5 - switch (akind) - case 1 - A = complex (zeros (m,n), 0) ; - case 2 - A = complex (ones (m,n), 0) ; - case 3 - A = complex (-ones (m,n), ones(m,n)) ; - case 4 - x = full (sprand(m,n,0.3)) ; - y = full (sprand(m,n,0.3)) ; - A = complex (x,y) ; - case 5 - A = complex (rand (m,n), rand (m,n)) ; - end - - % test unary ops with complex x - for k = 1:length (complex_unary) - op = complex_unary {k} ; - C1 = GB_mex_op (op, A, '',1) ; - [C2 tol] = GB_user_op (op, A) ; - GB_complex_compare (C1, C2, tol) ; - end - - for bkind = 1:6 - switch (bkind) - case 1 - B = complex (zeros (m,n), 0) ; - case 2 - B = complex (ones (m,n), 0) ; - case 3 - B = complex (-ones (m,n), ones(m,n)) ; - case 4 - x = full (sprand(m,n,0.3)) ; - y = full (sprand(m,n,0.3)) ; - B = complex (x,y) ; - case 5 - B = complex (rand (m,n), rand (m,n)) ; - case 6 - B = A ; - end - - % test all but the last one, 'complex', which requires - % x,y real - for k = 1:length (complex_binary)-1 - op = complex_binary {k} ; - C1 = GB_mex_op (op, A, B, 1) ; - [C2 tol] = GB_user_op (op, A, B) ; - GB_complex_compare (C1, C2, tol) ; - end - - % test complex(A,B) - C1 = GB_mex_op ('complex', real (A), real (B), 1) ; - C2 = GB_user_op ('complex', real (A), real (B)) ; - assert (isequal (C1, C2)) - - end - end - end -end - -fprintf ('testc1: all complex operator tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testc3.m b/GraphBLAS/Test/unused/testc3.m deleted file mode 100644 index f3882d379e..0000000000 --- a/GraphBLAS/Test/unused/testc3.m +++ /dev/null @@ -1,105 +0,0 @@ -function testc3(use_builtin) -%TESTC3 test complex GrB_extract - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng ('default') ; - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -d = struct ('outp', 'replace') ; -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - seed = seed + 1 ; - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; - for trials = 1:10 - j = randperm (n, 1) ; - j0 = uint64 (j-1) ; - w = GB_mex_complex (sprandn (m,1,0.1) + 1i*sprandn(m,1,0.1)) ; - - x1 = GB_mex_Col_extract (w, [],[], A, [], j0, d) ; - x2 = A (:,j) ; - assert (isequal (x1.matrix, x2)) - - x1 = GB_mex_Col_extract (w, [],'plus', A, [], j0, []) ; - x2 = w + A (:,j) ; - assert (isequal (x1.matrix, x2)) - - if (m > 2) - I = 1:(m/2) ; - I0 = uint64 (I-1) ; - wi = GB_mex_complex (w (I)) ; - - x1 = GB_mex_Col_extract (wi, [],[], A, I0, j0, d) ; - x2 = A (I,j) ; - assert (isequal (x1.matrix, x2)) - - x1 = GB_mex_Col_extract (wi, [],'plus', A, I0, j0, d) ; - x2 = GB_mex_complex (wi + A (I,j)) ; - assert (isequal (x1.matrix, x2)) - - end - end - end -end -fprintf ('All complex col extract w = A(:,j) tests passed\n') ; - - -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - seed = seed + 1 ; - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; - C = GB_mex_complex (sprandn (m,n,0.1) + 1i*sprandn(m,n,0.1)) ; - S = GB_mex_complex (sparse (m,n)) ; - for trials = 1:10 - - J = randperm (n, 1+floor(n/2)) ; - I = randperm (m, 1+floor(m/2)) ; - J0 = uint64 (J-1) ; - I0 = uint64 (I-1) ; - - x1 = GB_mex_Matrix_extract (S, [],[], A, [], [], []) ; - x2 = A ; - assert (isequal (x1.matrix, x2)) - - if (n == 1) - x1 = GB_mex_Vector_extract (S, [],[], A, [], []) ; - assert (isequal (x1.matrix, x2)) - end - - Sij = GB_mex_complex (S (I,J)) ; - - x1 = GB_mex_Matrix_extract (Sij, [],[], A, I0, J0, []) ; - x2 = GB_mex_complex (A (I,J)) ; - assert (isequal (x1.matrix, x2)) - - if (n == 1) - x1 = GB_mex_Vector_extract (Sij, [],[], A, I0, []) ; - assert (isequal (x1.matrix, x2)) - end - - Cij = GB_mex_complex (C (I,J)) ; - - x1 = GB_mex_Matrix_extract (Cij, [],'plus', A, I0, J0, []) ; - x2 = GB_mex_complex (Cij + A (I,J)) ; - assert (isequal (x1.matrix, x2)) - - if (n == 1) - x1 = GB_mex_Vector_extract (Cij, [],'plus', A, I0, []) ; - assert (isequal (x1.matrix, x2)) - end - - end - end -end -fprintf ('All complex extract C = A(I,J) tests passed\n') ; - -fprintf ('\ntestc3: all tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testc5.m b/GraphBLAS/Test/unused/testc5.m deleted file mode 100644 index 134db89735..0000000000 --- a/GraphBLAS/Test/unused/testc5.m +++ /dev/null @@ -1,32 +0,0 @@ -function testc5(use_builtin) -%TESTC5 test complex subref - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - seed = seed + 1 ; - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; - for trials = 1:10 - - J = randperm (n, 1+floor(n/2)) ; - I = randperm (m, 1+floor(m/2)) ; - J0 = uint64 (J-1) ; - I0 = uint64 (I-1) ; - - C1 = GB_mex_Matrix_subref (A, I0, J0) ; - C2 = GB_mex_complex (A (I,J)) ; - assert (isequal (C1, C2)) - end - end -end -fprintf ('testc5: all complex subref C = A(I,J) tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testc6.m b/GraphBLAS/Test/unused/testc6.m deleted file mode 100644 index 5c2cd0bc0e..0000000000 --- a/GraphBLAS/Test/unused/testc6.m +++ /dev/null @@ -1,99 +0,0 @@ -function testc6(use_builtin) -%TESTC6 test complex apply - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -rng 'default' - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -[complex_binary complex_unary] = GB_user_opsall ; - -dr = struct ('outp', 'replace') ; -dtr = struct ('outp', 'replace', 'inp0', 'tran') ; - -seed = 1 ; -for m = [1 5 10 50 100 ] - for n = [ 1 5 10 50 100 ] - - seed = seed + 1 ; - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; - D = GB_mex_random (n, m, 10*(m+n), 1, seed) ; - seed = seed + 1 ; - C = GB_mex_random (m, n, 10*(m+n), 1, seed) ; - seed = seed + 1 ; - B = GB_mex_random (m, n, 10*(m+n), 0, seed) ; - E = GB_mex_random (n, m, 10*(m+n), 0, seed) ; - a = pi + 1i ; - b = 42 ; - - % test unary ops with complex x,z - for k = 1:6 - op = complex_unary {k} ; - C1 = GB_mex_op (op, a, '',1) ; - [C2 tol] = GB_user_op (op, a) ; - GB_complex_compare (C1, C2, tol) ; - - C1 = GB_mex_apply (C, [], [], op, A, dr) ; - [i j x1] = find (C1.matrix) ; - x1 = complex (x1) ; - [i j s] = find (A) ; - x2 = GB_user_op (op, complex (s)) ; - x2 = complex (x2) ; - GB_complex_compare (x1, x2, tol) ; - end - - % test unary ops with complex x,z, array transposed - for k = 1:6 - op = complex_unary {k} ; - C1 = GB_mex_apply (C, [], [], op, D, dtr) ; - [i j x1] = find (C1.matrix) ; - x1 = complex (x1) ; - [i j s] = find (D.') ; - x2 = GB_user_op (op, complex (s)) ; - x2 = complex (x2) ; - GB_complex_compare (x1, x2, true) ; - end - - % test unary ops with complex x, real z - for k = 7:length(complex_unary) - op = complex_unary {k} ; - C1 = GB_mex_op (op, a, '',1) ; - [C2 tol] = GB_user_op (op, a) ; - GB_complex_compare (C1, C2, tol) ; - - C1 = GB_mex_apply (B, [], [], op, A, dr) ; - % [i j x1] = find (sparse (C1.matrix)) ; - [i j x1] = GB_mex_extractTuples (C1.matrix) ; - x1 = complex (x1) ; - % [i j s] = find (sparse (A)) ; - [i j s] = GB_mex_extractTuples (A) ; - x2 = GB_user_op (op, complex (s)) ; - x2 = complex (x2) ; - GB_complex_compare (x1, x2, tol) ; - end - - % test unary ops with complex x, real z, array transposed - for k = 8:length(complex_unary) - op = complex_unary {k} ; - C1 = GB_mex_apply (B, [], [], op, D, dtr) ; - % [i j x1] = find (C1.matrix) ; - [i j x1] = GB_mex_extractTuples (C1.matrix) ; - x1 = complex (x1) ; - % [i j s] = find (D.') ; - [i j s] = GB_mex_extractTuples (D.') ; - x2 = GB_user_op (op, complex (s)) ; - x2 = complex (x2) ; - GB_complex_compare (x1, x2, true) ; - end - - end -end - -fprintf ('testc6: all complex apply C=op(A) tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testc8.m b/GraphBLAS/Test/unused/testc8.m deleted file mode 100644 index b8ad89cb6f..0000000000 --- a/GraphBLAS/Test/unused/testc8.m +++ /dev/null @@ -1,49 +0,0 @@ -function testc8(use_builtin) -%TESTC8 test complex eWiseAdd and eWiseMult - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -fprintf ('testc8: test complex eWiseAdd and eWiseMult\n') ; - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -rng ('default') -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - - for trials = 1:100 - - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ; - B = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ; - S = GB_mex_complex (sparse (m,n)) ; - - C1 = GB_mex_complex (A + B) ; - C2 = GB_mex_Matrix_eWiseAdd (S, [], [], 'plus', A, B, []) ; - assert (isequal (C1, C2.matrix)) ; - - if (n == 1) - C2 = GB_mex_Vector_eWiseAdd (S, [], [], 'plus', A, B, []) ; - assert (isequal (C1, C2.matrix)) ; - end - - C1 = GB_mex_complex (A .* B) ; - C2 = GB_mex_Matrix_eWiseMult (S, [], [], 'times', A, B, []) ; - % drop explicit zeros from C2.matrix: - assert (isequal (C1, 1*C2.matrix)) ; - - if (n == 1) - C2 = GB_mex_Vector_eWiseMult (S, [], [], 'times', A, B, []) ; - assert (isequal (C1, 1*C2.matrix)) ; - end - end - end -end - -fprintf ('testc8: all complex eWise tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testc9.m b/GraphBLAS/Test/unused/testc9.m deleted file mode 100644 index 417e2e3a2d..0000000000 --- a/GraphBLAS/Test/unused/testc9.m +++ /dev/null @@ -1,36 +0,0 @@ -function testc9(use_builtin) -%TESTC9 test complex extractTuples - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - for trial = 1:100 - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ; - - [I J X ] = find (A) ; - X = complex (X) ; - - [I0 J0 X0] = GB_mex_extractTuples (A) ; - - I1 = double (I0+1) ; - J1 = double (J0+1) ; - - assert (isequal (I (:), I1 (:))) ; - assert (isequal (J (:), J1 (:))) ; - assert (isequal (X (:), X0 (:))) ; - - end - end -end - -fprintf ('testc9: all complex extractTuples tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testcb.m b/GraphBLAS/Test/unused/testcb.m deleted file mode 100644 index ac8db8d5fa..0000000000 --- a/GraphBLAS/Test/unused/testcb.m +++ /dev/null @@ -1,65 +0,0 @@ -function testcb(use_builtin) -%TESTCB test complex reduce - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -if (nargin < 1) - use_builtin = true ; -end -GB_builtin_complex_set (use_builtin) ; - -tol = 1e-13 ; -seed = 1 ; -for m = [1 5 10 100] - for n = [1 5 10 100] - for trial = 1:100 - - A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ; - s = complex (0) ; - - c1 = complex (full (sum (A (:)))) ; - c2 = GB_mex_reduce_to_scalar (s, [], 'plus', A) ; - assert (abs (c1 - c2) <= tol * abs (c1) + tol) ; - % assert (isequal (c1,c2)) - - [i j x] = find (A) ; - c1 = complex (prod (x)) ; - c2 = GB_mex_reduce_to_scalar (s, [], 'times', A) ; - assert (abs (c1 - c2) <= tol * abs (c1) + tol) ; - % assert (isequal (c1,c2)) - - s = complex (pi,2) ; - c1 = s * complex (full (sum (A (:)))) ; - c2 = GB_mex_reduce_to_scalar (s, 'times', 'plus', A) ; - assert (abs (c1 - c2) <= tol * abs (c1) + tol) ; - % assert (isequal (c1,c2)) - - s = complex (pi,2) ; - c1 = s + complex (full (sum (A (:)))) ; - c2 = GB_mex_reduce_to_scalar (s, 'plus', 'plus', A) ; - assert (abs (c1 - c2) <= tol * abs (c1) + tol) ; - % assert (isequal (c1,c2)) - - if (n > 1) - - w = GB_mex_complex (sparse (m, 1)) ; - c1 = sum (A.').' ; - c2 = GB_mex_reduce_to_vector (w, [], [], 'plus', A, []) ; - assert (norm (c1 - c2.matrix, 1) <= tol * norm (c1, 1) + tol) ; - % assert (isequal (c1,c2.matrix)) - - w = GB_mex_random (m, 1, 10, 1, seed) ; seed = seed + 1 ; - c1 = w + sum (A.').' ; - c2 = GB_mex_reduce_to_vector (w, [], 'plus', 'plus', A, []) ; - assert (norm (c1 - c2.matrix, 1) <= tol * norm (c1, 1) + tol) ; - % assert (isequal (c1,c2.matrix)) - - end - end - end -end - -fprintf ('testcb: all complex reduce tests passed\n') ; - -GB_builtin_complex_set (true) ; diff --git a/GraphBLAS/Test/unused/testcz.m b/GraphBLAS/Test/unused/testcz.m deleted file mode 100644 index 5f53015729..0000000000 --- a/GraphBLAS/Test/unused/testcz.m +++ /dev/null @@ -1,31 +0,0 @@ -threads {1} = [4 1] ; -t = threads ; - -% user-defined complex type -% logstat ('testc1(0)',t) ; % test ops -logstat ('testc2(0,0)',t) ; % A'*B, A+B, A*B -% logstat ('testc3(0)',t) ; % extract column, extract submatrix -logstat ('testc4(0)',t) ; % extractElement, setElement -% logstat ('testc5(0)',t) ; % subref -% logstat ('testc6(0)',t) ; % apply -logstat ('testc7(0)',t) ; % assign -% logstat ('testc8(0)',t) ; % eWise -% logstat ('testc9(0)',t) ; % extractTuples -% logstat ('testca(0)',t) ; % mxm, mxv, vxm -% logstat ('testcb(0)',t) ; % reduce -% logstat ('testcc(0)',t) ; % transpose - -% builtin complex type: GxB_FC64 -% logstat ('testc1(1)',t) ; % test ops -% logstat ('testc2(0,1)',t) ; % A'*B, A+B, A*B -% logstat ('testc3(1)',t) ; % extract column, extract submatrix -% logstat ('testc4(1)',t) ; % extractElement, setElement -% logstat ('testc5(1)',t) ; % subref -% logstat ('testc6(1)',t) ; % apply -logstat ('testc7(1)',t) ; % assign -% logstat ('testc8(1)',t) ; % eWise -% logstat ('testc9(1)',t) ; % extractTuples -% logstat ('testca(1)',t) ; % mxm, mxv, vxm -% logstat ('testcb(1)',t) ; % reduce -logstat ('testcc(1)',t) ; % transpose - diff --git a/GraphBLAS/Test/unused/testhack.m b/GraphBLAS/Test/unused/testhack.m deleted file mode 100644 index fc38efa838..0000000000 --- a/GraphBLAS/Test/unused/testhack.m +++ /dev/null @@ -1,334 +0,0 @@ -function testall (threads, mdebug) -%TESTALL run all GraphBLAS tests -% -% Usage: -% -% testall ; % runs just the shorter tests -% testall(threads) ; % run with specific list of threads and chunk sizes -% testall(threads,1) ; % runs with malloc debugging enabled -% -% threads is a cell array. Each entry is 2-by-1, with the first value being -% the # of threads to use and the 2nd being the chunk size. The default is -% {[4 1]} if threads is empty or not present. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -GrB.init ; -GB_mex_init ; -testall_time = tic ; - -if (nargin < 1) - threads = [ ] ; -end -if (isempty (threads)) - threads {1} = [4 1] ; -end -t = threads ; - -if (nargin < 2) - mdebug = false ; -end - -% single thread -s {1} = [1 1] ; - -% clear the statement coverage counts -%% clear global GraphBLAS_grbcov - -global GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... - GraphBLAS_scripts GraphBLAS_times - -% use built-in complex data types by default -GB_builtin_complex_set (true) ; - -% many of the tests use spok in SuiteSparse, a copy of which is -% included here in GraphBLAS/Test/spok. -addpath ('../Test/spok') ; -try - spok (sparse (1)) ; -catch - here = pwd ; - cd ../Test/spok ; - spok_install ; - cd (here) ; -end - -logstat ; % start the log.txt -hack = GB_mex_hack ; - -% JIT and factory controls - -% run once -j4 = {4} ; % JIT on -f1 = {1} ; % factory on -j0 = {0} ; % JIT off -f0 = {0} ; % factory off - -% run twice -j44 = {4,4} ; % JIT on, on -j04 = {0,4} ; % JIT off, on -j40 = {4,0} ; % JIT on, off -f10 = {1,0} ; % factory on, off -f00 = {0,0} ; % factory off, off -f11 = {1,1} ; % factory on, on -j42 = {4,2} ; % JIT on, pause - -% 3 runs -j440 = {4,4,0} ; % JIT on, on , off -j404 = {4,0,4} ; % JIT on, off, on -f100 = {1,0,0} ; % factory on, off, off -f110 = {1,1,0} ; % factory on, on , off - -% start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; - -% save the current malloc debug status -debug_save = stat ; - -%=============================================================================== -% quick tests (< 1 sec) -%=============================================================================== - -% < 1 second: debug_off -set_malloc_debug (mdebug, 0) -logstat ('test109' ,t, j404, f110) ; % terminal monoid with user-defined type -logstat ('test138' ,s, j4 , f1 ) ; % assign, coarse-only tasks in IxJ slice -logstat ('test139' ,s, j4 , f1 ) ; % merge sort, special cases -logstat ('test172' ,t, j4 , f1 ) ; % test eWiseMult with M bitmap/full -logstat ('test155' ,t, j4 , f1 ) ; % test GrB_*_setElement, removeElement -logstat ('test174' ,t, j4 , f1 ) ; % test GrB_assign C=A -logstat ('test203' ,t, j4 , f1 ) ; % test iso subref -logstat ('test213' ,t, j4 , f1 ) ; % test iso assign (method 05d) -logstat ('test216' ,t, j4 , f1 ) ; % test C=A, iso case -logstat ('test225' ,t, j4 , f1 ) ; % test mask operations (GB_masker) -logstat ('test226' ,t, j4 , f1 ) ; % test kron with iso matrices -logstat ('test235' ,t, j4 , f1 ) ; % test GxB_eWiseUnion and GrB_eWiseAdd -logstat ('test252' ,t, j4 , f1 ) ; % basic tests -logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests -logstat ('test255' ,t, j4 , f1 ) ; % flip binop -logstat ('test257' ,t, j4 , f0 ) ; % JIT error handling -logstat ('test260' ,t, j4 , f0 ) ; % demacrofy name -logstat ('test261' ,t, j4 , f0 ) ; % serialize/deserialize error handling -logstat ('test262' ,t, j0 , f1 ) ; % GB_mask -logstat ('test263' ,t, j4 , f0 ) ; % JIT tests -logstat ('test264' ,t, j4 , f0 ) ; % enumify / macrofy tests -logstat ('test265' ,t, j4 , f0 ) ; % reduce to scalar with user types -logstat ('test267' ,t, j4 , f0 ) ; % JIT error handling -logstat ('test269' ,t, j0 , f1 ) ; % get/set for type, scalar, vec, mtx -logstat ('test271' ,t, j0 , f1 ) ; % binary op get/set -logstat ('test272' ,t, j0 , f1 ) ; % misc simple tests -logstat ('test273' ,t, j0 , f1 ) ; % Global get/set -logstat ('test274' ,t, j0 , f1 ) ; % index unary op get/set -logstat ('test276' ,t, j0 , f1 ) ; % semiring get/set -logstat ('test277' ,t, j0 , f1 ) ; % context get/set -logstat ('test279' ,t, j0 , f1 ) ; % blob get/set -logstat ('test281' ,t, j4 , f1 ) ; % test user-defined idx unop, no JIT -logstat ('test268' ,t, j4 , f1 ) ; % C=Z sparse masker -logstat ('test247' ,t, j4 , f1 ) ; % GrB_mxm: fine Hash method -logstat ('test207' ,t, j4 , f1 ) ; % test iso subref -logstat ('test211' ,t, j4 , f1 ) ; % test iso assign -logstat ('test183' ,s, j4 , f1 ) ; % test eWiseMult with hypersparse mask -logstat ('test212' ,t, j44 , f10 ) ; % test iso mask all zero -logstat ('test219' ,s, j44 , f10 ) ; % test reduce to scalar (1 thread) - -% < 1 second: debug_on -set_malloc_debug (mdebug, 1) -logstat ('test09' ,t, j4 , f1 ) ; % duplicate I,J test of GB_mex_subassign -logstat ('test108' ,t, j40 , f10 ) ; % boolean monoids -logstat ('test137' ,s, j40 , f11 ) ; % GrB_eWiseMult, FIRST and SECOND -logstat ('test124' ,t, j4 , f1 ) ; % GrB_extract, case 6 -logstat ('test133' ,t, j4 , f1 ) ; % test mask operations (GB_masker) -logstat ('test176' ,t, j4 , f1 ) ; % test GrB_assign, method 09, 11 -logstat ('test197' ,t, j4 , f1 ) ; % test large sparse split -logstat ('test201' ,t, j4 , f1 ) ; % test iso reduce to vector and scalar -logstat ('test208' ,t, j4 , f1 ) ; % test iso apply, bind 1st and 2nd -logstat ('test214' ,t, j4 , f1 ) ; % test C=A'*B (tricount) -logstat ('test223' ,t, j4 , f1 ) ; % test matrix multiply, C=A*B -logstat ('test241' ,t, j4 , f1 ) ; % test GrB_mxm, trigger the swap_rule -logstat ('test270' ,t, j0 , f1 ) ; % unary op get/set -logstat ('test199' ,t, j4 , f1 ) ; % test dot2 with hypersparse -logstat ('test210' ,t, j4 , f1 ) ; % iso assign25: C=A -logstat ('test165' ,t, j4 , f1 ) ; % test C=A*B', A is diagonal, B bitmap -logstat ('test221' ,t, j4 , f1 ) ; % test C += A, C is bitmap and A is full -logstat ('test278' ,t, j0 , f1 ) ; % descriptor get/set -logstat ('test162' ,t, j4 , f1 ) ; % test C=A*B with very sparse M -logstat ('test275' ,t, j0 , f1 ) ; % monoid get/set -logstat ('test220' ,t, j4 , f1 ) ; % test mask C=Z, iso case -logstat ('test83' ,t, j4 , f1 ) ; % GrB_assign with C_replace and empty J -logstat ('test04' ,t, j4 , f1 ) ; % simple mask and transpose test -logstat ('test132' ,t, j4 , f1 ) ; % setElement -logstat ('test82' ,t, j4 , f1 ) ; % GrB_extract with index range (hyper) -logstat ('test202' ,t, j40 , f11 ) ; % test iso add and emult -logstat ('test222' ,t, j4 , f1 ) ; % test user selectop for iso matrices -logstat ('test204' ,t, j4 , f1 ) ; % test iso diag -logstat ('test258' ,t, j4 , f0 ) ; % reduce-to-vector for UDT -logstat ('test136' ,s, j4 , f1 ) ; % subassignment special cases -logstat ('test128' ,t, j4 , f1 ) ; % eWiseMult, eWiseAdd, eWiseUnion cases -logstat ('test144' ,t, j4 , f1 ) ; % cumsum - -%=============================================================================== -% 1 to 10 seconds -%=============================================================================== - -% 1 to 10 seconds: debug_off -set_malloc_debug (mdebug, 0) -logstat ('testc2(0,0)',t, j0 , f1 ) ; % A'*B, A+B, A*B, user-defined complex -logstat ('test239' ,t, j44 , f10 ) ; % test GxB_eWiseUnion -logstat ('test245' ,t, j40 , f11 ) ; % test complex row/col scale -logstat ('test159' ,t, j0 , f0 ) ; % test A*B -logstat ('test259' ,t, j4 , f0 ) ; % plus_plus_fp32 semiring -logstat ('testc4(0)' ,t, j4 , f1 ) ; % extractElement, setElement, user type -logstat ('test157' ,t, j4 , f1 ) ; % test sparsity formats -logstat ('test182' ,s, j4 , f1 ) ; % test for internal wait -logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced -logstat ('test173' ,t, j4 , f1 ) ; % test GrB_assign C=A -logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar -logstat ('test84' ,t, j4 , f1 ) ; % GrB_assign (row/col with C CSR/CSC) -logstat ('test215' ,t, j4 , f1 ) ; % test C=A'*B (dot2, ANY_PAIR) -logstat ('test80' ,t, j4 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test200' ,t, j4 , f1 ) ; % test iso full matrix multiply -logstat ('test283' ,t, j4 , f1 ) ; % test index binary op -logstat ('test254' ,t, j44 , f10 ) ; % mask types -logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators -logstat ('test142' ,t, j0 , f1 ) ; % test GrB_assign with accum -logstat ('test142b' ,t, j4 , f0 ) ; % test GrB_assign with accum -logstat ('test54' ,t, j4 , f1 ) ; % assign and extract with begin:inc:end -logstat ('testcc(1)' ,t, j4 , f1 ) ; % transpose, builtin complex -logstat ('testc2(1,1)',t, j44 , f10 ) ; % complex tests (quick case, builtin) -logstat ('test227' ,t, j4 , f1 ) ; % test kron -logstat ('test19b' ,s, j4 , f1 ) ; % GrB_assign, many pending operators -logstat ('test141' ,t, j0 , f1 ) ; % eWiseAdd with dense matrices -logstat ('test179' ,t, j44 , f10 ) ; % test bitmap select -logstat ('test232' ,t, j4 , f1 ) ; % test assign with GrB_Scalar - -% 1 to 10 seconds, no Werk, debug_off -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test256' ,t, j4 , f0 ) ; % JIT error handling -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -% 1 to 10 seconds: debug_on -set_malloc_debug (mdebug, 1) -logstat ('test130' ,t, j4 , f1 ) ; % GrB_apply, hypersparse cases -logstat ('test148' ,t, j4 , f1 ) ; % ewise with alias -logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp -logstat ('test129' ,t, j4 , f1 ) ; % test GxB_select (tril, nonz, hyper) -logstat ('test69' ,t, j4 , f1 ) ; % assign and subassign with alias -logstat ('test11' ,t, j4 , f1 ) ; % exhaustive test of GrB_extractTuples -logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies -logstat ('test282' ,t, j42 , f11 ) ; % test argmax, index binary op -logstat ('test249' ,t, j4 , f1 ) ; % GxB_Context object -logstat ('test196' ,t, j4 , f1 ) ; % test hypersparse concat -logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other tests -logstat ('test145' ,t, j42 , f11 ) ; % dot4 for C += A'*B -logstat ('test229' ,t, j40 , f11 ) ; % test setElement -logstat ('test209' ,t, j4 , f1 ) ; % test iso build -logstat ('test224' ,t, j4 , f1 ) ; % test unpack/pack - -% 1 to 10 seconds, no Werk, debug_on -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test150' ,t, j0 , f0 ) ; % mxm zombies, typecasting (dot3,saxpy) -logstat ('test240' ,t, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 -logstat ('test240' ,s, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 (1 task) -logstat ('test237' ,t, j40 , f10 ) ; % test GrB_mxm (saxpy4) -logstat ('test237' ,s, j40 , f10 ) ; % test GrB_mxm (saxpy4) (1 task) -logstat ('test184' ,t, j4 , f1 ) ; % special cases: mxm, transpose, build -logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%=============================================================================== -% 10 to 100 seconds -%=============================================================================== - -% 10 to 100 seconds: debug_off -set_malloc_debug (mdebug, 0) -logstat ('test18' ,t, j4 , f1 ) ; % GrB_eWiseAdd and eWiseMult -logstat ('testc7(0)' ,t, j4 , f1 ) ; % assign, builtin complex -logstat ('test193' ,t, j4 , f1 ) ; % test GxB_Matrix_diag -logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult -logstat ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build -logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator -logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract -logstat ('test242' ,t, j4 , f1 ) ; % test GxB_Iterator for matrices -logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement -logstat ('test246' ,t, j4 , f1 ) ; % GrB_mxm parallelism (slice_balanced) -logstat ('test206' ,t, j44 , f10 ) ; % test iso select -logstat ('test251' ,t, j4 , f1 ) ; % dot4, dot2, with plus_pair -logstat ('test251b' ,t, j4 , f0 ) ; % dot4, dot2, with plus_pair -logstat ('test152' ,t, j44 , f10 ) ; % test binops C=A+B, all matrices dense -logstat ('test160' ,s, j0 , f1 ) ; % test A*B, single threaded - -% 10 to 100 seconds, no Werk, debug_off -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test188b' ,t, j0 , f1 ) ; % test concat -logstat ('test186' ,t, j4 , f1 ) ; % saxpy, all formats (slice_balanced) -%ogstat ('test186' ,t, j40 , f11 ) ; % saxpy, all formats (slice_balanced) -%ogstat ('test186(0)' ,t, j4 , f1 ) ; % repeat with default slice_balanced -logstat ('test192' ,t, j4 , f1 ) ; % test C=scalar -logstat ('test187' ,t, j4 , f1 ) ; % test dup/assign for all formats -logstat ('test181' ,s, j4 , f1 ) ; % transpose with explicit zeros in mask -logstat ('test238' ,t, j44 , f10 ) ; % test GrB_mxm (dot4 and dot2) -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -% 10 to 100 seconds: debug_on -set_malloc_debug (mdebug, 1) -logstat ('test189' ,t, j4 , f1 ) ; % test large assign -logstat ('test169' ,t, j0 , f1 ) ; % C=A+B with many formats -logstat ('test76' ,s, j4 , f1 ) ; % GxB_resize (single threaded) -logstat ('test01' ,t, j4 , f1 ) ; % error handling -logstat ('test228' ,t, j4 , f1 ) ; % test serialize/deserialize -logstat ('test104' ,t, j4 , f1 ) ; % export/import -logstat ('test244' ,t, j4 , f1 ) ; % test GxB_Matrix_reshape* - -% 10 to 100 seconds, no Werk, debug_on -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) -logstat ('test188' ,t, j4 , f1 ) ; % test concat -logstat ('test151b' ,t, j4 , f1 ) ; % test bshift operator -logstat ('test191' ,t, j40 , f10 ) ; % test split -logstat ('test14' ,t, j4 , f1 ) ; % GrB_reduce -logstat ('test14b' ,t, j4 , f0 ) ; % GrB_reduce -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%=============================================================================== -% > 100 seconds -%=============================================================================== - -% > 100 seconds, debug_off -set_malloc_debug (mdebug, 0) -logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling -logstat ('test280' ,t, j4 , f1 ) ; % subassign method 26 -logstat ('test10' ,t, j4 , f1 ) ; % GrB_apply -logstat ('test75b' ,t, j4 , f1 ) ; % test GrB_mxm A'*B -logstat ('test81' ,t, j4 , f1 ) ; % extract with stride, range, backwards -logstat ('test230' ,t, j4 , f1 ) ; % test apply with idxunops -logstat ('test21b' ,t, j4 , f1 ) ; % quick test of GB_mex_assign -logstat ('test74' ,t, j0 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test234' ,t, j4 , f1 ) ; % test GxB_eWiseUnion -logstat ('test234b' ,t, j0 , f1 ) ; % test GxB_eWiseUnion - -% > 100 seconds, no Werk, debug_off -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test185' ,s, j4 , f1 ) ; % test dot4, saxpy for all sparsity -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -% > 100 seconds, debug_on -set_malloc_debug (mdebug, 1) -logstat ('testca(1)' ,t, j4 , f1 ) ; % test complex mxm, mxv, and vxm -logstat ('test194' ,t, j4 , f1 ) ; % test GxB_Vector_diag - -% > 100 seconds, no Werk, debug_on -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack -logstat ('test154' ,t, j4 , f1 ) ; % apply with binop and scalar binding -logstat ('test154b' ,t, j0 , f1 ) ; % apply with binop and scalar binding -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%=============================================================================== -% finalize -%=============================================================================== - -% restore the original malloc debug state -set_malloc_debug (mdebug, debug_save) -t = toc (testall_time) ; -fprintf ('\ntestall: all tests passed, total time %0.4g minutes\n', t / 60) ; - diff --git a/GraphBLAS/Test/unused/testlong.m b/GraphBLAS/Test/unused/testlong.m deleted file mode 100644 index 4e1f9b5b6b..0000000000 --- a/GraphBLAS/Test/unused/testlong.m +++ /dev/null @@ -1,228 +0,0 @@ -function testlong -%TESTLONG run long GraphBLAS tests - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -GB_mex_init ; - -testall_time = tic ; - -if (nargin < 2) - % run the shorter tests by default - longtests = 0 ; -end - -if (nargin < 1) - threads = [ ] ; -end -if (isempty (threads)) - threads {1} = [4 1] ; -end -t = threads ; - -% single thread -s {1} = [1 1] ; - -extra {1} = [4 1] ; -extra {2} = [1 1] ; - -% clear the statement coverage counts -clear global GraphBLAS_grbcov - -% use built-in complex data types by default -GB_builtin_complex_set (true) ; - -% many of the tests use spok in SuiteSparse, a copy of which is -% included here in GraphBLAS/Test/spok. -addpath ('../Test/spok') ; - -try - spok (sparse (1)) ; -catch - here = pwd ; - cd ../Test/spok ; - spok_install ; - cd (here) ; -end - -logstat ; % start the log.txt -hack = GB_mex_hack ; - -% start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; - -%=============================================================================== -% The following tests are not required for statement coverage. Some need -% other packages in SuiteSparse (CSparse, SSMULT, ssget). By default, these -% tests are not run. To install them, see test_other.m. Timing is with malloc -% debugging turned off. - -% ------------------------ % ---- % ------------------------------ -% test script % time % description -% ------------------------ % ---- % ------------------------------ - -logstat ('test03' ,t) ; % 0 % random matrix tests -logstat ('test03' ,s) ; % 0 % random matrix tests -logstat ('test05',t) ; % % quick setElement test, with typecasting -logstat ('test06(936)',t); % % performance test GrB_mxm on all semirings -logstat ('test07',t) ; % 0 % quick test GB_mex_subassign -logstat ('test07',s) ; % 0 % quick test GB_mex_subassign -logstat ('test07b',t) ; % % quick test GB_mex_assign -logstat ('test09b',t) ; % % duplicate I,J test of GB_mex_assign - -logstat ('test13',t) ; % % simple tests of GB_mex_transpose -logstat ('test15',t) ; % simple test of GB_mex_AxB -logstat ('test16' ,t) ; % 177 % user-defined complex operators - -logstat ('test20',t) ; % quick test of GB_mex_mxm on a few semirings -logstat ('test20(1)',t) ; % % test of GB_mex_mxm on all built-in semirings -logstat ('test21',s) ; % 41 % quick test of GB_mex_subassign -logstat ('test21(1)',t) ; % % exhaustive test of GB_mex_subassign -logstat ('test22',t) ; % % quick test of GB_mex_transpose -logstat ('test23(1)',t) ; % % exhaustive test of GB_*_build -logstat ('test24',t) ; % 42 % test of GrB_Matrix_reduce -logstat ('test24(1)',t) ; % % exhaustive test of GrB_Matrix_reduce -logstat ('test25',t) ; % % long test of GxB_select -logstat ('test26',t) ; % .6 % quick test of GxB_select -logstat ('test26(1)',t) ; % % performance test of GxB_select (use ssget) -logstat ('test27',t) ; % 13 % quick test of GxB_select (LoHi_band) -logstat ('test28',t) ; % 1 % mxm with aliased inputs, C = accum(C,C*C) - -logstat ('test30') ; % 11 % GB_mex_subassign, scalar expansion -logstat ('test30b') ; % 9 % performance GB_mex_assign, scalar expansion -logstat ('test31',t) ; % % simple tests of GB_mex_transpose -logstat ('test32',t) ; % % quick GB_mex_mxm test -logstat ('test33',t) ; % % create a semiring -logstat ('test34',t) ; % % quick GB_mex_Matrix_eWiseAdd test -logstat ('test35') ; % % performance test for GrB_extractTuples -logstat ('test36') ; % % performance test for GB_mex_Matrix_subref -logstat ('test38',t) ; % % GB_mex_transpose with matrix collection -logstat ('test39') ; % % GrB_transpose, GB_*_add and eWiseAdd -logstat ('test39(0)') ; % 55 % GrB_transpose, GB_*_add and eWiseAdd - -logstat ('test40',t) ; % % GrB_Matrix_extractElement, and Vector -logstat ('test41',t) ; % % test of GB_mex_AxB -logstat ('test42') ; % % performance tests for GB_mex_Matrix_build -logstat ('test43',t) ; % % performance tests for GB_mex_Matrix_subref -logstat ('test44',t) ; % 5 % test qsort -logstat ('test45(0)',t) ; % 334 % test GB_mex_setElement and build -logstat ('test46') ; % % performance test GB_mex_subassign -logstat ('test46b') ; % % performance test GB_mex_assign -logstat ('test47',t) ; % % performance test of GrB_vxm -logstat ('test48') ; % % performance test of GrB_mxm -logstat ('test49') ; % % performance test of GrB_mxm (dot, A'*B) - -logstat ('test50',t) ; % % test GB_mex_AxB on larger matrix -logstat ('test51') ; % % performance test GB_mex_subassign -logstat ('test51b') ; % % performance test GB_mex_assign, multiple ops -logstat ('test52',t) ; % % performance of A*B with tall mtx, AdotB, AxB -logstat ('test53',t) ; % % exhaustive test of GB_mex_Matrix_extract -logstat ('test55',t) ; % % GxB_subassign, dupl, built-in vs GraphBLAS -logstat ('test55b',t) ; % % GrB_assign, duplicates, built-in vs GrB -logstat ('test56',t) ; % % test GrB_*_build -logstat ('test57',t) ; % % test operator on large uint32 values -logstat ('test58(0)') ; % % longer GB_mex_Matrix_eWiseAdd performance -logstat ('test58') ; % % test GrB_eWiseAdd -logstat ('test59',t) ; % % test GrB_mxm - -logstat ('test60',t) ; % % test min and max operators with NaNs -logstat ('test61') ; % % performance test of GrB_eWiseMult -logstat ('test62',t) ; % % exhaustive test of GrB_apply -logstat ('test63',t) ; % % GB_mex_op and operator tests -logstat ('test64',t) ; % % GB_mex_subassign, scalar expansion -logstat ('test64b',t) ; % % GrB_*_assign, scalar expansion -logstat ('test65',t) ; % % test type casting -logstat ('test66',t) ; % % quick test for GrB_Matrix_reduce -logstat ('test67',t) ; % % quick test for GrB_apply -logstat ('test68',t) ; - -logstat ('test72' ,t) ; % 0 % several special cases -logstat ('test73',t) ; % % performance of C = A*B, with mask -logstat ('test75',t) ; % % test GrB_mxm A'*B on all semirings -logstat ('test77',t) ; % 450 % long tests of GrB_kronecker -logstat ('test78',t) ; % 1 % quick test of hypersparse subref -logstat ('test79',t) ; % % run all in SuiteSparse Collection - -logstat ('test85',t) ; % 0 % GrB_transpose (1-by-n with typecasting) -logstat ('test86',t) ; % % performance test of of GrB_Matrix_extract -logstat ('test87',t) ; % % performance test of GrB_mxm -logstat ('test88',t) ; % hypersparse matrices with hash-based method -logstat ('test89',t) ; % % performance test of complex A*B - -logstat ('test90',t) ; % 1 % test user-defined semirings -logstat ('test91',t) ; % % test subref performance on dense vectors -logstat ('test92' ,t) ; % .1 % GB_subref: symbolic case -logstat ('test95',t) ; % % performance test for GrB_transpose -logstat ('test96',t) ; % 16 % A*B using dot product -logstat ('test97',t) ; % 0 % GB_mex_assign, scalar expansion and zombies -logstat ('test98',t) ; % % GB_mex_mxm, typecast on the fly -logstat ('test99',t) ; % 20 % GB_mex_transpose w/ explicit 0s in the Mask - -logstat ('test101',t) ; % 1 % import and export -logstat ('test102',t); % 1 % GB_AxB_saxpy3_flopcount -logstat ('test103',t) ; % % GrB_transpose aliases -logstat ('test105',t) ; % 2 % eWiseAdd for hypersparse -logstat ('test106',t) ; % 4 % GxB_subassign with alias -logstat ('test107',t) ; % 2 % monoids with terminal values - -logstat ('test110',t) ; % 0 % binary search of M(:,j) in accum/mask -logstat ('test111',t) ; % % performance test for eWiseAdd -logstat ('test112',t) ; % % test row/col scale -logstat ('test113',t) ; % % performance tests for GrB_kron -logstat ('test114',t) ; % % performance of reduce-to-scalar -logstat ('test115',t) ; % 10 % GrB_assign with duplicate indices -logstat ('test116',t) ; % % performance tests for GrB_assign -logstat ('test117',t) ; % % performance tests for GrB_assign -logstat ('test118',t) ; % % performance tests for GrB_assign -logstat ('test119',t) ; % % performance tests for GrB_assign - -logstat ('test120',t) ; % % performance tests for GrB_assign -logstat ('test121',t) ; % % performance tests for GrB_assign -logstat ('test122',t) ; % % performance tests for GrB_assign -logstat ('test126',t) ; % 7 % GrB_reduce to vector; very sparse matrix - -logstat ('test131',t) ; % .1 % GrB_Matrix_clear -logstat ('test134',t) ; % 105 % quick test of GxB_select - -logstat ('test143',t) ; % 37 % mxm, special cases -logstat ('test146',t) ; % .1 % expand scalar -logstat ('test147',t) ; % C=A*B with very sparse M -logstat ('test149',t) ; % test fine hash tasks for C=A*B - -logstat ('test158',t) ; % 10 % test colscale and rowscale - -logstat ('test161',t) ; % % test A*B*E -logstat ('test163',t) ; % .6 % test C=A'*B where C and M are sparse -logstat ('test164',t) ; % 0 % test dot method -logstat ('test166',t) ; % .1 % test GxB_select with a dense matrix -logstat ('test167',t) ; % .2 % test C=A*B with very sparse M, different types -logstat ('test168',t) ; % test C=A+B with C and B full, A bitmap -logstat ('test169',t) ; % 0 % test C=A+B with C sparse, M hyper, A and B sparse - -logstat ('test171',t) ; % 1 % test conversion and GB_memset -logstat ('test175',t) ; % 8 % test142 updated -logstat ('test177',t) ; % 1.2 % test C=A*B, C and B bitmap, M and A sparse - -logstat ('test180',t) ; % 16 % test assign and subassign (multi threaded) - -logstat ('test190',t) ; % .3 % test dense matrix for C=A*B -logstat ('test198',t) ; % .1 % test apply with C=op(C) - -logstat ('test205',t) ; % 0 % test iso kron -logstat ('test217',t) ; % 0 % test C(I,J)=A, bitmap assign -logstat ('test218',t) ; % 0 % test C=A+B, C and A are full, B is bitmap - -logstat ('testc1',t) ; % % test complex operators -logstat ('testc2',t) ; % % test complex A*B, A'*B, A*B', A'*B', A+B -logstat ('testc3',t) ; % % test complex GrB_extract -logstat ('testc4',t) ; % % test complex extractElement and setElement -logstat ('testc5',t) ; % % test complex subref -logstat ('testc6',t) ; % % test complex apply -logstat ('testc7',t) ; % % test complex assign -logstat ('testc8',t) ; % % test complex eWiseAdd and eWiseMult -logstat ('testc9',t) ; % % test complex extractTuples -logstat ('testca',t) ; % % test complex mxm, mxv, and vxm -logstat ('testcb',t) ; % % test complex reduce -logstat ('testcc',t) ; % % test complex transpose - diff --git a/GraphBLAS/Test/unused/testperf.m b/GraphBLAS/Test/unused/testperf.m deleted file mode 100644 index 25a165d467..0000000000 --- a/GraphBLAS/Test/unused/testperf.m +++ /dev/null @@ -1,56 +0,0 @@ -function testperf -%TESTPERF run all performance tests - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -t = tic ; -fprintf ('\ntestperf: run all performance tests\n') ; - -test_other ; % install required packages - -debug_off - -test26(1) ; % performance test for GxB_select -test36 ; % performance test of matrix subref -test30 ; % performance test GB_mex_subassign, scalar expansion -test30b ; % performance test GB_mex_assign, scalar expansionb -test35 ; % performance test for GrB_extractTuples -test39 ; % performance test for GrB_transpose -test42 ; % performance tests for GB_mex_Matrix_build -test43 ; % performance tests for GB_mex_Matrix_subref -test46 ; % performance test GB_mex_subassign -test48 ; % performance test of GrB_mxm -test46b ; % performance test GB_mex_assign -test49 ; % performance test of GrB_mxm (dot product method, A'*B) -test51 ; % performance test GB_mex_subassign, multiple ops -test58(0) % longer GB_mex_Matrix_eWiseAdd performance test -test61 ; % performance test of GrB_eMult -test68 ; % performance tests for eWiseMult -f = [936 2662] ; -test73 ; % performance of C = A*B, with mask -test86 ; % performance of GrB_Matrix_extract -test52 ; % performance of A*B with tall matrices, AdotB, AxB - -test51b ; % performance of GrB_assign, multiply operations -test87 ; % performance test of GrB_mxm -test89 ; % performance test of complex A*B -test91 ; % test subref performance on dense vectors -test95 ; % performance test for GrB_transpose - -test111 ; % performance test for eWiseAdd -test113 ; % performance tests for GrB_kron -test114 ; % performance of reduce-to-scalar -test116 ; % performance tests C(I,J)=A and C=A(I,J) -test117 ; % performance tests C(:,:) += A -test118 ; % performance tests C(:,:) = A -test119 ; % performance tests C(I,J) += scalar -test120 ; % performance tests C(I,J) += scalar -test121 ; % performance tests C(I,J)+=A -test122 ; % performance tests C(I,J) += A - -% perfoance test of GrB_mxm on all semirings (just auto method) -test06(936, [ ], 1, 0) ; - -fprintf ('\ntestperf: all tests passed. Total te %g\n', toc (t)) ; - diff --git a/GraphBLAS/Test/unused/testsort.m b/GraphBLAS/Test/unused/testsort.m deleted file mode 100644 index a78cde3cf1..0000000000 --- a/GraphBLAS/Test/unused/testsort.m +++ /dev/null @@ -1,10 +0,0 @@ -%TESTSORT test qsort and msort - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make - - test43 - test44 - diff --git a/GraphBLAS/Test/unused/tt.m b/GraphBLAS/Test/unused/tt.m deleted file mode 100644 index 246bf7ff8f..0000000000 --- a/GraphBLAS/Test/unused/tt.m +++ /dev/null @@ -1,35 +0,0 @@ -%TT test eWiseMult and A+B - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -tic ; -C = A + B ; -t = toc ; -fprintf ('built-in C=A+B time: %g\n\n', t) ; - -for k = 1:40 - nthreads_set (k) ; - tic ; - C2 = GB_mex_AplusB (A,B,'plus') ; - ts (k) = toc ; - fprintf ('threads %d time %10.4f speedup %10.2f\n', k, ts(k), ts(1)/ts(k)) ; -end - -tic ; -C = A .* B ; -t = toc ; -fprintf ('built-in C=A.*B time: %g\n\n', t) ; - -[m n] = size (A) ; -Z = sparse (m,n) ; - -for k = 1:40 - nthreads_set (k) ; - tic ; - C2 = GB_mex_Matrix_eWiseMult (Z, [ ], [ ], 'times', A,B) ; - ts (k) = toc ; - fprintf ('threads %d time %10.4f speedup %10.2f\n', k, ts(k), ts(1)/ts(k)) ; -end - -err = norm (C - C2.matrix, 1) diff --git a/GraphBLAS/Test/unused/ttest.m b/GraphBLAS/Test/unused/ttest.m deleted file mode 100644 index 4796103a56..0000000000 --- a/GraphBLAS/Test/unused/ttest.m +++ /dev/null @@ -1,31 +0,0 @@ -% test GrB_extractTuples - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -for nth = [2 1] - nthreads_set (nth) ; - - debug_on - grbinfo - - test11 - test16 - test35 - test40 - testc9 - - debug_off - grbinfo - - test11 - test16 - test35 - test40 - testc9 - -end diff --git a/GraphBLAS/Test/unused/xtest.m b/GraphBLAS/Test/unused/xtest.m deleted file mode 100644 index 4f3469bde3..0000000000 --- a/GraphBLAS/Test/unused/xtest.m +++ /dev/null @@ -1,31 +0,0 @@ -% test GrB_extract - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -clear all ; make -addpath ('~/ssget') ; -addpath ('spok') ; - -for nth = [2 1] - nthreads_set (nth) ; - - debug_on - grbinfo - testc3 - testc4 - test53 - test81 - test82 - test86 - - debug_off - grbinfo - testc3 - testc4 - test53 - test81 - test82 - test86 - -end diff --git a/GraphBLAS/Test/unused/ztest.m b/GraphBLAS/Test/unused/ztest.m deleted file mode 100644 index 307494a73b..0000000000 --- a/GraphBLAS/Test/unused/ztest.m +++ /dev/null @@ -1,13 +0,0 @@ -% test zombie deletion - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -nthreads_set(1) -grbinfo -test29 -test97 - -nthreads_set(2) -test29 -test97 diff --git a/GraphBLAS/cmake_modules/GraphBLASReport.cmake b/GraphBLAS/cmake_modules/GraphBLASReport.cmake index 7f82380921..70ec9765cd 100644 --- a/GraphBLAS/cmake_modules/GraphBLASReport.cmake +++ b/GraphBLAS/cmake_modules/GraphBLASReport.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/GraphBLASReport.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2012-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2012-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake b/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake index 0ae9693a6b..efcccfc8a3 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS_JIT_configure.cmake: configure the JIT #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake b/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake index ddb88ad52e..f03ddeca34 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS_JIT_paths.cmake: configure the JIT paths #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/GraphBLAS_PreJIT.cmake b/GraphBLAS/cmake_modules/GraphBLAS_PreJIT.cmake index 388a908a16..71be1d5c5f 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_PreJIT.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_PreJIT.cmake @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS_PreJIT.cmake: configure the PreJIT #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/GraphBLAS_compiler_options.cmake b/GraphBLAS/cmake_modules/GraphBLAS_compiler_options.cmake index af5634683c..591d764a83 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_compiler_options.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_compiler_options.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/GraphBLAS_compiler_options.cmake #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- @@ -16,8 +16,7 @@ if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) # cmake 2.8 workaround: gcc needs to be told to do C11. # cmake 3.0 doesn't have this problem. set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef " ) -# uncomment this to check for all warnings: -# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-strict-aliasing " ) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-aliasing " ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -lm -Wno-pragmas " ) # operations may be carried out in higher precision set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexcess-precision=fast " ) @@ -27,8 +26,9 @@ if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno " ) # integer operations wrap set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fwrapv " ) - # check all warnings (uncomment for development only) -# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic " ) + # check all warnings (uncomment for development only): +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Werror" ) +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic" ) if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9 ) message ( FATAL_ERROR "gcc version must be at least 4.9" ) endif ( ) @@ -54,9 +54,16 @@ elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "IntelLLVM" ) elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) # options for clang set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-sign " ) + # check all warnings (uncomment for development only): +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall " ) if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 3.3 ) message ( FATAL_ERROR "clang version must be at least 3.3" ) endif ( ) +elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang" ) + # options for Apple Clang +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" ) +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address" ) +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread" ) elseif ( MSVC ) # options for MicroSoft Visual Studio set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2 -wd\"4244\" -wd\"4146\" -wd\"4018\" -wd\"4996\" -wd\"4047\" -wd\"4554\"" ) diff --git a/GraphBLAS/cmake_modules/GraphBLAS_complex.cmake b/GraphBLAS/cmake_modules/GraphBLAS_complex.cmake index 0678e7928e..ecc0e8de97 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_complex.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_complex.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/GraphBLAS_complex.cmake #------------------------------------------------------------------------------- -# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2024, All Rights Reserved. +# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2024-2025, All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- @@ -15,11 +15,12 @@ include ( CheckSourceCompiles ) check_source_compiles ( C "#include - int main(void) { - double _Complex z1 = 1.0; - double _Complex z2 = 1.0 * I; - double _Complex z3 = z1 * z2; - return 0; + int main (void) + { + double _Complex z1 = 1.0 ; + double _Complex z2 = 1.0 * I ; + double _Complex z3 = z1 * z2 ; + return ((int) creal (z3)) ; }" GxB_HAVE_COMPLEX_C99 ) @@ -28,15 +29,16 @@ if ( NOT GxB_HAVE_COMPLEX_C99 ) check_source_compiles ( C "#include - int main(void) { - _Dcomplex z1 = {1., 0.}; - _Dcomplex z2 = {0., 1.}; - _Dcomplex z3 = _Cmulcc(z1, z2); - return 0; + int main (void) + { + _Dcomplex z1 = {1., 0.} ; + _Dcomplex z2 = {0., 1.} ; + _Dcomplex z3 = _Cmulcc(z1, z2) ; + return 0 ; }" GxB_HAVE_COMPLEX_MSVC ) endif ( ) if ( NOT GxB_HAVE_COMPLEX_C99 AND NOT GxB_HAVE_COMPLEX_MSVC ) - message ( FATAL_ERROR "Complex floating point numbers are not supported by the used compiler." ) + message ( FATAL_ERROR "The selected C compiler does not support complex floating point numbers; try another compiler." ) endif ( ) diff --git a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake index 4b33afb23e..fef294ccb9 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake @@ -8,10 +8,10 @@ #------------------------------------------------------------------------------- # version of SuiteSparse:GraphBLAS -set ( GraphBLAS_DATE "Feb 20, 2025" ) -set ( GraphBLAS_VERSION_MAJOR 9 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_MINOR 4 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_SUB 5 CACHE STRING "" FORCE ) +set ( GraphBLAS_DATE "Mar 3, 2025" ) +set ( GraphBLAS_VERSION_MAJOR 10 CACHE STRING "" FORCE ) +set ( GraphBLAS_VERSION_MINOR 0 CACHE STRING "" FORCE ) +set ( GraphBLAS_VERSION_SUB 0 CACHE STRING "" FORCE ) # GraphBLAS C API Specification version, at graphblas.org set ( GraphBLAS_API_DATE "Dec 22, 2023" ) diff --git a/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake b/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake index ddee335a93..3fa94ecf3f 100644 --- a/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/SuiteSparseAtomic.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2017-2024, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2017-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake index 26f22bb605..4900924d55 100644 --- a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake @@ -2,7 +2,7 @@ # SuiteSparse/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2022-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -111,10 +111,10 @@ endif ( ) # readability (such as "/* do nothing */ ;" in SuiteSparse_config.c). Disable # the clang warning for these statements: if ( CMAKE_C_COMPILER_ID STREQUAL "Clang" ) - set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-extra-semi-stmt" ) + set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-extra-semi" ) endif ( ) if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) - set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-extra-semi-stmt" ) + set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-extra-semi" ) endif ( ) if ( WIN32 ) diff --git a/GraphBLAS/cmake_modules/SuiteSparse__thread.cmake b/GraphBLAS/cmake_modules/SuiteSparse__thread.cmake index 1c52185b7a..361bfb95e2 100644 --- a/GraphBLAS/cmake_modules/SuiteSparse__thread.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparse__thread.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/SuiteSparse__thread.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2017-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2017-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #------------------------------------------------------------------------------- diff --git a/GraphBLAS/rmm_wrap/rmm_wrap.cpp b/GraphBLAS/rmm_wrap/rmm_wrap.cpp index 9d358d5a91..db38264a14 100644 --- a/GraphBLAS/rmm_wrap/rmm_wrap.cpp +++ b/GraphBLAS/rmm_wrap/rmm_wrap.cpp @@ -330,11 +330,17 @@ int rmm_wrap_initialize_all_same devices.clear(); const char* cuda_visible_devices = std::getenv("CUDA_VISIBLE_DEVICES"); + if (cuda_visible_devices != nullptr) + { + std::cout << "CUDA_VISIBLE_DEVICES = " << cuda_visible_devices + << std::endl; + } /** * Start with "CUDA_VISIBLE_DEVICES" var if it's defined. */ if(cuda_visible_devices != nullptr) { + std::cout << "getting cuda visible devices" << std::endl; std::stringstream check1; check1 << cuda_visible_devices; std::string intermediate; @@ -343,7 +349,7 @@ int rmm_wrap_initialize_all_same intermediate.erase(std::remove_if(intermediate.begin(), intermediate.end(), ::isspace), intermediate.end()); uint32_t device_id = static_cast(stoi(intermediate)); - // std::cout << "Found device_id " << device_id << std::endl; + std::cout << "Found device_id " << device_id << std::endl; devices.push_back(device_id); } /** @@ -351,11 +357,18 @@ int rmm_wrap_initialize_all_same * default to device 0. */ } else { - devices.push_back(0); - // std::cout << "Using default device_id 0" << std::endl; + int ngpus = 0 ; + cudaGetDeviceCount (&ngpus) ; + std::cout << "Using all devices: " << ngpus << std::endl; + for (int i = 0 ; i < ngpus ; i++) + { + devices.push_back(i); + } } // Allocate rmm_wrap_contexts +// printf ("\ndevices.size %ld\n", devices.size()) ; + std::cout << "devices.size is " << devices.size() << std::endl ; rmm_wrap_context = (RMM_Wrap_Handle**)malloc(devices.size() * sizeof(RMM_Wrap_Handle*)); for(int i = 0; i < devices.size(); ++i) { rmm_wrap_context[i] = NULL; diff --git a/GraphBLAS/xxHash/xxhash.h b/GraphBLAS/xxHash/xxhash.h index 78340db86b..f89bbcefea 100644 --- a/GraphBLAS/xxHash/xxhash.h +++ b/GraphBLAS/xxHash/xxhash.h @@ -4038,7 +4038,7 @@ XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input, * By forcing seed64 into a register, we disrupt the cost model and * cause it to scalarize. See `XXH32_round()` * - * FIXME: Clang's output is still _much_ faster -- On an AMD Ryzen 3600, + * fixme: Clang's output is still _much_ faster -- On an AMD Ryzen 3600, * XXH3_64bits @ len=240 runs at 4.6 GB/s with Clang 9, but 3.3 GB/s on * GCC 9.2, despite both emitting scalar code. * diff --git a/GraphBLAS/zstd/zstd_subset/common/xxhash.h b/GraphBLAS/zstd/zstd_subset/common/xxhash.h index b8b73290bb..f7fa1a9a6e 100644 --- a/GraphBLAS/zstd/zstd_subset/common/xxhash.h +++ b/GraphBLAS/zstd/zstd_subset/common/xxhash.h @@ -3567,7 +3567,7 @@ XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input, * By forcing seed64 into a register, we disrupt the cost model and * cause it to scalarize. See `XXH32_round()` * - * FIXME: Clang's output is still _much_ faster -- On an AMD Ryzen 3600, + * fixme: Clang's output is still _much_ faster -- On an AMD Ryzen 3600, * XXH3_64bits @ len=240 runs at 4.6 GB/s with Clang 9, but 3.3 GB/s on * GCC 9.2, despite both emitting scalar code. * diff --git a/README.md b/README.md index a5ddb0fa87..023246b33f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SuiteSparse: A Suite of Sparse matrix packages at http://suitesparse.com ----------------------------------------------------------------------------- -Feb 20, 2025, SuiteSparse VERSION 7.9.0 +Mar 3, 2025, SuiteSparse VERSION 7.10.0 SuiteSparse is a set of sparse-matrix-related packages written or co-authored by Tim Davis, available at https://github.com/DrTimothyAldenDavis/SuiteSparse . diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index 4119db7c55..2c83cc042a 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/SuiteSparse_config/CMakeLists.txt: cmake for SuiteSparse_config #------------------------------------------------------------------------------- -# SuiteSparse_config, Copyright (c) 2012-2024, Timothy A. Davis. +# SuiteSparse_config, Copyright (c) 2012-2025, Timothy A. Davis. # All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause @@ -15,9 +15,9 @@ cmake_minimum_required ( VERSION 3.22 ) # version of both SuiteSparse and SuiteSparse_config -set ( SUITESPARSE_DATE "Feb 20, 2025" ) +set ( SUITESPARSE_DATE "Mar 3, 2025" ) set ( SUITESPARSE_VERSION_MAJOR 7 ) -set ( SUITESPARSE_VERSION_MINOR 9 ) +set ( SUITESPARSE_VERSION_MINOR 10 ) set ( SUITESPARSE_VERSION_SUB 0 ) set ( SUITESPARSE_CONFIG_VERSION_MAJOR ${SUITESPARSE_VERSION_MAJOR} CACHE STRING "" FORCE ) set ( SUITESPARSE_CONFIG_VERSION_MINOR ${SUITESPARSE_VERSION_MINOR} CACHE STRING "" FORCE ) diff --git a/SuiteSparse_config/SuiteSparse_config.h b/SuiteSparse_config/SuiteSparse_config.h index 83684a6037..2b4e79aa3f 100644 --- a/SuiteSparse_config/SuiteSparse_config.h +++ b/SuiteSparse_config/SuiteSparse_config.h @@ -434,19 +434,19 @@ int SuiteSparse_version // returns SUITESPARSE_VERSION #define SUITESPARSE_HAS_VERSION_FUNCTION -#define SUITESPARSE_DATE "Feb 20, 2025" +#define SUITESPARSE_DATE "Mar 3, 2025" #define SUITESPARSE_MAIN_VERSION 7 -#define SUITESPARSE_SUB_VERSION 9 +#define SUITESPARSE_SUB_VERSION 10 #define SUITESPARSE_SUBSUB_VERSION 0 // version format x.y #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) -#define SUITESPARSE_VERSION SUITESPARSE_VER_CODE(7, 9) +#define SUITESPARSE_VERSION SUITESPARSE_VER_CODE(7, 10) // version format x.y.z #define SUITESPARSE__VERCODE(main,sub,patch) \ (((main)*1000ULL + (sub))*1000ULL + (patch)) -#define SUITESPARSE__VERSION SUITESPARSE__VERCODE(7,9,0) +#define SUITESPARSE__VERSION SUITESPARSE__VERCODE(7,10,0) //============================================================================== // SuiteSparse interface to the BLAS and LAPACK libraries diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index 26f22bb605..4900924d55 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -2,7 +2,7 @@ # SuiteSparse/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2022-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause #------------------------------------------------------------------------------- @@ -111,10 +111,10 @@ endif ( ) # readability (such as "/* do nothing */ ;" in SuiteSparse_config.c). Disable # the clang warning for these statements: if ( CMAKE_C_COMPILER_ID STREQUAL "Clang" ) - set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-extra-semi-stmt" ) + set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-extra-semi" ) endif ( ) if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) - set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-extra-semi-stmt" ) + set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-extra-semi" ) endif ( ) if ( WIN32 ) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparse__thread.cmake b/SuiteSparse_config/cmake_modules/SuiteSparse__thread.cmake index 1c52185b7a..361bfb95e2 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparse__thread.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparse__thread.cmake @@ -2,7 +2,7 @@ # GraphBLAS/cmake_modules/SuiteSparse__thread.cmake #------------------------------------------------------------------------------- -# Copyright (c) 2017-2023, Timothy A. Davis. All Rights Reserved. +# Copyright (c) 2017-2025, Timothy A. Davis. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #-------------------------------------------------------------------------------